I have a question about the align attribute in my memory config:
Code:
MEMORY {
BANK00: start=$8000, size=$8000, fill=yes;
BANK01: start=$f000, size=$8000, fill=yes;
}
SEGMENTS {
CODE: load=BANK00, align=$8000; # bank 0 at $00:$8000
HEADER: load=BANK00, start=$ffc0;
ROMINFO: load=BANK00, start=$ffd5;
VECTOR: load=BANK00, start=$ffe4;
GRAPHICS: load=BANK01, align=$8000; # bank 1 at $01:$8000
}
Background: I'm playing around with programming SNES game bits for fun, the code is working fine. For ease of use I decided to have one 32KB segment/bank for my code(include the reset vectors and SNES specific data) and a second 32KB bank for the graphics I use(note that both data could fit completely into one bank, I simply do this for educational reasons).
Now, when I build my program the output file is as expected 64KB in size, so I except my code to start at $0000 of the output file, and the graphics data at $8000. Yet my graphics data starts at $9000. I also get this warning from ld65:
Code:
ld65: Warning: lorom128.cfg(11): The first segment in memory area `BANK01' needs fill bytes for alignment.
When I remove the second align attribute in the last line, my graphics are placed at $8000 as expected. I understand the align attribute to be a tool to make sure, that segements of a certain size won't overlap.
What am I getting wrong about align and why does it move my data to $9000 instead of $8000?