I have a folder called 'world' with a file called 'map.c' and 'map.h'. I compile the files using the same segments as for the provided 'sketch' folder (using BANK7 as memory in lynxcart.cfg). I extended the directory.s file as described with
.import __WORLD_CODE_LOAD__ .import __WORLD_CODE_SIZE__ .import __WORLD_DATA_SIZE__ .import __WORLD_RODATA_SIZE__and
; The 3rd entry is the 1st game level we want to run. entry off2, len2, off3, block3, len3, __SKETCH_CODE_SIZE__+__SKETCH_RODATA_SIZE__+__SKETCH_DATA_SIZE__, __SKETCH_CODE_LOAD__ entry off3, len3, off4, block4, len4, __WORLD_CODE_SIZE__+__WORLD_RODATA_SIZE__+__WORLD_DATA_SIZE__, __WORLD_CODE_LOAD__
Now the compiler (cc65) complains about the WORLD_CODE_SIZE etc. to be undefined externals. I can't find out where to fix this. Also, I haven't figured out how to load a new module in resident.c. FileLoadFile uses INTRO_FILENR and SKETCH_FILENR to load new modules, and they are defined in resident.h (as 2 and 3). Adding
#define WORLD_FILENR 4is of course not enough, but I don't know where this definition is used again.
Any ideas on how to do this correctly?