made some of sound devices use device callbacks instead of function callbacks part 2 (nw)

This commit is contained in:
Miodrag Milanovic 2013-03-29 09:56:02 +00:00
parent 266a4643f5
commit 46587ba913
64 changed files with 197 additions and 193 deletions

View File

@ -170,7 +170,7 @@ struct aica_state
unsigned char *AICARAM;
UINT32 AICARAM_LENGTH, RAM_MASK, RAM_MASK16;
char Master;
void (*IntARMCB)(device_t *device, int irq);
devcb_resolved_write_line IntARMCB;
sound_stream * stream;
INT32 *buffertmpl, *buffertmpr;
@ -252,7 +252,7 @@ static void CheckPendingIRQ(aica_state *AICA)
if(AICA->MidiW!=AICA->MidiR)
{
AICA->IRQL = AICA->IrqMidi;
AICA->IntARMCB(AICA->device, 1);
AICA->IntARMCB(1);
return;
}
if(!pend)
@ -261,21 +261,21 @@ static void CheckPendingIRQ(aica_state *AICA)
if(en&0x40)
{
AICA->IRQL = AICA->IrqTimA;
AICA->IntARMCB(AICA->device, 1);
AICA->IntARMCB(1);
return;
}
if(pend&0x80)
if(en&0x80)
{
AICA->IRQL = AICA->IrqTimBC;
AICA->IntARMCB(AICA->device, 1);
AICA->IntARMCB(1);
return;
}
if(pend&0x100)
if(en&0x100)
{
AICA->IRQL = AICA->IrqTimBC;
AICA->IntARMCB(AICA->device, 1);
AICA->IntARMCB(1);
return;
}
}
@ -832,7 +832,7 @@ static void AICA_UpdateRegR(aica_state *AICA, address_space &space, int reg)
unsigned short v=AICA->udata.data[0x8/2];
v&=0xff00;
v|=AICA->MidiStack[AICA->MidiR];
AICA->IntARMCB(AICA->device, 0); // cancel the IRQ
AICA->IntARMCB(0); // cancel the IRQ
if(AICA->MidiR!=AICA->MidiW)
{
++AICA->MidiR;
@ -930,7 +930,7 @@ static void AICA_w16(aica_state *AICA,address_space &space,unsigned int addr,uns
if (val)
{
AICA->IntARMCB(AICA->device, 0);
AICA->IntARMCB(0);
}
}
}
@ -1279,7 +1279,7 @@ static DEVICE_START( aica )
// set up the IRQ callbacks
{
AICA->IntARMCB = intf->irq_callback;
AICA->IntARMCB.resolve(intf->irq_callback,*device);
AICA->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, AICA, AICA_Update);
}

View File

@ -12,7 +12,7 @@ struct aica_interface
{
int master;
int roffset; /* offset in the region */
void (*irq_callback)(device_t *device, int state); /* irq callback */
devcb_write_line irq_callback; /* irq callback */
};
void aica_set_ram_base(device_t *device, void *base, int size);

View File

