Continuing new device implementation for SN76496 and clones - hyperspt.c, sbasketb.c, trackfld.c, yiear.c [David Haywood, Osso]

Comment:  "make depend" is required here.
This commit is contained in:
Scott Stone 2012-08-29 18:23:02 +00:00
parent d01ca81899
commit b06faaf87c
9 changed files with 102 additions and 41 deletions

View File

@ -13,7 +13,6 @@ typedef struct _trackfld_audio_state trackfld_audio_state;
struct _trackfld_audio_state
{
/* sound-related */
int m_SN76496_latch;
int m_last_addr;
int m_last_irq;
@ -46,7 +45,6 @@ static DEVICE_START( trackfld_audio )
state->m_vlm = device->machine().device("vlm");
/* sound */
device->save_item(NAME(state->m_SN76496_latch));
device->save_item(NAME(state->m_last_addr));
device->save_item(NAME(state->m_last_irq));
}
@ -55,7 +53,6 @@ static DEVICE_RESET( trackfld_audio )
{
trackfld_audio_state *state = get_safe_token(device);
state->m_SN76496_latch = 0;
state->m_last_addr = 0;
state->m_last_irq = 0;
}
@ -158,21 +155,8 @@ WRITE8_HANDLER( konami_sh_irqtrigger_w )
}
WRITE8_HANDLER( konami_SN76496_latch_w )
{
device_t *audio = space->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
state->m_SN76496_latch = data;
}
WRITE8_DEVICE_HANDLER( konami_SN76496_w )
{
device_t *audio = device->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
sn76496_w(device, offset, state->m_SN76496_latch);
}
/*****************************************************************************
DEVICE DEFINITION
*****************************************************************************/

View File

@ -82,8 +82,8 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, hyperspt_state )
AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w) /* speech data */
AM_RANGE(0xc000, 0xdfff) AM_DEVWRITE_LEGACY("vlm", hyperspt_sound_w) /* speech and output control */
AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
AM_RANGE(0xe001, 0xe001) AM_WRITE_LEGACY(konami_SN76496_latch_w) /* Loads the snd command into the snd latch */
AM_RANGE(0xe002, 0xe002) AM_DEVWRITE_LEGACY("snsnd", konami_SN76496_w) /* This address triggers the SN chip to read the data port. */
AM_RANGE(0xe001, 0xe001) AM_WRITE(konami_SN76496_latch_w) /* Loads the snd command into the snd latch */
AM_RANGE(0xe002, 0xe002) AM_WRITE(konami_SN76496_w) /* This address triggers the SN chip to read the data port. */
ADDRESS_MAP_END
static ADDRESS_MAP_START( soundb_map, AS_PROGRAM, 8, hyperspt_state )
@ -94,8 +94,8 @@ static ADDRESS_MAP_START( soundb_map, AS_PROGRAM, 8, hyperspt_state )
AM_RANGE(0xa000, 0xa000) AM_NOP
AM_RANGE(0xc000, 0xdfff) AM_DEVWRITE_LEGACY("hyprolyb_adpcm", hyprolyb_adpcm_w) /* speech and output control */
AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
AM_RANGE(0xe001, 0xe001) AM_WRITE_LEGACY(konami_SN76496_latch_w) /* Loads the snd command into the snd latch */
AM_RANGE(0xe002, 0xe002) AM_DEVWRITE_LEGACY("snsnd", konami_SN76496_w) /* This address triggers the SN chip to read the data port. */
AM_RANGE(0xe001, 0xe001) AM_WRITE(konami_SN76496_latch_w) /* Loads the snd command into the snd latch */
AM_RANGE(0xe002, 0xe002) AM_WRITE(konami_SN76496_w) /* This address triggers the SN chip to read the data port. */
ADDRESS_MAP_END
static INPUT_PORTS_START( hyperspt )
@ -280,6 +280,14 @@ static INTERRUPT_GEN( vblank_irq )
device_set_input_line(device, 0, HOLD_LINE);
}
//-------------------------------------------------
// sn76496_config psg_intf
//-------------------------------------------------
static const sn76496_config psg_intf =
{
DEVCB_NULL
};
static MACHINE_CONFIG_START( hyperspt, hyperspt_state )
@ -315,8 +323,9 @@ static MACHINE_CONFIG_START( hyperspt, hyperspt_state )
MCFG_DAC_ADD("dac")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MCFG_SOUND_ADD("snsnd", SN76496, XTAL_14_31818MHz/8) /* verified on pcb */
MCFG_SOUND_ADD("snsnd", SN76496_NEW, XTAL_14_31818MHz/8) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_CONFIG(psg_intf)
MCFG_SOUND_ADD("vlm", VLM5030, XTAL_3_579545MHz) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)

