OSDN Git Service

f363010b82c3469ac2297004ee9b43fe4e6cb2d6
[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         void decl_state();
36         void save_state(FILEIO* state_fio);
37         bool load_state(FILEIO* state_fio);
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 #endif
59