-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathcartridge.h
59 lines (45 loc) · 1.14 KB
/
cartridge.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
#ifndef CARTRIDGE_H_
#define CARTRIDGE_H_
#include "types.h"
#ifdef __cplusplus
extern "C"
{
#endif
typedef enum{
EGB,
EGBC,
ESGB
}GBMODE;
typedef struct {
uint8 index;
char * Name;
}Cart_mode;
typedef struct {
uint8 index;
char * Name;
int nbanks;
}Cart_size_mode;
typedef struct _Cartridge
{
uint8 * gbcart;
char name[17];
int SGB,GBC;
Cart_mode type;
Cart_size_mode size;
int ramsize;
int rombank,rambank,mbc1mode,mbc3rtc;
} Cartridge;
int read_cart_file(const char * name,Cartridge * cart);
void destroy_cart_file(Cartridge * cart);
void parse_cart_Header(GBMODE mode,Cartridge * cart);
void parse_cart_Name(GBMODE mode,Cartridge * cart);
void parse_cart_SGBCapable(Cartridge * cart);
void parse_cart_GBCCapable(Cartridge * cart);
void parse_cart_type(Cartridge * cart);
void parse_cart_size(Cartridge * cart);
void parse_cart_ramsize(Cartridge * cart);
void parse_cart_unimportant(Cartridge * cart);
#ifdef __cplusplus
}
#endif
#endif /*CARTRIDGE_H_*/