(MESS) a7800: added Yamaha 2151 emulation to the XM

expansion board, thanks to info from tep392. nw.

Also removed from the softlist the Donkey Kong XM Enhanced 
version which had been hacked to work on ProSystem emulator
and fails to save hiscores with correct HSC emulation 
(it remains available the correct version which saves fine both
in MESS and in the real hardware).
This commit is contained in:
Fabio Priuli 2014-08-26 05:58:29 +00:00
parent 30d296ba22
commit c397bad20b
3 changed files with 79 additions and 38 deletions

View File

@ -2436,41 +2436,11 @@ almost nothing like the prototype.
<!-- XM board enhanced -->
<!-- these should require an XM board? but the emulation seems to be built into the base driver?-->
<!-- these have had the header stripped vs the .a78 files offered
there was also a 'binary' with size 0x24000, CRC fd503bd4 -->
<software name="dkongxm">
<description>Donkey Kong (homebrew, XM enhanced, HSC support) (Demo)</description>
<description>Donkey Kong (PAL, Demo, XM enhanced)</description>
<year>2012</year>
<publisher>&lt;homebrew&gt;</publisher> <!-- TEP392 -->
<sharedfeat name="compatibility" value="PAL"/>
<part name="cart" interface="a7800_cart">
<feature name="pcb_type" value="TYPE-XM" />
<feature name="slot" value="a78_xmc" />
<dataarea name="rom" size="0x24000">
<rom name="dkxm_final_demo_pal_hsc.a78" size="0x24000" crc="6510b674" sha1="65b723b470d287af51e9888813149c43fb11ac26" offset="0" />
</dataarea>
</part>
</software>
<software name="dkongxmu" cloneof="dkongxm" >
<description>Donkey Kong (homebrew, XM enhanced, HSC support) (Demo) (NTSC)</description>
<year>2012</year>
<publisher>&lt;homebrew&gt;</publisher> <!-- TEP392 -->
<sharedfeat name="compatibility" value="NTSC"/>
<part name="cart" interface="a7800_cart">
<feature name="pcb_type" value="TYPE-XM" />
<feature name="slot" value="a78_xmc" />
<dataarea name="rom" size="0x24000">
<rom name="dkxm_final_demo_ntsc_hsc.a78" size="0x24000" crc="2c67fea7" sha1="7825c1946e3c7492fa9bbfae33029cd68c0d1135" offset="0" />
</dataarea>
</part>
</software>
<software name="dkongxmn" cloneof="dkongxm">
<description>Donkey Kong (homebrew, XM enhanced) (Demo)</description>
<year>2012</year>
<publisher>&lt;homebrew&gt;</publisher> <!-- TEP392 -->
<publisher>&lt;homebrew&gt;</publisher>
<info name="programmer" value="TEP392" />
<sharedfeat name="compatibility" value="PAL"/>
<part name="cart" interface="a7800_cart">
<feature name="pcb_type" value="TYPE-XM" />
@ -2482,9 +2452,10 @@ almost nothing like the prototype.
</software>
<software name="dkongxmnu" cloneof="dkongxm" >
<description>Donkey Kong (homebrew, XM enhanced) (Demo) (NTSC)</description>
<description>Donkey Kong (NTSC, Demo, XM enhanced)</description>
<year>2012</year>
<publisher>&lt;homebrew&gt;</publisher> <!-- TEP392 -->
<publisher>&lt;homebrew&gt;</publisher>
<info name="programmer" value="TEP392" />
<sharedfeat name="compatibility" value="NTSC"/>
<part name="cart" interface="a7800_cart">
<feature name="pcb_type" value="TYPE-XM" />

View File

@ -37,8 +37,6 @@
TODO:
- verify what happens when 2 POKEYs are present
- understand why high score in XM is not written to NVRAM
- add Yamaha YM2151 when more clear specs are available
***********************************************************************************************************/
@ -73,7 +71,8 @@ a78_xboard_device::a78_xboard_device(const machine_config &mconfig, const char *
a78_xm_device::a78_xm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: a78_xboard_device(mconfig, A78_XM, "Atari 7800 XM expansion module", tag, owner, clock, "a78_xm", __FILE__)
: a78_xboard_device(mconfig, A78_XM, "Atari 7800 XM expansion module", tag, owner, clock, "a78_xm", __FILE__),
m_ym(*this, "xm_ym2151")
{
}
@ -90,6 +89,20 @@ void a78_xboard_device::device_reset()
m_ram_bank = 0;
}
void a78_xm_device::device_start()
{
save_item(NAME(m_reg));
save_item(NAME(m_ram_bank));
save_item(NAME(m_ym_enabled));
}
void a78_xm_device::device_reset()
{
m_reg = 0;
m_ram_bank = 0;
m_ym_enabled = 0;
}
static MACHINE_CONFIG_FRAGMENT( a78_xb )
MCFG_A78_CARTRIDGE_ADD("xb_slot", a7800_cart, NULL)
@ -100,11 +113,27 @@ static MACHINE_CONFIG_FRAGMENT( a78_xb )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "xb_speaker", 1.00)
MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( a78_xm )
MCFG_A78_CARTRIDGE_ADD("xb_slot", a7800_cart, NULL)
MCFG_SPEAKER_STANDARD_MONO("xb_speaker")
MCFG_SOUND_ADD("xb_pokey", POKEY, XTAL_14_31818MHz/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "xb_speaker", 1.00)
MCFG_SOUND_ADD("xm_ym2151", YM2151, XTAL_14_31818MHz/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "xb_speaker", 1.00)
MACHINE_CONFIG_END
machine_config_constructor a78_xboard_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( a78_xb );
}
machine_config_constructor a78_xm_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( a78_xm );
}
/*-------------------------------------------------
mapper specific handlers
@ -177,3 +206,32 @@ READ8_MEMBER(a78_xm_device::read_30xx)
return m_rom[offset];
}
READ8_MEMBER(a78_xm_device::read_04xx)
{
if (BIT(m_reg, 4) && offset >= 0x50 && offset < 0x60)
return m_pokey->read(space, offset & 0x0f);
else if (m_ym_enabled && offset >= 0x60 && offset <= 0x61)
return m_ym->read(space, offset & 1);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
else
return 0xff;
}
WRITE8_MEMBER(a78_xm_device::write_04xx)
{
if (BIT(m_reg, 4) && offset >= 0x50 && offset < 0x60)
m_pokey->write(space, offset & 0x0f, data);
else if (m_ym_enabled && offset >= 0x60 && offset <= 0x61)
m_ym->write(space, offset & 1, data);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
else if (offset >= 0x70 && offset < 0x80)
{
if (data == 0x84)
m_ym_enabled = 1;
m_reg = data;
m_ram_bank = m_reg & 7;
}
}

View File

@ -4,6 +4,7 @@
#include "a78_slot.h"
#include "rom.h"
#include "sound/pokey.h"
#include "sound/2151intf.h"
// ======================> a78_xboard_device
@ -41,10 +42,21 @@ public:
// construction/destruction
a78_xm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// device-level overrides
virtual void device_start();
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_reset();
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx);
virtual DECLARE_WRITE8_MEMBER(write_04xx);
virtual DECLARE_READ8_MEMBER(read_10xx);
virtual DECLARE_WRITE8_MEMBER(write_10xx);
virtual DECLARE_READ8_MEMBER(read_30xx);
protected:
required_device<ym2151_device> m_ym;
int m_ym_enabled;
};