one file to rule them all

This commit is contained in:
4am 2021-10-21 13:04:01 -04:00
parent 2be64b37a8
commit 67f1ec0694
13 changed files with 65 additions and 71 deletions

View File

@ -34,43 +34,53 @@ dsk: asm
cp res/PREFS.CONF build/PREFS.CONF >>build/log cp res/PREFS.CONF build/PREFS.CONF >>build/log
bin/padto.sh 512 build/PREFS.CONF >>build/log bin/padto.sh 512 build/PREFS.CONF >>build/log
# #
# precompute OKVS data structure for mega-attract mode configuration file # precompute binary data structure for mega-attract mode configuration file
# #
bin/buildokvs.sh "res/ATTRACT.CONF" "build/ATTRACT.IDX" >>build/log bin/buildokvs.sh "res/ATTRACT.CONF" "build/ATTRACT.IDX" >>build/log
# #
# precompute FX and DFX indexes and merged data files containing multiple # precompute binary data structure and substitute special characters
# graphic effects in a single file (loaded at runtime by LoadIndexedFile()) # in game help and other all-text pages
#
bin/buildindexedfile.sh -p "res/FX.CONF" "build/FX.IDX" "build/FX.ALL" "build/FX.INDEXED" >>build/log
bin/buildindexedfile.sh -a -p "res/DFX.CONF" "build/DFX.IDX" "build/FX.ALL" "build/FX.INDEXED" >>build/log
#
# substitute special characters in help text and other pages that will be
# drawn with DrawPage()
# #
bin/converthelp.sh res/HELPTEXT build/HELPTEXT >>build/log bin/converthelp.sh res/HELPTEXT build/HELPTEXT >>build/log
bin/converthelp.sh res/CREDITS build/CREDITS >>build/log bin/converthelp.sh res/CREDITS build/CREDITS >>build/log
for f in res/GAMEHELP/*; do \ for f in res/GAMEHELP/*; do \
bin/converthelp.sh "$$f" build/GAMEHELP/"$$(basename $$f)" >>build/log; \ bin/converthelp.sh "$$f" build/GAMEHELP/"$$(basename $$f)" >>build/log; \
done done
# #
# precompute indexed files for game help, slideshow configuration, # create a sorted list of game filenames, without metadata or display names
# mini-attract mode configuration, and prelaunch files
# #
awk -F "," '!/^#/ { print $$2 }' < res/GAMES.CONF | awk -F "=" '{ print $$1 }' | sort > build/GAMES.SORTED awk -F "," '!/^#/ { print $$2 }' < res/GAMES.CONF | awk -F "=" '{ print $$1 }' | sort > build/GAMES.SORTED
bin/buildindexedfile.sh -p "build/GAMES.SORTED" "build/GAMEHELP.IDX" "build/GAMEHELP.ALL" "build/GAMEHELP" >>build/log #
# precompute indexed files for prelaunch
# note: prelaunch must be first in TOTAL.DATA due to a hack in LoadStandardPrelaunch
# note 2: these can not be padded because they are loaded at $0106 and padding would clobber the stack
#
bin/buildindexedfile.sh "build/GAMES.SORTED" "build/PRELAUNCH.IDX" "build/TOTAL.DATA" "build/PRELAUNCH.INDEXED" >>build/log
#
# precompute indexed files for game help
#
bin/buildindexedfile.sh -p -a "build/GAMES.SORTED" "build/GAMEHELP.IDX" "build/TOTAL.DATA" "build/GAMEHELP" >>build/log
#
# precompute indexed files for slideshows
#
(for f in res/SS/*; do \ (for f in res/SS/*; do \
bin/buildokvs.sh "$$f" "build/SS/$$(basename $$f)"; \ bin/buildokvs.sh "$$f" "build/SS/$$(basename $$f)"; \
echo "$$(basename $$f)"; \ echo "$$(basename $$f)"; \
done) > build/SSDIR done) > build/SSDIR
bin/buildindexedfile.sh -p "build/SSDIR" "build/SLIDESHOW.IDX" "build/SLIDESHOW.ALL" "build/SS" >>build/log bin/buildindexedfile.sh -p -a "build/SSDIR" "build/SLIDESHOW.IDX" "build/TOTAL.DATA" "build/SS" >>build/log
(for f in res/ATTRACT/*; do \ (for f in res/ATTRACT/*; do \
bin/buildokvs.sh "$$f" "build/ATTRACT/$$(basename $$f)"; \ bin/buildokvs.sh "$$f" "build/ATTRACT/$$(basename $$f)"; \
echo "$$(basename $$f)"; \ echo "$$(basename $$f)"; \
done) > build/ATTRACTDIR done) > build/ATTRACTDIR
bin/buildindexedfile.sh -p "build/ATTRACTDIR" "build/MINIATTRACT.IDX" "build/MINIATTRACT.ALL" "build/ATTRACT" >>build/log bin/buildindexedfile.sh -p -a "build/ATTRACTDIR" "build/MINIATTRACT.IDX" "build/TOTAL.DATA" "build/ATTRACT" >>build/log
bin/buildindexedfile.sh "build/GAMES.SORTED" "build/PRELAUNCH.IDX" "build/PRELAUNCH.ALL" "build/PRELAUNCH.INDEXED" >>build/log #
# precompute indexed files for graphic effects
#
bin/buildindexedfile.sh -p -a "res/FX.CONF" "build/FX.IDX" "build/TOTAL.DATA" "build/FX.INDEXED" >>build/log
bin/buildindexedfile.sh -p -a "res/DFX.CONF" "build/DFX.IDX" "build/TOTAL.DATA" "build/FX.INDEXED" >>build/log
# #
# precompute indexed files for HGR action screenshots # precompute indexed files for HGR action screenshots
# note: these can not be padded because they are compressed and the decompressor needs the exact size
# #
(for f in res/ACTION.HGR/[ABCD]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR0 (for f in res/ACTION.HGR/[ABCD]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR0
(for f in res/ACTION.HGR/[EFGH]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR1 (for f in res/ACTION.HGR/[EFGH]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR1
@ -79,20 +89,21 @@ dsk: asm
(for f in res/ACTION.HGR/[QRST]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR4 (for f in res/ACTION.HGR/[QRST]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR4
(for f in res/ACTION.HGR/[UVWX]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR5 (for f in res/ACTION.HGR/[UVWX]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR5
(for f in res/ACTION.HGR/[YZ]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR6 (for f in res/ACTION.HGR/[YZ]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR6
bin/buildindexedfile.sh "build/ACTIONHGR0" "build/HGR0.IDX" "build/HGR.ALL" "res/ACTION.HGR" >>build/log bin/buildindexedfile.sh -a "build/ACTIONHGR0" "build/HGR0.IDX" "build/TOTAL.DATA" "res/ACTION.HGR" >>build/log
bin/buildindexedfile.sh -a "build/ACTIONHGR1" "build/HGR1.IDX" "build/HGR.ALL" "res/ACTION.HGR" >>build/log bin/buildindexedfile.sh -a "build/ACTIONHGR1" "build/HGR1.IDX" "build/TOTAL.DATA" "res/ACTION.HGR" >>build/log
bin/buildindexedfile.sh -a "build/ACTIONHGR2" "build/HGR2.IDX" "build/HGR.ALL" "res/ACTION.HGR" >>build/log bin/buildindexedfile.sh -a "build/ACTIONHGR2" "build/HGR2.IDX" "build/TOTAL.DATA" "res/ACTION.HGR" >>build/log
bin/buildindexedfile.sh -a "build/ACTIONHGR3" "build/HGR3.IDX" "build/HGR.ALL" "res/ACTION.HGR" >>build/log bin/buildindexedfile.sh -a "build/ACTIONHGR3" "build/HGR3.IDX" "build/TOTAL.DATA" "res/ACTION.HGR" >>build/log
bin/buildindexedfile.sh -a "build/ACTIONHGR4" "build/HGR4.IDX" "build/HGR.ALL" "res/ACTION.HGR" >>build/log bin/buildindexedfile.sh -a "build/ACTIONHGR4" "build/HGR4.IDX" "build/TOTAL.DATA" "res/ACTION.HGR" >>build/log
bin/buildindexedfile.sh -a "build/ACTIONHGR5" "build/HGR5.IDX" "build/HGR.ALL" "res/ACTION.HGR" >>build/log bin/buildindexedfile.sh -a "build/ACTIONHGR5" "build/HGR5.IDX" "build/TOTAL.DATA" "res/ACTION.HGR" >>build/log
bin/buildindexedfile.sh -a "build/ACTIONHGR6" "build/HGR6.IDX" "build/HGR.ALL" "res/ACTION.HGR" >>build/log bin/buildindexedfile.sh -a "build/ACTIONHGR6" "build/HGR6.IDX" "build/TOTAL.DATA" "res/ACTION.HGR" >>build/log
# #
# precompute indexed files for SHR artwork # precompute indexed files for SHR artwork
# note: these can not be padded because they are compressed and the decompressor needs the exact size
# #
(for f in res/ARTWORK.SHR/*; do \ (for f in res/ARTWORK.SHR/*; do \
echo "$$(basename $$f)"; \ echo "$$(basename $$f)"; \
done) > build/ARTWORKDIR done) > build/ARTWORKDIR
bin/buildindexedfile.sh "build/ARTWORKDIR" "build/ARTWORK.IDX" "build/ARTWORK.ALL" "res/ARTWORK.SHR" >>build/log bin/buildindexedfile.sh -a "build/ARTWORKDIR" "build/ARTWORK.IDX" "build/TOTAL.DATA" "res/ARTWORK.SHR" >>build/log
# #
# create _FileInformation.txt files for subdirectories # create _FileInformation.txt files for subdirectories
# #
@ -107,6 +118,7 @@ dsk: asm
# add everything to the disk # add everything to the disk
# #
for f in \ for f in \
build/TOTAL.DATA \
res/TITLE \ res/TITLE \
res/COVER \ res/COVER \
res/HELP \ res/HELP \
@ -117,17 +129,11 @@ dsk: asm
build/ATTRACT.IDX \ build/ATTRACT.IDX \
build/FX.IDX \ build/FX.IDX \
build/DFX.IDX \ build/DFX.IDX \
build/FX.ALL \
build/GAMEHELP.IDX \ build/GAMEHELP.IDX \
build/GAMEHELP.ALL \
build/SLIDESHOW.IDX \ build/SLIDESHOW.IDX \
build/SLIDESHOW.ALL \
build/MINIATTRACT.IDX \ build/MINIATTRACT.IDX \
build/MINIATTRACT.ALL \
build/PRELAUNCH.IDX \ build/PRELAUNCH.IDX \
build/PRELAUNCH.ALL \
build/ARTWORK.IDX \ build/ARTWORK.IDX \
build/ARTWORK.ALL \
build/HGR0.IDX \ build/HGR0.IDX \
build/HGR1.IDX \ build/HGR1.IDX \
build/HGR2.IDX \ build/HGR2.IDX \
@ -135,7 +141,6 @@ dsk: asm
build/HGR4.IDX \ build/HGR4.IDX \
build/HGR5.IDX \ build/HGR5.IDX \
build/HGR6.IDX \ build/HGR6.IDX \
build/HGR.ALL \
res/DECRUNCH \ res/DECRUNCH \
res/JOYSTICK \ res/JOYSTICK \
res/Finder.Data \ res/Finder.Data \

View File

@ -12,6 +12,7 @@
pad=false pad=false
append=false append=false
standardoffset=0
standardsize=0 standardsize=0
while getopts ":ap" opt; do while getopts ":ap" opt; do
case $opt in case $opt in
@ -23,14 +24,19 @@ while getopts ":ap" opt; do
done done
shift $((OPTIND-1)) shift $((OPTIND-1))
if [ -f "$4"/STANDARD ]; then if [ "$append" = false ]; then
cp "$4"/STANDARD "$3"
standardsize=$(wc -c < "$3")
elif [ "$append" = false ]; then
rm -f "$3" rm -f "$3"
fi fi
touch "$3" touch "$3"
# if there is a file called "STANDARD" in the input directory, add it now
# because we will reuse it for any files that don't exist
if [ -f "$4"/STANDARD ]; then
standardoffset=$(wc -c < "$3")
standardsize=$(wc -c < "$4/STANDARD")
cat "$4"/STANDARD >> "$3"
fi
# make temp file with list of lines that contain keys # make temp file with list of lines that contain keys
records=$(mktemp) records=$(mktemp)
awk '!/^$|^#|^\[/ { print }' < "$1" > "$records" awk '!/^$|^#|^\[/ { print }' < "$1" > "$records"
@ -63,8 +69,8 @@ source=$(mktemp)
echo "$size" echo "$size"
fi fi
cat "$4/$key" >> "$3" # append this file to the end of the merged data file cat "$4/$key" >> "$3" # append this file to the end of the merged data file
else # if file does not exist, reuse placeholder at offset 0 else # if file does not exist, reuse STANDARD file
echo "!be24 0" echo "!be24 $standardoffset"
echo "!le16 $standardsize" echo "!le16 $standardsize"
fi fi
done < "$records") > "$source" done < "$records") > "$source"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,23 +1,17 @@
# This file is maintained by hand # This file is maintained by hand
LAUNCHER.SYSTEM=Type(FF),AuxType(2000),Access(C3) LAUNCHER.SYSTEM=Type(FF),AuxType(2000),Access(C3)
TOTAL.DATA=Type(06),AuxType(0000),Access(C3)
PREFS.CONF=Type(04),AuxType(8000),Access(C3) PREFS.CONF=Type(04),AuxType(8000),Access(C3)
GAMES.CONF=Type(04),AuxType(8000),Access(C3) GAMES.CONF=Type(04),AuxType(8000),Access(C3)
ATTRACT.IDX=Type(06),AuxType(6000),Access(C3) ATTRACT.IDX=Type(06),AuxType(6000),Access(C3)
MINIATTRACT.IDX=Type(06),AuxType(6000),Access(C3) MINIATTRACT.IDX=Type(06),AuxType(6000),Access(C3)
MINIATTRACT.ALL=Type(06),AuxType(6000),Access(C3)
FX.IDX=Type(06),AuxType(6000),Access(C3) FX.IDX=Type(06),AuxType(6000),Access(C3)
FX.ALL=Type(06),AuxType(6000),Access(C3)
DFX.IDX=Type(06),AuxType(6000),Access(C3) DFX.IDX=Type(06),AuxType(6000),Access(C3)
DFX.ALL=Type(06),AuxType(6000),Access(C3)
GAMEHELP.IDX=Type(06),AuxType(6000),Access(C3) GAMEHELP.IDX=Type(06),AuxType(6000),Access(C3)
GAMEHELP.ALL=Type(06),AuxType(6000),Access(C3)
SLIDESHOW.IDX=Type(06),AuxType(4000),Access(C3) SLIDESHOW.IDX=Type(06),AuxType(4000),Access(C3)
SLIDESHOW.ALL=Type(06),AuxType(0800),Access(C3)
PRELAUNCH.IDX=Type(06),AuxType(6000),Access(C3) PRELAUNCH.IDX=Type(06),AuxType(6000),Access(C3)
PRELAUNCH.ALL=Type(06),AuxType(0106),Access(C3)
ARTWORK.IDX=Type(06),AuxType(2000),Access(C3) ARTWORK.IDX=Type(06),AuxType(2000),Access(C3)
ARTWORK.ALL=Type(06),AuxType(1FF8),Access(C3)
HGR0.IDX=Type(06),AuxType(4000),Access(C3) HGR0.IDX=Type(06),AuxType(4000),Access(C3)
HGR1.IDX=Type(06),AuxType(4000),Access(C3) HGR1.IDX=Type(06),AuxType(4000),Access(C3)
HGR2.IDX=Type(06),AuxType(4000),Access(C3) HGR2.IDX=Type(06),AuxType(4000),Access(C3)
@ -25,7 +19,6 @@ HGR3.IDX=Type(06),AuxType(4000),Access(C3)
HGR4.IDX=Type(06),AuxType(4000),Access(C3) HGR4.IDX=Type(06),AuxType(4000),Access(C3)
HGR5.IDX=Type(06),AuxType(4000),Access(C3) HGR5.IDX=Type(06),AuxType(4000),Access(C3)
HGR6.IDX=Type(06),AuxType(4000),Access(C3) HGR6.IDX=Type(06),AuxType(4000),Access(C3)
HGR.ALL=Type(06),AuxType(3FF8),Access(C3)
COVER=Type(06),AuxType(2000),Access(C3) COVER=Type(06),AuxType(2000),Access(C3)
TITLE=Type(06),AuxType(2000),Access(C3) TITLE=Type(06),AuxType(2000),Access(C3)
HELP=Type(06),AuxType(2000),Access(C3) HELP=Type(06),AuxType(2000),Access(C3)

View File

@ -7,7 +7,7 @@
; ;
; LC RAM BANK 1 ; LC RAM BANK 1
; D000..E789 - persistent data structures (gGlobalPrefsStore, gGamesListStore) ; D000..E789 - persistent data structures (gGlobalPrefsStore, gGamesListStore)
; E8E4..FFEE - main program code ; E92D..FFEE - main program code
; FFEF..FFF9 - API functions and global constants available for main program ; FFEF..FFF9 - API functions and global constants available for main program
; code, prelaunchers, transition effects, &c. ; code, prelaunchers, transition effects, &c.
; (LoadFileDirect, Wait/UnwaitForVBL, MockingboardStuff, MachineStatus) ; (LoadFileDirect, Wait/UnwaitForVBL, MockingboardStuff, MachineStatus)
@ -16,8 +16,8 @@
; LC RAM BANK 2 ; LC RAM BANK 2
; D000..D3FF - ProRWTS data ; D000..D3FF - ProRWTS data
; D400..D6B8 - ProRWTS code ; D400..D6B8 - ProRWTS code
; D6B9..DB86 - HGR font code & ProRWTS glue code ; D6B9..DB90 - HGR font code & ProRWTS glue code
; DB87..DB96 - backup of stack (during gameplay and self-running demos) ; DB91..DBA0 - backup of stack (during gameplay and self-running demos)
; ...unused... ; ...unused...
; DBB4..DBFF - (de)acceleration function ; DBB4..DBFF - (de)acceleration function
; DC00..DFFF - HGR font data ; DC00..DFFF - HGR font data
@ -149,7 +149,7 @@ CHEATS_ENABLED = %00001000
iCurBlockLo = $D401 ; constant iCurBlockLo = $D401 ; constant
iCurBlockHi = $D403 ; constant iCurBlockHi = $D403 ; constant
launchpatch = $D661 ; glue.launch.a launchpatch = $D661 ; glue.launch.a
iAddToPath = $FE5C ; Roger Rabbit, avoid, use Infiltrator 2 style instead iAddToPath = $FEA5 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
itraverse = $D958 ; Roger Rabbit, avoid, use Infiltrator 2 style instead itraverse = $D958 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
ldrlo = $55 ; constant ldrlo = $55 ; constant
ldrhi = $56 ; constant ldrhi = $56 ; constant

View File

@ -291,4 +291,4 @@ LoadStandardPrelaunch
rts rts
+ !byte 0 + !byte 0
!be24 0 !be24 0
!le16 71 !le16 68

View File

@ -72,9 +72,11 @@ gHGRActionIndexNumber
!raw "_" !raw "_"
!raw ".IDX" !raw ".IDX"
kHGRActionDataFile kTotalDataFile
!byte 7 !byte 10
!raw "HGR.ALL" !raw "TOTAL.DATA"
kHGRActionDataFile=kTotalDataFile
kDHGRActionDirectory kDHGRActionDirectory
!byte 12 !byte 12
@ -101,9 +103,7 @@ kPrelaunchIndexFile
!byte 13 !byte 13
!raw "PRELAUNCH.IDX" !raw "PRELAUNCH.IDX"
kPrelaunchFulFile kPrelaunchFulFile=kTotalDataFile
!byte 13
!raw "PRELAUNCH.ALL"
kStandardPrelaunch kStandardPrelaunch
!byte 8 !byte 8
@ -121,25 +121,19 @@ kMiniAttractIndexFile
!byte 15 !byte 15
!raw "MINIATTRACT.IDX" !raw "MINIATTRACT.IDX"
kAttractModeFulFile kAttractModeFulFile=kTotalDataFile
!byte 15
!raw "MINIATTRACT.ALL"
kAttractModeSlideshowIndexFile kAttractModeSlideshowIndexFile
!byte 13 !byte 13
!raw "SLIDESHOW.IDX" !raw "SLIDESHOW.IDX"
kAttractModeSlideshowFulFile kAttractModeSlideshowFulFile=kTotalDataFile
!byte 13
!raw "SLIDESHOW.ALL"
kFXIndexFile kFXIndexFile
!byte 6 !byte 6
!raw "FX.IDX" !raw "FX.IDX"
kFXFile kFXFile=kTotalDataFile
!byte 6
!raw "FX.ALL"
kDFXIndexFile kDFXIndexFile
!byte 7 !byte 7
@ -149,17 +143,13 @@ kGameHelpIndexFile
!byte 12 !byte 12
!raw "GAMEHELP.IDX" !raw "GAMEHELP.IDX"
kGameHelpFile kGameHelpFile=kTotalDataFile
!byte 12
!raw "GAMEHELP.ALL"
kSHRArtworkIndexFile kSHRArtworkIndexFile
!byte 11 !byte 11
!raw "ARTWORK.IDX" !raw "ARTWORK.IDX"
kSHRArtworkDataFile kSHRArtworkDataFile=kTotalDataFile
!byte 11
!raw "ARTWORK.ALL"
kCreditsFile kCreditsFile
!byte 7 !byte 7