View File

@ -99,8 +99,8 @@ static ADDRESS_MAP_START( sbasketb_sound_map, AS_PROGRAM, 8, sbasketb_state )
AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w) /* speech data */
AM_RANGE(0xc000, 0xdfff) AM_DEVWRITE_LEGACY("vlm", hyperspt_sound_w) /* speech and output controll */
AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
AM_RANGE(0xe001, 0xe001) AM_WRITE_LEGACY(konami_SN76496_latch_w) /* Loads the snd command into the snd latch */
AM_RANGE(0xe002, 0xe002) AM_DEVWRITE_LEGACY("snsnd", konami_SN76496_w) /* This address triggers the SN chip to read the data port. */
AM_RANGE(0xe001, 0xe001) AM_WRITE(konami_SN76496_latch_w) /* Loads the snd command into the snd latch */
AM_RANGE(0xe002, 0xe002) AM_WRITE(konami_SN76496_w) /* This address triggers the SN chip to read the data port. */
ADDRESS_MAP_END
@ -184,6 +184,16 @@ static INTERRUPT_GEN( vblank_irq )
device_set_input_line(device, 0, HOLD_LINE);
}
//-------------------------------------------------
// sn76496_config psg_intf
//-------------------------------------------------
static const sn76496_config psg_intf =
{
DEVCB_NULL
};
static MACHINE_CONFIG_START( sbasketb, sbasketb_state )
/* basic machine hardware */
@ -216,8 +226,9 @@ static MACHINE_CONFIG_START( sbasketb, sbasketb_state )
MCFG_DAC_ADD("dac")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MCFG_SOUND_ADD("snsnd", SN76489, XTAL_14_31818MHz / 8)
MCFG_SOUND_ADD("snsnd", SN76489_NEW, XTAL_14_31818MHz / 8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_CONFIG(psg_intf)
MCFG_SOUND_ADD("vlm", VLM5030, XTAL_3_579545MHz) /* Schematics say 3.58MHz, but board uses 3.579545MHz xtal */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)

View File

