From a641b5bd186a253875db40abf2b1b3bfe1c2f868 Mon Sep 17 00:00:00 2001 From: Michaelangel007 Date: Thu, 28 Jan 2016 00:14:53 -0800 Subject: [PATCH] Short asciitable, don't hard-code starting row --- asm/asciitable.s | 36 ++++++++++++++++++------------------ bin/asciitable.bin | Bin 74 -> 68 bytes 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/asm/asciitable.s b/asm/asciitable.s index 9376308..7354153 100644 --- a/asm/asciitable.s +++ b/asm/asciitable.s @@ -13,21 +13,27 @@ HgrLo = $F5 HgrHi = $F6 glyph = $FE + row = $FF DrawChar = $310 HgrLoY = $3A0 HgrHiY = $3B8 + START_ROW = 0 + AsciiTable - BIT PAGE1 ; Page 1 - BIT TXTCLR ; not text, but graphics - BIT MIXSET ; Split screen text/graphics - BIT HIRES ; HGR, no GR + LDY #(START_ROW-1) & $FF + STY row LDA #0 ; glyph=0 STA glyph ; save which glyph to draw - LDY #8 ; Row=8 -_RowN + BIT PAGE1 ; Page 1 + 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 STA HgrLo ; Screen Address Lo LDA HgrHiY,Y @@ -35,26 +41,20 @@ _RowN STA HgrHi ; Screen Address Hi LDY #00 ; Y = col -_Glyph +_NextCol LDA glyph ; A = glyph JSR DrawChar INC glyph ; yes, ++glyph LDA glyph ; CMP #$20 ; done 16 chars? - BEQ _Row1 + BEQ _NextRow CMP #$40 - BEQ _Row2 + BEQ _NextRow CMP #$60 - BEQ _Row3 + BEQ _NextRow CMP #$80 - BNE _Glyph ; -_Done RTS ; Optimization: BEQ _Row4 -_Row1 LDY #9 - BNE _RowN -_Row2 LDY #10 - BNE _RowN -_Row3 LDY #11 - BNE _RowN + BNE _NextCol +_Done RTS ; Optimization: BEQ _NextRow __END: diff --git a/bin/asciitable.bin b/bin/asciitable.bin index 4ca8f7c0eac0ec83e2f86b663297a72ede017b0e..5818dd16122b5f4c7860e16c25d2f0d53a34c3b0 100644 GIT binary patch literal 68 zcmV-K0K5Ny5I_K+|Ahak0EPZ6RKP4yz${b1ELXth|D^x9paX^Vxwr!fAcgjz0HyvQ a5Ci7^rT)nv@Zrfo@ZHH^@Y%_L(C1*qc_wlI delta 55 zcmZ?q5^E4}W6%jXpc8OFC-{I)_<@xSt^XEqOq7w5;yvl`f%jwr5I0