@ -174,8 +174,8 @@ struct es5506_state
UINT32 write_latch; /* currently accumulated data for write */
UINT32 read_latch; /* currently accumulated data for read */
UINT32 master_clock; /* master clock frequency */
void (*irq_callback)(device_t *, int); /* IRQ callback */
UINT16 (*port_read)(device_t *); /* input port read */
devcb_resolved_write_line irq_callback; /* IRQ callback */
devcb_resolved_read16 port_read; /* input port read */
UINT8 current_page; /* current register page */
UINT8 active_voices; /* number of active voices */
@ -227,8 +227,8 @@ static FILE *eslog;
static void update_irq_state(es5506_state *chip)
{
/* ES5505/6 irq line has been set high - inform the host */
if (chip->irq_callback)
(*chip->irq_callback)(chip->device, 1); /* IRQB set high */
if (!chip->irq_callback.isnull())
chip->irq_callback(1); /* IRQB set high */
}
static void update_internal_irq_state(es5506_state *chip)
@ -244,8 +244,8 @@ static void update_internal_irq_state(es5506_state *chip)
chip->irqv=0x80;
if (chip->irq_callback)
(*chip->irq_callback)(chip->device, 0); /* IRQB set low */
if (!chip->irq_callback.isnull())
chip->irq_callback(0); /* IRQB set low */
}
/**********************************************************************************************
@ -920,8 +920,8 @@ static void es5506_start_common(device_t *device, const void *config, device_typ
/* initialize the rest of the structure */
chip->device = device;
chip->master_clock = device->clock();
chip->irq_callback = intf->irq_callback;
chip->port_read = intf->read_port;
chip->irq_callback.resolve(intf->irq_callback,*device);
chip->port_read.resolve(intf->read_port,*device);
chip->irqv = 0x80;
/* compute the tables */
@ -1392,8 +1392,8 @@ INLINE UINT32 es5506_reg_read_low(es5506_state *chip, es5506_voice *voice, offs_
break;
case 0x68/8: /* PAR */
if (chip->port_read)
result = (*chip->port_read)(chip->device);
if (!chip->port_read.isnull())
result = chip->port_read(0);
break;
case 0x70/8: /* IRQV */
@ -1468,8 +1468,8 @@ INLINE UINT32 es5506_reg_read_high(es5506_state *chip, es5506_voice *voice, offs
break;
case 0x68/8: /* PAR */
if (chip->port_read)
result = (*chip->port_read)(chip->device);
if (!chip->port_read.isnull())
result = chip->port_read(0);
break;
case 0x70/8: /* IRQV */
@ -1491,8 +1491,8 @@ INLINE UINT32 es5506_reg_read_test(es5506_state *chip, es5506_voice *voice, offs
switch (offset)
{
case 0x68/8: /* PAR */
if (chip->port_read)
result = (*chip->port_read)(chip->device);
if (!chip->port_read.isnull())
result = chip->port_read(0);
break;
case 0x70/8: /* IRQV */
@ -2081,8 +2081,8 @@ INLINE UINT16 es5505_reg_read_test(es5506_state *chip, es5506_voice *voice, offs
break;
case 0x09: /* PAR */
if (chip->port_read)
result = (*chip->port_read)(chip->device);
if (!chip->port_read.isnull())
result = chip->port_read(0);
break;
case 0x0f: /* PAGE */

View File

@ -16,8 +16,8 @@ struct es5505_interface
{
const char * region0; /* memory region where the sample ROM lives */
const char * region1; /* memory region where the sample ROM lives */
void (*irq_callback)(device_t *device, int state); /* irq callback */
UINT16 (*read_port)(device_t *device); /* input port read */
devcb_write_line irq_callback; /* irq callback */
devcb_read16 read_port; /* input port read */
};
DECLARE_READ16_DEVICE_HANDLER( es5505_r );
@ -58,8 +58,8 @@ struct es5506_interface
const char * region1; /* memory region where the sample ROM lives */
const char * region2; /* memory region where the sample ROM lives */
const char * region3; /* memory region where the sample ROM lives */
void (*irq_callback)(device_t *device, int state); /* irq callback */
UINT16 (*read_port)(device_t *device); /* input port read */
devcb_write_line irq_callback; /* irq callback */
devcb_read16 read_port; /* input port read */
};
DECLARE_READ8_DEVICE_HANDLER( es5506_r );

View File

@ -48,6 +48,7 @@ struct KDAC_A_PCM
sound_stream * stream;
const k007232_interface *intf;
UINT32 fncode[0x200];
devcb_resolved_write8 portwritehandler;
};
@ -300,7 +301,7 @@ static STREAM_UPDATE( KDAC_A_update )
/************************************************/
static DEVICE_START( k007232 )
{
static const k007232_interface defintrf = { 0 };
static const k007232_interface defintrf = { DEVCB_NULL };
int i;
KDAC_A_PCM *info = get_safe_token(device);
@ -314,6 +315,8 @@ static DEVICE_START( k007232 )
info->clock = device->clock();
info->portwritehandler.resolve(info->intf->portwritehandler,*device);
for( i = 0; i < KDAC_A_PCM_MAX; i++ )
{
info->start[i] = 0;
@ -348,7 +351,7 @@ WRITE8_DEVICE_HANDLER( k007232_w )
if (r == 0x0c){
/* external port, usually volume control */
if (info->intf->portwritehandler) (*info->intf->portwritehandler)(device,v);
if (!info->portwritehandler.isnull()) info->portwritehandler(0,v);
return;
}
else if( r == 0x0d ){

View File

@ -11,7 +11,7 @@
struct k007232_interface
{
void (*portwritehandler)(device_t *, int);
devcb_write8 portwritehandler;
};
DECLARE_WRITE8_DEVICE_HANDLER( k007232_w );

View File

@ -192,7 +192,7 @@ struct scsp_state
unsigned char *SCSPRAM;
UINT32 SCSPRAM_LENGTH;
char Master;
void (*Int68kCB)(device_t *device, int irq);
devcb_resolved_write_line Int68kCB;
sound_stream * stream;
INT32 *buffertmpl,*buffertmpr;
@ -286,30 +286,30 @@ static void CheckPendingIRQ(scsp_state *scsp)
if(pend&0x40)
if(en&0x40)
{
scsp->Int68kCB(scsp->device, scsp->IrqTimA);
scsp->Int68kCB(scsp->IrqTimA);
return;
}
if(pend&0x80)
if(en&0x80)
{
scsp->Int68kCB(scsp->device, scsp->IrqTimBC);
scsp->Int68kCB(scsp->IrqTimBC);
return;
}
if(pend&0x100)
if(en&0x100)
{
scsp->Int68kCB(scsp->device, scsp->IrqTimBC);
scsp->Int68kCB(scsp->IrqTimBC);
return;
}
if(pend&8)
if (en&8)
{
scsp->Int68kCB(scsp->device, scsp->IrqMidi);
scsp->Int68kCB(scsp->IrqMidi);
scsp->udata.data[0x20/2] &= ~8;
return;
}
scsp->Int68kCB(scsp->device, 0);
scsp->Int68kCB(0);
}
static void MainCheckPendingIRQ(scsp_state *scsp, UINT16 irq_type)
@ -328,15 +328,15 @@ static void ResetInterrupts(scsp_state *scsp)
if (reset & 0x40)
{
scsp->Int68kCB(scsp->device, -scsp->IrqTimA);
scsp->Int68kCB(-scsp->IrqTimA);
}
if (reset & 0x180)
{
scsp->Int68kCB(scsp->device, -scsp->IrqTimBC);
scsp->Int68kCB(-scsp->IrqTimBC);
}
if (reset & 0x8)
{
scsp->Int68kCB(scsp->device, -scsp->IrqMidi);
scsp->Int68kCB(-scsp->IrqMidi);
}
CheckPendingIRQ(scsp);
@ -899,7 +899,7 @@ static void SCSP_UpdateRegR(scsp_state *scsp, address_space &space, int reg)
unsigned short v=scsp->udata.data[0x5/2];
v&=0xff00;
v|=scsp->MidiStack[scsp->MidiR];
scsp->Int68kCB(scsp->device, -scsp->IrqMidi); // cancel the IRQ
scsp->Int68kCB(-scsp->IrqMidi); // cancel the IRQ
logerror("Read %x from SCSP MIDI\n", v);
if(scsp->MidiR!=scsp->MidiW)
{
@ -1412,7 +1412,7 @@ static DEVICE_START( scsp )
// set up the IRQ callbacks
{
scsp->Int68kCB = intf->irq_callback;
scsp->Int68kCB.resolve(intf->irq_callback,*device);
scsp->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, scsp, SCSP_Update);
}

View File

@ -12,7 +12,7 @@
struct scsp_interface
{
int roffset; /* offset in the region */
void (*irq_callback)(device_t *device, int state); /* irq callback */
devcb_write_line irq_callback; /* irq callback */
devcb_write_line main_irq;
};

View File

@ -107,7 +107,7 @@ struct YMF271Chip
const UINT8 *rom;
devcb_resolved_read8 ext_mem_read;
devcb_resolved_write8 ext_mem_write;
void (*irq_callback)(device_t *, int);
devcb_resolved_write_line irq_callback;
UINT32 clock;
sound_stream * stream;
@ -1385,7 +1385,7 @@ static TIMER_CALLBACK( ymf271_timer_a_tick )
if (chip->enable & 4)
{
chip->irqstate |= 1;
if (chip->irq_callback) chip->irq_callback(chip->device, 1);
if (!chip->irq_callback.isnull()) chip->irq_callback(1);
}
}
@ -1398,7 +1398,7 @@ static TIMER_CALLBACK( ymf271_timer_b_tick )
if (chip->enable & 8)
{
chip->irqstate |= 2;
if (chip->irq_callback) chip->irq_callback(chip->device, 1);
if (!chip->irq_callback.isnull()) chip->irq_callback(1);
}
}
@ -1484,7 +1484,7 @@ static void ymf271_write_timer(YMF271Chip *chip, int data)
chip->status &= ~1;
chip->timerAVal |= 0x300;
if (chip->irq_callback) chip->irq_callback(chip->device, 0);
if (!chip->irq_callback.isnull()) chip->irq_callback(0);
period = attotime::from_hz(chip->clock) * (384 * 4 * (1024 - chip->timerAVal));
@ -1495,7 +1495,7 @@ static void ymf271_write_timer(YMF271Chip *chip, int data)
chip->irqstate &= ~2;
chip->status &= ~2;
if (chip->irq_callback) chip->irq_callback(chip->device, 0);
if (!chip->irq_callback.isnull()) chip->irq_callback(0);
period = attotime::from_hz(chip->clock) * (384 * 16 * (256 - chip->timerBVal));
@ -1752,13 +1752,13 @@ static void init_state(YMF271Chip *chip, device_t *device)
device->save_item(NAME(chip->ext_read));
}
static void ymf271_init(device_t *device, YMF271Chip *chip, UINT8 *rom, void (*cb)(device_t *,int), const devcb_read8 *ext_read, const devcb_write8 *ext_write)
static void ymf271_init(device_t *device, YMF271Chip *chip, UINT8 *rom, const devcb_write_line *cb, const devcb_read8 *ext_read, const devcb_write8 *ext_write)
{
chip->timA = device->machine().scheduler().timer_alloc(FUNC(ymf271_timer_a_tick), chip);
chip->timB = device->machine().scheduler().timer_alloc(FUNC(ymf271_timer_b_tick), chip);
chip->rom = rom;
chip->irq_callback = cb;
chip->irq_callback.resolve(*cb, *device);
chip->ext_mem_read.resolve(*ext_read, *device);
chip->ext_mem_write.resolve(*ext_write, *device);
@ -1779,7 +1779,7 @@ static DEVICE_START( ymf271 )
intf = (device->static_config() != NULL) ? (const ymf271_interface *)device->static_config() : &defintrf;
ymf271_init(device, chip, *device->region(), intf->irq_callback, &intf->ext_read, &intf->ext_write);
ymf271_init(device, chip, *device->region(), &intf->irq_callback, &intf->ext_read, &intf->ext_write);
chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/384, chip, ymf271_update);
for (i = 0; i < 256; i++)

View File

@ -10,7 +10,7 @@ struct ymf271_interface
{
devcb_read8 ext_read; /* external memory read */
devcb_write8 ext_write; /* external memory write */
void (*irq_callback)(device_t *device, int state); /* irq callback */
devcb_write_line irq_callback; /* irq callback */
};
DECLARE_READ8_DEVICE_HANDLER( ymf271_r );

View File

@ -138,7 +138,7 @@ struct YMF278BChip
int irq_line;
UINT8 port_C, port_AB, lastport;
void (*irq_callback)(device_t *, int);
devcb_resolved_write_line irq_callback;
device_t *device;
const UINT8 *rom;
@ -422,8 +422,8 @@ static void ymf278b_irq_check(running_machine &machine, YMF278BChip *chip)
{
int prev_line = chip->irq_line;
chip->irq_line = chip->current_irq ? ASSERT_LINE : CLEAR_LINE;
if(chip->irq_line != prev_line && chip->irq_callback)
chip->irq_callback(chip->device, chip->irq_line);
if(chip->irq_line != prev_line && !chip->irq_callback.isnull())
chip->irq_callback(chip->irq_line);
}
static TIMER_CALLBACK( ymf278b_timer_a_tick )
@ -935,14 +935,14 @@ static DEVICE_RESET( ymf278b )
chip->irq_line = CLEAR_LINE;
}
static void ymf278b_init(device_t *device, YMF278BChip *chip, void (*cb)(device_t *, int))
static void ymf278b_init(device_t *device, YMF278BChip *chip, const devcb_write_line *cb)
{
int i;
chip->rom = *device->region();
chip->romsize = device->region()->bytes();
chip->clock = device->clock();
chip->irq_callback = cb;
chip->irq_callback.resolve(*cb, *device);
chip->timer_base = attotime::from_hz(chip->clock) * (19*36);
chip->timer_a = device->machine().scheduler().timer_alloc(FUNC(ymf278b_timer_a_tick), chip);
@ -1050,7 +1050,7 @@ static void ymf278b_register_save_state(device_t *device, YMF278BChip *chip)
static DEVICE_START( ymf278b )
{
static const ymf278b_interface defintrf = { 0 };
static const ymf278b_interface defintrf = { DEVCB_NULL };
const ymf278b_interface *intf;
int i;
YMF278BChip *chip = get_safe_token(device);
@ -1058,7 +1058,7 @@ static DEVICE_START( ymf278b )
chip->device = device;
intf = (device->static_config() != NULL) ? (const ymf278b_interface *)device->static_config() : &defintrf;
ymf278b_init(device, chip, intf->irq_callback);
ymf278b_init(device, chip, &intf->irq_callback);
chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/768, chip, ymf278b_pcm_update);
// rate tables

View File

@ -10,7 +10,7 @@
struct ymf278b_interface
{
void (*irq_callback)(device_t *device, int state); /* irq callback */
devcb_write_line irq_callback; /* irq callback */
};
DECLARE_READ8_DEVICE_HANDLER( ymf278b_r );

View File

@ -87,7 +87,7 @@ struct ymz280b_state
UINT8 keyon_enable; /* key on enable */
UINT8 ext_mem_enable; /* external memory enable */
double master_clock; /* master clock frequency */
void (*irq_callback)(device_t *, int); /* IRQ callback */
devcb_resolved_write_line irq_callback; /* IRQ callback */
struct YMZ280BVoice voice[8]; /* the 8 voices */
UINT32 rom_addr_hi;
UINT32 rom_addr_mid;
@ -174,15 +174,15 @@ INLINE void update_irq_state(ymz280b_state *chip)
if (irq_bits && !chip->irq_state)
{
chip->irq_state = 1;
if (chip->irq_callback)
(*chip->irq_callback)(chip->device, 1);
if (!chip->irq_callback.isnull())
chip->irq_callback(1);
else logerror("YMZ280B: IRQ generated, but no callback specified!");
}
else if (!irq_bits && chip->irq_state)
{
chip->irq_state = 0;
if (chip->irq_callback)
(*chip->irq_callback)(chip->device, 0);
if (!chip->irq_callback.isnull())
chip->irq_callback(0);
else logerror("YMZ280B: IRQ generated, but no callback specified!");
}
}
@ -686,7 +686,7 @@ static STREAM_UPDATE( ymz280b_update )
static DEVICE_START( ymz280b )
{
static const ymz280b_interface defintrf = { 0 };
static const ymz280b_interface defintrf = { DEVCB_NULL };
const ymz280b_interface *intf = (device->static_config() != NULL) ? (const ymz280b_interface *)device->static_config() : &defintrf;
ymz280b_state *chip = get_safe_token(device);
@ -701,7 +701,7 @@ static DEVICE_START( ymz280b )
chip->master_clock = (double)device->clock() / 384.0;
chip->region_base = *device->region();
chip->region_size = device->region()->bytes();
chip->irq_callback = intf->irq_callback;
chip->irq_callback.resolve(intf->irq_callback, *device);
/* create the stream */
chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, INTERNAL_SAMPLE_RATE, chip, ymz280b_update);

View File

@ -15,7 +15,7 @@
struct ymz280b_interface
{
void (*irq_callback)(device_t *device, int state); /* irq callback */
devcb_write_line irq_callback; /* irq callback */
devcb_read8 ext_read; /* external RAM read */
devcb_write8 ext_write; /* external RAM write */
};

View File

@ -315,7 +315,7 @@ static const es5505_interface es5505_taito_en_config =
{
"ensoniq.0", /* Bank 0: Unused by F3 games? */
"ensoniq.0", /* Bank 1: All games seem to use this */
NULL /* IRQ */
DEVCB_NULL /* IRQ */
};

View File

@ -150,10 +150,10 @@ WRITE8_MEMBER(ajax_state::sound_bank_w)
k007232_set_bank(m_k007232_2, bank_A, bank_B);
}
static void volume_callback0(device_t *device, int v)
static WRITE8_DEVICE_HANDLER(volume_callback0)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
WRITE8_MEMBER(ajax_state::k007232_extvol_w)
@ -163,20 +163,20 @@ WRITE8_MEMBER(ajax_state::k007232_extvol_w)
k007232_set_volume(device, 0, (data & 0x0f) * 0x11/2, (data & 0x0f) * 0x11/2);
}
static void volume_callback1(device_t *device, int v)
static WRITE8_DEVICE_HANDLER(volume_callback1)
{
/* channel B volume/pan */
k007232_set_volume(device, 1, (v & 0x0f) * 0x11/2, (v >> 4) * 0x11/2);
k007232_set_volume(device, 1, (data & 0x0f) * 0x11/2, (data >> 4) * 0x11/2);
}
static const k007232_interface k007232_interface_1 =
{
volume_callback0
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback0)
};
static const k007232_interface k007232_interface_2 =
{
volume_callback1
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback1)
};

