I have written a program which might need more than 16KB of data at times, and I have "decided" that for clarity's sake (?) I'm going to use MMC1 and swap the lower bank, upper bank being static and containing the code. Thus, the memory setup I'd like to have is something like this:
(data/bank 1)(data/bank 2) ... (code/bank n)
Now, I'm not sure how to relay that information to ca65/ld65. The memory (mis-)configuration I currently have is:
I took a look at another memory configuration from an open-source project (Tetramino), which seems to have "fluff" like ZPA area declaration - does ca65/ld65 really (have to) care? Do I need to specify the ROM segments "type = rw" to be able to manipulate the mapper? The start address of the RAM area is $0300.. shouldn't that be $0200? Confusing.
So, my question boils down to this - how can I introduce the additional data banks to my code & ca65/ld65? Code additions probably amount to something like:
But.. yeah. I initially wrote the program using NESASM, tried to figure out the banking there to no avail, checked here for help and found out that it blows and this is the way to go, converted the program and here I am again.
(data/bank 1)(data/bank 2) ... (code/bank n)
Now, I'm not sure how to relay that information to ca65/ld65. The memory (mis-)configuration I currently have is:
Code:
MEMORY {
ROM1: start = $8000, size = $8000;
ROM2: start = $c000, size = $8000;
}
SEGMENTS {
DATA: load = ROM1, type = ro;
CODE: load = ROM2, type = ro;
VECTORS: load = ROM2, type = ro, start = $FFFA;
}
ROM1: start = $8000, size = $8000;
ROM2: start = $c000, size = $8000;
}
SEGMENTS {
DATA: load = ROM1, type = ro;
CODE: load = ROM2, type = ro;
VECTORS: load = ROM2, type = ro, start = $FFFA;
}
I took a look at another memory configuration from an open-source project (Tetramino), which seems to have "fluff" like ZPA area declaration - does ca65/ld65 really (have to) care? Do I need to specify the ROM segments "type = rw" to be able to manipulate the mapper? The start address of the RAM area is $0300.. shouldn't that be $0200? Confusing.
Code:
MEMORY {
ZP: start = $10, size = $f0, type = rw;
# use first $10 zeropage locations as locals
HEADER: start = $7f00, size = $0010, type = ro, file = %O;
RAM: start = $0300, size = $0500, type = rw;
ROM: start = $C000, size = $8000, type = ro, file = %O;
}
SEGMENTS {
INESHDR: load = HEADER, type = ro, align = $10;
ZEROPAGE: load = ZP, type = zp;
DATA: load = ROM, run = RAM, type = rw, define = yes, align = $100;
BSS: load = RAM, type = bss, define = yes, align = $100;
CODE: load = ROM, type = ro, align = $100;
RODATA: load = ROM, type = ro, align = $100;
DMC: load = ROM, type = ro, align = $40;
VECTORS: load = ROM, type = ro, start = $FFFA;
}
FILES {
%O: format = bin;
}
ZP: start = $10, size = $f0, type = rw;
# use first $10 zeropage locations as locals
HEADER: start = $7f00, size = $0010, type = ro, file = %O;
RAM: start = $0300, size = $0500, type = rw;
ROM: start = $C000, size = $8000, type = ro, file = %O;
}
SEGMENTS {
INESHDR: load = HEADER, type = ro, align = $10;
ZEROPAGE: load = ZP, type = zp;
DATA: load = ROM, run = RAM, type = rw, define = yes, align = $100;
BSS: load = RAM, type = bss, define = yes, align = $100;
CODE: load = ROM, type = ro, align = $100;
RODATA: load = ROM, type = ro, align = $100;
DMC: load = ROM, type = ro, align = $40;
VECTORS: load = ROM, type = ro, start = $FFFA;
}
FILES {
%O: format = bin;
}
So, my question boils down to this - how can I introduce the additional data banks to my code & ca65/ld65? Code additions probably amount to something like:
Code:
.segment "DATABNK1"
.incbin "foo1.bin"
.segment "DATABNK2"
.incbin "foo2.bin"
.incbin "foo1.bin"
.segment "DATABNK2"
.incbin "foo2.bin"
But.. yeah. I initially wrote the program using NESASM, tried to figure out the banking there to no avail, checked here for help and found out that it blows and this is the way to go, converted the program and here I am again.