2018-08-21 13:58:28 +00:00
|
|
|
#
|
|
|
|
# 4cade Makefile
|
|
|
|
# assembles source code, optionally builds a disk image and mounts it
|
2018-11-07 23:56:39 +00:00
|
|
|
# note: Windows users should probably use winmake.bat instead
|
2018-08-21 13:58:28 +00:00
|
|
|
#
|
|
|
|
# original by Quinn Dunki on 2014-08-15
|
|
|
|
# One Girl, One Laptop Productions
|
|
|
|
# http://www.quinndunki.com/blondihacks
|
|
|
|
#
|
|
|
|
# adapted by 4am on 2018-08-19
|
|
|
|
#
|
|
|
|
|
2020-08-25 20:56:03 +00:00
|
|
|
DISK=4cade.hdv
|
2019-10-15 15:26:47 +00:00
|
|
|
VOLUME=TOTAL.REPLAY
|
2018-08-21 13:58:28 +00:00
|
|
|
|
|
|
|
# third-party tools required to build
|
2019-09-19 14:47:04 +00:00
|
|
|
|
2018-08-21 13:58:28 +00:00
|
|
|
# https://sourceforge.net/projects/acme-crossass/
|
2021-10-15 02:27:34 +00:00
|
|
|
# version 0.96.3 or later
|
2018-08-21 13:58:28 +00:00
|
|
|
ACME=acme
|
2019-09-15 21:55:16 +00:00
|
|
|
|
2021-10-15 02:27:34 +00:00
|
|
|
# https://github.com/mach-kernel/cadius
|
2019-09-19 14:47:04 +00:00
|
|
|
# version 1.4.0 or later
|
|
|
|
CADIUS=cadius
|
2019-09-15 02:57:52 +00:00
|
|
|
|
2020-03-12 02:03:28 +00:00
|
|
|
# https://bitbucket.org/magli143/exomizer/wiki/Home
|
2021-10-15 02:27:34 +00:00
|
|
|
# version 3.1.0 or later
|
2020-03-12 02:03:28 +00:00
|
|
|
EXOMIZER=exomizer mem -q -P23 -lnone
|
|
|
|
|
2020-11-13 04:26:15 +00:00
|
|
|
dsk: asm
|
2020-08-25 20:56:03 +00:00
|
|
|
cp res/blank.hdv build/"$(DISK)" >>build/log
|
2018-09-13 13:53:04 +00:00
|
|
|
cp res/_FileInformation.txt build/ >>build/log
|
2019-07-23 23:53:57 +00:00
|
|
|
$(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" "build/LAUNCHER.SYSTEM" >>build/log
|
2021-10-16 01:34:39 +00:00
|
|
|
cp res/PREFS.CONF build/PREFS.CONF >>build/log
|
2019-10-15 14:06:22 +00:00
|
|
|
bin/padto.sh 512 build/PREFS.CONF >>build/log
|
2021-10-16 01:34:39 +00:00
|
|
|
#
|
2021-10-21 17:04:01 +00:00
|
|
|
# precompute binary data structure for mega-attract mode configuration file
|
2021-10-16 01:34:39 +00:00
|
|
|
#
|
2021-10-13 02:55:41 +00:00
|
|
|
bin/buildokvs.sh "res/ATTRACT.CONF" "build/ATTRACT.IDX" >>build/log
|
2021-10-16 01:34:39 +00:00
|
|
|
#
|
2021-10-21 17:04:01 +00:00
|
|
|
# precompute binary data structure and substitute special characters
|
|
|
|
# in game help and other all-text pages
|
2021-10-16 01:34:39 +00:00
|
|
|
#
|
2021-10-15 02:27:34 +00:00
|
|
|
bin/converthelp.sh res/HELPTEXT build/HELPTEXT >>build/log
|
|
|
|
bin/converthelp.sh res/CREDITS build/CREDITS >>build/log
|
2021-10-16 01:34:39 +00:00
|
|
|
for f in res/GAMEHELP/*; do \
|
2021-10-21 17:04:01 +00:00
|
|
|
bin/converthelp.sh "$$f" build/GAMEHELP/"$$(basename $$f)" >>build/log; \
|
2021-10-16 01:34:39 +00:00
|
|
|
done
|
|
|
|
#
|
2021-10-21 17:04:01 +00:00
|
|
|
# create a sorted list of game filenames, without metadata or display names
|
2021-10-16 01:34:39 +00:00
|
|
|
#
|
2021-10-19 23:20:44 +00:00
|
|
|
awk -F "," '!/^#/ { print $$2 }' < res/GAMES.CONF | awk -F "=" '{ print $$1 }' | sort > build/GAMES.SORTED
|
2021-10-21 17:04:01 +00:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
#
|
2021-10-19 21:43:36 +00:00
|
|
|
(for f in res/SS/*; do \
|
2021-10-16 01:34:39 +00:00
|
|
|
bin/buildokvs.sh "$$f" "build/SS/$$(basename $$f)"; \
|
2021-10-19 21:43:36 +00:00
|
|
|
echo "$$(basename $$f)"; \
|
2021-10-19 23:20:44 +00:00
|
|
|
done) > build/SSDIR
|
2021-10-21 17:04:01 +00:00
|
|
|
bin/buildindexedfile.sh -p -a "build/SSDIR" "build/SLIDESHOW.IDX" "build/TOTAL.DATA" "build/SS" >>build/log
|
2021-10-19 21:43:36 +00:00
|
|
|
(for f in res/ATTRACT/*; do \
|
2021-10-16 01:34:39 +00:00
|
|
|
bin/buildokvs.sh "$$f" "build/ATTRACT/$$(basename $$f)"; \
|
2021-10-19 21:43:36 +00:00
|
|
|
echo "$$(basename $$f)"; \
|
2021-10-19 23:20:44 +00:00
|
|
|
done) > build/ATTRACTDIR
|
2021-10-21 17:04:01 +00:00
|
|
|
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
|
2021-10-16 01:34:39 +00:00
|
|
|
#
|
2021-10-20 03:07:56 +00:00
|
|
|
# precompute indexed files for HGR action screenshots
|
2021-10-21 17:04:01 +00:00
|
|
|
# note: these can not be padded because they are compressed and the decompressor needs the exact size
|
2021-10-20 03:07:56 +00:00
|
|
|
#
|
|
|
|
(for f in res/ACTION.HGR/[ABCD]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR0
|
|
|
|
(for f in res/ACTION.HGR/[EFGH]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR1
|
|
|
|
(for f in res/ACTION.HGR/[IJKL]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR2
|
|
|
|
(for f in res/ACTION.HGR/[MNOP]*; do echo "$$(basename $$f)"; done) > build/ACTIONHGR3
|
|
|
|
(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
|
2021-10-21 17:04:01 +00:00
|
|
|
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
|
2021-10-20 03:07:56 +00:00
|
|
|
#
|
2021-10-19 23:39:57 +00:00
|
|
|
# precompute indexed files for SHR artwork
|
2021-10-21 17:04:01 +00:00
|
|
|
# note: these can not be padded because they are compressed and the decompressor needs the exact size
|
2021-10-19 23:39:57 +00:00
|
|
|
#
|
|
|
|
(for f in res/ARTWORK.SHR/*; do \
|
|
|
|
echo "$$(basename $$f)"; \
|
|
|
|
done) > build/ARTWORKDIR
|
2021-10-21 17:04:01 +00:00
|
|
|
bin/buildindexedfile.sh -a "build/ARTWORKDIR" "build/ARTWORK.IDX" "build/TOTAL.DATA" "res/ARTWORK.SHR" >>build/log
|
2021-10-19 23:39:57 +00:00
|
|
|
#
|
2021-10-16 01:34:39 +00:00
|
|
|
# create _FileInformation.txt files for subdirectories
|
|
|
|
#
|
2020-03-12 23:04:04 +00:00
|
|
|
bin/buildfileinfo.sh res/TITLE.HGR "06" "4000" >>build/log
|
2020-10-26 05:00:42 +00:00
|
|
|
bin/buildfileinfo.sh res/TITLE.DHGR "06" "4000" >>build/log
|
|
|
|
bin/buildfileinfo.sh res/ACTION.DHGR "06" "3FF8" >>build/log
|
|
|
|
bin/buildfileinfo.sh res/ACTION.GR "06" "6000" >>build/log
|
|
|
|
bin/buildfileinfo.sh res/ICONS "CA" "0000" >>build/log
|
2021-10-16 01:34:39 +00:00
|
|
|
bin/buildfileinfo.sh build/FX "06" "6000" >>build/log
|
|
|
|
bin/buildfileinfo.sh build/PRELAUNCH "06" "0106" >>build/log
|
|
|
|
#
|
|
|
|
# add everything to the disk
|
|
|
|
#
|
|
|
|
for f in \
|
2021-10-21 17:04:01 +00:00
|
|
|
build/TOTAL.DATA \
|
2021-10-16 01:34:39 +00:00
|
|
|
res/TITLE \
|
|
|
|
res/COVER \
|
|
|
|
res/HELP \
|
|
|
|
res/GAMES.CONF \
|
|
|
|
build/PREFS.CONF \
|
|
|
|
build/CREDITS \
|
|
|
|
build/HELPTEXT \
|
|
|
|
build/ATTRACT.IDX \
|
|
|
|
build/FX.IDX \
|
|
|
|
build/DFX.IDX \
|
|
|
|
build/GAMEHELP.IDX \
|
|
|
|
build/SLIDESHOW.IDX \
|
|
|
|
build/MINIATTRACT.IDX \
|
|
|
|
build/PRELAUNCH.IDX \
|
2021-10-19 23:39:57 +00:00
|
|
|
build/ARTWORK.IDX \
|
2021-10-20 03:07:56 +00:00
|
|
|
build/HGR0.IDX \
|
|
|
|
build/HGR1.IDX \
|
|
|
|
build/HGR2.IDX \
|
|
|
|
build/HGR3.IDX \
|
|
|
|
build/HGR4.IDX \
|
|
|
|
build/HGR5.IDX \
|
|
|
|
build/HGR6.IDX \
|
2021-10-16 01:34:39 +00:00
|
|
|
res/DECRUNCH \
|
|
|
|
res/JOYSTICK \
|
|
|
|
res/Finder.Data \
|
|
|
|
res/Finder.Root; do \
|
|
|
|
$(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" "$$f" >>build/log; \
|
|
|
|
done
|
|
|
|
for f in \
|
|
|
|
res/TITLE.HGR \
|
|
|
|
res/TITLE.DHGR \
|
|
|
|
res/ACTION.DHGR \
|
|
|
|
res/ACTION.GR \
|
|
|
|
res/DEMO \
|
|
|
|
res/TITLE.ANIMATED \
|
|
|
|
res/ICONS \
|
|
|
|
build/FX \
|
|
|
|
build/PRELAUNCH; do \
|
|
|
|
rm -f "$$f"/.DS_Store; \
|
|
|
|
$(CADIUS) ADDFOLDER build/"$(DISK)" "/$(VOLUME)/$$(basename $$f)" "$$f" >>build/log; \
|
|
|
|
done
|
|
|
|
for i in 1 2 3 4 5 6; do \
|
|
|
|
$(CADIUS) RENAMEFILE build/"$(DISK)" "/$(VOLUME)/DEMO/SPCARTOON.$${i}$${i}" "SPCARTOON.$${i}." >>build/log; \
|
|
|
|
done
|
|
|
|
for f in res/dsk/*.po; do \
|
|
|
|
$(CADIUS) EXTRACTVOLUME "$${f}" build/X/ >>build/log; \
|
|
|
|
done
|
2020-10-26 05:00:42 +00:00
|
|
|
rm -f build/X/**/.DS_Store build/X/**/PRODOS* build/X/**/LOADER.SYSTEM*
|
|
|
|
$(CADIUS) CREATEFOLDER build/"$(DISK)" "/$(VOLUME)/X/" >>build/log
|
2021-10-16 01:34:39 +00:00
|
|
|
for f in build/X/*; do \
|
|
|
|
$(CADIUS) ADDFOLDER build/"$(DISK)" "/$(VOLUME)/X/$$(basename $$f)" "$$f" >>build/log; \
|
|
|
|
done
|
2021-08-14 00:53:38 +00:00
|
|
|
bin/changebootloader.sh build/"$(DISK)" build/proboothd
|
2018-08-21 13:58:28 +00:00
|
|
|
|
2021-08-14 00:53:38 +00:00
|
|
|
asm: asmlauncher asmfx asmprelaunch asmproboot
|
2019-09-19 14:47:04 +00:00
|
|
|
|
2020-11-13 04:26:15 +00:00
|
|
|
asmlauncher: md
|
2019-10-14 01:38:54 +00:00
|
|
|
$(ACME) -DBUILDNUMBER=`git rev-list --count HEAD` src/4cade.a 2>build/relbase.log
|
|
|
|
$(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
|
2019-09-19 14:47:04 +00:00
|
|
|
|
2020-11-13 04:26:15 +00:00
|
|
|
asmfx: md
|
2021-10-16 01:34:39 +00:00
|
|
|
for f in src/fx/*.a; do \
|
|
|
|
grep "^\!to" $${f} >/dev/null && $(ACME) $${f} >> build/log || true; \
|
|
|
|
done
|
2019-09-19 14:47:04 +00:00
|
|
|
|
2020-11-13 04:26:15 +00:00
|
|
|
asmprelaunch: md
|
2021-10-16 01:34:39 +00:00
|
|
|
for f in src/prelaunch/*.a; do \
|
|
|
|
grep "^\!to" $${f} >/dev/null && $(ACME) $${f} >> build/log; \
|
|
|
|
done
|
2019-09-19 14:47:04 +00:00
|
|
|
|
2021-08-14 00:53:38 +00:00
|
|
|
asmproboot: md
|
|
|
|
$(ACME) -r build/proboothd.lst src/proboothd/proboothd.a >> build/log
|
2019-08-23 17:59:22 +00:00
|
|
|
|
2021-10-16 01:34:39 +00:00
|
|
|
#
|
|
|
|
# |compress| and |attract| must be called separately because they are slow.
|
|
|
|
# They create files in the repository which can then be checked in.
|
|
|
|
#
|
2020-12-04 17:25:22 +00:00
|
|
|
compress: md
|
2020-03-15 03:22:31 +00:00
|
|
|
for f in res/ACTION.HGR.UNCOMPRESSED/*; do o=res/ACTION.HGR/$$(basename $$f); [ -f "$$o" ] || ${EXOMIZER} "$$f"@0x4000 -o "$$o" >>build/log; done
|
|
|
|
for f in res/ACTION.DHGR.UNCOMPRESSED/*; do o=res/ACTION.DHGR/$$(basename $$f); [ -f "$$o" ] || ${EXOMIZER} "$$f"@0x4000 -o "$$o" >>build/log; done
|
|
|
|
for f in res/ARTWORK.SHR.UNCOMPRESSED/*; do o=res/ARTWORK.SHR/$$(basename $$f); [ -f "$$o" ] || ${EXOMIZER} "$$f"@0x2000 -o "$$o" >>build/log; done
|
2020-03-12 02:03:28 +00:00
|
|
|
|
2020-03-16 15:03:27 +00:00
|
|
|
attract: compress
|
2020-03-16 18:08:07 +00:00
|
|
|
bin/check-attract-mode.sh
|
2020-03-16 15:03:27 +00:00
|
|
|
bin/generate-mini-attract-mode.sh
|
|
|
|
|
2018-08-21 13:58:28 +00:00
|
|
|
mount: dsk
|
|
|
|
osascript bin/V2Make.scpt "`pwd`" bin/4cade.vii build/"$(DISK)"
|
|
|
|
|
|
|
|
md:
|
2021-10-16 01:34:39 +00:00
|
|
|
mkdir -p build/X build/FX.INDEXED build/FX build/PRELAUNCH.INDEXED build/PRELAUNCH build/ATTRACT build/SS build/GAMEHELP
|
2020-12-04 17:25:22 +00:00
|
|
|
touch build/log
|
2018-08-21 13:58:28 +00:00
|
|
|
|
|
|
|
clean:
|
2018-11-07 02:18:13 +00:00
|
|
|
rm -rf build/ || rm -rf build
|
2018-08-21 13:58:28 +00:00
|
|
|
|
2020-03-12 02:03:28 +00:00
|
|
|
all: clean dsk mount
|
2020-05-01 22:40:51 +00:00
|
|
|
|
|
|
|
al: all
|