View File

@ -185,15 +185,15 @@ INPUT_PORTS_END
***************************************************************************/
static void volume_callback( device_t *device, int v )
static WRITE8_DEVICE_HANDLER(volume_callback)
{
k007232_set_volume(device, 0, (v & 0x0f) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v >> 4) * 0x11);
k007232_set_volume(device, 0, (data & 0x0f) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data >> 4) * 0x11);
}
static const k007232_interface k007232_config =
{
volume_callback /* external port callback */
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback) /* external port callback */
};

View File

@ -443,7 +443,7 @@ static void sound_irq_gen(device_t *device, int state)
static const ymz280b_interface ymz280b_intf =
{
sound_irq_gen
DEVCB_LINE(sound_irq_gen)
};
INTERRUPT_GEN_MEMBER(backfire_state::deco32_vbl_interrupt)

View File

@ -627,7 +627,7 @@ static void bfm_sc4_irqhandler(device_t *device, int state)
static const ymz280b_interface ymz280b_config =
{
bfm_sc4_irqhandler
DEVCB_LINE(bfm_sc4_irqhandler)
};

View File

@ -109,7 +109,7 @@ static void irqhandler(device_t *device, int state)
static const ymz280b_interface ymz280b_config =
{
irqhandler
DEVCB_LINE(irqhandler)
};

