Code Monkey home page Code Monkey logo

Comments (6)

iflan avatar iflan commented on June 12, 2024 1

To finish this off, I looked at a few professionally produced disks which I have imaged, including Ultima V and Chessmaster 2000, as well as personal disks that I'm pretty sure I formatted myself. All of the disks had the full DE AA EB epilog for both the address and data fields everywhere I looked. I did not do an exhaustive survey, but I tried to look at multiple sectors on several tracks for each disk.

Personally, I'm surprised that they all had the complete, intact epilog. But I guess that's good. :-)

from apple2js.

whscullin avatar whscullin commented on June 12, 2024

This is very interesting. I feel like this may have come up when @iflan was writing tests for the various nibble routines. I will have to dig in some more.

from apple2js.

iflan avatar iflan commented on June 12, 2024

Don't know how I missed this thread. :-)

@Bischoff, I do remember reading that passage in chapter 3 of Beneath Apple DOS:

Lastly follows the epilogue, which contains the three bytes $DE, $AA, and $EB. Oddly, the $EB is always written during initialization but is never verified when an Address Field is read.

And I just checked Beneath Apple ProDOS, chapter 3, which says:

Lastly follows the epilogue, which contains the three bytes $DE, $AA, and $EB. The $EB is only partly written during initialization, and is therefore never verified when an Address Field is read.

In Understanding the Apple IIe, on p. 9-27, Slater writes:

An interesting point about DOS formats is the DE AA EB series that follows every address field and data field. Apple has always had trouble writing the EB. In RWTS 3.2, they cut off the EB at the end of the data field by neglecting to wait 32 cycles before switching READ/WRITE to READ after storing EB in the data register. They changed that in RWTS 3.3, so the EB is actually written at the end of the data field. However, RWTS 3.3 and the FILER formatting routine both cut off the EB at the end of the address field. Those cut-off EBs are not really written, and no attempt to verify their presence is made in RWTS or DIIDD processing.

I think this explains what's on blank.nib. Essentially, it's a blank, formatted disk that was written by RWTS 3.3. Any partial write of a byte would be discarded, leaving the five $FFs.

I'd very much like to see what happens with real floppies using both DOS 3.3 and ProDOS as well as factory-formatted floppies. I recently received an AppleSauce controller, so I should be able to see exactly what's happening. (This is going to take a few weeks, though, because I need to find a Mac to use the software.)

My proposal is this: If factory-formatted floppies contain the DE AA EB epilog for the address field, then I think it's reasonable to emit those bytes after the address field for .dsk files. Otherwise, we should do as @Bischoff says and omit the EB for the address field. If, eventually, we always use WOZ as the internal format, we can even emulate whatever portion of the EB actually makes it to the disk before it gets cut off.

from apple2js.

Bischoff avatar Bischoff commented on June 12, 2024

Thanks guys for diving into this.

@iflan's proposal at emission time makes sense to me.

But I would also recomment to make the EB optional at reading time. If I am not wrong in interpreting the source code, it is currently expected when reading the disk.

from apple2js.

iflan avatar iflan commented on June 12, 2024

@Bischoff, two of the three places that you identified above are only for "exploding" a .dsk sector into the .nib format that's used internally. The readSector method (disk2.ts, line 389) completely ignores the entire epilog for the address fieldโ€”it doesn't even check the DE AA bytes. And, in any case, readSector is only used for exporting the disk state (DiskII.getBinary (used in the save dialog) and DiskII.rwts (unused)).

Therefore, I think that the emulator will be have correctly. If you think that's wrong, please let me know.

from apple2js.

Bischoff avatar Bischoff commented on June 12, 2024

Therefore, I think that the emulator will behave correctly. If you think that's wrong, please let me know.

You probably know the source code better than I do. If it does not impact reading, then fine ๐Ÿ˜ธ , let's concentrate on the writing part.

from apple2js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.