mirror of
https://github.com/mi57730/a2d.git
synced 2024-11-25 10:30:50 +00:00
cmp16 refactors
This commit is contained in:
parent
10c2c6099a
commit
c2b7c6810b
@ -289,17 +289,11 @@ L0B31: pha
|
||||
|
||||
L0B46: .byte 0
|
||||
L0B47: .byte 0
|
||||
lda $D20D
|
||||
cmp #$28
|
||||
lda $D20E
|
||||
sbc #$00
|
||||
cmp16 $D20D, #$0028
|
||||
bpl L0B57
|
||||
return #$FF
|
||||
|
||||
L0B57: lda $D20D
|
||||
cmp #$68
|
||||
lda $D20E
|
||||
sbc #$01
|
||||
L0B57: cmp16 $D20D, #$0168
|
||||
bcc L0B66
|
||||
return #$FF
|
||||
|
||||
@ -323,16 +317,10 @@ L0B79: sta $D210
|
||||
|
||||
L0B98: lda #$02
|
||||
sta L0C1F
|
||||
lda $D20D
|
||||
cmp #$18
|
||||
lda $D20E
|
||||
sbc #$01
|
||||
cmp16 $D20D, #$0118
|
||||
bcs L0BBB
|
||||
dec L0C1F
|
||||
lda $D20D
|
||||
cmp #$A0
|
||||
lda $D20E
|
||||
sbc #$00
|
||||
cmp16 $D20D, #$00A0
|
||||
bcs L0BBB
|
||||
dec L0C1F
|
||||
L0BBB: lda L0C1F
|
||||
|
@ -713,15 +713,9 @@ L96EF: lda $D20D
|
||||
bpl L9716
|
||||
return #$FF
|
||||
|
||||
L9716: lda $D20D
|
||||
cmp #$6E
|
||||
lda $D20E
|
||||
sbc #$00
|
||||
L9716: cmp16 $D20D, #$006E
|
||||
bmi L9736
|
||||
lda $D20D
|
||||
cmp #$DC
|
||||
lda $D20E
|
||||
sbc #$00
|
||||
cmp16 $D20D, #$00DC
|
||||
bmi L9732
|
||||
lda #$02
|
||||
bne L9738
|
||||
|
@ -2136,10 +2136,7 @@ L6718: rts
|
||||
|
||||
L6719: jsr L6E45
|
||||
stax $06
|
||||
lda $D20D
|
||||
cmp $06
|
||||
lda $D20E
|
||||
sbc $07
|
||||
cmp16 $D20D, $06
|
||||
bcs L672F
|
||||
jmp L67C4
|
||||
|
||||
@ -2155,10 +2152,7 @@ L672F: jsr L6E45
|
||||
sta $08
|
||||
L6751: MGTK_RELAY_CALL MGTK::TextWidth, $06
|
||||
add16 $09, L684D, $09
|
||||
lda $09
|
||||
cmp $D20D
|
||||
lda $0A
|
||||
sbc $D20E
|
||||
cmp16 $09, $D20D
|
||||
bcc L6783
|
||||
dec $08
|
||||
lda $08
|
||||
@ -2205,10 +2199,7 @@ L67C4: copy16 #$D402, $06
|
||||
sta $08
|
||||
L67D1: MGTK_RELAY_CALL MGTK::TextWidth, $06
|
||||
add16 $09, $DAA6, $09
|
||||
lda $09
|
||||
cmp $D20D
|
||||
lda $0A
|
||||
sbc $D20E
|
||||
cmp16 $09, $D20D
|
||||
bcc L6800
|
||||
dec $08
|
||||
lda $08
|
||||
@ -2273,10 +2264,7 @@ L688F: rts
|
||||
|
||||
L6890: jsr L6E72
|
||||
stax $06
|
||||
lda $D20D
|
||||
cmp $06
|
||||
lda $D20E
|
||||
sbc $07
|
||||
cmp16 $D20D, $06
|
||||
bcs L68A6
|
||||
jmp L693B
|
||||
|
||||
@ -2292,10 +2280,7 @@ L68A6: jsr L6E72
|
||||
sta $08
|
||||
L68C8: MGTK_RELAY_CALL MGTK::TextWidth, $06
|
||||
add16 $09, L69C4, $09
|
||||
lda $09
|
||||
cmp $D20D
|
||||
lda $0A
|
||||
sbc $D20E
|
||||
cmp16 $09, $D20D
|
||||
bcc L68FA
|
||||
dec $08
|
||||
lda $08
|
||||
@ -2342,10 +2327,7 @@ L693B: copy16 #$D443, $06
|
||||
sta $08
|
||||
L6948: MGTK_RELAY_CALL MGTK::TextWidth, $06
|
||||
add16 $09, $DAB2, $09
|
||||
lda $09
|
||||
cmp $D20D
|
||||
lda $0A
|
||||
sbc $D20E
|
||||
cmp16 $09, $D20D
|
||||
bcc L6977
|
||||
dec $08
|
||||
lda $08
|
||||
|
@ -180,6 +180,23 @@ $text =~ s/
|
||||
(hex(substr($3,1)) + 1 == hex(substr($6,1)))
|
||||
? "sub16 $1, $2, $3" : $&/egx;
|
||||
|
||||
$text =~ s/
|
||||
\b lda \s+ ([L\$][0-9A-F]{2,4}) \n
|
||||
\s+ cmp \s+ ([L\$][0-9A-F]{2,4}) \n
|
||||
\s+ lda \s+ ([L\$][0-9A-F]{2,4}) \n
|
||||
\s+ sbc \s+ ([L\$][0-9A-F]{2,4}) \b
|
||||
/(hex(substr($1,1)) + 1 == hex(substr($3,1))) &&
|
||||
(hex(substr($2,1)) + 1 == hex(substr($4,1)))
|
||||
? "cmp16 $1, $2" : $&/egx;
|
||||
|
||||
$text =~ s/
|
||||
\b lda \s+ ([L\$][0-9A-F]{2,4}) \n
|
||||
\s+ cmp \s+ \#\$([0-9A-F]{2}) \n
|
||||
\s+ lda \s+ ([L\$][0-9A-F]{2,4}) \n
|
||||
\s+ sbc \s+ \#\$([0-9A-F]{2}) \b
|
||||
/(hex(substr($1,1)) + 1 == hex(substr($3,1)))
|
||||
? "cmp16 $1, #\$$4$2" : $&/egx;
|
||||
|
||||
$text =~ s/
|
||||
\b inc \s+ ([L\$][0-9A-F]{2,4}) \n
|
||||
\s+ bne \s+ (\w+) \n
|
||||
|
Loading…
Reference in New Issue
Block a user