OSDN Git Service

[VM][STATE] Use namespace {VMNAME} to separate per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / pasopia7 / iotrap.h
1 /*
2         TOSHIBA PASOPIA 7 Emulator 'EmuPIA7'
3
4         Author : Takeda.Toshiya
5         Date   : 2006.09.20 -
6
7         [ i/o trap ]
8 */
9
10 #ifndef _IOTRAP_H_
11 #define _IOTRAP_H_
12
13 #include "../vm.h"
14 #include "../../emu.h"
15 #include "../device.h"
16
17 #define SIG_IOTRAP_I8255_2_A    0
18 #define SIG_IOTRAP_I8255_2_C    1
19
20 namespace PASOPIA7 {
21
22 class IOTRAP : public DEVICE
23 {
24 private:
25         DEVICE *d_cpu, *d_pio2;
26         bool nmi_mask, pasopia;
27         
28 public:
29         IOTRAP(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
30         {
31                 set_device_name(_T("I/O Trap"));
32         }
33         ~IOTRAP() {}
34         
35         // common functions
36         void initialize();
37         void write_io8(uint32_t addr, uint32_t data);
38         uint32_t read_io8(uint32_t addr);
39         void write_signal(int id, uint32_t data, uint32_t mask);
40         bool process_state(FILEIO* state_fio, bool loading);
41         
42         // unique functions
43         void set_context_cpu(DEVICE* device)
44         {
45                 d_cpu = device;
46         }
47         void set_context_pio2(DEVICE* device)
48         {
49                 d_pio2 = device;
50         }
51         void do_reset();
52 };
53
54 }
55 #endif
56