From c5a211a8f09afd63be4387caefc9fb58486ac1ee Mon Sep 17 00:00:00 2001 From: Gregor Riepl Date: Sat, 20 Aug 2022 17:37:42 +0200 Subject: [PATCH] Reconfig memory --- Makefile | 5 +++-- driver.a65 | 12 +----------- mem.cfg | 6 +----- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index d875389..591da2a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ MACHINE := pet +MEMCFG := mem.cfg .PHONY: all clean @@ -9,11 +10,11 @@ clean: rm -f rs232.bin *.o *.lst *.map rs232.bin: driver.o - cl65 -v -C mem.cfg -l rs232.lst -m rs232.map -o $@ $^ + cl65 -v -C ${MEMCFG} -m rs232.map -o $@ $^ %.lst: %.bin @# the start address shouldn't be hardcoded here... da65 -o $@ -S 0x7000 $< %.o: %.a65 - ca65 -v -t ${MACHINE} -o $@ $< + ca65 -v -l $(patsubst %.o,%.lst,$@) -t ${MACHINE} -o $@ $< diff --git a/driver.a65 b/driver.a65 index 2212a57..95ede2a 100644 --- a/driver.a65 +++ b/driver.a65 @@ -2,13 +2,6 @@ ; 6502 mode .p02 -; define where we want to be loaded -.global __LOADADDR__ -__LOADADDR__ = $7000 -; and where data should reside -.global __DATAADDR__ -__DATAADDR__ = $7200 - ; load useful register/memory locations .include "pet.inc" @@ -46,9 +39,6 @@ BAUD_RATE = 300 .export rs_status rs_status: .byte 0 -; specify the load address, so code and data will be located there -;.org __LOADADDR__ - ; entry points .code ; these are convenience entry points right at the beginning of the page, @@ -68,7 +58,7 @@ BAUD_RATE = 300 jmp write ; driver state data -.data +.bss ; 1=driver initialized initialized: .byte 0 ; saved IRQ vector diff --git a/mem.cfg b/mem.cfg index df3da0c..cc187ae 100644 --- a/mem.cfg +++ b/mem.cfg @@ -1,12 +1,8 @@ -SYMBOLS { - __LOADADDR__: type = import; - __DATAADDR__: type = import; -} MEMORY { # $ED-$F7 seems to be an unused area in the zero page according to the BASIC 2.0/4.0 memory map ZP: file = "", define = yes, start = $00ED, size = $000A; # we're loading at $7000, max code size $800 bytes - RAM: file = %O, start = __LOADADDR__, size = $0800; + RAM: file = %O, start = $7000, size = $0800; # if we reside in ROM instead, we should have more space available ROM: file = %O, start = $9000, size = $2000; }