MEMORY { # First 28 bytes of the zero page are used by NES library ZP: start = $28, size = $d8, type = rw, define = yes; # INES Cartridge Header HEADER: start = $0, size = $10, file = %O ,fill = yes; # 3 16K ROM Banks with first 2K being unusable # - startup # - code # - rodata # - data (load) PAD: start = $4000, size = $0800, file = %O ,fill = yes, define = yes; PRG: start = $4800, size = $b7f0, file = %O ,fill = yes, define = yes; # DPCM Samples at end of the ROM DMC: start = $fff0, size = $0a, file = %O, fill = yes; # Hardware Vectors at end of the ROM VECTORS: start = $fffa, size = $6, file = %O, fill = yes; # 1 8K CHR Bank CHR: start = $0000, size = $2000, 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; PADDING: load = PAD, type = ro; STARTUP: load = PRG, type = ro, define = yes; LOWCODE: load = PRG, type = ro, optional = yes; INIT: load = PRG, type = ro, define = yes, optional = yes; CODE: load = PRG, type = ro, define = yes; RODATA: load = PRG, type = ro, define = yes; DATA: load = PRG, run = RAM, type = rw, define = yes; SAMPLES: load = DMC, type = rw; 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__ = $0500; # 5 pages stack }