2 Skelton for retropc emulator
4 Author : Takeda.Toshiya
17 #define SIG_UPD71071_CH0 0
18 #define SIG_UPD71071_CH1 1
19 #define SIG_UPD71071_CH2 2
20 #define SIG_UPD71071_CH3 3
22 class UPD71071 : public DEVICE
26 //#ifdef SINGLE_MODE_DMA
38 uint8_t b16, selch, base;
40 uint8_t req, sreq, mask, tc;
42 bool _SINGLE_MODE_DMA;
44 UPD71071(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
46 // TIP: if((DEVICE::prev_device == NULL) || (DEVICE::this_device_id == 0)) DEVICE must be DUMMY.
47 // And, at this device, should not be FIRST DEVICE. 20170613 Ohta.
49 while((__dev->prev_device != NULL) && (__dev->this_device_id > 0)) {
50 __dev = __dev->prev_device;
52 for(int i = 0; i < 4; i++) {
53 //dma[i].dev = vm->dummy;
57 //#ifdef SINGLE_MODE_DMA
60 _SINGLE_MODE_DMA = false;
61 initialize_output_signals(&outputs_tc);
62 set_device_name(_T("uPD71071 DMAC"));
69 void write_io8(uint32_t addr, uint32_t data);
70 uint32_t read_io8(uint32_t addr);
71 void write_signal(int id, uint32_t data, uint32_t mask);
74 void save_state(FILEIO* state_fio);
75 bool load_state(FILEIO* state_fio);
77 void set_context_memory(DEVICE* device)
81 void set_context_ch0(DEVICE* device)
85 void set_context_ch1(DEVICE* device)
89 void set_context_ch2(DEVICE* device)
93 void set_context_ch3(DEVICE* device)
97 //#ifdef SINGLE_MODE_DMA
98 void set_context_child_dma(DEVICE* device)
103 void set_context_tc(DEVICE* device, int id, uint32_t mask)
105 register_output_signal(&outputs_tc, device, id, mask);