[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Toy Shop for Apple II available and a long story
Hey Vlad,
Track 0 is in a normal 16-sector format. Here's some more from my
notes:
Protected tracks will be T1-4, T1C-22. All the rest are normalized.
If you want to see the second stage boot code that reads in the 18-
sector track, boot the master a disk and enter the debugger at the
first hgr title screen and at look at $6803. This is called after the
address marker is read (D5 9D XX XX XX AA).
A5 marks the start of data
The loop runs for 256 iterations (via y) and reads 4 bytes from the
drive per iteration.
The disk bytes are 6+2 encoded, and the first byte holds the "2" bits,
and the next 3 bytes are the 3 "6" bytes.
These 4 disk bytes are translated to 3 data bytes (translate table is
at $6e00) and stored in memory.
D4 marks the end of data
This will yield 3 pages of data in memory per call, and is called 6
times in a track read for a total of 18-sectors of data per track.
There's a table set up at $6e43 that holds the memory pages in which
to store the data as it reads it from the disk and is translated.
This is always set up with 18 pages. In the read routine, $26, $28,
$2A are used to indirectly store the translated and decrypted byte
($26),Y for instance.
The 18-sector dos is used with a JSR to $69E7 followed immediately
with a command.
Commands are:
00 = turn on drive motor
01 = turn off drive motor
02 = seek to track followed by 00 XX (XX is track number(
03|43 = read track and store contiguous (18 pages) followed by XX
(start page in memory to store data)
04|44 = read track and store non-contiguous (18 pages) followed by 18
values of memory pages to store data to
At $6b41 the program makes it's first call to the dos, which is:
JSR $69E7 followed by 02 00 01 (seek to track 1)
JSR $69E7 followed by 43 20 (read, store starting at page $20 -- HGR1
screen)
After this point, track 1 is read, translated, and stored at $2000-
$31FF
Later in the application, the dos is relocated and called in a
different place. I think it's in the $4300 range. This dos is
sufficient to read in protected tracks on all disks, so that's where I
stopped.
I hope that helps!