precompute gAttractModeStore data

This commit is contained in:
4am 2021-10-06 16:22:54 -04:00
parent e4bb0b3919
commit bbd4fa7d24
4 changed files with 26 additions and 10 deletions

View File

@ -33,7 +33,8 @@ dsk: asm
bin/padto.sh 512 build/PREFS.CONF >>build/log
bin/buildhelp.sh "build/HELPFUL" "build/helper.inc" >>build/log
$(ACME) -r build/helper.lst src/helper/helper.a >>build/log
for f in res/TITLE res/COVER res/HELP res/GAMES.CONF res/ATTRACT.CONF res/FX.CONF res/DFX.CONF build/PREFS.CONF res/CREDITS res/HELPTEXT build/HELPER build/HELPFUL res/DECRUNCH res/JOYSTICK res/Finder.Data res/Finder.Root; do $(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" "$$f" >>build/log; done
bin/buildokvs.sh "res/ATTRACT.CONF" "build/ATTRACT.DATA" >>build/log
for f in res/TITLE res/COVER res/HELP res/GAMES.CONF build/ATTRACT.DATA res/FX.CONF res/DFX.CONF build/PREFS.CONF res/CREDITS res/HELPTEXT build/HELPER build/HELPFUL res/DECRUNCH res/JOYSTICK res/Finder.Data res/Finder.Root; do $(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" "$$f" >>build/log; done
bin/buildfileinfo.sh res/TITLE.HGR "06" "4000" >>build/log
bin/buildfileinfo.sh res/TITLE.DHGR "06" "4000" >>build/log
bin/buildfileinfo.sh res/ACTION.HGR "06" "3FF8" >>build/log

19
bin/buildokvs.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
# run from project root directory
records=$(mktemp)
grep -v "^$" < "$1" | grep -v "^#" | grep -v "^\[" > "$records"
source=$(mktemp)
(echo "*=0"
echo "!le16 $(wc -l <"$records"), 0"
while IFS="=" read -r key value; do
echo "!byte ${#key}+${#value}+3"
echo "!byte ${#key}"
echo "!text \"$key\""
echo "!byte ${#value}"
echo "!text \"$value\""
done < "$records") > "$source"
acme -o "$2" "$source"
rm "$source"
rm "$records"

View File

@ -114,9 +114,9 @@ kGlobalPrefsFilename
!byte 10
!raw "PREFS.CONF"
kAttractModeConfFile
kAttractModeDataFile
!byte 12
!raw "ATTRACT.CONF"
!raw "ATTRACT.DATA"
kFXConfFile
!byte 7

View File

@ -24,14 +24,10 @@ MegaAttractMode
jsr BlankHGR ; switch to HGR page 1 (once cleared)
jsr LoadFile ; load attract-mode configuration file into $8000
jsr LoadFile ; load pre-parsed attract mode configuration data into $6000
!word kRootDirectory
!word kAttractModeConfFile
- !word $8000
jsr ParseKeyValueList ; parse attract-mode configuration into OKVS data structure at $6000
!word gAttractModeStore
!word -
!byte 0
!word kAttractModeDataFile
!word $6000
jsr pref_get ; get attract mode module from prefs
!word kNextAttract