OSDN Git Service

[VM][STATE] Use namespace {VMNAME} to separate per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / n5200 / memory.h
1 /*
2         NEC N5200 Emulator 'eN5200'
3
4         Author : Takeda.Toshiya
5         Date   : 2009.06.03-
6
7         [ memory ]
8 */
9
10 #ifndef _N5200_MEMORY_H_
11 #define _N5200_MEMORY_H_
12
13 #include "../vm.h"
14 #include "../../emu.h"
15 #include "../device.h"
16
17 namespace N5200 {
18
19 class MEMORY : public DEVICE
20 {
21 private:
22         uint8_t* rbank[8192];   // 16MB / 2KB
23         uint8_t* wbank[8192];
24         uint8_t wdmy[0x800];
25         uint8_t rdmy[0x800];
26         
27         uint8_t ram[0xc0000];           // RAM 768KB
28         uint8_t exram[0x100000];                // Ext RAM 1MB
29         uint8_t vram[0x60000];          // VRAM 384KB ???
30         uint8_t tvram[0x7800];          // TVRAM 32KB ???
31         uint8_t backup[0x8200];         // Battery BackUp 32KB ???
32         uint8_t ipl[0x10000];           // IPL 64KB
33         
34         bool protect;
35         
36 public:
37         MEMORY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
38         {
39                 set_device_name(_T("Memory Bus"));
40         }
41         ~MEMORY() {}
42         
43         // common functions
44         void initialize();
45         void release();
46         void reset();
47         void write_data8(uint32_t addr, uint32_t data);
48         uint32_t read_data8(uint32_t addr);
49         void write_io8(uint32_t addr, uint32_t data);
50         uint32_t read_io8(uint32_t addr);
51         
52         // unique functions
53         uint8_t* get_vram()
54         {
55                 return vram;
56         }
57         uint8_t* get_tvram()
58         {
59                 return tvram;
60         }
61 };
62
63 }
64 #endif
65