Hi mamedev,

This is a reworked/expanded version of the patch I sent yesterday.
This one is split into three parts:

1.  This introduces function macros for SAMPLES_START,
CUSTOM_{START,STOP,RESET}, and ANTIC_RENDERER.
2.  This introduces running_machine *machine throughout MAME.
Principally it adds running_machine *machine = Machine to the top of
functions, but in some static functions the parameter is added
directly.  Some similar changes in 99xxcore.h, v9938.c, v9938mod.c,
galaxold.c, psx.c, taito_l.c are also made to eliminate Machine
params.  No global API is changed.
3.  This changes the APIs introduced in the first part to pass device
or space as appropriate.  A few similar changes in some other global
apis are made as well.

The net result of this sequence of patches is to remove 40% of the
Machine references and 27 deprecat.h includes.

~aa
This commit is contained in:
Aaron Giles 2008-12-08 06:53:40 +00:00
parent 60febeb3d9
commit b24198a1cd
124 changed files with 1199 additions and 1164 deletions

View File

@ -87,7 +87,6 @@ Other references can be found on spies.com:
#include "debugger.h" #include "debugger.h"
#include "cpuexec.h" #include "cpuexec.h"
#include "deprecat.h"
#include "tms9900.h" #include "tms9900.h"
@ -1869,7 +1868,7 @@ static void tms99xx_set_irq_line(int irqline, int state)
{ /* decrement, then interrupt if reach 0 */ { /* decrement, then interrupt if reach 0 */
if ((-- I.decrementer_count) == 0) if ((-- I.decrementer_count) == 0)
{ {
decrementer_callback(Machine, NULL, 0); decrementer_callback(I.device->machine, NULL, 0);
I.decrementer_count = I.decrementer_interval; /* reload */ I.decrementer_count = I.decrementer_interval; /* reload */
} }
} }

View File

@ -116,9 +116,10 @@ static pia6821 pias[MAX_PIA];
void pia_config(int which, const pia6821_interface *intf) void pia_config(int which, const pia6821_interface *intf)
{ {
running_machine *machine = Machine;
pia6821 *p; pia6821 *p;
assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "Can only call pia_config at init time!"); assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call pia_config at init time!");
assert_always((which >= 0) && (which < MAX_PIA), "pia_config called on an invalid PIA!"); assert_always((which >= 0) && (which < MAX_PIA), "pia_config called on an invalid PIA!");
assert_always(intf, "pia_config called with an invalid interface!"); assert_always(intf, "pia_config called with an invalid interface!");
@ -127,38 +128,38 @@ void pia_config(int which, const pia6821_interface *intf)
p->intf = intf; p->intf = intf;
state_save_register_item(Machine, "6821pia", NULL, which, p->in_a); state_save_register_item(machine, "6821pia", NULL, which, p->in_a);
state_save_register_item(Machine, "6821pia", NULL, which, p->in_ca1); state_save_register_item(machine, "6821pia", NULL, which, p->in_ca1);
state_save_register_item(Machine, "6821pia", NULL, which, p->in_ca2); state_save_register_item(machine, "6821pia", NULL, which, p->in_ca2);
state_save_register_item(Machine, "6821pia", NULL, which, p->out_a); state_save_register_item(machine, "6821pia", NULL, which, p->out_a);
state_save_register_item(Machine, "6821pia", NULL, which, p->out_ca2); state_save_register_item(machine, "6821pia", NULL, which, p->out_ca2);
state_save_register_item(Machine, "6821pia", NULL, which, p->port_a_z_mask); state_save_register_item(machine, "6821pia", NULL, which, p->port_a_z_mask);
state_save_register_item(Machine, "6821pia", NULL, which, p->ddr_a); state_save_register_item(machine, "6821pia", NULL, which, p->ddr_a);
state_save_register_item(Machine, "6821pia", NULL, which, p->ctl_a); state_save_register_item(machine, "6821pia", NULL, which, p->ctl_a);
state_save_register_item(Machine, "6821pia", NULL, which, p->irq_a1); state_save_register_item(machine, "6821pia", NULL, which, p->irq_a1);
state_save_register_item(Machine, "6821pia", NULL, which, p->irq_a2); state_save_register_item(machine, "6821pia", NULL, which, p->irq_a2);
state_save_register_item(Machine, "6821pia", NULL, which, p->irq_a_state); state_save_register_item(machine, "6821pia", NULL, which, p->irq_a_state);
state_save_register_item(Machine, "6821pia", NULL, which, p->in_b); state_save_register_item(machine, "6821pia", NULL, which, p->in_b);
state_save_register_item(Machine, "6821pia", NULL, which, p->in_cb1); state_save_register_item(machine, "6821pia", NULL, which, p->in_cb1);
state_save_register_item(Machine, "6821pia", NULL, which, p->in_cb2); state_save_register_item(machine, "6821pia", NULL, which, p->in_cb2);
state_save_register_item(Machine, "6821pia", NULL, which, p->out_b); state_save_register_item(machine, "6821pia", NULL, which, p->out_b);
state_save_register_item(Machine, "6821pia", NULL, which, p->out_cb2); state_save_register_item(machine, "6821pia", NULL, which, p->out_cb2);
state_save_register_item(Machine, "6821pia", NULL, which, p->last_out_cb2_z); state_save_register_item(machine, "6821pia", NULL, which, p->last_out_cb2_z);
state_save_register_item(Machine, "6821pia", NULL, which, p->ddr_b); state_save_register_item(machine, "6821pia", NULL, which, p->ddr_b);
state_save_register_item(Machine, "6821pia", NULL, which, p->ctl_b); state_save_register_item(machine, "6821pia", NULL, which, p->ctl_b);
state_save_register_item(Machine, "6821pia", NULL, which, p->irq_b1); state_save_register_item(machine, "6821pia", NULL, which, p->irq_b1);
state_save_register_item(Machine, "6821pia", NULL, which, p->irq_b2); state_save_register_item(machine, "6821pia", NULL, which, p->irq_b2);
state_save_register_item(Machine, "6821pia", NULL, which, p->irq_b_state); state_save_register_item(machine, "6821pia", NULL, which, p->irq_b_state);
state_save_register_item(Machine, "6821pia", NULL, which, p->in_a_pushed); state_save_register_item(machine, "6821pia", NULL, which, p->in_a_pushed);
state_save_register_item(Machine, "6821pia", NULL, which, p->out_a_needs_pulled); state_save_register_item(machine, "6821pia", NULL, which, p->out_a_needs_pulled);
state_save_register_item(Machine, "6821pia", NULL, which, p->in_ca1_pushed); state_save_register_item(machine, "6821pia", NULL, which, p->in_ca1_pushed);
state_save_register_item(Machine, "6821pia", NULL, which, p->in_ca2_pushed); state_save_register_item(machine, "6821pia", NULL, which, p->in_ca2_pushed);
state_save_register_item(Machine, "6821pia", NULL, which, p->out_ca2_needs_pulled); state_save_register_item(machine, "6821pia", NULL, which, p->out_ca2_needs_pulled);
state_save_register_item(Machine, "6821pia", NULL, which, p->in_b_pushed); state_save_register_item(machine, "6821pia", NULL, which, p->in_b_pushed);
state_save_register_item(Machine, "6821pia", NULL, which, p->out_b_needs_pulled); state_save_register_item(machine, "6821pia", NULL, which, p->out_b_needs_pulled);
state_save_register_item(Machine, "6821pia", NULL, which, p->in_cb1_pushed); state_save_register_item(machine, "6821pia", NULL, which, p->in_cb1_pushed);
state_save_register_item(Machine, "6821pia", NULL, which, p->in_cb2_pushed); state_save_register_item(machine, "6821pia", NULL, which, p->in_cb2_pushed);
state_save_register_item(Machine, "6821pia", NULL, which, p->out_cb2_needs_pulled); state_save_register_item(machine, "6821pia", NULL, which, p->out_cb2_needs_pulled);
} }

View File

@ -141,6 +141,7 @@ int TTL7474_output_comp_r(int which)
void TTL7474_config(int which, const struct TTL7474_interface *intf) void TTL7474_config(int which, const struct TTL7474_interface *intf)
{ {
running_machine *machine = Machine;
struct TTL7474 *chip = &chips[which]; struct TTL7474 *chip = &chips[which];
if (which >= MAX_TTL7474) if (which >= MAX_TTL7474)
@ -162,13 +163,13 @@ void TTL7474_config(int which, const struct TTL7474_interface *intf)
chip->last_output = -1; chip->last_output = -1;
chip->last_output_comp = -1; chip->last_output_comp = -1;
state_save_register_item(Machine, "ttl7474", NULL, which, chip->clear); state_save_register_item(machine, "ttl7474", NULL, which, chip->clear);
state_save_register_item(Machine, "ttl7474", NULL, which, chip->preset); state_save_register_item(machine, "ttl7474", NULL, which, chip->preset);
state_save_register_item(Machine, "ttl7474", NULL, which, chip->clock); state_save_register_item(machine, "ttl7474", NULL, which, chip->clock);
state_save_register_item(Machine, "ttl7474", NULL, which, chip->d); state_save_register_item(machine, "ttl7474", NULL, which, chip->d);
state_save_register_item(Machine, "ttl7474", NULL, which, chip->output); state_save_register_item(machine, "ttl7474", NULL, which, chip->output);
state_save_register_item(Machine, "ttl7474", NULL, which, chip->output_comp); state_save_register_item(machine, "ttl7474", NULL, which, chip->output_comp);
state_save_register_item(Machine, "ttl7474", NULL, which, chip->last_clock); state_save_register_item(machine, "ttl7474", NULL, which, chip->last_clock);
state_save_register_item(Machine, "ttl7474", NULL, which, chip->last_output); state_save_register_item(machine, "ttl7474", NULL, which, chip->last_output);
state_save_register_item(Machine, "ttl7474", NULL, which, chip->last_output_comp); state_save_register_item(machine, "ttl7474", NULL, which, chip->last_output_comp);
} }

View File

@ -65,6 +65,7 @@ static struct adc083x_chip adc083x[ MAX_ADC083X_CHIPS ];
void adc083x_init( int chip, int type, double (*input_callback)(int input) ) void adc083x_init( int chip, int type, double (*input_callback)(int input) )
{ {
running_machine *machine = Machine;
struct adc083x_chip *c; struct adc083x_chip *c;
if( chip >= MAX_ADC083X_CHIPS ) if( chip >= MAX_ADC083X_CHIPS )
@ -114,19 +115,19 @@ void adc083x_init( int chip, int type, double (*input_callback)(int input) )
break; break;
} }
state_save_register_item( Machine, "adc083x", NULL, chip, c->CS ); state_save_register_item( machine, "adc083x", NULL, chip, c->CS );
state_save_register_item( Machine, "adc083x", NULL, chip, c->CLK ); state_save_register_item( machine, "adc083x", NULL, chip, c->CLK );
state_save_register_item( Machine, "adc083x", NULL, chip, c->DI ); state_save_register_item( machine, "adc083x", NULL, chip, c->DI );
state_save_register_item( Machine, "adc083x", NULL, chip, c->SE ); state_save_register_item( machine, "adc083x", NULL, chip, c->SE );
state_save_register_item( Machine, "adc083x", NULL, chip, c->SARS ); state_save_register_item( machine, "adc083x", NULL, chip, c->SARS );
state_save_register_item( Machine, "adc083x", NULL, chip, c->DO ); state_save_register_item( machine, "adc083x", NULL, chip, c->DO );
state_save_register_item( Machine, "adc083x", NULL, chip, c->SGL ); state_save_register_item( machine, "adc083x", NULL, chip, c->SGL );
state_save_register_item( Machine, "adc083x", NULL, chip, c->ODD ); state_save_register_item( machine, "adc083x", NULL, chip, c->ODD );
state_save_register_item( Machine, "adc083x", NULL, chip, c->SEL1 ); state_save_register_item( machine, "adc083x", NULL, chip, c->SEL1 );
state_save_register_item( Machine, "adc083x", NULL, chip, c->SEL0 ); state_save_register_item( machine, "adc083x", NULL, chip, c->SEL0 );
state_save_register_item( Machine, "adc083x", NULL, chip, c->state ); state_save_register_item( machine, "adc083x", NULL, chip, c->state );
state_save_register_item( Machine, "adc083x", NULL, chip, c->bit ); state_save_register_item( machine, "adc083x", NULL, chip, c->bit );
state_save_register_item( Machine, "adc083x", NULL, chip, c->output ); state_save_register_item( machine, "adc083x", NULL, chip, c->output );
} }
void adc083x_cs_write( int chip, int cs ) void adc083x_cs_write( int chip, int cs )

View File

@ -211,6 +211,7 @@ WRITE32_HANDLER( am53cf96_w )
void am53cf96_init( const struct AM53CF96interface *interface ) void am53cf96_init( const struct AM53CF96interface *interface )
{ {
running_machine *machine = Machine;
int i; int i;
// save interface pointer for later // save interface pointer for later
@ -225,11 +226,11 @@ void am53cf96_init( const struct AM53CF96interface *interface )
SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion ); SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
} }
state_save_register_global_array(Machine, scsi_regs); state_save_register_global_array(machine, scsi_regs);
state_save_register_global_array(Machine, fifo); state_save_register_global_array(machine, fifo);
state_save_register_global(Machine, fptr); state_save_register_global(machine, fptr);
state_save_register_global(Machine, xfer_state); state_save_register_global(machine, xfer_state);
state_save_register_global(Machine, last_id); state_save_register_global(machine, last_id);
} }
void am53cf96_exit( const struct AM53CF96interface *interface ) void am53cf96_exit( const struct AM53CF96interface *interface )

View File

@ -111,14 +111,15 @@ static void cr589_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL
static void cr589_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion ) static void cr589_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{ {
running_machine *machine = Machine;
SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance ); SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance );
our_this->download = 0; our_this->download = 0;
memcpy( &our_this->buffer[ identity_offset ], "MATSHITACD-ROM CR-589 GS0N", 28 ); memcpy( &our_this->buffer[ identity_offset ], "MATSHITACD-ROM CR-589 GS0N", 28 );
state_save_register_item( Machine, "cr589", diskregion, 0, our_this->download ); state_save_register_item( machine, "cr589", diskregion, 0, our_this->download );
state_save_register_item_array( Machine, "cr589", diskregion, 0, our_this->buffer ); state_save_register_item_array( machine, "cr589", diskregion, 0, our_this->buffer );
state_save_register_item( Machine, "cr589", diskregion, 0, our_this->bufferOffset ); state_save_register_item( machine, "cr589", diskregion, 0, our_this->bufferOffset );
} }
static int cr589_dispatch( int operation, void *file, INT64 intparm, void *ptrparm ) static int cr589_dispatch( int operation, void *file, INT64 intparm, void *ptrparm )

View File

@ -141,6 +141,7 @@ static TIMER_CALLBACK( ds2401_tick )
void ds2401_init( int which, const UINT8 *data ) void ds2401_init( int which, const UINT8 *data )
{ {
running_machine *machine = Machine;
struct ds2401_chip *c = &ds2401[ which ]; struct ds2401_chip *c = &ds2401[ which ];
c->state = STATE_IDLE; c->state = STATE_IDLE;
@ -156,15 +157,15 @@ void ds2401_init( int which, const UINT8 *data )
c->t_pdh = ATTOTIME_IN_USEC( 15 ); c->t_pdh = ATTOTIME_IN_USEC( 15 );
c->t_pdl = ATTOTIME_IN_USEC( 60 ); c->t_pdl = ATTOTIME_IN_USEC( 60 );
state_save_register_item(Machine, "ds2401", NULL, which, c->state ); state_save_register_item(machine, "ds2401", NULL, which, c->state );
state_save_register_item(Machine, "ds2401", NULL, which, c->bit ); state_save_register_item(machine, "ds2401", NULL, which, c->bit );
state_save_register_item(Machine, "ds2401", NULL, which, c->byte ); state_save_register_item(machine, "ds2401", NULL, which, c->byte );
state_save_register_item(Machine, "ds2401", NULL, which, c->shift ); state_save_register_item(machine, "ds2401", NULL, which, c->shift );
state_save_register_item(Machine, "ds2401", NULL, which, c->rx ); state_save_register_item(machine, "ds2401", NULL, which, c->rx );
state_save_register_item(Machine, "ds2401", NULL, which, c->tx ); state_save_register_item(machine, "ds2401", NULL, which, c->tx );
c->timer = timer_alloc(Machine, ds2401_tick , NULL); c->timer = timer_alloc(machine, ds2401_tick , NULL);
c->reset_timer = timer_alloc(Machine, ds2401_reset , NULL); c->reset_timer = timer_alloc(machine, ds2401_reset , NULL);
} }
void ds2401_write( int which, int data ) void ds2401_write( int which, int data )

View File

@ -130,6 +130,7 @@ NVRAM_HANDLER( 93C66B )
void eeprom_init(const eeprom_interface *interface) void eeprom_init(const eeprom_interface *interface)
{ {
running_machine *machine = Machine;
intf = interface; intf = interface;
if ((1 << intf->address_bits) * intf->data_bits / 8 > MEMORY_SIZE) if ((1 << intf->address_bits) * intf->data_bits / 8 > MEMORY_SIZE)
@ -147,17 +148,17 @@ void eeprom_init(const eeprom_interface *interface)
if (intf->cmd_unlock) locked = 1; if (intf->cmd_unlock) locked = 1;
else locked = 0; else locked = 0;
state_save_register_global_array(Machine, eeprom_data); state_save_register_global_array(machine, eeprom_data);
state_save_register_global_array(Machine, serial_buffer); state_save_register_global_array(machine, serial_buffer);
state_save_register_global(Machine, clock_line); state_save_register_global(machine, clock_line);
state_save_register_global(Machine, reset_line); state_save_register_global(machine, reset_line);
state_save_register_global(Machine, locked); state_save_register_global(machine, locked);
state_save_register_global(Machine, serial_count); state_save_register_global(machine, serial_count);
state_save_register_global(Machine, latch); state_save_register_global(machine, latch);
state_save_register_global(Machine, reset_delay); state_save_register_global(machine, reset_delay);
state_save_register_global(Machine, eeprom_clock_count); state_save_register_global(machine, eeprom_clock_count);
state_save_register_global(Machine, eeprom_data_bits); state_save_register_global(machine, eeprom_data_bits);
state_save_register_global(Machine, eeprom_read_address); state_save_register_global(machine, eeprom_read_address);
} }
static void eeprom_write(int bit) static void eeprom_write(int bit)

View File