@ -275,8 +275,8 @@ WRITE8_MEMBER(trackfld_state::trackfld_VLM5030_control_w)
static ADDRESS_MAP_START( yieartf_map, AS_PROGRAM, 8, trackfld_state )
AM_RANGE(0x0000, 0x0000) AM_READ(trackfld_speech_r) AM_WRITE_LEGACY(konami_SN76496_latch_w)
AM_RANGE(0x0001, 0x0001) AM_DEVWRITE_LEGACY("snsnd", konami_SN76496_w)
AM_RANGE(0x0000, 0x0000) AM_READ(trackfld_speech_r) AM_WRITE(konami_SN76496_latch_w)
AM_RANGE(0x0001, 0x0001) AM_WRITE(konami_SN76496_w)
AM_RANGE(0x0002, 0x0002) AM_WRITE(trackfld_VLM5030_control_w)
AM_RANGE(0x0003, 0x0003) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w)
AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x007f) AM_WRITE(watchdog_reset_w) /* AFE */
@ -398,8 +398,7 @@ ADDRESS_MAP_END
READ8_MEMBER(trackfld_state::trackfld_SN76496_r)
{
device_t *device = machine().device("snsnd");
konami_SN76496_w(device, 0, 0);
konami_SN76496_w(space, 0, 0);
return 0xff; // ?
}
@ -408,8 +407,8 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, trackfld_state )
AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x1c00) AM_RAM
AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_READ(soundlatch_byte_r)
AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1fff) AM_READ_LEGACY(trackfld_sh_timer_r)
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1fff) AM_WRITE_LEGACY(konami_SN76496_latch_w)
AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fff) AM_READ(trackfld_SN76496_r) AM_DEVWRITE_LEGACY("snsnd",konami_SN76496_w)
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1fff) AM_WRITE(konami_SN76496_latch_w)
AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fff) AM_READ(trackfld_SN76496_r) AM_WRITE(konami_SN76496_w)
AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1ff8) AM_DEVWRITE("dac", dac_device, write_unsigned8)
AM_RANGE(0xe001, 0xe001) AM_MIRROR(0x1ff8) AM_NOP /* watch dog ?; reaktor reads here */
AM_RANGE(0xe002, 0xe002) AM_MIRROR(0x1ff8) AM_DEVREAD_LEGACY("vlm", trackfld_speech_r)
@ -422,8 +421,8 @@ static ADDRESS_MAP_START( hyprolyb_sound_map, AS_PROGRAM, 8, trackfld_state )
AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x1c00) AM_RAM
AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_READ(soundlatch_byte_r)
AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1fff) AM_READ_LEGACY(trackfld_sh_timer_r)
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1fff) AM_WRITE_LEGACY(konami_SN76496_latch_w)
AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fff) AM_READ(trackfld_SN76496_r) AM_DEVWRITE_LEGACY("snsnd",konami_SN76496_w)
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1fff) AM_WRITE(konami_SN76496_latch_w)
AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fff) AM_READ(trackfld_SN76496_r) AM_WRITE(konami_SN76496_w)
AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1ff8) AM_DEVWRITE("dac", dac_device, write_unsigned8)
AM_RANGE(0xe001, 0xe001) AM_MIRROR(0x1ff8) AM_NOP /* watch dog ?; reaktor reads here */
AM_RANGE(0xe002, 0xe002) AM_MIRROR(0x1ff8) AM_DEVREAD_LEGACY("hyprolyb_adpcm", hyprolyb_adpcm_busy_r)
@ -902,6 +901,14 @@ static INTERRUPT_GEN( vblank_nmi )
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
//-------------------------------------------------
// sn76496_config psg_intf
//-------------------------------------------------
static const sn76496_config psg_intf =
{
DEVCB_NULL
};
static MACHINE_CONFIG_START( trackfld, trackfld_state )
@ -939,8 +946,9 @@ static MACHINE_CONFIG_START( trackfld, trackfld_state )
MCFG_DAC_ADD("dac")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MCFG_SOUND_ADD("snsnd", SN76496, SOUND_CLOCK/8)
MCFG_SOUND_ADD("snsnd", SN76496_NEW, SOUND_CLOCK/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_CONFIG(psg_intf)
MCFG_SOUND_ADD("vlm", VLM5030, VLM_CLOCK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@ -993,8 +1001,9 @@ static MACHINE_CONFIG_START( yieartf, trackfld_state )
MCFG_DAC_ADD("dac")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MCFG_SOUND_ADD("snsnd", SN76496, MASTER_CLOCK/6/2)
MCFG_SOUND_ADD("snsnd", SN76496_NEW, MASTER_CLOCK/6/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_CONFIG(psg_intf)
MCFG_SOUND_ADD("vlm", VLM5030, VLM_CLOCK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)

View File

@ -103,6 +103,7 @@ Sound: VLM5030 at 7B
#include "includes/yiear.h"
READ8_MEMBER(yiear_state::yiear_speech_r)
{
device_t *device = machine().device("vlm");
@ -141,8 +142,8 @@ static INTERRUPT_GEN( yiear_nmi_interrupt )
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, yiear_state )
AM_RANGE(0x0000, 0x0000) AM_READ(yiear_speech_r)
AM_RANGE(0x4000, 0x4000) AM_WRITE(yiear_control_w)
AM_RANGE(0x4800, 0x4800) AM_WRITE_LEGACY(konami_SN76496_latch_w)
AM_RANGE(0x4900, 0x4900) AM_DEVWRITE_LEGACY("snsnd", konami_SN76496_w)
AM_RANGE(0x4800, 0x4800) AM_WRITE(konami_SN76496_latch_w)
AM_RANGE(0x4900, 0x4900) AM_WRITE(konami_SN76496_w)
AM_RANGE(0x4a00, 0x4a00) AM_WRITE(yiear_VLM5030_control_w)
AM_RANGE(0x4b00, 0x4b00) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w)
AM_RANGE(0x4c00, 0x4c00) AM_READ_PORT("DSW2")
@ -276,6 +277,15 @@ static MACHINE_RESET( yiear )
state->m_yiear_nmi_enable = 0;
}
//-------------------------------------------------
// sn76496_config psg_intf
//-------------------------------------------------
static const sn76496_config psg_intf =
{
DEVCB_NULL
};
static MACHINE_CONFIG_START( yiear, yiear_state )
/* basic machine hardware */
@ -306,8 +316,9 @@ static MACHINE_CONFIG_START( yiear, yiear_state )
MCFG_SOUND_ADD("trackfld_audio", TRACKFLD_AUDIO, 0)
MCFG_SOUND_ADD("snsnd", SN76489A, XTAL_18_432MHz/12) /* verified on pcb */
MCFG_SOUND_ADD("snsnd", SN76489A_NEW, XTAL_18_432MHz/12) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_CONFIG(psg_intf)
MCFG_SOUND_ADD("vlm", VLM5030, XTAL_3_579545MHz) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)

View File

