Basic main menu working!
This commit is contained in:
parent
1eb235fc4c
commit
5eb32268b9
Binary file not shown.
Before Width: | Height: | Size: 924 B After Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
|
@ -27,9 +27,7 @@
|
||||||
706DF1641F2D39F700AA6680 /* loader.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = loader.s; sourceTree = "<group>"; };
|
706DF1641F2D39F700AA6680 /* loader.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = loader.s; sourceTree = "<group>"; };
|
||||||
706DF1651F2D4A8100AA6680 /* terrain.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = terrain.s; sourceTree = "<group>"; };
|
706DF1651F2D4A8100AA6680 /* terrain.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = terrain.s; sourceTree = "<group>"; };
|
||||||
7076E9222A57AED90006E295 /* CompileFont.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = CompileFont.py; sourceTree = "<group>"; };
|
7076E9222A57AED90006E295 /* CompileFont.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = CompileFont.py; sourceTree = "<group>"; };
|
||||||
7076E9232A59113F0006E295 /* font8x8.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = font8x8.s; sourceTree = "<group>"; };
|
|
||||||
7076E9242A5A4A8E0006E295 /* fontEngine.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = fontEngine.s; sourceTree = "<group>"; };
|
7076E9242A5A4A8E0006E295 /* fontEngine.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = fontEngine.s; sourceTree = "<group>"; };
|
||||||
7076E9252A5F9F540006E295 /* font16x16.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = font16x16.s; sourceTree = "<group>"; };
|
|
||||||
7088096D1F2ECE8D00D4C950 /* GenerateRenderSpans.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = GenerateRenderSpans.py; sourceTree = "<group>"; };
|
7088096D1F2ECE8D00D4C950 /* GenerateRenderSpans.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = GenerateRenderSpans.py; sourceTree = "<group>"; };
|
||||||
708D1B1E27B9A1A600909AFC /* crosshair.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = crosshair.s; sourceTree = "<group>"; };
|
708D1B1E27B9A1A600909AFC /* crosshair.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = crosshair.s; sourceTree = "<group>"; };
|
||||||
709175C01F60D263008FAFAB /* GenerateCircles.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = GenerateCircles.py; sourceTree = "<group>"; };
|
709175C01F60D263008FAFAB /* GenerateCircles.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = GenerateCircles.py; sourceTree = "<group>"; };
|
||||||
|
@ -92,8 +90,6 @@
|
||||||
70E9D8631F2BD95400555C19 /* Makefile */,
|
70E9D8631F2BD95400555C19 /* Makefile */,
|
||||||
70BDCBC92006AD5F00CB51F1 /* linkerConfig */,
|
70BDCBC92006AD5F00CB51F1 /* linkerConfig */,
|
||||||
701E708A2A649A230030C35D /* tinyNumbers.s */,
|
701E708A2A649A230030C35D /* tinyNumbers.s */,
|
||||||
7076E9232A59113F0006E295 /* font8x8.s */,
|
|
||||||
7076E9252A5F9F540006E295 /* font16x16.s */,
|
|
||||||
7076E9242A5A4A8E0006E295 /* fontEngine.s */,
|
7076E9242A5A4A8E0006E295 /* fontEngine.s */,
|
||||||
7076E9222A57AED90006E295 /* CompileFont.py */,
|
7076E9222A57AED90006E295 /* CompileFont.py */,
|
||||||
70FE79D21F8814A600E0095C /* MerlinToCA65.sh */,
|
70FE79D21F8814A600E0095C /* MerlinToCA65.sh */,
|
||||||
|
|
29
input.s
29
input.s
|
@ -20,8 +20,14 @@ kbdScanTitle:
|
||||||
bpl kbdScanTitleDone
|
bpl kbdScanTitleDone
|
||||||
sta KBDSTROBE
|
sta KBDSTROBE
|
||||||
|
|
||||||
cmp #(8 + $80)
|
cmp #(11 + $80)
|
||||||
beq kbdScanLeftArrowTitle
|
beq kbdScanUpArrowTitle
|
||||||
|
cmp #(10 + $80)
|
||||||
|
beq kbdScanDownArrowTitle
|
||||||
|
cmp #(13 + $80)
|
||||||
|
beq kbdScanEnterTitle
|
||||||
|
cmp #(32 + $80)
|
||||||
|
beq kbdScanSpaceTitle
|
||||||
|
|
||||||
kbdScanTitleDone:
|
kbdScanTitleDone:
|
||||||
BITS16
|
BITS16
|
||||||
|
@ -32,12 +38,29 @@ kbdScanTitleDone:
|
||||||
; Title Screen Key Handlers
|
; Title Screen Key Handlers
|
||||||
;
|
;
|
||||||
|
|
||||||
kbdScanLeftArrowTitle:
|
kbdScanUpArrowTitle:
|
||||||
|
BITS16
|
||||||
|
lda #-1
|
||||||
|
sta menuActionRequested
|
||||||
|
rts
|
||||||
|
|
||||||
|
kbdScanDownArrowTitle:
|
||||||
BITS16
|
BITS16
|
||||||
lda #1
|
lda #1
|
||||||
sta menuActionRequested
|
sta menuActionRequested
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
kbdScanEnterTitle:
|
||||||
|
BITS16
|
||||||
|
lda #2
|
||||||
|
sta menuActionRequested
|
||||||
|
rts
|
||||||
|
|
||||||
|
kbdScanSpaceTitle:
|
||||||
|
BITS16
|
||||||
|
lda #2
|
||||||
|
sta menuActionRequested
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
1
loader.s
1
loader.s
|
@ -21,6 +21,7 @@ MAINENTRY = $020000
|
||||||
LOADSTEP = 3
|
LOADSTEP = 3
|
||||||
|
|
||||||
.macro addProgress amount
|
.macro addProgress amount
|
||||||
|
jsr nextVBL
|
||||||
lda #amount
|
lda #amount
|
||||||
jsr advanceLoadingBar
|
jsr advanceLoadingBar
|
||||||
jsr renderLoadingBar
|
jsr renderLoadingBar
|
||||||
|
|
160
titleScreen.s
160
titleScreen.s
|
@ -13,6 +13,8 @@ titlePalette:
|
||||||
|
|
||||||
TITLE_ANIMATION_FRAMES = 5
|
TITLE_ANIMATION_FRAMES = 5
|
||||||
CAT_DELAY = 300
|
CAT_DELAY = 300
|
||||||
|
CAT0_VRAM = $5d79
|
||||||
|
CAT1_VRAM = $5da0
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
@ -31,7 +33,7 @@ titleScreen:
|
||||||
|
|
||||||
titleScreenCopyLoop:
|
titleScreenCopyLoop:
|
||||||
lda $060000,x
|
lda $060000,x
|
||||||
sta VRAM,x
|
sta SHADOWVRAM,x
|
||||||
inx
|
inx
|
||||||
inx
|
inx
|
||||||
cpx #$7d00
|
cpx #$7d00
|
||||||
|
@ -46,11 +48,17 @@ titleScreenCopyLoop:
|
||||||
; Set up audio
|
; Set up audio
|
||||||
jsr initSoundSystem
|
jsr initSoundSystem
|
||||||
|
|
||||||
|
; Render menu text
|
||||||
|
jsr titleScreenRenderMenu
|
||||||
|
|
||||||
; Fade in
|
; Fade in
|
||||||
lda #titlePalette
|
lda #titlePalette
|
||||||
sta PARAML2
|
sta PARAML2
|
||||||
jsr paletteFade
|
jsr paletteFade
|
||||||
|
|
||||||
|
ldy #CAT0_VRAM ; Save a generic background to erase cats
|
||||||
|
jsr protectAnimation16x16
|
||||||
|
|
||||||
titleScreenMainLoop:
|
titleScreenMainLoop:
|
||||||
|
|
||||||
; Track animations
|
; Track animations
|
||||||
|
@ -67,6 +75,9 @@ titleScreenMainLoop:
|
||||||
lda #CAT_DELAY
|
lda #CAT_DELAY
|
||||||
sta animationDelay0
|
sta animationDelay0
|
||||||
|
|
||||||
|
ldy #CAT0_VRAM
|
||||||
|
jsr unrenderAnimation16x16
|
||||||
|
|
||||||
; Render next frame of cats
|
; Render next frame of cats
|
||||||
lda #titleAnimationPos0
|
lda #titleAnimationPos0
|
||||||
sta PARAML0
|
sta PARAML0
|
||||||
|
@ -78,7 +89,7 @@ titleScreenMainLoop:
|
||||||
|
|
||||||
titleScreenStillCat:
|
titleScreenStillCat:
|
||||||
sta animationDelay0
|
sta animationDelay0
|
||||||
ldy #$5d79
|
ldy #CAT0_VRAM
|
||||||
lda #29
|
lda #29
|
||||||
jsr drawSpriteBankSafe
|
jsr drawSpriteBankSafe
|
||||||
|
|
||||||
|
@ -89,6 +100,9 @@ titleScreenNextCat:
|
||||||
lda #CAT_DELAY
|
lda #CAT_DELAY
|
||||||
sta animationDelay1
|
sta animationDelay1
|
||||||
|
|
||||||
|
ldy #CAT1_VRAM
|
||||||
|
jsr unrenderAnimation16x16
|
||||||
|
|
||||||
lda #titleAnimationPos1
|
lda #titleAnimationPos1
|
||||||
sta PARAML0
|
sta PARAML0
|
||||||
ldx #TITLE_ANIMATION_FRAMES
|
ldx #TITLE_ANIMATION_FRAMES
|
||||||
|
@ -99,7 +113,7 @@ titleScreenNextCat:
|
||||||
|
|
||||||
titleScreenStillCat2:
|
titleScreenStillCat2:
|
||||||
sta animationDelay1
|
sta animationDelay1
|
||||||
ldy #$5da0
|
ldy #CAT1_VRAM
|
||||||
lda #20
|
lda #20
|
||||||
jsr drawSpriteBankSafe
|
jsr drawSpriteBankSafe
|
||||||
|
|
||||||
|
@ -107,14 +121,53 @@ titleScreenKeyboard:
|
||||||
; Check for selection
|
; Check for selection
|
||||||
jsr kbdScanTitle
|
jsr kbdScanTitle
|
||||||
lda menuActionRequested
|
lda menuActionRequested
|
||||||
beq titleScreenMainLoop
|
beq titleScreenMainLoopEndFrame
|
||||||
|
|
||||||
jmp beginGameplay
|
cmp #-1
|
||||||
|
beq titleScreenKeyboardMenuUp
|
||||||
|
cmp #1
|
||||||
|
beq titleScreenKeyboardMenuDown
|
||||||
|
cmp #2
|
||||||
|
beq titleScreenKeyboardMenuGo
|
||||||
|
bra titleScreenMainLoopEndFrame
|
||||||
|
|
||||||
titleScreenResetAnimation:
|
titleScreenResetAnimation:
|
||||||
stz titleAnimationCounter
|
stz titleAnimationCounter
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
titleScreenKeyboardMenuUp:
|
||||||
|
lda menuSelection
|
||||||
|
beq titleScreenMainLoopEndFrame
|
||||||
|
dec
|
||||||
|
sta menuSelection
|
||||||
|
jsr titleScreenRenderMenu
|
||||||
|
bra titleScreenMainLoopEndFrame
|
||||||
|
|
||||||
|
titleScreenKeyboardMenuDown:
|
||||||
|
lda menuSelection
|
||||||
|
cmp #2
|
||||||
|
beq titleScreenMainLoopEndFrame
|
||||||
|
inc
|
||||||
|
sta menuSelection
|
||||||
|
jsr titleScreenRenderMenu
|
||||||
|
bra titleScreenMainLoopEndFrame
|
||||||
|
|
||||||
|
titleScreenKeyboardMenuGo:
|
||||||
|
lda menuSelection
|
||||||
|
beq titleScreenBeginGame
|
||||||
|
cmp #2
|
||||||
|
beq titleScreenQuit
|
||||||
|
|
||||||
|
titleScreenMainLoopEndFrame:
|
||||||
|
stz menuActionRequested
|
||||||
|
jmp titleScreenMainLoop
|
||||||
|
|
||||||
|
titleScreenBeginGame:
|
||||||
|
jmp beginGameplay
|
||||||
|
|
||||||
|
titleScreenQuit:
|
||||||
|
jmp quitGame
|
||||||
|
|
||||||
titleAnimationCounter:
|
titleAnimationCounter:
|
||||||
.word 0
|
.word 0
|
||||||
titleAnimationPos0:
|
titleAnimationPos0:
|
||||||
|
@ -127,3 +180,100 @@ animationDelay1:
|
||||||
.word CAT_DELAY
|
.word CAT_DELAY
|
||||||
menuActionRequested:
|
menuActionRequested:
|
||||||
.word 0
|
.word 0
|
||||||
|
selectionString:
|
||||||
|
pstring "[[[[[[[[[[[[[[[["
|
||||||
|
unselectionString:
|
||||||
|
pstring "\\\\\\\\\\\\\\\\"
|
||||||
|
startString:
|
||||||
|
pstring "BEGIN GAME"
|
||||||
|
helpString:
|
||||||
|
pstring "HOW TO PLAY"
|
||||||
|
quitString:
|
||||||
|
pstring "QUIT"
|
||||||
|
menuSelection:
|
||||||
|
.word 0
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
; titleScreenRenderMenu
|
||||||
|
;
|
||||||
|
; Render the game menu
|
||||||
|
;
|
||||||
|
; Trashes A
|
||||||
|
;
|
||||||
|
titleScreenRenderMenu:
|
||||||
|
|
||||||
|
ldy #$78f0
|
||||||
|
jsr titleScreenUnRenderSelection
|
||||||
|
lda menuSelection
|
||||||
|
bne titleScreenRenderMenuItem0
|
||||||
|
ldy #$78f0
|
||||||
|
jsr titleScreenRenderSelection
|
||||||
|
|
||||||
|
titleScreenRenderMenuItem0:
|
||||||
|
lda #startString
|
||||||
|
sta PARAML0
|
||||||
|
lda #1
|
||||||
|
ldy #$78fc
|
||||||
|
jsl renderStringFar
|
||||||
|
|
||||||
|
ldy #$7f30
|
||||||
|
jsr titleScreenUnRenderSelection
|
||||||
|
lda menuSelection
|
||||||
|
cmp #1
|
||||||
|
bne titleScreenRenderMenuItem1
|
||||||
|
ldy #$7f30
|
||||||
|
jsr titleScreenRenderSelection
|
||||||
|
|
||||||
|
titleScreenRenderMenuItem1:
|
||||||
|
lda #helpString
|
||||||
|
sta PARAML0
|
||||||
|
lda #1
|
||||||
|
ldy #$7f39
|
||||||
|
jsl renderStringFar
|
||||||
|
|
||||||
|
ldy #$8570
|
||||||
|
jsr titleScreenUnRenderSelection
|
||||||
|
lda menuSelection
|
||||||
|
cmp #2
|
||||||
|
bne titleScreenRenderMenuItem2
|
||||||
|
ldy #$8570
|
||||||
|
jsr titleScreenRenderSelection
|
||||||
|
|
||||||
|
titleScreenRenderMenuItem2:
|
||||||
|
lda #quitString
|
||||||
|
sta PARAML0
|
||||||
|
lda #1
|
||||||
|
ldy #$8588
|
||||||
|
jsl renderStringFar
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
; titleScreenRenderSelection
|
||||||
|
;
|
||||||
|
; Render the menu selection bar
|
||||||
|
;
|
||||||
|
; Y = VRAM position of bar
|
||||||
|
;
|
||||||
|
titleScreenRenderSelection:
|
||||||
|
lda #selectionString
|
||||||
|
sta PARAML0
|
||||||
|
lda #1
|
||||||
|
jsl renderStringFar
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
; titleScreenUnRenderSelection
|
||||||
|
;
|
||||||
|
; Unrender the menu selection bar
|
||||||
|
;
|
||||||
|
; Y = VRAM position of bar
|
||||||
|
;
|
||||||
|
titleScreenUnRenderSelection:
|
||||||
|
lda #unselectionString
|
||||||
|
sta PARAML0
|
||||||
|
lda #1
|
||||||
|
jsl renderStringFar
|
||||||
|
rts
|
||||||
|
|
Loading…
Reference in New Issue