@ -81,6 +81,7 @@ static struct i2cmem_chip i2cmem[ I2CMEM_MAXCHIP ];
void i2cmem_init( int chip, int slave_address, int page_size, int data_size, unsigned char *data ) void i2cmem_init( int chip, int slave_address, int page_size, int data_size, unsigned char *data )
{ {
running_machine *machine = Machine;
struct i2cmem_chip *c; struct i2cmem_chip *c;
unsigned char *page = NULL; unsigned char *page = NULL;
@ -121,19 +122,19 @@ void i2cmem_init( int chip, int slave_address, int page_size, int data_size, uns
c->data = data; c->data = data;
c->page = page; c->page = page;
state_save_register_item( Machine, "i2cmem", NULL, chip, c->scl ); state_save_register_item( machine, "i2cmem", NULL, chip, c->scl );
state_save_register_item( Machine, "i2cmem", NULL, chip, c->sdaw ); state_save_register_item( machine, "i2cmem", NULL, chip, c->sdaw );
state_save_register_item( Machine, "i2cmem", NULL, chip, c->e0 ); state_save_register_item( machine, "i2cmem", NULL, chip, c->e0 );
state_save_register_item( Machine, "i2cmem", NULL, chip, c->e1 ); state_save_register_item( machine, "i2cmem", NULL, chip, c->e1 );
state_save_register_item( Machine, "i2cmem", NULL, chip, c->e2 ); state_save_register_item( machine, "i2cmem", NULL, chip, c->e2 );
state_save_register_item( Machine, "i2cmem", NULL, chip, c->wc ); state_save_register_item( machine, "i2cmem", NULL, chip, c->wc );
state_save_register_item( Machine, "i2cmem", NULL, chip, c->sdar ); state_save_register_item( machine, "i2cmem", NULL, chip, c->sdar );
state_save_register_item( Machine, "i2cmem", NULL, chip, c->state ); state_save_register_item( machine, "i2cmem", NULL, chip, c->state );
state_save_register_item( Machine, "i2cmem", NULL, chip, c->bits ); state_save_register_item( machine, "i2cmem", NULL, chip, c->bits );
state_save_register_item( Machine, "i2cmem", NULL, chip, c->shift ); state_save_register_item( machine, "i2cmem", NULL, chip, c->shift );
state_save_register_item( Machine, "i2cmem", NULL, chip, c->devsel ); state_save_register_item( machine, "i2cmem", NULL, chip, c->devsel );
state_save_register_item( Machine, "i2cmem", NULL, chip, c->byteaddr ); state_save_register_item( machine, "i2cmem", NULL, chip, c->byteaddr );
state_save_register_item_pointer( Machine, "i2cmem", NULL, chip, c->data, c->data_size ); state_save_register_item_pointer( machine, "i2cmem", NULL, chip, c->data, c->data_size );
} }
static int select_device( struct i2cmem_chip *c ) static int select_device( struct i2cmem_chip *c )

View File

@ -80,6 +80,7 @@ void* intelflash_getmemptr(int chip)
void intelflash_init(int chip, int type, void *data) void intelflash_init(int chip, int type, void *data)
{ {
running_machine *machine = Machine;
struct flash_chip *c; struct flash_chip *c;
if( chip >= FLASH_CHIPS_MAX ) if( chip >= FLASH_CHIPS_MAX )
{ {
@ -132,13 +133,13 @@ void intelflash_init(int chip, int type, void *data)
c->status = 0x80; c->status = 0x80;
c->flash_mode = FM_NORMAL; c->flash_mode = FM_NORMAL;
c->flash_master_lock = 0; c->flash_master_lock = 0;
c->timer = timer_alloc(Machine, erase_finished, c); c->timer = timer_alloc(machine, erase_finished, c);
c->flash_memory = data; c->flash_memory = data;
state_save_register_item( Machine, "intelfsh", NULL, chip, c->status ); state_save_register_item( machine, "intelfsh", NULL, chip, c->status );
state_save_register_item( Machine, "intelfsh", NULL, chip, c->flash_mode ); state_save_register_item( machine, "intelfsh", NULL, chip, c->flash_mode );
state_save_register_item( Machine, "intelfsh", NULL, chip, c->flash_master_lock ); state_save_register_item( machine, "intelfsh", NULL, chip, c->flash_master_lock );
state_save_register_memory( Machine, "intelfsh", NULL, chip, "flash_memory", c->flash_memory, c->bits/8, c->size / (c->bits/8) ); state_save_register_memory( machine, "intelfsh", NULL, chip, "flash_memory", c->flash_memory, c->bits/8, c->size / (c->bits/8) );
} }
UINT32 intelflash_read(int chip, UINT32 address) UINT32 intelflash_read(int chip, UINT32 address)

View File

@ -145,7 +145,7 @@ struct _sound_token
static TIMER_CALLBACK( perform_player_update ); static TIMER_CALLBACK( perform_player_update );
static void read_track_data(laserdisc_state *ld); static void read_track_data(laserdisc_state *ld);
static void process_track_data(const device_config *device); static void process_track_data(const device_config *device);
static void *custom_start(int clock, const custom_sound_interface *config); static CUSTOM_START( custom_start );
static void custom_stream_callback(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples); static void custom_stream_callback(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
static void configuration_load(running_machine *machine, int config_type, xml_data_node *parentnode); static void configuration_load(running_machine *machine, int config_type, xml_data_node *parentnode);
static void configuration_save(running_machine *machine, int config_type, xml_data_node *parentnode); static void configuration_save(running_machine *machine, int config_type, xml_data_node *parentnode);
@ -943,7 +943,7 @@ static void process_track_data(const device_config *device)
for laserdiscs for laserdiscs
-------------------------------------------------*/ -------------------------------------------------*/
static void *custom_start(int clock, const custom_sound_interface *config) static CUSTOM_START( custom_start )
{ {
sound_token *token = auto_malloc(sizeof(*token)); sound_token *token = auto_malloc(sizeof(*token));
token->stream = stream_create(0, 2, 48000, token, custom_stream_callback); token->stream = stream_create(0, 2, 48000, token, custom_stream_callback);

View File

@ -111,27 +111,28 @@ static TIMER_CALLBACK(microtouch_timer_callback)
void microtouch_init(void (*tx_cb)(UINT8 data), void microtouch_init(void (*tx_cb)(UINT8 data),
int (*touch_cb)(int *touch_x, int *touch_y)) int (*touch_cb)(int *touch_x, int *touch_y))
{ {
running_machine *machine = Machine;
memset(&microtouch, 0, sizeof(microtouch)); memset(&microtouch, 0, sizeof(microtouch));
microtouch.last_touch_state = -1; microtouch.last_touch_state = -1;
microtouch.tx_callback = tx_cb; microtouch.tx_callback = tx_cb;
microtouch.touch_callback = touch_cb; microtouch.touch_callback = touch_cb;
microtouch.timer = timer_alloc(Machine, microtouch_timer_callback, NULL); microtouch.timer = timer_alloc(machine, microtouch_timer_callback, NULL);
timer_adjust_periodic(microtouch.timer, ATTOTIME_IN_HZ(167*5), 0, ATTOTIME_IN_HZ(167*5)); timer_adjust_periodic(microtouch.timer, ATTOTIME_IN_HZ(167*5), 0, ATTOTIME_IN_HZ(167*5));
state_save_register_item(Machine, "microtouch", NULL, 0, microtouch.reset_done); state_save_register_item(machine, "microtouch", NULL, 0, microtouch.reset_done);
state_save_register_item(Machine, "microtouch", NULL, 0, microtouch.format_tablet); state_save_register_item(machine, "microtouch", NULL, 0, microtouch.format_tablet);
state_save_register_item(Machine, "microtouch", NULL, 0, microtouch.mode_inactive); state_save_register_item(machine, "microtouch", NULL, 0, microtouch.mode_inactive);
state_save_register_item(Machine, "microtouch", NULL, 0, microtouch.mode_stream); state_save_register_item(machine, "microtouch", NULL, 0, microtouch.mode_stream);
state_save_register_item(Machine, "microtouch", NULL, 0, microtouch.last_touch_state); state_save_register_item(machine, "microtouch", NULL, 0, microtouch.last_touch_state);
state_save_register_item(Machine, "microtouch", NULL, 0, microtouch.last_x); state_save_register_item(machine, "microtouch", NULL, 0, microtouch.last_x);
state_save_register_item(Machine, "microtouch", NULL, 0, microtouch.last_y); state_save_register_item(machine, "microtouch", NULL, 0, microtouch.last_y);
state_save_register_item_array(Machine, "microtouch", NULL, 0, microtouch.rx_buffer); state_save_register_item_array(machine, "microtouch", NULL, 0, microtouch.rx_buffer);
state_save_register_item(Machine, "microtouch", NULL, 0, microtouch.rx_buffer_ptr); state_save_register_item(machine, "microtouch", NULL, 0, microtouch.rx_buffer_ptr);
state_save_register_item_array(Machine, "microtouch", NULL, 0, microtouch.tx_buffer); state_save_register_item_array(machine, "microtouch", NULL, 0, microtouch.tx_buffer);
state_save_register_item(Machine, "microtouch", NULL, 0, microtouch.tx_buffer_num); state_save_register_item(machine, "microtouch", NULL, 0, microtouch.tx_buffer_num);
state_save_register_item(Machine, "microtouch", NULL, 0, microtouch.tx_buffer_ptr); state_save_register_item(machine, "microtouch", NULL, 0, microtouch.tx_buffer_ptr);
}; };

View File

@ -329,6 +329,7 @@ WRITE16_HANDLER( pd4990a_control_16_w )
void pd4990a_init(void) void pd4990a_init(void)
{ {
running_machine *machine = Machine;
pd4990a = pd4990a_initval; pd4990a = pd4990a_initval;
shiftlo = 0; shiftlo = 0;
shifthi = 0; shifthi = 0;
@ -343,27 +344,27 @@ void pd4990a_init(void)
clock_line = 0; clock_line = 0;
command_line =0; command_line =0;
state_save_register_item(Machine, "pd4990a", NULL, 0, pd4990a.seconds); state_save_register_item(machine, "pd4990a", NULL, 0, pd4990a.seconds);
state_save_register_item(Machine, "pd4990a", NULL, 0, pd4990a.minutes); state_save_register_item(machine, "pd4990a", NULL, 0, pd4990a.minutes);
state_save_register_item(Machine, "pd4990a", NULL, 0, pd4990a.hours); state_save_register_item(machine, "pd4990a", NULL, 0, pd4990a.hours);
state_save_register_item(Machine, "pd4990a", NULL, 0, pd4990a.days); state_save_register_item(machine, "pd4990a", NULL, 0, pd4990a.days);
state_save_register_item(Machine, "pd4990a", NULL, 0, pd4990a.month); state_save_register_item(machine, "pd4990a", NULL, 0, pd4990a.month);
state_save_register_item(Machine, "pd4990a", NULL, 0, pd4990a.year); state_save_register_item(machine, "pd4990a", NULL, 0, pd4990a.year);
state_save_register_item(Machine, "pd4990a", NULL, 0, pd4990a.weekday); state_save_register_item(machine, "pd4990a", NULL, 0, pd4990a.weekday);
state_save_register_item(Machine, "pd4990a", NULL, 0, shiftlo); state_save_register_item(machine, "pd4990a", NULL, 0, shiftlo);
state_save_register_item(Machine, "pd4990a", NULL, 0, shifthi); state_save_register_item(machine, "pd4990a", NULL, 0, shifthi);
state_save_register_item(Machine, "pd4990a", NULL, 0, retraces); state_save_register_item(machine, "pd4990a", NULL, 0, retraces);
state_save_register_item(Machine, "pd4990a", NULL, 0, testwaits); state_save_register_item(machine, "pd4990a", NULL, 0, testwaits);
state_save_register_item(Machine, "pd4990a", NULL, 0, maxwaits); state_save_register_item(machine, "pd4990a", NULL, 0, maxwaits);
state_save_register_item(Machine, "pd4990a", NULL, 0, testbit); state_save_register_item(machine, "pd4990a", NULL, 0, testbit);
state_save_register_item(Machine, "pd4990a", NULL, 0, outputbit); state_save_register_item(machine, "pd4990a", NULL, 0, outputbit);
state_save_register_item(Machine, "pd4990a", NULL, 0, bitno); state_save_register_item(machine, "pd4990a", NULL, 0, bitno);
state_save_register_item(Machine, "pd4990a", NULL, 0, reading); state_save_register_item(machine, "pd4990a", NULL, 0, reading);
state_save_register_item(Machine, "pd4990a", NULL, 0, writting); state_save_register_item(machine, "pd4990a", NULL, 0, writting);
state_save_register_item(Machine, "pd4990a", NULL, 0, clock_line); state_save_register_item(machine, "pd4990a", NULL, 0, clock_line);
state_save_register_item(Machine, "pd4990a", NULL, 0, command_line); state_save_register_item(machine, "pd4990a", NULL, 0, command_line);
} }

View File

@ -673,6 +673,7 @@ static void scsicd_write_data( SCSIInstance *scsiInstance, UINT8 *data, int data
static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion ) static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{ {
running_machine *machine = Machine;
SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance ); SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance );
our_this->lba = 0; our_this->lba = 0;
@ -683,13 +684,13 @@ static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
our_this->cur_subblock = 0; our_this->cur_subblock = 0;
our_this->play_err_flag = 0; our_this->play_err_flag = 0;
state_save_register_item( Machine, "scsicd", diskregion, 0, our_this->lba ); state_save_register_item( machine, "scsicd", diskregion, 0, our_this->lba );
state_save_register_item( Machine, "scsicd", diskregion, 0, our_this->blocks ); state_save_register_item( machine, "scsicd", diskregion, 0, our_this->blocks );
state_save_register_item( Machine, "scsicd", diskregion, 0, our_this->last_lba ); state_save_register_item( machine, "scsicd", diskregion, 0, our_this->last_lba );
state_save_register_item( Machine, "scsicd", diskregion, 0, our_this->bytes_per_sector ); state_save_register_item( machine, "scsicd", diskregion, 0, our_this->bytes_per_sector );
state_save_register_item( Machine, "scsicd", diskregion, 0, our_this->num_subblocks ); state_save_register_item( machine, "scsicd", diskregion, 0, our_this->num_subblocks );
state_save_register_item( Machine, "scsicd", diskregion, 0, our_this->cur_subblock ); state_save_register_item( machine, "scsicd", diskregion, 0, our_this->cur_subblock );
state_save_register_item( Machine, "scsicd", diskregion, 0, our_this->play_err_flag ); state_save_register_item( machine, "scsicd", diskregion, 0, our_this->play_err_flag );
#ifdef MESS #ifdef MESS
/* TODO: get rid of this ifdef MESS section */ /* TODO: get rid of this ifdef MESS section */

View File

@ -100,11 +100,12 @@ static int scsidev_get_command( SCSIInstance *scsiInstance, void **command )
static void scsidev_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion ) static void scsidev_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{ {
running_machine *machine = Machine;
SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance ); SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance );
state_save_register_item_array( Machine, "scsidev", diskregion, 0, our_this->command ); state_save_register_item_array( machine, "scsidev", diskregion, 0, our_this->command );
state_save_register_item( Machine, "scsidev", diskregion, 0, our_this->commandLength ); state_save_register_item( machine, "scsidev", diskregion, 0, our_this->commandLength );
state_save_register_item( Machine, "scsidev", diskregion, 0, our_this->phase ); state_save_register_item( machine, "scsidev", diskregion, 0, our_this->phase );
} }
static int scsidev_dispatch( int operation, void *file, INT64 intparm, void *ptrparm ) static int scsidev_dispatch( int operation, void *file, INT64 intparm, void *ptrparm )

View File

@ -225,13 +225,14 @@ static void scsihd_write_data( SCSIInstance *scsiInstance, UINT8 *data, int data
static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion ) static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{ {
running_machine *machine = Machine;
SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance ); SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance );
our_this->lba = 0; our_this->lba = 0;
our_this->blocks = 0; our_this->blocks = 0;
state_save_register_item( Machine, "scsihd", diskregion, 0, our_this->lba ); state_save_register_item( machine, "scsihd", diskregion, 0, our_this->lba );
state_save_register_item( Machine, "scsihd", diskregion, 0, our_this->blocks ); state_save_register_item( machine, "scsihd", diskregion, 0, our_this->blocks );
#ifdef MESS #ifdef MESS
/* TODO: get rid of this ifdef MESS section */ /* TODO: get rid of this ifdef MESS section */

View File

@ -34,6 +34,7 @@ static struct uPD4701_chip uPD4701[ UPD4701_MAXCHIP ];
void uPD4701_init( int chip ) void uPD4701_init( int chip )
{ {
running_machine *machine = Machine;
struct uPD4701_chip *c; struct uPD4701_chip *c;
if( chip < 0 || chip >= UPD4701_MAXCHIP ) if( chip < 0 || chip >= UPD4701_MAXCHIP )
@ -59,20 +60,20 @@ void uPD4701_init( int chip )
c->latchswitches = 0; c->latchswitches = 0;
c->cf = 1; c->cf = 1;
state_save_register_item( Machine, "uPD4701", NULL, chip, c->cs ); state_save_register_item( machine, "uPD4701", NULL, chip, c->cs );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->xy ); state_save_register_item( machine, "uPD4701", NULL, chip, c->xy );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->ul ); state_save_register_item( machine, "uPD4701", NULL, chip, c->ul );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->resetx ); state_save_register_item( machine, "uPD4701", NULL, chip, c->resetx );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->resety ); state_save_register_item( machine, "uPD4701", NULL, chip, c->resety );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->latchx ); state_save_register_item( machine, "uPD4701", NULL, chip, c->latchx );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->latchy ); state_save_register_item( machine, "uPD4701", NULL, chip, c->latchy );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->startx ); state_save_register_item( machine, "uPD4701", NULL, chip, c->startx );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->starty ); state_save_register_item( machine, "uPD4701", NULL, chip, c->starty );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->x ); state_save_register_item( machine, "uPD4701", NULL, chip, c->x );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->y ); state_save_register_item( machine, "uPD4701", NULL, chip, c->y );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->switches ); state_save_register_item( machine, "uPD4701", NULL, chip, c->switches );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->latchswitches ); state_save_register_item( machine, "uPD4701", NULL, chip, c->latchswitches );
state_save_register_item( Machine, "uPD4701", NULL, chip, c->cf ); state_save_register_item( machine, "uPD4701", NULL, chip, c->cf );
} }
void uPD4701_ul_w( int chip, int ul ) void uPD4701_ul_w( int chip, int ul )

View File

@ -110,6 +110,7 @@ static struct x76f041_chip x76f041[ X76F041_MAXCHIP ];
void x76f041_init( int chip, UINT8 *data ) void x76f041_init( int chip, UINT8 *data )
{ {
running_machine *machine = Machine;
int offset; int offset;
struct x76f041_chip *c; struct x76f041_chip *c;
@ -153,24 +154,24 @@ void x76f041_init( int chip, UINT8 *data )
c->configuration_registers = &data[ offset ]; offset += SIZE_CONFIGURATION_REGISTERS; c->configuration_registers = &data[ offset ]; offset += SIZE_CONFIGURATION_REGISTERS;
c->data = &data[ offset ]; offset += SIZE_DATA; c->data = &data[ offset ]; offset += SIZE_DATA;
state_save_register_item( Machine, "x76f041", NULL, chip, c->cs ); state_save_register_item( machine, "x76f041", NULL, chip, c->cs );
state_save_register_item( Machine, "x76f041", NULL, chip, c->rst ); state_save_register_item( machine, "x76f041", NULL, chip, c->rst );
state_save_register_item( Machine, "x76f041", NULL, chip, c->scl ); state_save_register_item( machine, "x76f041", NULL, chip, c->scl );
state_save_register_item( Machine, "x76f041", NULL, chip, c->sdaw ); state_save_register_item( machine, "x76f041", NULL, chip, c->sdaw );
state_save_register_item( Machine, "x76f041", NULL, chip, c->sdar ); state_save_register_item( machine, "x76f041", NULL, chip, c->sdar );
state_save_register_item( Machine, "x76f041", NULL, chip, c->state ); state_save_register_item( machine, "x76f041", NULL, chip, c->state );
state_save_register_item( Machine, "x76f041", NULL, chip, c->shift ); state_save_register_item( machine, "x76f041", NULL, chip, c->shift );
state_save_register_item( Machine, "x76f041", NULL, chip, c->bit ); state_save_register_item( machine, "x76f041", NULL, chip, c->bit );
state_save_register_item( Machine, "x76f041", NULL, chip, c->byte ); state_save_register_item( machine, "x76f041", NULL, chip, c->byte );
state_save_register_item( Machine, "x76f041", NULL, chip, c->command ); state_save_register_item( machine, "x76f041", NULL, chip, c->command );
state_save_register_item( Machine, "x76f041", NULL, chip, c->address ); state_save_register_item( machine, "x76f041", NULL, chip, c->address );
state_save_register_item_array( Machine, "x76f041", NULL, chip, c->write_buffer ); state_save_register_item_array( machine, "x76f041", NULL, chip, c->write_buffer );
state_save_register_item_pointer( Machine, "x76f041", NULL, chip, c->response_to_reset, SIZE_RESPONSE_TO_RESET ); state_save_register_item_pointer( machine, "x76f041", NULL, chip, c->response_to_reset, SIZE_RESPONSE_TO_RESET );
state_save_register_item_pointer( Machine, "x76f041", NULL, chip, c->write_password, SIZE_WRITE_PASSWORD ); state_save_register_item_pointer( machine, "x76f041", NULL, chip, c->write_password, SIZE_WRITE_PASSWORD );
state_save_register_item_pointer( Machine, "x76f041", NULL, chip, c->read_password, SIZE_READ_PASSWORD ); state_save_register_item_pointer( machine, "x76f041", NULL, chip, c->read_password, SIZE_READ_PASSWORD );
state_save_register_item_pointer( Machine, "x76f041", NULL, chip, c->configuration_password, SIZE_CONFIGURATION_PASSWORD ); state_save_register_item_pointer( machine, "x76f041", NULL, chip, c->configuration_password, SIZE_CONFIGURATION_PASSWORD );
state_save_register_item_pointer( Machine, "x76f041", NULL, chip, c->configuration_registers, SIZE_CONFIGURATION_REGISTERS ); state_save_register_item_pointer( machine, "x76f041", NULL, chip, c->configuration_registers, SIZE_CONFIGURATION_REGISTERS );
state_save_register_item_pointer( Machine, "x76f041", NULL, chip, c->data, SIZE_DATA ); state_save_register_item_pointer( machine, "x76f041", NULL, chip, c->data, SIZE_DATA );
} }
void x76f041_cs_write( int chip, int cs ) void x76f041_cs_write( int chip, int cs )

View File

@ -79,6 +79,7 @@ static struct x76f100_chip x76f100[ X76F100_MAXCHIP ];
void x76f100_init( int chip, UINT8 *data ) void x76f100_init( int chip, UINT8 *data )
{ {
running_machine *machine = Machine;
int offset; int offset;
struct x76f100_chip *c; struct x76f100_chip *c;
@ -117,21 +118,21 @@ void x76f100_init( int chip, UINT8 *data )
c->read_password = &data[ offset ]; offset += SIZE_READ_PASSWORD; c->read_password = &data[ offset ]; offset += SIZE_READ_PASSWORD;
c->data = &data[ offset ]; offset += SIZE_DATA; c->data = &data[ offset ]; offset += SIZE_DATA;
state_save_register_item( Machine, "x76f100", NULL, chip, c->cs ); state_save_register_item( machine, "x76f100", NULL, chip, c->cs );
state_save_register_item( Machine, "x76f100", NULL, chip, c->rst ); state_save_register_item( machine, "x76f100", NULL, chip, c->rst );
state_save_register_item( Machine, "x76f100", NULL, chip, c->scl ); state_save_register_item( machine, "x76f100", NULL, chip, c->scl );
state_save_register_item( Machine, "x76f100", NULL, chip, c->sdaw ); state_save_register_item( machine, "x76f100", NULL, chip, c->sdaw );
state_save_register_item( Machine, "x76f100", NULL, chip, c->sdar ); state_save_register_item( machine, "x76f100", NULL, chip, c->sdar );
state_save_register_item( Machine, "x76f100", NULL, chip, c->state ); state_save_register_item( machine, "x76f100", NULL, chip, c->state );
state_save_register_item( Machine, "x76f100", NULL, chip, c->shift ); state_save_register_item( machine, "x76f100", NULL, chip, c->shift );
state_save_register_item( Machine, "x76f100", NULL, chip, c->bit ); state_save_register_item( machine, "x76f100", NULL, chip, c->bit );
state_save_register_item( Machine, "x76f100", NULL, chip, c->byte ); state_save_register_item( machine, "x76f100", NULL, chip, c->byte );
state_save_register_item( Machine, "x76f100", NULL, chip, c->command ); state_save_register_item( machine, "x76f100", NULL, chip, c->command );
state_save_register_item_array( Machine, "x76f100", NULL, chip, c->write_buffer ); state_save_register_item_array( machine, "x76f100", NULL, chip, c->write_buffer );
state_save_register_item_pointer( Machine, "x76f100", NULL, chip, c->response_to_reset, SIZE_RESPONSE_TO_RESET ); state_save_register_item_pointer( machine, "x76f100", NULL, chip, c->response_to_reset, SIZE_RESPONSE_TO_RESET );
state_save_register_item_pointer( Machine, "x76f100", NULL, chip, c->write_password, SIZE_WRITE_PASSWORD ); state_save_register_item_pointer( machine, "x76f100", NULL, chip, c->write_password, SIZE_WRITE_PASSWORD );
state_save_register_item_pointer( Machine, "x76f100", NULL, chip, c->read_password, SIZE_READ_PASSWORD ); state_save_register_item_pointer( machine, "x76f100", NULL, chip, c->read_password, SIZE_READ_PASSWORD );
state_save_register_item_pointer( Machine, "x76f100", NULL, chip, c->data, SIZE_DATA ); state_save_register_item_pointer( machine, "x76f100", NULL, chip, c->data, SIZE_DATA );
} }
void x76f100_cs_write( int chip, int cs ) void x76f100_cs_write( int chip, int cs )

View File

