Short asciitable, don't hard-code starting row

This commit is contained in:
Michaelangel007 2016-01-28 00:14:53 -08:00
parent 8a5b55c971
commit a641b5bd18
2 changed files with 18 additions and 18 deletions

View File

@ -13,21 +13,27 @@
HgrLo = $F5 HgrLo = $F5
HgrHi = $F6 HgrHi = $F6
glyph = $FE glyph = $FE
row = $FF
DrawChar = $310 DrawChar = $310
HgrLoY = $3A0 HgrLoY = $3A0
HgrHiY = $3B8 HgrHiY = $3B8
START_ROW = 0
AsciiTable AsciiTable
BIT PAGE1 ; Page 1 LDY #(START_ROW-1) & $FF
BIT TXTCLR ; not text, but graphics STY row
BIT MIXSET ; Split screen text/graphics
BIT HIRES ; HGR, no GR
LDA #0 ; glyph=0 LDA #0 ; glyph=0
STA glyph ; save which glyph to draw STA glyph ; save which glyph to draw
LDY #8 ; Row=8 BIT PAGE1 ; Page 1
_RowN BIT TXTCLR ; not text, but graphics
BIT MIXSET ; Split screen text/graphics
BIT HIRES ; HGR, no GR
_NextRow
INC row
LDY row
LDA HgrLoY,Y LDA HgrLoY,Y
STA HgrLo ; Screen Address Lo STA HgrLo ; Screen Address Lo
LDA HgrHiY,Y LDA HgrHiY,Y
@ -35,26 +41,20 @@ _RowN
STA HgrHi ; Screen Address Hi STA HgrHi ; Screen Address Hi
LDY #00 ; Y = col LDY #00 ; Y = col
_Glyph _NextCol
LDA glyph ; A = glyph LDA glyph ; A = glyph
JSR DrawChar JSR DrawChar
INC glyph ; yes, ++glyph INC glyph ; yes, ++glyph
LDA glyph ; LDA glyph ;
CMP #$20 ; done 16 chars? CMP #$20 ; done 16 chars?
BEQ _Row1 BEQ _NextRow
CMP #$40 CMP #$40
BEQ _Row2 BEQ _NextRow
CMP #$60 CMP #$60
BEQ _Row3 BEQ _NextRow
CMP #$80 CMP #$80
BNE _Glyph ; BNE _NextCol
_Done RTS ; Optimization: BEQ _Row4 _Done RTS ; Optimization: BEQ _NextRow
_Row1 LDY #9
BNE _RowN
_Row2 LDY #10
BNE _RowN
_Row3 LDY #11
BNE _RowN
__END: __END:

Binary file not shown.