[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A Question of AppleII DiskII Controller
Hilary Cheng <hilarycheng@yahoo.com> wrote:
> I have written a AppleII Emulator for Palm. I would like to enhance
> the speed of emulation. I found that most of Games/Programs use lots
> of time to un-nibblized the data from Disk. Is there any reference of
> DiskII Controller ? I would like to know is that some routines is
> already built in the boot rom or for every games/programs, they needs
> to implements un-nibblized rountine ?
The Disk II controller firmware does contain code which denibbilizes a
sector (used during the boot process), and some games do use this code,
but not in the usual manner of calling a subroutine. The boot code is
written to load track 0, sector 0 into memory starting at $0800, then
jump to location $0801. This doesn't lend itself well to reading
arbitrary sectors.
A common method is to take a copy of the relevant portion of the
firmware in the $C600-$C6FF area (copying it to a convenient location in
RAM) and patch the copy so that it can be used as a subroutine.
This is unlikely to help with an emulator, unless you do something to
recognise the specific pattern of the denibbilizing code and implement
it in native code instead.
There are also games which have their own implementation of similar
code, and this technique is unlikely to help with them. Other games
rely on the standard drivers provided by DOS 3.3 or ProDOS (or a patched
version of them).
Any copy-protected game is likely to have a completely different routine
for reading the disk, but I don't know whether that is an issue for an
emulator.
--
David Empson
dempson@actrix.gen.nz