-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmc.h
101 lines (90 loc) · 1.38 KB
/
smc.h
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
/*
* smc.h
* smcdis
*
* Created by Alexander Strange on 12/21/07.
*
*/
#ifndef __SMC_H__
#define __SMC_H__
#include <stdint.h>
enum rom_type {
LoROM = 0,
HiROM,
ExLoROM,
ExHiROM,
BSCLoROM,
BSCHiROM
};
enum coprocessor_type {
DSP = 1,
SuperFX,
OBC1,
SA1,
UnknownCPU,
Custom = 0xF
};
struct snes_interrupt
{
uint16_t cop;
uint16_t brk;
uint16_t abort;
uint16_t vbl;
uint16_t main; // 0xFFFC
uint16_t irq;
};
struct snes_rom_header
{
uint8_t company1;
char game_code[4];
char zero_fill[7];
uint8_t expansion_ram;
uint8_t special_version;
uint8_t subcartridge;
char rom_name[21];
uint8_t map_mode;
uint8_t cart_type;
uint8_t rom_size;
uint8_t sram_size;
uint8_t region;
uint8_t company2;
uint8_t version;
uint16_t ichecksum;
uint16_t checksum; // 0xFFDE
snes_interrupt norm_exc, emu_exc;
};
struct snes_rom_info
{
rom_type type;
bool interleaved;
coprocessor_type coprocessor;
uint8_t company;
uint8_t dsp_ver;
uint8_t rom_mbit;
uint8_t eram_kbit;
uint8_t sram_kbit;
uint8_t map_mode;
bool ram;
bool battery;
bool fastrom;
bool hirom;
};
struct swc_header
{
uint16_t size;
uint8_t mode_select;
uint8_t byte3;
uint16_t magic;
uint8_t code;
bool mode, multi, sram, dram;
uint8_t sram_size;
};
struct fig_header
{
uint16_t size;
uint8_t multi;
uint8_t hirom;
uint8_t ex1; // 0xFD or 0x47 or 0x77
uint8_t ex2; // 0x82 or 0x83
};
#endif