Those are mine. They work, but as mentioned, there's a lot of "personal preference" stuff going on.
unrom:
Code:
MEMORY {
# Zero page
ZP: start = $00, size = $100, type = rw, define = yes;
# INES Cartridge Header
HEADER: start = $0, size = $10, file = %O ,fill = yes;
# UNROM 64K
PRG0: start = $8000, size = $4000, file = %O, fill = yes, define = yes;
PRG1: start = $8000, size = $4000, file = %O, fill = yes, define = yes;
PRG2: start = $8000, size = $4000, file = %O, fill = yes, define = yes;
PRG3: start = $C000, size = $3ffa, file = %O, fill = yes, define = yes;
VECTORS: start = $fffa, size = $6, file = %O, fill = yes;
# standard 2K SRAM (-zeropage)
# $0100 famitone, palette, cpu stack
# $0200 oam buffer
# $0300..$800 ca65 stack
RAM: start = $0300, size = $0500, define = yes;
}
SEGMENTS {
HEADER: load = HEADER, type = ro;
ROM0: load = PRG0, type = ro, define = yes;
ROM1: load = PRG1, type = ro, define = yes;
ROM2: load = PRG2, type = ro, define = yes;
STARTUP: load = PRG3, type = ro, define = yes;
LOWCODE: load = PRG3, type = ro, optional = yes;
INIT: load = PRG3, type = ro, define = yes, optional = yes;
DATA: load = PRG3, run = RAM, type = rw, define = yes;
RODATA: load = PRG3, type = ro, define = yes;
CODE: load = PRG3, type = ro, define = yes;
VECTORS: load = VECTORS, type = rw;
BSS: load = RAM, type = bss, define = yes;
HEAP: load = RAM, type = bss, optional = yes;
ZEROPAGE: load = ZP, type = zp;
}
FEATURES {
CONDES: segment = INIT,
type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__;
CONDES: segment = RODATA,
type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__;
CONDES: type = interruptor,
segment = RODATA,
label = __INTERRUPTOR_TABLE__,
count = __INTERRUPTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__: type = weak, value = $0500; # 5 pages stack
}
Tkrom
Code:
MEMORY {
# Zero page
ZP: start = $00, size = $100, type = rw, define = yes;
# INES Cartridge Header
HEADER: start = $0, size = $10, file = %O ,fill = yes;
# TKROM 256K
# PRG0: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
# PRG1: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
# Trick: I need to work with PRG0 + PRG1 together for this game.
PRG0001: start = $8000, size = $4000, file = %O, fill = yes, define = yes;
# I'm going to use these for data. Four is enough
PRG02: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG03: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG04: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG05: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
# Next four, for code, which comes handy to share existence with data, so
PRG06: start = $a000, size = $2000, file = %O, fill = yes, define = yes;
PRG07: start = $a000, size = $2000, file = %O, fill = yes, define = yes;
PRG08: start = $a000, size = $2000, file = %O, fill = yes, define = yes;
PRG09: start = $a000, size = $2000, file = %O, fill = yes, define = yes;
# I'm not going to use these and/or don't care
PRG0A: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG0B: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG0C: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG0D: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG0E: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG0F: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG10: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG11: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG12: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG13: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG14: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG15: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG16: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG17: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG18: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG19: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG1A: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG1B: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG1C: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG1D: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
# PRG1E and PRG1F go together.
# This is not guaranteed at startup, but I will enforce it via sorcery.
PRG1E1F: start = $c000, size = $3fc0, file = %O, fill = yes, define = yes;
# Here I will enforce 8K+8K+Fixed 16K scheme on startup
# And will page in 0 1 1e 1f
SETUP: start = $ffc0, size = $3a, file = %O, fill = yes;
VECTORS: start = $fffa, size = $6, file = %O, fill = yes;
# 1 8K CHR Bank
CHR: start = $0000, size = $20000, file = %O, fill = yes;
# Extra 8K RAM
RAM: start = $6000, size = $2000, define = yes;
}
SEGMENTS {
HEADER: load = HEADER, type = ro;
ROM0001: load = PRG0001, type = ro, define = yes;
ROM02: load = PRG02, type = ro, define = yes;
ROM03: load = PRG03, type = ro, define = yes;
ROM04: load = PRG04, type = ro, define = yes;
ROM05: load = PRG05, type = ro, define = yes;
ROM06: load = PRG06, type = ro, define = yes;
ROM07: load = PRG07, type = ro, define = yes;
ROM08: load = PRG08, type = ro, define = yes;
ROM09: load = PRG09, type = ro, define = yes;
ROM0A: load = PRG0A, type = ro, define = yes;
ROM0B: load = PRG0B, type = ro, define = yes;
ROM0C: load = PRG0C, type = ro, define = yes;
ROM0D: load = PRG0D, type = ro, define = yes;
ROM0E: load = PRG0E, type = ro, define = yes;
ROM0F: load = PRG0F, type = ro, define = yes;
ROM10: load = PRG10, type = ro, define = yes;
ROM11: load = PRG11, type = ro, define = yes;
ROM12: load = PRG12, type = ro, define = yes;
ROM13: load = PRG13, type = ro, define = yes;
ROM14: load = PRG14, type = ro, define = yes;
ROM15: load = PRG15, type = ro, define = yes;
ROM16: load = PRG16, type = ro, define = yes;
ROM17: load = PRG17, type = ro, define = yes;
ROM18: load = PRG18, type = ro, define = yes;
ROM19: load = PRG19, type = ro, define = yes;
ROM1A: load = PRG1A, type = ro, define = yes;
ROM1B: load = PRG1B, type = ro, define = yes;
ROM1C: load = PRG1C, type = ro, define = yes;
ROM1D: load = PRG1D, type = ro, define = yes;
STARTUP: load = PRG1E1F, type = ro, define = yes;
LOWCODE: load = PRG1E1F, type = ro, optional = yes;
INIT: load = PRG1E1F, type = ro, define = yes, optional = yes;
DATA: load = PRG1E1F, run = RAM, type = rw, define = yes;
RODATA: load = PRG1E1F, type = ro, define = yes;
CODE: load = PRG1E1F, type = ro, define = yes;
SETUP: load = SETUP, type = ro, define = yes;
VECTORS: load = VECTORS, type = rw;
CHARS: load = CHR, type = rw;
BSS: load = RAM, type = bss, define = yes;
HEAP: load = RAM, type = bss, optional = yes;
ZEROPAGE: load = ZP, type = zp;
}
FEATURES {
CONDES: segment = INIT,
type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__;
CONDES: segment = RODATA,
type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__;
CONDES: type = interruptor,
segment = RODATA,
label = __INTERRUPTOR_TABLE__,
count = __INTERRUPTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__: type = weak, value = $0500; # 5 pages stack
}