mirror of
https://github.com/holub/mame
synced 2025-04-26 10:13:37 +03:00
device callback handler cleanup (nw)
This commit is contained in:
parent
de35bcf071
commit
c6533ad919
@ -169,29 +169,27 @@ Language
|
||||
#include "sound/sn76496.h"
|
||||
|
||||
|
||||
static void appoooh_adpcm_int(device_t *device, int st)
|
||||
WRITE_LINE_MEMBER(appoooh_state::appoooh_adpcm_int)
|
||||
{
|
||||
appoooh_state *state = device->machine().driver_data<appoooh_state>();
|
||||
|
||||
if (state->m_adpcm_address != 0xffffffff)
|
||||
if (m_adpcm_address != 0xffffffff)
|
||||
{
|
||||
if (state->m_adpcm_data == 0xffffffff)
|
||||
if (m_adpcm_data == 0xffffffff)
|
||||
{
|
||||
UINT8 *RAM = state->memregion("adpcm")->base();
|
||||
UINT8 *RAM = memregion("adpcm")->base();
|
||||
|
||||
state->m_adpcm_data = RAM[state->m_adpcm_address++];
|
||||
msm5205_data_w(device, state->m_adpcm_data >> 4);
|
||||
m_adpcm_data = RAM[m_adpcm_address++];
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4);
|
||||
|
||||
if (state->m_adpcm_data == 0x70)
|
||||
if (m_adpcm_data == 0x70)
|
||||
{
|
||||
state->m_adpcm_address = 0xffffffff;
|
||||
msm5205_reset_w(device, 1);
|
||||
m_adpcm_address = 0xffffffff;
|
||||
msm5205_reset_w(machine().device("msm"), 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(device, state->m_adpcm_data & 0x0f );
|
||||
state->m_adpcm_data = -1;
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data & 0x0f );
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -387,7 +385,7 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(appoooh_adpcm_int),/* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(appoooh_state,appoooh_adpcm_int),/* interrupt function */
|
||||
MSM5205_S64_4B /* 6KHz */
|
||||
};
|
||||
|
||||
|
@ -270,10 +270,9 @@ static GFXDECODE_START( ashnojoe )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
static void ym2203_irq_handler( device_t *device, int irq )
|
||||
WRITE_LINE_MEMBER(ashnojoe_state::ym2203_irq_handler)
|
||||
{
|
||||
ashnojoe_state *state = device->machine().driver_data<ashnojoe_state>();
|
||||
state->m_audiocpu->set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(ashnojoe_state::ym2203_write_a)
|
||||
@ -301,28 +300,27 @@ static const ym2203_interface ym2203_config =
|
||||
DEVCB_DRIVER_MEMBER(ashnojoe_state,ym2203_write_a),
|
||||
DEVCB_DRIVER_MEMBER(ashnojoe_state,ym2203_write_b),
|
||||
},
|
||||
DEVCB_LINE(ym2203_irq_handler)
|
||||
DEVCB_DRIVER_LINE_MEMBER(ashnojoe_state,ym2203_irq_handler)
|
||||
};
|
||||
|
||||
static void ashnojoe_vclk_cb( device_t *device, int st )
|
||||
WRITE_LINE_MEMBER(ashnojoe_state::ashnojoe_vclk_cb)
|
||||
{
|
||||
ashnojoe_state *state = device->machine().driver_data<ashnojoe_state>();
|
||||
if (state->m_msm5205_vclk_toggle == 0)
|
||||
if (m_msm5205_vclk_toggle == 0)
|
||||
{
|
||||
msm5205_data_w(device, state->m_adpcm_byte >> 4);
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_byte >> 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(device, state->m_adpcm_byte & 0xf);
|
||||
state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_byte & 0xf);
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
state->m_msm5205_vclk_toggle ^= 1;
|
||||
m_msm5205_vclk_toggle ^= 1;
|
||||
}
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(ashnojoe_vclk_cb),
|
||||
DEVCB_DRIVER_LINE_MEMBER(ashnojoe_state,ashnojoe_vclk_cb),
|
||||
MSM5205_S48_4B
|
||||
};
|
||||
|
||||
|
@ -258,20 +258,18 @@ WRITE8_MEMBER(asuka_state::sound_bankswitch_2151_w)
|
||||
|
||||
|
||||
|
||||
static void asuka_msm5205_vck( device_t *device, int st )
|
||||
WRITE_LINE_MEMBER(asuka_state::asuka_msm5205_vck)
|
||||
{
|
||||
asuka_state *state = device->machine().driver_data<asuka_state>();
|
||||
|
||||
if (state->m_adpcm_data != -1)
|
||||
if (m_adpcm_data != -1)
|
||||
{
|
||||
msm5205_data_w(device, state->m_adpcm_data & 0x0f);
|
||||
state->m_adpcm_data = -1;
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
state->m_adpcm_data = device->machine().root_device().memregion("ymsnd")->base()[state->m_adpcm_pos];
|
||||
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0xffff;
|
||||
msm5205_data_w(device, state->m_adpcm_data >> 4);
|
||||
m_adpcm_data = machine().root_device().memregion("ymsnd")->base()[m_adpcm_pos];
|
||||
m_adpcm_pos = (m_adpcm_pos + 1) & 0xffff;
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -779,7 +777,7 @@ static const ym2610_interface ym2610_config =
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(asuka_msm5205_vck), /* VCK function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(asuka_state,asuka_msm5205_vck), /* VCK function */
|
||||
MSM5205_S48_4B /* 8 kHz */
|
||||
};
|
||||
|
||||
|
@ -83,16 +83,14 @@ ADDRESS_MAP_END
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
static void battlera_adpcm_int(device_t *device, int st)
|
||||
WRITE_LINE_MEMBER(battlera_state::battlera_adpcm_int)
|
||||
{
|
||||
battlera_state *state = device->machine().driver_data<battlera_state>();
|
||||
msm5205_data_w(machine().device("msm"),m_msm5205next >> 4);
|
||||
m_msm5205next <<= 4;
|
||||
|
||||
msm5205_data_w(device,state->m_msm5205next >> 4);
|
||||
state->m_msm5205next <<= 4;
|
||||
|
||||
state->m_toggle = 1 - state->m_toggle;
|
||||
if (state->m_toggle)
|
||||
device->machine().device("audiocpu")->execute().set_input_line(1, HOLD_LINE);
|
||||
m_toggle = 1 - m_toggle;
|
||||
if (m_toggle)
|
||||
machine().device("audiocpu")->execute().set_input_line(1, HOLD_LINE);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(battlera_state::battlera_adpcm_data_w)
|
||||
@ -217,7 +215,7 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(battlera_adpcm_int),/* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(battlera_state,battlera_adpcm_int),/* interrupt function */
|
||||
MSM5205_S48_4B /* 8KHz */
|
||||
};
|
||||
|
||||
|
@ -104,6 +104,8 @@ public:
|
||||
DECLARE_WRITE8_MEMBER( saiyugoub1_adpcm_control_w );
|
||||
DECLARE_WRITE8_MEMBER( saiyugoub1_m5205_clk_w );
|
||||
DECLARE_READ8_MEMBER( saiyugoub1_m5205_irq_r );
|
||||
DECLARE_WRITE_LINE_MEMBER(saiyugoub1_m5205_irq_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(chinagat_irq_handler);
|
||||
};
|
||||
|
||||
|
||||
@ -311,10 +313,9 @@ READ8_MEMBER(chinagat_state::saiyugoub1_m5205_irq_r )
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void saiyugoub1_m5205_irq_w( device_t *device, int st )
|
||||
WRITE_LINE_MEMBER(chinagat_state::saiyugoub1_m5205_irq_w)
|
||||
{
|
||||
chinagat_state *state = device->machine().driver_data<chinagat_state>();
|
||||
state->m_adpcm_sound_irq = 1;
|
||||
m_adpcm_sound_irq = 1;
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, chinagat_state )
|
||||
@ -504,16 +505,15 @@ static GFXDECODE_START( chinagat )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
static void chinagat_irq_handler(device_t *device, int irq )
|
||||
WRITE_LINE_MEMBER(chinagat_state::chinagat_irq_handler)
|
||||
{
|
||||
chinagat_state *state = device->machine().driver_data<chinagat_state>();
|
||||
state->m_snd_cpu->execute().set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE );
|
||||
m_snd_cpu->execute().set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE );
|
||||
}
|
||||
|
||||
/* This on the bootleg board, instead of the m6295 */
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(saiyugoub1_m5205_irq_w), /* Interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(chinagat_state,saiyugoub1_m5205_irq_w), /* Interrupt function */
|
||||
MSM5205_S64_4B /* vclk input mode (6030Hz, 4-bit) */
|
||||
};
|
||||
|
||||
@ -525,7 +525,7 @@ static const ym2203_interface ym2203_config =
|
||||
AY8910_DEFAULT_LOADS,
|
||||
DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL
|
||||
},
|
||||
DEVCB_LINE(chinagat_irq_handler)
|
||||
DEVCB_DRIVER_LINE_MEMBER(chinagat_state,chinagat_irq_handler)
|
||||
};
|
||||
|
||||
|
||||
|
@ -76,6 +76,7 @@ public:
|
||||
virtual void video_start();
|
||||
virtual void palette_init();
|
||||
UINT32 screen_update_chinsan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(chin_adpcm_int);
|
||||
};
|
||||
|
||||
|
||||
@ -535,35 +536,33 @@ GFXDECODE_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void chin_adpcm_int( device_t *device, int st )
|
||||
WRITE_LINE_MEMBER(chinsan_state::chin_adpcm_int)
|
||||
{
|
||||
chinsan_state *state = device->machine().driver_data<chinsan_state>();
|
||||
|
||||
if (state->m_adpcm_pos >= 0x10000 || state->m_adpcm_idle)
|
||||
if (m_adpcm_pos >= 0x10000 || m_adpcm_idle)
|
||||
{
|
||||
//state->m_adpcm_idle = 1;
|
||||
msm5205_reset_w(device, 1);
|
||||
state->m_trigger = 0;
|
||||
//m_adpcm_idle = 1;
|
||||
msm5205_reset_w(machine().device("msm"), 1);
|
||||
m_trigger = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
|
||||
UINT8 *ROM = machine().root_device().memregion("adpcm")->base();
|
||||
|
||||
state->m_adpcm_data = ((state->m_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0) >> 4));
|
||||
msm5205_data_w(device, state->m_adpcm_data & 0xf);
|
||||
state->m_trigger ^= 1;
|
||||
if(state->m_trigger == 0)
|
||||
m_adpcm_data = ((m_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0) >> 4));
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data & 0xf);
|
||||
m_trigger ^= 1;
|
||||
if(m_trigger == 0)
|
||||
{
|
||||
state->m_adpcm_pos++;
|
||||
if ((ROM[state->m_adpcm_pos] & 0xff) == 0x70)
|
||||
state->m_adpcm_idle = 1;
|
||||
m_adpcm_pos++;
|
||||
if ((ROM[m_adpcm_pos] & 0xff) == 0x70)
|
||||
m_adpcm_idle = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(chin_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(chinsan_state,chin_adpcm_int), /* interrupt function */
|
||||
MSM5205_S64_4B /* 8kHz */
|
||||
};
|
||||
|
||||
|
@ -198,27 +198,25 @@ READ8_MEMBER(crgolf_state::sound_to_main_r)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void vck_callback( device_t *device, int st )
|
||||
WRITE_LINE_MEMBER(crgolf_state::vck_callback)
|
||||
{
|
||||
crgolf_state *state = device->machine().driver_data<crgolf_state>();
|
||||
|
||||
/* only play back if we have data remaining */
|
||||
if (state->m_sample_count != 0xff)
|
||||
if (m_sample_count != 0xff)
|
||||
{
|
||||
UINT8 data = state->memregion("adpcm")->base()[state->m_sample_offset >> 1];
|
||||
UINT8 data = memregion("adpcm")->base()[m_sample_offset >> 1];
|
||||
|
||||
/* write the next nibble and advance */
|
||||
msm5205_data_w(device, (data >> (4 * (~state->m_sample_offset & 1))) & 0x0f);
|
||||
state->m_sample_offset++;
|
||||
msm5205_data_w(machine().device("msm"), (data >> (4 * (~m_sample_offset & 1))) & 0x0f);
|
||||
m_sample_offset++;
|
||||
|
||||
/* every 256 clocks, we decrement the length */
|
||||
if (!(state->m_sample_offset & 0xff))
|
||||
if (!(m_sample_offset & 0xff))
|
||||
{
|
||||
state->m_sample_count--;
|
||||
m_sample_count--;
|
||||
|
||||
/* if we hit 0xff, automatically turn off playback */
|
||||
if (state->m_sample_count == 0xff)
|
||||
msm5205_reset_w(device, 1);
|
||||
if (m_sample_count == 0xff)
|
||||
msm5205_reset_w(machine().device("msm"), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -378,7 +376,7 @@ INPUT_PORTS_END
|
||||
|
||||
static const msm5205_interface msm5205_intf =
|
||||
{
|
||||
DEVCB_LINE(vck_callback),
|
||||
DEVCB_DRIVER_LINE_MEMBER(crgolf_state,vck_callback),
|
||||
MSM5205_S64_4B
|
||||
};
|
||||
|
||||
|
@ -92,6 +92,7 @@ public:
|
||||
UINT32 screen_update_dacholer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(sound_irq);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
DECLARE_WRITE_LINE_MEMBER(adpcm_int);
|
||||
};
|
||||
|
||||
TILE_GET_INFO_MEMBER(dacholer_state::get_bg_tile_info)
|
||||
@ -557,24 +558,23 @@ INTERRUPT_GEN_MEMBER(dacholer_state::sound_irq)
|
||||
}
|
||||
}
|
||||
|
||||
static void adpcm_int( device_t *device, int st )
|
||||
WRITE_LINE_MEMBER(dacholer_state::adpcm_int)
|
||||
{
|
||||
dacholer_state *state = device->machine().driver_data<dacholer_state>();
|
||||
if (state->m_snd_interrupt_enable == 1 || (state->m_snd_interrupt_enable == 0 && state->m_msm_toggle == 1))
|
||||
if (m_snd_interrupt_enable == 1 || (m_snd_interrupt_enable == 0 && m_msm_toggle == 1))
|
||||
{
|
||||
msm5205_data_w(device, state->m_msm_data >> 4);
|
||||
state->m_msm_data <<= 4;
|
||||
state->m_msm_toggle ^= 1;
|
||||
if (state->m_msm_toggle == 0)
|
||||
msm5205_data_w(machine().device("msm"), m_msm_data >> 4);
|
||||
m_msm_data <<= 4;
|
||||
m_msm_toggle ^= 1;
|
||||
if (m_msm_toggle == 0)
|
||||
{
|
||||
state->m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0x38);
|
||||
m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0x38);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const msm5205_interface msm_interface =
|
||||
{
|
||||
DEVCB_LINE(adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(dacholer_state,adpcm_int), /* interrupt function */
|
||||
MSM5205_S96_4B /* 1 / 96 = 3906.25Hz playback - guess */
|
||||
};
|
||||
|
||||
|
@ -484,17 +484,15 @@ static ADDRESS_MAP_START( darius_sound2_map, AS_PROGRAM, 8, darius_state )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
static void darius_adpcm_int( device_t *device, int st )
|
||||
WRITE_LINE_MEMBER(darius_state::darius_adpcm_int)
|
||||
{
|
||||
darius_state *state = device->machine().driver_data<darius_state>();
|
||||
|
||||
if (state->m_nmi_enable)
|
||||
state->m_adpcm->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
if (m_nmi_enable)
|
||||
m_adpcm->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(darius_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(darius_state,darius_adpcm_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8KHz */
|
||||
};
|
||||
|
||||
|
@ -438,31 +438,37 @@ WRITE8_MEMBER(ddragon_state::dd_adpcm_w)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void dd_adpcm_int( device_t *device, int st )
|
||||
void ddragon_state::dd_adpcm_int( device_t *device, int chip )
|
||||
{
|
||||
ddragon_state *state = device->machine().driver_data<ddragon_state>();
|
||||
int chip = (device == state->m_adpcm_1) ? 0 : 1;
|
||||
|
||||
if (state->m_adpcm_pos[chip] >= state->m_adpcm_end[chip] || state->m_adpcm_pos[chip] >= 0x10000)
|
||||
if (m_adpcm_pos[chip] >= m_adpcm_end[chip] || m_adpcm_pos[chip] >= 0x10000)
|
||||
{
|
||||
state->m_adpcm_idle[chip] = 1;
|
||||
m_adpcm_idle[chip] = 1;
|
||||
msm5205_reset_w(device, 1);
|
||||
}
|
||||
else if (state->m_adpcm_data[chip] != -1)
|
||||
else if (m_adpcm_data[chip] != -1)
|
||||
{
|
||||
msm5205_data_w(device, state->m_adpcm_data[chip] & 0x0f);
|
||||
state->m_adpcm_data[chip] = -1;
|
||||
msm5205_data_w(device, m_adpcm_data[chip] & 0x0f);
|
||||
m_adpcm_data[chip] = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base() + 0x10000 * chip;
|
||||
UINT8 *ROM = machine().root_device().memregion("adpcm")->base() + 0x10000 * chip;
|
||||
|
||||
state->m_adpcm_data[chip] = ROM[state->m_adpcm_pos[chip]++];
|
||||
msm5205_data_w(device, state->m_adpcm_data[chip] >> 4);
|
||||
m_adpcm_data[chip] = ROM[m_adpcm_pos[chip]++];
|
||||
msm5205_data_w(device, m_adpcm_data[chip] >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(ddragon_state::dd_adpcm_int_1)
|
||||
{
|
||||
dd_adpcm_int(m_adpcm_1,0);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(ddragon_state::dd_adpcm_int_2)
|
||||
{
|
||||
dd_adpcm_int(m_adpcm_2,0);
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(ddragon_state::dd_adpcm_status_r)
|
||||
{
|
||||
@ -935,12 +941,17 @@ GFXDECODE_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
static const msm5205_interface msm5205_config_1 =
|
||||
{
|
||||
DEVCB_LINE(dd_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(ddragon_state,dd_adpcm_int_1), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8kHz */
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_config_2 =
|
||||
{
|
||||
DEVCB_DRIVER_LINE_MEMBER(ddragon_state,dd_adpcm_int_2), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8kHz */
|
||||
};
|
||||
|
||||
|
||||
/*************************************
|
||||
@ -986,11 +997,11 @@ static MACHINE_CONFIG_START( ddragon, ddragon_state )
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.60)
|
||||
|
||||
MCFG_SOUND_ADD("adpcm1", MSM5205, MAIN_CLOCK/32)
|
||||
MCFG_SOUND_CONFIG(msm5205_config)
|
||||
MCFG_SOUND_CONFIG(msm5205_config_1)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
|
||||
MCFG_SOUND_ADD("adpcm2", MSM5205, MAIN_CLOCK/32)
|
||||
MCFG_SOUND_CONFIG(msm5205_config)
|
||||
MCFG_SOUND_CONFIG(msm5205_config_2)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
@ -1049,11 +1060,11 @@ static MACHINE_CONFIG_START( ddragon6809, ddragon_state )
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.60)
|
||||
|
||||
MCFG_SOUND_ADD("adpcm1", MSM5205, MAIN_CLOCK/32)
|
||||
MCFG_SOUND_CONFIG(msm5205_config)
|
||||
MCFG_SOUND_CONFIG(msm5205_config_1)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
|
||||
MCFG_SOUND_ADD("adpcm2", MSM5205, MAIN_CLOCK/32)
|
||||
MCFG_SOUND_CONFIG(msm5205_config)
|
||||
MCFG_SOUND_CONFIG(msm5205_config_2)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
@ -262,21 +262,19 @@ WRITE_LINE_MEMBER(de_2_state::ym2151_irq_w)
|
||||
m_audiocpu->set_input_line(M6809_IRQ_LINE,state);
|
||||
}
|
||||
|
||||
//WRITE_LINE_MEMBER(de_2_state::msm5205_irq_w)
|
||||
static void msm5205_irq_w(device_t* device,int st)
|
||||
WRITE_LINE_MEMBER(de_2_state::msm5205_irq_w)
|
||||
{
|
||||
de_2_state* state = device->machine().driver_data<de_2_state>();
|
||||
msm5205_data_w(state->m_msm5205,state->m_sample_data >> 4);
|
||||
if(state->m_more_data)
|
||||
msm5205_data_w(m_msm5205,m_sample_data >> 4);
|
||||
if(m_more_data)
|
||||
{
|
||||
if(state->m_nmi_enable)
|
||||
state->m_audiocpu->set_input_line(INPUT_LINE_NMI,PULSE_LINE); // generate NMI when we need more data
|
||||
state->m_more_data = false;
|
||||
if(m_nmi_enable)
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI,PULSE_LINE); // generate NMI when we need more data
|
||||
m_more_data = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
state->m_more_data = true;
|
||||
state->m_sample_data <<= 4;
|
||||
m_more_data = true;
|
||||
m_sample_data <<= 4;
|
||||
}
|
||||
}
|
||||
|
||||
@ -547,7 +545,7 @@ WRITE8_MEMBER( de_2_state::sample_bank_w )
|
||||
|
||||
static const msm5205_interface msm5205_intf =
|
||||
{
|
||||
DEVCB_LINE(msm5205_irq_w),
|
||||
DEVCB_DRIVER_LINE_MEMBER(de_2_state,msm5205_irq_w),
|
||||
MSM5205_S96_4B
|
||||
};
|
||||
|
||||
|
@ -1294,24 +1294,24 @@ GFXDECODE_END
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static void sound_irq(device_t *device, int linestate)
|
||||
WRITE_LINE_MEMBER(dec0_state::sound_irq)
|
||||
{
|
||||
device->machine().device("audiocpu")->execute().set_input_line(0, linestate); /* IRQ */
|
||||
machine().device("audiocpu")->execute().set_input_line(0, state); /* IRQ */
|
||||
}
|
||||
|
||||
static void sound_irq2(device_t *device, int linestate)
|
||||
WRITE_LINE_MEMBER(dec0_state::sound_irq2)
|
||||
{
|
||||
device->machine().device("audiocpu")->execute().set_input_line(1, linestate); /* IRQ2 */
|
||||
machine().device("audiocpu")->execute().set_input_line(1, state); /* IRQ2 */
|
||||
}
|
||||
|
||||
static const ym3812_interface ym3812_config =
|
||||
{
|
||||
DEVCB_LINE(sound_irq)
|
||||
DEVCB_DRIVER_LINE_MEMBER(dec0_state,sound_irq)
|
||||
};
|
||||
|
||||
static const ym3812_interface ym3812b_interface =
|
||||
{
|
||||
DEVCB_LINE(sound_irq2)
|
||||
DEVCB_DRIVER_LINE_MEMBER(dec0_state,sound_irq2)
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
@ -1384,25 +1384,24 @@ MACHINE_CONFIG_END
|
||||
#define DEC0_VBSTART 256-8
|
||||
|
||||
|
||||
static void automat_vclk_cb(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(dec0_automat_state::automat_vclk_cb)
|
||||
{
|
||||
dec0_automat_state *state = device->machine().driver_data<dec0_automat_state>();
|
||||
if (state->m_automat_msm5205_vclk_toggle == 0)
|
||||
if (m_automat_msm5205_vclk_toggle == 0)
|
||||
{
|
||||
msm5205_data_w(device, state->m_automat_adpcm_byte & 0xf);
|
||||
msm5205_data_w(machine().device("msm"), m_automat_adpcm_byte & 0xf);
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(device, state->m_automat_adpcm_byte >> 4);
|
||||
msm5205_data_w(machine().device("msm"), m_automat_adpcm_byte >> 4);
|
||||
//device->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); // gives some scratch samples but breaks other sounds too
|
||||
}
|
||||
|
||||
state->m_automat_msm5205_vclk_toggle ^= 1;
|
||||
m_automat_msm5205_vclk_toggle ^= 1;
|
||||
}
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(automat_vclk_cb),
|
||||
DEVCB_DRIVER_LINE_MEMBER(dec0_automat_state,automat_vclk_cb),
|
||||
MSM5205_S48_4B
|
||||
};
|
||||
|
||||
|
@ -478,15 +478,14 @@ WRITE8_MEMBER(dec8_state::dec8_sound_w)
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static void csilver_adpcm_int( device_t *device ,int st)
|
||||
WRITE_LINE_MEMBER(dec8_state::csilver_adpcm_int)
|
||||
{
|
||||
dec8_state *state = device->machine().driver_data<dec8_state>();
|
||||
state->m_toggle ^= 1;
|
||||
if (state->m_toggle)
|
||||
state->m_audiocpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
|
||||
m_toggle ^= 1;
|
||||
if (m_toggle)
|
||||
m_audiocpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
|
||||
|
||||
msm5205_data_w(device, state->m_msm5205next >> 4);
|
||||
state->m_msm5205next <<= 4;
|
||||
msm5205_data_w(machine().device("msm"), m_msm5205next >> 4);
|
||||
m_msm5205next <<= 4;
|
||||
}
|
||||
|
||||
READ8_MEMBER(dec8_state::csilver_adpcm_reset_r)
|
||||
@ -1922,7 +1921,7 @@ static const ym3812_interface ym3812_config =
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(csilver_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(dec8_state,csilver_adpcm_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8KHz */
|
||||
};
|
||||
|
||||
|
@ -89,6 +89,7 @@ public:
|
||||
UINT32 screen_update_discoboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
void discoboy_setrombank( UINT8 data );
|
||||
DECLARE_WRITE_LINE_MEMBER(yunsung8_adpcm_int);
|
||||
};
|
||||
|
||||
|
||||
@ -469,19 +470,17 @@ void discoboy_state::machine_reset()
|
||||
m_toggle = 0;
|
||||
}
|
||||
|
||||
static void yunsung8_adpcm_int( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(discoboy_state::yunsung8_adpcm_int)
|
||||
{
|
||||
discoboy_state *state = device->machine().driver_data<discoboy_state>();
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm >> 4);
|
||||
m_adpcm <<= 4;
|
||||
|
||||
msm5205_data_w(device, state->m_adpcm >> 4);
|
||||
state->m_adpcm <<= 4;
|
||||
|
||||
state->m_toggle ^= 1;
|
||||
m_toggle ^= 1;
|
||||
}
|
||||
|
||||
static const msm5205_interface yunsung8_msm5205_interface =
|
||||
{
|
||||
DEVCB_LINE(yunsung8_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(discoboy_state,yunsung8_adpcm_int), /* interrupt function */
|
||||
MSM5205_S96_4B /* 4KHz, 4 Bits */
|
||||
};
|
||||
|
||||
|
@ -160,24 +160,22 @@ Dip locations verified with manual for docastle, dorunrun and dowild.
|
||||
|
||||
|
||||
/* Read/Write Handlers */
|
||||
static void idsoccer_adpcm_int( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(docastle_state::idsoccer_adpcm_int)
|
||||
{
|
||||
docastle_state *state = device->machine().driver_data<docastle_state>();
|
||||
|
||||
if (state->m_adpcm_pos >= state->memregion("adpcm")->bytes())
|
||||
if (m_adpcm_pos >= memregion("adpcm")->bytes())
|
||||
{
|
||||
state->m_adpcm_idle = 1;
|
||||
msm5205_reset_w(device, 1);
|
||||
m_adpcm_idle = 1;
|
||||
msm5205_reset_w(machine().device("msm"), 1);
|
||||
}
|
||||
else if (state->m_adpcm_data != -1)
|
||||
else if (m_adpcm_data != -1)
|
||||
{
|
||||
msm5205_data_w(device, state->m_adpcm_data & 0x0f);
|
||||
state->m_adpcm_data = -1;
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos++];
|
||||
msm5205_data_w(device, state->m_adpcm_data >> 4);
|
||||
m_adpcm_data = machine().root_device().memregion("adpcm")->base()[m_adpcm_pos++];
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -552,7 +550,7 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(idsoccer_adpcm_int), // interrupt function
|
||||
DEVCB_DRIVER_LINE_MEMBER(docastle_state,idsoccer_adpcm_int), // interrupt function
|
||||
MSM5205_S64_4B // 6 kHz ???
|
||||
};
|
||||
|
||||
|
@ -39,31 +39,30 @@ WRITE8_MEMBER(drmicro_state::nmi_enable_w)
|
||||
}
|
||||
|
||||
|
||||
static void pcm_w(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(drmicro_state::pcm_w)
|
||||
{
|
||||
drmicro_state *state = device->machine().driver_data<drmicro_state>();
|
||||
UINT8 *PCM = state->memregion("adpcm")->base();
|
||||
UINT8 *PCM = memregion("adpcm")->base();
|
||||
|
||||
int data = PCM[state->m_pcm_adr / 2];
|
||||
int data = PCM[m_pcm_adr / 2];
|
||||
|
||||
if (data != 0x70) // ??
|
||||
{
|
||||
if (~state->m_pcm_adr & 1)
|
||||
if (~m_pcm_adr & 1)
|
||||
data >>= 4;
|
||||
|
||||
msm5205_data_w(device, data & 0x0f);
|
||||
msm5205_reset_w(device, 0);
|
||||
msm5205_data_w(m_msm, data & 0x0f);
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
|
||||
state->m_pcm_adr = (state->m_pcm_adr + 1) & 0x7fff;
|
||||
m_pcm_adr = (m_pcm_adr + 1) & 0x7fff;
|
||||
}
|
||||
else
|
||||
msm5205_reset_w(device, 1);
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(drmicro_state::pcm_set_w)
|
||||
{
|
||||
m_pcm_adr = ((data & 0x3f) << 9);
|
||||
pcm_w(m_msm,1);
|
||||
pcm_w(1);
|
||||
}
|
||||
|
||||
/*************************************
|
||||
@ -214,7 +213,7 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(pcm_w), /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(drmicro_state,pcm_w), /* IRQ handler */
|
||||
MSM5205_S64_4B /* 6 KHz */
|
||||
};
|
||||
|
||||
|
@ -124,11 +124,10 @@ INTERRUPT_GEN_MEMBER(dynax_state::sprtmtch_vblank_interrupt)
|
||||
sprtmtch_update_irq(machine());
|
||||
}
|
||||
|
||||
static void sprtmtch_sound_callback( device_t *device, int state )
|
||||
WRITE_LINE_MEMBER(dynax_state::sprtmtch_sound_callback)
|
||||
{
|
||||
dynax_state *driver_state = device->machine().driver_data<dynax_state>();
|
||||
driver_state->m_sound_irq = state;
|
||||
sprtmtch_update_irq(device->machine());
|
||||
m_sound_irq = state;
|
||||
sprtmtch_update_irq(machine());
|
||||
}
|
||||
|
||||
|
||||
@ -192,11 +191,10 @@ WRITE8_MEMBER(dynax_state::jantouki_sound_vblank_ack_w)
|
||||
jantouki_sound_update_irq(machine());
|
||||
}
|
||||
|
||||
static void jantouki_sound_callback(device_t *device, int state)
|
||||
WRITE_LINE_MEMBER(dynax_state::jantouki_sound_callback)
|
||||
{
|
||||
dynax_state *driver_state = device->machine().driver_data<dynax_state>();
|
||||
driver_state->m_sound_irq = state;
|
||||
jantouki_sound_update_irq(device->machine());
|
||||
m_sound_irq = state;
|
||||
jantouki_sound_update_irq(machine());
|
||||
}
|
||||
|
||||
|
||||
@ -392,32 +390,30 @@ WRITE8_MEMBER(dynax_state::nanajign_palette_w)
|
||||
}
|
||||
|
||||
|
||||
static void adpcm_int( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(dynax_state::adpcm_int)
|
||||
{
|
||||
dynax_state *state = device->machine().driver_data<dynax_state>();
|
||||
msm5205_data_w(device, state->m_msm5205next >> 4);
|
||||
state->m_msm5205next <<= 4;
|
||||
msm5205_data_w(machine().device("msm"), m_msm5205next >> 4);
|
||||
m_msm5205next <<= 4;
|
||||
|
||||
state->m_toggle = 1 - state->m_toggle;
|
||||
m_toggle = 1 - m_toggle;
|
||||
|
||||
if (state->m_toggle)
|
||||
if (m_toggle)
|
||||
{
|
||||
if (state->m_resetkludge) // don't know what's wrong, but NMIs when the 5205 is reset make the game crash
|
||||
state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
if (m_resetkludge) // don't know what's wrong, but NMIs when the 5205 is reset make the game crash
|
||||
m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
static void adpcm_int_cpu1( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(dynax_state::adpcm_int_cpu1)
|
||||
{
|
||||
dynax_state *state = device->machine().driver_data<dynax_state>();
|
||||
msm5205_data_w(device, state->m_msm5205next >> 4);
|
||||
state->m_msm5205next <<= 4;
|
||||
msm5205_data_w(machine().device("msm"), m_msm5205next >> 4);
|
||||
m_msm5205next <<= 4;
|
||||
|
||||
state->m_toggle_cpu1 = 1 - state->m_toggle_cpu1;
|
||||
if (state->m_toggle_cpu1)
|
||||
m_toggle_cpu1 = 1 - m_toggle_cpu1;
|
||||
if (m_toggle_cpu1)
|
||||
{
|
||||
if (state->m_resetkludge) // don't know what's wrong, but NMIs when the 5205 is reset make the game crash
|
||||
state->m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); // cpu1
|
||||
if (m_resetkludge) // don't know what's wrong, but NMIs when the 5205 is reset make the game crash
|
||||
m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); // cpu1
|
||||
}
|
||||
}
|
||||
|
||||
@ -4356,12 +4352,12 @@ static const ym2203_interface hanamai_ym2203_interface =
|
||||
DEVCB_NULL, /* Port A Write */
|
||||
DEVCB_NULL, /* Port B Write */
|
||||
},
|
||||
DEVCB_LINE(sprtmtch_sound_callback) /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(dynax_state,sprtmtch_sound_callback) /* IRQ handler */
|
||||
};
|
||||
|
||||
static const msm5205_interface hanamai_msm5205_interface =
|
||||
{
|
||||
DEVCB_LINE(adpcm_int), /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(dynax_state,adpcm_int), /* IRQ handler */
|
||||
MSM5205_S48_4B /* 8 KHz, 4 Bits */
|
||||
};
|
||||
|
||||
@ -4524,7 +4520,7 @@ static const ym2203_interface sprtmtch_ym2203_interface =
|
||||
DEVCB_NULL, /* Port A Write */
|
||||
DEVCB_NULL, /* Port B Write */
|
||||
},
|
||||
DEVCB_LINE(sprtmtch_sound_callback), /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(dynax_state,sprtmtch_sound_callback), /* IRQ handler */
|
||||
};
|
||||
|
||||
static MACHINE_CONFIG_START( sprtmtch, dynax_state )
|
||||
@ -4695,12 +4691,12 @@ static const ym2203_interface jantouki_ym2203_interface =
|
||||
AY8910_DEFAULT_LOADS,
|
||||
DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL
|
||||
},
|
||||
DEVCB_LINE(jantouki_sound_callback) /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(dynax_state,jantouki_sound_callback) /* IRQ handler */
|
||||
};
|
||||
|
||||
static const msm5205_interface jantouki_msm5205_interface =
|
||||
{
|
||||
DEVCB_LINE(adpcm_int_cpu1), /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(dynax_state,adpcm_int_cpu1), /* IRQ handler */
|
||||
MSM5205_S48_4B /* 8 KHz, 4 Bits */
|
||||
};
|
||||
|
||||
|
@ -392,10 +392,10 @@ static void borntofi_adpcm_int( device_t *device, int voice )
|
||||
}
|
||||
}
|
||||
|
||||
static void borntofi_adpcm_int_0(device_t *device,int state) { borntofi_adpcm_int(device, 0); }
|
||||
static void borntofi_adpcm_int_1(device_t *device,int state) { borntofi_adpcm_int(device, 1); }
|
||||
static void borntofi_adpcm_int_2(device_t *device,int state) { borntofi_adpcm_int(device, 2); }
|
||||
static void borntofi_adpcm_int_3(device_t *device,int state) { borntofi_adpcm_int(device, 3); }
|
||||
WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_0) { borntofi_adpcm_int(machine().device("msm1"), 0); }
|
||||
WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_1) { borntofi_adpcm_int(machine().device("msm2"), 1); }
|
||||
WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_2) { borntofi_adpcm_int(machine().device("msm3"), 2); }
|
||||
WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_3) { borntofi_adpcm_int(machine().device("msm4"), 3); }
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( borntofi_sound_map, AS_PROGRAM, 8, fantland_state )
|
||||
@ -925,22 +925,22 @@ MACHINE_CONFIG_END
|
||||
// OKI M5205 running at 384kHz [18.432/48]. Sample rate = 384000 / 48
|
||||
static const msm5205_interface msm5205_config_0 =
|
||||
{
|
||||
DEVCB_LINE(borntofi_adpcm_int_0), /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(fantland_state,borntofi_adpcm_int_0), /* IRQ handler */
|
||||
MSM5205_S48_4B /* 8 kHz, 4 Bits */
|
||||
};
|
||||
static const msm5205_interface msm5205_config_1 =
|
||||
{
|
||||
DEVCB_LINE(borntofi_adpcm_int_1), /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(fantland_state,borntofi_adpcm_int_1), /* IRQ handler */
|
||||
MSM5205_S48_4B /* 8 kHz, 4 Bits */
|
||||
};
|
||||
static const msm5205_interface msm5205_config_2 =
|
||||
{
|
||||
DEVCB_LINE(borntofi_adpcm_int_2), /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(fantland_state,borntofi_adpcm_int_2), /* IRQ handler */
|
||||
MSM5205_S48_4B /* 8 kHz, 4 Bits */
|
||||
};
|
||||
static const msm5205_interface msm5205_config_3 =
|
||||
{
|
||||
DEVCB_LINE(borntofi_adpcm_int_3), /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(fantland_state,borntofi_adpcm_int_3), /* IRQ handler */
|
||||
MSM5205_S48_4B /* 8 kHz, 4 Bits */
|
||||
};
|
||||
|
||||
|
@ -117,24 +117,20 @@ WRITE8_MEMBER( cps_state::knightsb_snd_bankswitch_w )
|
||||
membank("bank1")->set_entry(data & 0x0f);
|
||||
}
|
||||
|
||||
static void m5205_int1( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(cps_state::m5205_int1)
|
||||
{
|
||||
cps_state *state = device->machine().driver_data<cps_state>();
|
||||
|
||||
msm5205_data_w(device, state->m_sample_buffer1 & 0x0f);
|
||||
state->m_sample_buffer1 >>= 4;
|
||||
state->m_sample_select1 ^= 1;
|
||||
if (state->m_sample_select1 == 0)
|
||||
state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
msm5205_data_w(m_msm_1, m_sample_buffer1 & 0x0f);
|
||||
m_sample_buffer1 >>= 4;
|
||||
m_sample_select1 ^= 1;
|
||||
if (m_sample_select1 == 0)
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static void m5205_int2( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(cps_state::m5205_int2)
|
||||
{
|
||||
cps_state *state = device->machine().driver_data<cps_state>();
|
||||
|
||||
msm5205_data_w(device, state->m_sample_buffer2 & 0x0f);
|
||||
state->m_sample_buffer2 >>= 4;
|
||||
state->m_sample_select2 ^= 1;
|
||||
msm5205_data_w(m_msm_2, m_sample_buffer2 & 0x0f);
|
||||
m_sample_buffer2 >>= 4;
|
||||
m_sample_select2 ^= 1;
|
||||
}
|
||||
|
||||
|
||||
@ -1259,13 +1255,13 @@ INPUT_PORTS_END
|
||||
|
||||
static const msm5205_interface msm5205_interface1 =
|
||||
{
|
||||
DEVCB_LINE(m5205_int1), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(cps_state,m5205_int1), /* interrupt function */
|
||||
MSM5205_S96_4B /* 4KHz 4-bit */
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_interface2 =
|
||||
{
|
||||
DEVCB_LINE(m5205_int2), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(cps_state,m5205_int2), /* interrupt function */
|
||||
MSM5205_S96_4B /* 4KHz 4-bit */
|
||||
};
|
||||
|
||||
|
@ -318,16 +318,14 @@ WRITE8_MEMBER(firetrap_state::firetrap_sound_bankselect_w)
|
||||
membank("bank2")->set_entry(data & 0x01);
|
||||
}
|
||||
|
||||
static void firetrap_adpcm_int( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(firetrap_state::firetrap_adpcm_int)
|
||||
{
|
||||
firetrap_state *state = device->machine().driver_data<firetrap_state>();
|
||||
msm5205_data_w(machine().device("msm"), m_msm5205next >> 4);
|
||||
m_msm5205next <<= 4;
|
||||
|
||||
msm5205_data_w(device, state->m_msm5205next >> 4);
|
||||
state->m_msm5205next <<= 4;
|
||||
|
||||
state->m_adpcm_toggle ^= 1;
|
||||
if (state->m_sound_irq_enable && state->m_adpcm_toggle)
|
||||
state->m_audiocpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
|
||||
m_adpcm_toggle ^= 1;
|
||||
if (m_sound_irq_enable && m_adpcm_toggle)
|
||||
m_audiocpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(firetrap_state::firetrap_adpcm_data_w)
|
||||
@ -576,7 +574,7 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(firetrap_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(firetrap_state,firetrap_adpcm_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* 7.8125kHz */
|
||||
};
|
||||
|
||||
|
@ -137,25 +137,23 @@ WRITE8_MEMBER(fromance_state::fromance_adpcm_w)
|
||||
}
|
||||
|
||||
|
||||
static void fromance_adpcm_int( device_t *device, int st )
|
||||
WRITE_LINE_MEMBER(fromance_state::fromance_adpcm_int)
|
||||
{
|
||||
fromance_state *state = device->machine().driver_data<fromance_state>();
|
||||
|
||||
/* skip if we're reset */
|
||||
if (!state->m_adpcm_reset)
|
||||
if (!m_adpcm_reset)
|
||||
return;
|
||||
|
||||
/* clock the data through */
|
||||
if (state->m_vclk_left)
|
||||
if (m_vclk_left)
|
||||
{
|
||||
msm5205_data_w(device, (state->m_adpcm_data >> 4));
|
||||
state->m_adpcm_data <<= 4;
|
||||
state->m_vclk_left--;
|
||||
msm5205_data_w(machine().device("msm"), (m_adpcm_data >> 4));
|
||||
m_adpcm_data <<= 4;
|
||||
m_vclk_left--;
|
||||
}
|
||||
|
||||
/* generate an NMI if we're out of data */
|
||||
if (!state->m_vclk_left)
|
||||
state->m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
if (!m_vclk_left)
|
||||
m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -937,7 +935,7 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(fromance_adpcm_int), /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(fromance_state,fromance_adpcm_int), /* IRQ handler */
|
||||
MSM5205_S48_4B /* 8 KHz */
|
||||
};
|
||||
|
||||
|
@ -202,27 +202,25 @@ WRITE16_MEMBER(gcpinbal_state::ioc_w)
|
||||
|
||||
|
||||
/* Controlled through ioc? */
|
||||
static void gcp_adpcm_int( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(gcpinbal_state::gcp_adpcm_int)
|
||||
{
|
||||
gcpinbal_state *state = device->machine().driver_data<gcpinbal_state>();
|
||||
|
||||
if (state->m_adpcm_idle)
|
||||
msm5205_reset_w(device, 1);
|
||||
if (state->m_adpcm_start >= 0x200000 || state->m_adpcm_start > state->m_adpcm_end)
|
||||
if (m_adpcm_idle)
|
||||
msm5205_reset_w(machine().device("msm"), 1);
|
||||
if (m_adpcm_start >= 0x200000 || m_adpcm_start > m_adpcm_end)
|
||||
{
|
||||
//msm5205_reset_w(device,1);
|
||||
state->m_adpcm_start = state->m_msm_start + state->m_msm_bank;
|
||||
state->m_adpcm_trigger = 0;
|
||||
//msm5205_reset_w(machine().device("msm"),1);
|
||||
m_adpcm_start = m_msm_start + m_msm_bank;
|
||||
m_adpcm_trigger = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 *ROM = device->machine().root_device().memregion("msm")->base();
|
||||
UINT8 *ROM = machine().root_device().memregion("msm")->base();
|
||||
|
||||
state->m_adpcm_data = ((state->m_adpcm_trigger ? (ROM[state->m_adpcm_start] & 0x0f) : (ROM[state->m_adpcm_start] & 0xf0) >> 4));
|
||||
msm5205_data_w(device, state->m_adpcm_data & 0xf);
|
||||
state->m_adpcm_trigger ^= 1;
|
||||
if (state->m_adpcm_trigger == 0)
|
||||
state->m_adpcm_start++;
|
||||
m_adpcm_data = ((m_adpcm_trigger ? (ROM[m_adpcm_start] & 0x0f) : (ROM[m_adpcm_start] & 0xf0) >> 4));
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data & 0xf);
|
||||
m_adpcm_trigger ^= 1;
|
||||
if (m_adpcm_trigger == 0)
|
||||
m_adpcm_start++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -384,7 +382,7 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface msm6585_config =
|
||||
{
|
||||
DEVCB_LINE(gcp_adpcm_int), /* VCK function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(gcpinbal_state,gcp_adpcm_int), /* VCK function */
|
||||
MSM6585_S40 /* 16 kHz */
|
||||
};
|
||||
|
||||
|
@ -270,10 +270,10 @@ WRITE8_MEMBER(gladiatr_state::gladiator_int_control_w)
|
||||
/* bit 0 : ?? */
|
||||
}
|
||||
/* YM2203 IRQ */
|
||||
static void gladiator_ym_irq(device_t *device, int irq)
|
||||
WRITE_LINE_MEMBER(gladiatr_state::gladiator_ym_irq)
|
||||
{
|
||||
/* NMI IRQ is not used by gladiator sound program */
|
||||
device->machine().device("sub")->execute().set_input_line(INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine().device("sub")->execute().set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
/*Sound Functions*/
|
||||
@ -649,7 +649,7 @@ static const ym2203_interface gladiatr_ym2203_interface =
|
||||
DEVCB_DRIVER_MEMBER(gladiatr_state,gladiator_int_control_w), /* port A write */
|
||||
DEVCB_NULL,
|
||||
},
|
||||
DEVCB_LINE(gladiator_ym_irq) /* NMI request for 2nd cpu */
|
||||
DEVCB_DRIVER_LINE_MEMBER(gladiatr_state,gladiator_ym_irq) /* NMI request for 2nd cpu */
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
|
@ -225,20 +225,19 @@ static const ym2203_interface ym2203_config =
|
||||
DEVCB_DRIVER_LINE_MEMBER(goal92_state,irqhandler)
|
||||
};
|
||||
|
||||
static void goal92_adpcm_int( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(goal92_state::goal92_adpcm_int)
|
||||
{
|
||||
goal92_state *state = device->machine().driver_data<goal92_state>();
|
||||
msm5205_data_w(device, state->m_msm5205next);
|
||||
state->m_msm5205next >>= 4;
|
||||
state->m_adpcm_toggle^= 1;
|
||||
msm5205_data_w(machine().device("msm"), m_msm5205next);
|
||||
m_msm5205next >>= 4;
|
||||
m_adpcm_toggle^= 1;
|
||||
|
||||
if (state->m_adpcm_toggle)
|
||||
state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
if (m_adpcm_toggle)
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(goal92_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(goal92_state,goal92_adpcm_int), /* interrupt function */
|
||||
MSM5205_S96_4B /* 4KHz 4-bit */
|
||||
};
|
||||
|
||||
|
@ -93,6 +93,7 @@ public:
|
||||
TIMER_CALLBACK_MEMBER(cvsd_bit_timer_callback);
|
||||
UINT8 jangou_gfx_nibble( UINT16 niboffset );
|
||||
void plot_jangou_gfx_pixel( UINT8 pix, int x, int y );
|
||||
DECLARE_WRITE_LINE_MEMBER(jngolady_vclk_cb);
|
||||
};
|
||||
|
||||
|
||||
@ -346,19 +347,17 @@ WRITE8_MEMBER(jangou_state::adpcm_w)
|
||||
m_adpcm_byte = data;
|
||||
}
|
||||
|
||||
static void jngolady_vclk_cb( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(jangou_state::jngolady_vclk_cb)
|
||||
{
|
||||
jangou_state *state = device->machine().driver_data<jangou_state>();
|
||||
|
||||
if (state->m_msm5205_vclk_toggle == 0)
|
||||
msm5205_data_w(device, state->m_adpcm_byte >> 4);
|
||||
if (m_msm5205_vclk_toggle == 0)
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_byte >> 4);
|
||||
else
|
||||
{
|
||||
msm5205_data_w(device, state->m_adpcm_byte & 0xf);
|
||||
state->m_cpu_1->execute().set_input_line(0, HOLD_LINE);
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_byte & 0xf);
|
||||
m_cpu_1->execute().set_input_line(0, HOLD_LINE);
|
||||
}
|
||||
|
||||
state->m_msm5205_vclk_toggle ^= 1;
|
||||
m_msm5205_vclk_toggle ^= 1;
|
||||
}
|
||||
|
||||
|
||||
@ -895,7 +894,7 @@ static const ay8910_interface ay8910_config =
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(jngolady_vclk_cb),
|
||||
DEVCB_DRIVER_LINE_MEMBER(jangou_state,jngolady_vclk_cb),
|
||||
MSM5205_S96_4B
|
||||
};
|
||||
|
||||
|
@ -131,6 +131,7 @@ public:
|
||||
virtual void video_start();
|
||||
virtual void palette_init();
|
||||
UINT32 screen_update_jantotsu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(jan_adpcm_int);
|
||||
};
|
||||
|
||||
|
||||
@ -290,28 +291,26 @@ WRITE8_MEMBER(jantotsu_state::jan_adpcm_w)
|
||||
}
|
||||
}
|
||||
|
||||
static void jan_adpcm_int( device_t *device ,int st)
|
||||
WRITE_LINE_MEMBER(jantotsu_state::jan_adpcm_int)
|
||||
{
|
||||
jantotsu_state *state = device->machine().driver_data<jantotsu_state>();
|
||||
|
||||
if (state->m_adpcm_pos >= 0x10000 || state->m_adpcm_idle)
|
||||
if (m_adpcm_pos >= 0x10000 || m_adpcm_idle)
|
||||
{
|
||||
//state->m_adpcm_idle = 1;
|
||||
msm5205_reset_w(device, 1);
|
||||
state->m_adpcm_trigger = 0;
|
||||
//m_adpcm_idle = 1;
|
||||
msm5205_reset_w(machine().device("msm"), 1);
|
||||
m_adpcm_trigger = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
|
||||
UINT8 *ROM = machine().root_device().memregion("adpcm")->base();
|
||||
|
||||
state->m_adpcm_data = ((state->m_adpcm_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0) >> 4));
|
||||
msm5205_data_w(device, state->m_adpcm_data & 0xf);
|
||||
state->m_adpcm_trigger ^= 1;
|
||||
if (state->m_adpcm_trigger == 0)
|
||||
m_adpcm_data = ((m_adpcm_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0) >> 4));
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data & 0xf);
|
||||
m_adpcm_trigger ^= 1;
|
||||
if (m_adpcm_trigger == 0)
|
||||
{
|
||||
state->m_adpcm_pos++;
|
||||
if ((ROM[state->m_adpcm_pos] & 0xff) == 0x70)
|
||||
state->m_adpcm_idle = 1;
|
||||
m_adpcm_pos++;
|
||||
if ((ROM[m_adpcm_pos] & 0xff) == 0x70)
|
||||
m_adpcm_idle = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -465,7 +464,7 @@ INPUT_PORTS_END
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(jan_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(jantotsu_state,jan_adpcm_int), /* interrupt function */
|
||||
MSM5205_S64_4B /* 6 KHz */
|
||||
};
|
||||
|
||||
|
@ -345,27 +345,25 @@ INTERRUPT_GEN_MEMBER(kchamp_state::kc_interrupt)
|
||||
device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static void msmint( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(kchamp_state::msmint)
|
||||
{
|
||||
kchamp_state *state = device->machine().driver_data<kchamp_state>();
|
||||
|
||||
if (state->m_msm_play_lo_nibble)
|
||||
msm5205_data_w(device, state->m_msm_data & 0x0f);
|
||||
if (m_msm_play_lo_nibble)
|
||||
msm5205_data_w(machine().device("msm"), m_msm_data & 0x0f);
|
||||
else
|
||||
msm5205_data_w(device, (state->m_msm_data >> 4) & 0x0f);
|
||||
msm5205_data_w(machine().device("msm"), (m_msm_data >> 4) & 0x0f);
|
||||
|
||||
state->m_msm_play_lo_nibble ^= 1;
|
||||
m_msm_play_lo_nibble ^= 1;
|
||||
|
||||
if (!(state->m_counter ^= 1))
|
||||
if (!(m_counter ^= 1))
|
||||
{
|
||||
if (state->m_sound_nmi_enable)
|
||||
state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
if (m_sound_nmi_enable)
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
static const msm5205_interface msm_interface =
|
||||
{
|
||||
DEVCB_LINE(msmint), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(kchamp_state,msmint), /* interrupt function */
|
||||
MSM5205_S96_4B /* 1 / 96 = 3906.25Hz playback */
|
||||
};
|
||||
|
||||
|
@ -84,6 +84,8 @@ public:
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
INTERRUPT_GEN_MEMBER(kungfur_irq);
|
||||
DECLARE_WRITE_LINE_MEMBER(kfr_adpcm1_int);
|
||||
DECLARE_WRITE_LINE_MEMBER(kfr_adpcm2_int);
|
||||
};
|
||||
|
||||
|
||||
@ -188,26 +190,24 @@ WRITE8_MEMBER(kungfur_state::kungfur_adpcm2_w)
|
||||
}
|
||||
|
||||
// adpcm callbacks
|
||||
static void kfr_adpcm1_int(device_t *device, int st)
|
||||
WRITE_LINE_MEMBER(kungfur_state::kfr_adpcm1_int)
|
||||
{
|
||||
kungfur_state *state = device->machine().driver_data<kungfur_state>();
|
||||
UINT8 *ROM = state->memregion("adpcm1")->base();
|
||||
UINT8 data = ROM[state->m_adpcm_pos[0] & 0x1ffff];
|
||||
UINT8 *ROM = memregion("adpcm1")->base();
|
||||
UINT8 data = ROM[m_adpcm_pos[0] & 0x1ffff];
|
||||
|
||||
msm5205_data_w(device, state->m_adpcm_sel[0] ? data & 0xf : data >> 4 & 0xf);
|
||||
state->m_adpcm_pos[0] += state->m_adpcm_sel[0];
|
||||
state->m_adpcm_sel[0] ^= 1;
|
||||
msm5205_data_w(machine().device("adpcm1"), m_adpcm_sel[0] ? data & 0xf : data >> 4 & 0xf);
|
||||
m_adpcm_pos[0] += m_adpcm_sel[0];
|
||||
m_adpcm_sel[0] ^= 1;
|
||||
}
|
||||
|
||||
static void kfr_adpcm2_int(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(kungfur_state::kfr_adpcm2_int)
|
||||
{
|
||||
kungfur_state *state = device->machine().driver_data<kungfur_state>();
|
||||
UINT8 *ROM = state->memregion("adpcm2")->base();
|
||||
UINT8 data = ROM[state->m_adpcm_pos[1] & 0x3ffff];
|
||||
UINT8 *ROM = memregion("adpcm2")->base();
|
||||
UINT8 data = ROM[m_adpcm_pos[1] & 0x3ffff];
|
||||
|
||||
msm5205_data_w(device, state->m_adpcm_sel[1] ? data & 0xf : data >> 4 & 0xf);
|
||||
state->m_adpcm_pos[1] += state->m_adpcm_sel[1];
|
||||
state->m_adpcm_sel[1] ^= 1;
|
||||
msm5205_data_w(machine().device("adpcm2"), m_adpcm_sel[1] ? data & 0xf : data >> 4 & 0xf);
|
||||
m_adpcm_pos[1] += m_adpcm_sel[1];
|
||||
m_adpcm_sel[1] ^= 1;
|
||||
}
|
||||
|
||||
|
||||
@ -284,13 +284,13 @@ static I8255A_INTERFACE( ppi8255_1_intf )
|
||||
|
||||
static const msm5205_interface msm5205_config_1 =
|
||||
{
|
||||
DEVCB_LINE(kfr_adpcm1_int),
|
||||
DEVCB_DRIVER_LINE_MEMBER(kungfur_state,kfr_adpcm1_int),
|
||||
MSM5205_S48_4B
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_config_2 =
|
||||
{
|
||||
DEVCB_LINE(kfr_adpcm2_int),
|
||||
DEVCB_DRIVER_LINE_MEMBER(kungfur_state,kfr_adpcm2_int),
|
||||
MSM5205_S48_4B
|
||||
};
|
||||
|
||||
|
@ -228,6 +228,7 @@ public:
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(kurukuru_vdp_scanline);
|
||||
DECLARE_WRITE_LINE_MEMBER(kurukuru_msm5205_vck);
|
||||
};
|
||||
|
||||
#define MAIN_CLOCK XTAL_21_4772MHz
|
||||
@ -283,11 +284,10 @@ void kurukuru_state::update_sound_irq(UINT8 cause)
|
||||
}
|
||||
|
||||
|
||||
static void kurukuru_msm5205_vck(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(kurukuru_state::kurukuru_msm5205_vck)
|
||||
{
|
||||
kurukuru_state *state = device->machine().driver_data<kurukuru_state>();
|
||||
state->update_sound_irq(state->m_sound_irq_cause | 2);
|
||||
msm5205_data_w(device, state->m_adpcm_data);
|
||||
update_sound_irq(m_sound_irq_cause | 2);
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data);
|
||||
}
|
||||
|
||||
|
||||
@ -548,7 +548,7 @@ static const ay8910_interface ym2149_intf =
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(kurukuru_msm5205_vck),
|
||||
DEVCB_DRIVER_LINE_MEMBER(kurukuru_state,kurukuru_msm5205_vck),
|
||||
MSM5205_S48_4B /* changed on the fly */
|
||||
};
|
||||
|
||||
|
@ -1402,46 +1402,45 @@ static SOUND_START( lucky74 )
|
||||
state->m_adpcm_busy_line = 0x01; /* free and ready */
|
||||
}
|
||||
|
||||
static void lucky74_adpcm_int(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(lucky74_state::lucky74_adpcm_int)
|
||||
{
|
||||
lucky74_state *state = device->machine().driver_data<lucky74_state>();
|
||||
if (state->m_adpcm_reg[05] == 0x01) /* register 0x05 (bit 0 activated), trigger the sample */
|
||||
if (m_adpcm_reg[05] == 0x01) /* register 0x05 (bit 0 activated), trigger the sample */
|
||||
{
|
||||
/* conditional zone for samples reproduction */
|
||||
|
||||
if (state->m_adpcm_busy_line) /* still not started */
|
||||
if (m_adpcm_busy_line) /* still not started */
|
||||
{
|
||||
/* init all 09R81P registers */
|
||||
logerror("init ADPCM registers\n");
|
||||
state->m_adpcm_end = (state->m_adpcm_reg[04] << 8) + state->m_adpcm_reg[03];
|
||||
state->m_adpcm_pos = (state->m_adpcm_reg[01] << 8) + state->m_adpcm_reg[00];
|
||||
state->m_adpcm_busy_line = 0;
|
||||
state->m_adpcm_data = -1;
|
||||
m_adpcm_end = (m_adpcm_reg[04] << 8) + m_adpcm_reg[03];
|
||||
m_adpcm_pos = (m_adpcm_reg[01] << 8) + m_adpcm_reg[00];
|
||||
m_adpcm_busy_line = 0;
|
||||
m_adpcm_data = -1;
|
||||
|
||||
logerror("sample pos:%4X\n", state->m_adpcm_pos);
|
||||
logerror("sample end:%4X\n", state->m_adpcm_end);
|
||||
logerror("sample pos:%4X\n", m_adpcm_pos);
|
||||
logerror("sample end:%4X\n", m_adpcm_end);
|
||||
}
|
||||
|
||||
if (state->m_adpcm_data == -1)
|
||||
if (m_adpcm_data == -1)
|
||||
{
|
||||
/* transferring 1st nibble */
|
||||
state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos];
|
||||
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0xffff;
|
||||
msm5205_data_w(device, state->m_adpcm_data >> 4);
|
||||
m_adpcm_data = machine().root_device().memregion("adpcm")->base()[m_adpcm_pos];
|
||||
m_adpcm_pos = (m_adpcm_pos + 1) & 0xffff;
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4);
|
||||
|
||||
if (state->m_adpcm_pos == state->m_adpcm_end)
|
||||
if (m_adpcm_pos == m_adpcm_end)
|
||||
{
|
||||
msm5205_reset_w(device, 0); /* reset the M5205 */
|
||||
state->m_adpcm_reg[05] = 0; /* clean trigger register */
|
||||
state->m_adpcm_busy_line = 0x01; /* deactivate busy flag */
|
||||
msm5205_reset_w(machine().device("msm"), 0); /* reset the M5205 */
|
||||
m_adpcm_reg[05] = 0; /* clean trigger register */
|
||||
m_adpcm_busy_line = 0x01; /* deactivate busy flag */
|
||||
logerror("end of sample.\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* transferring 2nd nibble */
|
||||
msm5205_data_w(device, state->m_adpcm_data & 0x0f);
|
||||
state->m_adpcm_data = -1;
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1515,7 +1514,7 @@ static const ay8910_interface ay8910_config =
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(lucky74_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(lucky74_state,lucky74_adpcm_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8KHz */
|
||||
};
|
||||
|
||||
|
@ -480,6 +480,7 @@ public:
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_mastboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(mastboy_interrupt);
|
||||
DECLARE_WRITE_LINE_MEMBER(mastboy_adpcm_int);
|
||||
};
|
||||
|
||||
|
||||
@ -667,21 +668,20 @@ WRITE8_MEMBER(mastboy_state::mastboy_msm5205_data_w)
|
||||
m_m5205_next = data;
|
||||
}
|
||||
|
||||
static void mastboy_adpcm_int(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(mastboy_state::mastboy_adpcm_int)
|
||||
{
|
||||
mastboy_state *state = device->machine().driver_data<mastboy_state>();
|
||||
msm5205_data_w(device, state->m_m5205_next);
|
||||
state->m_m5205_next >>= 4;
|
||||
msm5205_data_w(machine().device("msm"), m_m5205_next);
|
||||
m_m5205_next >>= 4;
|
||||
|
||||
state->m_m5205_part ^= 1;
|
||||
if(!state->m_m5205_part)
|
||||
device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
m_m5205_part ^= 1;
|
||||
if(!m_m5205_part)
|
||||
machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(mastboy_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(mastboy_state,mastboy_adpcm_int), /* interrupt function */
|
||||
MSM5205_SEX_4B /* 4KHz 4-bit */
|
||||
};
|
||||
|
||||
|
@ -397,30 +397,28 @@ void mermaid_state::machine_reset()
|
||||
}
|
||||
|
||||
/* Similar to Jantotsu, apparently the HW has three ports that controls what kind of sample should be played. Every sample size is 0x1000. */
|
||||
static void rougien_adpcm_int( device_t *device ,int st)
|
||||
WRITE_LINE_MEMBER(mermaid_state::rougien_adpcm_int)
|
||||
{
|
||||
mermaid_state *state = device->machine().driver_data<mermaid_state>();
|
||||
// popmessage("%08x",m_adpcm_pos);
|
||||
|
||||
// popmessage("%08x",state->m_adpcm_pos);
|
||||
|
||||
if (state->m_adpcm_pos >= state->m_adpcm_end || state->m_adpcm_idle)
|
||||
if (m_adpcm_pos >= m_adpcm_end || m_adpcm_idle)
|
||||
{
|
||||
//state->m_adpcm_idle = 1;
|
||||
msm5205_reset_w(device, 1);
|
||||
state->m_adpcm_trigger = 0;
|
||||
//m_adpcm_idle = 1;
|
||||
msm5205_reset_w(machine().device("msm"), 1);
|
||||
m_adpcm_trigger = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
|
||||
UINT8 *ROM = machine().root_device().memregion("adpcm")->base();
|
||||
|
||||
state->m_adpcm_data = ((state->m_adpcm_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0) >> 4));
|
||||
msm5205_data_w(device, state->m_adpcm_data & 0xf);
|
||||
state->m_adpcm_trigger ^= 1;
|
||||
if (state->m_adpcm_trigger == 0)
|
||||
m_adpcm_data = ((m_adpcm_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0) >> 4));
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data & 0xf);
|
||||
m_adpcm_trigger ^= 1;
|
||||
if (m_adpcm_trigger == 0)
|
||||
{
|
||||
state->m_adpcm_pos++;
|
||||
//if ((ROM[state->m_adpcm_pos] & 0xff) == 0x70)
|
||||
// state->m_adpcm_idle = 1;
|
||||
m_adpcm_pos++;
|
||||
//if ((ROM[m_adpcm_pos] & 0xff) == 0x70)
|
||||
// m_adpcm_idle = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -428,7 +426,7 @@ static void rougien_adpcm_int( device_t *device ,int st)
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(rougien_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(mermaid_state,rougien_adpcm_int), /* interrupt function */
|
||||
MSM5205_S96_4B
|
||||
};
|
||||
|
||||
|
@ -1182,20 +1182,19 @@ GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
static void spangbl_adpcm_int( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(mitchell_state::spangbl_adpcm_int)
|
||||
{
|
||||
mitchell_state *state = device->machine().driver_data<mitchell_state>();
|
||||
msm5205_data_w(device, state->m_sample_buffer & 0x0f);
|
||||
state->m_sample_buffer >>= 4;
|
||||
state->m_sample_select ^= 1;
|
||||
if(state->m_sample_select == 0)
|
||||
state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
msm5205_data_w(machine().device("msm"), m_sample_buffer & 0x0f);
|
||||
m_sample_buffer >>= 4;
|
||||
m_sample_select ^= 1;
|
||||
if(m_sample_select == 0)
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(spangbl_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(mitchell_state,spangbl_adpcm_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* 4KHz 4-bit */
|
||||
};
|
||||
|
||||
|
@ -80,6 +80,7 @@ public:
|
||||
UINT32 screen_update_mlanding(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_CALLBACK_MEMBER(dma_complete);
|
||||
int start_dma();
|
||||
DECLARE_WRITE_LINE_MEMBER(ml_msm5205_vck);
|
||||
};
|
||||
|
||||
|
||||
@ -280,35 +281,33 @@ WRITE8_MEMBER(mlanding_state::sound_bankswitch_w)
|
||||
membank("bank1")->set_base(memregion("audiocpu")->base() + ((data) & 0x03) * 0x4000 + 0x10000 );
|
||||
}
|
||||
|
||||
static void ml_msm5205_vck(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(mlanding_state::ml_msm5205_vck)
|
||||
{
|
||||
mlanding_state *state = device->machine().driver_data<mlanding_state>();
|
||||
// popmessage("%08x",m_adpcm_pos);
|
||||
|
||||
// popmessage("%08x",state->m_adpcm_pos);
|
||||
|
||||
if (state->m_adpcm_pos >= 0x50000 || state->m_adpcm_idle)
|
||||
if (m_adpcm_pos >= 0x50000 || m_adpcm_idle)
|
||||
{
|
||||
//state->m_adpcm_idle = 1;
|
||||
msm5205_reset_w(device,1);
|
||||
state->m_trigger = 0;
|
||||
//m_adpcm_idle = 1;
|
||||
msm5205_reset_w(machine().device("msm"),1);
|
||||
m_trigger = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
|
||||
UINT8 *ROM = machine().root_device().memregion("adpcm")->base();
|
||||
|
||||
state->m_adpcm_data = ((state->m_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0)>>4) );
|
||||
msm5205_data_w(device,state->m_adpcm_data & 0xf);
|
||||
state->m_trigger^=1;
|
||||
if(state->m_trigger == 0)
|
||||
m_adpcm_data = ((m_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0)>>4) );
|
||||
msm5205_data_w(machine().device("msm"),m_adpcm_data & 0xf);
|
||||
m_trigger^=1;
|
||||
if(m_trigger == 0)
|
||||
{
|
||||
state->m_adpcm_pos++;
|
||||
//device->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
m_adpcm_pos++;
|
||||
//machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
/*TODO: simplify this */
|
||||
if(ROM[state->m_adpcm_pos] == 0x00 && ROM[state->m_adpcm_pos+1] == 0x00 && ROM[state->m_adpcm_pos+2] == 0x00 && ROM[state->m_adpcm_pos+3] == 0x00
|
||||
&& ROM[state->m_adpcm_pos+4] == 0x00 && ROM[state->m_adpcm_pos+5] == 0x00 && ROM[state->m_adpcm_pos+6] == 0x00 && ROM[state->m_adpcm_pos+7] == 0x00
|
||||
&& ROM[state->m_adpcm_pos+8] == 0x00 && ROM[state->m_adpcm_pos+9] == 0x00 && ROM[state->m_adpcm_pos+10] == 0x00 && ROM[state->m_adpcm_pos+11] == 0x00
|
||||
&& ROM[state->m_adpcm_pos+12] == 0x00 && ROM[state->m_adpcm_pos+13] == 0x00 && ROM[state->m_adpcm_pos+14] == 0x00 && ROM[state->m_adpcm_pos+15] == 0x00)
|
||||
state->m_adpcm_idle = 1;
|
||||
if(ROM[m_adpcm_pos] == 0x00 && ROM[m_adpcm_pos+1] == 0x00 && ROM[m_adpcm_pos+2] == 0x00 && ROM[m_adpcm_pos+3] == 0x00
|
||||
&& ROM[m_adpcm_pos+4] == 0x00 && ROM[m_adpcm_pos+5] == 0x00 && ROM[m_adpcm_pos+6] == 0x00 && ROM[m_adpcm_pos+7] == 0x00
|
||||
&& ROM[m_adpcm_pos+8] == 0x00 && ROM[m_adpcm_pos+9] == 0x00 && ROM[m_adpcm_pos+10] == 0x00 && ROM[m_adpcm_pos+11] == 0x00
|
||||
&& ROM[m_adpcm_pos+12] == 0x00 && ROM[m_adpcm_pos+13] == 0x00 && ROM[m_adpcm_pos+14] == 0x00 && ROM[m_adpcm_pos+15] == 0x00)
|
||||
m_adpcm_idle = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -732,7 +731,7 @@ INPUT_PORTS_END
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(ml_msm5205_vck), /* VCK function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(mlanding_state,ml_msm5205_vck), /* VCK function */
|
||||
MSM5205_S48_4B /* 8 kHz */
|
||||
};
|
||||
|
||||
|
@ -70,25 +70,23 @@ WRITE8_MEMBER(ojankohs_state::ojankohs_msm5205_w)
|
||||
m_vclk_left = 2;
|
||||
}
|
||||
|
||||
static void ojankohs_adpcm_int( device_t *device ,int st)
|
||||
WRITE_LINE_MEMBER(ojankohs_state::ojankohs_adpcm_int)
|
||||
{
|
||||
ojankohs_state *state = device->machine().driver_data<ojankohs_state>();
|
||||
|
||||
/* skip if we're reset */
|
||||
if (!state->m_adpcm_reset)
|
||||
if (!m_adpcm_reset)
|
||||
return;
|
||||
|
||||
/* clock the data through */
|
||||
if (state->m_vclk_left)
|
||||
if (m_vclk_left)
|
||||
{
|
||||
msm5205_data_w(device, (state->m_adpcm_data >> 4));
|
||||
state->m_adpcm_data <<= 4;
|
||||
state->m_vclk_left--;
|
||||
msm5205_data_w(machine().device("msm"), (m_adpcm_data >> 4));
|
||||
m_adpcm_data <<= 4;
|
||||
m_vclk_left--;
|
||||
}
|
||||
|
||||
/* generate an NMI if we're out of data */
|
||||
if (!state->m_vclk_left)
|
||||
state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
if (!m_vclk_left)
|
||||
m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(ojankohs_state::ojankoc_ctrl_w)
|
||||
@ -782,7 +780,7 @@ static const ay8910_interface ojankoc_ay8910_interface =
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(ojankohs_adpcm_int), /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(ojankohs_state,ojankohs_adpcm_int), /* IRQ handler */
|
||||
MSM5205_S48_4B /* 8 KHz */
|
||||
};
|
||||
|
||||
|
@ -459,24 +459,30 @@ MACHINE_RESET_MEMBER(opwolf_state,opwolf)
|
||||
msm5205_reset_w(machine().device("msm2"), 1);
|
||||
}
|
||||
|
||||
static void opwolf_msm5205_vck( device_t *device ,int st)
|
||||
void opwolf_state::opwolf_msm5205_vck(device_t *device,int chip)
|
||||
{
|
||||
opwolf_state *state = device->machine().driver_data<opwolf_state>();
|
||||
int chip = (strcmp(device->tag(), ":msm1") == 0) ? 0 : 1;
|
||||
if (state->m_adpcm_data[chip] != -1)
|
||||
if (m_adpcm_data[chip] != -1)
|
||||
{
|
||||
msm5205_data_w(device, state->m_adpcm_data[chip] & 0x0f);
|
||||
state->m_adpcm_data[chip] = -1;
|
||||
if (state->m_adpcm_pos[chip] == state->m_adpcm_end[chip])
|
||||
msm5205_data_w(device, m_adpcm_data[chip] & 0x0f);
|
||||
m_adpcm_data[chip] = -1;
|
||||
if (m_adpcm_pos[chip] == m_adpcm_end[chip])
|
||||
msm5205_reset_w(device, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
state->m_adpcm_data[chip] = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos[chip]];
|
||||
state->m_adpcm_pos[chip] = (state->m_adpcm_pos[chip] + 1) & 0x7ffff;
|
||||
msm5205_data_w(device, state->m_adpcm_data[chip] >> 4);
|
||||
m_adpcm_data[chip] = machine().root_device().memregion("adpcm")->base()[m_adpcm_pos[chip]];
|
||||
m_adpcm_pos[chip] = (m_adpcm_pos[chip] + 1) & 0x7ffff;
|
||||
msm5205_data_w(device, m_adpcm_data[chip] >> 4);
|
||||
}
|
||||
}
|
||||
WRITE_LINE_MEMBER(opwolf_state::opwolf_msm5205_vck_1)
|
||||
{
|
||||
opwolf_msm5205_vck(machine().device("msm1"),0);
|
||||
}
|
||||
WRITE_LINE_MEMBER(opwolf_state::opwolf_msm5205_vck_2)
|
||||
{
|
||||
opwolf_msm5205_vck(machine().device("msm2"),1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(opwolf_state::opwolf_adpcm_b_w)
|
||||
{
|
||||
@ -684,12 +690,17 @@ GFXDECODE_END
|
||||
YM2151 (SOUND)
|
||||
**************************************************************/
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
static const msm5205_interface msm5205_config_1 =
|
||||
{
|
||||
DEVCB_LINE(opwolf_msm5205_vck), /* VCK function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(opwolf_state,opwolf_msm5205_vck_1), /* VCK function */
|
||||
MSM5205_S48_4B /* 8 kHz */
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_config_2 =
|
||||
{
|
||||
DEVCB_DRIVER_LINE_MEMBER(opwolf_state,opwolf_msm5205_vck_2), /* VCK function */
|
||||
MSM5205_S48_4B /* 8 kHz */
|
||||
};
|
||||
|
||||
|
||||
/***********************************************************
|
||||
@ -750,12 +761,12 @@ static MACHINE_CONFIG_START( opwolf, opwolf_state )
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
|
||||
|
||||
MCFG_SOUND_ADD("msm1", MSM5205, 384000)
|
||||
MCFG_SOUND_CONFIG(msm5205_config)
|
||||
MCFG_SOUND_CONFIG(msm5205_config_1)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.60)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.60)
|
||||
|
||||
MCFG_SOUND_ADD("msm2", MSM5205, 384000)
|
||||
MCFG_SOUND_CONFIG(msm5205_config)
|
||||
MCFG_SOUND_CONFIG(msm5205_config_2)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.60)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.60)
|
||||
|
||||
@ -804,12 +815,12 @@ static MACHINE_CONFIG_START( opwolfb, opwolf_state ) /* OSC clocks unknown for t
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
|
||||
|
||||
MCFG_SOUND_ADD("msm1", MSM5205, 384000)
|
||||
MCFG_SOUND_CONFIG(msm5205_config)
|
||||
MCFG_SOUND_CONFIG(msm5205_config_1)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.60)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.60)
|
||||
|
||||
MCFG_SOUND_ADD("msm2", MSM5205, 384000)
|
||||
MCFG_SOUND_CONFIG(msm5205_config)
|
||||
MCFG_SOUND_CONFIG(msm5205_config_2)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.60)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.60)
|
||||
|
||||
|
@ -267,35 +267,33 @@ static const sn76496_config psg_intf =
|
||||
#if USE_MSM
|
||||
|
||||
|
||||
static void pf_adpcm_int(device_t *device,int state)
|
||||
WRITE_LINE_MEMBER(pachifev_state::pf_adpcm_int)
|
||||
{
|
||||
pachifev_state *state = device->machine().driver_data<pachifev_state>();
|
||||
|
||||
if (state->m_adpcm_pos >= 0x4000 || state->m_adpcm_idle)
|
||||
if (m_adpcm_pos >= 0x4000 || m_adpcm_idle)
|
||||
{
|
||||
state->m_adpcm_idle = 1;
|
||||
msm5205_reset_w(device,1);
|
||||
state->m_trigger = 0;
|
||||
m_adpcm_idle = 1;
|
||||
msm5205_reset_w(machine().device("msm"),1);
|
||||
m_trigger = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
|
||||
UINT8 *ROM = machine().root_device().memregion("adpcm")->base();
|
||||
|
||||
state->m_adpcm_data = ((state->m_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0)>>4) );
|
||||
msm5205_data_w(device,state->m_adpcm_data & 0xf);
|
||||
state->m_trigger^=1;
|
||||
if(state->m_trigger == 0)
|
||||
m_adpcm_data = ((m_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0)>>4) );
|
||||
msm5205_data_w(machine().device("msm"),m_adpcm_data & 0xf);
|
||||
m_trigger^=1;
|
||||
if(m_trigger == 0)
|
||||
{
|
||||
state->m_adpcm_pos++;
|
||||
if((ROM[state->m_adpcm_pos] & 0xff) == 0xff)
|
||||
state->m_adpcm_idle = 1;
|
||||
m_adpcm_pos++;
|
||||
if((ROM[m_adpcm_pos] & 0xff) == 0xff)
|
||||
m_adpcm_idle = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(pf_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(pachifev_state,pf_adpcm_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8kHz */
|
||||
};
|
||||
|
||||
|
@ -46,16 +46,14 @@ WRITE8_MEMBER(pcktgal_state::pcktgal_sound_w)
|
||||
}
|
||||
|
||||
|
||||
static void pcktgal_adpcm_int(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(pcktgal_state::pcktgal_adpcm_int)
|
||||
{
|
||||
pcktgal_state *state = device->machine().driver_data<pcktgal_state>();
|
||||
msm5205_data_w(machine().device("msm"),m_msm5205next >> 4);
|
||||
m_msm5205next<<=4;
|
||||
|
||||
msm5205_data_w(device,state->m_msm5205next >> 4);
|
||||
state->m_msm5205next<<=4;
|
||||
|
||||
state->m_toggle = 1 - state->m_toggle;
|
||||
if (state->m_toggle)
|
||||
device->machine().device("audiocpu")->execute().set_input_line(M6502_IRQ_LINE, HOLD_LINE);
|
||||
m_toggle = 1 - m_toggle;
|
||||
if (m_toggle)
|
||||
machine().device("audiocpu")->execute().set_input_line(M6502_IRQ_LINE, HOLD_LINE);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(pcktgal_state::pcktgal_adpcm_data_w)
|
||||
@ -212,7 +210,7 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(pcktgal_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(pcktgal_state,pcktgal_adpcm_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8KHz */
|
||||
};
|
||||
|
||||
|
@ -167,19 +167,18 @@ WRITE8_MEMBER(rastan_state::rastan_bankswitch_w)
|
||||
}
|
||||
|
||||
|
||||
static void rastan_msm5205_vck( device_t *device ,int st)
|
||||
WRITE_LINE_MEMBER(rastan_state::rastan_msm5205_vck)
|
||||
{
|
||||
rastan_state *state = device->machine().driver_data<rastan_state>();
|
||||
if (state->m_adpcm_data != -1)
|
||||
if (m_adpcm_data != -1)
|
||||
{
|
||||
msm5205_data_w(device, state->m_adpcm_data & 0x0f);
|
||||
state->m_adpcm_data = -1;
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos];
|
||||
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0xffff;
|
||||
msm5205_data_w(device, state->m_adpcm_data >> 4);
|
||||
m_adpcm_data = machine().root_device().memregion("adpcm")->base()[m_adpcm_pos];
|
||||
m_adpcm_pos = (m_adpcm_pos + 1) & 0xffff;
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -340,7 +339,7 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(rastan_msm5205_vck), /* VCK function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(rastan_state,rastan_msm5205_vck), /* VCK function */
|
||||
MSM5205_S48_4B /* 8 kHz */
|
||||
};
|
||||
|
||||
|
@ -73,6 +73,7 @@ public:
|
||||
TIMER_CALLBACK_MEMBER(subcpu_resume);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(sothello_interrupt);
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
DECLARE_WRITE_LINE_MEMBER(adpcm_int);
|
||||
};
|
||||
|
||||
|
||||
@ -324,18 +325,17 @@ TIMER_DEVICE_CALLBACK_MEMBER(sothello_state::sothello_interrupt)
|
||||
m_v9938->interrupt();
|
||||
}
|
||||
|
||||
static void adpcm_int(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(sothello_state::adpcm_int)
|
||||
{
|
||||
sothello_state *state = device->machine().driver_data<sothello_state>();
|
||||
/* only 4 bits are used */
|
||||
msm5205_data_w( device, state->m_msm_data & 0x0f );
|
||||
device->machine().device("soundcpu")->execute().set_input_line(0, ASSERT_LINE );
|
||||
msm5205_data_w(machine().device("msm"), m_msm_data & 0x0f );
|
||||
machine().device("soundcpu")->execute().set_input_line(0, ASSERT_LINE );
|
||||
}
|
||||
|
||||
|
||||
static const msm5205_interface msm_interface =
|
||||
{
|
||||
DEVCB_LINE(adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(sothello_state,adpcm_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* changed on the fly */
|
||||
};
|
||||
|
||||
|
@ -62,29 +62,36 @@ WRITE8_MEMBER(spdodgeb_state::spd_adpcm_w)
|
||||
}
|
||||
}
|
||||
|
||||
static void spd_adpcm_int(device_t *device,int st)
|
||||
void spdodgeb_state::spd_adpcm_int( device_t *device, int chip )
|
||||
{
|
||||
spdodgeb_state *state = device->machine().driver_data<spdodgeb_state>();
|
||||
int chip = (strcmp(device->tag(), ":msm1") == 0) ? 0 : 1;
|
||||
if (state->m_adpcm_pos[chip] >= state->m_adpcm_end[chip] || state->m_adpcm_pos[chip] >= 0x10000)
|
||||
if (m_adpcm_pos[chip] >= m_adpcm_end[chip] || m_adpcm_pos[chip] >= 0x10000)
|
||||
{
|
||||
state->m_adpcm_idle[chip] = 1;
|
||||
m_adpcm_idle[chip] = 1;
|
||||
msm5205_reset_w(device,1);
|
||||
}
|
||||
else if (state->m_adpcm_data[chip] != -1)
|
||||
else if (m_adpcm_data[chip] != -1)
|
||||
{
|
||||
msm5205_data_w(device,state->m_adpcm_data[chip] & 0x0f);
|
||||
state->m_adpcm_data[chip] = -1;
|
||||
msm5205_data_w(device,m_adpcm_data[chip] & 0x0f);
|
||||
m_adpcm_data[chip] = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base() + 0x10000 * chip;
|
||||
UINT8 *ROM = machine().root_device().memregion("adpcm")->base() + 0x10000 * chip;
|
||||
|
||||
state->m_adpcm_data[chip] = ROM[state->m_adpcm_pos[chip]++];
|
||||
msm5205_data_w(device,state->m_adpcm_data[chip] >> 4);
|
||||
m_adpcm_data[chip] = ROM[m_adpcm_pos[chip]++];
|
||||
msm5205_data_w(device,m_adpcm_data[chip] >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(spdodgeb_state::spd_adpcm_int_1)
|
||||
{
|
||||
spd_adpcm_int(machine().device("msm1"), 0);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(spdodgeb_state::spd_adpcm_int_2)
|
||||
{
|
||||
spd_adpcm_int(machine().device("msm2"), 1);
|
||||
}
|
||||
|
||||
#if 0 // default - more sensitive (state change and timing measured on real board?)
|
||||
void spdodgeb_state::mcu63705_update_inputs()
|
||||
@ -385,12 +392,17 @@ static const ym3812_interface ym3812_config =
|
||||
DEVCB_DRIVER_LINE_MEMBER(spdodgeb_state,irqhandler)
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
static const msm5205_interface msm5205_config_1 =
|
||||
{
|
||||
DEVCB_LINE(spd_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(spdodgeb_state,spd_adpcm_int_1), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8kHz? */
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_config_2 =
|
||||
{
|
||||
DEVCB_DRIVER_LINE_MEMBER(spdodgeb_state,spd_adpcm_int_2), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8kHz? */
|
||||
};
|
||||
|
||||
void spdodgeb_state::machine_reset()
|
||||
{
|
||||
@ -435,12 +447,12 @@ static MACHINE_CONFIG_START( spdodgeb, spdodgeb_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
|
||||
|
||||
MCFG_SOUND_ADD("msm1", MSM5205, 384000)
|
||||
MCFG_SOUND_CONFIG(msm5205_config)
|
||||
MCFG_SOUND_CONFIG(msm5205_config_1)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
|
||||
|
||||
MCFG_SOUND_ADD("msm2", MSM5205, 384000)
|
||||
MCFG_SOUND_CONFIG(msm5205_config)
|
||||
MCFG_SOUND_CONFIG(msm5205_config_2)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
|
||||
MACHINE_CONFIG_END
|
||||
|
@ -110,12 +110,10 @@ WRITE8_MEMBER(splash_state::splash_adpcm_data_w)
|
||||
m_adpcm_data = data;
|
||||
}
|
||||
|
||||
static void splash_msm5205_int(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(splash_state::splash_msm5205_int)
|
||||
{
|
||||
splash_state *state = device->machine().driver_data<splash_state>();
|
||||
|
||||
msm5205_data_w(device, state->m_adpcm_data >> 4);
|
||||
state->m_adpcm_data = (state->m_adpcm_data << 4) & 0xf0;
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4);
|
||||
m_adpcm_data = (m_adpcm_data << 4) & 0xf0;
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( splash_sound_map, AS_PROGRAM, 8, splash_state )
|
||||
@ -155,11 +153,10 @@ WRITE8_MEMBER(splash_state::roldfrog_vblank_ack_w)
|
||||
}
|
||||
|
||||
|
||||
static void ym_irq(device_t *device, int state)
|
||||
WRITE_LINE_MEMBER(splash_state::ym_irq)
|
||||
{
|
||||
splash_state * driver_state = device->machine().driver_data<splash_state>();
|
||||
driver_state->m_sound_irq = state;
|
||||
driver_state->roldfrog_update_irq();
|
||||
m_sound_irq = state;
|
||||
roldfrog_update_irq();
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( roldfrog_map, AS_PROGRAM, 16, splash_state )
|
||||
@ -476,7 +473,7 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface splash_msm5205_interface =
|
||||
{
|
||||
DEVCB_LINE(splash_msm5205_int), /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(splash_state,splash_msm5205_int), /* IRQ handler */
|
||||
MSM5205_S48_4B /* 8KHz */
|
||||
};
|
||||
|
||||
@ -531,7 +528,7 @@ static const ym2203_interface ym2203_config =
|
||||
DEVCB_NULL, DEVCB_NULL,
|
||||
DEVCB_NULL, DEVCB_NULL
|
||||
},
|
||||
DEVCB_LINE(ym_irq)
|
||||
DEVCB_DRIVER_LINE_MEMBER(splash_state,ym_irq)
|
||||
};
|
||||
|
||||
INTERRUPT_GEN_MEMBER(splash_state::roldfrog_interrupt)
|
||||
@ -578,47 +575,45 @@ static MACHINE_CONFIG_START( roldfrog, splash_state )
|
||||
MCFG_SOUND_ROUTE(3, "mono", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static void adpcm_int1( device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(splash_state::adpcm_int1)
|
||||
{
|
||||
splash_state *state = device->machine().driver_data<splash_state>();
|
||||
if (state->m_snd_interrupt_enable1 || state->m_msm_toggle1 == 1)
|
||||
if (m_snd_interrupt_enable1 || m_msm_toggle1 == 1)
|
||||
{
|
||||
msm5205_data_w(device, state->m_msm_data1 >> 4);
|
||||
state->m_msm_data1 <<= 4;
|
||||
state->m_msm_toggle1 ^= 1;
|
||||
if (state->m_msm_toggle1 == 0)
|
||||
msm5205_data_w(machine().device("msm1"), m_msm_data1 >> 4);
|
||||
m_msm_data1 <<= 4;
|
||||
m_msm_toggle1 ^= 1;
|
||||
if (m_msm_toggle1 == 0)
|
||||
{
|
||||
state->m_msm_source|=1;
|
||||
device->machine().device("audiocpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0x38);
|
||||
m_msm_source|=1;
|
||||
machine().device("audiocpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0x38);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void adpcm_int2( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(splash_state::adpcm_int2)
|
||||
{
|
||||
splash_state *state = device->machine().driver_data<splash_state>();
|
||||
if (state->m_snd_interrupt_enable2 || state->m_msm_toggle2 == 1)
|
||||
if (m_snd_interrupt_enable2 || m_msm_toggle2 == 1)
|
||||
{
|
||||
msm5205_data_w(device, state->m_msm_data2 >> 4);
|
||||
state->m_msm_data2 <<= 4;
|
||||
state->m_msm_toggle2 ^= 1;
|
||||
if (state->m_msm_toggle2 == 0)
|
||||
msm5205_data_w(machine().device("msm2"), m_msm_data2 >> 4);
|
||||
m_msm_data2 <<= 4;
|
||||
m_msm_toggle2 ^= 1;
|
||||
if (m_msm_toggle2 == 0)
|
||||
{
|
||||
state->m_msm_source|=2;
|
||||
device->machine().device("audiocpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0x38);
|
||||
m_msm_source|=2;
|
||||
machine().device("audiocpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0x38);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const msm5205_interface msm_interface1 =
|
||||
{
|
||||
DEVCB_LINE(adpcm_int1), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(splash_state,adpcm_int1), /* interrupt function */
|
||||
MSM5205_S64_4B /* 1 / 96 = 3906.25Hz playback - guess */
|
||||
};
|
||||
|
||||
static const msm5205_interface msm_interface2 =
|
||||
{
|
||||
DEVCB_LINE(adpcm_int2), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(splash_state,adpcm_int2), /* interrupt function */
|
||||
MSM5205_S96_4B /* 1 / 96 = 3906.25Hz playback - guess */
|
||||
};
|
||||
|
||||
|
@ -206,38 +206,37 @@ WRITE8_MEMBER(srmp2_state::srmp3_adpcm_code_w)
|
||||
}
|
||||
|
||||
|
||||
static void srmp2_adpcm_int(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(srmp2_state::srmp2_adpcm_int)
|
||||
{
|
||||
srmp2_state *state = device->machine().driver_data<srmp2_state>();
|
||||
UINT8 *ROM = state->memregion("adpcm")->base();
|
||||
UINT8 *ROM = memregion("adpcm")->base();
|
||||
|
||||
if (state->m_adpcm_sptr)
|
||||
if (m_adpcm_sptr)
|
||||
{
|
||||
if (state->m_adpcm_data == -1)
|
||||
if (m_adpcm_data == -1)
|
||||
{
|
||||
state->m_adpcm_data = ROM[state->m_adpcm_sptr];
|
||||
m_adpcm_data = ROM[m_adpcm_sptr];
|
||||
|
||||
if (state->m_adpcm_sptr >= state->m_adpcm_eptr)
|
||||
if (m_adpcm_sptr >= m_adpcm_eptr)
|
||||
{
|
||||
msm5205_reset_w(device, 1);
|
||||
state->m_adpcm_data = 0;
|
||||
state->m_adpcm_sptr = 0;
|
||||
msm5205_reset_w(machine().device("msm"), 1);
|
||||
m_adpcm_data = 0;
|
||||
m_adpcm_sptr = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(device, ((state->m_adpcm_data >> 4) & 0x0f));
|
||||
msm5205_data_w(machine().device("msm"), ((m_adpcm_data >> 4) & 0x0f));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(device, ((state->m_adpcm_data >> 0) & 0x0f));
|
||||
state->m_adpcm_sptr++;
|
||||
state->m_adpcm_data = -1;
|
||||
msm5205_data_w(machine().device("msm"), ((m_adpcm_data >> 0) & 0x0f));
|
||||
m_adpcm_sptr++;
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_reset_w(device, 1);
|
||||
msm5205_reset_w(machine().device("msm"), 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1129,7 +1128,7 @@ static const ay8910_interface srmp2_ay8910_interface =
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(srmp2_adpcm_int), /* IRQ handler */
|
||||
DEVCB_DRIVER_LINE_MEMBER(srmp2_state,srmp2_adpcm_int), /* IRQ handler */
|
||||
MSM5205_S48_4B /* 8 KHz, 4 Bits */
|
||||
};
|
||||
|
||||
|
@ -427,7 +427,7 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(stfight_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(stfight_state,stfight_adpcm_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8KHz */
|
||||
};
|
||||
|
||||
|
@ -70,6 +70,7 @@ public:
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_suprgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
DECLARE_WRITE_LINE_MEMBER(adpcm_int);
|
||||
};
|
||||
|
||||
TILE_GET_INFO_MEMBER(suprgolf_state::get_tile_info)
|
||||
@ -432,28 +433,24 @@ static const ym2203_interface ym2203_config =
|
||||
DEVCB_DRIVER_LINE_MEMBER(suprgolf_state,irqhandler)
|
||||
};
|
||||
|
||||
static void adpcm_int(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(suprgolf_state::adpcm_int)
|
||||
{
|
||||
suprgolf_state *state = device->machine().driver_data<suprgolf_state>();
|
||||
|
||||
msm5205_reset_w(machine().device("msm"),0);
|
||||
m_toggle ^= 1;
|
||||
if(m_toggle)
|
||||
{
|
||||
msm5205_reset_w(device,0);
|
||||
state->m_toggle ^= 1;
|
||||
if(state->m_toggle)
|
||||
{
|
||||
msm5205_data_w(device, (state->m_msm5205next & 0xf0) >> 4);
|
||||
if(state->m_msm_nmi_mask) { device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); }
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(device, (state->m_msm5205next & 0x0f) >> 0);
|
||||
}
|
||||
msm5205_data_w(machine().device("msm"), (m_msm5205next & 0xf0) >> 4);
|
||||
if(m_msm_nmi_mask) { machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); }
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(machine().device("msm"), (m_msm5205next & 0x0f) >> 0);
|
||||
}
|
||||
}
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(suprgolf_state,adpcm_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* 4KHz 4-bit */
|
||||
};
|
||||
|
||||
|
@ -357,20 +357,19 @@ WRITE8_MEMBER(segas1x_bootleg_state::tturfbl_msm5205_data_w)
|
||||
m_sample_buffer = data;
|
||||
}
|
||||
|
||||
static void tturfbl_msm5205_callback( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(segas1x_bootleg_state::tturfbl_msm5205_callback)
|
||||
{
|
||||
segas1x_bootleg_state *state = device->machine().driver_data<segas1x_bootleg_state>();
|
||||
msm5205_data_w(device, (state->m_sample_buffer >> 4) & 0x0f);
|
||||
msm5205_data_w(machine().device("msm"), (m_sample_buffer >> 4) & 0x0f);
|
||||
|
||||
state->m_sample_buffer <<= 4;
|
||||
state->m_sample_select ^= 1;
|
||||
if(state->m_sample_select == 0)
|
||||
state->m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
m_sample_buffer <<= 4;
|
||||
m_sample_select ^= 1;
|
||||
if(m_sample_select == 0)
|
||||
m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static const msm5205_interface tturfbl_msm5205_interface =
|
||||
{
|
||||
DEVCB_LINE(tturfbl_msm5205_callback),
|
||||
DEVCB_DRIVER_LINE_MEMBER(segas1x_bootleg_state,tturfbl_msm5205_callback),
|
||||
MSM5205_S48_4B
|
||||
};
|
||||
|
||||
@ -1158,20 +1157,19 @@ WRITE8_MEMBER(segas1x_bootleg_state::shdancbl_msm5205_data_w)
|
||||
m_sample_buffer = data;
|
||||
}
|
||||
|
||||
static void shdancbl_msm5205_callback(device_t *device, int st)
|
||||
WRITE_LINE_MEMBER(segas1x_bootleg_state::shdancbl_msm5205_callback)
|
||||
{
|
||||
segas1x_bootleg_state *state = device->machine().driver_data<segas1x_bootleg_state>();
|
||||
msm5205_data_w(device, state->m_sample_buffer & 0x0f);
|
||||
msm5205_data_w(machine().device("msm"), m_sample_buffer & 0x0f);
|
||||
|
||||
state->m_sample_buffer >>= 4;
|
||||
state->m_sample_select ^= 1;
|
||||
if (state->m_sample_select == 0)
|
||||
state->m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
m_sample_buffer >>= 4;
|
||||
m_sample_select ^= 1;
|
||||
if (m_sample_select == 0)
|
||||
m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static const msm5205_interface shdancbl_msm5205_interface =
|
||||
{
|
||||
DEVCB_LINE(shdancbl_msm5205_callback),
|
||||
DEVCB_DRIVER_LINE_MEMBER(segas1x_bootleg_state,shdancbl_msm5205_callback),
|
||||
MSM5205_S48_4B
|
||||
};
|
||||
|
||||
|
@ -557,20 +557,18 @@ WRITE8_MEMBER(taitol_state::mux_ctrl_w)
|
||||
}
|
||||
|
||||
|
||||
static void champwr_msm5205_vck( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(taitol_state::champwr_msm5205_vck)
|
||||
{
|
||||
taitol_state *state = device->machine().driver_data<taitol_state>();
|
||||
|
||||
if (state->m_adpcm_data != -1)
|
||||
if (m_adpcm_data != -1)
|
||||
{
|
||||
msm5205_data_w(device, state->m_adpcm_data & 0x0f);
|
||||
state->m_adpcm_data = -1;
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos];
|
||||
state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0x1ffff;
|
||||
msm5205_data_w(device, state->m_adpcm_data >> 4);
|
||||
m_adpcm_data = machine().root_device().memregion("adpcm")->base()[m_adpcm_pos];
|
||||
m_adpcm_pos = (m_adpcm_pos + 1) & 0x1ffff;
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm_data >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1791,7 +1789,7 @@ static const ym2203_interface ym2203_interface_champwr =
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(champwr_msm5205_vck),/* VCK function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(taitol_state,champwr_msm5205_vck),/* VCK function */
|
||||
MSM5205_S48_4B /* 8 kHz */
|
||||
};
|
||||
|
||||
|
@ -161,27 +161,35 @@ WRITE8_MEMBER(tbowl_state::tbowl_adpcm_vol_w)
|
||||
msm5205_set_volume(adpcm, (data & 0x7f) * 100 / 0x7f);
|
||||
}
|
||||
|
||||
static void tbowl_adpcm_int(device_t *device,int st)
|
||||
void tbowl_state::tbowl_adpcm_int( device_t *device, int num )
|
||||
{
|
||||
tbowl_state *state = device->machine().driver_data<tbowl_state>();
|
||||
int num = (strcmp(device->tag(), ":msm1") == 0) ? 0 : 1;
|
||||
if (state->m_adpcm_pos[num] >= state->m_adpcm_end[num] ||
|
||||
state->m_adpcm_pos[num] >= state->memregion("adpcm")->bytes()/2)
|
||||
if (m_adpcm_pos[num] >= m_adpcm_end[num] ||
|
||||
m_adpcm_pos[num] >= memregion("adpcm")->bytes()/2)
|
||||
msm5205_reset_w(device,1);
|
||||
else if (state->m_adpcm_data[num] != -1)
|
||||
else if (m_adpcm_data[num] != -1)
|
||||
{
|
||||
msm5205_data_w(device,state->m_adpcm_data[num] & 0x0f);
|
||||
state->m_adpcm_data[num] = -1;
|
||||
msm5205_data_w(device,m_adpcm_data[num] & 0x0f);
|
||||
m_adpcm_data[num] = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base() + 0x10000 * num;
|
||||
UINT8 *ROM = machine().root_device().memregion("adpcm")->base() + 0x10000 * num;
|
||||
|
||||
state->m_adpcm_data[num] = ROM[state->m_adpcm_pos[num]++];
|
||||
msm5205_data_w(device,state->m_adpcm_data[num] >> 4);
|
||||
m_adpcm_data[num] = ROM[m_adpcm_pos[num]++];
|
||||
msm5205_data_w(device,m_adpcm_data[num] >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(tbowl_state::tbowl_adpcm_int_1)
|
||||
{
|
||||
tbowl_adpcm_int(machine().device("msm1"), 0);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(tbowl_state::tbowl_adpcm_int_2)
|
||||
{
|
||||
tbowl_adpcm_int(machine().device("msm2"), 1);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( 6206A_map, AS_PROGRAM, 8, tbowl_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_RAM
|
||||
@ -429,9 +437,15 @@ static const ym3812_interface ym3812_config =
|
||||
DEVCB_DRIVER_LINE_MEMBER(tbowl_state,irqhandler)
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
static const msm5205_interface msm5205_config_1 =
|
||||
{
|
||||
DEVCB_LINE(tbowl_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(tbowl_state,tbowl_adpcm_int_1), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8KHz */
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_config_2 =
|
||||
{
|
||||
DEVCB_DRIVER_LINE_MEMBER(tbowl_state,tbowl_adpcm_int_2), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8KHz */
|
||||
};
|
||||
|
||||
@ -505,11 +519,11 @@ static MACHINE_CONFIG_START( tbowl, tbowl_state )
|
||||
|
||||
/* something for the samples? */
|
||||
MCFG_SOUND_ADD("msm1", MSM5205, 384000)
|
||||
MCFG_SOUND_CONFIG(msm5205_config)
|
||||
MCFG_SOUND_CONFIG(msm5205_config_1)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
|
||||
MCFG_SOUND_ADD("msm2", MSM5205, 384000)
|
||||
MCFG_SOUND_CONFIG(msm5205_config)
|
||||
MCFG_SOUND_CONFIG(msm5205_config_2)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
@ -94,23 +94,22 @@ WRITE8_MEMBER(tecmo_state::tecmo_adpcm_vol_w)
|
||||
msm5205_set_volume(device,(data & 0x0f) * 100 / 15);
|
||||
}
|
||||
|
||||
static void tecmo_adpcm_int(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(tecmo_state::tecmo_adpcm_int)
|
||||
{
|
||||
tecmo_state *state = device->machine().driver_data<tecmo_state>();
|
||||
if (state->m_adpcm_pos >= state->m_adpcm_end ||
|
||||
state->m_adpcm_pos >= state->memregion("adpcm")->bytes())
|
||||
msm5205_reset_w(device,1);
|
||||
else if (state->m_adpcm_data != -1)
|
||||
if (m_adpcm_pos >= m_adpcm_end ||
|
||||
m_adpcm_pos >= memregion("adpcm")->bytes())
|
||||
msm5205_reset_w(machine().device("msm"),1);
|
||||
else if (m_adpcm_data != -1)
|
||||
{
|
||||
msm5205_data_w(device,state->m_adpcm_data & 0x0f);
|
||||
state->m_adpcm_data = -1;
|
||||
msm5205_data_w(machine().device("msm"),m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base();
|
||||
UINT8 *ROM = machine().root_device().memregion("adpcm")->base();
|
||||
|
||||
state->m_adpcm_data = ROM[state->m_adpcm_pos++];
|
||||
msm5205_data_w(device,state->m_adpcm_data >> 4);
|
||||
m_adpcm_data = ROM[m_adpcm_pos++];
|
||||
msm5205_data_w(machine().device("msm"),m_adpcm_data >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -616,7 +615,7 @@ static const ym3812_interface ym3812_config =
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(tecmo_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(tecmo_state,tecmo_adpcm_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8KHz */
|
||||
};
|
||||
|
||||
|
@ -188,22 +188,20 @@ WRITE8_MEMBER(tehkanwc_state::msm_reset_w)
|
||||
msm5205_reset_w(device,data ? 0 : 1);
|
||||
}
|
||||
|
||||
static void tehkanwc_adpcm_int(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(tehkanwc_state::tehkanwc_adpcm_int)
|
||||
{
|
||||
tehkanwc_state *state = device->machine().driver_data<tehkanwc_state>();
|
||||
UINT8 *SAMPLES = memregion("adpcm")->base();
|
||||
int msm_data = SAMPLES[m_msm_data_offs & 0x7fff];
|
||||
|
||||
UINT8 *SAMPLES = state->memregion("adpcm")->base();
|
||||
int msm_data = SAMPLES[state->m_msm_data_offs & 0x7fff];
|
||||
|
||||
if (state->m_toggle == 0)
|
||||
msm5205_data_w(device,(msm_data >> 4) & 0x0f);
|
||||
if (m_toggle == 0)
|
||||
msm5205_data_w(machine().device("msm"),(msm_data >> 4) & 0x0f);
|
||||
else
|
||||
{
|
||||
msm5205_data_w(device,msm_data & 0x0f);
|
||||
state->m_msm_data_offs++;
|
||||
msm5205_data_w(machine().device("msm"),msm_data & 0x0f);
|
||||
m_msm_data_offs++;
|
||||
}
|
||||
|
||||
state->m_toggle ^= 1;
|
||||
m_toggle ^= 1;
|
||||
}
|
||||
|
||||
/* End of MSM with counters emulation */
|
||||
@ -633,7 +631,7 @@ static const ay8910_interface ay8910_interface_2 =
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(tehkanwc_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(tehkanwc_state,tehkanwc_adpcm_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* 8KHz */
|
||||
};
|
||||
|
||||
|
@ -56,16 +56,14 @@ READ16_MEMBER(toki_state::pip16_r)
|
||||
|
||||
|
||||
|
||||
static void toki_adpcm_int (device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(toki_state::toki_adpcm_int)
|
||||
{
|
||||
toki_state *state = device->machine().driver_data<toki_state>();
|
||||
msm5205_data_w (machine().device("msm"), m_msm5205next);
|
||||
m_msm5205next >>= 4;
|
||||
|
||||
msm5205_data_w (device, state->m_msm5205next);
|
||||
state->m_msm5205next >>= 4;
|
||||
|
||||
state->m_toggle ^= 1;
|
||||
if (state->m_toggle)
|
||||
device->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
m_toggle ^= 1;
|
||||
if (m_toggle)
|
||||
machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(toki_state::toki_adpcm_control_w)
|
||||
@ -408,7 +406,7 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(toki_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(toki_state,toki_adpcm_int), /* interrupt function */
|
||||
MSM5205_S96_4B /* 4KHz */
|
||||
};
|
||||
|
||||
|
@ -424,27 +424,26 @@ WRITE8_MEMBER(topspeed_state::topspeed_tc0140syt_comm_w)
|
||||
device->tc0140syt_comm_w(space, 0, data);
|
||||
}
|
||||
|
||||
static void topspeed_msm5205_clock( device_t *device, int chip )
|
||||
void topspeed_state::topspeed_msm5205_clock( device_t *device, int chip )
|
||||
{
|
||||
topspeed_state *state = device->machine().driver_data<topspeed_state>();
|
||||
UINT8 data = state->m_msm_rom[chip][state->m_msm_pos[chip]];
|
||||
UINT8 data = m_msm_rom[chip][m_msm_pos[chip]];
|
||||
|
||||
msm5205_data_w(device, state->m_msm_sel[chip] ? data & 0xf : data >> 4 & 0xf);
|
||||
state->m_msm_pos[chip] += state->m_msm_sel[chip];
|
||||
state->m_msm_sel[chip] ^= 1;
|
||||
msm5205_data_w(device, m_msm_sel[chip] ? data & 0xf : data >> 4 & 0xf);
|
||||
m_msm_pos[chip] += m_msm_sel[chip];
|
||||
m_msm_sel[chip] ^= 1;
|
||||
|
||||
if ((state->m_msm_pos[chip]) == state->m_msm_loop[chip])
|
||||
state->m_msm_pos[chip] = state->m_msm_start[chip];
|
||||
if ((m_msm_pos[chip]) == m_msm_loop[chip])
|
||||
m_msm_pos[chip] = m_msm_start[chip];
|
||||
}
|
||||
|
||||
static void topspeed_msm5205_vck_1( device_t *device ,int state)
|
||||
WRITE_LINE_MEMBER(topspeed_state::topspeed_msm5205_vck_1)
|
||||
{
|
||||
topspeed_msm5205_clock(device, 0);
|
||||
topspeed_msm5205_clock(m_msm_chip[0], 0);
|
||||
}
|
||||
|
||||
static void topspeed_msm5205_vck_2( device_t *device ,int state)
|
||||
WRITE_LINE_MEMBER(topspeed_state::topspeed_msm5205_vck_2)
|
||||
{
|
||||
topspeed_msm5205_clock(device, 1);
|
||||
topspeed_msm5205_clock(m_msm_chip[1], 1);
|
||||
}
|
||||
|
||||
|
||||
@ -655,13 +654,13 @@ GFXDECODE_END
|
||||
|
||||
static const msm5205_interface msm5205_config_1 =
|
||||
{
|
||||
DEVCB_LINE(topspeed_msm5205_vck_1), /* VCK function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(topspeed_state,topspeed_msm5205_vck_1), /* VCK function */
|
||||
MSM5205_S48_4B /* 8 kHz */
|
||||
};
|
||||
|
||||
static const msm5205_interface msm5205_config_2 =
|
||||
{
|
||||
DEVCB_LINE(topspeed_msm5205_vck_2), /* VCK function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(topspeed_state,topspeed_msm5205_vck_2), /* VCK function */
|
||||
MSM5205_S48_4B /* 8 kHz */
|
||||
};
|
||||
|
||||
|
@ -549,19 +549,18 @@ WRITE8_MEMBER(tubep_state::rjammer_voice_frequency_select_w)
|
||||
}
|
||||
|
||||
|
||||
static void rjammer_adpcm_vck (device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(tubep_state::rjammer_adpcm_vck)
|
||||
{
|
||||
tubep_state *state = device->machine().driver_data<tubep_state>();
|
||||
state->m_ls74 = (state->m_ls74 + 1) & 1;
|
||||
m_ls74 = (m_ls74 + 1) & 1;
|
||||
|
||||
if (state->m_ls74 == 1)
|
||||
if (m_ls74 == 1)
|
||||
{
|
||||
msm5205_data_w(device, (state->m_ls377 >> 0) & 15 );
|
||||
device->machine().device("soundcpu")->execute().set_input_line(0, ASSERT_LINE );
|
||||
msm5205_data_w(machine().device("msm"), (m_ls377 >> 0) & 15 );
|
||||
machine().device("soundcpu")->execute().set_input_line(0, ASSERT_LINE );
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(device, (state->m_ls377 >> 4) & 15 );
|
||||
msm5205_data_w(machine().device("msm"), (m_ls377 >> 4) & 15 );
|
||||
}
|
||||
|
||||
}
|
||||
@ -870,7 +869,7 @@ static const ay8910_interface ay8910_interface_3 =
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(rjammer_adpcm_vck), /* VCK function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(tubep_state,rjammer_adpcm_vck), /* VCK function */
|
||||
MSM5205_S48_4B /* 8 KHz (changes at run time) */
|
||||
};
|
||||
|
||||
|
@ -340,23 +340,21 @@ static const ym2203_interface ym2203_config =
|
||||
DEVCB_DRIVER_LINE_MEMBER(wc90b_state,irqhandler)
|
||||
};
|
||||
|
||||
static void adpcm_int(device_t *device,int st)
|
||||
WRITE_LINE_MEMBER(wc90b_state::adpcm_int)
|
||||
{
|
||||
wc90b_state *state = device->machine().driver_data<wc90b_state>();
|
||||
|
||||
state->m_toggle ^= 1;
|
||||
if(state->m_toggle)
|
||||
m_toggle ^= 1;
|
||||
if(m_toggle)
|
||||
{
|
||||
msm5205_data_w(device, (state->m_msm5205next & 0xf0) >> 4);
|
||||
device->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
msm5205_data_w(machine().device("msm"), (m_msm5205next & 0xf0) >> 4);
|
||||
machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
else
|
||||
msm5205_data_w(device, (state->m_msm5205next & 0x0f) >> 0);
|
||||
msm5205_data_w(machine().device("msm"), (m_msm5205next & 0x0f) >> 0);
|
||||
}
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
{
|
||||
DEVCB_LINE(adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(wc90b_state,adpcm_int), /* interrupt function */
|
||||
MSM5205_S96_4B /* 4KHz 4-bit */
|
||||
};
|
||||
|
||||
|
@ -443,21 +443,19 @@ GFXDECODE_END
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
static void yunsung8_adpcm_int( device_t *device,int st )
|
||||
WRITE_LINE_MEMBER(yunsung8_state::yunsung8_adpcm_int)
|
||||
{
|
||||
yunsung8_state *state = device->machine().driver_data<yunsung8_state>();
|
||||
msm5205_data_w(machine().device("msm"), m_adpcm >> 4);
|
||||
m_adpcm <<= 4;
|
||||
|
||||
msm5205_data_w(device, state->m_adpcm >> 4);
|
||||
state->m_adpcm <<= 4;
|
||||
|
||||
state->m_toggle ^= 1;
|
||||
if (state->m_toggle)
|
||||
state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
m_toggle ^= 1;
|
||||
if (m_toggle)
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static const msm5205_interface yunsung8_msm5205_interface =
|
||||
{
|
||||
DEVCB_LINE(yunsung8_adpcm_int), /* interrupt function */
|
||||
DEVCB_DRIVER_LINE_MEMBER(yunsung8_state,yunsung8_adpcm_int), /* interrupt function */
|
||||
MSM5205_S96_4B /* 4KHz, 4 Bits */
|
||||
};
|
||||
|
||||
|
@ -55,6 +55,7 @@ public:
|
||||
INTERRUPT_GEN_MEMBER(vblank_irq);
|
||||
void appoooh_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, UINT8 *sprite );
|
||||
void robowres_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, UINT8 *sprite );
|
||||
DECLARE_WRITE_LINE_MEMBER(appoooh_adpcm_int);
|
||||
};
|
||||
|
||||
#define CHR1_OFST 0x00 /* palette page of char set #1 */
|
||||
|
@ -74,4 +74,6 @@ public:
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_ashnojoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(ym2203_irq_handler);
|
||||
DECLARE_WRITE_LINE_MEMBER(ashnojoe_vclk_cb);
|
||||
};
|
||||
|
@ -63,4 +63,5 @@ public:
|
||||
DECLARE_WRITE16_MEMBER( bonzeadv_cchip_bank_w );
|
||||
DECLARE_WRITE16_MEMBER( bonzeadv_cchip_ram_w );
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
DECLARE_WRITE_LINE_MEMBER(asuka_msm5205_vck);
|
||||
};
|
||||
|
@ -43,4 +43,5 @@ public:
|
||||
UINT32 screen_update_battlera(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(battlera_irq);
|
||||
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &clip,int pri);
|
||||
DECLARE_WRITE_LINE_MEMBER(battlera_adpcm_int);
|
||||
};
|
||||
|
@ -319,7 +319,8 @@ public:
|
||||
DECLARE_READ16_MEMBER(cps2_qsound_volume_r);
|
||||
DECLARE_READ16_MEMBER(kludge_r);
|
||||
DECLARE_READ16_MEMBER(joy_or_paddle_r);
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(m5205_int1);
|
||||
DECLARE_WRITE_LINE_MEMBER(m5205_int2);
|
||||
};
|
||||
|
||||
/*----------- defined in drivers/cps1.c -----------*/
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
TIMER_CALLBACK_MEMBER(main_to_sound_callback);
|
||||
TIMER_CALLBACK_MEMBER(sound_to_main_callback);
|
||||
void get_pens( pen_t *pens );
|
||||
DECLARE_WRITE_LINE_MEMBER(vck_callback);
|
||||
};
|
||||
|
||||
/*----------- defined in video/crgolf.c -----------*/
|
||||
|
@ -108,4 +108,5 @@ public:
|
||||
void update_psg1( int port );
|
||||
void update_da( );
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
DECLARE_WRITE_LINE_MEMBER(darius_adpcm_int);
|
||||
};
|
||||
|
@ -100,4 +100,7 @@ public:
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(ddragon_scanline);
|
||||
void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect );
|
||||
int scanline_to_vcount( int scanline );
|
||||
void dd_adpcm_int(device_t *device, int chip);
|
||||
DECLARE_WRITE_LINE_MEMBER(dd_adpcm_int_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(dd_adpcm_int_2);
|
||||
};
|
||||
|
@ -89,6 +89,8 @@ public:
|
||||
void dec0_i8751_reset();
|
||||
void h6280_decrypt(const char *cputag);
|
||||
void slyspy_set_protection_map( int type);
|
||||
DECLARE_WRITE_LINE_MEMBER(sound_irq);
|
||||
DECLARE_WRITE_LINE_MEMBER(sound_irq2);
|
||||
};
|
||||
|
||||
|
||||
@ -114,4 +116,5 @@ public:
|
||||
DECLARE_VIDEO_START(automat);
|
||||
UINT32 screen_update_automat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_secretab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(automat_vclk_cb);
|
||||
};
|
||||
|
@ -135,4 +135,5 @@ public:
|
||||
TIMER_CALLBACK_MEMBER(dec8_i8751_timer_callback);
|
||||
void srdarwin_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int pri );
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
DECLARE_WRITE_LINE_MEMBER(csilver_adpcm_int);
|
||||
};
|
||||
|
@ -50,4 +50,5 @@ public:
|
||||
UINT32 screen_update_docastle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void video_start_common( UINT32 tile_transmask );
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
DECLARE_WRITE_LINE_MEMBER(idsoccer_adpcm_int);
|
||||
};
|
||||
|
@ -36,4 +36,5 @@ public:
|
||||
virtual void palette_init();
|
||||
UINT32 screen_update_drmicro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(drmicro_interrupt);
|
||||
DECLARE_WRITE_LINE_MEMBER(pcm_w);
|
||||
};
|
||||
|
@ -492,6 +492,10 @@ public:
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(mjmyster_irq);
|
||||
void tenkai_update_rombank();
|
||||
void gekisha_bank_postload();
|
||||
DECLARE_WRITE_LINE_MEMBER(sprtmtch_sound_callback);
|
||||
DECLARE_WRITE_LINE_MEMBER(jantouki_sound_callback);
|
||||
DECLARE_WRITE_LINE_MEMBER(adpcm_int);
|
||||
DECLARE_WRITE_LINE_MEMBER(adpcm_int_cpu1);
|
||||
};
|
||||
|
||||
//----------- defined in drivers/dynax.c -----------
|
||||
|
@ -52,4 +52,8 @@ public:
|
||||
INTERRUPT_GEN_MEMBER(fantland_irq);
|
||||
INTERRUPT_GEN_MEMBER(fantland_sound_irq);
|
||||
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(borntofi_adpcm_int_0);
|
||||
DECLARE_WRITE_LINE_MEMBER(borntofi_adpcm_int_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(borntofi_adpcm_int_2);
|
||||
DECLARE_WRITE_LINE_MEMBER(borntofi_adpcm_int_3);
|
||||
};
|
||||
|
@ -74,4 +74,5 @@ public:
|
||||
INTERRUPT_GEN_MEMBER(firetrap_irq);
|
||||
inline void get_bg_tile_info(tile_data &tileinfo, int tile_index, UINT8 *bgvideoram, int gfx_region);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
DECLARE_WRITE_LINE_MEMBER(firetrap_adpcm_int);
|
||||
};
|
||||
|
@ -93,4 +93,5 @@ public:
|
||||
inline void get_fromance_tile_info( tile_data &tileinfo, int tile_index, int layer );
|
||||
inline void get_nekkyoku_tile_info( tile_data &tileinfo, int tile_index, int layer );
|
||||
void init_common( );
|
||||
DECLARE_WRITE_LINE_MEMBER(fromance_adpcm_int);
|
||||
};
|
||||
|
@ -64,4 +64,5 @@ public:
|
||||
TIMER_CALLBACK_MEMBER(gcpinbal_interrupt3);
|
||||
void gcpinbal_core_vh_start( );
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs );
|
||||
DECLARE_WRITE_LINE_MEMBER(gcp_adpcm_int);
|
||||
};
|
||||
|
@ -68,4 +68,5 @@ public:
|
||||
UINT32 screen_update_gladiatr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void swap_block(UINT8 *src1,UINT8 *src2,int len);
|
||||
DECLARE_WRITE_LINE_MEMBER(gladiator_ym_irq);
|
||||
};
|
||||
|
@ -55,4 +55,5 @@ public:
|
||||
void screen_eof_goal92(screen_device &screen, bool state);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int pri );
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
DECLARE_WRITE_LINE_MEMBER(goal92_adpcm_int);
|
||||
};
|
||||
|
@ -55,4 +55,5 @@ public:
|
||||
void kchamp_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
void kchampvs_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
UINT8 *decrypt_code();
|
||||
DECLARE_WRITE_LINE_MEMBER(msmint);
|
||||
};
|
||||
|
@ -41,4 +41,5 @@ public:
|
||||
virtual void palette_init();
|
||||
UINT32 screen_update_lucky74(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(nmi_interrupt);
|
||||
DECLARE_WRITE_LINE_MEMBER(lucky74_adpcm_int);
|
||||
};
|
||||
|
@ -82,4 +82,5 @@ public:
|
||||
INTERRUPT_GEN_MEMBER(vblank_irq);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
UINT8 collision_check( rectangle& rect );
|
||||
DECLARE_WRITE_LINE_MEMBER(rougien_adpcm_int);
|
||||
};
|
||||
|
@ -107,4 +107,5 @@ public:
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
void bootleg_decode( );
|
||||
void configure_banks( );
|
||||
DECLARE_WRITE_LINE_MEMBER(spangbl_adpcm_int);
|
||||
};
|
||||
|
@ -73,7 +73,5 @@ public:
|
||||
UINT32 screen_update_ojankohs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_ojankoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void ojankoc_flipscreen( address_space &space, int data );
|
||||
DECLARE_WRITE_LINE_MEMBER(ojankohs_adpcm_int);
|
||||
};
|
||||
|
||||
/*----------- defined in video/ojankohs.c -----------*/
|
||||
void ojankoc_flipscreen(address_space &space, int data);
|
||||
|
@ -77,7 +77,7 @@ public:
|
||||
TIMER_CALLBACK_MEMBER(cchip_timer);
|
||||
void updateDifficulty( int mode );
|
||||
void opwolf_cchip_init( );
|
||||
void opwolf_msm5205_vck(device_t *device, int chip);
|
||||
DECLARE_WRITE_LINE_MEMBER(opwolf_msm5205_vck_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(opwolf_msm5205_vck_2);
|
||||
};
|
||||
|
||||
/*----------- defined in machine/opwolf.c -----------*/
|
||||
void opwolf_cchip_init(running_machine &machine);
|
||||
|
@ -19,4 +19,5 @@ public:
|
||||
UINT32 screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(pcktgal_adpcm_int);
|
||||
};
|
||||
|
@ -34,4 +34,5 @@ public:
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
UINT32 screen_update_rastan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(rastan_msm5205_vck);
|
||||
};
|
||||
|
@ -51,4 +51,7 @@ public:
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
void mcu63705_update_inputs();
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
void spd_adpcm_int(device_t *device, int chip);
|
||||
DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_2);
|
||||
};
|
||||
|
@ -69,4 +69,8 @@ public:
|
||||
void splash_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
|
||||
void funystrp_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
|
||||
void roldfrog_update_irq( );
|
||||
DECLARE_WRITE_LINE_MEMBER(splash_msm5205_int);
|
||||
DECLARE_WRITE_LINE_MEMBER(ym_irq);
|
||||
DECLARE_WRITE_LINE_MEMBER(adpcm_int1);
|
||||
DECLARE_WRITE_LINE_MEMBER(adpcm_int2);
|
||||
};
|
||||
|
@ -50,4 +50,5 @@ public:
|
||||
UINT32 screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_mjyuugi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT8 iox_key_matrix_calc(UINT8 p_side);
|
||||
DECLARE_WRITE_LINE_MEMBER(srmp2_adpcm_int);
|
||||
};
|
||||
|
@ -51,7 +51,6 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(stfight_adpcm_control_w);
|
||||
void set_pens();
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(stfight_adpcm_int);
|
||||
};
|
||||
|
||||
/*----------- defined in machine/stfight.c -----------*/
|
||||
void stfight_adpcm_int(device_t *device, int st);
|
||||
|
@ -200,4 +200,6 @@ public:
|
||||
void set_fg_page( int data );
|
||||
void set_bg_page( int data );
|
||||
void datsu_set_pages( );
|
||||
DECLARE_WRITE_LINE_MEMBER(tturfbl_msm5205_callback);
|
||||
DECLARE_WRITE_LINE_MEMBER(shdancbl_msm5205_callback);
|
||||
};
|
||||
|
@ -141,4 +141,5 @@ public:
|
||||
void taito_machine_reset();
|
||||
void bank_w(address_space &space, offs_t offset, UINT8 data, int banknum );
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
DECLARE_WRITE_LINE_MEMBER(champwr_msm5205_vck);
|
||||
};
|
||||
|
@ -55,4 +55,7 @@ public:
|
||||
UINT32 screen_update_tbowl_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void tbowl_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int xscroll, UINT8* spriteram);
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
void tbowl_adpcm_int(device_t *device, int chip);
|
||||
DECLARE_WRITE_LINE_MEMBER(tbowl_adpcm_int_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(tbowl_adpcm_int_2);
|
||||
};
|
||||
|
@ -51,4 +51,5 @@ public:
|
||||
UINT32 screen_update_tecmo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
DECLARE_WRITE_LINE_MEMBER(tecmo_adpcm_int);
|
||||
};
|
||||
|
@ -50,4 +50,5 @@ public:
|
||||
TIMER_CALLBACK_MEMBER(reset_callback);
|
||||
void gridiron_draw_led(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 led,int player);
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(tehkanwc_adpcm_int);
|
||||
};
|
||||
|
@ -42,4 +42,5 @@ public:
|
||||
UINT32 screen_update_tokib(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void toki_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
|
||||
void tokib_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(toki_adpcm_int);
|
||||
};
|
||||
|
@ -64,4 +64,7 @@ public:
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
void parse_control( ) /* assumes Z80 sandwiched between 68Ks */;
|
||||
void reset_sound_region( );
|
||||
void topspeed_msm5205_clock(device_t *device, int chip);
|
||||
DECLARE_WRITE_LINE_MEMBER(topspeed_msm5205_vck_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(topspeed_msm5205_vck_2);
|
||||
};
|
||||
|
@ -84,6 +84,7 @@ public:
|
||||
void draw_sprite();
|
||||
void tubep_vblank_end();
|
||||
void tubep_setup_save_state();
|
||||
DECLARE_WRITE_LINE_MEMBER(rjammer_adpcm_vck);
|
||||
};
|
||||
|
||||
|
||||
|
@ -42,4 +42,5 @@ public:
|
||||
UINT32 screen_update_wc90b(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority );
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
DECLARE_WRITE_LINE_MEMBER(adpcm_int);
|
||||
};
|
||||
|
@ -40,4 +40,5 @@ public:
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_yunsung8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(yunsung8_adpcm_int);
|
||||
};
|
||||
|
@ -186,28 +186,27 @@ static const int sampleLimits[] =
|
||||
0x7200 // (end of samples)
|
||||
};
|
||||
|
||||
void stfight_adpcm_int(device_t *device, int st)
|
||||
WRITE_LINE_MEMBER(stfight_state::stfight_adpcm_int)
|
||||
{
|
||||
stfight_state *state = device->machine().driver_data<stfight_state>();
|
||||
UINT8 *SAMPLES = state->memregion("adpcm")->base();
|
||||
int adpcm_data = SAMPLES[state->m_adpcm_data_offs & 0x7fff];
|
||||
UINT8 *SAMPLES = memregion("adpcm")->base();
|
||||
int adpcm_data = SAMPLES[m_adpcm_data_offs & 0x7fff];
|
||||
|
||||
// finished playing sample?
|
||||
if( state->m_adpcm_data_offs == state->m_adpcm_data_end )
|
||||
if( m_adpcm_data_offs == m_adpcm_data_end )
|
||||
{
|
||||
msm5205_reset_w( device, 1 );
|
||||
msm5205_reset_w(machine().device("msm"), 1 );
|
||||
return;
|
||||
}
|
||||
|
||||
if( state->m_toggle == 0 )
|
||||
msm5205_data_w( device, ( adpcm_data >> 4 ) & 0x0f );
|
||||
if( m_toggle == 0 )
|
||||
msm5205_data_w(machine().device("msm"), ( adpcm_data >> 4 ) & 0x0f );
|
||||
else
|
||||
{
|
||||
msm5205_data_w( device, adpcm_data & 0x0f );
|
||||
state->m_adpcm_data_offs++;
|
||||
msm5205_data_w(machine().device("msm"), adpcm_data & 0x0f );
|
||||
m_adpcm_data_offs++;
|
||||
}
|
||||
|
||||
state->m_toggle ^= 1;
|
||||
m_toggle ^= 1;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(stfight_state::stfight_adpcm_control_w)
|
||||
|
Loading…
Reference in New Issue
Block a user