mirror of
https://github.com/a2-4am/4cade.git
synced 2024-09-29 09:55:29 +00:00
Esc switches between major modes, add input timeout to search mode too
This commit is contained in:
parent
94f9499ea0
commit
9c65662193
6
Makefile
6
Makefile
@ -102,9 +102,9 @@ dsk: md asm
|
|||||||
rsync -aP res/fx/* build/FX >>build/log
|
rsync -aP res/fx/* build/FX >>build/log
|
||||||
$(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/FX" "build/FX" >>build/log
|
$(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/FX" "build/FX" >>build/log
|
||||||
$(CADIUS) CREATEFOLDER build/"$(DISK)" "/${VOLUME}/X/" >>build/log
|
$(CADIUS) CREATEFOLDER build/"$(DISK)" "/${VOLUME}/X/" >>build/log
|
||||||
# bin/do2po.py res/dsk/ build/po/
|
bin/do2po.py res/dsk/ build/po/
|
||||||
# rsync -a res/dsk/*.po build/po/
|
rsync -a res/dsk/*.po build/po/
|
||||||
# bin/extract.py build/po/ | sh >>build/log
|
bin/extract.py build/po/ | sh >>build/log
|
||||||
rm -f build/X/**/.DS_Store
|
rm -f build/X/**/.DS_Store
|
||||||
rm -f build/X/**/PRODOS
|
rm -f build/X/**/PRODOS
|
||||||
rm -f build/X/**/LOADER.SYSTEM
|
rm -f build/X/**/LOADER.SYSTEM
|
||||||
|
13
src/4cade.a
13
src/4cade.a
@ -47,11 +47,22 @@ Main
|
|||||||
cmp #$8D
|
cmp #$8D
|
||||||
bne +
|
bne +
|
||||||
jsr Play
|
jsr Play
|
||||||
|
+ cmp #$9B
|
||||||
|
bne +
|
||||||
|
lda Mode
|
||||||
|
eor #$80
|
||||||
|
sta Mode
|
||||||
+
|
+
|
||||||
bit $C010
|
bit $C010
|
||||||
; jsr AttractMode
|
bit Mode
|
||||||
|
bpl +
|
||||||
|
jsr AttractMode
|
||||||
|
jmp @loop
|
||||||
|
+
|
||||||
jsr SearchMode
|
jsr SearchMode
|
||||||
jmp @loop
|
jmp @loop
|
||||||
|
Mode
|
||||||
|
!byte $80
|
||||||
|
|
||||||
; these routines will only be called after relocating to language card
|
; these routines will only be called after relocating to language card
|
||||||
!source "src/ui.search.mode.a"
|
!source "src/ui.search.mode.a"
|
||||||
|
@ -45,7 +45,7 @@ MachineStatus =$F0 ; bit 7 = 1 if machine has joystick
|
|||||||
; $FF ; used by ParseGamesList
|
; $FF ; used by ParseGamesList
|
||||||
|
|
||||||
; main memory
|
; main memory
|
||||||
gPathname = $1F00 ; used by ResetPath/AddToPath
|
gPathname = $1F00 ; used by SetPath/AddToPath
|
||||||
gKeyLen = $1F00 ; used by ParseGamesList
|
gKeyLen = $1F00 ; used by ParseGamesList
|
||||||
gKey = $1F01
|
gKey = $1F01
|
||||||
gValLen = $1F80
|
gValLen = $1F80
|
||||||
@ -53,3 +53,5 @@ gVal = $1F81
|
|||||||
|
|
||||||
; actual constants
|
; actual constants
|
||||||
SUPPORTS_SHR = %00110000 ; AND mask for MachineStatus
|
SUPPORTS_SHR = %00110000 ; AND mask for MachineStatus
|
||||||
|
kAttractMode = %10000000
|
||||||
|
kSearchMode = %00000000
|
||||||
|
@ -71,8 +71,9 @@ SaveGlobalPreferences
|
|||||||
+LDADDR @kEOF
|
+LDADDR @kEOF
|
||||||
jsr @addString
|
jsr @addString
|
||||||
|
|
||||||
|
+LDADDR kGlobalPrefsFilename
|
||||||
|
jsr SetPath
|
||||||
jsr SaveSmallFile
|
jsr SaveSmallFile
|
||||||
!word kGlobalPrefsFilename
|
|
||||||
!word kGlobalPrefsBuffer
|
!word kGlobalPrefsBuffer
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
@ -50,19 +50,6 @@ kFXDirectory
|
|||||||
!byte 2
|
!byte 2
|
||||||
!raw "FX"
|
!raw "FX"
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
|
||||||
; ResetPath
|
|
||||||
; reset gPathname to length 0
|
|
||||||
;
|
|
||||||
; in: none
|
|
||||||
; out: X = 0
|
|
||||||
; A/Y preserved
|
|
||||||
;------------------------------------------------------------------------------
|
|
||||||
ResetPath
|
|
||||||
ldx #0
|
|
||||||
stx gPathname
|
|
||||||
rts
|
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; SetPath/AddToPath
|
; SetPath/AddToPath
|
||||||
; append a length-prefixed string to gPathname
|
; append a length-prefixed string to gPathname
|
||||||
@ -75,7 +62,8 @@ ResetPath
|
|||||||
; gPathname updated with concatenated length-prefixed string
|
; gPathname updated with concatenated length-prefixed string
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
SetPath
|
SetPath
|
||||||
jsr ResetPath
|
ldx #0
|
||||||
|
stx gPathname
|
||||||
; execution falls through here
|
; execution falls through here
|
||||||
AddToPath
|
AddToPath
|
||||||
+STAY $00
|
+STAY $00
|
||||||
|
@ -120,15 +120,13 @@ DHGRTitleCallback
|
|||||||
stx gCurrentlyVisibleSlideshowIndex
|
stx gCurrentlyVisibleSlideshowIndex
|
||||||
|
|
||||||
; load DHGR screenshot at $4000/main and $4000/aux
|
; load DHGR screenshot at $4000/main and $4000/aux
|
||||||
jsr ResetPath
|
|
||||||
+LDADDR kDHGRTitleDirectory
|
+LDADDR kDHGRTitleDirectory
|
||||||
jsr AddToPath
|
jsr SetPath
|
||||||
+LDADDR kPathSeparator
|
+LDADDR kPathSeparator
|
||||||
jsr AddToPath
|
jsr AddToPath
|
||||||
+LDAY PTR
|
+LDAY PTR
|
||||||
jsr AddToPath
|
jsr AddToPath
|
||||||
jsr LoadDHRFile
|
jsr LoadDHRFile
|
||||||
!word gPathname
|
|
||||||
; execution falls through here
|
; execution falls through here
|
||||||
|
|
||||||
ExecuteTransition
|
ExecuteTransition
|
||||||
@ -166,15 +164,13 @@ DHGRActionCallback
|
|||||||
stx gCurrentlyVisibleSlideshowIndex
|
stx gCurrentlyVisibleSlideshowIndex
|
||||||
|
|
||||||
; load DHGR screenshot at $4000/main and $4000/aux
|
; load DHGR screenshot at $4000/main and $4000/aux
|
||||||
jsr ResetPath
|
|
||||||
+LDADDR kDHGRActionDirectory
|
+LDADDR kDHGRActionDirectory
|
||||||
jsr AddToPath
|
jsr SetPath
|
||||||
+LDADDR kPathSeparator
|
+LDADDR kPathSeparator
|
||||||
jsr AddToPath
|
jsr AddToPath
|
||||||
+LDAY PTR
|
+LDAY PTR
|
||||||
jsr AddToPath
|
jsr AddToPath
|
||||||
jsr LoadDHRFile
|
jsr LoadDHRFile
|
||||||
!word gPathname
|
|
||||||
jmp ExecuteTransition
|
jmp ExecuteTransition
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
|
@ -135,14 +135,14 @@ HGRActionCallback
|
|||||||
@key3 !word $FDFD ; SMC
|
@key3 !word $FDFD ; SMC
|
||||||
bcs @noname ; should never happen
|
bcs @noname ; should never happen
|
||||||
@foundname
|
@foundname
|
||||||
+STAY PTR
|
+STAY SAVE
|
||||||
@drawname
|
@drawname
|
||||||
ldx #0
|
ldx #0
|
||||||
stx HTAB
|
stx HTAB
|
||||||
ldx #22
|
ldx #22
|
||||||
stx VTAB
|
stx VTAB
|
||||||
ldy #0
|
ldy #0
|
||||||
lda (PTR),y
|
lda (SAVE),y
|
||||||
tax
|
tax
|
||||||
+LDADDR @topline
|
+LDADDR @topline
|
||||||
sec
|
sec
|
||||||
@ -158,7 +158,9 @@ HGRActionCallback
|
|||||||
+LDADDR @rightline
|
+LDADDR @rightline
|
||||||
sec
|
sec
|
||||||
jsr DrawBuffer
|
jsr DrawBuffer
|
||||||
+LDAY PTR
|
+LDAY SAVE
|
||||||
|
jsr SetPath
|
||||||
|
+LDADDR gPathname
|
||||||
sec
|
sec
|
||||||
jsr DrawString
|
jsr DrawString
|
||||||
ldx #2
|
ldx #2
|
||||||
|
@ -32,10 +32,28 @@ SearchMode
|
|||||||
bit $C057
|
bit $C057
|
||||||
bit $C050
|
bit $C050
|
||||||
bit $C010
|
bit $C010
|
||||||
|
jsr _ResetInputTimeout
|
||||||
InputLoop
|
InputLoop
|
||||||
- lda $C000
|
- 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
|
bit $C010
|
||||||
|
jsr _ResetInputTimeout
|
||||||
and #$7F
|
and #$7F
|
||||||
|
|
||||||
cmp #$7F ; delete key
|
cmp #$7F ; delete key
|
||||||
@ -307,6 +325,14 @@ _UpdateGameCount
|
|||||||
!byte 10
|
!byte 10
|
||||||
!byte 1
|
!byte 1
|
||||||
|
|
||||||
|
_ResetInputTimeout
|
||||||
|
; clobbers X, preserves A/Y
|
||||||
|
ldx #$24
|
||||||
|
stx $4D ; timeout counter
|
||||||
|
stx $4E
|
||||||
|
stx $4F
|
||||||
|
rts
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
|
|
||||||
Cover !byte 5
|
Cover !byte 5
|
||||||
|
Loading…
Reference in New Issue
Block a user