From 530b473ad2aa65bdae37ed5790a094839b332453 Mon Sep 17 00:00:00 2001 From: Michaelangel007 Date: Wed, 27 Jan 2016 20:41:38 -0800 Subject: [PATCH] Added CharInspect assembly source --- asm/charinspect.s | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 asm/charinspect.s diff --git a/asm/charinspect.s b/asm/charinspect.s new file mode 100644 index 0000000..44a4bfb --- /dev/null +++ b/asm/charinspect.s @@ -0,0 +1,55 @@ + __MAIN = $1000 + .include "dos33.inc" + .include "ca65.inc" + + KEYBOARD = $C000 + KEYSTROBE = $C010 + TXTCLR = $C050 ; Mode Graphics + MIXCLR = $C052 ; Full screen + MIXSET = $C053 ; Split screen + PAGE1 = $C054 + HIRES = $C057 ; Mode HGR + + HgrLo = $F5 + HgrHi = $F6 + glyph = $FE + DrawChar = $310 + +DemoCharInspect: + BIT PAGE1 ; Page 1 + BIT TXTCLR ; not text, but graphics + BIT MIXSET ; Split screen text/graphics + BIT HIRES ; HGR, no GR + + LDA #0 ; glyph=0 + STA glyph ; save which glyph to draw +.a LDA #0 ; screen = 0x2000 + STA HgrLo ; + LDA #$20 ; HGR Page 1 + STA HgrHi ; + LDA glyph ; A = glyph + LDY #00 ; Y = col + JSR DrawChar +.b LDA KEYBOARD ; read A=key + BPL .b ; no key? + STA KEYSTROBE ; debounce key + CMP #$88 ; key == <-- ? CTRL-H + BNE .d ; + DEC glyph ; yes, --glyph +.c LDA glyph ; glyph &= 0x7F + AND #$7F ; + STA glyph ; + BPL .a ; always branch, draw prev char +.d CMP #$95 ; key == --> ? CTRL-U + BNE .e ; + INC glyph ; yes, ++glyph + CLC ; always branch + BCC .c ; draw prev char +.e CMP #$9B ; key == ESC ? + BNE .b ; + RTS ; yes, exit + +PrintChar + +__END: +