1 /*  gngb, a game boy color emulator
2  *  Copyright (C) 2001 Peponas Thomas & Peponas Mathieu
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU Library General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18 
19 
20 #ifndef _ROM_H
21 #define _ROM_H
22 
23 #include "global.h"
24 #include <stdlib.h>
25 
26 /* rom type definition */
27 #define UNKNOW_TYPE    0x00
28 #define ROM_ONLY       0x01
29 #define MBC1           0x02
30 #define MBC2           0x04
31 #define MBC3           0x08
32 #define MBC5           0x10
33 #define RAM            0x20
34 #define BATTERY        0x40
35 #define TIMER          0x80
36 #define RUMBLE         0x100
37 #define SRAM           0x200
38 #define HUC1           0x400
39 
40 extern char *rom_name;
41 extern Sint16 rom_type;
42 
43 //  rom_gb_suport
44 
45 extern Uint8 rom_gb_type;
46 
47 typedef struct {
48   Uint16 cycle;
49   Uint8 reg_sel;
50   Uint8 latch;
51   Uint8 reg[5];
52   Uint8 regl[5];   // register locked
53 }ROM_TIMER; // MBC3
54 
55 extern ROM_TIMER *rom_timer;
56 
57 int open_rom(char *filename);
58 
59 #endif
60 
61 
62 
63 
64