BIG update.

Remove redundant machine items from address_space and device_t.
Neither machine nor m_machine are directly accessible anymore.
Instead a new getter machine() is available which returns a
machine reference. So:

  space->machine->xxx   ==>  space->machine().xxx
  device->machine->yyy  ==>  device->machine().yyy

Globally changed all running_machine pointers to running_machine
references. Any function/method that takes a running_machine takes
it as a required parameter (1 or 2 exceptions). Being consistent
here gets rid of a lot of odd &machine or *machine, but it does
mean a very large bulk change across the project.

Structs which have a running_machine * now have that variable
renamed to m_machine, and now have a shiny new machine() method
that works like the space and device methods above. Since most of
these are things that should eventually be devices anyway, consider
this a step in that direction.

98% of the update was done with regex searches. The changes are
architected such that the compiler will catch the remaining
errors:

// find things that use an embedded machine directly and replace
// with a machine() getter call
S: ->machine->
R: ->machine\(\)\.

// do the same if via a reference
S: \.machine->
R: \.machine\(\)\.

// convert function parameters to running_machine &
S: running_machine \*machine([^;])
R: running_machine \&machine\1

// replace machine-> with machine.
S: machine->
R: machine\.

// replace &machine() with machine()
S: \&([()->a-z0-9_]+machine\(\))
R: \1

// sanity check: look for this used as a cast
(running_machine &)
// and change to this:
*(running_machine *)
This commit is contained in:
Aaron Giles 2011-03-29 15:50:04 +00:00
parent b72cf3c570
commit 2ad5072023
2557 changed files with 54142 additions and 54089 deletions

View File

