OSDN Git Service

[VM][STATE] Use namespace {VMNAME} to separate per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / mz5500 / sysport.h
1 /*
2         SHARP MZ-5500 Emulator 'EmuZ-5500'
3
4         Author : Takeda.Toshiya
5         Date   : 2008.04.10 -
6
7         [ system port ]
8 */
9
10 #ifndef _SYSPORT_H_
11 #define _SYSPORT_H_
12
13 #include "../vm.h"
14 #include "../../emu.h"
15 #include "../device.h"
16
17 namespace MZ5500 {
18
19 class SYSPORT : public DEVICE
20 {
21 private:
22         DEVICE *d_fdc, *d_ctc, *d_sio;
23         int rst, highden;
24         
25 public:
26         SYSPORT(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
27         {
28                 set_device_name(_T("System I/O"));
29         }
30         ~SYSPORT() {}
31         
32         // common functions
33         void initialize();
34         void write_io8(uint32_t addr, uint32_t data);
35         uint32_t read_io8(uint32_t addr);
36         void event_frame();
37         bool process_state(FILEIO* state_fio, bool loading);
38         
39         // unique functions
40         void set_context_fdc(DEVICE* device)
41         {
42                 d_fdc = device;
43         }
44         void set_context_ctc(DEVICE* device)
45         {
46                 d_ctc = device;
47         }
48         void set_context_sio(DEVICE* device)
49         {
50                 d_sio = device;
51         }
52         void nmi_reset()
53         {
54                 rst = 20;
55         }
56 };
57
58 }
59 #endif
60