|Author:||Lord Crass (guest: search)|
|Date:||Mon, Mar 07th, 2011 @ 19:52 ( . )|
Whoops, I botched the LDA $1c00/BPL analysis of the byte counting routine. It's not counting header bytes, it's counting sync at the start of each header (assuming there's no short sync marks in the middle of the data, which my dump lacks), starting with the 2nd header block.
I still have to analyze the track skip routine, but other than that the only density change I see in the protection routine is at $025c, where it switches density to %10 before it reads track 18. I can't recall if this is standard density for V-Max on that track. Of course, this doesn't rule out the possibility that some of the data was written at a density that differs from the rest of the track, under the assumption that it's supposed to be read back incorrectly. I don't believe I can verify this without checking this on a real c64/1541 with original disk.
Would counting the same sync marks multiple times on a real 1541 result in a different count? Just wondering why they read it twice? I'm guessing it might also be the reason they average the values from 8 sector headers; to compensate for drives that have inconsistent speeds.
Also, why would mnib have an issue with reading the sync lengths incorrectly? Or is it an issue with the emulator not reading them right from the image?
.8:076a 20 2C 07 JSR $072C ; Search for header block
.8:076d 90 06 BCC $0775 ; branch if we found the requested header
.8:076f A9 02 LDA #$02
.8:0771 A4 18 LDY $18 ; track number
.8:0773 38 SEC
.8:0774 60 RTS
.8:0775 A0 00 LDY #$00
.8:0777 84 0E STY $0E ; variable. sync count total
.8:0779 A9 20 LDA #$20
.8:077b 85 2D STA $2D ; variable. Max number of retries.
.8:077d A2 00 LDX #$00 ; initialize sync count to 0
.8:077f 20 8B 02 JSR $028B ; Find next end-of-sync
.8:0782 B0 EB BCS $076F ; Branch if not found in time
.8:0784 AD 00 1C LDA $1C00
.8:0787 10 FB BPL $0784 ; branch if reading data byte (loop until sync found)
.8:0789 AD 00 1C LDA $1C00 ; sync-count loop
.8:078c 10 0A BPL $0798 ; branch out of loop if data byte.
.8:078e E8 INX ; increase sync counter
.8:078f D0 F8 BNE $0789 ; check again as long as we haven't read too many syncs
.8:0791 C6 2D DEC $2D ; sync counter overflowed past $ff. Decrease $2d counter (starts at $20)
.8:0793 D0 EA BNE $077F ; repeat until $2d is 0.
.8:0795 38 SEC
.8:0796 B0 D7 BCS $076F ; if we had to repeat the above section >$20 times, fail out.
.8:0798 8A TXA ; transfer the sync count to acc
.8:0799 18 CLC ; clear carry
.8:079a 65 0E ADC $0E
.8:079c 85 0E STA $0E ; keep a running byte count whenever theres <$ff syncs in a header
.8:079e C8 INY
.8:079f C0 08 CPY #$08
.8:07a1 D0 DA BNE $077D ; repeat to get 8 values
.8:07a3 4A LSR A
.8:07a4 4A LSR A
.8:07a5 4A LSR A ; divide result by 8 to get average header sync length
.8:07a6 A4 18 LDY $18 ; place track number back in Y
.8:07a8 18 CLC
.8:07a9 60 RTS
--* V-Max secondary checks
3/07/2011 @ 20:51--Pete Rittwage
3/08/2011 @ 02:19----Lord Crass
--- 0 Users Online --- 0 Recent Unique Posters