aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-02-18 05:26:21 -0500
committerB. Watson <yalhcru@gmail.com>2016-02-18 05:26:21 -0500
commit112ed11473e4be6fadf8f1abad08195294e838f4 (patch)
treeca6aa40ee05a20fdccd416de1e6b218108ea067c
parent7759a52eb0ee980efd8a1d9faa1c84af1db1368c (diff)
downloadtaipan-112ed11473e4be6fadf8f1abad08195294e838f4.tar.gz
save a byte in the cart build
-rw-r--r--Makefile18
-rw-r--r--crt0_cart.s11
2 files changed, 10 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 74ec7a5..ddcfa5b 100644
--- a/Makefile
+++ b/Makefile
@@ -303,21 +303,11 @@ mkcart: mkcart.c
$(HOSTCC) $(HOSTCFLAGS) -o mkcart mkcart.c
# cc65 doc atari.html explains how to produce a raw binary file.
-# we build it for $03ff because cc65-produced atari binaries always
-# have an RTS as the first byte (for compatibility with SpartaDOS).
-# the "tail -c+2" stuff removes the first byte, so we end up with
-# a romable_taimain.raw that's ready to be copied to $0400 and run
-# via "JSR $0400".
-#romable_taimain.raw: $(TAIMAIN_C_SRC) $(TAIMAIN_ASM_SRC) $(TAIMAIN_HDRS)
-# rm -f taimain.xex
-# $(MAKE) FONT_ADDR=0x9c00 TAIMAIN_ADDR=0x3ff EXTRACFLAGS="-Wl -D__AUTOSTART__=1 -Wl -D__EXEHDR__=1 -DCART_TARGET=1 --asm-define CART_TARGET=1" taimain.xex
-# tail -c+2 taimain.xex > romable_taimain.raw
-# rm -f taimain.xex
-
+# using a custom crt0 to get rid of the extra RTS cc65 puts there for
+# SpartaDOS compatibility (which has no effect on a cartridge image,
+# except to waste 1 byte).
romable_taimain.raw: $(TAIMAIN_C_SRC) $(TAIMAIN_ASM_SRC) $(TAIMAIN_HDRS) $(BIGNUM_SRC) $(BIGNUM_HDRS) $(TAIMAIN_LIBS) crt0_cart.s
- cl65 --config cartbank3.cfg -m taipan.map -t atari -T -I. -L. -DFONT_ADDR=0x9c00 --start-addr 0x3ff -Wl -D__STACKSIZE__=0x200 -O -Wl -D__SYSTEM_CHECK__=1 -Wl -D__AUTOSTART__=1 -Wl -D__EXEHDR__=1 -DCART_TARGET=1 --asm-define CART_TARGET=1 -DBIGNUM=BIGFLOAT -o romable_taimain.raw.in $(TAIMAIN_C_SRC) $(TAIMAIN_ASM_SRC) $(BIGNUM_SRC) $(TAIMAIN_LIBS) crt0_cart.s
- tail -c+2 romable_taimain.raw.in > romable_taimain.raw
- rm -f romable_taimain.raw.in
+ cl65 --config cartbank3.cfg -m taipan.map -t atari -T -I. -L. -DFONT_ADDR=0x9c00 --start-addr 0x400 -Wl -D__STACKSIZE__=0x200 -O -Wl -D__SYSTEM_CHECK__=1 -Wl -D__AUTOSTART__=1 -Wl -D__EXEHDR__=1 -DCART_TARGET=1 --asm-define CART_TARGET=1 -DBIGNUM=BIGFLOAT -o romable_taimain.raw $(TAIMAIN_C_SRC) $(TAIMAIN_ASM_SRC) $(BIGNUM_SRC) $(TAIMAIN_LIBS) crt0_cart.s
# 256 bytes of $ff filler, for the last page of each code bank. Wasting
# this little bit of space simplifies the copying code in bank7.s (no
diff --git a/crt0_cart.s b/crt0_cart.s
index ec3e423..7448e9b 100644
--- a/crt0_cart.s
+++ b/crt0_cart.s
@@ -8,6 +8,12 @@
; Stefan Haubenthal
;
+; Modified for use with Taipan cartridge image:
+; - Removed the RTS at the start of the code
+; - Got rid of __ATARIXL__ conditionals
+; - Don't save stuff like APPMHI and LMARGN, since the cart
+; never returns.
+
.export __STARTUP__ : absolute = 1 ; Mark as startup
.export _exit, start
@@ -22,11 +28,6 @@
.segment "STARTUP"
- rts ; fix for SpartaDOS / OS/A+
- ; They first call the entry point from AUTOSTRT; and
- ; then, the load address (this rts here).
- ; We point AUTOSTRT directly after the rts.
-
; Real entry point:
start: