mirror of
https://github.com/a2-4am/4cade.git
synced 2024-06-14 03:29:38 +00:00
Compare commits
189 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f98bdf34a5 | ||
|
d0b3b487a2 | ||
|
86be8264af | ||
|
40f96a77b6 | ||
|
2625f8948f | ||
|
c3bba51240 | ||
|
d5bd293d5e | ||
|
db84baae65 | ||
|
f066a2f87c | ||
|
72a0be59d7 | ||
|
be487abdc3 | ||
|
145be3e1dc | ||
|
6a80e6f083 | ||
|
3a269e9362 | ||
|
6ab0bde6a7 | ||
|
33ba5469bd | ||
|
45eb343eba | ||
|
0b1e208b9d | ||
|
83ca5f91af | ||
|
a55bd69fd4 | ||
|
a6c3fc70f6 | ||
|
52fe63f1d3 | ||
|
4df1631942 | ||
|
66986a1b64 | ||
|
dbfb043018 | ||
|
620d16addb | ||
|
3aa5157521 | ||
|
c408d9eb81 | ||
|
ffec871b7f | ||
|
7016bf19bb | ||
|
c95ddcae8b | ||
|
a67f80d3d3 | ||
|
91e189c885 | ||
|
5c8a89ecde | ||
|
84f0aa598c | ||
|
1482f1dc69 | ||
|
c656a259c4 | ||
|
7efc25b3e7 | ||
|
199073b1c8 | ||
|
d91feab43c | ||
|
0dbc649a44 | ||
|
59cb3c3b00 | ||
|
f379ffe685 | ||
|
d60466df9e | ||
|
021c06725a | ||
|
ceca849a86 | ||
|
a19975dc9f | ||
|
9aecd7ca43 | ||
|
2bb6eb557a | ||
|
b3a1f010d6 | ||
|
4fd63e6154 | ||
|
04e839d4d7 | ||
|
3a5d2d3830 | ||
|
965d7bed5f | ||
|
70f62c2e66 | ||
|
efdbb8218e | ||
|
457ccfbbe8 | ||
|
c9257aa5ed | ||
|
eb07d7798c | ||
|
7922873dbf | ||
|
24398b5d50 | ||
|
c8f924dc6e | ||
|
7ea8a0624d | ||
|
d75c1cc039 | ||
|
90a6f55ddf | ||
|
af538414ff | ||
|
6906bf15bd | ||
|
88e0faf522 | ||
|
c7a2c1a921 | ||
|
99dcc896d1 | ||
|
711de29099 | ||
|
bbe441a983 | ||
|
f151e50247 | ||
|
c7db1050cc | ||
|
1c15f9daa1 | ||
|
0301a7ff48 | ||
|
fd4a0cd7ba | ||
|
5a99dbcc40 | ||
|
57f8a44d61 | ||
|
c5e5162fda | ||
|
ac0a7cf4d5 | ||
|
b729ae17c2 | ||
|
93ee4bee01 | ||
|
5dbcb0507c | ||
|
98ef0d2249 | ||
|
de540fe930 | ||
|
b3d7d2e32c | ||
|
980a956bc1 | ||
|
83c77096ac | ||
|
2b8c4aadaa | ||
|
df7c909090 | ||
|
7d4421ba49 | ||
|
9f339195d7 | ||
|
e3fb3b3f6d | ||
|
0172bfdcad | ||
|
82b69f4619 | ||
|
efff92fee4 | ||
|
da9bc9c2ae | ||
|
1ff0161e2e | ||
|
e2a891ed9a | ||
|
7ec692b881 | ||
|
f5c614b207 | ||
|
4e3adc2aa5 | ||
|
15bf7ae9aa | ||
|
46e094decd | ||
|
466062d3a1 | ||
|
98f4646da6 | ||
|
f4484a3dc4 | ||
|
fcc6c1bd80 | ||
|
8c0c2cfe95 | ||
|
42a7941e61 | ||
|
43c1f99df8 | ||
|
5fbd3a831f | ||
|
e4b4e997aa | ||
|
49fafc4688 | ||
|
b4c2de8e4e | ||
|
ec5a83eb26 | ||
|
8ccd1fe044 | ||
|
665e7ffa67 | ||
|
13b5d876e8 | ||
|
370e544d24 | ||
|
c361472951 | ||
|
ada45c1fc2 | ||
|
c2de0a2ccc | ||
|
edd6192a22 | ||
|
b8e7d480e6 | ||
|
7cc7fd357b | ||
|
a7efbea1f8 | ||
|
6dd38440df | ||
|
674638fb7e | ||
|
9066bb2145 | ||
|
ada2f3b0b1 | ||
|
535f3a8a4c | ||
|
9f3cce4731 | ||
|
e0d2172132 | ||
|
51b5f51666 | ||
|
4a7ebf3a6d | ||
|
1bba465e92 | ||
|
990cf25809 | ||
|
a362597c09 | ||
|
0c0050d6cf | ||
|
b6b193c4ae | ||
|
ead3094694 | ||
|
c7626b11d8 | ||
|
8872250ac7 | ||
|
586c2fc227 | ||
|
a10337ef9b | ||
|
dba357c27a | ||
|
082e277e3d | ||
|
8e657186e1 | ||
|
7a21398f75 | ||
|
005f96d6af | ||
|
65f090b53f | ||
|
9e69cdca94 | ||
|
128385ea62 | ||
|
f681fe1d32 | ||
|
581099b175 | ||
|
8bb101a337 | ||
|
b138d030d5 | ||
|
13f3461621 | ||
|
f26e9f1763 | ||
|
7f0518fd46 | ||
|
f49ea558ab | ||
|
ccee4e55cf | ||
|
055cba6340 | ||
|
0845ea468a | ||
|
90c45e4e5e | ||
|
2c010c0851 | ||
|
a137612d08 | ||
|
7085faebc8 | ||
|
d29e8554df | ||
|
4e186fd530 | ||
|
2fbdd2bb37 | ||
|
dfc882b2fd | ||
|
4a2c619929 | ||
|
535c4c841d | ||
|
7acb717b11 | ||
|
b5dffa65ab | ||
|
bc38e605d9 | ||
|
43ab54a120 | ||
|
6637a5e51e | ||
|
124432f373 | ||
|
65c5d0697f | ||
|
7e5bb82d63 | ||
|
48567554df | ||
|
8ec38d2c95 | ||
|
af2f83fccc | ||
|
270d81d749 | ||
|
409de6a218 |
485
Makefile
485
Makefile
|
@ -33,213 +33,366 @@ PYTHON=python3
|
||||||
# version 3.1.0 or later
|
# version 3.1.0 or later
|
||||||
EXOMIZER=exomizer mem -q -P23 -lnone
|
EXOMIZER=exomizer mem -q -P23 -lnone
|
||||||
|
|
||||||
dsk: index asmproboot asmlauncher extract
|
BUILDDIR=build
|
||||||
cp res/blank.hdv build/"$(DISK)"
|
MD=$(BUILDDIR)/make.touch
|
||||||
cp res/_FileInformation.txt build/
|
CADIUS.LOG=$(BUILDDIR)/log
|
||||||
$(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" build/LAUNCHER.SYSTEM -C >>build/log
|
DEMO.SOURCES=$(wildcard src/demo/*.a)
|
||||||
cp res/PREFS.CONF build/PREFS.CONF
|
FX.SOURCES=$(wildcard src/fx/*.a)
|
||||||
bin/padto.sh build/PREFS.CONF
|
PRELAUNCH.SOURCES=$(wildcard src/prelaunch/*.a)
|
||||||
#
|
PROBOOT.SOURCES=$(wildcard src/proboot/*.a)
|
||||||
# create _FileInformation.txt files for subdirectories
|
LAUNCHER.SOURCES=$(wildcard src/*.a)
|
||||||
#
|
HDV=$(BUILDDIR)/$(DISK)
|
||||||
bin/buildfileinfo.sh res/ICONS "CA" "0000"
|
PROBOOTHD=$(BUILDDIR)/proboothd
|
||||||
bin/buildfileinfo.sh build/FX "06" "6000"
|
DEMO=$(BUILDDIR)/DEMO
|
||||||
cp src/prelaunch/_FileInformation.txt build/PRELAUNCH/
|
DEMO.LIST=$(BUILDDIR)/demo.list
|
||||||
#
|
FX=$(BUILDDIR)/FX
|
||||||
# add everything to the disk
|
FXCODE.LIST=$(BUILDDIR)/fxcode.list
|
||||||
#
|
FXDATA.LIST=$(BUILDDIR)/fxdata.list
|
||||||
for f in \
|
PRELAUNCH=$(BUILDDIR)/PRELAUNCH
|
||||||
build/TOTAL.DATA \
|
LAUNCHER.SYSTEM=$(BUILDDIR)/LAUNCHER.SYSTEM
|
||||||
build/PREFS.CONF \
|
ATTRACT=$(BUILDDIR)/ATTRACT
|
||||||
res/Finder.Data \
|
MINI.ATTRACT0.LIST=$(BUILDDIR)/mini.attract0.list
|
||||||
res/Finder.Root; do \
|
MINI.ATTRACT1.LIST=$(BUILDDIR)/mini.attract1.list
|
||||||
$(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" "$$f" -C >>build/log; \
|
ATTRACT.IDX=$(BUILDDIR)/ATTRACT.IDX
|
||||||
|
HELPTEXT=$(BUILDDIR)/HELPTEXT
|
||||||
|
CREDITS=$(BUILDDIR)/CREDITS
|
||||||
|
GAMEHELP=$(BUILDDIR)/GAMEHELP
|
||||||
|
GAMES.CONF=$(BUILDDIR)/GAMES.CONF
|
||||||
|
GAMES.SORTED=$(BUILDDIR)/GAMES.SORTED
|
||||||
|
PREFS.CONF=$(BUILDDIR)/PREFS.CONF
|
||||||
|
SS=$(BUILDDIR)/SS
|
||||||
|
SS.LIST=$(BUILDDIR)/ss.list
|
||||||
|
ACTION.DGR.LIST=$(BUILDDIR)/action.dgr.list
|
||||||
|
ACTION.DHGR.LIST=$(BUILDDIR)/action.dhgr.list
|
||||||
|
ACTION.GR.LIST=$(BUILDDIR)/action.gr.list
|
||||||
|
ACTION.HGR0.LIST=$(BUILDDIR)/action.hgr0.list
|
||||||
|
ACTION.HGR1.LIST=$(BUILDDIR)/action.hgr1.list
|
||||||
|
ACTION.HGR2.LIST=$(BUILDDIR)/action.hgr2.list
|
||||||
|
ACTION.HGR3.LIST=$(BUILDDIR)/action.hgr3.list
|
||||||
|
ACTION.HGR4.LIST=$(BUILDDIR)/action.hgr4.list
|
||||||
|
ACTION.HGR5.LIST=$(BUILDDIR)/action.hgr5.list
|
||||||
|
ACTION.HGR6.LIST=$(BUILDDIR)/action.hgr6.list
|
||||||
|
ARTWORK.SHR.LIST=$(BUILDDIR)/artwork.shr.list
|
||||||
|
TITLE.HGR.LIST=$(BUILDDIR)/title.hgr.list
|
||||||
|
TITLE.DHGR.LIST=$(BUILDDIR)/title.dhgr.list
|
||||||
|
TOTAL.DATA=$(BUILDDIR)/TOTAL.DATA
|
||||||
|
X=$(BUILDDIR)/X
|
||||||
|
XSINGLE.LIST=$(BUILDDIR)/xsingle.list
|
||||||
|
ACTION.DGR.SOURCES=$(wildcard res/ACTION.DGR/*)
|
||||||
|
ACTION.DHGR.SOURCES=$(wildcard res/ACTION.DHGR/*)
|
||||||
|
ACTION.GR.SOURCES=$(wildcard res/ACTION.GR/*)
|
||||||
|
ACTION.HGR.SOURCES=$(wildcard res/ACTION.HGR/*)
|
||||||
|
ARTWORK.SHR.SOURCES=$(wildcard res/ARTWORK.SHR/*)
|
||||||
|
ATTRACT.SOURCES=$(wildcard res/ATTRACT/*)
|
||||||
|
GAMEHELP.SOURCES=$(wildcard res/GAMEHELP/*)
|
||||||
|
SS.SOURCES=$(wildcard res/SS/*)
|
||||||
|
TITLE.ANIMATED.SOURCES=$(wildcard res/TITLE.ANIMATED/*)
|
||||||
|
TITLE.DHGR.SOURCES=$(wildcard res/TITLE.DHGR/*)
|
||||||
|
TITLE.HGR.SOURCES=$(wildcard res/TITLE.HGR/*)
|
||||||
|
CACHE.SOURCES=$(wildcard res/CACHE*.IDX)
|
||||||
|
ICONS=$(wildcard res/ICONS/*)
|
||||||
|
ATTRACT.CONF=res/ATTRACT.CONF
|
||||||
|
DFX.CONF=res/DFX.CONF
|
||||||
|
FX.CONF=res/FX.CONF
|
||||||
|
SFX.CONF=res/SFX.CONF
|
||||||
|
PREFS.CONF.SOURCE=res/PREFS.CONF
|
||||||
|
COVER=res/COVER
|
||||||
|
DECRUNCH=res/DECRUNCH
|
||||||
|
FINDER.DATA=res/Finder.Data
|
||||||
|
FINDER.ROOT=res/Finder.Root
|
||||||
|
HELP=res/HELP
|
||||||
|
JOYSTICK=res/JOYSTICK
|
||||||
|
TITLE=res/TITLE
|
||||||
|
|
||||||
|
.PHONY: compress attract cache clean mount all al
|
||||||
|
|
||||||
|
# build final disk image
|
||||||
|
$(HDV): $(PROBOOTHD) $(LAUNCHER.SYSTEM) $(PRELAUNCH) $(X) $(TOTAL.DATA) $(TITLE.ANIMATED.SOURCES) $(ICONS) $(FINDER.DATA) $(FINDER.ROOT) $(PREFS.CONF)
|
||||||
|
cp res/blank.hdv "$@"
|
||||||
|
cp res/_FileInformation.txt "$(BUILDDIR)"/
|
||||||
|
$(CADIUS) ADDFILE "$@" "/$(VOLUME)/" "$(LAUNCHER.SYSTEM)" -C >> "$(CADIUS.LOG)"
|
||||||
|
for f in "$(TOTAL.DATA)" "$(PREFS.CONF)" "$(FINDER.DATA)" "$(FINDER.ROOT)"; do \
|
||||||
|
$(CADIUS) ADDFILE "$@" "/$(VOLUME)/" "$$f" -C >> "$(CADIUS.LOG)"; \
|
||||||
done
|
done
|
||||||
for f in \
|
cp src/prelaunch/_FileInformation.txt "$(PRELAUNCH)"/
|
||||||
res/TITLE.ANIMATED \
|
for f in res/TITLE.ANIMATED res/ICONS "$(PRELAUNCH)" "$(X)"; do \
|
||||||
res/ICONS \
|
|
||||||
build/FX \
|
|
||||||
build/PRELAUNCH; do \
|
|
||||||
rm -f "$$f"/.DS_Store; \
|
rm -f "$$f"/.DS_Store; \
|
||||||
$(CADIUS) ADDFOLDER build/"$(DISK)" "/$(VOLUME)/$$(basename $$f)" "$$f" -C >>build/log; \
|
$(CADIUS) ADDFOLDER "$@" "/$(VOLUME)/$$(basename $$f)" "$$f" -C >> "$(CADIUS.LOG)"; \
|
||||||
done
|
done
|
||||||
$(CADIUS) CREATEFOLDER build/"$(DISK)" "/$(VOLUME)/X/" -C >>build/log
|
bin/changebootloader.sh "$@" $(PROBOOTHD)
|
||||||
for f in build/X/*; do \
|
@touch "$@"
|
||||||
$(CADIUS) ADDFOLDER build/"$(DISK)" "/$(VOLUME)/X/$$(basename $$f)" "$$f" -C >>build/log; \
|
|
||||||
done
|
|
||||||
bin/changebootloader.sh build/"$(DISK)" build/proboothd
|
|
||||||
|
|
||||||
extract: preconditions md
|
# build padded prefs file (padding is required for writing by ProRWTS)
|
||||||
$(PARALLEL) '$(CADIUS) EXTRACTVOLUME {} build/X/ >>build/log' ::: res/dsk/*.po
|
$(PREFS.CONF): $(PREFS.CONF.SOURCE) | $(MD)
|
||||||
rm -f build/X/**/.DS_Store build/X/**/PRODOS* build/X/**/LOADER.SYSTEM*
|
cp "$(PREFS.CONF.SOURCE)" "$@"
|
||||||
for f in $$(grep '^....1' res/GAMES.CONF | awk '!/^$$|^#/' | awk -F, '/,/ { print $$2 }' | awk -F= '{ print $$1 }'); do mv build/X/"$$(basename $$f)"/"$$(basename $$f)"* build/X.INDEXED/; rm -rf build/X/"$$(basename $$f)"; done
|
bin/padto.sh "$@"
|
||||||
(for f in build/X.INDEXED/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a -p build/TOTAL.DATA build/X.INDEXED > build/XSINGLE.IDX
|
|
||||||
|
# create a version of GAMES.CONF without comments or blank lines or anything after display titles
|
||||||
|
$(GAMES.CONF): $(MD)
|
||||||
|
awk '!/^$$|^#/' < res/GAMES.CONF | awk -F'/' '{ print $$1 }' > "$@"
|
||||||
|
|
||||||
index: preconditions md asmfx asmprelaunch asmdemo compress extract
|
|
||||||
#
|
|
||||||
# precompute binary data structure for mega-attract mode configuration file
|
|
||||||
#
|
|
||||||
[ -f build/index ] || (bin/buildokvs.sh < res/ATTRACT.CONF > build/ATTRACT.IDX)
|
|
||||||
#
|
|
||||||
# precompute binary data structure and substitute special characters
|
|
||||||
# in game help and other all-text pages
|
|
||||||
#
|
|
||||||
[ -f build/index ] || (bin/converthelp.sh res/HELPTEXT build/HELPTEXT)
|
|
||||||
[ -f build/index ] || (bin/converthelp.sh res/CREDITS build/CREDITS)
|
|
||||||
[ -f build/index ] || $(PARALLEL) 'bin/converthelp.sh "{}" "build/GAMEHELP/{/}"' ::: res/GAMEHELP/*
|
|
||||||
#
|
|
||||||
# create a version of GAMES.CONF without comments or blank lines
|
|
||||||
#
|
|
||||||
[ -f build/index ] || (awk '!/^$$|^#/' < res/GAMES.CONF > build/GAMES.CONF)
|
|
||||||
#
|
|
||||||
# create a list of all game filenames, without metadata or display names, sorted by game filename
|
# create a list of all game filenames, without metadata or display names, sorted by game filename
|
||||||
#
|
$(GAMES.SORTED): | $(MD) $(GAMES.CONF)
|
||||||
[ -f build/index ] || (awk -F, '/,/ { print $$2 }' < build/GAMES.CONF | awk -F= '{ print $$1 }' | sort > build/GAMES.SORTED)
|
awk -F, '/,/ { print $$2 }' < "$(GAMES.CONF)" | awk -F= '{ print $$1 }' | sort > "$@"
|
||||||
|
|
||||||
|
# extract files from original disk images and move them to their final directories
|
||||||
|
$(X): | $(MD) $(GAMES.CONF)
|
||||||
|
mkdir -p "$@" "$(BUILDDIR)"/X.INDEXED
|
||||||
|
$(PARALLEL) '$(CADIUS) EXTRACTVOLUME {} "$@"/ >> "$(CADIUS.LOG)"' ::: res/dsk/*.po
|
||||||
|
rm -f "$@"/**/.DS_Store "$@"/**/PRODOS* "$@"/**/LOADER.SYSTEM* "$@"/**/_FileInformation.txt
|
||||||
|
for f in $$(grep '^....1' "$(GAMES.CONF)" | awk '!/^$$|^#/' | awk -F, '/,/ { print $$2 }' | awk -F= '{ print $$1 }'); do mv "$@"/"$$f"/"$$f"* "$(BUILDDIR)"/X.INDEXED/; rm -rf "$@"/"$$f"; done
|
||||||
|
(cd "$(BUILDDIR)"/X.INDEXED/ && for f in *; do echo "$$f"; done) > "$(XSINGLE.LIST)"
|
||||||
|
for d in "$@"/*; do mv "$$d"/* "$@"/; rmdir "$$d"; done
|
||||||
|
@touch "$@"
|
||||||
|
|
||||||
|
# precompute binary data structure for mega-attract mode configuration file
|
||||||
|
$(ATTRACT.IDX): $(MD)
|
||||||
|
bin/buildokvs.py < res/ATTRACT.CONF > "$@"
|
||||||
|
|
||||||
|
# precompute binary data structure and substitute special characters in global help
|
||||||
|
$(HELPTEXT): $(MD)
|
||||||
|
bin/converthelp.sh res/HELPTEXT "$@"
|
||||||
|
|
||||||
|
# precompute binary data structure and substitute special characters in credits
|
||||||
|
$(CREDITS): $(MD)
|
||||||
|
bin/converthelp.sh res/CREDITS "$@"
|
||||||
|
|
||||||
|
# precompute binary data structures and substitute special characters for each game's help
|
||||||
|
$(GAMEHELP): $(GAMEHELP.SOURCES) | $(MD)
|
||||||
|
mkdir -p "$@"
|
||||||
|
$(PARALLEL) 'bin/converthelp.sh "{}" "$@/{/}"' ::: res/GAMEHELP/*
|
||||||
|
@touch "$@"
|
||||||
|
|
||||||
|
# precompute binary data structures for slideshow configuration files
|
||||||
|
$(SS): $(SS.SOURCES) | $(MD) $(GAMES.CONF)
|
||||||
|
mkdir -p "$@"
|
||||||
|
$(PARALLEL) 'bin/buildslideshow.py "{}" "$(GAMES.CONF)" < "{}" > "$@/{/}"' ::: res/SS/*
|
||||||
|
(cd "$(SS)"/ && for f in *; do echo "$$f"; done) > "$(SS.LIST)"
|
||||||
|
@touch "$@"
|
||||||
|
|
||||||
|
# precompute binary data structures for each game's mini-attract configuration file
|
||||||
|
$(ATTRACT): $(ATTRACT.SOURCES) | $(MD)
|
||||||
|
mkdir -p "$@"
|
||||||
|
$(PARALLEL) 'bin/buildokvs.py < "{}" > "$@/{/}"' ::: res/ATTRACT/*
|
||||||
|
(cd "$(ATTRACT)"/ && for f in [ABCDEFGHIJKLMNOP]*; do echo "$$f"; done) > "$(MINI.ATTRACT0.LIST)"
|
||||||
|
(cd "$(ATTRACT)"/ && for f in [QRSTUVWXYZ]*; do echo "$$f"; done) > "$(MINI.ATTRACT1.LIST)"
|
||||||
|
@touch "$@"
|
||||||
|
|
||||||
|
# create lists of specific files used to build data structures later
|
||||||
|
$(ACTION.HGR0.LIST): $(ACTION.HGR.SOURCES) | $(MD)
|
||||||
|
(cd res/ACTION.HGR/ && for f in [ABCD]*; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(ACTION.HGR1.LIST): $(ACTION.HGR.SOURCES) | $(MD)
|
||||||
|
(cd res/ACTION.HGR/ && for f in [EFGH]*; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(ACTION.HGR2.LIST): $(ACTION.HGR.SOURCES) | $(MD)
|
||||||
|
(cd res/ACTION.HGR/ && for f in [IJKL]*; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(ACTION.HGR3.LIST): $(ACTION.HGR.SOURCES) | $(MD)
|
||||||
|
(cd res/ACTION.HGR/ && for f in [MNOP]*; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(ACTION.HGR4.LIST): $(ACTION.HGR.SOURCES) | $(MD)
|
||||||
|
(cd res/ACTION.HGR/ && for f in [QRST]*; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(ACTION.HGR5.LIST): $(ACTION.HGR.SOURCES) | $(MD)
|
||||||
|
(cd res/ACTION.HGR/ && for f in [UVWX]*; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(ACTION.HGR6.LIST): $(ACTION.HGR.SOURCES) | $(MD)
|
||||||
|
(cd res/ACTION.HGR/ && for f in [YZ]*; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(ACTION.DHGR.LIST): $(ACTION.DHGR.SOURCES) | $(MD)
|
||||||
|
(cd res/ACTION.DHGR/ && for f in *; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(ACTION.GR.LIST): $(ACTION.GR.SOURCES) | $(MD)
|
||||||
|
(cd res/ACTION.GR/ && for f in *; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(ACTION.DGR.LIST): $(ACTION.DGR.SOURCES) | $(MD)
|
||||||
|
(cd res/ACTION.DGR/ && for f in *; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(ARTWORK.SHR.LIST): $(ARTWORK.SHR.SOURCES) | $(MD)
|
||||||
|
(cd res/ARTWORK.SHR/ && for f in *; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(TITLE.HGR.LIST): $(TITLE.HGR.SOURCES) | $(MD)
|
||||||
|
(cd res/TITLE.HGR/ && for f in *; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(TITLE.DHGR.LIST): $(TITLE.DHGR.SOURCES) | $(MD)
|
||||||
|
(cd res/TITLE.DHGR/ && for f in *; do echo "$$f"; done) > "$@"
|
||||||
|
|
||||||
|
$(TOTAL.DATA): $(FX) $(PRELAUNCH) $(DEMO) $(SS) $(X) $(ATTRACT) $(ATTRACT.IDX) $(HELPTEXT) $(CREDITS) $(GAMEHELP) $(GAMES.CONF) $(GAMES.SORTED) $(ACTION.HGR0.LIST) $(ACTION.HGR1.LIST) $(ACTION.HGR2.LIST) $(ACTION.HGR3.LIST) $(ACTION.HGR4.LIST) $(ACTION.HGR5.LIST) $(ACTION.HGR6.LIST) $(ACTION.DGR.LIST) $(ACTION.DHGR.LIST) $(ACTION.GR.LIST) $(ARTWORK.SHR.LIST) $(TITLE.DHGR.LIST) $(TITLE.HGR.LIST) $(CACHE.SOURCES) $(ATTRACT.CONF) $(DFX.CONF) $(FX.CONF) $(SFX.CONF) $(COVER) $(DECRUNCH) $(HELP) $(JOYSTICK) $(TITLE)
|
||||||
#
|
#
|
||||||
# precompute indexed files for prelaunch
|
# precompute indexed files for prelaunch
|
||||||
# note: prelaunch must be first in TOTAL.DATA due to a hack in LoadStandardPrelaunch
|
# 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
|
# note 2: these can not be padded because they are loaded at $0106 and padding would clobber the stack
|
||||||
#
|
#
|
||||||
[ -f build/index ] || (bin/buildindexedfile.sh build/TOTAL.DATA build/PRELAUNCH.INDEXED < build/GAMES.SORTED > build/PRELAUNCH.IDX)
|
rm -f "$@"
|
||||||
|
touch "$@"
|
||||||
|
bin/buildindexedfile.py "$@" "$(BUILDDIR)"/PRELAUNCH.INDEXED < "$(GAMES.SORTED)" > "$(BUILDDIR)"/PRELAUNCH.IDX
|
||||||
#
|
#
|
||||||
# precompute indexed files for HGR & DHGR titles
|
# precompute indexed files for HGR & DHGR titles
|
||||||
# note: these are not padded because they are all an exact block-multiple anyway
|
# note: these are not padded because they are all an exact block-multiple anyway
|
||||||
#
|
#
|
||||||
[ -f build/index ] || bin/padto.sh build/TOTAL.DATA
|
bin/padto.sh "$@"
|
||||||
[ -f build/index ] || ((for f in res/TITLE.HGR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/TITLE.HGR build/HGR.TITLES.LOG > build/TITLE.IDX)
|
bin/buildindexedfile.py "$@" res/TITLE.HGR "$(BUILDDIR)"/HGR.TITLES.LOG < "$(TITLE.HGR.LIST)" > "$(BUILDDIR)"/TITLE.IDX
|
||||||
[ -f build/index ] || ((for f in res/TITLE.DHGR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/TITLE.DHGR build/DHGR.TITLES.LOG > build/DTITLE.IDX)
|
bin/buildindexedfile.py "$@" res/TITLE.DHGR "$(BUILDDIR)"/DHGR.TITLES.LOG < "$(TITLE.DHGR.LIST)" > "$(BUILDDIR)"/DTITLE.IDX
|
||||||
[ -f build/index ] || bin/addfile.sh res/COVER build/TOTAL.DATA > src/index/res.cover.idx.a
|
bin/addfiles.py "$@" \
|
||||||
[ -f build/index ] || bin/addfile.sh res/TITLE build/TOTAL.DATA > src/index/res.title.idx.a
|
"$(COVER)" src/index/res.cover.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh res/HELP build/TOTAL.DATA > src/index/res.help.idx.a
|
"$(TITLE)" src/index/res.title.idx.a \
|
||||||
|
"$(HELP)" src/index/res.help.idx.a
|
||||||
#
|
#
|
||||||
# precompute indexed files for game help
|
# precompute indexed files for game help
|
||||||
# note: these can be padded because they're loaded into $800 at a time when $800..$1FFF is clobber-able
|
# note: these can be padded because they're loaded into $800 at a time when $800..$1FFF is clobber-able
|
||||||
#
|
#
|
||||||
[ -f build/index ] || (bin/buildindexedfile.sh -p -a build/TOTAL.DATA build/GAMEHELP < build/GAMES.SORTED > build/GAMEHELP.IDX)
|
bin/buildindexedfile.py -p "$@" "$(GAMEHELP)" < "$(GAMES.SORTED)" > "$(BUILDDIR)"/GAMEHELP.IDX
|
||||||
#
|
#
|
||||||
# precompute indexed files for slideshows
|
# precompute indexed files for slideshows
|
||||||
# note: these can be padded because they're loaded into $800 at a time when $800..$1FFF is clobber-able
|
# note: these can be padded because they're loaded into $800 at a time when $800..$1FFF is clobber-able
|
||||||
#
|
#
|
||||||
[ -f build/index ] || $(PARALLEL) '[ $$(echo "{/}" | cut -c-3) = "ACT" ] && bin/buildslideshow.sh -d build/GAMES.CONF < "{}" > "build/SS/{/}" || bin/buildslideshow.sh build/GAMES.CONF < "{}" > "build/SS/{/}"' ::: res/SS/*
|
bin/buildindexedfile.py -p "$@" "$(SS)" < "$(SS.LIST)" > "$(BUILDDIR)"/SLIDESHOW.IDX
|
||||||
[ -f build/index ] || ((for f in build/SS/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -p -a build/TOTAL.DATA build/SS > build/SLIDESHOW.IDX)
|
bin/buildindexedfile.py -p "$@" "$(ATTRACT)" < "$(MINI.ATTRACT0.LIST)" > "$(BUILDDIR)"/MINIATTRACT0.IDX
|
||||||
[ -f build/index ] || $(PARALLEL) 'bin/buildokvs.sh < "{}" > "build/ATTRACT/{/}"' ::: res/ATTRACT/*
|
bin/buildindexedfile.py -p "$@" "$(ATTRACT)" < "$(MINI.ATTRACT1.LIST)" > "$(BUILDDIR)"/MINIATTRACT1.IDX
|
||||||
[ -f build/index ] || ((for f in build/ATTRACT/[ABCDEFGHIJKLMNOP]*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -p -a build/TOTAL.DATA build/ATTRACT > build/MINIATTRACT0.IDX)
|
|
||||||
[ -f build/index ] || ((for f in build/ATTRACT/[QRSTUVWXYZ]*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -p -a build/TOTAL.DATA build/ATTRACT > build/MINIATTRACT1.IDX)
|
|
||||||
#
|
#
|
||||||
# precompute indexed files for graphic effects
|
# precompute indexed files for graphic effects
|
||||||
# note: these can be padded because they're loaded into $6000 at a time when $6000..$BEFF is clobber-able
|
# note: these can be padded because they're loaded into $6000 at a time when $6000..$BEFF is clobber-able
|
||||||
#
|
#
|
||||||
[ -f build/index ] || (bin/buildindexedfile.sh -p -a build/TOTAL.DATA build/FX.INDEXED < res/FX.CONF > build/FX.IDX)
|
bin/buildindexedfile.py -p "$@" "$(BUILDDIR)"/FX.INDEXED < "$(FX.CONF)" > "$(BUILDDIR)"/FX.IDX
|
||||||
[ -f build/index ] || (bin/buildindexedfile.sh -p -a build/TOTAL.DATA build/FX.INDEXED < res/DFX.CONF > build/DFX.IDX)
|
bin/buildindexedfile.py -p "$@" "$(BUILDDIR)"/FX.INDEXED < "$(DFX.CONF)" > "$(BUILDDIR)"/DFX.IDX
|
||||||
[ -f build/index ] || (bin/buildindexedfile.sh -p -a build/TOTAL.DATA build/FX.INDEXED < res/SFX.CONF > build/SFX.IDX)
|
bin/buildindexedfile.py -p "$@" "$(BUILDDIR)"/FX.INDEXED < "$(SFX.CONF)" > "$(BUILDDIR)"/SFX.IDX
|
||||||
|
bin/buildindexedfile.py -p "$@" "$(BUILDDIR)"/FXCODE < "$(FXCODE.LIST)" > "$(BUILDDIR)"/FXCODE.IDX
|
||||||
|
#
|
||||||
|
# precompute indexed files for coordinates files loaded by graphic effects
|
||||||
|
# note: these can not be padded because some of them are loaded into tight spaces near the unclobberable top of main memory
|
||||||
|
#
|
||||||
|
bin/buildindexedfile.py "$@" "$(BUILDDIR)"/FXDATA < "$(FXDATA.LIST)" > "$(BUILDDIR)"/FXDATA.IDX
|
||||||
#
|
#
|
||||||
# precompute indexed files for HGR & DHGR action screenshots
|
# precompute indexed files for HGR & DHGR action screenshots
|
||||||
# note: these can not be padded because they are compressed and the decompressor needs the exact size
|
# note: these can not be padded because they are compressed and the decompressor needs the exact size
|
||||||
#
|
#
|
||||||
[ -f build/index ] || ((for f in res/ACTION.HGR/[ABCD]*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ACTION.HGR > build/HGR0.IDX)
|
bin/buildindexedfile.py "$@" res/ACTION.HGR < "$(ACTION.HGR0.LIST)" > "$(BUILDDIR)"/HGR0.IDX
|
||||||
[ -f build/index ] || ((for f in res/ACTION.HGR/[EFGH]*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ACTION.HGR > build/HGR1.IDX)
|
bin/buildindexedfile.py "$@" res/ACTION.HGR < "$(ACTION.HGR1.LIST)" > "$(BUILDDIR)"/HGR1.IDX
|
||||||
[ -f build/index ] || ((for f in res/ACTION.HGR/[IJKL]*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ACTION.HGR > build/HGR2.IDX)
|
bin/buildindexedfile.py "$@" res/ACTION.HGR < "$(ACTION.HGR2.LIST)" > "$(BUILDDIR)"/HGR2.IDX
|
||||||
[ -f build/index ] || ((for f in res/ACTION.HGR/[MNOP]*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ACTION.HGR > build/HGR3.IDX)
|
bin/buildindexedfile.py "$@" res/ACTION.HGR < "$(ACTION.HGR3.LIST)" > "$(BUILDDIR)"/HGR3.IDX
|
||||||
[ -f build/index ] || ((for f in res/ACTION.HGR/[QRST]*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ACTION.HGR > build/HGR4.IDX)
|
bin/buildindexedfile.py "$@" res/ACTION.HGR < "$(ACTION.HGR4.LIST)" > "$(BUILDDIR)"/HGR4.IDX
|
||||||
[ -f build/index ] || ((for f in res/ACTION.HGR/[UVWX]*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ACTION.HGR > build/HGR5.IDX)
|
bin/buildindexedfile.py "$@" res/ACTION.HGR < "$(ACTION.HGR5.LIST)" > "$(BUILDDIR)"/HGR5.IDX
|
||||||
[ -f build/index ] || ((for f in res/ACTION.HGR/[YZ]*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ACTION.HGR > build/HGR6.IDX)
|
bin/buildindexedfile.py "$@" res/ACTION.HGR < "$(ACTION.HGR6.LIST)" > "$(BUILDDIR)"/HGR6.IDX
|
||||||
[ -f build/index ] || ((for f in res/ACTION.DHGR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ACTION.DHGR > build/DHGR.IDX)
|
bin/buildindexedfile.py "$@" res/ACTION.DHGR < "$(ACTION.DHGR.LIST)" > "$(BUILDDIR)"/DHGR.IDX
|
||||||
#
|
#
|
||||||
# precompute indexed files for GR and DGR action screenshots
|
# precompute indexed files for GR and DGR action screenshots
|
||||||
# note: these can be padded because they are not compressed
|
# note: these can be padded because they are not compressed
|
||||||
#
|
#
|
||||||
[ -f build/index ] || ((for f in res/ACTION.GR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a -p build/TOTAL.DATA res/ACTION.GR > build/GR.IDX)
|
bin/buildindexedfile.py -p "$@" res/ACTION.GR < "$(ACTION.GR.LIST)" > "$(BUILDDIR)"/GR.IDX
|
||||||
[ -f build/index ] || ((for f in res/ACTION.DGR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a -p build/TOTAL.DATA res/ACTION.DGR > build/DGR.IDX)
|
bin/buildindexedfile.py -p "$@" res/ACTION.DGR < "$(ACTION.DGR.LIST)" > "$(BUILDDIR)"/DGR.IDX
|
||||||
#
|
#
|
||||||
# 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
|
# note: these can not be padded because they are compressed and the decompressor needs the exact size
|
||||||
#
|
#
|
||||||
[ -f build/index ] || ((for f in res/ARTWORK.SHR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ARTWORK.SHR > build/ARTWORK.IDX)
|
bin/buildindexedfile.py "$@" res/ARTWORK.SHR < "$(ARTWORK.SHR.LIST)" > "$(BUILDDIR)"/ARTWORK.IDX
|
||||||
#
|
#
|
||||||
# precompute indexed files for demo launchers
|
# precompute indexed files for demo launchers
|
||||||
# note: these can not be padded because some of them are loaded too close to $C000
|
# note: these can not be padded because some of them are loaded too close to $C000
|
||||||
#
|
#
|
||||||
[ -f build/index ] || ((for f in build/DEMO/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA build/DEMO > build/DEMO.IDX)
|
bin/buildindexedfile.py "$@" "$(DEMO)" < "$(DEMO.LIST)" > "$(BUILDDIR)"/DEMO.IDX
|
||||||
[ -f build/index ] || bin/addfile.sh build/DEMO.IDX build/TOTAL.DATA > src/index/demo.idx.a
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# precompute indexed files for single-load game binaries
|
# precompute indexed files for single-load game binaries
|
||||||
# note: these can be padded because they are loaded at a time when all of main memory is clobber-able
|
# note: these can be padded because they are loaded at a time when all of main memory is clobber-able
|
||||||
#
|
#
|
||||||
[ -f build/index ] || ((for f in build/X.INDEXED/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a -p build/TOTAL.DATA build/X.INDEXED > build/XSINGLE.IDX)
|
bin/buildindexedfile.py -p "$@" "$(BUILDDIR)"/X.INDEXED < "$(XSINGLE.LIST)" > "$(BUILDDIR)"/XSINGLE.IDX
|
||||||
[ -f build/index ] || bin/addfile.sh build/XSINGLE.IDX build/TOTAL.DATA > src/index/xsingle.idx.a
|
|
||||||
#
|
#
|
||||||
# create search indexes for each variation of (game-requires-joystick) X (game-requires-128K)
|
# create search indexes for each variation of (game-requires-joystick) X (game-requires-128K)
|
||||||
# in the form of OKVS data structures, plus game counts in the form of source files
|
# in the form of OKVS data structures, plus game counts in the form of source files
|
||||||
#
|
#
|
||||||
[ -f build/index ] || $(PARALLEL) ::: \
|
$(PARALLEL) ::: \
|
||||||
'(grep "^00" < build/GAMES.CONF | bin/buildsearch.sh src/index/count00.a build/HGR.TITLES.LOG /dev/null > build/SEARCH00.IDX)' \
|
'(grep "^00" < "$(GAMES.CONF)" | bin/buildsearch.py src/index/count00.a "$(BUILDDIR)"/HGR.TITLES.LOG "" > "$(BUILDDIR)"/SEARCH00.IDX)' \
|
||||||
'(grep "^0" < build/GAMES.CONF | bin/buildsearch.sh src/index/count01.a build/HGR.TITLES.LOG build/DHGR.TITLES.LOG > build/SEARCH01.IDX)' \
|
'(grep "^0" < "$(GAMES.CONF)" | bin/buildsearch.py src/index/count01.a "$(BUILDDIR)"/HGR.TITLES.LOG "$(BUILDDIR)"/DHGR.TITLES.LOG > "$(BUILDDIR)"/SEARCH01.IDX)' \
|
||||||
'(grep "^.0" < build/GAMES.CONF | bin/buildsearch.sh src/index/count10.a build/HGR.TITLES.LOG /dev/null > build/SEARCH10.IDX)' \
|
'(grep "^.0" < "$(GAMES.CONF)" | bin/buildsearch.py src/index/count10.a "$(BUILDDIR)"/HGR.TITLES.LOG "" > "$(BUILDDIR)"/SEARCH10.IDX)' \
|
||||||
'(bin/buildsearch.sh src/index/count11.a build/HGR.TITLES.LOG build/DHGR.TITLES.LOG < build/GAMES.CONF > build/SEARCH11.IDX)'
|
'(bin/buildsearch.py src/index/count11.a "$(BUILDDIR)"/HGR.TITLES.LOG "$(BUILDDIR)"/DHGR.TITLES.LOG < "$(GAMES.CONF)" > "$(BUILDDIR)"/SEARCH11.IDX)'
|
||||||
#
|
#
|
||||||
# add IDX files to the combined index file and generate
|
# add IDX files to the combined index file and generate
|
||||||
# the index records that callers use to reference them
|
# the index records that callers use to reference them,
|
||||||
|
# plus additional miscellaneous files
|
||||||
#
|
#
|
||||||
[ -f build/index ] || bin/addfile.sh build/SEARCH00.IDX build/TOTAL.DATA > src/index/search00.idx.a
|
bin/addfiles.py "$@" \
|
||||||
[ -f build/index ] || bin/addfile.sh res/CACHE00.IDX build/TOTAL.DATA > src/index/cache00.idx.a
|
"$(BUILDDIR)"/SEARCH00.IDX src/index/search00.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/SEARCH01.IDX build/TOTAL.DATA > src/index/search01.idx.a
|
res/CACHE00.IDX src/index/cache00.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh res/CACHE01.IDX build/TOTAL.DATA > src/index/cache01.idx.a
|
"$(BUILDDIR)"/SEARCH01.IDX src/index/search01.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/SEARCH10.IDX build/TOTAL.DATA > src/index/search10.idx.a
|
res/CACHE01.IDX src/index/cache01.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh res/CACHE10.IDX build/TOTAL.DATA > src/index/cache10.idx.a
|
"$(BUILDDIR)"/SEARCH10.IDX src/index/search10.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/SEARCH11.IDX build/TOTAL.DATA > src/index/search11.idx.a
|
res/CACHE10.IDX src/index/cache10.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh res/CACHE11.IDX build/TOTAL.DATA > src/index/cache11.idx.a
|
"$(BUILDDIR)"/SEARCH11.IDX src/index/search11.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/PRELAUNCH.IDX build/TOTAL.DATA > src/index/prelaunch.idx.a
|
res/CACHE11.IDX src/index/cache11.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/ATTRACT.IDX build/TOTAL.DATA > src/index/attract.idx.a
|
"$(BUILDDIR)"/PRELAUNCH.IDX src/index/prelaunch.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/FX.IDX build/TOTAL.DATA > src/index/fx.idx.a
|
"$(ATTRACT.IDX)" src/index/attract.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/DFX.IDX build/TOTAL.DATA > src/index/dfx.idx.a
|
"$(BUILDDIR)"/DEMO.IDX src/index/demo.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/SFX.IDX build/TOTAL.DATA > src/index/sfx.idx.a
|
"$(BUILDDIR)"/XSINGLE.IDX src/index/xsingle.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/GAMEHELP.IDX build/TOTAL.DATA > src/index/gamehelp.idx.a
|
"$(BUILDDIR)"/FX.IDX src/index/fx.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/SLIDESHOW.IDX build/TOTAL.DATA > src/index/slideshow.idx.a
|
"$(BUILDDIR)"/DFX.IDX src/index/dfx.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/MINIATTRACT0.IDX build/TOTAL.DATA > src/index/miniattract0.idx.a
|
"$(BUILDDIR)"/SFX.IDX src/index/sfx.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/MINIATTRACT1.IDX build/TOTAL.DATA > src/index/miniattract1.idx.a
|
"$(BUILDDIR)"/FXCODE.IDX src/index/fxcode.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/TITLE.IDX build/TOTAL.DATA > src/index/title.idx.a
|
"$(BUILDDIR)"/FXDATA.IDX src/index/fxdata.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/DTITLE.IDX build/TOTAL.DATA > src/index/dtitle.idx.a
|
"$(BUILDDIR)"/GAMEHELP.IDX src/index/gamehelp.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/HGR0.IDX build/TOTAL.DATA > src/index/hgr0.idx.a
|
"$(BUILDDIR)"/SLIDESHOW.IDX src/index/slideshow.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/HGR1.IDX build/TOTAL.DATA > src/index/hgr1.idx.a
|
"$(BUILDDIR)"/MINIATTRACT0.IDX src/index/miniattract0.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/HGR2.IDX build/TOTAL.DATA > src/index/hgr2.idx.a
|
"$(BUILDDIR)"/MINIATTRACT1.IDX src/index/miniattract1.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/HGR3.IDX build/TOTAL.DATA > src/index/hgr3.idx.a
|
"$(BUILDDIR)"/TITLE.IDX src/index/title.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/HGR4.IDX build/TOTAL.DATA > src/index/hgr4.idx.a
|
"$(BUILDDIR)"/DTITLE.IDX src/index/dtitle.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/HGR5.IDX build/TOTAL.DATA > src/index/hgr5.idx.a
|
"$(BUILDDIR)"/HGR0.IDX src/index/hgr0.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/HGR6.IDX build/TOTAL.DATA > src/index/hgr6.idx.a
|
"$(BUILDDIR)"/HGR1.IDX src/index/hgr1.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/DHGR.IDX build/TOTAL.DATA > src/index/dhgr.idx.a
|
"$(BUILDDIR)"/HGR2.IDX src/index/hgr2.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/GR.IDX build/TOTAL.DATA > src/index/gr.idx.a
|
"$(BUILDDIR)"/HGR3.IDX src/index/hgr3.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/DGR.IDX build/TOTAL.DATA > src/index/dgr.idx.a
|
"$(BUILDDIR)"/HGR4.IDX src/index/hgr4.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/ARTWORK.IDX build/TOTAL.DATA > src/index/artwork.idx.a
|
"$(BUILDDIR)"/HGR5.IDX src/index/hgr5.idx.a \
|
||||||
#
|
"$(BUILDDIR)"/HGR6.IDX src/index/hgr6.idx.a \
|
||||||
# add additional miscellaneous files
|
"$(BUILDDIR)"/DHGR.IDX src/index/dhgr.idx.a \
|
||||||
#
|
"$(BUILDDIR)"/GR.IDX src/index/gr.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/COVERFADE build/TOTAL.DATA > src/index/coverfade.idx.a
|
"$(BUILDDIR)"/DGR.IDX src/index/dgr.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/GR.FIZZLE build/TOTAL.DATA > src/index/gr.fizzle.idx.a
|
"$(BUILDDIR)"/ARTWORK.IDX src/index/artwork.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/DGR.FIZZLE build/TOTAL.DATA > src/index/dgr.fizzle.idx.a
|
"$(BUILDDIR)"/COVERFADE src/index/coverfade.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/HELPTEXT build/TOTAL.DATA > src/index/helptext.idx.a
|
"$(BUILDDIR)"/GR.FIZZLE src/index/gr.fizzle.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh build/CREDITS build/TOTAL.DATA > src/index/credits.idx.a
|
"$(BUILDDIR)"/DGR.FIZZLE src/index/dgr.fizzle.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh res/DECRUNCH build/TOTAL.DATA > src/index/decrunch.idx.a
|
"$(HELPTEXT)" src/index/helptext.idx.a \
|
||||||
[ -f build/index ] || bin/addfile.sh res/JOYSTICK build/TOTAL.DATA > src/index/joystick.idx.a
|
"$(CREDITS)" src/index/credits.idx.a \
|
||||||
touch build/index
|
"$(DECRUNCH)" src/index/decrunch.idx.a \
|
||||||
|
"$(JOYSTICK)" src/index/joystick.idx.a
|
||||||
|
@touch "$@"
|
||||||
|
|
||||||
asmlauncher: preconditions md
|
# assemble main program
|
||||||
$(ACME) -DBUILDNUMBER=`git rev-list --count HEAD` src/4cade.a 2>build/relbase.log
|
$(LAUNCHER.SYSTEM): $(LAUNCHER.SOURCES) | $(MD) $(TOTAL.DATA)
|
||||||
$(ACME) -r build/4cade.lst -DBUILDNUMBER=`git rev-list --count HEAD` -DRELBASE=`cat build/relbase.log | grep "RELBASE =" | cut -d"=" -f2 | cut -d"(" -f2 | cut -d")" -f1` src/4cade.a
|
$(ACME) -DBUILDNUMBER=`git rev-list --count HEAD` src/4cade.a 2>"$(BUILDDIR)"/relbase.log
|
||||||
|
$(ACME) -r "$(BUILDDIR)"/4cade.lst -DBUILDNUMBER=`git rev-list --count HEAD` -DRELBASE=`cat "$(BUILDDIR)"/relbase.log | grep "RELBASE =" | cut -d"=" -f2 | cut -d"(" -f2 | cut -d")" -f1` src/4cade.a
|
||||||
|
@touch "$@"
|
||||||
|
|
||||||
asmdemo: preconditions md
|
# assemble launchers for self-running demos
|
||||||
|
$(DEMO): $(DEMO.SOURCES) | $(MD)
|
||||||
|
mkdir -p "$@"
|
||||||
$(PARALLEL) 'if grep -q "^!to" "{}"; then $(ACME) "{}"; fi' ::: src/demo/*.a
|
$(PARALLEL) 'if grep -q "^!to" "{}"; then $(ACME) "{}"; fi' ::: src/demo/*.a
|
||||||
|
(cd "$(DEMO)"/ && for f in *; do echo "$$f"; done) > "$(DEMO.LIST)"
|
||||||
|
@touch "$@"
|
||||||
|
|
||||||
asmfx: preconditions md
|
# assemble graphic effects
|
||||||
|
$(FX): $(FX.SOURCES) | $(MD)
|
||||||
|
mkdir -p "$@" "$(BUILDDIR)"/FX.INDEXED "$(BUILDDIR)"/FXDATA "$(BUILDDIR)"/FXCODE
|
||||||
$(PARALLEL) 'if grep -q "^!to" "{}"; then $(ACME) "{}"; fi' ::: src/fx/*.a
|
$(PARALLEL) 'if grep -q "^!to" "{}"; then $(ACME) "{}"; fi' ::: src/fx/*.a
|
||||||
|
(cd "$(BUILDDIR)"/FXCODE/ && for f in *; do echo "$$f"; done) > "$(FXCODE.LIST)"
|
||||||
|
(cd "$(BUILDDIR)"/FXDATA/ && for f in *; do echo "$$f"; done) > "$(FXDATA.LIST)"
|
||||||
|
@touch "$@"
|
||||||
|
|
||||||
asmprelaunch: preconditions md
|
# assemble launchers for games
|
||||||
|
$(PRELAUNCH): $(PRELAUNCH.SOURCES) | $(MD)
|
||||||
|
mkdir -p "$@" "$(BUILDDIR)"/PRELAUNCH.INDEXED
|
||||||
$(PARALLEL) 'if grep -q "^!to" "{}"; then $(ACME) "{}"; fi' ::: src/prelaunch/*.a
|
$(PARALLEL) 'if grep -q "^!to" "{}"; then $(ACME) "{}"; fi' ::: src/prelaunch/*.a
|
||||||
|
@touch "$@"
|
||||||
|
|
||||||
asmproboot: md
|
# assemble bootloader
|
||||||
$(ACME) -r build/proboothd.lst src/proboothd/proboothd.a
|
$(PROBOOTHD): $(PROBOOT.SOURCES) | $(MD)
|
||||||
|
$(ACME) -r "$(BUILDDIR)"/proboothd.lst src/proboothd/proboothd.a
|
||||||
|
@touch "$@"
|
||||||
|
|
||||||
compress: preconditions md
|
#
|
||||||
|
# |compress| must be called separately because it is slow and
|
||||||
|
# only needs to be run when a new graphic file is added.
|
||||||
|
# It create files in the repository which can then be checked in.
|
||||||
|
#
|
||||||
|
compress: $(MD)
|
||||||
$(PARALLEL) '[ -f "res/ACTION.HGR/{/}" ] || ${EXOMIZER} "{}"@0x4000 -o "res/ACTION.HGR/{/}"' ::: res/ACTION.HGR.UNCOMPRESSED/*
|
$(PARALLEL) '[ -f "res/ACTION.HGR/{/}" ] || ${EXOMIZER} "{}"@0x4000 -o "res/ACTION.HGR/{/}"' ::: res/ACTION.HGR.UNCOMPRESSED/*
|
||||||
$(PARALLEL) '[ -f "res/ACTION.DHGR/{/}" ] || ${EXOMIZER} "{}"@0x4000 -o "res/ACTION.DHGR/{/}"' ::: res/ACTION.DHGR.UNCOMPRESSED/*
|
$(PARALLEL) '[ -f "res/ACTION.DHGR/{/}" ] || ${EXOMIZER} "{}"@0x4000 -o "res/ACTION.DHGR/{/}"' ::: res/ACTION.DHGR.UNCOMPRESSED/*
|
||||||
$(PARALLEL) '[ -f "res/ARTWORK.SHR/{/}" ] || ${EXOMIZER} "{}"@0x2000 -o "res/ARTWORK.SHR/{/}"' ::: res/ARTWORK.SHR.UNCOMPRESSED/*
|
$(PARALLEL) '[ -f "res/ARTWORK.SHR/{/}" ] || ${EXOMIZER} "{}"@0x2000 -o "res/ARTWORK.SHR/{/}"' ::: res/ARTWORK.SHR.UNCOMPRESSED/*
|
||||||
|
@ -254,34 +407,40 @@ attract: compress
|
||||||
bin/check-attract-mode.sh
|
bin/check-attract-mode.sh
|
||||||
bin/generate-mini-attract-mode.sh
|
bin/generate-mini-attract-mode.sh
|
||||||
|
|
||||||
cache: preconditions md
|
#
|
||||||
|
# |cache| must be called separately because it is slow and
|
||||||
|
# only needs to be run when a new game is added.
|
||||||
|
# It create files in the repository which can then be checked in.
|
||||||
|
#
|
||||||
|
cache: $(GAMES.CONF)
|
||||||
$(PARALLEL) ::: \
|
$(PARALLEL) ::: \
|
||||||
'awk -F= '"'"'/^00/ { print $$2 }'"'"' < res/GAMES.CONF | bin/buildcache.py > build/cache00.a' \
|
'awk -F= '"'"'/^00/ { print $$2 }'"'"' < "$(GAMES.CONF)" | bin/buildcache.py > "$(BUILDDIR)"/cache00.a' \
|
||||||
'awk -F= '"'"'/^0/ { print $$2 }'"'"' < res/GAMES.CONF | bin/buildcache.py > build/cache01.a' \
|
'awk -F= '"'"'/^0/ { print $$2 }'"'"' < "$(GAMES.CONF)" | bin/buildcache.py > "$(BUILDDIR)"/cache01.a' \
|
||||||
'awk -F= '"'"'/^.0/ { print $$2 }'"'"' < res/GAMES.CONF | bin/buildcache.py > build/cache10.a' \
|
'awk -F= '"'"'/^.0/ { print $$2 }'"'"' < "$(GAMES.CONF)" | bin/buildcache.py > "$(BUILDDIR)"/cache10.a' \
|
||||||
'awk -F= '"'"'!/^$$|^#|^\[/ { print $$2 }'"'"' < res/GAMES.CONF | bin/buildcache.py > build/cache11.a'
|
'awk -F= '"'"'!/^$$|^#/ { print $$2 }'"'"' < "$(GAMES.CONF)" | bin/buildcache.py > "$(BUILDDIR)"/cache11.a'
|
||||||
$(PARALLEL) ::: \
|
$(PARALLEL) ::: \
|
||||||
'$(ACME) -o res/CACHE00.IDX build/cache00.a' \
|
'$(ACME) -o res/CACHE00.IDX "$(BUILDDIR)"/cache00.a' \
|
||||||
'$(ACME) -o res/CACHE01.IDX build/cache01.a' \
|
'$(ACME) -o res/CACHE01.IDX "$(BUILDDIR)"/cache01.a' \
|
||||||
'$(ACME) -o res/CACHE10.IDX build/cache10.a' \
|
'$(ACME) -o res/CACHE10.IDX "$(BUILDDIR)"/cache10.a' \
|
||||||
'$(ACME) -o res/CACHE11.IDX build/cache11.a'
|
'$(ACME) -o res/CACHE11.IDX "$(BUILDDIR)"/cache11.a'
|
||||||
|
|
||||||
mount: dsk
|
mount: $(HDV)
|
||||||
osascript bin/V2Make.scpt "`pwd`" bin/4cade.vii build/"$(DISK)"
|
osascript bin/V2Make.scpt "`pwd`" bin/4cade.vii "$(HDV)"
|
||||||
|
|
||||||
md:
|
$(MD):
|
||||||
mkdir -p build/X build/X.INDEXED build/FX build/FX.INDEXED build/PRELAUNCH build/PRELAUNCH.INDEXED build/ATTRACT build/SS build/GAMEHELP build/DEMO
|
|
||||||
touch build/log
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf build/ || rm -rf build
|
|
||||||
|
|
||||||
preconditions:
|
|
||||||
@$(ACME) --version | grep -q "ACME, release" || (echo "ACME is not installed" && exit 1)
|
@$(ACME) --version | grep -q "ACME, release" || (echo "ACME is not installed" && exit 1)
|
||||||
@$(CADIUS) | grep -q "cadius v" || (echo "Cadius is not installed" && exit 1)
|
@$(CADIUS) | grep -q "cadius v" || (echo "Cadius is not installed" && exit 1)
|
||||||
@$(PARALLEL) --version | grep -q "GNU" || (echo "GNU Parallel is not installed" && exit 1)
|
@$(PARALLEL) --version | grep -q "GNU" || (echo "GNU Parallel is not installed" && exit 1)
|
||||||
@$(PYTHON) --version | grep -q "Python 3" || (echo "Python 3 is not installed" && exit 1)
|
@$(PYTHON) --version | grep -q "Python 3" || (echo "Python 3 is not installed" && exit 1)
|
||||||
|
mkdir -p "$(BUILDDIR)"
|
||||||
|
touch "$(CADIUS.LOG)"
|
||||||
|
@touch "$@"
|
||||||
|
|
||||||
all: clean dsk mount
|
clean:
|
||||||
|
rm -rf "$(BUILDDIR)"/ || rm -rf "$(BUILDDIR)"
|
||||||
|
|
||||||
|
all: clean $(HDV) mount
|
||||||
|
|
||||||
al: all
|
al: all
|
||||||
|
|
||||||
|
.NOTPARALLEL:
|
||||||
|
|
|
@ -28,7 +28,7 @@ $ make
|
||||||
|
|
||||||
If all goes well, the `build/` subdirectory will contain a `4cade.hdv` image which can be mounted in emulators like [OpenEmulator](https://archive.org/details/OpenEmulatorSnapshots), [Ample](https://github.com/ksherlock/ample), or [Virtual II](http://virtualii.com/).
|
If all goes well, the `build/` subdirectory will contain a `4cade.hdv` image which can be mounted in emulators like [OpenEmulator](https://archive.org/details/OpenEmulatorSnapshots), [Ample](https://github.com/ksherlock/ample), or [Virtual II](http://virtualii.com/).
|
||||||
|
|
||||||
If all does not go well, try doing a clean build (`make clean dsk`)
|
If all does not go well, try doing a clean build (`makeg clean && make`)
|
||||||
|
|
||||||
If that fails, perhaps you have out-of-date versions of one of the required tools? The [Makefile](https://github.com/a2-4am/4cade/blob/main/Makefile) lists, but does not enforce, the minimum version requirements of each third-party tool.
|
If that fails, perhaps you have out-of-date versions of one of the required tools? The [Makefile](https://github.com/a2-4am/4cade/blob/main/Makefile) lists, but does not enforce, the minimum version requirements of each third-party tool.
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ $ make
|
||||||
|
|
||||||
If all goes well, the `build/` subdirectory will contain a `4cade.hdv` image which can be mounted in emulators like [MAME](http://www.mamedev.org).
|
If all goes well, the `build/` subdirectory will contain a `4cade.hdv` image which can be mounted in emulators like [MAME](http://www.mamedev.org).
|
||||||
|
|
||||||
If all does not go well, try doing a clean build (`make clean dsk`)
|
If all does not go well, try doing a clean build (`make clean && make`)
|
||||||
|
|
||||||
If that fails, perhaps you have out-of-date versions of one of the required tools? The [Makefile](https://github.com/a2-4am/4cade/blob/main/Makefile) lists, but does not enforce, the minimum version requirements of each third-party tool.
|
If that fails, perhaps you have out-of-date versions of one of the required tools? The [Makefile](https://github.com/a2-4am/4cade/blob/main/Makefile) lists, but does not enforce, the minimum version requirements of each third-party tool.
|
||||||
|
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# parameters
|
|
||||||
# 1 - input file
|
|
||||||
# 2 - output filename for data file
|
|
||||||
# stdout - source code of index record
|
|
||||||
|
|
||||||
touch "$2"
|
|
||||||
size=$(wc -c < "$1")
|
|
||||||
offset=$(wc -c < "$2")
|
|
||||||
cat "$1" >> "$2"
|
|
||||||
echo ";"
|
|
||||||
echo "; Index record for $1"
|
|
||||||
echo ";"
|
|
||||||
echo "; This file is automatically generated"
|
|
||||||
echo ";"
|
|
||||||
echo " !byte 0"
|
|
||||||
echo " !be24 $offset"
|
|
||||||
echo " !le16 $size"
|
|
40
bin/addfiles.py
Executable file
40
bin/addfiles.py
Executable file
|
@ -0,0 +1,40 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# parameters
|
||||||
|
# 1 - output filename for combined data file
|
||||||
|
# 2,3 - input filename, output index record filename
|
||||||
|
# 4,5 - ""
|
||||||
|
# 6,7... in pairs
|
||||||
|
|
||||||
|
import os.path
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
output_file = sys.argv[1]
|
||||||
|
offset = os.path.getsize(output_file)
|
||||||
|
data = []
|
||||||
|
index_records = []
|
||||||
|
# read and aggregate all input files, and generate index records
|
||||||
|
for input_file in sys.argv[2::2]:
|
||||||
|
with open(input_file, 'rb') as input_handle:
|
||||||
|
data.append(input_handle.read())
|
||||||
|
size = len(data[-1])
|
||||||
|
index_records.append(f""";
|
||||||
|
; Index record for {input_file}
|
||||||
|
;
|
||||||
|
; This file is automatically generated
|
||||||
|
;
|
||||||
|
!byte 0
|
||||||
|
!be24 {offset:>9}
|
||||||
|
!le16 {size:>8}
|
||||||
|
""")
|
||||||
|
offset += size
|
||||||
|
|
||||||
|
# write out index records to specified files
|
||||||
|
for index_file, record in zip(sys.argv[3::2], index_records):
|
||||||
|
with open(index_file, 'w') as index_handle:
|
||||||
|
index_handle.write(record)
|
||||||
|
|
||||||
|
# write out combined data
|
||||||
|
with open(output_file, 'ab') as output_handle:
|
||||||
|
output_handle.write(b''.join(data))
|
|
@ -1,12 +0,0 @@
|
||||||
a = new ActiveXObject("scripting.filesystemobject")
|
|
||||||
fileinfo = "# This file is automatically generated\r\n"
|
|
||||||
|
|
||||||
for (b = new Enumerator(a.GetFolder(WScript.Arguments(0)).files); !b.atEnd(); b.moveNext())
|
|
||||||
{
|
|
||||||
if (b.item().Name.toUpperCase() != "_FILEINFORMATION.TXT")
|
|
||||||
{
|
|
||||||
fileinfo += "\r\n" + b.item().Name.toUpperCase() + "=Type(" + WScript.Arguments(1) + "),AuxType(" + WScript.Arguments(2) + "),Access(C3)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fileinfo += "\r\n" + "_FileInformation.txt=Type(" + WScript.Arguments(1) + "),AuxType(" + WScript.Arguments(2) + "),Access(C3)\r\n"
|
|
||||||
a.createtextfile(WScript.Arguments(0)+"\\_FileInformation.txt", 1).write(fileinfo)
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
indir=$1
|
|
||||||
intype=$2
|
|
||||||
inaddress=$3
|
|
||||||
cd "$indir"
|
|
||||||
rm -f _FileInformation.txt
|
|
||||||
(echo "# This file is automatically generated\n"
|
|
||||||
for f in *; do
|
|
||||||
echo "$f=Type($intype),AuxType($inaddress),Access(C3)"
|
|
||||||
done) > _FileInformation.txt
|
|
|
@ -41,9 +41,7 @@ for (i = 0; i < entries.length; i++)
|
||||||
{
|
{
|
||||||
groups += "!byte " + (1 + 1 + entries[i].length + 5).toString() + "\n" + "!byte " + entries[i].length.toString() + "\n" + "!text \"" + entries[i] + "\"\n" + "!be24 " + fx_off.toString() + "\n"
|
groups += "!byte " + (1 + 1 + entries[i].length + 5).toString() + "\n" + "!byte " + entries[i].length.toString() + "\n" + "!text \"" + entries[i] + "\"\n" + "!be24 " + fx_off.toString() + "\n"
|
||||||
size = a.getfile(WScript.Arguments(3) + "\\" + entries[i]).size
|
size = a.getfile(WScript.Arguments(3) + "\\" + entries[i]).size
|
||||||
// if offset+size does not cross a block boundary, use the size
|
groups += "!le16 " + size + "\n"
|
||||||
// otherwise adjust size until it ends at the next block boundary to avoid a partial copy on the last block
|
|
||||||
groups += "!le16 " + ((Math.floor(fx_off / 512) == Math.floor((fx_off + size) / 512)) ? size : (((fx_off + size + 511) & -512) - fx_off)).toString() + "\n"
|
|
||||||
fx_off += size
|
fx_off += size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
94
bin/buildindexedfile.py
Executable file
94
bin/buildindexedfile.py
Executable file
|
@ -0,0 +1,94 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# flags
|
||||||
|
# -p pad sizes within data file to next block size (default off)
|
||||||
|
|
||||||
|
# parameters
|
||||||
|
# stdin - input containing list of files (e.g. FX.CONF)
|
||||||
|
# stdout - binary OKVS data structure
|
||||||
|
# 1 - output filename for data file
|
||||||
|
# 2 - input directory of files to merge into data file
|
||||||
|
# 3 - (optional) output filename for log of key,offset,size
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import os.path
|
||||||
|
from struct import pack
|
||||||
|
import sys
|
||||||
|
|
||||||
|
kStandardFilename = 'STANDARD'
|
||||||
|
|
||||||
|
def build(records, args):
|
||||||
|
output_file_size = os.path.getsize(args.output_file)
|
||||||
|
standard_offset = standard_size = 0
|
||||||
|
standard_filename = os.path.join(args.input_directory, kStandardFilename)
|
||||||
|
with open(args.output_file, 'ab') as output_file_handle:
|
||||||
|
if os.path.exists(standard_filename):
|
||||||
|
standard_offset = output_file_size
|
||||||
|
standard_size = os.path.getsize(standard_filename)
|
||||||
|
with open(standard_filename, 'rb') as standard_handle:
|
||||||
|
output_file_handle.write(standard_handle.read())
|
||||||
|
output_file_size += standard_size
|
||||||
|
|
||||||
|
# yield OKVS header (2 x 2 bytes, unsigned int, little-endian)
|
||||||
|
yield pack('<2H', len(records), 0)
|
||||||
|
|
||||||
|
for rec in records:
|
||||||
|
filename, dummy, dummy = rec.partition('=')
|
||||||
|
key, dummy, addr = filename.partition('#')
|
||||||
|
key_length = len(key)
|
||||||
|
filename = os.path.join(args.input_directory, filename)
|
||||||
|
rec_offset = standard_offset
|
||||||
|
rec_size = standard_size
|
||||||
|
|
||||||
|
# yield record length (1 byte, unsigned byte)
|
||||||
|
if addr:
|
||||||
|
# if filename is in the form 'NAME#06ADDR' then create extended index record
|
||||||
|
yield pack('B', key_length+9)
|
||||||
|
# trim '06' so we get just the starting address
|
||||||
|
addr = addr[2:]
|
||||||
|
else:
|
||||||
|
yield pack('B', key_length+7)
|
||||||
|
|
||||||
|
# yield key (Pascal-style string)
|
||||||
|
yield pack(f'{key_length+1}p', key.encode('ascii'))
|
||||||
|
|
||||||
|
if os.path.exists(filename):
|
||||||
|
rec_offset = output_file_size
|
||||||
|
rec_size = os.path.getsize(filename)
|
||||||
|
output_file_size += rec_size
|
||||||
|
if args.pad:
|
||||||
|
# If offset+size does not cross a block boundary, use file's true size.
|
||||||
|
# Otherwise, round up size to the next block boundary.
|
||||||
|
# This padding does not get added to the file; it is just an
|
||||||
|
# optimization to avoid a partial copy on the last block read.
|
||||||
|
if (rec_offset // 512) != ((rec_offset + rec_size) // 512):
|
||||||
|
rec_size = ((rec_offset + rec_size + 511) & -512) - rec_offset
|
||||||
|
with open(filename, 'rb') as input_file_handle:
|
||||||
|
output_file_handle.write(input_file_handle.read())
|
||||||
|
|
||||||
|
# yield record offset (3 bytes, big-endian, unsigned long)
|
||||||
|
yield pack('>L', rec_offset)[1:]
|
||||||
|
|
||||||
|
# yield record size (2 bytes, little-endian, unsigned short)
|
||||||
|
yield pack('<H', rec_size)
|
||||||
|
|
||||||
|
if addr:
|
||||||
|
# for extended index record, yield load address (2 bytes, little-endian, unsigned short)
|
||||||
|
yield bytes.fromhex(addr)[::-1]
|
||||||
|
|
||||||
|
if args.log_file:
|
||||||
|
with open(args.log_file, 'a') as log_file_handle:
|
||||||
|
log_file_handle.write(f'{key},{rec_offset},{rec_size}\n')
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser(description="Build indexed OKVS structure with links to data stored in TOTAL.DATA file")
|
||||||
|
parser.add_argument("output_file")
|
||||||
|
parser.add_argument("input_directory")
|
||||||
|
parser.add_argument("log_file", nargs='?', default=None)
|
||||||
|
parser.add_argument("-p", "--pad", action="store_true", default=False, help="pad file sizes to multiples of 512 (default: use exact size)")
|
||||||
|
args = parser.parse_args()
|
||||||
|
records = [x.strip() for x in sys.stdin.readlines()]
|
||||||
|
records = [x for x in records if x and x[0] not in ('#', '[')]
|
||||||
|
for b in build(records, args):
|
||||||
|
sys.stdout.buffer.write(b)
|
|
@ -1,96 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# flags
|
|
||||||
# -a append to data file (default off = truncate)
|
|
||||||
# -p pad sizes within data file to next block size (default off)
|
|
||||||
|
|
||||||
# parameters
|
|
||||||
# stdin - input containing list of files (e.g. FX.CONF)
|
|
||||||
# stdout - binary OKVS data structure
|
|
||||||
# 1 - output filename for data file
|
|
||||||
# 2 - input directory of files to merge into data file
|
|
||||||
# 3 - (optional) output filename for log of key,offset,size
|
|
||||||
|
|
||||||
pad=false
|
|
||||||
append=false
|
|
||||||
standardoffset=0
|
|
||||||
standardsize=0
|
|
||||||
while getopts ":ap" opt; do
|
|
||||||
case $opt in
|
|
||||||
a) append=true
|
|
||||||
;;
|
|
||||||
p) pad=true
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
shift $((OPTIND-1))
|
|
||||||
|
|
||||||
if [ "$append" = false ]; then
|
|
||||||
rm -f "$1"
|
|
||||||
fi
|
|
||||||
touch "$1"
|
|
||||||
|
|
||||||
if [ "${#3}" -ne "0" ]; then
|
|
||||||
rm -f "$3"
|
|
||||||
touch "$3"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 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 "$2"/STANDARD ]; then
|
|
||||||
standardoffset=$(wc -c < "$1")
|
|
||||||
standardsize=$(wc -c < "$2/STANDARD")
|
|
||||||
cat "$2"/STANDARD >> "$1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# make temp file with list of lines that contain keys
|
|
||||||
records=$(mktemp)
|
|
||||||
tr -d "\r" | awk '!/^$|^#|^\[/' > "$records"
|
|
||||||
|
|
||||||
# make temp assembly source file that represents the binary OKVS data structure
|
|
||||||
source=$(mktemp)
|
|
||||||
(echo "*=0" # dummy program counter for assembler
|
|
||||||
echo "!le16 $(wc -l <"$records"), 0" # OKVS header
|
|
||||||
while IFS="=" read -r filename dummy; do
|
|
||||||
key=$(echo "$filename" | awk -F'#' '{ print $1 }')
|
|
||||||
addr=$(echo "$filename" | awk -F'#' '{ print $2 }')
|
|
||||||
if [ "${#addr}" -ne "0" ]; then # if filename is in the form 'NAME#06ADDR' then create extended index record
|
|
||||||
addr=$(echo "$addr" | cut -c3-) # trim '06' so we get just the starting address
|
|
||||||
echo "!byte ${#key}+9" # OKVS record length
|
|
||||||
else
|
|
||||||
echo "!byte ${#key}+7" # OKVS record length
|
|
||||||
fi
|
|
||||||
echo "!byte ${#key}" # OKVS key length
|
|
||||||
echo "!text \"$key\"" # OKVS key
|
|
||||||
if [ ! -e "$2/$filename" ]; then # if file does not exist, use standard offset and size
|
|
||||||
offset="$standardoffset"
|
|
||||||
size="$standardsize"
|
|
||||||
else # otherwise calculate offset and size from file and options
|
|
||||||
offset=$(wc -c < "$1")
|
|
||||||
size=$(wc -c < "$2/$filename")
|
|
||||||
if [ "$pad" = true ]; then
|
|
||||||
# If offset+size does not cross a block boundary, use file's true size.
|
|
||||||
# Otherwise, round up size to the next block boundary.
|
|
||||||
# This padding does not get added to the file; it is just an
|
|
||||||
# optimization to avoid a partial copy on the last block read.
|
|
||||||
if [ $(($offset / 512)) -ne $((($offset + $size) / 512)) ]; then
|
|
||||||
size=$(((($offset + $size + 511) & -512) - $offset))
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
cat "$2/$filename" >> "$1" # append this file to the end of the merged data file
|
|
||||||
fi
|
|
||||||
echo "!be24 $offset"
|
|
||||||
echo "!le16 $size"
|
|
||||||
[ "${#addr}" -ne "0" ] && echo '!le16 $'"$addr"
|
|
||||||
[ "${#3}" -ne "0" ] && echo "$key,$offset,$size" >> "$3"
|
|
||||||
done < "$records") > "$source"
|
|
||||||
|
|
||||||
# assemble temp source file into binary OKVS data structure, then output that
|
|
||||||
out=$(mktemp)
|
|
||||||
acme -o "$out" "$source"
|
|
||||||
cat "$out"
|
|
||||||
|
|
||||||
# clean up
|
|
||||||
rm "$out"
|
|
||||||
rm "$source"
|
|
||||||
rm "$records"
|
|
28
bin/buildokvs.py
Executable file
28
bin/buildokvs.py
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# parameters
|
||||||
|
# stdin - input containing key=value pairs (e.g. res/ATTRACT.CONF or some file in res/ATTRACT/)
|
||||||
|
# stdout - binary OKVS data structure
|
||||||
|
|
||||||
|
import struct
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def build(records):
|
||||||
|
# yield OKVS header (2 x 2 bytes, unsigned int, little-endian)
|
||||||
|
yield struct.pack('<2H', len(records), 0)
|
||||||
|
|
||||||
|
for key, dummy, value in records:
|
||||||
|
# yield record length (1 byte)
|
||||||
|
yield struct.pack('B', len(key) + len(value) + 3)
|
||||||
|
|
||||||
|
# yield key (Pascal-style string)
|
||||||
|
yield struct.pack(f'{len(key)+1}p', key.encode('ascii'))
|
||||||
|
|
||||||
|
# yield value (Pascal-style string)
|
||||||
|
yield struct.pack(f'{len(value)+1}p', value.encode('ascii'))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
records = [x.strip() for x in sys.stdin.readlines()]
|
||||||
|
records = [x.partition('=') for x in records if x and x[0] not in ('#', '[')]
|
||||||
|
for b in build(records):
|
||||||
|
sys.stdout.buffer.write(b)
|
|
@ -1,27 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# make temp file with just the key/value pairs (strip blank lines, comments, eof marker)
|
|
||||||
records=$(mktemp)
|
|
||||||
tr -d "\r" | awk '!/^$|^#|^\[/' > "$records"
|
|
||||||
|
|
||||||
# make temp assembly source file that represents the binary OKVS data structure
|
|
||||||
source=$(mktemp)
|
|
||||||
(echo "*=0" # dummy program counter for assembler
|
|
||||||
echo "!le16 $(wc -l <"$records"), 0" # OKVS header
|
|
||||||
while IFS="=" read -r key value; do
|
|
||||||
echo "!byte ${#key}+${#value}+3" # OKVS record length
|
|
||||||
echo "!byte ${#key}" # OKVS key length
|
|
||||||
echo "!text \"$key\"" # OKVS key
|
|
||||||
echo "!byte ${#value}" # OKVS value length
|
|
||||||
echo "!text \"$value\"" # OKVS value
|
|
||||||
done < "$records") > "$source"
|
|
||||||
|
|
||||||
# assemble temp source file into binary OKVS data structure, then output that
|
|
||||||
out=$(mktemp)
|
|
||||||
acme -o "$out" "$source"
|
|
||||||
cat "$out"
|
|
||||||
|
|
||||||
# clean up
|
|
||||||
rm "$out"
|
|
||||||
rm "$source"
|
|
||||||
rm "$records"
|
|
105
bin/buildsearch.py
Executable file
105
bin/buildsearch.py
Executable file
|
@ -0,0 +1,105 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# parameters
|
||||||
|
# stdin - input containing list of game metadata, filename, display name (e.g. GAMES.CONF or some subset of it)
|
||||||
|
# stdout - binary OKVS data structure
|
||||||
|
# 1 - output filename for game count in assembler code format
|
||||||
|
# 2 - input filename of HGR titles, offsets, and sizes
|
||||||
|
# 3 - input filename of DHGR titles, offsets, and sizes
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import pprint
|
||||||
|
from struct import pack
|
||||||
|
import sys
|
||||||
|
|
||||||
|
gSearchIndex = 0x6000 # must match gSearchIndex in src/constants.a
|
||||||
|
|
||||||
|
# indexes into |flags| as string
|
||||||
|
iDHGRTitle = 2
|
||||||
|
iCheatCategory = 3
|
||||||
|
iSingleLoad = 4
|
||||||
|
|
||||||
|
# maps of flag raw string value -> value in final flags byte
|
||||||
|
kHasDHGRTitle = {'0': 0, '1': 128}
|
||||||
|
kSingleLoad = {'0': 0, '1': 64}
|
||||||
|
|
||||||
|
def parse_log_file(filename):
|
||||||
|
if not filename:
|
||||||
|
return {}
|
||||||
|
with open(filename, 'r') as f:
|
||||||
|
lines = [x.strip().split(',') for x in f.readlines()]
|
||||||
|
lines = [(title, (int(offset), int(size))) for title, offset, size in lines]
|
||||||
|
return dict(lines)
|
||||||
|
|
||||||
|
def build(records, args):
|
||||||
|
# records is [(flags, key, value), (flags, key, value) ...]
|
||||||
|
hgr_cache = parse_log_file(args.input_hgr_log_file)
|
||||||
|
dhgr_cache = parse_log_file(args.input_dhgr_log_file)
|
||||||
|
cache_ptr = {'0': hgr_cache, '1': dhgr_cache}
|
||||||
|
record_count = len(records)
|
||||||
|
|
||||||
|
# generate source file with game count
|
||||||
|
with open(args.output_game_count_file, 'w') as file_handle:
|
||||||
|
file_handle.write(f""";
|
||||||
|
; Game count
|
||||||
|
;
|
||||||
|
; This file is automatically generated
|
||||||
|
;
|
||||||
|
!word {record_count:>8}
|
||||||
|
""")
|
||||||
|
|
||||||
|
# lookup table is stored after all record data, so first calculate total record size
|
||||||
|
# record_count * (length-prefixed key + length-prefixed value + 8 other bytes)
|
||||||
|
# then lookup table address is that + gSearchIndex + 4 bytes for the OKVS header
|
||||||
|
total_record_size = len("".join([x for xs in records for x in xs[1:]])) + 10*record_count
|
||||||
|
|
||||||
|
# yield OKVS header (2 x 2 bytes, unsigned int, little-endian)
|
||||||
|
yield pack('<2H', record_count, total_record_size + gSearchIndex + 4)
|
||||||
|
|
||||||
|
rec_key_address = gSearchIndex + 5
|
||||||
|
key_addresses = []
|
||||||
|
for flags, key, value in records:
|
||||||
|
key_addresses.append(rec_key_address)
|
||||||
|
rec_length = len(key) + len(value) + 10
|
||||||
|
rec_key_address += rec_length
|
||||||
|
|
||||||
|
# yield record length (1 byte)
|
||||||
|
yield pack('B', rec_length)
|
||||||
|
|
||||||
|
# yield key (Pascal-style string)
|
||||||
|
yield pack(f'{len(key)+1}p', key.encode('ascii'))
|
||||||
|
|
||||||
|
# yield value (Pascal-style string)
|
||||||
|
yield pack(f'{len(value)+1}p', value.encode('ascii'))
|
||||||
|
|
||||||
|
yield pack('B', 1)
|
||||||
|
|
||||||
|
# yield flags
|
||||||
|
has_dhgr_title = dhgr_cache and flags[iDHGRTitle] or '0'
|
||||||
|
yield pack('B', kHasDHGRTitle[has_dhgr_title] + \
|
||||||
|
kSingleLoad[flags[iSingleLoad]] + \
|
||||||
|
int(flags[iCheatCategory]))
|
||||||
|
|
||||||
|
rec_offset, rec_size = cache_ptr[has_dhgr_title][key]
|
||||||
|
|
||||||
|
# yield record offset (3 bytes, big-endian, unsigned long)
|
||||||
|
yield pack('>L', rec_offset)[1:]
|
||||||
|
|
||||||
|
# yield record size (2 bytes, little-endian, unsigned short)
|
||||||
|
yield pack('<H', rec_size)
|
||||||
|
|
||||||
|
# yield lookup table
|
||||||
|
yield pack(f'<{record_count}H', *key_addresses)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser(description="Build indexed OKVS structure for search index")
|
||||||
|
parser.add_argument("output_game_count_file")
|
||||||
|
parser.add_argument("input_hgr_log_file")
|
||||||
|
parser.add_argument("input_dhgr_log_file")
|
||||||
|
args = parser.parse_args()
|
||||||
|
records = [x.strip() for x in sys.stdin.readlines()]
|
||||||
|
records = [x.replace('=',',').split(',')
|
||||||
|
for x in records
|
||||||
|
if x and x[0] not in ('#', '[')]
|
||||||
|
for b in build(records, args):
|
||||||
|
sys.stdout.buffer.write(b)
|
|
@ -1,77 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# parameters
|
|
||||||
# stdin - input containing list of game metadata, filename, display name (e.g. GAMES.CONF or some subset of it)
|
|
||||||
# stdout - binary OKVS data structure
|
|
||||||
# 1 - output filename for game count in assembler code format
|
|
||||||
# 2 - input filename of HGR titles, offsets, and sizes
|
|
||||||
# 3 - input filename of DHGR titles, offsets, and sizes
|
|
||||||
|
|
||||||
# make temp file with just the key/value pairs (strip blank lines, comments, eof marker)
|
|
||||||
records=$(mktemp)
|
|
||||||
tr -d "\r" | awk '!/^$|^#|^\[/' > "$records"
|
|
||||||
|
|
||||||
# read logs of offsets & sizes for HGR and DHGR titles
|
|
||||||
# that were generated by an earlier script
|
|
||||||
hgrlog=$(< "$2")
|
|
||||||
dhgrlog=$(< "$3")
|
|
||||||
|
|
||||||
# generate source file with game count
|
|
||||||
(echo ";"
|
|
||||||
echo "; Game count"
|
|
||||||
echo ";"
|
|
||||||
echo "; This file is automatically generated"
|
|
||||||
echo ";"
|
|
||||||
echo "!word $(wc -l < "$records")") > "$1"
|
|
||||||
|
|
||||||
# make temp assembly source file that represents the binary OKVS data structure
|
|
||||||
source=$(mktemp)
|
|
||||||
(echo '*=$6000'
|
|
||||||
echo "!le16 $(wc -l <"$records")" # OKVS header
|
|
||||||
echo "!word KeyLookup"
|
|
||||||
count=0
|
|
||||||
while IFS="=" read -r key value; do
|
|
||||||
count=$((count+1))
|
|
||||||
if [ -z "$dhgrlog" ]; then
|
|
||||||
dhgr="0"
|
|
||||||
else
|
|
||||||
dhgr=$(echo "$key" | cut -c3) # 'has DHGR title screen' flag (0 or 1)
|
|
||||||
fi
|
|
||||||
cheat=$(echo "$key" | cut -c4) # 'cheat category' (0..7)
|
|
||||||
single=$(echo "$key" | cut -c5) # 'single-load' flag (0 or 1)
|
|
||||||
key=$(echo "$key" | cut -d"," -f2)
|
|
||||||
if [ "$dhgr" -eq "0" ]; then
|
|
||||||
offset=$hgrlog
|
|
||||||
size=$hgrlog
|
|
||||||
else
|
|
||||||
offset=$dhgrlog
|
|
||||||
size=$dhgrlog
|
|
||||||
fi
|
|
||||||
offset=$(echo "$offset" | awk -F, '/^'"$key"',/ { print $2 }')
|
|
||||||
size=$(echo "$size" | awk -F, '/^'"$key"',/ { print $3 }')
|
|
||||||
echo "!byte ${#key}+${#value}+10" # OKVS record length
|
|
||||||
echo "Key${count}"
|
|
||||||
echo "!byte ${#key}" # OKVS key length
|
|
||||||
echo "!text \"$key\"" # OKVS key (filename)
|
|
||||||
echo "!byte ${#value}" # OKVS value length
|
|
||||||
echo "!text \"$value\"" # OKVS value (display name)
|
|
||||||
echo "!byte 1"
|
|
||||||
echo "!byte $((dhgr*128))+$((single*64))+$cheat"
|
|
||||||
echo "!be24 $offset"
|
|
||||||
echo "!le16 $size"
|
|
||||||
done < "$records"
|
|
||||||
echo "KeyLookup"
|
|
||||||
for i in $(seq $count); do
|
|
||||||
echo "!word Key$i"
|
|
||||||
done
|
|
||||||
) > "$source"
|
|
||||||
|
|
||||||
# assemble temp source file into binary OKVS data structure, then output that
|
|
||||||
out=$(mktemp)
|
|
||||||
acme -o "$out" "$source"
|
|
||||||
cat "$out"
|
|
||||||
|
|
||||||
# clean up
|
|
||||||
rm "$out"
|
|
||||||
rm "$source"
|
|
||||||
rm "$records"
|
|
|
@ -39,8 +39,8 @@ if (!a.fileexists(WScript.Arguments(1)) || a.getfile(WScript.Arguments(1)).datel
|
||||||
bits = q.indexOf("," + name + "=") + 1
|
bits = q.indexOf("," + name + "=") + 1
|
||||||
name = q.substr(bits + name.length + 1)
|
name = q.substr(bits + name.length + 1)
|
||||||
name = name.substr(0, name.indexOf("\n"))
|
name = name.substr(0, name.indexOf("\n"))
|
||||||
needsjoystick = q.substr(bits - 5, 1)
|
needsjoystick = q.substr(bits - 6, 1)
|
||||||
needs128k = q.substr(bits - 4, 1)
|
needs128k = q.substr(bits - 5, 1)
|
||||||
displayname = ((WScript.Arguments.length == 3) ? name : "")
|
displayname = ((WScript.Arguments.length == 3) ? name : "")
|
||||||
source.writeline("!byte " + (entries[i].length - ((val >= 0) ? 1 : 0) + displayname.length + 5))
|
source.writeline("!byte " + (entries[i].length - ((val >= 0) ? 1 : 0) + displayname.length + 5))
|
||||||
source.writeline("!byte " + ((val >= 0) ? val : entries[i].length))
|
source.writeline("!byte " + ((val >= 0) ? val : entries[i].length))
|
||||||
|
|
63
bin/buildslideshow.py
Executable file
63
bin/buildslideshow.py
Executable file
|
@ -0,0 +1,63 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# parameters
|
||||||
|
# stdin - input containing slideshow (e.g. some file in res/SS/)
|
||||||
|
# stdout - binary OKVS data structure
|
||||||
|
# 1 - name of slideshow file (used to decide whether if this is an action slideshow)
|
||||||
|
# 2 - name of file containing list of games with metadata (e.g. build/GAMES.CONF)
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os.path
|
||||||
|
from struct import pack
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# indexes into |flags| as string
|
||||||
|
iNeedsJoystick = 0
|
||||||
|
iNeeds128K = 1
|
||||||
|
|
||||||
|
# maps of flag raw string value -> value in final flags byte
|
||||||
|
kNeedsJoystick = {'0': 0, '1': 128}
|
||||||
|
kNeeds128K = {'0': 0, '1': 64}
|
||||||
|
|
||||||
|
def build(records, args):
|
||||||
|
with open(args.games_file, 'r') as games_file_handle:
|
||||||
|
games_list = [x.strip() for x in games_file_handle.readlines()]
|
||||||
|
games_list = [x.replace('=',',').split(',')
|
||||||
|
for x in games_list
|
||||||
|
if x and x[0] not in ('#', '[')]
|
||||||
|
if os.path.basename(args.slideshow_file).startswith('ACT'):
|
||||||
|
games_cache = dict([(key, (flags, displayname)) for flags, key, displayname in games_list])
|
||||||
|
else:
|
||||||
|
games_cache = dict([(key, (flags, '')) for flags, key, displayname in games_list])
|
||||||
|
|
||||||
|
# yield OKVS header (2 x 2 bytes, unsigned int, little-endian)
|
||||||
|
yield pack('<2H', len(records), 0)
|
||||||
|
|
||||||
|
for key, dummy, value in records:
|
||||||
|
flags, displayname = games_cache[value or key]
|
||||||
|
|
||||||
|
# yield record length (1 byte)
|
||||||
|
yield pack('B', len(key) + len(value) + len(displayname) + 5)
|
||||||
|
|
||||||
|
# yield key (Pascal-style string)
|
||||||
|
yield pack(f'{len(key)+1}p', key.encode('ascii'))
|
||||||
|
|
||||||
|
# yield value (Pascal-style string)
|
||||||
|
yield pack(f'{len(value)+1}p', value.encode('ascii'))
|
||||||
|
|
||||||
|
# yield display name (Pascal-style string)
|
||||||
|
yield pack(f'{len(displayname)+1}p', displayname.encode('ascii'))
|
||||||
|
|
||||||
|
# yield flags
|
||||||
|
yield pack('B', kNeedsJoystick[flags[iNeedsJoystick]] + \
|
||||||
|
kNeeds128K[flags[iNeeds128K]])
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser(description="Build indexed OKVS structure from slideshow configuration file")
|
||||||
|
parser.add_argument("slideshow_file")
|
||||||
|
parser.add_argument("games_file")
|
||||||
|
args = parser.parse_args()
|
||||||
|
records = [x.strip() for x in sys.stdin.readlines()]
|
||||||
|
records = [x.partition('=') for x in records if x and x[0] not in ('#', '[')]
|
||||||
|
for b in build(records, args):
|
||||||
|
sys.stdout.buffer.write(b)
|
|
@ -1,58 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# flags
|
|
||||||
# -d include game display name (default off = display name will be 0-length string)
|
|
||||||
|
|
||||||
# parameters
|
|
||||||
# stdin - input containing slideshow (e.g. some file in res/SS/)
|
|
||||||
# stdout - binary OKVS data structure
|
|
||||||
# 1 - list of games with metadata (e.g. build/GAMES.CONF)
|
|
||||||
|
|
||||||
include_displayname=false
|
|
||||||
while getopts ":d" opt; do
|
|
||||||
case $opt in
|
|
||||||
d) include_displayname=true
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
shift $((OPTIND-1))
|
|
||||||
|
|
||||||
games=$(cat "$1")
|
|
||||||
|
|
||||||
# make temp file with just the key/value pairs (strip blank lines, comments, eof marker)
|
|
||||||
records=$(mktemp)
|
|
||||||
tr -d "\r" | awk '!/^$|^#|^\[/' > "$records"
|
|
||||||
|
|
||||||
# make temp assembly source file that represents the binary OKVS data structure
|
|
||||||
source=$(mktemp)
|
|
||||||
(echo "*=0" # dummy program counter for assembler
|
|
||||||
echo "!le16 $(wc -l <"$records"), 0" # OKVS header
|
|
||||||
while IFS="=" read -r key value; do
|
|
||||||
[ -n "$value" ] && filename="$value" || filename="$key"
|
|
||||||
line=$(echo "$games" | awk '/,'"$filename"'=/')
|
|
||||||
needsjoystick=$(echo "$line" | cut -c1) # 'requires joystick' flag (0 or 1)
|
|
||||||
needs128k=$(echo "$line" | cut -c2) # 'requires 128K' flag (0 or 1)
|
|
||||||
if [ "$include_displayname" = false ]; then
|
|
||||||
displayname=""
|
|
||||||
else
|
|
||||||
displayname=$(echo "$line" | tr -d "\r" | awk -F= '{ print $2 }')
|
|
||||||
fi
|
|
||||||
echo "!byte ${#key}+${#value}+${#displayname}+5" # OKVS record length
|
|
||||||
echo "!byte ${#key}" # OKVS key length
|
|
||||||
echo "!text \"$key\"" # OKVS key
|
|
||||||
echo "!byte ${#value}" # OKVS value length
|
|
||||||
echo "!text \"$value\"" # OKVS value
|
|
||||||
echo "!byte ${#displayname}"
|
|
||||||
echo "!text \"$displayname\""
|
|
||||||
echo "!byte $((needsjoystick*128))+$((needs128k*64))"
|
|
||||||
done < "$records") > "$source"
|
|
||||||
|
|
||||||
# assemble temp source file into binary OKVS data structure, then output that
|
|
||||||
out=$(mktemp)
|
|
||||||
acme -o "$out" "$source"
|
|
||||||
cat "$out"
|
|
||||||
|
|
||||||
# clean up
|
|
||||||
rm "$out"
|
|
||||||
rm "$source"
|
|
||||||
rm "$records"
|
|
|
@ -50,13 +50,13 @@ cat res/GAMES.CONF |
|
||||||
grep '^\!to' src/demo/*.a | cut -d'/' -f5-|cut -d'#' -f1 |
|
grep '^\!to' src/demo/*.a | cut -d'/' -f5-|cut -d'#' -f1 |
|
||||||
grep -v "SPCARTOON" |
|
grep -v "SPCARTOON" |
|
||||||
while read f; do
|
while read f; do
|
||||||
grep "$f=0" res/ATTRACT.CONF >/dev/null || echo "unused demo: $f";
|
grep "^$f=0" res/ATTRACT.CONF >/dev/null || echo "unused demo: $f";
|
||||||
done
|
done
|
||||||
|
|
||||||
# warn about unused slideshows
|
# warn about unused slideshows
|
||||||
cd res/SS
|
cd res/SS
|
||||||
for f in *.CONF; do
|
for f in *.CONF; do
|
||||||
grep "$f" ../ATTRACT.CONF >/dev/null || echo "unused slideshow: $f";
|
grep "^$f=" ../ATTRACT.CONF >/dev/null || echo "unused slideshow: $f";
|
||||||
done
|
done
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
tr "\*\~\<\>\$\%" "\020\021\010\025\016\017" < "$1" | \
|
tr "\*\~\<\>\$\%" "\020\021\010\025\016\017" < "$1" | \
|
||||||
tr -d "\r" | awk '!/^\[/ { printf "%c%s", length, $0 } END { printf "\xFF" }' > "$2"
|
tr -d "\r" | awk '{ printf "%c%s", length, $0 } END { printf "\xFF" }' > "$2"
|
||||||
|
|
13
bin/flatten.js
Normal file
13
bin/flatten.js
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
a = new ActiveXObject("scripting.filesystemobject")
|
||||||
|
x = new ActiveXObject("wscript.shell")
|
||||||
|
|
||||||
|
for (b = new Enumerator(a.GetFolder("build\\X").subfolders); !b.atEnd(); b.moveNext())
|
||||||
|
{
|
||||||
|
for (c = new Enumerator(b.item().subfolders); !c.atEnd(); c.moveNext())
|
||||||
|
{
|
||||||
|
x.run('cmd /c move build\\X\\' + b.item().name + '\\' + c.item().name + ' build\\X', 0, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
x.run('cmd /c move build\\X\\' + b.item().name + '\\* build\\X', 0, 1)
|
||||||
|
x.run('cmd /c rd build\\X\\' + b.item().name, 0, 1)
|
||||||
|
}
|
|
@ -75,9 +75,6 @@ cat res/GAMES.CONF |
|
||||||
echo "ARTWORK.SHR/POP.END=C" >> /tmp/g
|
echo "ARTWORK.SHR/POP.END=C" >> /tmp/g
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add eof
|
|
||||||
echo -e "\n[eof]" >> /tmp/g
|
|
||||||
|
|
||||||
cat /tmp/g > res/ATTRACT/"$game"
|
cat /tmp/g > res/ATTRACT/"$game"
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
|
|
|
@ -13,13 +13,6 @@ while (!b.atendofstream)
|
||||||
d = d.substr(0, e)
|
d = d.substr(0, e)
|
||||||
}
|
}
|
||||||
|
|
||||||
e = d.indexOf("[eof]")
|
|
||||||
|
|
||||||
if (e > -1)
|
|
||||||
{
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
e = d.indexOf("=")
|
e = d.indexOf("=")
|
||||||
|
|
||||||
if (e == -1)
|
if (e == -1)
|
||||||
|
@ -35,5 +28,4 @@ while (!b.atendofstream)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
q.write(d + "\n")
|
|
||||||
a.createtextfile("build\\GAMES.SORTED").write(c.sort().toString().replace(/,/g, "\n"))
|
a.createtextfile("build\\GAMES.SORTED").write(c.sort().toString().replace(/,/g, "\n"))
|
||||||
|
|
BIN
res/ACTION.GR/COLORIX
Normal file
BIN
res/ACTION.GR/COLORIX
Normal file
Binary file not shown.
BIN
res/ACTION.GR/SNAKEBYTE.REMIX
Normal file
BIN
res/ACTION.GR/SNAKEBYTE.REMIX
Normal file
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/AERONAUTS
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/AERONAUTS
Normal file
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/AERONAUTS2
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/AERONAUTS2
Normal file
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/ANTIAIR
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/ANTIAIR
Normal file
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/ANTIAIR2
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/ANTIAIR2
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/FIDO
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/FIDO
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/HOPMAN
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/HOPMAN
Normal file
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/HOPMAN2
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/HOPMAN2
Normal file
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/MUTANT.SW
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/MUTANT.SW
Normal file
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/MUTANT.SW2
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/MUTANT.SW2
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/PANIC.BUTTON
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/PANIC.BUTTON
Normal file
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/PANIC.BUTTON2
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/PANIC.BUTTON2
Normal file
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/PICK.N.PILE
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/PICK.N.PILE
Normal file
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/PICK.N.PILE2
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/PICK.N.PILE2
Normal file
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/ROCKY.HORROR
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/ROCKY.HORROR
Normal file
Binary file not shown.
BIN
res/ACTION.HGR.UNCOMPRESSED/ROCKY.HORROR2
Normal file
BIN
res/ACTION.HGR.UNCOMPRESSED/ROCKY.HORROR2
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user