OSDN Git Service

1ecc5a69f649c7240dfe16c74914efecc55a0940
[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 class N5200_MEMORY : public DEVICE
18 {
19 private:
20         uint8_t* rbank[8192];   // 16MB / 2KB
21         uint8_t* wbank[8192];
22         uint8_t wdmy[0x800];
23         uint8_t rdmy[0x800];
24         
25         uint8_t ram[0xc0000];           // RAM 768KB
26         uint8_t exram[0x100000];                // Ext RAM 1MB
27         uint8_t vram[0x60000];          // VRAM 384KB ???
28         uint8_t tvram[0x7800];          // TVRAM 32KB ???
29         uint8_t backup[0x8200];         // Battery BackUp 32KB ???
30         uint8_t ipl[0x10000];           // IPL 64KB
31         
32         bool protect;
33         
34 public:
35         N5200_MEMORY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
36         {
37                 set_device_name(_T("Memory Bus"));
38         }
39         ~N5200_MEMORY() {}
40         
41         // common functions
42         void initialize();
43         void release();
44         void reset();
45         void write_data8(uint32_t addr, uint32_t data);
46         uint32_t read_data8(uint32_t addr);
47         void write_io8(uint32_t addr, uint32_t data);
48         uint32_t read_io8(uint32_t addr);
49         
50         // unique functions
51         uint8_t* get_vram()
52         {
53                 return vram;
54         }
55         uint8_t* get_tvram()
56         {
57                 return tvram;
58         }
59 };
60
61 #endif
62