Cleaned up font explode. Added 320 mode explode.

This commit is contained in:
Bobbi Webber-Manners
2022-12-27 01:50:10 -05:00
parent 8a76beec21
commit f5203735de
2 changed files with 35 additions and 28 deletions

Binary file not shown.

View File

@@ -191,25 +191,42 @@ SHRXPLDCHAR PHA
* Draw one pixel row of font in 320 mode * Draw one pixel row of font in 320 mode
* 4 bytes per char, 4 bits per pixel * 4 bytes per char, 4 bits per pixel
* TODO: Implement this * On entry: A contains row of font data
SHRCHAR320 PHY SHRCHAR320 PHY ; Preserve Y
LDA #$FF LDY #$00 ; Dest byte index
LDY #$00 :L0 STZ ZP2
LDX #$00 ; Source bit index
:L1 ASL ; MS bit -> C
PHP ; Preserve C
ROL ZP2 ; C -> LS bit
PLP ; Recover C
PHP
ROL ZP2 ; C -> LS bit
PLP ; Recover C
PHP
ROL ZP2 ; C -> LS bit
PLP ; Recover C
ROL ZP2 ; C -> LS bit
INX
CPX #$02 ; Processed two bits of font?
BNE :L1
PHA ; Preserve partially shifted font
LDA ZP2
STA [VDUADDR],Y STA [VDUADDR],Y
PLA ; Recover partially shifted font
INY INY
STA [VDUADDR],Y CPY #$04 ; Done 4 bytes?
INY BNE :L0
STA [VDUADDR],Y PLY ; Recover Y
INY
STA [VDUADDR],Y
PLY
RTS RTS
* Draw one pixel row of font in 640 mode * Draw one pixel row of font in 640 mode
* 2 bytes per char, 2 bits per pixel * 2 bytes per char, 2 bits per pixel
SHRCHAR640 PHY * On entry: A contains row of font data
STZ ZP2 SHRCHAR640 PHY ; Preserve Y
LDY #$00 ; Dest byte index
:L0 STZ ZP2
LDX #$00 ; Source bit index LDX #$00 ; Source bit index
:L1 ASL ; MS bit -> C :L1 ASL ; MS bit -> C
PHP ; Preserve C PHP ; Preserve C
@@ -219,24 +236,14 @@ SHRCHAR640 PHY
INX INX
CPX #$04 CPX #$04
BNE :L1 BNE :L1
PHA PHA ; Preserve partially shifted font
LDA ZP2 LDA ZP2
STA [VDUADDR]
PLA
STZ ZP2
LDX #$00
:L2 ASL ; MS bit -> C
PHP ; Preserve C
ROL ZP2 ; C -> LS bit
PLP ; Recover C
ROL ZP2 ; C -> LS bit
INX
CPX #$04
BNE :L2
LDA ZP2
LDY #$01
STA [VDUADDR],Y STA [VDUADDR],Y
PLY PLA ; Recover partially shifted font
INY
CPY #$02 ; Done 2 bytes?
BNE :L0
PLY ; Recover Y
RTS RTS