OSDN Git Service

[General] Merge from upstream version, 2015-01-28.
[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* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}
25         ~SYSPORT() {}
26         
27         // common functions
28         void initialize();
29         void write_io8(uint32 addr, uint32 data);
30         uint32 read_io8(uint32 addr);
31         void event_frame();
32         void save_state(FILEIO* state_fio);
33         bool load_state(FILEIO* state_fio);
34         
35         // unique functions
36         void set_context_fdc(DEVICE* device)
37         {
38                 d_fdc = device;
39         }
40         void set_context_ctc(DEVICE* device)
41         {
42                 d_ctc = device;
43         }
44         void set_context_sio(DEVICE* device)
45         {
46                 d_sio = device;
47         }
48         void nmi_reset()
49         {
50                 rst = 20;
51         }
52 };
53
54 #endif
55