View File

@ -367,7 +367,7 @@ static void sound_irq_gen(device_t *device, int state)
static const ymz280b_interface ymz280b_intf =
{
sound_irq_gen
DEVCB_LINE(sound_irq_gen)
};

View File

@ -261,26 +261,26 @@ INPUT_PORTS_END
static void volume_callback0( device_t *device, int v )
static WRITE8_DEVICE_HANDLER(volume_callback0)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static void volume_callback1( device_t *device, int v )
static WRITE8_DEVICE_HANDLER(volume_callback1)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static const k007232_interface k007232_interface_1 =
{
volume_callback0
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback0)
};
static const k007232_interface k007232_interface_2 =
{
volume_callback1
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback1)
};

View File

@ -1817,7 +1817,7 @@ MACHINE_RESET_MEMBER(cave_state,cave)
static const ymz280b_interface ymz280b_intf =
{
sound_irq_gen
DEVCB_LINE(sound_irq_gen)
};
static void irqhandler(device_t *device, int irq)

View File

@ -255,10 +255,10 @@ INPUT_PORTS_END
static void volume_callback0( device_t *device, int v )
static WRITE8_DEVICE_HANDLER(volume_callback0)
{
k007232_set_volume(device, 0, (v & 0x0f) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v >> 4) * 0x11);
k007232_set_volume(device, 0, (data & 0x0f) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data >> 4) * 0x11);
}
WRITE8_MEMBER(chqflag_state::k007232_extvolume_w)
@ -267,19 +267,19 @@ WRITE8_MEMBER(chqflag_state::k007232_extvolume_w)
k007232_set_volume(device, 1, (data & 0x0f) * 0x11/2, (data >> 4) * 0x11/2);
}
static void volume_callback1( device_t *device, int v )
static WRITE8_DEVICE_HANDLER(volume_callback1)
{
k007232_set_volume(device, 0, (v & 0x0f) * 0x11/2, (v >> 4) * 0x11/2);
k007232_set_volume(device, 0, (data & 0x0f) * 0x11/2, (data >> 4) * 0x11/2);
}
static const k007232_interface k007232_interface_1 =
{
volume_callback0
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback0)
};
static const k007232_interface k007232_interface_2 =
{
volume_callback1
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback1)
};
static const k051960_interface chqflag_k051960_intf =

