In article <
8JCdnaJpPP5JtknC...@giganews.com>,
Kent Dickey <
ke...@provalid.com> wrote:
>It's only been 16 years since the last release, but I was thinking I should
>release my current version of KEGS in anticipation of Nox Archaist coming
>out tomorrow.
>
>KEGS is an Apple IIgs emulator for Mac OS X and Linux. There's an older
>version for Win32, but I'm not updating that now. Most Apple II/II+/IIe/IIc
>games and applications work as well.
>
>KEGS v1.03 is available at:
http://kegs.sourceforge.net
>
>And as usual, full source code is included.
KEGS by default has a problem with the 5.25" disk images of Nox Archaist.
The fix is to turn off "Fast Disk emulation" by pressing Shift-F7 anytime
after starting KEGS, but before you make any selections at the game's main
menu.
------------------------------------------------------------------------
The details: KEGS's fast disk emulation was to avoid having KEGS slow
down to access the 5.25" disk--it could run at full speed and still access
the disk. In this mode, KEGS ignores the disk cycle timing and just reads the
"next" byte off of the disk whenever software gets around to reading it.
And for writing, it similarly just writes bytes to the disk image ignoring
cycle timing.
Each sector on a 5.25" disk consists of sync bytes (at least 5 bytes of 0xff
written each 40usec, instead of the usual 32usec), then the sector header D5
AA 96. Then there's the sector information: 2 bytes for volume, 2 bytes for
track, 2 bytes for physical sector number, then 2 bytes for checksum. Then DE
AA EB, then 5-6 sync bytes written at 40usec timing, then the data starts with
D5 AA AD, then the data.
DOS3.3/ProDOS/etc, read all of the header data, including the checksum,
and may read the DE byte as well. So then, when they get around to doing the
write, KEGS in fast disk emulation mode just begins writing at the disk
byte right after the last one read by software, regardless of how much "time"
passes.
Nox Archaist works differently. It doesn't read the header checksum when
writing a sector. It reads the volume, track, and sector number, then does a
small delay loop $24 times, then begins writing the 0xff sync bytes and the
sector data. This will wait a total of 186 clocks, which is 5.8 disk nibbles,
and then begin writing the sync bytes, D5 AA AD and then sector data.
So the checksum, and DE AA EB will have passed by. But not with fast disk
emulation in KEGS. Instead, KEGS with fast disk emulation enabled would
overwrite the checksum bytes with the new sync bytes, and so corrupt the
sector header.
And KEGS 1.03 defaults to fast disk emulation on. I've changed that so it's
now disabled by default, and this will be the default in KEGS from now on.
It would be better if Nox Archaist checked the header checksum before
writing the sector data. Real floppy disks do go bad, and extra checking
is a good idea.
Kent