-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCartridge.ZC
executable file
·112 lines (112 loc) · 2.47 KB
/
Cartridge.ZC
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
U0 initCart() {
I64 cartridgeType=ROM[0x147];
switch (cartridgeType) {
case 0x00:
//ROM w/o bank switching
if (overrideMBC1) {
break;
};
// no break
case 0x01:
cMBC1 = TRUE;
break;
case 0x02:
cMBC1 = TRUE;
cSRAM = TRUE;
break;
case 0x03:
cMBC1 = TRUE;
cSRAM = TRUE;
cBATT = TRUE;
break;
case 0x05:
cMBC2 = TRUE;
break;
case 0x06:
cMBC2 = TRUE;
cBATT = TRUE;
break;
case 0x08:
cSRAM = TRUE;
break;
case 0x09:
cSRAM = TRUE;
cBATT = TRUE;
break;
case 0x0B:
cMMMO1 = TRUE;
break;
case 0x0C:
cMMMO1 = TRUE;
cSRAM = TRUE;
break;
case 0x0D:
cMMMO1 = TRUE;
cSRAM = TRUE;
cBATT = TRUE;
break;
case 0x0F:
cMBC3 = TRUE;
cTIMER = TRUE;
cBATT = TRUE;
break;
case 0x10:
cMBC3 = TRUE;
cTIMER = TRUE;
cBATT = TRUE;
cSRAM = TRUE;
break;
case 0x11:
cMBC3 = TRUE;
break;
case 0x12:
cMBC3 = TRUE;
cSRAM = TRUE;
break;
case 0x13:
cMBC3 = TRUE;
cSRAM = TRUE;
cBATT = TRUE;
break;
case 0x19:
cMBC5 = TRUE;
break;
case 0x1A:
cMBC5 = TRUE;
cSRAM = TRUE;
break;
case 0x1B:
cMBC5 = TRUE;
cSRAM = TRUE;
cBATT = TRUE;
break;
case 0x1C:
cRUMBLE = TRUE;
break;
case 0x1D:
cRUMBLE = TRUE;
cSRAM = TRUE;
break;
case 0x1E:
cRUMBLE = TRUE;
cSRAM = TRUE;
cBATT = TRUE;
break;
case 0x1F:
cCamera = TRUE;
break;
case 0xFD:
cTAMA5 = TRUE;
break;
case 0xFE:
cHuC3 = TRUE;
break;
case 0xFF:
cHuC1 = TRUE;
break;
default:
"Cartridge type is unknown.\n";
PressAKey;
break;
};
}