-
Notifications
You must be signed in to change notification settings - Fork 0
/
MMC3.cfg
88 lines (63 loc) · 3.01 KB
/
MMC3.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# NOTE, this assumes you will keep the last bank fixed to c000-ffff, and swap only the first bank 8000-bfff
MEMORY {
#RAM Addresses:
# Zero page
ZP: start = $00, size = $100, type = rw, define = yes;
#note, the c compiler + neslib + famitone2 use about 60 zp addresses, I think
#note OAM: start = $0200, size = $0100, define = yes;
#note, sprites stored here in the RAM
RAM: start = $0300, size = $0400, define = yes;
#note, I located the c stack at 700-7ff, see below
WRAM: start = $6000, size = $2000, define = yes;
#INES Header:
HEADER: start = $0, size = $10, file = %O ,fill = yes;
#ROM Addresses:
PRG0: start = $8000, size = $2000, file = %O, fill = yes, define = yes;
PRG: start = $a000, size = $4000, file = %O ,fill = yes, define = yes;
PRGLAST: start = $e000, size = $2000, file = %O ,fill = yes, define = yes;
# make sure the reset code is in e000-ffff, see below
# ! 1 Banks of 8K CHR ROM
CHR: start = $0000, size = $2000, file = %O, fill = yes;
}
SEGMENTS {
HEADER: load = HEADER, type = ro;
# this needs to be in the fixed bank between e000 and ffff
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 = PRG0, type = ro, define = yes;
DATA: load = PRG, run = RAM, type = rw, define = yes;
CHARS: load = CHR, type = rw;
BSS: load = RAM, type = bss, define = yes;
HEAP: load = RAM, type = bss, optional = yes;
ZEROPAGE: load = ZP, type = zp;
ONCE: load = PRG, type = ro, define = yes;
XRAM: load = WRAM, type = bss, define = yes;
BANK0: load = PRG0, type = ro, define = yes;
STARTUP: load = PRGLAST, type = ro, define = yes;
# needs to be in the e000-ffff fixed bank
SAMPLES: load = PRG, start = $d500, type = ro;
VECTORS: load = PRGLAST, start = $fffa, type = ro;
}
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 = $0100; # 1 page stack
__STACK_START__: type = weak, value = $0700;
NES_MAPPER: type = weak, value = 4; # mapper number, 4 = mmc3, txrom
NES_PRG_BANKS: type = weak, value = 2; # number of 16K PRG banks, = 512k
NES_CHR_BANKS: type = weak, value = 1; # number of 8K CHR banks, = 8k
NES_MIRRORING: type = weak, value = 0; # 0 horizontal, 1 vertical, 8 four screen, mmc3 can switch mirroring
}