help screen

This commit is contained in:
4am 2020-07-10 14:56:07 -04:00
parent 6e7ba299b2
commit bb668ee1f9
5 changed files with 134 additions and 40 deletions

View File

@ -50,7 +50,7 @@ Start
lda #0 lda #0
sta gSelectedLogicalColumn sta gSelectedLogicalColumn
jsr DrawPuzzleChrome jsr DrawPuzzleChrome
jsr ClearAndDrawPuzzle jsr DrawPuzzle
jsr AnimatePuzzleIntoPlace jsr AnimatePuzzleIntoPlace
jsr DrawColumnSelectionIndicator jsr DrawColumnSelectionIndicator
@ -76,6 +76,7 @@ Start
!source "src/ui.main.menu.a" !source "src/ui.main.menu.a"
!source "src/ui.about.a" !source "src/ui.about.a"
!source "src/ui.play.a" !source "src/ui.play.a"
!source "src/ui.help.a"
!source "src/ui.message.a" !source "src/ui.message.a"
!source "src/ui.common.a" !source "src/ui.common.a"
!source "src/puzzle.a" !source "src/puzzle.a"

79
src/ui.help.a Normal file
View File

@ -0,0 +1,79 @@
;license:MIT
;(c) 2020 by 4am
;
; display help screen
;
; Public functions:
; - HelpEventLoop
;
;0123456789012345678901234567890123456789
;
;
;
; MOVE COLUMNS TO FORM WORDS
;
; USE ALL LETTERS TO ADVANCE
;
;
; *
;
;
;LEFT/RIGHT ARROWS..........SELECT COLUMN
;
;UP/DOWN ARROWS...............MOVE COLUMN
;
;A-Z.......................MOVE TO LETTER
;
;CTRL-R....................RESTART PUZZLE
;
;ESC............................MAIN MENU
;
;
;
;
help_info1
!byte 26
!raw "MOVE COLUMNS TO FORM WORDS"
help_info2
!byte 26
!raw "USE ALL LETTERS TO ADVANCE"
help_leftright
!byte 40
!raw "LEFT/RIGHT ARROWS..........SELECT COLUMN"
help_updown
!byte 40
!raw "UP/DOWN ARROWS...............MOVE COLUMN"
help_az
!byte 40
!raw "A-Z.......................MOVE TO LETTER"
help_ctrlr
!byte 40
!raw "CTRL-R....................RESTART PUZZLE"
help_esc
!byte 40
!raw "ESC............................MAIN MENU"
HelpEventLoop
jsr Home
jsr DrawHelpText
bit CLEARKBD
- lda KBD
bpl -
bit CLEARKBD
sec
rts
DrawHelpText
bit TEXTMODE
+PRINT_AT help_info1, 3, 7
+PRINT_AT help_info2, 5, 7
+PRINT_AT asterisk, 8, 20
+PRINT_AT help_leftright, 11, 0
+PRINT_AT help_updown, 13, 0
+PRINT_AT help_az, 15, 0
+PRINT_AT help_ctrlr, 17, 0
+PRINT_AT help_esc, 19, 0
bit GFXMODE
rts

View File

