No, I'm not using multiple output files in a single link. Each bank is its own separate link operation. They all use the same linker CFG, which looks like this, currently:
Code: Select all
MEMORY {
ZP: start = $00, size = $100, type = rw, file = "";
STACK: start = $100, size = $100, type = rw, file = "";
BSS: start = $200, size = $600, type = rw, file = "";
PRG: start = $8000, size = $8000, type = ro, file = %O, fill = yes, fillval = $EA;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
STACK: load = STACK, type = bss;
OAM: load = BSS, type = bss, start = $200;
RAM: load = BSS, type = bss;
ALIGNED: load = PRG, type = ro, start = $8000, optional = yes;
CODE: load = PRG, type = ro;
DATA: load = PRG, type = ro;
FIXED: load = PRG, type = ro, start = $FE00;
VECTORS: load = PRG, type = ro, start = $FFFA;
}
I just concatenate the header and binaries after linking.
ALIGNED is a place for a couple of timing critical routines, so I can be sure they don't cross a page.
FIXED is the place for the bankswitch routine, though I have also put my common NMI routine here.