OSDN Git Service

[VM][WIP] Use namespace to devices per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / hc80 / memory.h
1 /*
2         EPSON HC-80 Emulator 'eHC-80'
3
4         Author : Takeda.Toshiya
5         Date   : 2008.03.14 -
6
7         [ memory ]
8 */
9
10 #ifndef _HC80_MEMORY_H_
11 #define _HC80_MEMORY_H_
12
13 #include "../vm.h"
14 #include "../../emu.h"
15 #include "../device.h"
16
17 namespace HC80 {
18
19 class MEMORY : public DEVICE
20 {
21 private:
22         // memory
23         uint8_t ram[0x10000];
24         uint8_t sys[0x8000];
25         
26         uint8_t wdmy[0x2000];
27         uint8_t rdmy[0x2000];
28         uint8_t* wbank[8];
29         uint8_t* rbank[8];
30         uint8_t bank;
31         
32         void set_bank(uint32_t val);
33         
34 public:
35         MEMORY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
36         {
37                 set_device_name(_T("Memory Bus"));
38         }
39         ~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_signal(int id, uint32_t data, uint32_t mask);
48         bool process_state(FILEIO* state_fio, bool loading);
49 };
50
51 }
52 #endif
53