From 02e9719573afb1d7210c6ec4400fb50b4807d032 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 25 Feb 2016 04:57:59 -0500 Subject: rename linker config, replace cl65 => $(CC) in Makefile, 7479 bytes free --- Makefile | 22 +++++++++---------- cartbank2.cfg | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ cartbank3.cfg | 68 ----------------------------------------------------------- 3 files changed, 79 insertions(+), 79 deletions(-) create mode 100644 cartbank2.cfg delete mode 100644 cartbank3.cfg diff --git a/Makefile b/Makefile index 76bbbd9..e561e73 100644 --- a/Makefile +++ b/Makefile @@ -214,11 +214,11 @@ titledata.dat: newtitle.pl newtitle.png # for gory details. comptitle.xex: titledata.dat titlecomp.pl comptitle.s.in $(PERL) titlecomp.pl 133 < titledata.dat - cl65 -l comptitle.lst -o comptitle.xex -t none --asm-define destination=$(TITLE_DATA_ADDR) comptitle.s + $(CC) -l comptitle.lst -o comptitle.xex -t none --asm-define destination=$(TITLE_DATA_ADDR) comptitle.s # tiny 1-sector memory checker, aborts the laod if a cart is present. checkmem.xex: checkmem.s - cl65 -o checkmem.xex -t none checkmem.s + $(CC) -o checkmem.xex -t none checkmem.s # Init segment that loads after the title screen data. It sets up # a custom display list and sets the GTIA for narrow playfield, @@ -229,7 +229,7 @@ checkmem.xex: checkmem.s # to get cc65 to build an init segment (would need a custom linker # script at least). newtitle.xex: newtitle.s ver.dat help.dat - cl65 -l newtitle.lst -m newtitle.map -o newtitle.xex -t none --asm-define screendata=$(TITLE_DATA_ADDR) --asm-define origin=$(TITLE_CODE_ADDR) newtitle.s + $(CC) -l newtitle.lst -m newtitle.map -o newtitle.xex -t none --asm-define screendata=$(TITLE_DATA_ADDR) --asm-define origin=$(TITLE_CODE_ADDR) newtitle.s # Version number in Atari screen-data form ver.dat: text2screen.pl @@ -245,7 +245,7 @@ help.dat: help.txt text2screen.pl # The main executable. All the C and asm code goes here, except the init # segment in newtitle.s. taimain.xex: $(TAIMAIN_C_SRC) $(TAIMAIN_ASM_SRC) $(TAIMAIN_HDRS) $(BIGNUM_SRC) $(BIGNUM_HDRS) $(TAIMAIN_LIBS) messages.c - cl65 -m taipan.map $(CFLAGS) $(BIGNUM_CFLAGS) -o taimain.xex $(TAIMAIN_C_SRC) $(TAIMAIN_ASM_SRC) $(BIGNUM_SRC) $(TAIMAIN_LIBS) + $(CC) -m taipan.map $(CFLAGS) $(BIGNUM_CFLAGS) -o taimain.xex $(TAIMAIN_C_SRC) $(TAIMAIN_ASM_SRC) $(BIGNUM_SRC) $(TAIMAIN_LIBS) #cl65 --mapfile taipan.map $(CFLAGS) -o taimain.xex taipan.c sounds.c rand.s draw_lorcha.s timed_getch.s jsleep.s portstat.s console.s @@ -253,11 +253,11 @@ taimain.xex: $(TAIMAIN_C_SRC) $(TAIMAIN_ASM_SRC) $(TAIMAIN_HDRS) $(BIGNUM_SRC) $ # taipan.c. This rule not used as part of the main build, it's only for # debugging. taipan.lst: taipan.c - cl65 -m taipan.map $(CFLAGS) -c -o /dev/null -l taipan.lst -T taipan.c + $(CC) -m taipan.map $(CFLAGS) -c -o /dev/null -l taipan.lst -T taipan.c # Another such rule for sounds.c: sounds.lst: sounds.c sounds.h - cl65 -m sounds.map $(CFLAGS) -c -o /dev/null -l sounds.lst -T sounds.c + $(CC) -m sounds.map $(CFLAGS) -c -o /dev/null -l sounds.lst -T sounds.c # The font gets loaded into RAM, in the area reserved by the # -D__RESERVED_MEMORY__ option to cl65. To actually use the font, @@ -317,7 +317,7 @@ mkcart: mkcart.c # 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 messages.c - 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 + $(CC) --config cartbank2.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 @@ -352,10 +352,10 @@ bank1: splitrom.raw.1 fill256 # cl65 -l bank2.lst -m bank2.map -t none -o bank2 bank2.s bank2: rodata.8000 bank2.s taifont romable_taimain.raw - cl65 -l bank2.lst -m bank2.map -t none -o bank2 bank2.s + $(CC) -l bank2.lst -m bank2.map -t none -o bank2 bank2.s bank3: bank3.s titledata.dat ver.dat help.dat newtitle.s - cl65 -l bank3.lst -m bank3.map -t none -o bank3 bank3.s + $(CC) -l bank3.lst -m bank3.map -t none -o bank3 bank3.s # raw ROM, for burning to EPROM/flash. taipan.rom: bank0 bank1 bank2 bank3 @@ -397,7 +397,7 @@ size: clean all # Cruft. Was used for testing the enemy ship animation. lorchatest: lorchatest.c draw_lorcha.s taifont.xex - cl65 -t atari -O -T -o lorchatest1.xex lorchatest.c draw_lorcha.s + $(CC) -t atari -O -T -o lorchatest1.xex lorchatest.c draw_lorcha.s cat taifont.xex lorchatest1.xex > lorchatest.xex atari800 -nobasic lorchatest.xex @@ -422,7 +422,7 @@ romable_taimain.xex: $(TAIMAIN_C_SRC) $(TAIMAIN_ASM_SRC) $(TAIMAIN_HDRS) ### soundtest: sounds.c - cl65 -DTESTXEX -t atari -o sounds.xex sounds.c + $(CC) -DTESTXEX -t atari -o sounds.xex sounds.c atari800 -nobasic sounds.xex # former textmode title screen, was generated by TITLE.LST. Replaced diff --git a/cartbank2.cfg b/cartbank2.cfg new file mode 100644 index 0000000..1e6e5cc --- /dev/null +++ b/cartbank2.cfg @@ -0,0 +1,68 @@ +# TODO: get rid of some of the chunks like HEADER SYSCHKHDR etc. +# right now I'm killing them with -Wl options to cl65. + +FEATURES { + STARTADDRESS: default = $2000; +} +SYMBOLS { + __EXEHDR__: type = import; + __SYSTEM_CHECK__: type = import; # force inclusion of "system check" load chunk + __AUTOSTART__: type = import; # force inclusion of autostart "trailer" + __STACKSIZE__: type = weak, value = $0800; # 2k stack + __STARTADDRESS__: type = export, value = %S; + __RESERVED_MEMORY__: type = weak, value = $0000; +} +MEMORY { + ZP: file = "", define = yes, start = $0082, size = $007E; + +# file header, just $FFFF + HEADER: file = %O, start = $0000, size = $0002; + +# "system check" load chunk + SYSCHKHDR: file = %O, start = $0000, size = $0004; + SYSCHKCHNK: file = %O, start = $2E00, size = $0300; + SYSCHKTRL: file = %O, start = $0000, size = $0006; + +# "main program" load chunk + MAINHDR: file = %O, start = $0000, size = $0004; + RAM: file = %O, define = yes, start = %S, size = $BC20 - __STACKSIZE__ - __RESERVED_MEMORY__ - %S; + TRAILER: file = %O, start = $0000, size = $0006; + +# read-only data (and some code) goes in a cart bank + HIGHDATA: file = "rodata.8000" start = $8000, size = $2000; + +} +SEGMENTS { + EXEHDR: load = HEADER, type = ro; + SYSCHKHDR: load = SYSCHKHDR, type = ro, optional = yes; + SYSCHK: load = SYSCHKCHNK, type = rw, define = yes, optional = yes; + SYSCHKTRL: load = SYSCHKTRL, type = ro, optional = yes; + MAINHDR: load = MAINHDR, type = ro; + STARTUP: load = RAM, type = ro, define = yes; + LOWCODE: load = RAM, type = ro, define = yes, optional = yes; + INIT: load = RAM, type = ro, optional = yes; + CODE: load = RAM, type = ro, define = yes; + RODATA: load = HIGHDATA, type = ro; + HIGHCODE: load = HIGHDATA, type = ro; + DATA: load = RAM, type = rw; + INITBSS: load = RAM, type = bss, optional = yes; + BSS: load = RAM, type = bss, define = yes; + ZEROPAGE: load = ZP, type = zp; + EXTZP: load = ZP, type = zp, optional = yes; + AUTOSTRT: load = TRAILER, type = ro; +} +FEATURES { + CONDES: type = constructor, + label = __CONSTRUCTOR_TABLE__, + count = __CONSTRUCTOR_COUNT__, + segment = INIT; + CONDES: type = destructor, + label = __DESTRUCTOR_TABLE__, + count = __DESTRUCTOR_COUNT__, + segment = RODATA; + CONDES: type = interruptor, + label = __INTERRUPTOR_TABLE__, + count = __INTERRUPTOR_COUNT__, + segment = RODATA, + import = __CALLIRQ__; +} diff --git a/cartbank3.cfg b/cartbank3.cfg deleted file mode 100644 index 1e6e5cc..0000000 --- a/cartbank3.cfg +++ /dev/null @@ -1,68 +0,0 @@ -# TODO: get rid of some of the chunks like HEADER SYSCHKHDR etc. -# right now I'm killing them with -Wl options to cl65. - -FEATURES { - STARTADDRESS: default = $2000; -} -SYMBOLS { - __EXEHDR__: type = import; - __SYSTEM_CHECK__: type = import; # force inclusion of "system check" load chunk - __AUTOSTART__: type = import; # force inclusion of autostart "trailer" - __STACKSIZE__: type = weak, value = $0800; # 2k stack - __STARTADDRESS__: type = export, value = %S; - __RESERVED_MEMORY__: type = weak, value = $0000; -} -MEMORY { - ZP: file = "", define = yes, start = $0082, size = $007E; - -# file header, just $FFFF - HEADER: file = %O, start = $0000, size = $0002; - -# "system check" load chunk - SYSCHKHDR: file = %O, start = $0000, size = $0004; - SYSCHKCHNK: file = %O, start = $2E00, size = $0300; - SYSCHKTRL: file = %O, start = $0000, size = $0006; - -# "main program" load chunk - MAINHDR: file = %O, start = $0000, size = $0004; - RAM: file = %O, define = yes, start = %S, size = $BC20 - __STACKSIZE__ - __RESERVED_MEMORY__ - %S; - TRAILER: file = %O, start = $0000, size = $0006; - -# read-only data (and some code) goes in a cart bank - HIGHDATA: file = "rodata.8000" start = $8000, size = $2000; - -} -SEGMENTS { - EXEHDR: load = HEADER, type = ro; - SYSCHKHDR: load = SYSCHKHDR, type = ro, optional = yes; - SYSCHK: load = SYSCHKCHNK, type = rw, define = yes, optional = yes; - SYSCHKTRL: load = SYSCHKTRL, type = ro, optional = yes; - MAINHDR: load = MAINHDR, type = ro; - STARTUP: load = RAM, type = ro, define = yes; - LOWCODE: load = RAM, type = ro, define = yes, optional = yes; - INIT: load = RAM, type = ro, optional = yes; - CODE: load = RAM, type = ro, define = yes; - RODATA: load = HIGHDATA, type = ro; - HIGHCODE: load = HIGHDATA, type = ro; - DATA: load = RAM, type = rw; - INITBSS: load = RAM, type = bss, optional = yes; - BSS: load = RAM, type = bss, define = yes; - ZEROPAGE: load = ZP, type = zp; - EXTZP: load = ZP, type = zp, optional = yes; - AUTOSTRT: load = TRAILER, type = ro; -} -FEATURES { - CONDES: type = constructor, - label = __CONSTRUCTOR_TABLE__, - count = __CONSTRUCTOR_COUNT__, - segment = INIT; - CONDES: type = destructor, - label = __DESTRUCTOR_TABLE__, - count = __DESTRUCTOR_COUNT__, - segment = RODATA; - CONDES: type = interruptor, - label = __INTERRUPTOR_TABLE__, - count = __INTERRUPTOR_COUNT__, - segment = RODATA, - import = __CALLIRQ__; -} -- cgit v1.2.3