OSDN Git Service

[VM] Apply VM_TEMPLATE to all VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / mz2500 / serial.h
1 /*
2         SHARP MZ-2500 Emulator 'EmuZ-2500'
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         void decl_state();
37         void save_state(FILEIO* state_fio);
38         bool load_state(FILEIO* state_fio);
39         
40         // unique functions
41         void set_context_sio(Z80SIO* device)
42         {
43                 d_sio = device;
44         }
45 };
46
47 #endif
48