1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-01-24 05:33:50 +00:00

minor size optimisation

This commit is contained in:
Peter Ferrie 2016-08-03 16:19:08 -07:00
parent e94e05c3fa
commit d8c08bcecf

View File

@ -263,53 +263,49 @@ asm _dgrSetPix
BCS +
end
asm _dgrSetEvnEvn
SEC
!byte $90 ; mask CLC
asm _dgrSetOddEvn
CLC
; EVEN PIXEL
LDA $2000,X
AND #$0F
- JSR $0100 ; LDA AUX (DST),Y
STA TMP
JSR $0100 ; LDA AUX (DST),Y
AND #$F0
LDA #$FF
ADC #$00
EOR #$F0 ; #$F0 if even, #$0F if odd
PHA
AND TMP
STA TMP
PLA
EOR #$FF ; #$0F if even, #$F0 if odd
AND $2000,X
ORA TMP
STA $C005 ; WRITE AUX MEM
STA (GBASE),Y
STA $C004 ; WRITE MAIN MEM
RTS
end
asm _dgrSetEvnOdd
; ODD PIXEL
+ LDA $1000,X
AND #$0F
STA TMP
LDA (GBASE),Y
AND #$F0
ORA TMP
STA (GBASE),Y
RTS
; ODD ROW
++ LSR
TAY
BCS +++
end
asm _dgrSetOddEvn
; EVEN PIXEL
LDA $2000,X
AND #$F0
STA TMP
JSR $0100 ; LDA AUX (DST),Y
AND #$0F
ORA TMP
STA $C005 ; WRITE AUX MEM
STA (GBASE),Y
STA $C004 ; WRITE MAIN MEM
RTS
end
BCC -
asm _dgrSetOddOdd
CLC
!byte $B0 ; mask SEC
asm _dgrSetEvnOdd
SEC
; ODD PIXEL
+++ LDA $1000,X
AND #$F0
+ LDA #$FF
ADC #$00
EOR #$0F ; #$F0 if odd, #$0F if even
PHA
AND $1000,X
STA TMP
LDA (GBASE),Y
AND #$0F
PLA
EOR #$FF ; #$0F if odd, #$F0 if even
AND (GBASE),Y
ORA TMP
STA (GBASE),Y
RTS