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
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
#
# precompute FX and DFX indexes and merged data files containing multiple
# graphic effects in a single file (loaded at runtime by LoadIndexedFile())
#
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()
# precompute binary data structure and substitute special characters
# in game help and other all-text pages
#
bin/converthelp.sh res/HELPTEXT build/HELPTEXT >>build/log
bin/converthelp.sh res/CREDITS build/CREDITS >>build/log
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
#
# precompute indexed files for game help, slideshow configuration,
# mini-attract mode configuration, and prelaunch files
# create a sorted list of game filenames, without metadata or display names
#
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 \
bin/buildokvs.sh "$$f" "build/SS/$$(basename $$f)"; \
echo "$$(basename $$f)"; \
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 \
bin/buildokvs.sh "$$f" "build/ATTRACT/$$(basename $$f)"; \
echo "$$(basename $$f)"; \
done) > build/ATTRACTDIR
bin/buildindexedfile.sh -p "build/ATTRACTDIR" "build/MINIATTRACT.IDX" "build/MINIATTRACT.ALL" "build/ATTRACT" >>build/log
bin/buildindexedfile.sh "build/GAMES.SORTED" "build/PRELAUNCH.IDX" "build/PRELAUNCH.ALL" "build/PRELAUNCH.INDEXED" >>build/log
bin/buildindexedfile.sh -p -a "build/ATTRACTDIR" "build/MINIATTRACT.IDX" "build/TOTAL.DATA" "build/ATTRACT" >>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
# 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/[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/[UVWX]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR5
(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/ACTIONHGR1" "build/HGR1.IDX" "build/HGR.ALL" "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/ACTIONHGR3" "build/HGR3.IDX" "build/HGR.ALL" "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/ACTIONHGR5" "build/HGR5.IDX" "build/HGR.ALL" "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/ACTIONHGR0" "build/HGR0.IDX" "build/TOTAL.DATA" "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/TOTAL.DATA" "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/TOTAL.DATA" "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/TOTAL.DATA" "res/ACTION.HGR" >>build/log
#
# 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 \
echo "$$(basename $$f)"; \
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
#
@ -107,6 +118,7 @@ dsk: asm
# add everything to the disk
#
for f in \
build/TOTAL.DATA \
res/TITLE \
res/COVER \
res/HELP \
@ -117,17 +129,11 @@ dsk: asm
build/ATTRACT.IDX \
build/FX.IDX \
build/DFX.IDX \
build/FX.ALL \
build/GAMEHELP.IDX \
build/GAMEHELP.ALL \
build/SLIDESHOW.IDX \
build/SLIDESHOW.ALL \
build/MINIATTRACT.IDX \
build/MINIATTRACT.ALL \
build/PRELAUNCH.IDX \
build/PRELAUNCH.ALL \
build/ARTWORK.IDX \
build/ARTWORK.ALL \
build/HGR0.IDX \
build/HGR1.IDX \
build/HGR2.IDX \
@ -135,7 +141,6 @@ dsk: asm
build/HGR4.IDX \
build/HGR5.IDX \
build/HGR6.IDX \
build/HGR.ALL \
res/DECRUNCH \
res/JOYSTICK \
res/Finder.Data \

View File

@ -12,6 +12,7 @@
pad=false
append=false
standardoffset=0
standardsize=0
while getopts ":ap" opt; do
case $opt in
@ -23,14 +24,19 @@ while getopts ":ap" opt; do
done
shift $((OPTIND-1))
if [ -f "$4"/STANDARD ]; then
cp "$4"/STANDARD "$3"
standardsize=$(wc -c < "$3")
elif [ "$append" = false ]; then
if [ "$append" = false ]; then
rm -f "$3"
fi
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
records=$(mktemp)
awk '!/^$|^#|^\[/ { print }' < "$1" > "$records"
@ -63,8 +69,8 @@ source=$(mktemp)
echo "$size"
fi
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
echo "!be24 0"
else # if file does not exist, reuse STANDARD file
echo "!be24 $standardoffset"
echo "!le16 $standardsize"
fi
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
LAUNCHER.SYSTEM=Type(FF),AuxType(2000),Access(C3)
TOTAL.DATA=Type(06),AuxType(0000),Access(C3)
PREFS.CONF=Type(04),AuxType(8000),Access(C3)
GAMES.CONF=Type(04),AuxType(8000),Access(C3)
ATTRACT.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.ALL=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.ALL=Type(06),AuxType(6000),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.ALL=Type(06),AuxType(0106),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)
HGR1.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)
HGR5.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)
TITLE=Type(06),AuxType(2000),Access(C3)
HELP=Type(06),AuxType(2000),Access(C3)

View File

@ -7,7 +7,7 @@
;
; LC RAM BANK 1
; 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
; code, prelaunchers, transition effects, &c.
; (LoadFileDirect, Wait/UnwaitForVBL, MockingboardStuff, MachineStatus)
@ -16,8 +16,8 @@
; LC RAM BANK 2
; D000..D3FF - ProRWTS data
; D400..D6B8 - ProRWTS code
; D6B9..DB86 - HGR font code & ProRWTS glue code
; DB87..DB96 - backup of stack (during gameplay and self-running demos)
; D6B9..DB90 - HGR font code & ProRWTS glue code
; DB91..DBA0 - backup of stack (during gameplay and self-running demos)
; ...unused...
; DBB4..DBFF - (de)acceleration function
; DC00..DFFF - HGR font data
@ -149,7 +149,7 @@ CHEATS_ENABLED = %00001000
iCurBlockLo = $D401 ; constant
iCurBlockHi = $D403 ; constant
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
ldrlo = $55 ; constant
ldrhi = $56 ; constant

View File

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

View File

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