From 0036d0cf5d03baf49d26f338929c0afd93609783 Mon Sep 17 00:00:00 2001 From: 4am Date: Fri, 28 Dec 2018 15:08:36 -0500 Subject: [PATCH] reload ATTRACT.CONF and reparse into gAttractModeStore, which is now at 0x6000 and is overwritten after loading the current attract mode module from disk and saving the name of the next attract mode module --- res/_FileInformation.txt | 10 +++---- src/4cade.init.a | 59 +++------------------------------------- src/parse.common.a | 2 +- src/ui.attract.mode.a | 57 +++++++++++++++++++++++++++++++++++--- 4 files changed, 63 insertions(+), 65 deletions(-) diff --git a/res/_FileInformation.txt b/res/_FileInformation.txt index e0049b05b..a9358aa05 100644 --- a/res/_FileInformation.txt +++ b/res/_FileInformation.txt @@ -1,8 +1,8 @@ PRODOS=Type(FF),AuxType(0000),Access(C3) LAUNCHER.SYSTEM=Type(FF),AuxType(2000),Access(C3) -PREFS.CONF=Type(04),AuxType(4000),Access(C3) -GAMES.CONF=Type(04),AuxType(4000),Access(C3) -ATTRACT.CONF=Type(04),AuxType(4000),Access(C3) -FX.CONF=Type(04),AuxType(4000),Access(C3) -DFX.CONF=Type(04),AuxType(4000),Access(C3) +PREFS.CONF=Type(04),AuxType(8000),Access(C3) +GAMES.CONF=Type(04),AuxType(8000),Access(C3) +ATTRACT.CONF=Type(04),AuxType(8000),Access(C3) +FX.CONF=Type(04),AuxType(8000),Access(C3) +DFX.CONF=Type(04),AuxType(8000),Access(C3) COVER=Type(06),AuxType(2000),Access(C3) diff --git a/src/4cade.init.a b/src/4cade.init.a index 878985cc0..ee4fc0180 100644 --- a/src/4cade.init.a +++ b/src/4cade.init.a @@ -60,67 +60,21 @@ OneTimeSetup ldy hddopendir+3 +STAY gRootDirectory - jsr LoadFile ; load preferences file + jsr LoadFile ; load preferences file into $8000 !word kGlobalPrefsFilename - jsr ParseKeyValueList ; parse contents into global prefs store + jsr ParseKeyValueList ; parse contents into global prefs store into LC RAM bank !word gGlobalPrefsStore !word ldrlo2 ; (ldrlo2) points to last load address !byte 16 +LDAY SRC +STAY gGamesListStore ; save pointer to free space for next store - jsr LoadFile ; load games list + jsr LoadFile ; load games list into $8000 !word kGameListConfFile - jsr ParseGamesList ; parse games list + jsr ParseGamesList ; parse games list into LC RAM bank !word gGamesListStore !word ldrlo2 ; (ldrlo2) points to last load address - +LDAY SRC - +STAY gAttractModeStore ; save pointer to free space for next store - - jsr LoadFile ; load attract-mode configuration - !word kAttractModeConfFile - jsr ParseKeyValueList ; parse attract-mode configuration - !word gAttractModeStore - !word ldrlo2 ; (ldrlo2) points to last load address - !byte 0 - - jsr okvs_get ; get next attract-mode module from prefs - !word gGlobalPrefsStore - !word kNextAttract - bcs @noattract - +STAY @attract - jsr okvs_get - !word gAttractModeStore -@attract !word $FDFD ; SMC - bcc + -@noattract - ldx #0 -+ stx gAttractIndex - - jsr okvs_get ; get next HGR transition effect from prefs - !word gGlobalPrefsStore - !word kNextFX - bcs @nofx - +STAY @fx - jsr okvs_get - !word gFXStore -@fx !word $FDFD ; SMC - bcc + -@nofx ldx #0 -+ stx gFXIndex - - jsr okvs_get ; get next DHGR transition effect from prefs - !word gGlobalPrefsStore - !word kNextDFX - bcs @nodfx - +STAY @dfx - jsr okvs_get - !word gDFXStore -@dfx !word $FDFD ; SMC - bcc + -@nodfx ldx #0 -+ stx gDFXIndex jmp Main kGameListConfFile @@ -128,8 +82,3 @@ kGameListConfFile @kGameListConfFile_b !text "GAMES.CONF" @kGameListConfFile_e -kAttractModeConfFile - !byte @kAttractModeConfFile_e-@kAttractModeConfFile_b -@kAttractModeConfFile_b - !text "ATTRACT.CONF" -@kAttractModeConfFile_e diff --git a/src/parse.common.a b/src/parse.common.a index 9e20ca569..2f1447ebc 100644 --- a/src/parse.common.a +++ b/src/parse.common.a @@ -14,7 +14,7 @@ ; gAttractModeStore - !word $FDFD + !word $6000 gFXStore !word $6000 gDFXStore diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index 90f26f682..92dc2f7fa 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -12,6 +12,26 @@ ; - gDFXIndex ; [byte] numeric index of DHGR transition effect AttractMode + jsr LoadFile ; load attract-mode configuration into $8000 + !word kAttractModeConfFile + jsr ParseKeyValueList ; parse attract-mode configuration into $6000 + !word gAttractModeStore + !word ldrlo2 ; (ldrlo2) points to last load address + !byte 0 + + jsr okvs_get ; get next attract-mode module from prefs + !word gGlobalPrefsStore + !word kNextAttract + bcs @noattract + +STAY @attract + jsr okvs_get + !word gAttractModeStore +@attract !word $FDFD ; SMC + bcc + +@noattract + ldx #0 ++ stx gAttractIndex + jsr okvs_nth ; get filename of next attract-mode module !word gAttractModeStore gAttractIndex @@ -125,6 +145,11 @@ gAttractIndex !word gSlideshowStore !word HGRLoad ; address of callback (called on each file) @exit rts +kAttractModeConfFile + !byte @kAttractModeConfFile_e-@kAttractModeConfFile_b +@kAttractModeConfFile_b + !text "ATTRACT.CONF" +@kAttractModeConfFile_e ;------------------------------------------------------------------------------ ; internal functions @@ -177,13 +202,25 @@ WaitOnScreenshot + rts LoadTransition - jsr LoadFile ; load HGR transition effects list + jsr LoadFile ; load HGR transition effects list into $8000 !word kFXConfFile - jsr ParseKeyValueList ; parse HGR transition effects list + jsr ParseKeyValueList ; parse HGR transition effects list into $6000 !word gFXStore !word ldrlo2 ; (ldrlo2) points to last load address !byte 0 + jsr okvs_get ; get next HGR transition effect from prefs + !word gGlobalPrefsStore + !word kNextFX + bcs @nofx + +STAY @fx + jsr okvs_get + !word gFXStore +@fx !word $FDFD ; SMC + bcc + +@nofx ldx #0 ++ stx gFXIndex + jsr okvs_nth ; get filename of transition effect code !word gFXStore gFXIndex @@ -223,13 +260,25 @@ kFXConfFile @kFXConfFile_e LoadDHGRTransition - jsr LoadFile ; load DHGR transition effects list + jsr LoadFile ; load DHGR transition effects list into $8000 !word kDFXConfFile - jsr ParseKeyValueList ; parse DHGR transition effects list + jsr ParseKeyValueList ; parse DHGR transition effects list into $6000 !word gDFXStore !word ldrlo2 ; (ldrlo2) points to last load address !byte 0 + jsr okvs_get ; get next DHGR transition effect from prefs + !word gGlobalPrefsStore + !word kNextDFX + bcs @nodfx + +STAY @dfx + jsr okvs_get + !word gDFXStore +@dfx !word $FDFD ; SMC + bcc + +@nodfx ldx #0 ++ stx gDFXIndex + jsr okvs_nth ; get filename of DHGR transition effect code !word gDFXStore gDFXIndex