WIP quick hack to check keyboard
this for some reason only works ONCE though I can replicate the logic in BASIC and it works over multiple keys not sure what's wrong
This commit is contained in:
parent
24abc21b01
commit
53336f7af1
1 changed files with 39 additions and 0 deletions
39
mandel.s
39
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
|
||||
;
|
||||
|
|
Loading…
Reference in a new issue