GSCats/input.s

110 lines
1.2 KiB
ArmAsm
Raw Normal View History

2017-08-16 02:20:47 +00:00
;
; input
; Code related to handling input
;
; Created by Quinn Dunki on 8/15/17
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; kbdScan
; Processes keyboard input
;
; Trashes A
;
kbdScan:
BITS8
lda KBD
bpl kbdScanDone
sta KBDSTROBE
cmp #(8 + $80)
beq kbdScanLeftArrow
cmp #(21 + $80)
beq kbdScanRightArrow
cmp #('q' + $80)
beq kbdScanQ
2017-08-16 02:20:47 +00:00
cmp #('a' + $80)
beq kbdScanA
cmp #('z' + $80)
beq kbdScanZ
2017-09-05 19:55:27 +00:00
cmp #('s' + $80)
beq kbdScanS
cmp #('x' + $80)
beq kbdScanX
cmp #(' ' + $80)
beq kbdScanSpace
cmp #(27 + $80)
beq kbdScanESC
2017-08-16 02:20:47 +00:00
kbdScanDone:
BITS16
rts
kbdScanRightArrow:
BITS16
lda mapScrollPos
cmp #VISIBLETERRAINWIDTH-VISIBLETERRAINWINDOW
beq kbdScanDone
inc
inc
sta mapScrollRequested
rts
kbdScanLeftArrow:
BITS16
lda mapScrollPos
beq kbdScanDone
dec
dec
sta mapScrollRequested
rts
kbdScanQ:
2017-08-16 02:20:47 +00:00
BITS16
lda #1
sta quitRequested
rts
kbdScanA:
BITS16
lda #1
sta angleDeltaRequested
rts
kbdScanZ:
BITS16
lda #-1
sta angleDeltaRequested
rts
2017-09-05 19:55:27 +00:00
kbdScanS:
BITS16
lda #1
sta powerDeltaRequested
rts
kbdScanX:
BITS16
lda #-1
sta powerDeltaRequested
rts
kbdScanSpace:
BITS16
lda #1
sta fireRequested
rts
kbdScanESC:
BITS16
lda #1
sta breakpoint
rts
breakpoint:
.word 0