Modernized Konami 007232 sound device [Osso]

also, removed the chip from bishi_state class, since it seems that the driver does not use this device at all...
This commit is contained in:
Fabio Priuli 2013-06-13 11:20:06 +00:00
parent cd23c39c2b
commit 4c918f749f
20 changed files with 316 additions and 365 deletions

View File

@ -26,43 +26,9 @@ added external port callback, and functions to set the volume of the channels
#include "emu.h" #include "emu.h"
#include "k007232.h" #include "k007232.h"
#define KDAC_A_PCM_MAX (2) /* Channels per chip */
struct KDAC_A_PCM
{
UINT8 vol[KDAC_A_PCM_MAX][2]; /* volume for the left and right channel */
UINT32 addr[KDAC_A_PCM_MAX];
UINT32 start[KDAC_A_PCM_MAX];
UINT32 step[KDAC_A_PCM_MAX];
UINT32 bank[KDAC_A_PCM_MAX];
int play[KDAC_A_PCM_MAX];
UINT8 wreg[0x10]; /* write data */
UINT8 * pcmbuf[2]; /* Channel A & B pointers */
UINT32 clock; /* chip clock */
UINT32 pcmlimit;
sound_stream * stream;
const k007232_interface *intf;
UINT32 fncode[0x200];
devcb_resolved_write8 portwritehandler;
};
#define BASE_SHIFT (12) #define BASE_SHIFT (12)
INLINE KDAC_A_PCM *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == K007232);
return (KDAC_A_PCM *)downcast<k007232_device *>(device)->token();
}
#if 0 #if 0
static const int kdac_note[] = { static const int kdac_note[] = {
261.63/8, 277.18/8, 261.63/8, 277.18/8,
@ -175,8 +141,81 @@ static const float kdaca_fn[][2] = {
#endif #endif
/*************************************************************/ /*************************************************************/
static void KDAC_A_make_fncode( KDAC_A_PCM *info ){
int i;
const device_type K007232 = &device_creator<k007232_device>;
k007232_device::k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, K007232, "K007232", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void k007232_device::device_config_complete()
{
// inherit a copy of the static data
const k007232_interface *intf = reinterpret_cast<const k007232_interface *>(static_config());
if (intf != NULL)
*static_cast<k007232_interface *>(this) = *intf;
// or initialize to defaults if none provided
else
{
memset(&m_portwritehandler, 0, sizeof(m_portwritehandler));
}
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void k007232_device::device_start()
{
/* Set up the chips */
m_pcmbuf[0] = *region();
m_pcmbuf[1] = *region();
m_pcmlimit = region()->bytes();
m_portwritehandler_func.resolve(m_portwritehandler,*this);
for (int i = 0; i < KDAC_A_PCM_MAX; i++)
{
m_addr[i] = 0;
m_start[i] = 0;
m_step[i] = 0;
m_play[i] = 0;
m_bank[i] = 0;
}
m_vol[0][0] = 255; /* channel A output to output A */
m_vol[0][1] = 0;
m_vol[1][0] = 0;
m_vol[1][1] = 255; /* channel B output to output B */
for (int i = 0; i < 0x10; i++)
m_wreg[i] = 0;
m_stream = machine().sound().stream_alloc(*this, 0 , 2, clock()/128, this);
KDAC_A_make_fncode();
save_item(NAME(m_vol));
save_item(NAME(m_addr));
save_item(NAME(m_start));
save_item(NAME(m_step));
save_item(NAME(m_bank));
save_item(NAME(m_play));
save_item(NAME(m_wreg));
}
void k007232_device::KDAC_A_make_fncode()
{
#if 0 #if 0
int i, j, k; int i, j, k;
float fn; float fn;
@ -206,10 +245,12 @@ static void KDAC_A_make_fncode( KDAC_A_PCM *info ){
#endif #endif
#else #else
for( i = 0; i < 0x200; i++ ){ int i;
for( i = 0; i < 0x200; i++ )
{
//fncode[i] = (0x200 * 55) / (0x200 - i); //fncode[i] = (0x200 * 55) / (0x200 - i);
info->fncode[i] = (32 << BASE_SHIFT) / (0x200 - i); m_fncode[i] = (32 << BASE_SHIFT) / (0x200 - i);
// info->fncode[i] = ((0x200 * 55.2 / 880) / (0x200 - i)); // m_fncode[i] = ((0x200 * 55.2 / 880) / (0x200 - i));
// = 512 * 55.2 / 220 / (512 - i) = 128 / (512 - i) // = 512 * 55.2 / 220 / (512 - i) = 128 / (512 - i)
// logerror("2 : fncode[%04x] = %.2f\n", i, fncode[i] ); // logerror("2 : fncode[%04x] = %.2f\n", i, fncode[i] );
} }
@ -218,140 +259,21 @@ static void KDAC_A_make_fncode( KDAC_A_PCM *info ){
} }
/************************************************/
/* Konami PCM update */
/************************************************/
static STREAM_UPDATE( KDAC_A_update )
{
KDAC_A_PCM *info = (KDAC_A_PCM *)param;
int i;
memset(outputs[0],0,samples * sizeof(*outputs[0]));
memset(outputs[1],0,samples * sizeof(*outputs[1]));
for( i = 0; i < KDAC_A_PCM_MAX; i++ )
{
if (info->play[i])
{
int volA,volB,j,out;
unsigned int addr, old_addr;
//int cen;
/**** PCM setup ****/
addr = info->start[i] + ((info->addr[i]>>BASE_SHIFT)&0x000fffff);
volA = info->vol[i][0] * 2;
volB = info->vol[i][1] * 2;
#if 0
cen = (volA + volB) / 2;
volA = (volA + cen) < 0x1fe ? (volA + cen) : 0x1fe;
volB = (volB + cen) < 0x1fe ? (volB + cen) : 0x1fe;
#endif
for( j = 0; j < samples; j++ )
{
old_addr = addr;
addr = info->start[i] + ((info->addr[i]>>BASE_SHIFT)&0x000fffff);
while (old_addr <= addr)
{
if( (info->pcmbuf[i][old_addr] & 0x80) || old_addr >= info->pcmlimit )
{
/* end of sample */
if( info->wreg[0x0d]&(1<<i) )
{
/* loop to the beginning */
info->start[i] =
((((unsigned int)info->wreg[i*0x06 + 0x04]<<16)&0x00010000) |
(((unsigned int)info->wreg[i*0x06 + 0x03]<< 8)&0x0000ff00) |
(((unsigned int)info->wreg[i*0x06 + 0x02] )&0x000000ff) |
info->bank[i]);
addr = info->start[i];
info->addr[i] = 0;
old_addr = addr; /* skip loop */
}
else
{
/* stop sample */
info->play[i] = 0;
}
break;
}
old_addr++;
}
if (info->play[i] == 0)
break;
info->addr[i] += info->step[i];
out = (info->pcmbuf[i][addr] & 0x7f) - 0x40;
outputs[0][j] += out * volA;
outputs[1][j] += out * volB;
}
}
}
}
/************************************************/
/* Konami PCM start */
/************************************************/
static DEVICE_START( k007232 )
{
static const k007232_interface defintrf = { DEVCB_NULL };
int i;
KDAC_A_PCM *info = get_safe_token(device);
info->intf = (device->static_config() != NULL) ? (const k007232_interface *)device->static_config() : &defintrf;
/* Set up the chips */
info->pcmbuf[0] = *device->region();
info->pcmbuf[1] = *device->region();
info->pcmlimit = device->region()->bytes();
info->clock = device->clock();
info->portwritehandler.resolve(info->intf->portwritehandler,*device);
for( i = 0; i < KDAC_A_PCM_MAX; i++ )
{
info->start[i] = 0;
info->step[i] = 0;
info->play[i] = 0;
info->bank[i] = 0;
}
info->vol[0][0] = 255; /* channel A output to output A */
info->vol[0][1] = 0;
info->vol[1][0] = 0;
info->vol[1][1] = 255; /* channel B output to output B */
for( i = 0; i < 0x10; i++ ) info->wreg[i] = 0;
info->stream = device->machine().sound().stream_alloc(*device,0,2,device->clock()/128,info,KDAC_A_update);
KDAC_A_make_fncode(info);
}
/************************************************/ /************************************************/
/* Konami PCM write register */ /* Konami PCM write register */
/************************************************/ /************************************************/
WRITE8_DEVICE_HANDLER( k007232_w ) WRITE8_MEMBER( k007232_device::write )
{ {
KDAC_A_PCM *info = get_safe_token(device);
int r = offset; int r = offset;
int v = data; int v = data;
info->stream->update(); m_stream->update();
info->wreg[r] = v; /* stock write data */ m_wreg[r] = v; /* stock write data */
if (r == 0x0c){ if (r == 0x0c){
/* external port, usually volume control */ /* external port, usually volume control */
if (!info->portwritehandler.isnull()) info->portwritehandler(0,v); if (!m_portwritehandler_func.isnull()) m_portwritehandler_func(0,v);
return; return;
} }
else if( r == 0x0d ){ else if( r == 0x0d ){
@ -372,13 +294,13 @@ WRITE8_DEVICE_HANDLER( k007232_w )
case 0x01: case 0x01:
{ {
/**** address step ****/ /**** address step ****/
int idx = (((((unsigned int)info->wreg[reg_port*0x06 + 0x01])<<8)&0x0100) | (((unsigned int)info->wreg[reg_port*0x06 + 0x00])&0x00ff)); int idx = (((((unsigned int)m_wreg[reg_port*0x06 + 0x01])<<8)&0x0100) | (((unsigned int)m_wreg[reg_port*0x06 + 0x00])&0x00ff));
#if 0 #if 0
if( !reg_port && r == 1 ) if( !reg_port && r == 1 )
logerror("%04x\n" ,idx ); logerror("%04x\n" ,idx );
#endif #endif
info->step[reg_port] = info->fncode[idx]; m_step[reg_port] = m_fncode[idx];
break; break;
} }
case 0x02: case 0x02:
@ -387,14 +309,14 @@ WRITE8_DEVICE_HANDLER( k007232_w )
break; break;
case 0x05: case 0x05:
/**** start address ****/ /**** start address ****/
info->start[reg_port] = m_start[reg_port] =
((((unsigned int)info->wreg[reg_port*0x06 + 0x04]<<16)&0x00010000) | ((((unsigned int)m_wreg[reg_port*0x06 + 0x04]<<16)&0x00010000) |
(((unsigned int)info->wreg[reg_port*0x06 + 0x03]<< 8)&0x0000ff00) | (((unsigned int)m_wreg[reg_port*0x06 + 0x03]<< 8)&0x0000ff00) |
(((unsigned int)info->wreg[reg_port*0x06 + 0x02] )&0x000000ff) | (((unsigned int)m_wreg[reg_port*0x06 + 0x02] )&0x000000ff) |
info->bank[reg_port]); m_bank[reg_port]);
if (info->start[reg_port] < info->pcmlimit ){ if (m_start[reg_port] < m_pcmlimit ){
info->play[reg_port] = 1; m_play[reg_port] = 1;
info->addr[reg_port] = 0; m_addr[reg_port] = 0;
} }
break; break;
} }
@ -404,9 +326,8 @@ WRITE8_DEVICE_HANDLER( k007232_w )
/************************************************/ /************************************************/
/* Konami PCM read register */ /* Konami PCM read register */
/************************************************/ /************************************************/
READ8_DEVICE_HANDLER( k007232_r ) READ8_MEMBER( k007232_device::read )
{ {
KDAC_A_PCM *info = get_safe_token(device);
int r = offset; int r = offset;
int ch = 0; int ch = 0;
@ -414,15 +335,15 @@ READ8_DEVICE_HANDLER( k007232_r )
ch = r/0x0006; ch = r/0x0006;
r = ch * 0x0006; r = ch * 0x0006;
info->start[ch] = m_start[ch] =
((((unsigned int)info->wreg[r + 0x04]<<16)&0x00010000) | ((((unsigned int)m_wreg[r + 0x04]<<16)&0x00010000) |
(((unsigned int)info->wreg[r + 0x03]<< 8)&0x0000ff00) | (((unsigned int)m_wreg[r + 0x03]<< 8)&0x0000ff00) |
(((unsigned int)info->wreg[r + 0x02] )&0x000000ff) | (((unsigned int)m_wreg[r + 0x02] )&0x000000ff) |
info->bank[ch]); m_bank[ch]);
if (info->start[ch] < info->pcmlimit ){ if (m_start[ch] < m_pcmlimit ){
info->play[ch] = 1; m_play[ch] = 1;
info->addr[ch] = 0; m_addr[ch] = 0;
} }
} }
return 0; return 0;
@ -430,49 +351,20 @@ READ8_DEVICE_HANDLER( k007232_r )
/*****************************************************************************/ /*****************************************************************************/
void k007232_set_volume(device_t *device,int channel,int volumeA,int volumeB) void k007232_device::set_volume(int channel,int volumeA,int volumeB)
{ {
KDAC_A_PCM *info = get_safe_token(device); m_vol[channel][0] = volumeA;
info->vol[channel][0] = volumeA; m_vol[channel][1] = volumeB;
info->vol[channel][1] = volumeB;
} }
void k007232_set_bank( device_t *device, int chABank, int chBBank ) void k007232_device::set_bank(int chABank, int chBBank )
{ {
KDAC_A_PCM *info = get_safe_token(device); m_bank[0] = chABank<<17;
info->bank[0] = chABank<<17; m_bank[1] = chBBank<<17;
info->bank[1] = chBBank<<17;
} }
/*****************************************************************************/ /*****************************************************************************/
const device_type K007232 = &device_creator<k007232_device>;
k007232_device::k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, K007232, "K007232", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_clear(KDAC_A_PCM);
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void k007232_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void k007232_device::device_start()
{
DEVICE_START_NAME( k007232 )(this);
}
//------------------------------------------------- //-------------------------------------------------
// sound_stream_update - handle a stream update // sound_stream_update - handle a stream update
@ -480,6 +372,72 @@ void k007232_device::device_start()
void k007232_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) void k007232_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{ {
// should never get here int i;
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
memset(outputs[0],0,samples * sizeof(*outputs[0]));
memset(outputs[1],0,samples * sizeof(*outputs[1]));
for( i = 0; i < KDAC_A_PCM_MAX; i++ )
{
if (m_play[i])
{
int volA,volB,j,out;
unsigned int addr, old_addr;
//int cen;
/**** PCM setup ****/
addr = m_start[i] + ((m_addr[i]>>BASE_SHIFT)&0x000fffff);
volA = m_vol[i][0] * 2;
volB = m_vol[i][1] * 2;
#if 0
cen = (volA + volB) / 2;
volA = (volA + cen) < 0x1fe ? (volA + cen) : 0x1fe;
volB = (volB + cen) < 0x1fe ? (volB + cen) : 0x1fe;
#endif
for( j = 0; j < samples; j++ )
{
old_addr = addr;
addr = m_start[i] + ((m_addr[i]>>BASE_SHIFT)&0x000fffff);
while (old_addr <= addr)
{
if( (m_pcmbuf[i][old_addr] & 0x80) || old_addr >= m_pcmlimit )
{
/* end of sample */
if( m_wreg[0x0d]&(1<<i) )
{
/* loop to the beginning */
m_start[i] =
((((unsigned int)m_wreg[i*0x06 + 0x04]<<16)&0x00010000) |
(((unsigned int)m_wreg[i*0x06 + 0x03]<< 8)&0x0000ff00) |
(((unsigned int)m_wreg[i*0x06 + 0x02] )&0x000000ff) |
m_bank[i]);
addr = m_start[i];
m_addr[i] = 0;
old_addr = addr; /* skip loop */
}
else
{
/* stop sample */
m_play[i] = 0;
}
break;
}
old_addr++;
}
if (m_play[i] == 0)
break;
m_addr[i] += m_step[i];
out = (m_pcmbuf[i][addr] & 0x7f) - 0x40;
outputs[0][j] += out * volA;
outputs[1][j] += out * volB;
}
}
}
} }

View File

@ -7,37 +7,36 @@
#ifndef __K007232_H__ #ifndef __K007232_H__
#define __K007232_H__ #define __K007232_H__
#include "devlegcy.h" #define KDAC_A_PCM_MAX (2) /* Channels per chip */
struct k007232_interface struct k007232_interface
{ {
devcb_write8 portwritehandler; devcb_write8 m_portwritehandler;
}; };
DECLARE_WRITE8_DEVICE_HANDLER( k007232_w ); class k007232_device : public device_t,
DECLARE_READ8_DEVICE_HANDLER( k007232_r ); public device_sound_interface,
public k007232_interface
{
public:
k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~k007232_device() {}
void k007232_set_bank( device_t *device, int chABank, int chBBank ); DECLARE_WRITE8_MEMBER( write );
DECLARE_READ8_MEMBER( read );
/*
/*
The 007232 has two channels and produces two outputs. The volume control The 007232 has two channels and produces two outputs. The volume control
is external, however to make it easier to use we handle that inside the is external, however to make it easier to use we handle that inside the
emulation. You can control volume and panning: for each of the two channels emulation. You can control volume and panning: for each of the two channels
you can set the volume of the two outputs. If panning is not required, you can set the volume of the two outputs. If panning is not required,
then volumeB will be 0 for channel 0, and volumeA will be 0 for channel 1. then volumeB will be 0 for channel 0, and volumeA will be 0 for channel 1.
Volume is in the range 0-255. Volume is in the range 0-255.
*/ */
void k007232_set_volume(device_t *device,int channel,int volumeA,int volumeB); void set_volume(int channel,int volumeA,int volumeB);
class k007232_device : public device_t, void set_bank( int chABank, int chBBank );
public device_sound_interface
{
public:
k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~k007232_device() { global_free(m_token); }
// access to legacy token
void *token() const { assert(m_token != NULL); return m_token; }
protected: protected:
// device-level overrides // device-level overrides
virtual void device_config_complete(); virtual void device_config_complete();
@ -45,9 +44,26 @@ protected:
// sound stream update overrides // sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
void KDAC_A_make_fncode();
private: private:
// internal state // internal state
void *m_token; UINT8 m_vol[KDAC_A_PCM_MAX][2]; /* volume for the left and right channel */
UINT32 m_addr[KDAC_A_PCM_MAX];
UINT32 m_start[KDAC_A_PCM_MAX];
UINT32 m_step[KDAC_A_PCM_MAX];
UINT32 m_bank[KDAC_A_PCM_MAX];
int m_play[KDAC_A_PCM_MAX];
UINT8 m_wreg[0x10]; /* write data */
UINT8 * m_pcmbuf[2]; /* Channel A & B pointers */
UINT32 m_pcmlimit;
sound_stream * m_stream;
UINT32 m_fncode[0x200];
devcb_resolved_write8 m_portwritehandler_func;
}; };
extern const device_type K007232; extern const device_type K007232;

View File

@ -16,7 +16,6 @@
#include "cpu/m6809/konami.h" #include "cpu/m6809/konami.h"
#include "video/konicdev.h" #include "video/konicdev.h"
#include "sound/2151intf.h" #include "sound/2151intf.h"
#include "sound/k007232.h"
#include "includes/ajax.h" #include "includes/ajax.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
@ -51,8 +50,8 @@ static ADDRESS_MAP_START( ajax_sound_map, AS_PROGRAM, 8, ajax_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM F6 */ AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM F6 */
AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM 2128SL at D16 */ AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM 2128SL at D16 */
AM_RANGE(0x9000, 0x9000) AM_WRITE(sound_bank_w) /* 007232 bankswitch */ AM_RANGE(0x9000, 0x9000) AM_WRITE(sound_bank_w) /* 007232 bankswitch */
AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE_LEGACY("k007232_1", k007232_r, k007232_w) /* 007232 registers (chip 1) */ AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE("k007232_1", k007232_device, read, write) /* 007232 registers (chip 1) */
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232_2", k007232_r, k007232_w) /* 007232 registers (chip 2) */ AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232_2", k007232_device, read, write) /* 007232 registers (chip 2) */
AM_RANGE(0xb80c, 0xb80c) AM_WRITE(k007232_extvol_w) /* extra volume, goes to the 007232 w/ A11 */ AM_RANGE(0xb80c, 0xb80c) AM_WRITE(k007232_extvol_w) /* extra volume, goes to the 007232 w/ A11 */
/* selecting a different latch for the external port */ /* selecting a different latch for the external port */
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */ AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */
@ -142,30 +141,30 @@ WRITE8_MEMBER(ajax_state::sound_bank_w)
/* banks # for the 007232 (chip 1) */ /* banks # for the 007232 (chip 1) */
bank_A = BIT(data, 1); bank_A = BIT(data, 1);
bank_B = BIT(data, 0); bank_B = BIT(data, 0);
k007232_set_bank(m_k007232_1, bank_A, bank_B); m_k007232_1->set_bank(bank_A, bank_B);
/* banks # for the 007232 (chip 2) */ /* banks # for the 007232 (chip 2) */
bank_A = ((data >> 4) & 0x03); bank_A = ((data >> 4) & 0x03);
bank_B = ((data >> 2) & 0x03); bank_B = ((data >> 2) & 0x03);
k007232_set_bank(m_k007232_2, bank_A, bank_B); m_k007232_2->set_bank(bank_A, bank_B);
} }
WRITE8_MEMBER(ajax_state::volume_callback0) WRITE8_MEMBER(ajax_state::volume_callback0)
{ {
k007232_set_volume(m_k007232_1, 0, (data >> 4) * 0x11, 0); m_k007232_1->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232_1, 1, 0, (data & 0x0f) * 0x11); m_k007232_1->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
WRITE8_MEMBER(ajax_state::k007232_extvol_w) WRITE8_MEMBER(ajax_state::k007232_extvol_w)
{ {
/* channel A volume (mono) */ /* channel A volume (mono) */
k007232_set_volume(m_k007232_2, 0, (data & 0x0f) * 0x11/2, (data & 0x0f) * 0x11/2); m_k007232_2->set_volume(0, (data & 0x0f) * 0x11/2, (data & 0x0f) * 0x11/2);
} }
WRITE8_MEMBER(ajax_state::volume_callback1) WRITE8_MEMBER(ajax_state::volume_callback1)
{ {
/* channel B volume/pan */ /* channel B volume/pan */
k007232_set_volume(m_k007232_2, 1, (data & 0x0f) * 0x11/2, (data >> 4) * 0x11/2); m_k007232_2->set_volume(1, (data & 0x0f) * 0x11/2, (data >> 4) * 0x11/2);
} }
static const k007232_interface k007232_interface_1 = static const k007232_interface k007232_interface_1 =

View File

@ -10,7 +10,6 @@ Preliminary driver by:
#include "emu.h" #include "emu.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */ #include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
#include "sound/k007232.h"
#include "sound/2151intf.h" #include "sound/2151intf.h"
#include "video/konicdev.h" #include "video/konicdev.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
@ -77,7 +76,7 @@ WRITE8_MEMBER(aliens_state::aliens_snd_bankswitch_w)
int bank_A = BIT(data, 1); int bank_A = BIT(data, 1);
int bank_B = BIT(data, 0); int bank_B = BIT(data, 0);
k007232_set_bank(m_k007232, bank_A, bank_B); m_k007232->set_bank(bank_A, bank_B);
} }
@ -126,7 +125,7 @@ static ADDRESS_MAP_START( aliens_sound_map, AS_PROGRAM, 8, aliens_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */ AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
AM_RANGE(0xe000, 0xe00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) AM_RANGE(0xe000, 0xe00d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
ADDRESS_MAP_END ADDRESS_MAP_END
@ -187,8 +186,8 @@ INPUT_PORTS_END
WRITE8_MEMBER(aliens_state::volume_callback) WRITE8_MEMBER(aliens_state::volume_callback)
{ {
k007232_set_volume(m_k007232, 0, (data & 0x0f) * 0x11, 0); m_k007232->set_volume(0, (data & 0x0f) * 0x11, 0);
k007232_set_volume(m_k007232, 1, 0, (data >> 4) * 0x11); m_k007232->set_volume(1, 0, (data >> 4) * 0x11);
} }
static const k007232_interface k007232_config = static const k007232_interface k007232_config =

View File

@ -16,7 +16,6 @@
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "cpu/m6809/m6809.h" #include "cpu/m6809/m6809.h"
#include "video/konicdev.h" #include "video/konicdev.h"
#include "sound/k007232.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "includes/bottom9.h" #include "includes/bottom9.h"
@ -146,11 +145,11 @@ WRITE8_MEMBER(bottom9_state::sound_bank_w)
bank_A = ((data >> 0) & 0x03); bank_A = ((data >> 0) & 0x03);
bank_B = ((data >> 2) & 0x03); bank_B = ((data >> 2) & 0x03);
k007232_set_bank(m_k007232_1, bank_A, bank_B); m_k007232_1->set_bank(bank_A, bank_B);
bank_A = ((data >> 4) & 0x03); bank_A = ((data >> 4) & 0x03);
bank_B = ((data >> 6) & 0x03); bank_B = ((data >> 6) & 0x03);
k007232_set_bank(m_k007232_2, bank_A, bank_B); m_k007232_2->set_bank(bank_A, bank_B);
} }
@ -178,8 +177,8 @@ static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, bottom9_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x9000, 0x9000) AM_WRITE(sound_bank_w) AM_RANGE(0x9000, 0x9000) AM_WRITE(sound_bank_w)
AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE_LEGACY("k007232_1", k007232_r, k007232_w) AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE("k007232_1", k007232_device, read, write)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232_2", k007232_r, k007232_w) AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232_2", k007232_device, read, write)
AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r)
AM_RANGE(0xf000, 0xf000) AM_WRITE(nmi_enable_w) AM_RANGE(0xf000, 0xf000) AM_WRITE(nmi_enable_w)
ADDRESS_MAP_END ADDRESS_MAP_END
@ -263,14 +262,14 @@ INPUT_PORTS_END
WRITE8_MEMBER(bottom9_state::volume_callback0) WRITE8_MEMBER(bottom9_state::volume_callback0)
{ {
k007232_set_volume(m_k007232_1, 0, (data >> 4) * 0x11, 0); m_k007232_1->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232_1, 1, 0, (data & 0x0f) * 0x11); m_k007232_1->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
WRITE8_MEMBER(bottom9_state::volume_callback1) WRITE8_MEMBER(bottom9_state::volume_callback1)
{ {
k007232_set_volume(m_k007232_2, 0, (data >> 4) * 0x11, 0); m_k007232_2->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232_2, 1, 0, (data & 0x0f) * 0x11); m_k007232_2->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
static const k007232_interface k007232_interface_1 = static const k007232_interface k007232_interface_1 =

View File

@ -17,7 +17,6 @@
#include "cpu/m6809/konami.h" #include "cpu/m6809/konami.h"
#include "video/konicdev.h" #include "video/konicdev.h"
#include "sound/2151intf.h" #include "sound/2151intf.h"
#include "sound/k007232.h"
#include "includes/chqflag.h" #include "includes/chqflag.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
@ -169,21 +168,21 @@ WRITE8_MEMBER(chqflag_state::k007232_bankswitch_w)
/* banks # for the 007232 (chip 1) */ /* banks # for the 007232 (chip 1) */
bank_A = ((data >> 4) & 0x03); bank_A = ((data >> 4) & 0x03);
bank_B = ((data >> 6) & 0x03); bank_B = ((data >> 6) & 0x03);
k007232_set_bank(m_k007232_1, bank_A, bank_B); m_k007232_1->set_bank(bank_A, bank_B);
/* banks # for the 007232 (chip 2) */ /* banks # for the 007232 (chip 2) */
bank_A = ((data >> 0) & 0x03); bank_A = ((data >> 0) & 0x03);
bank_B = ((data >> 2) & 0x03); bank_B = ((data >> 2) & 0x03);
k007232_set_bank(m_k007232_2, bank_A, bank_B); m_k007232_2->set_bank(bank_A, bank_B);
} }
static ADDRESS_MAP_START( chqflag_sound_map, AS_PROGRAM, 8, chqflag_state ) static ADDRESS_MAP_START( chqflag_sound_map, AS_PROGRAM, 8, chqflag_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM */ AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM */
AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */ AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */
AM_RANGE(0x9000, 0x9000) AM_WRITE(k007232_bankswitch_w) /* 007232 bankswitch */ AM_RANGE(0x9000, 0x9000) AM_WRITE(k007232_bankswitch_w) /* 007232 bankswitch */
AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE_LEGACY("k007232_1", k007232_r, k007232_w) /* 007232 (chip 1) */ AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE("k007232_1", k007232_device, read, write) /* 007232 (chip 1) */
AM_RANGE(0xa01c, 0xa01c) AM_WRITE(k007232_extvolume_w) /* extra volume, goes to the 007232 w/ A11 */ AM_RANGE(0xa01c, 0xa01c) AM_WRITE(k007232_extvolume_w) /* extra volume, goes to the 007232 w/ A11 */
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232_2", k007232_r, k007232_w) /* 007232 (chip 2) */ AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232_2", k007232_device, read, write) /* 007232 (chip 2) */
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */ AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */
AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch2_byte_r) /* engine sound volume */ AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch2_byte_r) /* engine sound volume */
@ -257,18 +256,18 @@ INPUT_PORTS_END
WRITE8_MEMBER(chqflag_state::volume_callback0) WRITE8_MEMBER(chqflag_state::volume_callback0)
{ {
k007232_set_volume(m_k007232_1, 0, (data & 0x0f) * 0x11, 0); m_k007232_1->set_volume(0, (data & 0x0f) * 0x11, 0);
k007232_set_volume(m_k007232_1, 1, 0, (data >> 4) * 0x11); m_k007232_1->set_volume(1, 0, (data >> 4) * 0x11);
} }
WRITE8_MEMBER(chqflag_state::k007232_extvolume_w) WRITE8_MEMBER(chqflag_state::k007232_extvolume_w)
{ {
k007232_set_volume(m_k007232_2, 1, (data & 0x0f) * 0x11/2, (data >> 4) * 0x11/2); m_k007232_2->set_volume(1, (data & 0x0f) * 0x11/2, (data >> 4) * 0x11/2);
} }
WRITE8_MEMBER(chqflag_state::volume_callback1) WRITE8_MEMBER(chqflag_state::volume_callback1)
{ {
k007232_set_volume(m_k007232_2, 0, (data & 0x0f) * 0x11/2, (data >> 4) * 0x11/2); m_k007232_2->set_volume(0, (data & 0x0f) * 0x11/2, (data >> 4) * 0x11/2);
} }
static const k007232_interface k007232_interface_1 = static const k007232_interface k007232_interface_1 =

