GSCats/gscats.s

127 lines
1.6 KiB
ArmAsm
Raw Normal View History

2017-07-28 22:11:25 +00:00
;
; gscats
2017-07-28 22:11:25 +00:00
;
; Created by Quinn Dunki on 7/9/17
;
.include "macros.s"
.include "equates.s"
.include "loader.s"
2017-07-29 21:47:17 +00:00
mainBank2:
SYNCDBR
BITS8
2017-07-28 22:11:25 +00:00
lda #$f0
sta TEXTCOLOR
2017-07-29 21:47:17 +00:00
BITS16
2017-07-28 22:11:25 +00:00
; Set up SCBs
2017-07-28 22:11:25 +00:00
jsr initSCBs
SHRVIDEO
lda #basePalette
sta PARAML0
lda #0
jsr setPalette
ldx #$2222
2017-07-28 22:11:25 +00:00
jsr colorFill
jsr generateTerrain
2017-07-30 22:43:55 +00:00
mainGameLoop:
ldy mapScrollPos
; jsr renderTerrainColumns
jsr renderTerrain
2017-07-30 22:43:55 +00:00
jsr kbdScan
lda quitRequested
beq mainGameLoop
2017-07-28 22:11:25 +00:00
2017-07-30 22:43:55 +00:00
CLASSICVIDEO
2017-07-29 21:47:17 +00:00
jml (proDOSLongJump)
2017-07-28 22:11:25 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2017-07-30 22:43:55 +00:00
; kbdScan
; Processes keyboard input
;
; Trashes A
2017-07-28 22:11:25 +00:00
;
2017-07-30 22:43:55 +00:00
kbdScan:
2017-07-28 22:11:25 +00:00
EMULATION
2017-07-30 22:43:55 +00:00
kbdScanLoop:
2017-07-28 22:11:25 +00:00
lda KBD
2017-07-30 22:43:55 +00:00
bpl kbdScanLoop
2017-07-28 22:11:25 +00:00
sta KBDSTROBE
2017-07-30 22:43:55 +00:00
cmp #(8 + $80)
beq kbdScanLeftArrow
cmp #(21 + $80)
beq kbdScanRightArrow
cmp #(32 + $80)
beq kbdScanSpace
2017-07-28 22:11:25 +00:00
NATIVE
2017-07-30 22:43:55 +00:00
kbdScanDone:
2017-07-28 22:11:25 +00:00
rts
2017-07-30 22:43:55 +00:00
kbdScanLeftArrow:
NATIVE
lda mapScrollPos
cmp #TERRAINWIDTH/4-80
2017-07-30 22:43:55 +00:00
beq kbdScanDone
inc
inc
2017-07-30 22:43:55 +00:00
sta mapScrollPos
bra kbdScanDone
kbdScanRightArrow:
NATIVE
lda mapScrollPos
beq kbdScanDone
dec
dec
2017-07-30 22:43:55 +00:00
sta mapScrollPos
bra kbdScanDone
kbdScanSpace:
NATIVE
lda #1
sta quitRequested
bra kbdScanDone
2017-07-28 22:11:25 +00:00
basePalette:
.word $0800,$0080,$0000,$000F,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
mapScrollPos: ; 4-pixel columns distance from right terrain edge
.word 80
2017-07-30 22:43:55 +00:00
quitRequested:
.word $0000
2017-07-28 22:11:25 +00:00
.include "graphics.s"
.include "terrain.s"
.include "tables.s"
2017-07-29 21:47:17 +00:00
endMainBank2:
2017-07-28 22:11:25 +00:00
; Suppress some linker warnings - Must be the last thing in the file
; This is because Quinn doesn't really know how to use ca65 properly
.SEGMENT "ZPSAVE"
.SEGMENT "EXEHDR"
.SEGMENT "STARTUP"
.SEGMENT "INIT"
.SEGMENT "LOWCODE"