mirror of
https://github.com/a2-4am/passport.git
synced 2024-11-13 09:07:10 +00:00
simplify universal RWTS (remove unnecessary D5-plus-timing-bit address prologue, init Y=F7 in B944)
This commit is contained in:
parent
cca5364823
commit
677244978a
@ -293,10 +293,6 @@ PrereadT00Partial
|
||||
lda #$00
|
||||
sta gTrack
|
||||
sta gAddress
|
||||
lda #$F0
|
||||
sta $B959
|
||||
lda #$05
|
||||
sta $B95A
|
||||
- jsr ReadSector
|
||||
bcs .exit
|
||||
dec gAddress+1
|
||||
|
@ -15,19 +15,6 @@ TraceDOS33
|
||||
sta gTrack
|
||||
lda #$09
|
||||
sta gSector
|
||||
;
|
||||
; This pre-check is made more difficult by the fact that
|
||||
; some disks have a timing bit after the $D5 nibble in
|
||||
; the address prologue, which triggers the wrong code path
|
||||
; in our built-in RWTS. So just for this pre-check, we
|
||||
; disable that code path. This hack will get overwritten
|
||||
; either by the disk's own RWTS when we capture it, or by
|
||||
; re-copying the built-in RWTS later.
|
||||
;
|
||||
lda #$F0
|
||||
sta $B959
|
||||
lda #$05
|
||||
sta $B95A
|
||||
precheck
|
||||
ldy #<gRWTSParams
|
||||
lda #>gRWTSParams
|
||||
|
@ -276,41 +276,10 @@ Action
|
||||
sta TEXTTOP
|
||||
lda #s_reading
|
||||
jsr PrintByID
|
||||
;
|
||||
; For the initial T00,S00 check, we need to wait much longer
|
||||
; than usual to find the address prologue, because sector 0
|
||||
; might literally be the only standard sector on the track.
|
||||
; This will get overridden as soon as we either trace the
|
||||
; disk's RWTS or copy the universal RWTS again. (One of these
|
||||
; is guaranteed to happen before we read the rest of the disk.)
|
||||
;
|
||||
lda #$E7
|
||||
sta $B945
|
||||
ldy #<gRWTSParams ; call universal RWTS to see
|
||||
lda #>gRWTSParams ; if T00,S00 is readable
|
||||
jsr $BD00 ; (only care about the return code)
|
||||
bcs .fatalt00s00
|
||||
jmp .checkt00s00
|
||||
.fatalt00s00
|
||||
lda #$F0
|
||||
sta $B959
|
||||
lda #$05
|
||||
sta $B95A
|
||||
ldy #<gRWTSParams
|
||||
lda #>gRWTSParams
|
||||
jsr $BD00
|
||||
bcs .reallyfatal
|
||||
;
|
||||
; Bad emulator detected (disk controller presents nibbles
|
||||
; immediately instead of based on cycle count). Patch the
|
||||
; universal RWTS to compensate.
|
||||
;
|
||||
lda #$F0
|
||||
sta _B959
|
||||
lda #$05
|
||||
sta _B95A
|
||||
bne .checkt00s00 ; unconditional branch
|
||||
.reallyfatal
|
||||
jsr $BD00 ; (only care about the return code)
|
||||
bcc .checkt00s00
|
||||
lda #s_fail
|
||||
jsr PrintByID
|
||||
lda #s_fatal0000
|
||||
|
@ -68,20 +68,18 @@ universalrwts
|
||||
!byte $10,$fb,$d9,$00,$ba,$d0,$13,$18
|
||||
!byte $60,$00,$00,$00,$00,$00,$00,$00
|
||||
!byte $00,$00,$00,$00,$00,$00,$00,$00
|
||||
!byte $00,$00,$38,$60,$a0,$fc,$84,$26
|
||||
!byte $00,$00,$38,$60,$a0,$f7,$84,$26
|
||||
!byte $c8,$d0,$04,$e6,$26,$f0,$f3,$bd
|
||||
!byte $8c,$c0,$10,$fb,$4a,$c9,$6a,$d0
|
||||
!byte $ef
|
||||
_B959 !byte $bd
|
||||
_B95A !byte $8c,$c0,$c9,$d5,$f0,$36
|
||||
!byte $ef,$f0,$05,$00,$00,$00,$00,$00
|
||||
!byte $bd,$8c,$c0,$10,$fb,$c9,$aa,$d0
|
||||
!byte $df,$bd,$8c,$c0,$10,$fb,$c9,$96
|
||||
!byte $d0,$d6,$a0,$03,$a9,$00,$85,$27
|
||||
!byte $bd,$8c,$c0,$10,$fb,$2a,$85,$26
|
||||
!byte $bd,$8c,$c0,$10,$fb,$25,$26,$99
|
||||
!byte $2c,$00,$45,$27,$88,$10,$e7,$a8
|
||||
!byte $d0,$00,$18,$60,$38,$60,$8D,$9B
|
||||
!byte $B9,$F0,$D7,$00,$00,$00,$18,$60
|
||||
!byte $d0,$00,$18,$60,$38,$60,$00,$00
|
||||
!byte $00,$00,$00,$00,$00,$00,$18,$60
|
||||
!byte $86,$2b,$85,$2a,$cd,$78,$04,$f0
|
||||
!byte $53,$a9,$00,$85,$26,$ad,$78,$04
|
||||
!byte $85,$27,$38,$e5,$2a,$f0,$33,$b0
|
||||
|
Loading…
Reference in New Issue
Block a user