2017-07-28 22:11:25 +00:00
|
|
|
;
|
2017-07-30 18:54:37 +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"
|
2017-07-30 18:54:37 +00:00
|
|
|
.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
|
|
|
|
2017-07-30 18:54:37 +00:00
|
|
|
; Set up SCBs
|
2017-07-28 22:11:25 +00:00
|
|
|
jsr initSCBs
|
|
|
|
SHRVIDEO
|
|
|
|
|
|
|
|
lda #basePalette
|
|
|
|
sta PARAML0
|
|
|
|
lda #0
|
|
|
|
jsr setPalette
|
|
|
|
|
2017-07-30 18:54:37 +00:00
|
|
|
ldx #$2222
|
2017-07-28 22:11:25 +00:00
|
|
|
jsr colorFill
|
|
|
|
|
2017-07-30 18:54:37 +00:00
|
|
|
jsr generateTerrain
|
2017-07-30 22:43:55 +00:00
|
|
|
|
|
|
|
mainGameLoop:
|
|
|
|
ldy mapScrollPos
|
2017-07-31 03:23:32 +00:00
|
|
|
; jsr renderTerrainColumns
|
|
|
|
|
|
|
|
jsr renderTerrain
|
2017-07-30 18:54:37 +00:00
|
|
|
|
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
|
2017-08-06 19:05:19 +00:00
|
|
|
cmp #TERRAINWIDTH/4-80
|
2017-07-30 22:43:55 +00:00
|
|
|
beq kbdScanDone
|
2017-08-06 19:05:19 +00:00
|
|
|
inc
|
2017-08-06 19:52:21 +00:00
|
|
|
inc
|
2017-07-30 22:43:55 +00:00
|
|
|
sta mapScrollPos
|
|
|
|
bra kbdScanDone
|
|
|
|
|
|
|
|
kbdScanRightArrow:
|
|
|
|
NATIVE
|
|
|
|
lda mapScrollPos
|
|
|
|
beq kbdScanDone
|
2017-08-06 19:05:19 +00:00
|
|
|
dec
|
2017-08-06 19:52:21 +00:00
|
|
|
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:
|
2017-08-06 19:05:19 +00:00
|
|
|
.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"
|
2017-07-30 18:54:37 +00:00
|
|
|
.include "terrain.s"
|
2017-08-06 19:52:21 +00:00
|
|
|
.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"
|