View File

@ -655,7 +655,7 @@ GFXDECODE_END
static const ymz280b_interface ymz280b_intf =
{
0 // irq ?
DEVCB_NULL // irq ?
};
INTERRUPT_GEN_MEMBER(coinmvga_state::vblank_irq)

View File

@ -3569,14 +3569,14 @@ WRITE_LINE_MEMBER(coolridr_state::scsp2_to_sh1_irq)
static const scsp_interface scsp_config =
{
0,
scsp_irq,
DEVCB_LINE(scsp_irq),
DEVCB_DRIVER_LINE_MEMBER(coolridr_state, scsp1_to_sh1_irq)
};
static const scsp_interface scsp2_interface =
{
0,
NULL,
DEVCB_NULL,
DEVCB_DRIVER_LINE_MEMBER(coolridr_state, scsp2_to_sh1_irq)
};

View File

@ -220,15 +220,15 @@ INPUT_PORTS_END
***************************************************************************/
static void volume_callback( device_t *device, int v )
static WRITE8_DEVICE_HANDLER(volume_callback)
{
k007232_set_volume(device, 0, (v & 0x0f) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v >> 4) * 0x11);
k007232_set_volume(device, 0, (data & 0x0f) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data >> 4) * 0x11);
}
static const k007232_interface k007232_config =
{
volume_callback /* external port callback */
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback) /* external port callback */
};

