aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2015-12-31 03:00:46 -0500
committerB. Watson <yalhcru@gmail.com>2015-12-31 03:00:46 -0500
commit0ab84dd41eabd424420530efa36ac6147379706c (patch)
tree186240740abb0dd7b71f7f872e7a261261175340 /Makefile
parente947bd066312e3fcaaad62914126ac9270e79fbf (diff)
downloadtaipan-0ab84dd41eabd424420530efa36ac6147379706c.tar.gz
faster screen updates, requires git cc65
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 25 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 6eed257..4daa2ea 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,29 @@
CC=cl65
SYS=atari
-# COPT=-Oirs
-COPT=-O -l -T
-CFLAGS=-t $(SYS) -C custom.cfg -I. -L. $(COPT)
+
+# the meaning of the -l flag is different between cc65-2.13.3
+# and the later github cc65, so it's commented out here.
+#COPT=-O -l -T
+COPT=-O -T
+
+# for older cc65:
+#CFLAGS=-t $(SYS) -C custom.cfg -I. -L. $(COPT)
+
+# for recent git cc65.
+# -D__RESERVED_MEMORY__=1056 because cc65's default end of memory
+# is $BC20, and we want it to end just below our font, which starts
+# at $B800.
+# -D__SYSTEM_CHECK__=1 stops cl65 from prepending a bit of code that
+# checks to make sure there's enough memory. Older cc65 didn't do this,
+# and I never missed it.
+CFLAGS=-t $(SYS) -I. -L. -Wl -D__SYSTEM_CHECK__=1 -Wl -D__RESERVED_MEMORY__=1056 $(COPT)
AS=ca65
-ASFLAGS=-l
+ASFLAGS=
AR=ar65
+VERSION="v0.99alpha-$(shell date +%Y%m%d)-$(shell git rev-parse --short HEAD 2>/dev/null || echo UNKNOWN)"
+
# A few files have no make rules here. LORCHA.DAT is generated as a
# side-effect of generating taifont.xex. It's a 49-byte (7x7) blob of
# Atari "internal" screen codes.
@@ -28,6 +44,9 @@ XEX=taipan.xex
all: $(XEX)
+ver:
+ @echo $(VERSION)
+
$(XEX): taimain.xex taifont.xex title.xex
cat taifont.xex title.xex taimain.xex > $(XEX)
@@ -35,7 +54,7 @@ title.xex: TITLE.DAT
perl title.pl TITLE.DAT > title.xex
taimain.xex: taipan.c rand.s draw_lorcha.s taifont.xex
- cl65 --mapfile taipan.map -t atari -O -l -T -o taimain.xex taipan.c rand.s draw_lorcha.s timed_getch.s jsleep.s
+ cl65 -DVERSION=\"$(VERSION)\" --mapfile taipan.map $(CFLAGS) -o taimain.xex taipan.c rand.s draw_lorcha.s timed_getch.s jsleep.s portstat.s
taifont.xex: convfont romfont font
cat romfont font | ./convfont -x > taifont.xex
@@ -66,6 +85,6 @@ distclean: clean
$(CC) --mapfile map $(CFLAGS) -o $@ $<
lorchatest: lorchatest.c draw_lorcha.s taifont.xex
- cl65 -t atari -O -l -T -o lorchatest1.xex lorchatest.c draw_lorcha.s
+ cl65 -t atari -O -T -o lorchatest1.xex lorchatest.c draw_lorcha.s
cat taifont.xex lorchatest1.xex > lorchatest.xex
atari800 -nobasic lorchatest.xex