Esc switches between major modes, add input timeout to search mode too

This commit is contained in:
4am 2019-06-20 13:56:31 -04:00
parent 94f9499ea0
commit 9c65662193
8 changed files with 56 additions and 30 deletions

View File

@ -102,9 +102,9 @@ dsk: md asm
rsync -aP res/fx/* build/FX >>build/log
$(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/FX" "build/FX" >>build/log
$(CADIUS) CREATEFOLDER build/"$(DISK)" "/${VOLUME}/X/" >>build/log
# bin/do2po.py res/dsk/ build/po/
# rsync -a res/dsk/*.po build/po/
# bin/extract.py build/po/ | sh >>build/log
bin/do2po.py res/dsk/ build/po/
rsync -a res/dsk/*.po build/po/
bin/extract.py build/po/ | sh >>build/log
rm -f build/X/**/.DS_Store
rm -f build/X/**/PRODOS
rm -f build/X/**/LOADER.SYSTEM

View File

@ -47,11 +47,22 @@ Main
cmp #$8D
bne +
jsr Play
+ cmp #$9B
bne +
lda Mode
eor #$80
sta Mode
+
bit $C010
; jsr AttractMode
bit Mode
bpl +
jsr AttractMode
jmp @loop
+
jsr SearchMode
jmp @loop
Mode
!byte $80
; these routines will only be called after relocating to language card
!source "src/ui.search.mode.a"

View File

@ -45,7 +45,7 @@ MachineStatus =$F0 ; bit 7 = 1 if machine has joystick
; $FF ; used by ParseGamesList
; main memory
gPathname = $1F00 ; used by ResetPath/AddToPath
gPathname = $1F00 ; used by SetPath/AddToPath
gKeyLen = $1F00 ; used by ParseGamesList
gKey = $1F01
gValLen = $1F80
@ -53,3 +53,5 @@ gVal = $1F81
; actual constants
SUPPORTS_SHR = %00110000 ; AND mask for MachineStatus
kAttractMode = %10000000
kSearchMode = %00000000

View File

@ -71,8 +71,9 @@ SaveGlobalPreferences
+LDADDR @kEOF
jsr @addString
+LDADDR kGlobalPrefsFilename
jsr SetPath
jsr SaveSmallFile
!word kGlobalPrefsFilename
!word kGlobalPrefsBuffer
rts

View File

@ -50,19 +50,6 @@ kFXDirectory
!byte 2
!raw "FX"
;------------------------------------------------------------------------------
; ResetPath
; reset gPathname to length 0
;
; in: none
; out: X = 0
; A/Y preserved
;------------------------------------------------------------------------------
ResetPath
ldx #0
stx gPathname
rts
;------------------------------------------------------------------------------
; SetPath/AddToPath
; append a length-prefixed string to gPathname
@ -75,7 +62,8 @@ ResetPath
; gPathname updated with concatenated length-prefixed string
;------------------------------------------------------------------------------
SetPath
jsr ResetPath
ldx #0
stx gPathname
; execution falls through here
AddToPath
+STAY $00

View File

@ -120,15 +120,13 @@ DHGRTitleCallback
stx gCurrentlyVisibleSlideshowIndex
; load DHGR screenshot at $4000/main and $4000/aux
jsr ResetPath
+LDADDR kDHGRTitleDirectory
jsr AddToPath
jsr SetPath
+LDADDR kPathSeparator
jsr AddToPath
+LDAY PTR
jsr AddToPath
jsr LoadDHRFile
!word gPathname
; execution falls through here
ExecuteTransition
@ -166,15 +164,13 @@ DHGRActionCallback
stx gCurrentlyVisibleSlideshowIndex
; load DHGR screenshot at $4000/main and $4000/aux
jsr ResetPath
+LDADDR kDHGRActionDirectory
jsr AddToPath
jsr SetPath
+LDADDR kPathSeparator
jsr AddToPath
+LDAY PTR
jsr AddToPath
jsr LoadDHRFile
!word gPathname
jmp ExecuteTransition
;------------------------------------------------------------------------------

View File

@ -135,14 +135,14 @@ HGRActionCallback
@key3 !word $FDFD ; SMC
bcs @noname ; should never happen
@foundname
+STAY PTR
+STAY SAVE
@drawname
ldx #0
stx HTAB
ldx #22
stx VTAB
ldy #0
lda (PTR),y
lda (SAVE),y
tax
+LDADDR @topline
sec
@ -158,7 +158,9 @@ HGRActionCallback
+LDADDR @rightline
sec
jsr DrawBuffer
+LDAY PTR
+LDAY SAVE
jsr SetPath
+LDADDR gPathname
sec
jsr DrawString
ldx #2

View File

@ -32,10 +32,28 @@ SearchMode
bit $C057
bit $C050
bit $C010
jsr _ResetInputTimeout
InputLoop
- lda $C000
bpl -
bmi +
dec $4F
bne -
dec $4E
bne -
dec $4D
bne -
lda #kAttractMode ; no input for ~30 seconds
sta Mode ; switch to attract mode
rts
+
cmp #$9B ; Esc with no input returns to caller
bne + ; and switches to attract mode
ldx InputLength
bne +
rts
+
bit $C010
jsr _ResetInputTimeout
and #$7F
cmp #$7F ; delete key
@ -307,6 +325,14 @@ _UpdateGameCount
!byte 10
!byte 1
_ResetInputTimeout
; clobbers X, preserves A/Y
ldx #$24
stx $4D ; timeout counter
stx $4E
stx $4F
rts
;------------------------------------------------------------------------------
Cover !byte 5