(Wow, I had no idea quite so many drivers were using driver_data!)

Defined new class driver_data_t, which all driver_data classes must
derive from. Updated all class definitions to inherit from the new
class, and to call it in the constructor. Also changed the alloc()
signature to return a driver_data_t pointer instead of a void *.

Renamed and hid machine->driver_data as machine->m_driver_data.
Added a new templatized method machine->driver_data<class> which returns
a properly downcast'ed version of the driver data. Updated all code
which looked like this:

  mydriver_state *state = (mydriver_state *)machine->driver_data;

to this:

  mydriver_state *state = machine->driver_data<mydriver_state>();

The new function does a downcast<> which in debug builds dynamically
verifies that you're actually casting to the right type.

Changed atarigen_state to be a base class from which all the related
Atari drivers derive their state from.

For MESS: this was mostly a bulk search/replace, in 4 steps in
src/mame:

1. Add ": public driver_data_t" to each driver state class definition:

Search:  (class [a-z0-9_]+_state)$
Replace: \1 : public driver_data_t

2. Change the static alloc function to return a driver_data_t *:

Search:  static void \*alloc\(
Replace: static driver_data_t \*alloc\(

3. Change the constructor to initialize driver_data_t:

Search:  ([a-z0-9_]+_state\(running_machine \&machine\)) { }
Replace: \1\r\n\t\t: driver_data_t(machine) { }

4. Replace the state fetchers to use the new templatized function:

Search:  \(([a-z0-9_]+_state) \*\)(.*)machine->driver_data
Replace: \2machine->driver_data<\1>()
This commit is contained in:
Aaron Giles 2010-08-04 15:37:08 +00:00
parent b8b87c341a
commit c85c035c5d
1245 changed files with 11554 additions and 11101 deletions

View File

@ -174,7 +174,6 @@ running_machine::running_machine(const game_driver &driver, const machine_config
generic_video_data(NULL),
generic_audio_data(NULL),
m_debug_view(NULL),
driver_data(NULL),
m_logerror_list(NULL),
m_scheduler(*this),
m_options(options),
@ -190,7 +189,8 @@ running_machine::running_machine(const game_driver &driver, const machine_config
m_saveload_schedule(SLS_NONE),
m_saveload_schedule_time(attotime_zero),
m_saveload_searchpath(NULL),
m_rand_seed(0x9d14abd7)
m_rand_seed(0x9d14abd7),
m_driver_data(NULL)
{
memset(gfx, 0, sizeof(gfx));
memset(&generic, 0, sizeof(generic));
@ -202,7 +202,7 @@ running_machine::running_machine(const game_driver &driver, const machine_config
// allocate the driver data (after devices)
if (m_config.m_driver_data_alloc != NULL)
driver_data = (*m_config.m_driver_data_alloc)(*this);
m_driver_data = (*m_config.m_driver_data_alloc)(*this);
// find devices
primary_screen = screen_first(*this);
@ -965,6 +965,30 @@ running_machine::logerror_callback_item::logerror_callback_item(logerror_callbac
//**************************************************************************
// DRIVER DATA
//**************************************************************************
//-------------------------------------------------
// driver_data_t - constructor
//-------------------------------------------------
driver_data_t::driver_data_t(running_machine &machine)
: m_machine(machine)
{
}
//-------------------------------------------------
// driver_data_t - destructor
//-------------------------------------------------
driver_data_t::~driver_data_t()
{
}
//**************************************************************************
// SYSTEM TIME
//**************************************************************************

View File

@ -157,6 +157,17 @@ typedef struct _generic_audio_private generic_audio_private;
typedef tagged_list<region_info> region_list;
// base class for all driver data structures
class driver_data_t
{
public:
driver_data_t(running_machine &machine);
virtual ~driver_data_t();
running_machine & m_machine;
};
// memory region
class region_info
{
@ -231,6 +242,7 @@ struct generic_pointers
};
// system time description, both local and UTC
class system_time
{
public:
@ -385,7 +397,8 @@ public:
debug_view_manager * m_debug_view; // internal data from debugvw.c
// driver-specific information
void * driver_data; // drivers can hang data off of here instead of using globals
template<class T>
T *driver_data() const { return downcast<T *>(m_driver_data); }
private:
void start();
@ -448,6 +461,8 @@ private:
// base time
time_t m_base_time;
driver_data_t * m_driver_data; // drivers can hang data off of here instead of using globals
};

View File

@ -106,6 +106,8 @@
#define video_update_0 NULL
class driver_data_t;
typedef void (*nvram_handler_func)(running_machine *machine, mame_file *file, int read_or_write);
typedef void (*memcard_handler_func)(running_machine *machine, mame_file *file, int action);
typedef void (*machine_start_func)(running_machine *machine);
@ -117,7 +119,7 @@ typedef void (*video_reset_func)(running_machine *machine);
typedef void (*palette_init_func)(running_machine *machine, const UINT8 *color_prom);
typedef void (*video_eof_func)(running_machine *machine);
typedef UINT32 (*video_update_func)(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect);
typedef void * (*driver_data_alloc_func)(running_machine &machine);
typedef driver_data_t *(*driver_data_alloc_func)(running_machine &machine);

View File

@ -2072,13 +2072,13 @@ static void memory_init_locate(running_machine *machine)
if (entry->m_baseptr != NULL)
*entry->m_baseptr = entry->m_memory;
if (entry->m_baseptroffs_plus1 != 0)
*(void **)((UINT8 *)machine->driver_data + entry->m_baseptroffs_plus1 - 1) = entry->m_memory;
*(void **)(reinterpret_cast<UINT8 *>(machine->driver_data<void>()) + entry->m_baseptroffs_plus1 - 1) = entry->m_memory;
if (entry->m_genbaseptroffs_plus1 != 0)
*(void **)((UINT8 *)&machine->generic + entry->m_genbaseptroffs_plus1 - 1) = entry->m_memory;
if (entry->m_sizeptr != NULL)
*entry->m_sizeptr = entry->m_byteend - entry->m_bytestart + 1;
if (entry->m_sizeptroffs_plus1 != 0)
*(size_t *)((UINT8 *)machine->driver_data + entry->m_sizeptroffs_plus1 - 1) = entry->m_byteend - entry->m_bytestart + 1;
*(size_t *)(reinterpret_cast<UINT8 *>(machine->driver_data<void>()) + entry->m_sizeptroffs_plus1 - 1) = entry->m_byteend - entry->m_bytestart + 1;
if (entry->m_gensizeptroffs_plus1 != 0)
*(size_t *)((UINT8 *)&machine->generic + entry->m_gensizeptroffs_plus1 - 1) = entry->m_byteend - entry->m_bytestart + 1;
}

View File

@ -16,7 +16,7 @@
MACHINE_START( extra_8080bw_sh )
{
mw8080bw_state *state = (mw8080bw_state *)machine->driver_data;
mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
state_save_register_global(machine, state->port_1_last_extra);
state_save_register_global(machine, state->port_2_last_extra);
@ -31,7 +31,7 @@ MACHINE_START( extra_8080bw_sh )
WRITE8_HANDLER( invadpt2_sh_port_1_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
sn76477_enable_w(state->sn, !(data & 0x01)); /* SAUCER SOUND */
@ -58,7 +58,7 @@ WRITE8_HANDLER( invadpt2_sh_port_2_w )
D2 = 82K
D3 = 100K */
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 4, 3, 0); /* FLEET */
@ -81,7 +81,7 @@ WRITE8_HANDLER( invadpt2_sh_port_2_w )
WRITE8_HANDLER( spcewars_sh_port_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
sn76477_enable_w(state->sn, !(data & 0x01)); /* Saucer Sound */
@ -125,7 +125,7 @@ const samples_interface lrescue_samples_interface =
WRITE8_HANDLER( lrescue_sh_port_1_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 0, 3, 0); /* Thrust */
@ -143,7 +143,7 @@ WRITE8_HANDLER( lrescue_sh_port_1_w )
WRITE8_HANDLER( lrescue_sh_port_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 1, 8, 0); /* Footstep high tone */
@ -183,7 +183,7 @@ WRITE8_HANDLER( cosmo_sh_port_2_w )
WRITE8_HANDLER( ballbomb_sh_port_1_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 1, 2, 0); /* Hit a balloon */
@ -201,7 +201,7 @@ WRITE8_HANDLER( ballbomb_sh_port_1_w )
WRITE8_HANDLER( ballbomb_sh_port_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (data & 0x01) sample_start(state->samples, 0, 7, 0); /* Indicates plane will drop bombs */
@ -260,7 +260,7 @@ DISCRETE_SOUND_END
WRITE8_HANDLER( indianbt_sh_port_1_w )
{
/* bit 4 occurs every 5.25 seconds during gameplay */
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 1, 7, 0); /* Death */
@ -277,7 +277,7 @@ WRITE8_HANDLER( indianbt_sh_port_1_w )
WRITE8_HANDLER( indianbt_sh_port_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 4, 0, 0); /* Bird dropped an egg, Lasso used */
@ -633,7 +633,7 @@ WRITE8_DEVICE_HANDLER( polaris_sh_port_2_w )
WRITE8_DEVICE_HANDLER( polaris_sh_port_3_w )
{
mw8080bw_state *state = (mw8080bw_state *)device->machine->driver_data;
mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
coin_lockout_global_w(device->machine, data & 0x04); /* SX8 */
@ -787,7 +787,7 @@ static const double schaser_effect_rc[8] =
WRITE8_HANDLER( schaser_sh_port_1_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
int effect;
/* bit 0 - Dot Sound Enable (SX0)
@ -860,7 +860,7 @@ WRITE8_HANDLER( schaser_sh_port_2_w )
bit 4 - Field Control B (SX10)
bit 5 - Flip Screen */
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
//printf( "schaser_sh_port_2_w: %02x\n", data );
@ -882,7 +882,7 @@ WRITE8_HANDLER( schaser_sh_port_2_w )
static TIMER_CALLBACK( schaser_effect_555_cb )
{
mw8080bw_state *state = (mw8080bw_state *)machine->driver_data;
mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
int effect = param;
attotime new_time;
/* Toggle 555 output */
@ -907,7 +907,7 @@ static TIMER_CALLBACK( schaser_effect_555_cb )
static STATE_POSTLOAD( schaser_reinit_555_time_remain )
{
mw8080bw_state *state = (mw8080bw_state *)machine->driver_data;
mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
state->schaser_effect_555_time_remain = double_to_attotime(state->schaser_effect_555_time_remain_savable);
schaser_sh_port_2_w(space, 0, state->port_2_last_extra);
@ -916,7 +916,7 @@ static STATE_POSTLOAD( schaser_reinit_555_time_remain )
MACHINE_START( schaser_sh )
{
mw8080bw_state *state = (mw8080bw_state *)machine->driver_data;
mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
state->schaser_effect_555_timer = timer_alloc(machine, schaser_effect_555_cb, NULL);
@ -930,7 +930,7 @@ MACHINE_START( schaser_sh )
MACHINE_RESET( schaser_sh )
{
mw8080bw_state *state = (mw8080bw_state *)machine->driver_data;
mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
state->schaser_effect_555_is_low = 0;
@ -950,7 +950,7 @@ MACHINE_RESET( schaser_sh )
WRITE8_HANDLER( rollingc_sh_port_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_3_last_extra;
if (rising_bits & 0x02) sample_start(state->samples, 4, 0, 0); /* Steering */
@ -974,7 +974,7 @@ WRITE8_HANDLER( rollingc_sh_port_w )
WRITE8_HANDLER( invrvnge_sh_port_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
switch (data)
{
@ -1019,7 +1019,7 @@ WRITE8_HANDLER( invrvnge_sh_port_w )
WRITE8_HANDLER( lupin3_sh_port_1_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 0, 6, 0); /* Walking, get money */
@ -1035,7 +1035,7 @@ WRITE8_HANDLER( lupin3_sh_port_1_w )
WRITE8_HANDLER( lupin3_sh_port_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 0, 3, 0); /* Lands on top of building, wife kicks man */
@ -1064,7 +1064,7 @@ WRITE8_HANDLER( schasercv_sh_port_1_w )
bit 3 = 1st speedup
Death is a stream of ff's with some fe's thrown in */
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x02) sample_start(state->samples, 1, 6, 0); /* Ran over a dot */
@ -1075,7 +1075,7 @@ WRITE8_HANDLER( schasercv_sh_port_1_w )
WRITE8_HANDLER( schasercv_sh_port_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
speaker_level_w(state->speaker, (data & 0x01) ? 1 : 0); /* End-of-Level */
@ -1092,7 +1092,7 @@ WRITE8_HANDLER( schasercv_sh_port_2_w )
WRITE8_HANDLER( yosakdon_sh_port_1_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 0, 3, 0); /* Game Over */
@ -1108,7 +1108,7 @@ WRITE8_HANDLER( yosakdon_sh_port_1_w )
WRITE8_HANDLER( yosakdon_sh_port_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 1, 6, 0); /* Ready? , Game Over */
@ -1132,7 +1132,7 @@ WRITE8_HANDLER( yosakdon_sh_port_2_w )
WRITE8_HANDLER( shuttlei_sh_port_1_w )
{
/* bit 3 is high while you are alive and playing */
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 4, 4, 0); /* Fleet move */
@ -1145,7 +1145,7 @@ WRITE8_HANDLER( shuttlei_sh_port_1_w )
WRITE8_HANDLER( shuttlei_sh_port_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
switch (data)
{

View File

@ -34,7 +34,7 @@
WRITE8_HANDLER( astrof_audio_1_w )
{
astrof_state *state = (astrof_state *)space->machine->driver_data;
astrof_state *state = space->machine->driver_data<astrof_state>();
UINT8 rising_bits = data & ~state->port_1_last;
if (state->astrof_death_playing)
@ -80,7 +80,7 @@ WRITE8_HANDLER( astrof_audio_1_w )
WRITE8_HANDLER( astrof_audio_2_w )
{
astrof_state *state = (astrof_state *)space->machine->driver_data;
astrof_state *state = space->machine->driver_data<astrof_state>();
UINT8 rising_bits = data & ~state->port_2_last;
/* D0-D2 - explosion select (triggered by D2 of the other port */
@ -184,7 +184,7 @@ MACHINE_DRIVER_END
WRITE8_HANDLER( tomahawk_audio_w )
{
astrof_state *state = (astrof_state *)space->machine->driver_data;
astrof_state *state = space->machine->driver_data<astrof_state>();
/* D0 - sonar */

View File

@ -203,7 +203,7 @@ void atarijsa_reset(void)
static READ8_HANDLER( jsa1_io_r )
{
atarigen_state *atarigen = (atarigen_state *)space->machine->driver_data;
atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
@ -333,7 +333,7 @@ static WRITE8_HANDLER( jsa1_io_w )
static READ8_HANDLER( jsa2_io_r )
{
atarigen_state *atarigen = (atarigen_state *)space->machine->driver_data;
atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
@ -458,7 +458,7 @@ static WRITE8_HANDLER( jsa2_io_w )
static READ8_HANDLER( jsa3_io_r )
{
atarigen_state *atarigen = (atarigen_state *)space->machine->driver_data;
atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
@ -592,7 +592,7 @@ static WRITE8_HANDLER( jsa3_io_w )
static READ8_HANDLER( jsa3s_io_r )
{
atarigen_state *atarigen = (atarigen_state *)space->machine->driver_data;
atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)

View File

@ -172,7 +172,7 @@ DISCRETE_SOUND_END
WRITE8_HANDLER( circus_clown_z_w )
{
circus_state *state = (circus_state *)space->machine->driver_data;
circus_state *state = space->machine->driver_data<circus_state>();
state->clown_z = (data & 0x0f);
*(memory_region(space->machine, "maincpu") + 0x8000) = data; logerror("Z:%02x\n",data); //DEBUG

View File

@ -17,7 +17,7 @@ static void update_sound_68k_interrupts(running_machine *machine);
void cyberbal_sound_reset(running_machine *machine)
{
cyberbal_state *state = (cyberbal_state *)machine->driver_data;
cyberbal_state *state = machine->driver_data<cyberbal_state>();
/* reset the sound system */
state->bank_base = &memory_region(machine, "audiocpu")[0x10000];
@ -37,18 +37,18 @@ void cyberbal_sound_reset(running_machine *machine)
READ8_HANDLER( cyberbal_special_port3_r )
{
cyberbal_state *state = (cyberbal_state *)space->machine->driver_data;
cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
int temp = input_port_read(space->machine, "JSAII");
if (!(input_port_read(space->machine, "IN0") & 0x8000)) temp ^= 0x80;
if (state->atarigen.cpu_to_sound_ready) temp ^= 0x40;
if (state->atarigen.sound_to_cpu_ready) temp ^= 0x20;
if (state->cpu_to_sound_ready) temp ^= 0x40;
if (state->sound_to_cpu_ready) temp ^= 0x20;
return temp;
}
READ8_HANDLER( cyberbal_sound_6502_stat_r )
{
cyberbal_state *state = (cyberbal_state *)space->machine->driver_data;
cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
int temp = 0xff;
if (state->sound_data_from_6502_ready) temp ^= 0x80;
if (state->sound_data_from_68k_ready) temp ^= 0x40;
@ -58,7 +58,7 @@ READ8_HANDLER( cyberbal_sound_6502_stat_r )
WRITE8_HANDLER( cyberbal_sound_bank_select_w )
{
cyberbal_state *state = (cyberbal_state *)space->machine->driver_data;
cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
memory_set_bankptr(space->machine, "soundbank", &state->bank_base[0x1000 * ((data >> 6) & 3)]);
coin_counter_w(space->machine, 1, (data >> 5) & 1);
coin_counter_w(space->machine, 0, (data >> 4) & 1);
@ -69,7 +69,7 @@ WRITE8_HANDLER( cyberbal_sound_bank_select_w )
READ8_HANDLER( cyberbal_sound_68k_6502_r )
{
cyberbal_state *state = (cyberbal_state *)space->machine->driver_data;
cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
state->sound_data_from_68k_ready = 0;
return state->sound_data_from_68k;
}
@ -77,7 +77,7 @@ READ8_HANDLER( cyberbal_sound_68k_6502_r )
WRITE8_HANDLER( cyberbal_sound_68k_6502_w )
{
cyberbal_state *state = (cyberbal_state *)space->machine->driver_data;
cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
state->sound_data_from_6502 = data;
state->sound_data_from_6502_ready = 1;
@ -99,7 +99,7 @@ WRITE8_HANDLER( cyberbal_sound_68k_6502_w )
static void update_sound_68k_interrupts(running_machine *machine)
{
cyberbal_state *state = (cyberbal_state *)machine->driver_data;
cyberbal_state *state = machine->driver_data<cyberbal_state>();
cputag_set_input_line(machine, "dac", 6, state->fast_68k_int ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "dac", 2, state->io_68k_int ? ASSERT_LINE : CLEAR_LINE);
}
@ -107,7 +107,7 @@ static void update_sound_68k_interrupts(running_machine *machine)
INTERRUPT_GEN( cyberbal_sound_68k_irq_gen )
{
cyberbal_state *state = (cyberbal_state *)device->machine->driver_data;
cyberbal_state *state = device->machine->driver_data<cyberbal_state>();
if (!state->fast_68k_int)
{
state->fast_68k_int = 1;
@ -118,7 +118,7 @@ INTERRUPT_GEN( cyberbal_sound_68k_irq_gen )
WRITE16_HANDLER( cyberbal_io_68k_irq_ack_w )
{
cyberbal_state *state = (cyberbal_state *)space->machine->driver_data;
cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
if (state->io_68k_int)
{
state->io_68k_int = 0;
@ -129,7 +129,7 @@ WRITE16_HANDLER( cyberbal_io_68k_irq_ack_w )
READ16_HANDLER( cyberbal_sound_68k_r )
{
cyberbal_state *state = (cyberbal_state *)space->machine->driver_data;
cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
int temp = (state->sound_data_from_6502 << 8) | 0xff;
state->sound_data_from_6502_ready = 0;
@ -142,7 +142,7 @@ READ16_HANDLER( cyberbal_sound_68k_r )
WRITE16_HANDLER( cyberbal_sound_68k_w )
{
cyberbal_state *state = (cyberbal_state *)space->machine->driver_data;
cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
if (ACCESSING_BITS_8_15)
{
state->sound_data_from_68k = (data >> 8) & 0xff;
@ -153,7 +153,7 @@ WRITE16_HANDLER( cyberbal_sound_68k_w )
WRITE16_HANDLER( cyberbal_sound_68k_dac_w )
{
cyberbal_state *state = (cyberbal_state *)space->machine->driver_data;
cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
running_device *dac = space->machine->device((offset & 8) ? "dac2" : "dac1");
dac_data_16_w(dac, (((data >> 3) & 0x800) | ((data >> 2) & 0x7ff)) << 4);

View File

@ -1066,7 +1066,7 @@ DISCRETE_SOUND_END
static SOUND_START( dkong)
{
dkong_state *state = (dkong_state *)machine->driver_data;
dkong_state *state = machine->driver_data<dkong_state>();
state->snd_rom = memory_region(machine, "soundcpu");
}
@ -1196,7 +1196,7 @@ static READ8_DEVICE_HANDLER( dkong_voice_status_r )
static READ8_DEVICE_HANDLER( dkong_tune_r )
{
dkong_state *state = (dkong_state *)device->machine->driver_data;
dkong_state *state = device->machine->driver_data<dkong_state>();
UINT8 page = latch8_r(state->dev_vp2,0) & 0x47;
if ( page & 0x40 )

View File

@ -41,7 +41,7 @@ static const struct gotya_sample gotya_samples[] =
WRITE8_HANDLER( gotya_soundlatch_w )
{
gotya_state *state = (gotya_state *)space->machine->driver_data;
gotya_state *state = space->machine->driver_data<gotya_state>();
int sample_number;
if (data == 0)

View File

@ -23,7 +23,7 @@
void hdsnd_init(running_machine *machine)
{
harddriv_state *state = (harddriv_state *)machine->driver_data;
harddriv_state *state = machine->driver_data<harddriv_state>();
state->rombase = (UINT8 *)memory_region(machine, "serialroms");
state->romsize = memory_region_length(machine, "serialroms");
}
@ -38,7 +38,7 @@ void hdsnd_init(running_machine *machine)
static void update_68k_interrupts(running_machine *machine)
{
harddriv_state *state = (harddriv_state *)machine->driver_data;
harddriv_state *state = machine->driver_data<harddriv_state>();
cpu_set_input_line(state->soundcpu, 1, state->mainflag ? ASSERT_LINE : CLEAR_LINE);
cpu_set_input_line(state->soundcpu, 3, state->irq68k ? ASSERT_LINE : CLEAR_LINE);
}
@ -53,7 +53,7 @@ static void update_68k_interrupts(running_machine *machine)
READ16_HANDLER( hd68k_snd_data_r )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
state->soundflag = 0;
logerror("%06X:main read from sound=%04X\n", cpu_get_previouspc(space->cpu), state->sounddata);
return state->sounddata;
@ -62,14 +62,14 @@ READ16_HANDLER( hd68k_snd_data_r )
READ16_HANDLER( hd68k_snd_status_r )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
return (state->mainflag << 15) | (state->soundflag << 14) | 0x1fff;
}
static TIMER_CALLBACK( delayed_68k_w )
{
harddriv_state *state = (harddriv_state *)machine->driver_data;
harddriv_state *state = machine->driver_data<harddriv_state>();
state->maindata = param;
state->mainflag = 1;
update_68k_interrupts(machine);
@ -85,7 +85,7 @@ WRITE16_HANDLER( hd68k_snd_data_w )
WRITE16_HANDLER( hd68k_snd_reset_w )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
cpu_set_input_line(state->soundcpu, INPUT_LINE_RESET, ASSERT_LINE);
cpu_set_input_line(state->soundcpu, INPUT_LINE_RESET, CLEAR_LINE);
state->mainflag = state->soundflag = 0;
@ -103,7 +103,7 @@ WRITE16_HANDLER( hd68k_snd_reset_w )
READ16_HANDLER( hdsnd68k_data_r )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
state->mainflag = 0;
update_68k_interrupts(space->machine);
logerror("%06X:sound read from main=%04X\n", cpu_get_previouspc(space->cpu), state->maindata);
@ -113,7 +113,7 @@ READ16_HANDLER( hdsnd68k_data_r )
WRITE16_HANDLER( hdsnd68k_data_w )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
COMBINE_DATA(&state->sounddata);
state->soundflag = 1;
logerror("%06X:sound write to main=%04X\n", cpu_get_previouspc(space->cpu), data);
@ -148,7 +148,7 @@ READ16_HANDLER( hdsnd68k_status_r )
// D14 = 'Sound Flag'
// D13 = Test Switch
// D12 = 5220 Ready Flag (0=Ready)
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
logerror("%06X:hdsnd68k_status_r(%04X)\n", cpu_get_previouspc(space->cpu), offset);
return (state->mainflag << 15) | (state->soundflag << 14) | 0x2000 | 0;//((input_port_read(space->machine, "IN0") & 0x0020) << 8) | 0;
}
@ -163,7 +163,7 @@ READ16_HANDLER( hdsnd68k_status_r )
WRITE16_HANDLER( hdsnd68k_latches_w )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
/* bit 3 selects the value; data is ignored */
data = (offset >> 3) & 1;
@ -212,7 +212,7 @@ WRITE16_HANDLER( hdsnd68k_speech_w )
WRITE16_HANDLER( hdsnd68k_irqclr_w )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
state->irq68k = 0;
update_68k_interrupts(space->machine);
}
@ -227,21 +227,21 @@ WRITE16_HANDLER( hdsnd68k_irqclr_w )
READ16_HANDLER( hdsnd68k_320ram_r )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
return state->sounddsp_ram[offset & 0xfff];
}
WRITE16_HANDLER( hdsnd68k_320ram_w )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
COMBINE_DATA(&state->sounddsp_ram[offset & 0xfff]);
}
READ16_HANDLER( hdsnd68k_320ports_r )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
const address_space *iospace = cpu_get_address_space(state->sounddsp, ADDRESS_SPACE_IO);
return memory_read_word(iospace, (offset & 7) << 1);
}
@ -249,7 +249,7 @@ READ16_HANDLER( hdsnd68k_320ports_r )
WRITE16_HANDLER( hdsnd68k_320ports_w )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
const address_space *iospace = cpu_get_address_space(state->sounddsp, ADDRESS_SPACE_IO);
memory_write_word(iospace, (offset & 7) << 1, data);
}
@ -257,7 +257,7 @@ WRITE16_HANDLER( hdsnd68k_320ports_w )
READ16_HANDLER( hdsnd68k_320com_r )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
if (state->cramen)
return state->comram[offset & 0x1ff];
@ -269,7 +269,7 @@ READ16_HANDLER( hdsnd68k_320com_r )
WRITE16_HANDLER( hdsnd68k_320com_w )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
if (state->cramen)
COMBINE_DATA(&state->comram[offset & 0x1ff]);
@ -287,7 +287,7 @@ WRITE16_HANDLER( hdsnd68k_320com_w )
READ16_HANDLER( hdsnddsp_get_bio )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
UINT64 cycles_since_last_bio = state->sounddsp->total_cycles() - state->last_bio_cycles;
INT32 cycles_until_bio = CYCLES_PER_BIO - cycles_since_last_bio;
@ -312,7 +312,7 @@ READ16_HANDLER( hdsnddsp_get_bio )
WRITE16_DEVICE_HANDLER( hdsnddsp_dac_w )
{
harddriv_state *state = (harddriv_state *)device->machine->driver_data;
harddriv_state *state = device->machine->driver_data<harddriv_state>();
/* DAC L */
if (!state->dacmute)
@ -338,7 +338,7 @@ WRITE16_HANDLER( hdsnddsp_mute_w )
WRITE16_HANDLER( hdsnddsp_gen68kirq_w )
{
/* generate 68k IRQ */
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
state->irq68k = 1;
update_68k_interrupts(space->machine);
}
@ -346,7 +346,7 @@ WRITE16_HANDLER( hdsnddsp_gen68kirq_w )
WRITE16_HANDLER( hdsnddsp_soundaddr_w )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
if (offset == 0)
{
/* select sound ROM block */
@ -362,7 +362,7 @@ WRITE16_HANDLER( hdsnddsp_soundaddr_w )
READ16_HANDLER( hdsnddsp_rom_r )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
if (state->sound_rom_offs < state->romsize)
return state->rombase[state->sound_rom_offs++] << 7;
state->sound_rom_offs++;
@ -372,7 +372,7 @@ READ16_HANDLER( hdsnddsp_rom_r )
READ16_HANDLER( hdsnddsp_comram_r )
{
harddriv_state *state = (harddriv_state *)space->machine->driver_data;
harddriv_state *state = space->machine->driver_data<harddriv_state>();
return state->comram[state->sound_rom_offs++ & 0x1ff];
}

View File

@ -20,7 +20,7 @@
static SOUND_START( irem_audio )
{
irem_z80_state *state = (irem_z80_state *)machine->driver_data;
irem_z80_state *state = machine->driver_data<irem_z80_state>();
state->adpcm1 = machine->device("msm1");
state->adpcm2 = machine->device("msm2");
@ -58,7 +58,7 @@ WRITE8_HANDLER( irem_sound_cmd_w )
static WRITE8_HANDLER( m6803_port1_w )
{
irem_z80_state *state = (irem_z80_state *)space->machine->driver_data;
irem_z80_state *state = space->machine->driver_data<irem_z80_state>();
state->port1 = data;
}
@ -66,7 +66,7 @@ static WRITE8_HANDLER( m6803_port1_w )
static WRITE8_HANDLER( m6803_port2_w )
{
irem_z80_state *state = (irem_z80_state *)space->machine->driver_data;
irem_z80_state *state = space->machine->driver_data<irem_z80_state>();
/* write latch */
if ((state->port2 & 0x01) && !(data & 0x01))
@ -102,7 +102,7 @@ static WRITE8_HANDLER( m6803_port2_w )
static READ8_HANDLER( m6803_port1_r )
{
irem_z80_state *state = (irem_z80_state *)space->machine->driver_data;
irem_z80_state *state = space->machine->driver_data<irem_z80_state>();
/* PSG 0 or 1? */
if (state->port2 & 0x08)
@ -128,7 +128,7 @@ static READ8_HANDLER( m6803_port2_r )
static WRITE8_DEVICE_HANDLER( ay8910_0_portb_w )
{
irem_z80_state *state = (irem_z80_state *)device->machine->driver_data;
irem_z80_state *state = device->machine->driver_data<irem_z80_state>();
/* bits 2-4 select MSM5205 clock & 3b/4b playback mode */
msm5205_playmode_w(state->adpcm1, (data >> 2) & 7);
@ -165,7 +165,7 @@ static WRITE8_HANDLER( sound_irq_ack_w )
static WRITE8_HANDLER( m52_adpcm_w )
{
irem_z80_state *state = (irem_z80_state *)space->machine->driver_data;
irem_z80_state *state = space->machine->driver_data<irem_z80_state>();
if (offset & 1)
{
@ -181,7 +181,7 @@ static WRITE8_HANDLER( m52_adpcm_w )
static WRITE8_HANDLER( m62_adpcm_w )
{
irem_z80_state *state = (irem_z80_state *)space->machine->driver_data;
irem_z80_state *state = space->machine->driver_data<irem_z80_state>();
running_device *adpcm = (offset & 1) ? state->adpcm2 : state->adpcm1;
if (adpcm != NULL)
@ -198,7 +198,7 @@ static WRITE8_HANDLER( m62_adpcm_w )
static void adpcm_int(running_device *device)
{
irem_z80_state *state = (irem_z80_state *)device->machine->driver_data;
irem_z80_state *state = device->machine->driver_data<irem_z80_state>();
cputag_set_input_line(device->machine, "iremsound", INPUT_LINE_NMI, PULSE_LINE);

View File

@ -22,7 +22,7 @@
static SOUND_START( jedi )
{
jedi_state *state = (jedi_state *)machine->driver_data;
jedi_state *state = machine->driver_data<jedi_state>();
/* set up save state */
state_save_register_global(machine, state->audio_latch);
@ -40,7 +40,7 @@ static SOUND_START( jedi )
static SOUND_RESET( jedi )
{
jedi_state *state = (jedi_state *)machine->driver_data;
jedi_state *state = machine->driver_data<jedi_state>();
/* init globals */
state->audio_latch = 0;
@ -79,7 +79,7 @@ WRITE8_HANDLER( jedi_audio_reset_w )
static TIMER_CALLBACK( delayed_audio_latch_w )
{
jedi_state *state = (jedi_state *)machine->driver_data;
jedi_state *state = machine->driver_data<jedi_state>();
state->audio_latch = param;
*state->audio_comm_stat |= 0x80;
@ -94,7 +94,7 @@ WRITE8_HANDLER( jedi_audio_latch_w )
static READ8_HANDLER( audio_latch_r )
{
jedi_state *state = (jedi_state *)space->machine->driver_data;
jedi_state *state = space->machine->driver_data<jedi_state>();
*state->audio_comm_stat &= ~0x80;
return state->audio_latch;
@ -103,7 +103,7 @@ static READ8_HANDLER( audio_latch_r )
CUSTOM_INPUT( jedi_audio_comm_stat_r )
{
jedi_state *state = (jedi_state *)field->port->machine->driver_data;
jedi_state *state = field->port->machine->driver_data<jedi_state>();
return *state->audio_comm_stat >> 6;
}
@ -117,7 +117,7 @@ CUSTOM_INPUT( jedi_audio_comm_stat_r )
READ8_HANDLER( jedi_audio_ack_latch_r )
{
jedi_state *state = (jedi_state *)space->machine->driver_data;
jedi_state *state = space->machine->driver_data<jedi_state>();
*state->audio_comm_stat &= ~0x40;
return state->audio_ack_latch;
@ -126,7 +126,7 @@ READ8_HANDLER( jedi_audio_ack_latch_r )
static WRITE8_HANDLER( audio_ack_latch_w )
{
jedi_state *state = (jedi_state *)space->machine->driver_data;
jedi_state *state = space->machine->driver_data<jedi_state>();
state->audio_ack_latch = data;
*state->audio_comm_stat |= 0x40;
@ -142,7 +142,7 @@ static WRITE8_HANDLER( audio_ack_latch_w )
static WRITE8_HANDLER( speech_strobe_w )
{
jedi_state *state = (jedi_state *)space->machine->driver_data;
jedi_state *state = space->machine->driver_data<jedi_state>();
int new_speech_strobe_state = (~offset >> 8) & 1;
if ((new_speech_strobe_state != state->speech_strobe_state) && new_speech_strobe_state)

View File

@ -5,13 +5,13 @@
WRITE8_HANDLER( laserbat_csound1_w )
{
laserbat_state *state = (laserbat_state *)space->machine->driver_data;
laserbat_state *state = space->machine->driver_data<laserbat_state>();
state->csound1 = data;
}
WRITE8_HANDLER( laserbat_csound2_w )
{
laserbat_state *state = (laserbat_state *)space->machine->driver_data;
laserbat_state *state = space->machine->driver_data<laserbat_state>();
int ksound = 0;
if (data & 0x01)

View File

@ -450,7 +450,7 @@ DISCRETE_SOUND_END
static void set_ea(const address_space *space, int ea)
{
mario_state *state = (mario_state *)space->machine->driver_data;
mario_state *state = space->machine->driver_data<mario_state>();
//printf("ea: %d\n", ea);
//cputag_set_input_line(machine, "audiocpu", MCS48_INPUT_EA, (ea) ? ASSERT_LINE : CLEAR_LINE);
if (state->eabank != NULL)
@ -465,7 +465,7 @@ static void set_ea(const address_space *space, int ea)
static SOUND_START( mario )
{
mario_state *state = (mario_state *)machine->driver_data;
mario_state *state = machine->driver_data<mario_state>();
running_device *audiocpu = machine->device("audiocpu");
#if USE_8039
UINT8 *SND = memory_region(machine, "audiocpu");
@ -488,7 +488,7 @@ static SOUND_START( mario )
static SOUND_RESET( mario )
{
mario_state *state = (mario_state *)machine->driver_data;
mario_state *state = machine->driver_data<mario_state>();
const address_space *space = cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM);
#if USE_8039
@ -567,7 +567,7 @@ static WRITE8_HANDLER( mario_sh_p2_w )
WRITE8_HANDLER( masao_sh_irqtrigger_w )
{
mario_state *state = (mario_state *)space->machine->driver_data;
mario_state *state = space->machine->driver_data<mario_state>();
if (state->last == 1 && data == 0)
{
@ -600,7 +600,7 @@ WRITE8_DEVICE_HANDLER( mario_sh2_w )
/* Misc samples */
WRITE8_HANDLER( mario_sh3_w )
{
mario_state *state = (mario_state *)space->machine->driver_data;
mario_state *state = space->machine->driver_data<mario_state>();
switch (offset)
{

View File

@ -181,7 +181,7 @@ static void recompute_filter(lp_filter *iir, double k, double q, double fc)
void micro3d_noise_sh_w(running_machine *machine, UINT8 data)
{
micro3d_state *state = (micro3d_state*)machine->driver_data;
micro3d_state *state = machine->driver_data<micro3d_state>();
if (~data & 8)
{
@ -373,7 +373,7 @@ DEVICE_GET_INFO( micro3d_sound )
WRITE8_HANDLER( micro3d_snd_dac_a )
{
micro3d_state *state = (micro3d_state*)space->machine->driver_data;
micro3d_state *state = space->machine->driver_data<micro3d_state>();
state->dac_data = data;
}
@ -384,7 +384,7 @@ WRITE8_HANDLER( micro3d_snd_dac_b )
WRITE8_HANDLER( micro3d_sound_io_w )
{
micro3d_state *state = (micro3d_state*)space->machine->driver_data;
micro3d_state *state = space->machine->driver_data<micro3d_state>();
state->sound_port_latch[offset] = data;
@ -407,7 +407,7 @@ WRITE8_HANDLER( micro3d_sound_io_w )
READ8_HANDLER( micro3d_sound_io_r )
{
micro3d_state *state = (micro3d_state*)space->machine->driver_data;
micro3d_state *state = space->machine->driver_data<micro3d_state>();
switch (offset)
{

View File

@ -19,7 +19,7 @@
static SOUND_START( samples )
{
mw8080bw_state *state = (mw8080bw_state *)machine->driver_data;
mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
/* setup for save states */
state_save_register_global(machine, state->port_1_last);
@ -165,7 +165,7 @@ MACHINE_DRIVER_END
WRITE8_HANDLER( seawolf_audio_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last;
/* if (data & 0x01) enable SHIP HIT sound */
@ -231,7 +231,7 @@ MACHINE_DRIVER_END
WRITE8_HANDLER( gunfight_audio_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
/* D0 and D1 are just tied to 1k resistors */
@ -1284,7 +1284,7 @@ WRITE8_DEVICE_HANDLER( desertgu_audio_1_w )
WRITE8_DEVICE_HANDLER( desertgu_audio_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)device->machine->driver_data;
mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
discrete_sound_w(device, DESERTGU_ROADRUNNER_BEEP_BEEP_EN, (data >> 0) & 0x01);
@ -1593,7 +1593,7 @@ WRITE8_HANDLER( gmissile_audio_1_w )
reversed (D5=R, D7=L), but the software confirms that
ours is right */
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last;
/* D0 and D1 are not connected */
@ -1688,7 +1688,7 @@ MACHINE_DRIVER_END
WRITE8_HANDLER( m4_audio_1_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last;
/* D0 and D1 are not connected */
@ -1715,7 +1715,7 @@ WRITE8_HANDLER( m4_audio_1_w )
WRITE8_HANDLER( m4_audio_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last;
/* if (data & 0x01) enable LEFT PLAYER EXPLOSION sound via 510K res (goes to left speaker) */
@ -1950,7 +1950,7 @@ MACHINE_DRIVER_END
WRITE8_HANDLER( clowns_audio_1_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
coin_counter_w(space->machine, 0, (data >> 0) & 0x01);
state->clowns_controller_select = (data >> 1) & 0x01;
@ -1961,7 +1961,7 @@ WRITE8_HANDLER( clowns_audio_1_w )
WRITE8_DEVICE_HANDLER( clowns_audio_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)device->machine->driver_data;
mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last;
discrete_sound_w(device, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01);
@ -2317,7 +2317,7 @@ MACHINE_DRIVER_END
WRITE8_DEVICE_HANDLER( spacwalk_audio_1_w )
{
mw8080bw_state *state = (mw8080bw_state *)device->machine->driver_data;
mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
coin_counter_w(device->machine, 0, (data >> 0) & 0x01);
@ -3165,7 +3165,7 @@ WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w )
WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)device->machine->driver_data;
mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
/* set WIND SOUND FREQ(data & 0x0f) 0, if no wind */
@ -3181,7 +3181,7 @@ WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w )
WRITE8_DEVICE_HANDLER( spcenctr_audio_3_w )
{
mw8080bw_state *state = (mw8080bw_state *)device->machine->driver_data;
mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
/* if (data & 0x01) enable SCREECH (hit the sides) sound */
@ -3234,7 +3234,7 @@ MACHINE_DRIVER_END
WRITE8_HANDLER( phantom2_audio_1_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last;
/* if (data & 0x01) enable PLAYER SHOT sound */
@ -3256,7 +3256,7 @@ WRITE8_HANDLER( phantom2_audio_1_w )
WRITE8_HANDLER( phantom2_audio_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last;
/* D0-D2 are not connected */
@ -4087,7 +4087,7 @@ MACHINE_DRIVER_END
WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
{
mw8080bw_state *state = (mw8080bw_state *)device->machine->driver_data;
mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
sn76477_enable_w(state->sn, (~data >> 0) & 0x01); /* saucer sound */
@ -4104,7 +4104,7 @@ WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
WRITE8_DEVICE_HANDLER( invaders_audio_2_w )
{
mw8080bw_state *state = (mw8080bw_state *)device->machine->driver_data;
mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
discrete_sound_w(device, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
discrete_sound_w(device, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
@ -4720,7 +4720,7 @@ MACHINE_DRIVER_END
WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w )
{
mw8080bw_state *state = (mw8080bw_state *)device->machine->driver_data;
mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
sn76477_enable_w(state->sn1, (~data >> 0) & 0x01); /* saucer sound */
@ -4746,7 +4746,7 @@ WRITE8_DEVICE_HANDLER( invad2ct_audio_2_w )
WRITE8_DEVICE_HANDLER( invad2ct_audio_3_w )
{
mw8080bw_state *state = (mw8080bw_state *)device->machine->driver_data;
mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
sn76477_enable_w(state->sn2, (~data >> 0) & 0x01); /* saucer sound */

View File

@ -71,7 +71,7 @@ static const sn76477_interface spacefev_sn76477_interface =
static void spacefev_update_SN76477_status( running_device *sn )
{
n8080_state *state = (n8080_state *)sn->machine->driver_data;
n8080_state *state = sn->machine->driver_data<n8080_state>();
double dblR0 = RES_M(1.0);
double dblR1 = RES_M(1.5);
@ -101,7 +101,7 @@ static void spacefev_update_SN76477_status( running_device *sn )
static void sheriff_update_SN76477_status( running_device *sn )
{
n8080_state *state = (n8080_state *)sn->machine->driver_data;
n8080_state *state = sn->machine->driver_data<n8080_state>();
if (state->mono_flop[1])
{
sn76477_vco_voltage_w(sn, 5);
@ -123,7 +123,7 @@ static void sheriff_update_SN76477_status( running_device *sn )
static void update_SN76477_status( running_device *device )
{
n8080_state *state = (n8080_state *)device->machine->driver_data;
n8080_state *state = device->machine->driver_data<n8080_state>();
if (state->n8080_hardware == 1)
{
spacefev_update_SN76477_status(device);
@ -137,7 +137,7 @@ static void update_SN76477_status( running_device *device )
static void start_mono_flop( running_device *sn, int n, attotime expire )
{
n8080_state *state = (n8080_state *)sn->machine->driver_data;
n8080_state *state = sn->machine->driver_data<n8080_state>();
state->mono_flop[n] = 1;
update_SN76477_status(sn);
@ -148,7 +148,7 @@ static void start_mono_flop( running_device *sn, int n, attotime expire )
static void stop_mono_flop( running_device *sn, int n )
{
n8080_state *state = (n8080_state *)sn->machine->driver_data;
n8080_state *state = sn->machine->driver_data<n8080_state>();
state->mono_flop[n] = 0;
update_SN76477_status(sn);
@ -166,7 +166,7 @@ static TIMER_CALLBACK( stop_mono_flop_callback )
static void spacefev_sound_pins_changed( running_machine *machine )
{
running_device *sn = machine->device("snsnd");
n8080_state *state = (n8080_state *)machine->driver_data;
n8080_state *state = machine->driver_data<n8080_state>();
UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
if (changes & (1 << 0x3))
@ -199,7 +199,7 @@ static void spacefev_sound_pins_changed( running_machine *machine )
static void sheriff_sound_pins_changed( running_machine *machine )
{
running_device *sn = machine->device("snsnd");
n8080_state *state = (n8080_state *)machine->driver_data;
n8080_state *state = machine->driver_data<n8080_state>();
UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
if (changes & (1 << 0x6))
@ -223,7 +223,7 @@ static void sheriff_sound_pins_changed( running_machine *machine )
static void helifire_sound_pins_changed( running_machine *machine )
{
n8080_state *state = (n8080_state *)machine->driver_data;
n8080_state *state = machine->driver_data<n8080_state>();
UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
/* ((state->curr_sound_pins >> 0xa) & 1) not emulated */
@ -239,7 +239,7 @@ static void helifire_sound_pins_changed( running_machine *machine )
static void sound_pins_changed( running_machine *machine )
{
n8080_state *state = (n8080_state *)machine->driver_data;
n8080_state *state = machine->driver_data<n8080_state>();
if (state->n8080_hardware == 1)
spacefev_sound_pins_changed(machine);
@ -254,7 +254,7 @@ static void sound_pins_changed( running_machine *machine )
static void delayed_sound_1( running_machine *machine, int data )
{
n8080_state *state = (n8080_state *)machine->driver_data;
n8080_state *state = machine->driver_data<n8080_state>();
state->curr_sound_pins &= ~(
(1 << 0x7) |
@ -295,7 +295,7 @@ static TIMER_CALLBACK( delayed_sound_1_callback )
static void delayed_sound_2( running_machine *machine, int data )
{
n8080_state *state = (n8080_state *)machine->driver_data;
n8080_state *state = machine->driver_data<n8080_state>();
state->curr_sound_pins &= ~(
(1 << 0x8) |
@ -340,7 +340,7 @@ WRITE8_HANDLER( n8080_sound_2_w )
static READ8_HANDLER( n8080_8035_p1_r )
{
n8080_state *state = (n8080_state *)space->machine->driver_data;
n8080_state *state = space->machine->driver_data<n8080_state>();
UINT8 val = 0;
if ((state->curr_sound_pins >> 0xb) & 1) val |= 0x01;
@ -358,31 +358,31 @@ static READ8_HANDLER( n8080_8035_p1_r )
static READ8_HANDLER( n8080_8035_t0_r )
{
n8080_state *state = (n8080_state *)space->machine->driver_data;
n8080_state *state = space->machine->driver_data<n8080_state>();
return (state->curr_sound_pins >> 0x7) & 1;
}
static READ8_HANDLER( n8080_8035_t1_r )
{
n8080_state *state = (n8080_state *)space->machine->driver_data;
n8080_state *state = space->machine->driver_data<n8080_state>();
return (state->curr_sound_pins >> 0xc) & 1;
}
static READ8_HANDLER( helifire_8035_t0_r )
{
n8080_state *state = (n8080_state *)space->machine->driver_data;
n8080_state *state = space->machine->driver_data<n8080_state>();
return (state->curr_sound_pins >> 0x3) & 1;
}
static READ8_HANDLER( helifire_8035_t1_r )
{
n8080_state *state = (n8080_state *)space->machine->driver_data;
n8080_state *state = space->machine->driver_data<n8080_state>();
return (state->curr_sound_pins >> 0x4) & 1;
}
static READ8_HANDLER( helifire_8035_external_ram_r )
{
n8080_state *state = (n8080_state *)space->machine->driver_data;
n8080_state *state = space->machine->driver_data<n8080_state>();
UINT8 val = 0;
if ((state->curr_sound_pins >> 0x7) & 1) val |= 0x01;
@ -396,7 +396,7 @@ static READ8_HANDLER( helifire_8035_external_ram_r )
static READ8_HANDLER( helifire_8035_p2_r )
{
n8080_state *state = (n8080_state *)space->machine->driver_data;
n8080_state *state = space->machine->driver_data<n8080_state>();
return ((state->curr_sound_pins >> 0xc) & 1) ? 0x10 : 0x00; /* not used */
}
@ -409,14 +409,14 @@ static WRITE8_HANDLER( n8080_dac_w )
static WRITE8_HANDLER( helifire_dac_w )
{
n8080_state *state = (n8080_state *)space->machine->driver_data;
n8080_state *state = space->machine->driver_data<n8080_state>();
dac_data_w(space->machine->device("dac"), data * state->helifire_dac_volume);
}
static WRITE8_HANDLER( helifire_sound_ctrl_w )
{
n8080_state *state = (n8080_state *)space->machine->driver_data;
n8080_state *state = space->machine->driver_data<n8080_state>();
state->helifire_dac_phase = data & 0x80;
/* data & 0x40 not emulated */
@ -438,7 +438,7 @@ static WRITE8_HANDLER( helifire_sound_ctrl_w )
static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer )
{
running_device *sn = timer.machine->device("snsnd");
n8080_state *state = (n8080_state *)timer.machine->driver_data;
n8080_state *state = timer.machine->driver_data<n8080_state>();
double voltage = 0;
if (state->mono_flop[2])
@ -452,7 +452,7 @@ static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer )
static TIMER_DEVICE_CALLBACK( helifire_dac_volume_timer )
{
n8080_state *state = (n8080_state *)timer.machine->driver_data;
n8080_state *state = timer.machine->driver_data<n8080_state>();
double t = state->helifire_dac_timing - attotime_to_double(timer_get_time(timer.machine));
if (state->helifire_dac_phase)
@ -468,7 +468,7 @@ static TIMER_DEVICE_CALLBACK( helifire_dac_volume_timer )
MACHINE_START( spacefev_sound )
{
n8080_state *state = (n8080_state *)machine->driver_data;
n8080_state *state = machine->driver_data<n8080_state>();
state->sound_timer[0] = timer_alloc(machine, stop_mono_flop_callback, NULL);
state->sound_timer[1] = timer_alloc(machine, stop_mono_flop_callback, NULL);
@ -483,7 +483,7 @@ MACHINE_START( spacefev_sound )
MACHINE_RESET( spacefev_sound )
{
n8080_state *state = (n8080_state *)machine->driver_data;
n8080_state *state = machine->driver_data<n8080_state>();
state->n8080_hardware = 1;
state->mono_flop[0] = 0;
@ -500,7 +500,7 @@ MACHINE_RESET( spacefev_sound )
MACHINE_START( sheriff_sound )
{
n8080_state *state = (n8080_state *)machine->driver_data;
n8080_state *state = machine->driver_data<n8080_state>();
state->sound_timer[0] = timer_alloc(machine, stop_mono_flop_callback, NULL);
state->sound_timer[1] = timer_alloc(machine, stop_mono_flop_callback, NULL);
@ -514,7 +514,7 @@ MACHINE_START( sheriff_sound )
MACHINE_RESET( sheriff_sound )
{
n8080_state *state = (n8080_state *)machine->driver_data;
n8080_state *state = machine->driver_data<n8080_state>();
state->n8080_hardware = 2;
state->mono_flop[0] = 0;
@ -530,7 +530,7 @@ MACHINE_RESET( sheriff_sound )
MACHINE_START( helifire_sound )
{
n8080_state *state = (n8080_state *)machine->driver_data;
n8080_state *state = machine->driver_data<n8080_state>();
state_save_register_global(machine, state->prev_snd_data);
state_save_register_global(machine, state->prev_sound_pins);
@ -543,7 +543,7 @@ MACHINE_START( helifire_sound )
MACHINE_RESET( helifire_sound )
{
n8080_state *state = (n8080_state *)machine->driver_data;
n8080_state *state = machine->driver_data<n8080_state>();
state->n8080_hardware = 3;
state->helifire_dac_volume = 1;

View File

@ -28,7 +28,7 @@
static SOUND_START( timeplt )
{
timeplt_state *state = (timeplt_state *)machine->driver_data;
timeplt_state *state = machine->driver_data<timeplt_state>();
state->soundcpu = machine->device<cpu_device>("tpsound");
state->filter_0_0 = machine->device("filter.0.0");
@ -69,7 +69,7 @@ static SOUND_START( timeplt )
static READ8_DEVICE_HANDLER( timeplt_portB_r )
{
timeplt_state *state = (timeplt_state *)device->machine->driver_data;
timeplt_state *state = device->machine->driver_data<timeplt_state>();
static const int timeplt_timer[10] =
{
@ -102,7 +102,7 @@ static void filter_w( running_device *device, int data )
static WRITE8_HANDLER( timeplt_filter_w )
{
timeplt_state *state = (timeplt_state *)space->machine->driver_data;
timeplt_state *state = space->machine->driver_data<timeplt_state>();
filter_w(state->filter_1_0, (offset >> 0) & 3);
filter_w(state->filter_1_1, (offset >> 2) & 3);
filter_w(state->filter_1_2, (offset >> 4) & 3);
@ -121,7 +121,7 @@ static WRITE8_HANDLER( timeplt_filter_w )
WRITE8_HANDLER( timeplt_sh_irqtrigger_w )
{
timeplt_state *state = (timeplt_state *)space->machine->driver_data;
timeplt_state *state = space->machine->driver_data<timeplt_state>();
if (state->last_irq_state == 0 && data)
{

View File

@ -20,7 +20,7 @@
READ8_HANDLER( trackfld_sh_timer_r )
{
trackfld_state *state = (trackfld_state *)space->machine->driver_data;
trackfld_state *state = space->machine->driver_data<trackfld_state>();
UINT32 clock = state->audiocpu->total_cycles() / TIMER_RATE;
return clock & 0xF;
@ -33,7 +33,7 @@ READ8_DEVICE_HANDLER( trackfld_speech_r )
WRITE8_DEVICE_HANDLER( trackfld_sound_w )
{
trackfld_state *state = (trackfld_state *)device->machine->driver_data;
trackfld_state *state = device->machine->driver_data<trackfld_state>();
int changes = offset ^ state->last_addr;
/* A7 = data enable for VLM5030 (don't care ) */
@ -53,7 +53,7 @@ WRITE8_DEVICE_HANDLER( trackfld_sound_w )
READ8_HANDLER( hyperspt_sh_timer_r )
{
trackfld_state *state = (trackfld_state *)space->machine->driver_data;
trackfld_state *state = space->machine->driver_data<trackfld_state>();
UINT32 clock = state->audiocpu->total_cycles() / TIMER_RATE;
if (state->vlm != NULL)
@ -64,7 +64,7 @@ READ8_HANDLER( hyperspt_sh_timer_r )
WRITE8_DEVICE_HANDLER( hyperspt_sound_w )
{
trackfld_state *state = (trackfld_state *)device->machine->driver_data;
trackfld_state *state = device->machine->driver_data<trackfld_state>();
int changes = offset ^ state->last_addr;
/* A3 = data enable for VLM5030 (don't care ) */
@ -89,7 +89,7 @@ WRITE8_DEVICE_HANDLER( hyperspt_sound_w )
WRITE8_HANDLER( konami_sh_irqtrigger_w )
{
trackfld_state *state = (trackfld_state *)space->machine->driver_data;
trackfld_state *state = space->machine->driver_data<trackfld_state>();
if (state->last_irq == 0 && data)
{
/* setting bit 0 low then high triggers IRQ on the sound CPU */
@ -102,13 +102,13 @@ WRITE8_HANDLER( konami_sh_irqtrigger_w )
WRITE8_HANDLER( konami_SN76496_latch_w )
{
trackfld_state *state = (trackfld_state *)space->machine->driver_data;
trackfld_state *state = space->machine->driver_data<trackfld_state>();
state->SN76496_latch = data;
}
WRITE8_DEVICE_HANDLER( konami_SN76496_w )
{
trackfld_state *state = (trackfld_state *)device->machine->driver_data;
trackfld_state *state = device->machine->driver_data<trackfld_state>();
sn76496_w(device, offset, state->SN76496_latch);
}

View File

@ -75,7 +75,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
#if (!DISCRETE_TEST)
running_device *samples = device->machine->device("samples");
#endif
turbo_state *state = (turbo_state *)device->machine->driver_data;
turbo_state *state = device->machine->driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@ -124,7 +124,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
{
running_device *samples = device->machine->device("samples");
turbo_state *state = (turbo_state *)device->machine->driver_data;
turbo_state *state = device->machine->driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@ -147,7 +147,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
WRITE8_DEVICE_HANDLER( turbo_sound_c_w )
{
running_device *samples = device->machine->device("samples");
turbo_state *state = (turbo_state *)device->machine->driver_data;
turbo_state *state = device->machine->driver_data<turbo_state>();
/* OSEL1-2 */
state->turbo_osel = (state->turbo_osel & 1) | ((data & 3) << 1);
@ -297,7 +297,7 @@ MACHINE_DRIVER_END
WRITE8_DEVICE_HANDLER( subroc3d_sound_a_w )
{
turbo_state *state = (turbo_state *)device->machine->driver_data;
turbo_state *state = device->machine->driver_data<turbo_state>();
state->sound_state[0] = data;
/* DIS0-3 contained in bits 0-3 */
@ -328,7 +328,7 @@ INLINE void subroc3d_update_volume(running_device *samples, int leftchan, UINT8
WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
{
running_device *samples = device->machine->device("samples");
turbo_state *state = (turbo_state *)device->machine->driver_data;
turbo_state *state = device->machine->driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@ -384,7 +384,7 @@ WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
{
running_device *samples = device->machine->device("samples");
turbo_state *state = (turbo_state *)device->machine->driver_data;
turbo_state *state = device->machine->driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;
@ -509,7 +509,7 @@ static void buckrog_update_samples(turbo_state *state, running_device *samples)
WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
{
running_device *samples = device->machine->device("samples");
turbo_state *state = (turbo_state *)device->machine->driver_data;
turbo_state *state = device->machine->driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@ -535,7 +535,7 @@ WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
{
running_device *samples = device->machine->device("samples");
turbo_state *state = (turbo_state *)device->machine->driver_data;
turbo_state *state = device->machine->driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;

View File

@ -113,7 +113,7 @@ MACHINE_DRIVER_END
WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
{
zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
running_device *samples = device->machine->device("samples");
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@ -149,7 +149,7 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
{
zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
running_device *samples = device->machine->device("samples");
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@ -167,7 +167,7 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w )
{
zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
running_device *samples = device->machine->device("samples");
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;
@ -225,7 +225,7 @@ MACHINE_DRIVER_END
WRITE8_DEVICE_HANDLER( congo_sound_b_w )
{
zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
running_device *samples = device->machine->device("samples");
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@ -239,7 +239,7 @@ WRITE8_DEVICE_HANDLER( congo_sound_b_w )
WRITE8_DEVICE_HANDLER( congo_sound_c_w )
{
zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
running_device *samples = device->machine->device("samples");
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;

View File

@ -236,7 +236,7 @@ GFXDECODE_END
static MACHINE_START( 1942 )
{
_1942_state *state = (_1942_state *)machine->driver_data;
_1942_state *state = machine->driver_data<_1942_state>();
state->audiocpu = machine->device("audiocpu");
@ -246,7 +246,7 @@ static MACHINE_START( 1942 )
static MACHINE_RESET( 1942 )
{
_1942_state *state = (_1942_state *)machine->driver_data;
_1942_state *state = machine->driver_data<_1942_state>();
state->palette_bank = 0;
state->scroll[0] = 0;

View File

@ -249,7 +249,7 @@ GFXDECODE_END
static MACHINE_RESET( 1943 )
{
_1943_state *state = (_1943_state *)machine->driver_data;
_1943_state *state = machine->driver_data<_1943_state>();
state->char_on = 0;
state->obj_on = 0;

View File

@ -47,13 +47,14 @@ Notes:
#define MASTER_CLOCK XTAL_16MHz
class k3_state
class k3_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, k3_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, k3_state(machine)); }
k3_state(running_machine &machine)
: oki1(machine.device<okim6295_device>("oki1")),
: driver_data_t(machine),
oki1(machine.device<okim6295_device>("oki1")),
oki2(machine.device<okim6295_device>("oki2")) { }
/* memory pointers */
@ -73,27 +74,27 @@ public:
static WRITE16_HANDLER( k3_bgram_w )
{
k3_state *state = (k3_state *)space->machine->driver_data;
k3_state *state = space->machine->driver_data<k3_state>();
COMBINE_DATA(&state->bgram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_k3_bg_tile_info )
{
k3_state *state = (k3_state *)machine->driver_data;
k3_state *state = machine->driver_data<k3_state>();
int tileno = state->bgram[tile_index];
SET_TILE_INFO(1, tileno, 0, 0);
}
static VIDEO_START(k3)
{
k3_state *state = (k3_state *)machine->driver_data;
k3_state *state = machine->driver_data<k3_state>();
state->bg_tilemap = tilemap_create(machine, get_k3_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 64);
}
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
k3_state *state = (k3_state *)machine->driver_data;
k3_state *state = machine->driver_data<k3_state>();
const gfx_element *gfx = machine->gfx[0];
UINT16 *source = state->spriteram_1;
UINT16 *source2 = state->spriteram_2;
@ -119,7 +120,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static VIDEO_UPDATE(k3)
{
k3_state *state = (k3_state *)screen->machine->driver_data;
k3_state *state = screen->machine->driver_data<k3_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
draw_sprites(screen->machine, bitmap, cliprect);
return 0;
@ -128,19 +129,19 @@ static VIDEO_UPDATE(k3)
static WRITE16_HANDLER( k3_scrollx_w )
{
k3_state *state = (k3_state *)space->machine->driver_data;
k3_state *state = space->machine->driver_data<k3_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, data);
}
static WRITE16_HANDLER( k3_scrolly_w )
{
k3_state *state = (k3_state *)space->machine->driver_data;
k3_state *state = space->machine->driver_data<k3_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
static WRITE16_HANDLER( k3_soundbanks_w )
{
k3_state *state = (k3_state *)space->machine->driver_data;
k3_state *state = space->machine->driver_data<k3_state>();
state->oki1->set_bank_base((data & 4) ? 0x40000 : 0);
state->oki2->set_bank_base((data & 2) ? 0x40000 : 0);
}

View File

@ -70,7 +70,7 @@
static WRITE8_HANDLER( irqack_w )
{
_20pacgal_state *state = (_20pacgal_state *)space->machine->driver_data;
_20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
int bit = data & 1;
cpu_interrupt_enable(state->maincpu, bit);
@ -81,7 +81,7 @@ static WRITE8_HANDLER( irqack_w )
static WRITE8_HANDLER( timer_pulse_w )
{
//_20pacgal_state *state = (_20pacgal_state *)space->machine->driver_data;
//_20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
//printf("timer pulse %02x\n", data);
}
@ -138,7 +138,7 @@ static WRITE8_HANDLER( _20pacgal_coin_counter_w )
static void set_bankptr(running_machine *machine)
{
_20pacgal_state *state = (_20pacgal_state *) machine->driver_data;
_20pacgal_state *state = machine->driver_data<_20pacgal_state>();
if (state->game_selected == 0)
{
UINT8 *rom = memory_region(machine, "maincpu");
@ -150,7 +150,7 @@ static void set_bankptr(running_machine *machine)
static WRITE8_HANDLER( ram_bank_select_w )
{
_20pacgal_state *state = (_20pacgal_state *)space->machine->driver_data;
_20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
state->game_selected = data & 1;
set_bankptr(space->machine);
@ -158,7 +158,7 @@ static WRITE8_HANDLER( ram_bank_select_w )
static WRITE8_HANDLER( ram_48000_w )
{
_20pacgal_state *state = (_20pacgal_state *)space->machine->driver_data;
_20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
if (state->game_selected)
{
@ -283,7 +283,7 @@ INPUT_PORTS_END
static MACHINE_START( 20pacgal )
{
_20pacgal_state *state = (_20pacgal_state *)machine->driver_data;
_20pacgal_state *state = machine->driver_data<_20pacgal_state>();
state->maincpu = machine->device("maincpu");
state->eeprom = machine->device("eeprom");
@ -295,7 +295,7 @@ static MACHINE_START( 20pacgal )
static MACHINE_RESET( 20pacgal )
{
_20pacgal_state *state = (_20pacgal_state *)machine->driver_data;
_20pacgal_state *state = machine->driver_data<_20pacgal_state>();
state->game_selected = 0;
}
@ -372,7 +372,7 @@ ROM_END
static DRIVER_INIT(20pacgal)
{
_20pacgal_state *state = (_20pacgal_state *)machine->driver_data;
_20pacgal_state *state = machine->driver_data<_20pacgal_state>();
state->ram_48000 = auto_alloc_array(machine, UINT8, 0x2000);
}

View File

@ -49,12 +49,13 @@ DAC -26.6860Mhz
#include "sound/2610intf.h"
class _2mindril_state
class _2mindril_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _2mindril_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _2mindril_state(machine)); }
_2mindril_state(running_machine &machine) { }
_2mindril_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */
UINT16 * map1ram;
@ -94,7 +95,7 @@ public:
static VIDEO_UPDATE( drill )
{
_2mindril_state *state = (_2mindril_state *)screen->machine->driver_data;
_2mindril_state *state = screen->machine->driver_data<_2mindril_state>();
bitmap_fill(bitmap, NULL, 0);
DRAW_MAP(state->map1ram, 0)
@ -123,7 +124,7 @@ static VIDEO_UPDATE( drill )
static VIDEO_START( drill )
{
_2mindril_state *state = (_2mindril_state *)machine->driver_data;
_2mindril_state *state = machine->driver_data<_2mindril_state>();
machine->gfx[0]->color_granularity = 16;
gfx_element_set_source(machine->gfx[1], (UINT8 *)state->charram);
@ -131,7 +132,7 @@ static VIDEO_START( drill )
static READ16_HANDLER( drill_io_r )
{
_2mindril_state *state = (_2mindril_state *)space->machine->driver_data;
_2mindril_state *state = space->machine->driver_data<_2mindril_state>();
// if (offset * 2 == 0x4)
/*popmessage("PC=%08x %04x %04x %04x %04x %04x %04x %04x %04x", cpu_get_pc(space->cpu), state->iodata[0/2], state->iodata[2/2], state->iodata[4/2], state->iodata[6/2],
@ -161,7 +162,7 @@ static READ16_HANDLER( drill_io_r )
static WRITE16_HANDLER( drill_io_w )
{
_2mindril_state *state = (_2mindril_state *)space->machine->driver_data;
_2mindril_state *state = space->machine->driver_data<_2mindril_state>();
COMBINE_DATA(&state->iodata[offset]);
switch(offset)
@ -195,20 +196,20 @@ static WRITE16_HANDLER( drill_io_w )
#ifdef UNUSED_FUNCTION
static TIMER_CALLBACK( shutter_req )
{
_2mindril_state *state = (_2mindril_state *)machine->driver_data;
_2mindril_state *state = machine->driver_data<_2mindril_state>();
state->shutter_sensor = param;
}
static TIMER_CALLBACK( defender_req )
{
_2mindril_state *state = (_2mindril_state *)machine->driver_data;
_2mindril_state *state = machine->driver_data<_2mindril_state>();
state->defender_sensor = param;
}
#endif
static WRITE16_HANDLER( sensors_w )
{
_2mindril_state *state = (_2mindril_state *)space->machine->driver_data;
_2mindril_state *state = space->machine->driver_data<_2mindril_state>();
/*---- xxxx ---- ---- select "lamps" (guess)*/
/*---- ---- ---- -x-- lamp*/
@ -237,7 +238,7 @@ static WRITE16_HANDLER( sensors_w )
static WRITE16_HANDLER( charram_w )
{
_2mindril_state *state = (_2mindril_state *)space->machine->driver_data;
_2mindril_state *state = space->machine->driver_data<_2mindril_state>();
COMBINE_DATA(&state->charram[offset]);
gfx_element_mark_dirty(space->machine->gfx[1], offset / 16);
@ -415,7 +416,7 @@ static INTERRUPT_GEN( drill_interrupt )
/* WRONG,it does something with 60000c & 700002,likely to be called when the player throws the ball.*/
static void irqhandler(running_device *device, int irq)
{
// _2mindril_state *state = (_2mindril_state *)machine->driver_data;
// _2mindril_state *state = machine->driver_data<_2mindril_state>();
// cpu_set_input_line(state->maincpu, 5, irq ? ASSERT_LINE : CLEAR_LINE);
}
@ -427,7 +428,7 @@ static const ym2610_interface ym2610_config =
static MACHINE_START( drill )
{
_2mindril_state *state = (_2mindril_state *)machine->driver_data;
_2mindril_state *state = machine->driver_data<_2mindril_state>();
state->maincpu = machine->device("maincpu");
@ -437,7 +438,7 @@ static MACHINE_START( drill )
static MACHINE_RESET( drill )
{
_2mindril_state *state = (_2mindril_state *)machine->driver_data;
_2mindril_state *state = machine->driver_data<_2mindril_state>();
state->defender_sensor = 0;
state->shutter_sensor = 0;

View File

@ -27,12 +27,13 @@
#include "machine/pxa255.h"
#include "sound/dmadac.h"
class _39in1_state
class _39in1_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _39in1_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _39in1_state(machine)); }
_39in1_state(running_machine &machine) { }
_39in1_state(running_machine &machine)
: driver_data_t(machine) { }
UINT32 seed;
UINT32 magic;
@ -111,7 +112,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine* machine, int n_level,
static READ32_HANDLER( pxa255_i2s_r )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_I2S_Regs *i2s_regs = &state->i2s_regs;
switch(PXA255_I2S_BASE_ADDR | (offset << 2))
@ -146,7 +147,7 @@ static READ32_HANDLER( pxa255_i2s_r )
static WRITE32_HANDLER( pxa255_i2s_w )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_I2S_Regs *i2s_regs = &state->i2s_regs;
#if 0
@ -225,7 +226,7 @@ static WRITE32_HANDLER( pxa255_i2s_w )
static void pxa255_dma_irq_check(running_machine* machine)
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
int channel = 0;
int set_intr = 0;
@ -248,7 +249,7 @@ static void pxa255_dma_irq_check(running_machine* machine)
static void pxa255_dma_load_descriptor_and_start(running_machine* machine, int channel)
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
attotime period;
@ -290,7 +291,7 @@ static void pxa255_dma_load_descriptor_and_start(running_machine* machine, int c
static TIMER_CALLBACK( pxa255_dma_dma_end )
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
UINT32 sadr = dma_regs->dsadr[param];
UINT32 tadr = dma_regs->dtadr[param];
@ -400,7 +401,7 @@ static TIMER_CALLBACK( pxa255_dma_dma_end )
static READ32_HANDLER( pxa255_dma_r )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
switch(PXA255_DMA_BASE_ADDR | (offset << 2))
@ -459,7 +460,7 @@ static READ32_HANDLER( pxa255_dma_r )
static WRITE32_HANDLER( pxa255_dma_w )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
switch(PXA255_DMA_BASE_ADDR | (offset << 2))
@ -551,7 +552,7 @@ static WRITE32_HANDLER( pxa255_dma_w )
static void pxa255_ostimer_irq_check(running_machine* machine)
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
PXA255_OSTMR_Regs *ostimer_regs = &state->ostimer_regs;
pxa255_set_irq_line(machine, PXA255_INT_OSTIMER0, (ostimer_regs->oier & PXA255_OIER_E0) ? ((ostimer_regs->ossr & PXA255_OSSR_M0) ? 1 : 0) : 0);
@ -562,7 +563,7 @@ static void pxa255_ostimer_irq_check(running_machine* machine)
static TIMER_CALLBACK( pxa255_ostimer_match )
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
PXA255_OSTMR_Regs *ostimer_regs = &state->ostimer_regs;
if (0) verboselog(machine, 3, "pxa255_ostimer_match channel %d\n", param);
@ -573,7 +574,7 @@ static TIMER_CALLBACK( pxa255_ostimer_match )
static READ32_HANDLER( pxa255_ostimer_r )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_OSTMR_Regs *ostimer_regs = &state->ostimer_regs;
switch(PXA255_OSTMR_BASE_ADDR | (offset << 2))
@ -613,7 +614,7 @@ static READ32_HANDLER( pxa255_ostimer_r )
static WRITE32_HANDLER( pxa255_ostimer_w )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_OSTMR_Regs *ostimer_regs = &state->ostimer_regs;
switch(PXA255_OSTMR_BASE_ADDR | (offset << 2))
@ -705,7 +706,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
static void pxa255_update_interrupts(running_machine* machine)
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
PXA255_INTC_Regs *intc_regs = &state->intc_regs;
intc_regs->icfp = (intc_regs->icpr & intc_regs->icmr) & intc_regs->iclr;
@ -716,7 +717,7 @@ static void pxa255_update_interrupts(running_machine* machine)
static void pxa255_set_irq_line(running_machine* machine, UINT32 line, int irq_state)
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
PXA255_INTC_Regs *intc_regs = &state->intc_regs;
intc_regs->icpr &= ~line;
@ -727,7 +728,7 @@ static void pxa255_set_irq_line(running_machine* machine, UINT32 line, int irq_s
static READ32_HANDLER( pxa255_intc_r )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_INTC_Regs *intc_regs = &state->intc_regs;
switch(PXA255_INTC_BASE_ADDR | (offset << 2))
@ -759,7 +760,7 @@ static READ32_HANDLER( pxa255_intc_r )
static WRITE32_HANDLER( pxa255_intc_w )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_INTC_Regs *intc_regs = &state->intc_regs;
switch(PXA255_INTC_BASE_ADDR | (offset << 2))
@ -801,7 +802,7 @@ static WRITE32_HANDLER( pxa255_intc_w )
static READ32_HANDLER( pxa255_gpio_r )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_GPIO_Regs *gpio_regs = &state->gpio_regs;
switch(PXA255_GPIO_BASE_ADDR | (offset << 2))
@ -899,7 +900,7 @@ static READ32_HANDLER( pxa255_gpio_r )
static WRITE32_HANDLER( pxa255_gpio_w )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_GPIO_Regs *gpio_regs = &state->gpio_regs;
switch(PXA255_GPIO_BASE_ADDR | (offset << 2))
@ -1049,7 +1050,7 @@ static WRITE32_HANDLER( pxa255_gpio_w )
static void pxa255_lcd_load_dma_descriptor(const address_space* space, UINT32 address, int channel)
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
lcd_regs->dma[channel].fdadr = memory_read_dword_32le(space, address);
@ -1065,7 +1066,7 @@ static void pxa255_lcd_load_dma_descriptor(const address_space* space, UINT32 ad
static void pxa255_lcd_irq_check(running_machine* machine)
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
if(((lcd_regs->lcsr & PXA255_LCSR_BS) != 0 && (lcd_regs->lccr0 & PXA255_LCCR0_BM) == 0) ||
@ -1082,7 +1083,7 @@ static void pxa255_lcd_irq_check(running_machine* machine)
static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel)
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
if(lcd_regs->dma[channel].fdadr != 0)
@ -1123,7 +1124,7 @@ static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel)
static void pxa255_lcd_check_load_next_branch(running_machine* machine, int channel)
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
if(lcd_regs->fbr[channel] & 1)
@ -1152,7 +1153,7 @@ static void pxa255_lcd_check_load_next_branch(running_machine* machine, int chan
static TIMER_CALLBACK( pxa255_lcd_dma_eof )
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
if (0) verboselog( machine, 3, "End of frame callback\n" );
@ -1167,7 +1168,7 @@ static TIMER_CALLBACK( pxa255_lcd_dma_eof )
static READ32_HANDLER( pxa255_lcd_r )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
switch(PXA255_LCD_BASE_ADDR | (offset << 2))
@ -1235,7 +1236,7 @@ static READ32_HANDLER( pxa255_lcd_r )
static WRITE32_HANDLER( pxa255_lcd_w )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
switch(PXA255_LCD_BASE_ADDR | (offset << 2))
@ -1358,7 +1359,7 @@ static READ32_HANDLER( unknown_r )
static READ32_HANDLER( cpld_r )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
//if (cpu_get_pc(space->cpu) != 0xe3af4) printf("CPLD read @ %x (PC %x state %d)\n", offset, cpu_get_pc(space->cpu), state);
@ -1415,7 +1416,7 @@ static READ32_HANDLER( cpld_r )
static WRITE32_HANDLER( cpld_w )
{
_39in1_state *state = (_39in1_state *)space->machine->driver_data;
_39in1_state *state = space->machine->driver_data<_39in1_state>();
if (mem_mask == 0xffff)
{
@ -1449,7 +1450,7 @@ static READ32_HANDLER( prot_cheater_r )
static DRIVER_INIT( 39in1 )
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
state->dmadac[0] = machine->device<dmadac_sound_device>("dac1");
state->dmadac[1] = machine->device<dmadac_sound_device>("dac2");
@ -1509,7 +1510,7 @@ INPUT_PORTS_END
static VIDEO_UPDATE( 39in1 )
{
_39in1_state *state = (_39in1_state *)screen->machine->driver_data;
_39in1_state *state = screen->machine->driver_data<_39in1_state>();
int x = 0;
int y = 0;
@ -1527,7 +1528,7 @@ static VIDEO_UPDATE( 39in1 )
/* To be moved to DEVICE_START( pxa255 ) upon completion */
static void pxa255_start(running_machine* machine)
{
_39in1_state *state = (_39in1_state *)machine->driver_data;
_39in1_state *state = machine->driver_data<_39in1_state>();
int index = 0;
//pxa255_t* pxa255 = pxa255_get_safe_token( device );

View File

@ -227,7 +227,7 @@ Notes - Has jumper setting for 122HZ or 61HZ)
static TIMER_CALLBACK( nmi_callback )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
if (state->sound_nmi_enable)
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
else
@ -242,13 +242,13 @@ static WRITE8_HANDLER( sound_command_w )
static WRITE8_HANDLER( nmi_disable_w )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
@ -296,7 +296,7 @@ static WRITE8_HANDLER( bank_select_w )
static WRITE8_HANDLER( pix1_w )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
// if (data > 7)
// logerror("pix1 = %2x\n", data);
@ -304,7 +304,7 @@ static WRITE8_HANDLER( pix1_w )
}
static WRITE8_HANDLER( pix2_w )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
// if ((data!=0x00) && (data != 0xff))
// logerror("pix2 = %2x\n", data);
@ -315,14 +315,14 @@ static WRITE8_HANDLER( pix2_w )
#if 0
static READ8_HANDLER( pix1_r )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
return state->pix1;
}
#endif
static READ8_HANDLER( pix2_r )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
int res;
int d1 = state->pix1 & 7;
@ -400,7 +400,7 @@ static const UINT8 mcu_data2[0x80] =
static WRITE8_HANDLER( undoukai_mcu_w )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
int ram_adr = state->mcu_ram[0x1b5] * 0x100 + state->mcu_ram[0x1b4];
int d, i;
@ -560,7 +560,7 @@ static WRITE8_HANDLER( undoukai_mcu_w )
static READ8_HANDLER( undoukai_mcu_r )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
// logerror("mcu_r %02x\n", state->from_mcu);
@ -578,7 +578,7 @@ static READ8_HANDLER( undoukai_mcu_status_r )
static DRIVER_INIT( undoukai )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x2000);
@ -590,7 +590,7 @@ static DRIVER_INIT( undoukai )
static DRIVER_INIT( 40love )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x2000);
@ -616,20 +616,20 @@ static DRIVER_INIT( 40love )
static READ8_HANDLER( from_snd_r )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
state->snd_flag = 0;
return state->snd_data;
}
static READ8_HANDLER( snd_flag_r )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
return state->snd_flag | 0xfd;
}
static WRITE8_HANDLER( to_main_w )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
state->snd_data = data;
state->snd_flag = 2;
}
@ -688,7 +688,7 @@ ADDRESS_MAP_END
static MACHINE_RESET( ta7630 )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
int i;
double db = 0.0;
@ -713,7 +713,7 @@ static MACHINE_RESET( ta7630 )
static WRITE8_DEVICE_HANDLER( sound_control_0_w )
{
buggychl_state *state = (buggychl_state *)device->machine->driver_data;
buggychl_state *state = device->machine->driver_data<buggychl_state>();
state->snd_ctrl0 = data & 0xff;
// popmessage("SND0 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
@ -726,7 +726,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_0_w )
}
static WRITE8_DEVICE_HANDLER( sound_control_1_w )
{
buggychl_state *state = (buggychl_state *)device->machine->driver_data;
buggychl_state *state = device->machine->driver_data<buggychl_state>();
state->snd_ctrl1 = data & 0xff;
// popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
sound_set_output_gain(device, 4, state->vol_ctrl[(state->snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */
@ -737,7 +737,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_1_w )
static WRITE8_DEVICE_HANDLER( sound_control_2_w )
{
buggychl_state *state = (buggychl_state *)device->machine->driver_data;
buggychl_state *state = device->machine->driver_data<buggychl_state>();
int i;
state->snd_ctrl2 = data & 0xff;
// popmessage("SND2 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
@ -748,7 +748,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_2_w )
static WRITE8_DEVICE_HANDLER( sound_control_3_w ) /* unknown */
{
buggychl_state *state = (buggychl_state *)device->machine->driver_data;
buggychl_state *state = device->machine->driver_data<buggychl_state>();
state->snd_ctrl3 = data & 0xff;
// popmessage("SND3 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
}
@ -997,7 +997,7 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( common )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
state->audiocpu = machine->device("audiocpu");
state->mcu = machine->device("mcu");
@ -1019,7 +1019,7 @@ static MACHINE_START( common )
static MACHINE_START( 40love )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
MACHINE_START_CALL(common);
@ -1041,7 +1041,7 @@ static MACHINE_START( 40love )
static MACHINE_START( undoukai )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
MACHINE_START_CALL(common);
@ -1056,7 +1056,7 @@ static MACHINE_START( undoukai )
static MACHINE_RESET( common )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
MACHINE_RESET_CALL(ta7630);
@ -1077,7 +1077,7 @@ static MACHINE_RESET( common )
static MACHINE_RESET( 40love )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE);
@ -1101,7 +1101,7 @@ static MACHINE_RESET( 40love )
static MACHINE_RESET( undoukai )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
int i;
MACHINE_RESET_CALL(common);

View File

@ -56,13 +56,13 @@ Sound :
static WRITE8_HANDLER( sound_data_w )
{
_4enraya_state *state = (_4enraya_state *)space->machine->driver_data;
_4enraya_state *state = space->machine->driver_data<_4enraya_state>();
state->soundlatch = data;
}
static WRITE8_DEVICE_HANDLER( sound_control_w )
{
_4enraya_state *state = (_4enraya_state *)device->machine->driver_data;
_4enraya_state *state = device->machine->driver_data<_4enraya_state>();
if ((state->last_snd_ctrl & 0x04) == 0x04 && (data & 0x4) == 0x00)
ay8910_data_address_w(device, state->last_snd_ctrl, state->soundlatch);
@ -149,7 +149,7 @@ GFXDECODE_END
static MACHINE_START( 4enraya )
{
_4enraya_state *state = (_4enraya_state *)machine->driver_data;
_4enraya_state *state = machine->driver_data<_4enraya_state>();
state_save_register_global(machine, state->soundlatch);
state_save_register_global(machine, state->last_snd_ctrl);
@ -157,7 +157,7 @@ static MACHINE_START( 4enraya )
static MACHINE_RESET( 4enraya )
{
_4enraya_state *state = (_4enraya_state *)machine->driver_data;
_4enraya_state *state = machine->driver_data<_4enraya_state>();
state->soundlatch = 0;
state->last_snd_ctrl = 0;

View File

@ -1158,7 +1158,7 @@ MACHINE_DRIVER_END
static CUSTOM_INPUT( sflush_80_r )
{
mw8080bw_state *state = (mw8080bw_state *)field->port->machine->driver_data;
mw8080bw_state *state = field->port->machine->driver_data<mw8080bw_state>();
state->sfl_int ^= 1; /* vblank flag ? */
return state->sfl_int;
@ -1166,7 +1166,7 @@ static CUSTOM_INPUT( sflush_80_r )
static MACHINE_START( sflush )
{
mw8080bw_state *state = (mw8080bw_state *)machine->driver_data;
mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
state_save_register_global(machine, state->sfl_int);
MACHINE_START_CALL(mw8080bw);
@ -1374,7 +1374,7 @@ MACHINE_DRIVER_END
static INTERRUPT_GEN( polaris_interrupt )
{
mw8080bw_state *state = (mw8080bw_state *)device->machine->driver_data;
mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
state->polaris_cloud_speed++;
if (state->polaris_cloud_speed >= 4) /* every 4 frames - this was verified against real machine */
@ -1386,7 +1386,7 @@ static INTERRUPT_GEN( polaris_interrupt )
static MACHINE_START( polaris )
{
mw8080bw_state *state = (mw8080bw_state *)machine->driver_data;
mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
state_save_register_global(machine, state->polaris_cloud_speed);
state_save_register_global(machine, state->polaris_cloud_pos);

View File

@ -24,7 +24,7 @@ static UINT8 *paletteram_1000;
static INTERRUPT_GEN( k88games_interrupt )
{
_88games_state *state = (_88games_state *)device->machine->driver_data;
_88games_state *state = device->machine->driver_data<_88games_state>();
if (k052109_is_irq_enabled(state->k052109))
irq0_line_hold(device);
@ -32,7 +32,7 @@ static INTERRUPT_GEN( k88games_interrupt )
static READ8_HANDLER( bankedram_r )
{
_88games_state *state = (_88games_state *)space->machine->driver_data;
_88games_state *state = space->machine->driver_data<_88games_state>();
if (state->videobank)
return state->ram[offset];
@ -47,7 +47,7 @@ static READ8_HANDLER( bankedram_r )
static WRITE8_HANDLER( bankedram_w )
{
_88games_state *state = (_88games_state *)space->machine->driver_data;
_88games_state *state = space->machine->driver_data<_88games_state>();
if (state->videobank)
state->ram[offset] = data;
@ -57,7 +57,7 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( k88games_5f84_w )
{
_88games_state *state = (_88games_state *)space->machine->driver_data;
_88games_state *state = space->machine->driver_data<_88games_state>();
/* bits 0/1 coin counters */
coin_counter_w(space->machine, 0, data & 0x01);
@ -73,14 +73,14 @@ static WRITE8_HANDLER( k88games_5f84_w )
static WRITE8_HANDLER( k88games_sh_irqtrigger_w )
{
_88games_state *state = (_88games_state *)space->machine->driver_data;
_88games_state *state = space->machine->driver_data<_88games_state>();
cpu_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( speech_control_w )
{
_88games_state *state = (_88games_state *)space->machine->driver_data;
_88games_state *state = space->machine->driver_data<_88games_state>();
running_device *upd;
state->speech_chip = (data & 4) ? 1 : 0;
@ -92,7 +92,7 @@ static WRITE8_HANDLER( speech_control_w )
static WRITE8_HANDLER( speech_msg_w )
{
_88games_state *state = (_88games_state *)space->machine->driver_data;
_88games_state *state = space->machine->driver_data<_88games_state>();
running_device *upd = state->speech_chip ? state->upd_2 : state->upd_1;
upd7759_port_w(upd, 0, data);
@ -101,7 +101,7 @@ static WRITE8_HANDLER( speech_msg_w )
/* special handlers to combine 052109 & 051960 */
static READ8_HANDLER( k052109_051960_r )
{
_88games_state *state = (_88games_state *)space->machine->driver_data;
_88games_state *state = space->machine->driver_data<_88games_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@ -118,7 +118,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
_88games_state *state = (_88games_state *)space->machine->driver_data;
_88games_state *state = space->machine->driver_data<_88games_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@ -273,7 +273,7 @@ INPUT_PORTS_END
static KONAMI_SETLINES_CALLBACK( k88games_banking )
{
_88games_state *state = (_88games_state *)device->machine->driver_data;
_88games_state *state = device->machine->driver_data<_88games_state>();
UINT8 *RAM = memory_region(device->machine, "maincpu");
int offs;
@ -315,7 +315,7 @@ static KONAMI_SETLINES_CALLBACK( k88games_banking )
static MACHINE_START( 88games )
{
_88games_state *state = (_88games_state *)machine->driver_data;
_88games_state *state = machine->driver_data<_88games_state>();
state->audiocpu = machine->device("audiocpu");
state->k052109 = machine->device("k052109");
@ -335,7 +335,7 @@ static MACHINE_START( 88games )
static MACHINE_RESET( 88games )
{
_88games_state *state = (_88games_state *)machine->driver_data;
_88games_state *state = machine->driver_data<_88games_state>();
konami_configure_set_lines(machine->device("maincpu"), k88games_banking);
machine->generic.paletteram.u8 = &memory_region(machine, "maincpu")[0x20000];

View File

@ -43,12 +43,13 @@ A1 2101 2101
#define MASTER_CLOCK XTAL_18MHz
class ace_state
class ace_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ace_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ace_state(machine)); }
ace_state(running_machine &machine) { }
ace_state(running_machine &machine)
: driver_data_t(machine) { }
/* video-related */
UINT8 * ram2;
@ -62,21 +63,21 @@ public:
static WRITE8_HANDLER( ace_objpos_w )
{
ace_state *state = (ace_state *)space->machine->driver_data;
ace_state *state = space->machine->driver_data<ace_state>();
state->objpos[offset] = data;
}
#if 0
static READ8_HANDLER( ace_objpos_r )
{
ace_state *state = (ace_state *)space->machine->driver_data;
ace_state *state = space->machine->driver_data<ace_state>();
return state->objpos[offset];
}
#endif
static VIDEO_START( ace )
{
ace_state *state = (ace_state *)machine->driver_data;
ace_state *state = machine->driver_data<ace_state>();
gfx_element_set_source(machine->gfx[1], state->characterram);
gfx_element_set_source(machine->gfx[2], state->characterram);
gfx_element_set_source(machine->gfx[3], state->characterram);
@ -85,7 +86,7 @@ static VIDEO_START( ace )
static VIDEO_UPDATE( ace )
{
ace_state *state = (ace_state *)screen->machine->driver_data;
ace_state *state = screen->machine->driver_data<ace_state>();
int offs;
/* first of all, fill the screen with the background color */
@ -131,7 +132,7 @@ static PALETTE_INIT( ace )
static WRITE8_HANDLER( ace_characterram_w )
{
ace_state *state = (ace_state *)space->machine->driver_data;
ace_state *state = space->machine->driver_data<ace_state>();
if (state->characterram[offset] != data)
{
if (data & ~0x07)
@ -148,7 +149,7 @@ static WRITE8_HANDLER( ace_characterram_w )
static WRITE8_HANDLER( ace_scoreram_w )
{
ace_state *state = (ace_state *)space->machine->driver_data;
ace_state *state = space->machine->driver_data<ace_state>();
state->scoreram[offset] = data;
gfx_element_mark_dirty(space->machine->gfx[4], offset / 32);
}
@ -320,13 +321,13 @@ GFXDECODE_END
static MACHINE_START( ace )
{
ace_state *state = (ace_state *)machine->driver_data;
ace_state *state = machine->driver_data<ace_state>();
state_save_register_global_array(machine, state->objpos);
}
static MACHINE_RESET( ace )
{
ace_state *state = (ace_state *)machine->driver_data;
ace_state *state = machine->driver_data<ace_state>();
int i;
for (i = 0; i < 8; i++)

View File

@ -35,13 +35,13 @@
static WRITE8_HANDLER( triothep_control_select_w )
{
actfancr_state *state = (actfancr_state *)space->machine->driver_data;
actfancr_state *state = space->machine->driver_data<actfancr_state>();
state->trio_control_select = data;
}
static READ8_HANDLER( triothep_control_r )
{
actfancr_state *state = (actfancr_state *)space->machine->driver_data;
actfancr_state *state = space->machine->driver_data<actfancr_state>();
switch (state->trio_control_select)
{
case 0: return input_port_read(space->machine, "P1");
@ -56,7 +56,7 @@ static READ8_HANDLER( triothep_control_r )
static WRITE8_HANDLER( actfancr_sound_w )
{
actfancr_state *state = (actfancr_state *)space->machine->driver_data;
actfancr_state *state = space->machine->driver_data<actfancr_state>();
soundlatch_w(space, 0, data & 0xff);
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@ -265,7 +265,7 @@ GFXDECODE_END
static void sound_irq(running_device *device, int linestate)
{
actfancr_state *state = (actfancr_state *)device->machine->driver_data;
actfancr_state *state = device->machine->driver_data<actfancr_state>();
cpu_set_input_line(state->audiocpu, 0, linestate); /* IRQ */
}
@ -278,7 +278,7 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( actfancr )
{
actfancr_state *state = (actfancr_state *)machine->driver_data;
actfancr_state *state = machine->driver_data<actfancr_state>();
state->maincpu = machine->device("maincpu");
state->audiocpu = machine->device("audiocpu");
@ -286,7 +286,7 @@ static MACHINE_START( actfancr )
static MACHINE_START( triothep )
{
actfancr_state *state = (actfancr_state *)machine->driver_data;
actfancr_state *state = machine->driver_data<actfancr_state>();
MACHINE_START_CALL(actfancr);
@ -295,7 +295,7 @@ static MACHINE_START( triothep )
static MACHINE_RESET( actfancr )
{
actfancr_state *state = (actfancr_state *)machine->driver_data;
actfancr_state *state = machine->driver_data<actfancr_state>();
int i;
state->flipscreen = 0;
@ -308,7 +308,7 @@ static MACHINE_RESET( actfancr )
static MACHINE_RESET( triothep )
{
actfancr_state *state = (actfancr_state *)machine->driver_data;
actfancr_state *state = machine->driver_data<actfancr_state>();
MACHINE_RESET_CALL(actfancr);
state->trio_control_select = 0;
@ -584,7 +584,7 @@ ROM_END
static READ8_HANDLER( cycle_r )
{
actfancr_state *state = (actfancr_state *)space->machine->driver_data;
actfancr_state *state = space->machine->driver_data<actfancr_state>();
int pc = cpu_get_pc(space->cpu);
int ret = state->main_ram[0x26];
@ -602,7 +602,7 @@ static READ8_HANDLER( cycle_r )
static READ8_HANDLER( cyclej_r )
{
actfancr_state *state = (actfancr_state *)space->machine->driver_data;
actfancr_state *state = space->machine->driver_data<actfancr_state>();
int pc = cpu_get_pc(space->cpu);
int ret = state->main_ram[0x26];

View File

@ -152,12 +152,13 @@ Video board has additional chips:
#include "machine/microtch.h"
#include "machine/68681.h"
class adp_state
class adp_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, adp_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, adp_state(machine)); }
adp_state(running_machine &machine) { }
adp_state(running_machine &machine)
: driver_data_t(machine) { }
/* misc */
UINT8 mux_data;
@ -178,7 +179,7 @@ public:
static void duart_irq_handler( running_device *device, UINT8 vector )
{
adp_state *state = (adp_state *)device->machine->driver_data;
adp_state *state = device->machine->driver_data<adp_state>();
cpu_set_input_line_and_vector(state->maincpu, 4, HOLD_LINE, vector);
};
@ -192,7 +193,7 @@ static void duart_tx( running_device *device, int channel, UINT8 data )
static void microtouch_tx( running_machine *machine, UINT8 data )
{
adp_state *state = (adp_state *)machine->driver_data;
adp_state *state = machine->driver_data<adp_state>();
duart68681_rx_data(state->duart, 0, data);
}
@ -203,7 +204,7 @@ static UINT8 duart_input( running_device *device )
static MACHINE_START( skattv )
{
adp_state *state = (adp_state *)machine->driver_data;
adp_state *state = machine->driver_data<adp_state>();
microtouch_init(machine, microtouch_tx, 0);
state->maincpu = machine->device("maincpu");
@ -241,7 +242,7 @@ static MACHINE_START( skattv )
static MACHINE_RESET( skattv )
{
adp_state *state = (adp_state *)machine->driver_data;
adp_state *state = machine->driver_data<adp_state>();
state->mux_data = 0;
state->register_active = 0;
@ -291,7 +292,7 @@ static VIDEO_START(adp)
static VIDEO_UPDATE( adp )
{
adp_state *state = (adp_state *)screen->machine->driver_data;
adp_state *state = screen->machine->driver_data<adp_state>();
int x, y, b, src;
b = ((hd63484_regs_r(state->hd63484, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(state->hd63484, 0xce/2, 0xffff);
@ -368,7 +369,7 @@ if (!input_code_pressed(screen->machine, KEYCODE_O)) // debug: toggle window
static READ16_HANDLER( test_r )
{
adp_state *state = (adp_state *)space->machine->driver_data;
adp_state *state = space->machine->driver_data<adp_state>();
int value = 0xffff;
switch (state->mux_data)
@ -410,7 +411,7 @@ static READ16_HANDLER( test_r )
/*???*/
static WRITE16_HANDLER(wh2_w)
{
adp_state *state = (adp_state *)space->machine->driver_data;
adp_state *state = space->machine->driver_data<adp_state>();
state->register_active = data;
}

View File

@ -30,7 +30,7 @@ Revisions:
static READ8_HANDLER( aeroboto_201_r )
{
aeroboto_state *state = (aeroboto_state *)space->machine->driver_data;
aeroboto_state *state = space->machine->driver_data<aeroboto_state>();
/* if you keep a button pressed during boot, the game will expect this */
/* serie of values to be returned from 3004, and display "PASS 201" if it is */
static const UINT8 res[4] = { 0xff, 0x9f, 0x1b, 0x03 };
@ -42,7 +42,7 @@ static READ8_HANDLER( aeroboto_201_r )
static INTERRUPT_GEN( aeroboto_interrupt )
{
aeroboto_state *state = (aeroboto_state *)device->machine->driver_data;
aeroboto_state *state = device->machine->driver_data<aeroboto_state>();
if (!state->disable_irq)
cpu_set_input_line(device, 0, ASSERT_LINE);
@ -58,7 +58,7 @@ static READ8_HANDLER( aeroboto_irq_ack_r )
static READ8_HANDLER( aeroboto_2973_r )
{
aeroboto_state *state = (aeroboto_state *)space->machine->driver_data;
aeroboto_state *state = space->machine->driver_data<aeroboto_state>();
state->mainram[0x02be] = 0;
return 0xff;
@ -66,7 +66,7 @@ static READ8_HANDLER( aeroboto_2973_r )
static WRITE8_HANDLER ( aeroboto_1a2_w )
{
aeroboto_state *state = (aeroboto_state *)space->machine->driver_data;
aeroboto_state *state = space->machine->driver_data<aeroboto_state>();
state->mainram[0x01a2] = data;
if (data)
@ -228,7 +228,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( formatz )
{
aeroboto_state *state = (aeroboto_state *)machine->driver_data;
aeroboto_state *state = machine->driver_data<aeroboto_state>();
state->stars_rom = memory_region(machine, "gfx2");
state->stars_length = memory_region_length(machine, "gfx2");
@ -239,7 +239,7 @@ static MACHINE_START( formatz )
static MACHINE_RESET( formatz )
{
aeroboto_state *state = (aeroboto_state *)machine->driver_data;
aeroboto_state *state = machine->driver_data<aeroboto_state>();
state->disable_irq = 0;
state->count = 0;

View File

@ -68,7 +68,7 @@ Verification still needed for the other PCBs.
static WRITE16_HANDLER( sound_command_w )
{
aerofgt_state *state = (aerofgt_state *)space->machine->driver_data;
aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
if (ACCESSING_BITS_0_7)
{
state->pending_command = 1;
@ -79,7 +79,7 @@ static WRITE16_HANDLER( sound_command_w )
static WRITE16_HANDLER( turbofrc_sound_command_w )
{
aerofgt_state *state = (aerofgt_state *)space->machine->driver_data;
aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
if (ACCESSING_BITS_8_15)
{
state->pending_command = 1;
@ -90,7 +90,7 @@ static WRITE16_HANDLER( turbofrc_sound_command_w )
static WRITE16_HANDLER( aerfboot_soundlatch_w )
{
aerofgt_state *state = (aerofgt_state *)space->machine->driver_data;
aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
if(ACCESSING_BITS_8_15)
{
soundlatch_w(space, 0, (data >> 8) & 0xff);
@ -100,13 +100,13 @@ static WRITE16_HANDLER( aerfboot_soundlatch_w )
static READ16_HANDLER( pending_command_r )
{
aerofgt_state *state = (aerofgt_state *)space->machine->driver_data;
aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
return state->pending_command;
}
static WRITE8_HANDLER( pending_command_clear_w )
{
aerofgt_state *state = (aerofgt_state *)space->machine->driver_data;
aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
state->pending_command = 0;
}
@ -1282,7 +1282,7 @@ GFXDECODE_END
static void irqhandler( running_device *device, int irq )
{
aerofgt_state *state = (aerofgt_state *)device->machine->driver_data;
aerofgt_state *state = device->machine->driver_data<aerofgt_state>();
cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@ -1299,7 +1299,7 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( common )
{
aerofgt_state *state = (aerofgt_state *)machine->driver_data;
aerofgt_state *state = machine->driver_data<aerofgt_state>();
state->audiocpu = machine->device("audiocpu");
state_save_register_global(machine, state->pending_command);
@ -1316,7 +1316,7 @@ static MACHINE_START( aerofgt )
static MACHINE_RESET( common )
{
aerofgt_state *state = (aerofgt_state *)machine->driver_data;
aerofgt_state *state = machine->driver_data<aerofgt_state>();
state->pending_command = 0;
}

View File

@ -228,7 +228,7 @@ Code at 505: waits for bit 1 to go low, writes command, waits for bit
/* Read/Write Handlers */
static READ8_HANDLER( devram_r )
{
airbustr_state *state = (airbustr_state *)space->machine->driver_data;
airbustr_state *state = space->machine->driver_data<airbustr_state>();
// There's an MCU here, possibly
switch (offset)
@ -263,7 +263,7 @@ static READ8_HANDLER( devram_r )
static WRITE8_HANDLER( master_nmi_trigger_w )
{
airbustr_state *state = (airbustr_state *)space->machine->driver_data;
airbustr_state *state = space->machine->driver_data<airbustr_state>();
cpu_set_input_line(state->slave, INPUT_LINE_NMI, PULSE_LINE);
}
@ -274,7 +274,7 @@ static WRITE8_HANDLER( master_bankswitch_w )
static WRITE8_HANDLER( slave_bankswitch_w )
{
airbustr_state *state = (airbustr_state *)space->machine->driver_data;
airbustr_state *state = space->machine->driver_data<airbustr_state>();
memory_set_bank(space->machine, "bank2", data & 0x07);
@ -291,7 +291,7 @@ static WRITE8_HANDLER( sound_bankswitch_w )
static READ8_HANDLER( soundcommand_status_r )
{
airbustr_state *state = (airbustr_state *)space->machine->driver_data;
airbustr_state *state = space->machine->driver_data<airbustr_state>();
// bits: 2 <-> ? 1 <-> soundlatch full 0 <-> soundlatch2 empty
return 4 + state->soundlatch_status * 2 + (1 - state->soundlatch2_status);
@ -299,21 +299,21 @@ static READ8_HANDLER( soundcommand_status_r )
static READ8_HANDLER( soundcommand_r )
{
airbustr_state *state = (airbustr_state *)space->machine->driver_data;
airbustr_state *state = space->machine->driver_data<airbustr_state>();
state->soundlatch_status = 0; // soundlatch has been read
return soundlatch_r(space, 0);
}
static READ8_HANDLER( soundcommand2_r )
{
airbustr_state *state = (airbustr_state *)space->machine->driver_data;
airbustr_state *state = space->machine->driver_data<airbustr_state>();
state->soundlatch2_status = 0; // soundlatch2 has been read
return soundlatch2_r(space, 0);
}
static WRITE8_HANDLER( soundcommand_w )
{
airbustr_state *state = (airbustr_state *)space->machine->driver_data;
airbustr_state *state = space->machine->driver_data<airbustr_state>();
soundlatch_w(space, 0, data);
state->soundlatch_status = 1; // soundlatch has been written
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); // cause a nmi to sub cpu
@ -321,14 +321,14 @@ static WRITE8_HANDLER( soundcommand_w )
static WRITE8_HANDLER( soundcommand2_w )
{
airbustr_state *state = (airbustr_state *)space->machine->driver_data;
airbustr_state *state = space->machine->driver_data<airbustr_state>();
soundlatch2_w(space, 0, data);
state->soundlatch2_status = 1; // soundlatch2 has been written
}
static WRITE8_HANDLER( airbustr_paletteram_w )
{
airbustr_state *state = (airbustr_state *)space->machine->driver_data;
airbustr_state *state = space->machine->driver_data<airbustr_state>();
int val;
/* ! byte 1 ! ! byte 0 ! */
@ -559,14 +559,14 @@ static const ym2203_interface ym2203_config =
static INTERRUPT_GEN( master_interrupt )
{
airbustr_state *state = (airbustr_state *)device->machine->driver_data;
airbustr_state *state = device->machine->driver_data<airbustr_state>();
state->master_addr ^= 0x02;
cpu_set_input_line_and_vector(device, 0, HOLD_LINE, state->master_addr);
}
static INTERRUPT_GEN( slave_interrupt )
{
airbustr_state *state = (airbustr_state *)device->machine->driver_data;
airbustr_state *state = device->machine->driver_data<airbustr_state>();
state->slave_addr ^= 0x02;
cpu_set_input_line_and_vector(device, 0, HOLD_LINE, state->slave_addr);
}
@ -575,7 +575,7 @@ static INTERRUPT_GEN( slave_interrupt )
static MACHINE_START( airbustr )
{
airbustr_state *state = (airbustr_state *)machine->driver_data;
airbustr_state *state = machine->driver_data<airbustr_state>();
UINT8 *MASTER = memory_region(machine, "master");
UINT8 *SLAVE = memory_region(machine, "slave");
UINT8 *AUDIO = memory_region(machine, "audiocpu");
@ -605,7 +605,7 @@ static MACHINE_START( airbustr )
static MACHINE_RESET( airbustr )
{
airbustr_state *state = (airbustr_state *)machine->driver_data;
airbustr_state *state = machine->driver_data<airbustr_state>();
state->soundlatch_status = state->soundlatch2_status = 0;
state->master_addr = 0xff;

View File

@ -137,7 +137,7 @@ INPUT_PORTS_END
static WRITE8_HANDLER( sound_bank_w )
{
ajax_state *state = (ajax_state *)space->machine->driver_data;
ajax_state *state = space->machine->driver_data<ajax_state>();
int bank_A, bank_B;
/* banks # for the 007232 (chip 1) */

View File

@ -14,12 +14,13 @@ TODO:
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
class albazc_state
class albazc_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, albazc_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, albazc_state(machine)); }
albazc_state(running_machine &machine) { }
albazc_state(running_machine &machine)
: driver_data_t(machine) { }
/* video-related */
UINT8 * spriteram1;
@ -54,7 +55,7 @@ static VIDEO_START( hanaroku )
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
albazc_state *state = (albazc_state *)machine->driver_data;
albazc_state *state = machine->driver_data<albazc_state>();
int i;
for (i = 511; i >= 0; i--)
@ -130,7 +131,7 @@ static WRITE8_HANDLER( hanaroku_out_2_w )
static WRITE8_HANDLER( albazc_vregs_w )
{
albazc_state *state = (albazc_state *)space->machine->driver_data;
albazc_state *state = space->machine->driver_data<albazc_state>();
#ifdef UNUSED_FUNCTION
{

View File

@ -61,12 +61,13 @@ Code disassembling
#include "machine/8255ppi.h"
class albazg_state
class albazg_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, albazg_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, albazg_state(machine)); }
albazg_state(running_machine &machine) { }
albazg_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */
UINT8 * cus_ram;
@ -89,7 +90,7 @@ public:
static TILE_GET_INFO( y_get_bg_tile_info )
{
albazg_state *state = (albazg_state *)machine->driver_data;
albazg_state *state = machine->driver_data<albazg_state>();
int code = state->videoram[tile_index];
int color = state->colorram[tile_index];
@ -103,13 +104,13 @@ static TILE_GET_INFO( y_get_bg_tile_info )
static VIDEO_START( yumefuda )
{
albazg_state *state = (albazg_state *)machine->driver_data;
albazg_state *state = machine->driver_data<albazg_state>();
state->bg_tilemap = tilemap_create(machine, y_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static VIDEO_UPDATE( yumefuda )
{
albazg_state *state = (albazg_state *)screen->machine->driver_data;
albazg_state *state = screen->machine->driver_data<albazg_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@ -134,14 +135,14 @@ GFXDECODE_END
static WRITE8_HANDLER( yumefuda_vram_w )
{
albazg_state *state = (albazg_state *)space->machine->driver_data;
albazg_state *state = space->machine->driver_data<albazg_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( yumefuda_cram_w )
{
albazg_state *state = (albazg_state *)space->machine->driver_data;
albazg_state *state = space->machine->driver_data<albazg_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@ -149,14 +150,14 @@ static WRITE8_HANDLER( yumefuda_cram_w )
/*Custom RAM (Thrash Protection)*/
static READ8_HANDLER( custom_ram_r )
{
albazg_state *state = (albazg_state *)space->machine->driver_data;
albazg_state *state = space->machine->driver_data<albazg_state>();
// logerror("Custom RAM read at %02x PC = %x\n", offset + 0xaf80, cpu_get_pc(space->cpu));
return state->cus_ram[offset];// ^ 0x55;
}
static WRITE8_HANDLER( custom_ram_w )
{
albazg_state *state = (albazg_state *)space->machine->driver_data;
albazg_state *state = space->machine->driver_data<albazg_state>();
// logerror("Custom RAM write at %02x : %02x PC = %x\n", offset + 0xaf80, data, cpu_get_pc(space->cpu));
if(state->prot_lock)
state->cus_ram[offset] = data;
@ -165,14 +166,14 @@ static WRITE8_HANDLER( custom_ram_w )
/*this might be used as NVRAM commands btw*/
static WRITE8_HANDLER( prot_lock_w )
{
albazg_state *state = (albazg_state *)space->machine->driver_data;
albazg_state *state = space->machine->driver_data<albazg_state>();
// logerror("PC %04x Prot lock value written %02x\n", cpu_get_pc(space->cpu), data);
state->prot_lock = data;
}
static READ8_DEVICE_HANDLER( mux_r )
{
albazg_state *state = (albazg_state *)device->machine->driver_data;
albazg_state *state = device->machine->driver_data<albazg_state>();
switch(state->mux_data)
{
case 0x00: return input_port_read(device->machine, "IN0");
@ -189,7 +190,7 @@ static READ8_DEVICE_HANDLER( mux_r )
static WRITE8_DEVICE_HANDLER( mux_w )
{
albazg_state *state = (albazg_state *)device->machine->driver_data;
albazg_state *state = device->machine->driver_data<albazg_state>();
int new_bank = (data & 0xc0) >> 6;
//0x10000 "Learn Mode"
@ -376,7 +377,7 @@ INPUT_PORTS_END
static MACHINE_START( yumefuda )
{
albazg_state *state = (albazg_state *)machine->driver_data;
albazg_state *state = machine->driver_data<albazg_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
@ -388,7 +389,7 @@ static MACHINE_START( yumefuda )
static MACHINE_RESET( yumefuda )
{
albazg_state *state = (albazg_state *)machine->driver_data;
albazg_state *state = machine->driver_data<albazg_state>();
state->mux_data = 0;
state->bank = -1;
state->prot_lock = 0;

View File

@ -21,7 +21,7 @@ static KONAMI_SETLINES_CALLBACK( aliens_banking );
static INTERRUPT_GEN( aliens_interrupt )
{
aliens_state *state = (aliens_state *)device->machine->driver_data;
aliens_state *state = device->machine->driver_data<aliens_state>();
if (k051960_is_irq_enabled(state->k051960))
cpu_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
@ -29,7 +29,7 @@ static INTERRUPT_GEN( aliens_interrupt )
static READ8_HANDLER( bankedram_r )
{
aliens_state *state = (aliens_state *)space->machine->driver_data;
aliens_state *state = space->machine->driver_data<aliens_state>();
if (state->palette_selected)
return space->machine->generic.paletteram.u8[offset];
@ -39,7 +39,7 @@ static READ8_HANDLER( bankedram_r )
static WRITE8_HANDLER( bankedram_w )
{
aliens_state *state = (aliens_state *)space->machine->driver_data;
aliens_state *state = space->machine->driver_data<aliens_state>();
if (state->palette_selected)
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
@ -49,7 +49,7 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( aliens_coin_counter_w )
{
aliens_state *state = (aliens_state *)space->machine->driver_data;
aliens_state *state = space->machine->driver_data<aliens_state>();
/* bits 0-1 = coin counters */
coin_counter_w(space->machine, 0, data & 0x01);
@ -73,7 +73,7 @@ static WRITE8_HANDLER( aliens_coin_counter_w )
static WRITE8_HANDLER( aliens_sh_irqtrigger_w )
{
aliens_state *state = (aliens_state *)space->machine->driver_data;
aliens_state *state = space->machine->driver_data<aliens_state>();
soundlatch_w(space, offset, data);
cpu_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
@ -81,7 +81,7 @@ static WRITE8_HANDLER( aliens_sh_irqtrigger_w )
static WRITE8_DEVICE_HANDLER( aliens_snd_bankswitch_w )
{
aliens_state *state = (aliens_state *)device->machine->driver_data;
aliens_state *state = device->machine->driver_data<aliens_state>();
/* b1: bank for chanel A */
/* b0: bank for chanel B */
@ -95,7 +95,7 @@ static WRITE8_DEVICE_HANDLER( aliens_snd_bankswitch_w )
static READ8_HANDLER( k052109_051960_r )
{
aliens_state *state = (aliens_state *)space->machine->driver_data;
aliens_state *state = space->machine->driver_data<aliens_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@ -112,7 +112,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
aliens_state *state = (aliens_state *)space->machine->driver_data;
aliens_state *state = space->machine->driver_data<aliens_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@ -237,7 +237,7 @@ static const k051960_interface aliens_k051960_intf =
static MACHINE_START( aliens )
{
aliens_state *state = (aliens_state *)machine->driver_data;
aliens_state *state = machine->driver_data<aliens_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
memory_configure_bank(machine, "bank1", 0, 20, &ROM[0x10000], 0x2000);
@ -254,7 +254,7 @@ static MACHINE_START( aliens )
static MACHINE_RESET( aliens )
{
aliens_state *state = (aliens_state *)machine->driver_data;
aliens_state *state = machine->driver_data<aliens_state>();
konami_configure_set_lines(machine->device("maincpu"), aliens_banking);

View File

@ -232,7 +232,7 @@ static READ16_HANDLER( kyros_dip_r )
static READ16_HANDLER( control_1_r )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
if (state->invert_controls)
return ~(input_port_read(space->machine, "IN0") + (input_port_read(space->machine, "IN1") << 8));
@ -242,7 +242,7 @@ static READ16_HANDLER( control_1_r )
static READ16_HANDLER( control_2_r )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
if (state->invert_controls)
return ~(input_port_read(space->machine, "IN3") + ((~(1 << input_port_read(space->machine, "IN5"))) << 8));
@ -258,7 +258,7 @@ static READ16_HANDLER( control_2_V_r )
static READ16_HANDLER( control_3_r )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
if (state->invert_controls)
return ~(((~(1 << input_port_read(space->machine, "IN6"))) << 8) & 0xff00);
@ -269,7 +269,7 @@ static READ16_HANDLER( control_3_r )
/* High 4 bits of CN1 & CN2 */
static READ16_HANDLER( control_4_r )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
if (state->invert_controls)
return ~((((~(1 << input_port_read(space->machine, "IN6"))) << 4) & 0xf000)
@ -313,7 +313,7 @@ static WRITE16_HANDLER( alpha68k_V_sound_w )
//AT
static WRITE16_HANDLER( paddlema_soundlatch_w )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
if (ACCESSING_BITS_0_7)
{
@ -324,7 +324,7 @@ static WRITE16_HANDLER( paddlema_soundlatch_w )
static WRITE16_HANDLER( tnextspc_soundlatch_w )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
if (ACCESSING_BITS_0_7)
{
@ -343,7 +343,7 @@ static READ16_HANDLER( kyros_alpha_trigger_r )
*/
static const UINT8 coinage1[8][2]={{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}};
static const UINT8 coinage2[8][2]={{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}};
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
int source = state->shared_ram[offset];
switch (offset)
@ -425,7 +425,7 @@ static READ16_HANDLER( alpha_II_trigger_r )
*/
static const UINT8 coinage1[8][2] = {{1,1}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {2,3}, {3,2}};
static const UINT8 coinage2[8][2] = {{1,1}, {2,1}, {3,1}, {4,1}, {5,1}, {6,1}, {7,1}, {8,1}};
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
int source = state->shared_ram[offset];
switch (offset)
@ -520,7 +520,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
*/
static const UINT8 coinage1[8][2] = {{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}};
static const UINT8 coinage2[8][2] = {{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}};
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
int source = state->shared_ram[offset];
switch (offset)
@ -1829,7 +1829,7 @@ static const ym2203_interface ym2203_config =
static void YM3812_irq( running_device *device, int param )
{
alpha68k_state *state = (alpha68k_state *)device->machine->driver_data;
alpha68k_state *state = device->machine->driver_data<alpha68k_state>();
cpu_set_input_line(state->audiocpu, 0, (param) ? HOLD_LINE : CLEAR_LINE);
}
@ -1852,7 +1852,7 @@ static INTERRUPT_GEN( alpha68k_interrupt )
static MACHINE_START( common )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
state->audiocpu = machine->device("audiocpu");
@ -1868,7 +1868,7 @@ static MACHINE_START( common )
static MACHINE_RESET( common )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
state->trigstate = 0;
state->deposits1 = 0;
@ -1882,7 +1882,7 @@ static MACHINE_RESET( common )
static MACHINE_START( alpha68k_V )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
UINT8 *ROM = memory_region(machine, "audiocpu");
memory_configure_bank(machine, "bank7", 0, 32, &ROM[0x10000], 0x4000);
@ -1895,7 +1895,7 @@ static MACHINE_START( alpha68k_V )
static MACHINE_RESET( alpha68k_V )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
MACHINE_RESET_CALL(common);
@ -1905,7 +1905,7 @@ static MACHINE_RESET( alpha68k_V )
static MACHINE_RESET( alpha68k_II )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
MACHINE_RESET_CALL(common);
@ -1918,7 +1918,7 @@ static MACHINE_RESET( alpha68k_II )
static MACHINE_START( alpha68k_II )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
UINT8 *ROM = memory_region(machine, "audiocpu");
memory_configure_bank(machine, "bank7", 0, 28, &ROM[0x10000], 0x4000);
@ -3130,7 +3130,7 @@ ROM_END
static READ16_HANDLER( timesold_cycle_r )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
int ret = state->shared_ram[0x4];
if (cpu_get_pc(space->cpu) == 0x9ea2 && (ret & 0xff00) == 0)
@ -3144,7 +3144,7 @@ static READ16_HANDLER( timesold_cycle_r )
static READ16_HANDLER( timesold1_cycle_r )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
int ret = state->shared_ram[0x4];
if (cpu_get_pc(space->cpu) == 0x9e20 && (ret & 0xff00) == 0)
@ -3158,7 +3158,7 @@ static READ16_HANDLER( timesold1_cycle_r )
static READ16_HANDLER( btlfield_cycle_r )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
int ret = state->shared_ram[0x4];
if (cpu_get_pc(space->cpu) == 0x9e1c && (ret & 0xff00) == 0)
@ -3172,7 +3172,7 @@ static READ16_HANDLER( btlfield_cycle_r )
static READ16_HANDLER( skysoldr_cycle_r )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
int ret = state->shared_ram[0x4];
if (cpu_get_pc(space->cpu) == 0x1f4e && (ret & 0xff00) == 0)
@ -3186,7 +3186,7 @@ static READ16_HANDLER( skysoldr_cycle_r )
static READ16_HANDLER( skyadvnt_cycle_r )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
int ret = state->shared_ram[0x4];
if (cpu_get_pc(space->cpu) == 0x1f78 && (ret & 0xff00) == 0)
@ -3200,7 +3200,7 @@ static READ16_HANDLER( skyadvnt_cycle_r )
static READ16_HANDLER( gangwars_cycle_r )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
int ret = state->shared_ram[0x103];
if (cpu_get_pc(space->cpu) == 0xbbb6)
@ -3214,7 +3214,7 @@ static READ16_HANDLER( gangwars_cycle_r )
static READ16_HANDLER( gangwarsb_cycle_r )
{
alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
int ret = state->shared_ram[0x103];
if (cpu_get_pc(space->cpu) == 0xbbca)
@ -3230,7 +3230,7 @@ static READ16_HANDLER( gangwarsb_cycle_r )
static DRIVER_INIT( sstingry )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x00ff;
state->coin_id = 0x22 | (0x22 << 8);
@ -3238,7 +3238,7 @@ static DRIVER_INIT( sstingry )
static DRIVER_INIT( kyros )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x0012;
state->coin_id = 0x22 | (0x22 << 8);
@ -3247,7 +3247,7 @@ static DRIVER_INIT( kyros )
static DRIVER_INIT( jongbou )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0c0001, 0, 0, jongbou_inputs_r);
state->invert_controls = 0;
state->microcontroller_id = 0x00ff;
@ -3257,14 +3257,14 @@ static DRIVER_INIT( jongbou )
static DRIVER_INIT( paddlema )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
state->microcontroller_id = 0;
state->coin_id = 0; // Not needed !
}
static DRIVER_INIT( timesold )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, timesold_cycle_r);
state->invert_controls = 0;
state->microcontroller_id = 0;
@ -3273,7 +3273,7 @@ static DRIVER_INIT( timesold )
static DRIVER_INIT( timesold1 )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, timesold1_cycle_r);
state->invert_controls = 1;
state->microcontroller_id = 0;
@ -3282,7 +3282,7 @@ static DRIVER_INIT( timesold1 )
static DRIVER_INIT( btlfield )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, btlfield_cycle_r);
state->invert_controls = 1;
state->microcontroller_id = 0;
@ -3291,7 +3291,7 @@ static DRIVER_INIT( btlfield )
static DRIVER_INIT( btlfieldb )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
state->invert_controls = 1;
state->microcontroller_id = 0;
state->coin_id = 0x22 | (0x22 << 8); //not checked
@ -3300,7 +3300,7 @@ static DRIVER_INIT( btlfieldb )
static DRIVER_INIT( skysoldr )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, skysoldr_cycle_r);
memory_set_bankptr(machine, "bank8", (memory_region(machine, "user1")) + 0x40000);
state->invert_controls = 0;
@ -3310,7 +3310,7 @@ static DRIVER_INIT( skysoldr )
static DRIVER_INIT( goldmedl )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x8803; //AT
state->coin_id = 0x23 | (0x24 << 8);
@ -3318,7 +3318,7 @@ static DRIVER_INIT( goldmedl )
static DRIVER_INIT( goldmedla )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_set_bankptr(machine, "bank8", memory_region(machine, "maincpu") + 0x20000);
state->invert_controls = 0;
state->microcontroller_id = 0x8803; //Guess - routine to handle coinage is the same as in 'goldmedl'
@ -3327,7 +3327,7 @@ static DRIVER_INIT( goldmedla )
static DRIVER_INIT( skyadvnt )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r);
state->invert_controls = 0;
state->microcontroller_id = 0x8814;
@ -3336,7 +3336,7 @@ static DRIVER_INIT( skyadvnt )
static DRIVER_INIT( skyadvntu )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r);
state->invert_controls = 0;
state->microcontroller_id = 0x8814;
@ -3345,7 +3345,7 @@ static DRIVER_INIT( skyadvntu )
static DRIVER_INIT( gangwars )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40206, 0x40207, 0, 0, gangwars_cycle_r);
memory_set_bankptr(machine, "bank8", memory_region(machine, "user1"));
state->invert_controls = 0;
@ -3355,7 +3355,7 @@ static DRIVER_INIT( gangwars )
static DRIVER_INIT( gangwarsb )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40206, 0x40207, 0, 0, gangwarsb_cycle_r);
memory_set_bankptr(machine, "bank8", memory_region(machine, "user1"));
state->invert_controls = 0;
@ -3365,7 +3365,7 @@ static DRIVER_INIT( gangwarsb )
static DRIVER_INIT( sbasebal )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
UINT16 *rom = (UINT16 *)memory_region(machine, "maincpu");
/* Game hangs on divide by zero?! Patch it */
@ -3389,7 +3389,7 @@ static DRIVER_INIT( sbasebal )
static DRIVER_INIT( tnextspc )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
alpha68k_state *state = machine->driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x890a;
state->coin_id = 0; // Not needed !

View File

@ -36,7 +36,7 @@ Sound: YM2151
static UINT8 amspdwy_wheel_r( running_machine *machine, int index )
{
amspdwy_state *state = (amspdwy_state *)machine->driver_data;
amspdwy_state *state = machine->driver_data<amspdwy_state>();
static const char *const portnames[] = { "WHEEL1", "WHEEL2", "AN1", "AN2" };
UINT8 wheel = input_port_read(machine, portnames[2 + index]);
if (wheel != state->wheel_old[index])
@ -69,7 +69,7 @@ static READ8_DEVICE_HANDLER( amspdwy_sound_r )
static WRITE8_HANDLER( amspdwy_sound_w )
{
amspdwy_state *state = (amspdwy_state *)space->machine->driver_data;
amspdwy_state *state = space->machine->driver_data<amspdwy_state>();
soundlatch_w(space, 0, data);
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@ -241,7 +241,7 @@ GFXDECODE_END
static void irq_handler( running_device *device, int irq )
{
amspdwy_state *state = (amspdwy_state *)device->machine->driver_data;
amspdwy_state *state = device->machine->driver_data<amspdwy_state>();
cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@ -252,7 +252,7 @@ static const ym2151_interface amspdwy_ym2151_interface =
static MACHINE_START( amspdwy )
{
amspdwy_state *state = (amspdwy_state *)machine->driver_data;
amspdwy_state *state = machine->driver_data<amspdwy_state>();
state->audiocpu = machine->device("audiocpu");
@ -263,7 +263,7 @@ static MACHINE_START( amspdwy )
static MACHINE_RESET( amspdwy )
{
amspdwy_state *state = (amspdwy_state *)machine->driver_data;
amspdwy_state *state = machine->driver_data<amspdwy_state>();
state->flipscreen = 0;
state->wheel_old[0] = 0;
state->wheel_old[1] = 0;

View File

@ -489,32 +489,32 @@ sound related ?
static WRITE8_HANDLER( angelkds_main_sound_w )
{
angelkds_state *state = (angelkds_state *)space->machine->driver_data;
angelkds_state *state = space->machine->driver_data<angelkds_state>();
state->sound[offset] = data;
}
static READ8_HANDLER( angelkds_main_sound_r )
{
angelkds_state *state = (angelkds_state *)space->machine->driver_data;
angelkds_state *state = space->machine->driver_data<angelkds_state>();
return state->sound2[offset];
}
static WRITE8_HANDLER( angelkds_sub_sound_w )
{
angelkds_state *state = (angelkds_state *)space->machine->driver_data;
angelkds_state *state = space->machine->driver_data<angelkds_state>();
state->sound2[offset] = data;
}
static READ8_HANDLER( angelkds_sub_sound_r )
{
angelkds_state *state = (angelkds_state *)space->machine->driver_data;
angelkds_state *state = space->machine->driver_data<angelkds_state>();
return state->sound[offset];
}
static void irqhandler( running_device *device, int irq )
{
angelkds_state *state = (angelkds_state *)device->machine->driver_data;
angelkds_state *state = device->machine->driver_data<angelkds_state>();
cpu_set_input_line(state->subcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@ -575,7 +575,7 @@ GFXDECODE_END
static MACHINE_START( angelkds )
{
angelkds_state *state = (angelkds_state *)machine->driver_data;
angelkds_state *state = machine->driver_data<angelkds_state>();
state->subcpu = machine->device("sub");
@ -589,7 +589,7 @@ static MACHINE_START( angelkds )
static MACHINE_RESET( angelkds )
{
angelkds_state *state = (angelkds_state *)machine->driver_data;
angelkds_state *state = machine->driver_data<angelkds_state>();
int i;
for (i = 0; i < 4; i++)

View File

@ -171,7 +171,7 @@ Language
static void appoooh_adpcm_int(running_device *device)
{
appoooh_state *state = (appoooh_state *)device->machine->driver_data;
appoooh_state *state = device->machine->driver_data<appoooh_state>();
if (state->adpcm_address != 0xffffffff)
{
@ -199,7 +199,7 @@ static void appoooh_adpcm_int(running_device *device)
/* adpcm address write */
static WRITE8_HANDLER( appoooh_adpcm_w )
{
appoooh_state *state = (appoooh_state *)space->machine->driver_data;
appoooh_state *state = space->machine->driver_data<appoooh_state>();
state->adpcm_address = data << 8;
msm5205_reset_w(state->adpcm, 0);
@ -402,7 +402,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( appoooh )
{
appoooh_state *state = (appoooh_state *)machine->driver_data;
appoooh_state *state = machine->driver_data<appoooh_state>();
state->adpcm = machine->device("msm");
@ -413,7 +413,7 @@ static MACHINE_START( appoooh )
static MACHINE_RESET( appoooh )
{
appoooh_state *state = (appoooh_state *)machine->driver_data;
appoooh_state *state = machine->driver_data<appoooh_state>();
state->adpcm_address = 0xffffffff;
state->adpcm_data = 0;

View File

@ -74,7 +74,7 @@ static MACHINE_RESET( aquarium_hack )
static READ16_HANDLER( aquarium_coins_r )
{
aquarium_state *state = (aquarium_state *)space->machine->driver_data;
aquarium_state *state = space->machine->driver_data<aquarium_state>();
int data;
data = (input_port_read(space->machine, "SYSTEM") & 0x7fff);
@ -86,14 +86,14 @@ static READ16_HANDLER( aquarium_coins_r )
static WRITE8_HANDLER( aquarium_snd_ack_w )
{
aquarium_state *state = (aquarium_state *)space->machine->driver_data;
aquarium_state *state = space->machine->driver_data<aquarium_state>();
state->aquarium_snd_ack = 0x8000;
}
static WRITE16_HANDLER( aquarium_sound_w )
{
// popmessage("sound write %04x",data);
aquarium_state *state = (aquarium_state *)space->machine->driver_data;
aquarium_state *state = space->machine->driver_data<aquarium_state>();
soundlatch_w(space, 1, data & 0xff);
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE );
@ -328,7 +328,7 @@ GFXDECODE_END
static void irq_handler( running_device *device, int irq )
{
aquarium_state *state = (aquarium_state *)device->machine->driver_data;
aquarium_state *state = device->machine->driver_data<aquarium_state>();
cpu_set_input_line(state->audiocpu, 0 , irq ? ASSERT_LINE : CLEAR_LINE);
}
@ -340,7 +340,7 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( aquarium )
{
aquarium_state *state = (aquarium_state *)machine->driver_data;
aquarium_state *state = machine->driver_data<aquarium_state>();
state->audiocpu = machine->device("audiocpu");
@ -349,7 +349,7 @@ static MACHINE_START( aquarium )
static MACHINE_RESET( aquarium )
{
aquarium_state *state = (aquarium_state *)machine->driver_data;
aquarium_state *state = machine->driver_data<aquarium_state>();
state->aquarium_snd_ack = 0;
#if AQUARIUS_HACK

View File

@ -83,7 +83,7 @@
static WRITE8_DEVICE_HANDLER( ay8910_porta_w )
{
arabian_state *state = (arabian_state *)device->machine->driver_data;
arabian_state *state = device->machine->driver_data<arabian_state>();
/*
bit 7 = ENA
@ -98,7 +98,7 @@ static WRITE8_DEVICE_HANDLER( ay8910_porta_w )
static WRITE8_DEVICE_HANDLER( ay8910_portb_w )
{
arabian_state *state = (arabian_state *)device->machine->driver_data;
arabian_state *state = device->machine->driver_data<arabian_state>();
/*
bit 5 = /IREQ to custom CPU
@ -125,7 +125,7 @@ static WRITE8_DEVICE_HANDLER( ay8910_portb_w )
static READ8_HANDLER( custom_cpu_r )
{
arabian_state *state = (arabian_state *)space->machine->driver_data;
arabian_state *state = space->machine->driver_data<arabian_state>();
/* since we don't have a simulator for the Fujitsu 8841 4-bit microprocessor */
/* we have to simulate its behavior; it looks like Arabian reads out of the */
@ -171,7 +171,7 @@ static READ8_HANDLER( custom_cpu_r )
static WRITE8_HANDLER( custom_cpu_w )
{
arabian_state *state = (arabian_state *)space->machine->driver_data;
arabian_state *state = space->machine->driver_data<arabian_state>();
state->custom_cpu_ram[0x7f0 + offset] = data;
}
@ -179,7 +179,7 @@ static WRITE8_HANDLER( custom_cpu_w )
static void update_flip_state( running_machine *machine )
{
arabian_state *state = (arabian_state *)machine->driver_data;
arabian_state *state = machine->driver_data<arabian_state>();
/* the custom CPU also controls the video flip control line; unfortunately, */
/* it appears that the custom is smart enough to flip the screen itself, based */
@ -199,7 +199,7 @@ static void update_flip_state( running_machine *machine )
static WRITE8_HANDLER( custom_flip_w )
{
arabian_state *state = (arabian_state *)space->machine->driver_data;
arabian_state *state = space->machine->driver_data<arabian_state>();
state->custom_cpu_ram[0x34b + offset] = data;
update_flip_state(space->machine);
@ -208,7 +208,7 @@ static WRITE8_HANDLER( custom_flip_w )
static WRITE8_HANDLER( custom_cocktail_w )
{
arabian_state *state = (arabian_state *)space->machine->driver_data;
arabian_state *state = space->machine->driver_data<arabian_state>();
state->custom_cpu_ram[0x400 + offset] = data;
update_flip_state(space->machine);
@ -374,7 +374,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( arabian )
{
arabian_state *state = (arabian_state *)machine->driver_data;
arabian_state *state = machine->driver_data<arabian_state>();
state_save_register_global(machine, state->custom_cpu_reset);
state_save_register_global(machine, state->custom_cpu_busy);
@ -382,7 +382,7 @@ static MACHINE_START( arabian )
static MACHINE_RESET( arabian )
{
arabian_state *state = (arabian_state *)machine->driver_data;
arabian_state *state = machine->driver_data<arabian_state>();
state->custom_cpu_reset = 0;
state->custom_cpu_busy = 0;

View File

@ -83,8 +83,8 @@
static void update_interrupts(running_machine *machine)
{
rampart_state *state = (rampart_state *)machine->driver_data;
cputag_set_input_line(machine, "maincpu", 4, state->atarigen.scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
rampart_state *state = machine->driver_data<rampart_state>();
cputag_set_input_line(machine, "maincpu", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@ -111,10 +111,10 @@ static MACHINE_START( arcadecl )
static MACHINE_RESET( arcadecl )
{
rampart_state *state = (rampart_state *)machine->driver_data;
rampart_state *state = machine->driver_data<rampart_state>();
atarigen_eeprom_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
}
@ -168,7 +168,7 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x640026, 0x640027) AM_READ_PORT("TRACKY1")
AM_RANGE(0x640040, 0x64004f) AM_WRITE(latch_w)
AM_RANGE(0x640060, 0x64006f) AM_WRITE(atarigen_eeprom_enable_w)
AM_RANGE(0x641000, 0x641fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(rampart_state, atarigen.eeprom, atarigen.eeprom_size)
AM_RANGE(0x641000, 0x641fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(rampart_state, eeprom, eeprom_size)
AM_RANGE(0x642000, 0x642001) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0xff00)
AM_RANGE(0x646000, 0x646fff) AM_WRITE(atarigen_scanline_int_ack_w)
AM_RANGE(0x647000, 0x647fff) AM_WRITE(watchdog_reset16_w)

View File

@ -914,7 +914,7 @@ static const ay8910_interface hexa_ay8910_config =
static MACHINE_START( arkanoid )
{
arkanoid_state *state = (arkanoid_state *)machine->driver_data;
arkanoid_state *state = machine->driver_data<arkanoid_state>();
state->mcu = machine->device("mcu");
@ -939,7 +939,7 @@ static MACHINE_START( arkanoid )
static MACHINE_RESET( arkanoid )
{
arkanoid_state *state = (arkanoid_state *)machine->driver_data;
arkanoid_state *state = machine->driver_data<arkanoid_state>();
state->port_a_in = 0;
state->port_a_out = 0;
@ -1459,21 +1459,21 @@ static void arkanoid_bootleg_init( running_machine *machine )
static DRIVER_INIT( arkangc )
{
arkanoid_state *state = (arkanoid_state *)machine->driver_data;
arkanoid_state *state = machine->driver_data<arkanoid_state>();
state->bootleg_id = ARKANGC;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkangc2 )
{
arkanoid_state *state = (arkanoid_state *)machine->driver_data;
arkanoid_state *state = machine->driver_data<arkanoid_state>();
state->bootleg_id = ARKANGC2;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( block2 )
{
arkanoid_state *state = (arkanoid_state *)machine->driver_data;
arkanoid_state *state = machine->driver_data<arkanoid_state>();
// the graphics on this bootleg have the data scrambled
int tile;
UINT8* srcgfx = memory_region(machine,"gfx1");
@ -1509,28 +1509,28 @@ static DRIVER_INIT( block2 )
static DRIVER_INIT( arkblock )
{
arkanoid_state *state = (arkanoid_state *)machine->driver_data;
arkanoid_state *state = machine->driver_data<arkanoid_state>();
state->bootleg_id = ARKBLOCK;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkbloc2 )
{
arkanoid_state *state = (arkanoid_state *)machine->driver_data;
arkanoid_state *state = machine->driver_data<arkanoid_state>();
state->bootleg_id = ARKBLOC2;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkgcbl )
{
arkanoid_state *state = (arkanoid_state *)machine->driver_data;
arkanoid_state *state = machine->driver_data<arkanoid_state>();
state->bootleg_id = ARKGCBL;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( paddle2 )
{
arkanoid_state *state = (arkanoid_state *)machine->driver_data;
arkanoid_state *state = machine->driver_data<arkanoid_state>();
state->bootleg_id = PADDLE2;
arkanoid_bootleg_init(machine);
}

View File

@ -176,7 +176,7 @@ Stephh's notes (based on the games M68000 code and some tests) :
static WRITE16_HANDLER( io_w )
{
armedf_state *state = (armedf_state *)space->machine->driver_data;
armedf_state *state = space->machine->driver_data<armedf_state>();
COMBINE_DATA(&state->vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
@ -186,7 +186,7 @@ static WRITE16_HANDLER( io_w )
static WRITE16_HANDLER( terraf_io_w )
{
armedf_state *state = (armedf_state *)space->machine->driver_data;
armedf_state *state = space->machine->driver_data<armedf_state>();
COMBINE_DATA(&state->vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
@ -209,7 +209,7 @@ static WRITE16_HANDLER( terraf_io_w )
static WRITE16_HANDLER( kodure_io_w )
{
armedf_state *state = (armedf_state *)space->machine->driver_data;
armedf_state *state = space->machine->driver_data<armedf_state>();
COMBINE_DATA(&state->vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
@ -236,7 +236,7 @@ static WRITE16_HANDLER( sound_command_w )
#ifdef UNUSED_FUNCTION
static WRITE16_HANDLER( legion_command_c )
{
armedf_state *state = (armedf_state *)space->machine->driver_data;
armedf_state *state = space->machine->driver_data<armedf_state>();
COMBINE_DATA(&state->legion_cmd[offset]);
//logerror("Legion CMD %04x=%04x", offset, data);
@ -762,7 +762,7 @@ GFXDECODE_END
static MACHINE_START( armedf )
{
armedf_state *state = (armedf_state *)machine->driver_data;
armedf_state *state = machine->driver_data<armedf_state>();
state_save_register_global(machine, state->mcu_mode);
state_save_register_global(machine, state->old_mcu_mode);
@ -777,7 +777,7 @@ static MACHINE_START( armedf )
static MACHINE_RESET( armedf )
{
armedf_state *state = (armedf_state *)machine->driver_data;
armedf_state *state = machine->driver_data<armedf_state>();
state->mcu_mode = 0;
state->old_mcu_mode = 0;
@ -1527,32 +1527,32 @@ ROM_END
static DRIVER_INIT( terraf )
{
armedf_state *state = (armedf_state *)machine->driver_data;
armedf_state *state = machine->driver_data<armedf_state>();
state->scroll_type = 0;
}
static DRIVER_INIT( terrafu )
{
armedf_state *state = (armedf_state *)machine->driver_data;
armedf_state *state = machine->driver_data<armedf_state>();
state->scroll_type = 5;
}
static DRIVER_INIT( armedf )
{
armedf_state *state = (armedf_state *)machine->driver_data;
armedf_state *state = machine->driver_data<armedf_state>();
state->scroll_type = 1;
}
static DRIVER_INIT( kodure )
{
armedf_state *state = (armedf_state *)machine->driver_data;
armedf_state *state = machine->driver_data<armedf_state>();
state->scroll_type = 2;
}
static DRIVER_INIT( legion )
{
armedf_state *state = (armedf_state *)machine->driver_data;
armedf_state *state = machine->driver_data<armedf_state>();
#if LEGION_HACK
/* This is a hack to allow you to use the extra features
of 3 of the "Unused" Dip Switches (see notes above). */
@ -1567,7 +1567,7 @@ static DRIVER_INIT( legion )
static DRIVER_INIT( legiono )
{
armedf_state *state = (armedf_state *)machine->driver_data;
armedf_state *state = machine->driver_data<armedf_state>();
#if LEGION_HACK
/* This is a hack to allow you to use the extra features
of 3 of the "Unused" Dip Switches (see notes above). */
@ -1581,7 +1581,7 @@ static DRIVER_INIT( legiono )
static DRIVER_INIT( cclimbr2 )
{
armedf_state *state = (armedf_state *)machine->driver_data;
armedf_state *state = machine->driver_data<armedf_state>();
state->scroll_type = 4;
}

View File

@ -88,7 +88,7 @@ static READ16_HANDLER(fake_4a00a_r)
static WRITE16_HANDLER( ashnojoe_soundlatch_w )
{
ashnojoe_state *state = (ashnojoe_state *)space->machine->driver_data;
ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
if (ACCESSING_BITS_0_7)
{
state->soundlatch_status = 1;
@ -121,20 +121,20 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( adpcm_w )
{
ashnojoe_state *state = (ashnojoe_state *)space->machine->driver_data;
ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
state->adpcm_byte = data;
}
static READ8_HANDLER( sound_latch_r )
{
ashnojoe_state *state = (ashnojoe_state *)space->machine->driver_data;
ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
state->soundlatch_status = 0;
return soundlatch_r(space, 0);
}
static READ8_HANDLER( sound_latch_status_r )
{
ashnojoe_state *state = (ashnojoe_state *)space->machine->driver_data;
ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
return state->soundlatch_status;
}
@ -276,7 +276,7 @@ GFXDECODE_END
static void ym2203_irq_handler( running_device *device, int irq )
{
ashnojoe_state *state = (ashnojoe_state *)device->machine->driver_data;
ashnojoe_state *state = device->machine->driver_data<ashnojoe_state>();
cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@ -309,7 +309,7 @@ static const ym2203_interface ym2203_config =
static void ashnojoe_vclk_cb( running_device *device )
{
ashnojoe_state *state = (ashnojoe_state *)device->machine->driver_data;
ashnojoe_state *state = device->machine->driver_data<ashnojoe_state>();
if (state->msm5205_vclk_toggle == 0)
{
msm5205_data_w(device, state->adpcm_byte >> 4);
@ -332,7 +332,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( ashnojoe )
{
ashnojoe_state *state = (ashnojoe_state *)machine->driver_data;
ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
state->audiocpu = machine->device("audiocpu");
@ -343,7 +343,7 @@ static MACHINE_START( ashnojoe )
static MACHINE_RESET( ashnojoe )
{
ashnojoe_state *state = (ashnojoe_state *)machine->driver_data;
ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
state->adpcm_byte = 0;
state->soundlatch_status = 0;

View File

@ -33,14 +33,14 @@ static const eeprom_interface eeprom_intf =
#if 0
static READ16_HANDLER( control2_r )
{
asterix_state *state = (asterix_state *)space->machine->driver_data;
asterix_state *state = space->machine->driver_data<asterix_state>();
return state->cur_control2;
}
#endif
static WRITE16_HANDLER( control2_w )
{
asterix_state *state = (asterix_state *)space->machine->driver_data;
asterix_state *state = space->machine->driver_data<asterix_state>();
if (ACCESSING_BITS_0_7)
{
@ -57,7 +57,7 @@ static WRITE16_HANDLER( control2_w )
static INTERRUPT_GEN( asterix_interrupt )
{
asterix_state *state = (asterix_state *)device->machine->driver_data;
asterix_state *state = device->machine->driver_data<asterix_state>();
// global interrupt masking
if (!k056832_is_irq_enabled(state->k056832, 0))
@ -73,13 +73,13 @@ static READ8_DEVICE_HANDLER( asterix_sound_r )
static TIMER_CALLBACK( nmi_callback )
{
asterix_state *state = (asterix_state *)machine->driver_data;
asterix_state *state = machine->driver_data<asterix_state>();
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
}
static WRITE8_HANDLER( sound_arm_nmi_w )
{
asterix_state *state = (asterix_state *)space->machine->driver_data;
asterix_state *state = space->machine->driver_data<asterix_state>();
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
timer_set(space->machine, ATTOTIME_IN_USEC(5), NULL, 0, nmi_callback);
@ -87,7 +87,7 @@ static WRITE8_HANDLER( sound_arm_nmi_w )
static WRITE16_HANDLER( sound_irq_w )
{
asterix_state *state = (asterix_state *)space->machine->driver_data;
asterix_state *state = space->machine->driver_data<asterix_state>();
cpu_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@ -97,7 +97,7 @@ static WRITE16_HANDLER( sound_irq_w )
#if 0
static WRITE16_HANDLER( protection_w )
{
asterix_state *state = (asterix_state *)space->machine->driver_data;
asterix_state *state = space->machine->driver_data<asterix_state>();
COMBINE_DATA(state->prot + offset);
if (offset == 1)
@ -251,7 +251,7 @@ static const k05324x_interface asterix_k05324x_intf =
static MACHINE_START( asterix )
{
asterix_state *state = (asterix_state *)machine->driver_data;
asterix_state *state = machine->driver_data<asterix_state>();
state->maincpu = machine->device("maincpu");
state->audiocpu = machine->device("audiocpu");
@ -273,7 +273,7 @@ static MACHINE_START( asterix )
static MACHINE_RESET( asterix )
{
asterix_state *state = (asterix_state *)machine->driver_data;
asterix_state *state = machine->driver_data<asterix_state>();
int i;
state->cur_control2 = 0;

View File

@ -41,12 +41,13 @@ enum
};
class astinvad_state
class astinvad_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, astinvad_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, astinvad_state(machine)); }
astinvad_state(running_machine &machine) { }
astinvad_state(running_machine &machine)
: driver_data_t(machine) { }
UINT8 * colorram;
UINT8 * videoram;
@ -105,7 +106,7 @@ static const ppi8255_interface ppi8255_intf[2] =
static VIDEO_START( spaceint )
{
astinvad_state *state = (astinvad_state *)machine->driver_data;
astinvad_state *state = machine->driver_data<astinvad_state>();
state->colorram = auto_alloc_array(machine, UINT8, state->videoram_size);
state_save_register_global(machine, state->color_latch);
@ -115,14 +116,14 @@ static VIDEO_START( spaceint )
static WRITE8_HANDLER( color_latch_w )
{
astinvad_state *state = (astinvad_state *)space->machine->driver_data;
astinvad_state *state = space->machine->driver_data<astinvad_state>();
state->color_latch = data & 0x0f;
}
static WRITE8_HANDLER( spaceint_videoram_w )
{
astinvad_state *state = (astinvad_state *)space->machine->driver_data;
astinvad_state *state = space->machine->driver_data<astinvad_state>();
state->videoram[offset] = data;
state->colorram[offset] = state->color_latch;
}
@ -137,7 +138,7 @@ static WRITE8_HANDLER( spaceint_videoram_w )
static void plot_byte( running_machine *machine, bitmap_t *bitmap, UINT8 y, UINT8 x, UINT8 data, UINT8 color )
{
astinvad_state *state = (astinvad_state *)machine->driver_data;
astinvad_state *state = machine->driver_data<astinvad_state>();
pen_t fore_pen = MAKE_RGB(pal1bit(color >> 0), pal1bit(color >> 2), pal1bit(color >> 1));
UINT8 flip_xor = state->screen_flip & 7;
@ -154,7 +155,7 @@ static void plot_byte( running_machine *machine, bitmap_t *bitmap, UINT8 y, UINT
static VIDEO_UPDATE( astinvad )
{
astinvad_state *state = (astinvad_state *)screen->machine->driver_data;
astinvad_state *state = screen->machine->driver_data<astinvad_state>();
const UINT8 *color_prom = memory_region(screen->machine, "proms");
UINT8 yoffs = state->flip_yoffs & state->screen_flip;
int x, y;
@ -174,7 +175,7 @@ static VIDEO_UPDATE( astinvad )
static VIDEO_UPDATE( spaceint )
{
astinvad_state *state = (astinvad_state *)screen->machine->driver_data;
astinvad_state *state = screen->machine->driver_data<astinvad_state>();
const UINT8 *color_prom = memory_region(screen->machine, "proms");
int offs;
@ -206,14 +207,14 @@ static VIDEO_UPDATE( spaceint )
static TIMER_CALLBACK( kamikaze_int_off )
{
astinvad_state *state = (astinvad_state *)machine->driver_data;
astinvad_state *state = machine->driver_data<astinvad_state>();
cpu_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
static TIMER_CALLBACK( kamizake_int_gen )
{
astinvad_state *state = (astinvad_state *)machine->driver_data;
astinvad_state *state = machine->driver_data<astinvad_state>();
/* interrupts are asserted on every state change of the 128V line */
cpu_set_input_line(state->maincpu, 0, ASSERT_LINE);
param ^= 128;
@ -226,7 +227,7 @@ static TIMER_CALLBACK( kamizake_int_gen )
static MACHINE_START( kamikaze )
{
astinvad_state *state = (astinvad_state *)machine->driver_data;
astinvad_state *state = machine->driver_data<astinvad_state>();
state->maincpu = machine->device("maincpu");
state->ppi8255_0 = machine->device("ppi8255_0");
@ -243,7 +244,7 @@ static MACHINE_START( kamikaze )
static MACHINE_RESET( kamikaze )
{
astinvad_state *state = (astinvad_state *)machine->driver_data;
astinvad_state *state = machine->driver_data<astinvad_state>();
state->screen_flip = 0;
state->screen_red = 0;
@ -254,7 +255,7 @@ static MACHINE_RESET( kamikaze )
static MACHINE_START( spaceint )
{
astinvad_state *state = (astinvad_state *)machine->driver_data;
astinvad_state *state = machine->driver_data<astinvad_state>();
state->maincpu = machine->device("maincpu");
state->samples = machine->device("samples");
@ -265,7 +266,7 @@ static MACHINE_START( spaceint )
static MACHINE_RESET( spaceint )
{
astinvad_state *state = (astinvad_state *)machine->driver_data;
astinvad_state *state = machine->driver_data<astinvad_state>();
state->screen_flip = 0;
state->sound_state[0] = 0;
@ -276,7 +277,7 @@ static MACHINE_RESET( spaceint )
static INPUT_CHANGED( spaceint_coin_inserted )
{
astinvad_state *state = (astinvad_state *)field->port->machine->driver_data;
astinvad_state *state = field->port->machine->driver_data<astinvad_state>();
/* coin insertion causes an NMI */
cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
}
@ -291,7 +292,7 @@ static INPUT_CHANGED( spaceint_coin_inserted )
static READ8_HANDLER( kamikaze_ppi_r )
{
astinvad_state *state = (astinvad_state *)space->machine->driver_data;
astinvad_state *state = space->machine->driver_data<astinvad_state>();
UINT8 result = 0xff;
/* the address lines are used for /CS; yes, they can overlap! */
@ -305,7 +306,7 @@ static READ8_HANDLER( kamikaze_ppi_r )
static WRITE8_HANDLER( kamikaze_ppi_w )
{
astinvad_state *state = (astinvad_state *)space->machine->driver_data;
astinvad_state *state = space->machine->driver_data<astinvad_state>();
/* the address lines are used for /CS; yes, they can overlap! */
if (!(offset & 4))
@ -324,7 +325,7 @@ static WRITE8_HANDLER( kamikaze_ppi_w )
static WRITE8_DEVICE_HANDLER( astinvad_sound1_w )
{
astinvad_state *state = (astinvad_state *)device->machine->driver_data;
astinvad_state *state = device->machine->driver_data<astinvad_state>();
int bits_gone_hi = data & ~state->sound_state[0];
state->sound_state[0] = data;
@ -341,7 +342,7 @@ static WRITE8_DEVICE_HANDLER( astinvad_sound1_w )
static WRITE8_DEVICE_HANDLER( astinvad_sound2_w )
{
astinvad_state *state = (astinvad_state *)device->machine->driver_data;
astinvad_state *state = device->machine->driver_data<astinvad_state>();
int bits_gone_hi = data & ~state->sound_state[1];
state->sound_state[1] = data;
@ -357,7 +358,7 @@ static WRITE8_DEVICE_HANDLER( astinvad_sound2_w )
static WRITE8_HANDLER( spaceint_sound1_w )
{
astinvad_state *state = (astinvad_state *)space->machine->driver_data;
astinvad_state *state = space->machine->driver_data<astinvad_state>();
int bits_gone_hi = data & ~state->sound_state[0];
state->sound_state[0] = data;
@ -376,7 +377,7 @@ static WRITE8_HANDLER( spaceint_sound1_w )
static WRITE8_HANDLER( spaceint_sound2_w )
{
astinvad_state *state = (astinvad_state *)space->machine->driver_data;
astinvad_state *state = space->machine->driver_data<astinvad_state>();
int bits_gone_hi = data & ~state->sound_state[1];
state->sound_state[1] = data;
@ -752,7 +753,7 @@ ROM_END
static DRIVER_INIT( kamikaze )
{
astinvad_state *state = (astinvad_state *)machine->driver_data;
astinvad_state *state = machine->driver_data<astinvad_state>();
/* the flip screen logic adds 32 to the Y after flipping */
state->flip_yoffs = 32;
@ -761,7 +762,7 @@ static DRIVER_INIT( kamikaze )
static DRIVER_INIT( spcking2 )
{
astinvad_state *state = (astinvad_state *)machine->driver_data;
astinvad_state *state = machine->driver_data<astinvad_state>();
/* don't have the schematics, but the blanking must center the screen here */
state->flip_yoffs = 0;

View File

@ -35,12 +35,13 @@ To do:
#include "machine/ticket.h"
#include "sound/okim6295.h"
class astrocorp_state
class astrocorp_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, astrocorp_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, astrocorp_state(machine)); }
astrocorp_state(running_machine &machine) { }
astrocorp_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */
UINT16 * spriteram;
@ -59,7 +60,7 @@ public:
static VIDEO_START( astrocorp )
{
astrocorp_state *state = (astrocorp_state *)machine->driver_data;
astrocorp_state *state = machine->driver_data<astrocorp_state>();
state->bitmap = machine->primary_screen->alloc_compatible_bitmap();
@ -92,7 +93,7 @@ static VIDEO_START( astrocorp )
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
astrocorp_state *state = (astrocorp_state *)machine->driver_data;
astrocorp_state *state = machine->driver_data<astrocorp_state>();
UINT16 *source = state->spriteram;
UINT16 *finish = state->spriteram + state->spriteram_size / 2;
@ -140,7 +141,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static VIDEO_UPDATE(astrocorp)
{
astrocorp_state *state = (astrocorp_state *)screen->machine->driver_data;
astrocorp_state *state = screen->machine->driver_data<astrocorp_state>();
if (state->screen_enable & 1)
copybitmap(bitmap, state->bitmap, 0,0,0,0, cliprect);
@ -157,7 +158,7 @@ static VIDEO_UPDATE(astrocorp)
static WRITE16_HANDLER( astrocorp_draw_sprites_w )
{
astrocorp_state *state = (astrocorp_state *)space->machine->driver_data;
astrocorp_state *state = space->machine->driver_data<astrocorp_state>();
UINT16 old = state->draw_sprites;
UINT16 now = COMBINE_DATA(&state->draw_sprites);
@ -258,7 +259,7 @@ static WRITE16_HANDLER( skilldrp_outputs_w )
static WRITE16_HANDLER( astrocorp_screen_enable_w )
{
astrocorp_state *state = (astrocorp_state *)space->machine->driver_data;
astrocorp_state *state = space->machine->driver_data<astrocorp_state>();
COMBINE_DATA(&state->screen_enable);
// popmessage("%04X",data);
if (state->screen_enable & (~1))
@ -273,7 +274,7 @@ static READ16_HANDLER( astrocorp_unk_r )
// 5-6-5 Palette: BBBBB-GGGGGG-RRRRR
static WRITE16_HANDLER( astrocorp_palette_w )
{
astrocorp_state *state = (astrocorp_state *)space->machine->driver_data;
astrocorp_state *state = space->machine->driver_data<astrocorp_state>();
COMBINE_DATA(&state->paletteram[offset]);
palette_set_color_rgb(space->machine, offset,
pal5bit((state->paletteram[offset] >> 0) & 0x1f),

View File

@ -81,7 +81,7 @@
static READ8_HANDLER( irq_clear_r )
{
astrof_state *state = (astrof_state *)space->machine->driver_data;
astrof_state *state = space->machine->driver_data<astrof_state>();
cpu_set_input_line(state->maincpu, 0, CLEAR_LINE);
return 0;
@ -90,7 +90,7 @@ static READ8_HANDLER( irq_clear_r )
static TIMER_DEVICE_CALLBACK( irq_callback )
{
astrof_state *state = (astrof_state *)timer.machine->driver_data;
astrof_state *state = timer.machine->driver_data<astrof_state>();
cpu_set_input_line(state->maincpu, 0, ASSERT_LINE);
}
@ -104,7 +104,7 @@ static TIMER_DEVICE_CALLBACK( irq_callback )
static INPUT_CHANGED( coin_inserted )
{
astrof_state *state = (astrof_state *)field->port->machine->driver_data;
astrof_state *state = field->port->machine->driver_data<astrof_state>();
/* coin insertion causes an NMI */
cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
@ -114,7 +114,7 @@ static INPUT_CHANGED( coin_inserted )
static INPUT_CHANGED( service_coin_inserted )
{
astrof_state *state = (astrof_state *)field->port->machine->driver_data;
astrof_state *state = field->port->machine->driver_data<astrof_state>();
/* service coin insertion causes an NMI */
cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
@ -146,7 +146,7 @@ static CUSTOM_INPUT( astrof_p2_controls_r )
static CUSTOM_INPUT( tomahawk_controls_r )
{
UINT32 ret;
astrof_state *state = (astrof_state *)field->port->machine->driver_data;
astrof_state *state = field->port->machine->driver_data<astrof_state>();
/* on a cocktail cabinet, two sets of controls are
multiplexed on a single set of inputs
@ -174,7 +174,7 @@ static CUSTOM_INPUT( tomahawk_controls_r )
static VIDEO_START( astrof )
{
astrof_state *state = (astrof_state *)machine->driver_data;
astrof_state *state = machine->driver_data<astrof_state>();
/* allocate the color RAM -- half the size of the video RAM as A0 is not connected */
state->colorram = auto_alloc_array(machine, UINT8, state->videoram_size / 2);
@ -184,7 +184,7 @@ static VIDEO_START( astrof )
static rgb_t make_pen( running_machine *machine, UINT8 data )
{
astrof_state *state = (astrof_state *)machine->driver_data;
astrof_state *state = machine->driver_data<astrof_state>();
UINT8 r1_bit = state->red_on ? 0x01 : (data >> 0) & 0x01;
UINT8 r2_bit = state->red_on ? 0x01 : (data >> 1) & 0x01;
@ -205,7 +205,7 @@ static rgb_t make_pen( running_machine *machine, UINT8 data )
static void astrof_get_pens( running_machine *machine, pen_t *pens )
{
astrof_state *state = (astrof_state *)machine->driver_data;
astrof_state *state = machine->driver_data<astrof_state>();
offs_t i;
UINT8 bank = (state->astrof_palette_bank ? 0x10 : 0x00);
UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
@ -282,7 +282,7 @@ static void tomahawk_get_pens( running_machine *machine, pen_t *pens )
static WRITE8_HANDLER( astrof_videoram_w )
{
astrof_state *state = (astrof_state *)space->machine->driver_data;
astrof_state *state = space->machine->driver_data<astrof_state>();
state->videoram[offset] = data;
state->colorram[offset >> 1] = *state->astrof_color & 0x0e;
@ -291,7 +291,7 @@ static WRITE8_HANDLER( astrof_videoram_w )
static WRITE8_HANDLER( tomahawk_videoram_w )
{
astrof_state *state = (astrof_state *)space->machine->driver_data;
astrof_state *state = space->machine->driver_data<astrof_state>();
state->videoram[offset] = data;
state->colorram[offset >> 1] = (*state->astrof_color & 0x0e) | ((*state->astrof_color & 0x01) << 4);
@ -300,7 +300,7 @@ static WRITE8_HANDLER( tomahawk_videoram_w )
static WRITE8_HANDLER( video_control_1_w )
{
astrof_state *state = (astrof_state *)space->machine->driver_data;
astrof_state *state = space->machine->driver_data<astrof_state>();
state->flipscreen = ((data >> 0) & 0x01) & input_port_read(space->machine, "CAB");
@ -316,7 +316,7 @@ static WRITE8_HANDLER( video_control_1_w )
static void astrof_set_video_control_2( running_machine *machine, UINT8 data )
{
astrof_state *state = (astrof_state *)machine->driver_data;
astrof_state *state = machine->driver_data<astrof_state>();
/* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */
/* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */
@ -339,7 +339,7 @@ static WRITE8_HANDLER( astrof_video_control_2_w )
static void spfghmk2_set_video_control_2( running_machine *machine, UINT8 data )
{
astrof_state *state = (astrof_state *)machine->driver_data;
astrof_state *state = machine->driver_data<astrof_state>();
/* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */
/* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */
@ -359,7 +359,7 @@ static WRITE8_HANDLER( spfghmk2_video_control_2_w )
static void tomahawk_set_video_control_2( running_machine *machine, UINT8 data )
{
astrof_state *state = (astrof_state *)machine->driver_data;
astrof_state *state = machine->driver_data<astrof_state>();
/* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */
/* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */
@ -378,7 +378,7 @@ static WRITE8_HANDLER( tomahawk_video_control_2_w )
static void video_update_common( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, pen_t *pens )
{
astrof_state *state = (astrof_state *)machine->driver_data;
astrof_state *state = machine->driver_data<astrof_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@ -461,7 +461,7 @@ static READ8_HANDLER( shoot_r )
static READ8_HANDLER( abattle_coin_prot_r )
{
astrof_state *state = (astrof_state *)space->machine->driver_data;
astrof_state *state = space->machine->driver_data<astrof_state>();
state->abattle_count = (state->abattle_count + 1) % 0x0101;
return state->abattle_count ? 0x07 : 0x00;
@ -470,7 +470,7 @@ static READ8_HANDLER( abattle_coin_prot_r )
static READ8_HANDLER( afire_coin_prot_r )
{
astrof_state *state = (astrof_state *)space->machine->driver_data;
astrof_state *state = space->machine->driver_data<astrof_state>();
state->abattle_count = state->abattle_count ^ 0x01;
return state->abattle_count ? 0x07 : 0x00;
@ -479,7 +479,7 @@ static READ8_HANDLER( afire_coin_prot_r )
static READ8_HANDLER( tomahawk_protection_r )
{
astrof_state *state = (astrof_state *)space->machine->driver_data;
astrof_state *state = space->machine->driver_data<astrof_state>();
/* flip the byte */
return BITSWAP8(*state->tomahawk_protection, 0, 1, 2, 3, 4, 5, 6, 7);
@ -495,7 +495,7 @@ static READ8_HANDLER( tomahawk_protection_r )
static MACHINE_START( astrof )
{
astrof_state *state = (astrof_state *)machine->driver_data;
astrof_state *state = machine->driver_data<astrof_state>();
/* the 74175 outputs all HI's if not otherwise set */
astrof_set_video_control_2(machine, 0xff);
@ -518,7 +518,7 @@ static MACHINE_START( astrof )
static MACHINE_START( abattle )
{
astrof_state *state = (astrof_state *)machine->driver_data;
astrof_state *state = machine->driver_data<astrof_state>();
/* register for state saving */
state_save_register_global(machine, state->abattle_count);
@ -529,7 +529,7 @@ static MACHINE_START( abattle )
static MACHINE_START( spfghmk2 )
{
astrof_state *state = (astrof_state *)machine->driver_data;
astrof_state *state = machine->driver_data<astrof_state>();
/* the 74175 outputs all HI's if not otherwise set */
spfghmk2_set_video_control_2(machine, 0xff);
@ -548,7 +548,7 @@ static MACHINE_START( spfghmk2 )
static MACHINE_START( tomahawk )
{
astrof_state *state = (astrof_state *)machine->driver_data;
astrof_state *state = machine->driver_data<astrof_state>();
/* the 74175 outputs all HI's if not otherwise set */
tomahawk_set_video_control_2(machine, 0xff);
@ -572,7 +572,7 @@ static MACHINE_START( tomahawk )
static MACHINE_RESET( abattle )
{
astrof_state *state = (astrof_state *)machine->driver_data;
astrof_state *state = machine->driver_data<astrof_state>();
state->abattle_count = 0;
}

View File

@ -232,7 +232,7 @@ DIP locations verified for:
static TIMER_CALLBACK( cadash_interrupt5 )
{
asuka_state *state = (asuka_state *)machine->driver_data;
asuka_state *state = machine->driver_data<asuka_state>();
cpu_set_input_line(state->maincpu, 5, HOLD_LINE);
}
@ -261,7 +261,7 @@ static WRITE8_DEVICE_HANDLER( sound_bankswitch_2151_w )
static void asuka_msm5205_vck( running_device *device )
{
asuka_state *state = (asuka_state *)device->machine->driver_data;
asuka_state *state = device->machine->driver_data<asuka_state>();
if (state->adpcm_data != -1)
{
@ -278,7 +278,7 @@ static void asuka_msm5205_vck( running_device *device )
static WRITE8_HANDLER( asuka_msm5205_address_w )
{
asuka_state *state = (asuka_state *)space->machine->driver_data;
asuka_state *state = space->machine->driver_data<asuka_state>();
state->adpcm_pos = (state->adpcm_pos & 0x00ff) | (data << 8);
}
@ -289,7 +289,7 @@ static WRITE8_DEVICE_HANDLER( asuka_msm5205_start_w )
static WRITE8_DEVICE_HANDLER( asuka_msm5205_stop_w )
{
asuka_state *state = (asuka_state *)device->machine->driver_data;
asuka_state *state = device->machine->driver_data<asuka_state>();
msm5205_reset_w(device, 1);
state->adpcm_pos &= 0xff00;
}
@ -835,7 +835,7 @@ static const tc0110pcr_interface asuka_tc0110pcr_intf =
static MACHINE_START( asuka )
{
asuka_state *state = (asuka_state *)machine->driver_data;
asuka_state *state = machine->driver_data<asuka_state>();
state->maincpu = machine->device("maincpu");
state->audiocpu = machine->device("audiocpu");
@ -860,7 +860,7 @@ static MACHINE_START( asuka )
static MACHINE_RESET( asuka )
{
asuka_state *state = (asuka_state *)machine->driver_data;
asuka_state *state = machine->driver_data<asuka_state>();
state->adpcm_pos = 0;
state->adpcm_data = -1;
@ -876,7 +876,7 @@ static MACHINE_RESET( asuka )
static VIDEO_EOF( asuka )
{
asuka_state *state = (asuka_state *)machine->driver_data;
asuka_state *state = machine->driver_data<asuka_state>();
pc090oj_eof_callback(state->pc090oj);
}

View File

@ -507,7 +507,7 @@ GFXDECODE_END
static MACHINE_START( atarifb )
{
atarifb_state *state = (atarifb_state *)machine->driver_data;
atarifb_state *state = machine->driver_data<atarifb_state>();
state->maincpu = machine->device("maincpu");
@ -532,7 +532,7 @@ static MACHINE_START( atarifb )
static MACHINE_RESET( atarifb )
{
atarifb_state *state = (atarifb_state *)machine->driver_data;
atarifb_state *state = machine->driver_data<atarifb_state>();
state->CTRLD = 0;
state->sign_x_1 = 0;

View File

@ -34,15 +34,15 @@
static void update_interrupts(running_machine *machine)
{
atarig1_state *state = (atarig1_state *)machine->driver_data;
cputag_set_input_line(machine, "maincpu", 1, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->atarigen.sound_int_state ? ASSERT_LINE : CLEAR_LINE);
atarig1_state *state = machine->driver_data<atarig1_state>();
cputag_set_input_line(machine, "maincpu", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
static MACHINE_START( atarig1 )
{
atarig1_state *state = (atarig1_state *)machine->driver_data;
atarig1_state *state = machine->driver_data<atarig1_state>();
atarigen_init(machine);
state_save_register_global(machine, state->which_input);
}
@ -50,11 +50,11 @@ static MACHINE_START( atarig1 )
static MACHINE_RESET( atarig1 )
{
atarig1_state *state = (atarig1_state *)machine->driver_data;
atarig1_state *state = machine->driver_data<atarig1_state>();
atarigen_eeprom_reset(&state->atarigen);
atarigen_slapstic_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_eeprom_reset(state);
atarigen_slapstic_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
atarigen_scanline_timer_reset(*machine->primary_screen, atarig1_scanline_update, 8);
atarijsa_reset();
}
@ -76,7 +76,7 @@ static WRITE16_HANDLER( mo_control_w )
static WRITE16_HANDLER( mo_command_w )
{
atarig1_state *state = (atarig1_state *)space->machine->driver_data;
atarig1_state *state = space->machine->driver_data<atarig1_state>();
COMBINE_DATA(state->mo_command);
atarirle_command_w(0, (data == 0 && state->is_pitfight) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
}
@ -91,9 +91,9 @@ static WRITE16_HANDLER( mo_command_w )
static READ16_HANDLER( special_port0_r )
{
atarig1_state *state = (atarig1_state *)space->machine->driver_data;
atarig1_state *state = space->machine->driver_data<atarig1_state>();
int temp = input_port_read(space->machine, "IN0");
if (state->atarigen.cpu_to_sound_ready) temp ^= 0x1000;
if (state->cpu_to_sound_ready) temp ^= 0x1000;
temp ^= 0x2000; /* A2DOK always high for now */
return temp;
}
@ -101,7 +101,7 @@ static READ16_HANDLER( special_port0_r )
static WRITE16_HANDLER( a2d_select_w )
{
atarig1_state *state = (atarig1_state *)space->machine->driver_data;
atarig1_state *state = space->machine->driver_data<atarig1_state>();
state->which_input = offset;
}
@ -109,7 +109,7 @@ static WRITE16_HANDLER( a2d_select_w )
static READ16_HANDLER( a2d_data_r )
{
static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2" };
atarig1_state *state = (atarig1_state *)space->machine->driver_data;
atarig1_state *state = space->machine->driver_data<atarig1_state>();
/* Pit Fighter has no A2D, just another input port */
if (state->is_pitfight)
@ -149,7 +149,7 @@ INLINE void update_bank(atarig1_state *state, int bank)
static STATE_POSTLOAD( pitfightb_state_postload )
{
atarig1_state *state = (atarig1_state *)machine->driver_data;
atarig1_state *state = machine->driver_data<atarig1_state>();
int bank = state->bslapstic_bank;
state->bslapstic_bank = -1;
update_bank(state, bank);
@ -158,7 +158,7 @@ static STATE_POSTLOAD( pitfightb_state_postload )
static READ16_HANDLER( pitfightb_cheap_slapstic_r )
{
atarig1_state *state = (atarig1_state *)space->machine->driver_data;
atarig1_state *state = space->machine->driver_data<atarig1_state>();
int result = state->bslapstic_base[offset & 0xfff];
/* the cheap replacement slapstic just triggers on the simple banking */
@ -186,7 +186,7 @@ static READ16_HANDLER( pitfightb_cheap_slapstic_r )
static void pitfightb_cheap_slapstic_init(running_machine *machine)
{
atarig1_state *state = (atarig1_state *)machine->driver_data;
atarig1_state *state = machine->driver_data<atarig1_state>();
/* install a read handler */
state->bslapstic_base = memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x038000, 0x03ffff, 0, 0, pitfightb_cheap_slapstic_r);
@ -221,13 +221,13 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0xfc0000, 0xfc0001) AM_READ(special_port0_r)
AM_RANGE(0xfc8000, 0xfc8007) AM_READWRITE(a2d_data_r, a2d_select_w)
AM_RANGE(0xfd0000, 0xfd0001) AM_READ(atarigen_sound_upper_r)
AM_RANGE(0xfd8000, 0xfdffff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(atarig1_state, atarigen.eeprom, atarigen.eeprom_size)
AM_RANGE(0xfd8000, 0xfdffff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(atarig1_state, eeprom, eeprom_size)
/* AM_RANGE(0xfe0000, 0xfe7fff) AM_READ(from_r)*/
AM_RANGE(0xfe8000, 0xfe89ff) AM_RAM_WRITE(atarigen_666_paletteram_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0xff0000, 0xff0fff) AM_WRITE(atarirle_0_spriteram_w) AM_BASE(&atarirle_0_spriteram)
AM_RANGE(0xff2000, 0xff2001) AM_WRITE(mo_command_w) AM_BASE_MEMBER(atarig1_state, mo_command)
AM_RANGE(0xff4000, 0xff5fff) AM_WRITE(atarigen_playfield_w) AM_BASE_MEMBER(atarig1_state, atarigen.playfield)
AM_RANGE(0xff6000, 0xff6fff) AM_WRITE(atarigen_alpha_w) AM_BASE_MEMBER(atarig1_state, atarigen.alpha)
AM_RANGE(0xff4000, 0xff5fff) AM_WRITE(atarigen_playfield_w) AM_BASE_MEMBER(atarig1_state, playfield)
AM_RANGE(0xff6000, 0xff6fff) AM_WRITE(atarigen_alpha_w) AM_BASE_MEMBER(atarig1_state, alpha)
AM_RANGE(0xff0000, 0xffffff) AM_RAM
ADDRESS_MAP_END
@ -1169,9 +1169,9 @@ ROM_END
static void init_g1_common(running_machine *machine, offs_t slapstic_base, int slapstic, int is_pitfight)
{
atarig1_state *state = (atarig1_state *)machine->driver_data;
atarig1_state *state = machine->driver_data<atarig1_state>();
state->atarigen.eeprom_default = NULL;
state->eeprom_default = NULL;
if (slapstic == -1)
{
pitfightb_cheap_slapstic_init(machine);

View File

@ -33,15 +33,15 @@
static void update_interrupts(running_machine *machine)
{
atarig42_state *state = (atarig42_state *)machine->driver_data;
cputag_set_input_line(machine, "maincpu", 4, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 5, state->atarigen.sound_int_state ? ASSERT_LINE : CLEAR_LINE);
atarig42_state *state = machine->driver_data<atarig42_state>();
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 5, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
static MACHINE_START( atarig42 )
{
atarig42_state *state = (atarig42_state *)machine->driver_data;
atarig42_state *state = machine->driver_data<atarig42_state>();
atarigen_init(machine);
state_save_register_global(machine, state->analog_data);
@ -54,10 +54,10 @@ static MACHINE_START( atarig42 )
static MACHINE_RESET( atarig42 )
{
atarig42_state *state = (atarig42_state *)machine->driver_data;
atarig42_state *state = machine->driver_data<atarig42_state>();
atarigen_eeprom_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
atarigen_scanline_timer_reset(*machine->primary_screen, atarig42_scanline_update, 8);
atarijsa_reset();
}
@ -72,10 +72,10 @@ static MACHINE_RESET( atarig42 )
static READ16_HANDLER( special_port2_r )
{
atarig42_state *state = (atarig42_state *)space->machine->driver_data;
atarig42_state *state = space->machine->driver_data<atarig42_state>();
int temp = input_port_read(space->machine, "IN2");
if (state->atarigen.cpu_to_sound_ready) temp ^= 0x0020;
if (state->atarigen.sound_to_cpu_ready) temp ^= 0x0010;
if (state->cpu_to_sound_ready) temp ^= 0x0020;
if (state->sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
return temp;
}
@ -84,7 +84,7 @@ static READ16_HANDLER( special_port2_r )
static WRITE16_HANDLER( a2d_select_w )
{
static const char *const portnames[] = { "A2D0", "A2D1" };
atarig42_state *state = (atarig42_state *)space->machine->driver_data;
atarig42_state *state = space->machine->driver_data<atarig42_state>();
state->analog_data = input_port_read(space->machine, portnames[offset != 0]);
}
@ -92,7 +92,7 @@ static WRITE16_HANDLER( a2d_select_w )
static READ16_HANDLER( a2d_data_r )
{
atarig42_state *state = (atarig42_state *)space->machine->driver_data;
atarig42_state *state = space->machine->driver_data<atarig42_state>();
return state->analog_data << 8;
}
@ -125,7 +125,7 @@ static WRITE16_HANDLER( io_latch_w )
static WRITE16_HANDLER( mo_command_w )
{
atarig42_state *state = (atarig42_state *)space->machine->driver_data;
atarig42_state *state = space->machine->driver_data<atarig42_state>();
COMBINE_DATA(state->mo_command);
atarirle_command_w(0, (data == 0) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
}
@ -140,7 +140,7 @@ static WRITE16_HANDLER( mo_command_w )
static DIRECT_UPDATE_HANDLER( sloop_direct_handler )
{
atarig42_state *state = (atarig42_state *)space->machine->driver_data;
atarig42_state *state = space->machine->driver_data<atarig42_state>();
if (address < 0x80000)
{
direct->raw = direct->decrypted = (UINT8 *)state->sloop_base;
@ -264,7 +264,7 @@ static void roadriot_sloop_tweak(atarig42_state *state, int offset)
static READ16_HANDLER( roadriot_sloop_data_r )
{
atarig42_state *state = (atarig42_state *)space->machine->driver_data;
atarig42_state *state = space->machine->driver_data<atarig42_state>();
roadriot_sloop_tweak(state, offset);
if (offset < 0x78000/2)
return state->sloop_base[offset];
@ -275,7 +275,7 @@ static READ16_HANDLER( roadriot_sloop_data_r )
static WRITE16_HANDLER( roadriot_sloop_data_w )
{
atarig42_state *state = (atarig42_state *)space->machine->driver_data;
atarig42_state *state = space->machine->driver_data<atarig42_state>();
roadriot_sloop_tweak(state, offset);
}
@ -323,7 +323,7 @@ static void guardians_sloop_tweak(atarig42_state *state, int offset)
static READ16_HANDLER( guardians_sloop_data_r )
{
atarig42_state *state = (atarig42_state *)space->machine->driver_data;
atarig42_state *state = space->machine->driver_data<atarig42_state>();
guardians_sloop_tweak(state, offset);
if (offset < 0x78000/2)
return state->sloop_base[offset];
@ -334,7 +334,7 @@ static READ16_HANDLER( guardians_sloop_data_r )
static WRITE16_HANDLER( guardians_sloop_data_w )
{
atarig42_state *state = (atarig42_state *)space->machine->driver_data;
atarig42_state *state = space->machine->driver_data<atarig42_state>();
guardians_sloop_tweak(state, offset);
}
@ -363,11 +363,11 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0xf40000, 0xf40001) AM_READ(asic65_io_r)
AM_RANGE(0xf60000, 0xf60001) AM_READ(asic65_r)
AM_RANGE(0xf80000, 0xf80003) AM_WRITE(asic65_data_w)
AM_RANGE(0xfa0000, 0xfa0fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(atarig42_state, atarigen.eeprom, atarigen.eeprom_size)
AM_RANGE(0xfa0000, 0xfa0fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(atarig42_state, eeprom, eeprom_size)
AM_RANGE(0xfc0000, 0xfc0fff) AM_RAM_WRITE(atarigen_666_paletteram_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0xff0000, 0xff0fff) AM_WRITE(atarirle_0_spriteram_w) AM_BASE(&atarirle_0_spriteram)
AM_RANGE(0xff2000, 0xff5fff) AM_WRITE(atarigen_playfield_w) AM_BASE_MEMBER(atarig42_state, atarigen.playfield)
AM_RANGE(0xff6000, 0xff6fff) AM_WRITE(atarigen_alpha_w) AM_BASE_MEMBER(atarig42_state, atarigen.alpha)
AM_RANGE(0xff2000, 0xff5fff) AM_WRITE(atarigen_playfield_w) AM_BASE_MEMBER(atarig42_state, playfield)
AM_RANGE(0xff6000, 0xff6fff) AM_WRITE(atarigen_alpha_w) AM_BASE_MEMBER(atarig42_state, alpha)
AM_RANGE(0xff7000, 0xff7001) AM_WRITE(mo_command_w) AM_BASE_MEMBER(atarig42_state, mo_command)
AM_RANGE(0xff0000, 0xffffff) AM_RAM
ADDRESS_MAP_END
@ -688,8 +688,8 @@ static DRIVER_INIT( roadriot )
0x01B0,0x0146,0x012E,0x1A00,0x01C8,0x01D0,0x0118,0x0D00,
0x0118,0x0100,0x01C8,0x01D0,0x0000
};
atarig42_state *state = (atarig42_state *)machine->driver_data;
state->atarigen.eeprom_default = default_eeprom;
atarig42_state *state = machine->driver_data<atarig42_state>();
state->eeprom_default = default_eeprom;
atarijsa_init(machine, "IN2", 0x0040);
state->playfield_base = 0x400;
@ -738,8 +738,8 @@ static DRIVER_INIT( guardian )
0x01BE,0x016D,0x0142,0x0100,0x0120,0x0109,0x0110,0x0141,
0x0109,0x0100,0x0108,0x0134,0x0105,0x0148,0x1400,0x0000
};
atarig42_state *state = (atarig42_state *)machine->driver_data;
state->atarigen.eeprom_default = default_eeprom;
atarig42_state *state = machine->driver_data<atarig42_state>();
state->eeprom_default = default_eeprom;
atarijsa_init(machine, "IN2", 0x0040);
state->playfield_base = 0x000;

View File

@ -49,10 +49,10 @@ static void cage_irq_callback(running_machine *machine, int reason);
static void update_interrupts(running_machine *machine)
{
atarigt_state *state = (atarigt_state *)machine->driver_data;
cputag_set_input_line(machine, "maincpu", 3, state->atarigen.sound_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->atarigen.scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
atarigt_state *state = machine->driver_data<atarigt_state>();
cputag_set_input_line(machine, "maincpu", 3, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@ -64,10 +64,10 @@ static MACHINE_START( atarigt )
static MACHINE_RESET( atarigt )
{
atarigt_state *state = (atarigt_state *)machine->driver_data;
atarigt_state *state = machine->driver_data<atarigt_state>();
atarigen_eeprom_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
atarigen_scanline_timer_reset(*machine->primary_screen, atarigt_scanline_update, 8);
}
@ -108,10 +108,10 @@ static READ32_HANDLER( special_port2_r )
static READ32_HANDLER( special_port3_r )
{
atarigt_state *state = (atarigt_state *)space->machine->driver_data;
atarigt_state *state = space->machine->driver_data<atarigt_state>();
int temp = input_port_read(space->machine, "COIN");
if (state->atarigen.video_int_state) temp ^= 0x0001;
if (state->atarigen.scanline_int_state) temp ^= 0x0002;
if (state->video_int_state) temp ^= 0x0001;
if (state->scanline_int_state) temp ^= 0x0002;
return (temp << 16) | temp;
}
@ -211,7 +211,7 @@ static WRITE32_HANDLER( latch_w )
static WRITE32_HANDLER( mo_command_w )
{
atarigt_state *state = (atarigt_state *)space->machine->driver_data;
atarigt_state *state = space->machine->driver_data<atarigt_state>();
COMBINE_DATA(state->mo_command);
if (ACCESSING_BITS_0_15)
atarirle_command_w(0, ((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
@ -555,7 +555,7 @@ if (LOG_PROTECTION)
static READ32_HANDLER( colorram_protection_r )
{
atarigt_state *state = (atarigt_state *)space->machine->driver_data;
atarigt_state *state = space->machine->driver_data<atarigt_state>();
offs_t address = 0xd80000 + offset * 4;
UINT32 result32 = 0;
UINT16 result;
@ -579,7 +579,7 @@ static READ32_HANDLER( colorram_protection_r )
static WRITE32_HANDLER( colorram_protection_w )
{
atarigt_state *state = (atarigt_state *)space->machine->driver_data;
atarigt_state *state = space->machine->driver_data<atarigt_state>();
offs_t address = 0xd80000 + offset * 4;
if (ACCESSING_BITS_16_31)
@ -609,10 +609,10 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0xc00000, 0xc00003) AM_READWRITE(sound_data_r, sound_data_w)
AM_RANGE(0xd00014, 0xd00017) AM_READ(analog_port0_r)
AM_RANGE(0xd0001c, 0xd0001f) AM_READ(analog_port1_r)
AM_RANGE(0xd20000, 0xd20fff) AM_READWRITE(atarigen_eeprom_upper32_r, atarigen_eeprom32_w) AM_BASE_SIZE_MEMBER(atarigt_state, atarigen.eeprom, atarigen.eeprom_size)
AM_RANGE(0xd20000, 0xd20fff) AM_READWRITE(atarigen_eeprom_upper32_r, atarigen_eeprom32_w) AM_BASE_SIZE_MEMBER(atarigt_state, eeprom, eeprom_size)
AM_RANGE(0xd40000, 0xd4ffff) AM_WRITE(atarigen_eeprom_enable32_w)
AM_RANGE(0xd72000, 0xd75fff) AM_WRITE(atarigen_playfield32_w) AM_BASE_MEMBER(atarigt_state, atarigen.playfield32)
AM_RANGE(0xd76000, 0xd76fff) AM_WRITE(atarigen_alpha32_w) AM_BASE_MEMBER(atarigt_state, atarigen.alpha32)
AM_RANGE(0xd72000, 0xd75fff) AM_WRITE(atarigen_playfield32_w) AM_BASE_MEMBER(atarigt_state, playfield32)
AM_RANGE(0xd76000, 0xd76fff) AM_WRITE(atarigen_alpha32_w) AM_BASE_MEMBER(atarigt_state, alpha32)
AM_RANGE(0xd78000, 0xd78fff) AM_WRITE(atarirle_0_spriteram32_w) AM_BASE(&atarirle_0_spriteram32)
AM_RANGE(0xd7a200, 0xd7a203) AM_WRITE(mo_command_w) AM_BASE_MEMBER(atarigt_state, mo_command)
AM_RANGE(0xd70000, 0xd7ffff) AM_RAM
@ -1247,9 +1247,9 @@ static WRITE32_HANDLER( tmek_pf_w )
static DRIVER_INIT( tmek )
{
atarigt_state *state = (atarigt_state *)machine->driver_data;
atarigt_state *state = machine->driver_data<atarigt_state>();
state->atarigen.eeprom_default = NULL;
state->eeprom_default = NULL;
state->is_primrage = 0;
cage_init(machine, 0x4fad);
@ -1266,9 +1266,9 @@ static DRIVER_INIT( tmek )
static void primrage_init_common(running_machine *machine, offs_t cage_speedup)
{
atarigt_state *state = (atarigt_state *)machine->driver_data;
atarigt_state *state = machine->driver_data<atarigt_state>();
state->atarigen.eeprom_default = NULL;
state->eeprom_default = NULL;
state->is_primrage = 1;
cage_init(machine, cage_speedup);

View File

@ -35,9 +35,9 @@
static void update_interrupts(running_machine *machine)
{
atarigx2_state *state = (atarigx2_state *)machine->driver_data;
cputag_set_input_line(machine, "maincpu", 4, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 5, state->atarigen.sound_int_state ? ASSERT_LINE : CLEAR_LINE);
atarigx2_state *state = machine->driver_data<atarigx2_state>();
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 5, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@ -49,10 +49,10 @@ static MACHINE_START( atarigx2 )
static MACHINE_RESET( atarigx2 )
{
atarigx2_state *state = (atarigx2_state *)machine->driver_data;
atarigx2_state *state = machine->driver_data<atarigx2_state>();
atarigen_eeprom_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
atarigen_scanline_timer_reset(*machine->primary_screen, atarigx2_scanline_update, 8);
atarijsa_reset();
}
@ -67,10 +67,10 @@ static MACHINE_RESET( atarigx2 )
static READ32_HANDLER( special_port2_r )
{
atarigx2_state *state = (atarigx2_state *)space->machine->driver_data;
atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
int temp = input_port_read(space->machine, "SERVICE");
if (state->atarigen.cpu_to_sound_ready) temp ^= 0x0020;
if (state->atarigen.sound_to_cpu_ready) temp ^= 0x0010;
if (state->cpu_to_sound_ready) temp ^= 0x0020;
if (state->sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
return (temp << 16) | temp;
}
@ -129,7 +129,7 @@ static WRITE32_HANDLER( latch_w )
static WRITE32_HANDLER( mo_command_w )
{
atarigx2_state *state = (atarigx2_state *)space->machine->driver_data;
atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
COMBINE_DATA(state->mo_command);
if (ACCESSING_BITS_0_15)
atarirle_command_w(0, ((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
@ -146,7 +146,7 @@ static WRITE32_HANDLER( mo_command_w )
static WRITE32_HANDLER( atarigx2_protection_w )
{
atarigx2_state *state = (atarigx2_state *)space->machine->driver_data;
atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
{
int pc = cpu_get_previouspc(space->cpu);
// if (pc == 0x11cbe || pc == 0x11c30)
@ -1103,7 +1103,7 @@ static READ32_HANDLER( atarigx2_protection_r )
{ 0xffffffff, 0xffff }
};
atarigx2_state *state = (atarigx2_state *)space->machine->driver_data;
atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
UINT32 result = state->protection_base[offset];
if (offset == 0x300)
@ -1153,10 +1153,10 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0xc80000, 0xc80fff) AM_RAM
AM_RANGE(0xca0000, 0xca0fff) AM_READWRITE(atarigx2_protection_r, atarigx2_protection_w) AM_BASE_MEMBER(atarigx2_state, protection_base)
AM_RANGE(0xd00000, 0xd1ffff) AM_READ(a2d_data_r)
AM_RANGE(0xd20000, 0xd20fff) AM_READWRITE(atarigen_eeprom_upper32_r, atarigen_eeprom32_w) AM_BASE_SIZE_MEMBER(atarigx2_state, atarigen.eeprom, atarigen.eeprom_size)
AM_RANGE(0xd20000, 0xd20fff) AM_READWRITE(atarigen_eeprom_upper32_r, atarigen_eeprom32_w) AM_BASE_SIZE_MEMBER(atarigx2_state, eeprom, eeprom_size)
AM_RANGE(0xd40000, 0xd40fff) AM_RAM_WRITE(atarigen_666_paletteram32_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0xd72000, 0xd75fff) AM_WRITE(atarigen_playfield32_w) AM_BASE_MEMBER(atarigx2_state, atarigen.playfield32)
AM_RANGE(0xd76000, 0xd76fff) AM_WRITE(atarigen_alpha32_w) AM_BASE_MEMBER(atarigx2_state, atarigen.alpha32)
AM_RANGE(0xd72000, 0xd75fff) AM_WRITE(atarigen_playfield32_w) AM_BASE_MEMBER(atarigx2_state, playfield32)
AM_RANGE(0xd76000, 0xd76fff) AM_WRITE(atarigen_alpha32_w) AM_BASE_MEMBER(atarigx2_state, alpha32)
AM_RANGE(0xd78000, 0xd78fff) AM_WRITE(atarirle_0_spriteram32_w) AM_BASE(&atarirle_0_spriteram32)
AM_RANGE(0xd7a200, 0xd7a203) AM_WRITE(mo_command_w) AM_BASE_MEMBER(atarigx2_state, mo_command)
AM_RANGE(0xd70000, 0xd7ffff) AM_RAM
@ -2144,7 +2144,7 @@ ROM_END
static DRIVER_INIT( spclords )
{
atarigx2_state *state = (atarigx2_state *)machine->driver_data;
atarigx2_state *state = machine->driver_data<atarigx2_state>();
atarijsa_init(machine, "SERVICE", 0x0040);
@ -2156,7 +2156,7 @@ static DRIVER_INIT( spclords )
static DRIVER_INIT( motofren )
{
atarigx2_state *state = (atarigx2_state *)machine->driver_data;
atarigx2_state *state = machine->driver_data<atarigx2_state>();
atarijsa_init(machine, "SERVICE", 0x0040);
@ -2194,7 +2194,7 @@ static READ32_HANDLER( rrreveng_prot_r )
static DRIVER_INIT( rrreveng )
{
atarigx2_state *state = (atarigx2_state *)machine->driver_data;
atarigx2_state *state = machine->driver_data<atarigx2_state>();
atarijsa_init(machine, "SERVICE", 0x0040);

View File

@ -188,17 +188,17 @@
static void update_interrupts(running_machine *machine)
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarisy1_state *state = machine->driver_data<atarisy1_state>();
cputag_set_input_line(machine, "maincpu", 2, state->joystick_int && state->joystick_int_enable ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 3, state->atarigen.scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->atarigen.sound_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 3, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
static MACHINE_START( atarisy1 )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarisy1_state *state = machine->driver_data<atarisy1_state>();
atarigen_init(machine);
state_save_register_global(machine, state->joystick_int);
@ -209,12 +209,12 @@ static MACHINE_START( atarisy1 )
static MACHINE_RESET( atarisy1 )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarisy1_state *state = machine->driver_data<atarisy1_state>();
/* initialize the system */
atarigen_eeprom_reset(&state->atarigen);
atarigen_slapstic_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_eeprom_reset(state);
atarigen_slapstic_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
atarigen_sound_io_reset(machine->device("audiocpu"));
/* reset the joystick parameters */
@ -233,7 +233,7 @@ static MACHINE_RESET( atarisy1 )
static TIMER_DEVICE_CALLBACK( delayed_joystick_int )
{
atarisy1_state *state = (atarisy1_state *)timer.machine->driver_data;
atarisy1_state *state = timer.machine->driver_data<atarisy1_state>();
state->joystick_value = param;
state->joystick_int = 1;
atarigen_update_interrupts(timer.machine);
@ -242,7 +242,7 @@ static TIMER_DEVICE_CALLBACK( delayed_joystick_int )
static READ16_HANDLER( joystick_r )
{
atarisy1_state *state = (atarisy1_state *)space->machine->driver_data;
atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
int newval = 0xff;
static const char *const portnames[] = { "IN0", "IN1" };
@ -273,7 +273,7 @@ static READ16_HANDLER( joystick_r )
static WRITE16_HANDLER( joystick_w )
{
/* the A4 bit enables/disables joystick IRQs */
atarisy1_state *state = (atarisy1_state *)space->machine->driver_data;
atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
state->joystick_int_enable = ((offset >> 3) & 1) ^ 1;
}
@ -287,7 +287,7 @@ static WRITE16_HANDLER( joystick_w )
static READ16_HANDLER( trakball_r )
{
atarisy1_state *state = (atarisy1_state *)space->machine->driver_data;
atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
int result = 0xff;
/* Marble Madness trackball type -- rotated 45 degrees! */
@ -337,9 +337,9 @@ static READ16_HANDLER( trakball_r )
static READ16_HANDLER( port4_r )
{
atarisy1_state *state = (atarisy1_state *)space->machine->driver_data;
atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
int temp = input_port_read(space->machine, "F60000");
if (state->atarigen.cpu_to_sound_ready) temp ^= 0x0080;
if (state->cpu_to_sound_ready) temp ^= 0x0080;
return temp;
}
@ -353,11 +353,11 @@ static READ16_HANDLER( port4_r )
static READ8_HANDLER( switch_6502_r )
{
atarisy1_state *state = (atarisy1_state *)space->machine->driver_data;
atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
int temp = input_port_read(space->machine, "1820");
if (state->atarigen.cpu_to_sound_ready) temp ^= 0x08;
if (state->atarigen.sound_to_cpu_ready) temp ^= 0x10;
if (state->cpu_to_sound_ready) temp ^= 0x08;
if (state->sound_to_cpu_ready) temp ^= 0x10;
if (!(input_port_read(space->machine, "F60000") & 0x0040)) temp ^= 0x80;
return temp;
@ -453,19 +453,19 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x080000, 0x087fff) AM_ROM /* slapstic maps here */
AM_RANGE(0x2e0000, 0x2e0001) AM_READ(atarisy1_int3state_r)
AM_RANGE(0x400000, 0x401fff) AM_RAM
AM_RANGE(0x800000, 0x800001) AM_WRITE(atarisy1_xscroll_w) AM_BASE_MEMBER(atarisy1_state, atarigen.xscroll)
AM_RANGE(0x820000, 0x820001) AM_WRITE(atarisy1_yscroll_w) AM_BASE_MEMBER(atarisy1_state, atarigen.yscroll)
AM_RANGE(0x800000, 0x800001) AM_WRITE(atarisy1_xscroll_w) AM_BASE_MEMBER(atarisy1_state, xscroll)
AM_RANGE(0x820000, 0x820001) AM_WRITE(atarisy1_yscroll_w) AM_BASE_MEMBER(atarisy1_state, yscroll)
AM_RANGE(0x840000, 0x840001) AM_WRITE(atarisy1_priority_w)
AM_RANGE(0x860000, 0x860001) AM_WRITE(atarisy1_bankselect_w) AM_BASE_MEMBER(atarisy1_state, bankselect)
AM_RANGE(0x880000, 0x880001) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x8a0000, 0x8a0001) AM_WRITE(atarigen_video_int_ack_w)
AM_RANGE(0x8c0000, 0x8c0001) AM_WRITE(atarigen_eeprom_enable_w)
AM_RANGE(0x900000, 0x9fffff) AM_RAM
AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE_MEMBER(atarisy1_state, atarigen.playfield)
AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE_MEMBER(atarisy1_state, playfield)
AM_RANGE(0xa02000, 0xa02fff) AM_RAM_WRITE(atarisy1_spriteram_w) AM_BASE(&atarimo_0_spriteram)
AM_RANGE(0xa03000, 0xa03fff) AM_RAM_WRITE(atarigen_alpha_w) AM_BASE_MEMBER(atarisy1_state, atarigen.alpha)
AM_RANGE(0xa03000, 0xa03fff) AM_RAM_WRITE(atarigen_alpha_w) AM_BASE_MEMBER(atarisy1_state, alpha)
AM_RANGE(0xb00000, 0xb007ff) AM_RAM_WRITE(paletteram16_IIIIRRRRGGGGBBBB_word_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0xf00000, 0xf00fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(atarisy1_state, atarigen.eeprom, atarigen.eeprom_size)
AM_RANGE(0xf00000, 0xf00fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(atarisy1_state, eeprom, eeprom_size)
AM_RANGE(0xf20000, 0xf20007) AM_READ(trakball_r)
AM_RANGE(0xf40000, 0xf4001f) AM_READWRITE(joystick_r, joystick_w)
AM_RANGE(0xf60000, 0xf60003) AM_READ(port4_r)
@ -2325,7 +2325,7 @@ ROM_END
static DRIVER_INIT( marble )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarisy1_state *state = machine->driver_data<atarisy1_state>();
atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 103);
@ -2336,7 +2336,7 @@ static DRIVER_INIT( marble )
static DRIVER_INIT( peterpak )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarisy1_state *state = machine->driver_data<atarisy1_state>();
atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 107);
@ -2347,7 +2347,7 @@ static DRIVER_INIT( peterpak )
static DRIVER_INIT( indytemp )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarisy1_state *state = machine->driver_data<atarisy1_state>();
atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 105);
@ -2358,7 +2358,7 @@ static DRIVER_INIT( indytemp )
static DRIVER_INIT( roadrunn )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarisy1_state *state = machine->driver_data<atarisy1_state>();
atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 108);
@ -2369,7 +2369,7 @@ static DRIVER_INIT( roadrunn )
static DRIVER_INIT( roadb109 )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarisy1_state *state = machine->driver_data<atarisy1_state>();
atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 109);
@ -2380,7 +2380,7 @@ static DRIVER_INIT( roadb109 )
static DRIVER_INIT( roadb110 )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarisy1_state *state = machine->driver_data<atarisy1_state>();
atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 110);

View File

@ -157,14 +157,14 @@ static STATE_POSTLOAD( bankselect_postload );
static void update_interrupts(running_machine *machine)
{
atarisy2_state *state = (atarisy2_state *)machine->driver_data;
atarisy2_state *state = machine->driver_data<atarisy2_state>();
if (state->atarigen.video_int_state)
if (state->video_int_state)
cputag_set_input_line(machine, "maincpu", 3, ASSERT_LINE);
else
cputag_set_input_line(machine, "maincpu", 3, CLEAR_LINE);
if (state->atarigen.scanline_int_state)
if (state->scanline_int_state)
cputag_set_input_line(machine, "maincpu", 2, ASSERT_LINE);
else
cputag_set_input_line(machine, "maincpu", 2, CLEAR_LINE);
@ -190,7 +190,7 @@ static void update_interrupts(running_machine *machine)
static void scanline_update(screen_device &screen, int scanline)
{
atarisy2_state *state = (atarisy2_state *)screen.machine->driver_data;
atarisy2_state *state = screen.machine->driver_data<atarisy2_state>();
if (scanline <= screen.height())
{
/* generate the 32V interrupt (IRQ 2) */
@ -210,7 +210,7 @@ static void scanline_update(screen_device &screen, int scanline)
static DIRECT_UPDATE_HANDLER( atarisy2_direct_handler )
{
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
/* make sure slapstic area looks like ROM */
if (address >= 0x8000 && address < 0x8200)
@ -224,7 +224,7 @@ static DIRECT_UPDATE_HANDLER( atarisy2_direct_handler )
static MACHINE_START( atarisy2 )
{
atarisy2_state *state = (atarisy2_state *)machine->driver_data;
atarisy2_state *state = machine->driver_data<atarisy2_state>();
atarigen_init(machine);
state_save_register_global(machine, state->interrupt_enable);
@ -238,11 +238,11 @@ static MACHINE_START( atarisy2 )
static MACHINE_RESET( atarisy2 )
{
atarisy2_state *state = (atarisy2_state *)machine->driver_data;
atarisy2_state *state = machine->driver_data<atarisy2_state>();
atarigen_eeprom_reset(&state->atarigen);
atarigen_eeprom_reset(state);
slapstic_reset();
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_interrupt_reset(state, update_interrupts);
atarigen_sound_io_reset(machine->device("soundcpu"));
atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 64);
memory_set_direct_update_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), atarisy2_direct_handler);
@ -263,7 +263,7 @@ static MACHINE_RESET( atarisy2 )
static INTERRUPT_GEN( vblank_int )
{
atarisy2_state *state = (atarisy2_state *)device->machine->driver_data;
atarisy2_state *state = device->machine->driver_data<atarisy2_state>();
/* clock the VBLANK through */
if (state->interrupt_enable & 8)
@ -274,7 +274,7 @@ static INTERRUPT_GEN( vblank_int )
static WRITE16_HANDLER( int0_ack_w )
{
/* reset sound IRQ */
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
state->p2portrd_state = 0;
atarigen_update_interrupts(space->machine);
}
@ -290,7 +290,7 @@ static WRITE16_HANDLER( int1_ack_w )
static TIMER_CALLBACK( delayed_int_enable_w )
{
atarisy2_state *state = (atarisy2_state *)machine->driver_data;
atarisy2_state *state = machine->driver_data<atarisy2_state>();
state->interrupt_enable = param;
}
@ -331,7 +331,7 @@ static WRITE16_HANDLER( bankselect_w )
0x8e000, 0x86000, 0x7e000, 0x76000
};
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
int newword = state->bankselect[offset];
UINT8 *base;
@ -346,7 +346,7 @@ static WRITE16_HANDLER( bankselect_w )
static STATE_POSTLOAD( bankselect_postload )
{
const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
atarisy2_state *state = (atarisy2_state *)machine->driver_data;
atarisy2_state *state = machine->driver_data<atarisy2_state>();
bankselect_w(space, 0, state->bankselect[0], 0xffff);
bankselect_w(space, 1, state->bankselect[1], 0xffff);
@ -362,11 +362,11 @@ static STATE_POSTLOAD( bankselect_postload )
static READ16_HANDLER( switch_r )
{
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
int result = input_port_read(space->machine, "1800") | (input_port_read(space->machine, "1801") << 8);
if (state->atarigen.cpu_to_sound_ready) result ^= 0x20;
if (state->atarigen.sound_to_cpu_ready) result ^= 0x10;
if (state->cpu_to_sound_ready) result ^= 0x20;
if (state->sound_to_cpu_ready) result ^= 0x10;
return result;
}
@ -374,11 +374,11 @@ static READ16_HANDLER( switch_r )
static READ8_HANDLER( switch_6502_r )
{
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
int result = input_port_read(space->machine, "1840");
if (state->atarigen.cpu_to_sound_ready) result |= 0x01;
if (state->atarigen.sound_to_cpu_ready) result |= 0x02;
if (state->cpu_to_sound_ready) result |= 0x01;
if (state->sound_to_cpu_ready) result |= 0x02;
if ((state->has_tms5220) && (tms5220_readyq_r(space->machine->device("tms")) == 0))
result &= ~0x04;
if (!(input_port_read(space->machine, "1801") & 0x80)) result |= 0x10;
@ -389,7 +389,7 @@ static READ8_HANDLER( switch_6502_r )
static WRITE8_HANDLER( switch_6502_w )
{
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
if (state->has_tms5220)
{
@ -408,7 +408,7 @@ static WRITE8_HANDLER( switch_6502_w )
static WRITE16_HANDLER( adc_strobe_w )
{
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
state->which_adc = offset & 3;
}
@ -416,7 +416,7 @@ static WRITE16_HANDLER( adc_strobe_w )
static READ16_HANDLER( adc_r )
{
static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
if (state->which_adc < state->pedal_count)
return ~input_port_read(space->machine, adcnames[state->which_adc]);
@ -428,7 +428,7 @@ static READ16_HANDLER( adc_r )
static READ8_HANDLER( leta_r )
{
static const char *const letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" };
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
if (state->pedal_count == -1) /* 720 */
{
@ -611,7 +611,7 @@ static WRITE8_HANDLER( mixer_w )
static WRITE8_HANDLER( sound_reset_w )
{
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
/* if no change, do nothing */
if ((data & 1) == state->sound_reset_state)
@ -635,7 +635,7 @@ static WRITE8_HANDLER( sound_reset_w )
static READ16_HANDLER( sound_r )
{
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
/* clear the p2portwr state on a p1portrd */
state->p2portwr_state = 0;
@ -648,7 +648,7 @@ static READ16_HANDLER( sound_r )
static WRITE8_HANDLER( sound_6502_w )
{
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
/* clock the state through */
state->p2portwr_state = (state->interrupt_enable & 2) != 0;
@ -661,7 +661,7 @@ static WRITE8_HANDLER( sound_6502_w )
static READ8_HANDLER( sound_6502_r )
{
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
/* clock the state through */
state->p2portrd_state = (state->interrupt_enable & 1) != 0;
@ -681,7 +681,7 @@ static READ8_HANDLER( sound_6502_r )
static WRITE8_HANDLER( tms5220_w )
{
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
if (state->has_tms5220)
{
tms5220_data_w(space->machine->device("tms"), 0, data);
@ -690,7 +690,7 @@ static WRITE8_HANDLER( tms5220_w )
static WRITE8_HANDLER( tms5220_strobe_w )
{
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
if (state->has_tms5220)
{
tms5220_wsq_w(space->machine->device("tms"), 1-(offset & 1));
@ -729,8 +729,8 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x15e0, 0x15e1) AM_MIRROR(0x001e) AM_WRITE(atarigen_video_int_ack_w)
AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x007e) AM_WRITE(int_enable_w)
AM_RANGE(0x1680, 0x1681) AM_MIRROR(0x007e) AM_WRITE(atarigen_sound_w)
AM_RANGE(0x1700, 0x1701) AM_MIRROR(0x007e) AM_WRITE(atarisy2_xscroll_w) AM_BASE_MEMBER(atarisy2_state, atarigen.xscroll)
AM_RANGE(0x1780, 0x1781) AM_MIRROR(0x007e) AM_WRITE(atarisy2_yscroll_w) AM_BASE_MEMBER(atarisy2_state, atarigen.yscroll)
AM_RANGE(0x1700, 0x1701) AM_MIRROR(0x007e) AM_WRITE(atarisy2_xscroll_w) AM_BASE_MEMBER(atarisy2_state, xscroll)
AM_RANGE(0x1780, 0x1781) AM_MIRROR(0x007e) AM_WRITE(atarisy2_yscroll_w) AM_BASE_MEMBER(atarisy2_state, yscroll)
AM_RANGE(0x1800, 0x1801) AM_MIRROR(0x03fe) AM_READWRITE(switch_r, watchdog_reset16_w)
AM_RANGE(0x1c00, 0x1c01) AM_MIRROR(0x03fe) AM_READ(sound_r)
AM_RANGE(0x2000, 0x3fff) AM_READWRITE(atarisy2_videoram_r, atarisy2_videoram_w)
@ -751,7 +751,7 @@ ADDRESS_MAP_END
/* full memory map derived from schematics */
static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x0fff) AM_MIRROR(0x2000) AM_RAM
AM_RANGE(0x1000, 0x17ff) AM_MIRROR(0x2000) AM_RAM AM_BASE_SIZE_MEMBER(atarisy2_state, atarigen.eeprom, atarigen.eeprom_size)
AM_RANGE(0x1000, 0x17ff) AM_MIRROR(0x2000) AM_RAM AM_BASE_SIZE_MEMBER(atarisy2_state, eeprom, eeprom_size)
AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x2780) AM_DEVREADWRITE("pokey1", pokey_r, pokey_w)
AM_RANGE(0x1810, 0x1813) AM_MIRROR(0x278c) AM_READ(leta_r)
AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x2780) AM_DEVREADWRITE("pokey2", pokey_r, pokey_w)
@ -3037,10 +3037,10 @@ static DRIVER_INIT( paperboy )
0x0000
};
int i;
atarisy2_state *state = (atarisy2_state *)machine->driver_data;
atarisy2_state *state = machine->driver_data<atarisy2_state>();
UINT8 *cpu1 = memory_region(machine, "maincpu");
state->atarigen.eeprom_default = compressed_default_eeprom;
state->eeprom_default = compressed_default_eeprom;
slapstic_init(machine, 105);
/* expand the 16k program ROMs into full 64k chunks */
@ -3088,8 +3088,8 @@ static DRIVER_INIT( 720 )
0x0152,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0x06ff,
0x0000
};
atarisy2_state *state = (atarisy2_state *)machine->driver_data;
state->atarigen.eeprom_default = compressed_default_eeprom;
atarisy2_state *state = machine->driver_data<atarisy2_state>();
state->eeprom_default = compressed_default_eeprom;
slapstic_init(machine, 107);
state->pedal_count = -1;
@ -3100,11 +3100,11 @@ static DRIVER_INIT( 720 )
static void ssprint_init_common(running_machine *machine, const UINT16 *default_eeprom)
{
atarisy2_state *state = (atarisy2_state *)machine->driver_data;
atarisy2_state *state = machine->driver_data<atarisy2_state>();
int i;
UINT8 *cpu1 = memory_region(machine, "maincpu");
state->atarigen.eeprom_default = default_eeprom;
state->eeprom_default = default_eeprom;
slapstic_init(machine, 108);
/* expand the 32k program ROMs into full 64k chunks */
@ -3226,10 +3226,10 @@ static DRIVER_INIT( csprint )
0x0186,0x0100,0x011B,0x01BC,0x011D,0x011F,0x0000
};
int i;
atarisy2_state *state = (atarisy2_state *)machine->driver_data;
atarisy2_state *state = machine->driver_data<atarisy2_state>();
UINT8 *cpu1 = memory_region(machine, "maincpu");
state->atarigen.eeprom_default = compressed_default_eeprom;
state->eeprom_default = compressed_default_eeprom;
slapstic_init(machine, 109);
/* expand the 32k program ROMs into full 64k chunks */
@ -3243,9 +3243,9 @@ static DRIVER_INIT( csprint )
static DRIVER_INIT( apb )
{
atarisy2_state *state = (atarisy2_state *)machine->driver_data;
atarisy2_state *state = machine->driver_data<atarisy2_state>();
state->atarigen.eeprom_default = NULL;
state->eeprom_default = NULL;
slapstic_init(machine, 110);
state->pedal_count = 2;

View File

@ -46,13 +46,14 @@ LOIPOIO-B
#include "sound/mos6560.h"
class attckufo_state
class attckufo_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, attckufo_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, attckufo_state(machine)); }
attckufo_state(running_machine &machine)
: maincpu(machine.device<cpu_device>("maincpu")),
: driver_data_t(machine),
maincpu(machine.device<cpu_device>("maincpu")),
mos6560(machine.device("mos6560")) { }
/* memory pointers */
@ -157,26 +158,26 @@ INPUT_PORTS_END
static INTERRUPT_GEN( attckufo_raster_interrupt )
{
attckufo_state *state = (attckufo_state *)device->machine->driver_data;
attckufo_state *state = device->machine->driver_data<attckufo_state>();
mos6560_raster_interrupt_gen(state->mos6560);
}
static VIDEO_UPDATE( attckufo )
{
attckufo_state *state = (attckufo_state *)screen->machine->driver_data;
attckufo_state *state = screen->machine->driver_data<attckufo_state>();
mos6560_video_update(state->mos6560, bitmap, cliprect);
return 0;
}
static int attckufo_dma_read( running_machine *machine, int offset )
{
attckufo_state *state = (attckufo_state *)machine->driver_data;
attckufo_state *state = machine->driver_data<attckufo_state>();
return memory_read_byte(state->maincpu->space(AS_PROGRAM), offset);
}
static int attckufo_dma_read_color( running_machine *machine, int offset )
{
attckufo_state *state = (attckufo_state *)machine->driver_data;
attckufo_state *state = machine->driver_data<attckufo_state>();
return memory_read_byte(state->maincpu->space(AS_PROGRAM), offset + 0x400);
}

View File

@ -60,7 +60,7 @@ static INTERRUPT_GEN( avalnche_interrupt )
static VIDEO_UPDATE( avalnche )
{
avalnche_state *state = (avalnche_state *)screen->machine->driver_data;
avalnche_state *state = screen->machine->driver_data<avalnche_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@ -93,7 +93,7 @@ static VIDEO_UPDATE( avalnche )
static WRITE8_HANDLER( avalance_video_invert_w )
{
avalnche_state *state = (avalnche_state *)space->machine->driver_data;
avalnche_state *state = space->machine->driver_data<avalnche_state>();
state->avalance_video_inverted = data & 0x01;
}
@ -218,14 +218,14 @@ INPUT_PORTS_END
static MACHINE_START( avalnche )
{
avalnche_state *state = (avalnche_state *)machine->driver_data;
avalnche_state *state = machine->driver_data<avalnche_state>();
state_save_register_global(machine, state->avalance_video_inverted);
}
static MACHINE_RESET( avalnche )
{
avalnche_state *state = (avalnche_state *)machine->driver_data;
avalnche_state *state = machine->driver_data<avalnche_state>();
state->avalance_video_inverted = 0;
}

View File

@ -20,12 +20,13 @@
#include "video/deco16ic.h"
#include "rendlay.h"
class backfire_state
class backfire_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, backfire_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, backfire_state(machine)); }
backfire_state(running_machine &machine) { }
backfire_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */
UINT16 * pf1_rowscroll;
@ -55,7 +56,7 @@ public:
/* I'm using the functions in deco16ic.c ... same chips, why duplicate code? */
static VIDEO_START( backfire )
{
backfire_state *state = (backfire_state *)machine->driver_data;
backfire_state *state = machine->driver_data<backfire_state>();
/* allocate the ram as 16-bit (we do it here because the CPU is 32-bit) */
state->pf1_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2);
@ -160,7 +161,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static VIDEO_UPDATE( backfire )
{
backfire_state *state = (backfire_state *)screen->machine->driver_data;
backfire_state *state = screen->machine->driver_data<backfire_state>();
/* screen 1 uses pf1 as the forground and pf3 as the background */
/* screen 2 uses pf2 as the foreground and pf4 as the background */
@ -224,7 +225,7 @@ static READ32_DEVICE_HANDLER( backfire_eeprom_r )
static READ32_HANDLER( backfire_control2_r )
{
backfire_state *state = (backfire_state *)space->machine->driver_data;
backfire_state *state = space->machine->driver_data<backfire_state>();
// logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(space->cpu), offset << 1, mem_mask);
return (eeprom_read_bit(state->eeprom) << 24) | input_port_read(space->machine, "IN1") | (input_port_read(space->machine, "IN1") << 16);
@ -233,7 +234,7 @@ static READ32_HANDLER( backfire_control2_r )
#ifdef UNUSED_FUNCTION
static READ32_HANDLER(backfire_control3_r)
{
backfire_state *state = (backfire_state *)space->machine->driver_data;
backfire_state *state = space->machine->driver_data<backfire_state>();
// logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(space->cpu), offset << 1, mem_mask);
return (eeprom_read_bit(state->eeprom) << 24) | input_port_read(space->machine, "IN2") | (input_port_read(space->machine, "IN2") << 16);
@ -261,14 +262,14 @@ static WRITE32_HANDLER(backfire_nonbuffered_palette_w)
/* map 32-bit writes to 16-bit */
static READ32_HANDLER( backfire_pf1_rowscroll_r ) { backfire_state *state = (backfire_state *)space->machine->driver_data; return state->pf1_rowscroll[offset] ^ 0xffff0000; }
static READ32_HANDLER( backfire_pf2_rowscroll_r ) { backfire_state *state = (backfire_state *)space->machine->driver_data; return state->pf2_rowscroll[offset] ^ 0xffff0000; }
static READ32_HANDLER( backfire_pf3_rowscroll_r ) { backfire_state *state = (backfire_state *)space->machine->driver_data; return state->pf3_rowscroll[offset] ^ 0xffff0000; }
static READ32_HANDLER( backfire_pf4_rowscroll_r ) { backfire_state *state = (backfire_state *)space->machine->driver_data; return state->pf4_rowscroll[offset] ^ 0xffff0000; }
static WRITE32_HANDLER( backfire_pf1_rowscroll_w ) { backfire_state *state = (backfire_state *)space->machine->driver_data; data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
static WRITE32_HANDLER( backfire_pf2_rowscroll_w ) { backfire_state *state = (backfire_state *)space->machine->driver_data; data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
static WRITE32_HANDLER( backfire_pf3_rowscroll_w ) { backfire_state *state = (backfire_state *)space->machine->driver_data; data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); }
static WRITE32_HANDLER( backfire_pf4_rowscroll_w ) { backfire_state *state = (backfire_state *)space->machine->driver_data; data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); }
static READ32_HANDLER( backfire_pf1_rowscroll_r ) { backfire_state *state = space->machine->driver_data<backfire_state>(); return state->pf1_rowscroll[offset] ^ 0xffff0000; }
static READ32_HANDLER( backfire_pf2_rowscroll_r ) { backfire_state *state = space->machine->driver_data<backfire_state>(); return state->pf2_rowscroll[offset] ^ 0xffff0000; }
static READ32_HANDLER( backfire_pf3_rowscroll_r ) { backfire_state *state = space->machine->driver_data<backfire_state>(); return state->pf3_rowscroll[offset] ^ 0xffff0000; }
static READ32_HANDLER( backfire_pf4_rowscroll_r ) { backfire_state *state = space->machine->driver_data<backfire_state>(); return state->pf4_rowscroll[offset] ^ 0xffff0000; }
static WRITE32_HANDLER( backfire_pf1_rowscroll_w ) { backfire_state *state = space->machine->driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
static WRITE32_HANDLER( backfire_pf2_rowscroll_w ) { backfire_state *state = space->machine->driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
static WRITE32_HANDLER( backfire_pf3_rowscroll_w ) { backfire_state *state = space->machine->driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); }
static WRITE32_HANDLER( backfire_pf4_rowscroll_w ) { backfire_state *state = space->machine->driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); }
#ifdef UNUSED_FUNCTION
@ -469,7 +470,7 @@ static const deco16ic_interface backfire_deco16ic_intf =
static MACHINE_START( backfire )
{
backfire_state *state = (backfire_state *)machine->driver_data;
backfire_state *state = machine->driver_data<backfire_state>();
state->maincpu = machine->device("maincpu");
state->deco16ic = machine->device("deco_custom");
@ -675,7 +676,7 @@ static void descramble_sound( running_machine *machine )
static READ32_HANDLER( backfire_speedup_r )
{
backfire_state *state = (backfire_state *)space->machine->driver_data;
backfire_state *state = space->machine->driver_data<backfire_state>();
//mame_printf_debug( "%08x\n",cpu_get_pc(space->cpu));

View File

@ -178,9 +178,9 @@ Measurements -
static void update_interrupts(running_machine *machine)
{
badlands_state *state = (badlands_state *)machine->driver_data;
cputag_set_input_line(machine, "maincpu", 1, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->atarigen.sound_int_state ? ASSERT_LINE : CLEAR_LINE);
badlands_state *state = machine->driver_data<badlands_state>();
cputag_set_input_line(machine, "maincpu", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@ -198,7 +198,7 @@ static void scanline_update(screen_device &screen, int scanline)
static MACHINE_START( badlands )
{
badlands_state *state = (badlands_state *)machine->driver_data;
badlands_state *state = machine->driver_data<badlands_state>();
atarigen_init(machine);
@ -208,12 +208,12 @@ static MACHINE_START( badlands )
static MACHINE_RESET( badlands )
{
badlands_state *state = (badlands_state *)machine->driver_data;
badlands_state *state = machine->driver_data<badlands_state>();
state->pedal_value[0] = state->pedal_value[1] = 0x80;
atarigen_eeprom_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
atarigen_sound_io_reset(machine->device("audiocpu"));
@ -230,7 +230,7 @@ static MACHINE_RESET( badlands )
static INTERRUPT_GEN( vblank_int )
{
badlands_state *state = (badlands_state *)device->machine->driver_data;
badlands_state *state = device->machine->driver_data<badlands_state>();
int pedal_state = input_port_read(device->machine, "PEDALS");
int i;
@ -255,23 +255,23 @@ static INTERRUPT_GEN( vblank_int )
static READ16_HANDLER( sound_busy_r )
{
badlands_state *state = (badlands_state *)space->machine->driver_data;
badlands_state *state = space->machine->driver_data<badlands_state>();
int temp = 0xfeff;
if (state->atarigen.cpu_to_sound_ready) temp ^= 0x0100;
if (state->cpu_to_sound_ready) temp ^= 0x0100;
return temp;
}
static READ16_HANDLER( pedal_0_r )
{
badlands_state *state = (badlands_state *)space->machine->driver_data;
badlands_state *state = space->machine->driver_data<badlands_state>();
return state->pedal_value[0];
}
static READ16_HANDLER( pedal_1_r )
{
badlands_state *state = (badlands_state *)space->machine->driver_data;
badlands_state *state = space->machine->driver_data<badlands_state>();
return state->pedal_value[1];
}
@ -285,7 +285,7 @@ static READ16_HANDLER( pedal_1_r )
static READ8_HANDLER( audio_io_r )
{
badlands_state *state = (badlands_state *)space->machine->driver_data;
badlands_state *state = space->machine->driver_data<badlands_state>();
int result = 0xff;
switch (offset & 0x206)
@ -311,8 +311,8 @@ static READ8_HANDLER( audio_io_r )
*/
result = input_port_read(space->machine, "AUDIO");
if (!(input_port_read(space->machine, "FE4000") & 0x0080)) result ^= 0x90;
if (state->atarigen.cpu_to_sound_ready) result ^= 0x40;
if (state->atarigen.sound_to_cpu_ready) result ^= 0x20;
if (state->cpu_to_sound_ready) result ^= 0x40;
if (state->sound_to_cpu_ready) result ^= 0x20;
result ^= 0x10;
break;
@ -334,7 +334,7 @@ static READ8_HANDLER( audio_io_r )
static WRITE8_HANDLER( audio_io_w )
{
badlands_state *state = (badlands_state *)space->machine->driver_data;
badlands_state *state = space->machine->driver_data<badlands_state>();
switch (offset & 0x206)
{
@ -384,7 +384,7 @@ static WRITE8_HANDLER( audio_io_w )
static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0xfc0000, 0xfc1fff) AM_READWRITE(sound_busy_r, atarigen_sound_reset_w)
AM_RANGE(0xfd0000, 0xfd1fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(badlands_state, atarigen.eeprom, atarigen.eeprom_size)
AM_RANGE(0xfd0000, 0xfd1fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(badlands_state, eeprom, eeprom_size)
AM_RANGE(0xfe0000, 0xfe1fff) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0xfe2000, 0xfe3fff) AM_WRITE(atarigen_video_int_ack_w)
AM_RANGE(0xfe4000, 0xfe5fff) AM_READ_PORT("FE4000")
@ -397,7 +397,7 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0xfec000, 0xfedfff) AM_WRITE(badlands_pf_bank_w)
AM_RANGE(0xfee000, 0xfeffff) AM_WRITE(atarigen_eeprom_enable_w)
AM_RANGE(0xffc000, 0xffc3ff) AM_RAM_WRITE(atarigen_expanded_666_paletteram_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE_MEMBER(badlands_state, atarigen.playfield)
AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE_MEMBER(badlands_state, playfield)
AM_RANGE(0xfff000, 0xfff1ff) AM_RAM_WRITE(atarimo_0_spriteram_expanded_w) AM_BASE(&atarimo_0_spriteram)
AM_RANGE(0xfff200, 0xffffff) AM_RAM
ADDRESS_MAP_END
@ -589,7 +589,7 @@ ROM_END
static DRIVER_INIT( badlands )
{
badlands_state *state = (badlands_state *)machine->driver_data;
badlands_state *state = machine->driver_data<badlands_state>();
/* initialize the audio system */
state->bank_base = &memory_region(machine, "audiocpu")[0x03000];
@ -653,14 +653,14 @@ static ADDRESS_MAP_START( bootleg_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0xfe4006, 0xfe4007) AM_READ(badlandsb_unk_r )
AM_RANGE(0xfd0000, 0xfd1fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(badlands_state, atarigen.eeprom, atarigen.eeprom_size)
AM_RANGE(0xfd0000, 0xfd1fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(badlands_state, eeprom, eeprom_size)
//AM_RANGE(0xfe0000, 0xfe1fff) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0xfe2000, 0xfe3fff) AM_WRITE(atarigen_video_int_ack_w)
AM_RANGE(0xfec000, 0xfedfff) AM_WRITE(badlands_pf_bank_w)
AM_RANGE(0xfee000, 0xfeffff) AM_WRITE(atarigen_eeprom_enable_w)
AM_RANGE(0xffc000, 0xffc3ff) AM_RAM_WRITE(atarigen_expanded_666_paletteram_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE_MEMBER(badlands_state, atarigen.playfield)
AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE_MEMBER(badlands_state, playfield)
AM_RANGE(0xfff000, 0xfff1ff) AM_RAM_WRITE(atarimo_0_spriteram_expanded_w) AM_BASE(&atarimo_0_spriteram)
AM_RANGE(0xfff200, 0xffffff) AM_RAM
ADDRESS_MAP_END
@ -684,8 +684,8 @@ GFXDECODE_END
static void update_interrupts_bootleg(running_machine *machine)
{
badlands_state *state = (badlands_state *)machine->driver_data;
cputag_set_input_line(machine, "maincpu", 1, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
badlands_state *state = machine->driver_data<badlands_state>();
cputag_set_input_line(machine, "maincpu", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@ -702,11 +702,11 @@ static void scanline_update_bootleg(screen_device &screen, int scanline)
static MACHINE_RESET( badlandsb )
{
badlands_state *state = (badlands_state *)machine->driver_data;
badlands_state *state = machine->driver_data<badlands_state>();
// state->pedal_value[0] = state->pedal_value[1] = 0x80;
atarigen_eeprom_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts_bootleg);
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts_bootleg);
atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update_bootleg, 32);
// atarigen_sound_io_reset(machine->device("audiocpu"));

View File

@ -2107,7 +2107,7 @@ static void expand_roms(running_machine *machine, UINT8 cd_rom_mask)
INLINE void config_shooter_adc(running_machine *machine, UINT8 shooter, UINT8 adc_shift)
{
balsente_state *state = (balsente_state *)machine->driver_data;
balsente_state *state = machine->driver_data<balsente_state>();
state->shooter = shooter;
state->adc_shift = adc_shift;
}

View File

@ -261,7 +261,7 @@ GFXDECODE_END
static MACHINE_RESET( bankp )
{
bankp_state *state = (bankp_state *)machine->driver_data;
bankp_state *state = machine->driver_data<bankp_state>();
state->scroll_x = 0;
state->priority = 0;

View File

@ -32,15 +32,15 @@
static void update_interrupts(running_machine *machine)
{
batman_state *state = (batman_state *)machine->driver_data;
cputag_set_input_line(machine, "maincpu", 4, state->atarigen.scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->atarigen.sound_int_state ? ASSERT_LINE : CLEAR_LINE);
batman_state *state = machine->driver_data<batman_state>();
cputag_set_input_line(machine, "maincpu", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
static MACHINE_START( batman )
{
batman_state *state = (batman_state *)machine->driver_data;
batman_state *state = machine->driver_data<batman_state>();
atarigen_init(machine);
state_save_register_global(machine, state->latch_data);
@ -50,11 +50,11 @@ static MACHINE_START( batman )
static MACHINE_RESET( batman )
{
batman_state *state = (batman_state *)machine->driver_data;
batman_state *state = machine->driver_data<batman_state>();
atarigen_eeprom_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarivc_reset(*machine->primary_screen, state->atarigen.atarivc_eof_data, 2);
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
atarivc_reset(*machine->primary_screen, state->atarivc_eof_data, 2);
atarigen_scanline_timer_reset(*machine->primary_screen, batman_scanline_update, 8);
atarijsa_reset();
}
@ -88,17 +88,17 @@ static WRITE16_HANDLER( batman_atarivc_w )
static READ16_HANDLER( special_port2_r )
{
batman_state *state = (batman_state *)space->machine->driver_data;
batman_state *state = space->machine->driver_data<batman_state>();
int result = input_port_read(space->machine, "260010");
if (state->atarigen.sound_to_cpu_ready) result ^= 0x0010;
if (state->atarigen.cpu_to_sound_ready) result ^= 0x0020;
if (state->sound_to_cpu_ready) result ^= 0x0010;
if (state->cpu_to_sound_ready) result ^= 0x0020;
return result;
}
static WRITE16_HANDLER( latch_w )
{
batman_state *state = (batman_state *)space->machine->driver_data;
batman_state *state = space->machine->driver_data<batman_state>();
int oldword = state->latch_data;
COMBINE_DATA(&state->latch_data);
@ -112,7 +112,7 @@ static WRITE16_HANDLER( latch_w )
if ((oldword ^ state->latch_data) & 0x7000)
{
space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
tilemap_mark_all_tiles_dirty(state->atarigen.alpha_tilemap);
tilemap_mark_all_tiles_dirty(state->alpha_tilemap);
state->alpha_tile_bank = (state->latch_data >> 12) & 7;
}
}
@ -133,7 +133,7 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
ADDRESS_MAP_GLOBAL_MASK(0x3fffff)
AM_RANGE(0x000000, 0x0bffff) AM_ROM
AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x010000) AM_RAM
AM_RANGE(0x120000, 0x120fff) AM_MIRROR(0x01f000) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(batman_state, atarigen.eeprom, atarigen.eeprom_size)
AM_RANGE(0x120000, 0x120fff) AM_MIRROR(0x01f000) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(batman_state, eeprom, eeprom_size)
AM_RANGE(0x260000, 0x260001) AM_MIRROR(0x11ff8c) AM_READ_PORT("260000")
AM_RANGE(0x260002, 0x260003) AM_MIRROR(0x11ff8c) AM_READ_PORT("260002")
AM_RANGE(0x260010, 0x260011) AM_MIRROR(0x11ff8e) AM_READ(special_port2_r)
@ -143,13 +143,13 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x260060, 0x260061) AM_MIRROR(0x11ff8e) AM_WRITE(atarigen_eeprom_enable_w)
AM_RANGE(0x2a0000, 0x2a0001) AM_MIRROR(0x11fffe) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x3e0000, 0x3e0fff) AM_MIRROR(0x100000) AM_RAM_WRITE(atarigen_666_paletteram_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0x3effc0, 0x3effff) AM_MIRROR(0x100000) AM_READWRITE(batman_atarivc_r, batman_atarivc_w) AM_BASE_MEMBER(batman_state, atarigen.atarivc_data)
AM_RANGE(0x3f0000, 0x3f1fff) AM_MIRROR(0x100000) AM_WRITE(atarigen_playfield2_latched_msb_w) AM_BASE_MEMBER(batman_state, atarigen.playfield2)
AM_RANGE(0x3f2000, 0x3f3fff) AM_MIRROR(0x100000) AM_WRITE(atarigen_playfield_latched_lsb_w) AM_BASE_MEMBER(batman_state, atarigen.playfield)
AM_RANGE(0x3f4000, 0x3f5fff) AM_MIRROR(0x100000) AM_WRITE(atarigen_playfield_dual_upper_w) AM_BASE_MEMBER(batman_state, atarigen.playfield_upper)
AM_RANGE(0x3effc0, 0x3effff) AM_MIRROR(0x100000) AM_READWRITE(batman_atarivc_r, batman_atarivc_w) AM_BASE_MEMBER(batman_state, atarivc_data)
AM_RANGE(0x3f0000, 0x3f1fff) AM_MIRROR(0x100000) AM_WRITE(atarigen_playfield2_latched_msb_w) AM_BASE_MEMBER(batman_state, playfield2)
AM_RANGE(0x3f2000, 0x3f3fff) AM_MIRROR(0x100000) AM_WRITE(atarigen_playfield_latched_lsb_w) AM_BASE_MEMBER(batman_state, playfield)
AM_RANGE(0x3f4000, 0x3f5fff) AM_MIRROR(0x100000) AM_WRITE(atarigen_playfield_dual_upper_w) AM_BASE_MEMBER(batman_state, playfield_upper)
AM_RANGE(0x3f6000, 0x3f7fff) AM_MIRROR(0x100000) AM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram)
AM_RANGE(0x3f8000, 0x3f8fef) AM_MIRROR(0x100000) AM_WRITE(atarigen_alpha_w) AM_BASE_MEMBER(batman_state, atarigen.alpha)
AM_RANGE(0x3f8f00, 0x3f8f7f) AM_MIRROR(0x100000) AM_BASE_MEMBER(batman_state, atarigen.atarivc_eof_data)
AM_RANGE(0x3f8000, 0x3f8fef) AM_MIRROR(0x100000) AM_WRITE(atarigen_alpha_w) AM_BASE_MEMBER(batman_state, alpha)
AM_RANGE(0x3f8f00, 0x3f8f7f) AM_MIRROR(0x100000) AM_BASE_MEMBER(batman_state, atarivc_eof_data)
AM_RANGE(0x3f8f80, 0x3f8fff) AM_MIRROR(0x100000) AM_WRITE(atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram)
AM_RANGE(0x3f0000, 0x3fffff) AM_MIRROR(0x100000) AM_RAM
ADDRESS_MAP_END
@ -347,8 +347,8 @@ static DRIVER_INIT( batman )
0x0150,0x0218,0x01D0,0x0100,0x01D0,0x0300,0x01D0,0x0600,
0x01D0,0x02C8,0x0000
};
batman_state *state = (batman_state *)machine->driver_data;
state->atarigen.eeprom_default = default_eeprom;
batman_state *state = machine->driver_data<batman_state>();
state->eeprom_default = default_eeprom;
atarijsa_init(machine, "260010", 0x0040);
}

View File

@ -22,7 +22,7 @@
static WRITE8_HANDLER( battlane_cpu_command_w )
{
battlane_state *state = (battlane_state *)space->machine->driver_data;
battlane_state *state = space->machine->driver_data<battlane_state>();
state->cpu_control = data;
@ -81,7 +81,7 @@ static WRITE8_HANDLER( battlane_cpu_command_w )
static INTERRUPT_GEN( battlane_cpu1_interrupt )
{
battlane_state *state = (battlane_state *)device->machine->driver_data;
battlane_state *state = device->machine->driver_data<battlane_state>();
/* See note in battlane_cpu_command_w */
if (~state->cpu_control & 0x08)
@ -258,7 +258,7 @@ GFXDECODE_END
static void irqhandler( running_device *device, int irq )
{
battlane_state *state = (battlane_state *)device->machine->driver_data;
battlane_state *state = device->machine->driver_data<battlane_state>();
cpu_set_input_line(state->maincpu, M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE);
}
@ -276,7 +276,7 @@ static const ym3526_interface ym3526_config =
static MACHINE_START( battlane )
{
battlane_state *state = (battlane_state *)machine->driver_data;
battlane_state *state = machine->driver_data<battlane_state>();
state->maincpu = machine->device("maincpu");
state->subcpu = machine->device("sub");
@ -287,7 +287,7 @@ static MACHINE_START( battlane )
static MACHINE_RESET( battlane )
{
battlane_state *state = (battlane_state *)machine->driver_data;
battlane_state *state = machine->driver_data<battlane_state>();
state->video_ctrl = 0;
state->cpu_control = 0;

View File

@ -204,7 +204,7 @@ GFXDECODE_END
static MACHINE_RESET( battlex )
{
battlex_state *state = (battlex_state *)machine->driver_data;
battlex_state *state = machine->driver_data<battlex_state>();
state->scroll_lsb = 0;
state->scroll_msb = 0;

View File

@ -27,14 +27,14 @@
static INTERRUPT_GEN( battlnts_interrupt )
{
battlnts_state *state = (battlnts_state *)device->machine->driver_data;
battlnts_state *state = device->machine->driver_data<battlnts_state>();
if (k007342_is_int_enabled(state->k007342))
cpu_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
}
static WRITE8_HANDLER( battlnts_sh_irqtrigger_w )
{
battlnts_state *state = (battlnts_state *)space->machine->driver_data;
battlnts_state *state = space->machine->driver_data<battlnts_state>();
cpu_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@ -220,7 +220,7 @@ static const k007420_interface bladestl_k007420_intf =
static MACHINE_START( battlnts )
{
battlnts_state *state = (battlnts_state *)machine->driver_data;
battlnts_state *state = machine->driver_data<battlnts_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
@ -235,7 +235,7 @@ static MACHINE_START( battlnts )
static MACHINE_RESET( battlnts )
{
battlnts_state *state = (battlnts_state *)machine->driver_data;
battlnts_state *state = machine->driver_data<battlnts_state>();
state->layer_colorbase[0] = 0;
state->layer_colorbase[1] = 0;

View File

@ -55,12 +55,13 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "cpu/z80/z80.h"
class beaminv_state
class beaminv_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, beaminv_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, beaminv_state(machine)); }
beaminv_state(running_machine &machine) { }
beaminv_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */
UINT8 * videoram;
@ -93,7 +94,7 @@ static const int interrupt_lines[INTERRUPTS_PER_FRAME] = { 0x00, 0x80 };
static TIMER_CALLBACK( interrupt_callback )
{
beaminv_state *state = (beaminv_state *)machine->driver_data;
beaminv_state *state = machine->driver_data<beaminv_state>();
int interrupt_number = param;
int next_interrupt_number;
int next_vpos;
@ -110,14 +111,14 @@ static TIMER_CALLBACK( interrupt_callback )
static void create_interrupt_timer( running_machine *machine )
{
beaminv_state *state = (beaminv_state *)machine->driver_data;
beaminv_state *state = machine->driver_data<beaminv_state>();
state->interrupt_timer = timer_alloc(machine, interrupt_callback, NULL);
}
static void start_interrupt_timer( running_machine *machine )
{
beaminv_state *state = (beaminv_state *)machine->driver_data;
beaminv_state *state = machine->driver_data<beaminv_state>();
int vpos = interrupt_lines[0];
timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(vpos), 0);
}
@ -132,7 +133,7 @@ static void start_interrupt_timer( running_machine *machine )
static MACHINE_START( beaminv )
{
beaminv_state *state = (beaminv_state *)machine->driver_data;
beaminv_state *state = machine->driver_data<beaminv_state>();
create_interrupt_timer(machine);
state->maincpu = machine->device("maincpu");
@ -151,7 +152,7 @@ static MACHINE_START( beaminv )
static MACHINE_RESET( beaminv )
{
beaminv_state *state = (beaminv_state *)machine->driver_data;
beaminv_state *state = machine->driver_data<beaminv_state>();
start_interrupt_timer(machine);
state->controller_select = 0;
@ -167,7 +168,7 @@ static MACHINE_RESET( beaminv )
static VIDEO_UPDATE( beaminv )
{
beaminv_state *state = (beaminv_state *)screen->machine->driver_data;
beaminv_state *state = screen->machine->driver_data<beaminv_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@ -211,7 +212,7 @@ static READ8_HANDLER( v128_r )
static WRITE8_HANDLER( controller_select_w )
{
beaminv_state *state = (beaminv_state *)space->machine->driver_data;
beaminv_state *state = space->machine->driver_data<beaminv_state>();
/* 0x01 (player 1) or 0x02 (player 2) */
state->controller_select = data;
}
@ -219,7 +220,7 @@ static WRITE8_HANDLER( controller_select_w )
static READ8_HANDLER( controller_r )
{
beaminv_state *state = (beaminv_state *)space->machine->driver_data;
beaminv_state *state = space->machine->driver_data<beaminv_state>();
return input_port_read(space->machine, (state->controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG);
}

View File

@ -119,7 +119,7 @@ static void update_interrupts(running_machine *machine);
static TIMER_DEVICE_CALLBACK( scanline_callback )
{
beathead_state *state = (beathead_state *)timer.machine->driver_data;
beathead_state *state = timer.machine->driver_data<beathead_state>();
int scanline = param;
/* update the video */
@ -151,11 +151,11 @@ static MACHINE_START( beathead )
static MACHINE_RESET( beathead )
{
beathead_state *state = (beathead_state *)machine->driver_data;
beathead_state *state = machine->driver_data<beathead_state>();
/* reset the common subsystems */
atarigen_eeprom_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
atarijsa_reset();
/* the code is temporarily mapped at 0 at startup */
@ -183,7 +183,7 @@ static MACHINE_RESET( beathead )
static void update_interrupts(running_machine *machine)
{
beathead_state *state = (beathead_state *)machine->driver_data;
beathead_state *state = machine->driver_data<beathead_state>();
int gen_int;
/* compute the combined interrupt signal */
@ -206,7 +206,7 @@ static void update_interrupts(running_machine *machine)
static WRITE32_HANDLER( interrupt_control_w )
{
beathead_state *state = (beathead_state *)space->machine->driver_data;
beathead_state *state = space->machine->driver_data<beathead_state>();
int irq = offset & 3;
int control = (offset >> 2) & 1;
@ -225,7 +225,7 @@ static WRITE32_HANDLER( interrupt_control_w )
static READ32_HANDLER( interrupt_control_r )
{
beathead_state *state = (beathead_state *)space->machine->driver_data;
beathead_state *state = space->machine->driver_data<beathead_state>();
/* return the enables as a bitfield */
return (state->irq_enable[0]) | (state->irq_enable[1] << 1) | (state->irq_enable[2] << 2);
@ -241,7 +241,7 @@ static READ32_HANDLER( interrupt_control_r )
static WRITE32_HANDLER( eeprom_data_w )
{
beathead_state *state = (beathead_state *)space->machine->driver_data;
beathead_state *state = space->machine->driver_data<beathead_state>();
if (state->eeprom_enabled)
{
@ -254,7 +254,7 @@ static WRITE32_HANDLER( eeprom_data_w )
static WRITE32_HANDLER( eeprom_enable_w )
{
beathead_state *state = (beathead_state *)space->machine->driver_data;
beathead_state *state = space->machine->driver_data<beathead_state>();
state->eeprom_enabled = 1;
}
@ -269,10 +269,10 @@ static WRITE32_HANDLER( eeprom_enable_w )
static READ32_HANDLER( input_2_r )
{
beathead_state *state = (beathead_state *)space->machine->driver_data;
beathead_state *state = space->machine->driver_data<beathead_state>();
int result = input_port_read(space->machine, "IN2");
if (state->atarigen.sound_to_cpu_ready) result ^= 0x10;
if (state->atarigen.cpu_to_sound_ready) result ^= 0x20;
if (state->sound_to_cpu_ready) result ^= 0x10;
if (state->cpu_to_sound_ready) result ^= 0x20;
return result;
}

View File

@ -66,7 +66,7 @@ J1100072A
static WRITE8_HANDLER( beg_banking_w )
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
state->beg_bank = data;
/* d0-d3 connect to A11-A14 of the ROMs (via ls273 latch)
@ -77,7 +77,7 @@ static WRITE8_HANDLER( beg_banking_w )
static TIMER_CALLBACK( from_sound_latch_callback )
{
bigevglf_state *state = (bigevglf_state *)machine->driver_data;
bigevglf_state *state = machine->driver_data<bigevglf_state>();
state->from_sound = param & 0xff;
state->sound_state |= 2;
}
@ -88,7 +88,7 @@ static WRITE8_HANDLER( beg_fromsound_w ) /* write to D800 sets bit 1 in status *
static READ8_HANDLER( beg_fromsound_r )
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
/* set a timer to force synchronization after the read */
timer_call_after_resynch(space->machine, NULL, 0, NULL);
return state->from_sound;
@ -96,7 +96,7 @@ static READ8_HANDLER( beg_fromsound_r )
static READ8_HANDLER( beg_soundstate_r )
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
UINT8 ret = state->sound_state;
/* set a timer to force synchronization after the read */
timer_call_after_resynch(space->machine, NULL, 0, NULL);
@ -106,7 +106,7 @@ static READ8_HANDLER( beg_soundstate_r )
static READ8_HANDLER( soundstate_r )
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
/* set a timer to force synchronization after the read */
timer_call_after_resynch(space->machine, NULL, 0, NULL);
return state->sound_state;
@ -114,7 +114,7 @@ static READ8_HANDLER( soundstate_r )
static TIMER_CALLBACK( nmi_callback )
{
bigevglf_state *state = (bigevglf_state *)machine->driver_data;
bigevglf_state *state = machine->driver_data<bigevglf_state>();
if (state->sound_nmi_enable)
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@ -125,27 +125,27 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w ) /* write to port 20 clears bit 0 in status */
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
state->for_sound = data;
timer_call_after_resynch(space->machine, NULL, data, nmi_callback);
}
static READ8_HANDLER( sound_command_r ) /* read from D800 sets bit 0 in status */
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
state->sound_state |= 1;
return state->for_sound;
}
static WRITE8_HANDLER( nmi_disable_w )
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
@ -156,7 +156,7 @@ static WRITE8_HANDLER( nmi_enable_w )
static TIMER_CALLBACK( deferred_ls74_w )
{
bigevglf_state *state = (bigevglf_state *)machine->driver_data;
bigevglf_state *state = machine->driver_data<bigevglf_state>();
int offs = (param >> 8) & 255;
int data = param & 255;
state->beg13_ls74[offs] = data;
@ -185,7 +185,7 @@ static WRITE8_HANDLER( beg13_b_set_w )
static READ8_HANDLER( beg_status_r )
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
/* d0 = Q of 74ls74 IC13(partA)
d1 = Q of 74ls74 IC13(partB)
@ -204,7 +204,7 @@ static READ8_HANDLER( beg_status_r )
static READ8_HANDLER( beg_trackball_x_r )
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
static const char *const portx_name[2] = { "P1X", "P2X" };
return input_port_read(space->machine, portx_name[state->port_select]);
@ -212,7 +212,7 @@ static READ8_HANDLER( beg_trackball_x_r )
static READ8_HANDLER( beg_trackball_y_r )
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
static const char *const porty_name[2] = { "P1Y", "P2Y" };
return input_port_read(space->machine, porty_name[state->port_select]);
@ -220,7 +220,7 @@ static READ8_HANDLER( beg_trackball_y_r )
static WRITE8_HANDLER( beg_port08_w )
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
state->port_select = (data & 0x04) >> 2;
}
@ -342,7 +342,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( sub_cpu_mcu_coin_port_r )
{
bigevglf_state *state = (bigevglf_state *)space->machine->driver_data;
bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
/*
bit 0 and bit 1 = coin inputs
bit 3 and bit 4 = MCU status
@ -432,7 +432,7 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( bigevglf )
{
bigevglf_state *state = (bigevglf_state *)machine->driver_data;
bigevglf_state *state = machine->driver_data<bigevglf_state>();
state->audiocpu = machine->device("audiocpu");
state->mcu = machine->device("mcu");
@ -469,7 +469,7 @@ static MACHINE_START( bigevglf )
static MACHINE_RESET( bigevglf )
{
bigevglf_state *state = (bigevglf_state *)machine->driver_data;
bigevglf_state *state = machine->driver_data<bigevglf_state>();
state->vidram_bank = 0;
state->plane_selected = 0;

View File

@ -117,12 +117,13 @@ Notes:
#include "sound/3812intf.h"
class bigfghtr_state
class bigfghtr_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bigfghtr_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bigfghtr_state(machine)); }
bigfghtr_state(running_machine &machine) { }
bigfghtr_state(running_machine &machine)
: driver_data_t(machine) { }
/* video-related */
UINT16 * text_videoram;
@ -145,7 +146,7 @@ public:
static TILE_GET_INFO( get_fg_tile_info )
{
bigfghtr_state *state = (bigfghtr_state *)machine->driver_data;
bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
int data = state->fg_videoram[tile_index];
SET_TILE_INFO(
1,
@ -157,7 +158,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
bigfghtr_state *state = (bigfghtr_state *)machine->driver_data;
bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
int data = state->bg_videoram[tile_index];
SET_TILE_INFO(
2,
@ -168,7 +169,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
bigfghtr_state *state = (bigfghtr_state *)machine->driver_data;
bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
int tile_number = state->text_videoram[tile_index] & 0xff;
int attributes;
@ -183,7 +184,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static VIDEO_START( bigfghtr )
{
bigfghtr_state *state = (bigfghtr_state *)machine->driver_data;
bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 64, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_cols, 16, 16, 64, 32);
@ -195,7 +196,7 @@ static VIDEO_START( bigfghtr )
static WRITE16_HANDLER(text_videoram_w )
{
bigfghtr_state *state = (bigfghtr_state *)space->machine->driver_data;
bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
COMBINE_DATA(&state->text_videoram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap, offset & 0x7ff);
@ -203,7 +204,7 @@ static WRITE16_HANDLER(text_videoram_w )
static WRITE16_HANDLER( fg_videoram_w )
{
bigfghtr_state *state = (bigfghtr_state *)space->machine->driver_data;
bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@ -211,7 +212,7 @@ static WRITE16_HANDLER( fg_videoram_w )
static WRITE16_HANDLER( bg_videoram_w )
{
bigfghtr_state *state = (bigfghtr_state *)space->machine->driver_data;
bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@ -219,19 +220,19 @@ static WRITE16_HANDLER( bg_videoram_w )
static WRITE16_HANDLER( fg_scrollx_w )
{
bigfghtr_state *state = (bigfghtr_state *)space->machine->driver_data;
bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
COMBINE_DATA(&state->fg_scrollx);
}
static WRITE16_HANDLER( fg_scrolly_w )
{
bigfghtr_state *state = (bigfghtr_state *)space->machine->driver_data;
bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
COMBINE_DATA(&state->fg_scrolly);
}
static WRITE16_HANDLER( bg_scrollx_w )
{
bigfghtr_state *state = (bigfghtr_state *)space->machine->driver_data;
bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
COMBINE_DATA(&state->scroll_x);
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll_x);
@ -239,7 +240,7 @@ static WRITE16_HANDLER( bg_scrollx_w )
static WRITE16_HANDLER( bg_scrolly_w )
{
bigfghtr_state *state = (bigfghtr_state *)space->machine->driver_data;
bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
COMBINE_DATA(&state->scroll_y);
tilemap_set_scrolly(state->bg_tilemap, 0, state->scroll_y);
@ -272,7 +273,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static VIDEO_UPDATE( bigfghtr )
{
bigfghtr_state *state = (bigfghtr_state *)screen->machine->driver_data;
bigfghtr_state *state = screen->machine->driver_data<bigfghtr_state>();
int sprite_enable = state->vreg & 0x200;
tilemap_set_enable(state->bg_tilemap, state->vreg & 0x800);
@ -320,7 +321,7 @@ static WRITE16_HANDLER( sound_command_w )
static WRITE16_HANDLER( io_w )
{
bigfghtr_state *state = (bigfghtr_state *)space->machine->driver_data;
bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
COMBINE_DATA(&state->vreg);
flip_screen_set(space->machine, state->vreg & 0x1000);
@ -328,7 +329,7 @@ static WRITE16_HANDLER( io_w )
static READ16_HANDLER( latch_r )
{
bigfghtr_state *state = (bigfghtr_state *)space->machine->driver_data;
bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
state->read_latch = 1;
return 0;
@ -337,13 +338,13 @@ static READ16_HANDLER( latch_r )
static WRITE16_HANDLER( sharedram_w )
{
bigfghtr_state *state = (bigfghtr_state *)space->machine->driver_data;
bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
COMBINE_DATA(&state->sharedram[offset]);
}
static READ16_HANDLER(sharedram_r)
{
bigfghtr_state *state = (bigfghtr_state *)space->machine->driver_data;
bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
switch(offset)
{
case 0x40/2:
@ -535,7 +536,7 @@ GFXDECODE_END
static MACHINE_START( bigfghtr )
{
bigfghtr_state *state = (bigfghtr_state *)machine->driver_data;
bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
state_save_register_global(machine, state->fg_scrollx);
state_save_register_global(machine, state->fg_scrolly);
@ -547,7 +548,7 @@ static MACHINE_START( bigfghtr )
static MACHINE_RESET( bigfghtr )
{
bigfghtr_state *state = (bigfghtr_state *)machine->driver_data;
bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
state->fg_scrollx = 0;
state->fg_scrolly = 0;

View File

@ -73,7 +73,7 @@
static WRITE16_HANDLER( hacked_controls_w )
{
bionicc_state *state = (bionicc_state *)space->machine->driver_data;
bionicc_state *state = space->machine->driver_data<bionicc_state>();
logerror("%06x: hacked_controls_w %04x %02x\n", cpu_get_pc(space->cpu), offset, data);
COMBINE_DATA(&state->inp[offset]);
@ -81,7 +81,7 @@ static WRITE16_HANDLER( hacked_controls_w )
static READ16_HANDLER( hacked_controls_r )
{
bionicc_state *state = (bionicc_state *)space->machine->driver_data;
bionicc_state *state = space->machine->driver_data<bionicc_state>();
logerror("%06x: hacked_controls_r %04x %04x\n", cpu_get_pc(space->cpu), offset, state->inp[offset]);
return state->inp[offset];
@ -89,7 +89,7 @@ static READ16_HANDLER( hacked_controls_r )
static WRITE16_HANDLER( bionicc_mpu_trigger_w )
{
bionicc_state *state = (bionicc_state *)space->machine->driver_data;
bionicc_state *state = space->machine->driver_data<bionicc_state>();
data = input_port_read(space->machine, "SYSTEM") >> 12;
state->inp[0] = data ^ 0x0f;
@ -104,7 +104,7 @@ static WRITE16_HANDLER( bionicc_mpu_trigger_w )
static WRITE16_HANDLER( hacked_soundcommand_w )
{
bionicc_state *state = (bionicc_state *)space->machine->driver_data;
bionicc_state *state = space->machine->driver_data<bionicc_state>();
COMBINE_DATA(&state->soundcommand);
soundlatch_w(space, 0, state->soundcommand & 0xff);
@ -112,7 +112,7 @@ static WRITE16_HANDLER( hacked_soundcommand_w )
static READ16_HANDLER( hacked_soundcommand_r )
{
bionicc_state *state = (bionicc_state *)space->machine->driver_data;
bionicc_state *state = space->machine->driver_data<bionicc_state>();
return state->soundcommand;
}
@ -335,7 +335,7 @@ GFXDECODE_END
static MACHINE_START( bionicc )
{
bionicc_state *state = (bionicc_state *)machine->driver_data;
bionicc_state *state = machine->driver_data<bionicc_state>();
state_save_register_global(machine, state->soundcommand);
state_save_register_global_array(machine, state->inp);
@ -344,7 +344,7 @@ static MACHINE_START( bionicc )
static MACHINE_RESET( bionicc )
{
bionicc_state *state = (bionicc_state *)machine->driver_data;
bionicc_state *state = machine->driver_data<bionicc_state>();
state->inp[0] = 0;
state->inp[1] = 0;

View File

@ -92,27 +92,27 @@ Notes:
static READ16_HANDLER( control_r )
{
bishi_state *state = (bishi_state *)space->machine->driver_data;
bishi_state *state = space->machine->driver_data<bishi_state>();
return state->cur_control;
}
static WRITE16_HANDLER( control_w )
{
// bit 8 = interrupt gate
bishi_state *state = (bishi_state *)space->machine->driver_data;
bishi_state *state = space->machine->driver_data<bishi_state>();
COMBINE_DATA(&state->cur_control);
}
static WRITE16_HANDLER( control2_w )
{
// bit 12 = part of the banking calculation for the K056832 ROM readback
bishi_state *state = (bishi_state *)space->machine->driver_data;
bishi_state *state = space->machine->driver_data<bishi_state>();
COMBINE_DATA(&state->cur_control2);
}
static INTERRUPT_GEN(bishi_interrupt)
{
bishi_state *state = (bishi_state *)device->machine->driver_data;
bishi_state *state = device->machine->driver_data<bishi_state>();
if (state->cur_control & 0x800)
{
switch (cpu_getiloops(device))
@ -136,7 +136,7 @@ static READ16_HANDLER( bishi_mirror_r )
static READ16_HANDLER( bishi_K056832_rom_r )
{
bishi_state *state = (bishi_state *)space->machine->driver_data;
bishi_state *state = space->machine->driver_data<bishi_state>();
UINT16 ouroffs;
ouroffs = (offset >> 1) * 8;
@ -369,7 +369,7 @@ INPUT_PORTS_END
static void sound_irq_gen(running_device *device, int state)
{
bishi_state *bishi = (bishi_state *)device->machine->driver_data;
bishi_state *bishi = device->machine->driver_data<bishi_state>();
if (state)
cpu_set_input_line(bishi->maincpu, M68K_IRQ_1, ASSERT_LINE);
else
@ -400,7 +400,7 @@ static const k054338_interface bishi_k054338_intf =
static MACHINE_START( bishi )
{
bishi_state *state = (bishi_state *)machine->driver_data;
bishi_state *state = machine->driver_data<bishi_state>();
state->maincpu = machine->device("maincpu");
state->k056832 = machine->device("k056832");
@ -413,7 +413,7 @@ static MACHINE_START( bishi )
static MACHINE_RESET( bishi )
{
bishi_state *state = (bishi_state *)machine->driver_data;
bishi_state *state = machine->driver_data<bishi_state>();
state->cur_control = 0;
state->cur_control2 = 0;
}

View File

@ -24,20 +24,20 @@ DIP Locations verified for:
static READ8_HANDLER( bking_sndnmi_disable_r )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
state->sound_nmi_enable = 0;
return 0;
}
static WRITE8_HANDLER( bking_sndnmi_enable_w )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
state->sound_nmi_enable = 1;
}
static WRITE8_HANDLER( bking_soundlatch_w )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
int i, code = 0;
for (i = 0;i < 8;i++)
@ -51,19 +51,19 @@ static WRITE8_HANDLER( bking_soundlatch_w )
static WRITE8_HANDLER( bking3_addr_l_w )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
state->addr_l = data;
}
static WRITE8_HANDLER( bking3_addr_h_w )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
state->addr_h = data;
}
static READ8_HANDLER( bking3_extrarom_r )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
UINT8 *rom = memory_region(space->machine, "user2");
return rom[state->addr_h * 256 + state->addr_l];
}
@ -411,7 +411,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( bking )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
state->audiocpu = machine->device("audiocpu");
@ -437,7 +437,7 @@ static MACHINE_START( bking )
static MACHINE_START( bking3 )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
state->mcu = machine->device("mcu");
@ -465,7 +465,7 @@ static MACHINE_START( bking3 )
static MACHINE_RESET( bking )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
/* video */
state->pc3259_output[0] = 0;
@ -492,7 +492,7 @@ static MACHINE_RESET( bking )
static MACHINE_RESET( bking3 )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE);

View File

@ -38,7 +38,7 @@
static INTERRUPT_GEN( bladestl_interrupt )
{
bladestl_state *state = (bladestl_state *)device->machine->driver_data;
bladestl_state *state = device->machine->driver_data<bladestl_state>();
if (cpu_getiloops(device) == 0)
{
@ -59,7 +59,7 @@ static INTERRUPT_GEN( bladestl_interrupt )
static READ8_HANDLER( trackball_r )
{
bladestl_state *state = (bladestl_state *)space->machine->driver_data;
bladestl_state *state = space->machine->driver_data<bladestl_state>();
static const char *const port[] = { "TRACKBALL_P1_1", "TRACKBALL_P1_2", "TRACKBALL_P2_1", "TRACKBALL_P1_2" };
int curr, delta;
@ -72,7 +72,7 @@ static READ8_HANDLER( trackball_r )
static WRITE8_HANDLER( bladestl_bankswitch_w )
{
bladestl_state *state = (bladestl_state *)space->machine->driver_data;
bladestl_state *state = space->machine->driver_data<bladestl_state>();
/* bits 0 & 1 = coin counters */
coin_counter_w(space->machine, 0,data & 0x01);
@ -94,7 +94,7 @@ static WRITE8_HANDLER( bladestl_bankswitch_w )
static WRITE8_HANDLER( bladestl_sh_irqtrigger_w )
{
bladestl_state *state = (bladestl_state *)space->machine->driver_data;
bladestl_state *state = space->machine->driver_data<bladestl_state>();
soundlatch_w(space, offset, data);
cpu_set_input_line(state->audiocpu, M6809_IRQ_LINE, HOLD_LINE);
@ -306,7 +306,7 @@ static const k007420_interface bladestl_k007420_intf =
static MACHINE_START( bladestl )
{
bladestl_state *state = (bladestl_state *)machine->driver_data;
bladestl_state *state = machine->driver_data<bladestl_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
@ -322,7 +322,7 @@ static MACHINE_START( bladestl )
static MACHINE_RESET( bladestl )
{
bladestl_state *state = (bladestl_state *)machine->driver_data;
bladestl_state *state = machine->driver_data<bladestl_state>();
int i;
state->layer_colorbase[0] = 0;

View File

@ -28,20 +28,20 @@ Protection comms between main cpu and i8751
static READ8_HANDLER( blktiger_from_mcu_r )
{
blktiger_state *state = (blktiger_state *)space->machine->driver_data;
blktiger_state *state = space->machine->driver_data<blktiger_state>();
return state->i8751_latch;
}
static WRITE8_HANDLER( blktiger_to_mcu_w )
{
blktiger_state *state = (blktiger_state *)space->machine->driver_data;
blktiger_state *state = space->machine->driver_data<blktiger_state>();
cpu_set_input_line(state->mcu, MCS51_INT1_LINE, ASSERT_LINE);
state->z80_latch = data;
}
static READ8_HANDLER( blktiger_from_main_r )
{
blktiger_state *state = (blktiger_state *)space->machine->driver_data;
blktiger_state *state = space->machine->driver_data<blktiger_state>();
cpu_set_input_line(state->mcu, MCS51_INT1_LINE, CLEAR_LINE);
//printf("%02x read\n",latch);
return state->z80_latch;
@ -49,7 +49,7 @@ static READ8_HANDLER( blktiger_from_main_r )
static WRITE8_HANDLER( blktiger_to_main_w )
{
blktiger_state *state = (blktiger_state *)space->machine->driver_data;
blktiger_state *state = space->machine->driver_data<blktiger_state>();
//printf("%02x write\n",data);
state->i8751_latch = data;
}
@ -265,7 +265,7 @@ GFXDECODE_END
/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler( running_device *device, int irq )
{
blktiger_state *state = (blktiger_state *)device->machine->driver_data;
blktiger_state *state = device->machine->driver_data<blktiger_state>();
cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@ -281,7 +281,7 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( blktiger )
{
blktiger_state *state = (blktiger_state *)machine->driver_data;
blktiger_state *state = machine->driver_data<blktiger_state>();
state->audiocpu = machine->device("audiocpu");
state->mcu = machine->device("mcu");
@ -302,7 +302,7 @@ static MACHINE_START( blktiger )
static MACHINE_RESET( blktiger )
{
blktiger_state *state = (blktiger_state *)machine->driver_data;
blktiger_state *state = machine->driver_data<blktiger_state>();
/* configure bankswitching */
memory_configure_bank(machine, "bank1", 0, 16, memory_region(machine, "maincpu") + 0x10000, 0x4000);

View File

@ -60,7 +60,7 @@ static WRITE16_HANDLER( blmbycar_okibank_w )
static WRITE16_HANDLER( blmbycar_pot_wheel_reset_w )
{
blmbycar_state *state = (blmbycar_state *)space->machine->driver_data;
blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
if (ACCESSING_BITS_0_7)
state->pot_wheel = ~input_port_read(space->machine, "WHEEL") & 0xff;
@ -68,7 +68,7 @@ static WRITE16_HANDLER( blmbycar_pot_wheel_reset_w )
static WRITE16_HANDLER( blmbycar_pot_wheel_shift_w )
{
blmbycar_state *state = (blmbycar_state *)space->machine->driver_data;
blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
if (ACCESSING_BITS_0_7)
{
@ -80,7 +80,7 @@ static WRITE16_HANDLER( blmbycar_pot_wheel_shift_w )
static READ16_HANDLER( blmbycar_pot_wheel_r )
{
blmbycar_state *state = (blmbycar_state *)space->machine->driver_data;
blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
return ((state->pot_wheel & 0x80) ? 0x04 : 0) | (mame_rand(space->machine) & 0x08);
}
@ -130,7 +130,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( waterball_unk_r )
{
blmbycar_state *state = (blmbycar_state *)space->machine->driver_data;
blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
state->retvalue ^= 0x0008; // must toggle.. but not vblank?
return state->retvalue;
@ -341,7 +341,7 @@ GFXDECODE_END
static MACHINE_START( blmbycar )
{
blmbycar_state *state = (blmbycar_state *)machine->driver_data;
blmbycar_state *state = machine->driver_data<blmbycar_state>();
state_save_register_global(machine, state->pot_wheel);
state_save_register_global(machine, state->old_val);
@ -349,7 +349,7 @@ static MACHINE_START( blmbycar )
static MACHINE_RESET( blmbycar )
{
blmbycar_state *state = (blmbycar_state *)machine->driver_data;
blmbycar_state *state = machine->driver_data<blmbycar_state>();
state->pot_wheel = 0;
state->old_val = 0;
@ -394,14 +394,14 @@ MACHINE_DRIVER_END
static MACHINE_START( watrball )
{
blmbycar_state *state = (blmbycar_state *)machine->driver_data;
blmbycar_state *state = machine->driver_data<blmbycar_state>();
state_save_register_global(machine, state->retvalue);
}
static MACHINE_RESET( watrball )
{
blmbycar_state *state = (blmbycar_state *)machine->driver_data;
blmbycar_state *state = machine->driver_data<blmbycar_state>();
state->retvalue = 0;
}

View File

@ -58,7 +58,7 @@
static INTERRUPT_GEN( blockade_interrupt )
{
blockade_state *state = (blockade_state *)device->machine->driver_data;
blockade_state *state = device->machine->driver_data<blockade_state>();
cpu_resume(device, SUSPEND_ANY_REASON);
if ((input_port_read(device->machine, "IN0") & 0x80) == 0)
@ -76,7 +76,7 @@ static INTERRUPT_GEN( blockade_interrupt )
static READ8_HANDLER( blockade_input_port_0_r )
{
blockade_state *state = (blockade_state *)space->machine->driver_data;
blockade_state *state = space->machine->driver_data<blockade_state>();
/* coin latch is bit 7 */
UINT8 temp = (input_port_read(space->machine, "IN0") & 0x7f);
@ -85,7 +85,7 @@ static READ8_HANDLER( blockade_input_port_0_r )
static WRITE8_HANDLER( blockade_coin_latch_w )
{
blockade_state *state = (blockade_state *)space->machine->driver_data;
blockade_state *state = space->machine->driver_data<blockade_state>();
if (data & 0x80)
{
@ -466,7 +466,7 @@ static PALETTE_INIT( bw )
static MACHINE_START( blockade )
{
blockade_state *state = (blockade_state *)machine->driver_data;
blockade_state *state = machine->driver_data<blockade_state>();
state_save_register_global(machine, state->coin_latch);
state_save_register_global(machine, state->just_been_reset);
@ -474,7 +474,7 @@ static MACHINE_START( blockade )
static MACHINE_RESET( blockade )
{
blockade_state *state = (blockade_state *)machine->driver_data;
blockade_state *state = machine->driver_data<blockade_state>();
state->coin_latch = 1;
state->just_been_reset = 0;

View File

@ -32,7 +32,7 @@ static KONAMI_SETLINES_CALLBACK( blockhl_banking );
static INTERRUPT_GEN( blockhl_interrupt )
{
blockhl_state *state = (blockhl_state *)device->machine->driver_data;
blockhl_state *state = device->machine->driver_data<blockhl_state>();
if (k052109_is_irq_enabled(state->k052109) && state->rombank == 0) /* kludge to prevent crashes */
cpu_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
@ -40,7 +40,7 @@ static INTERRUPT_GEN( blockhl_interrupt )
static READ8_HANDLER( bankedram_r )
{
blockhl_state *state = (blockhl_state *)space->machine->driver_data;
blockhl_state *state = space->machine->driver_data<blockhl_state>();
if (state->palette_selected)
return space->machine->generic.paletteram.u8[offset];
@ -50,7 +50,7 @@ static READ8_HANDLER( bankedram_r )
static WRITE8_HANDLER( bankedram_w )
{
blockhl_state *state = (blockhl_state *)space->machine->driver_data;
blockhl_state *state = space->machine->driver_data<blockhl_state>();
if (state->palette_selected)
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
@ -60,7 +60,7 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( blockhl_sh_irqtrigger_w )
{
blockhl_state *state = (blockhl_state *)space->machine->driver_data;
blockhl_state *state = space->machine->driver_data<blockhl_state>();
cpu_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@ -68,7 +68,7 @@ static WRITE8_HANDLER( blockhl_sh_irqtrigger_w )
/* special handlers to combine 052109 & 051960 */
static READ8_HANDLER( k052109_051960_r )
{
blockhl_state *state = (blockhl_state *)space->machine->driver_data;
blockhl_state *state = space->machine->driver_data<blockhl_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@ -85,7 +85,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
blockhl_state *state = (blockhl_state *)space->machine->driver_data;
blockhl_state *state = space->machine->driver_data<blockhl_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@ -193,7 +193,7 @@ static const k051960_interface blockhl_k051960_intf =
static MACHINE_START( blockhl )
{
blockhl_state *state = (blockhl_state *)machine->driver_data;
blockhl_state *state = machine->driver_data<blockhl_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
@ -209,7 +209,7 @@ static MACHINE_START( blockhl )
static MACHINE_RESET( blockhl )
{
blockhl_state *state = (blockhl_state *)machine->driver_data;
blockhl_state *state = machine->driver_data<blockhl_state>();
konami_configure_set_lines(machine->device("maincpu"), blockhl_banking);
@ -323,7 +323,7 @@ ROM_END
static KONAMI_SETLINES_CALLBACK( blockhl_banking )
{
blockhl_state *state = (blockhl_state *)device->machine->driver_data;
blockhl_state *state = device->machine->driver_data<blockhl_state>();
/* bits 0-1 = ROM bank */
state->rombank = lines & 0x03;

View File

@ -83,7 +83,7 @@ static INTERRUPT_GEN( blockout_interrupt )
static WRITE16_HANDLER( blockout_sound_command_w )
{
blockout_state *state = (blockout_state *)space->machine->driver_data;
blockout_state *state = space->machine->driver_data<blockout_state>();
if (ACCESSING_BITS_0_7)
{
@ -237,7 +237,7 @@ INPUT_PORTS_END
/* handler called by the 2151 emulator when the internal timers cause an IRQ */
static void blockout_irq_handler(running_device *device, int irq)
{
blockout_state *state = (blockout_state *)device->machine->driver_data;
blockout_state *state = device->machine->driver_data<blockout_state>();
cpu_set_input_line_and_vector(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xff);
}
@ -255,7 +255,7 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( blockout )
{
blockout_state *state = (blockout_state *)machine->driver_data;
blockout_state *state = machine->driver_data<blockout_state>();
state->audiocpu = machine->device("audiocpu");
@ -264,7 +264,7 @@ static MACHINE_START( blockout )
static MACHINE_RESET( blockout )
{
blockout_state *state = (blockout_state *)machine->driver_data;
blockout_state *state = machine->driver_data<blockout_state>();
state->color = 0;
}

View File

@ -33,10 +33,10 @@
static void update_interrupts(running_machine *machine)
{
blstroid_state *state = (blstroid_state *)machine->driver_data;
cputag_set_input_line(machine, "maincpu", 1, state->atarigen.scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->atarigen.sound_int_state ? ASSERT_LINE : CLEAR_LINE);
blstroid_state *state = machine->driver_data<blstroid_state>();
cputag_set_input_line(machine, "maincpu", 1, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@ -54,10 +54,10 @@ static MACHINE_START( blstroid )
static MACHINE_RESET( blstroid )
{
blstroid_state *state = (blstroid_state *)machine->driver_data;
blstroid_state *state = machine->driver_data<blstroid_state>();
atarigen_eeprom_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
atarigen_scanline_timer_reset(*machine->primary_screen, blstroid_scanline_update, 8);
atarijsa_reset();
}
@ -73,10 +73,10 @@ static MACHINE_RESET( blstroid )
static READ16_HANDLER( inputs_r )
{
static const char *const iptnames[] = { "IN0", "IN1" };
blstroid_state *state = (blstroid_state *)space->machine->driver_data;
blstroid_state *state = space->machine->driver_data<blstroid_state>();
int temp = input_port_read(space->machine, iptnames[offset & 1]);
if (state->atarigen.cpu_to_sound_ready) temp ^= 0x0040;
if (state->cpu_to_sound_ready) temp ^= 0x0040;
if (atarigen_get_hblank(*space->machine->primary_screen)) temp ^= 0x0010;
return temp;
}
@ -106,8 +106,8 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0xff9804, 0xff9805) AM_MIRROR(0x7f83f8) AM_READ_PORT("DIAL1")
AM_RANGE(0xff9c00, 0xff9c03) AM_MIRROR(0x7f83fc) AM_READ(inputs_r)
AM_RANGE(0xffa000, 0xffa3ff) AM_MIRROR(0x7f8c00) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0xffb000, 0xffb3ff) AM_MIRROR(0x7f8c00) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(blstroid_state, atarigen.eeprom, atarigen.eeprom_size)
AM_RANGE(0xffc000, 0xffcfff) AM_MIRROR(0x7f8000) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE_MEMBER(blstroid_state, atarigen.playfield)
AM_RANGE(0xffb000, 0xffb3ff) AM_MIRROR(0x7f8c00) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(blstroid_state, eeprom, eeprom_size)
AM_RANGE(0xffc000, 0xffcfff) AM_MIRROR(0x7f8000) AM_RAM_WRITE(atarigen_playfield_w) AM_BASE_MEMBER(blstroid_state, playfield)
AM_RANGE(0xffd000, 0xffdfff) AM_MIRROR(0x7f8000) AM_RAM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram)
AM_RANGE(0xffe000, 0xffffff) AM_MIRROR(0x7f8000) AM_RAM
ADDRESS_MAP_END

View File

@ -60,19 +60,19 @@
static WRITE8_DEVICE_HANDLER( dipsw_w )
{
blueprnt_state *state = (blueprnt_state *)device->machine->driver_data;
blueprnt_state *state = device->machine->driver_data<blueprnt_state>();
state->dipsw = data;
}
static READ8_HANDLER( blueprnt_sh_dipsw_r )
{
blueprnt_state *state = (blueprnt_state *)space->machine->driver_data;
blueprnt_state *state = space->machine->driver_data<blueprnt_state>();
return state->dipsw;
}
static WRITE8_HANDLER( blueprnt_sound_command_w )
{
blueprnt_state *state = (blueprnt_state *)space->machine->driver_data;
blueprnt_state *state = space->machine->driver_data<blueprnt_state>();
soundlatch_w(space, offset, data);
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@ -281,7 +281,7 @@ static const ay8910_interface ay8910_interface_2 =
static MACHINE_START( blueprnt )
{
blueprnt_state *state = (blueprnt_state *)machine->driver_data;
blueprnt_state *state = machine->driver_data<blueprnt_state>();
state->audiocpu = machine->device("audiocpu");
@ -290,7 +290,7 @@ static MACHINE_START( blueprnt )
static MACHINE_RESET( blueprnt )
{
blueprnt_state *state = (blueprnt_state *)machine->driver_data;
blueprnt_state *state = machine->driver_data<blueprnt_state>();
state->gfx_bank = 0;
state->dipsw = 0;

View File

@ -24,13 +24,13 @@
static WRITE8_HANDLER( bogeyman_8910_latch_w )
{
bogeyman_state *state = (bogeyman_state *)space->machine->driver_data;
bogeyman_state *state = space->machine->driver_data<bogeyman_state>();
state->psg_latch = data;
}
static WRITE8_HANDLER( bogeyman_8910_control_w )
{
bogeyman_state *state = (bogeyman_state *)space->machine->driver_data;
bogeyman_state *state = space->machine->driver_data<bogeyman_state>();
// bit 0 is flipscreen
flip_screen_set(space->machine, data & 0x01);
@ -207,7 +207,7 @@ GFXDECODE_END
static MACHINE_START( bogeyman )
{
bogeyman_state *state = (bogeyman_state *)machine->driver_data;
bogeyman_state *state = machine->driver_data<bogeyman_state>();
state_save_register_global(machine, state->psg_latch);
state_save_register_global(machine, state->last_write);
@ -215,7 +215,7 @@ static MACHINE_START( bogeyman )
static MACHINE_RESET( bogeyman )
{
bogeyman_state *state = (bogeyman_state *)machine->driver_data;
bogeyman_state *state = machine->driver_data<bogeyman_state>();
state->psg_latch = 0;
state->last_write = 0;
@ -223,7 +223,7 @@ static MACHINE_RESET( bogeyman )
static WRITE8_DEVICE_HANDLER( bogeyman_colbank_w )
{
bogeyman_state *state = (bogeyman_state *)device->machine->driver_data;
bogeyman_state *state = device->machine->driver_data<bogeyman_state>();
if((data & 1) != (state->colbank & 1))
{

View File

@ -103,7 +103,7 @@ Dip Locations and factory settings verified with manual
static TIMER_CALLBACK( soundlatch_callback )
{
bombjack_state *state = (bombjack_state *)machine->driver_data;
bombjack_state *state = machine->driver_data<bombjack_state>();
state->latch = param;
}
@ -115,7 +115,7 @@ static WRITE8_HANDLER( bombjack_soundlatch_w )
static READ8_HANDLER( bombjack_soundlatch_r )
{
bombjack_state *state = (bombjack_state *)space->machine->driver_data;
bombjack_state *state = space->machine->driver_data<bombjack_state>();
int res;
res = state->latch;
@ -328,7 +328,7 @@ GFXDECODE_END
static MACHINE_START( bombjack )
{
bombjack_state *state = (bombjack_state *)machine->driver_data;
bombjack_state *state = machine->driver_data<bombjack_state>();
state_save_register_global(machine, state->latch);
state_save_register_global(machine, state->background_image);
@ -337,7 +337,7 @@ static MACHINE_START( bombjack )
static MACHINE_RESET( bombjack )
{
bombjack_state *state = (bombjack_state *)machine->driver_data;
bombjack_state *state = machine->driver_data<bombjack_state>();
state->latch = 0;
state->background_image = 0;

View File

@ -276,13 +276,13 @@ GFXDECODE_END
static void sound_irq(running_device *device, int state)
{
boogwing_state *driver_state = (boogwing_state *)device->machine->driver_data;
boogwing_state *driver_state = device->machine->driver_data<boogwing_state>();
cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
boogwing_state *state = (boogwing_state *)device->machine->driver_data;
boogwing_state *state = device->machine->driver_data<boogwing_state>();
state->oki2->set_bank_base(((data & 2) >> 1) * 0x40000);
state->oki1->set_bank_base((data & 1) * 0x40000);
}

View File

@ -23,7 +23,7 @@
static INTERRUPT_GEN( bottom9_interrupt )
{
bottom9_state *state = (bottom9_state *)device->machine->driver_data;
bottom9_state *state = device->machine->driver_data<bottom9_state>();
if (k052109_is_irq_enabled(state->k052109))
cpu_set_input_line(device, 0, HOLD_LINE);
@ -31,7 +31,7 @@ static INTERRUPT_GEN( bottom9_interrupt )
static READ8_HANDLER( k052109_051960_r )
{
bottom9_state *state = (bottom9_state *)space->machine->driver_data;
bottom9_state *state = space->machine->driver_data<bottom9_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@ -48,7 +48,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
bottom9_state *state = (bottom9_state *)space->machine->driver_data;
bottom9_state *state = space->machine->driver_data<bottom9_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@ -60,7 +60,7 @@ static WRITE8_HANDLER( k052109_051960_w )
static READ8_HANDLER( bottom9_bankedram1_r )
{
bottom9_state *state = (bottom9_state *)space->machine->driver_data;
bottom9_state *state = space->machine->driver_data<bottom9_state>();
if (state->k052109_selected)
return k052109_051960_r(space, offset);
@ -75,7 +75,7 @@ static READ8_HANDLER( bottom9_bankedram1_r )
static WRITE8_HANDLER( bottom9_bankedram1_w )
{
bottom9_state *state = (bottom9_state *)space->machine->driver_data;
bottom9_state *state = space->machine->driver_data<bottom9_state>();
if (state->k052109_selected)
k052109_051960_w(space, offset, data);
@ -85,7 +85,7 @@ static WRITE8_HANDLER( bottom9_bankedram1_w )
static READ8_HANDLER( bottom9_bankedram2_r )
{
bottom9_state *state = (bottom9_state *)space->machine->driver_data;
bottom9_state *state = space->machine->driver_data<bottom9_state>();
if (state->k052109_selected)
return k052109_051960_r(space, offset + 0x2000);
@ -95,7 +95,7 @@ static READ8_HANDLER( bottom9_bankedram2_r )
static WRITE8_HANDLER( bottom9_bankedram2_w )
{
bottom9_state *state = (bottom9_state *)space->machine->driver_data;
bottom9_state *state = space->machine->driver_data<bottom9_state>();
if (state->k052109_selected)
k052109_051960_w(space, offset + 0x2000, data);
@ -122,7 +122,7 @@ static WRITE8_HANDLER( bankswitch_w )
static WRITE8_HANDLER( bottom9_1f90_w )
{
bottom9_state *state = (bottom9_state *)space->machine->driver_data;
bottom9_state *state = space->machine->driver_data<bottom9_state>();
/* bits 0/1 = coin counters */
coin_counter_w(space->machine, 0, data & 0x01);
@ -143,26 +143,26 @@ static WRITE8_HANDLER( bottom9_1f90_w )
static WRITE8_HANDLER( bottom9_sh_irqtrigger_w )
{
bottom9_state *state = (bottom9_state *)space->machine->driver_data;
bottom9_state *state = space->machine->driver_data<bottom9_state>();
cpu_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static INTERRUPT_GEN( bottom9_sound_interrupt )
{
bottom9_state *state = (bottom9_state *)device->machine->driver_data;
bottom9_state *state = device->machine->driver_data<bottom9_state>();
if (state->nmienable)
cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( nmi_enable_w )
{
bottom9_state *state = (bottom9_state *)space->machine->driver_data;
bottom9_state *state = space->machine->driver_data<bottom9_state>();
state->nmienable = data;
}
static WRITE8_HANDLER( sound_bank_w )
{
bottom9_state *state = (bottom9_state *)space->machine->driver_data;
bottom9_state *state = space->machine->driver_data<bottom9_state>();
int bank_A, bank_B;
bank_A = ((data >> 0) & 0x03);
@ -332,7 +332,7 @@ static const k051316_interface bottom9_k051316_intf =
static MACHINE_START( bottom9 )
{
bottom9_state *state = (bottom9_state *)machine->driver_data;
bottom9_state *state = machine->driver_data<bottom9_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
memory_configure_bank(machine, "bank1", 0, 12, &ROM[0x10000], 0x2000);
@ -353,7 +353,7 @@ static MACHINE_START( bottom9 )
static MACHINE_RESET( bottom9 )
{
bottom9_state *state = (bottom9_state *)machine->driver_data;
bottom9_state *state = machine->driver_data<bottom9_state>();
state->video_enable = 0;
state->zoomreadroms = 0;

View File

@ -20,12 +20,13 @@
*
*************************************/
class boxer_state
class boxer_state : public driver_data_t
{
public:
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, boxer_state(machine)); }
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, boxer_state(machine)); }
boxer_state(running_machine &machine) { }
boxer_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */
UINT8 * tile_ram;
@ -47,7 +48,7 @@ public:
static TIMER_CALLBACK( pot_interrupt )
{
boxer_state *state = (boxer_state *)machine->driver_data;
boxer_state *state = machine->driver_data<boxer_state>();
int mask = param;
if (state->pot_latch & mask)
@ -59,7 +60,7 @@ static TIMER_CALLBACK( pot_interrupt )
static TIMER_CALLBACK( periodic_callback )
{
boxer_state *state = (boxer_state *)machine->driver_data;
boxer_state *state = machine->driver_data<boxer_state>();
int scanline = param;
cpu_set_input_line(state->maincpu, 0, ASSERT_LINE);
@ -112,7 +113,7 @@ static PALETTE_INIT( boxer )
static void draw_boxer( running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect )
{
boxer_state *state = (boxer_state *)machine->driver_data;
boxer_state *state = machine->driver_data<boxer_state>();
int n;
for (n = 0; n < 2; n++)
@ -160,7 +161,7 @@ static void draw_boxer( running_machine *machine, bitmap_t* bitmap, const rectan
static VIDEO_UPDATE( boxer )
{
boxer_state *state = (boxer_state *)screen->machine->driver_data;
boxer_state *state = screen->machine->driver_data<boxer_state>();
int i, j;
bitmap_fill(bitmap, cliprect, 1);
@ -205,7 +206,7 @@ static READ8_HANDLER( boxer_input_r )
static READ8_HANDLER( boxer_misc_r )
{
boxer_state *state = (boxer_state *)space->machine->driver_data;
boxer_state *state = space->machine->driver_data<boxer_state>();
UINT8 val = 0;
switch (offset & 3)
@ -245,7 +246,7 @@ static WRITE8_HANDLER( boxer_sound_w )
static WRITE8_HANDLER( boxer_pot_w )
{
boxer_state *state = (boxer_state *)space->machine->driver_data;
boxer_state *state = space->machine->driver_data<boxer_state>();
/* BIT0 => HPOT1 */
/* BIT1 => VPOT1 */
/* BIT2 => RPOT1 */
@ -261,7 +262,7 @@ static WRITE8_HANDLER( boxer_pot_w )
static WRITE8_HANDLER( boxer_irq_reset_w )
{
boxer_state *state = (boxer_state *)space->machine->driver_data;
boxer_state *state = space->machine->driver_data<boxer_state>();
cpu_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
@ -418,7 +419,7 @@ GFXDECODE_END
static MACHINE_START( boxer )
{
boxer_state *state = (boxer_state *)machine->driver_data;
boxer_state *state = machine->driver_data<boxer_state>();
state->maincpu = machine->device("maincpu");
@ -428,7 +429,7 @@ static MACHINE_START( boxer )
static MACHINE_RESET( boxer )
{
boxer_state *state = (boxer_state *)machine->driver_data;
boxer_state *state = machine->driver_data<boxer_state>();
timer_set(machine, machine->primary_screen->time_until_pos(0), NULL, 0, periodic_callback);
state->pot_state = 0;

View File

@ -67,7 +67,7 @@
static WRITE8_HANDLER( brkthru_1803_w )
{
brkthru_state *state = (brkthru_state *)space->machine->driver_data;
brkthru_state *state = space->machine->driver_data<brkthru_state>();
/* bit 0 = NMI enable */
cpu_interrupt_enable(state->maincpu, ~data & 1);
@ -75,7 +75,7 @@ static WRITE8_HANDLER( brkthru_1803_w )
}
static WRITE8_HANDLER( darwin_0803_w )
{
brkthru_state *state = (brkthru_state *)space->machine->driver_data;
brkthru_state *state = space->machine->driver_data<brkthru_state>();
/* bit 0 = NMI enable */
/*cpu_interrupt_enable(state->audiocpu, ~data & 1);*/
logerror("0803 %02X\n",data);
@ -85,14 +85,14 @@ static WRITE8_HANDLER( darwin_0803_w )
static WRITE8_HANDLER( brkthru_soundlatch_w )
{
brkthru_state *state = (brkthru_state *)space->machine->driver_data;
brkthru_state *state = space->machine->driver_data<brkthru_state>();
soundlatch_w(space, offset, data);
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static INPUT_CHANGED( coin_inserted )
{
brkthru_state *state = (brkthru_state *)field->port->machine->driver_data;
brkthru_state *state = field->port->machine->driver_data<brkthru_state>();
/* coin insertion causes an IRQ */
cpu_set_input_line(state->maincpu, 0, newval ? CLEAR_LINE : ASSERT_LINE);
}
@ -346,7 +346,7 @@ GFXDECODE_END
/* handler called by the 3812 emulator when the internal timers cause an IRQ */
static void irqhandler( running_device *device, int linestate )
{
brkthru_state *state = (brkthru_state *)device->machine->driver_data;
brkthru_state *state = device->machine->driver_data<brkthru_state>();
cpu_set_input_line(state->audiocpu, M6809_IRQ_LINE, linestate);
}
@ -365,7 +365,7 @@ static const ym3526_interface ym3526_config =
static MACHINE_START( brkthru )
{
brkthru_state *state = (brkthru_state *)machine->driver_data;
brkthru_state *state = machine->driver_data<brkthru_state>();
state->maincpu = machine->device("maincpu");
state->audiocpu = machine->device("audiocpu");
@ -377,7 +377,7 @@ static MACHINE_START( brkthru )
static MACHINE_RESET( brkthru )
{
brkthru_state *state = (brkthru_state *)machine->driver_data;
brkthru_state *state = machine->driver_data<brkthru_state>();
state->bgscroll = 0;
state->bgbasecolor = 0;

View File

@ -212,7 +212,7 @@ GFXDECODE_END
static MACHINE_START( bsktball )
{
bsktball_state *state = (bsktball_state *)machine->driver_data;
bsktball_state *state = machine->driver_data<bsktball_state>();
state_save_register_global(machine, state->nmi_on);
state_save_register_global(machine, state->i256v);
@ -230,7 +230,7 @@ static MACHINE_START( bsktball )
static MACHINE_RESET( bsktball )
{
bsktball_state *state = (bsktball_state *)machine->driver_data;
bsktball_state *state = machine->driver_data<bsktball_state>();
state->nmi_on = 0;
state->i256v = 0;

View File

@ -166,7 +166,7 @@ static UINT8 *decrypted;
static WRITE8_HANDLER( audio_nmi_enable_w )
{
btime_state *state = (btime_state *)space->machine->driver_data;
btime_state *state = space->machine->driver_data<btime_state>();
/* for most games, this serves as the NMI enable for the audio CPU; however,
lnc and disco use bit 0 of the first AY-8910's port A instead; many other
@ -180,7 +180,7 @@ static WRITE8_HANDLER( audio_nmi_enable_w )
static WRITE8_DEVICE_HANDLER( ay_audio_nmi_enable_w )
{
btime_state *state = (btime_state *)device->machine->driver_data;
btime_state *state = device->machine->driver_data<btime_state>();
/* port A bit 0, when 1, inhibits the NMI */
if (state->audio_nmi_enable_type == AUDIO_ENABLE_AY8910)
@ -192,7 +192,7 @@ static WRITE8_DEVICE_HANDLER( ay_audio_nmi_enable_w )
static TIMER_DEVICE_CALLBACK( audio_nmi_gen )
{
btime_state *state = (btime_state *)timer.machine->driver_data;
btime_state *state = timer.machine->driver_data<btime_state>();
int scanline = param;
state->audio_nmi_state = scanline & 8;
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, (state->audio_nmi_enabled && state->audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
@ -208,7 +208,7 @@ INLINE UINT8 swap_bits_5_6(UINT8 data)
static void btime_decrypt( const address_space *space )
{
btime_state *state = (btime_state *)space->machine->driver_data;
btime_state *state = space->machine->driver_data<btime_state>();
UINT8 *src, *src1;
int addr, addr1;
@ -239,7 +239,7 @@ static void btime_decrypt( const address_space *space )
static WRITE8_HANDLER( lnc_w )
{
btime_state *state = (btime_state *)space->machine->driver_data;
btime_state *state = space->machine->driver_data<btime_state>();
if (offset <= 0x3bff) ;
else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space, offset - 0x3c00, data); return; }
@ -260,7 +260,7 @@ static WRITE8_HANDLER( lnc_w )
static WRITE8_HANDLER( mmonkey_w )
{
btime_state *state = (btime_state *)space->machine->driver_data;
btime_state *state = space->machine->driver_data<btime_state>();
if (offset <= 0x3bff) ;
else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space, offset - 0x3c00, data); return; }
@ -280,7 +280,7 @@ static WRITE8_HANDLER( mmonkey_w )
static WRITE8_HANDLER( btime_w )
{
btime_state *state = (btime_state *)space->machine->driver_data;
btime_state *state = space->machine->driver_data<btime_state>();
if (offset <= 0x07ff) ;
else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(space, offset - 0x0c00, data);
@ -299,7 +299,7 @@ static WRITE8_HANDLER( btime_w )
static WRITE8_HANDLER( tisland_w )
{
btime_state *state = (btime_state *)space->machine->driver_data;
btime_state *state = space->machine->driver_data<btime_state>();
if (offset <= 0x07ff) ;
else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(space, offset - 0x0c00, data);
@ -320,7 +320,7 @@ static WRITE8_HANDLER( tisland_w )
static WRITE8_HANDLER( zoar_w )
{
btime_state *state = (btime_state *)space->machine->driver_data;
btime_state *state = space->machine->driver_data<btime_state>();
if (offset <= 0x07ff) ;
else if (offset >= 0x8000 && offset <= 0x87ff) ;
@ -340,7 +340,7 @@ static WRITE8_HANDLER( zoar_w )
static WRITE8_HANDLER( disco_w )
{
btime_state *state = (btime_state *)space->machine->driver_data;
btime_state *state = space->machine->driver_data<btime_state>();
if (offset <= 0x04ff) ;
else if (offset >= 0x2000 && offset <= 0x7fff) deco_charram_w(space, offset - 0x2000, data);
@ -525,7 +525,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( coin_inserted_irq_hi )
{
btime_state *state = (btime_state *)field->port->machine->driver_data;
btime_state *state = field->port->machine->driver_data<btime_state>();
if (newval)
cpu_set_input_line(state->maincpu, 0, HOLD_LINE);
@ -533,7 +533,7 @@ static INPUT_CHANGED( coin_inserted_irq_hi )
static INPUT_CHANGED( coin_inserted_irq_lo )
{
btime_state *state = (btime_state *)field->port->machine->driver_data;
btime_state *state = field->port->machine->driver_data<btime_state>();
if (!newval)
cpu_set_input_line(state->maincpu, 0, HOLD_LINE);
@ -541,21 +541,21 @@ static INPUT_CHANGED( coin_inserted_irq_lo )
static INPUT_CHANGED( coin_inserted_nmi_lo )
{
btime_state *state = (btime_state *)field->port->machine->driver_data;
btime_state *state = field->port->machine->driver_data<btime_state>();
cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_HANDLER( audio_command_w )
{
btime_state *state = (btime_state *)space->machine->driver_data;
btime_state *state = space->machine->driver_data<btime_state>();
soundlatch_w(space, offset, data);
cpu_set_input_line(state->audiocpu, 0, ASSERT_LINE);
}
static READ8_HANDLER( audio_command_r )
{
btime_state *state = (btime_state *)space->machine->driver_data;
btime_state *state = space->machine->driver_data<btime_state>();
cpu_set_input_line(state->audiocpu, 0, CLEAR_LINE);
return soundlatch_r(space, offset);
}
@ -1425,7 +1425,7 @@ DISCRETE_SOUND_END
static MACHINE_START( btime )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
state->maincpu = machine->device("maincpu");
state->audiocpu = machine->device("audiocpu");
@ -1440,7 +1440,7 @@ static MACHINE_START( btime )
static MACHINE_START( mmonkey )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
MACHINE_START_CALL(btime);
@ -1452,7 +1452,7 @@ static MACHINE_START( mmonkey )
static MACHINE_RESET( btime )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
/* by default, the audio NMI is disabled, except for bootlegs which don't use the enable */
state->audio_nmi_enabled = (state->audio_nmi_enable_type == AUDIO_ENABLE_NONE);
@ -1469,7 +1469,7 @@ static MACHINE_RESET( btime )
static MACHINE_RESET( lnc )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
*state->lnc_charbank = 1;
MACHINE_RESET_CALL(btime);
@ -1477,7 +1477,7 @@ static MACHINE_RESET( lnc )
static MACHINE_RESET( mmonkey )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
MACHINE_RESET_CALL(lnc);
@ -2121,14 +2121,14 @@ static void init_rom1(running_machine *machine)
static DRIVER_INIT( btime )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
init_rom1(machine);
state->audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
}
static DRIVER_INIT( zoar )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
UINT8 *rom = memory_region(machine, "maincpu");
/* At location 0xD50A is what looks like an undocumented opcode. I tried
@ -2143,7 +2143,7 @@ static DRIVER_INIT( zoar )
static DRIVER_INIT( tisland )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
UINT8 *rom = memory_region(machine, "maincpu");
/* At location 0xa2b6 there's a strange RLA followed by a BPL that reads from an
@ -2158,28 +2158,28 @@ static DRIVER_INIT( tisland )
static DRIVER_INIT( lnc )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
state->audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
static DRIVER_INIT( bnj )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
state->audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
}
static DRIVER_INIT( disco )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
DRIVER_INIT_CALL(btime);
state->audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
static DRIVER_INIT( cookrace )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
memory_install_read_bank(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), 0x0200, 0x0fff, 0, 0, "bank10");
@ -2189,14 +2189,14 @@ static DRIVER_INIT( cookrace )
static DRIVER_INIT( protennb )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
DRIVER_INIT_CALL(btime);
state->audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
static DRIVER_INIT( wtennis )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc15f, 0xc15f, 0, 0, wtennis_reset_hack_r);
@ -2208,7 +2208,7 @@ static DRIVER_INIT( wtennis )
static DRIVER_INIT( sdtennis )
{
btime_state *state = (btime_state *)machine->driver_data;
btime_state *state = machine->driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
decrypt_C10707_cpu(machine, "audiocpu");
state->audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;

View File

@ -699,7 +699,7 @@ GFXDECODE_END
// handler called by the 2203 emulator when the internal timers cause an IRQ
static void irqhandler(running_device *device, int irq)
{
bublbobl_state *state = (bublbobl_state *)device->machine->driver_data;
bublbobl_state *state = device->machine->driver_data<bublbobl_state>();
cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@ -723,7 +723,7 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( common )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
bublbobl_state *state = machine->driver_data<bublbobl_state>();
state->maincpu = machine->device("maincpu");
state->mcu = machine->device("mcu");
@ -738,7 +738,7 @@ static MACHINE_START( common )
static MACHINE_RESET( common )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
bublbobl_state *state = machine->driver_data<bublbobl_state>();
state->sound_nmi_enable = 0;
state->pending_nmi = 0;
@ -748,7 +748,7 @@ static MACHINE_RESET( common )
static MACHINE_START( tokio )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
bublbobl_state *state = machine->driver_data<bublbobl_state>();
MACHINE_START_CALL(common);
@ -757,7 +757,7 @@ static MACHINE_START( tokio )
static MACHINE_RESET( tokio )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
bublbobl_state *state = machine->driver_data<bublbobl_state>();
MACHINE_RESET_CALL(common);
@ -810,7 +810,7 @@ MACHINE_DRIVER_END
static MACHINE_START( bublbobl )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
bublbobl_state *state = machine->driver_data<bublbobl_state>();
MACHINE_START_CALL(common);
@ -830,7 +830,7 @@ static MACHINE_START( bublbobl )
static MACHINE_RESET( bublbobl )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
bublbobl_state *state = machine->driver_data<bublbobl_state>();
MACHINE_RESET_CALL(common);
@ -898,7 +898,7 @@ MACHINE_DRIVER_END
static MACHINE_START( boblbobl )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
bublbobl_state *state = machine->driver_data<bublbobl_state>();
MACHINE_START_CALL(common);
@ -908,7 +908,7 @@ static MACHINE_START( boblbobl )
static MACHINE_RESET( boblbobl )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
bublbobl_state *state = machine->driver_data<bublbobl_state>();
MACHINE_RESET_CALL(common);
@ -932,7 +932,7 @@ MACHINE_DRIVER_END
static MACHINE_START( bub68705 )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
bublbobl_state *state = machine->driver_data<bublbobl_state>();
MACHINE_START_CALL(common);
@ -948,7 +948,7 @@ static MACHINE_START( bub68705 )
static MACHINE_RESET( bub68705 )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
bublbobl_state *state = machine->driver_data<bublbobl_state>();
MACHINE_RESET_CALL(common);
@ -1543,7 +1543,7 @@ static void configure_banks( running_machine* machine )
static DRIVER_INIT( bublbobl )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
bublbobl_state *state = machine->driver_data<bublbobl_state>();
configure_banks(machine);
@ -1553,7 +1553,7 @@ static DRIVER_INIT( bublbobl )
static DRIVER_INIT( tokio )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
bublbobl_state *state = machine->driver_data<bublbobl_state>();
configure_banks(machine);
/* preemptively enable video, the bit is not mapped for this game and */

View File

@ -93,7 +93,7 @@ static WRITE8_HANDLER( bankswitch_w )
static TIMER_CALLBACK( nmi_callback )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
if (state->sound_nmi_enable)
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@ -109,13 +109,13 @@ static WRITE8_HANDLER( sound_command_w )
static WRITE8_HANDLER( nmi_disable_w )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
buggychl_state *state = (buggychl_state *)space->machine->driver_data;
buggychl_state *state = space->machine->driver_data<buggychl_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
@ -372,7 +372,7 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( buggychl )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x2000);
@ -406,7 +406,7 @@ static MACHINE_START( buggychl )
static MACHINE_RESET( buggychl )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
buggychl_state *state = machine->driver_data<buggychl_state>();
cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE);

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