trunk/src/emu/cpu/nec/v53.c
| r244836 | r244837 | |
| 215 | 215 | } |
| 216 | 216 | else // uPD71071 mode |
| 217 | 217 | { |
| 218 | | space(AS_IO).install_readwrite_handler(base+0x00, base+0x0f, read8_delegate(FUNC(upd71071_device::read), (upd71071_device*)m_dma_71071mode), write8_delegate(FUNC(upd71071_device::write), (upd71071_device*)m_dma_71071mode), 0xffff); |
| 218 | space(AS_IO).install_readwrite_handler(base+0x00, base+0x0f, read8_delegate(FUNC(upd71071_v53_device::read), (upd71071_v53_device*)m_dma_71071mode), write8_delegate(FUNC(upd71071_v53_device::write), (upd71071_v53_device*)m_dma_71071mode), 0xffff); |
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | |
| r244836 | r244837 | |
| 354 | 354 | /*** DMA ***/ |
| 355 | 355 | |
| 356 | 356 | // could be wrong / nonexistent |
| 357 | | int v53_base_device::dmarq(int state, int channel) |
| 357 | WRITE_LINE_MEMBER(v53_base_device::dreq0_trampoline_w) |
| 358 | 358 | { |
| 359 | | return m_dma_71071mode->dmarq(state, channel); |
| 359 | if (!(m_SCTL & 0x02)) |
| 360 | { |
| 361 | m_dma_71071mode->dreq0_w(state); |
| 362 | } |
| 363 | else |
| 364 | { |
| 365 | printf("v53: dreq0 not in 71071mode\n"); |
| 366 | } |
| 360 | 367 | } |
| 361 | 368 | |
| 369 | WRITE_LINE_MEMBER(v53_base_device::dreq1_trampoline_w) |
| 370 | { |
| 371 | if (!(m_SCTL & 0x02)) |
| 372 | { |
| 373 | m_dma_71071mode->dreq1_w(state); |
| 374 | } |
| 375 | else |
| 376 | { |
| 377 | printf("v53: dreq1 not in 71071mode\n"); |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | WRITE_LINE_MEMBER(v53_base_device::dreq2_trampoline_w) |
| 382 | { |
| 383 | if (!(m_SCTL & 0x02)) |
| 384 | { |
| 385 | m_dma_71071mode->dreq2_w(state); |
| 386 | } |
| 387 | else |
| 388 | { |
| 389 | printf("v53: dreq2 not in 71071mode\n"); |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | WRITE_LINE_MEMBER(v53_base_device::dreq3_trampoline_w) |
| 394 | { |
| 395 | if (!(m_SCTL & 0x02)) |
| 396 | { |
| 397 | m_dma_71071mode->dreq3_w(state); |
| 398 | } |
| 399 | else |
| 400 | { |
| 401 | printf("v53: dreq3 not in 71071mode\n"); |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | |
| 406 | |
| 362 | 407 | /* General stuff */ |
| 363 | 408 | |
| 364 | 409 | static ADDRESS_MAP_START( v53_internal_port_map, AS_IO, 16, v53_base_device ) |
| r244836 | r244837 | |
| 401 | 446 | MCFG_PIT8253_CLK0(16000000/2/8) |
| 402 | 447 | //MCFG_PIT8253_OUT0_HANDLER(WRITELINE(v53_base_device, pit_out0)) |
| 403 | 448 | |
| 404 | | MCFG_DEVICE_ADD("upd71071dma", UPD71071, 0) |
| 405 | | // MCFG_UPD71071_CPU("audiocpu") // should use owner name |
| 406 | | MCFG_UPD71071_CLOCK(4000000) |
| 407 | | // MCFG_UPD71071_DMA_READ_0_CB(READ16(towns_state, towns_fdc_dma_r)) |
| 408 | | // MCFG_UPD71071_DMA_READ_1_CB(READ16(towns_state, towns_scsi_dma_r)) |
| 409 | | // MCFG_UPD71071_DMA_READ_3_CB(READ16(towns_state, towns_cdrom_dma_r)) |
| 410 | | // MCFG_UPD71071_DMA_WRITE_0_CB(WRITE16(towns_state, towns_fdc_dma_w)) |
| 411 | | // MCFG_UPD71071_DMA_WRITE_1_CB(WRITE16(towns_state, towns_scsi_dma_w)) |
| 449 | MCFG_DEVICE_ADD("upd71071dma", UPD71071_V53, 4000000) |
| 412 | 450 | |
| 451 | |
| 413 | 452 | MACHINE_CONFIG_END |
| 414 | 453 | |
| 415 | 454 | machine_config_constructor v53_base_device::device_mconfig_additions() const |
trunk/src/emu/cpu/nec/v53.h
| r244836 | r244837 | |
| 4 | 4 | #include "necpriv.h" |
| 5 | 5 | |
| 6 | 6 | #include "machine/pit8253.h" |
| 7 | | #include "machine/upd71071.h" |
| 7 | #include "machine/am9517a.h" |
| 8 | 8 | |
| 9 | 9 | class v53_base_device : public nec_common_device |
| 10 | 10 | { |
| r244836 | r244837 | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | required_device<pit8253_device> m_pit; |
| 83 | | required_device<upd71071_device> m_dma_71071mode; |
| 83 | required_device<upd71071_v53_device> m_dma_71071mode; |
| 84 | 84 | |
| 85 | | int dmarq(int state, int channel); // trampoline to upd71071 |
| 85 | DECLARE_WRITE_LINE_MEMBER(dreq0_trampoline_w); |
| 86 | DECLARE_WRITE_LINE_MEMBER(dreq1_trampoline_w); |
| 87 | DECLARE_WRITE_LINE_MEMBER(dreq2_trampoline_w); |
| 88 | DECLARE_WRITE_LINE_MEMBER(dreq3_trampoline_w); |
| 86 | 89 | |
| 90 | |
| 87 | 91 | protected: |
| 88 | 92 | // device-level overrides |
| 89 | 93 | virtual machine_config_constructor device_mconfig_additions() const; |
trunk/src/emu/machine/am9517a.c
| r244836 | r244837 | |
| 2 | 2 | // copyright-holders:Curt Coder |
| 3 | 3 | /*************************************************************************** |
| 4 | 4 | |
| 5 | | AMD AM9517A/8237A Multimode DMA Controller emulation |
| 5 | AMD AM9517A |
| 6 | Intel 8237A |
| 7 | NEC UPD71071 |
| 8 | |
| 9 | Multimode DMA Controller emulation |
| 6 | 10 | |
| 7 | 11 | Copyright the MESS Team. |
| 8 | 12 | Visit http://mamedev.org for licensing and usage restrictions. |
| r244836 | r244837 | |
| 18 | 22 | |
| 19 | 23 | */ |
| 20 | 24 | |
| 25 | /* |
| 26 | |
| 27 | When the V53 operates in uPD71071 compatible mode there are the following |
| 28 | differences from a real uPD71071 |
| 29 | |
| 30 | V53 Real uPD71071 |
| 31 | Software Reqs No Yes |
| 32 | Memory-to-Memory DMA No Yes |
| 33 | DMARQ active level High programmable |
| 34 | DMAAK active level Low programmable |
| 35 | Bus Cycle 4 4 or 3 |
| 36 | |
| 37 | we don't currently handle the differences |
| 38 | |
| 39 | */ |
| 40 | |
| 21 | 41 | #include "am9517a.h" |
| 22 | 42 | |
| 23 | 43 | |
| r244836 | r244837 | |
| 27 | 47 | //************************************************************************** |
| 28 | 48 | |
| 29 | 49 | const device_type AM9517A = &device_creator<am9517a_device>; |
| 50 | const device_type UPD71071_V53 = &device_creator<upd71071_v53_device>; |
| 30 | 51 | |
| 31 | 52 | |
| 32 | | |
| 33 | 53 | //************************************************************************** |
| 34 | 54 | // MACROS / CONSTANTS |
| 35 | 55 | //************************************************************************** |
| r244836 | r244837 | |
| 447 | 467 | // am9517a_device - constructor |
| 448 | 468 | //------------------------------------------------- |
| 449 | 469 | |
| 470 | |
| 471 | am9517a_device::am9517a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) |
| 472 | : device_t(mconfig, AM9517A, name, tag, owner, clock, shortname, __FILE__), |
| 473 | device_execute_interface(mconfig, *this), |
| 474 | m_icount(0), |
| 475 | m_out_hreq_cb(*this), |
| 476 | m_out_eop_cb(*this), |
| 477 | m_in_memr_cb(*this), |
| 478 | m_out_memw_cb(*this), |
| 479 | m_in_ior_0_cb(*this), |
| 480 | m_in_ior_1_cb(*this), |
| 481 | m_in_ior_2_cb(*this), |
| 482 | m_in_ior_3_cb(*this), |
| 483 | m_out_iow_0_cb(*this), |
| 484 | m_out_iow_1_cb(*this), |
| 485 | m_out_iow_2_cb(*this), |
| 486 | m_out_iow_3_cb(*this), |
| 487 | m_out_dack_0_cb(*this), |
| 488 | m_out_dack_1_cb(*this), |
| 489 | m_out_dack_2_cb(*this), |
| 490 | m_out_dack_3_cb(*this), |
| 491 | m_hack(0), |
| 492 | m_ready(1), |
| 493 | m_command(0) |
| 494 | { |
| 495 | } |
| 496 | |
| 497 | |
| 450 | 498 | am9517a_device::am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 451 | 499 | : device_t(mconfig, AM9517A, "AM9517A", tag, owner, clock, "am9517a", __FILE__), |
| 452 | 500 | device_execute_interface(mconfig, *this), |
| r244836 | r244837 | |
| 473 | 521 | { |
| 474 | 522 | } |
| 475 | 523 | |
| 524 | upd71071_v53_device::upd71071_v53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 525 | : am9517a_device(mconfig, UPD71071_V53, "UPD71071 (V53)", tag, owner, clock, "upd71071_v53") |
| 526 | { |
| 527 | } |
| 528 | |
| 476 | 529 | //------------------------------------------------- |
| 477 | 530 | // device_start - device-specific startup |
| 478 | 531 | //------------------------------------------------- |
trunk/src/emu/machine/am9517a.h
| r244836 | r244837 | |
| 51 | 51 | { |
| 52 | 52 | public: |
| 53 | 53 | // construction/destruction |
| 54 | am9517a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); |
| 54 | 55 | am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 55 | 56 | |
| 56 | 57 | template<class _Object> static devcb_base &set_out_hreq_callback(device_t &device, _Object object) { return downcast<am9517a_device &>(device).m_out_hreq_cb.set_callback(object); } |
| r244836 | r244837 | |
| 151 | 152 | }; |
| 152 | 153 | |
| 153 | 154 | |
| 155 | class upd71071_v53_device : public am9517a_device |
| 156 | { |
| 157 | public: |
| 158 | // construction/destruction |
| 159 | upd71071_v53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 160 | }; |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 154 | 165 | // device type definition |
| 155 | 166 | extern const device_type AM9517A; |
| 167 | extern const device_type UPD71071_V53; |
| 156 | 168 | |
| 169 | |
| 157 | 170 | /*************************************************************************** |
| 158 | 171 | DEVICE CONFIGURATION MACROS |
| 159 | 172 | ***************************************************************************/ |
trunk/src/mame/audio/hng64.c
| r244836 | r244837 | |
| 150 | 150 | WRITE16_MEMBER(hng64_state::hng64_sound_port_0008_w) |
| 151 | 151 | { |
| 152 | 152 | printf("hng64_sound_port_0008_w %04x %04x\n", data, mem_mask); |
| 153 | | // just a guess, the v53 docs seem to indicate no software requests tho?? buriki sets up the DMA, then writes here, then waits for the counter to expire? |
| 154 | | // Maybe it's automatic? I see no way to trigger an actual DMA in the uPD71071 code at present otherwise tho? |
| 155 | | m_audiocpu->dmarq(1, 0); |
| 156 | | m_audiocpu->dmarq(1, 1); |
| 157 | | m_audiocpu->dmarq(1, 2); |
| 158 | | m_audiocpu->dmarq(1, 3); |
| 159 | | |
| 153 | // seems to one or more of the DMARQ on the V53, writes here when it expects DMA channel 3 to transfer ~0x20 bytes just after startup |
| 154 | m_audiocpu->dreq3_trampoline_w(data&1); |
| 160 | 155 | } |
| 161 | 156 | |
| 162 | 157 | static ADDRESS_MAP_START( hng_sound_io, AS_IO, 16, hng64_state ) |