OSDN Git Service

[General] Convert sourcecode's CRLF format: DOS(WINDOWS) to Unix, to apply patches...
[csp-qt/common_source_project-fm7.git] / source / src / vm / phc25 / memory.h
1 /*
2         SANYO PHC-25 Emulator 'ePHC-25'
3         SEIKO MAP-1010 Emulator 'eMAP-1010'
4
5         Author : Takeda.Toshiya
6         Date   : 2010.08.03-
7
8         [ memory ]
9 */
10
11 #ifndef _MEMORY_H_
12 #define _MEMORY_H_
13
14 #include "../vm.h"
15 #include "../../emu.h"
16 #include "../device.h"
17
18 class MEMORY : public DEVICE
19 {
20 private:
21         DEVICE *d_kbd;
22         
23         uint8 rom[0x6000];
24 #ifdef _MAP1010
25         uint8 ram[0x8000];
26 #else
27         uint8 ram[0x4000];
28 #endif
29         uint8 vram[0x1800];
30         
31         uint8 wdmy[0x800];
32         uint8 rdmy[0x800];
33         uint8* wbank[32];
34         uint8* rbank[32];
35         
36 public:
37         MEMORY(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}
38         ~MEMORY() {}
39         
40         // common functions
41         void initialize();
42         void reset();
43         void write_data8(uint32 addr, uint32 data);
44         uint32 read_data8(uint32 addr);
45         void save_state(FILEIO* state_fio);
46         bool load_state(FILEIO* state_fio);
47         
48         // unique functions
49         void set_context_keyboard(DEVICE* device)
50         {
51                 d_kbd = device;
52         }
53         uint8* get_vram()
54         {
55                 return vram;
56         }
57 };
58
59 #endif
60