shave some bytes

This commit is contained in:
4am 2021-06-19 00:21:14 -04:00
parent 270f437c6f
commit 5b02464c14
4 changed files with 49 additions and 52 deletions

View File

@ -183,6 +183,42 @@ Cancel
!byte s_canceled
bvc .TheEnd ; always branches
;-------------------------------
; PreCheckT00
;
; Before we trace through the drive firmware (which --
; at least on some machines -- will loop forever looking
; for each sector), we do a pre-check to ensure that all
; the sectors we're about to trace are actually readable.
;
; Before calling this function, you need to set all 16
; bytes of the precheck_sectors array (see above for format).
;
; If all required sectors are readable by Passport's own
; sector read routine, this exits gracefully with all
; flags and registered clobbered.
;
; If any required sector fails to read, this exits via
; FatalError, which does not return.
;-------------------------------
PreCheckT00
ldy #$00
sty gTrack
- lda precheck_sectors, y
bmi +
sta gSector
jsr IgnoreAddressChecksum
tya
pha
jsr ReadSector
pla
tay
bcs FatalError
+ iny
cpy #$10
bne -
rts
FatalError
jsr PrintByID
!byte s_fail
@ -200,3 +236,15 @@ FatalError
jsr PrintByID
!byte s_fatal220f
.TheEnd jmp TheEnd
precheck_sectors
; This list is (re)initialized in IDBootloader,
; then potentially altered in IDDOS33 and elsewhere.
; Values are logical sector numbers.
; There are always 16 (0x10) values in this list.
; Negative values are ignored.
; Positive values are treated as logical
; sector numbers and read from track $00.
; Sectors are read in the order listed here.
!byte $09,$08,$07,$06,$05,$04,$03,$02,$01
!byte $00,$FF,$FE,$FD,$FC,$FB,$FA,$F9,$F8

View File

@ -1,50 +0,0 @@
precheck_sectors
; This list is (re)initialized in IDBootloader,
; then potentially altered in IDDOS33 and elsewhere.
; Values are logical sector numbers.
; There are always 16 (0x10) values in this list.
; Negative values are ignored.
; Positive values are treated as logical
; sector numbers and read from track $00.
; Sectors are read in the order listed here.
!byte $09,$08,$07,$06,$05,$04,$03,$02,$01
!byte $00,$FF,$FE,$FD,$FC,$FB,$FA,$F9,$F8
;-------------------------------
; PreCheckT00
;
; Before we trace through the drive firmware (which --
; at least on some machines -- will loop forever looking
; for each sector), we do a pre-check to ensure that all
; the sectors we're about to trace are actually readable.
;
; Before calling this function, you need to set all 16
; bytes of the precheck_sectors array (see above for format).
;
; If all required sectors are readable by Passport's own
; sector read routine, this exits gracefully with all
; flags and registered clobbered.
;
; If any required sector fails to read, this exits via
; FatalError, which does not return.
;-------------------------------
PreCheckT00
ldy #$00
sty gTrack
@precheck_loop
lda precheck_sectors, y
bmi +
sta gSector
jsr IgnoreAddressChecksum
tya
pha
jsr ReadSector
pla
tay
bcc +
jmp FatalError
+
iny
cpy #$10
bne @precheck_loop
rts

View File

@ -46,7 +46,6 @@ Relocatable
NonRelocatable
!source "apidefs.a"
!source "strings/en.a"
!source "id/precheck.a"
!source "id/trace.a"
!source "id/trace33.a"
!source "id/trace32.a"

View File

@ -341,7 +341,7 @@ StringTableHigh
.passport
!text "Passport ",$00
.header
!text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2021-06-18",$00
!text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2021-06-19",$00
.bar9
!text "_________",$00
.bar18