OSDN Git Service

e72620f519559f8bcb260e00e220262f0ef0be85
[csp-qt/common_source_project-fm7.git] / source / src / vm / mz2800 / serial.h
1 /*
2         SHARP MZ-2800 Emulator 'EmuZ-2800'
3
4         Author : Takeda.Toshiya
5         Date   : 2015.01.17 -
6
7         [ serial ]
8 */
9
10 #ifndef _SERIAL_H_
11 #define _SERIAL_H_
12
13 #include "../vm.h"
14 #include "../../emu.h"
15 #include "../device.h"
16
17 class Z80SIO;
18
19 class SERIAL : public DEVICE
20 {
21 private:
22         Z80SIO* d_sio;
23         bool addr_a0;
24         
25 public:
26         SERIAL(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
27         {
28                 set_device_name(_T("Serial I/F"));
29         }
30         ~SERIAL() {}
31         
32         // common functions
33         void reset();
34         void write_io8(uint32_t addr, uint32_t data);
35         uint32_t read_io8(uint32_t addr);
36         bool process_state(FILEIO* state_fio, bool loading);
37         
38         // unique functions
39         void set_context_sio(Z80SIO* device)
40         {
41                 d_sio = device;
42         }
43 };
44
45 #endif
46