Previous 199869 Revisions Next

r36325 Sunday 8th March, 2015 at 21:21:35 UTC by David Haywood
carl noted that this seems to be the same thing, and is more complete, so use it instead (nw)
[src/emu/cpu/nec]v53.c v53.h
[src/emu/machine]am9517a.c am9517a.h upd71071.c
[src/mame/audio]hng64.c

trunk/src/emu/cpu/nec/v53.c
r244836r244837
215215      }
216216      else // uPD71071 mode
217217      {
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);
219219      }
220220   }
221221
r244836r244837
354354/*** DMA ***/
355355
356356// could be wrong / nonexistent
357int v53_base_device::dmarq(int state, int channel)
357WRITE_LINE_MEMBER(v53_base_device::dreq0_trampoline_w)
358358{
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   }
360367}
361368
369WRITE_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
381WRITE_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
393WRITE_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
362407/* General stuff */
363408
364409static ADDRESS_MAP_START( v53_internal_port_map, AS_IO, 16, v53_base_device )
r244836r244837
401446   MCFG_PIT8253_CLK0(16000000/2/8)
402447   //MCFG_PIT8253_OUT0_HANDLER(WRITELINE(v53_base_device, pit_out0))
403448
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)
412450
451
413452MACHINE_CONFIG_END
414453
415454machine_config_constructor v53_base_device::device_mconfig_additions() const
trunk/src/emu/cpu/nec/v53.h
r244836r244837
44#include "necpriv.h"
55
66#include "machine/pit8253.h"
7#include "machine/upd71071.h"
7#include "machine/am9517a.h"
88
99class v53_base_device : public nec_common_device
1010{
r244836r244837
8080   }
8181
8282   required_device<pit8253_device> m_pit;
83   required_device<upd71071_device> m_dma_71071mode;
83   required_device<upd71071_v53_device> m_dma_71071mode;
8484   
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);
8689
90
8791protected:
8892   // device-level overrides
8993   virtual machine_config_constructor device_mconfig_additions() const;
trunk/src/emu/machine/am9517a.c
r244836r244837
22// copyright-holders:Curt Coder
33/***************************************************************************
44
5    AMD AM9517A/8237A Multimode DMA Controller emulation
5    AMD AM9517A
6   Intel 8237A
7   NEC UPD71071
8   
9   Multimode DMA Controller emulation
610
711    Copyright the MESS Team.
812    Visit http://mamedev.org for licensing and usage restrictions.
r244836r244837
1822
1923*/
2024
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
2141#include "am9517a.h"
2242
2343
r244836r244837
2747//**************************************************************************
2848
2949const device_type AM9517A = &device_creator<am9517a_device>;
50const device_type UPD71071_V53 = &device_creator<upd71071_v53_device>;
3051
3152
32
3353//**************************************************************************
3454//  MACROS / CONSTANTS
3555//**************************************************************************
r244836r244837
447467//  am9517a_device - constructor
448468//-------------------------------------------------
449469
470
471am9517a_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
450498am9517a_device::am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
451499   : device_t(mconfig, AM9517A, "AM9517A", tag, owner, clock, "am9517a", __FILE__),
452500      device_execute_interface(mconfig, *this),
r244836r244837
473521{
474522}
475523
524upd71071_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
476529//-------------------------------------------------
477530//  device_start - device-specific startup
478531//-------------------------------------------------
trunk/src/emu/machine/am9517a.h
r244836r244837
5151{
5252public:
5353   // 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);
5455   am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5556
5657   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); }
r244836r244837
151152};
152153
153154
155class upd71071_v53_device :  public am9517a_device
156{
157public:
158   // construction/destruction
159   upd71071_v53_device(const machine_config &mconfig,  const char *tag, device_t *owner, UINT32 clock);
160};
161
162
163
164
154165// device type definition
155166extern const device_type AM9517A;
167extern const device_type UPD71071_V53;
156168
169
157170/***************************************************************************
158171    DEVICE CONFIGURATION MACROS
159172***************************************************************************/
trunk/src/emu/machine/upd71071.c
r244836r244837
11
22/*
33
4   am9517a.c is a more complete implementation of this, the uPD71071 appears to be a clone of it
5
46    NEC uPD71071 DMA Controller
57    Used on the Fujitsu FM-Towns
68
r244836r244837
7981   Note, the uPD71071 compatible mode of the V53 CPU differs from a real uPD71071 in the following ways
8082
8183
82                              V53     Real uPD71071
83   Software Reqs              No      Yes
84   Memory-to-Memory DMA       No      Yes
85   DMARQ active level         High    High or Low
86   DMAAK active level         Low     High or Low
87   Bus Cycle                  4       4 or 3
8884
89   we don't currently handle the differences
90
9185*/
9286
9387#include "emu.h"
trunk/src/mame/audio/hng64.c
r244836r244837
150150WRITE16_MEMBER(hng64_state::hng64_sound_port_0008_w)
151151{
152152   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);
160155}
161156
162157static ADDRESS_MAP_START( hng_sound_io, AS_IO, 16, hng64_state )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team