Some cleanup

This commit is contained in:
blondie7575 2017-08-15 19:20:47 -07:00
parent d6ab080ac8
commit 3776f3377f
5 changed files with 80 additions and 69 deletions

View File

@ -8,6 +8,7 @@
/* Begin PBXFileReference section */
700C39C51F2E5CA800C24F9C /* tables.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = tables.s; sourceTree = "<group>"; };
700F21DE1F43E31300D7007D /* input.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = input.s; sourceTree = "<group>"; };
700FFAFB1F40F3BF00A442DE /* font.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = font.s; sourceTree = "<group>"; };
7059502B1F37A0BE00BBE90F /* GenerateVRAMTable.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = GenerateVRAMTable.py; sourceTree = "<group>"; };
706DF1641F2D39F700AA6680 /* loader.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = loader.s; sourceTree = "<group>"; };
@ -30,6 +31,7 @@
isa = PBXGroup;
children = (
70E9D85F1F2BD95400555C19 /* equates.s */,
700F21DE1F43E31300D7007D /* input.s */,
70E9D8601F2BD95400555C19 /* graphics.s */,
70E9D8621F2BD95400555C19 /* macros.s */,
7099E3841F41022100182A82 /* gameobject.s */,

View File

@ -103,75 +103,6 @@ changeAngle:
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; kbdScan
; Processes keyboard input
;
; Trashes A
;
kbdScan:
EMULATION
kbdScanLoop:
lda KBD
bpl kbdScanDone
sta KBDSTROBE
cmp #(8 + $80)
beq kbdScanLeftArrow
cmp #(21 + $80)
beq kbdScanRightArrow
cmp #(' ' + $80)
beq kbdScanSpace
cmp #('a' + $80)
beq kbdScanA
cmp #('z' + $80)
beq kbdScanZ
kbdScanDone:
NATIVE
rts
kbdScanRightArrow:
NATIVE
lda mapScrollPos
cmp #VISIBLETERRAINWIDTH-VISIBLETERRAINWINDOW
beq kbdScanDone
inc
inc
sta mapScrollRequested
rts
kbdScanLeftArrow:
NATIVE
lda mapScrollPos
beq kbdScanDone
dec
dec
sta mapScrollRequested
rts
kbdScanSpace:
NATIVE
lda #1
sta quitRequested
rts
kbdScanA:
NATIVE
lda #1
sta angleDeltaRequested
rts
kbdScanZ:
NATIVE
lda #-1
sta angleDeltaRequested
rts
basePalette:
.word $0000,$0080,$0000,$000F,$0FFF,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0FFF
quitRequested:
@ -182,6 +113,8 @@ angleDeltaRequested:
.word $0000
terrainDirty:
.word 1
activePlayer:
.word 0
; Position of map viewing window. Can be visualized in two ways:
; a) Word-distance from right edge of terrain data (which is in memory right-to-left) to left edge of visible screen

Binary file not shown.

View File

@ -36,6 +36,8 @@ quitGame:
.include "utility.s"
.include "tables.s"
.include "gamemanager.s"
.include "input.s"
endMainBank2:

74
input.s Normal file
View File

@ -0,0 +1,74 @@
;
; 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 #(' ' + $80)
beq kbdScanSpace
cmp #('a' + $80)
beq kbdScanA
cmp #('z' + $80)
beq kbdScanZ
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
kbdScanSpace:
BITS16
lda #1
sta quitRequested
rts
kbdScanA:
BITS16
lda #1
sta angleDeltaRequested
rts
kbdScanZ:
BITS16
lda #-1
sta angleDeltaRequested
rts