mirror of
https://github.com/holub/mame
synced 2025-10-05 16:50:57 +03:00
From: Atari Ace [atari_ace@verizon.net]
Sent: Wednesday, December 10, 2008 9:27 AM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] Add machine to some emu/machine init methods Hi mamedev, This patch widens some machine init interfaces to pass the machine parameter, allowing more Machine global references to be eliminated. Eventually most of these need to be converted to devices, but this change reduces the deprecation surface in the meantime. I also attached the script I used to do the initial changes to the drivers, which handled about 90% of the cases without further editing. ~aa
This commit is contained in:
parent
4c0948ce00
commit
506da3c432
@ -114,9 +114,8 @@ static pia6821 pias[MAX_PIA];
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void pia_config(int which, const pia6821_interface *intf)
|
||||
void pia_config(running_machine *machine, int which, const pia6821_interface *intf)
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
pia6821 *p;
|
||||
|
||||
assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call pia_config at init time!");
|
||||
|
@ -48,7 +48,7 @@ struct _pia6821_interface
|
||||
|
||||
/*------------------ Configuration -----------------------*/
|
||||
|
||||
void pia_config(int which, const pia6821_interface *intf);
|
||||
void pia_config(running_machine *machine, int which, const pia6821_interface *intf);
|
||||
|
||||
|
||||
|
||||
|
@ -38,7 +38,6 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "7474.h"
|
||||
|
||||
|
||||
@ -139,9 +138,8 @@ int TTL7474_output_comp_r(int which)
|
||||
}
|
||||
|
||||
|
||||
void TTL7474_config(int which, const struct TTL7474_interface *intf)
|
||||
void TTL7474_config(running_machine *machine, int which, const struct TTL7474_interface *intf)
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
struct TTL7474 *chip = &chips[which];
|
||||
|
||||
if (which >= MAX_TTL7474)
|
||||
|
@ -48,7 +48,7 @@ struct TTL7474_interface
|
||||
};
|
||||
|
||||
|
||||
void TTL7474_config(int which, const struct TTL7474_interface *intf);
|
||||
void TTL7474_config(running_machine *machine, int which, const struct TTL7474_interface *intf);
|
||||
|
||||
/* must call TTL7474_update() after setting the inputs */
|
||||
void TTL7474_update(int which);
|
||||
|
@ -174,7 +174,6 @@
|
||||
|
||||
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "memconv.h"
|
||||
|
||||
#include "machine/pckeybrd.h"
|
||||
@ -267,7 +266,7 @@ static TIMER_CALLBACK( kbdc8042_time )
|
||||
|
||||
|
||||
|
||||
void kbdc8042_init(const struct kbdc8042_interface *intf)
|
||||
void kbdc8042_init(running_machine *machine, const struct kbdc8042_interface *intf)
|
||||
{
|
||||
poll_delay = 10;
|
||||
memset(&kbdc8042, 0, sizeof(kbdc8042));
|
||||
@ -280,7 +279,7 @@ void kbdc8042_init(const struct kbdc8042_interface *intf)
|
||||
kbdc8042.inport = 0xa0;
|
||||
at_8042_set_outport(0xfe, 1);
|
||||
|
||||
timer_pulse(Machine, ATTOTIME_IN_HZ(60), NULL, 0, kbdc8042_time);
|
||||
timer_pulse(machine, ATTOTIME_IN_HZ(60), NULL, 0, kbdc8042_time);
|
||||
}
|
||||
|
||||
static void at_8042_receive(UINT8 data)
|
||||
|
@ -28,7 +28,7 @@ struct kbdc8042_interface
|
||||
|
||||
|
||||
|
||||
void kbdc8042_init(const struct kbdc8042_interface *intf);
|
||||
void kbdc8042_init(running_machine *machine, const struct kbdc8042_interface *intf);
|
||||
|
||||
READ8_HANDLER(kbdc8042_8_r);
|
||||
WRITE8_HANDLER(kbdc8042_8_w);
|
||||
|
@ -63,9 +63,8 @@ struct adc083x_chip
|
||||
|
||||
static struct adc083x_chip adc083x[ MAX_ADC083X_CHIPS ];
|
||||
|
||||
void adc083x_init( int chip, int type, double (*input_callback)(int input) )
|
||||
void adc083x_init( running_machine *machine, int chip, int type, double (*input_callback)(int input) )
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
struct adc083x_chip *c;
|
||||
|
||||
if( chip >= MAX_ADC083X_CHIPS )
|
||||
|
@ -27,7 +27,7 @@
|
||||
#define ADC0834 ( 2 )
|
||||
#define ADC0838 ( 3 )
|
||||
|
||||
void adc083x_init( int chip, int type, double (*input_callback)( int input ) );
|
||||
void adc083x_init( running_machine *machine, int chip, int type, double (*input_callback)( int input ) );
|
||||
extern void adc083x_cs_write( int chip, int cs );
|
||||
extern void adc083x_clk_write( int chip, int clk );
|
||||
extern void adc083x_di_write( int chip, int di );
|
||||
|
@ -10,7 +10,6 @@
|
||||
*/
|
||||
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "am53cf96.h"
|
||||
|
||||
static UINT8 scsi_regs[32], fifo[16], fptr = 0, xfer_state, last_id;
|
||||
@ -209,9 +208,8 @@ WRITE32_HANDLER( am53cf96_w )
|
||||
}
|
||||
}
|
||||
|
||||
void am53cf96_init( const struct AM53CF96interface *interface )
|
||||
void am53cf96_init( running_machine *machine, const struct AM53CF96interface *interface )
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
int i;
|
||||
|
||||
// save interface pointer for later
|
||||
|
@ -14,7 +14,7 @@ struct AM53CF96interface
|
||||
void (*irq_callback)(running_machine *machine); /* irq callback */
|
||||
};
|
||||
|
||||
extern void am53cf96_init( const struct AM53CF96interface *interface );
|
||||
extern void am53cf96_init( running_machine *machine, const struct AM53CF96interface *interface );
|
||||
extern void am53cf96_exit( const struct AM53CF96interface *interface );
|
||||
extern void am53cf96_read_data(int bytes, UINT8 *pData);
|
||||
void am53cf96_write_data(int bytes, UINT8 *pData);
|
||||
|
@ -139,9 +139,8 @@ static TIMER_CALLBACK( ds2401_tick )
|
||||
}
|
||||
}
|
||||
|
||||
void ds2401_init( int which, const UINT8 *data )
|
||||
void ds2401_init( running_machine *machine, int which, const UINT8 *data )
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
struct ds2401_chip *c = &ds2401[ which ];
|
||||
|
||||
c->state = STATE_IDLE;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#define DS2401_MAXCHIP ( 3 )
|
||||
|
||||
extern void ds2401_init( int which, const UINT8 *data );
|
||||
extern void ds2401_init( running_machine *machine, int which, const UINT8 *data );
|
||||
extern void ds2401_write( int which, int data );
|
||||
extern int ds2401_read( int which );
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
/* Dallas DS2404 RTC/NVRAM */
|
||||
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "ds2404.h"
|
||||
#include <time.h>
|
||||
|
||||
@ -283,7 +282,7 @@ static TIMER_CALLBACK( DS2404_tick )
|
||||
}
|
||||
}
|
||||
|
||||
void DS2404_init(int ref_year, int ref_month, int ref_day)
|
||||
void DS2404_init(running_machine *machine, int ref_year, int ref_month, int ref_day)
|
||||
{
|
||||
struct tm ref_tm;
|
||||
time_t ref_time;
|
||||
@ -306,7 +305,7 @@ void DS2404_init(int ref_year, int ref_month, int ref_day)
|
||||
ds2404.rtc[ 3 ] = ( current_time >> 16 ) & 0xff;
|
||||
ds2404.rtc[ 4 ] = ( current_time >> 24 ) & 0xff;
|
||||
|
||||
timer = timer_alloc( Machine, DS2404_tick , NULL);
|
||||
timer = timer_alloc( machine, DS2404_tick , NULL);
|
||||
timer_adjust_periodic( timer, ATTOTIME_IN_HZ( 256 ), 0, ATTOTIME_IN_HZ( 256 ) );
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef DS2404_H
|
||||
#define DS2404_H
|
||||
|
||||
void DS2404_init(int ref_year, int ref_month, int ref_day);
|
||||
void DS2404_init(running_machine *machine, int ref_year, int ref_month, int ref_day);
|
||||
void DS2404_load(mame_file *file);
|
||||
void DS2404_save(mame_file *file);
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "eeprom.h"
|
||||
|
||||
#define VERBOSE 0
|
||||
@ -112,7 +111,7 @@ NVRAM_HANDLER( 93C46 )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C46);
|
||||
eeprom_init(machine, &eeprom_interface_93C46);
|
||||
if (file) eeprom_load(file);
|
||||
}
|
||||
}
|
||||
@ -123,14 +122,13 @@ NVRAM_HANDLER( 93C66B )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C66B);
|
||||
eeprom_init(machine, &eeprom_interface_93C66B);
|
||||
if (file) eeprom_load(file);
|
||||
}
|
||||
}
|
||||
|
||||
void eeprom_init(const eeprom_interface *interface)
|
||||
void eeprom_init(running_machine *machine, const eeprom_interface *interface)
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
intf = interface;
|
||||
|
||||
if ((1 << intf->address_bits) * intf->data_bits / 8 > MEMORY_SIZE)
|
||||
|
@ -17,7 +17,7 @@ struct _eeprom_interface
|
||||
};
|
||||
|
||||
|
||||
void eeprom_init(const eeprom_interface *interface);
|
||||
void eeprom_init(running_machine *machine, const eeprom_interface *interface);
|
||||
|
||||
void eeprom_write_bit(int bit);
|
||||
int eeprom_read_bit(void);
|
||||
|
@ -79,9 +79,8 @@ struct i2cmem_chip
|
||||
|
||||
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( running_machine *machine, int chip, int slave_address, int page_size, int data_size, unsigned char *data )
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
struct i2cmem_chip *c;
|
||||
unsigned char *page = NULL;
|
||||
|
||||
|
@ -19,7 +19,7 @@ I2C Memory
|
||||
#define I2CMEM_SLAVE_ADDRESS ( 0xa0 )
|
||||
#define I2CMEM_SLAVE_ADDRESS_ALT ( 0xb0 )
|
||||
|
||||
extern void i2cmem_init( int chip, int slave_address, int page_size, int data_size, unsigned char *data );
|
||||
extern void i2cmem_init( running_machine *machine, int chip, int slave_address, int page_size, int data_size, unsigned char *data );
|
||||
extern void i2cmem_write( int chip, int line, int data );
|
||||
extern int i2cmem_read( int chip, int line );
|
||||
extern NVRAM_HANDLER( i2cmem_0 );
|
||||
|
@ -12,7 +12,6 @@
|
||||
*/
|
||||
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "intelfsh.h"
|
||||
|
||||
enum
|
||||
@ -78,9 +77,8 @@ void* intelflash_getmemptr(int chip)
|
||||
return c->flash_memory;
|
||||
}
|
||||
|
||||
void intelflash_init(int chip, int type, void *data)
|
||||
void intelflash_init(running_machine *machine, int chip, int type, void *data)
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
struct flash_chip *c;
|
||||
if( chip >= FLASH_CHIPS_MAX )
|
||||
{
|
||||
|
@ -14,7 +14,7 @@
|
||||
#define FLASH_INTEL_TE28F160 ( 4 )
|
||||
#define FLASH_SHARP_LH28F016S ( 5 )
|
||||
|
||||
extern void intelflash_init( int chip, int type, void *data );
|
||||
extern void intelflash_init( running_machine *machine, int chip, int type, void *data );
|
||||
extern UINT32 intelflash_read( int chip, UINT32 address );
|
||||
extern void intelflash_write( int chip, UINT32 address, UINT32 value );
|
||||
extern void nvram_handler_intelflash( running_machine *machine, int chip, mame_file *file, int read_or_write );
|
||||
|
@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "machine/mb3773.h"
|
||||
|
||||
static emu_timer *watchdog_timer;
|
||||
@ -32,9 +31,9 @@ void mb3773_set_ck( UINT8 new_ck )
|
||||
ck = new_ck;
|
||||
}
|
||||
|
||||
void mb3773_init( void )
|
||||
void mb3773_init( running_machine *machine )
|
||||
{
|
||||
watchdog_timer = timer_alloc(Machine, watchdog_timeout, NULL);
|
||||
watchdog_timer = timer_alloc(machine, watchdog_timeout, NULL);
|
||||
reset_timer();
|
||||
state_save_register_global(Machine, ck );
|
||||
state_save_register_global(machine, ck );
|
||||
}
|
||||
|
@ -7,6 +7,6 @@
|
||||
#define MB3773_H ( 1 )
|
||||
|
||||
extern void mb3773_set_ck( UINT8 new_ck );
|
||||
extern void mb3773_init( void );
|
||||
extern void mb3773_init( running_machine *machine );
|
||||
|
||||
#endif
|
||||
|
@ -10,7 +10,6 @@
|
||||
*/
|
||||
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "microtch.h"
|
||||
|
||||
static struct
|
||||
@ -108,10 +107,9 @@ static TIMER_CALLBACK(microtouch_timer_callback)
|
||||
}
|
||||
};
|
||||
|
||||
void microtouch_init(void (*tx_cb)(UINT8 data),
|
||||
void microtouch_init(running_machine *machine, void (*tx_cb)(UINT8 data),
|
||||
int (*touch_cb)(int *touch_x, int *touch_y))
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
memset(µtouch, 0, sizeof(microtouch));
|
||||
|
||||
microtouch.last_touch_state = -1;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
INPUT_PORTS_EXTERN(microtouch);
|
||||
|
||||
void microtouch_init(void (*tx_cb)(UINT8 data), int (*touch_cb)(int *touch_x, int *touch_y));
|
||||
void microtouch_init(running_machine *machine, void (*tx_cb)(UINT8 data), int (*touch_cb)(int *touch_x, int *touch_y));
|
||||
void microtouch_rx(int count, UINT8* data);
|
||||
|
||||
#endif //_MICROTOUCH_H
|
||||
|
@ -31,7 +31,6 @@
|
||||
*/
|
||||
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "machine/pd4990a.h"
|
||||
|
||||
|
||||
@ -327,9 +326,8 @@ WRITE16_HANDLER( pd4990a_control_16_w )
|
||||
pd4990a_serial_control(data&0x7);
|
||||
}
|
||||
|
||||
void pd4990a_init(void)
|
||||
void pd4990a_init(running_machine *machine)
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
pd4990a = pd4990a_initval;
|
||||
shiftlo = 0;
|
||||
shifthi = 0;
|
||||
|
@ -17,7 +17,7 @@ struct pd4990a_s
|
||||
extern struct pd4990a_s pd4990a;
|
||||
|
||||
void pd4990a_addretrace (void);
|
||||
void pd4990a_init(void);
|
||||
void pd4990a_init(running_machine *machine);
|
||||
READ8_HANDLER( pd4990a_testbit_r );
|
||||
READ8_HANDLER( pd4990a_databit_r );
|
||||
WRITE16_HANDLER( pd4990a_control_16_w );
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "machine/rp5h01.h"
|
||||
|
||||
/****************************************************************************/
|
||||
@ -26,7 +25,7 @@ static RP5H01 RP5H01_state[MAX_RP5H01];
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
int RP5H01_init( const struct RP5H01_interface *interface ) {
|
||||
int RP5H01_init( running_machine *machine, const struct RP5H01_interface *interface ) {
|
||||
int i;
|
||||
|
||||
/* setup our local copy of the interface */
|
||||
@ -41,7 +40,7 @@ int RP5H01_init( const struct RP5H01_interface *interface ) {
|
||||
for( i = 0; i < intf->num; i++ ) {
|
||||
RP5H01_state[i].counter = 0;
|
||||
RP5H01_state[i].counter_mode = COUNTER_MODE_6_BITS;
|
||||
RP5H01_state[i].data = &( memory_region( Machine, intf->region[i] )[ intf->offset[i] ] );
|
||||
RP5H01_state[i].data = &( memory_region( machine, intf->region[i] )[ intf->offset[i] ] );
|
||||
RP5H01_state[i].enabled = 0;
|
||||
RP5H01_state[i].old_reset = -1;
|
||||
RP5H01_state[i].old_clock = -1;
|
||||
|
@ -10,7 +10,7 @@ struct RP5H01_interface {
|
||||
int offset[MAX_RP5H01]; /* memory offset within the above region where data resides */
|
||||
};
|
||||
|
||||
int RP5H01_init( const struct RP5H01_interface *interface );
|
||||
int RP5H01_init( running_machine *machine, const struct RP5H01_interface *interface );
|
||||
void RP5H01_enable_w( int which, int data ); /* /CE */
|
||||
void RP5H01_reset_w( int which, int data ); /* RESET */
|
||||
void RP5H01_clock_w( int which, int data ); /* DATA CLOCK (active low) */
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "rtc65271.h"
|
||||
|
||||
static void field_interrupts(void);
|
||||
@ -311,15 +310,15 @@ int rtc65271_file_save(mame_file *file)
|
||||
interrupt_callback: callback called when interrupt pin state changes (may
|
||||
be NULL)
|
||||
*/
|
||||
void rtc65271_init(UINT8 *xram, void (*interrupt_callback)(int state))
|
||||
void rtc65271_init(running_machine *machine, UINT8 *xram, void (*interrupt_callback)(int state))
|
||||
{
|
||||
memset(&rtc, 0, sizeof(rtc));
|
||||
|
||||
rtc.xram = xram;
|
||||
|
||||
rtc.update_timer = timer_alloc(Machine, rtc_begin_update_callback, NULL);
|
||||
rtc.update_timer = timer_alloc(machine, rtc_begin_update_callback, NULL);
|
||||
timer_adjust_periodic(rtc.update_timer, ATTOTIME_IN_SEC(1), 0, ATTOTIME_IN_SEC(1));
|
||||
rtc.SQW_timer = timer_alloc(Machine, rtc_SQW_callback, NULL);
|
||||
rtc.SQW_timer = timer_alloc(machine, rtc_SQW_callback, NULL);
|
||||
rtc.interrupt_callback = interrupt_callback;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,6 @@
|
||||
|
||||
extern int rtc65271_file_load(running_machine *machine, mame_file *file);
|
||||
extern int rtc65271_file_save(mame_file *file);
|
||||
extern void rtc65271_init(UINT8 *xram, void (*interrupt_callback)(int state));
|
||||
extern void rtc65271_init(running_machine *machine, UINT8 *xram, void (*interrupt_callback)(int state));
|
||||
extern UINT8 rtc65271_r(int xramsel, offs_t offset);
|
||||
extern void rtc65271_w(int xramsel, offs_t offset, UINT8 data);
|
||||
|
@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "machine/upd4701.h"
|
||||
|
||||
struct uPD4701_chip
|
||||
@ -32,14 +31,13 @@ static struct uPD4701_chip uPD4701[ UPD4701_MAXCHIP ];
|
||||
#define MASK_SWITCHES ( 7 )
|
||||
#define MASK_COUNTER ( 0xfff )
|
||||
|
||||
void uPD4701_init( int chip )
|
||||
void uPD4701_init( running_machine *machine, int chip )
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
struct uPD4701_chip *c;
|
||||
|
||||
if( chip < 0 || chip >= UPD4701_MAXCHIP )
|
||||
{
|
||||
logerror( "uPD4701_init( %d ) invalid chip\n", chip );
|
||||
logerror( "uPD4701_init( machine, %d ) invalid chip\n", chip );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#define UPD4701_MAXCHIP ( 1 )
|
||||
|
||||
extern void uPD4701_init( int chip );
|
||||
extern void uPD4701_init( running_machine *machine, int chip );
|
||||
extern void uPD4701_cs_w( int chip, int cs );
|
||||
extern void uPD4701_xy_w( int chip, int xy );
|
||||
extern void uPD4701_ul_w( int chip, int ul );
|
||||
|
@ -779,7 +779,7 @@ READ8_HANDLER(wd33c93_r)
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern void wd33c93_init( const struct WD33C93interface *interface )
|
||||
void wd33c93_init( running_machine *machine, const struct WD33C93interface *interface )
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -796,14 +796,14 @@ extern void wd33c93_init( const struct WD33C93interface *interface )
|
||||
}
|
||||
|
||||
/* allocate a timer for commands */
|
||||
scsi_data.cmd_timer = timer_alloc(Machine, wd33c93_complete_cb, NULL);
|
||||
scsi_data.cmd_timer = timer_alloc(machine, wd33c93_complete_cb, NULL);
|
||||
|
||||
scsi_data.temp_input = auto_malloc( TEMP_INPUT_LEN );
|
||||
|
||||
// state_save_register_item_array(Machine, "wd33c93", NULL, 0, scsi_data);
|
||||
// state_save_register_item_array(machine, "wd33c93", NULL, 0, scsi_data);
|
||||
}
|
||||
|
||||
extern void wd33c93_exit( const struct WD33C93interface *interface )
|
||||
void wd33c93_exit( const struct WD33C93interface *interface )
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -14,7 +14,7 @@ struct WD33C93interface
|
||||
void (*irq_callback)(running_machine *machine, int state); /* irq callback */
|
||||
};
|
||||
|
||||
extern void wd33c93_init( const struct WD33C93interface *interface );
|
||||
extern void wd33c93_init( running_machine *machine, const struct WD33C93interface *interface );
|
||||
extern void wd33c93_exit( const struct WD33C93interface *interface );
|
||||
extern void wd33c93_get_dma_data(int bytes, UINT8 *pData);
|
||||
extern void wd33c93_write_data(int bytes, UINT8 *pData);
|
||||
|
@ -108,9 +108,8 @@ static struct x76f041_chip x76f041[ X76F041_MAXCHIP ];
|
||||
#define STATE_READ_CONFIGURATION_REGISTERS ( 8 )
|
||||
#define STATE_WRITE_CONFIGURATION_REGISTERS ( 9 )
|
||||
|
||||
void x76f041_init( int chip, UINT8 *data )
|
||||
void x76f041_init( running_machine *machine, int chip, UINT8 *data )
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
int offset;
|
||||
struct x76f041_chip *c;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#define X76F041_MAXCHIP ( 2 )
|
||||
|
||||
extern void x76f041_init( int chip, UINT8 *data );
|
||||
extern void x76f041_init( running_machine *machine, int chip, UINT8 *data );
|
||||
extern void x76f041_cs_write( int chip, int cs );
|
||||
extern void x76f041_rst_write( int chip, int rst );
|
||||
extern void x76f041_scl_write( int chip, int scl );
|
||||
|
@ -77,9 +77,8 @@ static struct x76f100_chip x76f100[ X76F100_MAXCHIP ];
|
||||
#define STATE_READ_DATA ( 6 )
|
||||
#define STATE_WRITE_DATA ( 7 )
|
||||
|
||||
void x76f100_init( int chip, UINT8 *data )
|
||||
void x76f100_init( running_machine *machine, int chip, UINT8 *data )
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
int offset;
|
||||
struct x76f100_chip *c;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#define X76F100_MAXCHIP ( 2 )
|
||||
|
||||
extern void x76f100_init( int chip, UINT8 *data );
|
||||
extern void x76f100_init( running_machine *machine, int chip, UINT8 *data );
|
||||
extern void x76f100_cs_write( int chip, int cs );
|
||||
extern void x76f100_rst_write( int chip, int rst );
|
||||
extern void x76f100_scl_write( int chip, int scl );
|
||||
|
@ -664,8 +664,9 @@ static void *venture_common_sh_start(const device_config *device, int clock, con
|
||||
|
||||
static CUSTOM_START( venture_sh_start )
|
||||
{
|
||||
pia_config(0, &venture_pia_0_intf);
|
||||
pia_config(1, &venture_pia_1_intf);
|
||||
running_machine *machine = device->machine;
|
||||
pia_config(machine, 0, &venture_pia_0_intf);
|
||||
pia_config(machine, 1, &venture_pia_1_intf);
|
||||
|
||||
return venture_common_sh_start(device, clock, config, FALSE);
|
||||
}
|
||||
@ -861,7 +862,7 @@ static const pia6821_interface victory_pia_e5_intf =
|
||||
static CUSTOM_START( victory_sh_start )
|
||||
{
|
||||
running_machine *machine = device->machine;
|
||||
pia_config(1, &victory_pia_e5_intf);
|
||||
pia_config(machine, 1, &victory_pia_e5_intf);
|
||||
|
||||
state_save_register_global(machine, victory_sound_response_ack_clk);
|
||||
|
||||
|
@ -132,7 +132,7 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
|
||||
/* Turbo Chip Squeak */
|
||||
if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK)
|
||||
{
|
||||
pia_config(0, &turbocs_pia_intf);
|
||||
pia_config(machine, 0, &turbocs_pia_intf);
|
||||
turbocs_dac_index = dac_index++;
|
||||
turbocs_sound_cpu = sound_cpu++;
|
||||
state_save_register_global(machine, turbocs_status);
|
||||
@ -141,7 +141,7 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
|
||||
/* Chip Squeak Deluxe */
|
||||
if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE)
|
||||
{
|
||||
pia_config(0, &csdeluxe_pia_intf);
|
||||
pia_config(machine, 0, &csdeluxe_pia_intf);
|
||||
csdeluxe_dac_index = dac_index++;
|
||||
csdeluxe_sound_cpu = sound_cpu++;
|
||||
state_save_register_global(machine, csdeluxe_status);
|
||||
@ -151,7 +151,7 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
|
||||
if (mcr_sound_config & MCR_SOUNDS_GOOD)
|
||||
{
|
||||
/* special case: Spy Hunter 2 has both Turbo CS and Sounds Good, so we use PIA slot 1 */
|
||||
pia_config(1, &soundsgood_pia_intf);
|
||||
pia_config(machine, 1, &soundsgood_pia_intf);
|
||||
soundsgood_dac_index = dac_index++;
|
||||
soundsgood_sound_cpu = sound_cpu++;
|
||||
state_save_register_global(machine, soundsgood_status);
|
||||
@ -160,8 +160,8 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
|
||||
/* Squawk n Talk */
|
||||
if (mcr_sound_config & MCR_SQUAWK_N_TALK)
|
||||
{
|
||||
pia_config(0, &squawkntalk_pia0_intf);
|
||||
pia_config(1, &squawkntalk_pia1_intf);
|
||||
pia_config(machine, 0, &squawkntalk_pia0_intf);
|
||||
pia_config(machine, 1, &squawkntalk_pia1_intf);
|
||||
squawkntalk_sound_cpu = sound_cpu++;
|
||||
state_save_register_global(machine, squawkntalk_tms_command);
|
||||
state_save_register_global(machine, squawkntalk_tms_strobes);
|
||||
|
@ -378,7 +378,7 @@ static const pia6821_interface demoneye_pia_intf =
|
||||
|
||||
static SOUND_START( demoneye )
|
||||
{
|
||||
pia_config(0, &demoneye_pia_intf);
|
||||
pia_config(machine, 0, &demoneye_pia_intf);
|
||||
|
||||
state_save_register_global(machine, ay8910_latch_1);
|
||||
state_save_register_global(machine, ay8910_latch_2);
|
||||
|
@ -211,9 +211,10 @@ static const struct TTL7474_interface sfx_sh_7474_intf =
|
||||
|
||||
void scramble_sh_init(void)
|
||||
{
|
||||
cpu_set_irq_callback(Machine->cpu[1], scramble_sh_irq_callback);
|
||||
running_machine *machine = Machine;
|
||||
cpu_set_irq_callback(machine->cpu[1], scramble_sh_irq_callback);
|
||||
|
||||
TTL7474_config(2, &scramble_sh_7474_intf);
|
||||
TTL7474_config(machine, 2, &scramble_sh_7474_intf);
|
||||
|
||||
/* PR is always 0, D is always 1 */
|
||||
TTL7474_d_w(2, 1);
|
||||
@ -221,9 +222,10 @@ void scramble_sh_init(void)
|
||||
|
||||
void sfx_sh_init(void)
|
||||
{
|
||||
cpu_set_irq_callback(Machine->cpu[2], sfx_sh_irq_callback);
|
||||
running_machine *machine = Machine;
|
||||
cpu_set_irq_callback(machine->cpu[2], sfx_sh_irq_callback);
|
||||
|
||||
TTL7474_config(3, &sfx_sh_7474_intf);
|
||||
TTL7474_config(machine, 3, &sfx_sh_7474_intf);
|
||||
|
||||
/* PR is always 0, D is always 1 */
|
||||
TTL7474_d_w(3, 1);
|
||||
|
@ -261,19 +261,20 @@ MACHINE_DRIVER_END
|
||||
|
||||
void williams_cvsd_init(int pianum)
|
||||
{
|
||||
running_machine *machine = Machine;
|
||||
UINT8 *ROM;
|
||||
int bank;
|
||||
|
||||
/* configure the CPU */
|
||||
sound_cpu = cputag_get_cpu(Machine, "cvsd");
|
||||
sound_cpu = cputag_get_cpu(machine, "cvsd");
|
||||
soundalt_cpu = NULL;
|
||||
|
||||
/* configure the PIA */
|
||||
williams_pianum = pianum;
|
||||
pia_config(pianum, &cvsd_pia_intf);
|
||||
pia_config(machine, pianum, &cvsd_pia_intf);
|
||||
|
||||
/* configure master CPU banks */
|
||||
ROM = memory_region(Machine, "cvsd");
|
||||
ROM = memory_region(machine, "cvsd");
|
||||
for (bank = 0; bank < 16; bank++)
|
||||
{
|
||||
/*
|
||||
@ -282,16 +283,16 @@ void williams_cvsd_init(int pianum)
|
||||
D3 -> A16
|
||||
*/
|
||||
offs_t offset = 0x8000 * ((bank >> 2) & 3) + 0x20000 * (bank & 3);
|
||||
memory_configure_bank(Machine, 5, bank, 1, &ROM[0x10000 + offset], 0);
|
||||
memory_configure_bank(machine, 5, bank, 1, &ROM[0x10000 + offset], 0);
|
||||
}
|
||||
memory_set_bank(sound_cpu->machine, 5, 0);
|
||||
memory_set_bank(machine, 5, 0);
|
||||
|
||||
/* reset the IRQ state */
|
||||
pia_set_input_ca1(williams_pianum, 1);
|
||||
|
||||
/* register for save states */
|
||||
state_save_register_global(sound_cpu->machine, williams_sound_int_state);
|
||||
state_save_register_global(sound_cpu->machine, audio_talkback);
|
||||
state_save_register_global(machine, williams_sound_int_state);
|
||||
state_save_register_global(machine, audio_talkback);
|
||||
}
|
||||
|
||||
|
||||
|
@ -117,7 +117,7 @@ static NVRAM_HANDLER( eeprom )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
|
@ -186,7 +186,7 @@ static UINT8 duart_input(const device_config *device)
|
||||
|
||||
static MACHINE_START( skattv )
|
||||
{
|
||||
microtouch_init(microtouch_tx, 0);
|
||||
microtouch_init(machine, microtouch_tx, 0);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( skattv )
|
||||
|
@ -34,21 +34,13 @@ static const eeprom_interface eeprom_intf =
|
||||
"1100110000000" /* unlock command */
|
||||
};
|
||||
|
||||
#if 0
|
||||
static void eeprom_init(void)
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
init_eeprom_count = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static NVRAM_HANDLER( asterix )
|
||||
{
|
||||
if (read_or_write)
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
{
|
||||
|
@ -239,7 +239,7 @@ static NVRAM_HANDLER( showhand )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C46);
|
||||
eeprom_init(machine, &eeprom_interface_93C46);
|
||||
|
||||
if (file) eeprom_load(file);
|
||||
else
|
||||
|
@ -659,7 +659,7 @@ static DRIVER_INIT( ataxx )
|
||||
0x14,0x5a04,
|
||||
0xffff
|
||||
};
|
||||
ataxx_init_eeprom(0x00, ataxx_eeprom_data, 0x00);
|
||||
ataxx_init_eeprom(machine, 0x00, ataxx_eeprom_data, 0x00);
|
||||
|
||||
leland_rotate_memory(machine, "master");
|
||||
leland_rotate_memory(machine, "slave");
|
||||
@ -682,7 +682,7 @@ static DRIVER_INIT( ataxxj )
|
||||
0x3f,0x3c0c,
|
||||
0xffff
|
||||
};
|
||||
ataxx_init_eeprom(0x00, ataxxj_eeprom_data, 0x00);
|
||||
ataxx_init_eeprom(machine, 0x00, ataxxj_eeprom_data, 0x00);
|
||||
|
||||
leland_rotate_memory(machine, "master");
|
||||
leland_rotate_memory(machine, "slave");
|
||||
@ -705,7 +705,7 @@ static DRIVER_INIT( wsf )
|
||||
0x28,0xff00,
|
||||
0xffff
|
||||
};
|
||||
ataxx_init_eeprom(0x00, wsf_eeprom_data, 0x00);
|
||||
ataxx_init_eeprom(machine, 0x00, wsf_eeprom_data, 0x00);
|
||||
|
||||
leland_rotate_memory(machine, "master");
|
||||
leland_rotate_memory(machine, "slave");
|
||||
@ -730,7 +730,7 @@ static DRIVER_INIT( indyheat )
|
||||
0x31,0xfafa,
|
||||
0xffff
|
||||
};
|
||||
ataxx_init_eeprom(0x00, indyheat_eeprom_data, 0x00);
|
||||
ataxx_init_eeprom(machine, 0x00, indyheat_eeprom_data, 0x00);
|
||||
|
||||
leland_rotate_memory(machine, "master");
|
||||
leland_rotate_memory(machine, "slave");
|
||||
@ -760,7 +760,7 @@ static DRIVER_INIT( brutforc )
|
||||
0x36,0x0104,
|
||||
0xffff
|
||||
};
|
||||
ataxx_init_eeprom(0x00, brutforc_eeprom_data, 0x00);
|
||||
ataxx_init_eeprom(machine, 0x00, brutforc_eeprom_data, 0x00);
|
||||
|
||||
leland_rotate_memory(machine, "master");
|
||||
leland_rotate_memory(machine, "slave");
|
||||
@ -785,7 +785,7 @@ static DRIVER_INIT( asylum )
|
||||
0x07,0x0400,
|
||||
0xffff
|
||||
};
|
||||
ataxx_init_eeprom(0x00, asylum_eeprom_data, 0x00);
|
||||
ataxx_init_eeprom(machine, 0x00, asylum_eeprom_data, 0x00);
|
||||
|
||||
leland_rotate_memory(machine, "master");
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
@ -1858,14 +1858,14 @@ static const acia6850_interface acia6850_intf =
|
||||
|
||||
static MACHINE_START( sys903 )
|
||||
{
|
||||
pia_config(0, &sys903_pia0_intf);
|
||||
pia_config(1, &sys903_pia1_intf);
|
||||
pia_config(machine, 0, &sys903_pia0_intf);
|
||||
pia_config(machine, 1, &sys903_pia1_intf);
|
||||
}
|
||||
|
||||
static MACHINE_START( sys905 )
|
||||
{
|
||||
pia_config(0, &sys905_pia0_intf);
|
||||
pia_config(1, &sys905_pia1_intf);
|
||||
pia_config(machine, 0, &sys905_pia0_intf);
|
||||
pia_config(machine, 1, &sys905_pia1_intf);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( calomega )
|
||||
|
@ -418,7 +418,7 @@ static NVRAM_HANDLER( cave )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C46);
|
||||
eeprom_init(machine, &eeprom_interface_93C46);
|
||||
|
||||
if (file) eeprom_load(file);
|
||||
else
|
||||
@ -449,7 +449,7 @@ static NVRAM_HANDLER( korokoro )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C46_8bit);
|
||||
eeprom_init(machine, &eeprom_interface_93C46_8bit);
|
||||
|
||||
if (file) eeprom_load(file);
|
||||
else
|
||||
|
@ -106,7 +106,7 @@ static NVRAM_HANDLER( cbasebal )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
|
@ -597,9 +597,9 @@ static const pia6821_interface trailblz_pia_2_intf =
|
||||
|
||||
static MACHINE_START( quizmstr )
|
||||
{
|
||||
pia_config(0, &quizmstr_pia_0_intf);
|
||||
pia_config(1, &quizmstr_pia_1_intf);
|
||||
pia_config(2, &quizmstr_pia_2_intf);
|
||||
pia_config(machine, 0, &quizmstr_pia_0_intf);
|
||||
pia_config(machine, 1, &quizmstr_pia_1_intf);
|
||||
pia_config(machine, 2, &quizmstr_pia_2_intf);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( quizmstr )
|
||||
@ -609,9 +609,9 @@ static MACHINE_RESET( quizmstr )
|
||||
|
||||
static MACHINE_START( trailblz )
|
||||
{
|
||||
pia_config(0, &trailblz_pia_0_intf);
|
||||
pia_config(1, &trailblz_pia_1_intf);
|
||||
pia_config(2, &trailblz_pia_2_intf);
|
||||
pia_config(machine, 0, &trailblz_pia_0_intf);
|
||||
pia_config(machine, 1, &trailblz_pia_1_intf);
|
||||
pia_config(machine, 2, &trailblz_pia_2_intf);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( trailblz )
|
||||
|
@ -434,7 +434,7 @@ static NVRAM_HANDLER( qsound )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&qsound_eeprom_interface);
|
||||
eeprom_init(machine, &qsound_eeprom_interface);
|
||||
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
@ -447,7 +447,7 @@ static NVRAM_HANDLER( pang3 )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&pang3_eeprom_interface);
|
||||
eeprom_init(machine, &pang3_eeprom_interface);
|
||||
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
|
@ -713,7 +713,7 @@ static NVRAM_HANDLER( cps2 )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&cps2_eeprom_interface);
|
||||
eeprom_init(machine, &cps2_eeprom_interface);
|
||||
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
|
@ -759,7 +759,7 @@ static DRIVER_INIT( cps3 )
|
||||
// flash roms
|
||||
|
||||
for (i=0;i<48;i++)
|
||||
intelflash_init( i, FLASH_FUJITSU_29F016A, NULL );
|
||||
intelflash_init( machine, i, FLASH_FUJITSU_29F016A, NULL );
|
||||
|
||||
cps3_eeprom = auto_malloc(0x400);
|
||||
|
||||
@ -2366,7 +2366,7 @@ static void cps3_exit(running_machine *machine)
|
||||
|
||||
static MACHINE_START( cps3 )
|
||||
{
|
||||
wd33c93_init(&scsi_intf);
|
||||
wd33c93_init(machine, &scsi_intf);
|
||||
add_exit_callback(machine, cps3_exit);
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ static NVRAM_HANDLER( darkhors )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file) eeprom_load(file);
|
||||
else
|
||||
|
@ -1846,7 +1846,7 @@ static NVRAM_HANDLER(tattass)
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_tattass);
|
||||
eeprom_init(machine, &eeprom_interface_tattass);
|
||||
if (file) eeprom_load(file);
|
||||
else memcpy(eeprom_get_data_pointer(NULL,NULL),tattass_default_eprom,0x160);
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ static NVRAM_HANDLER( eolith )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C66);
|
||||
eeprom_init(machine, &eeprom_interface_93C66);
|
||||
if (file) eeprom_load(file);
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ static NVRAM_HANDLER( eolith16_eeprom )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C66);
|
||||
eeprom_init(machine, &eeprom_interface_93C66);
|
||||
if (file) eeprom_load(file);
|
||||
}
|
||||
}
|
||||
|
@ -1844,7 +1844,7 @@ static NVRAM_HANDLER(firebeat)
|
||||
}
|
||||
else
|
||||
{
|
||||
rtc65271_init(xram, NULL);
|
||||
rtc65271_init(machine, xram, NULL);
|
||||
|
||||
if (file != NULL)
|
||||
{
|
||||
@ -2277,11 +2277,11 @@ static void init_firebeat(running_machine *machine)
|
||||
UINT8 *rom = memory_region(machine, "user2");
|
||||
|
||||
atapi_init(machine);
|
||||
intelflash_init(0, FLASH_FUJITSU_29F016A, NULL);
|
||||
intelflash_init(1, FLASH_FUJITSU_29F016A, NULL);
|
||||
intelflash_init(2, FLASH_FUJITSU_29F016A, NULL);
|
||||
intelflash_init(machine, 0, FLASH_FUJITSU_29F016A, NULL);
|
||||
intelflash_init(machine, 1, FLASH_FUJITSU_29F016A, NULL);
|
||||
intelflash_init(machine, 2, FLASH_FUJITSU_29F016A, NULL);
|
||||
|
||||
rtc65271_init(xram, NULL);
|
||||
rtc65271_init(machine, xram, NULL);
|
||||
|
||||
pc16552d_init(0, 19660800, comm_uart_irq_callback, 0); // Network UART
|
||||
pc16552d_init(1, 24000000, midi_uart_irq_callback, 0); // MIDI UART
|
||||
|
@ -2555,8 +2555,8 @@ ROM_END
|
||||
static DRIVER_INIT( funworld )
|
||||
{
|
||||
/* Initializing PIAs... */
|
||||
pia_config(0, &pia0_intf);
|
||||
pia_config(1, &pia1_intf);
|
||||
pia_config(machine, 0, &pia0_intf);
|
||||
pia_config(machine, 1, &pia1_intf);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( tabblue )
|
||||
@ -2596,8 +2596,8 @@ static DRIVER_INIT( tabblue )
|
||||
}
|
||||
|
||||
/* Initializing PIAs... */
|
||||
pia_config(0, &pia0_intf);
|
||||
pia_config(1, &pia1_intf);
|
||||
pia_config(machine, 0, &pia0_intf);
|
||||
pia_config(machine, 1, &pia1_intf);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( jolyc980 )
|
||||
@ -2622,8 +2622,8 @@ static DRIVER_INIT( jolyc980 )
|
||||
// ROM[0xc1fe] = 0x80;
|
||||
|
||||
/* Initializing PIAs... */
|
||||
pia_config(0, &pia0_intf);
|
||||
pia_config(1, &pia1_intf);
|
||||
pia_config(machine, 0, &pia0_intf);
|
||||
pia_config(machine, 1, &pia1_intf);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( magicd2a )
|
||||
@ -2646,8 +2646,8 @@ static DRIVER_INIT( magicd2a )
|
||||
ROM[0xc1c6] = 0x92;
|
||||
|
||||
/* Initializing PIAs... */
|
||||
pia_config(0, &pia0_intf);
|
||||
pia_config(1, &pia1_intf);
|
||||
pia_config(machine, 0, &pia0_intf);
|
||||
pia_config(machine, 1, &pia1_intf);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( magicd2b )
|
||||
@ -2671,8 +2671,8 @@ static DRIVER_INIT( magicd2b )
|
||||
ROM[0xc1c6] = 0x92;
|
||||
|
||||
/* Initializing PIAs... */
|
||||
pia_config(0, &pia0_intf);
|
||||
pia_config(1, &pia1_intf);
|
||||
pia_config(machine, 0, &pia0_intf);
|
||||
pia_config(machine, 1, &pia1_intf);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( soccernw )
|
||||
@ -2691,8 +2691,8 @@ static DRIVER_INIT( soccernw )
|
||||
// ROM[0xa33c] = 0xea;
|
||||
|
||||
/* Initializing PIAs... */
|
||||
pia_config(0, &pia0_intf);
|
||||
pia_config(1, &pia1_intf);
|
||||
pia_config(machine, 0, &pia0_intf);
|
||||
pia_config(machine, 1, &pia1_intf);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( saloon )
|
||||
|
@ -329,7 +329,7 @@ static NVRAM_HANDLER( galastrm )
|
||||
if (read_or_write)
|
||||
eeprom_save(file);
|
||||
else {
|
||||
eeprom_init(&galastrm_eeprom_interface);
|
||||
eeprom_init(machine, &galastrm_eeprom_interface);
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
else
|
||||
|
@ -733,7 +733,7 @@ static DRIVER_INIT( gamecstl )
|
||||
|
||||
intel82439tx_init();
|
||||
|
||||
kbdc8042_init(&at8042);
|
||||
kbdc8042_init(machine, &at8042);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -63,21 +63,13 @@ static const eeprom_interface eeprom_intf =
|
||||
"0100110000000" /* unlock command */
|
||||
};
|
||||
|
||||
#if 0
|
||||
static void eeprom_init(void)
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
init_eeprom_count = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static NVRAM_HANDLER( gijoe )
|
||||
{
|
||||
if (read_or_write)
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
{
|
||||
|
@ -3158,14 +3158,14 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( goldnpkr )
|
||||
{
|
||||
pia_config(0, &goldnpkr_pia0_intf);
|
||||
pia_config(1, &goldnpkr_pia1_intf);
|
||||
pia_config(machine, 0, &goldnpkr_pia0_intf);
|
||||
pia_config(machine, 1, &goldnpkr_pia1_intf);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( pottnpkr )
|
||||
{
|
||||
pia_config(0, &pottnpkr_pia0_intf);
|
||||
pia_config(1, &pottnpkr_pia1_intf);
|
||||
pia_config(machine, 0, &pottnpkr_pia0_intf);
|
||||
pia_config(machine, 1, &pottnpkr_pia1_intf);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3214,8 +3214,8 @@ static DRIVER_INIT( royale )
|
||||
// ROM[0x60bb] = 0xea;
|
||||
// ROM[0x60bc] = 0xea;
|
||||
|
||||
pia_config(0, &pottnpkr_pia0_intf);
|
||||
pia_config(1, &pottnpkr_pia1_intf);
|
||||
pia_config(machine, 0, &pottnpkr_pia0_intf);
|
||||
pia_config(machine, 1, &pottnpkr_pia1_intf);
|
||||
}
|
||||
|
||||
/*************************
|
||||
|
@ -143,7 +143,7 @@ static NVRAM_HANDLER( groundfx )
|
||||
if (read_or_write)
|
||||
eeprom_save(file);
|
||||
else {
|
||||
eeprom_init(&groundfx_eeprom_interface);
|
||||
eeprom_init(machine, &groundfx_eeprom_interface);
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
else
|
||||
|
@ -332,7 +332,7 @@ static void eeprom_handler(running_machine *machine, mame_file *file, int read_o
|
||||
}
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
if (file)
|
||||
{
|
||||
eeprom_load(file);
|
||||
|
@ -349,7 +349,7 @@ static NVRAM_HANDLER( gunbustr )
|
||||
if (read_or_write)
|
||||
eeprom_save(file);
|
||||
else {
|
||||
eeprom_init(&gunbustr_eeprom_interface);
|
||||
eeprom_init(machine, &gunbustr_eeprom_interface);
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
else
|
||||
|
@ -653,7 +653,7 @@ static TIMER_CALLBACK( behind_the_beam_update );
|
||||
|
||||
static MACHINE_START( itech8 )
|
||||
{
|
||||
pia_config(0, &pia_interface);
|
||||
pia_config(machine, 0, &pia_interface);
|
||||
}
|
||||
|
||||
static MACHINE_START( sstrike )
|
||||
|
@ -420,8 +420,8 @@ static DRIVER_INIT( jokrwild )
|
||||
}
|
||||
|
||||
/* Initializing PIAs... */
|
||||
// pia_config(0, &pia0_intf);
|
||||
// pia_config(1, &pia1_intf);
|
||||
// pia_config(machine, 0, &pia0_intf);
|
||||
// pia_config(machine, 1, &pia1_intf);
|
||||
}
|
||||
|
||||
|
||||
|
@ -452,7 +452,7 @@ static NVRAM_HANDLER( kickgoal )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C46);
|
||||
eeprom_init(machine, &eeprom_interface_93C46);
|
||||
|
||||
if (file) eeprom_load(file);
|
||||
else
|
||||
|
@ -111,7 +111,7 @@ static NVRAM_HANDLER( konamigq_93C46 )
|
||||
}
|
||||
else
|
||||
{
|
||||
eeprom_init( &eeprom_interface_93C46 );
|
||||
eeprom_init( machine, &eeprom_interface_93C46 );
|
||||
if( file )
|
||||
{
|
||||
eeprom_load( file );
|
||||
@ -349,7 +349,7 @@ static void konamigq_exit(running_machine *machine)
|
||||
static MACHINE_START( konamigq )
|
||||
{
|
||||
/* init the scsi controller and hook up it's DMA */
|
||||
am53cf96_init(&scsi_intf);
|
||||
am53cf96_init(machine, &scsi_intf);
|
||||
add_exit_callback(machine, konamigq_exit);
|
||||
psx_dma_install_read_handler(5, scsi_dma_read);
|
||||
psx_dma_install_write_handler(5, scsi_dma_write);
|
||||
|
@ -142,7 +142,7 @@ static NVRAM_HANDLER( konamigv_93C46 )
|
||||
}
|
||||
else
|
||||
{
|
||||
eeprom_init( &eeprom_interface_93C46 );
|
||||
eeprom_init( machine, &eeprom_interface_93C46 );
|
||||
|
||||
if( file )
|
||||
{
|
||||
@ -311,7 +311,7 @@ static DRIVER_INIT( konamigv )
|
||||
psx_driver_init(machine);
|
||||
|
||||
/* init the scsi controller and hook up it's DMA */
|
||||
am53cf96_init(&scsi_intf);
|
||||
am53cf96_init(machine, &scsi_intf);
|
||||
add_exit_callback(machine, konamigv_exit);
|
||||
psx_dma_install_read_handler(5, scsi_dma_read);
|
||||
psx_dma_install_write_handler(5, scsi_dma_write);
|
||||
@ -537,10 +537,10 @@ static READ32_HANDLER( unknown_r )
|
||||
|
||||
static DRIVER_INIT( simpbowl )
|
||||
{
|
||||
intelflash_init( 0, FLASH_FUJITSU_29F016A, NULL );
|
||||
intelflash_init( 1, FLASH_FUJITSU_29F016A, NULL );
|
||||
intelflash_init( 2, FLASH_FUJITSU_29F016A, NULL );
|
||||
intelflash_init( 3, FLASH_FUJITSU_29F016A, NULL );
|
||||
intelflash_init( machine, 0, FLASH_FUJITSU_29F016A, NULL );
|
||||
intelflash_init( machine, 1, FLASH_FUJITSU_29F016A, NULL );
|
||||
intelflash_init( machine, 2, FLASH_FUJITSU_29F016A, NULL );
|
||||
intelflash_init( machine, 3, FLASH_FUJITSU_29F016A, NULL );
|
||||
|
||||
memory_install_readwrite32_handler( cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1f680080, 0x1f68008f, 0, 0, flash_r, flash_w );
|
||||
memory_install_read32_handler ( cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1f6800c0, 0x1f6800c7, 0, 0, trackball_r );
|
||||
@ -628,7 +628,7 @@ static NVRAM_HANDLER( btchamp )
|
||||
|
||||
static DRIVER_INIT( btchamp )
|
||||
{
|
||||
intelflash_init( 0, FLASH_SHARP_LH28F400, NULL );
|
||||
intelflash_init( machine, 0, FLASH_SHARP_LH28F400, NULL );
|
||||
|
||||
memory_install_readwrite32_handler( cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1f680080, 0x1f68008f, 0, 0, btc_trackball_r, btc_trackball_w );
|
||||
memory_install_write32_handler ( cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1f6800e0, 0x1f6800e3, 0, 0, SMH_NOP );
|
||||
@ -715,7 +715,7 @@ static WRITE32_HANDLER( kdeadeye_0_w )
|
||||
|
||||
static DRIVER_INIT( kdeadeye )
|
||||
{
|
||||
intelflash_init( 0, FLASH_SHARP_LH28F400, NULL );
|
||||
intelflash_init( machine, 0, FLASH_SHARP_LH28F400, NULL );
|
||||
|
||||
memory_install_read32_handler ( cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1f680080, 0x1f680083, 0, 0, input_port_read_handler32(machine->portconfig, "GUNX1") );
|
||||
memory_install_read32_handler ( cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1f680090, 0x1f680093, 0, 0, input_port_read_handler32(machine->portconfig, "GUNY1") );
|
||||
|
@ -468,7 +468,7 @@ static NVRAM_HANDLER(konamigx_93C46)
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C46);
|
||||
eeprom_init(machine, &eeprom_interface_93C46);
|
||||
|
||||
if (file)
|
||||
{
|
||||
@ -3331,7 +3331,7 @@ static DRIVER_INIT(konamigx)
|
||||
int i, match;
|
||||
int readback = 0;
|
||||
|
||||
adc083x_init( 0, ADC0834, adc0834_callback );
|
||||
adc083x_init( machine, 0, ADC0834, adc0834_callback );
|
||||
|
||||
konamigx_cfgport = -1;
|
||||
last_prot_op = -1;
|
||||
|
@ -1361,7 +1361,7 @@ static void flash_init( running_machine *machine )
|
||||
*( flash_init[ i ].start ) = flash_chips;
|
||||
for( chip = 0; chip < flash_init[ i ].chips; chip++ )
|
||||
{
|
||||
intelflash_init( flash_chips, flash_init[ i ].type, data + size );
|
||||
intelflash_init( machine, flash_chips, flash_init[ i ].type, data + size );
|
||||
size += flash_init[ i ].size;
|
||||
flash_chips++;
|
||||
}
|
||||
@ -1419,7 +1419,7 @@ static void security_cart_init( running_machine *machine, int cart, const char *
|
||||
switch( eeprom_length )
|
||||
{
|
||||
case 0x224:
|
||||
x76f041_init( cart, eeprom_rom );
|
||||
x76f041_init( machine, cart, eeprom_rom );
|
||||
chiptype[ cart ] = 1;
|
||||
|
||||
switch( cart )
|
||||
@ -1435,7 +1435,7 @@ static void security_cart_init( running_machine *machine, int cart, const char *
|
||||
break;
|
||||
|
||||
case 0x84:
|
||||
x76f100_init( cart, eeprom_rom );
|
||||
x76f100_init( machine, cart, eeprom_rom );
|
||||
chiptype[ cart ] = 2;
|
||||
|
||||
switch( cart )
|
||||
@ -1478,7 +1478,7 @@ static void security_cart_init( running_machine *machine, int cart, const char *
|
||||
|
||||
if( chiptype[ cart ] != 3 && ds2401_rom != NULL )
|
||||
{
|
||||
ds2401_init( cart, ds2401_rom );
|
||||
ds2401_init( machine, cart, ds2401_rom );
|
||||
has_ds2401[ cart ] = 1;
|
||||
}
|
||||
else
|
||||
@ -1511,7 +1511,7 @@ static DRIVER_INIT( konami573 )
|
||||
state_save_register_item_array( machine, "KSYS573", NULL, 0, m_p_n_root_target );
|
||||
state_save_register_item_array( machine, "KSYS573", NULL, 0, m_p_n_root_start );
|
||||
|
||||
adc083x_init( 0, ADC0834, analogue_inputs_callback );
|
||||
adc083x_init( machine, 0, ADC0834, analogue_inputs_callback );
|
||||
flash_init(machine);
|
||||
}
|
||||
|
||||
@ -1674,7 +1674,7 @@ static DRIVER_INIT( ge765pwbba )
|
||||
{
|
||||
DRIVER_INIT_CALL(konami573);
|
||||
|
||||
uPD4701_init( 0 );
|
||||
uPD4701_init( machine, 0 );
|
||||
|
||||
memory_install_readwrite32_handler( cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1f640000, 0x1f6400ff, 0, 0, ge765pwbba_r, ge765pwbba_w );
|
||||
}
|
||||
@ -2326,7 +2326,7 @@ static void gx894pwbba_init( running_machine *machine, void (*output_callback_fu
|
||||
gx894_ram_read_offset = 0;
|
||||
gx894_ram = auto_malloc( gx894_ram_size );
|
||||
|
||||
ds2401_init( 2, ds2401_xid ); /* todo: load this from roms */
|
||||
ds2401_init( machine, 2, ds2401_xid ); /* todo: load this from roms */
|
||||
|
||||
state_save_register_global_array(machine, gx894pwbba_output_data );
|
||||
state_save_register_global_pointer(machine, gx894_ram, gx894_ram_size / 4 );
|
||||
|
@ -670,7 +670,7 @@ static const ay8910_interface ay8910_config =
|
||||
|
||||
static MACHINE_START( catnmous )
|
||||
{
|
||||
pia_config(0, &pia_0_intf);
|
||||
pia_config(machine, 0, &pia_0_intf);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( catnmous )
|
||||
|
@ -1887,7 +1887,7 @@ static DRIVER_INIT( cerberus )
|
||||
0x3f,0x001d,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0x00, cerberus_eeprom_data, 0, SERIAL_TYPE_NONE);
|
||||
leland_init_eeprom(machine, 0x00, cerberus_eeprom_data, 0, SERIAL_TYPE_NONE);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = cerberus_bankswitch;
|
||||
@ -1935,7 +1935,7 @@ static DRIVER_INIT( mayhem )
|
||||
0x3f,0x0818,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0x00, mayhem_eeprom_data, 0x28, SERIAL_TYPE_ADD);
|
||||
leland_init_eeprom(machine, 0x00, mayhem_eeprom_data, 0x28, SERIAL_TYPE_ADD);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = mayhem_bankswitch;
|
||||
@ -1964,7 +1964,7 @@ static DRIVER_INIT( powrplay )
|
||||
0x2c,0xfffb,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, powrplay_eeprom_data, 0x2d, SERIAL_TYPE_ADD_XOR);
|
||||
leland_init_eeprom(machine, 0xff, powrplay_eeprom_data, 0x2d, SERIAL_TYPE_ADD_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = mayhem_bankswitch;
|
||||
@ -1985,7 +1985,7 @@ static DRIVER_INIT( wseries )
|
||||
0x1d,0x00ff,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, wseries_eeprom_data, 0x12, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, wseries_eeprom_data, 0x12, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = mayhem_bankswitch;
|
||||
@ -2008,7 +2008,7 @@ static DRIVER_INIT( alleymas )
|
||||
0x37,0x00ff,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, alleymas_eeprom_data, 0x0c, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, alleymas_eeprom_data, 0x0c, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = mayhem_bankswitch;
|
||||
@ -2038,7 +2038,7 @@ static DRIVER_INIT( upyoural )
|
||||
0x37,0x00ff,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, upyoural_eeprom_data, 0x0c, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, upyoural_eeprom_data, 0x0c, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = mayhem_bankswitch;
|
||||
@ -2063,7 +2063,7 @@ static DRIVER_INIT( dangerz )
|
||||
0x3a,0x8007,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, dangerz_eeprom_data, 0x10, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, dangerz_eeprom_data, 0x10, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = dangerz_bankswitch;
|
||||
@ -2089,7 +2089,7 @@ static DRIVER_INIT( basebal2 )
|
||||
0x1d,0x00ff,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, basebal2_eeprom_data, 0x12, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, basebal2_eeprom_data, 0x12, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = basebal2_bankswitch;
|
||||
@ -2111,7 +2111,7 @@ static DRIVER_INIT( dblplay )
|
||||
0x3b,0xffe1,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, dblplay_eeprom_data, 0x11, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, dblplay_eeprom_data, 0x11, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = basebal2_bankswitch;
|
||||
@ -2133,7 +2133,7 @@ static DRIVER_INIT( strkzone )
|
||||
0x1b,0xffe1,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, strkzone_eeprom_data, 0x0f, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, strkzone_eeprom_data, 0x0f, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = basebal2_bankswitch;
|
||||
@ -2154,7 +2154,7 @@ static DRIVER_INIT( redlin2p )
|
||||
0x22,0xfffe,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, redlin2p_eeprom_data, 0x18, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, redlin2p_eeprom_data, 0x18, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = redline_bankswitch;
|
||||
@ -2185,7 +2185,7 @@ static DRIVER_INIT( quarterb )
|
||||
0x3a,0xffd9,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, quarterb_eeprom_data, 0x24, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, quarterb_eeprom_data, 0x24, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = viper_bankswitch;
|
||||
@ -2210,7 +2210,7 @@ static DRIVER_INIT( viper )
|
||||
0x1b,0xfffe,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, viper_eeprom_data, 0x0c, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, viper_eeprom_data, 0x0c, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = viper_bankswitch;
|
||||
@ -2241,7 +2241,7 @@ static DRIVER_INIT( teamqb )
|
||||
0x3b,0xffd9,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, teamqb_eeprom_data, 0x1a, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, teamqb_eeprom_data, 0x1a, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = viper_bankswitch;
|
||||
@ -2271,7 +2271,7 @@ static DRIVER_INIT( aafb )
|
||||
0x3b,0xffd9,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, aafb_eeprom_data, 0x1a, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, aafb_eeprom_data, 0x1a, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = viper_bankswitch;
|
||||
@ -2301,7 +2301,7 @@ static DRIVER_INIT( aafbb )
|
||||
0x3b,0xffd9,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, aafb_eeprom_data, 0x1a, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, aafb_eeprom_data, 0x1a, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = viper_bankswitch;
|
||||
@ -2331,7 +2331,7 @@ static DRIVER_INIT( aafbd2p )
|
||||
0x3b,0xffd9,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, aafb_eeprom_data, 0x1a, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, aafb_eeprom_data, 0x1a, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = viper_bankswitch;
|
||||
@ -2366,7 +2366,7 @@ static DRIVER_INIT( offroad )
|
||||
0x3b,0xffad,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, offroad_eeprom_data, 0x00, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, offroad_eeprom_data, 0x00, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = offroad_bankswitch;
|
||||
@ -2403,7 +2403,7 @@ static DRIVER_INIT( offroadt )
|
||||
0x3b,0xffad,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, offroadt_eeprom_data, 0x00, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
leland_init_eeprom(machine, 0xff, offroadt_eeprom_data, 0x00, SERIAL_TYPE_ENCRYPT_XOR);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = offroad_bankswitch;
|
||||
@ -2437,7 +2437,7 @@ static DRIVER_INIT( pigout )
|
||||
0x3b,0xfffc,
|
||||
0xffff
|
||||
};
|
||||
leland_init_eeprom(0xff, pigout_eeprom_data, 0x00, SERIAL_TYPE_ENCRYPT);
|
||||
leland_init_eeprom(machine, 0xff, pigout_eeprom_data, 0x00, SERIAL_TYPE_ENCRYPT);
|
||||
|
||||
/* master CPU bankswitching */
|
||||
leland_update_master_bank = offroad_bankswitch;
|
||||
|
@ -214,7 +214,7 @@ static NVRAM_HANDLER( lethalen )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
{
|
||||
|
@ -1116,7 +1116,7 @@ static void init_mediagx(running_machine *machine)
|
||||
init_pc_common(machine, PCCOMMON_KEYBOARD_AT,mediagx_set_keyb_int);
|
||||
mc146818_init(machine, MC146818_STANDARD);
|
||||
|
||||
kbdc8042_init(&at8042);
|
||||
kbdc8042_init(machine, &at8042);
|
||||
}
|
||||
|
||||
#if SPEEDUP_HACKS
|
||||
|
@ -873,7 +873,7 @@ static MACHINE_START(meritm_crt260)
|
||||
meritm_switch_banks();
|
||||
MACHINE_START_CALL(merit_common);
|
||||
pc16552d_init(0, UART_CLK, NULL, pc16650d_tx_callback);
|
||||
microtouch_init(meritm_microtouch_tx_callback, meritm_touch_coord_transform);
|
||||
microtouch_init(machine, meritm_microtouch_tx_callback, meritm_touch_coord_transform);
|
||||
state_save_register_global(machine, meritm_bank);
|
||||
state_save_register_global(machine, meritm_psd_a15);
|
||||
state_save_register_global_pointer(machine, meritm_ram, 0x8000);
|
||||
|
@ -4222,7 +4222,7 @@ static NVRAM_HANDLER( dokyusp )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C46);
|
||||
eeprom_init(machine, &eeprom_interface_93C46);
|
||||
if (file) eeprom_load(file);
|
||||
else eeprom_set_data(def_data,sizeof(def_data)/sizeof(def_data[0]));
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ static NVRAM_HANDLER( mitchell )
|
||||
}
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
{
|
||||
|
@ -918,27 +918,28 @@ static const eeprom_interface eeprom_intf =
|
||||
5 /* reset_delay (Lost World needs this, very similar to wbeachvl in playmark.c) */
|
||||
};
|
||||
|
||||
static void eeprom_handler(mame_file *file,int read_or_write)
|
||||
static void eeprom_handler(running_machine *machine, mame_file *file, int read_or_write)
|
||||
{
|
||||
if (read_or_write)
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
if (file) eeprom_load(file);
|
||||
}
|
||||
}
|
||||
|
||||
static NVRAM_HANDLER( model3 )
|
||||
{
|
||||
if( mame_stricmp(machine->gamedrv->name, "lostwsga") == 0 ||
|
||||
mame_stricmp(machine->gamedrv->name, "dirtdvls") == 0 ||
|
||||
mame_stricmp(machine->gamedrv->name, "dirtdvla") == 0 ||
|
||||
mame_stricmp(machine->gamedrv->name, "lemans24") == 0 ||
|
||||
mame_stricmp(machine->gamedrv->name, "von2") == 0 ||
|
||||
mame_stricmp(machine->gamedrv->name, "von254g") == 0)
|
||||
const char *name = machine->gamedrv->name;
|
||||
if( mame_stricmp(name, "lostwsga") == 0 ||
|
||||
mame_stricmp(name, "dirtdvls") == 0 ||
|
||||
mame_stricmp(name, "dirtdvla") == 0 ||
|
||||
mame_stricmp(name, "lemans24") == 0 ||
|
||||
mame_stricmp(name, "von2") == 0 ||
|
||||
mame_stricmp(name, "von254g") == 0)
|
||||
{
|
||||
eeprom_handler(file, read_or_write);
|
||||
eeprom_handler(machine, file, read_or_write);
|
||||
} else {
|
||||
NVRAM_HANDLER_CALL(93C46);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ static NVRAM_HANDLER( moo )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
{
|
||||
|
@ -1241,12 +1241,12 @@ static const stepper_interface barcrest_reel_interface =
|
||||
/* Common configurations */
|
||||
static void mpu4_config_common(running_machine *machine)
|
||||
{
|
||||
pia_config(0,&pia_ic3_intf);
|
||||
pia_config(1,&pia_ic4_intf);
|
||||
pia_config(2,&pia_ic5_intf);
|
||||
pia_config(3,&pia_ic6_intf);
|
||||
pia_config(4,&pia_ic7_intf);
|
||||
pia_config(5,&pia_ic8_intf);
|
||||
pia_config(machine, 0,&pia_ic3_intf);
|
||||
pia_config(machine, 1,&pia_ic4_intf);
|
||||
pia_config(machine, 2,&pia_ic5_intf);
|
||||
pia_config(machine, 3,&pia_ic6_intf);
|
||||
pia_config(machine, 4,&pia_ic7_intf);
|
||||
pia_config(machine, 5,&pia_ic8_intf);
|
||||
|
||||
ic24_timer = timer_alloc(machine, ic24_timeout, NULL);
|
||||
/* setup 6840ptm */
|
||||
|
@ -85,7 +85,7 @@ static NVRAM_HANDLER(mystwarr)
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
{
|
||||
@ -103,7 +103,7 @@ static NVRAM_HANDLER(gaiapols)
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf_gaia);
|
||||
eeprom_init(machine, &eeprom_intf_gaia);
|
||||
|
||||
if (file)
|
||||
{
|
||||
|
@ -703,7 +703,7 @@ static NVRAM_HANDLER( naomi_eeproms )
|
||||
/*eeprom_save(file)*/;
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C46);
|
||||
eeprom_init(machine, &eeprom_interface_93C46);
|
||||
/*if (file)
|
||||
eeprom_load(file);
|
||||
else*/
|
||||
|
@ -233,8 +233,8 @@ static const ttl74123_config ic48_1_config =
|
||||
|
||||
static MACHINE_START( nyny )
|
||||
{
|
||||
pia_config(1, &pia_1_intf);
|
||||
pia_config(2, &pia_2_intf);
|
||||
pia_config(machine, 1, &pia_1_intf);
|
||||
pia_config(machine, 2, &pia_2_intf);
|
||||
|
||||
/* setup for save states */
|
||||
state_save_register_global(machine, flipscreen);
|
||||
|
@ -327,7 +327,7 @@ static NVRAM_HANDLER( othunder )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
|
@ -114,7 +114,7 @@ static NVRAM_HANDLER( overdriv )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
|
@ -1025,10 +1025,10 @@ MACHINE_DRIVER_END
|
||||
*****************/
|
||||
|
||||
/* Normal board */
|
||||
static void peplus_init(void)
|
||||
static void peplus_init(running_machine *machine)
|
||||
{
|
||||
/* EEPROM is a X2404P 4K-bit Serial I2C Bus */
|
||||
i2cmem_init(0, I2CMEM_SLAVE_ADDRESS, 8, eeprom_NVRAM_SIZE, NULL);
|
||||
i2cmem_init(machine, 0, I2CMEM_SLAVE_ADDRESS, 8, eeprom_NVRAM_SIZE, NULL);
|
||||
|
||||
/* default : no address to patch in program RAM to enable autohold feature */
|
||||
autohold_addr = 0;
|
||||
@ -1042,7 +1042,7 @@ static void peplus_init(void)
|
||||
/* Normal board */
|
||||
static DRIVER_INIT( peplus )
|
||||
{
|
||||
peplus_init();
|
||||
peplus_init(machine);
|
||||
}
|
||||
|
||||
/* Superboard */
|
||||
@ -1058,7 +1058,7 @@ static DRIVER_INIT( peplussb )
|
||||
memcpy(sd000_ram, &super_data[0xd000], 0x1000);
|
||||
memcpy(sf000_ram, &super_data[0xf000], 0x1000);
|
||||
|
||||
peplus_init();
|
||||
peplus_init(machine);
|
||||
}
|
||||
|
||||
/*************************
|
||||
|
@ -119,7 +119,7 @@ static NVRAM_HANDLER( pirates )
|
||||
if (read_or_write) eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
if (file) eeprom_load(file);
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ static NVRAM_HANDLER( wbeachvl )
|
||||
}
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
|
@ -122,7 +122,7 @@ static NVRAM_HANDLER( polygonet )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ static NVRAM_HANDLER( pntnpuzl )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
|
@ -262,7 +262,7 @@ static NVRAM_HANDLER( policetr )
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_policetr);
|
||||
eeprom_init(machine, &eeprom_interface_policetr);
|
||||
if (file) eeprom_load(file);
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ static NVRAM_HANDLER( magicstk )
|
||||
}
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_intf);
|
||||
eeprom_init(machine, &eeprom_intf);
|
||||
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
|
@ -181,7 +181,7 @@ static NVRAM_HANDLER(93C56)
|
||||
}
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C56);
|
||||
eeprom_init(machine, &eeprom_interface_93C56);
|
||||
if (file)
|
||||
{
|
||||
eeprom_load(file);
|
||||
|
@ -339,7 +339,7 @@ static NVRAM_HANDLER(93C56)
|
||||
}
|
||||
else
|
||||
{
|
||||
eeprom_init(&eeprom_interface_93C56);
|
||||
eeprom_init(machine, &eeprom_interface_93C56);
|
||||
if (file)
|
||||
{
|
||||
eeprom_load(file);
|
||||
|
@ -275,8 +275,8 @@ static const pia6821_interface pia_audio_intf =
|
||||
|
||||
static MACHINE_START( r2dtank )
|
||||
{
|
||||
pia_config(0, &pia_main_intf);
|
||||
pia_config(1, &pia_audio_intf);
|
||||
pia_config(machine, 0, &pia_main_intf);
|
||||
pia_config(machine, 1, &pia_audio_intf);
|
||||
|
||||
/* setup for save states */
|
||||
state_save_register_global(machine, flipscreen);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user