@ -17,7 +17,6 @@
***************************************************************************/ ***************************************************************************/
#include "driver.h" #include "driver.h"
#include "deprecat.h"
@ -580,7 +579,7 @@ static DEVICE_GET_INFO( sndclass )
(*snddata->intf.get_info)(device, state, (sndinfo *)info); (*snddata->intf.get_info)(device, state, (sndinfo *)info);
} }
int sndintrf_init_sound(int sndnum, const char *tag, sound_type sndtype, int clock, const void *config) int sndintrf_init_sound(running_machine *machine, int sndnum, const char *tag, sound_type sndtype, int clock, const void *config)
{ {
sndintrf_data *info = &sound[sndnum]; sndintrf_data *info = &sound[sndnum];
int index; int index;
@ -588,7 +587,7 @@ int sndintrf_init_sound(int sndnum, const char *tag, sound_type sndtype, int clo
info->device = auto_malloc(sizeof(*info->device) + strlen(tag)); info->device = auto_malloc(sizeof(*info->device) + strlen(tag));
memset(info->device, 0, sizeof(*info->device) + strlen(tag)); memset(info->device, 0, sizeof(*info->device) + strlen(tag));
info->device->type = DEVICE_GET_INFO_NAME(sndclass); info->device->type = DEVICE_GET_INFO_NAME(sndclass);
info->device->machine = Machine; info->device->machine = machine;
strcpy(info->device->tag, tag); strcpy(info->device->tag, tag);
info->device->static_config = config; info->device->static_config = config;
info->device->region = memory_region(info->device->machine, info->device->tag); info->device->region = memory_region(info->device->machine, info->device->tag);

View File

@ -341,7 +341,7 @@ const char *sndtype_get_info_string(sound_type sndtype, UINT32 state);
/* Initialization/Tear down */ /* Initialization/Tear down */
void sndintrf_init(running_machine *machine); void sndintrf_init(running_machine *machine);
int sndintrf_init_sound(int sndnum, const char *tag, sound_type sndtype, int clock, const void *config); int sndintrf_init_sound(running_machine *machine, int sndnum, const char *tag, sound_type sndtype, int clock, const void *config);
void sndintrf_exit_sound(int sndnum); void sndintrf_exit_sound(int sndnum);
void sndintrf_register_token(void *token); void sndintrf_register_token(void *token);

View File

@ -294,7 +294,7 @@ static void start_sound_chips(running_machine *machine)
VPRINTF(("sndnum = %d -- sound_type = %d\n", sndnum, msound->type)); VPRINTF(("sndnum = %d -- sound_type = %d\n", sndnum, msound->type));
num_regs = state_save_get_reg_count(machine); num_regs = state_save_get_reg_count(machine);
streams_set_tag(machine, info); streams_set_tag(machine, info);
if (sndintrf_init_sound(sndnum, msound->tag, msound->type, msound->clock, msound->config) != 0) if (sndintrf_init_sound(machine, sndnum, msound->tag, msound->type, msound->clock, msound->config) != 0)
fatalerror("Sound chip #%d (%s) failed to initialize!", sndnum, sndnum_get_name(sndnum)); fatalerror("Sound chip #%d (%s) failed to initialize!", sndnum, sndnum_get_name(sndnum));
/* if no state registered for saving, we can't save */ /* if no state registered for saving, we can't save */

View File

@ -646,7 +646,7 @@ static void AICA_Init(const device_config *device, struct _AICA *AICA, const aic
AICA->Slots[i].mslc=0; AICA->Slots[i].mslc=0;
} }
AICALFO_Init(); AICALFO_Init(device->machine);
AICA->buffertmpl=(signed int*) auto_malloc(44100*sizeof(signed int)); AICA->buffertmpl=(signed int*) auto_malloc(44100*sizeof(signed int));
AICA->buffertmpr=(signed int*) auto_malloc(44100*sizeof(signed int)); AICA->buffertmpr=(signed int*) auto_malloc(44100*sizeof(signed int));
memset(AICA->buffertmpl,0,44100*sizeof(signed int)); memset(AICA->buffertmpl,0,44100*sizeof(signed int));

View File

@ -34,7 +34,7 @@ static const float PSCALE[8]={0.0f,7.0f,13.5f,27.0f,55.0f,112.0f,230.0f,494.0f};
static int PSCALES[8][256]; static int PSCALES[8][256];
static int ASCALES[8][256]; static int ASCALES[8][256];
static void AICALFO_Init(void) static void AICALFO_Init(running_machine *machine)
{ {
int i,s; int i,s;
for(i=0;i<256;++i) for(i=0;i<256;++i)
@ -82,7 +82,7 @@ static void AICALFO_Init(void)
//noise //noise
//a=lfo_noise[i]; //a=lfo_noise[i];
a=mame_rand(Machine)&0xff; a=mame_rand(machine)&0xff;
p=128-a; p=128-a;
ALFO_NOI[i]=a; ALFO_NOI[i]=a;
PLFO_NOI[i]=p; PLFO_NOI[i]=p;

View File

@ -21,7 +21,7 @@ static SND_START( custom )
info->intf = config; info->intf = config;
if (info->intf->start) if (info->intf->start)
{ {
info->token = (*info->intf->start)(clock, config); info->token = (*info->intf->start)(device, clock, config);
if (!info->token) if (!info->token)
return NULL; return NULL;
} }

View File

@ -6,7 +6,7 @@
typedef struct _custom_sound_interface custom_sound_interface; typedef struct _custom_sound_interface custom_sound_interface;
struct _custom_sound_interface struct _custom_sound_interface
{ {
void *(*start)(int clock, const custom_sound_interface *config); void *(*start)(const device_config *device, int clock, const custom_sound_interface *config);
void (*stop)(void *token); void (*stop)(void *token);
void (*reset)(void *token); void (*reset)(void *token);
void *extra_data; void *extra_data;
@ -14,5 +14,8 @@ struct _custom_sound_interface
void *custom_get_token(int index); void *custom_get_token(int index);
#define CUSTOM_START(name) void *name(const device_config *device, int clock, const custom_sound_interface *config)
#define CUSTOM_STOP(name) void name(void *token)
#define CUSTOM_RESET(name) void name(void *token)
#endif /* __CUSTOM_H__ */ #endif /* __CUSTOM_H__ */

View File

@ -895,7 +895,7 @@ INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST)
{ {
if( COMPARE_TIMES(ST->busy_expiry_time, UNDEFINED_TIME) != 0 ) if( COMPARE_TIMES(ST->busy_expiry_time, UNDEFINED_TIME) != 0 )
{ {
if (COMPARE_TIMES(ST->busy_expiry_time, FM_GET_TIME_NOW()) > 0) if (COMPARE_TIMES(ST->busy_expiry_time, FM_GET_TIME_NOW(Machine)) > 0)
return ST->status | 0x80; /* with busy */ return ST->status | 0x80; /* with busy */
/* expire */ /* expire */
FM_BUSY_CLEAR(ST); FM_BUSY_CLEAR(ST);
@ -905,7 +905,7 @@ INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST)
INLINE void FM_BUSY_SET(FM_ST *ST,int busyclock ) INLINE void FM_BUSY_SET(FM_ST *ST,int busyclock )
{ {
TIME_TYPE expiry_period = MULTIPLY_TIME_BY_INT(ATTOTIME_IN_HZ(ST->clock), busyclock * ST->timer_prescaler); TIME_TYPE expiry_period = MULTIPLY_TIME_BY_INT(ATTOTIME_IN_HZ(ST->clock), busyclock * ST->timer_prescaler);
ST->busy_expiry_time = ADD_TIMES(FM_GET_TIME_NOW(), expiry_period); ST->busy_expiry_time = ADD_TIMES(FM_GET_TIME_NOW(Machine), expiry_period);
} }
#else #else
#define FM_STATUS_FLAG(ST) ((ST)->status) #define FM_STATUS_FLAG(ST) ((ST)->status)

View File

@ -42,7 +42,7 @@ struct _ssg_callbacks
#if FM_BUSY_FLAG_SUPPORT #if FM_BUSY_FLAG_SUPPORT
#define TIME_TYPE attotime #define TIME_TYPE attotime
#define UNDEFINED_TIME attotime_zero #define UNDEFINED_TIME attotime_zero
#define FM_GET_TIME_NOW() timer_get_time(Machine) #define FM_GET_TIME_NOW(machine) timer_get_time(machine)
#define ADD_TIMES(t1, t2) attotime_add((t1), (t2)) #define ADD_TIMES(t1, t2) attotime_add((t1), (t2))
#define COMPARE_TIMES(t1, t2) attotime_compare((t1), (t2)) #define COMPARE_TIMES(t1, t2) attotime_compare((t1), (t2))
#define MULTIPLY_TIME_BY_INT(t,i) attotime_mul(t, i) #define MULTIPLY_TIME_BY_INT(t,i) attotime_mul(t, i)

View File

@ -570,7 +570,7 @@ static SND_START( samples )
/* initialize any custom handlers */ /* initialize any custom handlers */
if (intf->start) if (intf->start)
(*intf->start)(); (*intf->start)(device);
return info; return info;
} }

View File

@ -21,9 +21,11 @@ struct _samples_interface
{ {
int channels; /* number of discrete audio channels needed */ int channels; /* number of discrete audio channels needed */
const char *const *samplenames; const char *const *samplenames;
void (*start)(void); void (*start)(const device_config *device);
}; };
#define SAMPLES_START(name) void name(const device_config *device)
void sample_start_n(int num,int channel,int samplenum,int loop); void sample_start_n(int num,int channel,int samplenum,int loop);
void sample_start_raw_n(int num,int channel,const INT16 *sampledata,int samples,int frequency,int loop); void sample_start_raw_n(int num,int channel,const INT16 *sampledata,int samples,int frequency,int loop);

View File

@ -638,7 +638,7 @@ static void SCSP_Init(const device_config *device, struct _SCSP *SCSP, const scs
SCSP->Slots[i].base=NULL; SCSP->Slots[i].base=NULL;
} }
LFO_Init(); LFO_Init(device->machine);
SCSP->buffertmpl=(signed int*) auto_malloc(44100*sizeof(signed int)); SCSP->buffertmpl=(signed int*) auto_malloc(44100*sizeof(signed int));
SCSP->buffertmpr=(signed int*) auto_malloc(44100*sizeof(signed int)); SCSP->buffertmpr=(signed int*) auto_malloc(44100*sizeof(signed int));
memset(SCSP->buffertmpl,0,44100*sizeof(signed int)); memset(SCSP->buffertmpl,0,44100*sizeof(signed int));

View File

@ -38,7 +38,7 @@ static const float PSCALE[8]={0.0f,7.0f,13.5f,27.0f,55.0f,112.0f,230.0f,494.0f};
static int PSCALES[8][256]; static int PSCALES[8][256];
static int ASCALES[8][256]; static int ASCALES[8][256];
static void LFO_Init(void) static void LFO_Init(running_machine *machine)
{ {
int i,s; int i,s;
for(i=0;i<256;++i) for(i=0;i<256;++i)
@ -86,7 +86,7 @@ static void LFO_Init(void)
//noise //noise
//a=lfo_noise[i]; //a=lfo_noise[i];
a=mame_rand(Machine)&0xff; a=mame_rand(machine)&0xff;
p=128-a; p=128-a;
ALFO_NOI[i]=a; ALFO_NOI[i]=a;
PLFO_NOI[i]=p; PLFO_NOI[i]=p;

View File

@ -350,7 +350,8 @@ void streams_update(running_machine *machine)
sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *param, stream_update_func callback) sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *param, stream_update_func callback)
{ {
streams_private *strdata = Machine->streams_data; running_machine *machine = Machine;
streams_private *strdata = machine->streams_data;
int inputnum, outputnum; int inputnum, outputnum;
sound_stream *stream; sound_stream *stream;
char statetag[30]; char statetag[30];
@ -362,7 +363,7 @@ sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *para
VPRINTF(("stream_create(%d, %d, %d) => %p\n", inputs, outputs, sample_rate, stream)); VPRINTF(("stream_create(%d, %d, %d) => %p\n", inputs, outputs, sample_rate, stream));
/* fill in the data */ /* fill in the data */
stream->machine = Machine; stream->machine = machine;
stream->tag = strdata->current_tag; stream->tag = strdata->current_tag;
stream->index = strdata->stream_index++; stream->index = strdata->stream_index++;
stream->sample_rate = sample_rate; stream->sample_rate = sample_rate;
@ -373,8 +374,8 @@ sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *para
/* create a unique tag for saving */ /* create a unique tag for saving */
sprintf(statetag, "%d", stream->index); sprintf(statetag, "%d", stream->index);
state_save_register_item(Machine, "stream", statetag, 0, stream->sample_rate); state_save_register_item(machine, "stream", statetag, 0, stream->sample_rate);
state_save_register_postload(Machine, stream_postload, stream); state_save_register_postload(machine, stream_postload, stream);
/* allocate space for the inputs */ /* allocate space for the inputs */
if (inputs > 0) if (inputs > 0)
@ -390,7 +391,7 @@ sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *para
{ {
stream->input[inputnum].owner = stream; stream->input[inputnum].owner = stream;
stream->input[inputnum].gain = 0x100; stream->input[inputnum].gain = 0x100;
state_save_register_item(Machine, "stream", statetag, inputnum, stream->input[inputnum].gain); state_save_register_item(machine, "stream", statetag, inputnum, stream->input[inputnum].gain);
} }
/* allocate space for the outputs */ /* allocate space for the outputs */
@ -407,7 +408,7 @@ sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *para
{ {
stream->output[outputnum].owner = stream; stream->output[outputnum].owner = stream;
stream->output[outputnum].gain = 0x100; stream->output[outputnum].gain = 0x100;
state_save_register_item(Machine, "stream", statetag, outputnum, stream->output[outputnum].gain); state_save_register_item(machine, "stream", statetag, outputnum, stream->output[outputnum].gain);
} }
/* hook us into the master stream list */ /* hook us into the master stream list */

View File

@ -293,6 +293,7 @@ void tilemap_init(running_machine *machine)
tilemap *tilemap_create(tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows) tilemap *tilemap_create(tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
{ {
running_machine *machine = Machine;
tilemap *tmap; tilemap *tmap;
int group; int group;
@ -345,22 +346,22 @@ tilemap *tilemap_create(tile_get_info_func tile_get_info, tilemap_mapper_func ma
tilemap_tailptr = &tmap->next; tilemap_tailptr = &tmap->next;
/* save relevant state */ /* save relevant state */
state_save_register_item(Machine, "tilemap", NULL, tilemap_instance, tmap->enable); state_save_register_item(machine, "tilemap", NULL, tilemap_instance, tmap->enable);
state_save_register_item(Machine, "tilemap", NULL, tilemap_instance, tmap->attributes); state_save_register_item(machine, "tilemap", NULL, tilemap_instance, tmap->attributes);
state_save_register_item(Machine, "tilemap", NULL, tilemap_instance, tmap->palette_offset); state_save_register_item(machine, "tilemap", NULL, tilemap_instance, tmap->palette_offset);
state_save_register_item(Machine, "tilemap", NULL, tilemap_instance, tmap->pen_data_offset); state_save_register_item(machine, "tilemap", NULL, tilemap_instance, tmap->pen_data_offset);
state_save_register_item(Machine, "tilemap", NULL, tilemap_instance, tmap->scrollrows); state_save_register_item(machine, "tilemap", NULL, tilemap_instance, tmap->scrollrows);
state_save_register_item(Machine, "tilemap", NULL, tilemap_instance, tmap->scrollcols); state_save_register_item(machine, "tilemap", NULL, tilemap_instance, tmap->scrollcols);
state_save_register_item_pointer(Machine, "tilemap", NULL, tilemap_instance, tmap->rowscroll, rows * tileheight); state_save_register_item_pointer(machine, "tilemap", NULL, tilemap_instance, tmap->rowscroll, rows * tileheight);
state_save_register_item_pointer(Machine, "tilemap", NULL, tilemap_instance, tmap->colscroll, cols * tilewidth); state_save_register_item_pointer(machine, "tilemap", NULL, tilemap_instance, tmap->colscroll, cols * tilewidth);
state_save_register_item(Machine, "tilemap", NULL, tilemap_instance, tmap->dx); state_save_register_item(machine, "tilemap", NULL, tilemap_instance, tmap->dx);
state_save_register_item(Machine, "tilemap", NULL, tilemap_instance, tmap->dx_flipped); state_save_register_item(machine, "tilemap", NULL, tilemap_instance, tmap->dx_flipped);
state_save_register_item(Machine, "tilemap", NULL, tilemap_instance, tmap->dy); state_save_register_item(machine, "tilemap", NULL, tilemap_instance, tmap->dy);
state_save_register_item(Machine, "tilemap", NULL, tilemap_instance, tmap->dy_flipped); state_save_register_item(machine, "tilemap", NULL, tilemap_instance, tmap->dy_flipped);
tilemap_instance++; tilemap_instance++;
/* reset everything after a load */ /* reset everything after a load */
state_save_register_postload(Machine, tilemap_postload, tmap); state_save_register_postload(machine, tilemap_postload, tmap);
return tmap; return tmap;
} }

View File

@ -1100,13 +1100,13 @@ skip_first_cc_set:
typedef struct { typedef struct {
UINT8 m; UINT8 m;
void (*visible_16)(UINT16*, int); void (*visible_16)(const pen_t *, UINT16*, int);
void (*visible_16s)(UINT16*, int); void (*visible_16s)(const pen_t *, UINT16*, int);
void (*border_16)(UINT16*); void (*border_16)(const pen_t *, UINT16*);
void (*border_16s)(UINT16*); void (*border_16s)(const pen_t *, UINT16*);
void (*sprites)(int, UINT8*); void (*sprites)(int, UINT8*);
void (*draw_sprite_16)(UINT16*, UINT8*); void (*draw_sprite_16)(const pen_t *, UINT16*, UINT8*);
void (*draw_sprite_16s)(UINT16*, UINT8*); void (*draw_sprite_16s)(const pen_t *, UINT16*, UINT8*);
} V9938_MODE; } V9938_MODE;
static const V9938_MODE modes[] = { static const V9938_MODE modes[] = {
@ -1214,6 +1214,7 @@ static void v9938_set_mode (void)
static void v9938_refresh_16 (bitmap_t *bmp, int line) static void v9938_refresh_16 (bitmap_t *bmp, int line)
{ {
const pen_t *pens = Machine->pens;
int i, double_lines; int i, double_lines;
UINT8 col[256]; UINT8 col[256];
UINT16 *ln, *ln2 = NULL; UINT16 *ln, *ln2 = NULL;
@ -1240,29 +1241,29 @@ static void v9938_refresh_16 (bitmap_t *bmp, int line)
if ( !(vdp->contReg[1] & 0x40) || (vdp->statReg[2] & 0x40) ) if ( !(vdp->contReg[1] & 0x40) || (vdp->statReg[2] & 0x40) )
{ {
if (vdp->size == RENDER_HIGH) if (vdp->size == RENDER_HIGH)
modes[vdp->mode].border_16 (ln); modes[vdp->mode].border_16 (pens, ln);
else else
modes[vdp->mode].border_16s (ln); modes[vdp->mode].border_16s (pens, ln);
} }
else else
{ {
i = (line - vdp->offset_y) & 255; i = (line - vdp->offset_y) & 255;
if (vdp->size == RENDER_HIGH) if (vdp->size == RENDER_HIGH)
{ {
modes[vdp->mode].visible_16 (ln, i); modes[vdp->mode].visible_16 (pens, ln, i);
if (modes[vdp->mode].sprites) if (modes[vdp->mode].sprites)
{ {
modes[vdp->mode].sprites (i, col); modes[vdp->mode].sprites (i, col);
modes[vdp->mode].draw_sprite_16 (ln, col); modes[vdp->mode].draw_sprite_16 (pens, ln, col);
} }
} }
else else
{ {
modes[vdp->mode].visible_16s (ln, i); modes[vdp->mode].visible_16s (pens, ln, i);
if (modes[vdp->mode].sprites) if (modes[vdp->mode].sprites)
{ {
modes[vdp->mode].sprites (i, col); modes[vdp->mode].sprites (i, col);
modes[vdp->mode].draw_sprite_16s (ln, col); modes[vdp->mode].draw_sprite_16s (pens, ln, col);
} }
} }
} }

View File

@ -24,20 +24,20 @@
#define V9938_BORDER_FUNC(name) \ #define V9938_BORDER_FUNC(name) \
static void FNAME (name) (PEN_TYPE *ln) static void FNAME (name) (const pen_t *pens, PEN_TYPE *ln)
#define V9938_MODE_FUNC(name) \ #define V9938_MODE_FUNC(name) \
static void FNAME (name) (PEN_TYPE *ln, int line) static void FNAME (name) (const pen_t *pens, PEN_TYPE *ln, int line)
#define V9938_SPRITE_FUNC(name) \ #define V9938_SPRITE_FUNC(name) \
static void FNAME (name) (PEN_TYPE *ln, UINT8 *col) static void FNAME (name) (const pen_t *pens, PEN_TYPE *ln, UINT8 *col)
V9938_BORDER_FUNC (default_border) V9938_BORDER_FUNC (default_border)
{ {
PEN_TYPE pen; PEN_TYPE pen;
int i; int i;
pen = Machine->pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]]; pen = pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]];
i = V9938_WIDTH; i = V9938_WIDTH;
while (i--) *ln++ = pen; while (i--) *ln++ = pen;
@ -49,7 +49,7 @@ V9938_BORDER_FUNC (graphic7_border)
PEN_TYPE pen; PEN_TYPE pen;
int i; int i;
pen = Machine->pens[vdp->pal_ind256[vdp->contReg[7]]]; pen = pens[vdp->pal_ind256[vdp->contReg[7]]];
i = V9938_WIDTH; i = V9938_WIDTH;
while (i--) *ln++ = pen; while (i--) *ln++ = pen;
@ -63,12 +63,12 @@ V9938_BORDER_FUNC (graphic5_border)
#if (V9938_WIDTH > 512) #if (V9938_WIDTH > 512)
PEN_TYPE pen1; PEN_TYPE pen1;
pen1 = Machine->pens[vdp->pal_ind16[(vdp->contReg[7]&0x03)]]; pen1 = pens[vdp->pal_ind16[(vdp->contReg[7]&0x03)]];
pen0 = Machine->pens[vdp->pal_ind16[((vdp->contReg[7]>>2)&0x03)]]; pen0 = pens[vdp->pal_ind16[((vdp->contReg[7]>>2)&0x03)]];
i = (V9938_WIDTH) / 2; i = (V9938_WIDTH) / 2;
while (i--) { *ln++ = pen0; *ln++ = pen1; } while (i--) { *ln++ = pen0; *ln++ = pen1; }
#else #else
pen0 = Machine->pens[vdp->pal_ind16[((vdp->contReg[7]>>2)&0x03)]]; pen0 = pens[vdp->pal_ind16[((vdp->contReg[7]>>2)&0x03)]];
i = V9938_WIDTH; i = V9938_WIDTH;
while (i--) *ln++ = pen0; while (i--) *ln++ = pen0;
#endif #endif
@ -84,12 +84,12 @@ V9938_MODE_FUNC (mode_text1)
patterntbl = vdp->vram + (vdp->contReg[4] << 11); patterntbl = vdp->vram + (vdp->contReg[4] << 11);
nametbl = vdp->vram + (vdp->contReg[2] << 10); nametbl = vdp->vram + (vdp->contReg[2] << 10);
fg = Machine->pens[vdp->pal_ind16[vdp->contReg[7] >> 4]]; fg = pens[vdp->pal_ind16[vdp->contReg[7] >> 4]];
bg = Machine->pens[vdp->pal_ind16[vdp->contReg[7] & 15]]; bg = pens[vdp->pal_ind16[vdp->contReg[7] & 15]];
name = (line/8)*40; name = (line/8)*40;
pen = Machine->pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]]; pen = pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]];
xxx = vdp->offset_x + 8; xxx = vdp->offset_x + 8;
#if (V9938_WIDTH > 512) #if (V9938_WIDTH > 512)
@ -137,15 +137,15 @@ V9938_MODE_FUNC (mode_text2)
nametbl = vdp->vram + ((vdp->contReg[2] & 0xfc) << 10); nametbl = vdp->vram + ((vdp->contReg[2] & 0xfc) << 10);
patternmask = ((vdp->contReg[2] & 3) << 10) | 0x3ff; /* seems correct */ patternmask = ((vdp->contReg[2] & 3) << 10) | 0x3ff; /* seems correct */
fg = Machine->pens[vdp->pal_ind16[vdp->contReg[7] >> 4]]; fg = pens[vdp->pal_ind16[vdp->contReg[7] >> 4]];
bg = Machine->pens[vdp->pal_ind16[vdp->contReg[7] & 15]]; bg = pens[vdp->pal_ind16[vdp->contReg[7] & 15]];
fg0 = Machine->pens[vdp->pal_ind16[vdp->contReg[12] >> 4]]; fg0 = pens[vdp->pal_ind16[vdp->contReg[12] >> 4]];
bg0 = Machine->pens[vdp->pal_ind16[vdp->contReg[12] & 15]]; bg0 = pens[vdp->pal_ind16[vdp->contReg[12] & 15]];
name = (line/8)*80; name = (line/8)*80;
xxx = vdp->offset_x + 8; xxx = vdp->offset_x + 8;
pen = Machine->pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]]; pen = pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]];
#if (V9938_WIDTH > 512) #if (V9938_WIDTH > 512)
xxx *= 2; xxx *= 2;
#endif #endif
@ -219,7 +219,7 @@ V9938_MODE_FUNC (mode_multi)
line2 = (line - vdp->contReg[23]) & 255; line2 = (line - vdp->contReg[23]) & 255;
name = (line2/8)*32; name = (line2/8)*32;
pen_bg = Machine->pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]]; pen_bg = pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]];
#if (V9938_WIDTH < 512) #if (V9938_WIDTH < 512)
xx = vdp->offset_x; xx = vdp->offset_x;
#else #else
@ -230,7 +230,7 @@ V9938_MODE_FUNC (mode_multi)
for (x=0;x<32;x++) for (x=0;x<32;x++)
{ {
colour = patterntbl[(nametbl[name] * 8) + ((line2/4)&7)]; colour = patterntbl[(nametbl[name] * 8) + ((line2/4)&7)];
pen = Machine->pens[vdp->pal_ind16[colour>>4]]; pen = pens[vdp->pal_ind16[colour>>4]];
/* eight pixels */ /* eight pixels */
*ln++ = pen; *ln++ = pen;
*ln++ = pen; *ln++ = pen;
@ -242,7 +242,7 @@ V9938_MODE_FUNC (mode_multi)
*ln++ = pen; *ln++ = pen;
*ln++ = pen; *ln++ = pen;
#endif #endif
pen = Machine->pens[vdp->pal_ind16[colour&15]]; pen = pens[vdp->pal_ind16[colour&15]];
/* eight pixels */ /* eight pixels */
*ln++ = pen; *ln++ = pen;
*ln++ = pen; *ln++ = pen;
@ -279,7 +279,7 @@ V9938_MODE_FUNC (mode_graphic1)
name = (line2/8)*32; name = (line2/8)*32;
pen = Machine->pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]]; pen = pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]];
#if (V9938_WIDTH < 512) #if (V9938_WIDTH < 512)
xxx = vdp->offset_x; xxx = vdp->offset_x;
#else #else
@ -291,8 +291,8 @@ V9938_MODE_FUNC (mode_graphic1)
{ {
charcode = nametbl[name]; charcode = nametbl[name];
colour = colourtbl[charcode/8]; colour = colourtbl[charcode/8];
fg = Machine->pens[vdp->pal_ind16[colour>>4]]; fg = pens[vdp->pal_ind16[colour>>4]];
bg = Machine->pens[vdp->pal_ind16[colour&15]]; bg = pens[vdp->pal_ind16[colour&15]];
pattern = patterntbl[charcode * 8 + (line2 & 7)]; pattern = patterntbl[charcode * 8 + (line2 & 7)];
for (xx=0;xx<8;xx++) for (xx=0;xx<8;xx++)
@ -331,7 +331,7 @@ V9938_MODE_FUNC (mode_graphic23)
line2 = (line + vdp->contReg[23]) & 255; line2 = (line + vdp->contReg[23]) & 255;
name = (line2/8)*32; name = (line2/8)*32;
pen = Machine->pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]]; pen = pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]];
#if (V9938_WIDTH < 512) #if (V9938_WIDTH < 512)
xxx = vdp->offset_x; xxx = vdp->offset_x;
#else #else
@ -344,8 +344,8 @@ V9938_MODE_FUNC (mode_graphic23)
charcode = nametbl[name] + (line2&0xc0)*4; charcode = nametbl[name] + (line2&0xc0)*4;
colour = colourtbl[(charcode&colourmask)*8+(line2&7)]; colour = colourtbl[(charcode&colourmask)*8+(line2&7)];
pattern = patterntbl[(charcode&patternmask)*8+(line2&7)]; pattern = patterntbl[(charcode&patternmask)*8+(line2&7)];
fg = Machine->pens[vdp->pal_ind16[colour>>4]]; fg = pens[vdp->pal_ind16[colour>>4]];
bg = Machine->pens[vdp->pal_ind16[colour&15]]; bg = pens[vdp->pal_ind16[colour&15]];
for (xx=0;xx<8;xx++) for (xx=0;xx<8;xx++)
{ {
*ln++ = (pattern & 0x80) ? fg : bg; *ln++ = (pattern & 0x80) ? fg : bg;
@ -379,7 +379,7 @@ V9938_MODE_FUNC (mode_graphic4)
if ( (vdp->contReg[2] & 0x20) && (V9938_SECOND_FIELD) ) if ( (vdp->contReg[2] & 0x20) && (V9938_SECOND_FIELD) )
nametbl += 0x8000; nametbl += 0x8000;
pen_bg = Machine->pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]]; pen_bg = pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]];
#if (V9938_WIDTH < 512) #if (V9938_WIDTH < 512)
xx = vdp->offset_x; xx = vdp->offset_x;
#else #else
@ -390,12 +390,12 @@ V9938_MODE_FUNC (mode_graphic4)
for (x=0;x<128;x++) for (x=0;x<128;x++)
{ {
colour = *nametbl++; colour = *nametbl++;
pen = Machine->pens[vdp->pal_ind16[colour>>4]]; pen = pens[vdp->pal_ind16[colour>>4]];
*ln++ = pen; *ln++ = pen;
#if (V9938_WIDTH > 512) #if (V9938_WIDTH > 512)
*ln++ = pen; *ln++ = pen;
#endif #endif
pen = Machine->pens[vdp->pal_ind16[colour&15]]; pen = pens[vdp->pal_ind16[colour&15]];
*ln++ = pen; *ln++ = pen;
#if (V9938_WIDTH > 512) #if (V9938_WIDTH > 512)
*ln++ = pen; *ln++ = pen;
@ -428,8 +428,8 @@ V9938_MODE_FUNC (mode_graphic5)
nametbl += 0x8000; nametbl += 0x8000;
#if (V9938_WIDTH > 512) #if (V9938_WIDTH > 512)
pen_bg1[0] = Machine->pens[vdp->pal_ind16[(vdp->contReg[7]&0x03)]]; pen_bg1[0] = pens[vdp->pal_ind16[(vdp->contReg[7]&0x03)]];
pen_bg0[0] = Machine->pens[vdp->pal_ind16[((vdp->contReg[7]>>2)&0x03)]]; pen_bg0[0] = pens[vdp->pal_ind16[((vdp->contReg[7]>>2)&0x03)]];
xx = vdp->offset_x; xx = vdp->offset_x;
while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; } while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; }
@ -438,8 +438,8 @@ V9938_MODE_FUNC (mode_graphic5)
for (;x<4;x++) for (;x<4;x++)
{ {
pen_bg0[x] = Machine->pens[vdp->pal_ind16[x]]; pen_bg0[x] = pens[vdp->pal_ind16[x]];
pen_bg1[x] = Machine->pens[vdp->pal_ind16[x]]; pen_bg1[x] = pens[vdp->pal_ind16[x]];
} }
for (x=0;x<128;x++) for (x=0;x<128;x++)
@ -452,17 +452,17 @@ V9938_MODE_FUNC (mode_graphic5)
*ln++ = pen_bg1[(colour&3)]; *ln++ = pen_bg1[(colour&3)];
} }
pen_bg1[0] = Machine->pens[vdp->pal_ind16[(vdp->contReg[7]&0x03)]]; pen_bg1[0] = pens[vdp->pal_ind16[(vdp->contReg[7]&0x03)]];
pen_bg0[0] = Machine->pens[vdp->pal_ind16[((vdp->contReg[7]>>2)&0x03)]]; pen_bg0[0] = pens[vdp->pal_ind16[((vdp->contReg[7]>>2)&0x03)]];
xx = 16 - vdp->offset_x; xx = 16 - vdp->offset_x;
while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; } while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; }
#else #else
pen_bg0[0] = Machine->pens[vdp->pal_ind16[((vdp->contReg[7]>>2)&0x03)]]; pen_bg0[0] = pens[vdp->pal_ind16[((vdp->contReg[7]>>2)&0x03)]];
x = (vdp->contReg[8] & 0x20) ? 0 : 1; x = (vdp->contReg[8] & 0x20) ? 0 : 1;
for (;x<4;x++) for (;x<4;x++)
pen_bg0[x] = Machine->pens[vdp->pal_ind16[x]]; pen_bg0[x] = pens[vdp->pal_ind16[x]];
xx = vdp->offset_x; xx = vdp->offset_x;
while (xx--) *ln++ = pen_bg0[0]; while (xx--) *ln++ = pen_bg0[0];
@ -474,7 +474,7 @@ V9938_MODE_FUNC (mode_graphic5)
*ln++ = pen_bg0[(colour>>2)&3]; *ln++ = pen_bg0[(colour>>2)&3];
} }
pen_bg0[0] = Machine->pens[vdp->pal_ind16[((vdp->contReg[7]>>2)&0x03)]]; pen_bg0[0] = pens[vdp->pal_ind16[((vdp->contReg[7]>>2)&0x03)]];
xx = 16 - vdp->offset_x; xx = 16 - vdp->offset_x;
while (xx--) *ln++ = pen_bg0[0]; while (xx--) *ln++ = pen_bg0[0];
#endif #endif
@ -498,7 +498,7 @@ V9938_MODE_FUNC (mode_graphic6)
if ( (vdp->contReg[2] & 0x20) && (V9938_SECOND_FIELD) ) if ( (vdp->contReg[2] & 0x20) && (V9938_SECOND_FIELD) )
nametbl += 0x10000; nametbl += 0x10000;
pen_bg = Machine->pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]]; pen_bg = pens[vdp->pal_ind16[(vdp->contReg[7]&0x0f)]];
#if (V9938_WIDTH < 512) #if (V9938_WIDTH < 512)
xx = vdp->offset_x; xx = vdp->offset_x;
#else #else
@ -512,14 +512,14 @@ V9938_MODE_FUNC (mode_graphic6)
{ {
nametbl++; nametbl++;
colour = vdp->vram[((nametbl&1) << 16) | (nametbl>>1)]; colour = vdp->vram[((nametbl&1) << 16) | (nametbl>>1)];
fg0 = Machine->pens[vdp->pal_ind16[colour>>4]]; fg0 = pens[vdp->pal_ind16[colour>>4]];
#if (V9938_WIDTH < 512) #if (V9938_WIDTH < 512)
*ln++ = fg0; *ln++ = fg0; *ln++ = fg0; *ln++ = fg0;
*ln++ = fg0; *ln++ = fg0; *ln++ = fg0; *ln++ = fg0;
*ln++ = fg0; *ln++ = fg0; *ln++ = fg0; *ln++ = fg0;
*ln++ = fg0; *ln++ = fg0; *ln++ = fg0; *ln++ = fg0;
#else #else
fg1 = Machine->pens[vdp->pal_ind16[colour&15]]; fg1 = pens[vdp->pal_ind16[colour&15]];
*ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
*ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
*ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
@ -533,9 +533,9 @@ V9938_MODE_FUNC (mode_graphic6)
for (x=0;x<256;x++) for (x=0;x<256;x++)
{ {
colour = vdp->vram[((nametbl&1) << 16) | (nametbl>>1)]; colour = vdp->vram[((nametbl&1) << 16) | (nametbl>>1)];
*ln++ = Machine->pens[vdp->pal_ind16[colour>>4]]; *ln++ = pens[vdp->pal_ind16[colour>>4]];
#if (V9938_WIDTH > 512) #if (V9938_WIDTH > 512)
*ln++ = Machine->pens[vdp->pal_ind16[colour&15]]; *ln++ = pens[vdp->pal_ind16[colour&15]];
#endif #endif
nametbl++; nametbl++;
} }
@ -563,7 +563,7 @@ V9938_MODE_FUNC (mode_graphic7)
if ( (vdp->contReg[2] & 0x20) && (V9938_SECOND_FIELD) ) if ( (vdp->contReg[2] & 0x20) && (V9938_SECOND_FIELD) )
nametbl += 0x10000; nametbl += 0x10000;
pen_bg = Machine->pens[vdp->pal_ind256[vdp->contReg[7]]]; pen_bg = pens[vdp->pal_ind256[vdp->contReg[7]]];
#if (V9938_WIDTH < 512) #if (V9938_WIDTH < 512)
xx = vdp->offset_x; xx = vdp->offset_x;
#else #else
@ -577,7 +577,7 @@ V9938_MODE_FUNC (mode_graphic7)
{ {
nametbl++; nametbl++;
colour = vdp->vram[((nametbl&1) << 16) | (nametbl>>1)]; colour = vdp->vram[((nametbl&1) << 16) | (nametbl>>1)];
pen = Machine->pens[vdp->pal_ind256[colour]]; pen = pens[vdp->pal_ind256[colour]];
*ln++ = pen; *ln++ = pen; *ln++ = pen; *ln++ = pen;
*ln++ = pen; *ln++ = pen; *ln++ = pen; *ln++ = pen;
*ln++ = pen; *ln++ = pen; *ln++ = pen; *ln++ = pen;
@ -596,7 +596,7 @@ V9938_MODE_FUNC (mode_graphic7)
for (x=0;x<256;x++) for (x=0;x<256;x++)
{ {
colour = vdp->vram[((nametbl&1) << 16) | (nametbl>>1)]; colour = vdp->vram[((nametbl&1) << 16) | (nametbl>>1)];
pen = Machine->pens[vdp->pal_ind256[colour]]; pen = pens[vdp->pal_ind256[colour]];
*ln++ = pen; *ln++ = pen;
#if (V9938_WIDTH > 512) #if (V9938_WIDTH > 512)
*ln++ = pen; *ln++ = pen;
@ -618,8 +618,8 @@ V9938_MODE_FUNC (mode_unknown)
PEN_TYPE fg, bg; PEN_TYPE fg, bg;
int x; int x;
fg = Machine->pens[vdp->pal_ind16[vdp->contReg[7] >> 4]]; fg = pens[vdp->pal_ind16[vdp->contReg[7] >> 4]];
bg = Machine->pens[vdp->pal_ind16[vdp->contReg[7] & 15]]; bg = pens[vdp->pal_ind16[vdp->contReg[7] & 15]];
#if (V9938_WIDTH < 512) #if (V9938_WIDTH < 512)
x = vdp->offset_x; x = vdp->offset_x;
@ -656,9 +656,9 @@ V9938_SPRITE_FUNC (default_draw_sprite)
{ {
if (col[i] & 0x80) if (col[i] & 0x80)
{ {
*ln++ = Machine->pens[vdp->pal_ind16[col[i]&0x0f]]; *ln++ = pens[vdp->pal_ind16[col[i]&0x0f]];
#if (V9938_WIDTH > 512) #if (V9938_WIDTH > 512)
*ln++ = Machine->pens[vdp->pal_ind16[col[i]&0x0f]]; *ln++ = pens[vdp->pal_ind16[col[i]&0x0f]];
#endif #endif
} }
else else
@ -682,9 +682,9 @@ V9938_SPRITE_FUNC (graphic5_draw_sprite)
{ {
if (col[i] & 0x80) if (col[i] & 0x80)
{ {
*ln++ = Machine->pens[vdp->pal_ind16[(col[i]>>2)&0x03]]; *ln++ = pens[vdp->pal_ind16[(col[i]>>2)&0x03]];
#if (V9938_WIDTH > 512) #if (V9938_WIDTH > 512)
*ln++ = Machine->pens[vdp->pal_ind16[col[i]&0x03]]; *ln++ = pens[vdp->pal_ind16[col[i]&0x03]];
#endif #endif
} }
else else
@ -714,9 +714,9 @@ V9938_SPRITE_FUNC (graphic7_draw_sprite)
{ {
if (col[i] & 0x80) if (col[i] & 0x80)
{ {
*ln++ = Machine->pens[g7_ind16[col[i]&0x0f]]; *ln++ = pens[g7_ind16[col[i]&0x0f]];
#if (V9938_WIDTH > 512) #if (V9938_WIDTH > 512)
*ln++ = Machine->pens[g7_ind16[col[i]&0x0f]]; *ln++ = pens[g7_ind16[col[i]&0x0f]];
#endif #endif
} }
else else

View File

@ -262,8 +262,9 @@ static void amiga_stream_update(void *param, stream_sample_t **inputs, stream_sa
* *
*************************************/ *************************************/
void *amiga_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( amiga_sh_start )
{ {
running_machine *machine = device->machine;
int i; int i;
/* allocate a new audio state */ /* allocate a new audio state */
@ -272,7 +273,7 @@ void *amiga_sh_start(int clock, const custom_sound_interface *config)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
audio_state->channel[i].index = i; audio_state->channel[i].index = i;
audio_state->channel[i].irq_timer = timer_alloc(Machine, signal_irq, NULL); audio_state->channel[i].irq_timer = timer_alloc(machine, signal_irq, NULL);
} }
/* create the stream */ /* create the stream */

View File

@ -208,7 +208,7 @@ static void attckufo_update (void *param,stream_sample_t **inputs, stream_sample
/************************************/ /************************************/
void *attckufo_custom_start(int clock, const custom_sound_interface *config) CUSTOM_START( attckufo_custom_start )
{ {
int i; int i;

View File

@ -271,7 +271,7 @@ static void bzone_sound_update(void *param, stream_sample_t **inputs, stream_sam
} }
} }
void *bzone_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( bzone_sh_start )
{ {
int i; int i;

View File

@ -1,5 +1,4 @@
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "sound/ay8910.h" #include "sound/ay8910.h"
#include "sound/samples.h" #include "sound/samples.h"
#include "includes/cclimber.h" #include "includes/cclimber.h"
@ -14,19 +13,20 @@
static INT16 *samplebuf; /* buffer to decode samples at run time */ static INT16 *samplebuf; /* buffer to decode samples at run time */
static void cclimber_sh_start(void) static SAMPLES_START( cclimber_sh_start )
{ {
running_machine *machine = device->machine;
samplebuf = 0; samplebuf = 0;
if (memory_region(Machine, "samples")) if (memory_region(machine, "samples"))
samplebuf = auto_malloc(sizeof(*samplebuf)*2*memory_region_length(Machine, "samples")); samplebuf = auto_malloc(sizeof(*samplebuf)*2*memory_region_length(machine, "samples"));
} }
static void cclimber_play_sample(int start,int freq,int volume) static void cclimber_play_sample(running_machine *machine, int start,int freq,int volume)
{ {
int len; int len;
int romlen = memory_region_length(Machine, "samples"); int romlen = memory_region_length(machine, "samples");
const UINT8 *rom = memory_region(Machine, "samples"); const UINT8 *rom = memory_region(machine, "samples");
if (!rom) return; if (!rom) return;
@ -73,7 +73,7 @@ WRITE8_HANDLER( cclimber_sample_trigger_w )
if (data == 0) if (data == 0)
return; return;
cclimber_play_sample(32 * sample_num,sample_freq,sample_volume); cclimber_play_sample(space->machine, 32 * sample_num,sample_freq,sample_volume);
} }

View File

@ -161,13 +161,15 @@ static const samples_interface spacewar_samples_interface =
static void spacewar_sound_w(UINT8 sound_val, UINT8 bits_changed) static void spacewar_sound_w(UINT8 sound_val, UINT8 bits_changed)
{ {
running_machine *machine = Machine;
/* Explosion - rising edge */ /* Explosion - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01)) if (SOUNDVAL_RISING_EDGE(0x01))
sample_start(0, (mame_rand(Machine) & 1) ? 0 : 6, 0); sample_start(0, (mame_rand(machine) & 1) ? 0 : 6, 0);
/* Fire sound - rising edge */ /* Fire sound - rising edge */
if (SOUNDVAL_RISING_EDGE(0x02)) if (SOUNDVAL_RISING_EDGE(0x02))
sample_start(1, (mame_rand(Machine) & 1) ? 1 : 7, 0); sample_start(1, (mame_rand(machine) & 1) ? 1 : 7, 0);
/* Player 1 thrust - 0=on, 1=off */ /* Player 1 thrust - 0=on, 1=off */
if (SOUNDVAL_FALLING_EDGE(0x04)) if (SOUNDVAL_FALLING_EDGE(0x04))
@ -833,7 +835,8 @@ static const samples_interface starcas_samples_interface =
static void starcas_sound_w(UINT8 sound_val, UINT8 bits_changed) static void starcas_sound_w(UINT8 sound_val, UINT8 bits_changed)
{ {
UINT32 target_pitch; running_machine *machine = Machine;
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10)) if (SOUNDVAL_RISING_EDGE(0x10))
@ -873,14 +876,14 @@ static void starcas_sound_w(UINT8 sound_val, UINT8 bits_changed)
target_pitch = 0x5800 + (target_pitch << 12); target_pitch = 0x5800 + (target_pitch << 12);
/* once per frame slide the pitch toward the target */ /* once per frame slide the pitch toward the target */
if (video_screen_get_frame_number(Machine->primary_screen) > last_frame) if (video_screen_get_frame_number(machine->primary_screen) > last_frame)
{ {
if (current_pitch > target_pitch) if (current_pitch > target_pitch)
current_pitch -= 225; current_pitch -= 225;
if (current_pitch < target_pitch) if (current_pitch < target_pitch)
current_pitch += 150; current_pitch += 150;
sample_set_freq(4, current_pitch); sample_set_freq(4, current_pitch);
last_frame = video_screen_get_frame_number(Machine->primary_screen); last_frame = video_screen_get_frame_number(machine->primary_screen);
} }
/* remember the previous value */ /* remember the previous value */
@ -945,7 +948,8 @@ static const samples_interface solarq_samples_interface =
static void solarq_sound_w(UINT8 sound_val, UINT8 bits_changed) static void solarq_sound_w(UINT8 sound_val, UINT8 bits_changed)
{ {
static float target_volume, current_volume; running_machine *machine = Machine;
static float target_volume, current_volume;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10)) if (SOUNDVAL_RISING_EDGE(0x10))
@ -976,7 +980,7 @@ static void solarq_sound_w(UINT8 sound_val, UINT8 bits_changed)
target_volume = 0; target_volume = 0;
/* ramp the thrust volume */ /* ramp the thrust volume */
if (sample_playing(2) && video_screen_get_frame_number(Machine->primary_screen) > last_frame) if (sample_playing(2) && video_screen_get_frame_number(machine->primary_screen) > last_frame)
{ {
if (current_volume > target_volume) if (current_volume > target_volume)
current_volume -= 0.078f; current_volume -= 0.078f;
@ -986,7 +990,7 @@ static void solarq_sound_w(UINT8 sound_val, UINT8 bits_changed)
sample_set_volume(2, current_volume); sample_set_volume(2, current_volume);
else else
sample_stop(2); sample_stop(2);
last_frame = video_screen_get_frame_number(Machine->primary_screen); last_frame = video_screen_get_frame_number(machine->primary_screen);
} }
/* fire - falling edge */ /* fire - falling edge */
@ -1213,7 +1217,8 @@ static const samples_interface wotw_samples_interface =
static void wotw_sound_w(UINT8 sound_val, UINT8 bits_changed) static void wotw_sound_w(UINT8 sound_val, UINT8 bits_changed)
{ {
UINT32 target_pitch; running_machine *machine = Machine;
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10)) if (SOUNDVAL_RISING_EDGE(0x10))
@ -1253,14 +1258,14 @@ static void wotw_sound_w(UINT8 sound_val, UINT8 bits_changed)
target_pitch = 0x10000 + (target_pitch << 12); target_pitch = 0x10000 + (target_pitch << 12);
/* once per frame slide the pitch toward the target */ /* once per frame slide the pitch toward the target */
if (video_screen_get_frame_number(Machine->primary_screen) > last_frame) if (video_screen_get_frame_number(machine->primary_screen) > last_frame)
{ {
if (current_pitch > target_pitch) if (current_pitch > target_pitch)
current_pitch -= 300; current_pitch -= 300;
if (current_pitch < target_pitch) if (current_pitch < target_pitch)
current_pitch += 200; current_pitch += 200;
sample_set_freq(4, current_pitch); sample_set_freq(4, current_pitch);
last_frame = video_screen_get_frame_number(Machine->primary_screen); last_frame = video_screen_get_frame_number(machine->primary_screen);
} }
/* remember the previous value */ /* remember the previous value */
@ -1325,7 +1330,8 @@ static const samples_interface wotwc_samples_interface =
static void wotwc_sound_w(UINT8 sound_val, UINT8 bits_changed) static void wotwc_sound_w(UINT8 sound_val, UINT8 bits_changed)
{ {
UINT32 target_pitch; running_machine *machine = Machine;
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10)) if (SOUNDVAL_RISING_EDGE(0x10))
@ -1365,14 +1371,14 @@ static void wotwc_sound_w(UINT8 sound_val, UINT8 bits_changed)
target_pitch = 0x10000 + (target_pitch << 12); target_pitch = 0x10000 + (target_pitch << 12);
/* once per frame slide the pitch toward the target */ /* once per frame slide the pitch toward the target */
if (video_screen_get_frame_number(Machine->primary_screen) > last_frame) if (video_screen_get_frame_number(machine->primary_screen) > last_frame)
{ {
if (current_pitch > target_pitch) if (current_pitch > target_pitch)
current_pitch -= 300; current_pitch -= 300;
if (current_pitch < target_pitch) if (current_pitch < target_pitch)
current_pitch += 200; current_pitch += 200;
sample_set_freq(4, current_pitch); sample_set_freq(4, current_pitch);
last_frame = video_screen_get_frame_number(Machine->primary_screen); last_frame = video_screen_get_frame_number(machine->primary_screen);
} }
/* remember the previous value */ /* remember the previous value */
@ -1424,12 +1430,14 @@ static TIMER_CALLBACK( synced_sound_w )
static void demon_sound_w(UINT8 sound_val, UINT8 bits_changed) static void demon_sound_w(UINT8 sound_val, UINT8 bits_changed)
{ {
running_machine *machine = Machine;
/* all inputs are inverted */ /* all inputs are inverted */
sound_val = ~sound_val; sound_val = ~sound_val;
/* watch for a 0->1 edge on bit 4 ("shift in") to clock in the new data */ /* watch for a 0->1 edge on bit 4 ("shift in") to clock in the new data */
if ((bits_changed & 0x10) && (sound_val & 0x10)) if ((bits_changed & 0x10) && (sound_val & 0x10))
timer_call_after_resynch(Machine, NULL, sound_val & 0x0f, synced_sound_w); timer_call_after_resynch(machine, NULL, sound_val & 0x0f, synced_sound_w);
} }

View File

@ -97,7 +97,7 @@ static void cps3_stream_update(void *param, stream_sample_t **inputs, stream_sam
} }
void *cps3_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( cps3_sh_start )
{ {
/* Allocate the stream */ /* Allocate the stream */
cps3_stream = stream_create(0, 2, clock / 384, NULL, cps3_stream_update); cps3_stream = stream_create(0, 2, clock / 384, NULL, cps3_stream_update);

View File

@ -7,7 +7,6 @@
#include "driver.h" #include "driver.h"
#include "machine/rescap.h" #include "machine/rescap.h"
#include "streams.h" #include "streams.h"
#include "deprecat.h"
#include "cpu/m6502/m6502.h" #include "cpu/m6502/m6502.h"
#include "machine/6821pia.h" #include "machine/6821pia.h"
#include "machine/6532riot.h" #include "machine/6532riot.h"
@ -338,7 +337,7 @@ static void exidy_stream_update(void *param, stream_sample_t **inputs, stream_sa
* *
*************************************/ *************************************/
void *exidy_sh6840_sh_start(int clock, const custom_sound_interface *config) static void *common_sh_start(int clock, const custom_sound_interface *config)
{ {
int sample_rate = SH8253_CLOCK; int sample_rate = SH8253_CLOCK;
@ -347,12 +346,17 @@ void *exidy_sh6840_sh_start(int clock, const custom_sound_interface *config)
/* allocate the stream */ /* allocate the stream */
exidy_stream = stream_create(0, 1, sample_rate, NULL, exidy_stream_update); exidy_stream = stream_create(0, 1, sample_rate, NULL, exidy_stream_update);
return auto_malloc(1);
}
CUSTOM_START( exidy_sh6840_sh_start )
{
/* indicate no additional hardware */ /* indicate no additional hardware */
has_sh8253 = FALSE; has_sh8253 = FALSE;
has_tms5220 = FALSE; has_tms5220 = FALSE;
has_mc3417 = FALSE; has_mc3417 = FALSE;
return auto_malloc(1); return common_sh_start(clock, config);
} }
@ -363,7 +367,7 @@ void *exidy_sh6840_sh_start(int clock, const custom_sound_interface *config)
* *
*************************************/ *************************************/
void exidy_sh6840_sh_reset(void *token) static void common_sh_reset(void *token)
{ {
/* 6840 */ /* 6840 */
memset(sh6840_timer, 0, sizeof(sh6840_timer)); memset(sh6840_timer, 0, sizeof(sh6840_timer));
@ -381,6 +385,11 @@ void exidy_sh6840_sh_reset(void *token)
sh6840_LFSR_3 = 0xffffffff; sh6840_LFSR_3 = 0xffffffff;
} }
CUSTOM_RESET( exidy_sh6840_sh_reset )
{
common_sh_reset(token);
}
/************************************* /*************************************
@ -626,13 +635,14 @@ static const pia6821_interface venture_pia_1_intf =
}; };
static void *venture_common_sh_start(int clock, const custom_sound_interface *config, int _has_tms5220) static void *venture_common_sh_start(const device_config *device, int clock, const custom_sound_interface *config, int _has_tms5220)
{ {
running_machine *machine = device->machine;
int i; int i;
void *ret = exidy_sh6840_sh_start(clock, config); void *ret = common_sh_start(clock, config);
riot = device_list_find_by_tag(Machine->config->devicelist, RIOT6532, "riot"); riot = device_list_find_by_tag(machine->config->devicelist, RIOT6532, "riot");
has_sh8253 = TRUE; has_sh8253 = TRUE;
has_tms5220 = _has_tms5220; has_tms5220 = _has_tms5220;
@ -641,7 +651,7 @@ static void *venture_common_sh_start(int clock, const custom_sound_interface *co
has_mc3417 = FALSE; has_mc3417 = FALSE;
for (i = 0; i < MAX_SOUND; i++) for (i = 0; i < MAX_SOUND; i++)
{ {
if (Machine->config->sound[i].type == SOUND_MC3417) if (machine->config->sound[i].type == SOUND_MC3417)
has_mc3417 = TRUE; has_mc3417 = TRUE;
} }
@ -652,18 +662,18 @@ static void *venture_common_sh_start(int clock, const custom_sound_interface *co
} }
static void *venture_sh_start(int clock, const custom_sound_interface *config) static CUSTOM_START( venture_sh_start )
{ {
pia_config(0, &venture_pia_0_intf); pia_config(0, &venture_pia_0_intf);
pia_config(1, &venture_pia_1_intf); pia_config(1, &venture_pia_1_intf);
return venture_common_sh_start(clock, config, FALSE); return venture_common_sh_start(device, clock, config, FALSE);
} }
static void venture_sh_reset(void *token) static CUSTOM_RESET( venture_sh_reset )
{ {
exidy_sh6840_sh_reset(token); common_sh_reset(token);
/* PIA */ /* PIA */
pia_reset(); pia_reset();
@ -848,19 +858,23 @@ static const pia6821_interface victory_pia_e5_intf =
}; };
static void *victory_sh_start(int clock, const custom_sound_interface *config) static CUSTOM_START( victory_sh_start )
{ {
running_machine *machine = device->machine;
pia_config(1, &victory_pia_e5_intf); pia_config(1, &victory_pia_e5_intf);
state_save_register_global(Machine, victory_sound_response_ack_clk); state_save_register_global(machine, victory_sound_response_ack_clk);
return venture_common_sh_start(clock, config, TRUE); return venture_common_sh_start(device, clock, config, TRUE);
} }
static void victory_sh_reset(void *token) static CUSTOM_RESET( victory_sh_reset )
{ {
venture_sh_reset(token); common_sh_reset(token);
pia_reset();
device_reset(riot);
memset(sh8253_timer, 0, sizeof(sh8253_timer));
/* the flip-flop @ F4 is reset */ /* the flip-flop @ F4 is reset */
victory_sound_response_ack_clk = 0; victory_sound_response_ack_clk = 0;

View File

@ -8,7 +8,6 @@
***************************************************************************/ ***************************************************************************/
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "streams.h" #include "streams.h"
#include "exidy440.h" #include "exidy440.h"
@ -113,12 +112,12 @@ static const int channel_bits[4] =
/* function prototypes */ /* function prototypes */
static void channel_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int length); static void channel_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int length);
static void m6844_finished(int ch); static void m6844_finished(int ch);
static void play_cvsd(int ch); static void play_cvsd(running_machine *machine, int ch);
static void stop_cvsd(int ch); static void stop_cvsd(int ch);
static void reset_sound_cache(void); static void reset_sound_cache(void);
static INT16 *add_to_sound_cache(UINT8 *input, int address, int length, int bits, int frequency); static INT16 *add_to_sound_cache(UINT8 *input, int address, int length, int bits, int frequency);
static INT16 *find_or_add_to_sound_cache(int address, int length, int bits, int frequency); static INT16 *find_or_add_to_sound_cache(running_machine *machine, int address, int length, int bits, int frequency);
static void decode_and_filter_cvsd(UINT8 *data, int bytes, int maskbits, int frequency, INT16 *dest); static void decode_and_filter_cvsd(UINT8 *data, int bytes, int maskbits, int frequency, INT16 *dest);
static void fir_filter(INT32 *input, INT16 *output, int count); static void fir_filter(INT32 *input, INT16 *output, int count);
@ -131,15 +130,16 @@ static void fir_filter(INT32 *input, INT16 *output, int count);
* *
*************************************/ *************************************/
static void *exidy440_sh_start(int clock, const custom_sound_interface *config) static CUSTOM_START( exidy440_sh_start )
{ {
running_machine *machine = device->machine;
int i, length; int i, length;
/* reset the system */ /* reset the system */
exidy440_sound_command = 0; exidy440_sound_command = 0;
exidy440_sound_command_ack = 1; exidy440_sound_command_ack = 1;
state_save_register_global(Machine, exidy440_sound_command); state_save_register_global(machine, exidy440_sound_command);
state_save_register_global(Machine, exidy440_sound_command_ack); state_save_register_global(machine, exidy440_sound_command_ack);
/* reset the 6844 */ /* reset the 6844 */
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
@ -151,9 +151,9 @@ static void *exidy440_sh_start(int clock, const custom_sound_interface *config)
m6844_interrupt = 0x00; m6844_interrupt = 0x00;
m6844_chain = 0x00; m6844_chain = 0x00;
state_save_register_global(Machine, m6844_priority); state_save_register_global(machine, m6844_priority);
state_save_register_global(Machine, m6844_interrupt); state_save_register_global(machine, m6844_interrupt);
state_save_register_global(Machine, m6844_chain); state_save_register_global(machine, m6844_chain);
channel_frequency[0] = clock; /* channels 0 and 1 are run by FCLK */ channel_frequency[0] = clock; /* channels 0 and 1 are run by FCLK */
channel_frequency[1] = clock; channel_frequency[1] = clock;
@ -164,7 +164,7 @@ static void *exidy440_sh_start(int clock, const custom_sound_interface *config)
stream = stream_create(0, 2, clock, NULL, channel_update); stream = stream_create(0, 2, clock, NULL, channel_update);
/* allocate the sample cache */ /* allocate the sample cache */
length = memory_region_length(Machine, "cvsd") * 16 + MAX_CACHE_ENTRIES * sizeof(sound_cache_entry); length = memory_region_length(machine, "cvsd") * 16 + MAX_CACHE_ENTRIES * sizeof(sound_cache_entry);
sound_cache = auto_malloc(length); sound_cache = auto_malloc(length);
/* determine the hard end of the cache and reset */ /* determine the hard end of the cache and reset */
@ -189,7 +189,7 @@ static void *exidy440_sh_start(int clock, const custom_sound_interface *config)
* *
*************************************/ *************************************/
static void exidy440_sh_stop(void *token) static CUSTOM_STOP( exidy440_sh_stop )
{ {
if (SOUND_LOG && debuglog) if (SOUND_LOG && debuglog)
fclose(debuglog); fclose(debuglog);
@ -574,7 +574,7 @@ static WRITE8_HANDLER( m6844_w )
m6844_channel[i].start_counter = m6844_channel[i].counter; m6844_channel[i].start_counter = m6844_channel[i].counter;
/* generate and play the sample */ /* generate and play the sample */
play_cvsd(i); play_cvsd(space->machine, i);
} }
/* if we're going inactive... */ /* if we're going inactive... */
@ -645,7 +645,7 @@ static INT16 *add_to_sound_cache(UINT8 *input, int address, int length, int bits
} }
static INT16 *find_or_add_to_sound_cache(int address, int length, int bits, int frequency) static INT16 *find_or_add_to_sound_cache(running_machine *machine, int address, int length, int bits, int frequency)
{ {
sound_cache_entry *current; sound_cache_entry *current;
@ -653,7 +653,7 @@ static INT16 *find_or_add_to_sound_cache(int address, int length, int bits, int
if (current->address == address && current->length == length && current->bits == bits && current->frequency == frequency) if (current->address == address && current->length == length && current->bits == bits && current->frequency == frequency)
return current->data; return current->data;
return add_to_sound_cache(&memory_region(Machine, "cvsd")[address], address, length, bits, frequency); return add_to_sound_cache(&memory_region(machine, "cvsd")[address], address, length, bits, frequency);
} }
@ -664,7 +664,7 @@ static INT16 *find_or_add_to_sound_cache(int address, int length, int bits, int
* *
*************************************/ *************************************/
static void play_cvsd(int ch) static void play_cvsd(running_machine *machine, int ch)
{ {
sound_channel_data *channel = &sound_channel[ch]; sound_channel_data *channel = &sound_channel[ch];
int address = m6844_channel[ch].address; int address = m6844_channel[ch].address;
@ -682,7 +682,7 @@ static void play_cvsd(int ch)
address += 0x18000; address += 0x18000;
/* compute the base address in the converted samples array */ /* compute the base address in the converted samples array */
base = find_or_add_to_sound_cache(address, length, channel_bits[ch], channel_frequency[ch]); base = find_or_add_to_sound_cache(machine, address, length, channel_bits[ch], channel_frequency[ch]);
if (!base) if (!base)
return; return;

View File

@ -5,7 +5,6 @@ Fighting Basketball PCM unsigned 8 bit mono samples
*/ */
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "sound/samples.h" #include "sound/samples.h"
static INT16 *samplebuf; static INT16 *samplebuf;
@ -16,10 +15,11 @@ WRITE8_HANDLER( fghtbskt_samples_w )
sample_start_raw(0, samplebuf + ((data & 0xf0) << 8), 0x2000, 8000, 0); sample_start_raw(0, samplebuf + ((data & 0xf0) << 8), 0x2000, 8000, 0);
} }
void fghtbskt_sh_start(void) SAMPLES_START( fghtbskt_sh_start )
{ {
int i, len = memory_region_length(Machine, "samples"); running_machine *machine = device->machine;
UINT8 *ROM = memory_region(Machine, "samples"); int i, len = memory_region_length(machine, "samples");
UINT8 *ROM = memory_region(machine, "samples");
samplebuf = auto_malloc(len * 2); samplebuf = auto_malloc(len * 2);

View File

@ -5,7 +5,6 @@
***************************************************************************/ ***************************************************************************/
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "streams.h" #include "streams.h"
#include "includes/flower.h" #include "includes/flower.h"
@ -155,8 +154,9 @@ static void flower_update_mono(void *param, stream_sample_t **inputs, stream_sam
void * flower_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( flower_sh_start )
{ {
running_machine *machine = device->machine;
sound_channel *voice; sound_channel *voice;
int i; int i;
@ -175,15 +175,15 @@ void * flower_sh_start(int clock, const custom_sound_interface *config)
num_voices = 8; num_voices = 8;
last_channel = channel_list + num_voices; last_channel = channel_list + num_voices;
sound_rom1 = memory_region(Machine, "sound1"); sound_rom1 = memory_region(machine, "sound1");
sound_rom2 = memory_region(Machine, "sound2"); sound_rom2 = memory_region(machine, "sound2");
/* start with sound enabled, many games don't have a sound enable register */ /* start with sound enabled, many games don't have a sound enable register */
sound_enable = 1; sound_enable = 1;
/* save globals */ /* save globals */
state_save_register_item(Machine, "flower_custom", NULL, 0, num_voices); state_save_register_item(machine, "flower_custom", NULL, 0, num_voices);
state_save_register_item(Machine, "flower_custom", NULL, 0, sound_enable); state_save_register_item(machine, "flower_custom", NULL, 0, sound_enable);
/* reset all the voices */ /* reset all the voices */
for (i = 0; i < num_voices; i++) for (i = 0; i < num_voices; i++)
@ -195,12 +195,12 @@ void * flower_sh_start(int clock, const custom_sound_interface *config)
voice->counter = 0; voice->counter = 0;
voice->rom_offset = 0; voice->rom_offset = 0;
state_save_register_item(Machine, "flower_custom", NULL, i+1, voice->frequency); state_save_register_item(machine, "flower_custom", NULL, i+1, voice->frequency);
state_save_register_item(Machine, "flower_custom", NULL, i+1, voice->counter); state_save_register_item(machine, "flower_custom", NULL, i+1, voice->counter);
state_save_register_item(Machine, "flower_custom", NULL, i+1, voice->volume); state_save_register_item(machine, "flower_custom", NULL, i+1, voice->volume);
state_save_register_item(Machine, "flower_custom", NULL, i+1, voice->oneshot); state_save_register_item(machine, "flower_custom", NULL, i+1, voice->oneshot);
state_save_register_item(Machine, "flower_custom", NULL, i+1, voice->oneshotplaying); state_save_register_item(machine, "flower_custom", NULL, i+1, voice->oneshotplaying);
state_save_register_item(Machine, "flower_custom", NULL, i+1, voice->rom_offset); state_save_register_item(machine, "flower_custom", NULL, i+1, voice->rom_offset);
} }
return auto_malloc(1); return auto_malloc(1);

View File

@ -1,6 +1,5 @@
#include "driver.h" #include "driver.h"
#include "streams.h" #include "streams.h"
#include "deprecat.h"
#include "sound/samples.h" #include "sound/samples.h"
#include "includes/galaxian.h" #include "includes/galaxian.h"
@ -182,8 +181,9 @@ WRITE8_HANDLER( galaxian_shoot_enable_w )
} }
static void galaxian_sh_start(void) static SAMPLES_START( galaxian_sh_start )
{ {
running_machine *machine = device->machine;
int i, j, sweep, charge, countdown, generator, bit1, bit2; int i, j, sweep, charge, countdown, generator, bit1, bit2;
freq = MAXFREQ; freq = MAXFREQ;
@ -197,7 +197,7 @@ static void galaxian_sh_start(void)
noisewave = auto_malloc(NOISE_LENGTH * sizeof(INT16)); noisewave = auto_malloc(NOISE_LENGTH * sizeof(INT16));
#define SHOOT_SEC 2 #define SHOOT_SEC 2
shoot_rate = Machine->sample_rate; shoot_rate = machine->sample_rate;
shoot_length = SHOOT_SEC * shoot_rate; shoot_length = SHOOT_SEC * shoot_rate;
shootwave = auto_malloc(shoot_length * sizeof(INT16)); shootwave = auto_malloc(shoot_length * sizeof(INT16));
@ -392,22 +392,22 @@ static void galaxian_sh_start(void)
sample_set_volume(CHANNEL_LFO+2,0); sample_set_volume(CHANNEL_LFO+2,0);
sample_start_raw(CHANNEL_LFO+2,backgroundwave,ARRAY_LENGTH(backgroundwave),1000,1); sample_start_raw(CHANNEL_LFO+2,backgroundwave,ARRAY_LENGTH(backgroundwave),1000,1);
noisetimer = timer_alloc(Machine, noise_timer_cb, NULL); noisetimer = timer_alloc(machine, noise_timer_cb, NULL);
timer_adjust_periodic(noisetimer, ATTOTIME_IN_NSEC((155000+22000)/100*693*22), 0, ATTOTIME_IN_NSEC((155000+22000)/100*693*22)); timer_adjust_periodic(noisetimer, ATTOTIME_IN_NSEC((155000+22000)/100*693*22), 0, ATTOTIME_IN_NSEC((155000+22000)/100*693*22));
lfotimer = timer_alloc(Machine, lfo_timer_cb, NULL); lfotimer = timer_alloc(machine, lfo_timer_cb, NULL);
timer_pulse(Machine, video_screen_get_frame_period(Machine->primary_screen), NULL, 0, galaxian_sh_update); timer_pulse(machine, video_screen_get_frame_period(machine->primary_screen), NULL, 0, galaxian_sh_update);
state_save_register_global(Machine, freq); state_save_register_global(machine, freq);
state_save_register_global(Machine, noise_enable); state_save_register_global(machine, noise_enable);
state_save_register_global(Machine, noisevolume); state_save_register_global(machine, noisevolume);
state_save_register_global(Machine, last_port2); state_save_register_global(machine, last_port2);
state_save_register_global(Machine, pitch); state_save_register_global(machine, pitch);
state_save_register_global(Machine, vol); state_save_register_global(machine, vol);
state_save_register_global(Machine, counter); state_save_register_global(machine, counter);
state_save_register_global(Machine, countdown); state_save_register_global(machine, countdown);
state_save_register_global_array(Machine, lfobit); state_save_register_global_array(machine, lfobit);
} }

View File

@ -9,7 +9,6 @@
#include <math.h> #include <math.h>
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "streams.h" #include "streams.h"
#include "sound/custom.h" #include "sound/custom.h"
#include "includes/warpwarp.h" #include "includes/warpwarp.h"
@ -113,8 +112,9 @@ static void geebee_sound_update(void *param, stream_sample_t **inputs, stream_sa
} }
} }
void *geebee_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( geebee_sh_start )
{ {
running_machine *machine = device->machine;
int i; int i;
decay = (UINT16 *)auto_malloc(32768 * sizeof(INT16)); decay = (UINT16 *)auto_malloc(32768 * sizeof(INT16));
@ -126,6 +126,6 @@ void *geebee_sh_start(int clock, const custom_sound_interface *config)
channel = stream_create(0, 1, 18432000 / 3 / 2 / 384, NULL, geebee_sound_update); channel = stream_create(0, 1, 18432000 / 3 / 2 / 384, NULL, geebee_sound_update);
vcount = 0; vcount = 0;
volume_timer = timer_alloc(Machine, volume_decay, NULL); volume_timer = timer_alloc(machine, volume_decay, NULL);
return auto_malloc(1); return auto_malloc(1);
} }

View File

@ -7,7 +7,6 @@
***************************************************************************/ ***************************************************************************/
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "streams.h" #include "streams.h"
#include "includes/gomoku.h" #include "includes/gomoku.h"
@ -163,8 +162,9 @@ static void gomoku_update_mono(void *param, stream_sample_t **inputs, stream_sam
void *gomoku_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( gomoku_sh_start )
{ {
running_machine *machine = device->machine;
sound_channel *voice; sound_channel *voice;
int ch; int ch;
@ -183,7 +183,7 @@ void *gomoku_sh_start(int clock, const custom_sound_interface *config)
num_voices = MAX_VOICES; num_voices = MAX_VOICES;
last_channel = channel_list + num_voices; last_channel = channel_list + num_voices;
sound_rom = memory_region(Machine, "gomoku"); sound_rom = memory_region(machine, "gomoku");
/* start with sound enabled, many games don't have a sound enable register */ /* start with sound enabled, many games don't have a sound enable register */
sound_enable = 1; sound_enable = 1;

View File

@ -7,7 +7,6 @@
#include "driver.h" #include "driver.h"
#include "streams.h" #include "streams.h"
#include "gridlee.h" #include "gridlee.h"
#include "deprecat.h"
#include "sound/custom.h" #include "sound/custom.h"
#include "sound/samples.h" #include "sound/samples.h"
@ -64,12 +63,14 @@ static void gridlee_stream_update(void *param, stream_sample_t **inputs, stream_
* *
*************************************/ *************************************/
void *gridlee_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( gridlee_sh_start )
{ {
/* allocate the stream */ running_machine *machine = device->machine;
gridlee_stream = stream_create(0, 1, Machine->sample_rate, NULL, gridlee_stream_update);
freq_to_step = (double)(1 << 24) / (double)Machine->sample_rate; /* allocate the stream */
gridlee_stream = stream_create(0, 1, machine->sample_rate, NULL, gridlee_stream_update);
freq_to_step = (double)(1 << 24) / (double)machine->sample_rate;
return auto_malloc(1); return auto_malloc(1);
} }

View File

@ -133,7 +133,7 @@ static void leland_update(void *param, stream_sample_t **inputs, stream_sample_t
} }
void *leland_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( leland_sh_start )
{ {
/* reset globals */ /* reset globals */
dac_buffer[0] = dac_buffer[1] = NULL; dac_buffer[0] = dac_buffer[1] = NULL;
@ -503,15 +503,16 @@ static void leland_80186_extern_update(void *param, stream_sample_t **inputs, st
static TIMER_CALLBACK( internal_timer_int ); static TIMER_CALLBACK( internal_timer_int );
static TIMER_CALLBACK( dma_timer_callback ); static TIMER_CALLBACK( dma_timer_callback );
void *leland_80186_sh_start(int clock, const custom_sound_interface *config) void *common_sh_start(int clock, const custom_sound_interface *config)
{ {
const address_space *dmaspace = cputag_get_address_space(Machine, "audio", ADDRESS_SPACE_PROGRAM); running_machine *machine = Machine;
const address_space *dmaspace = cputag_get_address_space(machine, "audio", ADDRESS_SPACE_PROGRAM);
int i; int i;
/* determine which sound hardware is installed */ /* determine which sound hardware is installed */
has_ym2151 = 0; has_ym2151 = 0;
for (i = 0; i < MAX_SOUND; i++) for (i = 0; i < MAX_SOUND; i++)
if (Machine->config->sound[i].type == SOUND_YM2151) if (machine->config->sound[i].type == SOUND_YM2151)
has_ym2151 = 1; has_ym2151 = 1;
/* allocate separate streams for the DMA and non-DMA DACs */ /* allocate separate streams for the DMA and non-DMA DACs */
@ -521,35 +522,36 @@ void *leland_80186_sh_start(int clock, const custom_sound_interface *config)
/* if we have a 2151, install an externally driven DAC stream */ /* if we have a 2151, install an externally driven DAC stream */
if (has_ym2151) if (has_ym2151)
{ {
ext_base = memory_region(Machine, "dac"); ext_base = memory_region(machine, "dac");
extern_stream = stream_create(0, 1, OUTPUT_RATE, NULL, leland_80186_extern_update); extern_stream = stream_create(0, 1, OUTPUT_RATE, NULL, leland_80186_extern_update);
} }
/* by default, we're not redline racer */
is_redline = 0;
/* create timers here so they stick around */ /* create timers here so they stick around */
i80186.timer[0].int_timer = timer_alloc(Machine, internal_timer_int, NULL); i80186.timer[0].int_timer = timer_alloc(machine, internal_timer_int, NULL);
i80186.timer[1].int_timer = timer_alloc(Machine, internal_timer_int, NULL); i80186.timer[1].int_timer = timer_alloc(machine, internal_timer_int, NULL);
i80186.timer[2].int_timer = timer_alloc(Machine, internal_timer_int, NULL); i80186.timer[2].int_timer = timer_alloc(machine, internal_timer_int, NULL);
i80186.timer[0].time_timer = timer_alloc(Machine, NULL, NULL); i80186.timer[0].time_timer = timer_alloc(machine, NULL, NULL);
i80186.timer[1].time_timer = timer_alloc(Machine, NULL, NULL); i80186.timer[1].time_timer = timer_alloc(machine, NULL, NULL);
i80186.timer[2].time_timer = timer_alloc(Machine, NULL, NULL); i80186.timer[2].time_timer = timer_alloc(machine, NULL, NULL);
i80186.dma[0].finish_timer = timer_alloc(Machine, dma_timer_callback, NULL); i80186.dma[0].finish_timer = timer_alloc(machine, dma_timer_callback, NULL);
i80186.dma[1].finish_timer = timer_alloc(Machine, dma_timer_callback, NULL); i80186.dma[1].finish_timer = timer_alloc(machine, dma_timer_callback, NULL);
for (i = 0; i < 9; i++) for (i = 0; i < 9; i++)
counter[i].timer = timer_alloc(Machine, NULL, NULL); counter[i].timer = timer_alloc(machine, NULL, NULL);
return auto_malloc(1); return auto_malloc(1);
} }
CUSTOM_START( leland_80186_sh_start )
void *redline_80186_sh_start(int clock, const custom_sound_interface *config) {
is_redline = 0;
return common_sh_start(clock, config);
}
CUSTOM_START( redline_80186_sh_start )
{ {
void *result = leland_80186_sh_start(clock, config);
is_redline = 1; is_redline = 1;
return result; return common_sh_start(clock, config);
} }
@ -647,7 +649,7 @@ static IRQ_CALLBACK(int_callback)
} }
static void update_interrupt_state(void) static void update_interrupt_state(running_machine *machine)
{ {
int i, j, new_vector = 0; int i, j, new_vector = 0;
@ -726,9 +728,9 @@ generate_int:
/* generate the appropriate interrupt */ /* generate the appropriate interrupt */
i80186.intr.poll_status = 0x8000 | new_vector; i80186.intr.poll_status = 0x8000 | new_vector;
if (!i80186.intr.pending) if (!i80186.intr.pending)
cpu_set_input_line(Machine->cpu[2], 0, ASSERT_LINE); cpu_set_input_line(machine->cpu[2], 0, ASSERT_LINE);
i80186.intr.pending = 1; i80186.intr.pending = 1;
if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", attotime_to_double(timer_get_time(Machine)), new_vector); if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", attotime_to_double(timer_get_time(machine)), new_vector);
} }
@ -813,7 +815,7 @@ static TIMER_CALLBACK( internal_timer_int )
if (t->control & 0x2000) if (t->control & 0x2000)
{ {
i80186.intr.status |= 0x01 << which; i80186.intr.status |= 0x01 << which;
update_interrupt_state(); update_interrupt_state(machine);
if (LOG_TIMER) logerror(" Generating timer interrupt\n"); if (LOG_TIMER) logerror(" Generating timer interrupt\n");
} }
@ -1011,7 +1013,7 @@ static TIMER_CALLBACK( dma_timer_callback )
{ {
if (LOG_DMA) logerror("DMA%d timer callback - requesting interrupt: count = %04X, source = %04X\n", which, d->count, d->source); if (LOG_DMA) logerror("DMA%d timer callback - requesting interrupt: count = %04X, source = %04X\n", which, d->count, d->source);
i80186.intr.request |= 0x04 << which; i80186.intr.request |= 0x04 << which;
update_interrupt_state(); update_interrupt_state(machine);
} }
} }
@ -1281,7 +1283,7 @@ static WRITE16_HANDLER( i80186_internal_port_w )
case 0x22/2: case 0x22/2:
if (LOG_PORTS) logerror("%05X:80186 EOI = %04X & %04X\n", cpu_get_pc(space->cpu), data, mem_mask); if (LOG_PORTS) logerror("%05X:80186 EOI = %04X & %04X\n", cpu_get_pc(space->cpu), data, mem_mask);
handle_eoi(space->machine, 0x8000); handle_eoi(space->machine, 0x8000);
update_interrupt_state(); update_interrupt_state(space->machine);
break; break;
case 0x24/2: case 0x24/2:
@ -1301,32 +1303,32 @@ static WRITE16_HANDLER( i80186_internal_port_w )
i80186.intr.ext[1] = (i80186.intr.ext[1] & ~0x08) | ((data >> 2) & 0x08); i80186.intr.ext[1] = (i80186.intr.ext[1] & ~0x08) | ((data >> 2) & 0x08);
i80186.intr.ext[2] = (i80186.intr.ext[2] & ~0x08) | ((data >> 3) & 0x08); i80186.intr.ext[2] = (i80186.intr.ext[2] & ~0x08) | ((data >> 3) & 0x08);
i80186.intr.ext[3] = (i80186.intr.ext[3] & ~0x08) | ((data >> 4) & 0x08); i80186.intr.ext[3] = (i80186.intr.ext[3] & ~0x08) | ((data >> 4) & 0x08);
update_interrupt_state(); update_interrupt_state(space->machine);
break; break;
case 0x2a/2: case 0x2a/2:
if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X & %04X\n", cpu_get_pc(space->cpu), data, mem_mask); if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X & %04X\n", cpu_get_pc(space->cpu), data, mem_mask);
i80186.intr.priority_mask = data & 0x0007; i80186.intr.priority_mask = data & 0x0007;
update_interrupt_state(); update_interrupt_state(space->machine);
break; break;
case 0x2c/2: case 0x2c/2:
if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X & %04X\n", cpu_get_pc(space->cpu), data, mem_mask); if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X & %04X\n", cpu_get_pc(space->cpu), data, mem_mask);
i80186.intr.in_service = data & 0x00ff; i80186.intr.in_service = data & 0x00ff;
update_interrupt_state(); update_interrupt_state(space->machine);
break; break;
case 0x2e/2: case 0x2e/2:
if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X & %04X\n", cpu_get_pc(space->cpu), data, mem_mask); if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X & %04X\n", cpu_get_pc(space->cpu), data, mem_mask);
i80186.intr.request = (i80186.intr.request & ~0x00c0) | (data & 0x00c0); i80186.intr.request = (i80186.intr.request & ~0x00c0) | (data & 0x00c0);
update_interrupt_state(); update_interrupt_state(space->machine);
break; break;
case 0x30/2: case 0x30/2:
if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X & %04X\n", cpu_get_pc(space->cpu), data, mem_mask); if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X & %04X\n", cpu_get_pc(space->cpu), data, mem_mask);
i80186.intr.status = (i80186.intr.status & ~0x8000) | (data & 0x8000); i80186.intr.status = (i80186.intr.status & ~0x8000) | (data & 0x8000);
i80186.intr.status = (i80186.intr.status & ~0x0007) | (data & 0x0007); i80186.intr.status = (i80186.intr.status & ~0x0007) | (data & 0x0007);
update_interrupt_state(); update_interrupt_state(space->machine);
break; break;
case 0x32/2: case 0x32/2:
@ -1695,7 +1697,7 @@ WRITE8_HANDLER( leland_80186_control_w )
if ((diff & 0x80) && (data & 0x80)) if ((diff & 0x80) && (data & 0x80))
leland_80186_reset(); leland_80186_reset();
update_interrupt_state(); update_interrupt_state(space->machine);
} }

View File

@ -40,7 +40,7 @@ static UINT8 latched_0c03 = 0;
/************************************/ /************************************/
/* Sound handler start */ /* Sound handler start */
/************************************/ /************************************/
void meadows_sh_start(void) SAMPLES_START( meadows_sh_start )
{ {
meadows_0c00 = meadows_0c01 = meadows_0c02 = meadows_0c03 = 0; meadows_0c00 = meadows_0c01 = meadows_0c02 = meadows_0c03 = 0;
meadows_dac = 0; meadows_dac = 0;

View File

@ -520,8 +520,9 @@ WRITE8_HANDLER( phoenix_sound_control_b_w )
mm6221aa_tune_w(0, data >> 6); mm6221aa_tune_w(0, data >> 6);
} }
void *phoenix_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( phoenix_sh_start )
{ {
running_machine *machine = device->machine;
int i, j; int i, j;
UINT32 shiftreg; UINT32 shiftreg;
@ -542,9 +543,9 @@ void *phoenix_sh_start(int clock, const custom_sound_interface *config)
poly18[i] = bits; poly18[i] = bits;
} }
channel = stream_create(0, 1, Machine->sample_rate, 0, phoenix_sound_update); channel = stream_create(0, 1, machine->sample_rate, 0, phoenix_sound_update);
state_save_register_global_pointer(Machine, poly18, (1ul << (18-5)) ); state_save_register_global_pointer(machine, poly18, (1ul << (18-5)) );
/* a dummy token */ /* a dummy token */
return auto_malloc(1); return auto_malloc(1);

View File

@ -455,8 +455,9 @@ WRITE8_HANDLER( pleiads_sound_control_c_w )
sound_latch_c = data; sound_latch_c = data;
} }
static void *common_sh_start(const custom_sound_interface *config, const char *name) static void *common_sh_start(const device_config *device, const custom_sound_interface *config, const char *name)
{ {
running_machine *machine = device->machine;
int i, j; int i, j;
UINT32 shiftreg; UINT32 shiftreg;
@ -477,13 +478,13 @@ static void *common_sh_start(const custom_sound_interface *config, const char *n
poly18[i] = bits; poly18[i] = bits;
} }
channel = stream_create(0, 1, Machine->sample_rate, NULL, pleiads_sound_update); channel = stream_create(0, 1, machine->sample_rate, NULL, pleiads_sound_update);
/* just a dummy alloc to make the caller happy */ /* just a dummy alloc to make the caller happy */
return auto_malloc(1); return auto_malloc(1);
} }
void *pleiads_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( pleiads_sh_start )
{ {
/* The real values are _unknown_! /* The real values are _unknown_!
* I took the ones from Naughty Boy / Pop Flamer * I took the ones from Naughty Boy / Pop Flamer
@ -541,10 +542,10 @@ void *pleiads_sh_start(int clock, const custom_sound_interface *config)
freq = 1.44 / ((100000+2*1000) * 0.01e-6) = approx. 1412 Hz */ freq = 1.44 / ((100000+2*1000) * 0.01e-6) = approx. 1412 Hz */
noise_freq = 1412; /* higher noise rate than popflame/naughtyb??? */ noise_freq = 1412; /* higher noise rate than popflame/naughtyb??? */
return common_sh_start(config, "Custom (Pleiads)"); return common_sh_start(device, config, "Custom (Pleiads)");
} }
void *naughtyb_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( naughtyb_sh_start )
{ {
/* charge 10u??? through 330K (R??) -> 3.3s */ /* charge 10u??? through 330K (R??) -> 3.3s */
pa5_charge_time = 3.3; pa5_charge_time = 3.3;
@ -598,10 +599,10 @@ void *naughtyb_sh_start(int clock, const custom_sound_interface *config)
freq = 1.44 / ((200000+2*1000) * 0.01e-6) = approx. 713 Hz */ freq = 1.44 / ((200000+2*1000) * 0.01e-6) = approx. 713 Hz */
noise_freq = 713; noise_freq = 713;
return common_sh_start(config, "Custom (Naughty Boy)"); return common_sh_start(device, config, "Custom (Naughty Boy)");
} }
void *popflame_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( popflame_sh_start )
{ {
/* charge 10u (C63 in Pop Flamer) through 330K -> 3.3s */ /* charge 10u (C63 in Pop Flamer) through 330K -> 3.3s */
pa5_charge_time = 3.3; pa5_charge_time = 3.3;
@ -655,5 +656,5 @@ void *popflame_sh_start(int clock, const custom_sound_interface *config)
freq = 1.44 / ((200000+2*1000) * 0.01e-6) = approx. 713 Hz */ freq = 1.44 / ((200000+2*1000) * 0.01e-6) = approx. 713 Hz */
noise_freq = 713; noise_freq = 713;
return common_sh_start(config, "Custom (Pop Flamer)"); return common_sh_start(device, config, "Custom (Pop Flamer)");
} }

View File

@ -100,7 +100,7 @@ static void engine_sound_update(void *param, stream_sample_t **inputs, stream_sa
/************************************/ /************************************/
/* Sound handler start */ /* Sound handler start */
/************************************/ /************************************/
void *polepos_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( polepos_sh_start )
{ {
stream = stream_create(0, 1, OUTPUT_RATE, NULL, engine_sound_update); stream = stream_create(0, 1, OUTPUT_RATE, NULL, engine_sound_update);
sample_msb = sample_lsb = 0; sample_msb = sample_lsb = 0;
@ -122,7 +122,7 @@ void *polepos_sh_start(int clock, const custom_sound_interface *config)
/************************************/ /************************************/
/* Sound handler reset */ /* Sound handler reset */
/************************************/ /************************************/
void polepos_sh_reset(void *token) CUSTOM_RESET( polepos_sh_reset )
{ {
int loop; int loop;
for (loop = 0; loop < 3; loop++) filter2_reset(&filter_engine[loop]); for (loop = 0; loop < 3; loop++) filter2_reset(&filter_engine[loop]);

View File

@ -22,7 +22,7 @@ static int freq1, freq2, channel_playing1, channel_playing2;
static INT16 backgroundwave[SAMPLE_LENGTH]; static INT16 backgroundwave[SAMPLE_LENGTH];
void polyplay_sh_start(void) SAMPLES_START( polyplay_sh_start )
{ {
int i; int i;

View File

@ -169,7 +169,7 @@ static void redbaron_sound_update(void *param, stream_sample_t **inputs, stream_
} }
} }
void *redbaron_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( redbaron_sh_start )
{ {
int i; int i;

View File

@ -627,7 +627,7 @@ void rockola_set_music_clock(double clock_time)
tone_clock = 0; tone_clock = 0;
} }
void *rockola_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( rockola_sh_start )
{ {
// adjusted // adjusted
rockola_set_music_freq(43000); rockola_set_music_freq(43000);

View File

@ -339,7 +339,7 @@ WRITE8_HANDLER( astrob_sound_w )
*************************************/ *************************************/
static SOUND_START( 005 ); static SOUND_START( 005 );
static void *sega005_custom_start(int clock, const custom_sound_interface *config); static CUSTOM_START( sega005_custom_start );
static void sega005_stream_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples); static void sega005_stream_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
static TIMER_CALLBACK( sega005_auto_timer ); static TIMER_CALLBACK( sega005_auto_timer );
static WRITE8_DEVICE_HANDLER( sega005_sound_a_w ); static WRITE8_DEVICE_HANDLER( sega005_sound_a_w );
@ -577,17 +577,19 @@ static WRITE8_DEVICE_HANDLER( sega005_sound_b_w )
* *
*************************************/ *************************************/
static void *sega005_custom_start(int clock, const custom_sound_interface *config) static CUSTOM_START( sega005_custom_start )
{ {
running_machine *machine = device->machine;
/* create the stream */ /* create the stream */
sega005_stream = stream_create(0, 1, SEGA005_COUNTER_FREQ, NULL, sega005_stream_update); sega005_stream = stream_create(0, 1, SEGA005_COUNTER_FREQ, NULL, sega005_stream_update);
/* create a timer for the 555 */ /* create a timer for the 555 */
sega005_sound_timer = timer_alloc(Machine, sega005_auto_timer, NULL); sega005_sound_timer = timer_alloc(machine, sega005_auto_timer, NULL);
/* set the initial sound data */ /* set the initial sound data */
sound_data = 0x00; sound_data = 0x00;
sega005_update_sound_data(Machine); sega005_update_sound_data(machine);
return auto_malloc(1); return auto_malloc(1);
} }

View File

@ -640,13 +640,14 @@ static void usb_stream_update(void *param, stream_sample_t **inputs, stream_samp
} }
static void *usb_start(int clock, const custom_sound_interface *config) static CUSTOM_START( usb_start )
{ {
running_machine *machine = Machine;
filter_state temp; filter_state temp;
int tchan, tgroup; int tchan, tgroup;
/* find the CPU we are associated with */ /* find the CPU we are associated with */
usb.cpu = cputag_get_cpu(Machine, "usb"); usb.cpu = cputag_get_cpu(machine, "usb");
assert(usb.cpu != NULL); assert(usb.cpu != NULL);
/* allocate work RAM */ /* allocate work RAM */
@ -685,11 +686,11 @@ static void *usb_start(int clock, const custom_sound_interface *config)
configure_filter(&usb.final_filter, 100e3, 4.7e-6); configure_filter(&usb.final_filter, 100e3, 4.7e-6);
/* register for save states */ /* register for save states */
state_save_register_item(Machine, "usb", NULL, 0, usb.in_latch); state_save_register_item(machine, "usb", NULL, 0, usb.in_latch);
state_save_register_item(Machine, "usb", NULL, 0, usb.out_latch); state_save_register_item(machine, "usb", NULL, 0, usb.out_latch);
state_save_register_item(Machine, "usb", NULL, 0, usb.last_p2_value); state_save_register_item(machine, "usb", NULL, 0, usb.last_p2_value);
state_save_register_item(Machine, "usb", NULL, 0, usb.work_ram_bank); state_save_register_item(machine, "usb", NULL, 0, usb.work_ram_bank);
state_save_register_item(Machine, "usb", NULL, 0, usb.t1_clock); state_save_register_item(machine, "usb", NULL, 0, usb.t1_clock);
for (tgroup = 0; tgroup < 3; tgroup++) for (tgroup = 0; tgroup < 3; tgroup++)
{ {
@ -697,36 +698,36 @@ static void *usb_start(int clock, const custom_sound_interface *config)
for (tchan = 0; tchan < 3; tchan++) for (tchan = 0; tchan < 3; tchan++)
{ {
timer8253_channel *channel = &group->chan[tchan]; timer8253_channel *channel = &group->chan[tchan];
state_save_register_item(Machine, "usb", NULL, tgroup * 3 + tchan, channel->holding); state_save_register_item(machine, "usb", NULL, tgroup * 3 + tchan, channel->holding);
state_save_register_item(Machine, "usb", NULL, tgroup * 3 + tchan, channel->latchmode); state_save_register_item(machine, "usb", NULL, tgroup * 3 + tchan, channel->latchmode);
state_save_register_item(Machine, "usb", NULL, tgroup * 3 + tchan, channel->latchtoggle); state_save_register_item(machine, "usb", NULL, tgroup * 3 + tchan, channel->latchtoggle);
state_save_register_item(Machine, "usb", NULL, tgroup * 3 + tchan, channel->clockmode); state_save_register_item(machine, "usb", NULL, tgroup * 3 + tchan, channel->clockmode);
state_save_register_item(Machine, "usb", NULL, tgroup * 3 + tchan, channel->bcdmode); state_save_register_item(machine, "usb", NULL, tgroup * 3 + tchan, channel->bcdmode);
state_save_register_item(Machine, "usb", NULL, tgroup * 3 + tchan, channel->output); state_save_register_item(machine, "usb", NULL, tgroup * 3 + tchan, channel->output);
state_save_register_item(Machine, "usb", NULL, tgroup * 3 + tchan, channel->lastgate); state_save_register_item(machine, "usb", NULL, tgroup * 3 + tchan, channel->lastgate);
state_save_register_item(Machine, "usb", NULL, tgroup * 3 + tchan, channel->gate); state_save_register_item(machine, "usb", NULL, tgroup * 3 + tchan, channel->gate);
state_save_register_item(Machine, "usb", NULL, tgroup * 3 + tchan, channel->subcount); state_save_register_item(machine, "usb", NULL, tgroup * 3 + tchan, channel->subcount);
state_save_register_item(Machine, "usb", NULL, tgroup * 3 + tchan, channel->count); state_save_register_item(machine, "usb", NULL, tgroup * 3 + tchan, channel->count);
state_save_register_item(Machine, "usb", NULL, tgroup * 3 + tchan, channel->remain); state_save_register_item(machine, "usb", NULL, tgroup * 3 + tchan, channel->remain);
} }
state_save_register_item_array(Machine, "usb", NULL, tgroup, group->env); state_save_register_item_array(machine, "usb", NULL, tgroup, group->env);
state_save_register_item(Machine, "usb", NULL, tgroup, group->chan_filter[0].capval); state_save_register_item(machine, "usb", NULL, tgroup, group->chan_filter[0].capval);
state_save_register_item(Machine, "usb", NULL, tgroup, group->chan_filter[1].capval); state_save_register_item(machine, "usb", NULL, tgroup, group->chan_filter[1].capval);
state_save_register_item(Machine, "usb", NULL, tgroup, group->gate1.capval); state_save_register_item(machine, "usb", NULL, tgroup, group->gate1.capval);
state_save_register_item(Machine, "usb", NULL, tgroup, group->gate2.capval); state_save_register_item(machine, "usb", NULL, tgroup, group->gate2.capval);
state_save_register_item(Machine, "usb", NULL, tgroup, group->config); state_save_register_item(machine, "usb", NULL, tgroup, group->config);
} }
state_save_register_item_array(Machine, "usb", NULL, 0, usb.timer_mode); state_save_register_item_array(machine, "usb", NULL, 0, usb.timer_mode);
state_save_register_item(Machine, "usb", NULL, 0, usb.noise_shift); state_save_register_item(machine, "usb", NULL, 0, usb.noise_shift);
state_save_register_item(Machine, "usb", NULL, 0, usb.noise_state); state_save_register_item(machine, "usb", NULL, 0, usb.noise_state);
state_save_register_item(Machine, "usb", NULL, 0, usb.noise_subcount); state_save_register_item(machine, "usb", NULL, 0, usb.noise_subcount);
state_save_register_item(Machine, "usb", NULL, 0, usb.final_filter.capval); state_save_register_item(machine, "usb", NULL, 0, usb.final_filter.capval);
state_save_register_item(Machine, "usb", NULL, 0, usb.noise_filters[0].capval); state_save_register_item(machine, "usb", NULL, 0, usb.noise_filters[0].capval);
state_save_register_item(Machine, "usb", NULL, 0, usb.noise_filters[1].capval); state_save_register_item(machine, "usb", NULL, 0, usb.noise_filters[1].capval);
state_save_register_item(Machine, "usb", NULL, 0, usb.noise_filters[2].capval); state_save_register_item(machine, "usb", NULL, 0, usb.noise_filters[2].capval);
state_save_register_item(Machine, "usb", NULL, 0, usb.noise_filters[3].capval); state_save_register_item(machine, "usb", NULL, 0, usb.noise_filters[3].capval);
state_save_register_item(Machine, "usb", NULL, 0, usb.noise_filters[4].capval); state_save_register_item(machine, "usb", NULL, 0, usb.noise_filters[4].capval);
return usb.stream; return usb.stream;
} }

View File

@ -33,7 +33,6 @@
***************************************************************************/ ***************************************************************************/
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "streams.h" #include "streams.h"
#include "audio/seibu.h" #include "audio/seibu.h"
#include "sound/3812intf.h" #include "sound/3812intf.h"
@ -169,8 +168,9 @@ static void seibu_adpcm_callback(void *param, stream_sample_t **inputs, stream_s
} }
} }
static void *seibu_adpcm_start(int clock, const custom_sound_interface *config) static CUSTOM_START( seibu_adpcm_start )
{ {
running_machine *machine = device->machine;
int i; int i;
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
@ -180,14 +180,14 @@ static void *seibu_adpcm_start(int clock, const custom_sound_interface *config)
state->allocated = 1; state->allocated = 1;
state->playing = 0; state->playing = 0;
state->stream = stream_create(0, 1, clock, state, seibu_adpcm_callback); state->stream = stream_create(0, 1, clock, state, seibu_adpcm_callback);
state->base = memory_region(Machine, "adpcm"); state->base = memory_region(machine, "adpcm");
reset_adpcm(&state->adpcm); reset_adpcm(&state->adpcm);
return state; return state;
} }
return NULL; return NULL;
} }
static void seibu_adpcm_stop(void *token) static CUSTOM_STOP( seibu_adpcm_stop )
{ {
struct seibu_adpcm_state *state = token; struct seibu_adpcm_state *state = token;
state->allocated = 0; state->allocated = 0;

View File

@ -1,5 +1,4 @@
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "sound/samples.h" #include "sound/samples.h"
#include "includes/senjyo.h" #include "includes/senjyo.h"
@ -71,9 +70,10 @@ static TIMER_CALLBACK( senjyo_sh_update )
} }
void senjyo_sh_start(void) SAMPLES_START( senjyo_sh_start )
{ {
int i; running_machine *machine = device->machine;
int i;
_single = (INT16 *)auto_malloc(SINGLE_LENGTH*2); _single = (INT16 *)auto_malloc(SINGLE_LENGTH*2);
@ -84,5 +84,5 @@ void senjyo_sh_start(void)
sample_set_volume(0,0); sample_set_volume(0,0);
sample_start_raw(0,_single,SINGLE_LENGTH,single_rate,1); sample_start_raw(0,_single,SINGLE_LENGTH,single_rate,1);
timer_pulse(Machine, video_screen_get_frame_period(Machine->primary_screen), NULL, 0, senjyo_sh_update); timer_pulse(machine, video_screen_get_frame_period(machine->primary_screen), NULL, 0, senjyo_sh_update);
} }

View File

@ -27,7 +27,6 @@
#include <math.h> #include <math.h>
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "streams.h" #include "streams.h"
#include "includes/snes.h" #include "includes/snes.h"
@ -1135,12 +1134,13 @@ static TIMER_CALLBACK( snes_spc_timer )
} }
} }
void *snes_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( snes_sh_start )
{ {
running_machine *machine = device->machine;
UINT8 ii; UINT8 ii;
/* put IPL image at the top of RAM */ /* put IPL image at the top of RAM */
memcpy(snes_ipl_region, memory_region(Machine, "user5"), 64); memcpy(snes_ipl_region, memory_region(machine, "user5"), 64);
/* default to ROM visible */ /* default to ROM visible */
spc_ram[0xf1] = 0x80; spc_ram[0xf1] = 0x80;
@ -1155,13 +1155,13 @@ void *snes_sh_start(int clock, const custom_sound_interface *config)
channel = stream_create( 0, 2, 32000, NULL, snes_sh_update ); channel = stream_create( 0, 2, 32000, NULL, snes_sh_update );
/* Initialize the timers */ /* Initialize the timers */
timers[0].timer = timer_alloc(Machine, snes_spc_timer , NULL); timers[0].timer = timer_alloc(machine, snes_spc_timer , NULL);
timer_adjust_periodic( timers[0].timer, ATTOTIME_IN_HZ(8000), 0, ATTOTIME_IN_HZ(8000) ); timer_adjust_periodic( timers[0].timer, ATTOTIME_IN_HZ(8000), 0, ATTOTIME_IN_HZ(8000) );
timer_enable( timers[0].timer, 0 ); timer_enable( timers[0].timer, 0 );
timers[1].timer = timer_alloc(Machine, snes_spc_timer , NULL); timers[1].timer = timer_alloc(machine, snes_spc_timer , NULL);
timer_adjust_periodic( timers[1].timer, ATTOTIME_IN_HZ(8000), 1, ATTOTIME_IN_HZ(8000) ); timer_adjust_periodic( timers[1].timer, ATTOTIME_IN_HZ(8000), 1, ATTOTIME_IN_HZ(8000) );
timer_enable( timers[1].timer, 0 ); timer_enable( timers[1].timer, 0 );
timers[2].timer = timer_alloc(Machine, snes_spc_timer , NULL); timers[2].timer = timer_alloc(machine, snes_spc_timer , NULL);
timer_adjust_periodic( timers[2].timer, ATTOTIME_IN_HZ(64000), 2, ATTOTIME_IN_HZ(64000) ); timer_adjust_periodic( timers[2].timer, ATTOTIME_IN_HZ(64000), 2, ATTOTIME_IN_HZ(64000) );
timer_enable( timers[2].timer, 0 ); timer_enable( timers[2].timer, 0 );

View File

@ -7,7 +7,6 @@
*/ */
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "sound/samples.h" #include "sound/samples.h"
#include "includes/suna8.h" #include "includes/suna8.h"
@ -35,10 +34,11 @@ WRITE8_HANDLER( suna8_samples_number_w )
sample = data & 0xf; sample = data & 0xf;
} }
void suna8_sh_start(void) SAMPLES_START( suna8_sh_start )
{ {
int i, len = memory_region_length(Machine, "samples"); running_machine *machine = device->machine;
UINT8 *ROM = memory_region(Machine, "samples"); int i, len = memory_region_length(machine, "samples");
UINT8 *ROM = memory_region(machine, "samples");
samplebuf = auto_malloc(len * sizeof(samplebuf[0])); samplebuf = auto_malloc(len * sizeof(samplebuf[0]));

View File

@ -12,7 +12,6 @@
*/ */
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "sound/samples.h" #include "sound/samples.h"
#include "sound/dac.h" #include "sound/dac.h"
#include "targ.h" #include "targ.h"
@ -142,7 +141,7 @@ static const char *const sample_names[] =
}; };
static void common_audio_start(int freq) static void common_audio_start(running_machine *machine, int freq)
{ {
max_freq = freq; max_freq = freq;
@ -152,26 +151,28 @@ static void common_audio_start(int freq)
sample_set_volume(3, 0); sample_set_volume(3, 0);
sample_start_raw(3, sine_wave, 32, 1000, 1); sample_start_raw(3, sine_wave, 32, 1000, 1);
state_save_register_global(Machine, port_1_last); state_save_register_global(machine, port_1_last);
state_save_register_global(Machine, port_2_last); state_save_register_global(machine, port_2_last);
state_save_register_global(Machine, tone_freq); state_save_register_global(machine, tone_freq);
state_save_register_global(Machine, tone_active); state_save_register_global(machine, tone_active);
} }
static void spectar_audio_start(void) static SAMPLES_START( spectar_audio_start )
{ {
common_audio_start(SPECTAR_MAXFREQ); running_machine *machine = device->machine;
common_audio_start(machine, SPECTAR_MAXFREQ);
} }
static void targ_audio_start(void) static SAMPLES_START( targ_audio_start )
{ {
common_audio_start(TARG_MAXFREQ); running_machine *machine = device->machine;
common_audio_start(machine, TARG_MAXFREQ);
tone_pointer = 0; tone_pointer = 0;
state_save_register_global(Machine, tone_pointer); state_save_register_global(machine, tone_pointer);
} }

View File

@ -32,7 +32,6 @@
***************************************************************************/ ***************************************************************************/
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "streams.h" #include "streams.h"
#include "includes/tiamc1.h" #include "includes/tiamc1.h"
@ -281,8 +280,9 @@ static void tiamc1_sound_update(void *param, stream_sample_t **inputs, stream_sa
} }
} }
void *tiamc1_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( tiamc1_sh_start )
{ {
running_machine *machine = device->machine;
int i, j; int i, j;
timer8253_reset(&timer0); timer8253_reset(&timer0);
@ -296,19 +296,19 @@ void *tiamc1_sh_start(int clock, const custom_sound_interface *config)
struct timer8253struct *t = (i ? &timer1 : &timer0); struct timer8253struct *t = (i ? &timer1 : &timer0);
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
state_save_register_item(Machine, "channel", NULL, i * 3 + j, t->channel[j].count); state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].count);
state_save_register_item(Machine, "channel", NULL, i * 3 + j, t->channel[j].cnval); state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].cnval);
state_save_register_item(Machine, "channel", NULL, i * 3 + j, t->channel[j].bcdMode); state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].bcdMode);
state_save_register_item(Machine, "channel", NULL, i * 3 + j, t->channel[j].cntMode); state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].cntMode);
state_save_register_item(Machine, "channel", NULL, i * 3 + j, t->channel[j].valMode); state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].valMode);
state_save_register_item(Machine, "channel", NULL, i * 3 + j, t->channel[j].gate); state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].gate);
state_save_register_item(Machine, "channel", NULL, i * 3 + j, t->channel[j].output); state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].output);
state_save_register_item(Machine, "channel", NULL, i * 3 + j, t->channel[j].loadCnt); state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].loadCnt);
state_save_register_item(Machine, "channel", NULL, i * 3 + j, t->channel[j].enable); state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].enable);
} }
} }
state_save_register_global(Machine, timer1_divider); state_save_register_global(machine, timer1_divider);
return channel; return channel;
} }

