OSDN Git Service

98465c1d3a86efaa3212a2390926014d6d94ea64
[csp-qt/common_source_project-fm7.git] / source / src / vm / tk80bs / membus.h
1 /*
2         NEC TK-80BS (COMPO BS/80) Emulator 'eTK-80BS'
3         NEC TK-80 Emulator 'eTK-80'
4         NEC TK-85 Emulator 'eTK-85'
5
6         Author : Takeda.Toshiya
7         Date   : 2017.01.13-
8
9         [ memory bus ]
10 */
11
12 #ifndef _MEMBUS_H_
13 #define _MEMBUS_H_
14
15 #include "../memory.h"
16
17 #if defined(_TK85)
18 #define SIG_MEMBUS_PC7  0
19 #endif
20
21 //class csp_state_utils;
22
23 class MEMBUS : public MEMORY
24 {
25 private:
26         DEVICE *d_cpu;
27
28 //      csp_state_utils *state_entry;
29
30 #if defined(_TK85)
31         uint32_t pc7, count;
32 #endif
33         
34 public:
35         MEMBUS(VM_TEMPLATE* parent_vm, EMU* parent_emu) : MEMORY(parent_vm, parent_emu)
36         {
37                 set_device_name(_T("Memory Bus"));
38         }
39         ~MEMBUS() {}
40         
41         // common functions
42         void reset();
43         uint32_t fetch_op(uint32_t addr, int *wait);
44 #if defined(_TK85)
45         void write_signal(int id, uint32_t data, uint32_t mask);
46 #endif
47         void decl_state();
48         void save_state(FILEIO* state_fio);
49         bool load_state(FILEIO* state_fio);
50         
51         // unique function
52         void set_context_cpu(DEVICE* device)
53         {
54                 d_cpu = device;
55         }
56 };
57
58 #endif