View File

@ -315,7 +315,7 @@ static void sound_irq_gen(device_t *device, int state)
static const ymz280b_interface ymz280b_intf =
{
sound_irq_gen
DEVCB_LINE(sound_irq_gen)
};
INTERRUPT_GEN_MEMBER(deco156_state::deco32_vbl_interrupt)

View File

@ -179,26 +179,26 @@ GFXDECODE_END
***************************************************************************/
static void volume_callback0(device_t *device, int v)
static WRITE8_DEVICE_HANDLER(volume_callback0)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static void volume_callback1(device_t *device, int v)
static WRITE8_DEVICE_HANDLER(volume_callback1)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static const k007232_interface k007232_interface_1 =
{
volume_callback0
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback0)
};
static const k007232_interface k007232_interface_2 =
{
volume_callback1
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback1)
};
void fastlane_state::machine_start()

View File

@ -1896,7 +1896,7 @@ static void sound_irq_callback(device_t *device, int state)
static const ymz280b_interface ymz280b_intf =
{
sound_irq_callback, // irq
DEVCB_LINE(sound_irq_callback), // irq
DEVCB_DRIVER_MEMBER(firebeat_state,soundram_r)
};

View File

@ -177,15 +177,15 @@ static GFXDECODE_START( flkatck )
GFXDECODE_ENTRY( "gfx1", 0, gfxlayout, 0, 32 )
GFXDECODE_END
static void volume_callback0(device_t *device, int v)
static WRITE8_DEVICE_HANDLER(volume_callback0)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static const k007232_interface k007232_config =
{
volume_callback0 /* external port callback */
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback0) /* external port callback */
};

View File

@ -577,7 +577,7 @@ static void irqhandler( device_t *device, int irq )
static const ymf278b_interface fuuki32_ymf278b_interface =
{
irqhandler /* irq */
DEVCB_LINE(irqhandler) /* irq */
};
static const ymf262_interface fuuki32_ymf262_interface =

View File

@ -501,7 +501,7 @@ ADDRESS_MAP_END
static const ymz280b_interface ymz280b_intf =
{
0 // irq ?
DEVCB_NULL // irq ?
};
static MACHINE_CONFIG_START( galpani3, galpani3_state )

View File

@ -231,15 +231,15 @@ INPUT_PORTS_END
***************************************************************************/
static void volume_callback( device_t *device, int v )
static WRITE8_DEVICE_HANDLER(volume_callback)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static const k007232_interface k007232_config =
{
volume_callback /* external port callback */
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback) /* external port callback */
};
static const k052109_interface gbusters_k052109_intf =

View File

@ -250,15 +250,15 @@ static INPUT_PORTS_START( gradius3 )
INPUT_PORTS_END
static void volume_callback(device_t *device, int v)
static WRITE8_DEVICE_HANDLER(volume_callback)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static const k007232_interface k007232_config =
{
volume_callback /* external port callback */
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback) /* external port callback */
};

View File

@ -1316,7 +1316,7 @@ static void sound_irq_gen(device_t *device, int state)
static const ymz280b_interface ymz280b_intf =
{
sound_irq_gen
DEVCB_LINE(sound_irq_gen)
};

View File

@ -161,15 +161,15 @@ static void irqhandler(device_t *device, int linestate)
// state->m_audiocpu.device(0)->execute().set_input_line(linestate);
}
static void volume_callback(device_t *device, int v)
static WRITE8_DEVICE_HANDLER(volume_callback)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static const k007232_interface k007232_config =
{
volume_callback /* external port callback */
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback) /* external port callback */
};
static const ym3812_interface ym3812_config =

View File

@ -581,7 +581,7 @@ INPUT_PORTS_END
static const ymz280b_interface ymz280b_intf =
{
0 // irq ?
DEVCB_NULL // irq ?
};

