Moved DECO BSMT2000 sound board out to a device shared between Whitestar and tattass [R. Belmont]

not whatsnew: make clean strongly recommended after getting this.
This commit is contained in:
R. Belmont 2011-09-17 19:14:39 +00:00
parent 1d64e14960
commit d01d0460fa
8 changed files with 252 additions and 139 deletions

2
.gitattributes vendored
View File

@ -1655,6 +1655,8 @@ src/mame/audio/crbaloon.c svneol=native#text/plain
src/mame/audio/cyberbal.c svneol=native#text/plain
src/mame/audio/dcs.c svneol=native#text/plain
src/mame/audio/dcs.h svneol=native#text/plain
src/mame/audio/decobsmt.c svneol=native#text/plain
src/mame/audio/decobsmt.h svneol=native#text/plain
src/mame/audio/depthch.c svneol=native#text/plain
src/mame/audio/dkong.c svneol=native#text/plain
src/mame/audio/dragrace.c svneol=native#text/plain

172
src/mame/audio/decobsmt.c Normal file
View File

@ -0,0 +1,172 @@
/***************************************************************************
Data East Pinball BSMT2000 sound board
used for System 3 and Whitestar pinball games and Tattoo Assassins video
***************************************************************************/
#define ADDRESS_MAP_MODERN
#include "emu.h"
#include "audio/decobsmt.h"
#define M6809_TAG "soundcpu"
#define BSMT_TAG "bsmt"
/*
Overriding the child device's memory map fails when done from a parent device rather than the base driver.
Uncomment this out to observe.
*/
//#define USE_OVERRIDE_MAP
static ADDRESS_MAP_START( decobsmt_map, AS_PROGRAM, 8, decobsmt_device )
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_WRITE(bsmt_reset_w)
AM_RANGE(0x2002, 0x2003) AM_READ(bsmt_comms_r)
AM_RANGE(0x2006, 0x2007) AM_READ(bsmt_status_r)
AM_RANGE(0x6000, 0x6000) AM_WRITE(bsmt0_w)
AM_RANGE(0xa000, 0xa0ff) AM_WRITE(bsmt1_w)
AM_RANGE(0x2000, 0xffff) AM_ROM AM_REGION(":soundcpu", 0x2000)
ADDRESS_MAP_END
#ifdef USE_OVERRIDE_MAP
static ADDRESS_MAP_START( bsmt_map, AS_0, 8, decobsmt_device )
AM_RANGE(0x000000, 0xffffff) AM_ROM AM_REGION(":bsmt", 0)
ADDRESS_MAP_END
#endif
ROM_START( decobsmt )
ROM_REGION(0x1000000, BSMT_TAG, ROMREGION_ERASE00)
ROM_END
static INTERRUPT_GEN( decobsmt_firq_interrupt )
{
device_set_input_line(device, M6809_FIRQ_LINE, HOLD_LINE);
}
static void bsmt_ready_callback(bsmt2000_device &device)
{
decobsmt_device *decobsmt = device.machine().device<decobsmt_device>(DECOBSMT_TAG);
device_set_input_line(decobsmt->m_ourcpu, M6809_IRQ_LINE, ASSERT_LINE); /* BSMT is ready */
}
MACHINE_CONFIG_FRAGMENT( decobsmt )
MCFG_CPU_ADD(M6809_TAG, M6809, (3579580/2))
MCFG_CPU_PROGRAM_MAP(decobsmt_map)
MCFG_CPU_PERIODIC_INT(decobsmt_firq_interrupt, 489) /* Fixed FIRQ of 489Hz as measured on real (pinball) machine */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_BSMT2000_ADD("bsmt", 24000000)
#ifdef USE_OVERRIDE_MAP
MCFG_DEVICE_ADDRESS_MAP(AS_0, bsmt_map)
#endif
MCFG_BSMT2000_READY_CALLBACK(bsmt_ready_callback)
MCFG_SOUND_ROUTE(0, "lspeaker", 2.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 2.0)
MACHINE_CONFIG_END
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
const device_type DECOBSMT = &device_creator<decobsmt_device>;
//-------------------------------------------------
// machine_config_additions - device-specific
// machine configurations
//-------------------------------------------------
machine_config_constructor decobsmt_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( decobsmt );
}
const rom_entry *decobsmt_device::device_rom_region() const
{
return ROM_NAME( decobsmt );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// decobsmt_device - constructor
//-------------------------------------------------
decobsmt_device::decobsmt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, DECOBSMT, "Data East/Sega/Stern BSMT2000 Sound Board", tag, owner, clock),
m_ourcpu(*this, M6809_TAG),
m_bsmt(*this, BSMT_TAG)
{
m_shortname = "decobsmt";
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void decobsmt_device::device_start()
{
#ifndef USE_OVERRIDE_MAP
UINT8 *romsrc = machine().region("bsmt")->base();
astring tempstring;
UINT8 *romdst = machine().region(subtag(tempstring, "bsmt"))->base();
memcpy(romdst, romsrc, 0x1000000);
#endif
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void decobsmt_device::device_reset()
{
m_bsmt_latch = 0;
m_bsmt_reset = 0;
m_bsmt_comms = 0;
}
WRITE8_MEMBER(decobsmt_device::bsmt_reset_w)
{
UINT8 diff = data ^ m_bsmt_reset;
m_bsmt_reset = data;
if ((diff & 0x80) && !(data & 0x80))
m_bsmt->reset();
}
WRITE8_MEMBER(decobsmt_device::bsmt0_w)
{
m_bsmt_latch = data;
}
WRITE8_MEMBER(decobsmt_device::bsmt1_w)
{
m_bsmt->write_reg(offset ^ 0xff);
m_bsmt->write_data((m_bsmt_latch << 8) | data);
device_set_input_line(m_ourcpu, M6809_IRQ_LINE, CLEAR_LINE); /* BSMT is not ready */
}
READ8_MEMBER(decobsmt_device::bsmt_status_r)
{
return m_bsmt->read_status() << 7;
}
READ8_MEMBER(decobsmt_device::bsmt_comms_r)
{
return m_bsmt_comms;
}
WRITE8_MEMBER(decobsmt_device::bsmt_comms_w)
{
m_bsmt_comms = data;
}
WRITE_LINE_MEMBER(decobsmt_device::bsmt_reset_line)
{
device_set_input_line(m_ourcpu, INPUT_LINE_RESET, state);
}

56
src/mame/audio/decobsmt.h Normal file
View File

@ -0,0 +1,56 @@
#pragma once
#ifndef __DECOBSMT_H__
#define __DECOBSMT_H__
#include "emu.h"
#include "cpu/m6809/m6809.h"
#include "sound/bsmt2000.h"
#define DECOBSMT_TAG "decobsmt"
#define MCFG_DECOBSMT_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, DECOBSMT, 0)
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
class decobsmt_device : public device_t
{
public:
// construction/destruction
decobsmt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual const rom_entry *device_rom_region() const;
DECLARE_WRITE8_MEMBER(bsmt_reset_w);
DECLARE_READ8_MEMBER(bsmt_status_r);
DECLARE_WRITE8_MEMBER(bsmt0_w);
DECLARE_WRITE8_MEMBER(bsmt1_w);
DECLARE_READ8_MEMBER(bsmt_comms_r);
DECLARE_WRITE8_MEMBER(bsmt_comms_w);
DECLARE_WRITE_LINE_MEMBER(bsmt_reset_line);
required_device<cpu_device> m_ourcpu;
required_device<bsmt2000_device> m_bsmt;
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
private:
UINT8 m_bsmt_latch;
UINT8 m_bsmt_reset;
UINT8 m_bsmt_comms;
};
// device type definition
extern const device_type DECOBSMT;
#endif /* __DECOBSMT_H__ */

View File

@ -235,7 +235,6 @@ Notes:
#include "includes/deco32.h"
#include "sound/2151intf.h"
#include "sound/okim6295.h"
#include "sound/bsmt2000.h"
#include "video/decospr.h"
#include "video/deco16ic.h"
@ -515,12 +514,13 @@ static READ32_HANDLER( tattass_prot_r )
static WRITE32_HANDLER( tattass_prot_w )
{
deco32_state *state = space->machine().driver_data<deco32_state>();
/* Only sound port of chip is used - no protection */
if (offset==0x700/4) {
/* 'Swap bits 0 and 3 to correct for design error from BSMT schematic' */
int soundcommand = (data>>16)&0xff;
soundcommand = BITSWAP8(soundcommand,7,6,5,4,0,2,1,3);
soundlatch_w(space,0,soundcommand);
state->m_decobsmt->bsmt_comms_w(*space, 0, soundcommand);
}
}
@ -646,9 +646,9 @@ static WRITE32_HANDLER( tattass_control_w )
/* Sound board reset control */
if (data&0x80)
cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
state->m_decobsmt->bsmt_reset_line(CLEAR_LINE);
else
cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
state->m_decobsmt->bsmt_reset_line(ASSERT_LINE);
/* bit 0x4 fade cancel? */
/* bit 0x8 ?? */
@ -1031,42 +1031,6 @@ ADDRESS_MAP_END
/******************************************************************************/
static WRITE8_HANDLER(deco32_bsmt_reset_w)
{
deco32_state *state = space->machine().driver_data<deco32_state>();
UINT8 diff = data ^ state->m_bsmt_reset;
state->m_bsmt_reset = data;
if ((diff & 0x80) && !(data & 0x80))
devtag_reset(space->machine(), "bsmt");
}
static WRITE8_HANDLER(deco32_bsmt0_w)
{
deco32_state *state = space->machine().driver_data<deco32_state>();
state->m_bsmt_latch = data;
}
static void bsmt_ready_callback(bsmt2000_device &device)
{
cputag_set_input_line(device.machine(), "audiocpu", M6809_IRQ_LINE, ASSERT_LINE); /* BSMT is ready */
}
static WRITE8_HANDLER(deco32_bsmt1_w)
{
deco32_state *state = space->machine().driver_data<deco32_state>();
bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
bsmt->write_reg(offset ^ 0xff);
bsmt->write_data((state->m_bsmt_latch << 8) | data);
cputag_set_input_line(space->machine(), "audiocpu", M6809_IRQ_LINE, CLEAR_LINE); /* BSMT is not ready */
}
static READ8_HANDLER(deco32_bsmt_status_r)
{
bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
return bsmt->read_status() << 7;
}
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
AM_RANGE(0x000000, 0x00ffff) AM_ROM
AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE("ymsnd", ym2151_r, ym2151_w)
@ -1078,16 +1042,6 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE(h6280_irq_status_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( tattass_sound_map, AS_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_WRITE(deco32_bsmt_reset_w)
AM_RANGE(0x2002, 0x2003) AM_READ(soundlatch_r)
AM_RANGE(0x2006, 0x2007) AM_READ(deco32_bsmt_status_r)
AM_RANGE(0x6000, 0x6000) AM_WRITE(deco32_bsmt0_w)
AM_RANGE(0xa000, 0xa0ff) AM_WRITE(deco32_bsmt1_w)
AM_RANGE(0x2000, 0xffff) AM_ROM
ADDRESS_MAP_END
static READ8_HANDLER(latch_r)
{
deco32_state *state = space->machine().driver_data<deco32_state>();
@ -1744,12 +1698,6 @@ static INTERRUPT_GEN( deco32_vbl_interrupt )
device_set_input_line(device, ARM_IRQ_LINE, HOLD_LINE);
}
static INTERRUPT_GEN( tattass_snd_interrupt )
{
device_set_input_line(device, M6809_FIRQ_LINE, HOLD_LINE);
}
UINT16 captaven_pri_callback(UINT16 x)
{
if ((x&0x60)==0x00)
@ -2165,10 +2113,6 @@ static MACHINE_CONFIG_START( tattass, deco32_state )
MCFG_CPU_PROGRAM_MAP(tattass_map)
MCFG_CPU_VBLANK_INT("screen", deco32_vbl_interrupt)
MCFG_CPU_ADD("audiocpu", M6809, 2000000)
MCFG_CPU_PROGRAM_MAP(tattass_sound_map)
MCFG_CPU_PERIODIC_INT(tattass_snd_interrupt, 489) /* Fixed FIRQ of 489Hz as measured on real (pinball) machine */
MCFG_EEPROM_ADD("eeprom", eeprom_interface_tattass)
MCFG_SCREEN_ADD("screen", RASTER)
@ -2188,19 +2132,13 @@ static MACHINE_CONFIG_START( tattass, deco32_state )
MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
decospr_device::set_gfx_region(*device, 4);
MCFG_GFXDECODE(tattass)
MCFG_PALETTE_LENGTH(2048)
MCFG_VIDEO_START(nslasher)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_BSMT2000_ADD("bsmt", 24000000)
MCFG_BSMT2000_READY_CALLBACK(bsmt_ready_callback)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MCFG_DECOBSMT_ADD(DECOBSMT_TAG)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( nslasher, deco32_state )
@ -3002,7 +2940,7 @@ ROM_START( tattass )
ROM_LOAD32_WORD( "pp44.cpu", 0x000000, 0x80000, CRC(c3ca5b49) SHA1(c6420b0c20df1ae166b279504880ade65b1d8048) )
ROM_LOAD32_WORD( "pp45.cpu", 0x000002, 0x80000, CRC(d3f30de0) SHA1(5a0aa0f96d29299b3b337b4b51bc84e447eb74d0) )
ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */
ROM_REGION(0x10000, "soundcpu", 0 ) /* Sound CPU */
ROM_LOAD( "u7.snd", 0x00000, 0x10000, CRC(6947be8a) SHA1(4ac6c3c7f54501f23c434708cea6bf327bc8cf95) )
ROM_REGION( 0x200000, "gfx1", 0 )
@ -3075,7 +3013,7 @@ ROM_START( tattassa )
ROM_LOAD32_WORD( "rev232a.000", 0x000000, 0x80000, CRC(1a357112) SHA1(d7f78f90970fd56ca1452a4c138168568b06d868) )
ROM_LOAD32_WORD( "rev232a.001", 0x000002, 0x80000, CRC(550245d4) SHA1(c1b2b31768da9becebd907a8622d05aa68ecaa29) )
ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */
ROM_REGION(0x10000, "soundcpu", 0 ) /* Sound CPU */
ROM_LOAD( "u7.snd", 0x00000, 0x10000, CRC(6947be8a) SHA1(4ac6c3c7f54501f23c434708cea6bf327bc8cf95) )
ROM_REGION( 0x200000, "gfx1", 0 )

View File

@ -5,9 +5,8 @@
#define ADDRESS_MAP_MODERN
#include "emu.h"
#include "cpu/m6809/m6809.h"
#include "sound/bsmt2000.h"
#include "video/mc6845.h"
#include "audio/decobsmt.h"
#include "rendlay.h"
class whitestar_state : public driver_device
@ -17,19 +16,14 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_dmdcpu(*this, "dmdcpu"),
m_soundcpu(*this, "soundcpu"),
m_bsmt(*this, "bsmt"),
m_mc6845(*this, "mc6845")
m_mc6845(*this, "mc6845"),
m_decobsmt(*this, "decobsmt")
{ }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_dmdcpu;
required_device<cpu_device> m_soundcpu;
required_device<bsmt2000_device> m_bsmt;
required_device<mc6845_device> m_mc6845;
UINT8 m_bsmt_latch;
UINT8 m_bsmt_reset;
required_device<decobsmt_device> m_decobsmt;
UINT8 m_dmd_latch;
UINT8 m_dmd_ctrl;
@ -38,11 +32,6 @@ public:
UINT8 *m_vram;
DECLARE_WRITE8_MEMBER(bsmt_reset_w);
DECLARE_READ8_MEMBER(bsmt_status_r);
DECLARE_WRITE8_MEMBER(bsmt0_w);
DECLARE_WRITE8_MEMBER(bsmt1_w);
DECLARE_WRITE8_MEMBER(dmd_latch_w);
DECLARE_READ8_MEMBER(dmd_latch_r);
DECLARE_WRITE8_MEMBER(dmd_ctrl_w);
@ -95,7 +84,7 @@ static ADDRESS_MAP_START( whitestar_map, AS_PROGRAM, 8, whitestar_state )
AM_RANGE(0x3600, 0x3600) AM_WRITE(dmd_latch_w)
AM_RANGE(0x3601, 0x3601) AM_READWRITE(dmd_ctrl_r, dmd_ctrl_w)
AM_RANGE(0x3700, 0x3700) AM_READ(dmd_status_r)
AM_RANGE(0x3800, 0x3800) AM_WRITE_LEGACY(soundlatch_w)
AM_RANGE(0x3800, 0x3800) AM_DEVWRITE(DECOBSMT_TAG, decobsmt_device, bsmt_comms_w)
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("user1", 0x18000)
ADDRESS_MAP_END
@ -168,47 +157,6 @@ WRITE8_MEMBER(whitestar_state::dmd_status_w)
{
m_dmd_status = data & 0x0f;
}
/* Whitestar audio (similar to Tattoo Assassins) */
WRITE8_MEMBER(whitestar_state::bsmt_reset_w)
{
UINT8 diff = data ^ m_bsmt_reset;
m_bsmt_reset = data;
if ((diff & 0x80) && !(data & 0x80))
m_bsmt->reset();
}
WRITE8_MEMBER(whitestar_state::bsmt0_w)
{
m_bsmt_latch = data;
}
static void bsmt_ready_callback(bsmt2000_device &device)
{
cputag_set_input_line(device.machine(), "soundcpu", M6809_IRQ_LINE, ASSERT_LINE); /* BSMT is ready */
}
WRITE8_MEMBER(whitestar_state::bsmt1_w)
{
m_bsmt->write_reg(offset ^ 0xff);
m_bsmt->write_data((m_bsmt_latch << 8) | data);
device_set_input_line(m_soundcpu, M6809_IRQ_LINE, CLEAR_LINE); /* BSMT is not ready */
}
READ8_MEMBER(whitestar_state::bsmt_status_r)
{
return m_bsmt->read_status() << 7;
}
static ADDRESS_MAP_START( whitestar_sound_map, AS_PROGRAM, 8, whitestar_state )
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_WRITE(bsmt_reset_w)
AM_RANGE(0x2002, 0x2003) AM_READ_LEGACY(soundlatch_r)
AM_RANGE(0x2006, 0x2007) AM_READ(bsmt_status_r)
AM_RANGE(0x6000, 0x6000) AM_WRITE(bsmt0_w)
AM_RANGE(0xa000, 0xa0ff) AM_WRITE(bsmt1_w)
AM_RANGE(0x2000, 0xffff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( whitestar_dmd_map, AS_PROGRAM, 8, whitestar_state )
AM_RANGE(0x0000, 0x1fff) AM_RAM
@ -288,10 +236,6 @@ static MACHINE_CONFIG_START( whitestar, whitestar_state )
MCFG_CPU_PROGRAM_MAP(whitestar_map)
MCFG_CPU_PERIODIC_INT(whitestar_firq_interrupt, 976) // value taken from PinMAME
MCFG_CPU_ADD("soundcpu", M6809, (3579580/2))
MCFG_CPU_PROGRAM_MAP(whitestar_sound_map)
MCFG_CPU_PERIODIC_INT(whitestar_firq_interrupt, 489) /* Fixed FIRQ of 489Hz as measured on real (pinball) machine */
MCFG_CPU_ADD("dmdcpu", M6809, (8000000/4))
MCFG_CPU_PROGRAM_MAP(whitestar_dmd_map)
MCFG_CPU_PERIODIC_INT(whitestar_firq_interrupt, 80) // value taken from PinMAME
@ -299,12 +243,7 @@ static MACHINE_CONFIG_START( whitestar, whitestar_state )
MCFG_MACHINE_RESET( whitestar )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_BSMT2000_ADD("bsmt", 24000000)
MCFG_BSMT2000_READY_CALLBACK(bsmt_ready_callback)
MCFG_SOUND_ROUTE(0, "lspeaker", 2.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 2.0)
MCFG_DECOBSMT_ADD(DECOBSMT_TAG)
MCFG_MC6845_ADD("mc6845", MC6845, 2000000, whitestar_crtc6845_interface)

View File

@ -1,8 +1,14 @@
#include "audio/decobsmt.h"
class deco32_state : public driver_device
{
public:
deco32_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { }
: driver_device(mconfig, type, tag),
m_decobsmt(*this, "decobsmt")
{ }
required_device<decobsmt_device> m_decobsmt;
UINT32 *m_ram;
int m_raster_enable;
@ -16,8 +22,6 @@ public:
int m_pendingCommand;
int m_readBitCount;
int m_byteAddr;
UINT8 m_bsmt_latch;
UINT8 m_bsmt_reset;
int m_ace_ram_dirty;
int m_has_ace_ram;

View File

@ -596,6 +596,7 @@ $(MAMEOBJ)/dataeast.a: \
$(DRIVERS)/deco_mlc.o $(VIDEO)/deco_mlc.o \
$(DRIVERS)/deco156.o $(MACHINE)/deco156.o \
$(DRIVERS)/deco32.o $(VIDEO)/deco32.o \
$(AUDIO)/decobsmt.o \
$(DRIVERS)/decocass.o $(MACHINE)/decocass.o $(VIDEO)/decocass.o \
$(DRIVERS)/deshoros.o \
$(DRIVERS)/dietgo.o $(VIDEO)/dietgo.o \

View File

@ -39,6 +39,7 @@
******************************************************************************/
BSMT2000
DECOBSMT
H63484
NAMCO_50XX
NAMCO_51XX