a bit smaller way

This commit is contained in:
Peter Ferrie 2020-03-07 22:28:07 -08:00
parent 81fd961a94
commit 3d816934af

View File

@ -403,61 +403,29 @@ HGRByteToDHGRBytes
; $01 = corresponding DHGR byte in auxmem ; $01 = corresponding DHGR byte in auxmem
; preserves X ; preserves X
ldy #%10000000 stx $02
sty $00 ldy #$02
sty $01 sec
pha php
and #%00000001 ldx #$07
-- lsr
- php
ror $00
sec
dex
beq + beq +
lda #%10000011 plp
sta $01 + ror $00
+ pla dex
pha bpl --
and #%00000010 plp
beq + ldx $03
lda $01 stx $01
clc ldx $00
adc #%00001100 stx $03
sta $01 ldx #$06
+ pla dey
pha bne -
and #%00000100 ror $00
beq + ldx $02
lda $01 rts
clc
adc #%00110000
sta $01
+ pla
pha
and #%00001000
beq +
lda $01
clc
adc #%01000000
sta $01
inc $00
+ pla
pha
and #%00010000
beq +
lda $00
clc
adc #%00000110
sta $00
+ pla
pha
and #%00100000
beq +
lda $00
clc
adc #%00011000
sta $00
+ pla
;pha
and #%01000000
beq +
lda $00
clc
adc #%01100000
sta $00
+ rts