diff --git a/Makefile b/Makefile index 66b1f5f69..8d9353b35 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/bin/buildokvs.sh b/bin/buildokvs.sh new file mode 100755 index 000000000..09a7a201a --- /dev/null +++ b/bin/buildokvs.sh @@ -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" diff --git a/src/prodos.path.a b/src/prodos.path.a index 79c75fb1c..89325545b 100644 --- a/src/prodos.path.a +++ b/src/prodos.path.a @@ -114,9 +114,9 @@ kGlobalPrefsFilename !byte 10 !raw "PREFS.CONF" -kAttractModeConfFile +kAttractModeDataFile !byte 12 - !raw "ATTRACT.CONF" + !raw "ATTRACT.DATA" kFXConfFile !byte 7 diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index 923bb0b4f..798f76ade 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -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