OSDN Git Service

eaca08d965e1abe5537ce66a9713ed98840e9c29
[csp-qt/common_source_project-fm7.git] / source / src / vm / pc9801 / sasi.h
1 /*
2         NEC PC-9801VX Emulator 'ePC-9801VX'
3         NEC PC-9801RA Emulator 'ePC-9801RA'
4         NEC PC-98XA Emulator 'ePC-98XA'
5         NEC PC-98XL Emulator 'ePC-98XL'
6         NEC PC-98RL Emulator 'ePC-98RL'
7
8         Author : Takeda.Toshiya
9         Date   : 2018.04.01-
10
11         [ sasi i/f ]
12 */
13
14 #ifndef _SASI_H_
15 #define _SASI_H_
16
17 #include "../vm.h"
18 #include "../../emu.h"
19 #include "../device.h"
20
21 #define SIG_SASI_IRQ    0
22 #define SIG_SASI_DRQ    1
23 #define SIG_SASI_TC     2
24
25 class SASI_HDD;
26
27 class SASI : public DEVICE
28 {
29 private:
30         DEVICE *d_host;
31         SASI_HDD *d_hdd;
32         DEVICE *d_dma, *d_pic;
33         
34         uint8_t ocr;
35         bool irq_status;
36         bool drq_status;
37         
38 public:
39         SASI(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
40         {
41                 set_device_name(_T("SASI I/F"));
42         }
43         ~SASI() {}
44         
45         // common functions
46         void reset();
47         void write_io8(uint32_t addr, uint32_t data);
48         uint32_t read_io8(uint32_t addr);
49 //      void write_dma_io8(uint32_t addr, uint32_t data);
50 //      uint32_t read_dma_io8(uint32_t addr);
51         void write_signal(int id, uint32_t data, uint32_t mask);
52         bool process_state(FILEIO* state_fio, bool loading);
53         
54         // unique functions
55         void set_context_host(DEVICE* device)
56         {
57                 d_host = device;
58         }
59         void set_context_hdd(SASI_HDD* device)
60         {
61                 d_hdd = device;
62         }
63         void set_context_dma(DEVICE* device)
64         {
65                 d_dma = device;
66         }
67         void set_context_pic(DEVICE* device)
68         {
69                 d_pic = device;
70         }
71 };
72
73 #endif
74