@ -19,6 +19,8 @@ kMainMenuKeys ; must keep in sync with kMainMenuKeyHandle
!byte $03 ; Ctrl-C !byte $03 ; Ctrl-C
!byte $53 ; S/s !byte $53 ; S/s
!byte $13 ; Ctrl-S !byte $13 ; Ctrl-S
!byte $2F ; /
!byte $3F ; ?
!byte $51 ; Q/q !byte $51 ; Q/q
!byte $11 ; Ctrl-Q !byte $11 ; Ctrl-Q
!byte $1B ; Esc !byte $1B ; Esc
@ -30,6 +32,8 @@ kMainMenuKeyHandlersLo
!byte <MainMenuEventC !byte <MainMenuEventC
!byte <MainMenuEventS !byte <MainMenuEventS
!byte <MainMenuEventS !byte <MainMenuEventS
!byte <MainMenuEventQuestion
!byte <MainMenuEventQuestion
!byte <MainMenuEventQ !byte <MainMenuEventQ
!byte <MainMenuEventQ !byte <MainMenuEventQ
!byte <MainMenuEventQ !byte <MainMenuEventQ
@ -40,6 +44,8 @@ kMainMenuKeyHandlersHi
!byte >MainMenuEventC !byte >MainMenuEventC
!byte >MainMenuEventS !byte >MainMenuEventS
!byte >MainMenuEventS !byte >MainMenuEventS
!byte >MainMenuEventQuestion
!byte >MainMenuEventQuestion
!byte >MainMenuEventQ !byte >MainMenuEventQ
!byte >MainMenuEventQ !byte >MainMenuEventQ
!byte >MainMenuEventQ !byte >MainMenuEventQ
@ -86,6 +92,10 @@ MainMenuEventLoop
beq MainMenuEventLoop beq MainMenuEventLoop
rts rts
MainMenuEventQuestion
jsr HelpEventLoop
jmp +
MainMenuEventReturn MainMenuEventReturn
jsr SelectWorld jsr SelectWorld
bcs + ; in next event handler bcs + ; in next event handler
@ -137,17 +147,18 @@ DrawMainMenuTitle
DrawMainMenuText DrawMainMenuText
+PRINT_AT asterisk, 2, 30 +PRINT_AT asterisk, 2, 30
+PRINT_AT version, 11, 26 +PRINT_AT version, 11, 26
+PRINT_AT menuline_play, 15, 10 +PRINT_AT mainmenu_play, 15, 10
+PRINT_AT menuline_sound, 16, 10 +PRINT_AT mainmenu_sound, 16, 10
lda gSoundPref lda gSoundPref
beq @theSoundOfSilence beq @theSoundOfSilence
+LDADDR menuline_sound_on +LDADDR mainmenu_sound_on
bne + ; always branches bne + ; always branches
@theSoundOfSilence @theSoundOfSilence
+LDADDR menuline_sound_off +LDADDR mainmenu_sound_off
+ jsr DrawHeavySilkString + jsr DrawHeavySilkString
+PRINT_AT menuline_about, 17, 10 +PRINT_AT mainmenu_about, 17, 10
+PRINT_AT menuline_quit, 18, 10 +PRINT_AT mainmenu_help, 18, 10
+PRINT_AT mainmenu_quit, 19, 10
+PRINT_AT disclaimer, 23, 0 +PRINT_AT disclaimer, 23, 0
rts rts
@ -321,24 +332,27 @@ asterisk
version version
!byte 4 !byte 4
!raw "V0.3" !raw "V0.3"
menuline_play mainmenu_play
!byte 20 !byte 20
!raw "RETURN.....PLAY GAME" !raw "RETURN.....PLAY GAME"
menuline_sound mainmenu_sound
!byte 18 !byte 18
!raw "CTRL-S.....SOUND (" !raw " S.....SOUND ("
menuline_sound_on mainmenu_sound_on
!byte 4 !byte 4
!raw "ON) " !raw "ON) "
menuline_sound_off mainmenu_sound_off
!byte 4 !byte 4
!raw "OFF)" !raw "OFF)"
menuline_about mainmenu_about
!byte 18 !byte 18
!raw "CTRL-C.....CREDITS" !raw " C.....CREDITS"
menuline_quit mainmenu_help
!byte 15 !byte 15
!raw "CTRL-Q.....QUIT" !raw " ?.....HELP"
mainmenu_quit
!byte 15
!raw " Q.....QUIT"
disclaimer disclaimer
!byte 40 !byte 40
!raw "* NOT GUARANTEED, ACTUAL COUNT MAY VARY." !raw "* NOT GUARANTEED, ACTUAL COUNT MAY VARY."

View File

@ -9,19 +9,6 @@
; - HideMessage ; - HideMessage
; ;
;0123456789012345678901
; press ? for help
;
;0123456789012345678901
;letters can be reused
;
;0123456789012345678901
;3-word solution exists
;
;0123456789012345678901
; don't panic!
;
showingMessage ; [byte][private] showingMessage ; [byte][private]
!byte 0 ; 1 = currently showing message, 0 = not !byte 0 ; 1 = currently showing message, 0 = not