View File

@ -712,7 +712,7 @@ MACHINE_CONFIG_END
static const ymf278b_interface ymf278b_config =
{
soundirq
DEVCB_LINE(soundirq)
};
static MACHINE_CONFIG_START( aliencha, lordgun_state )

View File

@ -588,7 +588,7 @@ static const es5506_interface es5506_config =
"ensoniq.1",
"ensoniq.2",
"ensoniq.3",
irqhandler
DEVCB_LINE(irqhandler)
};

View File

@ -375,15 +375,15 @@ INPUT_PORTS_END
/*****************************************************************************/
static void volume_callback(device_t *device, int v)
static WRITE8_DEVICE_HANDLER(volume_callback)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static const k007232_interface k007232_config =
{
volume_callback /* external port callback */
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback) /* external port callback */
};
static const k052109_interface mainevt_k052109_intf =

View File

@ -106,7 +106,7 @@ static void irqhandler(device_t *device, int state)
static const ymz280b_interface ymz280b_config =
{
irqhandler
DEVCB_LINE(irqhandler)
};

View File

@ -440,7 +440,7 @@ WRITE8_MEMBER(metro_state::daitorid_portb_w)
static const ymf278b_interface ymf278b_config =
{
ymf278b_interrupt
DEVCB_LINE(ymf278b_interrupt)
};

View File

@ -693,7 +693,7 @@ static void livequiz_irqhandler(device_t *device, int state)
static const ymz280b_interface ymz280b_config =
{
livequiz_irqhandler
DEVCB_LINE(livequiz_irqhandler)
};
static MACHINE_CONFIG_START( livequiz, midas_state )

View File

@ -1887,7 +1887,7 @@ static void scsp_irq(device_t *device, int irq)
static const scsp_interface scsp_config =
{
0,
scsp_irq,
DEVCB_LINE(scsp_irq),
DEVCB_NULL
};

View File

@ -5301,14 +5301,15 @@ static void scsp_irq(device_t *device, int irq)
static const scsp_interface scsp_config =
{
0,
scsp_irq,
DEVCB_LINE(scsp_irq),
DEVCB_NULL
};
static const scsp_interface scsp2_interface =
{
0,
NULL
DEVCB_NULL,
DEVCB_NULL
};
/* IRQs */

View File

@ -1833,7 +1833,7 @@ static const aica_interface aica_config =
{
TRUE,
0,
aica_irq
DEVCB_LINE(aica_irq)
};

View File

@ -1492,15 +1492,15 @@ static const ym3812_interface ym3812_config =
DEVCB_LINE(sound_irq)
};
static void volume_callback(device_t *device, int v)
static WRITE8_DEVICE_HANDLER(volume_callback)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static const k007232_interface k007232_config =
{
volume_callback /* external port callback */
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback) /* external port callback */
};
/******************************************************************************/

View File

@ -1170,7 +1170,7 @@ static void irqhandler( device_t *device, int linestate )
static const ymf278b_interface ymf278b_config =
{
irqhandler
DEVCB_LINE(irqhandler)
};
static MACHINE_CONFIG_START( s1945, psikyo_state )

View File

@ -653,7 +653,7 @@ static void irqhandler( device_t *device, int linestate )
static const ymf278b_interface ymf278b_config =
{
irqhandler
DEVCB_LINE(irqhandler)
};

View File

@ -790,7 +790,7 @@ static void irqhandler(device_t *device, int linestate)
static const ymf278b_interface ymf278b_config =
{
irqhandler
DEVCB_LINE(irqhandler)
};

View File

@ -1112,7 +1112,7 @@ static const ymf271_interface ymf271_config =
{
DEVCB_DRIVER_MEMBER(seibuspi_state,flashrom_read),
DEVCB_DRIVER_MEMBER(seibuspi_state,flashrom_write),
irqhandler
DEVCB_LINE(irqhandler)
};
/********************************************************************/

View File

@ -447,15 +447,15 @@ INPUT_PORTS_END
static void volume_callback( device_t *device, int v )
static WRITE8_DEVICE_HANDLER(volume_callback)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static const k007232_interface spy_k007232_interface =
{
volume_callback
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback)
};

View File

@ -893,7 +893,7 @@ static const sh2_cpu_core sh2_conf_slave = { 1, NULL };
static const scsp_interface scsp_config =
{
0,
scsp_irq,
DEVCB_LINE(scsp_irq),
DEVCB_DRIVER_LINE_MEMBER(saturn_state, scsp_to_main_irq)
};

View File

@ -743,7 +743,7 @@ GFXDECODE_END
static const ymz280b_interface ymz280b_intf =
{
0 // irq ?
DEVCB_NULL // irq ?
};

View File

@ -566,15 +566,15 @@ INPUT_PORTS_END
***************************************************************************/
static void volume_callback(device_t *device, int v)
static WRITE8_DEVICE_HANDLER(volume_callback)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static const k007232_interface k007232_config =
{
volume_callback /* external port callback */
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback) /* external port callback */
};

View File

