What has happened is that I split up the executable header into 3 parts:
exehdr.s part that contains the lnx header for handy
bootldr.s that contains a new bootloader following Wookies ideas
defdir.s that contains a default directory.
Any of these parts can be replaced by your own code.
But in order to use these you need to modify the cfg files.
SYMBOLS {
__STACKSIZE__: type = weak, value = $0800; # 2k stack
__STARTOFDIRECTORY__: type = weak, value = $00DF; # start just after loader
__BLOCKSIZE__: type = weak, value = 1024; # cart block size
__EXEHDR__: type = import;
__BOOTLDR__: type = import;
__DEFDIR__: type = import;
}
MEMORY {
ZP: file = "", define = yes, start = $0000, size = $0100;
HEADER: file = %O, start = $0000, size = $0040;
BOOT: file = %O, start = $0200, size = __STARTOFDIRECTORY__;
DIR: file = %O, start = $0000, size = 8;
RAM: file = %O, define = yes, start = $0200, size = $BE38 - __STACKSIZE__;
}
SEGMENTS {
EXEHDR: load = HEADER, type = ro;
BOOTLDR: load = BOOT, type = ro;
DIRECTORY:load = DIR, type = ro;
If you leave out a line like
__DEFDIR__: type = import;
then you can create your own directory instead with whatever you want to put in the rom.
These "type = import" will drag in the cc65 compiler default code for various code segments.
So to create a BLL download compatible binary you can do this instead:
SYMBOLS {
__STACKSIZE__: type = weak, value = $0800; # 2k stack
__BLLHDR__: type = import;
}
MEMORY {
ZP: file = "", define = yes, start = $0000, size = $0100;
HEADER: file = %O, start = $0000, size = $000a;
RAM: file = %O, define = yes, start = $0400, size = $BC38 - __STACKSIZE__;
}
SEGMENTS {
BLLHDR: load = HEADER, type = ro;
The new compiler includes 3 built-in cfg files already:
- normal dual-buffered -C lynx-cfg
- collision detection + dual-buffered -C lynx-coll.cfg
- downloadable BLL binary -C lynx-bll.cfg
--
Karri
Edited by karri, Tue Mar 22, 2011 11:55 PM.













