aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile69
1 files changed, 69 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1d254e1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,69 @@
+
+CC=cl65
+SYS=atari
+# COPT=-Oirs
+COPT=-O -l -T
+CFLAGS=-t $(SYS) -C custom.cfg -I. -L. $(COPT)
+AS=ca65
+ASFLAGS=-l
+AR=ar65
+
+# 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.
+
+# TITLE.DAT is generated by Atari BASIC code in TITLE.LST,
+# except last time I modified it, I exited the emulator without
+# saving the damn BASIC source, so TITLE.LST is outdated. TITLE.DAT
+# is a complete 960-byte dump of GR.0 screen memory, which gets
+# turned into title.xex and prepended to the main .xex. When
+# it loads, it goes straight to screen memory.
+
+# romfont is the 1K font extracted from the Atari 800 OS, with a
+# command like:
+# dd if=atariosb.rom of=1 bs=256 skip=8 count=4
+# ...where atariosb.rom comes from e.g. the PC-Xformer 2.5 zip file.
+
+XEX=taipan.xex
+
+all: $(XEX)
+
+$(XEX): taimain.xex taifont.xex title.xex
+ cat taifont.xex title.xex taimain.xex > $(XEX)
+
+title.xex: TITLE.DAT
+ perl title.pl TITLE.DAT > title.xex
+
+taimain.xex: taipan.c rand.s draw_lorcha.s
+ cl65 --mapfile taipan.map -t atari -O -l -T -o taimain.xex taipan.c rand.s draw_lorcha.s timed_getch.s jsleep.s
+
+taifont.xex: convfont romfont font
+ cat romfont font | ./convfont -x > taifont.xex
+ touch draw_lorcha.s
+
+taifont: convfont romfont font
+ cat romfont font | ./convfont > taifont
+
+convfont: convfont.c
+ gcc -Wall -o convfont convfont.c
+
+test: all
+ atari800 -nobasic $(XEX)
+
+.s.o:
+ $(AS) $(ASFLAGS) -o $@ $<
+
+.c.o:
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+clean:
+ rm -f *.o *.lst convfont
+
+distclean: clean
+ rm -f *~ core *.xex .*.swp 1.* 2.* 1 2 map map.* *.map
+
+%.xex: %.c
+ $(CC) --mapfile map $(CFLAGS) -o $@ $<
+
+lorchatest.xex: lorchatest.c draw_lorcha.s lorcha_data.inc
+ cl65 -t atari -O -l -T -o lorchatest.xex lorchatest.c draw_lorcha.s