shave some bytes

This commit is contained in:
4am 2021-06-13 13:08:28 -04:00
parent 8edd3da266
commit d8c9f21877

View File

@ -4,17 +4,15 @@
; that indicate structural copy protection ; that indicate structural copy protection
; but don't require any patches ; but don't require any patches
;------------------------------- ;-------------------------------
_rwtslog_start
!zone {
;-------------------------------
; RWTS "LSR $6A" identification
; disk allows either $D4 or $D5 for the
; first address prologue nibble
;-------------------------------
bit gMode ; nothing to do here in verify mode bit gMode ; nothing to do here in verify mode
bmi + bmi @lsr6a_start
jmp .exit jmp _rwtslog_end
- ;
; Some purely local utility functions here (out of execution path)
; to reduce duplicated code
;
@compare_lsr6a
ldy #$0A ldy #$0A
jsr compare jsr compare
!byte $BD,$8C,$C0 !byte $BD,$8C,$C0
@ -23,26 +21,44 @@
!byte WILDCARD,$6A !byte WILDCARD,$6A
!byte $D0,$EF !byte $D0,$EF
rts rts
+
@compare_bne0
ldy #$09
jsr compare
!byte $BD,$8C,$C0
!byte $10,$FB
!byte $C9,WILDCARD
!byte $D0,$00
rts
;-------------------------------
; RWTS "LSR $6A" identification
; disk allows either $D4 or $D5 for the
; first address prologue nibble
;-------------------------------
@lsr6a_start
; DOS 3.3 variant ; DOS 3.3 variant
lda #$03 lda #$03 ; if T00,S03,$4F ==
ldx #$4F ; T00,S03,$4F ldx #$4F
jsr - jsr @compare_lsr6a
bcc .yeslsr ; passport-test-suite/The Seasons.woz [C=0] matches bcc @print_lsr6a ; passport-test-suite/The Seasons.woz [C=0] matches
; RDOS variant ; RDOS variant
ldx #$4D ; T00,S03,$4D ldx #$4D ; or T00,S03,$4D ==
jsr - jsr @compare_lsr6a
bcc .yeslsr ; passport-test-suite/Roadwar 2000.woz [C=0] matches bcc @print_lsr6a ; passport-test-suite/Roadwar 2000.woz [C=0] matches
; Pascal variant ; Pascal variant
lda #$0D lda #$0D
ldx #$05 ; T00,S0D,$05 ldx #$05 ; oro T00,S0D,$05 ==
jsr - jsr @compare_lsr6a
bcs .endlsr ; passport-test-suite/GATO v1.3.woz [C=0] matches bcs @lsr6a_end ; passport-test-suite/GATO v1.3.woz [C=0] matches
.yeslsr
@print_lsr6a
jsr PrintByID jsr PrintByID
!byte s_lsr6a !byte s_lsr6a
inc gPatchCount inc gPatchCount
.endlsr @lsr6a_end
;------------------------------- ;-------------------------------
; RWTS "CMP #$08 / BCS" identification ; RWTS "CMP #$08 / BCS" identification
@ -66,7 +82,8 @@
!byte $EA !byte $EA
!byte $18 !byte $18
!byte $60 !byte $60
bcc .yesbcs ; passport-test-suite/The Seasons.woz [C=0] matches bcc @print_bcs08 ; passport-test-suite/The Seasons.woz [C=0] matches
; RDOS variant ; RDOS variant
ldx #$89 ldx #$89
ldy #$11 ldy #$11
@ -80,12 +97,13 @@
!byte $BD,$8C,$C0 !byte $BD,$8C,$C0
!byte $C9,$80 !byte $C9,$80
!byte $B0 !byte $B0
bcs .endbcs ; passport-test-suite/Roadwar 2000.woz [C=0] matches bcs @bcs08_end ; passport-test-suite/Roadwar 2000.woz [C=0] matches
.yesbcs
@print_bcs08
jsr PrintByID jsr PrintByID
!byte s_bcs08 !byte s_bcs08
inc gPatchCount inc gPatchCount
.endbcs @bcs08_end
;------------------------------- ;-------------------------------
; RWTS "CMP / BNE 0" identification ; RWTS "CMP / BNE 0" identification
@ -93,28 +111,21 @@
; for the first address epilogue nibble ; for the first address epilogue nibble
;------------------------------- ;-------------------------------
; DOS 3.3 variant ; DOS 3.3 variant
lda #$03 lda #$03 ; if T00,S03,$8B ==
ldx #$8B ldx #$8B
ldy #$09 jsr @compare_bne0
jsr compare ; if T00,S03,$8B == bcc @print_bne0 ; passport-test-suite/The Home Accountant.woz [C=0] matches
!byte $BD,$8C,$C0
!byte $10,$FB
!byte $C9,WILDCARD
!byte $D0,$00
bcc .yesbne0 ; passport-test-suite/The Home Accountant.woz [C=0] matches
; David-DOS variant ; David-DOS variant
lda #$05 lda #$05 ; or T00,S05,$8B ==
jsr compare ; or T00,S05,$8B == jsr @compare_bne0
!byte $BD,$8C,$C0 bcs @bne0_end ; passport-test-suite/Horses.woz [C=0] matches
!byte $10,$FB
!byte $C9,WILDCARD @print_bne0
!byte $D0,$00
bcs .endbne0 ; passport-test-suite/Horses.woz [C=0] matches
.yesbne0
jsr PrintByID jsr PrintByID
!byte s_cmpbne0 !byte s_cmpbne0
inc gPatchCount inc gPatchCount
.endbne0 @bne0_end
;------------------------------- ;-------------------------------
; RWTS "CMP / NOP NOP" identification ; RWTS "CMP / NOP NOP" identification
@ -129,10 +140,9 @@
!byte $10,$FB !byte $10,$FB
!byte $C9,$AA !byte $C9,$AA
!byte $EA,$EA !byte $EA,$EA
bcs .endnopnop ; passport-test-suite/La Guillotine.woz [C=0] matches bcs _rwtslog_end ; passport-test-suite/La Guillotine.woz [C=0] matches
jsr PrintByID jsr PrintByID
!byte s_cmpnopnop !byte s_cmpnopnop
inc gPatchCount inc gPatchCount
.endnopnop
.exit _rwtslog_end
}