diff --git a/testcode/grc/Makefile b/testcode/grc/Makefile new file mode 100644 index 000000000..4df2f17bc --- /dev/null +++ b/testcode/grc/Makefile @@ -0,0 +1,43 @@ + +# Just the usual way to find out if we're +# using cmd.exe to execute make rules. +ifneq ($(shell echo),) + CMD_EXE = 1 +endif + +ifdef CMD_EXE + NULLDEV = nul: + DEL = -del /f + RMDIR = rmdir /s /q +else + NULLDEV = /dev/null + DEL = $(RM) + RMDIR = $(RM) -r +endif + +ifdef CC65_HOME + AS = $(CC65_HOME)/bin/ca65 + CC = $(CC65_HOME)/bin/cc65 + CL = $(CC65_HOME)/bin/cl65 + LD = $(CC65_HOME)/bin/ld65 + GRC = $(CC65_HOME)/bin/grc65 +else + AS := $(if $(wildcard ../../../bin/ca65*),../../../bin/ca65,ca65) + CC := $(if $(wildcard ../../../bin/cc65*),../../../bin/cc65,cc65) + CL := $(if $(wildcard ../../../bin/cl65*),../../../bin/cl65,cl65) + LD := $(if $(wildcard ../../../bin/ld65*),../../../bin/ld65,ld65) + GRC := $(if $(wildcard ../../../bin/grc65*),../../../bin/grc65,grc65) +endif + +all: test.s vlir.cvt + +test.s: test.grc + $(GRC) -s test.s test.grc + +vlir.cvt: vlir.grc + $(GRC) -s vlir.s test.grc + $(CL) -t geos -C geos-cbm-overlay.cfg -o vlir.cvt vlir.s vlir0.s vlir1.s vlir2.s + +clean: + $(RM) test.s test.h + $(RM) vlir.s vlir.cvt diff --git a/testcode/grc/geos-cbm-overlay.cfg b/testcode/grc/geos-cbm-overlay.cfg new file mode 100644 index 000000000..ddf1d1e1f --- /dev/null +++ b/testcode/grc/geos-cbm-overlay.cfg @@ -0,0 +1,84 @@ +FEATURES { + STARTADDRESS: default = $0400; +} +SYMBOLS { + __BACKBUFSIZE__: type = weak, value = $2000; + __HIMEM__: type = weak, value = $8000 - __BACKBUFSIZE__; + __OVERLAYSIZE__: type = weak, value = $1000; + __OVERLAYADDR__: type = weak, value = __HIMEM__ - __OVERLAYSIZE__; + __STACKSIZE__: type = weak, value = $0400; # 1k stack + __STACKADDR__: type = weak, value = __OVERLAYADDR__ - __STACKSIZE__; +} +MEMORY { + CVT: file = %O, start = $0, size = $40000; + ZP: define = yes, start = $58, size = $1A + $06; + VLIR0: define = yes, start = %S, size = __STACKADDR__ - %S; + VLIR1: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR2: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR3: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR4: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR5: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR6: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR7: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR8: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR9: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR10: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR11: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR12: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR13: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR14: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR15: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR16: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR17: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR18: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; + VLIR19: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__; +} +SEGMENTS { + ZEROPAGE: type = zp, load = ZP; + EXTZP: type = zp, load = ZP, optional = yes; + DIRENTRY: type = ro, load = CVT, align = $FE; + FILEINFO: type = ro, load = CVT, align = $FE; + RECORDS: type = ro, load = CVT, align = $FE, optional = yes; + STARTUP: type = ro, run = VLIR0, load = CVT, align_load = $FE, define = yes; + LOWCODE: type = ro, run = VLIR0, load = CVT, optional = yes; + ONCE: type = ro, run = VLIR0, load = CVT, optional = yes; + CODE: type = ro, run = VLIR0, load = CVT; + RODATA: type = ro, run = VLIR0, load = CVT; + DATA: type = rw, run = VLIR0, load = CVT; + INIT: type = bss, load = VLIR0, optional = yes; + BSS: type = bss, load = VLIR0, define = yes; + OVERLAY1: type = ro, run = VLIR1, load = CVT, align_load = $FE, optional = yes; + OVERLAY2: type = ro, run = VLIR2, load = CVT, align_load = $FE, optional = yes; + OVERLAY3: type = ro, run = VLIR3, load = CVT, align_load = $FE, optional = yes; + OVERLAY4: type = ro, run = VLIR4, load = CVT, align_load = $FE, optional = yes; + OVERLAY5: type = ro, run = VLIR5, load = CVT, align_load = $FE, optional = yes; + OVERLAY6: type = ro, run = VLIR6, load = CVT, align_load = $FE, optional = yes; + OVERLAY7: type = ro, run = VLIR7, load = CVT, align_load = $FE, optional = yes; + OVERLAY8: type = ro, run = VLIR8, load = CVT, align_load = $FE, optional = yes; + OVERLAY9: type = ro, run = VLIR9, load = CVT, align_load = $FE, optional = yes; + OVERLAY10: type = ro, run = VLIR10, load = CVT, align_load = $FE, optional = yes; + OVERLAY11: type = ro, run = VLIR11, load = CVT, align_load = $FE, optional = yes; + OVERLAY12: type = ro, run = VLIR12, load = CVT, align_load = $FE, optional = yes; + OVERLAY13: type = ro, run = VLIR13, load = CVT, align_load = $FE, optional = yes; + OVERLAY14: type = ro, run = VLIR14, load = CVT, align_load = $FE, optional = yes; + OVERLAY15: type = ro, run = VLIR15, load = CVT, align_load = $FE, optional = yes; + OVERLAY16: type = ro, run = VLIR16, load = CVT, align_load = $FE, optional = yes; + OVERLAY17: type = ro, run = VLIR17, load = CVT, align_load = $FE, optional = yes; + OVERLAY18: type = ro, run = VLIR18, load = CVT, align_load = $FE, optional = yes; + OVERLAY19: type = ro, run = VLIR19, load = CVT, align_load = $FE, optional = yes; +} +FEATURES { + CONDES: type = constructor, + label = __CONSTRUCTOR_TABLE__, + count = __CONSTRUCTOR_COUNT__, + segment = ONCE; + 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/testcode/grc/vlir0.s b/testcode/grc/vlir0.s index 2e9a3ffd9..a54d406df 100644 --- a/testcode/grc/vlir0.s +++ b/testcode/grc/vlir0.s @@ -5,10 +5,10 @@ ; include some GEOS defines - .include "../../libsrc/geos/inc/const.inc" - .include "../../libsrc/geos/inc/jumptab.inc" - .include "../../libsrc/geos/inc/geossym.inc" - .include "../../libsrc/geos/inc/geosmac.inc" + .include "../../libsrc/geos-common/const.inc" + .include "../../libsrc/geos-cbm/jumptab.inc" + .include "../../libsrc/geos-cbm/geossym.inc" + .include "../../libsrc/geos-common/geosmac.inc" ; import load addresses for all VLIR chains ; these labels are defined upon linking with ld65 diff --git a/testcode/grc/vlir1.s b/testcode/grc/vlir1.s index eae34565e..6ee3cca37 100644 --- a/testcode/grc/vlir1.s +++ b/testcode/grc/vlir1.s @@ -5,10 +5,10 @@ ; include some GEOS defines - .include "../../libsrc/geos/inc/const.inc" - .include "../../libsrc/geos/inc/jumptab.inc" - .include "../../libsrc/geos/inc/geossym.inc" - .include "../../libsrc/geos/inc/geosmac.inc" + .include "../../libsrc/geos-common/const.inc" + .include "../../libsrc/geos-cbm/jumptab.inc" + .include "../../libsrc/geos-cbm/geossym.inc" + .include "../../libsrc/geos-common/geosmac.inc" ; export names of functions that will be used in the main program diff --git a/testcode/grc/vlir2.s b/testcode/grc/vlir2.s index 9d180c847..4c02983ff 100644 --- a/testcode/grc/vlir2.s +++ b/testcode/grc/vlir2.s @@ -5,10 +5,10 @@ ; similar to vlir1.s except the fact that this is chain #2 - .include "../../libsrc/geos/inc/const.inc" - .include "../../libsrc/geos/inc/jumptab.inc" - .include "../../libsrc/geos/inc/geossym.inc" - .include "../../libsrc/geos/inc/geosmac.inc" + .include "../../libsrc/geos-common/const.inc" + .include "../../libsrc/geos-cbm/jumptab.inc" + .include "../../libsrc/geos-cbm/geossym.inc" + .include "../../libsrc/geos-common/geosmac.inc" .export OVERLAY2_Function1 .export OVERLAY2_Function2