OSDN Git Service

[VM][STATE] Use namespace {VMNAME} to separate per VMs.
[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 namespace MZ2800 {
20
21 class SERIAL : public DEVICE
22 {
23 private:
24         Z80SIO* d_sio;
25         bool addr_a0;
26         
27 public:
28         SERIAL(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
29         {
30                 set_device_name(_T("Serial I/F"));
31         }
32         ~SERIAL() {}
33         
34         // common functions
35         void reset();
36         void write_io8(uint32_t addr, uint32_t data);
37         uint32_t read_io8(uint32_t addr);
38         bool process_state(FILEIO* state_fio, bool loading);
39         
40         // unique functions
41         void set_context_sio(Z80SIO* device)
42         {
43                 d_sio = device;
44         }
45 };
46
47 }
48 #endif
49