read NEXTATTRACT from prefs on startup

This commit is contained in:
4am 2018-11-17 09:54:55 -05:00
parent dd36021ed4
commit a130581c17
3 changed files with 36 additions and 6 deletions

View File

@ -70,8 +70,8 @@ dsk: md asm
cp res/_FileInformation.txt build/ >>build/log
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "build/LAUNCHER.SYSTEM" >>build/log
$(CADIUS) CREATEFOLDER build/"$(DISK)" "/${VOLUME}/X/" >>build/log
# cp res/prefs-sample.conf build/PREFS.CONF >>build/log
cp res/prefs.conf build/PREFS.CONF >>build/log
cp res/prefs-sample.conf build/PREFS.CONF >>build/log
# cp res/prefs.conf build/PREFS.CONF >>build/log
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "build/PREFS.CONF" >>build/log
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/GAMES.CONF" >>build/log
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/ATTRACT.CONF" >>build/log

View File

@ -100,6 +100,19 @@ OneTimeSetup
+LDAY SRC
+STAY gSlideshowStore ; save pointer to free space for next store
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

View File

@ -7,23 +7,40 @@
; - AttractMode
;
; Public variables
; - gAttractIndex ; [byte] numeric index of Mega-Attract Module
; - gFXIndex ; [byte] numeric index of HGR transition effect
; - gDFXIndex ; [byte] numeric index of DHGR transition effect
AttractMode
jsr okvs_nth ; get filename of next attract-mode module
!word gAttractModeStore
@index !byte 0
gAttractIndex
!byte 0
+STAY @key
inc @index ; increment module index for next time
inc gAttractIndex ; increment module index for next time
jsr okvs_len
!word gAttractModeStore
cmp @index
cmp gAttractIndex
bne +
lda #0
sta @index
sta gAttractIndex
+
lda gAttractIndex
sta @nexti
jsr okvs_nth ; get name of next attract-mode module
!word gAttractModeStore
@nexti !byte $FD ; SMC
+STAY @nextattract
jsr okvs_update ; save name of next attract-mode module in prefs store
!word gGlobalPrefsStore
!word kNextAttract
@nextattract
!word $FDFD ; SMC
; jsr SaveGlobalPreferences ; write prefs store to disk
jsr okvs_get
!word gAttractModeStore
@key !word $FDFD