OSDN Git Service

[General] Tracking to upstream, rev 2015-01-14.
[csp-qt/common_source_project-fm7.git] / source / src / vm / sc3000 / memory.h
1 /*\r
2         SEGA SC-3000 Emulator 'eSC-3000'\r
3 \r
4         Author : Takeda.Toshiya\r
5         Date   : 2010.08.17-\r
6 \r
7         [ memory ]\r
8 */\r
9 \r
10 #ifndef _MEMORY_H_\r
11 #define _MEMORY_H_\r
12 \r
13 #include "../vm.h"\r
14 #include "../../emu.h"\r
15 #include "../device.h"\r
16 \r
17 #define SIG_MEMORY_SEL  0\r
18 \r
19 class MEMORY : public DEVICE\r
20 {\r
21 private:\r
22         // memory\r
23         uint8 cart[0x8000];\r
24         uint8 ipl[0x2000];      // sf7000\r
25         uint8 ram[0x10000];\r
26         \r
27         uint8 wdmy[0x1000];\r
28         uint8 rdmy[0x1000];\r
29         uint8* wbank[16];\r
30         uint8* rbank[16];\r
31         \r
32         bool inserted;\r
33         bool ram_selected;\r
34         \r
35 public:\r
36         MEMORY(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}\r
37         ~MEMORY() {}\r
38         \r
39         // common functions\r
40         void initialize();\r
41         void write_data8(uint32 addr, uint32 data);\r
42         uint32 read_data8(uint32 addr);\r
43         void write_signal(int id, uint32 data, uint32 mask);\r
44         void save_state(FILEIO* state_fio);\r
45         bool load_state(FILEIO* state_fio);\r
46         \r
47         // unique functions\r
48         void open_cart(_TCHAR* file_path);\r
49         void close_cart();\r
50         bool cart_inserted()\r
51         {\r
52                 return inserted;\r
53         }\r
54 };\r
55 \r
56 #endif\r
57 \r