View File

@ -270,16 +270,17 @@ static void tx1_stream_update(void *param, stream_sample_t **inputs, stream_samp
} }
void *tx1_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( tx1_sh_start )
{ {
running_machine *machine = device->machine;
static const int r0[4] = { 390e3, 180e3, 180e3, 180e3 }; static const int r0[4] = { 390e3, 180e3, 180e3, 180e3 };
static const int r1[3] = { 180e3, 390e3, 56e3 }; static const int r1[3] = { 180e3, 390e3, 56e3 };
static const int r2[3] = { 390e3, 390e3, 180e3 }; static const int r2[3] = { 390e3, 390e3, 180e3 };
/* Allocate the stream */ /* Allocate the stream */
stream = stream_create(0, 2, Machine->sample_rate, NULL, tx1_stream_update); stream = stream_create(0, 2, machine->sample_rate, NULL, tx1_stream_update);
freq_to_step = (double)(1 << TX1_FRAC) / (double)Machine->sample_rate; freq_to_step = (double)(1 << TX1_FRAC) / (double)machine->sample_rate;
/* Compute the engine resistor weights */ /* Compute the engine resistor weights */
compute_resistor_weights(0, 10000, -1.0, compute_resistor_weights(0, 10000, -1.0,
@ -290,7 +291,7 @@ void *tx1_sh_start(int clock, const custom_sound_interface *config)
return auto_malloc(1); return auto_malloc(1);
} }
void tx1_sh_reset(void *token) CUSTOM_RESET( tx1_sh_reset )
{ {
step0 = step1 = step2 = 0; step0 = step1 = step2 = 0;
} }
@ -491,8 +492,9 @@ static void buggyboy_stream_update(void *param, stream_sample_t **inputs, stream
} }
} }
void *buggyboy_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( buggyboy_sh_start )
{ {
running_machine *machine = device->machine;
static const int resistors[4] = { 330000, 220000, 330000, 220000 }; static const int resistors[4] = { 330000, 220000, 330000, 220000 };
double aweights[4]; double aweights[4];
int i; int i;
@ -510,13 +512,13 @@ void *buggyboy_sh_start(int clock, const custom_sound_interface *config)
buggyboy_eng_voltages[i] = combine_4_weights(aweights, BIT(tmp[i], 0), BIT(tmp[i], 1), BIT(tmp[i], 2), BIT(tmp[i], 3)); buggyboy_eng_voltages[i] = combine_4_weights(aweights, BIT(tmp[i], 0), BIT(tmp[i], 1), BIT(tmp[i], 2), BIT(tmp[i], 3));
/* Allocate the stream */ /* Allocate the stream */
stream = stream_create(0, 2, Machine->sample_rate, NULL, buggyboy_stream_update); stream = stream_create(0, 2, machine->sample_rate, NULL, buggyboy_stream_update);
freq_to_step = (double)(1 << 24) / (double)Machine->sample_rate; freq_to_step = (double)(1 << 24) / (double)machine->sample_rate;
return auto_malloc(1); return auto_malloc(1);
} }
void buggyboy_sh_reset(void *token) CUSTOM_RESET( buggyboy_sh_reset )
{ {
step0 = step1 = 0; step0 = step1 = 0;

View File

@ -9,7 +9,6 @@
#include <math.h> #include <math.h>
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "streams.h" #include "streams.h"
#include "sound/custom.h" #include "sound/custom.h"
#include "includes/warpwarp.h" #include "includes/warpwarp.h"
@ -205,8 +204,9 @@ static void warpwarp_sound_update(void *param, stream_sample_t **inputs, stream_
} }
} }
void *warpwarp_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( warpwarp_sh_start )
{ {
running_machine *machine = device->machine;
int i; int i;
decay = (INT16 *) auto_malloc(32768 * sizeof(INT16)); decay = (INT16 *) auto_malloc(32768 * sizeof(INT16));
@ -216,7 +216,7 @@ void *warpwarp_sh_start(int clock, const custom_sound_interface *config)
channel = stream_create(0, 1, CLOCK_16H, NULL, warpwarp_sound_update); channel = stream_create(0, 1, CLOCK_16H, NULL, warpwarp_sound_update);
sound_volume_timer = timer_alloc(Machine, sound_volume_decay, NULL); sound_volume_timer = timer_alloc(machine, sound_volume_decay, NULL);
music_volume_timer = timer_alloc(Machine, music_volume_decay, NULL); music_volume_timer = timer_alloc(machine, music_volume_decay, NULL);
return auto_malloc(1); return auto_malloc(1);
} }