@ -1,3 +1,6 @@
#include "sound/sn76496.h"
class hyperspt_state : public driver_device
{
public:
@ -6,13 +9,16 @@ public:
m_spriteram(*this, "spriteram"),
m_scroll(*this, "scroll"),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"){ }
m_colorram(*this, "colorram"),
m_sn(*this, "snsnd")
{ }
/* memory pointers */
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_scroll;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_colorram;
optional_device<sn76496_new_device> m_sn;
UINT8 * m_scroll2;
UINT8 * m_spriteram2;
@ -27,6 +33,10 @@ public:
DECLARE_WRITE8_MEMBER(hyperspt_colorram_w);
DECLARE_WRITE8_MEMBER(hyperspt_flipscreen_w);
DECLARE_DRIVER_INIT(hyperspt);
UINT8 m_SN76496_latch;
DECLARE_WRITE8_MEMBER( konami_SN76496_latch_w ) { m_SN76496_latch = data; };
DECLARE_WRITE8_MEMBER( konami_SN76496_w ) { m_sn->write(space, offset, m_SN76496_latch); };
};
/*----------- defined in video/hyperspt.c -----------*/

View File

@ -1,3 +1,6 @@
#include "sound/sn76496.h"
class sbasketb_state : public driver_device
{
public:
@ -8,7 +11,9 @@ public:
m_spriteram(*this, "spriteram"),
m_palettebank(*this, "palettebank"),
m_spriteram_select(*this, "spriteramsel"),
m_scroll(*this, "scroll"){ }
m_scroll(*this, "scroll"),
m_sn(*this, "snsnd")
{ }
/* memory pointers */
required_shared_ptr<UINT8> m_colorram;
@ -17,6 +22,7 @@ public:
required_shared_ptr<UINT8> m_palettebank;
required_shared_ptr<UINT8> m_spriteram_select;
required_shared_ptr<UINT8> m_scroll;
optional_device<sn76489_new_device> m_sn;
/* video-related */
tilemap_t *m_bg_tilemap;
@ -29,6 +35,10 @@ public:
DECLARE_WRITE8_MEMBER(sbasketb_colorram_w);
DECLARE_WRITE8_MEMBER(sbasketb_flipscreen_w);
DECLARE_DRIVER_INIT(sbasketb);
UINT8 m_SN76496_latch;
DECLARE_WRITE8_MEMBER( konami_SN76496_latch_w ) { m_SN76496_latch = data; };
DECLARE_WRITE8_MEMBER( konami_SN76496_w ) { m_sn->write(space, offset, m_SN76496_latch); };
};
/*----------- defined in video/sbasketb.c -----------*/

View File

@ -4,6 +4,7 @@
***************************************************************************/
#include "sound/sn76496.h"
class trackfld_state : public driver_device
{
@ -15,7 +16,9 @@ public:
m_spriteram(*this, "spriteram"),
m_scroll2(*this, "scroll2"),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"){ }
m_colorram(*this, "colorram"),
m_sn(*this, "snsnd")
{ }
/* memory pointers */
required_shared_ptr<UINT8> m_spriteram2;
@ -24,6 +27,7 @@ public:
required_shared_ptr<UINT8> m_scroll2;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_colorram;
optional_device<sn76496_new_device> m_sn;
/* video-related */
tilemap_t *m_bg_tilemap;
@ -51,6 +55,10 @@ public:
DECLARE_DRIVER_INIT(atlantol);
DECLARE_DRIVER_INIT(wizzquiz);
DECLARE_DRIVER_INIT(mastkin);
UINT8 m_SN76496_latch;
DECLARE_WRITE8_MEMBER( konami_SN76496_latch_w ) { m_SN76496_latch = data; };
DECLARE_WRITE8_MEMBER( konami_SN76496_w ) { m_sn->write(space, offset, m_SN76496_latch); };
};

View File

@ -1,3 +1,5 @@
#include "sound/sn76496.h"
class yiear_state : public driver_device
{
public:
@ -5,12 +7,15 @@ public:
: driver_device(mconfig, type, tag) ,
m_spriteram(*this, "spriteram"),
m_spriteram2(*this, "spriteram2"),
m_videoram(*this, "videoram"){ }
m_videoram(*this, "videoram"),
m_sn(*this, "snsnd")
{ }
/* memory pointers */
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_spriteram2;
required_shared_ptr<UINT8> m_videoram;
optional_device<sn76489a_new_device> m_sn;
/* video-related */
tilemap_t *m_bg_tilemap;
@ -21,6 +26,10 @@ public:
DECLARE_WRITE8_MEMBER(yiear_control_w);
DECLARE_READ8_MEMBER(yiear_speech_r);
DECLARE_WRITE8_MEMBER(yiear_VLM5030_control_w);
UINT8 m_SN76496_latch;
DECLARE_WRITE8_MEMBER( konami_SN76496_latch_w ) { m_SN76496_latch = data; };
DECLARE_WRITE8_MEMBER( konami_SN76496_w ) { m_sn->write(space, offset, m_SN76496_latch); };
};