mirror of
https://github.com/blondie7575/GSCats.git
synced 2024-06-12 22:29:33 +00:00
Game/menu transitions working
- Also cleaned up key mapping - Fixed a bug in VRAM pointer calculation
This commit is contained in:
parent
5eb32268b9
commit
2927cb0c68
|
@ -25,6 +25,7 @@ renderAnimation:
|
||||||
|
|
||||||
phx ; Calculate VRAM position
|
phx ; Calculate VRAM position
|
||||||
jsr vramPtr
|
jsr vramPtr
|
||||||
|
BREAK
|
||||||
cpx #$ffff
|
cpx #$ffff
|
||||||
beq renderAnimationSkip
|
beq renderAnimationSkip
|
||||||
stx SCRATCHL2
|
stx SCRATCHL2
|
||||||
|
|
|
@ -41,8 +41,12 @@ beginGameplay:
|
||||||
|
|
||||||
jsr compileTerrain
|
jsr compileTerrain
|
||||||
jsr clipTerrain
|
jsr clipTerrain
|
||||||
|
jsr renderTerrain
|
||||||
|
|
||||||
; Set up palette for terrain and players
|
jsr renderInventory
|
||||||
|
jsr renderPlayers
|
||||||
|
|
||||||
|
; Fade in from menu
|
||||||
lda #basePalette
|
lda #basePalette
|
||||||
sta PARAML2
|
sta PARAML2
|
||||||
jsr paletteFade
|
jsr paletteFade
|
||||||
|
@ -191,7 +195,14 @@ gameplayLoopEndFrame:
|
||||||
gameplayLoopEndFrameCont:
|
gameplayLoopEndFrameCont:
|
||||||
lda quitRequested
|
lda quitRequested
|
||||||
beq gameplayLoopContinue
|
beq gameplayLoopContinue
|
||||||
jmp quitGame
|
|
||||||
|
; Transition back to menu
|
||||||
|
stz quitRequested
|
||||||
|
lda #skyPalette
|
||||||
|
sta PARAML2
|
||||||
|
jsr paletteFade
|
||||||
|
jmp titleScreen
|
||||||
|
|
||||||
gameplayLoopContinue:
|
gameplayLoopContinue:
|
||||||
jmp gameplayLoop
|
jmp gameplayLoop
|
||||||
|
|
||||||
|
|
41
input.s
41
input.s
|
@ -28,6 +28,7 @@ kbdScanTitle:
|
||||||
beq kbdScanEnterTitle
|
beq kbdScanEnterTitle
|
||||||
cmp #(32 + $80)
|
cmp #(32 + $80)
|
||||||
beq kbdScanSpaceTitle
|
beq kbdScanSpaceTitle
|
||||||
|
bra kbdScanDebugPiggyback
|
||||||
|
|
||||||
kbdScanTitleDone:
|
kbdScanTitleDone:
|
||||||
BITS16
|
BITS16
|
||||||
|
@ -80,16 +81,16 @@ kbdScanGameplay:
|
||||||
beq kbdScanLeftArrow
|
beq kbdScanLeftArrow
|
||||||
cmp #(21 + $80)
|
cmp #(21 + $80)
|
||||||
beq kbdScanRightArrow
|
beq kbdScanRightArrow
|
||||||
cmp #('q' + $80)
|
cmp #(11 + $80)
|
||||||
beq kbdScanQ
|
beq kbdScanUpArrow
|
||||||
cmp #('a' + $80)
|
cmp #(10 + $80)
|
||||||
beq kbdScanA
|
beq kbdScanDownArrow
|
||||||
cmp #('z' + $80)
|
cmp #(27 + $80)
|
||||||
beq kbdScanZ
|
beq kbdScanESC
|
||||||
cmp #('s' + $80)
|
cmp #(',' + $80)
|
||||||
beq kbdScanS
|
beq kbdScanComma
|
||||||
cmp #('x' + $80)
|
cmp #('.' + $80)
|
||||||
beq kbdScanX
|
beq kbdScanPeriod
|
||||||
cmp #(' ' + $80)
|
cmp #(' ' + $80)
|
||||||
beq kbdScanSpace
|
beq kbdScanSpace
|
||||||
cmp #(9 + $80)
|
cmp #(9 + $80)
|
||||||
|
@ -107,8 +108,8 @@ kbdScanDebug:
|
||||||
sta KBDSTROBE
|
sta KBDSTROBE
|
||||||
|
|
||||||
kbdScanDebugPiggyback:
|
kbdScanDebugPiggyback:
|
||||||
cmp #(27 + $80)
|
cmp #('`' + $80)
|
||||||
beq kbdScanESC
|
beq kbdScanBackQuote
|
||||||
cmp #(127 + $80)
|
cmp #(127 + $80)
|
||||||
beq kbdScanDEL
|
beq kbdScanDEL
|
||||||
cmp #('=' + $80)
|
cmp #('=' + $80)
|
||||||
|
@ -120,7 +121,7 @@ kbdScanDebugPiggyback:
|
||||||
; Gameplay Key Handlers
|
; Gameplay Key Handlers
|
||||||
;
|
;
|
||||||
|
|
||||||
kbdScanRightArrow:
|
kbdScanPeriod:
|
||||||
BITS16
|
BITS16
|
||||||
lda mapScrollPos
|
lda mapScrollPos
|
||||||
cmp #VISIBLETERRAINWIDTH-VISIBLETERRAINWINDOW
|
cmp #VISIBLETERRAINWIDTH-VISIBLETERRAINWINDOW
|
||||||
|
@ -132,7 +133,7 @@ kbdScanRightArrow:
|
||||||
sta mapScrollRequested
|
sta mapScrollRequested
|
||||||
rts
|
rts
|
||||||
|
|
||||||
kbdScanLeftArrow:
|
kbdScanComma:
|
||||||
BITS16
|
BITS16
|
||||||
|
|
||||||
lda mapScrollPos
|
lda mapScrollPos
|
||||||
|
@ -144,32 +145,32 @@ kbdScanLeftArrow:
|
||||||
sta mapScrollRequested
|
sta mapScrollRequested
|
||||||
rts
|
rts
|
||||||
|
|
||||||
kbdScanQ:
|
kbdScanESC:
|
||||||
BITS16
|
BITS16
|
||||||
|
|
||||||
lda #1
|
lda #1
|
||||||
sta quitRequested
|
sta quitRequested
|
||||||
rts
|
rts
|
||||||
|
|
||||||
kbdScanA:
|
kbdScanLeftArrow:
|
||||||
BITS16
|
BITS16
|
||||||
lda #2
|
lda #2
|
||||||
sta angleDeltaRequested
|
sta angleDeltaRequested
|
||||||
rts
|
rts
|
||||||
|
|
||||||
kbdScanZ:
|
kbdScanRightArrow:
|
||||||
BITS16
|
BITS16
|
||||||
lda #-2
|
lda #-2
|
||||||
sta angleDeltaRequested
|
sta angleDeltaRequested
|
||||||
rts
|
rts
|
||||||
|
|
||||||
kbdScanS:
|
kbdScanUpArrow:
|
||||||
BITS16
|
BITS16
|
||||||
lda #1
|
lda #1
|
||||||
sta powerDeltaRequested
|
sta powerDeltaRequested
|
||||||
rts
|
rts
|
||||||
|
|
||||||
kbdScanX:
|
kbdScanDownArrow:
|
||||||
BITS16
|
BITS16
|
||||||
lda #-1
|
lda #-1
|
||||||
sta powerDeltaRequested
|
sta powerDeltaRequested
|
||||||
|
@ -181,7 +182,7 @@ kbdScanSpace:
|
||||||
sta fireRequested
|
sta fireRequested
|
||||||
rts
|
rts
|
||||||
|
|
||||||
kbdScanESC:
|
kbdScanBackQuote:
|
||||||
BITS16
|
BITS16
|
||||||
lda #1
|
lda #1
|
||||||
sta breakpoint
|
sta breakpoint
|
||||||
|
|
|
@ -26,6 +26,7 @@ titleScreen:
|
||||||
|
|
||||||
lda #%10000000 ; Set all SCBs to 320, no interrupts, palette 0
|
lda #%10000000 ; Set all SCBs to 320, no interrupts, palette 0
|
||||||
jsr initSCBs
|
jsr initSCBs
|
||||||
|
stz leftScreenEdge
|
||||||
|
|
||||||
; Copy title screen art from where it was loaded in bank 6
|
; Copy title screen art from where it was loaded in bank 6
|
||||||
; This isn't fast, but doesn't need to be
|
; This isn't fast, but doesn't need to be
|
||||||
|
@ -120,6 +121,7 @@ titleScreenStillCat2:
|
||||||
titleScreenKeyboard:
|
titleScreenKeyboard:
|
||||||
; Check for selection
|
; Check for selection
|
||||||
jsr kbdScanTitle
|
jsr kbdScanTitle
|
||||||
|
jsr kbdScanDebug
|
||||||
lda menuActionRequested
|
lda menuActionRequested
|
||||||
beq titleScreenMainLoopEndFrame
|
beq titleScreenMainLoopEndFrame
|
||||||
|
|
||||||
|
@ -163,6 +165,11 @@ titleScreenMainLoopEndFrame:
|
||||||
jmp titleScreenMainLoop
|
jmp titleScreenMainLoop
|
||||||
|
|
||||||
titleScreenBeginGame:
|
titleScreenBeginGame:
|
||||||
|
; Transition to gameplay
|
||||||
|
stz menuActionRequested
|
||||||
|
lda #skyPalette
|
||||||
|
sta PARAML2
|
||||||
|
jsr paletteFade
|
||||||
jmp beginGameplay
|
jmp beginGameplay
|
||||||
|
|
||||||
titleScreenQuit:
|
titleScreenQuit:
|
||||||
|
@ -171,9 +178,9 @@ titleScreenQuit:
|
||||||
titleAnimationCounter:
|
titleAnimationCounter:
|
||||||
.word 0
|
.word 0
|
||||||
titleAnimationPos0:
|
titleAnimationPos0:
|
||||||
.word 130,120
|
.word 114,120
|
||||||
titleAnimationPos1:
|
titleAnimationPos1:
|
||||||
.word 208,120
|
.word 192,120
|
||||||
animationDelay0:
|
animationDelay0:
|
||||||
.word CAT_DELAY/2
|
.word CAT_DELAY/2
|
||||||
animationDelay1:
|
animationDelay1:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user