]> git.sur5r.net Git - cc65/blob - src/ld65/cfg/nes.cfg
- No more HEAP segment
[cc65] / src / ld65 / cfg / nes.cfg
1 SYMBOLS {
2     __STACKSIZE__: value = $0300, weak = yes; # 3 pages stack
3 }
4 MEMORY {
5     ZP:     start = $0002, size = $001A, type = rw, define = yes;
6
7     # INES Cartridge Header
8     HEADER: start = $0000, size = $0010, file = %O, fill = yes;
9
10     # 2 16K ROM Banks
11     # - startup
12     # - code
13     # - rodata
14     # - data (load)
15     ROM0:   start = $8000, size = $7FF4, file = %O, fill = yes, define = yes;
16
17     # Hardware Vectors at End of 2nd 8K ROM
18     ROMV:   start = $FFF6, size = $000C, file = %O, fill = yes;
19
20     # 1 8k CHR Bank
21     ROM2:   start = $0000, size = $2000, file = %O, fill = yes;
22
23     # standard 2k SRAM (-zeropage)
24     # $0100-$0200 cpu stack
25     # $0200-$0500 3 pages for ppu memory write buffer
26     # $0500-$0800 3 pages for cc65 parameter stack
27     SRAM:   start = $0500, size = __STACKSIZE__, define = yes;
28
29     # additional 8K SRAM Bank
30     # - data (run)
31     # - bss
32     # - heap
33     RAM: start = $6000, size = $2000, define = yes;
34 }
35 SEGMENTS {
36     HEADER:   load = HEADER,          type = ro;
37     STARTUP:  load = ROM0,            type = ro,  define = yes;
38     LOWCODE:  load = ROM0,            type = ro,                optional = yes;
39     INIT:     load = ROM0,            type = ro,  define = yes, optional = yes;
40     CODE:     load = ROM0,            type = ro,  define = yes;
41     RODATA:   load = ROM0,            type = ro,  define = yes;
42     DATA:     load = ROM0, run = RAM, type = rw,  define = yes;
43     VECTORS:  load = ROMV,            type = rw;
44     CHARS:    load = ROM2,            type = rw;
45     BSS:      load = RAM,             type = bss, define = yes;
46     ZEROPAGE: load = ZP,              type = zp;
47 }
48 FEATURES {
49     CONDES: segment = INIT,
50             type    = constructor,
51             label   = __CONSTRUCTOR_TABLE__,
52             count   = __CONSTRUCTOR_COUNT__;
53     CONDES: segment = RODATA,
54             type    = destructor,
55             label   = __DESTRUCTOR_TABLE__,
56             count   = __DESTRUCTOR_COUNT__;
57     CONDES: segment = RODATA,
58             type    = interruptor,
59             label   = __INTERRUPTOR_TABLE__,
60             count   = __INTERRUPTOR_COUNT__;
61 }