diff --git a/mandel.s b/mandel.s index b524c6f..44bff1f 100644 --- a/mandel.s +++ b/mandel.s @@ -42,6 +42,9 @@ CIX = $f2 ; u8 - index into INBUFF INBUFF = $f3 ; u16 - pointer to ascii FLPTR = $fc ; u16 - pointer to user buffer float48 +CH1 = $02f2 ; previous character read from keyboard +CH = $02fc ; current character read from keyboard + LBUFF = $0580 ; result buffer for FASC routine ; FP ROM routine vectors @@ -73,15 +76,21 @@ stride = width >> 2 DMACTL = $D400 DLISTL = $D402 DLISTH = $D403 +WSYNC = $D40A ; OS shadow registers SDLSTL = $230 SDLSTH = $231 ; interrupt stuff +SYSVBV = $E45F XITVBV = $E462 SETVBV = $E45C + +; Keys +KEY_RIGHT = $07 + .struct float48 exponent .byte mantissa .byte 6 @@ -126,6 +135,9 @@ char_map: .byte 96 + i .endrepeat +hex_chars: + .byte "0123456789abcdef" + aspect: ; aspect ratio! ; pixels at 320w are 5:6 (narrow) @@ -888,6 +900,33 @@ loop_sx: jsr mandelbrot jsr pset + ; check keyboard buffer + lda CH + cmp #$ff + beq skip_char + + ; Clear the keyboard buffer + ldx #$ff + stx CH + + tax + lsr a + lsr a + lsr a + lsr a + tay + lda hex_chars,y + sta temp + + txa + and #$0f + tay + lda hex_chars,y + sta temp + 1 + + draw_text 14, 2, temp + +skip_char: ; check if we should update the counters ;