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