View File

@ -44,6 +44,8 @@ kPlayKeys ; must keep in sync with kPlayKeyHandlersLo
!byte $1B ; Esc !byte $1B ; Esc
!byte $12 ; Ctrl-R !byte $12 ; Ctrl-R
!byte $0D ; Return !byte $0D ; Return
!byte $2F ; /
!byte $3F ; ?
!byte $00 ; A-Z !byte $00 ; A-Z
kPlayKeyHandlersLo kPlayKeyHandlersLo
@ -54,6 +56,8 @@ kPlayKeyHandlersLo
!byte <PlayEventEsc !byte <PlayEventEsc
!byte <PlayEventCtrlR !byte <PlayEventCtrlR
!byte <PlayEventReturn !byte <PlayEventReturn
!byte <PlayEventQuestion
!byte <PlayEventQuestion
!byte <PlayEventLetter !byte <PlayEventLetter
kPlayKeyHandlersHi kPlayKeyHandlersHi
@ -64,6 +68,8 @@ kPlayKeyHandlersHi
!byte >PlayEventEsc !byte >PlayEventEsc
!byte >PlayEventCtrlR !byte >PlayEventCtrlR
!byte >PlayEventReturn !byte >PlayEventReturn
!byte >PlayEventQuestion
!byte >PlayEventQuestion
!byte >PlayEventLetter !byte >PlayEventLetter
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -177,6 +183,15 @@ MoveToFirstColumn
ldx #kKeepPlaying ldx #kKeepPlaying
rts rts
PlayEventQuestion
jsr HelpEventLoop
jsr Home
jsr DrawPuzzleChrome
jsr DrawPuzzle
jsr DrawColumnSelectionIndicator
ldx #kKeepPlaying
rts
- jsr PlayNextChord - jsr PlayNextChord
PlayEventLetter PlayEventLetter
lda gLastKeyPressed lda gLastKeyPressed
@ -235,14 +250,14 @@ CheckForPuzzleComplete
rts rts
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ClearAndDrawPuzzle ; DrawPuzzle
; clears screen and draws current puzzle (but not column selection indicator or ; draws letters in current puzzle (but not column selection indicator or
; other UI elements) ; other UI elements)
; ;
; in: none ; in: none
; out: all registers and flags clobbered ; out: all registers and flags clobbered
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
ClearAndDrawPuzzle DrawPuzzle
jsr DrawThinLines jsr DrawThinLines
+LDADDR puzzle_data0 +LDADDR puzzle_data0
+ST16 $FE +ST16 $FE
@ -260,10 +275,8 @@ ClearAndDrawPuzzle
bcc + bcc +
inc $FF inc $FF
+ inx + inx
cpx puzzle_logical_height cpx #9
bne -- bne --
bit GFXMODE
rts rts
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -285,13 +298,14 @@ AnimatePuzzleIntoPlace
iny iny
@max cpy #$FD ; SMC @max cpy #$FD ; SMC
bne -- bne --
jmp ShowMessage jsr ShowMessage
+LDADDR noMessage
jmp SetNextMessage
; ;
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; DrawPuzzleChrome ; DrawPuzzleChrome
; draw all elements on puzzle screen that are not the actual puzzle ; draw all elements on puzzle screen that are not the actual puzzle
; (e.g. column selection indicator, game title, help text) ; (game title, level)
; ;
; in: none ; in: none
; out: all registers and flags clobbered ; out: all registers and flags clobbered
@ -328,8 +342,7 @@ DrawPuzzleChrome
lda #$30 ; padding character ('0') lda #$30 ; padding character ('0')
jsr ToASCIIString jsr ToASCIIString
+LDADDR $00F1 +LDADDR $00F1
jsr DrawHeavySilkString jmp DrawHeavySilkString
jmp DrawColumnSelectionIndicator
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; AnimatePuzzleCompleted ; AnimatePuzzleCompleted