diff --git a/Makefile b/Makefile index ffef83b67..16a12e392 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/src/4cade.a b/src/4cade.a index b457d1efa..016c10ae7 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -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" diff --git a/src/constants.a b/src/constants.a index b5beb0eb9..8cd71d899 100644 --- a/src/constants.a +++ b/src/constants.a @@ -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 diff --git a/src/parse.prefs.a b/src/parse.prefs.a index 11635a772..5d8232c00 100644 --- a/src/parse.prefs.a +++ b/src/parse.prefs.a @@ -71,8 +71,9 @@ SaveGlobalPreferences +LDADDR @kEOF jsr @addString + +LDADDR kGlobalPrefsFilename + jsr SetPath jsr SaveSmallFile - !word kGlobalPrefsFilename !word kGlobalPrefsBuffer rts diff --git a/src/prodos.path.a b/src/prodos.path.a index 137cb3604..afb8068b4 100644 --- a/src/prodos.path.a +++ b/src/prodos.path.a @@ -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 diff --git a/src/ui.attract.dhgr.a b/src/ui.attract.dhgr.a index e10cf60e8..8a174b50c 100644 --- a/src/ui.attract.dhgr.a +++ b/src/ui.attract.dhgr.a @@ -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 ;------------------------------------------------------------------------------ diff --git a/src/ui.attract.hgr.a b/src/ui.attract.hgr.a index 5e99f3e9f..1a579f5a5 100644 --- a/src/ui.attract.hgr.a +++ b/src/ui.attract.hgr.a @@ -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 diff --git a/src/ui.search.mode.a b/src/ui.search.mode.a index 12ed94e3c..1c7d61448 100644 --- a/src/ui.search.mode.a +++ b/src/ui.search.mode.a @@ -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