add hotkey to skip to next puzzle

This commit is contained in:
4am 2022-01-16 11:04:17 -05:00
parent 434a17f134
commit 16ab81e1cc
5 changed files with 35 additions and 13 deletions

View File

@ -66,6 +66,12 @@ Start ; X = Mockingboard slot (from init)
jsr MaybeShowInterstitial
bcc @Play
bcs @GoToMainMenu
+
cpx #kRequestedSkip
bne +
ldx gPuzzleID
jsr MarkPuzzleSkipped
jmp @Play
+
cpx #kRequestedRestart
bne +

View File

@ -252,7 +252,7 @@ LoadPuzzleFromMemory
!raw " "
;------------------------------------------------------------------------------
; MarkPuzzleCompleted
; MarkPuzzleCompleted/MarkPuzzleSkipped
;
; in: X = puzzle ID
; out: A = next puzzle ID
@ -263,14 +263,18 @@ MarkPuzzleCompleted
; memory for easy access
; Mark this puzzle as completed in the unpacked table
lda #1
!byte $2C
MarkPuzzleSkipped
lda #0
sta PROGRESS, x
; Find the next uncompleted puzzle
clc
beq @next
+HIDE_NEXT_BYTE
-- sec
- lda PROGRESS, x
beq +
inx
beq @done
@next inx
cpx #100
bne -
ldx #0 ; start over at the puzzle 0
@ -279,7 +283,7 @@ MarkPuzzleCompleted
; have been completed (yay!), and we'll leave X at 0.
; If we branch here, we found the next uncompleted puzzle
; and X contains that puzzle ID.
+ txa
@done txa
pha ; push next puzzle ID
;
; Completion status for all puzzles across all worlds is stored in packed

View File

@ -27,13 +27,14 @@ HelpEventLoop
DrawHelpText
; [private]
bit TEXTMODE
+PRINT_AT sHelpHeader1, 3, 7
+PRINT_AT sHelpHeader2, 5, 7
+PRINT_AT sAsterisk, 8, 20
+PRINT_AT sHelpLeftRight, 11, 0
+PRINT_AT sHelpUpDown, 13, 0
+PRINT_AT sHelpLetters, 15, 0
+PRINT_AT sHelpRestart, 17, 0
+PRINT_AT sHelpQuit, 19, 0
+PRINT_AT sHelpHeader1, 2, 7
+PRINT_AT sHelpHeader2, 4, 7
+PRINT_AT sAsterisk, 7, 20
+PRINT_AT sHelpLeftRight, 10, 0
+PRINT_AT sHelpUpDown, 12, 0
+PRINT_AT sHelpLetters, 14, 0
+PRINT_AT sHelpRestart, 16, 0
+PRINT_AT sHelpSkip, 18, 0
+PRINT_AT sHelpQuit, 20, 0
bit GFXMODE
rts

View File

@ -15,7 +15,8 @@
kKeepPlaying = 0 ; This code is checked with BEQ/BNE, so it must be 0
kCompletedPuzzle = 1 ; All non-zero codes will exit play event loop
kRequestedRestart = 2 ; with the code in X so caller knows what happened
kReturnToMainMenu = 3
kRequestedSkip = 3
kReturnToMainMenu = 4
gSelectedLogicalColumn
!byte 0
@ -43,6 +44,7 @@ kPlayKeys ; must keep in sync with kPlayKeyHandlersLo
!byte $15 ; right arrow
!byte $1B ; Esc
!byte $12 ; Ctrl-R
!byte $0E ; Ctrl-N
!byte $0D ; Return
!byte $2F ; /
!byte $3F ; ?
@ -55,6 +57,7 @@ kPlayKeyHandlersLo
!byte <PlayEventRightArrow
!byte <PlayEventEsc
!byte <PlayEventCtrlR
!byte <PlayEventCtrlN
!byte <PlayEventReturn
!byte <PlayEventQuestion
!byte <PlayEventQuestion
@ -67,6 +70,7 @@ kPlayKeyHandlersHi
!byte >PlayEventRightArrow
!byte >PlayEventEsc
!byte >PlayEventCtrlR
!byte >PlayEventCtrlN
!byte >PlayEventReturn
!byte >PlayEventQuestion
!byte >PlayEventQuestion
@ -125,6 +129,10 @@ PlayEventCtrlR
ldx #kRequestedRestart ; caller will exit play event loop
rts
PlayEventCtrlN
ldx #kRequestedSkip ; caller will exit play event loop
rts
PlayEventReturn
ldy gSelectedLogicalColumn
beq +

View File

@ -144,6 +144,9 @@ sHelpLetters
sHelpRestart
!byte 40
!raw "CTRL-R....................RESTART PUZZLE"
sHelpSkip
!byte 40
!raw "CTRL-N.......................NEXT PUZZLE"
sHelpQuit
!byte 40
!raw "ESC............................MAIN MENU"