@ -2010,15 +2010,15 @@ static INPUT_PORTS_START( prmrsocr )
INPUT_PORTS_END
static void volume_callback(device_t *device, int v)
static WRITE8_DEVICE_HANDLER(volume_callback)
{
k007232_set_volume(device, 0, (v >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11);
k007232_set_volume(device, 0, (data >> 4) * 0x11, 0);
k007232_set_volume(device, 1, 0, (data & 0x0f) * 0x11);
}
static const k007232_interface k007232_config =
{
volume_callback /* external port callback */
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback) /* external port callback */
};
static const samples_interface tmnt_samples_interface =

View File

@ -2995,7 +2995,7 @@ static void bbakraid_irqhandler(device_t *device, int state)
static const ymz280b_interface ymz280b_config =
{
bbakraid_irqhandler
DEVCB_LINE(bbakraid_irqhandler)
};

View File

@ -671,15 +671,15 @@ GFXDECODE_END
/* Sound Interfaces */
static void volume_callback(device_t *device, int v)
static WRITE8_DEVICE_HANDLER(volume_callback)
{
k007232_set_volume(device,0,(v >> 4) * 0x11,0);
k007232_set_volume(device,1,0,(v & 0x0f) * 0x11);
k007232_set_volume(device,0,(data >> 4) * 0x11,0);
k007232_set_volume(device,1,0,(data & 0x0f) * 0x11);
}
static const k007232_interface k007232_config =
{
volume_callback /* external port callback */
DEVCB_DEVICE_HANDLER(DEVICE_SELF,volume_callback) /* external port callback */
};
/* Interrupt Generators */

View File

@ -214,7 +214,7 @@ static const aica_interface dc_aica_interface =
{
0,
0,
aica_irq
DEVCB_LINE(aica_irq)
};
static const struct sh4_config sh4cpu_config = { 1, 0, 1, 0, 0, 0, 1, 1, 0, CPU_CLOCK };

View File

@ -337,7 +337,7 @@ static void esq5505_otis_irq(device_t *device, int state)
esq5505->update_irq_to_maincpu();
}
static UINT16 esq5505_read_adc(device_t *device)
static READ16_DEVICE_HANDLER(esq5505_read_adc)
{
esq5505_state *state = device->machine().driver_data<esq5505_state>();
@ -611,8 +611,8 @@ static const es5505_interface es5505_config =
{
"waverom", /* Bank 0 */
"waverom2", /* Bank 1 */
esq5505_otis_irq, /* irq */
esq5505_read_adc
DEVCB_LINE(esq5505_otis_irq), /* irq */
DEVCB_DEVICE_HANDLER(DEVICE_SELF, esq5505_read_adc)
};
static const esqpanel_interface esqpanel_config =

View File

@ -249,7 +249,7 @@ static void esq5506_otto_irq(device_t *device, int state)
#endif
}
static UINT16 esq5506_read_adc(device_t *device)
static READ16_DEVICE_HANDLER(esq5506_read_adc)
{
esqkt_state *state = device->machine().driver_data<esqkt_state>();
@ -410,8 +410,8 @@ static const es5506_interface es5506_config =
"waverom2", /* Bank 1 */
"waverom3", /* Bank 0 */
"waverom4", /* Bank 1 */
esq5506_otto_irq, /* irq */
esq5506_read_adc
DEVCB_LINE(esq5506_otto_irq), /* irq */
DEVCB_DEVICE_HANDLER(DEVICE_SELF, esq5506_read_adc)
};
static const es5506_interface es5506_2_config =
@ -420,8 +420,8 @@ static const es5506_interface es5506_2_config =
"waverom2", /* Bank 1 */
"waverom3", /* Bank 0 */
"waverom4", /* Bank 1 */
NULL,
NULL
DEVCB_NULL,
DEVCB_NULL
};
static const esqpanel_interface esqpanel_config =

View File

@ -54,7 +54,7 @@ static void esq5506_otto_irq(device_t *device, int state)
{
}
static UINT16 esq5506_read_adc(device_t *device)
static READ16_DEVICE_HANDLER(esq5506_read_adc)
{
return 0;
}
@ -65,8 +65,8 @@ static const es5506_interface es5506_config =
"waverom2", /* Bank 1 */
"waverom3", /* Bank 0 */
"waverom4", /* Bank 1 */
esq5506_otto_irq, /* irq */
esq5506_read_adc
DEVCB_LINE(esq5506_otto_irq), /* irq */
DEVCB_DEVICE_HANDLER(DEVICE_SELF, esq5506_read_adc)
};
static const es5506_interface es5506_2_config =
@ -75,8 +75,8 @@ static const es5506_interface es5506_2_config =
"waverom2", /* Bank 1 */
"waverom3", /* Bank 0 */
"waverom4", /* Bank 1 */
NULL,
NULL
DEVCB_NULL,
DEVCB_NULL
};
static MACHINE_CONFIG_START( mr, esqmr_state )

View File

@ -603,7 +603,7 @@ static const sh2_cpu_core sh2_conf_slave = { 1, NULL };
static const scsp_interface scsp_config =
{
0,
scsp_irq,
DEVCB_LINE(scsp_irq),
DEVCB_DRIVER_LINE_MEMBER(saturn_state, scsp_to_main_irq)
};