View File

@ -16,7 +16,6 @@
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */ #include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
#include "video/konicdev.h" #include "video/konicdev.h"
#include "sound/2151intf.h" #include "sound/2151intf.h"
#include "sound/k007232.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "includes/crimfght.h" #include "includes/crimfght.h"
@ -49,7 +48,7 @@ WRITE8_MEMBER(crimfght_state::crimfght_snd_bankswitch_w)
int bank_A = BIT(data, 1); int bank_A = BIT(data, 1);
int bank_B = BIT(data, 0); int bank_B = BIT(data, 0);
k007232_set_bank(m_k007232, bank_A, bank_B ); m_k007232->set_bank(bank_A, bank_B );
} }
READ8_MEMBER(crimfght_state::k052109_051960_r) READ8_MEMBER(crimfght_state::k052109_051960_r)
@ -102,7 +101,7 @@ static ADDRESS_MAP_START( crimfght_sound_map, AS_PROGRAM, 8, crimfght_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */ AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */ AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */
AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
AM_RANGE(0xe000, 0xe00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) /* 007232 registers */ AM_RANGE(0xe000, 0xe00d) AM_DEVREADWRITE("k007232", k007232_device, read, write) /* 007232 registers */
ADDRESS_MAP_END ADDRESS_MAP_END
/*************************************************************************** /***************************************************************************
@ -222,8 +221,8 @@ INPUT_PORTS_END
WRITE8_MEMBER(crimfght_state::volume_callback) WRITE8_MEMBER(crimfght_state::volume_callback)
{ {
k007232_set_volume(m_k007232, 0, (data & 0x0f) * 0x11, 0); m_k007232->set_volume(0, (data & 0x0f) * 0x11, 0);
k007232_set_volume(m_k007232, 1, 0, (data >> 4) * 0x11); m_k007232->set_volume(1, 0, (data >> 4) * 0x11);
} }
static const k007232_interface k007232_config = static const k007232_interface k007232_config =

View File

@ -11,7 +11,6 @@
#include "emu.h" #include "emu.h"
#include "cpu/m6809/hd6309.h" #include "cpu/m6809/hd6309.h"
#include "sound/k007232.h"
#include "video/konicdev.h" #include "video/konicdev.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "includes/fastlane.h" #include "includes/fastlane.h"
@ -46,7 +45,7 @@ WRITE8_MEMBER(fastlane_state::fastlane_bankswitch_w)
membank("bank1")->set_entry((data & 0x0c) >> 2); membank("bank1")->set_entry((data & 0x0c) >> 2);
/* bit 4: bank # for the 007232 (chip 2) */ /* bit 4: bank # for the 007232 (chip 2) */
k007232_set_bank(m_k007232_2, 0 + ((data & 0x10) >> 4), 2 + ((data & 0x10) >> 4)); m_k007232_2->set_bank(0 + ((data & 0x10) >> 4), 2 + ((data & 0x10) >> 4));
/* other bits seems to be unused */ /* other bits seems to be unused */
} }
@ -56,22 +55,22 @@ WRITE8_MEMBER(fastlane_state::fastlane_bankswitch_w)
READ8_MEMBER(fastlane_state::fastlane_k1_k007232_r) READ8_MEMBER(fastlane_state::fastlane_k1_k007232_r)
{ {
return k007232_r(m_k007232_1, space, offset ^ 1); return m_k007232_1->read(space, offset ^ 1);
} }
WRITE8_MEMBER(fastlane_state::fastlane_k1_k007232_w) WRITE8_MEMBER(fastlane_state::fastlane_k1_k007232_w)
{ {
k007232_w(m_k007232_1, space, offset ^ 1, data); m_k007232_1->write(space, offset ^ 1, data);
} }
READ8_MEMBER(fastlane_state::fastlane_k2_k007232_r) READ8_MEMBER(fastlane_state::fastlane_k2_k007232_r)
{ {
return k007232_r(m_k007232_2, space, offset ^ 1); return m_k007232_2->read(space, offset ^ 1);
} }
WRITE8_MEMBER(fastlane_state::fastlane_k2_k007232_w) WRITE8_MEMBER(fastlane_state::fastlane_k2_k007232_w)
{ {
k007232_w(m_k007232_2, space, offset ^ 1, data); m_k007232_2->write(space, offset ^ 1, data);
} }
static ADDRESS_MAP_START( fastlane_map, AS_PROGRAM, 8, fastlane_state ) static ADDRESS_MAP_START( fastlane_map, AS_PROGRAM, 8, fastlane_state )
AM_RANGE(0x0000, 0x005f) AM_RAM_WRITE(k007121_registers_w) AM_SHARE("k007121_regs") /* 007121 registers */ AM_RANGE(0x0000, 0x005f) AM_RAM_WRITE(k007121_registers_w) AM_SHARE("k007121_regs") /* 007121 registers */
@ -177,14 +176,14 @@ GFXDECODE_END
WRITE8_MEMBER(fastlane_state::volume_callback0) WRITE8_MEMBER(fastlane_state::volume_callback0)
{ {
k007232_set_volume(m_k007232_1, 0, (data >> 4) * 0x11, 0); m_k007232_1->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232_1, 1, 0, (data & 0x0f) * 0x11); m_k007232_1->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
WRITE8_MEMBER(fastlane_state::volume_callback1) WRITE8_MEMBER(fastlane_state::volume_callback1)
{ {
k007232_set_volume(m_k007232_2, 0, (data >> 4) * 0x11, 0); m_k007232_2->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232_2, 1, 0, (data & 0x0f) * 0x11); m_k007232_2->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
static const k007232_interface k007232_interface_1 = static const k007232_interface k007232_interface_1 =

View File

@ -14,7 +14,6 @@
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "cpu/m6809/hd6309.h" #include "cpu/m6809/hd6309.h"
#include "sound/2151intf.h" #include "sound/2151intf.h"
#include "sound/k007232.h"
#include "video/konicdev.h" #include "video/konicdev.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "includes/flkatck.h" #include "includes/flkatck.h"
@ -108,7 +107,7 @@ static ADDRESS_MAP_START( flkatck_sound_map, AS_PROGRAM, 8, flkatck_state )
AM_RANGE(0x9004, 0x9004) AM_READNOP /* ??? */ AM_RANGE(0x9004, 0x9004) AM_READNOP /* ??? */
AM_RANGE(0x9006, 0x9006) AM_WRITENOP /* ??? */ AM_RANGE(0x9006, 0x9006) AM_WRITENOP /* ??? */
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) /* 007232 registers */ AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write) /* 007232 registers */
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */ AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */
ADDRESS_MAP_END ADDRESS_MAP_END
@ -179,8 +178,8 @@ GFXDECODE_END
WRITE8_MEMBER(flkatck_state::volume_callback0) WRITE8_MEMBER(flkatck_state::volume_callback0)
{ {
k007232_set_volume(m_k007232, 0, (data >> 4) * 0x11, 0); m_k007232->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232, 1, 0, (data & 0x0f) * 0x11); m_k007232->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
static const k007232_interface k007232_config = static const k007232_interface k007232_config =
@ -202,7 +201,7 @@ void flkatck_state::machine_start()
void flkatck_state::machine_reset() void flkatck_state::machine_reset()
{ {
k007232_set_bank(m_k007232, 0, 1); m_k007232->set_bank(0, 1);
m_irq_enabled = 0; m_irq_enabled = 0;
m_multiply_reg[0] = 0; m_multiply_reg[0] = 0;

View File

@ -12,7 +12,6 @@
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */ #include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
#include "video/konicdev.h" #include "video/konicdev.h"
#include "sound/2151intf.h" #include "sound/2151intf.h"
#include "sound/k007232.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "includes/gbusters.h" #include "includes/gbusters.h"
@ -102,7 +101,7 @@ WRITE8_MEMBER(gbusters_state::gbusters_snd_bankswitch_w)
{ {
int bank_B = BIT(data, 2); /* ?? */ int bank_B = BIT(data, 2); /* ?? */
int bank_A = BIT(data, 0); /* ?? */ int bank_A = BIT(data, 0); /* ?? */
k007232_set_bank(m_k007232, bank_A, bank_B ); m_k007232->set_bank(bank_A, bank_B );
#if 0 #if 0
{ {
@ -164,7 +163,7 @@ static ADDRESS_MAP_START( gbusters_sound_map, AS_PROGRAM, 8, gbusters_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM 878h01.rom */ AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM 878h01.rom */
AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */ AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) /* 007232 registers */ AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write) /* 007232 registers */
AM_RANGE(0xc001, 0xc001) AM_DEVREAD("ymsnd", ym2151_device, status_r) /* YM 2151 */ AM_RANGE(0xc001, 0xc001) AM_DEVREAD("ymsnd", ym2151_device, status_r) /* YM 2151 */
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM 2151 */ AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM 2151 */
AM_RANGE(0xf000, 0xf000) AM_WRITE(gbusters_snd_bankswitch_w) /* 007232 bankswitch? */ AM_RANGE(0xf000, 0xf000) AM_WRITE(gbusters_snd_bankswitch_w) /* 007232 bankswitch? */
@ -232,8 +231,8 @@ INPUT_PORTS_END
WRITE8_MEMBER(gbusters_state::volume_callback) WRITE8_MEMBER(gbusters_state::volume_callback)
{ {
k007232_set_volume(m_k007232, 0, (data >> 4) * 0x11, 0); m_k007232->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232, 1, 0, (data & 0x0f) * 0x11); m_k007232->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
static const k007232_interface k007232_config = static const k007232_interface k007232_config =

View File

@ -23,7 +23,6 @@
#include "cpu/m68000/m68000.h" #include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "sound/2151intf.h" #include "sound/2151intf.h"
#include "sound/k007232.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "includes/gradius3.h" #include "includes/gradius3.h"
@ -142,7 +141,7 @@ WRITE8_MEMBER(gradius3_state::sound_bank_w)
/* banks # for the 007232 (chip 1) */ /* banks # for the 007232 (chip 1) */
bank_A = ((data >> 0) & 0x03); bank_A = ((data >> 0) & 0x03);
bank_B = ((data >> 2) & 0x03); bank_B = ((data >> 2) & 0x03);
k007232_set_bank(m_k007232, bank_A, bank_B); m_k007232->set_bank(bank_A, bank_B);
} }
@ -185,7 +184,7 @@ static ADDRESS_MAP_START( gradius3_s_map, AS_PROGRAM, 8, gradius3_state )
AM_RANGE(0x0000, 0xefff) AM_ROM AM_RANGE(0x0000, 0xefff) AM_ROM
AM_RANGE(0xf000, 0xf000) AM_WRITE(sound_bank_w) /* 007232 bankswitch */ AM_RANGE(0xf000, 0xf000) AM_WRITE(sound_bank_w) /* 007232 bankswitch */
AM_RANGE(0xf010, 0xf010) AM_READ(soundlatch_byte_r) AM_RANGE(0xf010, 0xf010) AM_READ(soundlatch_byte_r)
AM_RANGE(0xf020, 0xf02d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) AM_RANGE(0xf020, 0xf02d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
AM_RANGE(0xf030, 0xf031) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) AM_RANGE(0xf030, 0xf031) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xf800, 0xffff) AM_RAM AM_RANGE(0xf800, 0xffff) AM_RAM
ADDRESS_MAP_END ADDRESS_MAP_END
@ -251,8 +250,8 @@ INPUT_PORTS_END
WRITE8_MEMBER(gradius3_state::volume_callback) WRITE8_MEMBER(gradius3_state::volume_callback)
{ {
k007232_set_volume(m_k007232, 0, (data >> 4) * 0x11, 0); m_k007232->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232, 1, 0, (data & 0x0f) * 0x11); m_k007232->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
static const k007232_interface k007232_config = static const k007232_interface k007232_config =

View File

@ -10,7 +10,6 @@
#include "cpu/m6809/konami.h" #include "cpu/m6809/konami.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "sound/3812intf.h" #include "sound/3812intf.h"
#include "sound/k007232.h"
#include "sound/k051649.h" #include "sound/k051649.h"
#include "video/konicdev.h" #include "video/konicdev.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
@ -67,7 +66,7 @@ WRITE8_MEMBER(hcastle_state::sound_bank_w)
{ {
int bank_A=(data&0x3); int bank_A=(data&0x3);
int bank_B=((data>>2)&0x3); int bank_B=((data>>2)&0x3);
k007232_set_bank(m_k007232, bank_A, bank_B ); m_k007232->set_bank(bank_A, bank_B );
} }
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, hcastle_state ) static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, hcastle_state )
@ -79,7 +78,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, hcastle_state )
AM_RANGE(0x988f, 0x988f) AM_DEVWRITE("k051649", k051649_device, k051649_keyonoff_w) AM_RANGE(0x988f, 0x988f) AM_DEVWRITE("k051649", k051649_device, k051649_keyonoff_w)
AM_RANGE(0x98e0, 0x98ff) AM_DEVREADWRITE("k051649", k051649_device, k051649_test_r, k051649_test_w) AM_RANGE(0x98e0, 0x98ff) AM_DEVREADWRITE("k051649", k051649_device, k051649_test_r, k051649_test_w)
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write) AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
AM_RANGE(0xc000, 0xc000) AM_WRITE(sound_bank_w) /* 7232 bankswitch */ AM_RANGE(0xc000, 0xc000) AM_WRITE(sound_bank_w) /* 7232 bankswitch */
AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r)
ADDRESS_MAP_END ADDRESS_MAP_END
@ -162,8 +161,8 @@ WRITE_LINE_MEMBER(hcastle_state::irqhandler)
WRITE8_MEMBER(hcastle_state::volume_callback) WRITE8_MEMBER(hcastle_state::volume_callback)
{ {
k007232_set_volume(m_k007232, 0, (data >> 4) * 0x11, 0); m_k007232->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232, 1, 0, (data & 0x0f) * 0x11); m_k007232->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
static const k007232_interface k007232_config = static const k007232_interface k007232_config =

View File

@ -26,7 +26,6 @@ Notes:
#include "video/konicdev.h" #include "video/konicdev.h"
#include "cpu/m6809/m6809.h" #include "cpu/m6809/m6809.h"
#include "sound/2151intf.h" #include "sound/2151intf.h"
#include "sound/k007232.h"
#include "sound/upd7759.h" #include "sound/upd7759.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "includes/mainevt.h" #include "includes/mainevt.h"
@ -107,7 +106,7 @@ WRITE8_MEMBER(mainevt_state::mainevt_sh_bankswitch_w)
/* bits 0-3 select the 007232 banks */ /* bits 0-3 select the 007232 banks */
bank_A = (data & 0x3); bank_A = (data & 0x3);
bank_B = ((data >> 2) & 0x3); bank_B = ((data >> 2) & 0x3);
k007232_set_bank(m_k007232, bank_A, bank_B); m_k007232->set_bank(bank_A, bank_B);
/* bits 4-5 select the UPD7759 bank */ /* bits 4-5 select the UPD7759 bank */
upd7759_set_bank_base(m_upd7759, ((data >> 4) & 0x03) * 0x20000); upd7759_set_bank_base(m_upd7759, ((data >> 4) & 0x03) * 0x20000);
@ -122,7 +121,7 @@ WRITE8_MEMBER(mainevt_state::dv_sh_bankswitch_w)
/* bits 0-3 select the 007232 banks */ /* bits 0-3 select the 007232 banks */
bank_A = (data & 0x3); bank_A = (data & 0x3);
bank_B = ((data >> 2) & 0x3); bank_B = ((data >> 2) & 0x3);
k007232_set_bank(m_k007232, bank_A, bank_B); m_k007232->set_bank(bank_A, bank_B);
} }
READ8_MEMBER(mainevt_state::k052109_051960_r) READ8_MEMBER(mainevt_state::k052109_051960_r)
@ -205,7 +204,7 @@ static ADDRESS_MAP_START( mainevt_sound_map, AS_PROGRAM, 8, mainevt_state )
AM_RANGE(0x8000, 0x83ff) AM_RAM AM_RANGE(0x8000, 0x83ff) AM_RAM
AM_RANGE(0x9000, 0x9000) AM_DEVWRITE_LEGACY("upd", upd7759_port_w) AM_RANGE(0x9000, 0x9000) AM_DEVWRITE_LEGACY("upd", upd7759_port_w)
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r,k007232_w) AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
AM_RANGE(0xd000, 0xd000) AM_READ(mainevt_sh_busy_r) AM_RANGE(0xd000, 0xd000) AM_READ(mainevt_sh_busy_r)
AM_RANGE(0xe000, 0xe000) AM_WRITE(mainevt_sh_irqcontrol_w) AM_RANGE(0xe000, 0xe000) AM_WRITE(mainevt_sh_irqcontrol_w)
AM_RANGE(0xf000, 0xf000) AM_WRITE(mainevt_sh_bankswitch_w) AM_RANGE(0xf000, 0xf000) AM_WRITE(mainevt_sh_bankswitch_w)
@ -215,7 +214,7 @@ static ADDRESS_MAP_START( devstors_sound_map, AS_PROGRAM, 8, mainevt_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x83ff) AM_RAM AM_RANGE(0x8000, 0x83ff) AM_RAM
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r,k007232_w) AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write) AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
AM_RANGE(0xe000, 0xe000) AM_WRITE(devstor_sh_irqcontrol_w) AM_RANGE(0xe000, 0xe000) AM_WRITE(devstor_sh_irqcontrol_w)
AM_RANGE(0xf000, 0xf000) AM_WRITE(dv_sh_bankswitch_w) AM_RANGE(0xf000, 0xf000) AM_WRITE(dv_sh_bankswitch_w)
@ -375,8 +374,8 @@ INPUT_PORTS_END
WRITE8_MEMBER(mainevt_state::volume_callback) WRITE8_MEMBER(mainevt_state::volume_callback)
{ {
k007232_set_volume(m_k007232, 0, (data >> 4) * 0x11, 0); m_k007232->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232, 1, 0, (data & 0x0f) * 0x11); m_k007232->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
static const k007232_interface k007232_config = static const k007232_interface k007232_config =

View File

@ -54,7 +54,6 @@ So this is the correct behavior of real hardware, not an emulation bug.
#include "sound/3812intf.h" #include "sound/3812intf.h"
#include "sound/vlm5030.h" #include "sound/vlm5030.h"
#include "sound/k005289.h" #include "sound/k005289.h"
#include "sound/k007232.h"
#include "sound/k051649.h" #include "sound/k051649.h"
#include "includes/nemesis.h" #include "includes/nemesis.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
@ -254,7 +253,7 @@ WRITE8_MEMBER(nemesis_state::city_sound_bank_w)
{ {
int bank_A = (data & 0x03); int bank_A = (data & 0x03);
int bank_B = ((data >> 2) & 0x03); int bank_B = ((data >> 2) & 0x03);
k007232_set_bank(m_k007232, bank_A, bank_B); m_k007232->set_bank(bank_A, bank_B);
} }
@ -541,7 +540,7 @@ static ADDRESS_MAP_START( sal_sound_map, AS_PROGRAM, 8, nemesis_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w) AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w)
AM_RANGE(0xe000, 0xe000) AM_READ(wd_r) /* watchdog?? */ AM_RANGE(0xe000, 0xe000) AM_READ(wd_r) /* watchdog?? */
@ -552,7 +551,7 @@ static ADDRESS_MAP_START( blkpnthr_sound_map, AS_PROGRAM, 8, nemesis_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xe000, 0xe000) AM_READ(wd_r) /* watchdog?? */ AM_RANGE(0xe000, 0xe000) AM_READ(wd_r) /* watchdog?? */
ADDRESS_MAP_END ADDRESS_MAP_END
@ -566,7 +565,7 @@ static ADDRESS_MAP_START( city_sound_map, AS_PROGRAM, 8, nemesis_state )
AM_RANGE(0x988f, 0x988f) AM_DEVWRITE("k051649", k051649_device, k051649_keyonoff_w) AM_RANGE(0x988f, 0x988f) AM_DEVWRITE("k051649", k051649_device, k051649_keyonoff_w)
AM_RANGE(0x98e0, 0x98ff) AM_DEVREADWRITE("k051649", k051649_device, k051649_test_r, k051649_test_w) AM_RANGE(0x98e0, 0x98ff) AM_DEVREADWRITE("k051649", k051649_device, k051649_test_r, k051649_test_w)
AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write) AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
AM_RANGE(0xc000, 0xc000) AM_WRITE(city_sound_bank_w) /* 7232 bankswitch */ AM_RANGE(0xc000, 0xc000) AM_WRITE(city_sound_bank_w) /* 7232 bankswitch */
AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r)
ADDRESS_MAP_END ADDRESS_MAP_END
@ -1492,8 +1491,8 @@ WRITE_LINE_MEMBER(nemesis_state::sound_irq)
WRITE8_MEMBER(nemesis_state::volume_callback) WRITE8_MEMBER(nemesis_state::volume_callback)
{ {
k007232_set_volume(m_k007232, 0, (data >> 4) * 0x11, 0); m_k007232->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232, 1, 0, (data & 0x0f) * 0x11); m_k007232->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
static const k007232_interface k007232_config = static const k007232_interface k007232_config =

View File

@ -22,7 +22,6 @@
#include "cpu/m6809/m6809.h" #include "cpu/m6809/m6809.h"
#include "video/konicdev.h" #include "video/konicdev.h"
#include "sound/3812intf.h" #include "sound/3812intf.h"
#include "sound/k007232.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "includes/spy.h" #include "includes/spy.h"
@ -336,11 +335,11 @@ WRITE8_MEMBER(spy_state::sound_bank_w)
bank_A = (data >> 0) & 0x03; bank_A = (data >> 0) & 0x03;
bank_B = (data >> 2) & 0x03; bank_B = (data >> 2) & 0x03;
k007232_set_bank(m_k007232_1, bank_A, bank_B); m_k007232_1->set_bank(bank_A, bank_B);
bank_A = (data >> 4) & 0x03; bank_A = (data >> 4) & 0x03;
bank_B = (data >> 6) & 0x03; bank_B = (data >> 6) & 0x03;
k007232_set_bank(m_k007232_2, bank_A, bank_B); m_k007232_2->set_bank(bank_A, bank_B);
} }
@ -391,8 +390,8 @@ static ADDRESS_MAP_START( spy_sound_map, AS_PROGRAM, 8, spy_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x9000, 0x9000) AM_WRITE(sound_bank_w) AM_RANGE(0x9000, 0x9000) AM_WRITE(sound_bank_w)
AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE_LEGACY("k007232_1", k007232_r, k007232_w) AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE("k007232_1", k007232_device, read, write)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232_2", k007232_r, k007232_w) AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232_2", k007232_device, read, write)
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write) AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write)
AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r)
ADDRESS_MAP_END ADDRESS_MAP_END
@ -449,8 +448,8 @@ INPUT_PORTS_END
WRITE8_MEMBER(spy_state::volume_callback0) WRITE8_MEMBER(spy_state::volume_callback0)
{ {
k007232_set_volume(m_k007232_1, 0, (data >> 4) * 0x11, 0); m_k007232_1->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232_1, 1, 0, (data & 0x0f) * 0x11); m_k007232_1->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
static const k007232_interface spy_k007232_interface_1 = static const k007232_interface spy_k007232_interface_1 =
@ -460,8 +459,8 @@ static const k007232_interface spy_k007232_interface_1 =
WRITE8_MEMBER(spy_state::volume_callback1) WRITE8_MEMBER(spy_state::volume_callback1)
{ {
k007232_set_volume(m_k007232_2, 0, (data >> 4) * 0x11, 0); m_k007232_2->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232_2, 1, 0, (data & 0x0f) * 0x11); m_k007232_2->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
static const k007232_interface spy_k007232_interface_2 = static const k007232_interface spy_k007232_interface_2 =

View File

@ -17,7 +17,6 @@
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */ #include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
#include "video/konicdev.h" #include "video/konicdev.h"
#include "sound/2151intf.h" #include "sound/2151intf.h"
#include "sound/k007232.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "includes/thunderx.h" #include "includes/thunderx.h"
@ -364,7 +363,7 @@ WRITE8_MEMBER(thunderx_state::scontra_snd_bankswitch_w)
int bank_A = (data & 0x03); int bank_A = (data & 0x03);
int bank_B = ((data >> 2) & 0x03); int bank_B = ((data >> 2) & 0x03);
k007232_set_bank(m_k007232, bank_A, bank_B); m_k007232->set_bank(bank_A, bank_B);
} }
READ8_MEMBER(thunderx_state::k052109_051960_r) READ8_MEMBER(thunderx_state::k052109_051960_r)
@ -438,7 +437,7 @@ static ADDRESS_MAP_START( scontra_sound_map, AS_PROGRAM, 8, thunderx_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM */ AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM */
AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */ AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) /* 007232 registers */ AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write) /* 007232 registers */
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */ AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */
AM_RANGE(0xf000, 0xf000) AM_WRITE(scontra_snd_bankswitch_w) /* 007232 bank select */ AM_RANGE(0xf000, 0xf000) AM_WRITE(scontra_snd_bankswitch_w) /* 007232 bank select */
ADDRESS_MAP_END ADDRESS_MAP_END
@ -574,8 +573,8 @@ INPUT_PORTS_END
WRITE8_MEMBER(thunderx_state::volume_callback) WRITE8_MEMBER(thunderx_state::volume_callback)
{ {
k007232_set_volume(m_k007232, 0, (data >> 4) * 0x11, 0); m_k007232->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232, 1, 0, (data & 0x0f) * 0x11); m_k007232->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
static const k007232_interface k007232_config = static const k007232_interface k007232_config =

View File

@ -74,7 +74,6 @@ Updates:
#include "sound/samples.h" #include "sound/samples.h"
#include "sound/k053260.h" #include "sound/k053260.h"
#include "sound/k054539.h" #include "sound/k054539.h"
#include "sound/k007232.h"
#include "sound/upd7759.h" #include "sound/upd7759.h"
#include "machine/nvram.h" #include "machine/nvram.h"
#include "includes/tmnt.h" #include "includes/tmnt.h"
@ -1081,7 +1080,7 @@ static ADDRESS_MAP_START( mia_audio_map, AS_PROGRAM, 8, tmnt_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
ADDRESS_MAP_END ADDRESS_MAP_END
@ -1091,7 +1090,7 @@ static ADDRESS_MAP_START( tmnt_audio_map, AS_PROGRAM, 8, tmnt_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x9000, 0x9000) AM_READWRITE(tmnt_sres_r, tmnt_sres_w) /* title music & UPD7759C reset */ AM_RANGE(0x9000, 0x9000) AM_READWRITE(tmnt_sres_r, tmnt_sres_w) /* title music & UPD7759C reset */
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("upd", upd7759_port_w) AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("upd", upd7759_port_w)
AM_RANGE(0xe000, 0xe000) AM_WRITE(tmnt_upd_start_w) AM_RANGE(0xe000, 0xe000) AM_WRITE(tmnt_upd_start_w)
@ -2015,8 +2014,8 @@ INPUT_PORTS_END
WRITE8_MEMBER(tmnt_state::volume_callback) WRITE8_MEMBER(tmnt_state::volume_callback)
{ {
k007232_set_volume(m_k007232, 0, (data >> 4) * 0x11, 0); m_k007232->set_volume(0, (data >> 4) * 0x11, 0);
k007232_set_volume(m_k007232, 1, 0, (data & 0x0f) * 0x11); m_k007232->set_volume(1, 0, (data & 0x0f) * 0x11);
} }
static const k007232_interface k007232_config = static const k007232_interface k007232_config =

View File

@ -47,7 +47,6 @@ Known Issues:
#include "cpu/m68000/m68000.h" #include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "sound/2151intf.h" #include "sound/2151intf.h"
#include "sound/k007232.h"
#include "sound/upd7759.h" #include "sound/upd7759.h"
#include "machine/nvram.h" #include "machine/nvram.h"
#include "includes/twin16.h" #include "includes/twin16.h"
@ -224,7 +223,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, twin16_state )
AM_RANGE(0x8000, 0x8fff) AM_RAM AM_RANGE(0x8000, 0x8fff) AM_RAM
AM_RANGE(0x9000, 0x9000) AM_WRITE(twin16_upd_reset_w) AM_RANGE(0x9000, 0x9000) AM_WRITE(twin16_upd_reset_w)
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("upd", upd7759_port_w) AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("upd", upd7759_port_w)
AM_RANGE(0xe000, 0xe000) AM_WRITE(twin16_upd_start_w) AM_RANGE(0xe000, 0xe000) AM_WRITE(twin16_upd_start_w)
@ -670,8 +669,8 @@ GFXDECODE_END
WRITE8_MEMBER(twin16_state::volume_callback) WRITE8_MEMBER(twin16_state::volume_callback)
{ {
k007232_set_volume(m_k007232,0,(data >> 4) * 0x11,0); m_k007232->set_volume(0,(data >> 4) * 0x11,0);
k007232_set_volume(m_k007232,1,0,(data & 0x0f) * 0x11); m_k007232->set_volume(1,0,(data & 0x0f) * 0x11);
} }
static const k007232_interface k007232_config = static const k007232_interface k007232_config =

View File

@ -263,7 +263,6 @@ TODO:
#include "video/konicdev.h" #include "video/konicdev.h"
#include "cpu/m6809/m6809.h" #include "cpu/m6809/m6809.h"
#include "sound/2151intf.h" #include "sound/2151intf.h"
#include "sound/k007232.h"
#include "wecleman.lh" #include "wecleman.lh"
#include "includes/wecleman.h" #include "includes/wecleman.h"
@ -617,7 +616,7 @@ WRITE8_MEMBER(wecleman_state::multiply_w)
WRITE8_MEMBER(wecleman_state::wecleman_K00723216_bank_w) WRITE8_MEMBER(wecleman_state::wecleman_K00723216_bank_w)
{ {
k007232_set_bank(m_k007232, 0, ~data&1 ); //* (wecleman062gre) m_k007232->set_bank(0, ~data&1 ); //* (wecleman062gre)
} }
static ADDRESS_MAP_START( wecleman_sound_map, AS_PROGRAM, 8, wecleman_state ) static ADDRESS_MAP_START( wecleman_sound_map, AS_PROGRAM, 8, wecleman_state )
@ -628,7 +627,7 @@ static ADDRESS_MAP_START( wecleman_sound_map, AS_PROGRAM, 8, wecleman_state )
AM_RANGE(0x9000, 0x9001) AM_WRITE(multiply_w) // Protection AM_RANGE(0x9000, 0x9001) AM_WRITE(multiply_w) // Protection
AM_RANGE(0x9006, 0x9006) AM_WRITENOP // ? AM_RANGE(0x9006, 0x9006) AM_WRITENOP // ?
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) // From main CPU AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) // From main CPU
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) // K007232 (Reading offset 5/b triggers the sample) AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write) // K007232 (Reading offset 5/b triggers the sample)
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xf000, 0xf000) AM_WRITE(wecleman_K00723216_bank_w) // Samples banking AM_RANGE(0xf000, 0xf000) AM_WRITE(wecleman_K00723216_bank_w) // Samples banking
ADDRESS_MAP_END ADDRESS_MAP_END
@ -650,13 +649,8 @@ WRITE16_MEMBER(wecleman_state::hotchase_soundlatch_w)
WRITE8_MEMBER(wecleman_state::hotchase_sound_control_w) WRITE8_MEMBER(wecleman_state::hotchase_sound_control_w)
{ {
k007232_device *sound[3];
// int reg[8]; // int reg[8];
sound[0] = m_k007232_1;
sound[1] = m_k007232_2;
sound[2] = m_k007232_3;
// reg[offset] = data; // reg[offset] = data;
@ -673,7 +667,9 @@ WRITE8_MEMBER(wecleman_state::hotchase_sound_control_w)
++------ chip select ( 0:chip 1, 1:chip2, 2:chip3) ++------ chip select ( 0:chip 1, 1:chip2, 2:chip3)
data&0x0f left volume (data>>4)&0x0f right volume data&0x0f left volume (data>>4)&0x0f right volume
*/ */
k007232_set_volume( sound[offset>>1], offset&1, (data&0x0f) * 0x08, (data>>4) * 0x08 ); m_k007232_1->set_volume( offset&1, (data&0x0f) * 0x08, (data>>4) * 0x08 );
m_k007232_2->set_volume( offset&1, (data&0x0f) * 0x08, (data>>4) * 0x08 );
m_k007232_3->set_volume( offset&1, (data&0x0f) * 0x08, (data>>4) * 0x08 );
break; break;
case 0x06: /* Bankswitch for chips 0 & 1 */ case 0x06: /* Bankswitch for chips 0 & 1 */
@ -685,8 +681,8 @@ WRITE8_MEMBER(wecleman_state::hotchase_sound_control_w)
// bit 6: chip 2 - ch0 ? // bit 6: chip 2 - ch0 ?
// bit 7: chip 2 - ch1 ? // bit 7: chip 2 - ch1 ?
k007232_set_bank( sound[0], bank0_a, bank0_b ); m_k007232_1->set_bank( bank0_a, bank0_b );
k007232_set_bank( sound[1], bank1_a, bank1_b ); m_k007232_2->set_bank( bank1_a, bank1_b );
} }
break; break;
@ -695,7 +691,7 @@ WRITE8_MEMBER(wecleman_state::hotchase_sound_control_w)
int bank2_a = (data >> 0) & 7; int bank2_a = (data >> 0) & 7;
int bank2_b = (data >> 3) & 7; int bank2_b = (data >> 3) & 7;
k007232_set_bank( sound[2], bank2_a, bank2_b ); m_k007232_3->set_bank( bank2_a, bank2_b );
} }
break; break;
} }
@ -705,32 +701,32 @@ WRITE8_MEMBER(wecleman_state::hotchase_sound_control_w)
even and odd register are mapped swapped */ even and odd register are mapped swapped */
READ8_MEMBER(wecleman_state::hotchase_1_k007232_r) READ8_MEMBER(wecleman_state::hotchase_1_k007232_r)
{ {
return k007232_r(m_k007232_1, space, offset ^ 1); return m_k007232_1->read(space, offset ^ 1);
} }
WRITE8_MEMBER(wecleman_state::hotchase_1_k007232_w) WRITE8_MEMBER(wecleman_state::hotchase_1_k007232_w)
{ {
k007232_w(m_k007232_1, space, offset ^ 1, data); m_k007232_1->write(space, offset ^ 1, data);
} }
READ8_MEMBER(wecleman_state::hotchase_2_k007232_r) READ8_MEMBER(wecleman_state::hotchase_2_k007232_r)
{ {
return k007232_r(m_k007232_2, space, offset ^ 1); return m_k007232_2->read(space, offset ^ 1);
} }
WRITE8_MEMBER(wecleman_state::hotchase_2_k007232_w) WRITE8_MEMBER(wecleman_state::hotchase_2_k007232_w)
{ {
k007232_w(m_k007232_2, space, offset ^ 1, data); m_k007232_2->write(space, offset ^ 1, data);
} }
READ8_MEMBER(wecleman_state::hotchase_3_k007232_r) READ8_MEMBER(wecleman_state::hotchase_3_k007232_r)
{ {
return k007232_r(m_k007232_3, space, offset ^ 1); return m_k007232_3->read(space, offset ^ 1);
} }
WRITE8_MEMBER(wecleman_state::hotchase_3_k007232_w) WRITE8_MEMBER(wecleman_state::hotchase_3_k007232_w)
{ {
k007232_w(m_k007232_3, space, offset ^ 1, data); m_k007232_3->write(space, offset ^ 1, data);
} }
static ADDRESS_MAP_START( hotchase_sound_map, AS_PROGRAM, 8, wecleman_state ) static ADDRESS_MAP_START( hotchase_sound_map, AS_PROGRAM, 8, wecleman_state )
@ -1040,7 +1036,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(wecleman_state::hotchase_scanline)
MACHINE_RESET_MEMBER(wecleman_state,wecleman) MACHINE_RESET_MEMBER(wecleman_state,wecleman)
{ {
k007232_set_bank( m_k007232, 0, 1 ); m_k007232->set_bank( 0, 1 );
} }
static MACHINE_CONFIG_START( wecleman, wecleman_state ) static MACHINE_CONFIG_START( wecleman, wecleman_state )

