mirror of
https://github.com/holub/mame
synced 2025-06-06 12:53:46 +03:00
msm5205.c: modernized the device. [Fabio Priuli]
This commit is contained in:
parent
8d7e236c83
commit
6242986278
@ -47,38 +47,98 @@
|
||||
Timer callback at VCLK low edge on MSM5205 (at rising edge on MSM6585)
|
||||
|
||||
TODO:
|
||||
- convert to modern
|
||||
- lowpass filter for MSM6585
|
||||
|
||||
*/
|
||||
|
||||
struct msm5205_state
|
||||
{
|
||||
const msm5205_interface *intf;
|
||||
device_t *device;
|
||||
sound_stream * stream; /* number of stream system */
|
||||
INT32 clock; /* clock rate */
|
||||
emu_timer *timer; /* VCLK callback timer */
|
||||
INT32 data; /* next adpcm data */
|
||||
INT32 vclk; /* vclk signal (external mode) */
|
||||
INT32 reset; /* reset pin signal */
|
||||
INT32 prescaler; /* prescaler selector S1 and S2 */
|
||||
INT32 bitwidth; /* bit width selector -3B/4B */
|
||||
INT32 signal; /* current ADPCM signal */
|
||||
INT32 step; /* current ADPCM step */
|
||||
int diff_lookup[49*16];
|
||||
devcb_resolved_write_line vclk_callback;
|
||||
};
|
||||
const device_type MSM5205 = &device_creator<msm5205_device>;
|
||||
const device_type MSM6585 = &device_creator<msm6585_device>;
|
||||
|
||||
INLINE msm5205_state *get_safe_token(device_t *device)
|
||||
|
||||
msm5205_device::msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, MSM5205, "MSM5205", tag, owner, clock),
|
||||
device_sound_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
msm5205_device::msm5205_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, type, name, tag, owner, clock),
|
||||
device_sound_interface(mconfig, *this)
|
||||
{
|
||||
assert(device != NULL);
|
||||
assert(device->type() == MSM5205 || device->type() == MSM6585);
|
||||
return (msm5205_state *)downcast<msm5205_device *>(device)->token();
|
||||
}
|
||||
|
||||
|
||||
static void msm5205_playmode(msm5205_state *voice,int select);
|
||||
msm6585_device::msm6585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: msm5205_device(mconfig, MSM6585, "MSM6585", tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_config_complete - perform any
|
||||
// operations now that the configuration is
|
||||
// complete
|
||||
//-------------------------------------------------
|
||||
|
||||
void msm5205_device::device_config_complete()
|
||||
{
|
||||
// inherit a copy of the static data
|
||||
const msm5205_interface *intf = reinterpret_cast<const msm5205_interface *>(static_config());
|
||||
if (intf != NULL)
|
||||
*static_cast<msm5205_interface *>(this) = *intf;
|
||||
|
||||
// or initialize to defaults if none provided
|
||||
else
|
||||
{
|
||||
memset(&m_vclk_cb, 0, sizeof(m_vclk_cb));
|
||||
m_select = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void msm5205_device::device_start()
|
||||
{
|
||||
m_mod_clock = clock();
|
||||
m_vclk_callback.resolve(m_vclk_cb, *this);
|
||||
|
||||
/* compute the difference tables */
|
||||
compute_tables();
|
||||
|
||||
/* stream system initialize */
|
||||
m_stream = machine().sound().stream_alloc(*this, 0, 1, clock(), this);
|
||||
m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(msm5205_device::vclk_callback), this));
|
||||
|
||||
/* register for save states */
|
||||
save_item(NAME(m_mod_clock));
|
||||
save_item(NAME(m_data));
|
||||
save_item(NAME(m_vclk));
|
||||
save_item(NAME(m_reset));
|
||||
save_item(NAME(m_prescaler));
|
||||
save_item(NAME(m_bitwidth));
|
||||
save_item(NAME(m_signal));
|
||||
save_item(NAME(m_step));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void msm5205_device::device_reset()
|
||||
{
|
||||
/* initialize work */
|
||||
m_data = 0;
|
||||
m_vclk = 0;
|
||||
m_reset = 0;
|
||||
m_signal = 0;
|
||||
m_step = 0;
|
||||
|
||||
/* timer and bitwidth set */
|
||||
playmode_w(m_select);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ADPCM lookup table
|
||||
@ -91,7 +151,7 @@ static const int index_shift[8] = { -1, -1, -1, -1, 2, 4, 6, 8 };
|
||||
* Compute the difference table
|
||||
*/
|
||||
|
||||
static void ComputeTables (msm5205_state *voice)
|
||||
void msm5205_device::compute_tables()
|
||||
{
|
||||
/* nibble to bit map */
|
||||
static const int nbl2bit[16][4] =
|
||||
@ -113,7 +173,7 @@ static void ComputeTables (msm5205_state *voice)
|
||||
/* loop over all nibbles and compute the difference */
|
||||
for (nib = 0; nib < 16; nib++)
|
||||
{
|
||||
voice->diff_lookup[step*16 + nib] = nbl2bit[nib][0] *
|
||||
m_diff_lookup[step*16 + nib] = nbl2bit[nib][0] *
|
||||
(stepval * nbl2bit[nib][1] +
|
||||
stepval/2 * nbl2bit[nib][2] +
|
||||
stepval/4 * nbl2bit[nib][3] +
|
||||
@ -122,135 +182,63 @@ static void ComputeTables (msm5205_state *voice)
|
||||
}
|
||||
}
|
||||
|
||||
/* stream update callbacks */
|
||||
static STREAM_UPDATE( MSM5205_update )
|
||||
{
|
||||
msm5205_state *voice = (msm5205_state *)param;
|
||||
stream_sample_t *buffer = outputs[0];
|
||||
|
||||
/* if this voice is active */
|
||||
if(voice->signal)
|
||||
{
|
||||
short val = voice->signal * 16;
|
||||
while (samples)
|
||||
{
|
||||
*buffer++ = val;
|
||||
samples--;
|
||||
}
|
||||
}
|
||||
else
|
||||
memset (buffer,0,samples*sizeof(*buffer));
|
||||
}
|
||||
|
||||
/* timer callback at VCLK low edge on MSM5205 (at rising edge on MSM6585) */
|
||||
static TIMER_CALLBACK( MSM5205_vclk_callback )
|
||||
TIMER_CALLBACK_MEMBER( msm5205_device::vclk_callback )
|
||||
{
|
||||
msm5205_state *voice = (msm5205_state *)ptr;
|
||||
int val;
|
||||
int new_signal;
|
||||
|
||||
/* callback user handler and latch next data */
|
||||
if(!voice->vclk_callback.isnull()) voice->vclk_callback(1);
|
||||
if (!m_vclk_callback.isnull())
|
||||
m_vclk_callback(1);
|
||||
|
||||
/* reset check at last hiedge of VCLK */
|
||||
if(voice->reset)
|
||||
if (m_reset)
|
||||
{
|
||||
new_signal = 0;
|
||||
voice->step = 0;
|
||||
m_step = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* update signal */
|
||||
/* !! MSM5205 has internal 12bit decoding, signal width is 0 to 8191 !! */
|
||||
val = voice->data;
|
||||
new_signal = voice->signal + voice->diff_lookup[voice->step * 16 + (val & 15)];
|
||||
val = m_data;
|
||||
new_signal = m_signal + m_diff_lookup[m_step * 16 + (val & 15)];
|
||||
|
||||
if (new_signal > 2047) new_signal = 2047;
|
||||
else if (new_signal < -2048) new_signal = -2048;
|
||||
voice->step += index_shift[val & 7];
|
||||
if (voice->step > 48) voice->step = 48;
|
||||
else if (voice->step < 0) voice->step = 0;
|
||||
|
||||
m_step += index_shift[val & 7];
|
||||
|
||||
if (m_step > 48) m_step = 48;
|
||||
else if (m_step < 0) m_step = 0;
|
||||
}
|
||||
|
||||
/* update when signal changed */
|
||||
if( voice->signal != new_signal)
|
||||
if( m_signal != new_signal)
|
||||
{
|
||||
voice->stream->update();
|
||||
voice->signal = new_signal;
|
||||
m_stream->update();
|
||||
m_signal = new_signal;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Reset emulation of an MSM5205-compatible chip
|
||||
*/
|
||||
static DEVICE_RESET( msm5205 )
|
||||
{
|
||||
msm5205_state *voice = get_safe_token(device);
|
||||
|
||||
/* initialize work */
|
||||
voice->data = 0;
|
||||
voice->vclk = 0;
|
||||
voice->reset = 0;
|
||||
voice->signal = 0;
|
||||
voice->step = 0;
|
||||
|
||||
/* timer and bitwidth set */
|
||||
msm5205_playmode(voice,voice->intf->select);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Start emulation of an MSM5205-compatible chip
|
||||
*/
|
||||
|
||||
static DEVICE_START( msm5205 )
|
||||
{
|
||||
msm5205_state *voice = get_safe_token(device);
|
||||
|
||||
/* save a global pointer to our interface */
|
||||
voice->intf = (const msm5205_interface *)device->static_config();
|
||||
voice->device = device;
|
||||
voice->clock = device->clock();
|
||||
voice->vclk_callback.resolve(voice->intf->vclk_callback,*device);
|
||||
|
||||
/* compute the difference tables */
|
||||
ComputeTables (voice);
|
||||
|
||||
/* stream system initialize */
|
||||
voice->stream = device->machine().sound().stream_alloc(*device,0,1,device->clock(),voice,MSM5205_update);
|
||||
voice->timer = device->machine().scheduler().timer_alloc(FUNC(MSM5205_vclk_callback), voice);
|
||||
|
||||
/* initialize */
|
||||
DEVICE_RESET_CALL(msm5205);
|
||||
|
||||
/* register for save states */
|
||||
device->save_item(NAME(voice->clock));
|
||||
device->save_item(NAME(voice->data));
|
||||
device->save_item(NAME(voice->vclk));
|
||||
device->save_item(NAME(voice->reset));
|
||||
device->save_item(NAME(voice->prescaler));
|
||||
device->save_item(NAME(voice->bitwidth));
|
||||
device->save_item(NAME(voice->signal));
|
||||
device->save_item(NAME(voice->step));
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle an update of the vclk status of a chip (1 is reset ON, 0 is reset OFF)
|
||||
* This function can use selector = MSM5205_SEX only
|
||||
*/
|
||||
void msm5205_vclk_w (device_t *device, int vclk)
|
||||
void msm5205_device::vclk_w(int vclk)
|
||||
{
|
||||
msm5205_state *voice = get_safe_token(device);
|
||||
|
||||
if( voice->prescaler != 0 )
|
||||
{
|
||||
logerror("error: msm5205_vclk_w() called with chip = '%s', but VCLK selected master mode\n", device->tag());
|
||||
}
|
||||
if (m_prescaler != 0)
|
||||
logerror("error: msm5205_vclk_w() called with chip = '%s', but VCLK selected master mode\n", this->device().tag());
|
||||
else
|
||||
{
|
||||
if( voice->vclk != vclk)
|
||||
if (m_vclk != vclk)
|
||||
{
|
||||
voice->vclk = vclk;
|
||||
if( !vclk ) MSM5205_vclk_callback(voice->device->machine(), voice, 0);
|
||||
m_vclk = vclk;
|
||||
if (!vclk)
|
||||
vclk_callback(this, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -259,36 +247,28 @@ void msm5205_vclk_w (device_t *device, int vclk)
|
||||
* Handle an update of the reset status of a chip (1 is reset ON, 0 is reset OFF)
|
||||
*/
|
||||
|
||||
void msm5205_reset_w (device_t *device, int reset)
|
||||
void msm5205_device::reset_w(int reset)
|
||||
{
|
||||
msm5205_state *voice = get_safe_token(device);
|
||||
voice->reset = reset;
|
||||
m_reset = reset;
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle an update of the data to the chip
|
||||
*/
|
||||
|
||||
void msm5205_data_w (device_t *device, int data)
|
||||
void msm5205_device::data_w(int data)
|
||||
{
|
||||
msm5205_state *voice = get_safe_token(device);
|
||||
if( voice->bitwidth == 4)
|
||||
voice->data = data & 0x0f;
|
||||
if (m_bitwidth == 4)
|
||||
m_data = data & 0x0f;
|
||||
else
|
||||
voice->data = (data & 0x07)<<1; /* unknown */
|
||||
m_data = (data & 0x07) << 1; /* unknown */
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle a change of the selector
|
||||
*/
|
||||
|
||||
void msm5205_playmode_w(device_t *device, int select)
|
||||
{
|
||||
msm5205_state *voice = get_safe_token(device);
|
||||
msm5205_playmode(voice, select);
|
||||
}
|
||||
|
||||
static void msm5205_playmode(msm5205_state *voice, int select)
|
||||
void msm5205_device::playmode_w(int select)
|
||||
{
|
||||
static const int prescaler_table[2][4] =
|
||||
{
|
||||
@ -298,92 +278,45 @@ static void msm5205_playmode(msm5205_state *voice, int select)
|
||||
int prescaler = prescaler_table[select >> 3 & 1][select & 3];
|
||||
int bitwidth = (select & 4) ? 4 : 3;
|
||||
|
||||
|
||||
if( voice->prescaler != prescaler )
|
||||
if (m_prescaler != prescaler)
|
||||
{
|
||||
voice->stream->update();
|
||||
m_stream->update();
|
||||
|
||||
voice->prescaler = prescaler;
|
||||
m_prescaler = prescaler;
|
||||
|
||||
/* timer set */
|
||||
if( prescaler )
|
||||
if (prescaler)
|
||||
{
|
||||
attotime period = attotime::from_hz(voice->clock) * prescaler;
|
||||
voice->timer->adjust(period, 0, period);
|
||||
attotime period = attotime::from_hz(m_mod_clock) * prescaler;
|
||||
m_timer->adjust(period, 0, period);
|
||||
}
|
||||
else
|
||||
voice->timer->adjust(attotime::never);
|
||||
m_timer->adjust(attotime::never);
|
||||
}
|
||||
|
||||
if( voice->bitwidth != bitwidth )
|
||||
if (m_bitwidth != bitwidth)
|
||||
{
|
||||
voice->stream->update();
|
||||
|
||||
voice->bitwidth = bitwidth;
|
||||
m_stream->update();
|
||||
m_bitwidth = bitwidth;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void msm5205_set_volume(device_t *device,int volume)
|
||||
void msm5205_device::set_volume(int volume)
|
||||
{
|
||||
msm5205_state *voice = get_safe_token(device);
|
||||
|
||||
voice->stream->set_output_gain(0,volume / 100.0);
|
||||
m_stream->set_output_gain(0,volume / 100.0);
|
||||
}
|
||||
|
||||
void msm5205_change_clock_w(device_t *device, INT32 clock)
|
||||
void msm5205_device::change_clock_w(INT32 clock)
|
||||
{
|
||||
msm5205_state *voice = get_safe_token(device);
|
||||
attotime period;
|
||||
|
||||
voice->clock = clock;
|
||||
m_mod_clock = clock;
|
||||
|
||||
period = attotime::from_hz(voice->clock) * voice->prescaler;
|
||||
voice->timer->adjust(period, 0, period);
|
||||
period = attotime::from_hz(m_mod_clock) * m_prescaler;
|
||||
m_timer->adjust(period, 0, period);
|
||||
}
|
||||
|
||||
const device_type MSM5205 = &device_creator<msm5205_device>;
|
||||
|
||||
msm5205_device::msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, MSM5205, "MSM5205", tag, owner, clock),
|
||||
device_sound_interface(mconfig, *this)
|
||||
{
|
||||
m_token = global_alloc_clear(msm5205_state);
|
||||
}
|
||||
msm5205_device::msm5205_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, type, name, tag, owner, clock),
|
||||
device_sound_interface(mconfig, *this)
|
||||
{
|
||||
m_token = global_alloc_clear(msm5205_state);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_config_complete - perform any
|
||||
// operations now that the configuration is
|
||||
// complete
|
||||
//-------------------------------------------------
|
||||
|
||||
void msm5205_device::device_config_complete()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void msm5205_device::device_start()
|
||||
{
|
||||
DEVICE_START_NAME( msm5205 )(this);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void msm5205_device::device_reset()
|
||||
{
|
||||
DEVICE_RESET_NAME( msm5205 )(this);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update - handle a stream update
|
||||
@ -391,24 +324,29 @@ void msm5205_device::device_reset()
|
||||
|
||||
void msm5205_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||
{
|
||||
// should never get here
|
||||
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
|
||||
stream_sample_t *buffer = outputs[0];
|
||||
|
||||
/* if this voice is active */
|
||||
if(m_signal)
|
||||
{
|
||||
short val = m_signal * 16;
|
||||
while (samples)
|
||||
{
|
||||
*buffer++ = val;
|
||||
samples--;
|
||||
}
|
||||
}
|
||||
else
|
||||
memset(buffer, 0, samples * sizeof(*buffer));
|
||||
}
|
||||
|
||||
|
||||
const device_type MSM6585 = &device_creator<msm6585_device>;
|
||||
|
||||
msm6585_device::msm6585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: msm5205_device(mconfig, MSM6585, "MSM6585", tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update - handle a stream update
|
||||
//-------------------------------------------------
|
||||
|
||||
void msm6585_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||
{
|
||||
// should never get here
|
||||
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
|
||||
// should this be different?
|
||||
msm5205_device::sound_stream_update(stream, inputs, outputs,samples);
|
||||
}
|
||||
|
@ -3,8 +3,6 @@
|
||||
#ifndef __MSM5205_H__
|
||||
#define __MSM5205_H__
|
||||
|
||||
#include "devlegcy.h"
|
||||
|
||||
/* an interface for the MSM5205 and similar chips */
|
||||
|
||||
/* prescaler selector defines */
|
||||
@ -24,48 +22,63 @@
|
||||
#define MSM6585_S80 (6+8) /* prescaler 1/80 (8KHz), data 4bit */
|
||||
#define MSM6585_S20 (7+8) /* prescaler 1/20(32KHz), data 4bit */
|
||||
|
||||
|
||||
struct msm5205_interface
|
||||
{
|
||||
devcb_write_line vclk_callback; /* VCLK callback */
|
||||
int select; /* prescaler / bit width selector */
|
||||
devcb_write_line m_vclk_cb; /* VCLK callback */
|
||||
int m_select; /* prescaler / bit width selector */
|
||||
};
|
||||
|
||||
/* reset signal should keep for 2cycle of VCLK */
|
||||
void msm5205_reset_w (device_t *device, int reset);
|
||||
/* adpcmata is latched after vclk_interrupt callback */
|
||||
void msm5205_data_w (device_t *device, int data);
|
||||
/* VCLK slave mode option */
|
||||
/* if VCLK and reset or data is changed at the same time, */
|
||||
/* Call msm5205_vclk_w after msm5205_data_w and msm5205_reset_w. */
|
||||
void msm5205_vclk_w (device_t *device, int reset);
|
||||
/* option , selected pin seletor */
|
||||
void msm5205_playmode_w(device_t *device, int _select);
|
||||
|
||||
void msm5205_set_volume(device_t *device,int volume);
|
||||
|
||||
void msm5205_change_clock_w(device_t *device, INT32 clock);
|
||||
|
||||
class msm5205_device : public device_t,
|
||||
public device_sound_interface
|
||||
public device_sound_interface,
|
||||
public msm5205_interface
|
||||
{
|
||||
public:
|
||||
msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
msm5205_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
|
||||
~msm5205_device() { global_free(m_token); }
|
||||
~msm5205_device() {}
|
||||
|
||||
// reset signal should keep for 2cycle of VCLK
|
||||
void reset_w(int reset);
|
||||
// adpcmata is latched after vclk_interrupt callback
|
||||
void data_w(int data);
|
||||
// VCLK slave mode option
|
||||
// if VCLK and reset or data is changed at the same time,
|
||||
// call vclk_w after data_w and reset_w.
|
||||
void vclk_w(int vclk);
|
||||
// option , selected pin seletor
|
||||
void playmode_w(int select);
|
||||
|
||||
void set_volume(int volume);
|
||||
void change_clock_w(INT32 clock);
|
||||
|
||||
// access to legacy token
|
||||
void *token() const { assert(m_token != NULL); return m_token; }
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete();
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
TIMER_CALLBACK_MEMBER(vclk_callback);
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
|
||||
private:
|
||||
|
||||
void compute_tables();
|
||||
|
||||
// internal state
|
||||
void *m_token;
|
||||
sound_stream * m_stream; /* number of stream system */
|
||||
INT32 m_mod_clock; /* clock rate */
|
||||
emu_timer *m_timer; /* VCLK callback timer */
|
||||
INT32 m_data; /* next adpcm data */
|
||||
INT32 m_vclk; /* vclk signal (external mode) */
|
||||
INT32 m_reset; /* reset pin signal */
|
||||
INT32 m_prescaler; /* prescaler selector S1 and S2 */
|
||||
INT32 m_bitwidth; /* bit width selector -3B/4B */
|
||||
INT32 m_signal; /* current ADPCM signal */
|
||||
INT32 m_step; /* current ADPCM step */
|
||||
int m_diff_lookup[49*16];
|
||||
devcb_resolved_write_line m_vclk_callback;
|
||||
};
|
||||
|
||||
extern const device_type MSM5205;
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
struct hyprolyb_adpcm_state
|
||||
{
|
||||
device_t *m_msm;
|
||||
msm5205_device *m_msm;
|
||||
address_space *m_space;
|
||||
UINT8 m_adpcm_ready; // only bootlegs
|
||||
UINT8 m_adpcm_busy;
|
||||
@ -25,7 +25,7 @@ static DEVICE_START( hyprolyb_adpcm )
|
||||
hyprolyb_adpcm_state *state = get_safe_token(device);
|
||||
|
||||
state->m_space = &device->machine().device("audiocpu")->memory().space(AS_PROGRAM);
|
||||
state->m_msm = device->machine().device("msm");
|
||||
state->m_msm = device->machine().device<msm5205_device>("msm");
|
||||
device->save_item(NAME(state->m_adpcm_ready)); // only bootlegs
|
||||
device->save_item(NAME(state->m_adpcm_busy));
|
||||
device->save_item(NAME(state->m_vck_ready));
|
||||
@ -60,7 +60,7 @@ static WRITE8_DEVICE_HANDLER( hyprolyb_msm_data_w )
|
||||
{
|
||||
hyprolyb_adpcm_state *state = get_safe_token(device);
|
||||
|
||||
msm5205_data_w(state->m_msm, data);
|
||||
state->m_msm->data_w(data);
|
||||
state->m_adpcm_busy = ~data & 0x80;
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@ struct irem_audio_state
|
||||
|
||||
ay8910_device *m_ay1;
|
||||
ay8910_device *m_ay2;
|
||||
device_t *m_adpcm1;
|
||||
device_t *m_adpcm2;
|
||||
msm5205_device *m_adpcm1;
|
||||
msm5205_device *m_adpcm2;
|
||||
};
|
||||
|
||||
INLINE irem_audio_state *get_safe_token( device_t *device )
|
||||
@ -43,8 +43,8 @@ static DEVICE_START( irem_audio )
|
||||
irem_audio_state *state = get_safe_token(device);
|
||||
running_machine &machine = device->machine();
|
||||
|
||||
state->m_adpcm1 = machine.device("msm1");
|
||||
state->m_adpcm2 = machine.device("msm2");
|
||||
state->m_adpcm1 = machine.device<msm5205_device>("msm1");
|
||||
state->m_adpcm2 = machine.device<msm5205_device>("msm2");
|
||||
state->m_ay1 = machine.device<ay8910_device>("ay1");
|
||||
state->m_ay2 = machine.device<ay8910_device>("ay2");
|
||||
|
||||
@ -153,14 +153,14 @@ static WRITE8_DEVICE_HANDLER( ay8910_0_portb_w )
|
||||
irem_audio_state *state = get_safe_token(device);
|
||||
|
||||
/* bits 2-4 select MSM5205 clock & 3b/4b playback mode */
|
||||
msm5205_playmode_w(state->m_adpcm1, (data >> 2) & 7);
|
||||
state->m_adpcm1->playmode_w((data >> 2) & 7);
|
||||
if (state->m_adpcm2 != NULL)
|
||||
msm5205_playmode_w(state->m_adpcm2, ((data >> 2) & 4) | 3); /* always in slave mode */
|
||||
state->m_adpcm2->playmode_w(((data >> 2) & 4) | 3); /* always in slave mode */
|
||||
|
||||
/* bits 0 and 1 reset the two chips */
|
||||
msm5205_reset_w(state->m_adpcm1, data & 1);
|
||||
state->m_adpcm1->reset_w(data & 1);
|
||||
if (state->m_adpcm2 != NULL)
|
||||
msm5205_reset_w(state->m_adpcm2, data & 2);
|
||||
state->m_adpcm2->reset_w(data & 2);
|
||||
}
|
||||
|
||||
|
||||
@ -191,12 +191,12 @@ static WRITE8_DEVICE_HANDLER( m52_adpcm_w )
|
||||
|
||||
if (offset & 1)
|
||||
{
|
||||
msm5205_data_w(state->m_adpcm1, data);
|
||||
state->m_adpcm1->data_w(data);
|
||||
}
|
||||
if (offset & 2)
|
||||
{
|
||||
if (state->m_adpcm2 != NULL)
|
||||
msm5205_data_w(state->m_adpcm2, data);
|
||||
state->m_adpcm2->data_w(data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,9 +205,9 @@ static WRITE8_DEVICE_HANDLER( m62_adpcm_w )
|
||||
{
|
||||
irem_audio_state *state = get_safe_token(device);
|
||||
|
||||
device_t *adpcm = (offset & 1) ? state->m_adpcm2 : state->m_adpcm1;
|
||||
msm5205_device *adpcm = (offset & 1) ? state->m_adpcm2 : state->m_adpcm1;
|
||||
if (adpcm != NULL)
|
||||
msm5205_data_w(adpcm, data);
|
||||
adpcm->data_w(data);
|
||||
}
|
||||
|
||||
|
||||
@ -220,15 +220,15 @@ static WRITE8_DEVICE_HANDLER( m62_adpcm_w )
|
||||
|
||||
static void adpcm_int(device_t *device,int st)
|
||||
{
|
||||
device_t *adpcm2 = device->machine().device("msm2");
|
||||
msm5205_device *adpcm2 = device->machine().device<msm5205_device>("msm2");
|
||||
|
||||
device->machine().device("iremsound")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
|
||||
/* the first MSM5205 clocks the second */
|
||||
if (adpcm2 != NULL)
|
||||
{
|
||||
msm5205_vclk_w(adpcm2, 1);
|
||||
msm5205_vclk_w(adpcm2, 0);
|
||||
adpcm2->vclk_w(1);
|
||||
adpcm2->vclk_w(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,17 +178,17 @@ WRITE_LINE_MEMBER(appoooh_state::appoooh_adpcm_int)
|
||||
UINT8 *RAM = memregion("adpcm")->base();
|
||||
|
||||
m_adpcm_data = RAM[m_adpcm_address++];
|
||||
msm5205_data_w(m_msm, m_adpcm_data >> 4);
|
||||
m_msm->data_w(m_adpcm_data >> 4);
|
||||
|
||||
if (m_adpcm_data == 0x70)
|
||||
{
|
||||
m_adpcm_address = 0xffffffff;
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(m_msm, m_adpcm_data & 0x0f );
|
||||
m_msm->data_w(m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
}
|
||||
@ -198,7 +198,7 @@ WRITE_LINE_MEMBER(appoooh_state::appoooh_adpcm_int)
|
||||
WRITE8_MEMBER(appoooh_state::appoooh_adpcm_w)
|
||||
{
|
||||
m_adpcm_address = data << 8;
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
m_adpcm_data = 0xffffffff;
|
||||
}
|
||||
|
||||
|
@ -281,7 +281,7 @@ WRITE8_MEMBER(ashnojoe_state::ym2203_write_a)
|
||||
if (data == 0xff)
|
||||
return;
|
||||
|
||||
msm5205_reset_w(m_msm, !(data & 0x01));
|
||||
m_msm->reset_w(!(data & 0x01));
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(ashnojoe_state::ym2203_write_b)
|
||||
@ -303,11 +303,11 @@ WRITE_LINE_MEMBER(ashnojoe_state::ashnojoe_vclk_cb)
|
||||
{
|
||||
if (m_msm5205_vclk_toggle == 0)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_adpcm_byte >> 4);
|
||||
m_msm->data_w(m_adpcm_byte >> 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(m_msm, m_adpcm_byte & 0xf);
|
||||
m_msm->data_w(m_adpcm_byte & 0xf);
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
|
@ -270,14 +270,14 @@ WRITE_LINE_MEMBER(asuka_state::asuka_msm5205_vck)
|
||||
{
|
||||
if (m_adpcm_data != -1)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_adpcm_data & 0x0f);
|
||||
m_msm->data_w(m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_adpcm_data = memregion("ymsnd")->base()[m_adpcm_pos];
|
||||
m_adpcm_pos = (m_adpcm_pos + 1) & 0xffff;
|
||||
msm5205_data_w(m_msm, m_adpcm_data >> 4);
|
||||
m_msm->data_w(m_adpcm_data >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -288,12 +288,12 @@ WRITE8_MEMBER(asuka_state::asuka_msm5205_address_w)
|
||||
|
||||
WRITE8_MEMBER(asuka_state::asuka_msm5205_start_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(asuka_state::asuka_msm5205_stop_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
m_adpcm_pos &= 0xff00;
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ ADDRESS_MAP_END
|
||||
|
||||
WRITE_LINE_MEMBER(battlera_state::battlera_adpcm_int)
|
||||
{
|
||||
msm5205_data_w(m_msm,m_msm5205next >> 4);
|
||||
m_msm->data_w(m_msm5205next >> 4);
|
||||
m_msm5205next <<= 4;
|
||||
|
||||
m_toggle = 1 - m_toggle;
|
||||
@ -100,7 +100,7 @@ WRITE8_MEMBER(battlera_state::battlera_adpcm_data_w)
|
||||
|
||||
WRITE8_MEMBER(battlera_state::battlera_adpcm_reset_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, battlera_state )
|
||||
|
@ -210,19 +210,19 @@ ADDRESS_MAP_END
|
||||
|
||||
WRITE8_MEMBER(cabal_state::cabalbl_1_adpcm_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm1,(data>>7)&1);
|
||||
m_msm1->reset_w(BIT(data, 7));
|
||||
/* ?? bit 6?? */
|
||||
msm5205_data_w(m_msm1,data);
|
||||
msm5205_vclk_w(m_msm1,1);
|
||||
msm5205_vclk_w(m_msm1,0);
|
||||
m_msm1->data_w(data);
|
||||
m_msm1->vclk_w(1);
|
||||
m_msm1->vclk_w(0);
|
||||
}
|
||||
WRITE8_MEMBER(cabal_state::cabalbl_2_adpcm_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm2,(data>>7)&1);
|
||||
m_msm2->reset_w(BIT(data, 7));
|
||||
/* ?? bit 6?? */
|
||||
msm5205_data_w(m_msm2,data);
|
||||
msm5205_vclk_w(m_msm2,1);
|
||||
msm5205_vclk_w(m_msm2,0);
|
||||
m_msm2->data_w(data);
|
||||
m_msm2->vclk_w(1);
|
||||
m_msm2->vclk_w(0);
|
||||
}
|
||||
static ADDRESS_MAP_START( cabalbl_talk1_map, AS_PROGRAM, 8, cabal_state )
|
||||
AM_RANGE(0x0000, 0xffff) AM_ROM AM_WRITENOP
|
||||
|
@ -247,7 +247,7 @@ WRITE8_MEMBER(chinagat_state::saiyugoub1_adpcm_control_w )
|
||||
{
|
||||
logerror("ADPCM output disabled\n");
|
||||
m_pcm_nibble = 0x0f;
|
||||
msm5205_reset_w(m_adpcm, 1);
|
||||
m_adpcm->reset_w(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -276,7 +276,7 @@ WRITE8_MEMBER(chinagat_state::saiyugoub1_adpcm_control_w )
|
||||
|
||||
if (((m_i8748_P2 & 0xc) >= 8) && ((data & 0xc) == 4))
|
||||
{
|
||||
msm5205_data_w (m_adpcm, m_pcm_nibble);
|
||||
m_adpcm->data_w(m_pcm_nibble);
|
||||
logerror("Writing %02x to m5205\n", m_pcm_nibble);
|
||||
}
|
||||
logerror("$ROM=%08x P1=%02x P2=%02x Prev_P2=%02x Nibble=%1x PCM_data=%02x\n", m_adpcm_addr, m_i8748_P1, data, m_i8748_P2, m_pcm_shift, m_pcm_nibble);
|
||||
@ -295,11 +295,11 @@ WRITE8_MEMBER(chinagat_state::saiyugoub1_m5205_clk_w )
|
||||
m_m5205_clk++;
|
||||
if (m_m5205_clk == 8)
|
||||
{
|
||||
msm5205_vclk_w(m_adpcm, 1); /* ??? */
|
||||
m_adpcm->vclk_w(1); /* ??? */
|
||||
m_m5205_clk = 0;
|
||||
}
|
||||
else
|
||||
msm5205_vclk_w(m_adpcm, 0); /* ??? */
|
||||
m_adpcm->vclk_w(0); /* ??? */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -237,7 +237,7 @@ WRITE8_MEMBER(chinsan_state::chin_adpcm_w)
|
||||
{
|
||||
m_adpcm_pos = (data & 0xff) * 0x100;
|
||||
m_adpcm_idle = 0;
|
||||
msm5205_reset_w(m_adpcm, 0);
|
||||
m_adpcm->reset_w(0);
|
||||
}
|
||||
|
||||
/*************************************
|
||||
@ -541,7 +541,7 @@ WRITE_LINE_MEMBER(chinsan_state::chin_adpcm_int)
|
||||
if (m_adpcm_pos >= 0x10000 || m_adpcm_idle)
|
||||
{
|
||||
//m_adpcm_idle = 1;
|
||||
msm5205_reset_w(m_adpcm, 1);
|
||||
m_adpcm->reset_w(1);
|
||||
m_trigger = 0;
|
||||
}
|
||||
else
|
||||
@ -549,7 +549,7 @@ WRITE_LINE_MEMBER(chinsan_state::chin_adpcm_int)
|
||||
UINT8 *ROM = memregion("adpcm")->base();
|
||||
|
||||
m_adpcm_data = ((m_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0) >> 4));
|
||||
msm5205_data_w(m_adpcm, m_adpcm_data & 0xf);
|
||||
m_adpcm->data_w(m_adpcm_data & 0xf);
|
||||
m_trigger ^= 1;
|
||||
if(m_trigger == 0)
|
||||
{
|
||||
|
@ -404,10 +404,10 @@ WRITE8_MEMBER(combatsc_state::combatscb_dac_w)
|
||||
|
||||
membank("bl_abank")->set_entry((data & 0x80) >> 7);
|
||||
|
||||
//msm5205_reset_w(m_msm5205, (data >> 4) & 1);
|
||||
msm5205_data_w(m_msm5205, (data & 0x0f));
|
||||
msm5205_vclk_w(m_msm5205, 1);
|
||||
msm5205_vclk_w(m_msm5205, 0);
|
||||
//m_msm5205->reset_w(BIT(data, 4));
|
||||
m_msm5205->data_w(data & 0x0f);
|
||||
m_msm5205->vclk_w(1);
|
||||
m_msm5205->vclk_w(0);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( combatscb_sound_map, AS_PROGRAM, 8, combatsc_state )
|
||||
|
@ -243,7 +243,6 @@ Stephh's log (2006.09.20) :
|
||||
#include "sound/2151intf.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "sound/qsound.h"
|
||||
#include "sound/msm5205.h"
|
||||
#include "machine/kabuki.h"
|
||||
#include "includes/cps1.h" /* External CPS1 definitions */
|
||||
|
||||
|
@ -203,7 +203,7 @@ WRITE_LINE_MEMBER(crgolf_state::vck_callback)
|
||||
UINT8 data = memregion("adpcm")->base()[m_sample_offset >> 1];
|
||||
|
||||
/* write the next nibble and advance */
|
||||
msm5205_data_w(m_msm, (data >> (4 * (~m_sample_offset & 1))) & 0x0f);
|
||||
m_msm->data_w((data >> (4 * (~m_sample_offset & 1))) & 0x0f);
|
||||
m_sample_offset++;
|
||||
|
||||
/* every 256 clocks, we decrement the length */
|
||||
@ -213,7 +213,7 @@ WRITE_LINE_MEMBER(crgolf_state::vck_callback)
|
||||
|
||||
/* if we hit 0xff, automatically turn off playback */
|
||||
if (m_sample_count == 0xff)
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -225,7 +225,7 @@ WRITE8_MEMBER(crgolf_state::crgolfhi_sample_w)
|
||||
{
|
||||
/* offset 0 holds the MSM5205 in reset */
|
||||
case 0:
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
break;
|
||||
|
||||
/* offset 1 is the length/256 nibbles */
|
||||
@ -240,7 +240,7 @@ WRITE8_MEMBER(crgolf_state::crgolfhi_sample_w)
|
||||
|
||||
/* offset 3 turns on playback */
|
||||
case 3:
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -565,7 +565,7 @@ WRITE_LINE_MEMBER(dacholer_state::adpcm_int)
|
||||
{
|
||||
if (m_snd_interrupt_enable == 1 || (m_snd_interrupt_enable == 0 && m_msm_toggle == 1))
|
||||
{
|
||||
msm5205_data_w(m_msm, m_msm_data >> 4);
|
||||
m_msm->data_w(m_msm_data >> 4);
|
||||
m_msm_data <<= 4;
|
||||
m_msm_toggle ^= 1;
|
||||
if (m_msm_toggle == 0)
|
||||
|
@ -526,8 +526,8 @@ WRITE8_MEMBER(darius_state::adpcm_nmi_enable)
|
||||
|
||||
WRITE8_MEMBER(darius_state::adpcm_data_w)
|
||||
{
|
||||
msm5205_data_w(m_msm, data);
|
||||
msm5205_reset_w(m_msm, !(data & 0x20)); /* my best guess, but it could be output enable as well */
|
||||
m_msm->data_w(data);
|
||||
m_msm->reset_w(!(data & 0x20)); /* my best guess, but it could be output enable as well */
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( darius_sound2_io_map, AS_IO, 8, darius_state )
|
||||
|
@ -408,13 +408,13 @@ WRITE8_MEMBER(ddragon_state::ddragon_spriteram_w)
|
||||
WRITE8_MEMBER(ddragon_state::dd_adpcm_w)
|
||||
{
|
||||
int chip = offset & 1;
|
||||
device_t *adpcm = chip ? m_adpcm2 : m_adpcm1;
|
||||
msm5205_device *adpcm = chip ? m_adpcm2 : m_adpcm1;
|
||||
|
||||
switch (offset / 2)
|
||||
{
|
||||
case 3:
|
||||
m_adpcm_idle[chip] = 1;
|
||||
msm5205_reset_w(adpcm, 1);
|
||||
adpcm->reset_w(1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@ -427,21 +427,21 @@ WRITE8_MEMBER(ddragon_state::dd_adpcm_w)
|
||||
|
||||
case 0:
|
||||
m_adpcm_idle[chip] = 0;
|
||||
msm5205_reset_w(adpcm, 0);
|
||||
adpcm->reset_w(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ddragon_state::dd_adpcm_int( device_t *device, int chip )
|
||||
void ddragon_state::dd_adpcm_int( msm5205_device *device, int chip )
|
||||
{
|
||||
if (m_adpcm_pos[chip] >= m_adpcm_end[chip] || m_adpcm_pos[chip] >= 0x10000)
|
||||
{
|
||||
m_adpcm_idle[chip] = 1;
|
||||
msm5205_reset_w(device, 1);
|
||||
device->reset_w(1);
|
||||
}
|
||||
else if (m_adpcm_data[chip] != -1)
|
||||
{
|
||||
msm5205_data_w(device, m_adpcm_data[chip] & 0x0f);
|
||||
device->data_w(m_adpcm_data[chip] & 0x0f);
|
||||
m_adpcm_data[chip] = -1;
|
||||
}
|
||||
else
|
||||
@ -449,18 +449,18 @@ void ddragon_state::dd_adpcm_int( device_t *device, int chip )
|
||||
UINT8 *ROM = memregion("adpcm")->base() + 0x10000 * chip;
|
||||
|
||||
m_adpcm_data[chip] = ROM[m_adpcm_pos[chip]++];
|
||||
msm5205_data_w(device, m_adpcm_data[chip] >> 4);
|
||||
device->data_w(m_adpcm_data[chip] >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(ddragon_state::dd_adpcm_int_1)
|
||||
{
|
||||
dd_adpcm_int(m_adpcm1,0);
|
||||
dd_adpcm_int(m_adpcm1, 0);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(ddragon_state::dd_adpcm_int_2)
|
||||
{
|
||||
dd_adpcm_int(m_adpcm2,1);
|
||||
dd_adpcm_int(m_adpcm2, 1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -264,7 +264,7 @@ WRITE_LINE_MEMBER(de_2_state::ym2151_irq_w)
|
||||
|
||||
WRITE_LINE_MEMBER(de_2_state::msm5205_irq_w)
|
||||
{
|
||||
msm5205_data_w(m_msm5205,m_sample_data >> 4);
|
||||
m_msm5205->data_w(m_sample_data >> 4);
|
||||
if(m_more_data)
|
||||
{
|
||||
if(m_nmi_enable)
|
||||
@ -539,8 +539,8 @@ WRITE8_MEMBER( de_2_state::sample_bank_w )
|
||||
membank("sample_bank")->set_entry(m_sample_bank);
|
||||
m_msm_prescaler = (data & 0x30) >> 4;
|
||||
m_nmi_enable = (~data & 0x80);
|
||||
msm5205_playmode_w(m_msm5205,prescale[m_msm_prescaler]);
|
||||
msm5205_reset_w(m_msm5205,data & 0x40);
|
||||
m_msm5205->playmode_w(prescale[m_msm_prescaler]);
|
||||
m_msm5205->reset_w(data & 0x40);
|
||||
}
|
||||
|
||||
static const msm5205_interface msm5205_intf =
|
||||
|
@ -1378,11 +1378,11 @@ WRITE_LINE_MEMBER(dec0_automat_state::automat_vclk_cb)
|
||||
{
|
||||
if (m_automat_msm5205_vclk_toggle == 0)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_automat_adpcm_byte & 0xf);
|
||||
m_msm->data_w(m_automat_adpcm_byte & 0xf);
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(m_msm, m_automat_adpcm_byte >> 4);
|
||||
m_msm->data_w(m_automat_adpcm_byte >> 4);
|
||||
//device->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); // gives some scratch samples but breaks other sounds too
|
||||
}
|
||||
|
||||
|
@ -491,13 +491,13 @@ WRITE_LINE_MEMBER(dec8_state::csilver_adpcm_int)
|
||||
if (m_toggle)
|
||||
m_audiocpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
|
||||
|
||||
msm5205_data_w(m_msm, m_msm5205next >> 4);
|
||||
m_msm->data_w(m_msm5205next >> 4);
|
||||
m_msm5205next <<= 4;
|
||||
}
|
||||
|
||||
READ8_MEMBER(dec8_state::csilver_adpcm_reset_r)
|
||||
{
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -334,7 +334,7 @@ ADDRESS_MAP_END
|
||||
WRITE8_MEMBER(discoboy_state::yunsung8_sound_bankswitch_w)
|
||||
{
|
||||
/* Note: this is bit 5 on yunsung8.c */
|
||||
msm5205_reset_w(m_msm, (data & 0x08) >> 3);
|
||||
m_msm->reset_w((data & 0x08) >> 3);
|
||||
|
||||
membank("sndbank")->set_entry(data & 0x07);
|
||||
|
||||
@ -474,7 +474,7 @@ void discoboy_state::machine_reset()
|
||||
|
||||
WRITE_LINE_MEMBER(discoboy_state::yunsung8_adpcm_int)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_adpcm >> 4);
|
||||
m_msm->data_w(m_adpcm >> 4);
|
||||
m_adpcm <<= 4;
|
||||
|
||||
m_toggle ^= 1;
|
||||
|
@ -165,17 +165,17 @@ WRITE_LINE_MEMBER(docastle_state::idsoccer_adpcm_int)
|
||||
if (m_adpcm_pos >= memregion("adpcm")->bytes())
|
||||
{
|
||||
m_adpcm_idle = 1;
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
}
|
||||
else if (m_adpcm_data != -1)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_adpcm_data & 0x0f);
|
||||
m_msm->data_w(m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_adpcm_data = memregion("adpcm")->base()[m_adpcm_pos++];
|
||||
msm5205_data_w(m_msm, m_adpcm_data >> 4);
|
||||
m_msm->data_w(m_adpcm_data >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,13 +191,13 @@ WRITE8_MEMBER(docastle_state::idsoccer_adpcm_w)
|
||||
if (data & 0x80)
|
||||
{
|
||||
m_adpcm_idle = 1;
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_adpcm_pos = (data & 0x7f) * 0x200;
|
||||
m_adpcm_idle = 0;
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,13 +50,13 @@ WRITE_LINE_MEMBER(drmicro_state::pcm_w)
|
||||
if (~m_pcm_adr & 1)
|
||||
data >>= 4;
|
||||
|
||||
msm5205_data_w(m_msm, data & 0x0f);
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->data_w(data & 0x0f);
|
||||
m_msm->reset_w(0);
|
||||
|
||||
m_pcm_adr = (m_pcm_adr + 1) & 0x7fff;
|
||||
}
|
||||
else
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(drmicro_state::pcm_set_w)
|
||||
|
@ -392,7 +392,7 @@ WRITE8_MEMBER(dynax_state::nanajign_palette_w)
|
||||
|
||||
WRITE_LINE_MEMBER(dynax_state::adpcm_int)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_msm5205next >> 4);
|
||||
m_msm->data_w(m_msm5205next >> 4);
|
||||
m_msm5205next <<= 4;
|
||||
|
||||
m_toggle = 1 - m_toggle;
|
||||
@ -406,7 +406,7 @@ WRITE_LINE_MEMBER(dynax_state::adpcm_int)
|
||||
|
||||
WRITE_LINE_MEMBER(dynax_state::adpcm_int_cpu1)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_msm5205next >> 4);
|
||||
m_msm->data_w(m_msm5205next >> 4);
|
||||
m_msm5205next <<= 4;
|
||||
|
||||
m_toggle_cpu1 = 1 - m_toggle_cpu1;
|
||||
@ -426,14 +426,14 @@ WRITE8_MEMBER(dynax_state::adpcm_data_w)
|
||||
WRITE8_MEMBER(dynax_state::adpcm_reset_w)
|
||||
{
|
||||
m_resetkludge = data & 1;
|
||||
msm5205_reset_w(m_msm, ~data & 1);
|
||||
m_msm->reset_w(~data & 1);
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(dynax_state,adpcm)
|
||||
{
|
||||
/* start with the MSM5205 reset */
|
||||
m_resetkludge = 0;
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(dynax_state::yarunara_layer_half_w)
|
||||
|
@ -307,17 +307,17 @@ ADDRESS_MAP_END
|
||||
Born To Fight
|
||||
***************************************************************************/
|
||||
|
||||
void fantland_state::borntofi_adpcm_start( device_t *device, int voice )
|
||||
void fantland_state::borntofi_adpcm_start( msm5205_device *device, int voice )
|
||||
{
|
||||
msm5205_reset_w(device, 0);
|
||||
device->reset_w(0);
|
||||
m_adpcm_playing[voice] = 1;
|
||||
m_adpcm_nibble[voice] = 0;
|
||||
// logerror("%s: adpcm start = %06x, stop = %06x\n", device->machine().describe_context(), m_adpcm_addr[0][voice], m_adpcm_addr[1][voice]);
|
||||
}
|
||||
|
||||
void fantland_state::borntofi_adpcm_stop( device_t *device, int voice )
|
||||
void fantland_state::borntofi_adpcm_stop( msm5205_device *device, int voice )
|
||||
{
|
||||
msm5205_reset_w(device, 1);
|
||||
device->reset_w(1);
|
||||
m_adpcm_playing[voice] = 0;
|
||||
}
|
||||
|
||||
@ -325,7 +325,7 @@ WRITE8_MEMBER(fantland_state::borntofi_msm5205_w)
|
||||
{
|
||||
int voice = offset / 8;
|
||||
int reg = offset % 8;
|
||||
device_t *msm;
|
||||
msm5205_device *msm;
|
||||
|
||||
switch (voice)
|
||||
{
|
||||
@ -356,7 +356,7 @@ WRITE8_MEMBER(fantland_state::borntofi_msm5205_w)
|
||||
}
|
||||
}
|
||||
|
||||
void fantland_state::borntofi_adpcm_int( device_t *device, int voice )
|
||||
void fantland_state::borntofi_adpcm_int( msm5205_device *device, int voice )
|
||||
{
|
||||
UINT8 *rom;
|
||||
size_t len;
|
||||
@ -384,7 +384,7 @@ void fantland_state::borntofi_adpcm_int( device_t *device, int voice )
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(device, rom[start / 2] >> ((start & 1) * 4));
|
||||
device->data_w(rom[start / 2] >> ((start & 1) * 4));
|
||||
m_adpcm_nibble[voice]++;
|
||||
}
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ WRITE8_MEMBER( cps_state::knightsb_snd_bankswitch_w )
|
||||
|
||||
WRITE_LINE_MEMBER(cps_state::m5205_int1)
|
||||
{
|
||||
msm5205_data_w(m_msm_1, m_sample_buffer1 & 0x0f);
|
||||
m_msm_1->data_w(m_sample_buffer1 & 0x0f);
|
||||
m_sample_buffer1 >>= 4;
|
||||
m_sample_select1 ^= 1;
|
||||
if (m_sample_select1 == 0)
|
||||
@ -157,7 +157,7 @@ WRITE_LINE_MEMBER(cps_state::m5205_int1)
|
||||
|
||||
WRITE_LINE_MEMBER(cps_state::m5205_int2)
|
||||
{
|
||||
msm5205_data_w(m_msm_2, m_sample_buffer2 & 0x0f);
|
||||
m_msm_2->data_w(m_sample_buffer2 & 0x0f);
|
||||
m_sample_buffer2 >>= 4;
|
||||
m_sample_select2 ^= 1;
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ WRITE8_MEMBER(firetrap_state::firetrap_sound_command_w)
|
||||
|
||||
WRITE8_MEMBER(firetrap_state::firetrap_sound_2400_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, ~data & 0x01);
|
||||
m_msm->reset_w(~data & 0x01);
|
||||
m_sound_irq_enable = data & 0x02;
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ WRITE8_MEMBER(firetrap_state::firetrap_sound_bankselect_w)
|
||||
|
||||
WRITE_LINE_MEMBER(firetrap_state::firetrap_adpcm_int)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_msm5205next >> 4);
|
||||
m_msm->data_w(m_msm5205next >> 4);
|
||||
m_msm5205next <<= 4;
|
||||
|
||||
m_adpcm_toggle ^= 1;
|
||||
|
@ -125,7 +125,7 @@ WRITE8_MEMBER(fromance_state::fromance_adpcm_reset_w)
|
||||
m_adpcm_reset = (data & 0x01);
|
||||
m_vclk_left = 0;
|
||||
|
||||
msm5205_reset_w(m_msm, !(data & 0x01));
|
||||
m_msm->reset_w(!(data & 0x01));
|
||||
}
|
||||
|
||||
|
||||
@ -145,7 +145,7 @@ WRITE_LINE_MEMBER(fromance_state::fromance_adpcm_int)
|
||||
/* clock the data through */
|
||||
if (m_vclk_left)
|
||||
{
|
||||
msm5205_data_w(m_msm, (m_adpcm_data >> 4));
|
||||
m_msm->data_w(m_adpcm_data >> 4);
|
||||
m_adpcm_data <<= 4;
|
||||
m_vclk_left--;
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ WRITE16_MEMBER(gcpinbal_state::ioc_w)
|
||||
/* data written here is adpcm param? */
|
||||
//popmessage("%08x %08x", m_msm_start + m_msm_bank, m_msm_end);
|
||||
m_adpcm_idle = 0;
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
m_adpcm_start = m_msm_start + m_msm_bank;
|
||||
m_adpcm_end = m_msm_end;
|
||||
// ADPCM_stop(0);
|
||||
@ -208,10 +208,10 @@ WRITE16_MEMBER(gcpinbal_state::ioc_w)
|
||||
WRITE_LINE_MEMBER(gcpinbal_state::gcp_adpcm_int)
|
||||
{
|
||||
if (m_adpcm_idle)
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
if (m_adpcm_start >= 0x200000 || m_adpcm_start > m_adpcm_end)
|
||||
{
|
||||
//msm5205_reset_w(m_msm,1);
|
||||
//m_msm->reset_w(1);
|
||||
m_adpcm_start = m_msm_start + m_msm_bank;
|
||||
m_adpcm_trigger = 0;
|
||||
}
|
||||
@ -220,7 +220,7 @@ WRITE_LINE_MEMBER(gcpinbal_state::gcp_adpcm_int)
|
||||
UINT8 *ROM = memregion("msm")->base();
|
||||
|
||||
m_adpcm_data = ((m_adpcm_trigger ? (ROM[m_adpcm_start] & 0x0f) : (ROM[m_adpcm_start] & 0xf0) >> 4));
|
||||
msm5205_data_w(m_msm, m_adpcm_data & 0xf);
|
||||
m_msm->data_w(m_adpcm_data & 0xf);
|
||||
m_adpcm_trigger ^= 1;
|
||||
if (m_adpcm_trigger == 0)
|
||||
m_adpcm_start++;
|
||||
|
@ -284,9 +284,9 @@ WRITE8_MEMBER(gladiatr_state::glad_adpcm_w)
|
||||
/* bit6 = bank offset */
|
||||
membank("bank2")->set_base(rom + ((data & 0x40) ? 0xc000 : 0));
|
||||
|
||||
msm5205_data_w(m_msm,data); /* bit0..3 */
|
||||
msm5205_reset_w(m_msm,(data>>5)&1); /* bit 5 */
|
||||
msm5205_vclk_w (m_msm,(data>>4)&1); /* bit4 */
|
||||
m_msm->data_w(data); /* bit0..3 */
|
||||
m_msm->reset_w(BIT(data, 5)); /* bit 5 */
|
||||
m_msm->vclk_w (BIT(data, 4)); /* bit4 */
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(gladiatr_state::glad_cpu_sound_command_w)
|
||||
|
@ -71,7 +71,7 @@ WRITE8_MEMBER(goal92_state::adpcm_control_w)
|
||||
{
|
||||
membank("bank1")->set_entry(data & 0x01);
|
||||
|
||||
msm5205_reset_w(m_msm, data & 0x08);
|
||||
m_msm->reset_w(data & 0x08);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(goal92_state::adpcm_data_w)
|
||||
@ -223,7 +223,7 @@ static const ay8910_interface ay8910_config =
|
||||
|
||||
WRITE_LINE_MEMBER(goal92_state::goal92_adpcm_int)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_msm5205next);
|
||||
m_msm->data_w(m_msm5205next);
|
||||
m_msm5205next >>= 4;
|
||||
m_adpcm_toggle^= 1;
|
||||
|
||||
|
@ -312,9 +312,9 @@ READ8_MEMBER(gsword_state::gsword_fake_1_r)
|
||||
|
||||
WRITE8_MEMBER(gsword_state::gsword_adpcm_data_w)
|
||||
{
|
||||
msm5205_data_w (m_msm,data & 0x0f); /* bit 0..3 */
|
||||
msm5205_reset_w(m_msm,(data>>5)&1); /* bit 5 */
|
||||
msm5205_vclk_w(m_msm,(data>>4)&1); /* bit 4 */
|
||||
m_msm->data_w (data & 0x0f); /* bit 0..3 */
|
||||
m_msm->reset_w(BIT(data, 5)); /* bit 5 */
|
||||
m_msm->vclk_w(BIT(data, 4)); /* bit 4 */
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(gsword_state::adpcm_soundcommand_w)
|
||||
|
@ -69,22 +69,22 @@ WRITE8_MEMBER(hnayayoi_state::keyboard_w)
|
||||
|
||||
WRITE8_MEMBER(hnayayoi_state::adpcm_data_w)
|
||||
{
|
||||
msm5205_data_w(m_msm, data);
|
||||
m_msm->data_w(data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(hnayayoi_state::adpcm_vclk_w)
|
||||
{
|
||||
msm5205_vclk_w(m_msm, data & 1);
|
||||
m_msm->vclk_w(data & 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(hnayayoi_state::adpcm_reset_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, data & 1);
|
||||
m_msm->reset_w(data & 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(hnayayoi_state::adpcm_reset_inv_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, ~data & 1);
|
||||
m_msm->reset_w(~data & 1);
|
||||
}
|
||||
|
||||
|
||||
@ -535,7 +535,7 @@ void hnayayoi_state::machine_start()
|
||||
void hnayayoi_state::machine_reset()
|
||||
{
|
||||
/* start with the MSM5205 reset */
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
|
||||
m_palbank = 0;
|
||||
m_blit_layer = 0;
|
||||
|
@ -355,10 +355,10 @@ WRITE8_MEMBER(jangou_state::adpcm_w)
|
||||
WRITE_LINE_MEMBER(jangou_state::jngolady_vclk_cb)
|
||||
{
|
||||
if (m_msm5205_vclk_toggle == 0)
|
||||
msm5205_data_w(m_msm, m_adpcm_byte >> 4);
|
||||
m_msm->data_w(m_adpcm_byte >> 4);
|
||||
else
|
||||
{
|
||||
msm5205_data_w(m_msm, m_adpcm_byte & 0xf);
|
||||
m_msm->data_w(m_adpcm_byte & 0xf);
|
||||
m_cpu_1->set_input_line(0, HOLD_LINE);
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ WRITE8_MEMBER(jantotsu_state::jan_adpcm_w)
|
||||
case 0:
|
||||
m_adpcm_pos = (data & 0xff) * 0x100;
|
||||
m_adpcm_idle = 0;
|
||||
msm5205_reset_w(m_adpcm, 0);
|
||||
m_adpcm->reset_w(0);
|
||||
/* I don't think that this will ever happen, it's there just to be sure
|
||||
(i.e. I'll probably never do a "nagare" in my entire life ;-) ) */
|
||||
if(data & 0x20)
|
||||
@ -287,7 +287,7 @@ WRITE8_MEMBER(jantotsu_state::jan_adpcm_w)
|
||||
/*same write as port 2? MSM sample ack? */
|
||||
case 1:
|
||||
// m_adpcm_idle = 1;
|
||||
// msm5205_reset_w(m_adpcm, 1);
|
||||
// m_adpcm->reset_w(1);
|
||||
// printf("%02x 1\n", data);
|
||||
break;
|
||||
}
|
||||
@ -298,7 +298,7 @@ WRITE_LINE_MEMBER(jantotsu_state::jan_adpcm_int)
|
||||
if (m_adpcm_pos >= 0x10000 || m_adpcm_idle)
|
||||
{
|
||||
//m_adpcm_idle = 1;
|
||||
msm5205_reset_w(m_adpcm, 1);
|
||||
m_adpcm->reset_w(1);
|
||||
m_adpcm_trigger = 0;
|
||||
}
|
||||
else
|
||||
@ -306,7 +306,7 @@ WRITE_LINE_MEMBER(jantotsu_state::jan_adpcm_int)
|
||||
UINT8 *ROM = memregion("adpcm")->base();
|
||||
|
||||
m_adpcm_data = ((m_adpcm_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0) >> 4));
|
||||
msm5205_data_w(m_adpcm, m_adpcm_data & 0xf);
|
||||
m_adpcm->data_w(m_adpcm_data & 0xf);
|
||||
m_adpcm_trigger ^= 1;
|
||||
if (m_adpcm_trigger == 0)
|
||||
{
|
||||
|
@ -87,7 +87,7 @@ WRITE8_MEMBER(kchamp_state::sound_reset_w)
|
||||
|
||||
WRITE8_MEMBER(kchamp_state::sound_control_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, !(data & 1));
|
||||
m_msm->reset_w(!(data & 1));
|
||||
m_sound_nmi_enable = ((data >> 1) & 1);
|
||||
}
|
||||
|
||||
@ -347,9 +347,9 @@ INTERRUPT_GEN_MEMBER(kchamp_state::kc_interrupt)
|
||||
WRITE_LINE_MEMBER(kchamp_state::msmint)
|
||||
{
|
||||
if (m_msm_play_lo_nibble)
|
||||
msm5205_data_w(m_msm, m_msm_data & 0x0f);
|
||||
m_msm->data_w(m_msm_data & 0x0f);
|
||||
else
|
||||
msm5205_data_w(m_msm, (m_msm_data >> 4) & 0x0f);
|
||||
m_msm->data_w((m_msm_data >> 4) & 0x0f);
|
||||
|
||||
m_msm_play_lo_nibble ^= 1;
|
||||
|
||||
|
@ -170,13 +170,13 @@ WRITE8_MEMBER(kungfur_state::kungfur_control_w)
|
||||
// d6-d7: sound trigger (edge)
|
||||
if ((data ^ m_control) & 0x40)
|
||||
{
|
||||
msm5205_reset_w(m_adpcm1, data >> 6 & 1);
|
||||
m_adpcm1->reset_w(BIT(data, 6));
|
||||
m_adpcm_pos[0] = m_adpcm_data[0] * 0x400;
|
||||
m_adpcm_sel[0] = 0;
|
||||
}
|
||||
if ((data ^ m_control) & 0x80)
|
||||
{
|
||||
msm5205_reset_w(m_adpcm2, data >> 7 & 1);
|
||||
m_adpcm2->reset_w(BIT(data, 7));
|
||||
m_adpcm_pos[1] = m_adpcm_data[1] * 0x400;
|
||||
m_adpcm_sel[1] = 0;
|
||||
}
|
||||
@ -201,7 +201,7 @@ WRITE_LINE_MEMBER(kungfur_state::kfr_adpcm1_int)
|
||||
UINT8 *ROM = memregion("adpcm1")->base();
|
||||
UINT8 data = ROM[m_adpcm_pos[0] & 0x1ffff];
|
||||
|
||||
msm5205_data_w(m_adpcm1, m_adpcm_sel[0] ? data & 0xf : data >> 4 & 0xf);
|
||||
m_adpcm1->data_w(m_adpcm_sel[0] ? data & 0xf : data >> 4 & 0xf);
|
||||
m_adpcm_pos[0] += m_adpcm_sel[0];
|
||||
m_adpcm_sel[0] ^= 1;
|
||||
}
|
||||
@ -211,7 +211,7 @@ WRITE_LINE_MEMBER(kungfur_state::kfr_adpcm2_int)
|
||||
UINT8 *ROM = memregion("adpcm2")->base();
|
||||
UINT8 data = ROM[m_adpcm_pos[1] & 0x3ffff];
|
||||
|
||||
msm5205_data_w(m_adpcm2, m_adpcm_sel[1] ? data & 0xf : data >> 4 & 0xf);
|
||||
m_adpcm2->data_w(m_adpcm_sel[1] ? data & 0xf : data >> 4 & 0xf);
|
||||
m_adpcm_pos[1] += m_adpcm_sel[1];
|
||||
m_adpcm_sel[1] ^= 1;
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ void kurukuru_state::update_sound_irq(UINT8 cause)
|
||||
WRITE_LINE_MEMBER(kurukuru_state::kurukuru_msm5205_vck)
|
||||
{
|
||||
update_sound_irq(m_sound_irq_cause | 2);
|
||||
msm5205_data_w(m_adpcm, m_adpcm_data);
|
||||
m_adpcm->data_w(m_adpcm_data);
|
||||
}
|
||||
|
||||
|
||||
@ -393,8 +393,8 @@ WRITE8_MEMBER(kurukuru_state::kurukuru_adpcm_reset_w)
|
||||
bit 2 = S2
|
||||
bit 3 = S1
|
||||
*/
|
||||
msm5205_playmode_w(m_adpcm, BITSWAP8((data>>1), 7,6,5,4,3,0,1,2));
|
||||
msm5205_reset_w(m_adpcm, data & 1);
|
||||
m_adpcm->playmode_w(BITSWAP8((data>>1), 7,6,5,4,3,0,1,2));
|
||||
m_adpcm->reset_w(data & 1);
|
||||
}
|
||||
|
||||
READ8_MEMBER(kurukuru_state::kurukuru_soundlatch_r)
|
||||
|
@ -1426,11 +1426,11 @@ WRITE_LINE_MEMBER(lucky74_state::lucky74_adpcm_int)
|
||||
/* transferring 1st nibble */
|
||||
m_adpcm_data = memregion("adpcm")->base()[m_adpcm_pos];
|
||||
m_adpcm_pos = (m_adpcm_pos + 1) & 0xffff;
|
||||
msm5205_data_w(m_msm, m_adpcm_data >> 4);
|
||||
m_msm->data_w(m_adpcm_data >> 4);
|
||||
|
||||
if (m_adpcm_pos == m_adpcm_end)
|
||||
{
|
||||
msm5205_reset_w(m_msm, 0); /* reset the M5205 */
|
||||
m_msm->reset_w(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");
|
||||
@ -1439,7 +1439,7 @@ WRITE_LINE_MEMBER(lucky74_state::lucky74_adpcm_int)
|
||||
else
|
||||
{
|
||||
/* transferring 2nd nibble */
|
||||
msm5205_data_w(m_msm, m_adpcm_data & 0x0f);
|
||||
m_msm->data_w(m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,6 @@ Notes:
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "sound/2203intf.h"
|
||||
#include "sound/msm5205.h"
|
||||
#include "includes/lwings.h"
|
||||
|
||||
/* Avengers runs on hardware almost identical to Trojan, but with a protection
|
||||
@ -267,11 +266,10 @@ READ8_MEMBER(lwings_state::avengers_soundlatch2_r)
|
||||
|
||||
WRITE8_MEMBER(lwings_state::msm5205_w)
|
||||
{
|
||||
device_t *device = machine().device("5205");
|
||||
msm5205_reset_w(device, (data >> 7) & 1);
|
||||
msm5205_data_w(device, data);
|
||||
msm5205_vclk_w(device, 1);
|
||||
msm5205_vclk_w(device, 0);
|
||||
m_msm->reset_w(BIT(data, 7));
|
||||
m_msm->data_w(data);
|
||||
m_msm->vclk_w(1);
|
||||
m_msm->vclk_w(0);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( avengers_map, AS_PROGRAM, 8, lwings_state )
|
||||
|
@ -642,7 +642,7 @@ WRITE8_MEMBER(mastboy_state::backupram_enable_w)
|
||||
WRITE8_MEMBER(mastboy_state::msm5205_mastboy_m5205_sambit0_w)
|
||||
{
|
||||
m_m5205_sambit0 = data & 1;
|
||||
msm5205_playmode_w(m_msm, (1 << 2) | (m_m5205_sambit1 << 1) | (m_m5205_sambit0) );
|
||||
m_msm->playmode_w((1 << 2) | (m_m5205_sambit1 << 1) | (m_m5205_sambit0) );
|
||||
|
||||
logerror("msm5205 samplerate bit 0, set to %02x\n",data);
|
||||
}
|
||||
@ -651,7 +651,7 @@ WRITE8_MEMBER(mastboy_state::msm5205_mastboy_m5205_sambit1_w)
|
||||
{
|
||||
m_m5205_sambit1 = data & 1;
|
||||
|
||||
msm5205_playmode_w(m_msm, (1 << 2) | (m_m5205_sambit1 << 1) | (m_m5205_sambit0) );
|
||||
m_msm->playmode_w((1 << 2) | (m_m5205_sambit1 << 1) | (m_m5205_sambit0) );
|
||||
|
||||
logerror("msm5205 samplerate bit 0, set to %02x\n",data);
|
||||
}
|
||||
@ -659,7 +659,7 @@ WRITE8_MEMBER(mastboy_state::msm5205_mastboy_m5205_sambit1_w)
|
||||
WRITE8_MEMBER(mastboy_state::mastboy_msm5205_reset_w)
|
||||
{
|
||||
m_m5205_part = 0;
|
||||
msm5205_reset_w(m_msm,data&1);
|
||||
m_msm->reset_w(data & 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(mastboy_state::mastboy_msm5205_data_w)
|
||||
@ -669,7 +669,7 @@ WRITE8_MEMBER(mastboy_state::mastboy_msm5205_data_w)
|
||||
|
||||
WRITE_LINE_MEMBER(mastboy_state::mastboy_adpcm_int)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_m5205_next);
|
||||
m_msm->data_w(m_m5205_next);
|
||||
m_m5205_next >>= 4;
|
||||
|
||||
m_m5205_part ^= 1;
|
||||
@ -877,7 +877,7 @@ void mastboy_state::machine_reset()
|
||||
memset( m_vram, 0x00, 0x10000);
|
||||
|
||||
m_m5205_part = 0;
|
||||
msm5205_reset_w(m_msm,1);
|
||||
m_msm->reset_w(1);
|
||||
m_irq0_ack = 0;
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ WRITE8_MEMBER(mermaid_state::rougien_sample_playback_w)
|
||||
m_adpcm_pos = m_adpcm_rom_sel*0x1000;
|
||||
m_adpcm_end = m_adpcm_pos+0x1000;
|
||||
m_adpcm_idle = 0;
|
||||
msm5205_reset_w(m_adpcm, 0);
|
||||
m_adpcm->reset_w(0);
|
||||
}
|
||||
|
||||
m_adpcm_play_reg = data & 1;
|
||||
@ -399,7 +399,7 @@ WRITE_LINE_MEMBER(mermaid_state::rougien_adpcm_int)
|
||||
if (m_adpcm_pos >= m_adpcm_end || m_adpcm_idle)
|
||||
{
|
||||
//m_adpcm_idle = 1;
|
||||
msm5205_reset_w(m_adpcm, 1);
|
||||
m_adpcm->reset_w(1);
|
||||
m_adpcm_trigger = 0;
|
||||
}
|
||||
else
|
||||
@ -407,7 +407,7 @@ WRITE_LINE_MEMBER(mermaid_state::rougien_adpcm_int)
|
||||
UINT8 *ROM = memregion("adpcm")->base();
|
||||
|
||||
m_adpcm_data = ((m_adpcm_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0) >> 4));
|
||||
msm5205_data_w(m_adpcm, m_adpcm_data & 0xf);
|
||||
m_adpcm->data_w(m_adpcm_data & 0xf);
|
||||
m_adpcm_trigger ^= 1;
|
||||
if (m_adpcm_trigger == 0)
|
||||
{
|
||||
|
@ -1178,7 +1178,7 @@ GFXDECODE_END
|
||||
|
||||
WRITE_LINE_MEMBER(mitchell_state::spangbl_adpcm_int)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_sample_buffer & 0x0f);
|
||||
m_msm->data_w(m_sample_buffer & 0x0f);
|
||||
m_sample_buffer >>= 4;
|
||||
m_sample_select ^= 1;
|
||||
if(m_sample_select == 0)
|
||||
|
@ -308,7 +308,7 @@ WRITE8_MEMBER(mlanding_state::sound_bankswitch_w)
|
||||
WRITE_LINE_MEMBER(mlanding_state::ml_msm5205_vck)
|
||||
{
|
||||
UINT8 data = m_adpcm_rom->base()[m_adpcm_pos];
|
||||
msm5205_data_w(m_msm, m_adpcm_trigger ? (data & 0xf) : (data >> 4));
|
||||
m_msm->data_w(m_adpcm_trigger ? (data & 0xf) : (data >> 4));
|
||||
m_adpcm_pos = (m_adpcm_pos + m_adpcm_trigger) & 0x7ffff;
|
||||
m_adpcm_trigger ^= 1;
|
||||
}
|
||||
@ -494,12 +494,12 @@ WRITE8_MEMBER(mlanding_state::ml_adpcm_start_w)
|
||||
{
|
||||
m_adpcm_pos = m_adpcm_address << 8;
|
||||
m_adpcm_trigger = 0;
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(mlanding_state::ml_adpcm_stop_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(mlanding_state::ml_adpcm_address_lo_w)
|
||||
@ -700,7 +700,7 @@ void mlanding_state::machine_reset()
|
||||
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
|
||||
m_mechacpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
|
||||
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
m_dsp_HOLD_signal = 0;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ WRITE8_MEMBER(ojankohs_state::ojankoy_rombank_w)
|
||||
if (!m_adpcm_reset)
|
||||
m_vclk_left = 0;
|
||||
|
||||
msm5205_reset_w(m_msm, !m_adpcm_reset);
|
||||
m_msm->reset_w(!m_adpcm_reset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(ojankohs_state::ojankohs_adpcm_reset_w)
|
||||
@ -60,7 +60,7 @@ WRITE8_MEMBER(ojankohs_state::ojankohs_adpcm_reset_w)
|
||||
m_adpcm_reset = BIT(data, 0);
|
||||
m_vclk_left = 0;
|
||||
|
||||
msm5205_reset_w(m_msm, !m_adpcm_reset);
|
||||
m_msm->reset_w(!m_adpcm_reset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(ojankohs_state::ojankohs_msm5205_w)
|
||||
@ -78,7 +78,7 @@ WRITE_LINE_MEMBER(ojankohs_state::ojankohs_adpcm_int)
|
||||
/* clock the data through */
|
||||
if (m_vclk_left)
|
||||
{
|
||||
msm5205_data_w(m_msm, (m_adpcm_data >> 4));
|
||||
m_msm->data_w((m_adpcm_data >> 4));
|
||||
m_adpcm_data <<= 4;
|
||||
m_vclk_left--;
|
||||
}
|
||||
@ -93,7 +93,7 @@ WRITE8_MEMBER(ojankohs_state::ojankoc_ctrl_w)
|
||||
membank("bank1")->set_entry(data & 0x0f);
|
||||
|
||||
m_adpcm_reset = BIT(data, 4);
|
||||
msm5205_reset_w(m_msm, !BIT(data, 4));
|
||||
m_msm->reset_w(!BIT(data, 4));
|
||||
ojankoc_flipscreen(space, data);
|
||||
}
|
||||
|
||||
|
@ -448,33 +448,33 @@ MACHINE_RESET_MEMBER(opwolf_state,opwolf)
|
||||
m_sprite_ctrl = 0;
|
||||
m_sprites_flipscreen = 0;
|
||||
|
||||
msm5205_reset_w(m_msm1, 1);
|
||||
msm5205_reset_w(m_msm2, 1);
|
||||
m_msm1->reset_w(1);
|
||||
m_msm2->reset_w(1);
|
||||
}
|
||||
|
||||
void opwolf_state::opwolf_msm5205_vck(device_t *device,int chip)
|
||||
void opwolf_state::opwolf_msm5205_vck(msm5205_device *device,int chip)
|
||||
{
|
||||
if (m_adpcm_data[chip] != -1)
|
||||
{
|
||||
msm5205_data_w(device, m_adpcm_data[chip] & 0x0f);
|
||||
device->data_w(m_adpcm_data[chip] & 0x0f);
|
||||
m_adpcm_data[chip] = -1;
|
||||
if (m_adpcm_pos[chip] == m_adpcm_end[chip])
|
||||
msm5205_reset_w(device, 1);
|
||||
device->reset_w(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_adpcm_data[chip] = 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);
|
||||
device->data_w(m_adpcm_data[chip] >> 4);
|
||||
}
|
||||
}
|
||||
WRITE_LINE_MEMBER(opwolf_state::opwolf_msm5205_vck_1)
|
||||
{
|
||||
opwolf_msm5205_vck(m_msm1,0);
|
||||
opwolf_msm5205_vck(m_msm1, 0);
|
||||
}
|
||||
WRITE_LINE_MEMBER(opwolf_state::opwolf_msm5205_vck_2)
|
||||
{
|
||||
opwolf_msm5205_vck(m_msm2,1);
|
||||
opwolf_msm5205_vck(m_msm2, 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(opwolf_state::opwolf_adpcm_b_w)
|
||||
@ -492,7 +492,7 @@ WRITE8_MEMBER(opwolf_state::opwolf_adpcm_b_w)
|
||||
end *= 16;
|
||||
m_adpcm_pos[0] = start;
|
||||
m_adpcm_end[0] = end;
|
||||
msm5205_reset_w(m_msm1, 0);
|
||||
m_msm1->reset_w(0);
|
||||
}
|
||||
|
||||
// logerror("CPU #1 b00%i-data=%2x pc=%4x\n",offset,data,space.device().safe_pc() );
|
||||
@ -514,7 +514,7 @@ WRITE8_MEMBER(opwolf_state::opwolf_adpcm_c_w)
|
||||
end *= 16;
|
||||
m_adpcm_pos[1] = start;
|
||||
m_adpcm_end[1] = end;
|
||||
msm5205_reset_w(m_msm2, 0);
|
||||
m_msm2->reset_w(0);
|
||||
}
|
||||
|
||||
// logerror("CPU #1 c00%i-data=%2x pc=%4x\n",offset,data,space.device().safe_pc() );
|
||||
|
@ -274,7 +274,7 @@ WRITE_LINE_MEMBER(pachifev_state::pf_adpcm_int)
|
||||
if (m_adpcm_pos >= 0x4000 || m_adpcm_idle)
|
||||
{
|
||||
m_adpcm_idle = 1;
|
||||
msm5205_reset_w(m_msm,1);
|
||||
m_msm->reset_w(1);
|
||||
m_trigger = 0;
|
||||
}
|
||||
else
|
||||
@ -282,7 +282,7 @@ WRITE_LINE_MEMBER(pachifev_state::pf_adpcm_int)
|
||||
UINT8 *ROM = memregion("adpcm")->base();
|
||||
|
||||
m_adpcm_data = ((m_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0)>>4) );
|
||||
msm5205_data_w(m_msm,m_adpcm_data & 0xf);
|
||||
m_msm->data_w(m_adpcm_data & 0xf);
|
||||
m_trigger^=1;
|
||||
if(m_trigger == 0)
|
||||
{
|
||||
|
@ -48,8 +48,8 @@ WRITE8_MEMBER(pcktgal_state::pcktgal_sound_w)
|
||||
|
||||
WRITE_LINE_MEMBER(pcktgal_state::pcktgal_adpcm_int)
|
||||
{
|
||||
msm5205_data_w(m_msm,m_msm5205next >> 4);
|
||||
m_msm5205next<<=4;
|
||||
m_msm->data_w(m_msm5205next >> 4);
|
||||
m_msm5205next <<= 4;
|
||||
|
||||
m_toggle = 1 - m_toggle;
|
||||
if (m_toggle)
|
||||
@ -58,12 +58,12 @@ WRITE_LINE_MEMBER(pcktgal_state::pcktgal_adpcm_int)
|
||||
|
||||
WRITE8_MEMBER(pcktgal_state::pcktgal_adpcm_data_w)
|
||||
{
|
||||
m_msm5205next=data;
|
||||
m_msm5205next = data;
|
||||
}
|
||||
|
||||
READ8_MEMBER(pcktgal_state::pcktgal_adpcm_reset_r)
|
||||
{
|
||||
msm5205_reset_w(m_msm,0);
|
||||
m_msm->reset_w(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -171,14 +171,14 @@ WRITE_LINE_MEMBER(rastan_state::rastan_msm5205_vck)
|
||||
{
|
||||
if (m_adpcm_data != -1)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_adpcm_data & 0x0f);
|
||||
m_msm->data_w(m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_adpcm_data = memregion("adpcm")->base()[m_adpcm_pos];
|
||||
m_adpcm_pos = (m_adpcm_pos + 1) & 0xffff;
|
||||
msm5205_data_w(m_msm, m_adpcm_data >> 4);
|
||||
m_msm->data_w(m_adpcm_data >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,12 +189,12 @@ WRITE8_MEMBER(rastan_state::rastan_msm5205_address_w)
|
||||
|
||||
WRITE8_MEMBER(rastan_state::rastan_msm5205_start_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(rastan_state::rastan_msm5205_stop_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
m_adpcm_pos &= 0xff00;
|
||||
}
|
||||
|
||||
|
@ -167,9 +167,9 @@ READ8_MEMBER(rmhaihai_state::samples_r)
|
||||
|
||||
WRITE8_MEMBER(rmhaihai_state::adpcm_w)
|
||||
{
|
||||
msm5205_data_w(m_msm,data); /* bit0..3 */
|
||||
msm5205_reset_w(m_msm,(data>>5)&1); /* bit 5 */
|
||||
msm5205_vclk_w (m_msm,(data>>4)&1); /* bit4 */
|
||||
m_msm->data_w(data); /* bit0..3 */
|
||||
m_msm->reset_w(BIT(data, 5)); /* bit 5 */
|
||||
m_msm->vclk_w(BIT(data, 4)); /* bit4 */
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(rmhaihai_state::ctrl_w)
|
||||
|
@ -178,20 +178,20 @@ WRITE8_MEMBER(sf_state::sound2_bank_w)
|
||||
|
||||
WRITE8_MEMBER(sf_state::msm1_5205_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm1, (data >> 7) & 1);
|
||||
m_msm1->reset_w(BIT(data, 7));
|
||||
/* ?? bit 6?? */
|
||||
msm5205_data_w(m_msm1, data);
|
||||
msm5205_vclk_w(m_msm1, 1);
|
||||
msm5205_vclk_w(m_msm1, 0);
|
||||
m_msm1->data_w(data);
|
||||
m_msm1->vclk_w(1);
|
||||
m_msm1->vclk_w(0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sf_state::msm2_5205_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm2, (data >> 7) & 1);
|
||||
m_msm2->reset_w(BIT(data, 7));
|
||||
/* ?? bit 6?? */
|
||||
msm5205_data_w(m_msm2, data);
|
||||
msm5205_vclk_w(m_msm2, 1);
|
||||
msm5205_vclk_w(m_msm2, 0);
|
||||
m_msm2->data_w(data);
|
||||
m_msm2->vclk_w(1);
|
||||
m_msm2->vclk_w(0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -180,8 +180,8 @@ WRITE8_MEMBER(sothello_state::msm_cfg_w)
|
||||
bit 2 = S2 1
|
||||
bit 3 = S1 2
|
||||
*/
|
||||
msm5205_playmode_w(m_msm, BITSWAP8((data>>1), 7,6,5,4,3,0,1,2));
|
||||
msm5205_reset_w(m_msm,data&1);
|
||||
m_msm->playmode_w(BITSWAP8((data>>1), 7,6,5,4,3,0,1,2));
|
||||
m_msm->reset_w(data & 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sothello_state::msm_data_w)
|
||||
@ -336,7 +336,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(sothello_state::sothello_interrupt)
|
||||
WRITE_LINE_MEMBER(sothello_state::adpcm_int)
|
||||
{
|
||||
/* only 4 bits are used */
|
||||
msm5205_data_w(m_msm, m_msm_data & 0x0f );
|
||||
m_msm->data_w(m_msm_data & 0x0f );
|
||||
m_soundcpu->set_input_line(0, ASSERT_LINE );
|
||||
}
|
||||
|
||||
|
@ -38,13 +38,13 @@ WRITE8_MEMBER(spdodgeb_state::sound_command_w)
|
||||
WRITE8_MEMBER(spdodgeb_state::spd_adpcm_w)
|
||||
{
|
||||
int chip = offset & 1;
|
||||
device_t *adpcm = machine().device((chip == 0) ? "msm1" : "msm2");
|
||||
msm5205_device *adpcm = chip ? m_msm2 : m_msm1;
|
||||
|
||||
switch (offset/2)
|
||||
{
|
||||
case 3:
|
||||
m_adpcm_idle[chip] = 1;
|
||||
msm5205_reset_w(adpcm,1);
|
||||
adpcm->reset_w(1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@ -57,21 +57,21 @@ WRITE8_MEMBER(spdodgeb_state::spd_adpcm_w)
|
||||
|
||||
case 0:
|
||||
m_adpcm_idle[chip] = 0;
|
||||
msm5205_reset_w(adpcm,0);
|
||||
adpcm->reset_w(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void spdodgeb_state::spd_adpcm_int( device_t *device, int chip )
|
||||
void spdodgeb_state::spd_adpcm_int( msm5205_device *device, int chip )
|
||||
{
|
||||
if (m_adpcm_pos[chip] >= m_adpcm_end[chip] || m_adpcm_pos[chip] >= 0x10000)
|
||||
{
|
||||
m_adpcm_idle[chip] = 1;
|
||||
msm5205_reset_w(device,1);
|
||||
device->reset_w(1);
|
||||
}
|
||||
else if (m_adpcm_data[chip] != -1)
|
||||
{
|
||||
msm5205_data_w(device,m_adpcm_data[chip] & 0x0f);
|
||||
device->data_w(m_adpcm_data[chip] & 0x0f);
|
||||
m_adpcm_data[chip] = -1;
|
||||
}
|
||||
else
|
||||
@ -79,7 +79,7 @@ void spdodgeb_state::spd_adpcm_int( device_t *device, int chip )
|
||||
UINT8 *ROM = memregion("adpcm")->base() + 0x10000 * chip;
|
||||
|
||||
m_adpcm_data[chip] = ROM[m_adpcm_pos[chip]++];
|
||||
msm5205_data_w(device,m_adpcm_data[chip] >> 4);
|
||||
device->data_w(m_adpcm_data[chip] >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ WRITE8_MEMBER(splash_state::splash_adpcm_data_w)
|
||||
|
||||
WRITE_LINE_MEMBER(splash_state::splash_msm5205_int)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_adpcm_data >> 4);
|
||||
m_msm->data_w(m_adpcm_data >> 4);
|
||||
m_adpcm_data = (m_adpcm_data << 4) & 0xf0;
|
||||
}
|
||||
|
||||
@ -577,7 +577,7 @@ WRITE_LINE_MEMBER(splash_state::adpcm_int1)
|
||||
{
|
||||
if (m_snd_interrupt_enable1 || m_msm_toggle1 == 1)
|
||||
{
|
||||
msm5205_data_w(m_msm1, m_msm_data1 >> 4);
|
||||
m_msm1->data_w(m_msm_data1 >> 4);
|
||||
m_msm_data1 <<= 4;
|
||||
m_msm_toggle1 ^= 1;
|
||||
if (m_msm_toggle1 == 0)
|
||||
@ -592,7 +592,7 @@ WRITE_LINE_MEMBER(splash_state::adpcm_int2)
|
||||
{
|
||||
if (m_snd_interrupt_enable2 || m_msm_toggle2 == 1)
|
||||
{
|
||||
msm5205_data_w(m_msm2, m_msm_data2 >> 4);
|
||||
m_msm2->data_w(m_msm_data2 >> 4);
|
||||
m_msm_data2 <<= 4;
|
||||
m_msm_toggle2 ^= 1;
|
||||
if (m_msm_toggle2 == 0)
|
||||
|
@ -176,7 +176,7 @@ WRITE16_MEMBER(srmp2_state::srmp2_adpcm_code_w)
|
||||
m_adpcm_sptr += (m_adpcm_bank * 0x10000);
|
||||
m_adpcm_eptr += (m_adpcm_bank * 0x10000);
|
||||
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ WRITE8_MEMBER(srmp2_state::srmp3_adpcm_code_w)
|
||||
m_adpcm_sptr += (m_adpcm_bank * 0x10000);
|
||||
m_adpcm_eptr += (m_adpcm_bank * 0x10000);
|
||||
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
|
||||
@ -216,25 +216,25 @@ WRITE_LINE_MEMBER(srmp2_state::srmp2_adpcm_int)
|
||||
|
||||
if (m_adpcm_sptr >= m_adpcm_eptr)
|
||||
{
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
m_adpcm_data = 0;
|
||||
m_adpcm_sptr = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(m_msm, ((m_adpcm_data >> 4) & 0x0f));
|
||||
m_msm->data_w(((m_adpcm_data >> 4) & 0x0f));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(m_msm, ((m_adpcm_data >> 0) & 0x0f));
|
||||
m_msm->data_w(((m_adpcm_data >> 0) & 0x0f));
|
||||
m_adpcm_sptr++;
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -436,16 +436,16 @@ static const ay8910_interface ay8910_config =
|
||||
|
||||
WRITE_LINE_MEMBER(suprgolf_state::adpcm_int)
|
||||
{
|
||||
msm5205_reset_w(m_msm,0);
|
||||
m_msm->reset_w(0);
|
||||
m_toggle ^= 1;
|
||||
if(m_toggle)
|
||||
{
|
||||
msm5205_data_w(m_msm, (m_msm5205next & 0xf0) >> 4);
|
||||
m_msm->data_w((m_msm5205next & 0xf0) >> 4);
|
||||
if(m_msm_nmi_mask) { m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); }
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(m_msm, (m_msm5205next & 0x0f) >> 0);
|
||||
m_msm->data_w((m_msm5205next & 0x0f) >> 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -359,7 +359,7 @@ WRITE8_MEMBER(segas1x_bootleg_state::tturfbl_msm5205_data_w)
|
||||
|
||||
WRITE_LINE_MEMBER(segas1x_bootleg_state::tturfbl_msm5205_callback)
|
||||
{
|
||||
msm5205_data_w(machine().device("5205"), (m_sample_buffer >> 4) & 0x0f);
|
||||
m_msm->data_w((m_sample_buffer >> 4) & 0x0f);
|
||||
|
||||
m_sample_buffer <<= 4;
|
||||
m_sample_select ^= 1;
|
||||
@ -1159,7 +1159,7 @@ WRITE8_MEMBER(segas1x_bootleg_state::shdancbl_msm5205_data_w)
|
||||
|
||||
WRITE_LINE_MEMBER(segas1x_bootleg_state::shdancbl_msm5205_callback)
|
||||
{
|
||||
msm5205_data_w(machine().device("5205"), m_sample_buffer & 0x0f);
|
||||
m_msm->data_w(m_sample_buffer & 0x0f);
|
||||
|
||||
m_sample_buffer >>= 4;
|
||||
m_sample_select ^= 1;
|
||||
|
@ -558,14 +558,14 @@ WRITE_LINE_MEMBER(taitol_state::champwr_msm5205_vck)
|
||||
{
|
||||
if (m_adpcm_data != -1)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_adpcm_data & 0x0f);
|
||||
m_msm->data_w(m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_adpcm_data = memregion("adpcm")->base()[m_adpcm_pos];
|
||||
m_adpcm_pos = (m_adpcm_pos + 1) & 0x1ffff;
|
||||
msm5205_data_w(m_msm, m_adpcm_data >> 4);
|
||||
m_msm->data_w(m_adpcm_data >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -581,12 +581,12 @@ WRITE8_MEMBER(taitol_state::champwr_msm5205_hi_w)
|
||||
|
||||
WRITE8_MEMBER(taitol_state::champwr_msm5205_start_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(taitol_state::champwr_msm5205_stop_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, 1);
|
||||
m_msm->reset_w(1);
|
||||
m_adpcm_pos &= 0x1ff00;
|
||||
}
|
||||
|
||||
|
@ -145,9 +145,9 @@ ADDRESS_MAP_END
|
||||
|
||||
WRITE8_MEMBER(tbowl_state::tbowl_adpcm_start_w)
|
||||
{
|
||||
device_t *adpcm = machine().device((offset & 1) ? "msm2" : "msm1");
|
||||
msm5205_device *adpcm = (offset & 1) ? m_msm2 : m_msm1;
|
||||
m_adpcm_pos[offset & 1] = data << 8;
|
||||
msm5205_reset_w(adpcm,0);
|
||||
adpcm->reset_w(0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(tbowl_state::tbowl_adpcm_end_w)
|
||||
@ -157,18 +157,18 @@ WRITE8_MEMBER(tbowl_state::tbowl_adpcm_end_w)
|
||||
|
||||
WRITE8_MEMBER(tbowl_state::tbowl_adpcm_vol_w)
|
||||
{
|
||||
device_t *adpcm = machine().device((offset & 1) ? "msm2" : "msm1");
|
||||
msm5205_set_volume(adpcm, (data & 0x7f) * 100 / 0x7f);
|
||||
msm5205_device *adpcm = (offset & 1) ? m_msm2 : m_msm1;
|
||||
adpcm->set_volume((data & 0x7f) * 100 / 0x7f);
|
||||
}
|
||||
|
||||
void tbowl_state::tbowl_adpcm_int( device_t *device, int num )
|
||||
void tbowl_state::tbowl_adpcm_int( msm5205_device *device, int num )
|
||||
{
|
||||
if (m_adpcm_pos[num] >= m_adpcm_end[num] ||
|
||||
m_adpcm_pos[num] >= memregion("adpcm")->bytes()/2)
|
||||
msm5205_reset_w(device,1);
|
||||
device->reset_w(1);
|
||||
else if (m_adpcm_data[num] != -1)
|
||||
{
|
||||
msm5205_data_w(device,m_adpcm_data[num] & 0x0f);
|
||||
device->data_w(m_adpcm_data[num] & 0x0f);
|
||||
m_adpcm_data[num] = -1;
|
||||
}
|
||||
else
|
||||
@ -176,7 +176,7 @@ void tbowl_state::tbowl_adpcm_int( device_t *device, int num )
|
||||
UINT8 *ROM = memregion("adpcm")->base() + 0x10000 * num;
|
||||
|
||||
m_adpcm_data[num] = ROM[m_adpcm_pos[num]++];
|
||||
msm5205_data_w(device,m_adpcm_data[num] >> 4);
|
||||
device->data_w(m_adpcm_data[num] >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ WRITE8_MEMBER(tecmo_state::tecmo_nmi_ack_w)
|
||||
WRITE8_MEMBER(tecmo_state::tecmo_adpcm_start_w)
|
||||
{
|
||||
m_adpcm_pos = data << 8;
|
||||
msm5205_reset_w(m_msm, 0);
|
||||
m_msm->reset_w(0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(tecmo_state::tecmo_adpcm_end_w)
|
||||
@ -89,17 +89,17 @@ WRITE8_MEMBER(tecmo_state::tecmo_adpcm_end_w)
|
||||
|
||||
WRITE8_MEMBER(tecmo_state::tecmo_adpcm_vol_w)
|
||||
{
|
||||
msm5205_set_volume(m_msm,(data & 0x0f) * 100 / 15);
|
||||
m_msm->set_volume((data & 0x0f) * 100 / 15);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(tecmo_state::tecmo_adpcm_int)
|
||||
{
|
||||
if (m_adpcm_pos >= m_adpcm_end ||
|
||||
m_adpcm_pos >= memregion("adpcm")->bytes())
|
||||
msm5205_reset_w(m_msm,1);
|
||||
m_msm->reset_w(1);
|
||||
else if (m_adpcm_data != -1)
|
||||
{
|
||||
msm5205_data_w(m_msm,m_adpcm_data & 0x0f);
|
||||
m_msm->data_w(m_adpcm_data & 0x0f);
|
||||
m_adpcm_data = -1;
|
||||
}
|
||||
else
|
||||
@ -107,7 +107,7 @@ WRITE_LINE_MEMBER(tecmo_state::tecmo_adpcm_int)
|
||||
UINT8 *ROM = memregion("adpcm")->base();
|
||||
|
||||
m_adpcm_data = ROM[m_adpcm_pos++];
|
||||
msm5205_data_w(m_msm,m_adpcm_data >> 4);
|
||||
m_msm->data_w(m_adpcm_data >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ WRITE8_MEMBER(tehkanwc_state::tehkanwc_portB_w)
|
||||
|
||||
WRITE8_MEMBER(tehkanwc_state::msm_reset_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm,data ? 0 : 1);
|
||||
m_msm->reset_w(data ? 0 : 1);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(tehkanwc_state::tehkanwc_adpcm_int)
|
||||
@ -200,10 +200,10 @@ WRITE_LINE_MEMBER(tehkanwc_state::tehkanwc_adpcm_int)
|
||||
int msm_data = SAMPLES[m_msm_data_offs & 0x7fff];
|
||||
|
||||
if (m_toggle == 0)
|
||||
msm5205_data_w(m_msm,(msm_data >> 4) & 0x0f);
|
||||
m_msm->data_w((msm_data >> 4) & 0x0f);
|
||||
else
|
||||
{
|
||||
msm5205_data_w(m_msm,msm_data & 0x0f);
|
||||
m_msm->data_w(msm_data & 0x0f);
|
||||
m_msm_data_offs++;
|
||||
}
|
||||
|
||||
|
@ -156,10 +156,10 @@ WRITE16_MEMBER(tigeroad_state::tigeroad_soundcmd_w)
|
||||
|
||||
WRITE8_MEMBER(tigeroad_state::msm5205_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm,(data>>7)&1);
|
||||
msm5205_data_w(m_msm,data);
|
||||
msm5205_vclk_w(m_msm,1);
|
||||
msm5205_vclk_w(m_msm,0);
|
||||
m_msm->reset_w(BIT(data, 7));
|
||||
m_msm->data_w(data);
|
||||
m_msm->vclk_w(1);
|
||||
m_msm->vclk_w(0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -58,7 +58,7 @@ READ16_MEMBER(toki_state::pip16_r)
|
||||
|
||||
WRITE_LINE_MEMBER(toki_state::toki_adpcm_int)
|
||||
{
|
||||
msm5205_data_w (m_msm, m_msm5205next);
|
||||
m_msm->data_w(m_msm5205next);
|
||||
m_msm5205next >>= 4;
|
||||
|
||||
m_toggle ^= 1;
|
||||
@ -76,7 +76,7 @@ WRITE8_MEMBER(toki_state::toki_adpcm_control_w)
|
||||
bankaddress = 0x10000 + (data & 0x01) * 0x4000;
|
||||
membank("bank1")->set_base(&RAM[bankaddress]);
|
||||
|
||||
msm5205_reset_w(m_msm,data & 0x08);
|
||||
m_msm->reset_w(data & 0x08);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(toki_state::toki_adpcm_data_w)
|
||||
|
@ -420,11 +420,12 @@ WRITE8_MEMBER(topspeed_state::sound_bankswitch_w)/* assumes Z80 sandwiched betwe
|
||||
reset_sound_region();
|
||||
}
|
||||
|
||||
void topspeed_state::topspeed_msm5205_clock( device_t *device, int chip )
|
||||
void topspeed_state::topspeed_msm5205_clock( int chip )
|
||||
{
|
||||
UINT8 data = m_msm_rom[chip][m_msm_pos[chip]];
|
||||
msm5205_device *msm = chip ? m_msm2 : m_msm1;
|
||||
|
||||
msm5205_data_w(device, m_msm_sel[chip] ? data & 0xf : data >> 4 & 0xf);
|
||||
msm->data_w(m_msm_sel[chip] ? data & 0xf : data >> 4 & 0xf);
|
||||
m_msm_pos[chip] += m_msm_sel[chip];
|
||||
m_msm_sel[chip] ^= 1;
|
||||
|
||||
@ -434,18 +435,19 @@ void topspeed_state::topspeed_msm5205_clock( device_t *device, int chip )
|
||||
|
||||
WRITE_LINE_MEMBER(topspeed_state::topspeed_msm5205_vck_1)
|
||||
{
|
||||
topspeed_msm5205_clock(m_msm_chip[0], 0);
|
||||
topspeed_msm5205_clock(0);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(topspeed_state::topspeed_msm5205_vck_2)
|
||||
{
|
||||
topspeed_msm5205_clock(m_msm_chip[1], 1);
|
||||
topspeed_msm5205_clock(1);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(topspeed_state::topspeed_msm5205_command_w)
|
||||
{
|
||||
int chip = offset >> 12 & 1;
|
||||
msm5205_device *msm = chip ? m_msm2 : m_msm1;
|
||||
|
||||
// disable 2nd chip for now... it doesn't work yet
|
||||
if (chip == 1) return;
|
||||
@ -457,7 +459,7 @@ WRITE8_MEMBER(topspeed_state::topspeed_msm5205_command_w)
|
||||
m_msm_start[chip] = data << 8;
|
||||
m_msm_pos[chip] = m_msm_start[chip];
|
||||
m_msm_sel[chip] = 0;
|
||||
msm5205_reset_w(m_msm_chip[chip], 0);
|
||||
msm->reset_w(0);
|
||||
break;
|
||||
|
||||
// $b400 / $c400: apply volume now
|
||||
@ -467,7 +469,7 @@ WRITE8_MEMBER(topspeed_state::topspeed_msm5205_command_w)
|
||||
|
||||
// $b800 / $c800: stop?
|
||||
case 0x08:
|
||||
msm5205_reset_w(m_msm_chip[chip], 1);
|
||||
msm->reset_w(1);
|
||||
break;
|
||||
|
||||
// $bc00 / $cc00: set loop?
|
||||
@ -675,8 +677,6 @@ void topspeed_state::machine_start()
|
||||
{
|
||||
membank("bank10")->configure_entries(0, 4, memregion("audiocpu")->base() + 0xc000, 0x4000);
|
||||
|
||||
m_msm_chip[0] = m_msm1;
|
||||
m_msm_chip[1] = m_msm2;
|
||||
m_msm_rom[0] = memregion("adpcm")->base();
|
||||
m_msm_rom[1] = memregion("adpcm")->base() + 0x10000;
|
||||
|
||||
@ -692,8 +692,8 @@ void topspeed_state::machine_reset()
|
||||
m_ioc220_port = 0;
|
||||
m_banknum = -1;
|
||||
|
||||
msm5205_reset_w(m_msm_chip[0], 1);
|
||||
msm5205_reset_w(m_msm_chip[1], 1);
|
||||
m_msm1->reset_w(1);
|
||||
m_msm2->reset_w(1);
|
||||
m_msm_loop[0] = 0;
|
||||
m_msm_loop[1] = 0;
|
||||
}
|
||||
|
@ -547,7 +547,7 @@ WRITE8_MEMBER(tubep_state::rjammer_voice_startstop_w)
|
||||
{
|
||||
/* bit 0 of data selects voice start/stop (reset pin on MSM5205)*/
|
||||
// 0 -stop; 1-start
|
||||
msm5205_reset_w (m_msm, (data&1)^1 );
|
||||
m_msm->reset_w((data & 1)^1);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -558,9 +558,9 @@ WRITE8_MEMBER(tubep_state::rjammer_voice_frequency_select_w)
|
||||
/* bit 0 of data selects voice frequency on MSM5205 */
|
||||
// 0 -4 KHz; 1- 8KHz
|
||||
if (data & 1)
|
||||
msm5205_playmode_w(m_msm, MSM5205_S48_4B); /* 8 KHz */
|
||||
m_msm->playmode_w(MSM5205_S48_4B); /* 8 KHz */
|
||||
else
|
||||
msm5205_playmode_w(m_msm, MSM5205_S96_4B); /* 4 KHz */
|
||||
m_msm->playmode_w(MSM5205_S96_4B); /* 4 KHz */
|
||||
|
||||
return;
|
||||
}
|
||||
@ -572,12 +572,12 @@ WRITE_LINE_MEMBER(tubep_state::rjammer_adpcm_vck)
|
||||
|
||||
if (m_ls74 == 1)
|
||||
{
|
||||
msm5205_data_w(m_msm, (m_ls377 >> 0) & 15 );
|
||||
m_soundcpu->set_input_line(0, ASSERT_LINE );
|
||||
m_msm->data_w((m_ls377 >> 0) & 15);
|
||||
m_soundcpu->set_input_line(0, ASSERT_LINE);
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_data_w(m_msm, (m_ls377 >> 4) & 15 );
|
||||
m_msm->data_w((m_ls377 >> 4) & 15);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ WRITE8_MEMBER(wc90b_state::adpcm_control_w)
|
||||
bankaddress = 0x10000 + (data & 0x01) * 0x4000;
|
||||
membank("bank3")->set_base(&ROM[bankaddress]);
|
||||
|
||||
msm5205_reset_w(m_msm,data & 0x08);
|
||||
m_msm->reset_w(data & 0x08);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(wc90b_state::adpcm_data_w)
|
||||
@ -341,11 +341,11 @@ WRITE_LINE_MEMBER(wc90b_state::adpcm_int)
|
||||
m_toggle ^= 1;
|
||||
if(m_toggle)
|
||||
{
|
||||
msm5205_data_w(m_msm, (m_msm5205next & 0xf0) >> 4);
|
||||
m_msm->data_w((m_msm5205next & 0xf0) >> 4);
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
else
|
||||
msm5205_data_w(m_msm, (m_msm5205next & 0x0f) >> 0);
|
||||
m_msm->data_w((m_msm5205next & 0x0f) >> 0);
|
||||
}
|
||||
|
||||
static const msm5205_interface msm5205_config =
|
||||
|
@ -95,7 +95,7 @@ ADDRESS_MAP_END
|
||||
|
||||
WRITE8_MEMBER(yunsung8_state::yunsung8_sound_bankswitch_w)
|
||||
{
|
||||
msm5205_reset_w(m_msm, data & 0x20);
|
||||
m_msm->reset_w(data & 0x20);
|
||||
|
||||
membank("bank2")->set_entry(data & 0x07);
|
||||
|
||||
@ -444,7 +444,7 @@ GFXDECODE_END
|
||||
|
||||
WRITE_LINE_MEMBER(yunsung8_state::yunsung8_adpcm_int)
|
||||
{
|
||||
msm5205_data_w(m_msm, m_adpcm >> 4);
|
||||
m_msm->data_w(m_adpcm >> 4);
|
||||
m_adpcm <<= 4;
|
||||
|
||||
m_toggle ^= 1;
|
||||
|
@ -105,7 +105,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);
|
||||
void dd_adpcm_int(msm5205_device *device, int chip);
|
||||
DECLARE_WRITE_LINE_MEMBER(dd_adpcm_int_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(dd_adpcm_int_2);
|
||||
};
|
||||
|
@ -61,9 +61,9 @@ public:
|
||||
DECLARE_WRITE_LINE_MEMBER(borntofi_adpcm_int_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(borntofi_adpcm_int_2);
|
||||
DECLARE_WRITE_LINE_MEMBER(borntofi_adpcm_int_3);
|
||||
void borntofi_adpcm_start( device_t *device, int voice );
|
||||
void borntofi_adpcm_stop( device_t *device, int voice );
|
||||
void borntofi_adpcm_int( device_t *device, int voice );
|
||||
void borntofi_adpcm_start( msm5205_device *device, int voice );
|
||||
void borntofi_adpcm_stop( msm5205_device *device, int voice );
|
||||
void borntofi_adpcm_int( msm5205_device *device, int voice );
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "video/bufsprite.h"
|
||||
#include "sound/msm5205.h"
|
||||
|
||||
class lwings_state : public driver_device
|
||||
{
|
||||
@ -9,7 +10,8 @@ public:
|
||||
m_fgvideoram(*this, "fgvideoram"),
|
||||
m_bg1videoram(*this, "bg1videoram"),
|
||||
m_soundlatch2(*this, "soundlatch2"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_msm(*this, "5205") { }
|
||||
|
||||
/* memory pointers */
|
||||
required_device<buffered_spriteram8_device> m_spriteram;
|
||||
@ -68,4 +70,5 @@ public:
|
||||
void trojan_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
int avengers_fetch_paldata( );
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<msm5205_device> m_msm;
|
||||
};
|
||||
|
@ -91,7 +91,7 @@ public:
|
||||
TIMER_CALLBACK_MEMBER(cchip_timer);
|
||||
void updateDifficulty( int mode );
|
||||
void opwolf_cchip_init( );
|
||||
void opwolf_msm5205_vck(device_t *device, int chip);
|
||||
void opwolf_msm5205_vck(msm5205_device *device, int chip);
|
||||
DECLARE_WRITE_LINE_MEMBER(opwolf_msm5205_vck_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(opwolf_msm5205_vck_2);
|
||||
|
||||
|
@ -56,7 +56,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);
|
||||
void spd_adpcm_int(msm5205_device *device, int chip);
|
||||
DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_2);
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include "video/sega16sp.h"
|
||||
#include "machine/segaic16.h"
|
||||
#include "sound/msm5205.h"
|
||||
|
||||
class segas1x_bootleg_state : public sega_16bit_common_base
|
||||
{
|
||||
@ -17,7 +18,8 @@ public:
|
||||
m_goldnaxeb2_fgpage(*this, "gab2_fgpage"),
|
||||
m_sprites(*this, "sprites"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_soundcpu(*this, "soundcpu")
|
||||
m_soundcpu(*this, "soundcpu"),
|
||||
m_msm(*this, "5205")
|
||||
{ }
|
||||
|
||||
required_shared_ptr<UINT16> m_textram;
|
||||
@ -112,6 +114,7 @@ public:
|
||||
/* devices */
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<cpu_device> m_soundcpu;
|
||||
optional_device<msm5205_device> m_msm;
|
||||
DECLARE_WRITE16_MEMBER(sound_command_nmi_w);
|
||||
DECLARE_WRITE16_MEMBER(sound_command_w);
|
||||
DECLARE_WRITE16_MEMBER(sys16_coinctrl_w);
|
||||
|
@ -60,7 +60,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);
|
||||
void tbowl_adpcm_int(msm5205_device *device, int chip);
|
||||
DECLARE_WRITE_LINE_MEMBER(tbowl_adpcm_int_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(tbowl_adpcm_int_2);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
|
@ -37,7 +37,6 @@ public:
|
||||
required_shared_ptr<UINT16> m_sharedram;
|
||||
|
||||
/* adpcm */
|
||||
device_t *m_msm_chip[2];
|
||||
UINT8 *m_msm_rom[2];
|
||||
UINT16 m_msm_start[2];
|
||||
UINT16 m_msm_loop[2];
|
||||
@ -78,7 +77,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);
|
||||
void topspeed_msm5205_clock(int chip);
|
||||
DECLARE_WRITE_LINE_MEMBER(topspeed_msm5205_vck_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(topspeed_msm5205_vck_2);
|
||||
|
||||
|
@ -201,15 +201,15 @@ WRITE_LINE_MEMBER(stfight_state::stfight_adpcm_int)
|
||||
// finished playing sample?
|
||||
if( m_adpcm_data_offs == m_adpcm_data_end )
|
||||
{
|
||||
msm5205_reset_w(m_msm, 1 );
|
||||
m_msm->reset_w(1);
|
||||
return;
|
||||
}
|
||||
|
||||
if( m_toggle == 0 )
|
||||
msm5205_data_w(m_msm, ( adpcm_data >> 4 ) & 0x0f );
|
||||
m_msm->data_w((adpcm_data >> 4) & 0x0f);
|
||||
else
|
||||
{
|
||||
msm5205_data_w(m_msm, adpcm_data & 0x0f );
|
||||
m_msm->data_w(adpcm_data & 0x0f);
|
||||
m_adpcm_data_offs++;
|
||||
}
|
||||
|
||||
@ -224,7 +224,7 @@ WRITE8_MEMBER(stfight_state::stfight_adpcm_control_w)
|
||||
m_adpcm_data_end = sampleLimits[data+1];
|
||||
}
|
||||
|
||||
msm5205_reset_w( m_msm, data & 0x08 ? 1 : 0 );
|
||||
m_msm->reset_w(BIT(data, 3));
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(stfight_state::stfight_e800_w)
|
||||
|
@ -122,6 +122,8 @@ public:
|
||||
optional_device<msm5205_device> m_msm5205;
|
||||
required_device<pce_cart_slot_device> m_cartslot;
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(pce_cd_msm5205_int);
|
||||
|
||||
UINT8 m_io_port_options;
|
||||
UINT8 m_sys3_card;
|
||||
UINT8 m_acard;
|
||||
|
@ -100,9 +100,9 @@ enum {
|
||||
/* CD Unit RAM */
|
||||
|
||||
/* MSM5205 ADPCM decoder definition */
|
||||
static void pce_cd_msm5205_int(device_t *device,int state);
|
||||
const msm5205_interface pce_cd_msm5205_interface = {
|
||||
DEVCB_LINE(pce_cd_msm5205_int), /* interrupt function */
|
||||
const msm5205_interface pce_cd_msm5205_interface =
|
||||
{
|
||||
DEVCB_DRIVER_LINE_MEMBER(pce_state, pce_cd_msm5205_int), /* interrupt function */
|
||||
MSM5205_S48_4B /* 1/48 prescaler, 4bit data */
|
||||
};
|
||||
|
||||
@ -298,21 +298,20 @@ static void adpcm_play(running_machine &machine)
|
||||
the MSM5205. Currently we can only use static clocks for the
|
||||
MSM5205.
|
||||
*/
|
||||
static void pce_cd_msm5205_int(device_t *device, int st)
|
||||
WRITE_LINE_MEMBER(pce_state::pce_cd_msm5205_int)
|
||||
{
|
||||
pce_state *state = device->machine().driver_data<pce_state>();
|
||||
pce_cd_t &pce_cd = state->m_cd;
|
||||
pce_cd_t &pce_cd = m_cd;
|
||||
UINT8 msm_data;
|
||||
|
||||
// popmessage("%08x %08x %08x %02x %02x",pce_cd.msm_start_addr,pce_cd.msm_end_addr,pce_cd.msm_half_addr,pce_cd.regs[0x0c],pce_cd.regs[0x0d]);
|
||||
|
||||
if ( pce_cd.msm_idle )
|
||||
if (pce_cd.msm_idle)
|
||||
return;
|
||||
|
||||
/* Supply new ADPCM data */
|
||||
msm_data = (pce_cd.msm_nibble) ? (pce_cd.adpcm_ram[pce_cd.msm_start_addr] & 0x0f) : ((pce_cd.adpcm_ram[pce_cd.msm_start_addr] & 0xf0) >> 4);
|
||||
|
||||
msm5205_data_w(device, msm_data);
|
||||
m_msm5205->data_w(msm_data);
|
||||
pce_cd.msm_nibble ^= 1;
|
||||
|
||||
if(pce_cd.msm_nibble == 0)
|
||||
@ -321,16 +320,16 @@ static void pce_cd_msm5205_int(device_t *device, int st)
|
||||
|
||||
if(pce_cd.msm_start_addr == pce_cd.msm_half_addr)
|
||||
{
|
||||
//pce_cd_set_irq_line( device->machine(), PCE_CD_IRQ_SAMPLE_FULL_PLAY, CLEAR_LINE );
|
||||
//pce_cd_set_irq_line( device->machine(), PCE_CD_IRQ_SAMPLE_HALF_PLAY, ASSERT_LINE );
|
||||
//pce_cd_set_irq_line(machine(), PCE_CD_IRQ_SAMPLE_FULL_PLAY, CLEAR_LINE);
|
||||
//pce_cd_set_irq_line(machine(), PCE_CD_IRQ_SAMPLE_HALF_PLAY, ASSERT_LINE);
|
||||
}
|
||||
|
||||
if(pce_cd.msm_start_addr > pce_cd.msm_end_addr)
|
||||
{
|
||||
//pce_cd_set_irq_line( device->machine(), PCE_CD_IRQ_SAMPLE_HALF_PLAY, CLEAR_LINE );
|
||||
//pce_cd_set_irq_line( device->machine(), PCE_CD_IRQ_SAMPLE_FULL_PLAY, CLEAR_LINE );
|
||||
adpcm_stop(device->machine(),1);
|
||||
msm5205_reset_w(device, 1);
|
||||
//pce_cd_set_irq_line(machine(), PCE_CD_IRQ_SAMPLE_HALF_PLAY, CLEAR_LINE);
|
||||
//pce_cd_set_irq_line(machine(), PCE_CD_IRQ_SAMPLE_FULL_PLAY, CLEAR_LINE);
|
||||
adpcm_stop(machine(),1);
|
||||
m_msm5205->reset_w(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1033,7 +1032,7 @@ static void pce_cd_init( running_machine &machine )
|
||||
pce_cd.adpcm_ram = auto_alloc_array(machine, UINT8, PCE_ADPCM_RAM_SIZE );
|
||||
memset( pce_cd.adpcm_ram, 0, PCE_ADPCM_RAM_SIZE );
|
||||
pce_cd.adpcm_clock_divider = 1;
|
||||
msm5205_change_clock_w(machine.device("msm5205"), (PCE_CD_CLOCK / 6) / pce_cd.adpcm_clock_divider);
|
||||
machine.device<msm5205_device>("msm5205")->change_clock_w((PCE_CD_CLOCK / 6) / pce_cd.adpcm_clock_divider);
|
||||
|
||||
/* Set up cd command buffer */
|
||||
pce_cd.command_buffer = auto_alloc_array(machine, UINT8, PCE_CD_COMMAND_BUFFER_SIZE );
|
||||
@ -1150,12 +1149,12 @@ TIMER_CALLBACK_MEMBER(pce_state::pce_cd_adpcm_fadeout_callback)
|
||||
if(pce_cd.adpcm_volume <= 0)
|
||||
{
|
||||
pce_cd.adpcm_volume = 0.0;
|
||||
msm5205_set_volume(m_msm5205, 0.0);
|
||||
m_msm5205->set_volume(0.0);
|
||||
pce_cd.adpcm_fadeout_timer->adjust(attotime::never);
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_set_volume(m_msm5205, pce_cd.adpcm_volume);
|
||||
m_msm5205->set_volume(pce_cd.adpcm_volume);
|
||||
pce_cd.adpcm_fadeout_timer->adjust(attotime::from_usec(param), param);
|
||||
}
|
||||
}
|
||||
@ -1168,12 +1167,12 @@ TIMER_CALLBACK_MEMBER(pce_state::pce_cd_adpcm_fadein_callback)
|
||||
if(pce_cd.adpcm_volume >= 100.0)
|
||||
{
|
||||
pce_cd.adpcm_volume = 100.0;
|
||||
msm5205_set_volume(m_msm5205, 100.0);
|
||||
m_msm5205->set_volume(100.0);
|
||||
pce_cd.adpcm_fadein_timer->adjust(attotime::never);
|
||||
}
|
||||
else
|
||||
{
|
||||
msm5205_set_volume(m_msm5205, pce_cd.adpcm_volume);
|
||||
m_msm5205->set_volume(pce_cd.adpcm_volume);
|
||||
pce_cd.adpcm_fadein_timer->adjust(attotime::from_usec(param), param);
|
||||
}
|
||||
}
|
||||
@ -1257,7 +1256,7 @@ WRITE8_MEMBER(pce_state::pce_cd_intf_w)
|
||||
pce_cd.msm_half_addr = 0;
|
||||
pce_cd.msm_nibble = 0;
|
||||
adpcm_stop(machine(), 0);
|
||||
msm5205_reset_w( machine().device( "msm5205"), 1 );
|
||||
m_msm5205->reset_w(1);
|
||||
}
|
||||
|
||||
if ( ( data & 0x40) && ((pce_cd.regs[0x0D] & 0x40) == 0) ) // ADPCM play
|
||||
@ -1267,7 +1266,7 @@ WRITE8_MEMBER(pce_state::pce_cd_intf_w)
|
||||
pce_cd.msm_half_addr = (pce_cd.adpcm_read_ptr + (pce_cd.adpcm_length / 2)) & 0xffff;
|
||||
pce_cd.msm_nibble = 0;
|
||||
adpcm_play(machine());
|
||||
msm5205_reset_w( machine().device( "msm5205"), 0 );
|
||||
m_msm5205->reset_w(0);
|
||||
|
||||
//popmessage("%08x %08x",pce_cd.adpcm_read_ptr,pce_cd.adpcm_length);
|
||||
}
|
||||
@ -1275,7 +1274,7 @@ WRITE8_MEMBER(pce_state::pce_cd_intf_w)
|
||||
{
|
||||
/* used by Buster Bros to cancel an in-flight sample */
|
||||
adpcm_stop(machine(), 0);
|
||||
msm5205_reset_w( machine().device( "msm5205"), 1 );
|
||||
m_msm5205->reset_w(1);
|
||||
}
|
||||
|
||||
pce_cd.msm_repeat = (data & 0x20) >> 5;
|
||||
@ -1297,7 +1296,7 @@ WRITE8_MEMBER(pce_state::pce_cd_intf_w)
|
||||
break;
|
||||
case 0x0E: /* ADPCM playback rate */
|
||||
pce_cd.adpcm_clock_divider = 0x10 - ( data & 0x0F );
|
||||
msm5205_change_clock_w(m_msm5205, (PCE_CD_CLOCK / 6) / pce_cd.adpcm_clock_divider);
|
||||
m_msm5205->change_clock_w((PCE_CD_CLOCK / 6) / pce_cd.adpcm_clock_divider);
|
||||
break;
|
||||
case 0x0F: /* ADPCM and CD audio fade timer */
|
||||
/* TODO: timers needs HW tests */
|
||||
|
@ -2671,7 +2671,7 @@ READ8_MEMBER(rmnimbus_state::nimbus_iou_r)
|
||||
WRITE8_MEMBER(rmnimbus_state::nimbus_iou_w)
|
||||
{
|
||||
int pc=space.device().safe_pc();
|
||||
device_t *msm5205 = machine().device(MSM5205_TAG);
|
||||
msm5205_device *msm5205 = machine().device<msm5205_device>(MSM5205_TAG);
|
||||
|
||||
if(LOG_IOU)
|
||||
logerror("Nimbus IOUW %08X write of %02X to %04X\n",pc,data,(offset*2)+0x92);
|
||||
@ -2679,7 +2679,7 @@ WRITE8_MEMBER(rmnimbus_state::nimbus_iou_w)
|
||||
if(offset==0)
|
||||
{
|
||||
m_iou_reg092=data;
|
||||
msm5205_reset_w(msm5205, (data & MSM5205_INT_ENABLE) ? 0 : 1);
|
||||
msm5205->reset_w((data & MSM5205_INT_ENABLE) ? 0 : 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2705,13 +2705,13 @@ void rmnimbus_state::iou_reset()
|
||||
void rmnimbus_state::rmni_sound_reset()
|
||||
{
|
||||
//device_t *ay8910 = machine().device(AY8910_TAG);
|
||||
device_t *msm5205 = machine().device(MSM5205_TAG);
|
||||
msm5205_device *msm5205 = machine().device<msm5205_device>(MSM5205_TAG);
|
||||
|
||||
//ay8910->reset();
|
||||
msm5205_reset_w(msm5205, 1);
|
||||
msm5205->reset_w(1);
|
||||
|
||||
m_last_playmode=MSM5205_S48_4B;
|
||||
msm5205_playmode_w(msm5205,m_last_playmode);
|
||||
m_last_playmode = MSM5205_S48_4B;
|
||||
msm5205->playmode_w(m_last_playmode);
|
||||
|
||||
m_ay8910_a=0;
|
||||
}
|
||||
@ -2743,9 +2743,9 @@ WRITE8_MEMBER(rmnimbus_state::nimbus_sound_ay8910_w)
|
||||
|
||||
WRITE8_MEMBER(rmnimbus_state::nimbus_sound_ay8910_porta_w)
|
||||
{
|
||||
device_t *msm5205 = machine().device(MSM5205_TAG);
|
||||
msm5205_device *msm5205 = machine().device<msm5205_device>(MSM5205_TAG);
|
||||
|
||||
msm5205_data_w(msm5205, data);
|
||||
msm5205->data_w(data);
|
||||
|
||||
// Mouse code needs a copy of this.
|
||||
m_ay8910_a=data;
|
||||
@ -2753,12 +2753,12 @@ WRITE8_MEMBER(rmnimbus_state::nimbus_sound_ay8910_porta_w)
|
||||
|
||||
WRITE8_MEMBER(rmnimbus_state::nimbus_sound_ay8910_portb_w)
|
||||
{
|
||||
device_t *msm5205 = machine().device(MSM5205_TAG);
|
||||
msm5205_device *msm5205 = machine().device<msm5205_device>(MSM5205_TAG);
|
||||
|
||||
if((data & 0x07)!=m_last_playmode)
|
||||
if ((data & 0x07) != m_last_playmode)
|
||||
{
|
||||
m_last_playmode=(data & 0x07);
|
||||
msm5205_playmode_w(msm5205, m_last_playmode);
|
||||
m_last_playmode = (data & 0x07);
|
||||
msm5205->playmode_w(m_last_playmode);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user