OSDN Git Service

588f4ceef2724f958d061ce982c9696b9e2fdf93
[csp-qt/common_source_project-fm7.git] / source / src / vm / pc9801 / cpureg.h
1 /*
2         NEC PC-9801VX Emulator 'ePC-9801VX'
3         NEC PC-9801RA Emulator 'ePC-9801RA'
4         NEC PC-98XA Emulator 'ePC-98XA'
5         NEC PC-98XL Emulator 'ePC-98XL'
6         NEC PC-98RL Emulator 'ePC-98RL'
7
8         Author : Takeda.Toshiya
9         Date   : 2017.06.25-
10
11         [ cpu regs ]
12 */
13
14 #ifndef _CPUREG_H_
15 #define _CPUREG_H_
16
17 #include "../vm.h"
18 #include "../../emu.h"
19 #include "../device.h"
20
21 #if defined(SUPPORT_32BIT_ADDRESS)
22 class I386;
23 #else
24 class I286;
25 #endif
26
27 class CPUREG : public DEVICE
28 {
29 private:
30 #if defined(SUPPORT_32BIT_ADDRESS)
31         I386 *d_cpu;
32 #else
33         I286 *d_cpu;
34 #endif
35         bool nmi_enabled;
36         
37 public:
38         CPUREG(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
39         {
40                 set_device_name(_T("CPU I/O"));
41         }
42         ~CPUREG() {}
43         
44         // common functions
45         void reset();
46         void write_io8(uint32_t addr, uint32_t data);
47         uint32_t read_io8(uint32_t addr);
48         void decl_state();
49         void save_state(FILEIO* state_fio);
50         bool load_state(FILEIO* state_fio);
51         
52         // unique function
53 #if defined(SUPPORT_32BIT_ADDRESS)
54         void set_context_cpu(I386* device)
55 #else
56         void set_context_cpu(I286* device)
57 #endif
58         {
59                 d_cpu = device;
60         }
61 };
62
63 #endif
64