src/mess/machine/isa_wdxt_gen.c
| r14339 | r14340 | |
| 230 | 230 | set_isa_device(); |
| 231 | 231 | m_isa->install_rom(this, 0xc8000, 0xc9fff, 0, 0, "hdc", "hdc"); |
| 232 | 232 | m_isa->install_device(0x0320, 0x0323, 0, 0, read8_delegate(FUNC(wd11c00_17_device::io_r), (wd11c00_17_device*)m_host), write8_delegate(FUNC(wd11c00_17_device::io_w), (wd11c00_17_device*)m_host)); |
| 233 | m_isa->set_dma_channel(3, this, FALSE); |
| 233 | 234 | } |
| 234 | 235 | |
| 235 | 236 | |
| r14339 | r14340 | |
| 263 | 264 | m_host->dack_w(data); |
| 264 | 265 | } |
| 265 | 266 | |
| 266 | | |
| 267 | 267 | //------------------------------------------------- |
| 268 | | // have_dack - |
| 269 | | //------------------------------------------------- |
| 270 | | |
| 271 | | bool wdxt_gen_device::have_dack(int line) |
| 272 | | { |
| 273 | | return (line == 3) ? TRUE : FALSE; |
| 274 | | } |
| 275 | | |
| 276 | | |
| 277 | | //------------------------------------------------- |
| 278 | 268 | // wd1015_t0_r - |
| 279 | 269 | //------------------------------------------------- |
| 280 | 270 | |
src/mess/machine/3c503.c
| r14339 | r14340 | |
| 38 | 38 | set_isa_device(); |
| 39 | 39 | m_isa->install_device(0x0300, 0x030f, 0, 0, read8_delegate(FUNC(el2_3c503_device::el2_3c503_loport_r), this), write8_delegate(FUNC(el2_3c503_device::el2_3c503_loport_w), this)); |
| 40 | 40 | m_isa->install_device(0x0700, 0x070f, 0, 0, read8_delegate(FUNC(el2_3c503_device::el2_3c503_hiport_r), this), write8_delegate(FUNC(el2_3c503_device::el2_3c503_hiport_w), this)); |
| 41 | |
| 42 | int chan = 0, idcfr = m_regs.idcfr & 0x0f; |
| 43 | if((m_regs.streg | 0x08)) { |
| 44 | while(idcfr) { |
| 45 | chan++; |
| 46 | idcfr >>= 1; |
| 47 | } |
| 48 | m_isa->set_dma_channel(chan, this, FALSE); |
| 49 | } |
| 41 | 50 | } |
| 42 | 51 | |
| 43 | 52 | void el2_3c503_device::device_reset() { |
| r14339 | r14340 | |
| 90 | 99 | } |
| 91 | 100 | } |
| 92 | 101 | |
| 93 | | bool el2_3c503_device::have_dack(int line) { |
| 94 | | int chan = 0, idcfr = m_regs.idcfr & 0x0f; |
| 95 | | if(!(m_regs.streg | 0x08)) return FALSE; |
| 96 | | while(idcfr) { |
| 97 | | chan++; |
| 98 | | idcfr >>= 1; |
| 99 | | } |
| 100 | | if(chan && (chan == line)) return TRUE; |
| 101 | | return FALSE; |
| 102 | | } |
| 103 | | |
| 104 | 102 | UINT8 el2_3c503_device::dack_r(int line) { |
| 105 | 103 | set_drq(CLEAR_LINE); |
| 106 | 104 | return el2_3c503_mem_read(m_regs.da++); |
src/mess/machine/isa_hdc.c
| r14339 | r14340 | |
| 172 | 172 | set_isa_device(); |
| 173 | 173 | m_isa->install_rom(this, 0xc8000, 0xc9fff, 0, 0, "hdc", "hdc"); |
| 174 | 174 | m_isa->install_device(this, 0x0320, 0x0323, 0, 0, FUNC(pc_HDC_r), FUNC(pc_HDC_w) ); |
| 175 | m_isa->set_dma_channel(3, this, FALSE); |
| 175 | 176 | buffer = auto_alloc_array(machine(), UINT8, 17*4*512); |
| 176 | 177 | timer = machine().scheduler().timer_alloc(FUNC(pc_hdc_command), this); |
| 177 | 178 | } |
| r14339 | r14340 | |
| 824 | 825 | { |
| 825 | 826 | pc_hdc_dack_w(data); |
| 826 | 827 | } |
| 827 | | bool isa8_hdc_device::have_dack(int line) |
| 828 | | { |
| 829 | | if (line==3) return TRUE; |
| 830 | | return FALSE; |
| 831 | | } |
src/mess/machine/isa_sblaster.c
| r14339 | r14340 | |
| 491 | 491 | // 1.0 always has the SAA1099s for CMS back-compatibility |
| 492 | 492 | m_isa->install_device(subdevice("saa1099.1"), 0x0220, 0x0221, 0, 0, FUNC(saa1099_16_r), FUNC(saa1099_16_w) ); |
| 493 | 493 | m_isa->install_device(subdevice("saa1099.2"), 0x0222, 0x0223, 0, 0, FUNC(saa1099_16_r), FUNC(saa1099_16_w) ); |
| 494 | m_isa->set_dma_channel(1, this, FALSE); |
| 494 | 495 | m_dsp.version = 0x0105; |
| 495 | 496 | sb8_device::device_start(); |
| 496 | 497 | } |
| r14339 | r14340 | |
| 516 | 517 | m_dsp.fifo_r_ptr = 0; |
| 517 | 518 | } |
| 518 | 519 | |
| 519 | | bool sb8_device::have_dack(int line) |
| 520 | | { |
| 521 | | if (line==1) return TRUE; |
| 522 | | return FALSE; |
| 523 | | } |
| 524 | | |
| 525 | 520 | UINT8 sb8_device::dack_r(int line) |
| 526 | 521 | { |
| 527 | 522 | // printf("dack_r: line %x out = %02x\n", line, m_dack_out); |
src/mess/machine/isa.c
| r14339 | r14340 | |
| 145 | 145 | isa8_device::isa8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 146 | 146 | device_t(mconfig, ISA8, "ISA8", tag, owner, clock) |
| 147 | 147 | { |
| 148 | for(int i=0;i<8;i++) |
| 149 | { |
| 150 | m_dma_device[i] = NULL; |
| 151 | m_dma_eop[i] = false; |
| 152 | } |
| 148 | 153 | } |
| 149 | 154 | |
| 150 | 155 | isa8_device::isa8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : |
| 151 | 156 | device_t(mconfig, type, name, tag, owner, clock) |
| 152 | 157 | { |
| 158 | for(int i=0;i<8;i++) |
| 159 | { |
| 160 | m_dma_device[i] = NULL; |
| 161 | m_dma_eop[i] = false; |
| 162 | } |
| 153 | 163 | } |
| 164 | |
| 165 | void isa8_device::set_dma_channel(UINT8 channel, device_isa8_card_interface *dev, bool do_eop) |
| 166 | { |
| 167 | m_dma_device[channel] = dev; |
| 168 | m_dma_eop[channel] = do_eop; |
| 169 | } |
| 170 | |
| 154 | 171 | //------------------------------------------------- |
| 155 | 172 | // device_start - device-specific startup |
| 156 | 173 | //------------------------------------------------- |
| r14339 | r14340 | |
| 177 | 194 | { |
| 178 | 195 | } |
| 179 | 196 | |
| 180 | | void isa8_device::add_isa_card(device_isa8_card_interface *card) |
| 181 | | { |
| 182 | | m_device_list.append(*card); |
| 183 | | } |
| 184 | | |
| 185 | 197 | void isa8_device::install_memory(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_space_func rhandler, const char* rhandler_name, write8_space_func whandler, const char *whandler_name) |
| 186 | 198 | { |
| 187 | 199 | int buswidth = m_maincpu->memory().space_config(AS_PROGRAM)->m_databus_width; |
| r14339 | r14340 | |
| 347 | 359 | |
| 348 | 360 | UINT8 isa8_device::dack_r(int line) |
| 349 | 361 | { |
| 350 | | UINT8 retVal = 0xff; |
| 351 | | device_isa8_card_interface *entry = m_device_list.first(); |
| 352 | | while(entry) { |
| 353 | | if (entry->have_dack(line)) { |
| 354 | | retVal = entry->dack_r(line); |
| 355 | | break; |
| 356 | | } |
| 357 | | entry = entry->next(); |
| 358 | | } |
| 359 | | return retVal; |
| 362 | if (m_dma_device[line]) |
| 363 | return m_dma_device[line]->dack_r(line); |
| 364 | return 0xff; |
| 360 | 365 | } |
| 361 | 366 | |
| 362 | 367 | void isa8_device::dack_w(int line,UINT8 data) |
| 363 | 368 | { |
| 364 | | device_isa8_card_interface *entry = m_device_list.first(); |
| 365 | | while(entry) { |
| 366 | | if (entry->have_dack(line)) { |
| 367 | | entry->dack_w(line,data); |
| 368 | | } |
| 369 | | entry = entry->next(); |
| 370 | | } |
| 369 | if (m_dma_device[line]) |
| 370 | return m_dma_device[line]->dack_w(line,data); |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | void isa8_device::eop_w(int state) |
| 374 | 374 | { |
| 375 | | device_isa8_card_interface *entry = m_device_list.first(); |
| 376 | | while(entry) { |
| 377 | | entry->eop_w(state); |
| 378 | | entry = entry->next(); |
| 375 | for (int i=0;i<8;i++) { |
| 376 | if (m_dma_eop[i]==TRUE && m_dma_device[i]) |
| 377 | m_dma_device[i]->eop_w(state); |
| 379 | 378 | } |
| 380 | 379 | } |
| 381 | 380 | |
| r14339 | r14340 | |
| 420 | 419 | { |
| 421 | 420 | } |
| 422 | 421 | |
| 423 | | bool device_isa8_card_interface::have_dack(int line) |
| 424 | | { |
| 425 | | return FALSE; |
| 426 | | } |
| 427 | | |
| 428 | 422 | void device_isa8_card_interface::static_set_isabus_tag(device_t &device, const char *tag) |
| 429 | 423 | { |
| 430 | 424 | device_isa8_card_interface &isa_card = dynamic_cast<device_isa8_card_interface &>(device); |
| r14339 | r14340 | |
| 434 | 428 | void device_isa8_card_interface::set_isa_device() |
| 435 | 429 | { |
| 436 | 430 | m_isa = dynamic_cast<isa8_device *>(device().machine().device(m_isa_tag)); |
| 437 | | m_isa->add_isa_card(this); |
| 438 | 431 | } |
| 439 | 432 | |
| 440 | 433 | |
| r14339 | r14340 | |
| 590 | 583 | void device_isa16_card_interface::set_isa_device() |
| 591 | 584 | { |
| 592 | 585 | m_isa = dynamic_cast<isa16_device *>(device().machine().device(m_isa_tag)); |
| 593 | | m_isa->add_isa_card(this); |
| 594 | 586 | } |
src/mess/machine/isa.h
| r14339 | r14340 | |
| 151 | 151 | // inline configuration |
| 152 | 152 | static void static_set_cputag(device_t &device, const char *tag); |
| 153 | 153 | |
| 154 | | void add_isa_card(device_isa8_card_interface *card); |
| 155 | 154 | void install_device(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_device_func rhandler, const char* rhandler_name, write8_device_func whandler, const char *whandler_name); |
| 156 | 155 | void install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler); |
| 157 | 156 | void install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_space_func rhandler, const char* rhandler_name, write8_space_func whandler, const char *whandler_name); |
| r14339 | r14340 | |
| 176 | 175 | UINT8 dack_r(int line); |
| 177 | 176 | void dack_w(int line,UINT8 data); |
| 178 | 177 | void eop_w(int state); |
| 179 | | |
| 178 | |
| 179 | void set_dma_channel(UINT8 channel, device_isa8_card_interface *dev, bool do_eop); |
| 180 | 180 | protected: |
| 181 | 181 | // device-level overrides |
| 182 | 182 | virtual void device_start(); |
| r14339 | r14340 | |
| 197 | 197 | devcb_resolved_write_line m_out_drq2_func; |
| 198 | 198 | devcb_resolved_write_line m_out_drq3_func; |
| 199 | 199 | |
| 200 | | simple_list<device_isa8_card_interface> m_device_list; |
| 200 | device_isa8_card_interface *m_dma_device[8]; |
| 201 | bool m_dma_eop[8]; |
| 201 | 202 | const char *m_cputag; |
| 202 | 203 | }; |
| 203 | 204 | |
| r14339 | r14340 | |
| 223 | 224 | virtual UINT8 dack_r(int line); |
| 224 | 225 | virtual void dack_w(int line,UINT8 data); |
| 225 | 226 | virtual void eop_w(int state); |
| 226 | | virtual bool have_dack(int line); |
| 227 | 227 | |
| 228 | 228 | // inline configuration |
| 229 | 229 | static void static_set_isabus_tag(device_t &device, const char *tag); |