8BIT wrote:
I'm away from my computer but you can look at my cc65 files for the emulator I did. It might shed some light.
http://sbc.rictor.org/download/AVR_CC65.zipWill try to follow up this wekend.
Thanks a lot, it's incredibly useful being able to access as many examples as possible! I'm checking your code and I'll surely learn from it
In the meantime I've
partially solved my issue - I say partially because, while I've been able to relocate the CODE section's start address
within the MAIN memory area, I still can't successfully create any new memory area at a different address than the default one. Actually, looks like any new MEMORY areas I'm creating just won't work!
So, the following works:
Code:
MEMORY {
...
# This is the default MAIN memory area, no changes here
MAIN: file = %O, define = yes, start = __HEADER_LAST__, size = __HIMEM__ - __HEADER_LAST__;
...
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
LOADADDR: load = LOADADDR, type = ro;
EXEHDR: load = HEADER, type = ro;
STARTUP: load = MAIN, type = ro;
LOWCODE: load = MAIN, type = ro, optional = yes;
### THIS IS WHAT I'VE CHANGED: setting a start location for the segment within the MAIN memory area
CODE: load = MAIN, start=$3000, type = ro;
###
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
ONCE: load = MAIN, type = ro, define = yes;
BSS: load = BSS, type = bss, define = yes;
}
So, I've just specified the start address in the CODE
segment. I don't like it very much though, it doesn't look very flexible, I'm not sure where the rest of the segments following CODE are going to be placed, and overall I quite hate it
I can't even create new MEMORY areas and allocate SEGMENTS in there, as the following just won't work;
Code:
MEMORY {
...
SIDTUNE: start = $1000, size = $1000, type = ro, file = %O, fill = yes;
...
}
SEGMENTS {
...
sidtune: load = SIDTUNE, start=$1000, type = ro;
...
}
That's quite weird, also considering that it's exactly what the cc65 docs suggest to do for including binary data at specific addresses... (yes, I know I can relocate SID tunes, but that was not the point
).
Instead, if I just locate the sidtune segment withing the MAIN memory area and set a start location for it, it works fine!
Still quite puzzled
I'm afraid cc65 is a great tool with very poor documentation
White Flame wrote:
According to
the docs, you want to start with c64-asm.cfg, not c64.cfg. The latter assumes standalone RUN-launched programs.
The docs say that the c64-asm.cfg "[...]is made for assembler programmers who don't need a special setup". I'm writing a C program with some ASM parts (both inline and as separate .s source files), and the c64-asm.cfg doesn't seem to work
Thanks all for the support!
Fabrizio.-