(MESS) msx.c: Added preliminary msx audio support. (nw)

This commit is contained in:
Wilbert Pol 2014-05-20 20:17:06 +00:00
parent 0121de2214
commit ec72ebc33e
7 changed files with 128 additions and 1 deletions

2
.gitattributes vendored
View File

@ -991,6 +991,8 @@ src/emu/bus/msx_cart/korean.c svneol=native#text/plain
src/emu/bus/msx_cart/korean.h svneol=native#text/plain
src/emu/bus/msx_cart/majutsushi.c svneol=native#text/plain
src/emu/bus/msx_cart/majutsushi.h svneol=native#text/plain
src/emu/bus/msx_cart/msx_audio.c svneol=native#text/plain
src/emu/bus/msx_cart/msx_audio.h svneol=native#text/plain
src/emu/bus/msx_cart/msxdos2.c svneol=native#text/plain
src/emu/bus/msx_cart/msxdos2.h svneol=native#text/plain
src/emu/bus/msx_cart/nomapper.c svneol=native#text/plain

View File

@ -17025,6 +17025,18 @@ kept for now until finding out what those bytes affect...
<!-- SORT -->
<software name="nms1205">
<description>Philips NMS-1205 Music Module</description>
<year>198?</year>
<publisher>Philips</publisher>
<part name="cart" interface="msx_cart">
<feature name="slot" value="msx_audio" />
<dataarea name="rom" size="32768">
<rom name="nms1205.bin" size="32768" crc="5ecaeef0" sha1="c7463e1fd0433c5d41b70670d6c10fd781b66426" offset="0" />
</dataarea>
</part>
</software>
</softwarelist>

View File

@ -414,6 +414,7 @@ BUSOBJS += $(BUSOBJ)/msx_cart/fmpac.o
BUSOBJS += $(BUSOBJ)/msx_cart/konami.o
BUSOBJS += $(BUSOBJ)/msx_cart/korean.o
BUSOBJS += $(BUSOBJ)/msx_cart/majutsushi.o
BUSOBJS += $(BUSOBJ)/msx_cart/msx_audio.o
BUSOBJS += $(BUSOBJ)/msx_cart/msxdos2.o
BUSOBJS += $(BUSOBJ)/msx_cart/nomapper.o
BUSOBJS += $(BUSOBJ)/msx_cart/rtype.o

View File

@ -7,6 +7,7 @@
#include "konami.h"
#include "korean.h"
#include "majutsushi.h"
#include "msx_audio.h"
#include "msxdos2.h"
#include "nomapper.h"
#include "rtype.h"
@ -35,6 +36,7 @@ SLOT_INTERFACE_START(msx_cart)
SLOT_INTERFACE_INTERNAL("korean_126in1", MSX_CART_KOREAN_126IN1)
SLOT_INTERFACE_INTERNAL("sound_snatcher", MSX_CART_SOUND_SNATCHER)
SLOT_INTERFACE_INTERNAL("sound_sdsnatch", MSX_CART_SOUND_SDSNATCHER)
SLOT_INTERFACE_INTERNAL("msx_audio", MSX_CART_MSX_AUDIO)
SLOT_INTERFACE_END

View File

@ -0,0 +1,75 @@
/**********************************************************************************
**********************************************************************************/
#include "emu.h"
#include "msx_audio.h"
const device_type MSX_CART_MSX_AUDIO = &device_creator<msx_cart_msx_audio>;
msx_cart_msx_audio::msx_cart_msx_audio(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MSX_CART_MSX_AUDIO, "MSX Cartridge - MSX-AUDIO", tag, owner, clock, "msx_cart_msx_audio", __FILE__)
, msx_cart_interface(mconfig, *this)
, m_y8950(*this, "y8950")
, m_acia6850(*this, "acia6850")
{
}
static MACHINE_CONFIG_FRAGMENT( msx_audio )
// There is a 2 MHz crystal on the PCB, where does it go?
// This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'.
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("y8950", Y8950, XTAL_3_579545MHz)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
MCFG_DEVICE_ADD("acia6850", ACIA6850, 0)
MACHINE_CONFIG_END
machine_config_constructor msx_cart_msx_audio::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( msx_audio );
}
void msx_cart_msx_audio::device_start()
{
// Install IO read/write handlers
address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO);
space.install_write_handler(0xc0, 0xc1, write8_delegate(FUNC(msx_cart_msx_audio::write_y8950), this));
space.install_read_handler(0xc0, 0xc1, read8_delegate(FUNC(msx_cart_msx_audio::read_y8950), this));
}
void msx_cart_msx_audio::initialize_cartridge()
{
if ( get_rom_size() != 0x8000 )
{
fatalerror("msx_audio: Invalid ROM size\n");
}
}
READ8_MEMBER(msx_cart_msx_audio::read_cart)
{
if (offset >= 0x4000 && offset < 0xC000)
{
return m_rom[offset - 0x4000];
}
return 0xff;
}
WRITE8_MEMBER(msx_cart_msx_audio::write_y8950)
{
m_y8950->write(space, offset, data);
}
READ8_MEMBER(msx_cart_msx_audio::read_y8950)
{
return m_y8950->read(space, offset);
}

View File

@ -0,0 +1,35 @@
#ifndef __MSX_CART_MSX_AUDIO_H
#define __MSX_CART_MSX_AUDIO_H
#include "bus/msx_cart/cartridge.h"
#include "sound/8950intf.h"
#include "machine/6850acia.h"
extern const device_type MSX_CART_MSX_AUDIO;
class msx_cart_msx_audio : public device_t
, public msx_cart_interface
{
public:
msx_cart_msx_audio(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 initialize_cartridge();
virtual DECLARE_READ8_MEMBER(read_cart);
DECLARE_WRITE8_MEMBER(write_y8950);
DECLARE_READ8_MEMBER(read_y8950);
private:
required_device<y8950_device> m_y8950;
required_device<acia6850_device> m_acia6850;
};
#endif

View File

@ -153,7 +153,7 @@ SOUNDS += YM2612
#SOUNDS += YM3438
SOUNDS += YM3812
SOUNDS += YM3526
#SOUNDS += Y8950
SOUNDS += Y8950
SOUNDS += YMF262
#SOUNDS += YMF271
#SOUNDS += YMF278B