View File

@ -3,7 +3,6 @@
Bishi Bashi Champ Mini Game Senshuken Bishi Bashi Champ Mini Game Senshuken
*************************************************************************/ *************************************************************************/
#include "sound/k007232.h"
#define CPU_CLOCK (XTAL_24MHz / 2) /* 68000 clock */ #define CPU_CLOCK (XTAL_24MHz / 2) /* 68000 clock */
#define SOUND_CLOCK XTAL_16_9344MHz /* YMZ280 clock */ #define SOUND_CLOCK XTAL_16_9344MHz /* YMZ280 clock */
@ -15,7 +14,6 @@ public:
: driver_device(mconfig, type, tag), : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"), m_audiocpu(*this, "audiocpu"),
m_k007232(*this, "k007232"),
m_k056832(*this, "k056832"), m_k056832(*this, "k056832"),
m_k054338(*this, "k054338"), m_k054338(*this, "k054338"),
m_k055555(*this, "k055555") { } m_k055555(*this, "k055555") { }
@ -34,7 +32,6 @@ public:
/* devices */ /* devices */
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu; optional_device<cpu_device> m_audiocpu;
optional_device<k007232_device> m_k007232;
required_device<k056832_device> m_k056832; required_device<k056832_device> m_k056832;
required_device<k054338_device> m_k054338; required_device<k054338_device> m_k054338;
required_device<k055555_device> m_k055555; required_device<k055555_device> m_k055555;