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
|
2017-08-21 00:51:12 +00:00
|
|
|
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
|
2017-08-21 00:51:12 +00:00
|
|
|
cmp #(' ' + $80)
|
|
|
|
beq kbdScanSpace
|
2017-08-31 19:55:02 +00:00
|
|
|
cmp #(27 + $80)
|
|
|
|
beq kbdScanESC
|
2017-09-30 20:01:36 +00:00
|
|
|
cmp #(127 + $80)
|
|
|
|
beq kbdScanDEL
|
2019-02-22 23:52:07 +00:00
|
|
|
cmp #('=' + $80)
|
|
|
|
beq kbdScanEquals
|
2018-06-11 00:05:20 +00:00
|
|
|
cmp #(9 + $80)
|
|
|
|
beq kbdScanTab
|
2017-08-16 02:20:47 +00:00
|
|
|
|
|
|
|
kbdScanDone:
|
|
|
|
BITS16
|
|
|
|
rts
|
|
|
|
|
|
|
|
kbdScanRightArrow:
|
|
|
|
BITS16
|
|
|
|
lda mapScrollPos
|
|
|
|
cmp #VISIBLETERRAINWIDTH-VISIBLETERRAINWINDOW
|
|
|
|
beq kbdScanDone
|
2017-12-24 02:01:16 +00:00
|
|
|
; inc
|
2017-08-16 02:20:47 +00:00
|
|
|
inc
|
|
|
|
sta mapScrollRequested
|
|
|
|
rts
|
|
|
|
|
|
|
|
kbdScanLeftArrow:
|
|
|
|
BITS16
|
|
|
|
|
|
|
|
lda mapScrollPos
|
|
|
|
beq kbdScanDone
|
|
|
|
dec
|
2017-12-24 02:01:16 +00:00
|
|
|
; dec
|
2017-08-16 02:20:47 +00:00
|
|
|
sta mapScrollRequested
|
|
|
|
rts
|
|
|
|
|
2017-08-21 00:51:12 +00:00
|
|
|
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
|
|
|
|
|
2017-08-21 00:51:12 +00:00
|
|
|
kbdScanSpace:
|
|
|
|
BITS16
|
|
|
|
lda #1
|
|
|
|
sta fireRequested
|
|
|
|
rts
|
|
|
|
|
2017-08-31 19:55:02 +00:00
|
|
|
kbdScanESC:
|
|
|
|
BITS16
|
|
|
|
lda #1
|
|
|
|
sta breakpoint
|
|
|
|
rts
|
|
|
|
|
2017-09-30 20:01:36 +00:00
|
|
|
kbdScanDEL:
|
|
|
|
BITS16
|
|
|
|
lda paused
|
|
|
|
eor #1
|
|
|
|
sta paused
|
|
|
|
rts
|
|
|
|
|
2019-02-22 23:52:07 +00:00
|
|
|
kbdScanEquals:
|
|
|
|
BITS16
|
|
|
|
lda #1
|
|
|
|
sta singleStep
|
|
|
|
stz paused
|
|
|
|
rts
|
|
|
|
|
2018-06-11 00:05:20 +00:00
|
|
|
kbdScanTab:
|
|
|
|
BITS16
|
|
|
|
ldy currentPlayer
|
|
|
|
PLAYERPTR_Y
|
|
|
|
lda playerData+PD_CURRWEAPON,y
|
|
|
|
inc
|
|
|
|
cmp #INVENTORY_ITEMS
|
|
|
|
bne kbdScanTab_store
|
|
|
|
lda #0
|
|
|
|
|
|
|
|
kbdScanTab_store:
|
|
|
|
sta playerData+PD_CURRWEAPON,y
|
|
|
|
inc inventoryDirty
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
2017-08-31 19:55:02 +00:00
|
|
|
breakpoint:
|
|
|
|
.word 0
|
|
|
|
|