View File

@ -7,7 +7,6 @@
***************************************************************************/ ***************************************************************************/
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "streams.h" #include "streams.h"
#include "sound/custom.h" #include "sound/custom.h"
@ -162,8 +161,9 @@ static void wiping_update_mono(void *param, stream_sample_t **inputs, stream_sam
void *wiping_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( wiping_sh_start )
{ {
running_machine *machine = device->machine;
sound_channel *voice; sound_channel *voice;
/* get stream channels */ /* get stream channels */
@ -181,8 +181,8 @@ void *wiping_sh_start(int clock, const custom_sound_interface *config)
num_voices = 8; num_voices = 8;
last_channel = channel_list + num_voices; last_channel = channel_list + num_voices;
sound_rom = memory_region(Machine, "samples"); sound_rom = memory_region(machine, "samples");
sound_prom = memory_region(Machine, "soundproms"); sound_prom = memory_region(machine, "soundproms");
/* start with sound enabled, many games don't have a sound enable register */ /* start with sound enabled, many games don't have a sound enable register */
sound_enable = 1; sound_enable = 1;

View File

@ -36,7 +36,7 @@ VIDEO_START( clshroad );
VIDEO_UPDATE( clshroad ); VIDEO_UPDATE( clshroad );
extern UINT8 *wiping_soundregs; extern UINT8 *wiping_soundregs;
void *wiping_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( wiping_sh_start );
WRITE8_HANDLER( wiping_sound_w ); WRITE8_HANDLER( wiping_sound_w );

View File

@ -206,22 +206,22 @@ static void unpack_gfx(running_machine *machine);
static DRIVER_INIT( 56_58 ) static DRIVER_INIT( 56_58 )
{ {
unpack_gfx(machine); unpack_gfx(machine);
namcoio_init(0, NAMCOIO_56XX, &intf0); namcoio_init(machine, 0, NAMCOIO_56XX, &intf0);
namcoio_init(1, NAMCOIO_58XX, &intf1); namcoio_init(machine, 1, NAMCOIO_58XX, &intf1);
} }
static DRIVER_INIT( 56_58l ) static DRIVER_INIT( 56_58l )
{ {
unpack_gfx(machine); unpack_gfx(machine);
namcoio_init(0, NAMCOIO_56XX, &intf0_lamps); namcoio_init(machine, 0, NAMCOIO_56XX, &intf0_lamps);
namcoio_init(1, NAMCOIO_58XX, &intf1); namcoio_init(machine, 1, NAMCOIO_58XX, &intf1);
} }
static DRIVER_INIT( 58_56 ) static DRIVER_INIT( 58_56 )
{ {
unpack_gfx(machine); unpack_gfx(machine);
namcoio_init(0, NAMCOIO_58XX, &intf0); namcoio_init(machine, 0, NAMCOIO_58XX, &intf0);
namcoio_init(1, NAMCOIO_56XX, &intf1); namcoio_init(machine, 1, NAMCOIO_56XX, &intf1);
} }

View File

@ -1188,7 +1188,7 @@ static DRIVER_INIT(hangplt)
gticlub_led_reg0 = gticlub_led_reg1 = 0x7f; gticlub_led_reg0 = gticlub_led_reg1 = 0x7f;
K056800_init(machine, sound_irq_callback); K056800_init(machine, sound_irq_callback);
K033906_init(); K033906_init(machine);
adc1038_init(machine); adc1038_init(machine);
} }

View File

@ -1183,6 +1183,7 @@ static void jamma_jvs_w(UINT8 data)
static int jvs_encode_data(UINT8 *in, int length) static int jvs_encode_data(UINT8 *in, int length)
{ {
running_machine *machine = Machine;
int inptr = 0; int inptr = 0;
int sum = 0; int sum = 0;
@ -1192,19 +1193,19 @@ static int jvs_encode_data(UINT8 *in, int length)
if (b == 0xe0) if (b == 0xe0)
{ {
sum += 0xd0 + 0xdf; sum += 0xd0 + 0xdf;
ppc4xx_spu_receive_byte(Machine->cpu[0], 0xd0); ppc4xx_spu_receive_byte(machine->cpu[0], 0xd0);
ppc4xx_spu_receive_byte(Machine->cpu[0], 0xdf); ppc4xx_spu_receive_byte(machine->cpu[0], 0xdf);
} }
else if (b == 0xd0) else if (b == 0xd0)
{ {
sum += 0xd0 + 0xcf; sum += 0xd0 + 0xcf;
ppc4xx_spu_receive_byte(Machine->cpu[0], 0xd0); ppc4xx_spu_receive_byte(machine->cpu[0], 0xd0);
ppc4xx_spu_receive_byte(Machine->cpu[0], 0xcf); ppc4xx_spu_receive_byte(machine->cpu[0], 0xcf);
} }
else else
{ {
sum += b; sum += b;
ppc4xx_spu_receive_byte(Machine->cpu[0], b); ppc4xx_spu_receive_byte(machine->cpu[0], b);
} }
} }
return sum; return sum;
@ -1234,6 +1235,7 @@ static int jvs_decode_data(UINT8 *in, UINT8 *out, int length)
static void jamma_jvs_cmd_exec(void) static void jamma_jvs_cmd_exec(void)
{ {
running_machine *machine = Machine;
UINT8 sync, node, byte_num; UINT8 sync, node, byte_num;
UINT8 data[1024], rdata[1024]; UINT8 data[1024], rdata[1024];
int length; int length;
@ -1293,11 +1295,11 @@ static void jamma_jvs_cmd_exec(void)
// write jvs return data // write jvs return data
sum = 0x00 + (rdata_ptr+1); sum = 0x00 + (rdata_ptr+1);
ppc4xx_spu_receive_byte(Machine->cpu[0], 0xe0); // sync ppc4xx_spu_receive_byte(machine->cpu[0], 0xe0); // sync
ppc4xx_spu_receive_byte(Machine->cpu[0], 0x00); // node ppc4xx_spu_receive_byte(machine->cpu[0], 0x00); // node
ppc4xx_spu_receive_byte(Machine->cpu[0], rdata_ptr+1); // num of bytes ppc4xx_spu_receive_byte(machine->cpu[0], rdata_ptr+1); // num of bytes
sum += jvs_encode_data(rdata, rdata_ptr); sum += jvs_encode_data(rdata, rdata_ptr);
ppc4xx_spu_receive_byte(Machine->cpu[0], sum - 1); // checksum ppc4xx_spu_receive_byte(machine->cpu[0], sum - 1); // checksum
jvs_sdata_ptr = 0; jvs_sdata_ptr = 0;
} }
@ -1323,7 +1325,7 @@ static DRIVER_INIT(hornet)
set_cgboard_texture_bank(0, 5, memory_region(machine, "user5")); set_cgboard_texture_bank(0, 5, memory_region(machine, "user5"));
K056800_init(machine, sound_irq_callback); K056800_init(machine, sound_irq_callback);
K033906_init(); K033906_init(machine);
led_reg0 = led_reg1 = 0x7f; led_reg0 = led_reg1 = 0x7f;
@ -1337,7 +1339,7 @@ static DRIVER_INIT(hornet_2board)
set_cgboard_texture_bank(1, 6, memory_region(machine, "user5")); set_cgboard_texture_bank(1, 6, memory_region(machine, "user5"));
K056800_init(machine, sound_irq_callback); K056800_init(machine, sound_irq_callback);
K033906_init(); K033906_init(machine);
led_reg0 = led_reg1 = 0x7f; led_reg0 = led_reg1 = 0x7f;

View File

@ -120,8 +120,8 @@ Dip locations verified for:
#include "sound/ay8910.h" #include "sound/ay8910.h"
#include "sound/samples.h" #include "sound/samples.h"
extern void fghtbskt_sh_start(void); SAMPLES_START( fghtbskt_sh_start );
extern WRITE8_HANDLER( fghtbskt_samples_w ); WRITE8_HANDLER( fghtbskt_samples_w );
static UINT8 *m63_videoram2, *m63_scrollram; static UINT8 *m63_videoram2, *m63_scrollram;
static int pal_bank, fg_flag, sy_offset; static int pal_bank, fg_flag, sy_offset;

View File

@ -650,38 +650,38 @@ static const struct namcoio_interface intf1_interleave =
static DRIVER_INIT( 56_56 ) static DRIVER_INIT( 56_56 )
{ {
namcoio_init(0, NAMCOIO_56XX, &intf0); namcoio_init(machine, 0, NAMCOIO_56XX, &intf0);
namcoio_init(1, NAMCOIO_56XX, &intf1); namcoio_init(machine, 1, NAMCOIO_56XX, &intf1);
} }
static DRIVER_INIT( 58_56i ) static DRIVER_INIT( 58_56i )
{ {
namcoio_init(0, NAMCOIO_58XX, &intf0); namcoio_init(machine, 0, NAMCOIO_58XX, &intf0);
namcoio_init(1, NAMCOIO_56XX, &intf1_interleave); namcoio_init(machine, 1, NAMCOIO_56XX, &intf1_interleave);
} }
static DRIVER_INIT( 56out_56 ) static DRIVER_INIT( 56out_56 )
{ {
namcoio_init(0, NAMCOIO_56XX, &intf0_lamps); namcoio_init(machine, 0, NAMCOIO_56XX, &intf0_lamps);
namcoio_init(1, NAMCOIO_56XX, &intf1); namcoio_init(machine, 1, NAMCOIO_56XX, &intf1);
} }
static DRIVER_INIT( 56out_59 ) static DRIVER_INIT( 56out_59 )
{ {
namcoio_init(0, NAMCOIO_56XX, &intf0_lamps); namcoio_init(machine, 0, NAMCOIO_56XX, &intf0_lamps);
namcoio_init(1, NAMCOIO_59XX, &intf1); namcoio_init(machine, 1, NAMCOIO_59XX, &intf1);
} }
static DRIVER_INIT( 58_58 ) static DRIVER_INIT( 58_58 )
{ {
namcoio_init(0, NAMCOIO_58XX, &intf0); namcoio_init(machine, 0, NAMCOIO_58XX, &intf0);
namcoio_init(1, NAMCOIO_58XX, &intf1); namcoio_init(machine, 1, NAMCOIO_58XX, &intf1);
} }
static DRIVER_INIT( 58_56 ) static DRIVER_INIT( 58_56 )
{ {
namcoio_init(0, NAMCOIO_58XX, &intf0); namcoio_init(machine, 0, NAMCOIO_58XX, &intf0);
namcoio_init(1, NAMCOIO_56XX, &intf1); namcoio_init(machine, 1, NAMCOIO_56XX, &intf1);
} }
/***************************************************************************/ /***************************************************************************/

View File

@ -1778,20 +1778,20 @@ INPUT_PORTS_END
/* xxx_BUTTONs are used with player = 0, 1, 2, 3 so we need to return 0 for the missing 4th I/O port */ /* xxx_BUTTONs are used with player = 0, 1, 2, 3 so we need to return 0 for the missing 4th I/O port */
static const char *const padnames[] = { "PAD1", "PAD2", "IN0", "UNK" }; static const char *const padnames[] = { "PAD1", "PAD2", "IN0", "UNK" };
#define MODE_BUTTON(player) ((input_port_read_safe(Machine, padnames[player], 0) & 0x0800) >> 11) #define MODE_BUTTON(machine,player) ((input_port_read_safe(machine, padnames[player], 0) & 0x0800) >> 11)
#define Z_BUTTON(player) ((input_port_read_safe(Machine, padnames[player], 0) & 0x0400) >> 10) #define Z_BUTTON(machine,player) ((input_port_read_safe(machine, padnames[player], 0) & 0x0400) >> 10)
#define Y_BUTTON(player) ((input_port_read_safe(Machine, padnames[player], 0) & 0x0200) >> 9 ) #define Y_BUTTON(machine,player) ((input_port_read_safe(machine, padnames[player], 0) & 0x0200) >> 9 )
#define X_BUTTON(player) ((input_port_read_safe(Machine, padnames[player], 0) & 0x0100) >> 8 ) #define X_BUTTON(machine,player) ((input_port_read_safe(machine, padnames[player], 0) & 0x0100) >> 8 )
#define START_BUTTON(player) ((input_port_read_safe(Machine, padnames[player], 0) & 0x0080) >> 7 ) #define START_BUTTON(machine,player) ((input_port_read_safe(machine, padnames[player], 0) & 0x0080) >> 7 )
#define C_BUTTON(player) ((input_port_read_safe(Machine, padnames[player], 0) & 0x0040) >> 6 ) #define C_BUTTON(machine,player) ((input_port_read_safe(machine, padnames[player], 0) & 0x0040) >> 6 )
#define B_BUTTON(player) ((input_port_read_safe(Machine, padnames[player], 0) & 0x0020) >> 5 ) #define B_BUTTON(machine,player) ((input_port_read_safe(machine, padnames[player], 0) & 0x0020) >> 5 )
#define A_BUTTON(player) ((input_port_read_safe(Machine, padnames[player], 0) & 0x0010) >> 4 ) #define A_BUTTON(machine,player) ((input_port_read_safe(machine, padnames[player], 0) & 0x0010) >> 4 )
#define RIGHT_BUTTON(player) ((input_port_read_safe(Machine, padnames[player], 0) & 0x0008) >> 3 ) #define RIGHT_BUTTON(machine,player) ((input_port_read_safe(machine, padnames[player], 0) & 0x0008) >> 3 )
#define LEFT_BUTTON(player) ((input_port_read_safe(Machine, padnames[player], 0) & 0x0004) >> 2 ) #define LEFT_BUTTON(machine,player) ((input_port_read_safe(machine, padnames[player], 0) & 0x0004) >> 2 )
#define DOWN_BUTTON(player) ((input_port_read_safe(Machine, padnames[player], 0) & 0x0002) >> 1 ) #define DOWN_BUTTON(machine,player) ((input_port_read_safe(machine, padnames[player], 0) & 0x0002) >> 1 )
#define UP_BUTTON(player) ((input_port_read_safe(Machine, padnames[player], 0) & 0x0001) >> 0 ) #define UP_BUTTON(machine,player) ((input_port_read_safe(machine, padnames[player], 0) & 0x0001) >> 0 )
#define MD_RESET_BUTTON ((input_port_read_safe(Machine, "RESET", 0x00) & 0x01) >> 0 ) #define MD_RESET_BUTTON(machine) ((input_port_read_safe(machine, "RESET", 0x00) & 0x01) >> 0 )
UINT8 megadrive_io_data_regs[3]; UINT8 megadrive_io_data_regs[3];
UINT8 megadrive_io_ctrl_regs[3]; UINT8 megadrive_io_ctrl_regs[3];
@ -1827,23 +1827,23 @@ static UINT8 megadrive_io_read_data_port_6button(running_machine *machine, int p
{ {
retdata = ( megadrive_io_data_regs[portnum] & 0x80) | retdata = ( megadrive_io_data_regs[portnum] & 0x80) |
(1 <<6) | (1 <<6) |
((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(C_BUTTON(portnum)<<5)) | ((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(C_BUTTON(machine,portnum)<<5)) |
((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(B_BUTTON(portnum)<<4)) | ((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(B_BUTTON(machine,portnum)<<4)) |
((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(MODE_BUTTON(portnum)<<3)) | ((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(MODE_BUTTON(machine,portnum)<<3)) |
((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(X_BUTTON(portnum)<<2)) | ((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(X_BUTTON(machine,portnum)<<2)) |
((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(Y_BUTTON(portnum)<<1)) | ((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(Y_BUTTON(machine,portnum)<<1)) |
((megadrive_io_ctrl_regs[portnum]&0x01)?(megadrive_io_data_regs[portnum]&0x01):(Z_BUTTON(portnum)<<0)); ((megadrive_io_ctrl_regs[portnum]&0x01)?(megadrive_io_data_regs[portnum]&0x01):(Z_BUTTON(machine,portnum)<<0));
} }
else else
{ {
retdata = ( megadrive_io_data_regs[portnum] & 0x80) | retdata = ( megadrive_io_data_regs[portnum] & 0x80) |
(1 << 6) | (1 << 6) |
((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(C_BUTTON(portnum)<<5)) | ((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(C_BUTTON(machine,portnum)<<5)) |
((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(B_BUTTON(portnum)<<4)) | ((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(B_BUTTON(machine,portnum)<<4)) |
((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(RIGHT_BUTTON(portnum)<<3)) | ((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(RIGHT_BUTTON(machine,portnum)<<3)) |
((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(LEFT_BUTTON(portnum)<<2)) | ((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(LEFT_BUTTON(machine,portnum)<<2)) |
((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(DOWN_BUTTON(portnum)<<1)) | ((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(DOWN_BUTTON(machine,portnum)<<1)) |
((megadrive_io_ctrl_regs[portnum]&0x01)?(megadrive_io_data_regs[portnum]&0x01):(UP_BUTTON(portnum)<<0)); ((megadrive_io_ctrl_regs[portnum]&0x01)?(megadrive_io_data_regs[portnum]&0x01):(UP_BUTTON(machine,portnum)<<0));
} }
} }
else else
@ -1852,8 +1852,8 @@ static UINT8 megadrive_io_read_data_port_6button(running_machine *machine, int p
{ {
retdata = ( megadrive_io_data_regs[portnum] & 0x80) | retdata = ( megadrive_io_data_regs[portnum] & 0x80) |
( 0<<6 ) | ( 0<<6 ) |
((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(START_BUTTON(portnum)<<5)) | ((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(START_BUTTON(machine,portnum)<<5)) |
((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(A_BUTTON(portnum)<<4)) | ((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(A_BUTTON(machine,portnum)<<4)) |
((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(0<<3)) | ((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(0<<3)) |
((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(0<<2)) | ((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(0<<2)) |
((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(0<<1)) | ((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(0<<1)) |
@ -1863,8 +1863,8 @@ static UINT8 megadrive_io_read_data_port_6button(running_machine *machine, int p
{ {
retdata = ( megadrive_io_data_regs[portnum] & 0x80) | retdata = ( megadrive_io_data_regs[portnum] & 0x80) |
( 0<<6 ) | ( 0<<6 ) |
((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(START_BUTTON(portnum)<<5)) | ((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(START_BUTTON(machine,portnum)<<5)) |
((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(A_BUTTON(portnum)<<4)) | ((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(A_BUTTON(machine,portnum)<<4)) |
((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(1<<3)) | ((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(1<<3)) |
((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(1<<2)) | ((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(1<<2)) |
((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(1<<1)) | ((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(1<<1)) |
@ -1874,12 +1874,12 @@ static UINT8 megadrive_io_read_data_port_6button(running_machine *machine, int p
{ {
retdata = ( megadrive_io_data_regs[portnum] & 0x80) | retdata = ( megadrive_io_data_regs[portnum] & 0x80) |
( 0<<6 ) | ( 0<<6 ) |
((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(START_BUTTON(portnum)<<5)) | ((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(START_BUTTON(machine,portnum)<<5)) |
((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(A_BUTTON(portnum)<<4)) | ((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(A_BUTTON(machine,portnum)<<4)) |
((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(0<<3)) | ((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(0<<3)) |
((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(0<<2)) | ((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(0<<2)) |
((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(DOWN_BUTTON(portnum)<<1)) | ((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(DOWN_BUTTON(machine,portnum)<<1)) |
((megadrive_io_ctrl_regs[portnum]&0x01)?(megadrive_io_data_regs[portnum]&0x01):(UP_BUTTON(portnum)<<0)); ((megadrive_io_ctrl_regs[portnum]&0x01)?(megadrive_io_data_regs[portnum]&0x01):(UP_BUTTON(machine,portnum)<<0));
} }
} }
@ -1899,23 +1899,23 @@ static UINT8 megadrive_io_read_data_port_3button(running_machine *machine, int p
{ {
retdata = ( megadrive_io_data_regs[portnum] & 0x80) | retdata = ( megadrive_io_data_regs[portnum] & 0x80) |
((megadrive_io_ctrl_regs[portnum]&0x40)?(megadrive_io_data_regs[portnum]&0x40):(0x40)) | ((megadrive_io_ctrl_regs[portnum]&0x40)?(megadrive_io_data_regs[portnum]&0x40):(0x40)) |
((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(C_BUTTON(portnum)<<5)) | ((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(C_BUTTON(machine,portnum)<<5)) |
((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(B_BUTTON(portnum)<<4)) | ((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(B_BUTTON(machine,portnum)<<4)) |
((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(RIGHT_BUTTON(portnum)<<3)) | ((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(RIGHT_BUTTON(machine,portnum)<<3)) |
((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(LEFT_BUTTON(portnum)<<2)) | ((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(LEFT_BUTTON(machine,portnum)<<2)) |
((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(DOWN_BUTTON(portnum)<<1)) | ((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(DOWN_BUTTON(machine,portnum)<<1)) |
((megadrive_io_ctrl_regs[portnum]&0x01)?(megadrive_io_data_regs[portnum]&0x01):(UP_BUTTON(portnum)<<0)); ((megadrive_io_ctrl_regs[portnum]&0x01)?(megadrive_io_data_regs[portnum]&0x01):(UP_BUTTON(machine,portnum)<<0));
} }
else else
{ {
retdata = ( megadrive_io_data_regs[portnum] & 0x80) | retdata = ( megadrive_io_data_regs[portnum] & 0x80) |
((megadrive_io_ctrl_regs[portnum]&0x40)?(megadrive_io_data_regs[portnum]&0x40):(0x40)) | ((megadrive_io_ctrl_regs[portnum]&0x40)?(megadrive_io_data_regs[portnum]&0x40):(0x40)) |
((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(START_BUTTON(portnum)<<5)) | ((megadrive_io_ctrl_regs[portnum]&0x20)?(megadrive_io_data_regs[portnum]&0x20):(START_BUTTON(machine,portnum)<<5)) |
((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(A_BUTTON(portnum)<<4)) | ((megadrive_io_ctrl_regs[portnum]&0x10)?(megadrive_io_data_regs[portnum]&0x10):(A_BUTTON(machine,portnum)<<4)) |
((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(0<<3)) | ((megadrive_io_ctrl_regs[portnum]&0x08)?(megadrive_io_data_regs[portnum]&0x08):(0<<3)) |
((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(0<<2)) | ((megadrive_io_ctrl_regs[portnum]&0x04)?(megadrive_io_data_regs[portnum]&0x04):(0<<2)) |
((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(DOWN_BUTTON(portnum)<<1)) | ((megadrive_io_ctrl_regs[portnum]&0x02)?(megadrive_io_data_regs[portnum]&0x02):(DOWN_BUTTON(machine,portnum)<<1)) |
((megadrive_io_ctrl_regs[portnum]&0x01)?(megadrive_io_data_regs[portnum]&0x01):(UP_BUTTON(portnum)<<0)); ((megadrive_io_ctrl_regs[portnum]&0x01)?(megadrive_io_data_regs[portnum]&0x01):(UP_BUTTON(machine,portnum)<<0));
} }
return retdata; return retdata;
@ -1924,15 +1924,16 @@ static UINT8 megadrive_io_read_data_port_3button(running_machine *machine, int p
/* used by megatech bios, the test mode accesses the joypad/stick inputs like this */ /* used by megatech bios, the test mode accesses the joypad/stick inputs like this */
UINT8 megatech_bios_port_cc_dc_r(int offset, int ctrl) UINT8 megatech_bios_port_cc_dc_r(int offset, int ctrl)
{ {
running_machine *machine = Machine;
UINT8 retdata; UINT8 retdata;
if (ctrl==0x55) if (ctrl==0x55)
{ {
retdata = (1<<0) | retdata = (1<<0) |
(1<<1) | (1<<1) |
(A_BUTTON(1)<<2) | (A_BUTTON(machine,1)<<2) |
(1<<3) | (1<<3) |
(A_BUTTON(0)<<4) | (A_BUTTON(machine,0)<<4) |
(1<<5) | (1<<5) |
(1<<6) | (1<<6) |
(1<<7); (1<<7);
@ -1941,21 +1942,21 @@ UINT8 megatech_bios_port_cc_dc_r(int offset, int ctrl)
{ {
if (offset==0) if (offset==0)
{ {
retdata = (UP_BUTTON(0)<<0) | retdata = (UP_BUTTON(machine,0)<<0) |
(DOWN_BUTTON(0)<<1) | (DOWN_BUTTON(machine,0)<<1) |
(LEFT_BUTTON(0)<<2) | (LEFT_BUTTON(machine,0)<<2) |
(RIGHT_BUTTON(0)<<3) | (RIGHT_BUTTON(machine,0)<<3) |
(B_BUTTON(0)<<4) | (B_BUTTON(machine,0)<<4) |
(C_BUTTON(0)<<5) | (C_BUTTON(machine,0)<<5) |
(UP_BUTTON(1)<<6) | (UP_BUTTON(machine,1)<<6) |
(DOWN_BUTTON(1)<<7); (DOWN_BUTTON(machine,1)<<7);
} }
else else
{ {
retdata = (LEFT_BUTTON(1)<<0) | retdata = (LEFT_BUTTON(machine,1)<<0) |
(RIGHT_BUTTON(1)<<1) | (RIGHT_BUTTON(machine,1)<<1) |
(B_BUTTON(1)<<2) | (B_BUTTON(machine,1)<<2) |
(C_BUTTON(1)<<3) | (C_BUTTON(machine,1)<<3) |
(1<<4) | (1<<4) |
(1<<5) | (1<<5) |
(1<<6) | (1<<6) |
@ -1970,26 +1971,28 @@ UINT8 megatech_bios_port_cc_dc_r(int offset, int ctrl)
/* the SMS inputs should be more complex, like the megadrive ones */ /* the SMS inputs should be more complex, like the megadrive ones */
READ8_HANDLER (megatech_sms_ioport_dc_r) READ8_HANDLER (megatech_sms_ioport_dc_r)
{ {
return (DOWN_BUTTON(1) << 7) | running_machine *machine = space->machine;
(UP_BUTTON(1) << 6) | return (DOWN_BUTTON(machine,1) << 7) |
(B_BUTTON(0) << 5) | // TR-A (UP_BUTTON(machine,1) << 6) |
(A_BUTTON(0) << 4) | // TL-A (B_BUTTON(machine,0) << 5) | // TR-A
(RIGHT_BUTTON(0) << 3) | (A_BUTTON(machine,0) << 4) | // TL-A
(LEFT_BUTTON(0) << 2) | (RIGHT_BUTTON(machine,0) << 3) |
(DOWN_BUTTON(0) << 1) | (LEFT_BUTTON(machine,0) << 2) |
(UP_BUTTON(0) << 0); (DOWN_BUTTON(machine,0) << 1) |
(UP_BUTTON(machine,0) << 0);
} }
READ8_HANDLER (megatech_sms_ioport_dd_r) READ8_HANDLER (megatech_sms_ioport_dd_r)
{ {
running_machine *machine = space->machine;
return (0 << 7) | // TH-B return (0 << 7) | // TH-B
(0 << 6) | // TH-A (0 << 6) | // TH-A
(0 << 5) | // unused (0 << 5) | // unused
(1 << 4) | // RESET button (1 << 4) | // RESET button
(B_BUTTON(1) << 3) | // TR-B (B_BUTTON(machine,1) << 3) | // TR-B
(A_BUTTON(1) << 2) | // TL-B (A_BUTTON(machine,1) << 2) | // TL-B
(RIGHT_BUTTON(1) << 1) | (RIGHT_BUTTON(machine,1) << 1) |
(LEFT_BUTTON(1) << 0); (LEFT_BUTTON(machine,1) << 0);
} }
static UINT8 megadrive_io_read_ctrl_port(int portnum) static UINT8 megadrive_io_read_ctrl_port(int portnum)
@ -6142,7 +6145,7 @@ VIDEO_EOF(megadriv)
megadrive_imode_odd_frame^=1; megadrive_imode_odd_frame^=1;
// cpu_set_input_line(machine->cpu[1],0,CLEAR_LINE); // if the z80 interrupt hasn't happened by now, clear it.. // cpu_set_input_line(machine->cpu[1],0,CLEAR_LINE); // if the z80 interrupt hasn't happened by now, clear it..
if (MD_RESET_BUTTON) cpu_set_input_line(machine->cpu[0], INPUT_LINE_RESET, PULSE_LINE); if (MD_RESET_BUTTON(machine)) cpu_set_input_line(machine->cpu[0], INPUT_LINE_RESET, PULSE_LINE);
/* /*
int megadrive_total_scanlines = 262; int megadrive_total_scanlines = 262;

View File

@ -205,7 +205,7 @@ static int ds1204_r(void)
return ds1204.out_bit; return ds1204.out_bit;
}; };
static void ds1204_init(const UINT8* key, const UINT8* nvram) static void ds1204_init(running_machine *machine, const UINT8* key, const UINT8* nvram)
{ {
memset(&ds1204, 0, sizeof(ds1204)); memset(&ds1204, 0, sizeof(ds1204));
if (key) if (key)
@ -213,11 +213,11 @@ static void ds1204_init(const UINT8* key, const UINT8* nvram)
if (nvram) if (nvram)
memcpy(ds1204.nvram, nvram, sizeof(ds1204.nvram)); memcpy(ds1204.nvram, nvram, sizeof(ds1204.nvram));
state_save_register_item(Machine, "ds1204", NULL, 0, ds1204.state); state_save_register_item(machine, "ds1204", NULL, 0, ds1204.state);
state_save_register_item(Machine, "ds1204", NULL, 0, ds1204.read_ptr); state_save_register_item(machine, "ds1204", NULL, 0, ds1204.read_ptr);
state_save_register_item(Machine, "ds1204", NULL, 0, ds1204.last_clk); state_save_register_item(machine, "ds1204", NULL, 0, ds1204.last_clk);
state_save_register_item(Machine, "ds1204", NULL, 0, ds1204.out_bit); state_save_register_item(machine, "ds1204", NULL, 0, ds1204.out_bit);
state_save_register_item_array(Machine, "ds1204", NULL, 0, ds1204.command); state_save_register_item_array(machine, "ds1204", NULL, 0, ds1204.command);
}; };
/************************************* /*************************************
@ -1370,7 +1370,7 @@ static DRIVER_INIT(megat3)
static const UINT8 megat3_ds1204_nvram[16] = static const UINT8 megat3_ds1204_nvram[16] =
{ 0x51, 0xa1, 0xc0, 0x7c, 0x27, 0x6e, 0x51, 0xb9, 0xa5, 0xb2, 0x27, 0x0c, 0xb9, 0x88, 0x82, 0x2c }; { 0x51, 0xa1, 0xc0, 0x7c, 0x27, 0x6e, 0x51, 0xb9, 0xa5, 0xb2, 0x27, 0x0c, 0xb9, 0x88, 0x82, 0x2c };
ds1204_init(megat3_ds1204_key, megat3_ds1204_nvram); ds1204_init(machine, megat3_ds1204_key, megat3_ds1204_nvram);
}; };
@ -1382,7 +1382,7 @@ static DRIVER_INIT(megat3te)
static const UINT8 megat3_ds1204_nvram[16] = static const UINT8 megat3_ds1204_nvram[16] =
{ 0x99, 0x53, 0xfc, 0x29, 0x3a, 0x95, 0x8b, 0x58, 0xca, 0xca, 0x00, 0xc2, 0x30, 0x62, 0x0b, 0x96 }; { 0x99, 0x53, 0xfc, 0x29, 0x3a, 0x95, 0x8b, 0x58, 0xca, 0xca, 0x00, 0xc2, 0x30, 0x62, 0x0b, 0x96 };
ds1204_init(megat3_ds1204_key, megat3_ds1204_nvram); ds1204_init(machine, megat3_ds1204_key, megat3_ds1204_nvram);
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xfff8, 0xffff, 0, 0, meritm_ds1644_r, meritm_ds1644_w ); memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xfff8, 0xffff, 0, 0, meritm_ds1644_r, meritm_ds1644_w );
@ -1393,7 +1393,7 @@ static DRIVER_INIT(megat4)
static const UINT8 megat4_ds1204_nvram[16] = static const UINT8 megat4_ds1204_nvram[16] =
{ 0xe3, 0x08, 0x39, 0xd8, 0x4c, 0xbb, 0xc4, 0xf8, 0xf0, 0xe2, 0xd8, 0x77, 0xa8, 0x3d, 0x95, 0x02 }; { 0xe3, 0x08, 0x39, 0xd8, 0x4c, 0xbb, 0xc4, 0xf8, 0xf0, 0xe2, 0xd8, 0x77, 0xa8, 0x3d, 0x95, 0x02 };
ds1204_init(0, megat4_ds1204_nvram); ds1204_init(machine, 0, megat4_ds1204_nvram);
} }
static DRIVER_INIT(megat4te) static DRIVER_INIT(megat4te)
@ -1401,7 +1401,7 @@ static DRIVER_INIT(megat4te)
static const UINT8 megat4te_ds1204_nvram[16] = static const UINT8 megat4te_ds1204_nvram[16] =
{ 0x05, 0x21, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 }; { 0x05, 0x21, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
ds1204_init(0, megat4te_ds1204_nvram); ds1204_init(machine, 0, megat4te_ds1204_nvram);
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xfff8, 0xffff, 0, 0, meritm_ds1644_r, meritm_ds1644_w ); memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xfff8, 0xffff, 0, 0, meritm_ds1644_r, meritm_ds1644_w );
@ -1412,7 +1412,7 @@ static DRIVER_INIT(megat5)
static const UINT8 megat5_ds1204_nvram[16] = static const UINT8 megat5_ds1204_nvram[16] =
{ 0x06, 0x23, 0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 }; { 0x06, 0x23, 0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
ds1204_init(0, megat5_ds1204_nvram); ds1204_init(machine, 0, megat5_ds1204_nvram);
} }
@ -1421,7 +1421,7 @@ static DRIVER_INIT(megat6)
static const UINT8 megat6_ds1204_nvram[16] = static const UINT8 megat6_ds1204_nvram[16] =
{ 0x07, 0x15, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 }; { 0x07, 0x15, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
ds1204_init(0, megat6_ds1204_nvram); ds1204_init(machine, 0, megat6_ds1204_nvram);
} }

View File

@ -22,7 +22,6 @@ TODO:
***************************************************************************/ ***************************************************************************/
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "streams.h" #include "streams.h"
#include "sound/sn76496.h" #include "sound/sn76496.h"
#include "sound/okim6295.h" #include "sound/okim6295.h"
@ -74,12 +73,13 @@ static void mjkjidai_adpcm_callback (void *param, stream_sample_t **inputs, stre
} }
} }
static void *mjkjidai_adpcm_start (int clock, const custom_sound_interface *config) static CUSTOM_START( mjkjidai_adpcm_start )
{ {
running_machine *machine = device->machine;
struct mjkjidai_adpcm_state *state = &mjkjidai_adpcm; struct mjkjidai_adpcm_state *state = &mjkjidai_adpcm;
state->playing = 0; state->playing = 0;
state->stream = stream_create(0, 1, clock, state, mjkjidai_adpcm_callback); state->stream = stream_create(0, 1, clock, state, mjkjidai_adpcm_callback);
state->base = memory_region(Machine, "adpcm"); state->base = memory_region(machine, "adpcm");
reset_adpcm(&state->adpcm); reset_adpcm(&state->adpcm);
return state; return state;
} }

View File

@ -1265,10 +1265,10 @@ static MACHINE_START( mpu4mod2 )
Mechmtr_init(8); Mechmtr_init(8);
/* setup 4 reels */ /* setup 4 reels */
stepper_config(0, &barcrest_reel_interface); stepper_config(machine, 0, &barcrest_reel_interface);
stepper_config(1, &barcrest_reel_interface); stepper_config(machine, 1, &barcrest_reel_interface);
stepper_config(2, &barcrest_reel_interface); stepper_config(machine, 2, &barcrest_reel_interface);
stepper_config(3, &barcrest_reel_interface); stepper_config(machine, 3, &barcrest_reel_interface);
/* setup the standard oki MSC1937 display */ /* setup the standard oki MSC1937 display */
ROC10937_init(0, MSC1937,0); ROC10937_init(0, MSC1937,0);

View File

@ -1364,10 +1364,10 @@ MACHINE_START( mpu4_vid )
/* setup 4 reels (for hybrid machines) */ /* setup 4 reels (for hybrid machines) */
stepper_config(0, &barcrest_reel_interface); stepper_config(machine, 0, &barcrest_reel_interface);
stepper_config(1, &barcrest_reel_interface); stepper_config(machine, 1, &barcrest_reel_interface);
stepper_config(2, &barcrest_reel_interface); stepper_config(machine, 2, &barcrest_reel_interface);
stepper_config(3, &barcrest_reel_interface); stepper_config(machine, 3, &barcrest_reel_interface);
/* setup the standard oki MSC1937 display */ /* setup the standard oki MSC1937 display */

View File

@ -121,7 +121,6 @@ TODO:
******************************************************************************/ ******************************************************************************/
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "sound/2203intf.h" #include "sound/2203intf.h"
#include "sound/samples.h" #include "sound/samples.h"
#include "machine/mc8123.h" #include "machine/mc8123.h"
@ -201,12 +200,11 @@ static WRITE8_HANDLER( ninjakd2_soundreset_w )
static void ninjakd2_init_samples(void) static SAMPLES_START( ninjakd2_init_samples )
{ {
const UINT8* const rom = memory_region(Machine, "samples"); running_machine *machine = device->machine;
const UINT8* const rom = memory_region(machine, "samples");
const int length = memory_region_length(Machine, "samples"); const int length = memory_region_length(machine, "samples");
INT16* const sampledata = auto_malloc(length * sizeof(sampledata[0])); INT16* const sampledata = auto_malloc(length * sizeof(sampledata[0]));
int i; int i;

View File

@ -1159,7 +1159,7 @@ static DRIVER_INIT(nwktr)
led_reg0 = led_reg1 = 0x7f; led_reg0 = led_reg1 = 0x7f;
K056800_init(machine, sound_irq_callback); K056800_init(machine, sound_irq_callback);
K033906_init(); K033906_init(machine);
// cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_SPU_TX_HANDLER, (genf *)jamma_jvs_w); // cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_SPU_TX_HANDLER, (genf *)jamma_jvs_w);
// cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_SPU_RX_HANDLER, (genf *)jamma_jvs_r); // cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_SPU_RX_HANDLER, (genf *)jamma_jvs_r);

View File

@ -165,12 +165,13 @@ static void renegade_adpcm_callback(void *param, stream_sample_t **inputs, strea
} }
} }
static void *renegade_adpcm_start(int clock, const custom_sound_interface *config) static CUSTOM_START( renegade_adpcm_start )
{ {
running_machine *machine = device->machine;
struct renegade_adpcm_state *state = &renegade_adpcm; struct renegade_adpcm_state *state = &renegade_adpcm;
state->playing = 0; state->playing = 0;
state->stream = stream_create(0, 1, clock, state, renegade_adpcm_callback); state->stream = stream_create(0, 1, clock, state, renegade_adpcm_callback);
state->base = memory_region(Machine, "adpcm"); state->base = memory_region(machine, "adpcm");
reset_adpcm(&state->adpcm); reset_adpcm(&state->adpcm);
return state; return state;
} }

View File

@ -134,10 +134,11 @@ VIDEO_UPDATE( superqix );
/* pbillian sample playback */ /* pbillian sample playback */
static INT16 *samplebuf; static INT16 *samplebuf;
static void pbillian_sh_start(void) static SAMPLES_START( pbillian_sh_start )
{ {
UINT8 *src = memory_region(Machine, "samples"); running_machine *machine = device->machine;
int i, len = memory_region_length(Machine, "samples"); UINT8 *src = memory_region(machine, "samples");
int i, len = memory_region_length(machine, "samples");
/* convert 8-bit unsigned samples to 8-bit signed */ /* convert 8-bit unsigned samples to 8-bit signed */
samplebuf = auto_malloc(len * 2); samplebuf = auto_malloc(len * 2);

View File

@ -281,10 +281,11 @@ static WRITE8_HANDLER( tmnt_sres_w )
} }
static void tmnt_decode_sample(void) static SAMPLES_START( tmnt_decode_sample )
{ {
running_machine *machine = device->machine;
int i; int i;
UINT8 *source = memory_region(Machine, "title"); UINT8 *source = memory_region(machine, "title");
sampledata = auto_malloc(0x40000*sizeof(sampledata[0])); sampledata = auto_malloc(0x40000*sizeof(sampledata[0]));

View File

@ -620,7 +620,6 @@ Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 1999/11/06
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "taitoipt.h" #include "taitoipt.h"
#include "cpu/i8x41/i8x41.h" #include "cpu/i8x41/i8x41.h"
#include "sound/2203intf.h" #include "sound/2203intf.h"
@ -639,14 +638,15 @@ UINT8 *tnzs_vdcram, *tnzs_scrollram, *tnzs_objctrl, *tnzs_bg_flag;
static INT16 *sampledata[MAX_SAMPLES]; static INT16 *sampledata[MAX_SAMPLES];
static int samplesize[MAX_SAMPLES]; static int samplesize[MAX_SAMPLES];
static void kageki_init_samples(void) static SAMPLES_START( kageki_init_samples )
{ {
running_machine *machine = device->machine;
UINT8 *scan, *src; UINT8 *scan, *src;
INT16 *dest; INT16 *dest;
int start, size; int start, size;
int i, n; int i, n;
src = memory_region(Machine, "samples") + 0x0090; src = memory_region(machine, "samples") + 0x0090;
for (i = 0; i < MAX_SAMPLES; i++) for (i = 0; i < MAX_SAMPLES; i++)
{ {
start = (src[(i * 2) + 1] * 256) + src[(i * 2)]; start = (src[(i * 2) + 1] * 256) + src[(i * 2)];

View File

@ -108,16 +108,16 @@ static const struct namcoio_interface intf2 =
static DRIVER_INIT( 58c_56_56 ) static DRIVER_INIT( 58c_56_56 )
{ {
namcoio_init(0, NAMCOIO_58XX, &intf0_coin); namcoio_init(machine, 0, NAMCOIO_58XX, &intf0_coin);
namcoio_init(1, NAMCOIO_56XX, &intf1); namcoio_init(machine, 1, NAMCOIO_56XX, &intf1);
namcoio_init(2, NAMCOIO_56XX, &intf2); namcoio_init(machine, 2, NAMCOIO_56XX, &intf2);
} }
static DRIVER_INIT( 58_56_56 ) static DRIVER_INIT( 58_56_56 )
{ {
namcoio_init(0, NAMCOIO_58XX, &intf0); namcoio_init(machine, 0, NAMCOIO_58XX, &intf0);
namcoio_init(1, NAMCOIO_56XX, &intf1); namcoio_init(machine, 1, NAMCOIO_56XX, &intf1);
namcoio_init(2, NAMCOIO_56XX, &intf2); namcoio_init(machine, 2, NAMCOIO_56XX, &intf2);
} }

View File

@ -43,7 +43,7 @@ PALETTE_INIT( wiping );
VIDEO_UPDATE( wiping ); VIDEO_UPDATE( wiping );
extern UINT8 *wiping_soundregs; extern UINT8 *wiping_soundregs;
void *wiping_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( wiping_sh_start );
WRITE8_HANDLER( wiping_sound_w ); WRITE8_HANDLER( wiping_sound_w );

View File

@ -391,7 +391,7 @@ const amiga_machine_interface *amiga_get_interface(void);
/*----------- defined in audio/amiga.c -----------*/ /*----------- defined in audio/amiga.c -----------*/
void *amiga_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( amiga_sh_start );
void amiga_audio_update(void); void amiga_audio_update(void);
void amiga_audio_data_w(int which, UINT16 data); void amiga_audio_data_w(int which, UINT16 data);

View File

@ -575,7 +575,7 @@ typedef struct {
FUNC(40); FUNC(41); FUNC(42); FUNC(43); \ FUNC(40); FUNC(41); FUNC(42); FUNC(43); \
FUNC(44); FUNC(45); FUNC(46); FUNC(47); FUNC(44); FUNC(45); FUNC(46); FUNC(47);
typedef void (*atari_renderer_func)(VIDEO *video); typedef void (*atari_renderer_func)(const address_space *space, VIDEO *video);
/*----------- defined in video/antic.c -----------*/ /*----------- defined in video/antic.c -----------*/
@ -586,49 +586,51 @@ void antic_reset(void);
READ8_HANDLER ( atari_antic_r ); READ8_HANDLER ( atari_antic_r );
WRITE8_HANDLER ( atari_antic_w ); WRITE8_HANDLER ( atari_antic_w );
void antic_mode_0_xx(VIDEO *video); #define ANTIC_RENDERER(name) void name(const address_space *space, VIDEO *video)
void antic_mode_2_32(VIDEO *video);
void antic_mode_2_40(VIDEO *video); ANTIC_RENDERER( antic_mode_0_xx );
void antic_mode_2_48(VIDEO *video); ANTIC_RENDERER( antic_mode_2_32 );
void antic_mode_3_32(VIDEO *video); ANTIC_RENDERER( antic_mode_2_40 );
void antic_mode_3_40(VIDEO *video); ANTIC_RENDERER( antic_mode_2_48 );
void antic_mode_3_48(VIDEO *video); ANTIC_RENDERER( antic_mode_3_32 );
void antic_mode_4_32(VIDEO *video); ANTIC_RENDERER( antic_mode_3_40 );
void antic_mode_4_40(VIDEO *video); ANTIC_RENDERER( antic_mode_3_48 );
void antic_mode_4_48(VIDEO *video); ANTIC_RENDERER( antic_mode_4_32 );
void antic_mode_5_32(VIDEO *video); ANTIC_RENDERER( antic_mode_4_40 );
void antic_mode_5_40(VIDEO *video); ANTIC_RENDERER( antic_mode_4_48 );
void antic_mode_5_48(VIDEO *video); ANTIC_RENDERER( antic_mode_5_32 );
void antic_mode_6_32(VIDEO *video); ANTIC_RENDERER( antic_mode_5_40 );
void antic_mode_6_40(VIDEO *video); ANTIC_RENDERER( antic_mode_5_48 );
void antic_mode_6_48(VIDEO *video); ANTIC_RENDERER( antic_mode_6_32 );
void antic_mode_7_32(VIDEO *video); ANTIC_RENDERER( antic_mode_6_40 );
void antic_mode_7_40(VIDEO *video); ANTIC_RENDERER( antic_mode_6_48 );
void antic_mode_7_48(VIDEO *video); ANTIC_RENDERER( antic_mode_7_32 );
void antic_mode_8_32(VIDEO *video); ANTIC_RENDERER( antic_mode_7_40 );
void antic_mode_8_40(VIDEO *video); ANTIC_RENDERER( antic_mode_7_48 );
void antic_mode_8_48(VIDEO *video); ANTIC_RENDERER( antic_mode_8_32 );
void antic_mode_9_32(VIDEO *video); ANTIC_RENDERER( antic_mode_8_40 );
void antic_mode_9_40(VIDEO *video); ANTIC_RENDERER( antic_mode_8_48 );
void antic_mode_9_48(VIDEO *video); ANTIC_RENDERER( antic_mode_9_32 );
void antic_mode_a_32(VIDEO *video); ANTIC_RENDERER( antic_mode_9_40 );
void antic_mode_a_40(VIDEO *video); ANTIC_RENDERER( antic_mode_9_48 );
void antic_mode_a_48(VIDEO *video); ANTIC_RENDERER( antic_mode_a_32 );
void antic_mode_b_32(VIDEO *video); ANTIC_RENDERER( antic_mode_a_40 );
void antic_mode_b_40(VIDEO *video); ANTIC_RENDERER( antic_mode_a_48 );
void antic_mode_b_48(VIDEO *video); ANTIC_RENDERER( antic_mode_b_32 );
void antic_mode_c_32(VIDEO *video); ANTIC_RENDERER( antic_mode_b_40 );
void antic_mode_c_40(VIDEO *video); ANTIC_RENDERER( antic_mode_b_48 );
void antic_mode_c_48(VIDEO *video); ANTIC_RENDERER( antic_mode_c_32 );
void antic_mode_d_32(VIDEO *video); ANTIC_RENDERER( antic_mode_c_40 );
void antic_mode_d_40(VIDEO *video); ANTIC_RENDERER( antic_mode_c_48 );
void antic_mode_d_48(VIDEO *video); ANTIC_RENDERER( antic_mode_d_32 );
void antic_mode_e_32(VIDEO *video); ANTIC_RENDERER( antic_mode_d_40 );
void antic_mode_e_40(VIDEO *video); ANTIC_RENDERER( antic_mode_d_48 );
void antic_mode_e_48(VIDEO *video); ANTIC_RENDERER( antic_mode_e_32 );
void antic_mode_f_32(VIDEO *video); ANTIC_RENDERER( antic_mode_e_40 );
void antic_mode_f_40(VIDEO *video); ANTIC_RENDERER( antic_mode_e_48 );
void antic_mode_f_48(VIDEO *video); ANTIC_RENDERER( antic_mode_f_32 );
ANTIC_RENDERER( antic_mode_f_40 );
ANTIC_RENDERER( antic_mode_f_48 );
/*----------- defined in video/atari.c -----------*/ /*----------- defined in video/atari.c -----------*/

View File

@ -3,7 +3,7 @@
/*----------- defined in audio/attckufo.c -----------*/ /*----------- defined in audio/attckufo.c -----------*/
void attckufo_soundport_w (int offset, int data); void attckufo_soundport_w (int offset, int data);
void *attckufo_custom_start(int clock, const custom_sound_interface *config); CUSTOM_START( attckufo_custom_start );
/*----------- defined in video/attckufo.c -----------*/ /*----------- defined in video/attckufo.c -----------*/

View File

@ -16,7 +16,7 @@ extern UINT8 rb_input_select;
WRITE8_HANDLER( bzone_sounds_w ); WRITE8_HANDLER( bzone_sounds_w );
void *bzone_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( bzone_sh_start );
/*----------- defined in audio/redbaron.c -----------*/ /*----------- defined in audio/redbaron.c -----------*/
@ -24,4 +24,4 @@ void *bzone_sh_start(int clock, const custom_sound_interface *config);
WRITE8_HANDLER( redbaron_sounds_w ); WRITE8_HANDLER( redbaron_sounds_w );
WRITE8_HANDLER( redbaron_pokey_w ); WRITE8_HANDLER( redbaron_pokey_w );
void *redbaron_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( redbaron_sh_start );

View File

@ -8,7 +8,7 @@
/*----------- defined in audio/cps3.c -----------*/ /*----------- defined in audio/cps3.c -----------*/
void *cps3_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( cps3_sh_start );
WRITE32_HANDLER( cps3_sound_w ); WRITE32_HANDLER( cps3_sound_w );
READ32_HANDLER( cps3_sound_r ); READ32_HANDLER( cps3_sound_r );

View File

@ -24,8 +24,8 @@
/*----------- defined in audio/exidy.c -----------*/ /*----------- defined in audio/exidy.c -----------*/
void *exidy_sh6840_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( exidy_sh6840_sh_start );
void exidy_sh6840_sh_reset(void *token); CUSTOM_RESET( exidy_sh6840_sh_reset );
WRITE8_HANDLER( exidy_sh6840_w ); WRITE8_HANDLER( exidy_sh6840_w );
WRITE8_HANDLER( exidy_sfxctrl_w ); WRITE8_HANDLER( exidy_sfxctrl_w );

View File

@ -6,7 +6,7 @@ extern UINT8 *flower_soundregs1,*flower_soundregs2;
WRITE8_HANDLER( flower_sound1_w ); WRITE8_HANDLER( flower_sound1_w );
WRITE8_HANDLER( flower_sound2_w ); WRITE8_HANDLER( flower_sound2_w );
void *flower_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( flower_sh_start );
/*----------- defined in video/flower.c -----------*/ /*----------- defined in video/flower.c -----------*/

View File

@ -7,7 +7,7 @@ extern UINT8 *gomoku_soundregs2;
WRITE8_HANDLER( gomoku_sound1_w ); WRITE8_HANDLER( gomoku_sound1_w );
WRITE8_HANDLER( gomoku_sound2_w ); WRITE8_HANDLER( gomoku_sound2_w );
void *gomoku_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( gomoku_sh_start );
/*----------- defined in video/gomoku.c -----------*/ /*----------- defined in video/gomoku.c -----------*/

View File

@ -12,7 +12,7 @@
/*----------- defined in audio/gridlee.c -----------*/ /*----------- defined in audio/gridlee.c -----------*/
WRITE8_HANDLER( gridlee_sound_w ); WRITE8_HANDLER( gridlee_sound_w );
void *gridlee_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( gridlee_sh_start );
/*----------- defined in video/gridlee.c -----------*/ /*----------- defined in video/gridlee.c -----------*/

View File

@ -101,10 +101,10 @@ void leland_rotate_memory(running_machine *machine, const char *cpuname);
/*----------- defined in audio/leland.c -----------*/ /*----------- defined in audio/leland.c -----------*/
void *leland_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( leland_sh_start );
void *leland_80186_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( leland_80186_sh_start );
void *redline_80186_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( redline_80186_sh_start );
void leland_dac_update(int dacnum, UINT8 sample); void leland_dac_update(int dacnum, UINT8 sample);
void leland_80186_sound_init(void); void leland_80186_sound_init(void);

View File

@ -4,9 +4,11 @@
*************************************************************************/ *************************************************************************/
#include "sound/samples.h"
/*----------- defined in audio/meadows.c -----------*/ /*----------- defined in audio/meadows.c -----------*/
void meadows_sh_start(void); SAMPLES_START( meadows_sh_start );
void meadows_sh_dac_w(int data); void meadows_sh_dac_w(int data);
void meadows_sh_update(running_machine *machine); void meadows_sh_update(running_machine *machine);
extern UINT8 meadows_0c00; extern UINT8 meadows_0c00;

View File

@ -24,7 +24,7 @@ DISCRETE_SOUND_EXTERN( phoenix );
WRITE8_HANDLER( phoenix_sound_control_a_w ); WRITE8_HANDLER( phoenix_sound_control_a_w );
WRITE8_HANDLER( phoenix_sound_control_b_w ); WRITE8_HANDLER( phoenix_sound_control_b_w );
void *phoenix_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( phoenix_sh_start );
/*----------- defined in audio/pleiads.c -----------*/ /*----------- defined in audio/pleiads.c -----------*/
@ -32,9 +32,9 @@ WRITE8_HANDLER( pleiads_sound_control_a_w );
WRITE8_HANDLER( pleiads_sound_control_b_w ); WRITE8_HANDLER( pleiads_sound_control_b_w );
WRITE8_HANDLER( pleiads_sound_control_c_w ); WRITE8_HANDLER( pleiads_sound_control_c_w );
void *pleiads_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( pleiads_sh_start );
void *naughtyb_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( naughtyb_sh_start );
void *popflame_sh_start(int clock, const custom_sound_interface *config); CUSTOM_START( popflame_sh_start );
/*----------- defined in video/naughtyb.c -----------*/ /*----------- defined in video/naughtyb.c -----------*/

Some files were not shown because too many files have changed in this diff Show More