]> git.sur5r.net Git - cc65/blob - src/ld65/cfg/nes.cfg
Added the new INIT segment to all configs and adjusted formatting.
[cc65] / src / ld65 / cfg / nes.cfg
1 MEMORY {
2
3     ZP:  start = $02, size = $1A, type = rw, define = yes;
4
5     # INES Cartridge Header
6     HEADER: start = $0, size = $10, file = %O ,fill = yes;
7
8     # 2 16K ROM Banks
9     # - startup
10     # - code
11     # - rodata
12     # - data (load)
13     ROM0: start = $8000, size = $7ff4, file = %O ,fill = yes, define = yes;
14
15     # Hardware Vectors at End of 2nd 8K ROM
16     ROMV: start = $fff6, size = $c, file = %O, fill = yes;
17
18     # 1 8k CHR Bank
19     ROM2: start = $0000, size = $2000, file = %O, fill = yes;
20
21     # standard 2k SRAM (-zeropage)
22     # $0100-$0200 cpu stack
23     # $0200-$0500 3 pages for ppu memory write buffer
24     # $0500-$0800 3 pages for cc65 parameter stack
25     SRAM: start = $0500, size = $0300, define = yes;
26
27     # additional 8K SRAM Bank
28     # - data (run)
29     # - bss
30     # - heap
31     RAM: start = $6000, size = $2000, define = yes;
32
33 }
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
49 FEATURES {
50     CONDES: segment = RODATA,
51             type = constructor,
52             label = __CONSTRUCTOR_TABLE__,
53             count = __CONSTRUCTOR_COUNT__;
54     CONDES: segment = RODATA,
55             type = destructor,
56             label = __DESTRUCTOR_TABLE__,
57             count = __DESTRUCTOR_COUNT__;
58 }
59
60 SYMBOLS {
61     __STACKSIZE__ = $0300;      # 3 pages stack
62 }