@ -35,11 +35,11 @@ struct _generic_audio_private
register for save states
-------------------------------------------------*/
int generic_sound_init(running_machine *machine)
int generic_sound_init(running_machine &machine)
{
generic_audio_private *state;
state = machine->generic_audio_data = auto_alloc_clear(machine, generic_audio_private);
state = machine.generic_audio_data = auto_alloc_clear(machine, generic_audio_private);
/* register globals with the save state system */
state_save_register_global_array(machine, state->latched_value);
@ -67,7 +67,7 @@ int generic_sound_init(running_machine *machine)
static TIMER_CALLBACK( latch_callback )
{
generic_audio_private *state = machine->generic_audio_data;
generic_audio_private *state = machine.generic_audio_data;
UINT16 value = param >> 8;
int which = param & 0xff;
@ -87,7 +87,7 @@ static TIMER_CALLBACK( latch_callback )
INLINE void latch_w(address_space *space, int which, UINT16 value)
{
space->machine->scheduler().synchronize(FUNC(latch_callback), which | (value << 8));
space->machine().scheduler().synchronize(FUNC(latch_callback), which | (value << 8));
}
@ -97,7 +97,7 @@ INLINE void latch_w(address_space *space, int which, UINT16 value)
INLINE UINT16 latch_r(address_space *space, int which)
{
generic_audio_private *state = space->machine->generic_audio_data;
generic_audio_private *state = space->machine().generic_audio_data;
state->latch_read[which] = 1;
return state->latched_value[which];
}
@ -109,7 +109,7 @@ INLINE UINT16 latch_r(address_space *space, int which)
INLINE void latch_clear(address_space *space, int which)
{
generic_audio_private *state = space->machine->generic_audio_data;
generic_audio_private *state = space->machine().generic_audio_data;
state->latched_value[which] = state->latch_clear_value;
}
@ -160,9 +160,9 @@ WRITE8_HANDLER( soundlatch4_clear_w ) { latch_clear(space, 3); }
value for all sound latches
-------------------------------------------------*/
void soundlatch_setclearedvalue(running_machine *machine, int value)
void soundlatch_setclearedvalue(running_machine &machine, int value)
{
generic_audio_private *state = machine->generic_audio_data;
assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call soundlatch_setclearedvalue at init time!");
generic_audio_private *state = machine.generic_audio_data;
assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call soundlatch_setclearedvalue at init time!");
state->latch_clear_value = value;
}

View File

@ -22,7 +22,7 @@
***************************************************************************/
int generic_sound_init(running_machine *machine);
int generic_sound_init(running_machine &machine);
/* latch readers */
READ8_HANDLER( soundlatch_r );
@ -53,7 +53,7 @@ WRITE8_HANDLER( soundlatch4_clear_w );
/* If you're going to use soundlatchX_clear_w, and the cleared value is
something other than 0x00, use this function from machine_init. Note
that this one call effects all 4 latches */
void soundlatch_setclearedvalue(running_machine *machine, int value);
void soundlatch_setclearedvalue(running_machine &machine, int value);
#endif /* __SOUND_GENERIC_H__ */

View File

@ -190,7 +190,7 @@ cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols,
int format = xml_get_attribute_int_format(itemnode, "value");
// allocate and append a new item
item &curitem = m_itemlist.append(*auto_alloc(&manager.machine(), item(itemnode->value, value, format)));
item &curitem = m_itemlist.append(*auto_alloc(manager.machine(), item(itemnode->value, value, format)));
// ensure the maximum expands to suit
m_maxval = MAX(m_maxval, curitem.value());
@ -366,11 +366,11 @@ cheat_script::cheat_script(cheat_manager &manager, symbol_table &symbols, const
{
// handle action nodes
if (strcmp(entrynode->name, "action") == 0)
m_entrylist.append(*auto_alloc(&manager.machine(), script_entry(manager, symbols, filename, *entrynode, true)));
m_entrylist.append(*auto_alloc(manager.machine(), script_entry(manager, symbols, filename, *entrynode, true)));
// handle output nodes
else if (strcmp(entrynode->name, "output") == 0)
m_entrylist.append(*auto_alloc(&manager.machine(), script_entry(manager, symbols, filename, *entrynode, false)));
m_entrylist.append(*auto_alloc(manager.machine(), script_entry(manager, symbols, filename, *entrynode, false)));
// anything else is ignored
else
@ -476,7 +476,7 @@ cheat_script::script_entry::script_entry(cheat_manager &manager, symbol_table &s
int totalargs = 0;
for (xml_data_node *argnode = xml_get_sibling(entrynode.child, "argument"); argnode != NULL; argnode = xml_get_sibling(argnode->next, "argument"))
{
output_argument &curarg = m_arglist.append(*auto_alloc(&manager.machine(), output_argument(manager, symbols, filename, *argnode)));
output_argument &curarg = m_arglist.append(*auto_alloc(manager.machine(), output_argument(manager, symbols, filename, *argnode)));
// verify we didn't overrun the argument count
totalargs += curarg.count();
@ -766,7 +766,7 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons
if (paramnode != NULL)
{
// load this parameter
m_parameter = auto_alloc(&manager.machine(), cheat_parameter(manager, m_symbols, filename, *paramnode));
m_parameter = auto_alloc(manager.machine(), cheat_parameter(manager, m_symbols, filename, *paramnode));
// only one parameter allowed
paramnode = xml_get_sibling(paramnode->next, "parameter");
@ -778,7 +778,7 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons
for (xml_data_node *scriptnode = xml_get_sibling(cheatnode.child, "script"); scriptnode != NULL; scriptnode = xml_get_sibling(scriptnode->next, "script"))
{
// load this entry
cheat_script *curscript = auto_alloc(&manager.machine(), cheat_script(manager, m_symbols, filename, *scriptnode));
cheat_script *curscript = auto_alloc(manager.machine(), cheat_script(manager, m_symbols, filename, *scriptnode));
// if we have a script already for this slot, it is an error
cheat_script *&slot = script_for_state(curscript->state());
@ -803,11 +803,11 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons
cheat_entry::~cheat_entry()
{
auto_free(&m_manager.machine(), m_on_script);
auto_free(&m_manager.machine(), m_off_script);
auto_free(&m_manager.machine(), m_change_script);
auto_free(&m_manager.machine(), m_run_script);
auto_free(&m_manager.machine(), m_parameter);
auto_free(m_manager.machine(), m_on_script);
auto_free(m_manager.machine(), m_off_script);
auto_free(m_manager.machine(), m_change_script);
auto_free(m_manager.machine(), m_run_script);
auto_free(m_manager.machine(), m_parameter);
}
@ -1107,7 +1107,7 @@ cheat_manager::cheat_manager(running_machine &machine)
// we rely on the debugger expression callbacks; if the debugger isn't
// enabled, we must jumpstart them manually
if ((machine.debug_flags & DEBUG_FLAG_ENABLED) == 0)
debug_cpu_init(&machine);
debug_cpu_init(machine);
// configure for memory access (shared with debugger)
debug_cpu_configure_memory(machine, m_symtable);
@ -1446,7 +1446,7 @@ void cheat_manager::load_cheats(const char *filename)
for (xml_data_node *cheatnode = xml_get_sibling(mamecheatnode->child, "cheat"); cheatnode != NULL; cheatnode = xml_get_sibling(cheatnode->next, "cheat"))
{
// load this entry
cheat_entry *curcheat = auto_alloc(&m_machine, cheat_entry(*this, m_symtable, filename, *cheatnode));
cheat_entry *curcheat = auto_alloc(m_machine, cheat_entry(*this, m_symtable, filename, *cheatnode));
// make sure we're not a duplicate
cheat_entry *scannode = NULL;
@ -1462,7 +1462,7 @@ void cheat_manager::load_cheats(const char *filename)
if (scannode == NULL)
m_cheatlist.append(*curcheat);
else
auto_free(&m_machine, curcheat);
auto_free(m_machine, curcheat);
}
// free the file and loop for the next one

View File

@ -46,8 +46,8 @@ static config_type *typelist;
FUNCTION PROTOTYPES
***************************************************************************/
static int config_load_xml(running_machine *machine, emu_file &file, int type);
static int config_save_xml(running_machine *machine, emu_file &file, int type);
static int config_load_xml(running_machine &machine, emu_file &file, int type);
static int config_save_xml(running_machine &machine, emu_file &file, int type);
@ -61,7 +61,7 @@ static int config_save_xml(running_machine *machine, emu_file &file, int type);
*
*************************************/
void config_init(running_machine *machine)
void config_init(running_machine &machine)
{
typelist = NULL;
}
@ -75,7 +75,7 @@ void config_init(running_machine *machine)
*
*************************************/
void config_register(running_machine *machine, const char *nodename, config_callback_func load, config_callback_func save)
void config_register(running_machine &machine, const char *nodename, config_callback_func load, config_callback_func save)
{
config_type *newtype;
config_type **ptype;
@ -100,9 +100,9 @@ void config_register(running_machine *machine, const char *nodename, config_call
*
*************************************/
int config_load_settings(running_machine *machine)
int config_load_settings(running_machine &machine)
{
const char *controller = machine->options().ctrlr();
const char *controller = machine.options().ctrlr();
config_type *type;
int loaded = 0;
@ -114,7 +114,7 @@ int config_load_settings(running_machine *machine)
if (controller[0] != 0)
{
/* open the config file */
emu_file file(machine->options().ctrlr_path(), OPEN_FLAG_READ);
emu_file file(machine.options().ctrlr_path(), OPEN_FLAG_READ);
file_error filerr = file.open(controller, ".cfg");
if (filerr != FILERR_NONE)
@ -126,13 +126,13 @@ int config_load_settings(running_machine *machine)
}
/* next load the defaults file */
emu_file file(machine->options().cfg_directory(), OPEN_FLAG_READ);
emu_file file(machine.options().cfg_directory(), OPEN_FLAG_READ);
file_error filerr = file.open("default.cfg");
if (filerr == FILERR_NONE)
config_load_xml(machine, file, CONFIG_TYPE_DEFAULT);
/* finally, load the game-specific file */
filerr = file.open(machine->basename(), ".cfg");
filerr = file.open(machine.basename(), ".cfg");
if (filerr == FILERR_NONE)
loaded = config_load_xml(machine, file, CONFIG_TYPE_GAME);
@ -146,7 +146,7 @@ int config_load_settings(running_machine *machine)
}
void config_save_settings(running_machine *machine)
void config_save_settings(running_machine &machine)
{
config_type *type;
@ -155,13 +155,13 @@ void config_save_settings(running_machine *machine)
(*type->save)(machine, CONFIG_TYPE_INIT, NULL);
/* save the defaults file */
emu_file file(machine->options().cfg_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
emu_file file(machine.options().cfg_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
file_error filerr = file.open("default.cfg");
if (filerr == FILERR_NONE)
config_save_xml(machine, file, CONFIG_TYPE_DEFAULT);
/* finally, save the game-specific file */
filerr = file.open(machine->basename(), ".cfg");
filerr = file.open(machine.basename(), ".cfg");
if (filerr == FILERR_NONE)
config_save_xml(machine, file, CONFIG_TYPE_GAME);
@ -178,7 +178,7 @@ void config_save_settings(running_machine *machine)
*
*************************************/
static int config_load_xml(running_machine *machine, emu_file &file, int which_type)
static int config_load_xml(running_machine &machine, emu_file &file, int which_type)
{
xml_data_node *root, *confignode, *systemnode;
config_type *type;
@ -201,13 +201,13 @@ static int config_load_xml(running_machine *machine, emu_file &file, int which_t
goto error;
/* strip off all the path crap from the source filename */
srcfile = strrchr(machine->system().source_file, '/');
srcfile = strrchr(machine.system().source_file, '/');
if (!srcfile)
srcfile = strrchr(machine->system().source_file, '\\');
srcfile = strrchr(machine.system().source_file, '\\');
if (!srcfile)
srcfile = strrchr(machine->system().source_file, ':');
srcfile = strrchr(machine.system().source_file, ':');
if (!srcfile)
srcfile = machine->system().source_file;
srcfile = machine.system().source_file;
else
srcfile++;
@ -223,7 +223,7 @@ static int config_load_xml(running_machine *machine, emu_file &file, int which_t
{
case CONFIG_TYPE_GAME:
/* only match on the specific game name */
if (strcmp(name, machine->system().name) != 0)
if (strcmp(name, machine.system().name) != 0)
continue;
break;
@ -238,9 +238,9 @@ static int config_load_xml(running_machine *machine, emu_file &file, int which_t
const game_driver *clone_of;
/* match on: default, game name, source file name, parent name, grandparent name */
if (strcmp(name, "default") != 0 &&
strcmp(name, machine->system().name) != 0 &&
strcmp(name, machine.system().name) != 0 &&
strcmp(name, srcfile) != 0 &&
((clone_of = driver_get_clone(&machine->system())) == NULL || strcmp(name, clone_of->name) != 0) &&
((clone_of = driver_get_clone(&machine.system())) == NULL || strcmp(name, clone_of->name) != 0) &&
(clone_of == NULL || ((clone_of = driver_get_clone(clone_of)) == NULL) || strcmp(name, clone_of->name) != 0))
continue;
break;
@ -279,7 +279,7 @@ error:
*
*************************************/
static int config_save_xml(running_machine *machine, emu_file &file, int which_type)
static int config_save_xml(running_machine &machine, emu_file &file, int which_type)
{
xml_data_node *root = xml_file_create();
xml_data_node *confignode, *systemnode;
@ -299,7 +299,7 @@ static int config_save_xml(running_machine *machine, emu_file &file, int which_t
systemnode = xml_add_child(confignode, "system", NULL);
if (!systemnode)
goto error;
xml_set_attribute(systemnode, "name", (which_type == CONFIG_TYPE_DEFAULT) ? "default" : machine->system().name);
xml_set_attribute(systemnode, "name", (which_type == CONFIG_TYPE_DEFAULT) ? "default" : machine.system().name);
/* create the input node and write it out */
/* loop over all registrants and call their save function */

View File

@ -43,7 +43,7 @@ enum
*
*************************************/
typedef void (*config_callback_func)(running_machine *machine, int config_type, xml_data_node *parentnode);
typedef void (*config_callback_func)(running_machine &machine, int config_type, xml_data_node *parentnode);
@ -53,9 +53,9 @@ typedef void (*config_callback_func)(running_machine *machine, int config_type,
*
*************************************/
void config_init(running_machine *machine);
void config_register(running_machine *machine, const char *nodename, config_callback_func load, config_callback_func save);
int config_load_settings(running_machine *machine);
void config_save_settings(running_machine *machine);
void config_init(running_machine &machine);
void config_register(running_machine &machine, const char *nodename, config_callback_func load, config_callback_func save);
int config_load_settings(running_machine &machine);
void config_save_settings(running_machine &machine);
#endif /* __CONFIG_H__ */

View File

@ -211,17 +211,17 @@ device_config *adsp2181_device_config::static_alloc_device_config(const machine_
device_t *adsp2100_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, adsp2100_device(machine, *this));
return auto_alloc(machine, adsp2100_device(machine, *this));
}
device_t *adsp2101_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, adsp2101_device(machine, *this));
return auto_alloc(machine, adsp2101_device(machine, *this));
}
device_t *adsp2181_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, adsp2181_device(machine, *this));
return auto_alloc(machine, adsp2181_device(machine, *this));
}

View File

@ -298,7 +298,7 @@ INLINE void M_UNDEFINED(alpha8201_state *cpustate)
mame_printf_debug("alpha8201: cpustate->PC = %03x, Unimplemented opcode = %02x\n", cpustate->PC-1, M_RDMEM(cpustate->PC-1));
#endif
#if BREAK_ON_UNKNOWN_OPCODE
debugger_break(cpustate->device->machine);
debugger_break(cpustate->device->machine());
#endif
}
@ -311,7 +311,7 @@ INLINE void M_UNDEFINED2(alpha8201_state *cpustate)
mame_printf_debug("alpha8201: cpustate->PC = %03x, Unimplemented opcode = %02x,%02x\n", cpustate->PC-2, op,imm);
#endif
#if BREAK_ON_UNKNOWN_OPCODE
debugger_break(cpustate->device->machine);
debugger_break(cpustate->device->machine());
#endif
}

View File

@ -388,7 +388,7 @@ INLINE void fetch_decode(am29000_state *am29000)
static CPU_EXECUTE( am29000 )
{
am29000_state *am29000 = get_safe_token(device);
UINT32 call_debugger = (device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0;
UINT32 call_debugger = (device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0;
external_irq_check(am29000);

View File

@ -194,7 +194,7 @@ device_config *asap_device_config::static_alloc_device_config(const machine_conf
device_t *asap_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, asap_device(machine, *this));
return auto_alloc(machine, asap_device(machine, *this));
}

View File

@ -886,14 +886,14 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
/* allocate serial timer */
cpustate->serial_timer = device->machine->scheduler().timer_alloc(FUNC(serial_tick), cpustate);
cpustate->serial_timer = device->machine().scheduler().timer_alloc(FUNC(serial_tick), cpustate);
cpustate->serial_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16));
/* allocate counter timer */
if (has_counter)
{
cpustate->counter_timer = device->machine->scheduler().timer_alloc(FUNC(counter_tick), cpustate);
cpustate->counter_timer = device->machine().scheduler().timer_alloc(FUNC(counter_tick), cpustate);
cpustate->counter_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16 / 4));
}
@ -901,7 +901,7 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
if (has_inil)
{
cpustate->inil_timer = device->machine->scheduler().timer_alloc(FUNC(inil_tick), cpustate);
cpustate->inil_timer = device->machine().scheduler().timer_alloc(FUNC(inil_tick), cpustate);
cpustate->inil_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16));
}
@ -909,7 +909,7 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
if (cpustate->intf->microbus == COP400_MICROBUS_ENABLED)
{
cpustate->microbus_timer = device->machine->scheduler().timer_alloc(FUNC(microbus_tick), cpustate);
cpustate->microbus_timer = device->machine().scheduler().timer_alloc(FUNC(microbus_tick), cpustate);
cpustate->microbus_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16));
}

View File

@ -214,7 +214,7 @@ device_config *cosmac_device_config::static_alloc_device_config(const machine_co
device_t *cosmac_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, cosmac_device(machine, *this));
return auto_alloc(machine, cosmac_device(machine, *this));
}

View File

@ -275,7 +275,7 @@ static void cquestsnd_state_register(device_t *device)
device->save_item(NAME(cpustate->prev_ipram));
device->save_item(NAME(cpustate->prev_ipwrt));
device->machine->state().register_postload(cquestsnd_postload, (void *)device);
device->machine().state().register_postload(cquestsnd_postload, (void *)device);
}
static CPU_INIT( cquestsnd )
@ -286,14 +286,14 @@ static CPU_INIT( cquestsnd )
memset(cpustate, 0, sizeof(*cpustate));
cpustate->dac_w = _config->dac_w;
cpustate->sound_data = (UINT16*)device->machine->region(_config->sound_data_region)->base();
cpustate->sound_data = (UINT16*)device->machine().region(_config->sound_data_region)->base();
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
/* Allocate RAM shared with 68000 */
cpustate->sram = auto_alloc_array(device->machine, UINT16, 4096/2);
cpustate->sram = auto_alloc_array(device->machine(), UINT16, 4096/2);
cquestsnd_state_register(device);
}
@ -349,7 +349,7 @@ static void cquestrot_state_register(device_t *device)
device->save_pointer(NAME(cpustate->dram), 16384);
device->save_pointer(NAME(cpustate->sram), 2048);
device->machine->state().register_postload(cquestrot_postload, (void *)device);
device->machine().state().register_postload(cquestrot_postload, (void *)device);
}
static CPU_INIT( cquestrot )
@ -359,11 +359,11 @@ static CPU_INIT( cquestrot )
memset(cpustate, 0, sizeof(*cpustate));
/* Allocate RAM */
cpustate->dram = auto_alloc_array(device->machine, UINT16, 16384); /* Shared with 68000 */
cpustate->sram = auto_alloc_array(device->machine, UINT16, 2048); /* Private */
cpustate->dram = auto_alloc_array(device->machine(), UINT16, 16384); /* Shared with 68000 */
cpustate->sram = auto_alloc_array(device->machine(), UINT16, 2048); /* Private */
cpustate->device = device;
cpustate->lindevice = device->machine->device<legacy_cpu_device>(rotconfig->lin_cpu_tag);
cpustate->lindevice = device->machine().device<legacy_cpu_device>(rotconfig->lin_cpu_tag);
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
@ -433,7 +433,7 @@ static void cquestlin_state_register(device_t *device)
device->save_pointer(NAME(cpustate->e_stack), 32768);
device->save_pointer(NAME(cpustate->o_stack), 32768);
device->machine->state().register_postload(cquestlin_postload, (void *)device);
device->machine().state().register_postload(cquestlin_postload, (void *)device);
}
static CPU_INIT( cquestlin )
@ -443,13 +443,13 @@ static CPU_INIT( cquestlin )
memset(cpustate, 0, sizeof(*cpustate));
/* Allocate RAM */
cpustate->sram = auto_alloc_array(device->machine, UINT16, 4096); /* Shared with rotate CPU */
cpustate->ptr_ram = auto_alloc_array(device->machine, UINT8, 1024); /* Pointer RAM */
cpustate->e_stack = auto_alloc_array(device->machine, UINT32, 32768); /* Stack DRAM: 32kx20 */
cpustate->o_stack = auto_alloc_array(device->machine, UINT32, 32768); /* Stack DRAM: 32kx20 */
cpustate->sram = auto_alloc_array(device->machine(), UINT16, 4096); /* Shared with rotate CPU */
cpustate->ptr_ram = auto_alloc_array(device->machine(), UINT8, 1024); /* Pointer RAM */
cpustate->e_stack = auto_alloc_array(device->machine(), UINT32, 32768); /* Stack DRAM: 32kx20 */
cpustate->o_stack = auto_alloc_array(device->machine(), UINT32, 32768); /* Stack DRAM: 32kx20 */
cpustate->device = device;
cpustate->rotdevice = device->machine->device<legacy_cpu_device>(linconfig->rot_cpu_tag);
cpustate->rotdevice = device->machine().device<legacy_cpu_device>(linconfig->rot_cpu_tag);
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
@ -503,7 +503,7 @@ static int do_sndjmp(cquestsnd_state *cpustate, int jmp)
static CPU_EXECUTE( cquestsnd )
{
cquestsnd_state *cpustate = get_safe_token_snd(device);
int calldebugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
int calldebugger = ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
/* Core execution loop */
do
@ -764,7 +764,7 @@ static CPU_EXECUTE( cquestrot )
{
cquestrot_state *cpustate = get_safe_token_rot(device);
cquestlin_state *lincpustate = get_safe_token_lin(cpustate->lindevice);
int calldebugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
int calldebugger = ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
/* Core execution loop */
do
@ -1177,7 +1177,7 @@ static CPU_EXECUTE( cquestlin )
cquestlin_state *cpustate = get_safe_token_lin(device);
cquestrot_state *rotcpustate = get_safe_token_rot(cpustate->rotdevice);
int calldebugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
int calldebugger = ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
UINT32 *stack_ram;
UINT8 *ptr_ram;

View File

@ -2781,13 +2781,13 @@ void drcbe_x64::op_debug(x86code *&dst, const instruction &inst)
assert_no_condition(inst);
assert_no_flags(inst);
if ((m_device.machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((m_device.machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
// normalize parameters
be_parameter pcp(*this, inst.param(0), PTYPE_MRI);
// test and branch
emit_mov_r64_imm(dst, REG_RAX, (FPTR)&m_device.machine->debug_flags); // mov rax,&debug_flags
emit_mov_r64_imm(dst, REG_RAX, (FPTR)m_device.machine().debug_flags); // mov rax,&debug_flags
emit_test_m32_imm(dst, MBD(REG_RAX, 0), DEBUG_FLAG_CALL_HOOK); // test [debug_flags],DEBUG_FLAG_CALL_HOOK
emit_link skip = { 0 };
emit_jcc_short_link(dst, x64emit::COND_Z, skip); // jz skip

View File

@ -3012,13 +3012,13 @@ void drcbe_x86::op_debug(x86code *&dst, const instruction &inst)
assert_no_condition(inst);
assert_no_flags(inst);
if ((m_device.machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((m_device.machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
// normalize parameters
be_parameter pcp(*this, inst.param(0), PTYPE_MRI);
// test and branch
emit_test_m32_imm(dst, MABS(&m_device.machine->debug_flags), DEBUG_FLAG_CALL_HOOK); // test [debug_flags],DEBUG_FLAG_CALL_HOOK
emit_test_m32_imm(dst, MABS(&m_device.machine().debug_flags), DEBUG_FLAG_CALL_HOOK); // test [debug_flags],DEBUG_FLAG_CALL_HOOK
emit_link skip = { 0 };
emit_jcc_short_link(dst, x86emit::COND_Z, skip); // jz skip

View File

@ -84,9 +84,9 @@ drc_frontend::drc_frontend(device_t &cpu, UINT32 window_start, UINT32 window_end
m_cpudevice(downcast<cpu_device &>(cpu)),
m_program(m_cpudevice.space(AS_PROGRAM)),
m_pageshift(m_cpudevice.space_config(AS_PROGRAM)->m_page_shift),
m_desc_live_list(cpu.machine->respool()),
m_desc_allocator(cpu.machine->respool()),
m_desc_array(auto_alloc_array_clear(cpu.machine, opcode_desc *, window_end + window_start + 2))
m_desc_live_list(cpu.machine().respool()),
m_desc_allocator(cpu.machine().respool()),
m_desc_array(auto_alloc_array_clear(cpu.machine(), opcode_desc *, window_end + window_start + 2))
{
}
@ -101,7 +101,7 @@ drc_frontend::~drc_frontend()
release_descriptions();
// free the description array
auto_free(m_cpudevice.machine, m_desc_array);
auto_free(m_cpudevice.machine(), m_desc_array);
}

View File

@ -151,11 +151,11 @@ drcuml_state::drcuml_state(device_t &device, drc_cache &cache, UINT32 flags, int
: m_device(device),
m_cache(cache),
m_beintf((flags & DRCUML_OPTION_USE_C) ?
*static_cast<drcbe_interface *>(auto_alloc(device.machine, drcbe_c(*this, device, cache, flags, modes, addrbits, ignorebits))) :
*static_cast<drcbe_interface *>(auto_alloc(device.machine, drcbe_native(*this, device, cache, flags, modes, addrbits, ignorebits)))),
*static_cast<drcbe_interface *>(auto_alloc(device.machine(), drcbe_c(*this, device, cache, flags, modes, addrbits, ignorebits))) :
*static_cast<drcbe_interface *>(auto_alloc(device.machine(), drcbe_native(*this, device, cache, flags, modes, addrbits, ignorebits)))),
m_umllog(NULL),
m_blocklist(device.machine->respool()),
m_symlist(device.machine->respool())
m_blocklist(device.machine().respool()),
m_symlist(device.machine().respool())
{
// if we're to log, create the logfile
if (flags & DRCUML_OPTION_LOG_UML)
@ -170,7 +170,7 @@ drcuml_state::drcuml_state(device_t &device, drc_cache &cache, UINT32 flags, int
drcuml_state::~drcuml_state()
{
// free the back-end
auto_free(m_device.machine, &m_beintf);
auto_free(m_device.machine(), &m_beintf);
// close any files
if (m_umllog != NULL)
@ -230,7 +230,7 @@ drcuml_block *drcuml_state::begin_block(UINT32 maxinst)
// if we failed to find one, allocate a new one
if (bestblock == NULL)
bestblock = &m_blocklist.append(*auto_alloc(m_device.machine, drcuml_block(*this, maxinst * 3/2)));
bestblock = &m_blocklist.append(*auto_alloc(m_device.machine(), drcuml_block(*this, maxinst * 3/2)));
// start the block
bestblock->begin();
@ -245,7 +245,7 @@ drcuml_block *drcuml_state::begin_block(UINT32 maxinst)
code_handle *drcuml_state::handle_alloc(const char *name)
{
// allocate the handle, add it to our list, and return it
return &m_handlelist.append(*auto_alloc(m_device.machine, code_handle(*this, name)));
return &m_handlelist.append(*auto_alloc(m_device.machine(), code_handle(*this, name)));
}
@ -256,7 +256,7 @@ code_handle *drcuml_state::handle_alloc(const char *name)
void drcuml_state::symbol_add(void *base, UINT32 length, const char *name)
{
m_symlist.append(*auto_alloc(m_device.machine, symbol(base, length, name)));
m_symlist.append(*auto_alloc(m_device.machine(), symbol(base, length, name)));
}
@ -323,7 +323,7 @@ drcuml_block::drcuml_block(drcuml_state &drcuml, UINT32 maxinst)
m_next(NULL),
m_nextinst(0),
m_maxinst(maxinst * 3/2),
m_inst(auto_alloc_array(drcuml.device().machine, instruction, m_maxinst)),
m_inst(auto_alloc_array(drcuml.device().machine(), instruction, m_maxinst)),
m_inuse(false)
{
}
@ -336,7 +336,7 @@ drcuml_block::drcuml_block(drcuml_state &drcuml, UINT32 maxinst)
drcuml_block::~drcuml_block()
{
// free the instruction list
auto_free(m_drcuml.device().machine, m_inst);
auto_free(m_drcuml.device().machine(), m_inst);
}
@ -951,31 +951,31 @@ static void bevalidate_execute(drcuml_state *drcuml, code_handle **handles, cons
static void bevalidate_initialize_random_state(drcuml_state *drcuml, drcuml_block *block, drcuml_machine_state *state)
{
running_machine *machine = drcuml->device->machine;
running_machine &machine = drcuml->device->machine();
int regnum;
// initialize core state to random values
state->fmod = machine->rand() & 0x03;
state->flags = machine->rand() & 0x1f;
state->exp = machine->rand();
state->fmod = machine.rand() & 0x03;
state->flags = machine.rand() & 0x1f;
state->exp = machine.rand();
// initialize integer registers to random values
for (regnum = 0; regnum < ARRAY_LENGTH(state->r); regnum++)
{
state->r[regnum].w.h = machine->rand();
state->r[regnum].w.l = machine->rand();
state->r[regnum].w.h = machine.rand();
state->r[regnum].w.l = machine.rand();
}
// initialize float registers to random values
for (regnum = 0; regnum < ARRAY_LENGTH(state->f); regnum++)
{
*(UINT32 *)&state->f[regnum].s.h = machine->rand();
*(UINT32 *)&state->f[regnum].s.l = machine->rand();
*(UINT32 *)&state->f[regnum].s.h = machine.rand();
*(UINT32 *)&state->f[regnum].s.l = machine.rand();
}
// initialize map variables to random values
for (regnum = 0; regnum < MAPVAR_COUNT; regnum++)
UML_MAPVAR(block, MVAR(regnum), machine->rand());
UML_MAPVAR(block, MVAR(regnum), machine.rand());
}

View File

@ -45,7 +45,7 @@ device_config *dsp16_device_config::static_alloc_device_config(const machine_con
device_t *dsp16_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, dsp16_device(machine, *this));
return auto_alloc(machine, dsp16_device(machine, *this));
}

View File

@ -202,7 +202,7 @@ device_config *dsp32c_device_config::static_alloc_device_config(const machine_co
device_t *dsp32c_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, dsp32c_device(machine, *this));
return auto_alloc(machine, dsp32c_device(machine, *this));
}

View File

@ -238,7 +238,7 @@ static CPU_INIT( dsp56k )
/* Setup the direct memory handler for this CPU */
/* NOTE: Be sure to grab this guy and call him if you ever install another direct_update_hander in a driver! */
const_cast<address_space *>(cpustate->program)->set_direct_update_handler(direct_update_delegate_create_static(dsp56k_direct_handler, *device->machine));
const_cast<address_space *>(cpustate->program)->set_direct_update_handler(direct_update_delegate_create_static(dsp56k_direct_handler, device->machine()));
}

View File

@ -1546,7 +1546,7 @@ static void hyperstone_init(legacy_cpu_device *device, device_irq_callback irqca
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
cpustate->io = device->space(AS_IO);
cpustate->timer = device->machine->scheduler().timer_alloc(FUNC(e132xs_timer_callback), (void *)device);
cpustate->timer = device->machine().scheduler().timer_alloc(FUNC(e132xs_timer_callback), (void *)device);
cpustate->clock_scale_mask = scale_mask;
}

View File

@ -116,8 +116,8 @@ typedef struct
read16_device_func fdt_r;
write16_device_func fdt_w;
UINT8 (*status_in)(running_machine *machine);
int (*draw)(running_machine *machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
UINT8 (*status_in)(running_machine &machine);
int (*draw)(running_machine &machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
} esrip_state;
@ -256,19 +256,19 @@ static CPU_INIT( esrip )
/* Register configuration structure callbacks */
cpustate->fdt_r = _config->fdt_r;
cpustate->fdt_w = _config->fdt_w;
cpustate->lbrm = (UINT8*)device->machine->region(_config->lbrm_prom)->base();
cpustate->lbrm = (UINT8*)device->machine().region(_config->lbrm_prom)->base();
cpustate->status_in = _config->status_in;
cpustate->draw = _config->draw;
/* Allocate image pointer table RAM */
cpustate->ipt_ram = auto_alloc_array(device->machine, UINT16, IPT_RAM_SIZE/2);
cpustate->ipt_ram = auto_alloc_array(device->machine(), UINT16, IPT_RAM_SIZE/2);
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
/* Create the instruction decode lookup table */
cpustate->optable = auto_alloc_array(device->machine, UINT8, 65536);
cpustate->optable = auto_alloc_array(device->machine(), UINT8, 65536);
make_ops(cpustate);
/* Register stuff for state saving */
@ -354,9 +354,9 @@ static CPU_EXIT( esrip )
PRIVATE FUNCTIONS
***************************************************************************/
static int get_hblank(running_machine *machine)
static int get_hblank(running_machine &machine)
{
return machine->primary_screen->hblank();
return machine.primary_screen->hblank();
}
/* Return the state of the LBRM line (Y-scaling related) */
@ -384,7 +384,7 @@ INLINE int check_jmp(esrip_state *cpustate, UINT8 jmp_ctrl)
/* T3 */ case 6: ret = BIT(cpustate->t, 2); break;
/* T4 */ case 1: ret = BIT(cpustate->t, 3); break;
/* /LBRM */ case 5: ret = !get_lbrm(cpustate); break;
/* /HBLANK */ case 3: ret = !get_hblank(cpustate->device->machine); break;
/* /HBLANK */ case 3: ret = !get_hblank(cpustate->device->machine()); break;
/* JMP */ case 7: ret = 0; break;
}
@ -1664,11 +1664,11 @@ INLINE void am29116_execute(esrip_state *cpustate, UINT16 inst, int _sre)
static CPU_EXECUTE( esrip )
{
esrip_state *cpustate = get_safe_token(device);
int calldebugger = (device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0;
int calldebugger = (device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0;
UINT8 status;
/* I think we can get away with placing this outside of the loop */
status = cpustate->status_in(device->machine);
status = cpustate->status_in(device->machine());
/* Core execution loop */
do
@ -1811,7 +1811,7 @@ static CPU_EXECUTE( esrip )
cpustate->attr_latch = x_bus;
cpustate->fig = 1;
cpustate->fig_cycles = cpustate->draw(device->machine, cpustate->adl_latch, cpustate->adr_latch, cpustate->fig_latch, cpustate->attr_latch, cpustate->iaddr_latch, cpustate->c_latch, cpustate->x_scale, cpustate->img_bank);
cpustate->fig_cycles = cpustate->draw(device->machine(), cpustate->adl_latch, cpustate->adr_latch, cpustate->fig_latch, cpustate->attr_latch, cpustate->iaddr_latch, cpustate->c_latch, cpustate->x_scale, cpustate->img_bank);
}
/* X-scale */
@ -1943,7 +1943,7 @@ CPU_GET_INFO( esrip )
cpustate->status & 0x04 ? 'N' : '.',
cpustate->status & 0x02 ? 'C' : '.',
cpustate->status & 0x01 ? 'Z' : '.',
get_hblank(device->machine) ? 'H' : '.'); break;
get_hblank(device->machine()) ? 'H' : '.'); break;
case CPUINFO_STR_REGISTER + ESRIP_PC: sprintf(info->s, "PC: %04X", RIP_PC); break;
case CPUINFO_STR_REGISTER + ESRIP_ACC: sprintf(info->s, "ACC: %04X", cpustate->acc); break;

View File

@ -85,8 +85,8 @@ struct _esrip_config_
{
read16_device_func fdt_r;
write16_device_func fdt_w;
UINT8 (*status_in)(running_machine *machine);
int (*draw)(running_machine *machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
UINT8 (*status_in)(running_machine &machine);
int (*draw)(running_machine &machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
const char* const lbrm_prom;
};

View File

@ -365,7 +365,7 @@ static CPU_INIT( g65816 )
device->save_item(NAME(cpustate->irq_delay));
device->save_item(NAME(cpustate->stopped));
device->machine->state().register_postload(g65816_restore_state, cpustate);
device->machine().state().register_postload(g65816_restore_state, cpustate);
}
/**************************************************************************

View File

@ -237,7 +237,7 @@ static CPU_INIT(h8)
device->save_item(NAME(h8->h8TSTR));
device->save_item(NAME(h8->h8TCNT));
device->machine->state().register_postload(h8_onstateload, h8);
device->machine().state().register_postload(h8_onstateload, h8);
h8_itu_init(h8);
}

View File

@ -241,10 +241,10 @@ static CPU_INIT(h8bit)
h8->direct = &h8->program->direct();
h8->io = device->space(AS_IO);
h8->timer[0] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_0_cb), h8);
h8->timer[1] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_1_cb), h8);
h8->timer[2] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_2_cb), h8);
h8->timer[3] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_3_cb), h8);
h8->timer[0] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_0_cb), h8);
h8->timer[1] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_1_cb), h8);
h8->timer[2] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_2_cb), h8);
h8->timer[3] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_3_cb), h8);
device->save_item(NAME(h8->h8err));
device->save_item(NAME(h8->regs));
@ -259,7 +259,7 @@ static CPU_INIT(h8bit)
device->save_item(NAME(h8->h8TSTR));
device->save_item(NAME(h8->h8TCNT));
h8->device->machine->state().register_postload(h8_onstateload, h8);
h8->device->machine().state().register_postload(h8_onstateload, h8);
}
static CPU_RESET(h8bit)

View File

@ -766,20 +766,20 @@ void h8_3007_register1_write8(h83xx_state *h8, UINT32 address, UINT8 val)
void h8_3007_itu_init(h83xx_state *h8)
{
h8->timer[0] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_3007_timer_0_cb), h8);
h8->timer[1] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_3007_timer_1_cb), h8);
h8->timer[2] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_3007_timer_2_cb), h8);
h8->timer[0] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_3007_timer_0_cb), h8);
h8->timer[1] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_3007_timer_1_cb), h8);
h8->timer[2] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_3007_timer_2_cb), h8);
h8_itu_reset(h8);
}
void h8_itu_init(h83xx_state *h8)
{
h8->timer[0] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_0_cb), h8);
h8->timer[1] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_1_cb), h8);
h8->timer[2] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_2_cb), h8);
h8->timer[3] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_3_cb), h8);
h8->timer[4] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_4_cb), h8);
h8->timer[0] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_0_cb), h8);
h8->timer[1] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_1_cb), h8);
h8->timer[2] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_2_cb), h8);
h8->timer[3] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_3_cb), h8);
h8->timer[4] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_4_cb), h8);
h8_itu_reset(h8);
}

View File

@ -541,7 +541,7 @@ static CPU_INIT( hd6309 )
device->save_item(NAME(DP));
device->save_item(NAME(CC));
device->save_item(NAME(MD));
device->machine->state().register_postload(hd6309_postload, (void *) device);
device->machine().state().register_postload(hd6309_postload, (void *) device);
device->save_item(NAME(m68_state->int_state));
device->save_item(NAME(m68_state->nmi_state));
device->save_item(NAME(m68_state->irq_state[0]));

View File

@ -418,7 +418,7 @@ INLINE void CYCLES_RM(i386_state *cpustate,int modrm, int r, int m)
}
}
static void build_cycle_table(running_machine *machine)
static void build_cycle_table(running_machine &machine)
{
int i, j;
for (j=0; j < X86_NUM_CPUS; j++)
@ -534,7 +534,7 @@ static CPU_INIT( i386 )
static const int regs32[8] = {EAX,ECX,EDX,EBX,ESP,EBP,ESI,EDI};
i386_state *cpustate = get_safe_token(device);
build_cycle_table(device->machine);
build_cycle_table(device->machine());
for( i=0; i < 256; i++ ) {
int c=0;
@ -614,7 +614,7 @@ static CPU_INIT( i386 )
device->save_item(NAME(cpustate->ldtr.flags));
device->save_item(NAME(cpustate->irq_state));
device->save_item(NAME(cpustate->performed_intersegment_jump));
device->machine->state().register_postload(i386_postload, (void *)device);
device->machine().state().register_postload(i386_postload, (void *)device);
}
static void build_opcode_table(i386_state *cpustate, UINT32 features)

View File

@ -430,7 +430,7 @@ static void init_common(int isdsp, legacy_cpu_device *device, device_irq_callbac
device->save_item(NAME(jaguar->a));
device->save_item(NAME(jaguar->ctrl));
device->save_item(NAME(jaguar->ppc));
device->machine->state().register_postload(jaguar_postload, (void *)device);
device->machine().state().register_postload(jaguar_postload, (void *)device);
}

View File

@ -906,7 +906,7 @@ static CPU_INIT( m37710 )
cpustate->destination = 0;
for (i = 0; i < 8; i++)
cpustate->timers[i] = device->machine->scheduler().timer_alloc(FUNC(m37710_timer_cb), cpustate);
cpustate->timers[i] = device->machine().scheduler().timer_alloc(FUNC(m37710_timer_cb), cpustate);
device->save_item(NAME(cpustate->a));
device->save_item(NAME(cpustate->b));
@ -949,7 +949,7 @@ static CPU_INIT( m37710 )
device->save_item(NAME(cpustate->reload[6]));
device->save_item(NAME(cpustate->reload[7]));
device->machine->state().register_postload(m37710_restore_state, cpustate);
device->machine().state().register_postload(m37710_restore_state, cpustate);
}
/**************************************************************************

View File

@ -1204,7 +1204,7 @@ static CPU_INIT( m6801 )
cpustate->io = device->space(AS_IO);
cpustate->clock = device->clock() / 4;
cpustate->sci_timer = device->machine->scheduler().timer_alloc(FUNC(sci_tick), cpustate);
cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
state_register(cpustate, "m6801");
@ -1254,7 +1254,7 @@ static CPU_INIT( m6803 )
cpustate->io = device->space(AS_IO);
cpustate->clock = device->clock() / 4;
cpustate->sci_timer = device->machine->scheduler().timer_alloc(FUNC(sci_tick), cpustate);
cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
state_register(cpustate, "m6803");
@ -1312,7 +1312,7 @@ static CPU_INIT( hd6301 )
cpustate->io = device->space(AS_IO);
cpustate->clock = device->clock() / 4;
cpustate->sci_timer = device->machine->scheduler().timer_alloc(FUNC(sci_tick), cpustate);
cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
state_register(cpustate, "hd6301");
}
@ -1336,7 +1336,7 @@ static CPU_INIT( hd63701 )
cpustate->io = device->space(AS_IO);
cpustate->clock = device->clock() / 4;
cpustate->sci_timer = device->machine->scheduler().timer_alloc(FUNC(sci_tick), cpustate);
cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
state_register(cpustate, "hd63701");
}

View File

@ -538,7 +538,7 @@ static void set_irq_line(m68ki_cpu_core *m68k, int irqline, int state)
m68k->nmi_pending = TRUE;
}
static void m68k_presave(running_machine *machine, void *param)
static void m68k_presave(running_machine &machine, void *param)
{
m68ki_cpu_core *m68k = (m68ki_cpu_core *)param;
m68k->save_sr = m68ki_get_sr(m68k);
@ -546,7 +546,7 @@ static void m68k_presave(running_machine *machine, void *param)
m68k->save_halted = (m68k->stopped & STOP_LEVEL_HALT) != 0;
}
static void m68k_postload(running_machine *machine, void *param)
static void m68k_postload(running_machine &machine, void *param)
{
m68ki_cpu_core *m68k = (m68ki_cpu_core *)param;
m68ki_set_sr_noint_nosp(m68k, m68k->save_sr);
@ -762,8 +762,8 @@ static CPU_INIT( m68k )
device->save_item(NAME(m68k->save_halted));
device->save_item(NAME(m68k->pref_addr));
device->save_item(NAME(m68k->pref_data));
device->machine->state().register_presave(m68k_presave, m68k);
device->machine->state().register_postload(m68k_postload, m68k);
device->machine().state().register_presave(m68k_presave, m68k);
device->machine().state().register_postload(m68k_postload, m68k);
}
/* Pulse the RESET line on the CPU */

View File

@ -121,13 +121,13 @@ static CPU_INIT( mb86233 )
cpustate->fifo_write_cb = _config->fifo_write_cb;
}
cpustate->RAM = auto_alloc_array(device->machine, UINT32, 2 * 0x200); /* 2x 2KB */
cpustate->RAM = auto_alloc_array(device->machine(), UINT32, 2 * 0x200); /* 2x 2KB */
memset( cpustate->RAM, 0, 2 * 0x200 * sizeof(UINT32) );
cpustate->ARAM = &cpustate->RAM[0];
cpustate->BRAM = &cpustate->RAM[0x200];
cpustate->Tables = (UINT32*) device->machine->region(_config->tablergn)->base();
cpustate->Tables = (UINT32*) device->machine().region(_config->tablergn)->base();
state_save_register_global_pointer(device->machine, cpustate->RAM,2 * 0x200 * sizeof(UINT32));
state_save_register_global_pointer(device->machine(), cpustate->RAM,2 * 0x200 * sizeof(UINT32));
}
static CPU_RESET( mb86233 )

View File

@ -149,7 +149,7 @@ static CPU_INIT( mb88 )
cpustate->data = device->space(AS_DATA);
cpustate->io = device->space(AS_IO);
cpustate->serial = device->machine->scheduler().timer_alloc(FUNC(serial_timer), (void *)device);
cpustate->serial = device->machine().scheduler().timer_alloc(FUNC(serial_timer), (void *)device);
device->save_item(NAME(cpustate->PC));
device->save_item(NAME(cpustate->PA));

View File

@ -410,7 +410,7 @@ static CPU_INIT( hc11 )
cpustate->internal_ram_size = 1280;
}
cpustate->internal_ram = auto_alloc_array(device->machine, UINT8, cpustate->internal_ram_size);
cpustate->internal_ram = auto_alloc_array(device->machine(), UINT8, cpustate->internal_ram_size);
cpustate->reg_position = 0;
cpustate->ram_position = 0x100;

View File

@ -1215,7 +1215,7 @@ static TIMER_CALLBACK( master_callback )
void upi41_master_w(device_t *_device, UINT8 a0, UINT8 data)
{
legacy_cpu_device *device = downcast<legacy_cpu_device *>(_device);
device->machine->scheduler().synchronize(FUNC(master_callback), (a0 << 8) | data, (void *)device);
device->machine().scheduler().synchronize(FUNC(master_callback), (a0 << 8) | data, (void *)device);
}

View File

@ -105,7 +105,7 @@ void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, legacy
mips->vtlb = vtlb_alloc(device, AS_PROGRAM, 2 * mips->tlbentries + 2, 0);
/* allocate a timer for the compare interrupt */
mips->compare_int_timer = device->machine->scheduler().timer_alloc(FUNC(compare_int_callback), (void *)device);
mips->compare_int_timer = device->machine().scheduler().timer_alloc(FUNC(compare_int_callback), (void *)device);
/* reset the state */
mips3com_reset(mips);

View File

@ -396,7 +396,7 @@ static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *de
int regnum;
/* allocate enough space for the cache and the core */
cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(*mips3)));
cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(*mips3)));
if (cache == NULL)
fatalerror("Unable to allocate cache of size %d", (UINT32)(CACHE_SIZE + sizeof(*mips3)));
@ -419,7 +419,7 @@ static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *de
flags |= DRCUML_OPTION_LOG_UML;
if (LOG_NATIVE)
flags |= DRCUML_OPTION_LOG_NATIVE;
mips3->impstate->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 8, 32, 2));
mips3->impstate->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 8, 32, 2));
/* add symbols for our stuff */
mips3->impstate->drcuml->symbol_add(&mips3->pc, sizeof(mips3->pc), "pc");
@ -465,7 +465,7 @@ static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *de
mips3->impstate->drcuml->symbol_add(&mips3->impstate->fpmode, sizeof(mips3->impstate->fpmode), "fpmode");
/* initialize the front-end helper */
mips3->impstate->drcfe = auto_alloc(device->machine, mips3_frontend(*mips3, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
mips3->impstate->drcfe = auto_alloc(device->machine(), mips3_frontend(*mips3, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* allocate memory for cache-local state and initialize it */
memcpy(mips3->impstate->fpmode, fpmode_source, sizeof(fpmode_source));
@ -562,9 +562,9 @@ static CPU_EXIT( mips3 )
mips3com_exit(mips3);
/* clean up the DRC */
auto_free(device->machine, mips3->impstate->drcfe);
auto_free(device->machine, mips3->impstate->drcuml);
auto_free(device->machine, mips3->impstate->cache);
auto_free(device->machine(), mips3->impstate->drcfe);
auto_free(device->machine(), mips3->impstate->drcuml);
auto_free(device->machine(), mips3->impstate->cache);
}
@ -1275,7 +1275,7 @@ static void static_generate_memory_accessor(mips3_state *mips3, int mode, int si
UML_JMPc(block, COND_Z, tlbmiss = label++); // jmp tlbmiss,z
UML_ROLINS(block, I0, I3, 0, 0xfffff000); // rolins i0,i3,0,0xfffff000
if ((mips3->device->machine->debug_flags & DEBUG_FLAG_ENABLED) == 0)
if ((mips3->device->machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
for (ramnum = 0; ramnum < MIPS3_MAX_FASTRAM; ramnum++)
if (mips3->impstate->fastram[ramnum].base != NULL && (!iswrite || !mips3->impstate->fastram[ramnum].readonly))
{
@ -1612,7 +1612,7 @@ static void generate_sequence_instruction(mips3_state *mips3, drcuml_block *bloc
}
/* if we are debugging, call the debugger */
if ((mips3->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((mips3->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&mips3->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(mips3, block);

View File

@ -232,7 +232,7 @@ void psxcpu_device::set_biu( UINT32 data, UINT32 mem_mask )
void psxcpu_device::stop()
{
debugger_break( machine );
debugger_break( m_machine );
debugger_instruction_hook( this, m_pc );
}
@ -1602,12 +1602,12 @@ device_config *cxd8661r_device_config::static_alloc_device_config(const machine_
device_t *psxcpu_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, psxcpu_device(machine, *this));
return auto_alloc(machine, psxcpu_device(machine, *this));
}
device_t *cxd8661r_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, psxcpu_device(machine, *this));
return auto_alloc(machine, psxcpu_device(machine, *this));
}

View File

@ -303,8 +303,8 @@ static CPU_INIT( r3000 )
r3000_state *r3000 = get_safe_token(device);
/* allocate memory */
r3000->icache = auto_alloc_array(device->machine, UINT32, configdata->icache/4);
r3000->dcache = auto_alloc_array(device->machine, UINT32, configdata->dcache/4);
r3000->icache = auto_alloc_array(device->machine(), UINT32, configdata->icache/4);
r3000->dcache = auto_alloc_array(device->machine(), UINT32, configdata->dcache/4);
r3000->icache_size = configdata->icache;
r3000->dcache_size = configdata->dcache;

View File

@ -295,7 +295,7 @@ static CPU_INIT(mn10200)
for (tmr = 0; tmr < NUM_TIMERS_8BIT; tmr++)
{
cpustate->timer_timers[tmr] = device->machine->scheduler().timer_alloc(FUNC(simple_timer_cb), cpustate);
cpustate->timer_timers[tmr] = device->machine().scheduler().timer_alloc(FUNC(simple_timer_cb), cpustate);
cpustate->timer_timers[tmr]->adjust(attotime::never, tmr);
}
}

View File

@ -430,7 +430,7 @@ static void v25_init(legacy_cpu_device *device, device_irq_callback irqcallback,
nec_state->config = config;
for (int i = 0; i < 4; i++)
nec_state->timers[i] = device->machine->scheduler().timer_alloc(FUNC(v25_timer_callback), nec_state);
nec_state->timers[i] = device->machine().scheduler().timer_alloc(FUNC(v25_timer_callback), nec_state);
device->save_item(NAME(nec_state->ram.w));
device->save_item(NAME(nec_state->intp_state));

View File

@ -947,8 +947,8 @@ static CPU_INIT( ppc403 )
// !!! why is rfci here !!!
ppc.optable19[51] = ppc_rfci;
ppc.spu.rx_timer = device->machine->scheduler().timer_alloc(FUNC(ppc403_spu_rx_callback));
ppc.spu.tx_timer = device->machine->scheduler().timer_alloc(FUNC(ppc403_spu_tx_callback));
ppc.spu.rx_timer = device->machine().scheduler().timer_alloc(FUNC(ppc403_spu_rx_callback));
ppc.spu.tx_timer = device->machine().scheduler().timer_alloc(FUNC(ppc403_spu_tx_callback));
ppc.read8 = ppc403_read8;
ppc.read16 = ppc403_read16;

View File

@ -328,14 +328,14 @@ void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_di
/* allocate a timer for the compare interrupt */
if ((cap & PPCCAP_OEA) && (ppc->tb_divisor))
ppc->decrementer_int_timer = device->machine->scheduler().timer_alloc(FUNC(decrementer_int_callback), ppc);
ppc->decrementer_int_timer = device->machine().scheduler().timer_alloc(FUNC(decrementer_int_callback), ppc);
/* and for the 4XX interrupts if needed */
if (cap & PPCCAP_4XX)
{
ppc->fit_timer = device->machine->scheduler().timer_alloc(FUNC(ppc4xx_fit_callback), ppc);
ppc->pit_timer = device->machine->scheduler().timer_alloc(FUNC(ppc4xx_pit_callback), ppc);
ppc->spu.timer = device->machine->scheduler().timer_alloc(FUNC(ppc4xx_spu_callback), ppc);
ppc->fit_timer = device->machine().scheduler().timer_alloc(FUNC(ppc4xx_fit_callback), ppc);
ppc->pit_timer = device->machine().scheduler().timer_alloc(FUNC(ppc4xx_pit_callback), ppc);
ppc->spu.timer = device->machine().scheduler().timer_alloc(FUNC(ppc4xx_spu_callback), ppc);
}
/* register for save states */
@ -403,7 +403,7 @@ void ppccom_reset(powerpc_state *ppc)
ppc->dec_zero_cycles = ppc->device->total_cycles();
if (ppc->tb_divisor)
{
decrementer_int_callback(ppc->device->machine, ppc, 0);
decrementer_int_callback(ppc->device->machine(), ppc, 0);
}
}
@ -676,7 +676,7 @@ void ppccom_execute_tlbl(powerpc_state *ppc)
int entrynum;
/* determine entry number; we use rand() for associativity */
entrynum = ((address >> 12) & 0x1f) | (ppc->device->machine->rand() & 0x20) | (isitlb ? 0x40 : 0);
entrynum = ((address >> 12) & 0x1f) | (ppc->device->machine().rand() & 0x20) | (isitlb ? 0x40 : 0);
/* determine the flags */
flags = VTLB_FLAG_VALID | VTLB_READ_ALLOWED | VTLB_FETCH_ALLOWED;
@ -946,9 +946,9 @@ void ppccom_execute_mtspr(powerpc_state *ppc)
case SPR4XX_TCR:
ppc->spr[SPR4XX_TCR] = ppc->param1 | (oldval & PPC4XX_TCR_WRC_MASK);
if ((oldval ^ ppc->spr[SPR4XX_TCR]) & PPC4XX_TCR_FIE)
ppc4xx_fit_callback(ppc->device->machine, ppc, FALSE);
ppc4xx_fit_callback(ppc->device->machine(), ppc, FALSE);
if ((oldval ^ ppc->spr[SPR4XX_TCR]) & PPC4XX_TCR_PIE)
ppc4xx_pit_callback(ppc->device->machine, ppc, FALSE);
ppc4xx_pit_callback(ppc->device->machine(), ppc, FALSE);
return;
/* timer status register */
@ -961,7 +961,7 @@ void ppccom_execute_mtspr(powerpc_state *ppc)
case SPR4XX_PIT:
ppc->spr[SPR4XX_PIT] = ppc->param1;
ppc->pit_reload = ppc->param1;
ppc4xx_pit_callback(ppc->device->machine, ppc, FALSE);
ppc4xx_pit_callback(ppc->device->machine(), ppc, FALSE);
return;
/* timebase */

View File

@ -557,7 +557,7 @@ static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy
int regnum;
/* allocate enough space for the cache and the core */
cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(*ppc)));
cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(*ppc)));
/* allocate the core from the near cache */
*(powerpc_state **)device->token() = ppc = (powerpc_state *)cache->alloc_near(sizeof(*ppc));
@ -578,7 +578,7 @@ static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy
flags |= DRCUML_OPTION_LOG_UML;
if (LOG_NATIVE)
flags |= DRCUML_OPTION_LOG_NATIVE;
ppc->impstate->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 8, 32, 2));
ppc->impstate->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 8, 32, 2));
/* add symbols for our stuff */
ppc->impstate->drcuml->symbol_add(&ppc->pc, sizeof(ppc->pc), "pc");
@ -624,7 +624,7 @@ static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy
ppc->impstate->drcuml->symbol_add(&ppc->impstate->fcmp_cr_table, sizeof(ppc->impstate->fcmp_cr_table), "fcmp_cr_table");
/* initialize the front-end helper */
ppc->impstate->drcfe = auto_alloc(device->machine, ppc_frontend(*ppc, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
ppc->impstate->drcfe = auto_alloc(device->machine(), ppc_frontend(*ppc, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* initialize the implementation state tables */
memcpy(ppc->impstate->fpmode, fpmode_source, sizeof(fpmode_source));
@ -716,9 +716,9 @@ static CPU_EXIT( ppcdrc )
ppccom_exit(ppc);
/* clean up the DRC */
auto_free(device->machine, ppc->impstate->drcfe);
auto_free(device->machine, ppc->impstate->drcuml);
auto_free(device->machine, ppc->impstate->cache);
auto_free(device->machine(), ppc->impstate->drcfe);
auto_free(device->machine(), ppc->impstate->drcuml);
auto_free(device->machine(), ppc->impstate->cache);
}
@ -1511,7 +1511,7 @@ static void static_generate_memory_accessor(powerpc_state *ppc, int mode, int si
UML_AND(block, I0, I0, 0x7fffffff); // and i0,i0,0x7fffffff
UML_XOR(block, I0, I0, (mode & MODE_LITTLE_ENDIAN) ? (8 - size) : 0); // xor i0,i0,8-size
if ((ppc->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((ppc->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
for (ramnum = 0; ramnum < PPC_MAX_FASTRAM; ramnum++)
if (ppc->impstate->fastram[ramnum].base != NULL && (!iswrite || !ppc->impstate->fastram[ramnum].readonly))
{
@ -2127,7 +2127,7 @@ static void generate_sequence_instruction(powerpc_state *ppc, drcuml_block *bloc
}
/* if we are debugging, call the debugger */
if ((ppc->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((ppc->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&ppc->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(ppc, block); // <save fastregs>

View File

@ -207,7 +207,7 @@ static void set_cop0_reg(rsp_state *rsp, int reg, UINT32 data)
static void unimplemented_opcode(rsp_state *rsp, UINT32 op)
{
if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
rsp_dasm_one(string, rsp->ppc, op);
@ -303,7 +303,7 @@ static CPU_INIT( rsp )
#endif
// ...except for the accumulators.
// We're not calling machine->rand() because initializing something with machine->rand()
// We're not calling machine.rand() because initializing something with machine.rand()
// makes me retch uncontrollably.
for(accumIdx = 0; accumIdx < 8; accumIdx++ )
{

View File

@ -496,7 +496,7 @@ static void cfunc_unimplemented_opcode(void *param)
{
rsp_state *rsp = (rsp_state*)param;
int op = rsp->impstate->arg0;
if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
rsp_dasm_one(string, rsp->ppc, op);
@ -508,7 +508,7 @@ static void cfunc_unimplemented_opcode(void *param)
static void unimplemented_opcode(rsp_state *rsp, UINT32 op)
{
if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
rsp_dasm_one(string, rsp->ppc, op);
@ -612,7 +612,7 @@ static CPU_INIT( rsp )
//int elnum;
/* allocate enough space for the cache and the core */
cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(*rsp)));
cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(*rsp)));
/* allocate the core memory */
*(rsp_state **)device->token() = rsp = (rsp_state *)cache->alloc_near(sizeof(*rsp));
@ -638,7 +638,7 @@ static CPU_INIT( rsp )
{
flags |= DRCUML_OPTION_LOG_NATIVE;
}
rsp->impstate->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 8, 32, 2));
rsp->impstate->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 8, 32, 2));
/* add symbols for our stuff */
rsp->impstate->drcuml->symbol_add(&rsp->pc, sizeof(rsp->pc), "pc");
@ -656,7 +656,7 @@ static CPU_INIT( rsp )
rsp->impstate->drcuml->symbol_add(&rsp->impstate->numcycles, sizeof(rsp->impstate->numcycles), "numcycles");
/* initialize the front-end helper */
rsp->impstate->drcfe = auto_alloc(device->machine, rsp_frontend(*rsp, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
rsp->impstate->drcfe = auto_alloc(device->machine(), rsp_frontend(*rsp, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* compute the register parameters */
for (regnum = 0; regnum < 32; regnum++)
@ -696,9 +696,9 @@ static CPU_EXIT( rsp )
rsp_state *rsp = get_safe_token(device);
/* clean up the DRC */
auto_free(device->machine, rsp->impstate->drcfe);
auto_free(device->machine, rsp->impstate->drcuml);
auto_free(device->machine, rsp->impstate->cache);
auto_free(device->machine(), rsp->impstate->drcfe);
auto_free(device->machine(), rsp->impstate->drcuml);
auto_free(device->machine(), rsp->impstate->cache);
}
@ -3817,7 +3817,7 @@ static void generate_sequence_instruction(rsp_state *rsp, drcuml_block *block, c
UML_MAPVAR(block, MAPVAR_CYCLES, compiler->cycles); // mapvar CYCLES,compiler->cycles
/* if we are debugging, call the debugger */
if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&rsp->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(rsp, block);

View File

@ -104,7 +104,7 @@ static CPU_INIT( sc61860 )
{
sc61860_state *cpustate = get_safe_token(device);
cpustate->config = (sc61860_cpu_core *) device->baseconfig().static_config();
device->machine->scheduler().timer_pulse(attotime::from_hz(500), FUNC(sc61860_2ms_tick), 0, cpustate);
device->machine().scheduler().timer_pulse(attotime::from_hz(500), FUNC(sc61860_2ms_tick), 0, cpustate);
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();

View File

@ -923,17 +923,17 @@ void sh2_common_init(sh2_state *sh2, legacy_cpu_device *device, device_irq_callb
const sh2_cpu_core *conf = (const sh2_cpu_core *)device->baseconfig().static_config();
int i;
sh2->timer = device->machine->scheduler().timer_alloc(FUNC(sh2_timer_callback), sh2);
sh2->timer = device->machine().scheduler().timer_alloc(FUNC(sh2_timer_callback), sh2);
sh2->timer->adjust(attotime::never);
sh2->dma_current_active_timer[0] = device->machine->scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
sh2->dma_current_active_timer[0] = device->machine().scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
sh2->dma_current_active_timer[0]->adjust(attotime::never);
sh2->dma_current_active_timer[1] = device->machine->scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
sh2->dma_current_active_timer[1] = device->machine().scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
sh2->dma_current_active_timer[1]->adjust(attotime::never);
sh2->m = auto_alloc_array(device->machine, UINT32, 0x200/4);
sh2->m = auto_alloc_array(device->machine(), UINT32, 0x200/4);
if(conf)
{

View File

@ -8,7 +8,7 @@
Visit http://mamedev.org for licensing and usage restrictions.
ST-V status:
colmns97 & stress crash due to SCSP stream->machine getting corrupted.
colmns97 & stress crash due to SCSP stream->machine() getting corrupted.
cottonbm w/US bios: run to 60323B4 on master, then MOV insn @ 602f5aa crashes?
actually crash on slave @ 6032b38 after above. reading wrong addr for jump vector.
@ -683,7 +683,7 @@ static CPU_INIT( sh2 )
int regnum;
/* allocate enough space for the cache and the core */
cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(sh2_state)));
cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(sh2_state)));
/* allocate the core memory */
*(sh2_state **)device->token() = sh2 = (sh2_state *)cache->alloc_near(sizeof(sh2_state));
@ -705,7 +705,7 @@ static CPU_INIT( sh2 )
flags |= DRCUML_OPTION_LOG_UML;
if (LOG_NATIVE)
flags |= DRCUML_OPTION_LOG_NATIVE;
sh2->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 1, 32, 1));
sh2->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 1, 32, 1));
/* add symbols for our stuff */
sh2->drcuml->symbol_add(&sh2->pc, sizeof(sh2->pc), "pc");
@ -724,7 +724,7 @@ static CPU_INIT( sh2 )
sh2->drcuml->symbol_add(&sh2->mach, sizeof(sh2->macl), "mach");
/* initialize the front-end helper */
sh2->drcfe = auto_alloc(device->machine, sh2_frontend(*sh2, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
sh2->drcfe = auto_alloc(device->machine(), sh2_frontend(*sh2, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* compute the register parameters */
for (regnum = 0; regnum < 16; regnum++)
@ -764,9 +764,9 @@ static CPU_EXIT( sh2 )
sh2_state *sh2 = get_safe_token(device);
/* clean up the DRC */
auto_free(device->machine, sh2->drcfe);
auto_free(device->machine, sh2->drcuml);
auto_free(device->machine, sh2->cache);
auto_free(device->machine(), sh2->drcfe);
auto_free(device->machine(), sh2->drcuml);
auto_free(device->machine(), sh2->cache);
}
@ -1577,7 +1577,7 @@ static void generate_sequence_instruction(sh2_state *sh2, drcuml_block *block, c
}
/* if we are debugging, call the debugger */
if ((sh2->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((sh2->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&sh2->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(sh2, block);

View File

@ -845,7 +845,7 @@ INLINE void LDCSR(sh4_state *sh4, UINT32 m)
UINT32 reg;
reg = sh4->r[m];
if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (sh4->sr & sRB) >> 29);
if ((sh4->r[m] & sRB) != (sh4->sr & sRB))
sh4_change_register_bank(sh4, sh4->r[m] & sRB ? 1 : 0);
@ -873,7 +873,7 @@ UINT32 old;
old = sh4->sr;
sh4->ea = sh4->r[m];
sh4->sr = RL(sh4, sh4->ea ) & FLAGS;
if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (old & sRB) >> 29);
if ((old & sRB) != (sh4->sr & sRB))
sh4_change_register_bank(sh4, sh4->sr & sRB ? 1 : 0);
@ -1459,7 +1459,7 @@ INLINE void RTE(sh4_state *sh4)
{
sh4->delay = sh4->pc;
sh4->pc = sh4->ea = sh4->spc;
if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (sh4->sr & sRB) >> 29);
if ((sh4->ssr & sRB) != (sh4->sr & sRB))
sh4_change_register_bank(sh4, sh4->ssr & sRB ? 1 : 0);
@ -1750,7 +1750,7 @@ INLINE void TRAPA(sh4_state *sh4, UINT32 i)
sh4->sgr = sh4->r[15];
sh4->sr |= MD;
if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (sh4->sr & sRB) >> 29);
if (!(sh4->sr & sRB))
sh4_change_register_bank(sh4, 1);
@ -3196,7 +3196,7 @@ INLINE void op1111(sh4_state *sh4, UINT16 opcode)
FRCHG(sh4);
break;
default:
debugger_break(sh4->device->machine);
debugger_break(sh4->device->machine());
break;
}
} else {
@ -3207,7 +3207,7 @@ INLINE void op1111(sh4_state *sh4, UINT16 opcode)
}
break;
default:
debugger_break(sh4->device->machine);
debugger_break(sh4->device->machine());
break;
}
break;
@ -3215,7 +3215,7 @@ INLINE void op1111(sh4_state *sh4, UINT16 opcode)
FMAC(sh4, Rm,Rn);
break;
default:
debugger_break(sh4->device->machine);
debugger_break(sh4->device->machine());
break;
}
}

View File

@ -193,7 +193,7 @@ void sh4_exception(sh4_state *sh4, const char *message, int exception) // handle
sh4->sgr = sh4->r[15];
sh4->sr |= MD;
if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (sh4->sr & sRB) >> 29);
if (!(sh4->sr & sRB))
sh4_change_register_bank(sh4, 1);
@ -1160,24 +1160,24 @@ void sh4_common_init(device_t *device)
for (i=0; i<3; i++)
{
sh4->timer[i] = device->machine->scheduler().timer_alloc(FUNC(sh4_timer_callback), sh4);
sh4->timer[i] = device->machine().scheduler().timer_alloc(FUNC(sh4_timer_callback), sh4);
sh4->timer[i]->adjust(attotime::never, i);
}
for (i=0; i<4; i++)
{
sh4->dma_timer[i] = device->machine->scheduler().timer_alloc(FUNC(sh4_dmac_callback), sh4);
sh4->dma_timer[i] = device->machine().scheduler().timer_alloc(FUNC(sh4_dmac_callback), sh4);
sh4->dma_timer[i]->adjust(attotime::never, i);
}
sh4->refresh_timer = device->machine->scheduler().timer_alloc(FUNC(sh4_refresh_timer_callback), sh4);
sh4->refresh_timer = device->machine().scheduler().timer_alloc(FUNC(sh4_refresh_timer_callback), sh4);
sh4->refresh_timer->adjust(attotime::never);
sh4->refresh_timer_base = 0;
sh4->rtc_timer = device->machine->scheduler().timer_alloc(FUNC(sh4_rtc_timer_callback), sh4);
sh4->rtc_timer = device->machine().scheduler().timer_alloc(FUNC(sh4_rtc_timer_callback), sh4);
sh4->rtc_timer->adjust(attotime::never);
sh4->m = auto_alloc_array(device->machine, UINT32, 16384);
sh4->m = auto_alloc_array(device->machine(), UINT32, 16384);
}
void sh4_dma_ddt(device_t *device, struct sh4_ddt_dma *s)

View File

@ -430,7 +430,7 @@ static CPU_INIT( sharc )
build_opcode_table();
cpustate->internal_ram = auto_alloc_array(device->machine, UINT16, 2 * 0x10000); // 2x 128KB
cpustate->internal_ram = auto_alloc_array(device->machine(), UINT16, 2 * 0x10000); // 2x 128KB
cpustate->internal_ram_block0 = &cpustate->internal_ram[0];
cpustate->internal_ram_block1 = &cpustate->internal_ram[0x20000/2];

View File

@ -95,7 +95,7 @@ INLINE void WRITE32(ssem_state *cpustate, UINT32 address, UINT32 data)
static void unimplemented_opcode(ssem_state *cpustate, UINT32 op)
{
if((cpustate->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if((cpustate->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
ssem_dasm_one(string, cpustate->pc-1, op);

View File

@ -2726,9 +2726,9 @@ static CPU_INIT( t90 )
// Timers
for (i = 0; i < 4; i++)
cpustate->timer[i] = device->machine->scheduler().timer_alloc(FUNC(t90_timer_callback), cpustate);
cpustate->timer[i] = device->machine().scheduler().timer_alloc(FUNC(t90_timer_callback), cpustate);
cpustate->timer[4] = device->machine->scheduler().timer_alloc(FUNC(t90_timer4_callback), cpustate);
cpustate->timer[4] = device->machine().scheduler().timer_alloc(FUNC(t90_timer4_callback), cpustate);
}
static ADDRESS_MAP_START(tmp90840_mem, AS_PROGRAM, 8)

View File

@ -1719,7 +1719,7 @@ static CPU_INIT( tms32025 )
{
tms32025_state *cpustate = get_safe_token(device);
cpustate->intRAM = auto_alloc_array(device->machine, UINT16, 0x800);
cpustate->intRAM = auto_alloc_array(device->machine(), UINT16, 0x800);
cpustate->irq_callback = irqcallback;
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);

View File

@ -103,7 +103,7 @@ void tms3203x_device::illegal(UINT32 op)
if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
logerror("Illegal op @ %06X: %08X (tbl=%03X)\n", m_pc - 1, op, op >> 21);
debugger_break(machine);
debugger_break(m_machine);
}
}
@ -120,7 +120,7 @@ inline void tms3203x_device::execute_one()
m_icount -= 2; // 2 clocks per cycle
m_pc++;
#if (TMS_3203X_LOG_OPCODE_USAGE)
if (machine->primary_screen->frame_number() == 2003)
if (machine.primary_screen->frame_number() == 2003)
m_hits[op >> 21]++;
#endif
(this->*s_tms32031ops[op >> 21])(op);

View File

@ -178,12 +178,12 @@ device_config *tms32032_device_config::static_alloc_device_config(const machine_
device_t *tms32031_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, tms32031_device(machine, *this));
return auto_alloc(machine, tms32031_device(machine, *this));
}
device_t *tms32032_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, tms32032_device(machine, *this));
return auto_alloc(machine, tms32032_device(machine, *this));
}
@ -854,7 +854,7 @@ void tms3203x_device::execute_run()
{
// watch for out-of-range stack pointers
if (IREG(TMR_SP) & 0xff000000)
debugger_break(&m_machine);
debugger_break(m_machine);
if ((IREG(TMR_ST) & RMFLAG) && m_pc == IREG(TMR_RE) + 1)
{
if ((INT32)--IREG(TMR_RC) >= 0)

View File

@ -11,7 +11,7 @@
#define LOG_GFX_OPS 0
#define LOGGFX(x) do { if (LOG_GFX_OPS && input_code_pressed(tms->device->machine, KEYCODE_L)) logerror x; } while (0)
#define LOGGFX(x) do { if (LOG_GFX_OPS && input_code_pressed(tms->device->machine(), KEYCODE_L)) logerror x; } while (0)
/* Graphics Instructions */

View File

@ -97,7 +97,7 @@ static void unimpl(tms34010_state *tms, UINT16 op)
if (tms->pc == 0 || opcode_table[tms->direct->read_decrypted_word(TOBYTE(tms->pc)) >> 4] == unimpl)
{
device_set_input_line(tms->device, INPUT_LINE_HALT, ASSERT_LINE);
debugger_break(tms->device->machine);
debugger_break(tms->device->machine());
}
}

View File

@ -630,7 +630,7 @@ static CPU_INIT( tms34010 )
tms->device = device;
tms->program = device->space(AS_PROGRAM);
tms->direct = &tms->program->direct();
tms->screen = downcast<screen_device *>(device->machine->device(configdata->screen_tag));
tms->screen = downcast<screen_device *>(device->machine().device(configdata->screen_tag));
/* set up the state table */
{
@ -652,11 +652,11 @@ static CPU_INIT( tms34010 )
}
/* allocate a scanline timer and set it to go off at the start */
tms->scantimer = device->machine->scheduler().timer_alloc(FUNC(scanline_callback), tms);
tms->scantimer = device->machine().scheduler().timer_alloc(FUNC(scanline_callback), tms);
tms->scantimer->adjust(attotime::zero);
/* allocate the shiftreg */
tms->shiftreg = auto_alloc_array(device->machine, UINT16, SHIFTREG_SIZE/2);
tms->shiftreg = auto_alloc_array(device->machine(), UINT16, SHIFTREG_SIZE/2);
device->save_item(NAME(tms->pc));
device->save_item(NAME(tms->st));
@ -669,7 +669,7 @@ static CPU_INIT( tms34010 )
device->save_item(NAME(tms->pixelshift));
device->save_item(NAME(tms->gfxcycles));
device->save_pointer(NAME(&tms->regs[0].reg), ARRAY_LENGTH(tms->regs));
device->machine->state().register_postload(tms34010_state_postload, tms);
device->machine().state().register_postload(tms34010_state_postload, tms);
}
static CPU_RESET( tms34010 )
@ -799,7 +799,7 @@ static CPU_EXECUTE( tms34010 )
/* check interrupts first */
tms->executing = TRUE;
check_interrupt(tms);
if ((tms->device->machine->debug_flags & DEBUG_FLAG_ENABLED) == 0)
if ((tms->device->machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
{
do
{
@ -1080,14 +1080,14 @@ void tms34010_get_display_params(device_t *cpu, tms34010_display_params *params)
SCREEN_UPDATE( tms340x0 )
{
pen_t blackpen = get_black_pen(screen->machine);
pen_t blackpen = get_black_pen(screen->machine());
tms34010_display_params params;
tms34010_state *tms = NULL;
device_t *cpu;
int x;
/* find the owning CPU */
for (cpu = screen->machine->m_devicelist.first(); cpu != NULL; cpu = cpu->next())
for (cpu = screen->machine().m_devicelist.first(); cpu != NULL; cpu = cpu->next())
{
device_type type = cpu->type();
if (type == TMS34010 || type == TMS34020)
@ -1200,7 +1200,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
/* NMI issued? */
if (data & 0x0100)
tms->device->machine->scheduler().synchronize(FUNC(internal_interrupt_callback), 0, tms);
tms->device->machine().scheduler().synchronize(FUNC(internal_interrupt_callback), 0, tms);
break;
case REG_HSTCTLL:
@ -1235,7 +1235,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
/* input interrupt? (should really be state-based, but the functions don't exist!) */
if (!(oldreg & 0x0008) && (newreg & 0x0008))
tms->device->machine->scheduler().synchronize(FUNC(internal_interrupt_callback), TMS34010_HI, tms);
tms->device->machine().scheduler().synchronize(FUNC(internal_interrupt_callback), TMS34010_HI, tms);
else if ((oldreg & 0x0008) && !(newreg & 0x0008))
IOREG(tms, REG_INTPEND) &= ~TMS34010_HI;
break;
@ -1270,7 +1270,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
}
// if (LOG_CONTROL_REGS)
// logerror("%s: %s = %04X (%d)\n", tms->device->machine->describe_context(), ioreg_name[offset], IOREG(tms, offset), tms->screen->vpos());
// logerror("%s: %s = %04X (%d)\n", tms->device->machine().describe_context(), ioreg_name[offset], IOREG(tms, offset), tms->screen->vpos());
}
@ -1307,7 +1307,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
IOREG(tms, offset) = data;
// if (LOG_CONTROL_REGS)
// logerror("%s: %s = %04X (%d)\n", device->machine->describe_context(), ioreg020_name[offset], IOREG(tms, offset), tms->screen->vpos());
// logerror("%s: %s = %04X (%d)\n", device->machine().describe_context(), ioreg020_name[offset], IOREG(tms, offset), tms->screen->vpos());
switch (offset)
{
@ -1351,7 +1351,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
/* NMI issued? */
if (data & 0x0100)
tms->device->machine->scheduler().synchronize(FUNC(internal_interrupt_callback), 0, tms);
tms->device->machine().scheduler().synchronize(FUNC(internal_interrupt_callback), 0, tms);
break;
case REG020_HSTCTLL:
@ -1386,7 +1386,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
/* input interrupt? (should really be state-based, but the functions don't exist!) */
if (!(oldreg & 0x0008) && (newreg & 0x0008))
tms->device->machine->scheduler().synchronize(FUNC(internal_interrupt_callback), TMS34010_HI, tms);
tms->device->machine().scheduler().synchronize(FUNC(internal_interrupt_callback), TMS34010_HI, tms);
else if ((oldreg & 0x0008) && !(newreg & 0x0008))
IOREG(tms, REG020_INTPEND) &= ~TMS34010_HI;
break;
@ -1466,7 +1466,7 @@ READ16_HANDLER( tms34010_io_register_r )
int result, total;
// if (LOG_CONTROL_REGS)
// logerror("%s: read %s\n", device->machine->describe_context(), ioreg_name[offset]);
// logerror("%s: read %s\n", device->machine().describe_context(), ioreg_name[offset]);
switch (offset)
{
@ -1509,7 +1509,7 @@ READ16_HANDLER( tms34020_io_register_r )
int result, total;
// if (LOG_CONTROL_REGS)
// logerror("%s: read %s\n", device->machine->describe_context(), ioreg_name[offset]);
// logerror("%s: read %s\n", device->machine().describe_context(), ioreg_name[offset]);
switch (offset)
{

View File

@ -1298,7 +1298,7 @@ static CPU_INIT( tms99xx )
cpustate->io = device->space(AS_IO);
#if (TMS99XX_MODEL == TMS9995_ID)
cpustate->timer = device->machine->scheduler().timer_alloc(FUNC(decrementer_callback), cpustate);
cpustate->timer = device->machine().scheduler().timer_alloc(FUNC(decrementer_callback), cpustate);
#endif
cpustate->idle_callback = param ? param->idle_callback : NULL;
@ -1815,7 +1815,7 @@ static void tms99xx_set_irq_line(tms99xx_state *cpustate, int irqline, int state
{ /* decrement, then interrupt if reach 0 */
if ((-- cpustate->decrementer_count) == 0)
{
decrementer_callback(cpustate->device->machine, cpustate, 0);
decrementer_callback(cpustate->device->machine(), cpustate, 0);
cpustate->decrementer_count = cpustate->decrementer_interval; /* reload */
}
}

View File

@ -72,17 +72,17 @@ device_config *upd96050_device_config::static_alloc_device_config(const machine_
device_t *necdsp_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, necdsp_device(machine, *this));
return auto_alloc(machine, necdsp_device(machine, *this));
}
device_t *upd7725_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, upd7725_device(machine, *this));
return auto_alloc(machine, upd7725_device(machine, *this));
}
device_t *upd96050_device_config::alloc_device(running_machine &machine) const
{
return auto_alloc(&machine, upd96050_device(machine, *this));
return auto_alloc(machine, upd96050_device(machine, *this));
}
//-------------------------------------------------

View File

@ -59,7 +59,7 @@ vtlb_state *vtlb_alloc(device_t *cpu, address_spacenum space, int fixed_entries,
vtlb_state *vtlb;
/* allocate memory for the core structure */
vtlb = auto_alloc_clear(cpu->machine, vtlb_state);
vtlb = auto_alloc_clear(cpu->machine(), vtlb_state);
/* fill in CPU information */
vtlb->cpudevice = downcast<cpu_device *>(cpu);
@ -76,17 +76,17 @@ vtlb_state *vtlb_alloc(device_t *cpu, address_spacenum space, int fixed_entries,
assert(vtlb->addrwidth > vtlb->pageshift);
/* allocate the entry array */
vtlb->live = auto_alloc_array_clear(cpu->machine, offs_t, fixed_entries + dynamic_entries);
vtlb->live = auto_alloc_array_clear(cpu->machine(), offs_t, fixed_entries + dynamic_entries);
cpu->save_pointer(NAME(vtlb->live), fixed_entries + dynamic_entries, space);
/* allocate the lookup table */
vtlb->table = auto_alloc_array_clear(cpu->machine, vtlb_entry, (size_t) 1 << (vtlb->addrwidth - vtlb->pageshift));
vtlb->table = auto_alloc_array_clear(cpu->machine(), vtlb_entry, (size_t) 1 << (vtlb->addrwidth - vtlb->pageshift));
cpu->save_pointer(NAME(vtlb->table), 1 << (vtlb->addrwidth - vtlb->pageshift), space);
/* allocate the fixed page count array */
if (fixed_entries > 0)
{
vtlb->fixedpages = auto_alloc_array_clear(cpu->machine, int, fixed_entries);
vtlb->fixedpages = auto_alloc_array_clear(cpu->machine(), int, fixed_entries);
cpu->save_pointer(NAME(vtlb->fixedpages), fixed_entries, space);
}
return vtlb;
@ -101,16 +101,16 @@ void vtlb_free(vtlb_state *vtlb)
{
/* free the fixed pages if allocated */
if (vtlb->fixedpages != NULL)
auto_free(vtlb->cpudevice->machine, vtlb->fixedpages);
auto_free(vtlb->cpudevice->machine(), vtlb->fixedpages);
/* free the table and array if they exist */
if (vtlb->live != NULL)
auto_free(vtlb->cpudevice->machine, vtlb->live);
auto_free(vtlb->cpudevice->machine(), vtlb->live);
if (vtlb->table != NULL)
auto_free(vtlb->cpudevice->machine, vtlb->table);
auto_free(vtlb->cpudevice->machine(), vtlb->table);
/* and then the VTLB object itself */
auto_free(vtlb->cpudevice->machine, vtlb);
auto_free(vtlb->cpudevice->machine(), vtlb);
}

View File

@ -1945,8 +1945,8 @@ static CPU_INIT( z180 )
cpustate->daisy.init(device, (const z80_daisy_config *)device->baseconfig().static_config());
cpustate->irq_callback = irqcallback;
SZHVC_add = auto_alloc_array(device->machine, UINT8, 2*256*256);
SZHVC_sub = auto_alloc_array(device->machine, UINT8, 2*256*256);
SZHVC_add = auto_alloc_array(device->machine(), UINT8, 2*256*256);
SZHVC_sub = auto_alloc_array(device->machine(), UINT8, 2*256*256);
/* set up the state table */
{

View File

@ -669,8 +669,8 @@ static CPU_INIT( z8 )
cpustate->io = device->space(AS_IO);
/* allocate timers */
cpustate->t0_timer = device->machine->scheduler().timer_alloc(FUNC(t0_tick), cpustate);
cpustate->t1_timer = device->machine->scheduler().timer_alloc(FUNC(t1_tick), cpustate);
cpustate->t0_timer = device->machine().scheduler().timer_alloc(FUNC(t0_tick), cpustate);
cpustate->t1_timer = device->machine().scheduler().timer_alloc(FUNC(t1_tick), cpustate);
/* register for state saving */
device->save_item(NAME(cpustate->pc));

View File

@ -95,7 +95,7 @@ void z80_daisy_chain::init(device_t *cpudevice, const z80_daisy_config *daisy)
fatalerror("Device '%s' does not implement the z80daisy interface!", daisy->devname);
// append to the end
*tailptr = auto_alloc(cpudevice->machine, daisy_entry(target));
*tailptr = auto_alloc(cpudevice->machine(), daisy_entry(target));
tailptr = &(*tailptr)->m_next;
}
}

View File

@ -132,8 +132,8 @@ static const rgb_t crosshair_colors[] =
***************************************************************************/
static void crosshair_exit(running_machine &machine);
static void crosshair_load(running_machine *machine, int config_type, xml_data_node *parentnode);
static void crosshair_save(running_machine *machine, int config_type, xml_data_node *parentnode);
static void crosshair_load(running_machine &machine, int config_type, xml_data_node *parentnode);
static void crosshair_save(running_machine &machine, int config_type, xml_data_node *parentnode);
static void animate(screen_device &device, void *param, bool vblank_state);
@ -148,7 +148,7 @@ static void animate(screen_device &device, void *param, bool vblank_state);
structures for the given player
-------------------------------------------------*/
static void create_bitmap(running_machine *machine, int player)
static void create_bitmap(running_machine &machine, int player)
{
int x, y;
char filename[20];
@ -156,9 +156,9 @@ static void create_bitmap(running_machine *machine, int player)
/* if we have a bitmap and texture for this player, kill it */
global_free(global.bitmap[player]);
machine->render().texture_free(global.texture[player]);
machine.render().texture_free(global.texture[player]);
emu_file crossfile(machine->options().crosshair_path(), OPEN_FLAG_READ);
emu_file crossfile(machine.options().crosshair_path(), OPEN_FLAG_READ);
if (global.name[player][0] != 0)
{
/* look for user specified file */
@ -169,7 +169,7 @@ static void create_bitmap(running_machine *machine, int player)
{
/* look for default cross?.png in crsshair\game dir */
sprintf(filename, "cross%d.png", player + 1);
global.bitmap[player] = render_load_png(crossfile, machine->system().name, filename, NULL, NULL);
global.bitmap[player] = render_load_png(crossfile, machine.system().name, filename, NULL, NULL);
/* look for default cross?.png in crsshair dir */
if (global.bitmap[player] == NULL)
@ -198,7 +198,7 @@ static void create_bitmap(running_machine *machine, int player)
}
/* create a texture to reference the bitmap */
global.texture[player] = machine->render().texture_alloc(render_texture::hq_scale);
global.texture[player] = machine.render().texture_alloc(render_texture::hq_scale);
global.texture[player]->set_bitmap(global.bitmap[player], NULL, TEXFORMAT_ARGB32);
}
@ -208,10 +208,10 @@ static void create_bitmap(running_machine *machine, int player)
bitmaps and such
-------------------------------------------------*/
void crosshair_init(running_machine *machine)
void crosshair_init(running_machine &machine)
{
/* request a callback upon exiting */
machine->add_notifier(MACHINE_NOTIFY_EXIT, crosshair_exit);
machine.add_notifier(MACHINE_NOTIFY_EXIT, crosshair_exit);
/* clear all the globals */
memset(&global, 0, sizeof(global));
@ -220,7 +220,7 @@ void crosshair_init(running_machine *machine)
global.auto_time = CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT;
/* determine who needs crosshairs */
for (const input_port_config *port = machine->m_portlist.first(); port != NULL; port = port->next())
for (const input_port_config *port = machine.m_portlist.first(); port != NULL; port = port->next())
for (const input_field_config *field = port->fieldlist; field != NULL; field = field->next)
if (field->crossaxis != CROSSHAIR_AXIS_NONE)
{
@ -235,7 +235,7 @@ void crosshair_init(running_machine *machine)
global.visible[player] = (CROSSHAIR_VISIBILITY_DEFAULT == CROSSHAIR_VISIBILITY_OFF) ? FALSE : TRUE;
/* for now, use the main screen */
global.screen[player] = machine->primary_screen;
global.screen[player] = machine.primary_screen;
create_bitmap(machine, player);
}
@ -245,8 +245,8 @@ void crosshair_init(running_machine *machine)
config_register(machine, "crosshairs", crosshair_load, crosshair_save);
/* register the animation callback */
if (machine->primary_screen != NULL)
machine->primary_screen->register_vblank_callback(animate, NULL);
if (machine.primary_screen != NULL)
machine.primary_screen->register_vblank_callback(animate, NULL);
}
@ -274,7 +274,7 @@ static void crosshair_exit(running_machine &machine)
if any crosshairs are used
-------------------------------------------------*/
int crosshair_get_usage(running_machine *machine)
int crosshair_get_usage(running_machine &machine)
{
return global.usage;
}
@ -286,7 +286,7 @@ int crosshair_get_usage(running_machine *machine)
Note: auto_time is common for all players
-------------------------------------------------*/
void crosshair_get_user_settings(running_machine *machine, UINT8 player, crosshair_user_settings *settings)
void crosshair_get_user_settings(running_machine &machine, UINT8 player, crosshair_user_settings *settings)
{
settings->auto_time = global.auto_time;
settings->used = global.used[player];
@ -301,7 +301,7 @@ void crosshair_get_user_settings(running_machine *machine, UINT8 player, crossha
Note: auto_time is common for all players
-------------------------------------------------*/
void crosshair_set_user_settings(running_machine *machine, UINT8 player, crosshair_user_settings *settings)
void crosshair_set_user_settings(running_machine &machine, UINT8 player, crosshair_user_settings *settings)
{
int changed = FALSE;
@ -346,7 +346,7 @@ static void animate(screen_device &device, void *param, bool vblank_state)
{
/* read all the lightgun values */
if (global.used[player])
input_port_get_crosshair_position(device.machine, player, &global.x[player], &global.y[player]);
input_port_get_crosshair_position(device.machine(), player, &global.x[player], &global.y[player]);
/* auto visibility */
if (global.mode[player] == CROSSHAIR_VISIBILITY_AUTO)
@ -405,7 +405,7 @@ void crosshair_render(screen_device &screen)
given player's crosshair
-------------------------------------------------*/
void crosshair_set_screen(running_machine *machine, int player, device_t *screen)
void crosshair_set_screen(running_machine &machine, int player, device_t *screen)
{
global.screen[player] = screen;
}
@ -416,7 +416,7 @@ void crosshair_set_screen(running_machine *machine, int player, device_t *screen
configuration file
-------------------------------------------------*/
static void crosshair_load(running_machine *machine, int config_type, xml_data_node *parentnode)
static void crosshair_load(running_machine &machine, int config_type, xml_data_node *parentnode)
{
/* Note: crosshair_load() is only registered if croshairs are used */
@ -475,7 +475,7 @@ static void crosshair_load(running_machine *machine, int config_type, xml_data_n
configuration file
-------------------------------------------------*/
static void crosshair_save(running_machine *machine, int config_type, xml_data_node *parentnode)
static void crosshair_save(running_machine &machine, int config_type, xml_data_node *parentnode)
{
/* Note: crosshair_save() is only registered if crosshairs are used */

View File

@ -59,22 +59,22 @@ struct _crosshair_user_settings
***************************************************************************/
/* initializes the crosshair system */
void crosshair_init(running_machine *machine);
void crosshair_init(running_machine &machine);
/* draws crosshair(s) in a given screen, if neccessary */
void crosshair_render(screen_device &screen);
/* sets the screen(s) for a given player's crosshair */
void crosshair_set_screen(running_machine *machine, int player, device_t *screen);
void crosshair_set_screen(running_machine &machine, int player, device_t *screen);
/* return TRUE if any crosshairs are used */
int crosshair_get_usage(running_machine *machine);
int crosshair_get_usage(running_machine &machine);
/* return the current crosshair settings for the given player */
void crosshair_get_user_settings(running_machine *machine, UINT8 player, crosshair_user_settings *settings);
void crosshair_get_user_settings(running_machine &machine, UINT8 player, crosshair_user_settings *settings);
/* modify the current crosshair settings for the given player */
void crosshair_set_user_settings(running_machine *machine, UINT8 player, crosshair_user_settings *settings);
void crosshair_set_user_settings(running_machine &machine, UINT8 player, crosshair_user_settings *settings);
#endif /* __CRSSHAIR_H__ */

View File

@ -99,56 +99,56 @@ static UINT64 execute_if(symbol_table &table, void *ref, int params, const UINT6
static UINT64 global_get(symbol_table &table, void *ref);
static void global_set(symbol_table &table, void *ref, UINT64 value);
static void execute_help(running_machine *machine, int ref, int params, const char **param);
static void execute_print(running_machine *machine, int ref, int params, const char **param);
static void execute_printf(running_machine *machine, int ref, int params, const char **param);
static void execute_logerror(running_machine *machine, int ref, int params, const char **param);
static void execute_tracelog(running_machine *machine, int ref, int params, const char **param);
static void execute_quit(running_machine *machine, int ref, int params, const char **param);
static void execute_do(running_machine *machine, int ref, int params, const char **param);
static void execute_step(running_machine *machine, int ref, int params, const char **param);
static void execute_over(running_machine *machine, int ref, int params, const char **param);
static void execute_out(running_machine *machine, int ref, int params, const char **param);
static void execute_go(running_machine *machine, int ref, int params, const char **param);
static void execute_go_vblank(running_machine *machine, int ref, int params, const char **param);
static void execute_go_interrupt(running_machine *machine, int ref, int params, const char **param);
static void execute_go_time(running_machine *machine, int ref, int params, const char *param[]);
static void execute_focus(running_machine *machine, int ref, int params, const char **param);
static void execute_ignore(running_machine *machine, int ref, int params, const char **param);
static void execute_observe(running_machine *machine, int ref, int params, const char **param);
static void execute_next(running_machine *machine, int ref, int params, const char **param);
static void execute_comment(running_machine *machine, int ref, int params, const char **param);
static void execute_comment_del(running_machine *machine, int ref, int params, const char **param);
static void execute_comment_save(running_machine *machine, int ref, int params, const char **param);
static void execute_bpset(running_machine *machine, int ref, int params, const char **param);
static void execute_bpclear(running_machine *machine, int ref, int params, const char **param);
static void execute_bpdisenable(running_machine *machine, int ref, int params, const char **param);
static void execute_bplist(running_machine *machine, int ref, int params, const char **param);
static void execute_wpset(running_machine *machine, int ref, int params, const char **param);
static void execute_wpclear(running_machine *machine, int ref, int params, const char **param);
static void execute_wpdisenable(running_machine *machine, int ref, int params, const char **param);
static void execute_wplist(running_machine *machine, int ref, int params, const char **param);
static void execute_hotspot(running_machine *machine, int ref, int params, const char **param);
static void execute_save(running_machine *machine, int ref, int params, const char **param);
static void execute_load(running_machine *machine, int ref, int params, const char **param);
static void execute_dump(running_machine *machine, int ref, int params, const char **param);
static void execute_cheatinit(running_machine *machine, int ref, int params, const char **param);
static void execute_cheatnext(running_machine *machine, int ref, int params, const char **param);
static void execute_cheatlist(running_machine *machine, int ref, int params, const char **param);
static void execute_cheatundo(running_machine *machine, int ref, int params, const char **param);
static void execute_dasm(running_machine *machine, int ref, int params, const char **param);
static void execute_find(running_machine *machine, int ref, int params, const char **param);
static void execute_trace(running_machine *machine, int ref, int params, const char **param);
static void execute_traceover(running_machine *machine, int ref, int params, const char **param);
static void execute_traceflush(running_machine *machine, int ref, int params, const char **param);
static void execute_history(running_machine *machine, int ref, int params, const char **param);
static void execute_snap(running_machine *machine, int ref, int params, const char **param);
static void execute_source(running_machine *machine, int ref, int params, const char **param);
static void execute_map(running_machine *machine, int ref, int params, const char **param);
static void execute_memdump(running_machine *machine, int ref, int params, const char **param);
static void execute_symlist(running_machine *machine, int ref, int params, const char **param);
static void execute_softreset(running_machine *machine, int ref, int params, const char **param);
static void execute_hardreset(running_machine *machine, int ref, int params, const char **param);
static void execute_help(running_machine &machine, int ref, int params, const char **param);
static void execute_print(running_machine &machine, int ref, int params, const char **param);
static void execute_printf(running_machine &machine, int ref, int params, const char **param);
static void execute_logerror(running_machine &machine, int ref, int params, const char **param);
static void execute_tracelog(running_machine &machine, int ref, int params, const char **param);
static void execute_quit(running_machine &machine, int ref, int params, const char **param);
static void execute_do(running_machine &machine, int ref, int params, const char **param);
static void execute_step(running_machine &machine, int ref, int params, const char **param);
static void execute_over(running_machine &machine, int ref, int params, const char **param);
static void execute_out(running_machine &machine, int ref, int params, const char **param);
static void execute_go(running_machine &machine, int ref, int params, const char **param);
static void execute_go_vblank(running_machine &machine, int ref, int params, const char **param);
static void execute_go_interrupt(running_machine &machine, int ref, int params, const char **param);
static void execute_go_time(running_machine &machine, int ref, int params, const char *param[]);
static void execute_focus(running_machine &machine, int ref, int params, const char **param);
static void execute_ignore(running_machine &machine, int ref, int params, const char **param);
static void execute_observe(running_machine &machine, int ref, int params, const char **param);
static void execute_next(running_machine &machine, int ref, int params, const char **param);
static void execute_comment(running_machine &machine, int ref, int params, const char **param);
static void execute_comment_del(running_machine &machine, int ref, int params, const char **param);
static void execute_comment_save(running_machine &machine, int ref, int params, const char **param);
static void execute_bpset(running_machine &machine, int ref, int params, const char **param);
static void execute_bpclear(running_machine &machine, int ref, int params, const char **param);
static void execute_bpdisenable(running_machine &machine, int ref, int params, const char **param);
static void execute_bplist(running_machine &machine, int ref, int params, const char **param);
static void execute_wpset(running_machine &machine, int ref, int params, const char **param);
static void execute_wpclear(running_machine &machine, int ref, int params, const char **param);
static void execute_wpdisenable(running_machine &machine, int ref, int params, const char **param);
static void execute_wplist(running_machine &machine, int ref, int params, const char **param);
static void execute_hotspot(running_machine &machine, int ref, int params, const char **param);
static void execute_save(running_machine &machine, int ref, int params, const char **param);
static void execute_load(running_machine &machine, int ref, int params, const char **param);
static void execute_dump(running_machine &machine, int ref, int params, const char **param);
static void execute_cheatinit(running_machine &machine, int ref, int params, const char **param);
static void execute_cheatnext(running_machine &machine, int ref, int params, const char **param);
static void execute_cheatlist(running_machine &machine, int ref, int params, const char **param);
static void execute_cheatundo(running_machine &machine, int ref, int params, const char **param);
static void execute_dasm(running_machine &machine, int ref, int params, const char **param);
static void execute_find(running_machine &machine, int ref, int params, const char **param);
static void execute_trace(running_machine &machine, int ref, int params, const char **param);
static void execute_traceover(running_machine &machine, int ref, int params, const char **param);
static void execute_traceflush(running_machine &machine, int ref, int params, const char **param);
static void execute_history(running_machine &machine, int ref, int params, const char **param);
static void execute_snap(running_machine &machine, int ref, int params, const char **param);
static void execute_source(running_machine &machine, int ref, int params, const char **param);
static void execute_map(running_machine &machine, int ref, int params, const char **param);
static void execute_memdump(running_machine &machine, int ref, int params, const char **param);
static void execute_symlist(running_machine &machine, int ref, int params, const char **param);
static void execute_softreset(running_machine &machine, int ref, int params, const char **param);
static void execute_hardreset(running_machine &machine, int ref, int params, const char **param);
@ -226,7 +226,7 @@ INLINE UINT64 cheat_read_extended(const cheat_system *cheatsys, address_space *s
system
-------------------------------------------------*/
void debug_command_init(running_machine *machine)
void debug_command_init(running_machine &machine)
{
symbol_table *symtable = debug_cpu_get_global_symtable(machine);
const char *name;
@ -244,7 +244,7 @@ void debug_command_init(running_machine *machine)
void *base;
/* stop when we run out of items */
name = machine->state().indexed_item(itemnum, base, valsize, valcount);
name = machine.state().indexed_item(itemnum, base, valsize, valcount);
if (name == NULL)
break;
@ -369,10 +369,10 @@ void debug_command_init(running_machine *machine)
debug_console_register_command(machine, "softreset", CMDFLAG_NONE, 0, 0, 1, execute_softreset);
debug_console_register_command(machine, "hardreset", CMDFLAG_NONE, 0, 0, 1, execute_hardreset);
machine->add_notifier(MACHINE_NOTIFY_EXIT, debug_command_exit);
machine.add_notifier(MACHINE_NOTIFY_EXIT, debug_command_exit);
/* set up the initial debugscript if specified */
name = machine->options().debug_script();
name = machine.options().debug_script();
if (name[0] != 0)
debug_cpu_source_script(machine, name);
}
@ -389,7 +389,7 @@ static void debug_command_exit(running_machine &machine)
device->debug()->trace(NULL, 0, NULL);
if (cheat.length)
auto_free(&machine, cheat.cheatmap);
auto_free(machine, cheat.cheatmap);
}
@ -478,7 +478,7 @@ static void global_set(symbol_table &table, void *ref, UINT64 value)
number parameter
-------------------------------------------------*/
int debug_command_parameter_number(running_machine *machine, const char *param, UINT64 *result)
int debug_command_parameter_number(running_machine &machine, const char *param, UINT64 *result)
{
/* NULL parameter does nothing and returns no error */
if (param == NULL)
@ -506,7 +506,7 @@ int debug_command_parameter_number(running_machine *machine, const char *param,
parameter as a cpu
-------------------------------------------------*/
int debug_command_parameter_cpu(running_machine *machine, const char *param, device_t **result)
int debug_command_parameter_cpu(running_machine &machine, const char *param, device_t **result)
{
UINT64 cpunum;
@ -523,7 +523,7 @@ int debug_command_parameter_cpu(running_machine *machine, const char *param, dev
}
/* first look for a tag match */
*result = machine->device(param);
*result = machine.device(param);
if (*result != NULL)
return TRUE;
@ -540,7 +540,7 @@ int debug_command_parameter_cpu(running_machine *machine, const char *param, dev
/* if we got a valid one, return */
device_execute_interface *exec = NULL;
for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
if (cpunum-- == 0)
{
*result = &exec->device();
@ -559,7 +559,7 @@ int debug_command_parameter_cpu(running_machine *machine, const char *param, dev
address space
-------------------------------------------------*/
int debug_command_parameter_cpu_space(running_machine *machine, const char *param, int spacenum, address_space **result)
int debug_command_parameter_cpu_space(running_machine &machine, const char *param, int spacenum, address_space **result)
{
device_t *cpu;
@ -583,7 +583,7 @@ int debug_command_parameter_cpu_space(running_machine *machine, const char *para
an expression parameter
-------------------------------------------------*/
static int debug_command_parameter_expression(running_machine *machine, const char *param, parsed_expression &result)
static int debug_command_parameter_expression(running_machine &machine, const char *param, parsed_expression &result)
{
/* NULL parameter does nothing and returns no error */
if (param == NULL)
@ -611,7 +611,7 @@ static int debug_command_parameter_expression(running_machine *machine, const ch
command parameter
-------------------------------------------------*/
static int debug_command_parameter_command(running_machine *machine, const char *param)
static int debug_command_parameter_command(running_machine &machine, const char *param)
{
CMDERR err;
@ -641,7 +641,7 @@ static int debug_command_parameter_command(running_machine *machine, const char
execute_help - execute the help command
-------------------------------------------------*/
static void execute_help(running_machine *machine, int ref, int params, const char *param[])
static void execute_help(running_machine &machine, int ref, int params, const char *param[])
{
if (params == 0)
debug_console_printf_wrap(machine, 80, "%s\n", debug_get_help(""));
@ -654,7 +654,7 @@ static void execute_help(running_machine *machine, int ref, int params, const ch
execute_print - execute the print command
-------------------------------------------------*/
static void execute_print(running_machine *machine, int ref, int params, const char *param[])
static void execute_print(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 values[MAX_COMMAND_PARAMS];
int i;
@ -675,7 +675,7 @@ static void execute_print(running_machine *machine, int ref, int params, const c
mini_printf - safe printf to a buffer
-------------------------------------------------*/
static int mini_printf(running_machine *machine, char *buffer, const char *format, int params, UINT64 *param)
static int mini_printf(running_machine &machine, char *buffer, const char *format, int params, UINT64 *param)
{
const char *f = format;
char *p = buffer;
@ -769,7 +769,7 @@ static int mini_printf(running_machine *machine, char *buffer, const char *forma
execute_printf - execute the printf command
-------------------------------------------------*/
static void execute_printf(running_machine *machine, int ref, int params, const char *param[])
static void execute_printf(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 values[MAX_COMMAND_PARAMS];
char buffer[1024];
@ -790,7 +790,7 @@ static void execute_printf(running_machine *machine, int ref, int params, const
execute_logerror - execute the logerror command
-------------------------------------------------*/
static void execute_logerror(running_machine *machine, int ref, int params, const char *param[])
static void execute_logerror(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 values[MAX_COMMAND_PARAMS];
char buffer[1024];
@ -811,7 +811,7 @@ static void execute_logerror(running_machine *machine, int ref, int params, cons
execute_tracelog - execute the tracelog command
-------------------------------------------------*/
static void execute_tracelog(running_machine *machine, int ref, int params, const char *param[])
static void execute_tracelog(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 values[MAX_COMMAND_PARAMS];
char buffer[1024];
@ -832,10 +832,10 @@ static void execute_tracelog(running_machine *machine, int ref, int params, cons
execute_quit - execute the quit command
-------------------------------------------------*/
static void execute_quit(running_machine *machine, int ref, int params, const char *param[])
static void execute_quit(running_machine &machine, int ref, int params, const char *param[])
{
mame_printf_error("Exited via the debugger\n");
machine->schedule_exit();
machine.schedule_exit();
}
@ -843,7 +843,7 @@ static void execute_quit(running_machine *machine, int ref, int params, const ch
execute_do - execute the do command
-------------------------------------------------*/
static void execute_do(running_machine *machine, int ref, int params, const char *param[])
static void execute_do(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 dummy;
debug_command_parameter_number(machine, param[0], &dummy);
@ -854,7 +854,7 @@ static void execute_do(running_machine *machine, int ref, int params, const char
execute_step - execute the step command
-------------------------------------------------*/
static void execute_step(running_machine *machine, int ref, int params, const char *param[])
static void execute_step(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 steps = 1;
@ -870,7 +870,7 @@ static void execute_step(running_machine *machine, int ref, int params, const ch
execute_over - execute the over command
-------------------------------------------------*/
static void execute_over(running_machine *machine, int ref, int params, const char *param[])
static void execute_over(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 steps = 1;
@ -886,7 +886,7 @@ static void execute_over(running_machine *machine, int ref, int params, const ch
execute_out - execute the out command
-------------------------------------------------*/
static void execute_out(running_machine *machine, int ref, int params, const char *param[])
static void execute_out(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_get_visible_cpu(machine)->debug()->single_step_out();
}
@ -896,7 +896,7 @@ static void execute_out(running_machine *machine, int ref, int params, const cha
execute_go - execute the go command
-------------------------------------------------*/
static void execute_go(running_machine *machine, int ref, int params, const char *param[])
static void execute_go(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 addr = ~0;
@ -913,7 +913,7 @@ static void execute_go(running_machine *machine, int ref, int params, const char
command
-------------------------------------------------*/
static void execute_go_vblank(running_machine *machine, int ref, int params, const char *param[])
static void execute_go_vblank(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_get_visible_cpu(machine)->debug()->go_vblank();
}
@ -923,7 +923,7 @@ static void execute_go_vblank(running_machine *machine, int ref, int params, con
execute_go_interrupt - execute the goint command
-------------------------------------------------*/
static void execute_go_interrupt(running_machine *machine, int ref, int params, const char *param[])
static void execute_go_interrupt(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 irqline = -1;
@ -939,7 +939,7 @@ static void execute_go_interrupt(running_machine *machine, int ref, int params,
execute_go_time - execute the gtime command
-------------------------------------------------*/
static void execute_go_time(running_machine *machine, int ref, int params, const char *param[])
static void execute_go_time(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 milliseconds = -1;
@ -955,7 +955,7 @@ static void execute_go_time(running_machine *machine, int ref, int params, const
execute_next - execute the next command
-------------------------------------------------*/
static void execute_next(running_machine *machine, int ref, int params, const char *param[])
static void execute_next(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_get_visible_cpu(machine)->debug()->go_next_device();
}
@ -965,7 +965,7 @@ static void execute_next(running_machine *machine, int ref, int params, const ch
execute_focus - execute the focus command
-------------------------------------------------*/
static void execute_focus(running_machine *machine, int ref, int params, const char *param[])
static void execute_focus(running_machine &machine, int ref, int params, const char *param[])
{
/* validate params */
device_t *cpu;
@ -977,7 +977,7 @@ static void execute_focus(running_machine *machine, int ref, int params, const c
/* then loop over CPUs and set the ignore flags on all other CPUs */
device_execute_interface *exec = NULL;
for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
if (&exec->device() != cpu)
exec->device().debug()->ignore(true);
debug_console_printf(machine, "Now focused on CPU '%s'\n", cpu->tag());
@ -988,7 +988,7 @@ static void execute_focus(running_machine *machine, int ref, int params, const c
execute_ignore - execute the ignore command
-------------------------------------------------*/
static void execute_ignore(running_machine *machine, int ref, int params, const char *param[])
static void execute_ignore(running_machine &machine, int ref, int params, const char *param[])
{
/* if there are no parameters, dump the ignore list */
if (params == 0)
@ -997,7 +997,7 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
/* loop over all executable devices */
device_execute_interface *exec = NULL;
for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
/* build up a comma-separated list */
if (!exec->device().debug()->observing())
@ -1030,7 +1030,7 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
/* make sure this isn't the last live CPU */
device_execute_interface *exec = NULL;
bool gotone;
for (gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
for (gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
if (&exec->device() != devicelist[paramnum] && exec->device().debug()->observing())
break;
if (!gotone)
@ -1050,7 +1050,7 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
execute_observe - execute the observe command
-------------------------------------------------*/
static void execute_observe(running_machine *machine, int ref, int params, const char *param[])
static void execute_observe(running_machine &machine, int ref, int params, const char *param[])
{
/* if there are no parameters, dump the ignore list */
if (params == 0)
@ -1059,7 +1059,7 @@ static void execute_observe(running_machine *machine, int ref, int params, const
/* loop over all executable devices */
device_execute_interface *exec = NULL;
for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
/* build up a comma-separated list */
if (exec->device().debug()->observing())
@ -1100,7 +1100,7 @@ static void execute_observe(running_machine *machine, int ref, int params, const
execute_comment - add a comment to a line
-------------------------------------------------*/
static void execute_comment(running_machine *machine, int ref, int params, const char *param[])
static void execute_comment(running_machine &machine, int ref, int params, const char *param[])
{
device_t *cpu;
UINT64 address;
@ -1122,7 +1122,7 @@ static void execute_comment(running_machine *machine, int ref, int params, const
/* Now try adding the comment */
cpu->debug()->comment_add(address, param[1], 0x00ff0000);
cpu->machine->debug_view().update_all(DVT_DISASSEMBLY);
cpu->machine().debug_view().update_all(DVT_DISASSEMBLY);
}
@ -1130,7 +1130,7 @@ static void execute_comment(running_machine *machine, int ref, int params, const
execute_comment_del - remove a comment from an addr
--------------------------------------------------------*/
static void execute_comment_del(running_machine *machine, int ref, int params, const char *param[])
static void execute_comment_del(running_machine &machine, int ref, int params, const char *param[])
{
device_t *cpu;
UINT64 address;
@ -1146,7 +1146,7 @@ static void execute_comment_del(running_machine *machine, int ref, int params, c
/* If it's a number, it must be an address */
/* The bankoff and cbn will be pulled from what's currently active */
cpu->debug()->comment_remove(address);
cpu->machine->debug_view().update_all(DVT_DISASSEMBLY);
cpu->machine().debug_view().update_all(DVT_DISASSEMBLY);
}
@ -1154,7 +1154,7 @@ static void execute_comment_del(running_machine *machine, int ref, int params, c
execute_comment - add a comment to a line
-------------------------------------------------*/
static void execute_comment_save(running_machine *machine, int ref, int params, const char *param[])
static void execute_comment_save(running_machine &machine, int ref, int params, const char *param[])
{
if (debug_comment_save(machine))
debug_console_printf(machine, "Comments successfully saved\n");
@ -1166,7 +1166,7 @@ static void execute_comment_save(running_machine *machine, int ref, int params,
command
-------------------------------------------------*/
static void execute_bpset(running_machine *machine, int ref, int params, const char *param[])
static void execute_bpset(running_machine &machine, int ref, int params, const char *param[])
{
device_t *cpu;
const char *action = NULL;
@ -1201,14 +1201,14 @@ static void execute_bpset(running_machine *machine, int ref, int params, const c
clear command
-------------------------------------------------*/
static void execute_bpclear(running_machine *machine, int ref, int params, const char *param[])
static void execute_bpclear(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 bpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
device->debug()->breakpoint_clear_all();
debug_console_printf(machine, "Cleared all breakpoints\n");
}
@ -1219,7 +1219,7 @@ static void execute_bpclear(running_machine *machine, int ref, int params, const
else
{
bool found = false;
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_clear(bpindex))
found = true;
if (found)
@ -1235,14 +1235,14 @@ static void execute_bpclear(running_machine *machine, int ref, int params, const
disable/enable commands
-------------------------------------------------*/
static void execute_bpdisenable(running_machine *machine, int ref, int params, const char *param[])
static void execute_bpdisenable(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 bpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
device->debug()->breakpoint_enable_all(ref);
if (ref == 0)
debug_console_printf(machine, "Disabled all breakpoints\n");
@ -1256,7 +1256,7 @@ static void execute_bpdisenable(running_machine *machine, int ref, int params, c
else
{
bool found = false;
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_enable(bpindex, ref))
found = true;
if (found)
@ -1272,13 +1272,13 @@ static void execute_bpdisenable(running_machine *machine, int ref, int params, c
command
-------------------------------------------------*/
static void execute_bplist(running_machine *machine, int ref, int params, const char *param[])
static void execute_bplist(running_machine &machine, int ref, int params, const char *param[])
{
int printed = 0;
astring buffer;
/* loop over all CPUs */
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_first() != NULL)
{
debug_console_printf(machine, "Device '%s' breakpoints:\n", device->tag());
@ -1306,7 +1306,7 @@ static void execute_bplist(running_machine *machine, int ref, int params, const
command
-------------------------------------------------*/
static void execute_wpset(running_machine *machine, int ref, int params, const char *param[])
static void execute_wpset(running_machine &machine, int ref, int params, const char *param[])
{
address_space *space;
const char *action = NULL;
@ -1359,14 +1359,14 @@ static void execute_wpset(running_machine *machine, int ref, int params, const c
clear command
-------------------------------------------------*/
static void execute_wpclear(running_machine *machine, int ref, int params, const char *param[])
static void execute_wpclear(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 wpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
device->debug()->watchpoint_clear_all();
debug_console_printf(machine, "Cleared all watchpoints\n");
}
@ -1377,7 +1377,7 @@ static void execute_wpclear(running_machine *machine, int ref, int params, const
else
{
bool found = false;
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->watchpoint_clear(wpindex))
found = true;
if (found)
@ -1393,14 +1393,14 @@ static void execute_wpclear(running_machine *machine, int ref, int params, const
disable/enable commands
-------------------------------------------------*/
static void execute_wpdisenable(running_machine *machine, int ref, int params, const char *param[])
static void execute_wpdisenable(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 wpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
device->debug()->watchpoint_enable_all(ref);
if (ref == 0)
debug_console_printf(machine, "Disabled all watchpoints\n");
@ -1414,7 +1414,7 @@ static void execute_wpdisenable(running_machine *machine, int ref, int params, c
else
{
bool found = false;
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->watchpoint_enable(wpindex, ref))
found = true;
if (found)
@ -1430,13 +1430,13 @@ static void execute_wpdisenable(running_machine *machine, int ref, int params, c
command
-------------------------------------------------*/
static void execute_wplist(running_machine *machine, int ref, int params, const char *param[])
static void execute_wplist(running_machine &machine, int ref, int params, const char *param[])
{
int printed = 0;
astring buffer;
/* loop over all CPUs */
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
if (device->debug()->watchpoint_first(spacenum) != NULL)
{
@ -1470,7 +1470,7 @@ static void execute_wplist(running_machine *machine, int ref, int params, const
command
-------------------------------------------------*/
static void execute_hotspot(running_machine *machine, int ref, int params, const char *param[])
static void execute_hotspot(running_machine &machine, int ref, int params, const char *param[])
{
/* if no params, and there are live hotspots, clear them */
if (params == 0)
@ -1478,7 +1478,7 @@ static void execute_hotspot(running_machine *machine, int ref, int params, const
bool cleared = false;
/* loop over CPUs and find live spots */
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->hotspot_tracking_enabled())
{
device->debug()->hotspot_track(0, 0);
@ -1512,7 +1512,7 @@ static void execute_hotspot(running_machine *machine, int ref, int params, const
execute_save - execute the save command
-------------------------------------------------*/
static void execute_save(running_machine *machine, int ref, int params, const char *param[])
static void execute_save(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, endoffset, length;
address_space *space;
@ -1556,7 +1556,7 @@ static void execute_save(running_machine *machine, int ref, int params, const ch
execute_load - execute the load command
-------------------------------------------------*/
static void execute_load(running_machine *machine, int ref, int params, const char *param[])
static void execute_load(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, endoffset, length;
address_space *space;
@ -1606,7 +1606,7 @@ static void execute_load(running_machine *machine, int ref, int params, const ch
execute_dump - execute the dump command
-------------------------------------------------*/
static void execute_dump(running_machine *machine, int ref, int params, const char *param[])
static void execute_dump(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, endoffset, length, width = 0, ascii = 1;
address_space *space;
@ -1704,7 +1704,7 @@ static void execute_dump(running_machine *machine, int ref, int params, const ch
execute_cheatinit - initialize the cheat system
-------------------------------------------------*/
static void execute_cheatinit(running_machine *machine, int ref, int params, const char *param[])
static void execute_cheatinit(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, length = 0, real_length = 0;
address_space *space;
@ -1867,7 +1867,7 @@ static void execute_cheatinit(running_machine *machine, int ref, int params, con
execute_cheatnext - execute the search
-------------------------------------------------*/
static void execute_cheatnext(running_machine *machine, int ref, int params, const char *param[])
static void execute_cheatnext(running_machine &machine, int ref, int params, const char *param[])
{
address_space *space;
UINT64 cheatindex;
@ -2044,7 +2044,7 @@ static void execute_cheatnext(running_machine *machine, int ref, int params, con
execute_cheatlist - show a list of active cheat
-------------------------------------------------*/
static void execute_cheatlist(running_machine *machine, int ref, int params, const char *param[])
static void execute_cheatlist(running_machine &machine, int ref, int params, const char *param[])
{
char spaceletter, sizeletter;
address_space *space;
@ -2110,7 +2110,7 @@ static void execute_cheatlist(running_machine *machine, int ref, int params, con
execute_cheatundo - undo the last search
-------------------------------------------------*/
static void execute_cheatundo(running_machine *machine, int ref, int params, const char *param[])
static void execute_cheatundo(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 cheatindex;
UINT32 undo_count = 0;
@ -2139,7 +2139,7 @@ static void execute_cheatundo(running_machine *machine, int ref, int params, con
execute_find - execute the find command
-------------------------------------------------*/
static void execute_find(running_machine *machine, int ref, int params, const char *param[])
static void execute_find(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, endoffset, length;
address_space *space;
@ -2238,7 +2238,7 @@ static void execute_find(running_machine *machine, int ref, int params, const ch
execute_dasm - execute the dasm command
-------------------------------------------------*/
static void execute_dasm(running_machine *machine, int ref, int params, const char *param[])
static void execute_dasm(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, length, bytes = 1;
int minbytes, maxbytes, byteswidth;
@ -2353,7 +2353,7 @@ static void execute_dasm(running_machine *machine, int ref, int params, const ch
trace over and trace info
-------------------------------------------------*/
static void execute_trace_internal(running_machine *machine, int ref, int params, const char *param[], int trace_over)
static void execute_trace_internal(running_machine &machine, int ref, int params, const char *param[], int trace_over)
{
const char *action = NULL, *filename = param[0];
device_t *cpu;
@ -2403,7 +2403,7 @@ static void execute_trace_internal(running_machine *machine, int ref, int params
execute_trace - execute the trace command
-------------------------------------------------*/
static void execute_trace(running_machine *machine, int ref, int params, const char *param[])
static void execute_trace(running_machine &machine, int ref, int params, const char *param[])
{
execute_trace_internal(machine, ref, params, param, 0);
}
@ -2413,7 +2413,7 @@ static void execute_trace(running_machine *machine, int ref, int params, const c
execute_traceover - execute the trace over command
-------------------------------------------------*/
static void execute_traceover(running_machine *machine, int ref, int params, const char *param[])
static void execute_traceover(running_machine &machine, int ref, int params, const char *param[])
{
execute_trace_internal(machine, ref, params, param, 1);
}
@ -2423,7 +2423,7 @@ static void execute_traceover(running_machine *machine, int ref, int params, con
execute_traceflush - execute the trace flush command
-------------------------------------------------*/
static void execute_traceflush(running_machine *machine, int ref, int params, const char *param[])
static void execute_traceflush(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_flush_traces(machine);
}
@ -2433,7 +2433,7 @@ static void execute_traceflush(running_machine *machine, int ref, int params, co
execute_history - execute the history command
-------------------------------------------------*/
static void execute_history(running_machine *machine, int ref, int params, const char *param[])
static void execute_history(running_machine &machine, int ref, int params, const char *param[])
{
/* validate parameters */
address_space *space;
@ -2477,12 +2477,12 @@ static void execute_history(running_machine *machine, int ref, int params, const
execute_snap - execute the snapshot command
-------------------------------------------------*/
static void execute_snap(running_machine *machine, int ref, int params, const char *param[])
static void execute_snap(running_machine &machine, int ref, int params, const char *param[])
{
/* if no params, use the default behavior */
if (params == 0)
{
machine->video().save_active_screen_snapshots();
machine.video().save_active_screen_snapshots();
debug_console_printf(machine, "Saved snapshot\n");
}
@ -2492,9 +2492,9 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch
const char *filename = param[0];
int scrnum = (params > 1) ? atoi(param[1]) : 0;
screen_device *screen = downcast<screen_device *>(machine->m_devicelist.find(SCREEN, scrnum));
screen_device *screen = downcast<screen_device *>(machine.m_devicelist.find(SCREEN, scrnum));
if ((screen == NULL) || !machine->render().is_live(*screen))
if ((screen == NULL) || !machine.render().is_live(*screen))
{
debug_console_printf(machine, "Invalid screen number '%d'\n", scrnum);
return;
@ -2503,7 +2503,7 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch
astring fname(filename);
if (fname.find(0, ".png") == -1)
fname.cat(".png");
emu_file file(machine->options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
emu_file file(machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
file_error filerr = file.open(fname);
if (filerr != FILERR_NONE)
@ -2512,7 +2512,7 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch
return;
}
screen->machine->video().save_snapshot(screen, file);
screen->machine().video().save_snapshot(screen, file);
debug_console_printf(machine, "Saved screen #%d snapshot as '%s'\n", scrnum, filename);
}
}
@ -2522,7 +2522,7 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch
execute_source - execute the source command
-------------------------------------------------*/
static void execute_source(running_machine *machine, int ref, int params, const char *param[])
static void execute_source(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_source_script(machine, param[0]);
}
@ -2532,7 +2532,7 @@ static void execute_source(running_machine *machine, int ref, int params, const
execute_map - execute the map command
-------------------------------------------------*/
static void execute_map(running_machine *machine, int ref, int params, const char *param[])
static void execute_map(running_machine &machine, int ref, int params, const char *param[])
{
address_space *space;
offs_t taddress;
@ -2567,7 +2567,7 @@ static void execute_map(running_machine *machine, int ref, int params, const cha
execute_memdump - execute the memdump command
-------------------------------------------------*/
static void execute_memdump(running_machine *machine, int ref, int params, const char **param)
static void execute_memdump(running_machine &machine, int ref, int params, const char **param)
{
FILE *file;
const char *filename;
@ -2596,7 +2596,7 @@ static int CLIB_DECL symbol_sort_compare(const void *item1, const void *item2)
return strcmp(str1, str2);
}
static void execute_symlist(running_machine *machine, int ref, int params, const char **param)
static void execute_symlist(running_machine &machine, int ref, int params, const char **param)
{
device_t *cpu = NULL;
const char *namelist[1000];
@ -2654,9 +2654,9 @@ static void execute_symlist(running_machine *machine, int ref, int params, const
execute_softreset - execute the softreset command
-------------------------------------------------*/
static void execute_softreset(running_machine *machine, int ref, int params, const char **param)
static void execute_softreset(running_machine &machine, int ref, int params, const char **param)
{
machine->schedule_soft_reset();
machine.schedule_soft_reset();
}
@ -2664,7 +2664,7 @@ static void execute_softreset(running_machine *machine, int ref, int params, con
execute_hardreset - execute the hardreset command
-------------------------------------------------*/
static void execute_hardreset(running_machine *machine, int ref, int params, const char **param)
static void execute_hardreset(running_machine &machine, int ref, int params, const char **param)
{
machine->schedule_hard_reset();
machine.schedule_hard_reset();
}

View File

@ -20,19 +20,19 @@
/* ----- initialization ----- */
/* initializes the command system */
void debug_command_init(running_machine *machine);
void debug_command_init(running_machine &machine);
/* ----- parameter validation ----- */
/* validates a number parameter */
int debug_command_parameter_number(running_machine *machine, const char *param, UINT64 *result);
int debug_command_parameter_number(running_machine &machine, const char *param, UINT64 *result);
/* validates a parameter as a cpu */
int debug_command_parameter_cpu(running_machine *machine, const char *param, device_t **result);
int debug_command_parameter_cpu(running_machine &machine, const char *param, device_t **result);
/* validates a parameter as a cpu and retrieves the given address space */
int debug_command_parameter_cpu_space(running_machine *machine, const char *param, int spacenum, address_space **result);
int debug_command_parameter_cpu_space(running_machine &machine, const char *param, int spacenum, address_space **result);
#endif

View File

@ -43,7 +43,7 @@ struct _debug_command
char command[32];
const char * params;
const char * help;
void (*handler)(running_machine *machine, int ref, int params, const char **param);
void (*handler)(running_machine &machine, int ref, int params, const char **param);
void (*handler_ex)(int ref);
UINT32 flags;
int ref;
@ -83,7 +83,7 @@ static void debug_console_exit(running_machine &machine);
system
-------------------------------------------------*/
void debug_console_init(running_machine *machine)
void debug_console_init(running_machine &machine)
{
/* allocate text buffers */
console_textbuf = text_buffer_alloc(CONSOLE_BUF_SIZE, CONSOLE_MAX_LINES);
@ -96,10 +96,10 @@ void debug_console_init(running_machine *machine)
/* print the opening lines */
debug_console_printf(machine, "MAME new debugger version %s\n", build_version);
debug_console_printf(machine, "Currently targeting %s (%s)\n", machine->system().name, machine->system().description);
debug_console_printf(machine, "Currently targeting %s (%s)\n", machine.system().name, machine.system().description);
/* request callback upon exiting */
machine->add_notifier(MACHINE_NOTIFY_EXIT, debug_console_exit);
machine.add_notifier(MACHINE_NOTIFY_EXIT, debug_console_exit);
}
@ -193,7 +193,7 @@ static void trim_parameter(char **paramptr, int keep_quotes)
command
-------------------------------------------------*/
static CMDERR internal_execute_command(running_machine *machine, int execute, int params, char **param)
static CMDERR internal_execute_command(running_machine &machine, int execute, int params, char **param)
{
debug_command *cmd, *found = NULL;
int i, foundcount = 0;
@ -268,7 +268,7 @@ static CMDERR internal_execute_command(running_machine *machine, int execute, in
and either executes or just validates it
-------------------------------------------------*/
static CMDERR internal_parse_command(running_machine *machine, const char *original_command, int execute)
static CMDERR internal_parse_command(running_machine &machine, const char *original_command, int execute)
{
char command[MAX_COMMAND_LENGTH], parens[MAX_COMMAND_LENGTH];
char *params[MAX_COMMAND_PARAMS] = { 0 };
@ -364,7 +364,7 @@ static CMDERR internal_parse_command(running_machine *machine, const char *origi
command string
-------------------------------------------------*/
CMDERR debug_console_execute_command(running_machine *machine, const char *command, int echo)
CMDERR debug_console_execute_command(running_machine &machine, const char *command, int echo)
{
CMDERR result;
@ -387,7 +387,7 @@ CMDERR debug_console_execute_command(running_machine *machine, const char *comma
/* update all views */
if (echo)
{
machine->debug_view().update_all();
machine.debug_view().update_all();
debugger_refresh_display(machine);
}
return result;
@ -399,7 +399,7 @@ CMDERR debug_console_execute_command(running_machine *machine, const char *comma
command string
-------------------------------------------------*/
CMDERR debug_console_validate_command(running_machine *machine, const char *command)
CMDERR debug_console_validate_command(running_machine &machine, const char *command)
{
return internal_parse_command(machine, command, FALSE);
}
@ -410,12 +410,12 @@ CMDERR debug_console_validate_command(running_machine *machine, const char *comm
command handler
-------------------------------------------------*/
void debug_console_register_command(running_machine *machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine *machine, int ref, int params, const char **param))
void debug_console_register_command(running_machine &machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine &machine, int ref, int params, const char **param))
{
debug_command *cmd;
assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call debug_console_register_command() at init time!");
assert_always((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call debug_console_register_command() when debugger is not running");
assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call debug_console_register_command() at init time!");
assert_always((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call debug_console_register_command() when debugger is not running");
cmd = auto_alloc_clear(machine, debug_command);
@ -474,7 +474,7 @@ const char *debug_cmderr_to_string(CMDERR error)
console
-------------------------------------------------*/
void CLIB_DECL debug_console_printf(running_machine *machine, const char *format, ...)
void CLIB_DECL debug_console_printf(running_machine &machine, const char *format, ...)
{
astring buffer;
va_list arg;
@ -486,7 +486,7 @@ void CLIB_DECL debug_console_printf(running_machine *machine, const char *format
text_buffer_print(console_textbuf, buffer);
/* force an update of any console views */
machine->debug_view().update_all(DVT_CONSOLE);
machine.debug_view().update_all(DVT_CONSOLE);
}
@ -496,7 +496,7 @@ void CLIB_DECL debug_console_printf(running_machine *machine, const char *format
console
-------------------------------------------------*/
void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *format, va_list args)
void CLIB_DECL debug_console_vprintf(running_machine &machine, const char *format, va_list args)
{
astring buffer;
@ -504,7 +504,7 @@ void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *forma
text_buffer_print(console_textbuf, buffer);
/* force an update of any console views */
machine->debug_view().update_all(DVT_CONSOLE);
machine.debug_view().update_all(DVT_CONSOLE);
}
@ -514,7 +514,7 @@ void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *forma
console
-------------------------------------------------*/
void CLIB_DECL debug_console_printf_wrap(running_machine *machine, int wrapcol, const char *format, ...)
void CLIB_DECL debug_console_printf_wrap(running_machine &machine, int wrapcol, const char *format, ...)
{
astring buffer;
va_list arg;
@ -526,7 +526,7 @@ void CLIB_DECL debug_console_printf_wrap(running_machine *machine, int wrapcol,
text_buffer_print_wrap(console_textbuf, buffer, wrapcol);
/* force an update of any console views */
machine->debug_view().update_all(DVT_CONSOLE);
machine.debug_view().update_all(DVT_CONSOLE);
}

View File

@ -75,18 +75,18 @@ typedef UINT32 CMDERR;
***************************************************************************/
/* initialization */
void debug_console_init(running_machine *machine);
void debug_console_init(running_machine &machine);
/* command handling */
CMDERR debug_console_execute_command(running_machine *machine, const char *command, int echo);
CMDERR debug_console_validate_command(running_machine *machine, const char *command);
void debug_console_register_command(running_machine *machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine *machine, int ref, int params, const char **param));
CMDERR debug_console_execute_command(running_machine &machine, const char *command, int echo);
CMDERR debug_console_validate_command(running_machine &machine, const char *command);
void debug_console_register_command(running_machine &machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine &machine, int ref, int params, const char **param));
const char * debug_cmderr_to_string(CMDERR error);
/* console management */
void CLIB_DECL debug_console_printf(running_machine *machine, const char *format, ...) ATTR_PRINTF(2,3);
void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *format, va_list args);
void CLIB_DECL debug_console_printf_wrap(running_machine *machine, int wrapcol, const char *format, ...) ATTR_PRINTF(3,4);
void CLIB_DECL debug_console_printf(running_machine &machine, const char *format, ...) ATTR_PRINTF(2,3);
void CLIB_DECL debug_console_vprintf(running_machine &machine, const char *format, va_list args);
void CLIB_DECL debug_console_printf_wrap(running_machine &machine, int wrapcol, const char *format, ...) ATTR_PRINTF(3,4);
text_buffer * debug_console_get_textbuf(void);
/* errorlog management */

View File

@ -115,15 +115,15 @@ struct _debugcpu_private
static void debug_cpu_exit(running_machine &machine);
static void on_vblank(screen_device &device, void *param, bool vblank_state);
static void reset_transient_flags(running_machine &machine);
static void process_source_file(running_machine *machine);
static void process_source_file(running_machine &machine);
/* expression handlers */
static UINT64 expression_read_memory(void *param, const char *name, expression_space space, UINT32 address, int size);
static UINT64 expression_read_program_direct(address_space *space, int opcode, offs_t address, int size);
static UINT64 expression_read_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size);
static UINT64 expression_read_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size);
static void expression_write_memory(void *param, const char *name, expression_space space, UINT32 address, int size, UINT64 data);
static void expression_write_program_direct(address_space *space, int opcode, offs_t address, int size, UINT64 data);
static void expression_write_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size, UINT64 data);
static void expression_write_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size, UINT64 data);
static expression_error::error_code expression_validate(void *param, const char *name, expression_space space);
/* variable getters/setters */
@ -143,23 +143,23 @@ static UINT64 get_frame(symbol_table &table, void *ref);
information for debugging
-------------------------------------------------*/
void debug_cpu_init(running_machine *machine)
void debug_cpu_init(running_machine &machine)
{
screen_device *first_screen = machine->first_screen();
screen_device *first_screen = machine.first_screen();
debugcpu_private *global;
int regnum;
/* allocate and reset globals */
machine->debugcpu_data = global = auto_alloc_clear(machine, debugcpu_private);
machine.debugcpu_data = global = auto_alloc_clear(machine, debugcpu_private);
global->execution_state = EXECUTION_STATE_STOPPED;
global->bpindex = 1;
global->wpindex = 1;
/* create a global symbol table */
global->symtable = global_alloc(symbol_table(machine));
global->symtable = global_alloc(symbol_table(&machine));
// configure our base memory accessors
debug_cpu_configure_memory(*machine, *global->symtable);
debug_cpu_configure_memory(machine, *global->symtable);
/* add "wpaddr", "wpdata", "cycles", "cpunum", "logunmap" to the global symbol table */
global->symtable->add("wpaddr", symbol_table::READ_ONLY, &global->wpaddr);
@ -178,13 +178,13 @@ void debug_cpu_init(running_machine *machine)
}
/* first CPU is visible by default */
global->visiblecpu = machine->firstcpu;
global->visiblecpu = machine.firstcpu;
/* add callback for breaking on VBLANK */
if (machine->primary_screen != NULL)
machine->primary_screen->register_vblank_callback(on_vblank, NULL);
if (machine.primary_screen != NULL)
machine.primary_screen->register_vblank_callback(on_vblank, NULL);
machine->add_notifier(MACHINE_NOTIFY_EXIT, debug_cpu_exit);
machine.add_notifier(MACHINE_NOTIFY_EXIT, debug_cpu_exit);
}
@ -200,11 +200,11 @@ void debug_cpu_configure_memory(running_machine &machine, symbol_table &table)
fatalerror
-------------------------------------------------*/
void debug_cpu_flush_traces(running_machine *machine)
void debug_cpu_flush_traces(running_machine &machine)
{
/* this can be called on exit even when no debugging is enabled, so
make sure the devdebug is valid before proceeding */
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug() != NULL)
device->debug()->trace_flush();
}
@ -220,9 +220,9 @@ void debug_cpu_flush_traces(running_machine *machine)
device (the one that commands should apply to)
-------------------------------------------------*/
device_t *debug_cpu_get_visible_cpu(running_machine *machine)
device_t *debug_cpu_get_visible_cpu(running_machine &machine)
{
return machine->debugcpu_data->visiblecpu;
return machine.debugcpu_data->visiblecpu;
}
@ -231,9 +231,9 @@ device_t *debug_cpu_get_visible_cpu(running_machine *machine)
the debugger is currently live
-------------------------------------------------*/
int debug_cpu_within_instruction_hook(running_machine *machine)
int debug_cpu_within_instruction_hook(running_machine &machine)
{
return machine->debugcpu_data->within_instruction_hook;
return machine.debugcpu_data->within_instruction_hook;
}
@ -242,9 +242,9 @@ int debug_cpu_within_instruction_hook(running_machine *machine)
current execution state is stopped
-------------------------------------------------*/
int debug_cpu_is_stopped(running_machine *machine)
int debug_cpu_is_stopped(running_machine &machine)
{
debugcpu_private *global = machine->debugcpu_data;
debugcpu_private *global = machine.debugcpu_data;
return (global != NULL) ? (global->execution_state == EXECUTION_STATE_STOPPED) : false;
}
@ -259,9 +259,9 @@ int debug_cpu_is_stopped(running_machine *machine)
global symbol table
-------------------------------------------------*/
symbol_table *debug_cpu_get_global_symtable(running_machine *machine)
symbol_table *debug_cpu_get_global_symtable(running_machine &machine)
{
return machine->debugcpu_data->symtable;
return machine.debugcpu_data->symtable;
}
@ -270,9 +270,9 @@ symbol_table *debug_cpu_get_global_symtable(running_machine *machine)
locally-visible symbol table
-------------------------------------------------*/
symbol_table *debug_cpu_get_visible_symtable(running_machine *machine)
symbol_table *debug_cpu_get_visible_symtable(running_machine &machine)
{
return &machine->debugcpu_data->visiblecpu->debug()->symtable();
return &machine.debugcpu_data->visiblecpu->debug()->symtable();
}
@ -281,9 +281,9 @@ symbol_table *debug_cpu_get_visible_symtable(running_machine *machine)
command script to execute
-------------------------------------------------*/
void debug_cpu_source_script(running_machine *machine, const char *file)
void debug_cpu_source_script(running_machine &machine, const char *file)
{
debugcpu_private *global = machine->debugcpu_data;
debugcpu_private *global = machine.debugcpu_data;
/* close any existing source file */
if (global->source_file != NULL)
@ -298,7 +298,7 @@ void debug_cpu_source_script(running_machine *machine, const char *file)
global->source_file = fopen(file, "r");
if (!global->source_file)
{
if (machine->phase() == MACHINE_PHASE_RUNNING)
if (machine.phase() == MACHINE_PHASE_RUNNING)
debug_console_printf(machine, "Cannot open command file '%s'\n", file);
else
fatalerror("Cannot open command file '%s'", file);
@ -317,7 +317,7 @@ void debug_cpu_source_script(running_machine *machine, const char *file)
// the given machine
//-------------------------------------------------
bool debug_comment_save(running_machine *machine)
bool debug_comment_save(running_machine &machine)
{
// if we don't have a root, bail
xml_data_node *root = xml_file_create();
@ -337,11 +337,11 @@ bool debug_comment_save(running_machine *machine)
xml_data_node *systemnode = xml_add_child(commentnode, "system", NULL);
if (systemnode == NULL)
throw emu_exception();
xml_set_attribute(systemnode, "name", machine->system().name);
xml_set_attribute(systemnode, "name", machine.system().name);
// for each device
bool found_comments = false;
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->comment_count() > 0)
{
// create a node for this device
@ -359,8 +359,8 @@ bool debug_comment_save(running_machine *machine)
// flush the file
if (found_comments)
{
emu_file file(machine->options().comment_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
file_error filerr = file.open(machine->basename(), ".cmt");
emu_file file(machine.options().comment_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
file_error filerr = file.open(machine.basename(), ".cmt");
if (filerr == FILERR_NONE)
xml_file_write(root, file);
}
@ -382,11 +382,11 @@ bool debug_comment_save(running_machine *machine)
// the given machine
//-------------------------------------------------
bool debug_comment_load(running_machine *machine)
bool debug_comment_load(running_machine &machine)
{
// open the file
emu_file file(machine->options().comment_directory(), OPEN_FLAG_READ);
file_error filerr = file.open(machine->basename(), ".cmt");
emu_file file(machine.options().comment_directory(), OPEN_FLAG_READ);
file_error filerr = file.open(machine.basename(), ".cmt");
// if an error, just return false
if (filerr != FILERR_NONE)
@ -413,13 +413,13 @@ bool debug_comment_load(running_machine *machine)
// check to make sure the file is applicable
xml_data_node *systemnode = xml_get_sibling(commentnode->child, "system");
const char *name = xml_get_attribute_string(systemnode, "name", "");
if (strcmp(name, machine->system().name) != 0)
if (strcmp(name, machine.system().name) != 0)
throw emu_exception();
// iterate over devices
for (xml_data_node *cpunode = xml_get_sibling(systemnode->child, "cpu"); cpunode; cpunode = xml_get_sibling(cpunode->next, "cpu"))
{
device_t *device = machine->device(xml_get_attribute_string(cpunode, "tag", ""));
device_t *device = machine.device(xml_get_attribute_string(cpunode, "tag", ""));
if (device != NULL)
if (!device->debug()->comment_import(*cpunode))
throw emu_exception();
@ -471,7 +471,7 @@ int debug_cpu_translate(address_space *space, int intention, offs_t *address)
UINT8 debug_read_byte(address_space *_space, offs_t address, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
debugcpu_private *global = space->machine->debugcpu_data;
debugcpu_private *global = space->machine().debugcpu_data;
UINT64 custom;
UINT8 result;
@ -507,7 +507,7 @@ UINT8 debug_read_byte(address_space *_space, offs_t address, int apply_translati
UINT16 debug_read_word(address_space *_space, offs_t address, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
debugcpu_private *global = space->machine->debugcpu_data;
debugcpu_private *global = space->machine().debugcpu_data;
UINT16 result;
/* mask against the logical byte mask */
@ -562,7 +562,7 @@ UINT16 debug_read_word(address_space *_space, offs_t address, int apply_translat
UINT32 debug_read_dword(address_space *_space, offs_t address, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
debugcpu_private *global = space->machine->debugcpu_data;
debugcpu_private *global = space->machine().debugcpu_data;
UINT32 result;
/* mask against the logical byte mask */
@ -617,7 +617,7 @@ UINT32 debug_read_dword(address_space *_space, offs_t address, int apply_transla
UINT64 debug_read_qword(address_space *_space, offs_t address, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
debugcpu_private *global = space->machine->debugcpu_data;
debugcpu_private *global = space->machine().debugcpu_data;
UINT64 result;
/* mask against the logical byte mask */
@ -691,7 +691,7 @@ UINT64 debug_read_memory(address_space *space, offs_t address, int size, int app
void debug_write_byte(address_space *_space, offs_t address, UINT8 data, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
debugcpu_private *global = space->machine->debugcpu_data;
debugcpu_private *global = space->machine().debugcpu_data;
/* mask against the logical byte mask */
address &= space->logbytemask();
@ -725,7 +725,7 @@ void debug_write_byte(address_space *_space, offs_t address, UINT8 data, int app
void debug_write_word(address_space *_space, offs_t address, UINT16 data, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
debugcpu_private *global = space->machine->debugcpu_data;
debugcpu_private *global = space->machine().debugcpu_data;
/* mask against the logical byte mask */
address &= space->logbytemask();
@ -778,7 +778,7 @@ void debug_write_word(address_space *_space, offs_t address, UINT16 data, int ap
void debug_write_dword(address_space *_space, offs_t address, UINT32 data, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
debugcpu_private *global = space->machine->debugcpu_data;
debugcpu_private *global = space->machine().debugcpu_data;
/* mask against the logical byte mask */
address &= space->logbytemask();
@ -831,7 +831,7 @@ void debug_write_dword(address_space *_space, offs_t address, UINT32 data, int a
void debug_write_qword(address_space *_space, offs_t address, UINT64 data, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
debugcpu_private *global = space->machine->debugcpu_data;
debugcpu_private *global = space->machine().debugcpu_data;
/* mask against the logical byte mask */
address &= space->logbytemask();
@ -902,7 +902,7 @@ UINT64 debug_read_opcode(address_space *_space, offs_t address, int size, int ar
{
address_space *space = const_cast<address_space *>(_space);
UINT64 result = ~(UINT64)0 & (~(UINT64)0 >> (64 - 8*size)), result2;
debugcpu_private *global = space->machine->debugcpu_data;
debugcpu_private *global = space->machine().debugcpu_data;
/* keep in logical range */
address &= space->logbytemask();
@ -1072,7 +1072,7 @@ static void on_vblank(screen_device &device, void *param, bool vblank_state)
{
/* just set a global flag to be consumed later */
if (vblank_state)
device.machine->debugcpu_data->vblank_occurred = true;
device.machine().debugcpu_data->vblank_occurred = true;
}
@ -1095,9 +1095,9 @@ static void reset_transient_flags(running_machine &machine)
a source file
-------------------------------------------------*/
static void process_source_file(running_machine *machine)
static void process_source_file(running_machine &machine)
{
debugcpu_private *global = machine->debugcpu_data;
debugcpu_private *global = machine.debugcpu_data;
/* loop until the file is exhausted or until we are executing again */
while (global->source_file != NULL && global->execution_state == EXECUTION_STATE_STOPPED)
@ -1145,11 +1145,11 @@ static void process_source_file(running_machine *machine)
based on a case insensitive tag search
-------------------------------------------------*/
static device_t *expression_get_device(running_machine *machine, const char *tag)
static device_t *expression_get_device(running_machine &machine, const char *tag)
{
device_t *device;
for (device = machine->m_devicelist.first(); device != NULL; device = device->next())
for (device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (mame_stricmp(device->tag(), tag) == 0)
return device;
@ -1165,7 +1165,7 @@ static device_t *expression_get_device(running_machine *machine, const char *tag
static UINT64 expression_read_memory(void *param, const char *name, expression_space spacenum, UINT32 address, int size)
{
running_machine *machine = (running_machine *)param;
running_machine &machine = *(running_machine *)param;
UINT64 result = ~(UINT64)0 >> (64 - 8*size);
device_t *device = NULL;
address_space *space;
@ -1286,9 +1286,9 @@ static UINT64 expression_read_program_direct(address_space *_space, int opcode,
from a memory region
-------------------------------------------------*/
static UINT64 expression_read_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size)
static UINT64 expression_read_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size)
{
const memory_region *region = machine->region(rgntag);
const memory_region *region = machine.region(rgntag);
UINT64 result = ~(UINT64)0 >> (64 - 8*size);
/* make sure we get a valid base before proceeding */
@ -1337,7 +1337,7 @@ static UINT64 expression_read_memory_region(running_machine *machine, const char
static void expression_write_memory(void *param, const char *name, expression_space spacenum, UINT32 address, int size, UINT64 data)
{
running_machine *machine = (running_machine *)param;
running_machine &machine = *(running_machine *)param;
device_t *device = NULL;
address_space *space;
@ -1400,7 +1400,7 @@ static void expression_write_program_direct(address_space *_space, int opcode, o
address_space *space = const_cast<address_space *>(_space);
if (space != NULL)
{
debugcpu_private *global = space->machine->debugcpu_data;
debugcpu_private *global = space->machine().debugcpu_data;
UINT8 *base;
/* adjust the address into a byte address, but not if being called recursively */
@ -1462,10 +1462,10 @@ static void expression_write_program_direct(address_space *_space, int opcode, o
from a memory region
-------------------------------------------------*/
static void expression_write_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size, UINT64 data)
static void expression_write_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size, UINT64 data)
{
debugcpu_private *global = machine->debugcpu_data;
const memory_region *region = machine->region(rgntag);
debugcpu_private *global = machine.debugcpu_data;
const memory_region *region = machine.region(rgntag);
/* make sure we get a valid base before proceeding */
if (region != NULL)
@ -1520,7 +1520,7 @@ static void expression_write_memory_region(running_machine *machine, const char
static expression_error::error_code expression_validate(void *param, const char *name, expression_space space)
{
running_machine *machine = (running_machine *)param;
running_machine &machine = *(running_machine *)param;
device_t *device = NULL;
switch (space)
@ -1574,7 +1574,7 @@ static expression_error::error_code expression_validate(void *param, const char
case EXPSPACE_REGION:
if (name == NULL)
return expression_error::MISSING_MEMORY_NAME;
if (machine->region(name)->base() == NULL)
if (machine.region(name)->base() == NULL)
return expression_error::INVALID_MEMORY_NAME;
break;
@ -1630,12 +1630,12 @@ static UINT64 get_frame(symbol_table &table, void *ref)
static UINT64 get_cpunum(symbol_table &table, void *ref)
{
running_machine *machine = reinterpret_cast<running_machine *>(table.globalref());
device_t *target = machine->debugcpu_data->visiblecpu;
running_machine &machine = *reinterpret_cast<running_machine *>(table.globalref());
device_t *target = machine.debugcpu_data->visiblecpu;
device_execute_interface *exec = NULL;
int index = 0;
for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
{
if (&exec->device() == target)
return index;
@ -1661,7 +1661,7 @@ device_debug::device_debug(device_t &device)
m_state(NULL),
m_disasm(NULL),
m_flags(0),
m_symtable(&device, debug_cpu_get_global_symtable(device.machine)),
m_symtable(&device, debug_cpu_get_global_symtable(device.machine())),
m_instrhook(NULL),
m_dasm_override(NULL),
m_opwidth(0),
@ -1744,9 +1744,9 @@ device_debug::~device_debug()
void device_debug::start_hook(attotime endtime)
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
assert((m_device.machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
assert((m_device.machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
// stash a pointer to the current live CPU
assert(global->livecpu == NULL);
@ -1757,7 +1757,7 @@ void device_debug::start_hook(attotime endtime)
{
global->m_stop_when_not_device = NULL;
global->execution_state = EXECUTION_STATE_STOPPED;
reset_transient_flags(*m_device.machine);
reset_transient_flags(m_device.machine());
}
// update the target execution end time
@ -1769,8 +1769,8 @@ void device_debug::start_hook(attotime endtime)
// check for periodic updates
if (&m_device == global->visiblecpu && osd_ticks() > global->last_periodic_update_time + osd_ticks_per_second()/4)
{
m_device.machine->debug_view().update_all();
m_device.machine->debug_view().flush_osd_updates();
m_device.machine().debug_view().update_all();
m_device.machine().debug_view().flush_osd_updates();
global->last_periodic_update_time = osd_ticks();
}
@ -1790,11 +1790,11 @@ void device_debug::start_hook(attotime endtime)
if ((m_flags & DEBUG_FLAG_STOP_VBLANK) != 0)
{
global->execution_state = EXECUTION_STATE_STOPPED;
debug_console_printf(m_device.machine, "Stopped at VBLANK\n");
debug_console_printf(m_device.machine(), "Stopped at VBLANK\n");
}
// check for debug keypresses
else if (ui_input_pressed(m_device.machine, IPT_UI_DEBUG_BREAK))
else if (ui_input_pressed(m_device.machine(), IPT_UI_DEBUG_BREAK))
global->visiblecpu->debug()->halt_on_next_instruction("User-initiated break\n");
}
}
@ -1811,7 +1811,7 @@ void device_debug::start_hook(attotime endtime)
void device_debug::stop_hook()
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
assert(global->livecpu == &m_device);
@ -1827,13 +1827,13 @@ void device_debug::stop_hook()
void device_debug::interrupt_hook(int irqline)
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
// see if this matches a pending interrupt request
if ((m_flags & DEBUG_FLAG_STOP_INTERRUPT) != 0 && (m_stopirq == -1 || m_stopirq == irqline))
{
global->execution_state = EXECUTION_STATE_STOPPED;
debug_console_printf(m_device.machine, "Stopped on interrupt (CPU '%s', IRQ %d)\n", m_device.tag(), irqline);
debug_console_printf(m_device.machine(), "Stopped on interrupt (CPU '%s', IRQ %d)\n", m_device.tag(), irqline);
compute_debug_flags();
}
}
@ -1846,13 +1846,13 @@ void device_debug::interrupt_hook(int irqline)
void device_debug::exception_hook(int exception)
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
// see if this matches a pending interrupt request
if ((m_flags & DEBUG_FLAG_STOP_EXCEPTION) != 0 && (m_stopexception == -1 || m_stopexception == exception))
{
global->execution_state = EXECUTION_STATE_STOPPED;
debug_console_printf(m_device.machine, "Stopped on exception (CPU '%s', exception %d)\n", m_device.tag(), exception);
debug_console_printf(m_device.machine(), "Stopped on exception (CPU '%s', exception %d)\n", m_device.tag(), exception);
compute_debug_flags();
}
}
@ -1865,7 +1865,7 @@ void device_debug::exception_hook(int exception)
void device_debug::instruction_hook(offs_t curpc)
{
running_machine &machine = *m_device.machine;
running_machine &machine = m_device.machine();
debugcpu_private *global = machine.debugcpu_data;
// note that we are in the debugger code
@ -1901,7 +1901,7 @@ void device_debug::instruction_hook(offs_t curpc)
{
machine.debug_view().update_all();
machine.debug_view().flush_osd_updates();
debugger_refresh_display(&machine);
debugger_refresh_display(machine);
}
}
}
@ -1912,14 +1912,14 @@ void device_debug::instruction_hook(offs_t curpc)
// see if we hit a target time
if ((m_flags & DEBUG_FLAG_STOP_TIME) != 0 && machine.time() >= m_stoptime)
{
debug_console_printf(&machine, "Stopped at time interval %.1g\n", machine.time().as_double());
debug_console_printf(machine, "Stopped at time interval %.1g\n", machine.time().as_double());
global->execution_state = EXECUTION_STATE_STOPPED;
}
// check the temp running breakpoint and break if we hit it
else if ((m_flags & DEBUG_FLAG_STOP_PC) != 0 && m_stopaddr == curpc)
{
debug_console_printf(&machine, "Stopped at temporary breakpoint %X on CPU '%s'\n", m_stopaddr, m_device.tag());
debug_console_printf(machine, "Stopped at temporary breakpoint %X on CPU '%s'\n", m_stopaddr, m_device.tag());
global->execution_state = EXECUTION_STATE_STOPPED;
}
@ -1936,12 +1936,12 @@ void device_debug::instruction_hook(offs_t curpc)
// load comments if we haven't yet
if (!global->comments_loaded)
{
debug_comment_load(m_device.machine);
debug_comment_load(m_device.machine());
global->comments_loaded = true;
}
// reset any transient state
reset_transient_flags(*m_device.machine);
reset_transient_flags(m_device.machine());
global->breakcpu = NULL;
// remember the last visible CPU in the debugger
@ -1949,10 +1949,10 @@ void device_debug::instruction_hook(offs_t curpc)
// update all views
machine.debug_view().update_all();
debugger_refresh_display(m_device.machine);
debugger_refresh_display(m_device.machine());
// wait for the debugger; during this time, disable sound output
m_device.machine->sound().debugger_mute(true);
m_device.machine().sound().debugger_mute(true);
while (global->execution_state == EXECUTION_STATE_STOPPED)
{
// flush any pending updates before waiting again
@ -1970,17 +1970,17 @@ void device_debug::instruction_hook(offs_t curpc)
if (global->memory_modified)
{
machine.debug_view().update_all(DVT_DISASSEMBLY);
debugger_refresh_display(m_device.machine);
debugger_refresh_display(m_device.machine());
}
// check for commands in the source file
process_source_file(m_device.machine);
process_source_file(m_device.machine());
// if an event got scheduled, resume
if (machine.scheduled_event_pending())
global->execution_state = EXECUTION_STATE_RUNNING;
}
m_device.machine->sound().debugger_mute(false);
m_device.machine().sound().debugger_mute(false);
// remember the last visible CPU in the debugger
global->visiblecpu = &m_device;
@ -2080,7 +2080,7 @@ if (m_memory != NULL && m_disasm != NULL)
void device_debug::ignore(bool ignore)
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@ -2101,7 +2101,7 @@ void device_debug::ignore(bool ignore)
void device_debug::single_step(int numsteps)
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@ -2119,7 +2119,7 @@ void device_debug::single_step(int numsteps)
void device_debug::single_step_over(int numsteps)
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@ -2137,7 +2137,7 @@ void device_debug::single_step_over(int numsteps)
void device_debug::single_step_out()
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@ -2155,7 +2155,7 @@ void device_debug::single_step_out()
void device_debug::go(offs_t targetpc)
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@ -2171,7 +2171,7 @@ void device_debug::go(offs_t targetpc)
void device_debug::go_vblank()
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@ -2188,7 +2188,7 @@ void device_debug::go_vblank()
void device_debug::go_interrupt(int irqline)
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@ -2205,7 +2205,7 @@ void device_debug::go_interrupt(int irqline)
void device_debug::go_exception(int exception)
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@ -2222,11 +2222,11 @@ void device_debug::go_exception(int exception)
void device_debug::go_milliseconds(UINT64 milliseconds)
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
m_stoptime = m_device.machine->time() + attotime::from_msec(milliseconds);
m_stoptime = m_device.machine().time() + attotime::from_msec(milliseconds);
m_flags |= DEBUG_FLAG_STOP_TIME;
global->execution_state = EXECUTION_STATE_RUNNING;
}
@ -2239,7 +2239,7 @@ void device_debug::go_milliseconds(UINT64 milliseconds)
void device_debug::go_next_device()
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@ -2255,7 +2255,7 @@ void device_debug::go_next_device()
void device_debug::halt_on_next_instruction(const char *fmt, ...)
{
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
va_list arg;
assert(m_exec != NULL);
@ -2266,7 +2266,7 @@ void device_debug::halt_on_next_instruction(const char *fmt, ...)
// output the message to the console
va_start(arg, fmt);
debug_console_vprintf(m_device.machine, fmt, arg);
debug_console_vprintf(m_device.machine(), fmt, arg);
va_end(arg);
// if we are live, stop now, otherwise note that we want to break there
@ -2289,7 +2289,7 @@ void device_debug::halt_on_next_instruction(const char *fmt, ...)
int device_debug::breakpoint_set(offs_t address, const char *condition, const char *action)
{
// allocate a new one
breakpoint *bp = auto_alloc(m_device.machine, breakpoint(m_symtable, m_device.machine->debugcpu_data->bpindex++, address, condition, action));
breakpoint *bp = auto_alloc(m_device.machine(), breakpoint(m_symtable, m_device.machine().debugcpu_data->bpindex++, address, condition, action));
// hook it into our list
bp->m_next = m_bplist;
@ -2314,7 +2314,7 @@ bool device_debug::breakpoint_clear(int index)
{
breakpoint *deleteme = *bp;
*bp = deleteme->m_next;
auto_free(m_device.machine, deleteme);
auto_free(m_device.machine(), deleteme);
breakpoint_update_flags();
return true;
}
@ -2380,7 +2380,7 @@ int device_debug::watchpoint_set(address_space &space, int type, offs_t address,
assert(space.spacenum() < ARRAY_LENGTH(m_wplist));
// allocate a new one
watchpoint *wp = auto_alloc(m_device.machine, watchpoint(m_symtable, m_device.machine->debugcpu_data->bpindex++, space, type, address, length, condition, action));
watchpoint *wp = auto_alloc(m_device.machine(), watchpoint(m_symtable, m_device.machine().debugcpu_data->bpindex++, space, type, address, length, condition, action));
// hook it into our list
wp->m_next = m_wplist[space.spacenum()];
@ -2407,7 +2407,7 @@ bool device_debug::watchpoint_clear(int index)
watchpoint *deleteme = *wp;
address_space &space = deleteme->m_space;
*wp = deleteme->m_next;
auto_free(m_device.machine, deleteme);
auto_free(m_device.machine(), deleteme);
watchpoint_update_flags(space);
return true;
}
@ -2474,14 +2474,14 @@ void device_debug::watchpoint_enable_all(bool enable)
void device_debug::hotspot_track(int numspots, int threshhold)
{
// if we already have tracking enabled, kill it
auto_free(m_device.machine, m_hotspots);
auto_free(m_device.machine(), m_hotspots);
m_hotspots = NULL;
// only start tracking if we have a non-zero count
if (numspots > 0)
{
// allocate memory for hotspots
m_hotspots = auto_alloc_array(m_device.machine, hotspot_entry, numspots);
m_hotspots = auto_alloc_array(m_device.machine(), hotspot_entry, numspots);
memset(m_hotspots, 0xff, sizeof(*m_hotspots) * numspots);
// fill in the info
@ -2519,7 +2519,7 @@ void device_debug::comment_add(offs_t addr, const char *comment, rgb_t color)
{
// create a new item for the list
UINT32 crc = compute_opcode_crc32(addr);
dasm_comment *newcomment = auto_alloc(m_device.machine, dasm_comment(comment, addr, color, crc));
dasm_comment *newcomment = auto_alloc(m_device.machine(), dasm_comment(comment, addr, color, crc));
// figure out where to insert it
dasm_comment *prev = NULL;
@ -2646,7 +2646,7 @@ bool device_debug::comment_import(xml_data_node &cpunode)
sscanf(xml_get_attribute_string(datanode, "crc", 0), "%08X", &crc);
// add the new comment; we assume they were saved ordered
m_comment_list.append(*auto_alloc(m_device.machine, dasm_comment(datanode->value, address, color, crc)));
m_comment_list.append(*auto_alloc(m_device.machine(), dasm_comment(datanode->value, address, color, crc)));
}
return true;
}
@ -2723,12 +2723,12 @@ UINT32 device_debug::compute_opcode_crc32(offs_t address) const
void device_debug::trace(FILE *file, bool trace_over, const char *action)
{
// delete any existing tracers
auto_free(m_device.machine, m_trace);
auto_free(m_device.machine(), m_trace);
m_trace = NULL;
// if we have a new file, make a new tracer
if (file != NULL)
m_trace = auto_alloc(m_device.machine, tracer(*this, *file, trace_over, action));
m_trace = auto_alloc(m_device.machine(), tracer(*this, *file, trace_over, action));
}
@ -2756,33 +2756,33 @@ void device_debug::trace_printf(const char *fmt, ...)
void device_debug::compute_debug_flags()
{
running_machine *machine = m_device.machine;
debugcpu_private *global = machine->debugcpu_data;
running_machine &machine = m_device.machine();
debugcpu_private *global = machine.debugcpu_data;
// clear out global flags by default, keep DEBUG_FLAG_OSD_ENABLED
machine->debug_flags &= DEBUG_FLAG_OSD_ENABLED;
machine->debug_flags |= DEBUG_FLAG_ENABLED;
machine.debug_flags &= DEBUG_FLAG_OSD_ENABLED;
machine.debug_flags |= DEBUG_FLAG_ENABLED;
// if we are ignoring this CPU, or if events are pending, we're done
if ((m_flags & DEBUG_FLAG_OBSERVING) == 0 || machine->scheduled_event_pending() || machine->save_or_load_pending())
if ((m_flags & DEBUG_FLAG_OBSERVING) == 0 || machine.scheduled_event_pending() || machine.save_or_load_pending())
return;
// if we're stopped, keep calling the hook
if (global->execution_state == EXECUTION_STATE_STOPPED)
machine->debug_flags |= DEBUG_FLAG_CALL_HOOK;
machine.debug_flags |= DEBUG_FLAG_CALL_HOOK;
// if we're tracking history, or we're hooked, or stepping, or stopping at a breakpoint
// make sure we call the hook
if ((m_flags & (DEBUG_FLAG_HISTORY | DEBUG_FLAG_HOOKED | DEBUG_FLAG_STEPPING_ANY | DEBUG_FLAG_STOP_PC | DEBUG_FLAG_LIVE_BP)) != 0)
machine->debug_flags |= DEBUG_FLAG_CALL_HOOK;
machine.debug_flags |= DEBUG_FLAG_CALL_HOOK;
// also call if we are tracing
if (m_trace != NULL)
machine->debug_flags |= DEBUG_FLAG_CALL_HOOK;
machine.debug_flags |= DEBUG_FLAG_CALL_HOOK;
// if we are stopping at a particular time and that time is within the current timeslice, we need to be called
if ((m_flags & DEBUG_FLAG_STOP_TIME) && m_endexectime <= m_stoptime)
machine->debug_flags |= DEBUG_FLAG_CALL_HOOK;
machine.debug_flags |= DEBUG_FLAG_CALL_HOOK;
}
@ -2837,7 +2837,7 @@ void device_debug::breakpoint_update_flags()
}
// push the flags out globally
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
if (global->livecpu != NULL)
global->livecpu->debug()->compute_debug_flags();
}
@ -2855,16 +2855,16 @@ void device_debug::breakpoint_check(offs_t pc)
if (bp->hit(pc))
{
// halt in the debugger by default
debugcpu_private *global = m_device.machine->debugcpu_data;
debugcpu_private *global = m_device.machine().debugcpu_data;
global->execution_state = EXECUTION_STATE_STOPPED;
// if we hit, evaluate the action
if (bp->m_action)
debug_console_execute_command(m_device.machine, bp->m_action, 0);
debug_console_execute_command(m_device.machine(), bp->m_action, 0);
// print a notification, unless the action made us go again
if (global->execution_state == EXECUTION_STATE_STOPPED)
debug_console_printf(m_device.machine, "Stopped at breakpoint %X\n", bp->m_index);
debug_console_printf(m_device.machine(), "Stopped at breakpoint %X\n", bp->m_index);
break;
}
}
@ -2906,7 +2906,7 @@ void device_debug::watchpoint_update_flags(address_space &space)
void device_debug::watchpoint_check(address_space &space, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask)
{
debugcpu_private *global = space.machine->debugcpu_data;
debugcpu_private *global = space.machine().debugcpu_data;
// if we're within debugger code, don't stop
if (global->within_instruction_hook || global->debugger_access)
@ -2953,7 +2953,7 @@ void device_debug::watchpoint_check(address_space &space, int type, offs_t addre
// if we hit, evaluate the action
if (wp->m_action)
debug_console_execute_command(space.machine, wp->m_action, 0);
debug_console_execute_command(space.machine(), wp->m_action, 0);
// print a notification, unless the action made us go again
if (global->execution_state == EXECUTION_STATE_STOPPED)
@ -2975,7 +2975,7 @@ void device_debug::watchpoint_check(address_space &space, int type, offs_t addre
}
else
buffer.printf("Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->m_index, sizes[size], space.byte_to_address(address), pc);
debug_console_printf(space.machine, "%s\n", buffer.cstr());
debug_console_printf(space.machine(), "%s\n", buffer.cstr());
space.cpu->debug()->compute_debug_flags();
}
break;
@ -3006,7 +3006,7 @@ void device_debug::hotspot_check(address_space &space, offs_t address)
// if the bottom of the list is over the threshhold, print it
hotspot_entry &spot = m_hotspots[m_hotspot_count - 1];
if (spot.m_count > m_hotspot_threshhold)
debug_console_printf(space.machine, "Hotspot @ %s %08X (PC=%08X) hit %d times (fell off bottom)\n", space.name(), spot.m_access, spot.m_pc, spot.m_count);
debug_console_printf(space.machine(), "Hotspot @ %s %08X (PC=%08X) hit %d times (fell off bottom)\n", space.name(), spot.m_access, spot.m_pc, spot.m_count);
// move everything else down and insert this one at the top
memmove(&m_hotspots[1], &m_hotspots[0], sizeof(m_hotspots[0]) * (m_hotspot_count - 1));
@ -3307,7 +3307,7 @@ void device_debug::tracer::update(offs_t pc)
// execute any trace actions first
if (m_action)
debug_console_execute_command(m_debug.m_device.machine, m_action, 0);
debug_console_execute_command(m_debug.m_device.machine(), m_action, 0);
// print the address
astring buffer;

View File

@ -370,51 +370,51 @@ private:
/* ----- initialization and cleanup ----- */
/* initialize the CPU tracking for the debugger */
void debug_cpu_init(running_machine *machine);
void debug_cpu_init(running_machine &machine);
void debug_cpu_configure_memory(running_machine &machine, symbol_table &table);
/* flushes all traces; this is useful if a trace is going on when we fatalerror */
void debug_cpu_flush_traces(running_machine *machine);
void debug_cpu_flush_traces(running_machine &machine);
/* ----- debugging status & information ----- */
/* return the visible CPU device (the one that commands should apply to) */
device_t *debug_cpu_get_visible_cpu(running_machine *machine);
device_t *debug_cpu_get_visible_cpu(running_machine &machine);
/* TRUE if the debugger is currently stopped within an instruction hook callback */
int debug_cpu_within_instruction_hook(running_machine *machine);
int debug_cpu_within_instruction_hook(running_machine &machine);
/* return TRUE if the current execution state is stopped */
int debug_cpu_is_stopped(running_machine *machine);
int debug_cpu_is_stopped(running_machine &machine);
/* ----- symbol table interfaces ----- */
/* return the global symbol table */
symbol_table *debug_cpu_get_global_symtable(running_machine *machine);
symbol_table *debug_cpu_get_global_symtable(running_machine &machine);
/* return the locally-visible symbol table */
symbol_table *debug_cpu_get_visible_symtable(running_machine *machine);
symbol_table *debug_cpu_get_visible_symtable(running_machine &machine);
/* ----- misc debugger functions ----- */
/* specifies a debug command script to execute */
void debug_cpu_source_script(running_machine *machine, const char *file);
void debug_cpu_source_script(running_machine &machine, const char *file);
/* ----- debugger comment helpers ----- */
// save all comments for a given machine
bool debug_comment_save(running_machine *machine);
bool debug_comment_save(running_machine &machine);
// load all comments for a given machine
bool debug_comment_load(running_machine *machine);
bool debug_comment_load(running_machine &machine);

View File

@ -147,7 +147,7 @@ void debug_view_source_list::reset()
{
debug_view_source *source = m_head;
m_head = source->m_next;
auto_free(&m_machine, source);
auto_free(m_machine, source);
}
// reset the tail pointer and index
@ -222,7 +222,7 @@ debug_view::debug_view(running_machine &machine, debug_view_type type, debug_vie
{
// allocate memory for the buffer
m_viewdata_size = m_visible.y * m_visible.x;
m_viewdata = auto_alloc_array(&machine, debug_view_char, m_viewdata_size);
m_viewdata = auto_alloc_array(machine, debug_view_char, m_viewdata_size);
}
@ -256,8 +256,8 @@ void debug_view::end_update()
if (size > m_viewdata_size)
{
m_viewdata_size = size;
auto_free(&m_machine, m_viewdata);
m_viewdata = auto_alloc_array(&m_machine, debug_view_char, m_viewdata_size);
auto_free(m_machine, m_viewdata);
m_viewdata = auto_alloc_array(m_machine, debug_view_char, m_viewdata_size);
}
// update the view
@ -450,7 +450,7 @@ debug_view_manager::~debug_view_manager()
{
debug_view *oldhead = m_viewlist;
m_viewlist = oldhead->m_next;
auto_free(&m_machine, oldhead);
auto_free(m_machine, oldhead);
}
}
@ -464,25 +464,25 @@ debug_view *debug_view_manager::alloc_view(debug_view_type type, debug_view_osd_
switch (type)
{
case DVT_CONSOLE:
return append(auto_alloc(&m_machine, debug_view_console(m_machine, osdupdate, osdprivate)));
return append(auto_alloc(m_machine, debug_view_console(m_machine, osdupdate, osdprivate)));
case DVT_STATE:
return append(auto_alloc(&m_machine, debug_view_state(m_machine, osdupdate, osdprivate)));
return append(auto_alloc(m_machine, debug_view_state(m_machine, osdupdate, osdprivate)));
case DVT_DISASSEMBLY:
return append(auto_alloc(&m_machine, debug_view_disasm(m_machine, osdupdate, osdprivate)));
return append(auto_alloc(m_machine, debug_view_disasm(m_machine, osdupdate, osdprivate)));
case DVT_MEMORY:
return append(auto_alloc(&m_machine, debug_view_memory(m_machine, osdupdate, osdprivate)));
return append(auto_alloc(m_machine, debug_view_memory(m_machine, osdupdate, osdprivate)));
case DVT_LOG:
return append(auto_alloc(&m_machine, debug_view_log(m_machine, osdupdate, osdprivate)));
return append(auto_alloc(m_machine, debug_view_log(m_machine, osdupdate, osdprivate)));
case DVT_TIMERS:
// return append(auto_alloc(&m_machine, debug_view_timers(m_machine, osdupdate, osdprivate)));
// return append(auto_alloc(m_machine, debug_view_timers(m_machine, osdupdate, osdprivate)));
case DVT_ALLOCS:
// return append(auto_alloc(&m_machine, debug_view_allocs(m_machine, osdupdate, osdprivate)));
// return append(auto_alloc(m_machine, debug_view_allocs(m_machine, osdupdate, osdprivate)));
default:
fatalerror("Attempt to create invalid debug view type %d\n", type);
@ -502,7 +502,7 @@ void debug_view_manager::free_view(debug_view &view)
if (*viewptr == &view)
{
*viewptr = view.m_next;
auto_free(&m_machine, &view);
auto_free(m_machine, &view);
break;
}
}
@ -559,7 +559,7 @@ debug_view_expression::debug_view_expression(running_machine &machine)
: m_machine(machine),
m_dirty(true),
m_result(0),
m_parsed(debug_cpu_get_global_symtable(&machine)),
m_parsed(debug_cpu_get_global_symtable(machine)),
m_string("0")
{
}
@ -581,7 +581,7 @@ debug_view_expression::~debug_view_expression()
void debug_view_expression::set_context(symbol_table *context)
{
m_parsed.set_symbols((context != NULL) ? context : debug_cpu_get_global_symtable(&m_machine));
m_parsed.set_symbols((context != NULL) ? context : debug_cpu_get_global_symtable(m_machine));
m_dirty = true;
}

View File

@ -116,8 +116,8 @@ debug_view_disasm::debug_view_disasm(running_machine &machine, debug_view_osd_up
debug_view_disasm::~debug_view_disasm()
{
auto_free(&m_machine, m_byteaddress);
auto_free(&m_machine, m_dasm);
auto_free(m_machine, m_byteaddress);
auto_free(m_machine, m_dasm);
}
@ -137,7 +137,7 @@ void debug_view_disasm::enumerate_sources()
for (bool gotone = m_machine.m_devicelist.first(dasm); gotone; gotone = dasm->next(dasm))
{
name.printf("%s '%s'", dasm->device().name(), dasm->device().tag());
m_source_list.append(*auto_alloc(&m_machine, debug_view_disasm_source(name, dasm->device())));
m_source_list.append(*auto_alloc(m_machine, debug_view_disasm_source(name, dasm->device())));
}
// reset the source to a known good entry
@ -377,12 +377,12 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines)
m_allocated = m_total;
// allocate address array
auto_free(&m_machine, m_byteaddress);
m_byteaddress = auto_alloc_array(&m_machine, offs_t, m_allocated.y);
auto_free(m_machine, m_byteaddress);
m_byteaddress = auto_alloc_array(m_machine, offs_t, m_allocated.y);
// allocate disassembly buffer
auto_free(&m_machine, m_dasm);
m_dasm = auto_alloc_array(&m_machine, char, m_allocated.x * m_allocated.y);
auto_free(m_machine, m_dasm);
m_dasm = auto_alloc_array(m_machine, char, m_allocated.x * m_allocated.y);
}
// iterate over lines

View File

@ -160,7 +160,7 @@ void debug_view_memory::enumerate_sources()
if (space != NULL)
{
name.printf("%s '%s' %s space memory", memintf->device().name(), memintf->device().tag(), space->name());
m_source_list.append(*auto_alloc(&m_machine, debug_view_memory_source(name, *space)));
m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, *space)));
}
}
@ -168,7 +168,7 @@ void debug_view_memory::enumerate_sources()
for (const memory_region *region = m_machine.first_region(); region != NULL; region = region->next())
{
name.printf("Region '%s'", region->name());
m_source_list.append(*auto_alloc(&m_machine, debug_view_memory_source(name, *region)));
m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, *region)));
}
// finally add all global array symbols
@ -185,7 +185,7 @@ void debug_view_memory::enumerate_sources()
if (valcount > 1 && strstr(itemname, "globals/"))
{
name.cpy(strrchr(itemname, '/') + 1);
m_source_list.append(*auto_alloc(&m_machine, debug_view_memory_source(name, base, valsize, valcount)));
m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, base, valsize, valcount)));
}
}
@ -707,10 +707,10 @@ void debug_view_memory::write(UINT8 size, offs_t offs, UINT64 data)
// hack for FD1094 editing
#ifdef FD1094_HACK
if (source.m_base == *m_machine.region("user2"))
if (source.m_base == m_machine.region("user2"))
{
extern void fd1094_regenerate_key(running_machine *machine);
fd1094_regenerate_key(&m_machine);
extern void fd1094_regenerate_key(running_machine &machine);
fd1094_regenerate_key(m_machine);
}
#endif
}

View File

@ -108,7 +108,7 @@ void debug_view_state::enumerate_sources()
for (bool gotone = m_machine.m_devicelist.first(state); gotone; gotone = state->next(state))
{
name.printf("%s '%s'", state->device().name(), state->device().tag());
m_source_list.append(*auto_alloc(&m_machine, debug_view_state_source(name, state->device())));
m_source_list.append(*auto_alloc(m_machine, debug_view_state_source(name, state->device())));
}
// reset the source to a known good entry
@ -127,7 +127,7 @@ void debug_view_state::reset()
{
state_item *oldhead = m_state_list;
m_state_list = oldhead->m_next;
auto_free(&m_machine, oldhead);
auto_free(m_machine, oldhead);
}
}
@ -146,34 +146,34 @@ void debug_view_state::recompute()
// add a cycles entry: cycles:99999999
state_item **tailptr = &m_state_list;
*tailptr = auto_alloc(&m_machine, state_item(REG_CYCLES, "cycles", 8));
*tailptr = auto_alloc(m_machine, state_item(REG_CYCLES, "cycles", 8));
tailptr = &(*tailptr)->m_next;
// add a beam entry: beamx:1234
*tailptr = auto_alloc(&m_machine, state_item(REG_BEAMX, "beamx", 4));
*tailptr = auto_alloc(m_machine, state_item(REG_BEAMX, "beamx", 4));
tailptr = &(*tailptr)->m_next;
// add a beam entry: beamy:5678
*tailptr = auto_alloc(&m_machine, state_item(REG_BEAMY, "beamy", 4));
*tailptr = auto_alloc(m_machine, state_item(REG_BEAMY, "beamy", 4));
tailptr = &(*tailptr)->m_next;
// add a beam entry: frame:123456
*tailptr = auto_alloc(&m_machine, state_item(REG_FRAME, "frame", 6));
*tailptr = auto_alloc(m_machine, state_item(REG_FRAME, "frame", 6));
tailptr = &(*tailptr)->m_next;
// add a flags entry: flags:xxxxxxxx
*tailptr = auto_alloc(&m_machine, state_item(STATE_GENFLAGS, "flags", source.m_stateintf->state_string_max_length(STATE_GENFLAGS)));
*tailptr = auto_alloc(m_machine, state_item(STATE_GENFLAGS, "flags", source.m_stateintf->state_string_max_length(STATE_GENFLAGS)));
tailptr = &(*tailptr)->m_next;
// add a divider entry
*tailptr = auto_alloc(&m_machine, state_item(REG_DIVIDER, "", 0));
*tailptr = auto_alloc(m_machine, state_item(REG_DIVIDER, "", 0));
tailptr = &(*tailptr)->m_next;
// add all registers into it
for (const device_state_entry *entry = source.m_stateintf->state_first(); entry != NULL; entry = entry->next())
if (entry->visible())
{
*tailptr = auto_alloc(&m_machine, state_item(entry->index(), entry->symbol(), source.m_stateintf->state_string_max_length(entry->index())));
*tailptr = auto_alloc(m_machine, state_item(entry->index(), entry->symbol(), source.m_stateintf->state_string_max_length(entry->index())));
tailptr = &(*tailptr)->m_next;
}

View File

@ -60,15 +60,15 @@ static void debugger_exit(running_machine &machine);
debugger_init - start up all subsections
-------------------------------------------------*/
void debugger_init(running_machine *machine)
void debugger_init(running_machine &machine)
{
/* only if debugging is enabled */
if (machine->debug_flags & DEBUG_FLAG_ENABLED)
if (machine.debug_flags & DEBUG_FLAG_ENABLED)
{
machine_entry *entry;
/* initialize the submodules */
machine->m_debug_view = auto_alloc(machine, debug_view_manager(*machine));
machine.m_debug_view = auto_alloc(machine, debug_view_manager(machine));
debug_cpu_init(machine);
debug_command_init(machine);
debug_console_init(machine);
@ -77,10 +77,10 @@ void debugger_init(running_machine *machine)
debugint_init(machine);
/* allocate a new entry for our global list */
machine->add_notifier(MACHINE_NOTIFY_EXIT, debugger_exit);
machine.add_notifier(MACHINE_NOTIFY_EXIT, debugger_exit);
entry = global_alloc(machine_entry);
entry->next = machine_list;
entry->machine = machine;
entry->machine = &machine;
machine_list = entry;
/* register an atexit handler if we haven't yet */
@ -89,10 +89,10 @@ void debugger_init(running_machine *machine)
atexit_registered = TRUE;
/* listen in on the errorlog */
machine->add_logerror_callback(debug_errorlog_write_line);
machine.add_logerror_callback(debug_errorlog_write_line);
/* initialize osd debugger features */
machine->osd().init_debugger();
machine.osd().init_debugger();
}
}
@ -102,9 +102,9 @@ void debugger_init(running_machine *machine)
video display
-------------------------------------------------*/
void debugger_refresh_display(running_machine *machine)
void debugger_refresh_display(running_machine &machine)
{
machine->video().frame_update(true);
machine.video().frame_update(true);
}
@ -141,7 +141,7 @@ void debugger_flush_all_traces_on_abnormal_exit(void)
while (machine_list != NULL)
{
machine_entry *deleteme = machine_list;
debug_cpu_flush_traces(deleteme->machine);
debug_cpu_flush_traces(*deleteme->machine);
machine_list = deleteme->next;
global_free(deleteme);
}

View File

@ -24,10 +24,10 @@
/* ----- core debugger functions ----- */
/* initialize the debugger */
void debugger_init(running_machine *machine);
void debugger_init(running_machine &machine);
/* redraw the current video display */
void debugger_refresh_display(running_machine *machine);
void debugger_refresh_display(running_machine &machine);
/* OSD can call this to safely flush all traces in the event of a crash */
void debugger_flush_all_traces_on_abnormal_exit(void);
@ -45,7 +45,7 @@ void debugger_flush_all_traces_on_abnormal_exit(void);
INLINE void debugger_instruction_hook(device_t *device, offs_t curpc)
{
if ((device->machine->debug_flags & DEBUG_FLAG_CALL_HOOK) != 0)
if ((device->machine().debug_flags & DEBUG_FLAG_CALL_HOOK) != 0)
device->debug()->instruction_hook(curpc);
}
@ -57,7 +57,7 @@ INLINE void debugger_instruction_hook(device_t *device, offs_t curpc)
INLINE void debugger_exception_hook(device_t *device, int exception)
{
if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
device->debug()->exception_hook(exception);
}
@ -75,7 +75,7 @@ INLINE void debugger_exception_hook(device_t *device, int exception)
INLINE void debugger_start_cpu_hook(device_t *device, attotime endtime)
{
if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
device->debug()->start_hook(endtime);
}
@ -88,7 +88,7 @@ INLINE void debugger_start_cpu_hook(device_t *device, attotime endtime)
INLINE void debugger_stop_cpu_hook(device_t *device)
{
if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
device->debug()->stop_hook();
}
@ -101,7 +101,7 @@ INLINE void debugger_stop_cpu_hook(device_t *device)
INLINE void debugger_interrupt_hook(device_t *device, int irqline)
{
if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
device->debug()->interrupt_hook(irqline);
}
@ -116,9 +116,9 @@ INLINE void debugger_interrupt_hook(device_t *device, int irqline)
next opportunity
-------------------------------------------------*/
INLINE void debugger_break(running_machine *machine)
INLINE void debugger_break(running_machine &machine)
{
if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
debug_cpu_get_visible_cpu(machine)->debug()->halt_on_next_instruction("Internal breakpoint\n");
}
@ -129,9 +129,9 @@ INLINE void debugger_break(running_machine *machine)
halted within the instruction hook
-------------------------------------------------*/
INLINE int debugger_within_instruction_hook(running_machine *machine)
INLINE int debugger_within_instruction_hook(running_machine &machine)
{
if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
return debug_cpu_within_instruction_hook(machine);
return FALSE;
}

View File

@ -150,7 +150,7 @@ class DView
DISABLE_COPYING(DView);
public:
DView(render_target *target, running_machine *machine, debug_view_type type, int flags)
DView(render_target *target, running_machine &machine, debug_view_type type, int flags)
: next(NULL),
type(0),
state(0),
@ -160,9 +160,9 @@ public:
this->target = target;
//dv->container = render_target_get_component_container(target, name, &pos);
this->container = target->debug_alloc();
this->view = machine->debug_view().alloc_view(type, dview_update, this);
this->view = machine.debug_view().alloc_view(type, dview_update, this);
this->type = type;
this->machine = machine;
this->m_machine = &machine;
this->state = flags | VIEW_STATE_NEEDS_UPDATE;
// initial size
@ -186,16 +186,18 @@ public:
~DView()
{
this->target->debug_free(*this->container);
machine->debug_view().free_view(*this->view);
m_machine->debug_view().free_view(*this->view);
}
running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
DView * next;
int type;
debug_view * view;
render_container * container;
render_target * target;
running_machine * machine;
running_machine * m_machine;
int state;
// drawing
rectangle bounds;
@ -299,7 +301,7 @@ static void set_focus_view(DView *dv)
}
}
static DView *dview_alloc(render_target *target, running_machine *machine, debug_view_type type, int flags)
static DView *dview_alloc(render_target *target, running_machine &machine, debug_view_type type, int flags)
{
DView *dv;
@ -316,7 +318,7 @@ static void dview_free(DView *dv)
{
//astring_free(dv->title);
LIST_REMOVE(list, dv, DView);
auto_free(dv->machine, dv);
auto_free(dv->machine(), dv);
}
static void dview_get_rect(DView *dv, int type, rectangle *rect)
@ -895,11 +897,11 @@ static void debugint_exit(running_machine &machine)
}
void debugint_init(running_machine *machine)
void debugint_init(running_machine &machine)
{
unicode_char ch;
int chw;
debug_font = machine->render().font_alloc("ui.bdf"); //ui_get_font(machine);
debug_font = machine.render().font_alloc("ui.bdf"); //ui_get_font(machine);
debug_font_width = 0;
debug_font_height = 15;
@ -908,7 +910,7 @@ void debugint_init(running_machine *machine)
list = NULL;
focus_view = NULL;
debug_font_aspect = machine->render().ui_aspect();
debug_font_aspect = machine.render().ui_aspect();
for (ch=0;ch<=127;ch++)
{
@ -919,7 +921,7 @@ void debugint_init(running_machine *machine)
debug_font_width++;
/* FIXME: above does not really work */
debug_font_width = 10;
machine->add_notifier(MACHINE_NOTIFY_EXIT, debugint_exit);
machine.add_notifier(MACHINE_NOTIFY_EXIT, debugint_exit);
}
#if 0
@ -957,9 +959,9 @@ static void process_string(DView *dv, const char *str)
break;
case DVT_CONSOLE:
if(!dv->editor.str[(long)0])
debug_cpu_get_visible_cpu(dv->machine)->debug()->single_step();
debug_cpu_get_visible_cpu(dv->machine())->debug()->single_step();
else
debug_console_execute_command(dv->machine, str, 1);
debug_console_execute_command(dv->machine(), str, 1);
break;
case DVT_MEMORY:
downcast<debug_view_memory *>(dv->view)->set_expression(str);
@ -977,11 +979,11 @@ static void on_disassembly_window_activate(DView *dv, const ui_menu_event *event
render_target *target;
const debug_view_source *source;
target = &dv->machine->render().ui_target();
target = &dv->machine().render().ui_target();
ndv = dview_alloc(target, dv->machine, DVT_DISASSEMBLY, 0);
ndv = dview_alloc(target, dv->machine(), DVT_DISASSEMBLY, 0);
ndv->editor.active = TRUE;
ndv->editor.container = &dv->machine->render().ui_container();
ndv->editor.container = &dv->machine().render().ui_container();
source = ndv->view->source();
dview_set_title(ndv, source->name());
set_focus_view(ndv);
@ -1010,8 +1012,8 @@ static void on_log_window_activate(DView *dv, const ui_menu_event *event)
DView *ndv;
render_target *target;
target = &dv->machine->render().ui_target();
ndv = dview_alloc(target, dv->machine, DVT_LOG, 0);
target = &dv->machine().render().ui_target();
ndv = dview_alloc(target, dv->machine(), DVT_LOG, 0);
dview_set_title(ndv, "Log");
set_focus_view(ndv);
}
@ -1025,63 +1027,63 @@ static void on_close_activate(DView *dv, const ui_menu_event *event)
static void on_run_activate(DView *dv, const ui_menu_event *event)
{
debug_cpu_get_visible_cpu(dv->machine)->debug()->go();
debug_cpu_get_visible_cpu(dv->machine())->debug()->go();
}
#if 0
void on_run_h_activate(DView *dv, const ui_menu_event *event)
{
debugwin_show(0);
debug_cpu_get_visible_cpu(dv->machine)->debug()->go();
debug_cpu_get_visible_cpu(dv->machine())->debug()->go();
}
#endif
static void on_run_cpu_activate(DView *dv, const ui_menu_event *event)
{
debug_cpu_get_visible_cpu(dv->machine)->debug()->go_next_device();
debug_cpu_get_visible_cpu(dv->machine())->debug()->go_next_device();
}
static void on_run_irq_activate(DView *dv, const ui_menu_event *event)
{
debug_cpu_get_visible_cpu(dv->machine)->debug()->go_interrupt();
debug_cpu_get_visible_cpu(dv->machine())->debug()->go_interrupt();
}
static void on_run_vbl_activate(DView *dv, const ui_menu_event *event)
{
debug_cpu_get_visible_cpu(dv->machine)->debug()->go_vblank();
debug_cpu_get_visible_cpu(dv->machine())->debug()->go_vblank();
}
static void on_step_into_activate(DView *dv, const ui_menu_event *event)
{
debug_cpu_get_visible_cpu(dv->machine)->debug()->single_step();
debug_cpu_get_visible_cpu(dv->machine())->debug()->single_step();
}
static void on_step_over_activate(DView *dv, const ui_menu_event *event)
{
debug_cpu_get_visible_cpu(dv->machine)->debug()->single_step_over();
debug_cpu_get_visible_cpu(dv->machine())->debug()->single_step_over();
}
#ifdef UNUSED_CODE
static void on_step_out_activate(DView *dv, const ui_menu_event *event)
{
debug_cpu_get_visible_cpu(dv->machine)->debug()->single_step_out();
debug_cpu_get_visible_cpu(dv->machine())->debug()->single_step_out();
}
#endif
static void on_hard_reset_activate(DView *dv, const ui_menu_event *event)
{
dv->machine->schedule_hard_reset();
dv->machine().schedule_hard_reset();
}
static void on_soft_reset_activate(DView *dv, const ui_menu_event *event)
{
dv->machine->schedule_soft_reset();
debug_cpu_get_visible_cpu(dv->machine)->debug()->go();
dv->machine().schedule_soft_reset();
debug_cpu_get_visible_cpu(dv->machine())->debug()->go();
}
static void on_exit_activate(DView *dv, const ui_menu_event *event)
{
dv->machine->schedule_exit();
dv->machine().schedule_exit();
}
static void on_view_opcodes_activate(DView *dv, const ui_menu_event *event)
@ -1108,11 +1110,11 @@ static void on_run_to_cursor_activate(DView *dv, const ui_menu_event *event)
{
char command[64];
if (dv->view->cursor_visible() && debug_cpu_get_visible_cpu(dv->machine) == dv->view->source()->device())
if (dv->view->cursor_visible() && debug_cpu_get_visible_cpu(dv->machine()) == dv->view->source()->device())
{
offs_t address = downcast<debug_view_disasm *>(dv->view)->selected_address();
sprintf(command, "go %X", address);
debug_console_execute_command(dv->machine, command, 1);
debug_console_execute_command(dv->machine(), command, 1);
}
}
@ -1157,7 +1159,7 @@ static void render_editor(DView_edit *editor)
menu_main_populate - populate the main menu
-------------------------------------------------*/
static void CreateMainMenu(running_machine *machine)
static void CreateMainMenu(running_machine &machine)
{
const char *subtext = "";
int rc;
@ -1165,7 +1167,7 @@ static void CreateMainMenu(running_machine *machine)
if (menu != NULL)
ui_menu_free(menu);
menu = ui_menu_alloc(machine, &machine->render().ui_container(),NULL,NULL);
menu = ui_menu_alloc(machine, &machine.render().ui_container(),NULL,NULL);
switch (focus_view->type)
{
@ -1258,7 +1260,7 @@ static int map_point(DView *dv, INT32 target_x, INT32 target_y, INT32 *mapped_x,
return FALSE;
}
static void handle_mouse(running_machine *machine)
static void handle_mouse(running_machine &machine)
{
render_target * mouse_target;
INT32 x,y;
@ -1288,7 +1290,7 @@ static void handle_mouse(running_machine *machine)
handle_editor - handle the editor
-------------------------------------------------*/
static void handle_editor(running_machine *machine)
static void handle_editor(running_machine &machine)
{
if (focus_view->editor.active)
{
@ -1344,12 +1346,12 @@ static void handle_editor(running_machine *machine)
menu_main - handle the main menu
-------------------------------------------------*/
static void handle_menus(running_machine *machine)
static void handle_menus(running_machine &machine)
{
const ui_menu_event *event;
machine->render().ui_container().empty();
ui_input_frame_update(*machine);
machine.render().ui_container().empty();
ui_input_frame_update(machine);
if (menu != NULL)
{
/* process the menu */
@ -1447,35 +1449,35 @@ void debugint_wait_for_debugger(device_t &device, bool firststop)
DView *dv;
render_target *target;
target = &device.machine->render().ui_target();
target = &device.machine().render().ui_target();
//set_view_by_name(target, "Debug");
dv = dview_alloc(target, device.machine, DVT_DISASSEMBLY, VIEW_STATE_FOLLOW_CPU);
dv = dview_alloc(target, device.machine(), DVT_DISASSEMBLY, VIEW_STATE_FOLLOW_CPU);
dv->editor.active = TRUE;
dv->editor.container = &device.machine->render().ui_container();
dv = dview_alloc(target, device.machine, DVT_STATE, VIEW_STATE_FOLLOW_CPU);
dv = dview_alloc(target, device.machine, DVT_CONSOLE, VIEW_STATE_FOLLOW_CPU);
dv->editor.container = &device.machine().render().ui_container();
dv = dview_alloc(target, device.machine(), DVT_STATE, VIEW_STATE_FOLLOW_CPU);
dv = dview_alloc(target, device.machine(), DVT_CONSOLE, VIEW_STATE_FOLLOW_CPU);
dview_set_title(dv, "Console");
dv->editor.active = TRUE;
dv->editor.container = &device.machine->render().ui_container();
dv->editor.container = &device.machine().render().ui_container();
set_focus_view(dv);
}
followers_set_cpu(&device);
//ui_update_and_render(device.machine, &device.machine->render().ui_container()());
//ui_update_and_render(device.machine(), device.machine().render().ui_container()());
update_views();
device.machine->osd().update(false);
handle_menus(device.machine);
handle_mouse(device.machine);
device.machine().osd().update(false);
handle_menus(device.machine());
handle_mouse(device.machine());
//osd_sleep(osd_ticks_per_second()/60);
}
void debugint_update_during_game(running_machine *machine)
void debugint_update_during_game(running_machine &machine)
{
if (!debug_cpu_is_stopped(machine) && machine->phase() == MACHINE_PHASE_RUNNING)
if (!debug_cpu_is_stopped(machine) && machine.phase() == MACHINE_PHASE_RUNNING)
{
update_views();
}

View File

@ -36,12 +36,12 @@
***************************************************************************/
/* initialize the internal debugger */
void debugint_init(running_machine *machine);
void debugint_init(running_machine &machine);
/* process events for internal debugger */
void debugint_wait_for_debugger(device_t &device, bool firststop);
/* update the internal debugger during a game */
void debugint_update_during_game(running_machine *machine);
void debugint_update_during_game(running_machine &machine);
#endif

View File

@ -41,7 +41,7 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
/* input port handlers */
if (config->type == DEVCB_TYPE_INPUT)
{
resolved->target = device->machine->port(config->tag);
resolved->target = device->machine().port(config->tag);
if (resolved->target == NULL)
fatalerror("devcb_resolve_read_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
resolved->read = trampoline_read_port_to_read_line;
@ -74,7 +74,7 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
if (config->type == DEVCB_TYPE_SELF)
resolved->target = device;
else if (config->type == DEVCB_TYPE_DRIVER)
resolved->target = device->machine->driver_data();
resolved->target = device->machine().driver_data();
else
if (strcmp(config->tag, DEVICE_SELF_OWNER) == 0)
resolved->target = device->owner();
@ -130,7 +130,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
if (config->type == DEVCB_TYPE_INPUT)
{
resolved->target = device->machine->port(config->tag);
resolved->target = device->machine().port(config->tag);
if (resolved->target == NULL)
fatalerror("devcb_resolve_write_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
resolved->write = trampoline_write_port_to_write_line;
@ -178,7 +178,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
if (config->type == DEVCB_TYPE_SELF)
resolved->target = device;
else if (config->type == DEVCB_TYPE_DRIVER)
resolved->target = device->machine->driver_data();
resolved->target = device->machine().driver_data();
else
if (strcmp(config->tag, DEVICE_SELF_OWNER) == 0)
resolved->target = device->owner();
@ -228,7 +228,7 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
/* input port handlers */
if (config->type == DEVCB_TYPE_INPUT)
{
resolved->target = device->machine->port(config->tag);
resolved->target = device->machine().port(config->tag);
if (resolved->target == NULL)
fatalerror("devcb_resolve_read8: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
resolved->read = trampoline_read_port_to_read8;
@ -258,7 +258,7 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
if (config->type == DEVCB_TYPE_SELF)
resolved->target = device;
else if (config->type == DEVCB_TYPE_DRIVER)
resolved->target = device->machine->driver_data();
resolved->target = device->machine().driver_data();
else
if (strcmp(config->tag, DEVICE_SELF_OWNER) == 0)
resolved->target = device->owner();
@ -307,7 +307,7 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c
if (config->type == DEVCB_TYPE_INPUT)
{
resolved->target = device->machine->port(config->tag);
resolved->target = device->machine().port(config->tag);
if (resolved->target == NULL)
fatalerror("devcb_resolve_read_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
resolved->write = trampoline_write_port_to_write8;
@ -337,7 +337,7 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c
if (config->type == DEVCB_TYPE_SELF)
resolved->target = device;
else if (config->type == DEVCB_TYPE_DRIVER)
resolved->target = device->machine->driver_data();
resolved->target = device->machine().driver_data();
else
if (strcmp(config->tag, DEVICE_SELF_OWNER) == 0)
resolved->target = device->owner();

View File

@ -75,7 +75,7 @@ template<class _Class, UINT8 (_Class::*_Function)(address_space &, offs_t, UINT8
UINT8 devcb_stub(device_t *device, offs_t offset)
{
_Class *target = downcast<_Class *>(device);
return (target->*_Function)(*memory_nonspecific_space(device->machine), offset, 0xff);
return (target->*_Function)(*memory_nonspecific_space(device->machine()), offset, 0xff);
}
// static template for a write_line stub function that calls through a given WRITE_LINE_MEMBER
@ -91,7 +91,7 @@ template<class _Class, void (_Class::*_Function)(address_space &, offs_t, UINT8,
void devcb_stub(device_t *device, offs_t offset, UINT8 data)
{
_Class *target = downcast<_Class *>(device);
(target->*_Function)(*memory_nonspecific_space(device->machine), offset, data, 0xff);
(target->*_Function)(*memory_nonspecific_space(device->machine()), offset, data, 0xff);
}
#define DEVCB_NULL { DEVCB_TYPE_NULL }

View File

@ -236,7 +236,7 @@ legacy_cpu_device::legacy_cpu_device(running_machine &machine, const legacy_cpu_
throw emu_fatalerror("Device %s specifies a 0 context size!\n", tag());
// allocate memory for the token
m_token = auto_alloc_array_clear(&machine, UINT8, tokenbytes);
m_token = auto_alloc_array_clear(machine, UINT8, tokenbytes);
}

View File

@ -286,8 +286,8 @@ const device_type name = basename##_device_config::static_alloc_device_config
#define INTERRUPT_GEN(func) void func(device_t *device)
// helpers for using machine/cputag instead of cpu objects
#define cputag_set_input_line(mach, tag, line, state) device_execute((mach)->device(tag))->set_input_line(line, state)
#define cputag_set_input_line_and_vector(mach, tag, line, state, vec) device_execute((mach)->device(tag))->set_input_line_and_vector(line, state, vec)
#define cputag_set_input_line(mach, tag, line, state) device_execute((mach).device(tag))->set_input_line(line, state)
#define cputag_set_input_line_and_vector(mach, tag, line, state, vec) device_execute((mach).device(tag))->set_input_line_and_vector(line, state, vec)

View File

@ -487,7 +487,7 @@ done:
if (m_err!=0) {
if (!m_init_phase)
{
if (machine->phase() == MACHINE_PHASE_RUNNING)
if (m_machine.phase() == MACHINE_PHASE_RUNNING)
popmessage("Error: Unable to %s image '%s': %s\n", is_create ? "create" : "load", path, error());
else
mame_printf_error("Error: Unable to %s image '%s': %s", is_create ? "create" : "load", path, error());
@ -496,13 +496,13 @@ done:
}
else {
/* do we need to reset the CPU? only schedule it if load/create is successful */
if (device().machine->time() > attotime::zero && m_image_config.is_reset_on_load())
device().machine->schedule_hard_reset();
if (device().machine().time() > attotime::zero && m_image_config.is_reset_on_load())
device().machine().schedule_hard_reset();
else
{
if (!m_init_phase)
{
if (machine->phase() == MACHINE_PHASE_RUNNING)
if (m_machine.phase() == MACHINE_PHASE_RUNNING)
popmessage("Image '%s' was successfully %s.", path, is_create ? "created" : "loaded");
else
mame_printf_info("Image '%s' was successfully %s.\n", path, is_create ? "created" : "loaded");

View File

@ -189,7 +189,7 @@ void device_list::static_exit(running_machine &machine)
{
// first let the debugger save comments
if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
debug_comment_save(&machine);
debug_comment_save(machine);
// then nuke the devices
machine.m_devicelist.reset();
@ -201,7 +201,7 @@ void device_list::static_exit(running_machine &machine)
// about to save
//-------------------------------------------------
void device_list::static_pre_save(running_machine *machine, void *param)
void device_list::static_pre_save(running_machine &machine, void *param)
{
device_list *list = reinterpret_cast<device_list *>(param);
for (device_t *device = list->first(); device != NULL; device = device->next())
@ -214,7 +214,7 @@ void device_list::static_pre_save(running_machine *machine, void *param)
// completed a load
//-------------------------------------------------
void device_list::static_post_load(running_machine *machine, void *param)
void device_list::static_post_load(running_machine &machine, void *param)
{
device_list *list = reinterpret_cast<device_list *>(param);
for (device_t *device = list->first(); device != NULL; device = device->next())
@ -545,8 +545,7 @@ void device_interface::interface_debug_setup()
//-------------------------------------------------
device_t::device_t(running_machine &_machine, const device_config &config)
: machine(&_machine),
m_machine(_machine),
: m_machine(_machine),
m_state_manager(_machine.state()),
m_debug(NULL),
m_execute(NULL),
@ -573,7 +572,7 @@ device_t::device_t(running_machine &_machine, const device_config &config)
device_t::~device_t()
{
auto_free(&m_machine, m_debug);
auto_free(m_machine, m_debug);
}
@ -737,13 +736,13 @@ void device_t::start()
intf->interface_pre_start();
// remember the number of state registrations
int state_registrations = machine->state().registration_count();
int state_registrations = m_machine.state().registration_count();
// start the device
device_start();
// complain if nothing was registered by the device
state_registrations = machine->state().registration_count() - state_registrations;
state_registrations = m_machine.state().registration_count() - state_registrations;
device_execute_interface *exec;
device_sound_interface *sound;
if (state_registrations == 0 && (interface(exec) || interface(sound)))
@ -763,7 +762,7 @@ void device_t::start()
// if we're debugging, create a device_debug object
if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
m_debug = auto_alloc(&m_machine, device_debug(*this));
m_debug = auto_alloc(m_machine, device_debug(*this));
debug_setup();
}
@ -983,7 +982,7 @@ device_t *device_t::auto_finder_base::find_device(device_t &base, const char *ta
void *device_t::auto_finder_base::find_shared_ptr(device_t &base, const char *tag)
{
return memory_get_shared(*base.machine, tag);
return memory_get_shared(base.machine(), tag);
}
@ -994,6 +993,6 @@ void *device_t::auto_finder_base::find_shared_ptr(device_t &base, const char *ta
size_t device_t::auto_finder_base::find_shared_size(device_t &base, const char *tag)
{
size_t result = 0;
memory_get_shared(*base.machine, tag, result);
memory_get_shared(base.machine(), tag, result);
return result;
}

View File

@ -56,7 +56,7 @@
#define DERIVED_CLOCK(num, den) (0xff000000 | ((num) << 12) | ((den) << 0))
// shorthand for accessing devices by machine/type/tag
#define devtag_reset(mach,tag) (mach)->device(tag)->reset()
#define devtag_reset(mach,tag) (mach).device(tag)->reset()
// often derived devices need only a different name and a simple parameter to differentiate them
// these are provided as macros because you can't pass string literals to templates, annoyingly enough
@ -89,7 +89,7 @@ device_config *_ConfigClass::static_alloc_device_config(const machine_config &mc
\
device_t *_ConfigClass::alloc_device(running_machine &machine) const \
{ \
return auto_alloc(&machine, _DeviceClass(machine, *this)); \
return auto_alloc(machine, _DeviceClass(machine, *this)); \
} \
@ -234,8 +234,8 @@ class device_list : public tagged_device_list<device_t>
static void static_reset(running_machine &machine);
static void static_exit(running_machine &machine);
static void static_pre_save(running_machine *machine, void *param);
static void static_post_load(running_machine *machine, void *param);
static void static_pre_save(running_machine &machine, void *param);
static void static_post_load(running_machine &machine, void *param);
public:
device_list(resource_pool &pool = global_resource_pool);
@ -394,6 +394,9 @@ protected:
virtual ~device_t();
public:
// getters
running_machine &machine() const { return m_machine; }
// iteration helpers
device_t *next() const { return m_next; }
device_t *typenext() const;
@ -467,9 +470,6 @@ public:
machine_config_constructor machine_config_additions() const { return m_baseconfig.machine_config_additions(); }
const input_port_token *input_ports() const { return m_baseconfig.input_ports(); }
public:
running_machine * machine;
protected:
// miscellaneous helpers
void find_interfaces();

View File

@ -217,7 +217,7 @@ legacy_device_base::legacy_device_base(running_machine &_machine, const device_c
{
int tokenbytes = m_config.get_legacy_config_int(DEVINFO_INT_TOKEN_BYTES);
if (tokenbytes != 0)
m_token = auto_alloc_array_clear(machine, UINT8, tokenbytes);
m_token = auto_alloc_array_clear(m_machine, UINT8, tokenbytes);
}

View File

@ -314,7 +314,7 @@ device_execute_interface::~device_execute_interface()
bool device_execute_interface::executing() const
{
return (this == device().machine->scheduler().currently_executing());
return (this == device().machine().scheduler().currently_executing());
}
@ -372,7 +372,7 @@ void device_execute_interface::adjust_icount(int delta)
void device_execute_interface::abort_timeslice()
{
// ignore if not the executing device
if (this != device().machine->scheduler().currently_executing())
if (this != device().machine().scheduler().currently_executing())
return;
// swallow the remaining cycles
@ -442,7 +442,7 @@ void device_execute_interface::spin_until_time(attotime duration)
suspend_until_trigger(TRIGGER_SUSPENDTIME + timetrig, true);
// then set a timer for it
device().machine->scheduler().timer_set(duration, FUNC(static_timed_trigger_callback), TRIGGER_SUSPENDTIME + timetrig, this);
device().machine().scheduler().timer_set(duration, FUNC(static_timed_trigger_callback), TRIGGER_SUSPENDTIME + timetrig, this);
timetrig = (timetrig + 1) % 256;
}
@ -547,7 +547,7 @@ void device_execute_interface::execute_set_input(int linenum, int state)
void device_execute_interface::interface_pre_start()
{
// fill in the initial states
int index = device().machine->m_devicelist.indexof(m_device);
int index = device().machine().m_devicelist.indexof(m_device);
m_suspend = SUSPEND_REASON_RESET;
m_profiler = profile_type(index + PROFILER_DEVICE_FIRST);
m_inttrigger = index + TRIGGER_INT;
@ -558,9 +558,9 @@ void device_execute_interface::interface_pre_start()
// allocate timers if we need them
if (m_execute_config.m_vblank_interrupts_per_frame > 1)
m_partial_frame_timer = device().machine->scheduler().timer_alloc(FUNC(static_trigger_partial_frame_interrupt), (void *)this);
m_partial_frame_timer = device().machine().scheduler().timer_alloc(FUNC(static_trigger_partial_frame_interrupt), (void *)this);
if (m_execute_config.m_timed_interrupt_period != attotime::zero)
m_timedint_timer = device().machine->scheduler().timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this);
m_timedint_timer = device().machine().scheduler().timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this);
// register for save states
m_device.save_item(NAME(m_suspend));
@ -623,11 +623,11 @@ void device_execute_interface::interface_post_reset()
// new style - use screen tag directly
screen_device *screen;
if (m_execute_config.m_vblank_interrupt_screen != NULL)
screen = downcast<screen_device *>(device().machine->device(m_execute_config.m_vblank_interrupt_screen));
screen = downcast<screen_device *>(device().machine().device(m_execute_config.m_vblank_interrupt_screen));
// old style 'hack' setup - use screen #0
else
screen = device().machine->first_screen();
screen = device().machine().first_screen();
assert(screen != NULL);
screen->register_vblank_callback(static_on_vblank, NULL);
@ -665,7 +665,7 @@ void device_execute_interface::interface_clock_changed()
m_divisor = attos;
// re-compute the perfect interleave factor
device().machine->scheduler().compute_perfect_interleave();
device().machine().scheduler().compute_perfect_interleave();
}
@ -709,7 +709,7 @@ void device_execute_interface::static_on_vblank(screen_device &screen, void *par
if (vblank_state)
{
device_execute_interface *exec = NULL;
for (bool gotone = screen.machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
for (bool gotone = screen.machine().m_devicelist.first(exec); gotone; gotone = exec->next(exec))
exec->on_vblank_start(screen);
}
}
@ -740,7 +740,7 @@ void device_execute_interface::on_vblank_start(screen_device &screen)
// if we have more than one interrupt per frame, start the timer now to trigger the rest of them
if (m_execute_config.m_vblank_interrupts_per_frame > 1 && !suspended(SUSPEND_REASON_DISABLE))
{
m_partial_frame_period = device().machine->primary_screen->frame_period() / m_execute_config.m_vblank_interrupts_per_frame;
m_partial_frame_period = device().machine().primary_screen->frame_period() / m_execute_config.m_vblank_interrupts_per_frame;
m_partial_frame_timer->adjust(m_partial_frame_period);
}
}
@ -916,7 +916,7 @@ if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_device->tag(), m_linenum, state,
// if this is the first one, set the timer
if (event_index == 0)
m_execute->device().machine->scheduler().synchronize(FUNC(static_empty_event_queue), 0, (void *)this);
m_execute->device().machine().scheduler().synchronize(FUNC(static_empty_event_queue), 0, (void *)this);
}
}

View File

@ -300,7 +300,7 @@ protected:
int m_qindex; // index within the queue
private:
static void static_empty_event_queue(running_machine *machine, void *ptr, int param);
static void static_empty_event_queue(running_machine &machine, void *ptr, int param);
void empty_event_queue();
};
@ -344,15 +344,15 @@ protected:
private:
// callbacks
static void static_timed_trigger_callback(running_machine *machine, void *ptr, int param);
static void static_timed_trigger_callback(running_machine &machine, void *ptr, int param);
static void static_on_vblank(screen_device &screen, void *param, bool vblank_state);
void on_vblank_start(screen_device &screen);
static void static_trigger_partial_frame_interrupt(running_machine *machine, void *ptr, int param);
static void static_trigger_partial_frame_interrupt(running_machine &machine, void *ptr, int param);
void trigger_partial_frame_interrupt();
static void static_trigger_periodic_interrupt(running_machine *machine, void *ptr, int param);
static void static_trigger_periodic_interrupt(running_machine &machine, void *ptr, int param);
void trigger_periodic_interrupt();
attoseconds_t minimum_quantum() const;

View File

@ -394,7 +394,7 @@ void device_image_interface::setup_working_directory()
if (try_change_working_directory("software"))
{
/* now down to a directory for this computer */
gamedrv = &device().machine->system();
gamedrv = &device().machine().system();
while(gamedrv && !try_change_working_directory(gamedrv->name))
{
gamedrv = driver_get_compatible(gamedrv);
@ -431,7 +431,7 @@ UINT8 *device_image_interface::get_software_region(const char *tag)
return NULL;
sprintf( full_tag, "%s:%s", device().tag(), tag );
return device().machine->region( full_tag )->base();
return device().machine().region( full_tag )->base();
}
@ -444,7 +444,7 @@ UINT32 device_image_interface::get_software_region_length(const char *tag)
char full_tag[256];
sprintf( full_tag, "%s:%s", device().tag(), tag );
return device().machine->region( full_tag )->bytes();
return device().machine().region( full_tag )->bytes();
}
@ -582,9 +582,9 @@ UINT32 device_image_interface::crc()
-------------------------------------------------*/
void device_image_interface::battery_load(void *buffer, int length, int fill)
{
astring *fname = astring_assemble_4(astring_alloc(), device().machine->system().name, PATH_SEPARATOR, m_basename_noext, ".nv");
astring *fname = astring_assemble_4(astring_alloc(), device().machine().system().name, PATH_SEPARATOR, m_basename_noext, ".nv");
image_battery_load_by_name(device().machine->options(), astring_c(fname), buffer, length, fill);
image_battery_load_by_name(device().machine().options(), astring_c(fname), buffer, length, fill);
astring_free(fname);
}
@ -596,9 +596,9 @@ void device_image_interface::battery_load(void *buffer, int length, int fill)
-------------------------------------------------*/
void device_image_interface::battery_save(const void *buffer, int length)
{
astring *fname = astring_assemble_4(astring_alloc(), device().machine->system().name, PATH_SEPARATOR, m_basename_noext, ".nv");
astring *fname = astring_assemble_4(astring_alloc(), device().machine().system().name, PATH_SEPARATOR, m_basename_noext, ".nv");
image_battery_save_by_name(device().machine->options(), astring_c(fname), buffer, length);
image_battery_save_by_name(device().machine().options(), astring_c(fname), buffer, length);
astring_free(fname);
}

View File

@ -181,7 +181,7 @@ int device_sound_interface::inputs() const
{
// scan the list counting streams we own and summing their inputs
int inputs = 0;
for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &m_device)
inputs += stream->input_count();
return inputs;
@ -197,7 +197,7 @@ int device_sound_interface::outputs() const
{
// scan the list counting streams we own and summing their outputs
int outputs = 0;
for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &m_device)
outputs += stream->output_count();
return outputs;
@ -215,7 +215,7 @@ sound_stream *device_sound_interface::input_to_stream_input(int inputnum, int &s
assert(inputnum >= 0);
// scan the list looking for streams owned by this device
for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &m_device)
{
if (inputnum < stream->input_count())
@ -242,7 +242,7 @@ sound_stream *device_sound_interface::output_to_stream_output(int outputnum, int
assert(outputnum >= 0);
// scan the list looking for streams owned by this device
for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &device())
{
if (outputnum < stream->output_count())
@ -268,7 +268,7 @@ void device_sound_interface::set_output_gain(int outputnum, float gain)
// handle ALL_OUTPUTS as a special case
if (outputnum == ALL_OUTPUTS)
{
for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &device())
for (int outputnum = 0; outputnum < stream->output_count(); outputnum++)
stream->set_output_gain(outputnum, gain);
@ -294,13 +294,13 @@ void device_sound_interface::interface_pre_start()
{
// scan all the sound devices
device_sound_interface *sound = NULL;
for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
for (bool gotone = m_device.machine().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
{
// scan each route on the device
for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
{
// see if we are the target of this route; if we are, make sure the source device is started
device_t *target_device = m_device.machine->device(route->m_target);
device_t *target_device = m_device.machine().device(route->m_target);
if (target_device == &m_device && !sound->device().started())
throw device_missing_dependencies();
}
@ -308,13 +308,13 @@ void device_sound_interface::interface_pre_start()
// now iterate through devices again and assign any auto-allocated inputs
m_auto_allocated_inputs = 0;
for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
for (bool gotone = m_device.machine().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
{
// scan each route on the device
for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
{
// see if we are the target of this route
device_t *target_device = m_device.machine->device(route->m_target);
device_t *target_device = m_device.machine().device(route->m_target);
if (target_device == &m_device && route->m_input == AUTO_ALLOC_INPUT)
{
const_cast<device_config_sound_interface::sound_route *>(route)->m_input = m_auto_allocated_inputs;
@ -334,13 +334,13 @@ void device_sound_interface::interface_post_start()
{
// iterate over all the sound devices
device_sound_interface *sound = NULL;
for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
for (bool gotone = m_device.machine().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
{
// scan each route on the device
for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
{
// if we are the target of this route, hook it up
device_t *target_device = m_device.machine->device(route->m_target);
device_t *target_device = m_device.machine().device(route->m_target);
if (target_device == &m_device)
{
// iterate over all outputs, matching any that apply
@ -378,7 +378,7 @@ void device_sound_interface::interface_post_start()
void device_sound_interface::interface_pre_reset()
{
// update all streams on this device prior to reset
for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &device())
stream->update();
}

View File

@ -579,7 +579,7 @@ device_state_entry &device_state_interface::state_add(int index, const char *sym
assert(symbol != NULL);
// allocate new entry
device_state_entry *entry = auto_alloc(device().machine, device_state_entry(index, symbol, data, size));
device_state_entry *entry = auto_alloc(device().machine(), device_state_entry(index, symbol, data, size));
// append to the end of the list
m_state_list.append(*entry);

View File

@ -79,9 +79,9 @@ INLINE INT32 normalize_yscroll(bitmap_t *bitmap, INT32 yscroll)
elements referenced by a machine
-------------------------------------------------*/
void gfx_init(running_machine *machine)
void gfx_init(running_machine &machine)
{
const gfx_decode_entry *gfxdecodeinfo = machine->config().m_gfxdecodeinfo;
const gfx_decode_entry *gfxdecodeinfo = machine.config().m_gfxdecodeinfo;
int curgfx;
/* skip if nothing to do */
@ -92,7 +92,7 @@ void gfx_init(running_machine *machine)
for (curgfx = 0; curgfx < MAX_GFX_ELEMENTS && gfxdecodeinfo[curgfx].gfxlayout != NULL; curgfx++)
{
const gfx_decode_entry *gfxdecode = &gfxdecodeinfo[curgfx];
const memory_region *region = (gfxdecode->memory_region != NULL) ? machine->region(gfxdecode->memory_region) : NULL;
const memory_region *region = (gfxdecode->memory_region != NULL) ? machine.region(gfxdecode->memory_region) : NULL;
UINT32 region_length = (region != NULL) ? (8 * region->bytes()) : 0;
const UINT8 *region_base = (region != NULL) ? region->base() : NULL;
UINT32 xscale = (gfxdecode->xscale == 0) ? 1 : gfxdecode->xscale;
@ -206,7 +206,7 @@ void gfx_init(running_machine *machine)
glcopy.total = total;
/* allocate the graphics */
machine->gfx[curgfx] = gfx_element_alloc(machine, &glcopy, (region_base != NULL) ? region_base + gfxdecode->start : NULL, gfxdecode->total_color_codes, gfxdecode->color_codes_start);
machine.gfx[curgfx] = gfx_element_alloc(machine, &glcopy, (region_base != NULL) ? region_base + gfxdecode->start : NULL, gfxdecode->total_color_codes, gfxdecode->color_codes_start);
}
}
@ -217,7 +217,7 @@ void gfx_init(running_machine *machine)
based on a given layout
-------------------------------------------------*/
gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base)
gfx_element *gfx_element_alloc(running_machine &machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base)
{
int israw = (gl->planeoffset[0] == GFX_RAW);
int planes = gl->planes;
@ -243,7 +243,7 @@ gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, c
gfx->total_colors = total_colors;
gfx->srcdata = srcdata;
gfx->machine = machine;
gfx->m_machine = &machine;
/* copy the layout */
gfx->layout = *gl;
@ -338,12 +338,12 @@ void gfx_element_free(gfx_element *gfx)
return;
/* free our data */
auto_free(gfx->machine, gfx->layout.extyoffs);
auto_free(gfx->machine, gfx->layout.extxoffs);
auto_free(gfx->machine, gfx->pen_usage);
auto_free(gfx->machine, gfx->dirty);
auto_free(gfx->machine, gfx->gfxdata);
auto_free(gfx->machine, gfx);
auto_free(gfx->machine(), gfx->layout.extyoffs);
auto_free(gfx->machine(), gfx->layout.extxoffs);
auto_free(gfx->machine(), gfx->pen_usage);
auto_free(gfx->machine(), gfx->dirty);
auto_free(gfx->machine(), gfx->gfxdata);
auto_free(gfx->machine(), gfx);
}
@ -352,7 +352,7 @@ void gfx_element_free(gfx_element *gfx)
temporary one-off gfx_element
-------------------------------------------------*/
void gfx_element_build_temporary(gfx_element *gfx, running_machine *machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags)
void gfx_element_build_temporary(gfx_element *gfx, running_machine &machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags)
{
static UINT8 not_dirty = 0;
@ -369,7 +369,7 @@ void gfx_element_build_temporary(gfx_element *gfx, running_machine *machine, UIN
gfx->color_base = color_base;
gfx->color_depth = color_granularity;
gfx->color_granularity = color_granularity;
gfx->total_colors = (machine->total_colors() - color_base) / color_granularity;
gfx->total_colors = (machine.total_colors() - color_base) / color_granularity;
gfx->pen_usage = NULL;
@ -380,7 +380,7 @@ void gfx_element_build_temporary(gfx_element *gfx, running_machine *machine, UIN
gfx->dirty = &not_dirty;
gfx->dirtyseq = 0;
gfx->machine = machine;
gfx->m_machine = &machine;
}
@ -517,7 +517,7 @@ void drawgfx_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_element
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* render based on dest bitmap depth */
if (dest->bpp == 16)
@ -553,7 +553,7 @@ void drawgfx_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_eleme
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@ -638,7 +638,7 @@ void drawgfx_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_elem
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@ -686,7 +686,7 @@ void drawgfx_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx_ele
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* render based on dest bitmap depth */
if (dest->bpp == 16)
@ -723,7 +723,7 @@ void drawgfx_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_element
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0)
@ -768,7 +768,7 @@ void drawgfxzoom_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_ele
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* render based on dest bitmap depth */
if (dest->bpp == 16)
@ -811,7 +811,7 @@ void drawgfxzoom_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_e
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@ -910,7 +910,7 @@ void drawgfxzoom_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@ -965,7 +965,7 @@ void drawgfxzoom_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* render based on dest bitmap depth */
if (dest->bpp == 16)
@ -1009,7 +1009,7 @@ void drawgfxzoom_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_elem
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0)
@ -1047,7 +1047,7 @@ void pdrawgfx_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_elemen
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
@ -1086,7 +1086,7 @@ void pdrawgfx_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_elem
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@ -1174,7 +1174,7 @@ void pdrawgfx_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_ele
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@ -1225,7 +1225,7 @@ void pdrawgfx_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx_el
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
@ -1265,7 +1265,7 @@ void pdrawgfx_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_element
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0)
@ -1313,7 +1313,7 @@ void pdrawgfxzoom_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_el
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
@ -1360,7 +1360,7 @@ void pdrawgfxzoom_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@ -1466,7 +1466,7 @@ void pdrawgfxzoom_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@ -1525,7 +1525,7 @@ void pdrawgfxzoom_transtable(bitmap_t *dest, const rectangle *cliprect, const gf
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
@ -1574,7 +1574,7 @@ void pdrawgfxzoom_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_ele
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0)

View File

@ -120,6 +120,8 @@ struct _gfx_layout
class gfx_element
{
public:
running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
UINT16 width; /* current pixel width of each element (changeble with source clipping) */
UINT16 height; /* current pixel height of each element (changeble with source clipping) */
UINT16 startx; /* current source clip X offset */
@ -144,7 +146,7 @@ public:
UINT8 * dirty; /* dirty array for detecting tiles that need decoding */
UINT32 dirtyseq; /* sequence number; incremented each time a tile is dirtied */
running_machine *machine; /* pointer to the owning machine */
running_machine *m_machine; /* pointer to the owning machine */
gfx_layout layout; /* copy of the original layout */
};
@ -170,10 +172,10 @@ struct gfx_decode_entry
/* ----- graphics elements ----- */
/* allocate memory for the graphics elements referenced by a machine */
void gfx_init(running_machine *machine);
void gfx_init(running_machine &machine);
/* allocate a gfx_element structure based on a given layout */
gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base);
gfx_element *gfx_element_alloc(running_machine &machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base);
/* update a single code in a gfx_element */
void gfx_element_decode(const gfx_element *gfx, UINT32 code);
@ -182,7 +184,7 @@ void gfx_element_decode(const gfx_element *gfx, UINT32 code);
void gfx_element_free(gfx_element *gfx);
/* create a temporary one-off gfx_element */
void gfx_element_build_temporary(gfx_element *gfx, running_machine *machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags);
void gfx_element_build_temporary(gfx_element *gfx, running_machine &machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags);

View File

@ -60,7 +60,7 @@
TYPE DEFINITIONS
***************************************************************************/
typedef void (*driver_init_func)(running_machine *machine);
typedef void (*driver_init_func)(running_machine &machine);
struct game_driver
@ -73,7 +73,7 @@ struct game_driver
const char * manufacturer; /* manufacturer of the game */
machine_config_constructor machine_config; /* machine driver tokens */
const input_port_token *ipt; /* pointer to array of input port tokens */
void (*driver_init)(running_machine *machine); /* DRIVER_INIT callback */
void (*driver_init)(running_machine &machine); /* DRIVER_INIT callback */
const rom_entry * rom; /* pointer to list of ROMs for the game */
const char * compatible_with;
UINT32 flags; /* orientation and other flags; see defines below */
@ -88,7 +88,7 @@ struct game_driver
#define DRIVER_INIT_NAME(name) driver_init_##name
#define DRIVER_INIT(name) void DRIVER_INIT_NAME(name)(running_machine *machine)
#define DRIVER_INIT(name) void DRIVER_INIT_NAME(name)(running_machine &machine)
#define DRIVER_INIT_CALL(name) DRIVER_INIT_NAME(name)(machine)
#define driver_init_0 NULL

View File

@ -23,7 +23,7 @@
static MACHINE_START( empty )
{
/* force the UI to show the game select screen */
ui_menu_force_game_select(machine, &machine->render().ui_container());
ui_menu_force_game_select(machine, &machine.render().ui_container());
}

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