OSDN Git Service

[VM][STATE] Apply new framework to some 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 class SYSPORT : public DEVICE
18 {
19 private:
20         DEVICE *d_fdc, *d_ctc, *d_sio;
21         int rst, highden;
22         
23 public:
24         SYSPORT(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
25         {
26                 set_device_name(_T("System I/O"));
27         }
28         ~SYSPORT() {}
29         
30         // common functions
31         void initialize();
32         void write_io8(uint32_t addr, uint32_t data);
33         uint32_t read_io8(uint32_t addr);
34         void event_frame();
35         bool process_state(FILEIO* state_fio, bool loading);
36         
37         // unique functions
38         void set_context_fdc(DEVICE* device)
39         {
40                 d_fdc = device;
41         }
42         void set_context_ctc(DEVICE* device)
43         {
44                 d_ctc = device;
45         }
46         void set_context_sio(DEVICE* device)
47         {
48                 d_sio = device;
49         }
50         void nmi_reset()
51         {
52                 rst = 20;
53         }
54 };
55
56 #endif
57