Fixed MSM sounds

This commit is contained in:
darq 2016-12-08 17:25:22 +01:00
parent 4146ff7e70
commit 34474bf869
2 changed files with 29 additions and 13 deletions

View File

@ -56,6 +56,17 @@ WRITE8_MEMBER(yunsung8_state::bankswitch_w)
logerror("CPU #0 - PC %04X: Bank %02X\n", space.device().safe_pc(), data);
}
READ8_MEMBER(yunsung8_state::sound_command_r)
{
m_audiocpu->set_input_line (0, CLEAR_LINE);
return (m_soundlatch->read (space, 0));
}
WRITE8_MEMBER (yunsung8_state::sound_command_w)
{
m_audiocpu->set_input_line (0, ASSERT_LINE);
}
/*
Banked Video RAM:
@ -78,7 +89,7 @@ static ADDRESS_MAP_START( port_map, AS_IO, 8, yunsung8_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_READ_PORT("SYSTEM") AM_WRITE(videobank_w) // video RAM bank
AM_RANGE(0x01, 0x01) AM_READ_PORT("P1") AM_WRITE(bankswitch_w) // ROM Bank + Layers Enable
AM_RANGE(0x02, 0x02) AM_READ_PORT("P2") AM_DEVWRITE("soundlatch", generic_latch_8_device, write) // To Sound CPU
AM_RANGE(0x02, 0x02) AM_READ_PORT("P2") AM_WRITE(sound_command_w) // To Sound CPU
AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1")
AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW2")
AM_RANGE(0x06, 0x06) AM_WRITE(flipscreen_w) // Flip Screen
@ -115,12 +126,12 @@ WRITE8_MEMBER(yunsung8_state::adpcm_w)
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, yunsung8_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("soundbank") // Banked ROM
AM_RANGE(0xe000, 0xe000) AM_WRITE(sound_bankswitch_w ) // ROM Bank
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("soundbank") // Banked ROM
AM_RANGE(0xe000, 0xe000) AM_WRITE(sound_bankswitch_w) // ROM Bank
AM_RANGE(0xe400, 0xe400) AM_WRITE(adpcm_w)
AM_RANGE(0xec00, 0xec01) AM_DEVWRITE("ymsnd", ym3812_device, write)
AM_RANGE(0xf000, 0xf7ff) AM_RAM
AM_RANGE(0xf800, 0xf800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) // From Main CPU
AM_RANGE(0xf800, 0xf800) AM_READ(sound_command_r) // From Main CPU
ADDRESS_MAP_END
@ -488,8 +499,6 @@ static MACHINE_CONFIG_START( yunsung8, yunsung8_state )
MCFG_CPU_ADD("audiocpu", Z80, XTAL_16MHz/4) /* ? */
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", yunsung8_state, irq0_line_hold) /* NMI caused by the MSM5205? */
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@ -735,8 +744,8 @@ ROM_END
***************************************************************************/
GAME( 1995, cannball, 0, yunsung8, cannball, driver_device, 0, ROT0, "Yun Sung / Soft Vision", "Cannon Ball (Yun Sung, horizontal)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1995, cannballv, cannball, yunsung8, cannbalv, driver_device, 0, ROT270, "Yun Sung / T&K", "Cannon Ball (Yun Sung, vertical)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1995, magix, 0, yunsung8, magix, driver_device, 0, ROT0, "Yun Sung", "Magix / Rock", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1995, magixb, magix, yunsung8, magix, driver_device, 0, ROT0, "Yun Sung", "Magix / Rock (no copyright message)",MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // was marked as bootleg, but has been seen on original PCBs
GAME( 1994?, rocktris, 0, yunsung8, rocktris, driver_device, 0, ROT0, "Yun Sung", "Rock Tris", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1995, cannball, 0, yunsung8, cannball, driver_device, 0, ROT0, "Yun Sung / Soft Vision", "Cannon Ball (Yun Sung, horizontal)", MACHINE_SUPPORTS_SAVE )
GAME( 1995, cannballv, cannball, yunsung8, cannbalv, driver_device, 0, ROT270, "Yun Sung / T&K", "Cannon Ball (Yun Sung, vertical)", MACHINE_SUPPORTS_SAVE )
GAME( 1995, magix, 0, yunsung8, magix, driver_device, 0, ROT0, "Yun Sung", "Magix / Rock", MACHINE_SUPPORTS_SAVE )
GAME( 1995, magixb, magix, yunsung8, magix, driver_device, 0, ROT0, "Yun Sung", "Magix / Rock (no copyright message)", MACHINE_SUPPORTS_SAVE ) // was marked as bootleg, but has been seen on original PCBs
GAME( 1994?, rocktris, 0, yunsung8, rocktris, driver_device, 0, ROT0, "Yun Sung", "Rock Tris", MACHINE_SUPPORTS_SAVE )

View File

@ -6,6 +6,7 @@
*************************************************************************/
#include "machine/gen_latch.h"
#include "sound/msm5205.h"
class yunsung8_state : public driver_device
@ -14,10 +15,13 @@ public:
yunsung8_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu") ,
m_audiocpu(*this, "audiocpu"),
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch")
{
}
/* video-related */
tilemap_t *m_tilemap_0;
@ -37,11 +41,14 @@ public:
required_device<msm5205_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
/* memory */
uint8_t m_videoram[0x4000];
DECLARE_WRITE8_MEMBER(bankswitch_w);
DECLARE_READ8_MEMBER(sound_command_r);
DECLARE_WRITE8_MEMBER(sound_command_w);
DECLARE_WRITE8_MEMBER(adpcm_w);
DECLARE_WRITE8_MEMBER(videobank_w);
DECLARE_READ8_MEMBER(videoram_r);