OSDN Git Service

d927494e775575ae1e1b5372cf397a35d5ac41df
[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 class IOTRAP : public DEVICE
21 {
22 private:
23         DEVICE *d_cpu, *d_pio2;
24         bool nmi_mask, pasopia;
25         
26 public:
27         IOTRAP(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
28         {
29                 set_device_name(_T("I/O Trap"));
30         }
31         ~IOTRAP() {}
32         
33         // common functions
34         void initialize();
35         void write_io8(uint32_t addr, uint32_t data);
36         uint32_t read_io8(uint32_t addr);
37         void write_signal(int id, uint32_t data, uint32_t mask);
38         bool process_state(FILEIO* state_fio, bool loading);
39         
40         // unique functions
41         void set_context_cpu(DEVICE* device)
42         {
43                 d_cpu = device;
44         }
45         void set_context_pio2(DEVICE* device)
46         {
47                 d_pio2 = device;
48         }
49         void do_reset();
50 };
51
52 #endif
53