OSDN Git Service

[INITIAL] Import 20141226 version of http://homepage3.nifty.com/takeda-toshiya/common...
[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         \r
34 public:\r
35         MEMORY(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}\r
36         ~MEMORY() {}\r
37         \r
38         // common functions\r
39         void initialize();\r
40         void write_data8(uint32 addr, uint32 data);\r
41         uint32 read_data8(uint32 addr);\r
42         void write_signal(int id, uint32 data, uint32 mask);\r
43         \r
44         // unique functions\r
45         void open_cart(_TCHAR* file_path);\r
46         void close_cart();\r
47         bool cart_inserted()\r
48         {\r
49                 return inserted;\r
50         }\r
51 };\r
52 \r
53 #endif\r
54 \r