diff options
| author | 2014-05-22 19:04:16 +0000 | |
|---|---|---|
| committer | 2014-05-22 19:04:16 +0000 | |
| commit | 9b1c2dfc19c5a248286d94c4f42c4cb821f0d9f6 (patch) | |
| tree | 72265ceb39ce818d6e96c9633414e07ad242db02 | |
| parent | fbaaffefb8a0328db26a1ef4dd04405caffdb672 (diff) | |
(MESS) msx.c: Some small msx audio changes. Renamed the msx audio soft list sets. (nw)
| -rw-r--r-- | hash/msx1_cart.xml | 36 | ||||
| -rw-r--r-- | src/emu/bus/msx_cart/cartridge.c | 4 | ||||
| -rw-r--r-- | src/emu/bus/msx_cart/msx_audio.c | 205 | ||||
| -rw-r--r-- | src/emu/bus/msx_cart/msx_audio.h | 52 |
4 files changed, 259 insertions, 38 deletions
diff --git a/hash/msx1_cart.xml b/hash/msx1_cart.xml index d1186b4816f..a9b0e069291 100644 --- a/hash/msx1_cart.xml +++ b/hash/msx1_cart.xml @@ -14508,24 +14508,27 @@ kept for now until finding out what those bytes affect... </part> </software> - <software name="panaudio"> + <software name="fsca1" supported="no"> <description>Panasonic FS-CA1 MSX-Audio + BASIC (Jpn)</description> <year>1988</year> <publisher>Panasonic</publisher> <part name="cart" interface="msx_cart"> + <feature name="slot" value="msxaud_fsca1" /> <feature name="mapper" value="NOMAPPER" /> <dataarea name="rom" size="131072"> <rom name="msx audio (japan) (fs-ca1) (program).rom" size="131072" crc="90e893ba" sha1="930eae7057af1652abae794072b296a59decd61b" offset="0" /> </dataarea> + <dataarea name="ram" size="4096"> + </dataarea> </part> </software> - <software name="tosaudio"> + <software name="hxmu900"> <description>Toshiba HX-MU900 MSX-Audio</description> <year>1985</year> <publisher>Toshiba</publisher> <part name="cart" interface="msx_cart"> - <feature name="slot" value="msx_audio" /> + <feature name="slot" value="msxaud_hxmu900" /> <feature name="mapper" value="NOMAPPER" /> <dataarea name="rom" size="32768"> <rom name="msx audio (japan) (hx-mu900) (program).rom" size="32768" crc="dc405f8c" sha1="0d246b0e3edc63803fcce861ea07eadf29dc488c" offset="0" /> @@ -14533,6 +14536,20 @@ kept for now until finding out what those bytes affect... </part> </software> + <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="msxaud_nms1205" /> + <dataarea name="rom" size="32768"> + <rom name="nms1205.bin" size="32768" crc="5ecaeef0" sha1="c7463e1fd0433c5d41b70670d6c10fd781b66426" offset="0" /> + </dataarea> + <dataarea name="ram" size="32768"> + </dataarea> + </part> + </software> + <!-- Dictionary ROMs? --> <software name="natjis" supported="no"> <description>National FS-SR022 MSX-Jisho (Jpn)</description> @@ -17026,18 +17043,5 @@ 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> diff --git a/src/emu/bus/msx_cart/cartridge.c b/src/emu/bus/msx_cart/cartridge.c index 38cadc344e8..905fb25d136 100644 --- a/src/emu/bus/msx_cart/cartridge.c +++ b/src/emu/bus/msx_cart/cartridge.c @@ -36,7 +36,9 @@ 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_INTERNAL("msxaud_hxmu900", MSX_CART_MSX_AUDIO_HXMU900) + SLOT_INTERFACE_INTERNAL("msxaud_fsca1", MSX_CART_MSX_AUDIO_FSCA1) + SLOT_INTERFACE_INTERNAL("msxaud_nms1205", MSX_CART_MSX_AUDIO_NMS1205) SLOT_INTERFACE_END diff --git a/src/emu/bus/msx_cart/msx_audio.c b/src/emu/bus/msx_cart/msx_audio.c index 3a05cce7c61..6f29aa61016 100644 --- a/src/emu/bus/msx_cart/msx_audio.c +++ b/src/emu/bus/msx_cart/msx_audio.c @@ -1,15 +1,84 @@ /********************************************************************************** +Emulation of the different MSX-AUDIO devices: + +- Panasonic FS-CA1 + - Y8950 + - 4KB ram + +- Toshiba HX-MU900 + - Y8950 + - No midi ports + - No ram + +- Philips NMS-1205 + - Y8950 + - Midi ports + - 32KB sample ram + **********************************************************************************/ #include "emu.h" #include "msx_audio.h" -const device_type MSX_CART_MSX_AUDIO = &device_creator<msx_cart_msx_audio>; +const device_type MSX_CART_MSX_AUDIO_HXMU900 = &device_creator<msx_cart_msx_audio_hxmu900>; +const device_type MSX_CART_MSX_AUDIO_NMS1205 = &device_creator<msx_cart_msx_audio_nms1205>; +const device_type MSX_CART_MSX_AUDIO_FSCA1 = &device_creator<msx_cart_msx_audio_fsca1>; + + +msx_cart_msx_audio_hxmu900::msx_cart_msx_audio_hxmu900(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, MSX_CART_MSX_AUDIO_HXMU900, "MSX Cartridge - MSX-AUDIO HX-MU900", tag, owner, clock, "msx_audio_hxmu900", __FILE__) + , msx_cart_interface(mconfig, *this) + , m_y8950(*this, "y8950") +{ +} + + +static MACHINE_CONFIG_FRAGMENT( msx_audio_hxmu900 ) + // 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) // Not verified + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) +MACHINE_CONFIG_END + + +machine_config_constructor msx_cart_msx_audio_hxmu900::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( msx_audio_hxmu900 ); +} + + +void msx_cart_msx_audio_hxmu900::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(y8950_device::write), m_y8950.target())); + space.install_read_handler(0xc0, 0xc1, read8_delegate(FUNC(y8950_device::read), m_y8950.target())); +} + + +void msx_cart_msx_audio_hxmu900::initialize_cartridge() +{ + if (get_rom_size() < 0x8000) + { + fatalerror("msx_audio: Invalid ROM size\n"); + } +} + + +READ8_MEMBER(msx_cart_msx_audio_hxmu900::read_cart) +{ + if (offset >= 0x4000 && offset < 0xC000) + { + return m_rom[offset - 0x4000]; + } + return 0xff; +} + -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_msx_audio_nms1205::msx_cart_msx_audio_nms1205(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, MSX_CART_MSX_AUDIO_NMS1205, "MSX Cartridge - MSX-AUDIO NMS-1205", tag, owner, clock, "msx_audio_nms1205", __FILE__) , msx_cart_interface(mconfig, *this) , m_y8950(*this, "y8950") , m_acia6850(*this, "acia6850") @@ -17,7 +86,7 @@ msx_cart_msx_audio::msx_cart_msx_audio(const machine_config &mconfig, const char } -static MACHINE_CONFIG_FRAGMENT( msx_audio ) +static MACHINE_CONFIG_FRAGMENT( msx_audio_nms1205 ) // 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'. @@ -29,31 +98,31 @@ static MACHINE_CONFIG_FRAGMENT( msx_audio ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_msx_audio::device_mconfig_additions() const +machine_config_constructor msx_cart_msx_audio_nms1205::device_mconfig_additions() const { - return MACHINE_CONFIG_NAME( msx_audio ); + return MACHINE_CONFIG_NAME( msx_audio_nms1205 ); } -void msx_cart_msx_audio::device_start() +void msx_cart_msx_audio_nms1205::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)); + space.install_write_handler(0xc0, 0xc1, write8_delegate(FUNC(y8950_device::write), m_y8950.target())); + space.install_read_handler(0xc0, 0xc1, read8_delegate(FUNC(y8950_device::read), m_y8950.target())); } -void msx_cart_msx_audio::initialize_cartridge() +void msx_cart_msx_audio_nms1205::initialize_cartridge() { - if ( get_rom_size() != 0x8000 ) + if (get_rom_size() < 0x8000) { fatalerror("msx_audio: Invalid ROM size\n"); } } -READ8_MEMBER(msx_cart_msx_audio::read_cart) +READ8_MEMBER(msx_cart_msx_audio_nms1205::read_cart) { if (offset >= 0x4000 && offset < 0xC000) { @@ -63,13 +132,117 @@ READ8_MEMBER(msx_cart_msx_audio::read_cart) } -WRITE8_MEMBER(msx_cart_msx_audio::write_y8950) + + + + +msx_cart_msx_audio_fsca1::msx_cart_msx_audio_fsca1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, MSX_CART_MSX_AUDIO_FSCA1, "MSX Cartridge - MSX-AUDIO FS-CA1", tag, owner, clock, "msx_audio_fsca1", __FILE__) + , msx_cart_interface(mconfig, *this) + , m_y8950(*this, "y8950") + , m_7ffe(0) + , m_7fff(0) +{ +} + + +static MACHINE_CONFIG_FRAGMENT( msx_audio_fsca1 ) + // 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) +MACHINE_CONFIG_END + + +machine_config_constructor msx_cart_msx_audio_fsca1::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( msx_audio_fsca1 ); +} + + +void msx_cart_msx_audio_fsca1::device_start() +{ + // Install IO read/write handlers + address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO); + space.install_write_handler(0xc0, 0xc3, write8_delegate(FUNC(msx_cart_msx_audio_fsca1::write_y8950), this)); + space.install_read_handler(0xc0, 0xc3, read8_delegate(FUNC(msx_cart_msx_audio_fsca1::read_y8950), this)); +} + + +void msx_cart_msx_audio_fsca1::initialize_cartridge() +{ + if (get_rom_size() != 0x20000) + { + fatalerror("msx_audio_fsca1: Invalid ROM size\n"); + } +} + + +READ8_MEMBER(msx_cart_msx_audio_fsca1::read_cart) +{ + if (offset < 0x8000) + { + if ((offset & 0x3000) == 0x3000) + { + return m_ram[offset & 0xfff]; + } + return m_rom[offset]; + } + return 0xff; +} + + +WRITE8_MEMBER(msx_cart_msx_audio_fsca1::write_cart) +{ + if (offset == 0x7ffe) + { + m_7ffe = data; + return; + } + + if (offset == 0x7fff) + { + m_7fff = data; + return; + } + + if ((offset & 0xb000) == 0x3000) + { + m_ram[offset & 0xfff] = data; + return; + } + + printf("msx_cart_msx_audio_fsca1: Unhandled write %02x to %04x\n", data, offset); +} + + +WRITE8_MEMBER(msx_cart_msx_audio_fsca1::write_y8950) { - m_y8950->write(space, offset, data); + if (offset & 2) + { + if (m_7fff & 0x02) + { + m_y8950->write(space, offset, data); + } + } + else + { + if (m_7fff & 0x01) + { + m_y8950->write(space, offset, data); + } + } } -READ8_MEMBER(msx_cart_msx_audio::read_y8950) +READ8_MEMBER(msx_cart_msx_audio_fsca1::read_y8950) { - return m_y8950->read(space, offset); + if (offset & 2) + { + return (m_7fff & 0x02) ? m_y8950->read(space, offset) : 0xff; + } + else + { + return (m_7fff & 0x01) ? m_y8950->read(space, offset) : 0xff; + } } diff --git a/src/emu/bus/msx_cart/msx_audio.h b/src/emu/bus/msx_cart/msx_audio.h index 46505d39c87..066c4a50c38 100644 --- a/src/emu/bus/msx_cart/msx_audio.h +++ b/src/emu/bus/msx_cart/msx_audio.h @@ -6,14 +6,55 @@ #include "machine/6850acia.h" -extern const device_type MSX_CART_MSX_AUDIO; +extern const device_type MSX_CART_MSX_AUDIO_NMS1205; +extern const device_type MSX_CART_MSX_AUDIO_HXMU900; +extern const device_type MSX_CART_MSX_AUDIO_FSCA1; -class msx_cart_msx_audio : public device_t +class msx_cart_msx_audio_hxmu900 : public device_t + , public msx_cart_interface +{ +public: + msx_cart_msx_audio_hxmu900(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); + +private: + required_device<y8950_device> m_y8950; +}; + + +class msx_cart_msx_audio_nms1205 : public device_t + , public msx_cart_interface +{ +public: + msx_cart_msx_audio_nms1205(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); + +private: + required_device<y8950_device> m_y8950; + required_device<acia6850_device> m_acia6850; +}; + + +class msx_cart_msx_audio_fsca1 : public device_t , public msx_cart_interface { public: - msx_cart_msx_audio(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_msx_audio_fsca1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // device-level overrides virtual void device_start(); @@ -22,14 +63,15 @@ public: virtual void initialize_cartridge(); virtual DECLARE_READ8_MEMBER(read_cart); + virtual DECLARE_WRITE8_MEMBER(write_cart); DECLARE_WRITE8_MEMBER(write_y8950); DECLARE_READ8_MEMBER(read_y8950); private: required_device<y8950_device> m_y8950; - required_device<acia6850_device> m_acia6850; + UINT8 m_7ffe; + UINT8 m_7fff; }; - #endif |
