Cleanup of machine.h. Shuffled some fields around, and moved several

to private member variables with accessors:

machine->m_respool     ==> machine->respool()
machine->config        ==> machine->config()
machine->gamedrv       ==> machine->system()
machine->m_regionlist  ==> machine->first_region()
machine->sample_rate   ==> machine->sample_rate()

Also converted internal lists to use simple_list.
This commit is contained in:
Aaron Giles 2011-03-28 09:10:17 +00:00
parent 58f70e9184
commit af071893a6
148 changed files with 627 additions and 629 deletions

View File

@ -167,7 +167,7 @@ inline const char *number_and_format::format(astring &string) const
cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node &paramnode)
: m_value(0),
m_itemlist(manager.machine().m_respool)
m_itemlist(manager.machine().respool())
{
// read the core attributes
m_minval = number_and_format(xml_get_attribute_int(&paramnode, "min", 0), xml_get_attribute_int_format(&paramnode, "min"));
@ -347,7 +347,7 @@ bool cheat_parameter::set_next_state()
//-------------------------------------------------
cheat_script::cheat_script(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node &scriptnode)
: m_entrylist(manager.machine().m_respool),
: m_entrylist(manager.machine().respool()),
m_state(SCRIPT_STATE_RUN)
{
// read the core attributes
@ -433,7 +433,7 @@ cheat_script::script_entry::script_entry(cheat_manager &manager, symbol_table &s
: m_next(NULL),
m_condition(&symbols),
m_expression(&symbols),
m_arglist(manager.machine().m_respool)
m_arglist(manager.machine().respool())
{
const char *expression = NULL;
try
@ -1088,7 +1088,7 @@ cheat_script *&cheat_entry::script_for_state(script_state state)
cheat_manager::cheat_manager(running_machine &machine)
: m_machine(machine),
m_cheatlist(machine.m_respool),
m_cheatlist(machine.respool()),
m_disabled(true),
m_symtable(&machine)
{

View File

@ -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->gamedrv->source_file, '/');
srcfile = strrchr(machine->system().source_file, '/');
if (!srcfile)
srcfile = strrchr(machine->gamedrv->source_file, '\\');
srcfile = strrchr(machine->system().source_file, '\\');
if (!srcfile)
srcfile = strrchr(machine->gamedrv->source_file, ':');
srcfile = strrchr(machine->system().source_file, ':');
if (!srcfile)
srcfile = machine->gamedrv->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->gamedrv->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->gamedrv->name) != 0 &&
strcmp(name, machine->system().name) != 0 &&
strcmp(name, srcfile) != 0 &&
((clone_of = driver_get_clone(machine->gamedrv)) == 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;
@ -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->gamedrv->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

@ -84,8 +84,8 @@ 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->m_respool),
m_desc_allocator(cpu.machine->m_respool),
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))
{
}

View File

@ -154,8 +154,8 @@ drcuml_state::drcuml_state(device_t &device, drc_cache &cache, UINT32 flags, int
*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->m_respool),
m_symlist(device.machine->m_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)

View 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->gamedrv->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)

View File

@ -96,7 +96,7 @@ 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->gamedrv->name, machine->gamedrv->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);

View File

@ -337,7 +337,7 @@ 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->gamedrv->name);
xml_set_attribute(systemnode, "name", machine->system().name);
// for each device
bool found_comments = false;
@ -413,7 +413,7 @@ 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->gamedrv->name) != 0)
if (strcmp(name, machine->system().name) != 0)
throw emu_exception();
// iterate over devices

View File

@ -165,7 +165,7 @@ void debug_view_memory::enumerate_sources()
}
// then add all the memory regions
for (const memory_region *region = m_machine.m_regionlist.first(); region != NULL; region = region->next())
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)));

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)(*device->machine->m_nonspecific_space, 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)(*device->machine->m_nonspecific_space, offset, data, 0xff);
(target->*_Function)(*memory_nonspecific_space(device->machine), offset, data, 0xff);
}
#define DEVCB_NULL { DEVCB_TYPE_NULL }

View File

@ -81,7 +81,7 @@ resource_pool &machine_get_pool(running_machine &machine)
{
// temporary to get around include dependencies, until CPUs
// get a proper device class
return machine.m_respool;
return machine.respool();
}
@ -749,7 +749,7 @@ void device_t::start()
if (state_registrations == 0 && (interface(exec) || interface(sound)))
{
logerror("Device '%s' did not register any state to save!\n", tag());
if ((m_machine.gamedrv->flags & GAME_SUPPORTS_SAVE) != 0)
if ((m_machine.system().flags & GAME_SUPPORTS_SAVE) != 0)
fatalerror("Device '%s' did not register any state to save!", tag());
}

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->gamedrv;
gamedrv = &device().machine->system();
while(gamedrv && !try_change_working_directory(gamedrv->name))
{
gamedrv = driver_get_compatible(gamedrv);
@ -582,7 +582,7 @@ 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->gamedrv->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);
astring_free(fname);
@ -596,7 +596,7 @@ 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->gamedrv->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);
astring_free(fname);

View File

@ -81,7 +81,7 @@ INLINE INT32 normalize_yscroll(bitmap_t *bitmap, INT32 yscroll)
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 */

View File

@ -319,7 +319,6 @@ colortable_t *colortable_alloc(running_machine *machine, UINT32 palettesize)
UINT32 index;
assert(machine != NULL);
assert(machine->config != NULL);
assert(palettesize > 0);
/* allocate the colortable */
@ -583,9 +582,9 @@ static void allocate_palette(running_machine *machine, palette_private *palette)
/* determine the number of groups we need */
numgroups = 1;
if (machine->config->m_video_attributes & VIDEO_HAS_SHADOWS)
if (machine->config().m_video_attributes & VIDEO_HAS_SHADOWS)
palette->shadow_group = numgroups++;
if (machine->config->m_video_attributes & VIDEO_HAS_HIGHLIGHTS)
if (machine->config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS)
palette->hilight_group = numgroups++;
assert_always(machine->total_colors() * numgroups <= 65536, "Error: palette has more than 65536 colors.");
@ -680,7 +679,7 @@ static void allocate_color_tables(running_machine *machine, palette_private *pal
static void allocate_shadow_tables(running_machine *machine, palette_private *palette)
{
/* if we have shadows, allocate shadow tables */
if (machine->config->m_video_attributes & VIDEO_HAS_SHADOWS)
if (machine->config().m_video_attributes & VIDEO_HAS_SHADOWS)
{
pen_t *table = auto_alloc_array(machine, pen_t, 65536);
int i;
@ -703,7 +702,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
}
/* if we have hilights, allocate shadow tables */
if (machine->config->m_video_attributes & VIDEO_HAS_HIGHLIGHTS)
if (machine->config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS)
{
pen_t *table = auto_alloc_array(machine, pen_t, 65536);
int i;

View File

@ -176,7 +176,7 @@ static void image_options_extract(running_machine *machine)
/* write the config, if appropriate */
if (machine->options().write_config())
write_config(machine->options(), NULL, machine->gamedrv);
write_config(machine->options(), NULL, &machine->system());
}
/*-------------------------------------------------
@ -368,7 +368,7 @@ astring *image_info_astring(running_machine *machine, astring *string)
{
device_image_interface *image = NULL;
astring_printf(string, "%s\n\n", machine->gamedrv->description);
astring_printf(string, "%s\n\n", machine->system().description);
#if 0
if (mess_ram_size > 0)
@ -493,22 +493,22 @@ void image_add_device_with_subdevices(device_t *owner, device_type type, const c
{
astring tempstring;
device_list *device_list = &owner->machine->m_devicelist;
machine_config *config = (machine_config *)owner->machine->config;
machine_config &config = const_cast<machine_config &>(owner->machine->config());
device_config *devconfig = type(*config, owner->subtag(tempstring,tag), &owner->baseconfig(), clock);
device_config *devconfig = type(config, owner->subtag(tempstring,tag), &owner->baseconfig(), clock);
device_t &device = device_list->append(devconfig->tag(), *devconfig->alloc_device(*owner->machine));
machine_config_constructor machconfig = device.machine_config_additions();
if (machconfig != NULL)
{
(*machconfig)(*config, devconfig);
for (const device_config *config_dev = config->m_devicelist.first(); config_dev != NULL; config_dev = config_dev->next())
(*machconfig)(config, devconfig);
for (const device_config *config_dev = config.m_devicelist.first(); config_dev != NULL; config_dev = config_dev->next())
{
if (config_dev->owner()==devconfig) {
device_list->append(config_dev->tag(), *config_dev->alloc_device(*owner->machine));
}
}
}
config->m_devicelist.append(devconfig->tag(), *devconfig);
config.m_devicelist.append(devconfig->tag(), *devconfig);
}

View File

@ -169,7 +169,7 @@ static int process_cartridge(device_image_interface *image, process_mode mode)
const rom_entry *romrgn, *roment;
int result = 0;
for (source = rom_first_source(*image->device().machine->config); source != NULL; source = rom_next_source(*source))
for (source = rom_first_source(image->device().machine->config()); source != NULL; source = rom_next_source(*source))
{
for (romrgn = rom_first_region(*source); romrgn != NULL; romrgn = rom_next_region(romrgn))
{
@ -303,7 +303,7 @@ static DEVICE_IMAGE_LOAD( cartslot )
return (*config->device_load)(image);
/* try opening this as if it were a multicart */
multicart_open(device->machine->options(), image.filename(), device->machine->gamedrv->name, MULTICART_FLAGS_LOAD_RESOURCES, &cart->mc);
multicart_open(device->machine->options(), image.filename(), device->machine->system().name, MULTICART_FLAGS_LOAD_RESOURCES, &cart->mc);
if (cart->mc == NULL)
{
@ -360,7 +360,7 @@ static const cartslot_pcb_type *identify_pcb(device_image_interface &image)
if (image.software_entry() == NULL && image.exists())
{
/* try opening this as if it were a multicart */
multicart_open_error me = multicart_open(image.device().machine->options(), image.filename(), image.device().machine->gamedrv->name, MULTICART_FLAGS_DONT_LOAD_RESOURCES, &mc);
multicart_open_error me = multicart_open(image.device().machine->options(), image.filename(), image.device().machine->system().name, MULTICART_FLAGS_DONT_LOAD_RESOURCES, &mc);
if (me == MCERR_NONE)
{
/* this was a multicart - read from it */

View File

@ -4547,8 +4547,8 @@ static time_t playback_init(running_machine *machine)
mame_printf_info("Recorded using %s\n", header + 0x20);
/* verify the header against the current game */
if (memcmp(machine->gamedrv->name, header + 0x14, strlen(machine->gamedrv->name) + 1) != 0)
mame_printf_info("Input file is for " GAMENOUN " '%s', not for current " GAMENOUN " '%s'\n", header + 0x14, machine->gamedrv->name);
if (memcmp(machine->system().name, header + 0x14, strlen(machine->system().name) + 1) != 0)
mame_printf_info("Input file is for " GAMENOUN " '%s', not for current " GAMENOUN " '%s'\n", header + 0x14, machine->system().name);
/* enable compression */
portdata->playback_file->compress(FCOMPRESS_MEDIUM);
@ -4744,7 +4744,7 @@ static void record_init(running_machine *machine)
header[0x0f] = systime.time >> 56;
header[0x10] = INP_HEADER_MAJVERSION;
header[0x11] = INP_HEADER_MINVERSION;
strcpy((char *)header + 0x14, machine->gamedrv->name);
strcpy((char *)header + 0x14, machine->system().name);
sprintf((char *)header + 0x20, APPNAME " %s", build_version);
/* write it */

View File

@ -139,22 +139,15 @@ static char giant_string_buffer[65536] = { 0 };
//-------------------------------------------------
running_machine::running_machine(const machine_config &_config, osd_interface &osd, bool exit_to_game_select)
: m_regionlist(m_respool),
m_devicelist(m_respool),
config(&_config),
m_config(_config),
: m_devicelist(m_respool),
firstcpu(NULL),
gamedrv(&_config.gamedrv()),
m_game(_config.gamedrv()),
primary_screen(NULL),
palette(NULL),
pens(NULL),
colortable(NULL),
shadow_table(NULL),
priority_bitmap(NULL),
sample_rate(_config.options().sample_rate()),
debug_flags(0),
ui_active(false),
memory_data(NULL),
palette_data(NULL),
tilemap_data(NULL),
@ -166,11 +159,19 @@ running_machine::running_machine(const machine_config &_config, osd_interface &o
generic_machine_data(NULL),
generic_video_data(NULL),
generic_audio_data(NULL),
m_logerror_list(NULL),
m_config(_config),
m_system(_config.gamedrv()),
m_osd(osd),
m_regionlist(m_respool),
m_state(*this),
m_scheduler(*this),
m_osd(osd),
m_basename(_config.gamedrv().name),
m_cheat(NULL),
m_render(NULL),
m_sound(NULL),
m_video(NULL),
m_debug_view(NULL),
m_driver_device(NULL),
m_current_phase(MACHINE_PHASE_PREINIT),
m_paused(false),
m_hard_reset_pending(false),
@ -178,21 +179,18 @@ running_machine::running_machine(const machine_config &_config, osd_interface &o
m_exit_to_game_select(exit_to_game_select),
m_new_driver_pending(NULL),
m_soft_reset_timer(NULL),
m_rand_seed(0x9d14abd7),
m_ui_active(false),
m_basename(_config.gamedrv().name),
m_sample_rate(_config.options().sample_rate()),
m_logfile(NULL),
m_saveload_schedule(SLS_NONE),
m_saveload_schedule_time(attotime::zero),
m_saveload_searchpath(NULL),
m_rand_seed(0x9d14abd7),
m_driver_device(NULL),
m_cheat(NULL),
m_render(NULL),
m_sound(NULL),
m_video(NULL),
m_debug_view(NULL)
m_logerror_list(m_respool)
{
memset(gfx, 0, sizeof(gfx));
memset(&generic, 0, sizeof(generic));
memset(m_notifier_list, 0, sizeof(m_notifier_list));
memset(&m_base_time, 0, sizeof(m_base_time));
// find the driver device config and tell it which game
@ -284,7 +282,7 @@ void running_machine::start()
// initialize the input system and input ports for the game
// this must be done before memory_init in order to allow specifying
// callbacks based on input port tags
time_t newbase = input_port_init(this, m_game.ipt, m_config.m_devicelist);
time_t newbase = input_port_init(this, m_system.ipt, m_config.m_devicelist);
if (newbase != 0)
m_base_time = newbase;
@ -332,7 +330,7 @@ void running_machine::start()
schedule_load(savegame);
// if we're in autosave mode, schedule a load
else if (options().autosave() && (m_game.flags & GAME_SUPPORTS_SAVE) != 0)
else if (options().autosave() && (m_system.flags & GAME_SUPPORTS_SAVE) != 0)
schedule_load("auto");
// set up the cheat engine
@ -458,7 +456,7 @@ void running_machine::schedule_exit()
m_scheduler.eat_all_cycles();
// if we're autosaving on exit, schedule a save as well
if (options().autosave() && (m_game.flags & GAME_SUPPORTS_SAVE) && this->time() > attotime::zero)
if (options().autosave() && (m_system.flags & GAME_SUPPORTS_SAVE) && this->time() > attotime::zero)
schedule_save("auto");
}
@ -637,19 +635,11 @@ void running_machine::add_notifier(machine_notification event, notify_callback c
// exit notifiers are added to the head, and executed in reverse order
if (event == MACHINE_NOTIFY_EXIT)
{
notifier_callback_item *notifier = auto_alloc(this, notifier_callback_item(callback));
notifier->m_next = m_notifier_list[event];
m_notifier_list[event] = notifier;
}
m_notifier_list[event].prepend(*global_alloc(notifier_callback_item(callback)));
// all other notifiers are added to the tail, and executed in the order registered
else
{
notifier_callback_item **tailptr;
for (tailptr = &m_notifier_list[event]; *tailptr != NULL; tailptr = &(*tailptr)->m_next) ;
*tailptr = auto_alloc(this, notifier_callback_item(callback));
}
m_notifier_list[event].append(*global_alloc(notifier_callback_item(callback)));
}
@ -661,10 +651,7 @@ void running_machine::add_notifier(machine_notification event, notify_callback c
void running_machine::add_logerror_callback(logerror_callback callback)
{
assert_always(m_current_phase == MACHINE_PHASE_INIT, "Can only call add_logerror_callback at init time!");
logerror_callback_item **tailptr;
for (tailptr = &m_logerror_list; *tailptr != NULL; tailptr = &(*tailptr)->m_next) ;
*tailptr = auto_alloc(this, logerror_callback_item(callback));
m_logerror_list.append(*auto_alloc(this, logerror_callback_item(callback)));
}
@ -675,7 +662,7 @@ void running_machine::add_logerror_callback(logerror_callback callback)
void CLIB_DECL running_machine::logerror(const char *format, ...)
{
// process only if there is a target
if (m_logerror_list != NULL)
if (m_logerror_list.first() != NULL)
{
va_list arg;
va_start(arg, format);
@ -692,7 +679,7 @@ void CLIB_DECL running_machine::logerror(const char *format, ...)
void CLIB_DECL running_machine::vlogerror(const char *format, va_list args)
{
// process only if there is a target
if (m_logerror_list != NULL)
if (m_logerror_list.first() != NULL)
{
g_profiler.start(PROFILER_LOGERROR);
@ -700,7 +687,7 @@ void CLIB_DECL running_machine::vlogerror(const char *format, va_list args)
vsnprintf(giant_string_buffer, ARRAY_LENGTH(giant_string_buffer), format, args);
// log to all callbacks
for (logerror_callback_item *cb = m_logerror_list; cb != NULL; cb = cb->m_next)
for (logerror_callback_item *cb = m_logerror_list.first(); cb != NULL; cb = cb->next())
(*cb->m_func)(*this, giant_string_buffer);
g_profiler.stop();
@ -752,7 +739,7 @@ UINT32 running_machine::rand()
void running_machine::call_notifiers(machine_notification which)
{
for (notifier_callback_item *cb = m_notifier_list[which]; cb != NULL; cb = cb->m_next)
for (notifier_callback_item *cb = m_notifier_list[which].first(); cb != NULL; cb = cb->next())
(*cb->m_func)(*this);
}
@ -814,7 +801,7 @@ void running_machine::handle_saveload()
break;
case STATERR_NONE:
if (!(m_game.flags & GAME_SUPPORTS_SAVE))
if (!(m_system.flags & GAME_SUPPORTS_SAVE))
popmessage("State successfully %s.\nWarning: Save states are not officially supported for this game.", opnamed);
else
popmessage("State successfully %s.", opnamed);
@ -942,7 +929,7 @@ running_machine::logerror_callback_item::logerror_callback_item(logerror_callbac
driver_device_config_base::driver_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner)
: device_config(mconfig, type, "Driver Device", tag, owner, 0),
m_game(NULL),
m_system(NULL),
m_palette_init(NULL)
{
memset(m_callbacks, 0, sizeof(m_callbacks));
@ -956,7 +943,7 @@ driver_device_config_base::driver_device_config_base(const machine_config &mconf
void driver_device_config_base::static_set_game(device_config *device, const game_driver *game)
{
downcast<driver_device_config_base *>(device)->m_game = game;
downcast<driver_device_config_base *>(device)->m_system = game;
downcast<driver_device_config_base *>(device)->m_shortname = game->name;
}
@ -992,7 +979,7 @@ void driver_device_config_base::static_set_palette_init(device_config *device, p
const rom_entry *driver_device_config_base::rom_region() const
{
return m_game->rom;
return m_system->rom;
}
@ -1146,8 +1133,8 @@ void driver_device::device_start()
throw device_missing_dependencies();
// call the game-specific init
if (m_config.m_game->driver_init != NULL)
(*m_config.m_game->driver_init)(&m_machine);
if (m_config.m_system->driver_init != NULL)
(*m_config.m_system->driver_init)(&m_machine);
// finish image devices init process
image_postdevice_init(&m_machine);

View File

@ -153,11 +153,11 @@ const int DEBUG_FLAG_OSD_ENABLED = 0x00001000; // The OSD debugger is enabled
// global allocation helpers
#define auto_alloc(m, t) pool_alloc(static_cast<running_machine *>(m)->m_respool, t)
#define auto_alloc_clear(m, t) pool_alloc_clear(static_cast<running_machine *>(m)->m_respool, t)
#define auto_alloc_array(m, t, c) pool_alloc_array(static_cast<running_machine *>(m)->m_respool, t, c)
#define auto_alloc_array_clear(m, t, c) pool_alloc_array_clear(static_cast<running_machine *>(m)->m_respool, t, c)
#define auto_free(m, v) pool_free(static_cast<running_machine *>(m)->m_respool, v)
#define auto_alloc(m, t) pool_alloc(static_cast<running_machine *>(m)->respool(), t)
#define auto_alloc_clear(m, t) pool_alloc_clear(static_cast<running_machine *>(m)->respool(), t)
#define auto_alloc_array(m, t, c) pool_alloc_array(static_cast<running_machine *>(m)->respool(), t, c)
#define auto_alloc_array_clear(m, t, c) pool_alloc_array_clear(static_cast<running_machine *>(m)->respool(), t, c)
#define auto_free(m, v) pool_free(static_cast<running_machine *>(m)->respool(), v)
#define auto_bitmap_alloc(m, w, h, f) auto_alloc(m, bitmap_t(w, h, f))
#define auto_strdup(m, s) strcpy(auto_alloc_array(m, char, strlen(s) + 1), s)
@ -316,15 +316,50 @@ class running_machine : public bindable_object
DISABLE_COPYING(running_machine);
friend void debugger_init(running_machine *machine);
friend class sound_manager;
typedef void (*notify_callback)(running_machine &machine);
typedef void (*logerror_callback)(running_machine &machine, const char *string);
// must be at top of member variables
resource_pool m_respool; // pool of resources for this machine
public:
// construction/destruction
running_machine(const machine_config &config, osd_interface &osd, bool exit_to_game_select = false);
~running_machine();
// getters
const machine_config &config() const { return m_config; }
const game_driver &system() const { return m_system; }
osd_interface &osd() const { return m_osd; }
resource_pool &respool() { return m_respool; }
device_scheduler &scheduler() { return m_scheduler; }
state_manager &state() { return m_state; }
cheat_manager &cheat() const { assert(m_cheat != NULL); return *m_cheat; }
render_manager &render() const { assert(m_render != NULL); return *m_render; }
sound_manager &sound() const { assert(m_sound != NULL); return *m_sound; }
video_manager &video() const { assert(m_video != NULL); return *m_video; }
debug_view_manager &debug_view() const { assert(m_debug_view != NULL); return *m_debug_view; }
driver_device *driver_data() const { return m_driver_device; }
template<class T> T *driver_data() const { return downcast<T *>(m_driver_device); }
machine_phase phase() const { return m_current_phase; }
bool paused() const { return m_paused || (m_current_phase != MACHINE_PHASE_RUNNING); }
bool exit_pending() const { return m_exit_pending; }
bool new_driver_pending() const { return (m_new_driver_pending != NULL); }
const char *new_driver_name() const { return m_new_driver_pending->name; }
bool ui_active() const { return m_ui_active; }
const char *basename() const { return m_basename; }
int sample_rate() const { return m_sample_rate; }
bool save_or_load_pending() const { return m_saveload_pending_file; }
screen_device *first_screen() const { return primary_screen; }
// additional helpers
emu_options &options() const { return m_config.options(); }
memory_region *first_region() const { return m_regionlist.first(); }
attotime time() const { return m_scheduler.time(); }
bool scheduled_event_pending() const { return m_exit_pending || m_hard_reset_pending; }
// fetch items by name
inline device_t *device(const char *tag);
template<class T> inline T *device(const char *tag) { return downcast<T *>(device(tag)); }
@ -334,22 +369,6 @@ public:
// configuration helpers
UINT32 total_colors() const { return m_config.m_total_colors; }
// getters
const char *basename() const { return m_basename; }
emu_options &options() const { return m_config.options(); }
machine_phase phase() const { return m_current_phase; }
bool paused() const { return m_paused || (m_current_phase != MACHINE_PHASE_RUNNING); }
bool scheduled_event_pending() const { return m_exit_pending || m_hard_reset_pending; }
bool save_or_load_pending() const { return (m_saveload_pending_file); }
bool exit_pending() const { return m_exit_pending; }
bool new_driver_pending() const { return (m_new_driver_pending != NULL); }
const char *new_driver_name() const { return m_new_driver_pending->name; }
state_manager &state() { return m_state; }
device_scheduler &scheduler() { return m_scheduler; }
osd_interface &osd() const { return m_osd; }
screen_device *first_screen() const { return primary_screen; }
attotime time() const { return m_scheduler.time(); }
// immediate operations
int run(bool firstrun);
void pause();
@ -357,6 +376,7 @@ public:
void add_notifier(machine_notification event, notify_callback callback);
void call_notifiers(machine_notification which);
void add_logerror_callback(logerror_callback callback);
void set_ui_active(bool active) { m_ui_active = active; }
// scheduled operations
void schedule_exit();
@ -374,13 +394,6 @@ public:
memory_region *region_alloc(const char *name, UINT32 length, UINT8 width, endianness_t endian);
void region_free(const char *name);
// managers
cheat_manager &cheat() const { assert(m_cheat != NULL); return *m_cheat; }
render_manager &render() const { assert(m_render != NULL); return *m_render; }
sound_manager &sound() const { assert(m_sound != NULL); return *m_sound; }
video_manager &video() const { assert(m_video != NULL); return *m_video; }
debug_view_manager &debug_view() const { assert(m_debug_view != NULL); return *m_debug_view; }
// misc
void CLIB_DECL logerror(const char *format, ...);
void CLIB_DECL vlogerror(const char *format, va_list args);
@ -388,22 +401,11 @@ public:
const char *describe_context();
// internals
resource_pool m_respool; // pool of resources for this machine
region_list m_regionlist; // list of memory regions
device_list m_devicelist; // list of running devices
// configuration data
const machine_config * config; // points to the constructed machine_config
const machine_config & m_config; // points to the constructed machine_config
ioport_list m_portlist; // points to a list of input port configurations
// CPU information
cpu_device * firstcpu; // first CPU (allows for quick iteration via typenext)
address_space * m_nonspecific_space;// a dummy address_space used for legacy compatibility
// game-related information
const game_driver * gamedrv; // points to the definition of the game machine
const game_driver & m_game; // points to the definition of the game machine
// video-related information
gfx_element * gfx[MAX_GFX_ELEMENTS];// array of pointers to graphic sets (chars, sprites)
@ -416,15 +418,9 @@ public:
pen_t * shadow_table; // table for looking up a shadowed pen
bitmap_t * priority_bitmap; // priority bitmap
// audio-related information
int sample_rate; // the digital audio sample rate
// debugger-related information
UINT32 debug_flags; // the current debug flags
// UI-related
bool ui_active; // ui active or not (useful for games / systems with keyboard inputs)
// generic pointers
generic_pointers generic; // generic pointers
@ -441,56 +437,56 @@ public:
generic_video_private * generic_video_data; // internal data from video/generic.c
generic_audio_private * generic_audio_data; // internal data from audio/generic.c
// driver-specific information
driver_device *driver_data() const { return m_driver_device; }
template<class T>
T *driver_data() const { return downcast<T *>(m_driver_device); }
private:
// internal helpers
void start();
void set_saveload_filename(const char *filename);
void fill_systime(system_time &systime, time_t t);
void handle_saveload();
void soft_reset(running_machine &machine, int param = 0);
// internal callbacks
static void logfile_callback(running_machine &machine, const char *buffer);
// internal state
const machine_config & m_config; // reference to the constructed machine_config
const game_driver & m_system; // reference to the definition of the game machine
osd_interface & m_osd; // reference to OSD system
// notifier callbacks
struct notifier_callback_item
{
notifier_callback_item(notify_callback func);
notifier_callback_item * m_next;
notify_callback m_func;
};
notifier_callback_item *m_notifier_list[MACHINE_NOTIFY_COUNT];
// embedded managers and objects
region_list m_regionlist; // list of memory regions
state_manager m_state; // state manager
device_scheduler m_scheduler; // scheduler object
// logerror callbacks
struct logerror_callback_item
{
logerror_callback_item(logerror_callback func);
logerror_callback_item * m_next;
logerror_callback m_func;
};
logerror_callback_item *m_logerror_list;
// managers
cheat_manager * m_cheat; // internal data from cheat.c
render_manager * m_render; // internal data from render.c
sound_manager * m_sound; // internal data from sound.c
video_manager * m_video; // internal data from video.c
debug_view_manager * m_debug_view; // internal data from debugvw.c
state_manager m_state; // state manager
device_scheduler m_scheduler; // scheduler object
osd_interface & m_osd;
// driver state
driver_device * m_driver_device; // pointer to the current driver device
astring m_context; // context string
astring m_basename; // basename used for game-related paths
// system state
machine_phase m_current_phase; // current execution phase
bool m_paused; // paused?
bool m_hard_reset_pending; // is a hard reset pending?
bool m_exit_pending; // is an exit pending?
bool m_exit_to_game_select; // when we exit, go we go back to the game select?
const game_driver * m_new_driver_pending; // pointer to the next pending driver
emu_timer * m_soft_reset_timer; // timer used to schedule a soft reset
machine_phase m_current_phase;
bool m_paused;
bool m_hard_reset_pending;
bool m_exit_pending;
bool m_exit_to_game_select;
const game_driver * m_new_driver_pending;
emu_timer * m_soft_reset_timer;
emu_file * m_logfile;
// misc state
UINT32 m_rand_seed; // current random number seed
bool m_ui_active; // ui active or not (useful for games / systems with keyboard inputs)
time_t m_base_time; // real time at initial emulation time
astring m_basename; // basename used for game-related paths
astring m_context; // context string buffer
int m_sample_rate; // the digital audio sample rate
emu_file * m_logfile; // pointer to the active log file
// load/save
// load/save management
enum saveload_schedule
{
SLS_NONE,
@ -502,18 +498,36 @@ private:
astring m_saveload_pending_file;
const char * m_saveload_searchpath;
// random number seed
UINT32 m_rand_seed;
// notifier callbacks
struct notifier_callback_item
{
// construction/destruction
notifier_callback_item(notify_callback func);
// base time
time_t m_base_time;
// getters
notifier_callback_item *next() const { return m_next; }
// state
notifier_callback_item * m_next;
notify_callback m_func;
};
simple_list<notifier_callback_item> m_notifier_list[MACHINE_NOTIFY_COUNT];
driver_device * m_driver_device;
cheat_manager * m_cheat; // internal data from cheat.c
render_manager * m_render; // internal data from render.c
sound_manager * m_sound; // internal data from sound.c
video_manager * m_video; // internal data from video.c
debug_view_manager * m_debug_view; // internal data from debugvw.c
// logerror callbacks
class logerror_callback_item
{
public:
// construction/destruction
logerror_callback_item(logerror_callback func);
// getters
logerror_callback_item *next() const { return m_next; }
// state
logerror_callback_item * m_next;
logerror_callback m_func;
};
simple_list<logerror_callback_item> m_logerror_list;
};
@ -552,7 +566,7 @@ protected:
virtual const rom_entry *rom_region() const;
// internal state
const game_driver * m_game; // pointer to the game driver
const game_driver * m_system; // pointer to the game driver
legacy_callback_func m_callbacks[CB_COUNT]; // generic legacy callbacks
palette_init_func m_palette_init; // one-time palette init callback

View File

@ -115,7 +115,7 @@ void generic_machine_init(running_machine *machine)
config_register(machine, "counters", counters_load, counters_save);
/* for memory cards, request save state and an exit callback */
if (machine->config->m_memcard_handler != NULL)
if (machine->config().m_memcard_handler != NULL)
{
state_save_register_global(machine, state->memcard_inserted);
machine->add_notifier(MACHINE_NOTIFY_EXIT, memcard_eject);
@ -319,7 +319,7 @@ void nvram_load(running_machine *machine)
{
// only need to do something if we have an NVRAM device or an nvram_handler
device_nvram_interface *nvram = NULL;
if (!machine->m_devicelist.first(nvram) && machine->config->m_nvram_handler == NULL)
if (!machine->m_devicelist.first(nvram) && machine->config().m_nvram_handler == NULL)
return;
// open the file; if it exists, call everyone to read from it
@ -327,8 +327,8 @@ void nvram_load(running_machine *machine)
if (file.open(machine->basename(), ".nv") == FILERR_NONE)
{
// read data from general NVRAM handler first
if (machine->config->m_nvram_handler != NULL)
(*machine->config->m_nvram_handler)(machine, &file, FALSE);
if (machine->config().m_nvram_handler != NULL)
(*machine->config().m_nvram_handler)(machine, &file, FALSE);
// find all devices with NVRAM handlers, and read from them next
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
@ -339,8 +339,8 @@ void nvram_load(running_machine *machine)
else
{
// initialize via the general NVRAM handler first
if (machine->config->m_nvram_handler != NULL)
(*machine->config->m_nvram_handler)(machine, NULL, FALSE);
if (machine->config().m_nvram_handler != NULL)
(*machine->config().m_nvram_handler)(machine, NULL, FALSE);
// find all devices with NVRAM handlers, and read from them next
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
@ -357,7 +357,7 @@ void nvram_save(running_machine *machine)
{
// only need to do something if we have an NVRAM device or an nvram_handler
device_nvram_interface *nvram = NULL;
if (!machine->m_devicelist.first(nvram) && machine->config->m_nvram_handler == NULL)
if (!machine->m_devicelist.first(nvram) && machine->config().m_nvram_handler == NULL)
return;
// open the file; if it exists, call everyone to read from it
@ -365,8 +365,8 @@ void nvram_save(running_machine *machine)
if (file.open(machine->basename(), ".nv") == FILERR_NONE)
{
// write data via general NVRAM handler first
if (machine->config->m_nvram_handler != NULL)
(*machine->config->m_nvram_handler)(machine, &file, TRUE);
if (machine->config().m_nvram_handler != NULL)
(*machine->config().m_nvram_handler)(machine, &file, TRUE);
// find all devices with NVRAM handlers, and tell them to write next
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
@ -419,8 +419,8 @@ int memcard_create(running_machine *machine, int index, int overwrite)
return 1;
/* initialize and then save the card */
if (machine->config->m_memcard_handler)
(*machine->config->m_memcard_handler)(machine, file, MEMCARD_CREATE);
if (machine->config().m_memcard_handler)
(*machine->config().m_memcard_handler)(machine, file, MEMCARD_CREATE);
/* close the file */
return 0;
@ -452,8 +452,8 @@ int memcard_insert(running_machine *machine, int index)
return 1;
/* initialize and then load the card */
if (machine->config->m_memcard_handler)
(*machine->config->m_memcard_handler)(machine, file, MEMCARD_INSERT);
if (machine->config().m_memcard_handler)
(*machine->config().m_memcard_handler)(machine, file, MEMCARD_INSERT);
/* close the file */
state->memcard_inserted = index;
@ -485,8 +485,8 @@ void memcard_eject(running_machine &machine)
return;
/* initialize and then load the card */
if (machine.m_config.m_memcard_handler)
(*machine.m_config.m_memcard_handler)(&machine, file, MEMCARD_EJECT);
if (machine.config().m_memcard_handler)
(*machine.config().m_memcard_handler)(&machine, file, MEMCARD_EJECT);
/* close the file */
state->memcard_inserted = -1;

View File

@ -1793,7 +1793,6 @@ static DEVICE_START( ide_controller )
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
assert(device->machine != NULL);
assert(device->machine->config != NULL);
/* store a pointer back to the device */
ide->device = device;

View File

@ -272,7 +272,6 @@ static DEVICE_START( pci_bus )
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
assert(device->machine != NULL);
assert(device->machine->config != NULL);
/* store a pointer back to the device */
pcibus->config = (const pci_bus_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();

View File

@ -517,7 +517,6 @@ static DEVICE_START( smc91c9x )
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
assert(device->machine != NULL);
assert(device->machine->config != NULL);
/* store a pointer back to the device */
smc->device = device;

View File

@ -1593,13 +1593,16 @@ void memory_init(running_machine *machine)
// dump the final memory configuration
generate_memdump(machine);
// borrow the first address space to be used as a dummy space
machine->m_nonspecific_space = memdata->spacelist.first();
// we are now initialized
memdata->initialized = true;
}
address_space *memory_nonspecific_space(running_machine *machine)
{
memory_private *memdata = machine->memory_data;
return memdata->spacelist.first();
}
//**************************************************************************
@ -4078,7 +4081,7 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen
// register for saving, but only if we're not part of a memory region
const memory_region *region;
for (region = space.m_machine.m_regionlist.first(); region != NULL; region = region->next())
for (region = space.m_machine.first_region(); region != NULL; region = region->next())
if (m_data >= region->base() && (m_data + (byteend - bytestart + 1)) < region->end())
{
VPRINTF(("skipping save of this memory block as it is covered by a memory region\n"));

View File

@ -739,6 +739,7 @@ void *memory_get_shared(running_machine &machine, const char *tag, size_t &lengt
// dump the internal memory tables to the given file
void memory_dump(running_machine *machine, FILE *file);
address_space *memory_nonspecific_space(running_machine *machine);
//**************************************************************************

View File

@ -702,8 +702,8 @@ const rgb_t *render_texture::get_adjusted_palette(render_container &container)
render_container::render_container(render_manager &manager, screen_device *screen)
: m_next(NULL),
m_manager(manager),
m_itemlist(manager.machine().m_respool),
m_item_allocator(manager.machine().m_respool),
m_itemlist(manager.machine().respool()),
m_item_allocator(manager.machine().respool()),
m_screen(screen),
m_overlaybitmap(NULL),
m_overlaytexture(NULL),
@ -720,7 +720,7 @@ render_container::render_container(render_manager &manager, screen_device *scree
if (screen != NULL)
{
// set the initial orientation and brightness/contrast/gamma
m_user.m_orientation = manager.machine().gamedrv->flags & ORIENTATION_MASK;
m_user.m_orientation = manager.machine().system().flags & ORIENTATION_MASK;
m_user.m_brightness = manager.machine().options().brightness();
m_user.m_contrast = manager.machine().options().contrast();
m_user.m_gamma = manager.machine().options().gamma();
@ -1051,7 +1051,7 @@ render_target::render_target(render_manager &manager, const char *layoutfile, UI
: m_next(NULL),
m_manager(manager),
m_curview(NULL),
m_filelist(*auto_alloc(&manager.machine(), simple_list<layout_file>(manager.machine().m_respool))),
m_filelist(*auto_alloc(&manager.machine(), simple_list<layout_file>(manager.machine().respool()))),
m_flags(flags),
m_listindex(0),
m_width(640),
@ -1063,7 +1063,7 @@ render_target::render_target(render_manager &manager, const char *layoutfile, UI
m_base_orientation(ROT0),
m_maxtexwidth(65536),
m_maxtexheight(65536),
m_debug_containers(manager.machine().m_respool)
m_debug_containers(manager.machine().respool())
{
// determine the base layer configuration based on options
m_base_layerconfig.set_backdrops_enabled(manager.machine().options().use_backdrops());
@ -1074,12 +1074,12 @@ render_target::render_target(render_manager &manager, const char *layoutfile, UI
// determine the base orientation based on options
m_orientation = ROT0;
if (!manager.machine().options().rotate())
m_base_orientation = orientation_reverse(manager.machine().gamedrv->flags & ORIENTATION_MASK);
m_base_orientation = orientation_reverse(manager.machine().system().flags & ORIENTATION_MASK);
// rotate left/right
if (manager.machine().options().ror() || (manager.machine().options().auto_ror() && (manager.machine().gamedrv->flags & ORIENTATION_SWAP_XY)))
if (manager.machine().options().ror() || (manager.machine().options().auto_ror() && (manager.machine().system().flags & ORIENTATION_SWAP_XY)))
m_base_orientation = orientation_add(ROT90, m_base_orientation);
if (manager.machine().options().rol() || (manager.machine().options().auto_rol() && (manager.machine().gamedrv->flags & ORIENTATION_SWAP_XY)))
if (manager.machine().options().rol() || (manager.machine().options().auto_rol() && (manager.machine().system().flags & ORIENTATION_SWAP_XY)))
m_base_orientation = orientation_add(ROT270, m_base_orientation);
// flip X/Y
@ -1631,18 +1631,18 @@ void render_target::load_layout_files(const char *layoutfile, bool singlefile)
return;
// try to load a file based on the driver name
const game_driver *gamedrv = m_manager.machine().gamedrv;
if (!load_layout_file(basename, gamedrv->name))
const game_driver &system = m_manager.machine().system();
if (!load_layout_file(basename, system.name))
load_layout_file(basename, "default");
// if a default view has been specified, use that as a fallback
if (gamedrv->default_layout != NULL)
load_layout_file(NULL, gamedrv->default_layout);
if (m_manager.machine().m_config.m_default_layout != NULL)
load_layout_file(NULL, m_manager.machine().m_config.m_default_layout);
if (system.default_layout != NULL)
load_layout_file(NULL, system.default_layout);
if (m_manager.machine().config().m_default_layout != NULL)
load_layout_file(NULL, m_manager.machine().config().m_default_layout);
// try to load another file based on the parent driver name
const game_driver *cloneof = driver_get_clone(gamedrv);
const game_driver *cloneof = driver_get_clone(&system);
if (cloneof != NULL)
if (!load_layout_file(cloneof->name, cloneof->name))
load_layout_file(cloneof->name, "default");
@ -1650,7 +1650,7 @@ void render_target::load_layout_files(const char *layoutfile, bool singlefile)
// now do the built-in layouts for single-screen games
if (m_manager.machine().m_devicelist.count(SCREEN) == 1)
{
if (gamedrv->flags & ORIENTATION_SWAP_XY)
if (system.flags & ORIENTATION_SWAP_XY)
load_layout_file(NULL, layout_vertical);
else
load_layout_file(NULL, layout_horizont);
@ -2454,12 +2454,12 @@ done:
render_manager::render_manager(running_machine &machine)
: m_machine(machine),
m_targetlist(machine.m_respool),
m_targetlist(machine.respool()),
m_ui_target(NULL),
m_live_textures(0),
m_texture_allocator(machine.m_respool),
m_texture_allocator(machine.respool()),
m_ui_container(auto_alloc(&machine, render_container(*this))),
m_screen_container_list(machine.m_respool)
m_screen_container_list(machine.respool())
{
// register callbacks
config_register(&machine, "video", config_load_static, config_save_static);

View File

@ -196,9 +196,9 @@ static int get_variable_value(running_machine &machine, const char *string, char
char temp[100];
// screen 0 parameters
for (const screen_device_config *devconfig = machine.m_config.first_screen(); devconfig != NULL; devconfig = devconfig->next_screen())
for (const screen_device_config *devconfig = machine.config().first_screen(); devconfig != NULL; devconfig = devconfig->next_screen())
{
int scrnum = machine.m_config.m_devicelist.indexof(SCREEN, devconfig->tag());
int scrnum = machine.config().m_devicelist.indexof(SCREEN, devconfig->tag());
// native X aspect factor
sprintf(temp, "~scr%dnativexaspect~", scrnum);
@ -434,7 +434,7 @@ static void parse_orientation(running_machine &machine, xml_data_node *orientnod
layout_element::layout_element(running_machine &machine, xml_data_node &elemnode, const char *dirname)
: m_next(NULL),
m_machine(machine),
m_complist(machine.m_respool),
m_complist(machine.respool()),
m_defstate(0),
m_maxstate(0),
m_elemtex(NULL)
@ -1665,11 +1665,11 @@ layout_view::layout_view(running_machine &machine, xml_data_node &viewnode, simp
: m_next(NULL),
m_aspect(1.0f),
m_scraspect(1.0f),
m_screens(machine.m_respool),
m_backdrop_list(machine.m_respool),
m_screen_list(machine.m_respool),
m_overlay_list(machine.m_respool),
m_bezel_list(machine.m_respool)
m_screens(machine.respool()),
m_backdrop_list(machine.respool()),
m_screen_list(machine.respool()),
m_overlay_list(machine.respool()),
m_bezel_list(machine.respool())
{
// allocate a copy of the name
m_name = xml_get_attribute_string_with_subst(machine, viewnode, "name", "");
@ -1931,8 +1931,8 @@ int layout_view::item::state() const
layout_file::layout_file(running_machine &machine, xml_data_node &rootnode, const char *dirname)
: m_next(NULL),
m_elemlist(machine.m_respool),
m_viewlist(machine.m_respool)
m_elemlist(machine.respool()),
m_viewlist(machine.respool())
{
// find the layout node
xml_data_node *mamelayoutnode = xml_get_sibling(rootnode.child, "mamelayout");

View File

@ -338,7 +338,7 @@ static void determine_bios_rom(rom_load_data *romdata)
romdata->system_bios = 0;
for (const rom_source *source = rom_first_source(*romdata->machine->config); source != NULL; source = rom_next_source(*source))
for (const rom_source *source = rom_first_source(romdata->machine->config()); source != NULL; source = rom_next_source(*source))
{
/* first determine the default BIOS name */
for (rom = source->rom_region(); !ROMENTRY_ISEND(rom); rom++)
@ -396,7 +396,7 @@ static void count_roms(rom_load_data *romdata)
romdata->romstotalsize = 0;
/* loop over regions, then over files */
for (source = rom_first_source(*romdata->machine->config); source != NULL; source = rom_next_source(*source))
for (source = rom_first_source(romdata->machine->config()); source != NULL; source = rom_next_source(*source))
for (region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
if (ROM_GETBIOSFLAGS(rom) == 0 || ROM_GETBIOSFLAGS(rom) == romdata->system_bios)
@ -624,7 +624,7 @@ static int open_rom_file(rom_load_data *romdata, const char *regiontag, const ro
/* attempt reading up the chain through the parents. It automatically also
attempts any kind of load by checksum supported by the archives. */
romdata->file = NULL;
for (drv = romdata->machine->gamedrv; romdata->file == NULL && drv != NULL; drv = driver_get_clone(drv))
for (drv = &romdata->machine->system(); romdata->file == NULL && drv != NULL; drv = driver_get_clone(drv))
if (drv->name != NULL && *drv->name != 0)
filerr = common_process_file(romdata->machine->options(), drv->name, has_crc, crc, romp, &romdata->file);
@ -1226,7 +1226,7 @@ static void process_disk_entries(rom_load_data *romdata, const char *regiontag,
/* first open the source drive */
LOG(("Opening disk image: %s\n", filename.cstr()));
err = open_disk_image(romdata->machine->options(), romdata->machine->gamedrv, romp, &chd.origfile, &chd.origchd, locationtag);
err = open_disk_image(romdata->machine->options(), &romdata->machine->system(), romp, &chd.origfile, &chd.origchd, locationtag);
if (err != CHDERR_NONE)
{
if (err == CHDERR_FILE_NOT_FOUND)
@ -1450,12 +1450,12 @@ static void process_region_list(rom_load_data *romdata)
const rom_entry *region;
/* loop until we hit the end */
for (source = rom_first_source(*romdata->machine->config); source != NULL; source = rom_next_source(*source))
for (source = rom_first_source(romdata->machine->config()); source != NULL; source = rom_next_source(*source))
for (region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
{
UINT32 regionlength = ROMREGION_GETLENGTH(region);
rom_region_name(regiontag, romdata->machine->gamedrv, source, region);
rom_region_name(regiontag, &romdata->machine->system(), source, region);
LOG(("Processing region \"%s\" (length=%X)\n", regiontag.cstr(), regionlength));
/* the first entry must be a region */
@ -1495,7 +1495,7 @@ static void process_region_list(rom_load_data *romdata)
}
/* now go back and post-process all the regions */
for (source = rom_first_source(*romdata->machine->config); source != NULL; source = rom_next_source(*source))
for (source = rom_first_source(romdata->machine->config()); source != NULL; source = rom_next_source(*source))
for (region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
region_post_process(romdata, ROMREGION_GETTAG(region), ROMREGION_ISINVERTED(region));
}

View File

@ -331,12 +331,12 @@ device_scheduler::device_scheduler(running_machine &machine) :
m_execute_list(NULL),
m_basetime(attotime::zero),
m_timer_list(NULL),
m_timer_allocator(machine.m_respool),
m_timer_allocator(machine.respool()),
m_callback_timer(NULL),
m_callback_timer_modified(false),
m_callback_timer_expire_time(attotime::zero),
m_quantum_list(machine.m_respool),
m_quantum_allocator(machine.m_respool),
m_quantum_list(machine.respool()),
m_quantum_allocator(machine.respool()),
m_quantum_minimum(ATTOSECONDS_IN_NSEC(1) / 1000)
{
// append a single never-expiring timer so there is always one in the list
@ -719,22 +719,22 @@ void device_scheduler::rebuild_execute_list()
if (m_quantum_list.first() == NULL)
{
// set the core scheduling quantum
attotime min_quantum = m_machine.config->m_minimum_quantum;
attotime min_quantum = m_machine.config().m_minimum_quantum;
// if none specified default to 60Hz
if (min_quantum == attotime::zero)
min_quantum = attotime::from_hz(60);
// if the configuration specifies a device to make perfect, pick that as the minimum
if (m_machine.config->m_perfect_cpu_quantum != NULL)
if (m_machine.config().m_perfect_cpu_quantum != NULL)
{
device_t *device = m_machine.device(m_machine.config->m_perfect_cpu_quantum);
device_t *device = m_machine.device(m_machine.config().m_perfect_cpu_quantum);
if (device == NULL)
fatalerror("Device '%s' specified for perfect interleave is not present!", m_machine.config->m_perfect_cpu_quantum);
fatalerror("Device '%s' specified for perfect interleave is not present!", m_machine.config().m_perfect_cpu_quantum);
device_execute_interface *exec;
if (!device->interface(exec))
fatalerror("Device '%s' specified for perfect interleave is not an executing device!", m_machine.config->m_perfect_cpu_quantum);
fatalerror("Device '%s' specified for perfect interleave is not an executing device!", m_machine.config().m_perfect_cpu_quantum);
min_quantum = min(attotime(0, exec->minimum_quantum()), min_quantum);
}

View File

@ -378,7 +378,7 @@ void screen_device::device_start()
m_scanline0_timer = machine->scheduler().timer_alloc(FUNC(static_scanline0_callback), (void *)this);
// allocate a timer to generate per-scanline updates
if ((machine->config->m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
if ((machine->config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
m_scanline_timer = machine->scheduler().timer_alloc(FUNC(static_scanline_update_callback), (void *)this);
// configure the screen with the default parameters
@ -389,7 +389,7 @@ void screen_device::device_start()
m_vblank_end_time = attotime(0, m_vblank_period);
// start the timer to generate per-scanline updates
if ((machine->config->m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
if ((machine->config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
m_scanline_timer->adjust(time_until_pos(0));
// create burn-in bitmap
@ -609,7 +609,7 @@ bool screen_device::update_partial(int scanline)
LOG_PARTIAL_UPDATES(("Partial: update_partial(%s, %d): ", tag(), scanline));
// these two checks only apply if we're allowed to skip frames
if (!(machine->config->m_video_attributes & VIDEO_ALWAYS_UPDATE))
if (!(machine->config().m_video_attributes & VIDEO_ALWAYS_UPDATE))
{
// if skipping this frame, bail
if (m_machine.video().skip_this_frame())
@ -824,7 +824,7 @@ void screen_device::vblank_begin_callback()
(*item->m_callback)(*this, item->m_param, true);
// if this is the primary screen and we need to update now
if (this == machine->primary_screen && !(machine->config->m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
if (this == machine->primary_screen && !(machine->config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
machine->video().frame_update();
// reset the VBLANK start timer for the next frame
@ -850,7 +850,7 @@ void screen_device::vblank_end_callback()
(*item->m_callback)(*this, item->m_param, false);
// if this is the primary screen and we need to update now
if (this == machine->primary_screen && (machine->config->m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
if (this == machine->primary_screen && (machine->config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
machine->video().frame_update();
// increment the frame number counter
@ -902,7 +902,7 @@ bool screen_device::update_quads()
if (m_machine.render().is_live(*this))
{
// only update if empty and not a vector game; otherwise assume the driver did it directly
if (m_config.m_type != SCREEN_TYPE_VECTOR && (machine->config->m_video_attributes & VIDEO_SELF_RENDER) == 0)
if (m_config.m_type != SCREEN_TYPE_VECTOR && (machine->config().m_video_attributes & VIDEO_SELF_RENDER) == 0)
{
// if we're not skipping the frame and if the screen actually changed, then update the texture
if (!m_machine.video().skip_this_frame() && m_changed)
@ -1068,7 +1068,7 @@ void screen_device::finalize_burnin()
// add two text entries describing the image
sprintf(text, APPNAME " %s", build_version);
png_add_text(&pnginfo, "Software", text);
sprintf(text, "%s %s", machine->m_game.manufacturer, machine->m_game.description);
sprintf(text, "%s %s", machine->system().manufacturer, machine->system().description);
png_add_text(&pnginfo, "System", text);
// now do the actual work

View File

@ -182,7 +182,7 @@ public:
attotime time_until_pos(int vpos, int hpos = 0) const;
attotime time_until_vblank_start() const { return time_until_pos(m_visarea.max_y + 1); }
attotime time_until_vblank_end() const;
attotime time_until_update() const { return (machine->config->m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK) ? time_until_vblank_end() : time_until_vblank_start(); }
attotime time_until_update() const { return (machine->config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK) ? time_until_vblank_end() : time_until_vblank_start(); }
attotime scan_period() const { return attotime(0, m_scantime); }
attotime frame_period() const { return (this == NULL || !started()) ? DEFAULT_FRAME_PERIOD : attotime(0, m_frame_period); };
UINT64 frame_number() const { return m_frame_number; }

View File

@ -1445,7 +1445,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
/* If not found try to load the software list using the driver name */
if ( ! software_part_ptr )
{
swlist_name = (char *)image->device().machine->gamedrv->name;
swlist_name = (char *)image->device().machine->system().name;
if ( software_list_ptr )
{
@ -2035,7 +2035,7 @@ static void ui_mess_menu_populate_software_list(running_machine *machine, ui_men
bool haveCompatible = FALSE;
const char *interface = image->image_config().image_interface();
for (const device_config *dev = machine->config->m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
for (const device_config *dev = machine->config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
{
software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
@ -2065,7 +2065,7 @@ static void ui_mess_menu_populate_software_list(running_machine *machine, ui_men
}
}
for (const device_config *dev = machine->config->m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
for (const device_config *dev = machine->config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
{
software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();

View File

@ -775,7 +775,7 @@ sound_manager::sound_manager(running_machine &machine)
m_attenuation(0),
m_nosound_mode(!machine.options().sound()),
m_wavfile(NULL),
m_stream_list(machine.m_respool),
m_stream_list(machine.respool()),
m_update_attoseconds(STREAMS_UPDATE_ATTOTIME.attoseconds),
m_last_update(attotime::zero)
{
@ -785,19 +785,19 @@ sound_manager::sound_manager(running_machine &machine)
// handle -nosound and lower sample rate if not recording WAV or AVI
if (m_nosound_mode && wavfile[0] == 0 && avifile[0] == 0)
machine.sample_rate = 11025;
machine.m_sample_rate = 11025;
// count the speakers
VPRINTF(("total speakers = %d\n", machine.m_devicelist.count(SPEAKER)));
// allocate memory for mix buffers
m_leftmix = auto_alloc_array(&machine, INT32, machine.sample_rate);
m_rightmix = auto_alloc_array(&machine, INT32, machine.sample_rate);
m_finalmix = auto_alloc_array(&machine, INT16, machine.sample_rate);
m_leftmix = auto_alloc_array(&machine, INT32, machine.sample_rate());
m_rightmix = auto_alloc_array(&machine, INT32, machine.sample_rate());
m_finalmix = auto_alloc_array(&machine, INT16, machine.sample_rate());
// open the output WAV file if specified
if (wavfile[0] != 0)
m_wavfile = wav_open(wavfile, machine.sample_rate, 2);
m_wavfile = wav_open(wavfile, machine.sample_rate(), 2);
// register callbacks
config_register(&machine, "mixer", &sound_manager::config_load, &sound_manager::config_save);

View File

@ -123,7 +123,7 @@ static STREAM_UPDATE( cdp1863_stream_update )
if (cdp1863->oe)
{
double frequency;
int rate = device->machine->sample_rate / 2;
int rate = device->machine->sample_rate() / 2;
/* get progress through wave */
int incr = cdp1863->incr;
@ -175,7 +175,7 @@ static DEVICE_START( cdp1863 )
const cdp1863_config *config = get_safe_config(device);
/* set initial values */
cdp1863->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, cdp1863, cdp1863_stream_update);
cdp1863->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), cdp1863, cdp1863_stream_update);
cdp1863->clock1 = device->clock();
cdp1863->clock2 = config->clock2;
cdp1863->oe = 1;

View File

@ -364,7 +364,7 @@ static STREAM_UPDATE( cdp1864_stream_update )
if (cdp1864->aoe)
{
double frequency = cdp1864->cpu->unscaled_clock() / 8 / 4 / (cdp1864->latch + 1) / 2;
int rate = device->machine->sample_rate / 2;
int rate = device->machine->sample_rate() / 2;
/* get progress through wave */
int incr = cdp1864->incr;
@ -446,7 +446,7 @@ static DEVICE_START( cdp1864 )
cdp1864_init_palette(device, intf);
/* create sound stream */
cdp1864->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, cdp1864, cdp1864_stream_update);
cdp1864->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), cdp1864, cdp1864_stream_update);
/* create the timers */
cdp1864->int_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1864_int_tick), (void *)device);

View File

@ -434,7 +434,7 @@ void cdp1869_device::device_start()
initialize_palette();
// create sound stream
m_stream = m_machine.sound().stream_alloc(*this, 0, 1, m_machine.sample_rate);
m_stream = m_machine.sound().stream_alloc(*this, 0, 1, m_machine.sample_rate());
// register for state saving
save_item(NAME(m_prd));
@ -529,7 +529,7 @@ void cdp1869_device::sound_stream_update(sound_stream &stream, stream_sample_t *
double frequency = (clock() / 2) / (512 >> m_tonefreq) / (m_tonediv + 1);
// double amplitude = m_toneamp * ((0.78*5) / 15);
int rate = m_machine.sample_rate / 2;
int rate = m_machine.sample_rate() / 2;
/* get progress through wave */
int incr = m_incr;

View File

@ -930,7 +930,7 @@ void discrete_device::device_start()
if (this->clock())
m_sample_rate = this->clock();
else
m_sample_rate = this->machine->sample_rate;
m_sample_rate = this->machine->sample_rate();
m_sample_time = 1.0 / m_sample_rate;
m_neg_sample_time = - m_sample_time;

View File

@ -134,7 +134,7 @@ filter* filter_lp_fir_alloc(double freq, int order) {
void filter2_setup(device_t *device, int type, double fc, double d, double gain,
filter2_context *filter2)
{
int sample_rate = device->machine->sample_rate;
int sample_rate = device->machine->sample_rate();
double w; /* cutoff freq, in radians/sec */
double w_squared;
double den; /* temp variable */

View File

@ -83,7 +83,7 @@ static void set_RC_info(filter_rc_state *info, int type, double R1, double R2, d
/* Cut Frequency = 1/(2*Pi*Req*C) */
/* k = (1-(EXP(-TIMEDELTA/RC))) */
info->k = 0x10000 - 0x10000 * (exp(-1 / (Req * C) / info->device->machine->sample_rate));
info->k = 0x10000 - 0x10000 * (exp(-1 / (Req * C) / info->device->machine->sample_rate()));
}
@ -93,7 +93,7 @@ static DEVICE_START( filter_rc )
const flt_rc_config *conf = (const flt_rc_config *)device->baseconfig().static_config();
info->device = device;
info->stream = device->machine->sound().stream_alloc(*device, 1, 1, device->machine->sample_rate, info, filter_rc_update);
info->stream = device->machine->sound().stream_alloc(*device, 1, 1, device->machine->sample_rate(), info, filter_rc_update);
if (conf)
set_RC_info(info, conf->type, conf->R1, conf->R2, conf->R3, conf->C);
else

View File

@ -34,7 +34,7 @@ static DEVICE_START( filter_volume )
filter_volume_state *info = get_safe_token(device);
info->gain = 0x100;
info->stream = device->machine->sound().stream_alloc(*device, 1, 1, device->machine->sample_rate, info, filter_volume_update);
info->stream = device->machine->sound().stream_alloc(*device, 1, 1, device->machine->sample_rate(), info, filter_volume_update);
}

View File

@ -587,7 +587,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
if (!(old & 0x80) && TONE1_ON)
{
mos6560->tone1pos = 0;
mos6560->tone1samples = device->machine->sample_rate / TONE1_FREQUENCY;
mos6560->tone1samples = device->machine->sample_rate() / TONE1_FREQUENCY;
if (!mos6560->tone1samples == 0)
mos6560->tone1samples = 1;
}
@ -598,7 +598,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
if (!(old & 0x80) && TONE2_ON)
{
mos6560->tone2pos = 0;
mos6560->tone2samples = device->machine->sample_rate / TONE2_FREQUENCY;
mos6560->tone2samples = device->machine->sample_rate() / TONE2_FREQUENCY;
if (mos6560->tone2samples == 0)
mos6560->tone2samples = 1;
}
@ -609,7 +609,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
if (!(old & 0x80) && TONE3_ON)
{
mos6560->tone3pos = 0;
mos6560->tone3samples = device->machine->sample_rate / TONE3_FREQUENCY;
mos6560->tone3samples = device->machine->sample_rate() / TONE3_FREQUENCY;
if (mos6560->tone3samples == 0)
mos6560->tone3samples = 1;
}
@ -619,7 +619,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
mos6560->reg[offset] = data;
if (NOISE_ON)
{
mos6560->noisesamples = (int) ((double) NOISE_FREQUENCY_MAX * device->machine->sample_rate
mos6560->noisesamples = (int) ((double) NOISE_FREQUENCY_MAX * device->machine->sample_rate()
* NOISE_BUFFER_SIZE_SEC / NOISE_FREQUENCY);
DBG_LOG (1, "mos6560", ("noise %.2x %d sample:%d\n",
data, NOISE_FREQUENCY, mos6560->noisesamples));
@ -664,7 +664,7 @@ static STREAM_UPDATE( mos6560_update )
if (mos6560->tone1pos >= mos6560->tone1samples)
{
mos6560->tone1pos = 0;
mos6560->tone1samples = device->machine->sample_rate / TONE1_FREQUENCY;
mos6560->tone1samples = device->machine->sample_rate() / TONE1_FREQUENCY;
if (mos6560->tone1samples == 0)
mos6560->tone1samples = 1;
}
@ -680,7 +680,7 @@ static STREAM_UPDATE( mos6560_update )
if (mos6560->tone2pos >= mos6560->tone2samples)
{
mos6560->tone2pos = 0;
mos6560->tone2samples = device->machine->sample_rate / TONE2_FREQUENCY;
mos6560->tone2samples = device->machine->sample_rate() / TONE2_FREQUENCY;
if (mos6560->tone2samples == 0)
mos6560->tone2samples = 1;
}
@ -696,7 +696,7 @@ static STREAM_UPDATE( mos6560_update )
if (mos6560->tone3pos >= mos6560->tone3samples)
{
mos6560->tone3pos = 0;
mos6560->tone3samples = device->machine->sample_rate / TONE3_FREQUENCY;
mos6560->tone3samples = device->machine->sample_rate() / TONE3_FREQUENCY;
if (mos6560->tone3samples == 0)
mos6560->tone3samples = 1;
}
@ -739,7 +739,7 @@ static void mos6560_sound_start( device_t *device )
mos6560_state *mos6560 = get_safe_token(device);
int i;
mos6560->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, 0, mos6560_update);
mos6560->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), 0, mos6560_update);
/* buffer for fastest played sample for 5 second so we have enough data for min 5 second */
mos6560->noisesize = NOISE_FREQUENCY_MAX * NOISE_BUFFER_SIZE_SEC;
@ -774,7 +774,7 @@ static void mos6560_sound_start( device_t *device )
noiseshift <<= 1;
}
}
mos6560->tonesize = device->machine->sample_rate / TONE_FREQUENCY_MIN;
mos6560->tonesize = device->machine->sample_rate() / TONE_FREQUENCY_MIN;
if (mos6560->tonesize > 0)
{

View File

@ -264,7 +264,7 @@ static void rf5c400_init_chip(device_t *device, rf5c400_state *info)
double r;
// attack
r = 1.0 / (ENV_AR_SPEED * device->machine->sample_rate);
r = 1.0 / (ENV_AR_SPEED * device->machine->sample_rate());
for (i = 0; i < ENV_MIN_AR; i++)
{
info->env_ar_table[i] = 1.0;
@ -280,7 +280,7 @@ static void rf5c400_init_chip(device_t *device, rf5c400_state *info)
}
// decay
r = -1.0 / (ENV_DR_SPEED * device->machine->sample_rate);
r = -1.0 / (ENV_DR_SPEED * device->machine->sample_rate());
for (i = 0; i < ENV_MIN_DR; i++)
{
info->env_dr_table[i] = r;
@ -296,7 +296,7 @@ static void rf5c400_init_chip(device_t *device, rf5c400_state *info)
}
// release
r = -1.0 / (ENV_RR_SPEED * device->machine->sample_rate);
r = -1.0 / (ENV_RR_SPEED * device->machine->sample_rate());
for (i = 0; i < ENV_MIN_RR; i++)
{
info->env_rr_table[i] = r;

View File

@ -592,7 +592,7 @@ static DEVICE_START( s14001a )
chip->SpeechRom = *device->region();
chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() ? device->clock() : device->machine->sample_rate, chip, s14001a_pcm_update);
chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() ? device->clock() : device->machine->sample_rate(), chip, s14001a_pcm_update);
}
int s14001a_bsy_r(device_t *device)

View File

@ -38,7 +38,7 @@ void s2636_soundport_w (device_t *device, int offset, int data)
token->pos = 0;
token->level = TRUE;
// frequency 7874/(data+1)
token->size = device->machine->sample_rate * (data + 1) /7874;
token->size = device->machine->sample_rate() * (data + 1) /7874;
break;
}
}
@ -79,7 +79,7 @@ static DEVICE_START(s2636_sound)
{
s2636_sound *token = get_token(device);
memset(token, 0, sizeof(*token));
token->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, 0, s2636_update);
token->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), 0, s2636_update);
}

View File

@ -251,7 +251,7 @@ void sample_start(device_t *device,int channel,int samplenum,int loop)
chan->pos = 0;
chan->frac = 0;
chan->basefreq = sample->frequency;
chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine->sample_rate;
chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine->sample_rate();
chan->loop = loop;
}
@ -275,7 +275,7 @@ void sample_start_raw(device_t *device,int channel,const INT16 *sampledata,int s
chan->pos = 0;
chan->frac = 0;
chan->basefreq = frequency;
chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine->sample_rate;
chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine->sample_rate();
chan->loop = loop;
}
@ -292,7 +292,7 @@ void sample_set_freq(device_t *device,int channel,int freq)
/* force an update before we start */
chan->stream->update();
chan->step = ((INT64)freq << FRAC_BITS) / info->device->machine->sample_rate;
chan->step = ((INT64)freq << FRAC_BITS) / info->device->machine->sample_rate();
}
@ -468,7 +468,7 @@ static DEVICE_START( samples )
/* read audio samples */
if (intf->samplenames)
info->samples = readsamples(device->machine, intf->samplenames,device->machine->gamedrv->name);
info->samples = readsamples(device->machine, intf->samplenames,device->machine->system().name);
/* allocate channels */
info->numchannels = intf->channels;
@ -476,7 +476,7 @@ static DEVICE_START( samples )
info->channel = auto_alloc_array(device->machine, sample_channel, info->numchannels);
for (i = 0; i < info->numchannels; i++)
{
info->channel[i].stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, &info->channel[i], sample_update_sound);
info->channel[i].stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), &info->channel[i], sample_update_sound);
info->channel[i].source = NULL;
info->channel[i].source_num = -1;

View File

@ -151,7 +151,7 @@ int sidEmuReset(_SID6581 *This)
static void filterTableInit(running_machine *machine)
{
int sample_rate = machine->sample_rate;
int sample_rate = machine->sample_rate();
UINT16 uk;
/* Parameter calculation has not been moved to a separate function */
/* by purpose. */

View File

@ -35,8 +35,8 @@ static void sid_start(device_t *device, SIDTYPE sidtype)
const sid6581_interface *iface = (const sid6581_interface*) device->baseconfig().static_config();
sid->device = device;
sid->mixer_channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, (void *) sid, sid_update);
sid->PCMfreq = device->machine->sample_rate;
sid->mixer_channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), (void *) sid, sid_update);
sid->PCMfreq = device->machine->sample_rate();
sid->clock = device->clock();
sid->ad_read = iface ? iface->ad_read : NULL;
sid->type = sidtype;

View File

@ -253,7 +253,7 @@ struct _sn76477_state
/* others */
sound_stream *channel; /* returned by stream_create() */
int sample_rate; /* from machine->sample_rate */
int sample_rate; /* from machine->sample_rate() */
device_t *device;
wav_file *file; /* handle of the wave file to produce */
@ -2406,7 +2406,7 @@ static DEVICE_START( sn76477 )
sn->device = device;
sn->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, sn, SN76477_update);
sn->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), sn, SN76477_update);
if (device->clock() > 0)
{
@ -2414,7 +2414,7 @@ static DEVICE_START( sn76477 )
}
else
{
sn->sample_rate = device->machine->sample_rate;
sn->sample_rate = device->machine->sample_rate();
}
intialize_noise(sn);

View File

@ -140,7 +140,7 @@ static DEVICE_START( speaker )
int i;
double x;
sp->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, sp, speaker_sound_update);
sp->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), sp, speaker_sound_update);
if (intf != NULL)
{
@ -160,7 +160,7 @@ static DEVICE_START( speaker )
sp->composed_volume[i] = 0;
sp->composed_sample_index = 0;
sp->last_update_time = device->machine->time();
sp->channel_sample_period = HZ_TO_ATTOSECONDS(device->machine->sample_rate);
sp->channel_sample_period = HZ_TO_ATTOSECONDS(device->machine->sample_rate());
sp->channel_sample_period_secfrac = ATTOSECONDS_TO_DOUBLE(sp->channel_sample_period);
sp->interm_sample_period = sp->channel_sample_period / RATE_MULTIPLIER;
sp->interm_sample_period_secfrac = ATTOSECONDS_TO_DOUBLE(sp->interm_sample_period);

View File

@ -117,7 +117,7 @@ static DEVICE_START( votrax )
votrax->frequency = 8000;
votrax->volume = 230;
votrax->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, votrax, votrax_update_sound);
votrax->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), votrax, votrax_update_sound);
votrax->sample = NULL;
votrax->step = 0;
@ -144,7 +144,7 @@ WRITE8_DEVICE_HANDLER( votrax_w )
info->sample = &info->samples->sample[Phoneme];
info->pos = 0;
info->frac = 0;
info->step = ((INT64)(info->sample->frequency + (256*Intonation)) << FRAC_BITS) / info->device->machine->sample_rate;
info->step = ((INT64)(info->sample->frequency + (256*Intonation)) << FRAC_BITS) / info->device->machine->sample_rate();
info->channel->set_output_gain(0, (info->volume + (8*Intonation)*100/255) / 100.0);
}
}

View File

@ -39,7 +39,7 @@ static STREAM_UPDATE( wave_sound_update )
{
cassette = cassette_get_image(&image->device());
time_index = cassette_get_position(&image->device());
duration = ((double) samples) / image->device().machine->sample_rate;
duration = ((double) samples) / image->device().machine->sample_rate();
cassette_get_samples(cassette, 0, time_index, duration, samples, 2, left_buffer, CASSETTE_WAVEFORM_16BIT);
if (speakers > 1)
@ -68,12 +68,12 @@ static DEVICE_START( wave )
assert( device != NULL );
assert( device->baseconfig().static_config() != NULL );
int speakers = device->machine->config->m_devicelist.count(SPEAKER);
int speakers = device->machine->config().m_devicelist.count(SPEAKER);
image = dynamic_cast<device_image_interface *>(device->machine->device( (const char *)device->baseconfig().static_config()));
if (speakers > 1)
device->machine->sound().stream_alloc(*device, 0, 2, device->machine->sample_rate, (void *)image, wave_sound_update);
device->machine->sound().stream_alloc(*device, 0, 2, device->machine->sample_rate(), (void *)image, wave_sound_update);
else
device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, (void *)image, wave_sound_update);
device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), (void *)image, wave_sound_update);
}

View File

@ -170,7 +170,7 @@ void speaker_device::device_start()
}
// allocate the mixer stream
m_mixer_stream = m_machine.sound().stream_alloc(*this, m_auto_allocated_inputs, 1, machine->sample_rate);
m_mixer_stream = m_machine.sound().stream_alloc(*this, m_auto_allocated_inputs, 1, machine->sample_rate());
}
@ -182,7 +182,7 @@ void speaker_device::device_start()
void speaker_device::device_post_load()
{
m_mixer_stream->set_sample_rate(m_machine.sample_rate);
m_mixer_stream->set_sample_rate(m_machine.sample_rate());
}

View File

@ -105,9 +105,9 @@ state_manager::state_manager(running_machine &machine)
: m_machine(machine),
m_reg_allowed(true),
m_illegal_regs(0),
m_entry_list(machine.m_respool),
m_presave_list(machine.m_respool),
m_postload_list(machine.m_respool)
m_entry_list(machine.respool()),
m_presave_list(machine.respool()),
m_postload_list(machine.respool())
{
}
@ -200,7 +200,7 @@ void state_manager::save_memory(const char *module, const char *tag, UINT32 inde
if (!m_reg_allowed)
{
logerror("Attempt to register save state entry after state registration is closed!\nModule %s tag %s name %s\n", module, tag, name);
if (m_machine.gamedrv->flags & GAME_SUPPORTS_SAVE)
if (m_machine.system().flags & GAME_SUPPORTS_SAVE)
fatalerror("Attempt to register save state entry after state registration is closed!\nModule %s tag %s name %s\n", module, tag, name);
m_illegal_regs++;
return;
@ -280,7 +280,7 @@ state_save_error state_manager::read_file(emu_file &file)
// verify the header and report an error if it doesn't match
UINT32 sig = signature();
if (validate_header(header, m_machine.gamedrv->name, sig, popmessage, "Error: ") != STATERR_NONE)
if (validate_header(header, m_machine.system().name, sig, popmessage, "Error: ") != STATERR_NONE)
return STATERR_INVALID_HEADER;
// determine whether or not to flip the data when done
@ -321,7 +321,7 @@ state_save_error state_manager::write_file(emu_file &file)
memcpy(&header[0], s_magic_num, 8);
header[8] = SAVE_VERSION;
header[9] = NATIVE_ENDIAN_VALUE_LE_BE(0, SS_MSB_FIRST);
strncpy((char *)&header[0x0a], m_machine.gamedrv->name, 0x1c - 0x0a);
strncpy((char *)&header[0x0a], m_machine.system().name, 0x1c - 0x0a);
UINT32 sig = signature();
*(UINT32 *)&header[0x1c] = LITTLE_ENDIANIZE_INT32(sig);

View File

@ -280,7 +280,7 @@ int ui_display_startup_screens(running_machine *machine, int first_time, int sho
/* disable everything if we are using -str for 300 or fewer seconds, or if we're the empty driver,
or if we are debugging */
if (!first_time || (str > 0 && str < 60*5) || machine->gamedrv == &GAME_NAME(empty) || (machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
if (!first_time || (str > 0 && str < 60*5) || &machine->system() == &GAME_NAME(empty) || (machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
show_gameinfo = show_warnings = show_disclaimer = FALSE;
/* initialize the on-screen display system */
@ -305,9 +305,9 @@ int ui_display_startup_screens(running_machine *machine, int first_time, int sho
if (show_warnings && warnings_string(machine, messagebox_text).len() > 0)
{
ui_set_handler(handler_messagebox_ok, 0);
if (machine->gamedrv->flags & (GAME_WRONG_COLORS | GAME_IMPERFECT_COLORS | GAME_REQUIRES_ARTWORK | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NO_SOUND))
if (machine->system().flags & (GAME_WRONG_COLORS | GAME_IMPERFECT_COLORS | GAME_REQUIRES_ARTWORK | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NO_SOUND))
messagebox_backcolor = UI_YELLOW_COLOR;
if (machine->gamedrv->flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
if (machine->system().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
messagebox_backcolor = UI_RED_COLOR;
}
break;
@ -883,7 +883,7 @@ int ui_is_menu_active(void)
static astring &disclaimer_string(running_machine *machine, astring &string)
{
string.cpy("Usage of emulators in conjunction with ROMs you don't own is forbidden by copyright law.\n\n");
string.catprintf("IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n\n", machine->gamedrv->description);
string.catprintf("IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n\n", machine->system().description);
string.cat("Otherwise, type OK or move the joystick left then right to continue");
return string;
}
@ -912,19 +912,19 @@ static astring &warnings_string(running_machine *machine, astring &string)
string.reset();
/* if no warnings, nothing to return */
if (rom_load_warnings(machine) == 0 && rom_load_knownbad(machine) == 0 && !(machine->gamedrv->flags & WARNING_FLAGS))
if (rom_load_warnings(machine) == 0 && rom_load_knownbad(machine) == 0 && !(machine->system().flags & WARNING_FLAGS))
return string;
/* add a warning if any ROMs were loaded with warnings */
if (rom_load_warnings(machine) > 0)
{
string.cat("One or more ROMs/CHDs for this game are incorrect. The " GAMENOUN " may not run correctly.\n");
if (machine->gamedrv->flags & WARNING_FLAGS)
if (machine->system().flags & WARNING_FLAGS)
string.cat("\n");
}
/* if we have at least one warning flag, print the general header */
if ((machine->gamedrv->flags & WARNING_FLAGS) || rom_load_knownbad(machine) > 0)
if ((machine->system().flags & WARNING_FLAGS) || rom_load_knownbad(machine) > 0)
{
string.cat("There are known problems with this " GAMENOUN "\n\n");
@ -935,46 +935,46 @@ static astring &warnings_string(running_machine *machine, astring &string)
/* add one line per warning flag */
if (input_machine_has_keyboard(machine))
string.cat("The keyboard emulation may not be 100% accurate.\n");
if (machine->gamedrv->flags & GAME_IMPERFECT_COLORS)
if (machine->system().flags & GAME_IMPERFECT_COLORS)
string.cat("The colors aren't 100% accurate.\n");
if (machine->gamedrv->flags & GAME_WRONG_COLORS)
if (machine->system().flags & GAME_WRONG_COLORS)
string.cat("The colors are completely wrong.\n");
if (machine->gamedrv->flags & GAME_IMPERFECT_GRAPHICS)
if (machine->system().flags & GAME_IMPERFECT_GRAPHICS)
string.cat("The video emulation isn't 100% accurate.\n");
if (machine->gamedrv->flags & GAME_IMPERFECT_SOUND)
if (machine->system().flags & GAME_IMPERFECT_SOUND)
string.cat("The sound emulation isn't 100% accurate.\n");
if (machine->gamedrv->flags & GAME_NO_SOUND)
if (machine->system().flags & GAME_NO_SOUND)
string.cat("The game lacks sound.\n");
if (machine->gamedrv->flags & GAME_NO_COCKTAIL)
if (machine->system().flags & GAME_NO_COCKTAIL)
string.cat("Screen flipping in cocktail mode is not supported.\n");
/* check if external artwork is present before displaying this warning? */
if (machine->gamedrv->flags & GAME_REQUIRES_ARTWORK)
if (machine->system().flags & GAME_REQUIRES_ARTWORK)
string.cat("The game requires external artwork files\n");
/* if there's a NOT WORKING, UNEMULATED PROTECTION or GAME MECHANICAL warning, make it stronger */
if (machine->gamedrv->flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
if (machine->system().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
{
const game_driver *maindrv;
const game_driver *clone_of;
int foundworking;
/* add the strings for these warnings */
if (machine->gamedrv->flags & GAME_UNEMULATED_PROTECTION)
if (machine->system().flags & GAME_UNEMULATED_PROTECTION)
string.cat("The game has protection which isn't fully emulated.\n");
if (machine->gamedrv->flags & GAME_NOT_WORKING)
if (machine->system().flags & GAME_NOT_WORKING)
string.cat("\nTHIS " CAPGAMENOUN " DOESN'T WORK. The emulation for this game is not yet complete. "
"There is nothing you can do to fix this problem except wait for the developers to improve the emulation.\n");
if (machine->gamedrv->flags & GAME_MECHANICAL)
if (machine->system().flags & GAME_MECHANICAL)
string.cat("\nCertain elements of this " GAMENOUN " cannot be emulated as it requires actual physical interaction or consists of mechanical devices. "
"It is not possible to fully play this " GAMENOUN ".\n");
/* find the parent of this driver */
clone_of = driver_get_clone(machine->gamedrv);
clone_of = driver_get_clone(&machine->system());
if (clone_of != NULL && !(clone_of->flags & GAME_IS_BIOS_ROOT))
maindrv = clone_of;
else
maindrv = machine->gamedrv;
maindrv = &machine->system();
/* scan the driver list for any working clones and add them */
foundworking = FALSE;
@ -1013,7 +1013,7 @@ astring &game_info_astring(running_machine *machine, astring &string)
int found_sound = FALSE;
/* print description, manufacturer, and CPU: */
string.printf("%s\n%s %s\n\nCPU:\n", machine->gamedrv->description, machine->gamedrv->year, machine->gamedrv->manufacturer);
string.printf("%s\n%s %s\n\nCPU:\n", machine->system().description, machine->system().year, machine->system().manufacturer);
/* loop over all CPUs */
device_execute_interface *exec = NULL;
@ -1103,7 +1103,7 @@ astring &game_info_astring(running_machine *machine, astring &string)
string.catprintf("%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
visarea.max_x - visarea.min_x + 1,
visarea.max_y - visarea.min_y + 1,
(machine->gamedrv->flags & ORIENTATION_SWAP_XY) ? "V" : "H",
(machine->system().flags & ORIENTATION_SWAP_XY) ? "V" : "H",
ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds));
}
}
@ -1311,7 +1311,7 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
}
/* determine if we should disable the rest of the UI */
int ui_disabled = (input_machine_has_keyboard(machine) && !machine->ui_active);
int ui_disabled = (input_machine_has_keyboard(machine) && !machine->ui_active());
/* is ScrLk UI toggling applicable here? */
if (input_machine_has_keyboard(machine))
@ -1320,10 +1320,10 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (ui_input_pressed(machine, IPT_UI_TOGGLE_UI))
{
/* toggle the UI */
machine->ui_active = !machine->ui_active;
machine->set_ui_active(!machine->ui_active());
/* display a popup indicating the new status */
if (machine->ui_active)
if (machine->ui_active())
{
ui_popup_time(2, "%s\n%s\n%s\n%s\n%s\n%s\n",
"Keyboard Emulation Status",

View File

@ -120,12 +120,12 @@ void ui_gfx_init(running_machine *machine)
/* set up the graphics state */
for (gfx = 0; gfx < MAX_GFX_ELEMENTS; gfx++)
{
state->gfxset.rotate[gfx] = machine->gamedrv->flags & ORIENTATION_MASK;
state->gfxset.rotate[gfx] = machine->system().flags & ORIENTATION_MASK;
state->gfxset.count[gfx] = 16;
}
/* set up the tilemap state */
state->tilemap.rotate = machine->gamedrv->flags & ORIENTATION_MASK;
state->tilemap.rotate = machine->system().flags & ORIENTATION_MASK;
}

View File

@ -1574,7 +1574,7 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st
ui_menu_item_append(menu, "Cheat", NULL, 0, (void *)menu_cheat);
/* add memory card menu */
if (machine->config->m_memcard_handler != NULL)
if (machine->config().m_memcard_handler != NULL)
ui_menu_item_append(menu, "Memory Card", NULL, 0, (void *)menu_memory_card);
/* add reset and exit menus */

View File

@ -336,7 +336,7 @@ void video_manager::save_snapshot(screen_device *screen, emu_file &file)
// add two text entries describing the image
astring text1(APPNAME, " ", build_version);
astring text2(m_machine.m_game.manufacturer, " ", m_machine.m_game.description);
astring text2(m_machine.system().manufacturer, " ", m_machine.system().description);
png_info pnginfo = { 0 };
png_add_text(&pnginfo, "Software", text1);
png_add_text(&pnginfo, "System", text2);
@ -414,12 +414,12 @@ void video_manager::begin_recording(const char *name, movie_format format)
info.video_depth = 24;
info.audio_format = 0;
info.audio_timescale = m_machine.sample_rate;
info.audio_timescale = m_machine.sample_rate();
info.audio_sampletime = 1;
info.audio_numsamples = 0;
info.audio_channels = 2;
info.audio_samplebits = 16;
info.audio_samplerate = m_machine.sample_rate;
info.audio_samplerate = m_machine.sample_rate();
// create a new temporary movie file
file_error filerr;
@ -1263,7 +1263,7 @@ void video_manager::record_frame()
if (m_movie_frame == 0)
{
astring text1(APPNAME, " ", build_version);
astring text2(m_machine.m_game.manufacturer, " ", m_machine.m_game.description);
astring text2(m_machine.system().manufacturer, " ", m_machine.system().description);
png_add_text(&pnginfo, "Software", text1);
png_add_text(&pnginfo, "System", text2);
}

View File

@ -237,7 +237,7 @@ void generic_video_init(running_machine *machine)
machine->state().save_item(NAME(state->flip_screen_y));
// create spriteram buffers if necessary
if (machine->config->m_video_attributes & VIDEO_BUFFERS_SPRITERAM)
if (machine->config().m_video_attributes & VIDEO_BUFFERS_SPRITERAM)
{
assert_always(machine->generic.spriteram_size != 0, "Video buffers spriteram but spriteram size is 0");

View File

@ -4488,7 +4488,6 @@ static DEVICE_START( voodoo )
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
assert(device->machine != NULL);
assert(device->machine->config != NULL);
/* validate configuration */
assert(config->screen != NULL);

View File

@ -57,7 +57,7 @@ void watchdog_init(running_machine *machine)
static void watchdog_internal_reset(running_machine &machine)
{
/* set up the watchdog timer; only start off enabled if explicitly configured */
watchdog_enabled = (machine.m_config.m_watchdog_vblank_count != 0 || machine.m_config.m_watchdog_time != attotime::zero);
watchdog_enabled = (machine.config().m_watchdog_vblank_count != 0 || machine.config().m_watchdog_time != attotime::zero);
watchdog_reset(&machine);
watchdog_enabled = TRUE;
}
@ -90,7 +90,7 @@ static void on_vblank(screen_device &screen, void *param, bool vblank_state)
if (vblank_state && watchdog_enabled)
{
/* check the watchdog */
if (screen.machine->config->m_watchdog_vblank_count != 0)
if (screen.machine->config().m_watchdog_vblank_count != 0)
{
watchdog_counter = watchdog_counter - 1;
@ -112,9 +112,9 @@ void watchdog_reset(running_machine *machine)
watchdog_timer->adjust(attotime::never);
/* VBLANK-based watchdog? */
else if (machine->config->m_watchdog_vblank_count != 0)
else if (machine->config().m_watchdog_vblank_count != 0)
{
watchdog_counter = machine->config->m_watchdog_vblank_count;
watchdog_counter = machine->config().m_watchdog_vblank_count;
/* register a VBLANK callback for the primary screen */
if (machine->primary_screen != NULL)
@ -122,8 +122,8 @@ void watchdog_reset(running_machine *machine)
}
/* timer-based watchdog? */
else if (machine->config->m_watchdog_time != attotime::zero)
watchdog_timer->adjust(machine->config->m_watchdog_time);
else if (machine->config().m_watchdog_time != attotime::zero)
watchdog_timer->adjust(machine->config().m_watchdog_time);
/* default to an obscene amount of time (3 seconds) */
else

View File

@ -133,7 +133,7 @@ static void trigger_sample(device_t *samples, UINT8 data)
{
gottlieb_state *state = samples->machine->driver_data<gottlieb_state>();
/* Reactor samples */
if (strcmp(samples->machine->gamedrv->name, "reactor") == 0)
if (strcmp(samples->machine->system().name, "reactor") == 0)
{
switch (data)
{
@ -186,7 +186,7 @@ static void trigger_sample(device_t *samples, UINT8 data)
void gottlieb_knocker(running_machine *machine)
{
device_t *samples = space->machine->device("samples");
if (!strcmp(machine->gamedrv->name,"reactor")) /* reactor */
if (!strcmp(machine->system().name,"reactor")) /* reactor */
{
}
else if (samples != NULL) /* qbert */

View File

@ -72,11 +72,11 @@ static DEVICE_START( gridlee_sound )
running_machine *machine = device->machine;
/* allocate the stream */
state->stream = device->machine->sound().stream_alloc(*device, 0, 1, machine->sample_rate, NULL, gridlee_stream_update);
state->stream = device->machine->sound().stream_alloc(*device, 0, 1, machine->sample_rate(), NULL, gridlee_stream_update);
state->samples = device->machine->device("samples");
state->freq_to_step = (double)(1 << 24) / (double)machine->sample_rate;
state->freq_to_step = (double)(1 << 24) / (double)machine->sample_rate();
}

View File

@ -314,8 +314,8 @@ static DEVICE_START( micro3d_sound )
noise_state *state = get_safe_token(device);
/* Allocate the stream */
state->stream = device->machine->sound().stream_alloc(*device, 0, 2, machine->sample_rate, state, micro3d_stream_update);
filter_init(machine, &state->filter, machine->sample_rate);
state->stream = device->machine->sound().stream_alloc(*device, 0, 2, machine->sample_rate(), state, micro3d_stream_update);
filter_init(machine, &state->filter, machine->sample_rate());
configure_filter(&state->noise_filters[0], 2.7e3 + 2.7e3, 1.0e-6);
configure_filter(&state->noise_filters[1], 2.7e3 + 1e3, 0.30e-6);

View File

@ -225,7 +225,7 @@ INLINE int noise(phoenix_sound_state *state, int samplerate)
static STREAM_UPDATE( phoenix_sound_update )
{
phoenix_sound_state *state = get_safe_token(device);
int samplerate = device->machine->sample_rate;
int samplerate = device->machine->sample_rate();
stream_sample_t *buffer = outputs[0];
while( samples-- > 0 )
@ -566,7 +566,7 @@ static DEVICE_START( phoenix_sound )
state->poly18[i] = bits;
}
state->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, 0, phoenix_sound_update);
state->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), 0, phoenix_sound_update);
register_state(device);
}

View File

@ -409,7 +409,7 @@ INLINE int noise(pleiads_sound_state *state, int samplerate)
static STREAM_UPDATE( pleiads_sound_update )
{
pleiads_sound_state *state = get_safe_token(device);
int rate = device->machine->sample_rate;
int rate = device->machine->sample_rate();
stream_sample_t *buffer = outputs[0];
while( samples-- > 0 )
@ -496,7 +496,7 @@ static DEVICE_START( common_sh_start )
state->poly18[i] = bits;
}
state->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, NULL, pleiads_sound_update);
state->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), NULL, pleiads_sound_update);
}
static DEVICE_START( pleiads_sound )

View File

@ -301,8 +301,8 @@ static DEVICE_START( tx1_sound )
/* Allocate the stream */
state->stream = device->machine->sound().stream_alloc(*device, 0, 2, machine->sample_rate, NULL, tx1_stream_update);
state->freq_to_step = (double)(1 << TX1_FRAC) / (double)machine->sample_rate;
state->stream = device->machine->sound().stream_alloc(*device, 0, 2, machine->sample_rate(), NULL, tx1_stream_update);
state->freq_to_step = (double)(1 << TX1_FRAC) / (double)machine->sample_rate();
/* Compute the engine resistor weights */
compute_resistor_weights(0, 10000, -1.0,
@ -442,7 +442,7 @@ WRITE8_DEVICE_HANDLER( bb_ym2_b_w )
state->ym2_outputb = data ^ 0xff;
if (!strcmp(device->machine->gamedrv->name, "buggyboyjr"))
if (!strcmp(device->machine->system().name, "buggyboyjr"))
{
coin_counter_w(device->machine, 0, data & 0x01);
coin_counter_w(device->machine, 1, data & 0x02);
@ -489,7 +489,7 @@ static STREAM_UPDATE( buggyboy_stream_update )
step_0 = state->pit8253.counts[0].val ? (BUGGYBOY_PIT_CLOCK / state->pit8253.counts[0].val) * state->freq_to_step : 0;
step_1 = state->pit8253.counts[1].val ? (BUGGYBOY_PIT_CLOCK / state->pit8253.counts[1].val) * state->freq_to_step : 0;
if (!strcmp(device->machine->gamedrv->name, "buggyboyjr"))
if (!strcmp(device->machine->system().name, "buggyboyjr"))
gain0 = BIT(state->ym2_outputb, 3) ? 1.0 : 2.0;
else
gain0 = BIT(state->ym1_outputa, 3) ? 1.0 : 2.0;
@ -508,7 +508,7 @@ static STREAM_UPDATE( buggyboy_stream_update )
pit1 = state->eng_voltages[(state->step1 >> 24) & 0xf];
/* Calculate the tyre screech noise source */
for (i = 0; i < BUGGYBOY_NOISE_CLOCK / device->machine->sample_rate; ++i)
for (i = 0; i < BUGGYBOY_NOISE_CLOCK / device->machine->sample_rate(); ++i)
{
/* CD4006 is a 4-4-1-4-4-1 shift register */
int p13 = BIT(state->noise_lfsra, 3);
@ -572,8 +572,8 @@ static DEVICE_START( buggyboy_sound )
state->eng_voltages[i] = combine_4_weights(aweights, BIT(tmp[i], 0), BIT(tmp[i], 1), BIT(tmp[i], 2), BIT(tmp[i], 3));
/* Allocate the stream */
state->stream = device->machine->sound().stream_alloc(*device, 0, 2, machine->sample_rate, NULL, buggyboy_stream_update);
state->freq_to_step = (double)(1 << 24) / (double)machine->sample_rate;
state->stream = device->machine->sound().stream_alloc(*device, 0, 2, machine->sample_rate(), NULL, buggyboy_stream_update);
state->freq_to_step = (double)(1 << 24) / (double)machine->sample_rate();
}
static DEVICE_RESET( buggyboy_sound )

View File

@ -742,7 +742,7 @@ INLINE void generic_decode(running_machine *machine, const char *tag, int bit7,
FILE *fp;
char filename[256];
sprintf(filename,"decrypted_%s", machine->gamedrv->name);
sprintf(filename,"decrypted_%s", machine->system().name);
fp=fopen(filename, "w+b");
if (fp)
{

View File

@ -730,8 +730,8 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data & 0x0008) ? CLEAR_LINE : ASSERT_LINE);
coin_counter_w(space->machine, 0, data & 0x0001);
if ((strncmp(space->machine->gamedrv->name, "pzloop2", 8) == 0) ||
(strncmp(space->machine->gamedrv->name, "pzloop2j", 8) == 0))
if ((strncmp(space->machine->system().name, "pzloop2", 8) == 0) ||
(strncmp(space->machine->system().name, "pzloop2j", 8) == 0))
{
// Puzz Loop 2 uses coin counter 2 input to switch between stick and paddle controls
state->readpaddle = data & 0x0002;
@ -741,7 +741,7 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
coin_counter_w(space->machine, 1, data & 0x0002);
}
if (strncmp(space->machine->gamedrv->name, "mmatrix", 7) == 0) // Mars Matrix seems to require the coin lockout bit to be reversed
if (strncmp(space->machine->system().name, "mmatrix", 7) == 0) // Mars Matrix seems to require the coin lockout bit to be reversed
{
coin_lockout_w(space->machine, 0, data & 0x0010);
coin_lockout_w(space->machine, 1, data & 0x0020);

View File

@ -634,7 +634,7 @@ static void cps3_decrypt_bios(running_machine *machine)
/* Dump to file */
{
FILE *fp;
const char *gamename = machine->gamedrv->name;
const char *gamename = machine->system().name;
char filename[256];
sprintf(filename, "%s_bios.dump", gamename);
@ -2353,7 +2353,7 @@ static void copy_from_nvram(running_machine *machine)
/*
{
FILE *fp;
const char *gamename = machine->gamedrv->name;
const char *gamename = machine->system().name;
char filename[256];
sprintf(filename, "%s_bios.dump", gamename);

View File

@ -232,7 +232,7 @@ static READ8_HANDLER( darktowr_mcu_bank_r )
so just hack around the protection here. (The hacks are 'right' as I have
the original source code & notes to this version of TStrike to examine).
*/
if (!strcmp(space->machine->gamedrv->name, "tstrike"))
if (!strcmp(space->machine->system().name, "tstrike"))
{
/* Static protection checks at boot-up */
if (cpu_get_pc(space->cpu) == 0x9ace)

View File

@ -2889,7 +2889,7 @@ static void dump_to_file(running_machine* machine, UINT8* ROM, int offset, int s
{
FILE *fp;
char filename[256];
sprintf(filename,"%s_%08x_%08x", machine->gamedrv->name, offset, size);
sprintf(filename,"%s_%08x_%08x", machine->system().name, offset, size);
fp=fopen(filename, "w+b");
if (fp)
{

View File

@ -425,7 +425,7 @@ static MACHINE_START( s2650 )
{
dkong_state *state = machine->driver_data<dkong_state>();
UINT8 *p = machine->region("user1")->base();
const char *game_name = machine->gamedrv->name;
const char *game_name = machine->system().name;
int i;
MACHINE_START_CALL(dkong2b);

View File

@ -68,7 +68,7 @@ void init_eolith_speedup(running_machine *machine)
while( eolith_speedup_table[ n_game ].s_name != NULL )
{
if( strcmp( machine->gamedrv->name, eolith_speedup_table[ n_game ].s_name ) == 0 )
if( strcmp( machine->system().name, eolith_speedup_table[ n_game ].s_name ) == 0 )
{
eolith_speedup_address = eolith_speedup_table[ n_game ].speedup_address;
eolith_speedup_resume_scanline = eolith_speedup_table[ n_game ].speedup_resume_scanline;

View File

@ -525,7 +525,7 @@ static SCREEN_UPDATE(firebeat)
bitmap_fill(bitmap, cliprect, 0);
if (mame_stricmp(screen->machine->gamedrv->name, "popn7") == 0)
if (mame_stricmp(screen->machine->system().name, "popn7") == 0)
{
gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x1f80000);
}

View File

@ -9670,7 +9670,7 @@ static void dump_to_file(running_machine* machine, UINT8* ROM)
{
FILE *fp;
char filename[256];
sprintf(filename,"decrypted_%s", machine->gamedrv->name);
sprintf(filename,"decrypted_%s", machine->system().name);
fp=fopen(filename, "w+b");
if (fp)
{

View File

@ -1393,7 +1393,7 @@ static DRIVER_INIT (luckygrl)
{
FILE *fp;
char filename[256];
sprintf(filename,"decrypted_%s", machine->gamedrv->name);
sprintf(filename,"decrypted_%s", machine->system().name);
fp=fopen(filename, "w+b");
if (fp)
{

View File

@ -169,7 +169,7 @@ static MACHINE_START( kinst )
device_t *ide = machine->device("ide");
UINT8 *features = ide_get_features(ide);
if (strncmp(machine->gamedrv->name, "kinst2", 6) != 0)
if (strncmp(machine->system().name, "kinst2", 6) != 0)
{
/* kinst: tweak the model number so we pass the check */
features[27*2+0] = 0x54;

View File

@ -3671,12 +3671,12 @@ static MACHINE_RESET(konamigx)
cputag_set_input_line(machine, "soundcpu", INPUT_LINE_HALT, ASSERT_LINE);
cputag_set_input_line(machine, "dasp", INPUT_LINE_RESET, ASSERT_LINE);
if (!strcmp(machine->gamedrv->name, "tkmmpzdm"))
if (!strcmp(machine->system().name, "tkmmpzdm"))
{
// boost voice(chip 1 channel 3-7)
for (i=3; i<=7; i++) k054539_set_gain(k054539_2, i, 2.0);
}
else if ((!strcmp(machine->gamedrv->name, "dragoonj")) || (!strcmp(machine->gamedrv->name, "dragoona")))
else if ((!strcmp(machine->system().name, "dragoonj")) || (!strcmp(machine->system().name, "dragoona")))
{
// soften percussions(chip 1 channel 0-3), boost voice(chip 1 channel 4-7)
for (i=0; i<=3; i++)
@ -3761,7 +3761,7 @@ static DRIVER_INIT(konamigx)
i = match = 0;
while ((gameDefs[i].cfgport != -1) && (!match))
{
if (!strcmp(machine->gamedrv->name, gameDefs[i].romname))
if (!strcmp(machine->system().name, gameDefs[i].romname))
{
match = 1;
konamigx_cfgport = gameDefs[i].cfgport;

View File

@ -1346,7 +1346,7 @@ static INTERRUPT_GEN( sys573_vblank )
update_mode(device->machine);
if( strcmp( device->machine->gamedrv->name, "ddr2ml" ) == 0 )
if( strcmp( device->machine->system().name, "ddr2ml" ) == 0 )
{
/* patch out security-plate error */
@ -1368,7 +1368,7 @@ static INTERRUPT_GEN( sys573_vblank )
p_n_psxram[ 0x1f850 / 4 ] = 0x08007e22;
}
}
else if( strcmp( device->machine->gamedrv->name, "ddr2mla" ) == 0 )
else if( strcmp( device->machine->system().name, "ddr2mla" ) == 0 )
{
/* patch out security-plate error */

View File

@ -891,7 +891,7 @@ static DRIVER_INIT( luckgrln )
{
FILE *fp;
char filename[256];
sprintf(filename,"decrypted_%s", machine->gamedrv->name);
sprintf(filename,"decrypted_%s", machine->system().name);
fp=fopen(filename, "w+b");
if (fp)
{

View File

@ -738,8 +738,8 @@ static MACHINE_RESET(model1)
model1_state *state = machine->driver_data<model1_state>();
memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x1000000);
irq_init(machine);
model1_tgp_reset(machine, !strcmp(machine->gamedrv->name, "swa") || !strcmp(machine->gamedrv->name, "wingwar") || !strcmp(machine->gamedrv->name, "wingwaru") || !strcmp(machine->gamedrv->name, "wingwarj"));
if (!strcmp(machine->gamedrv->name, "swa"))
model1_tgp_reset(machine, !strcmp(machine->system().name, "swa") || !strcmp(machine->system().name, "wingwar") || !strcmp(machine->system().name, "wingwaru") || !strcmp(machine->system().name, "wingwarj"));
if (!strcmp(machine->system().name, "swa"))
{
state->sound_irq = 0;
}

View File

@ -691,15 +691,15 @@ static WRITE32_HANDLER(copro_sharc_iop_w)
{
model2_state *state = space->machine->driver_data<model2_state>();
/* FIXME: clean this up */
if ((strcmp(space->machine->gamedrv->name, "schamp" ) == 0) ||
(strcmp(space->machine->gamedrv->name, "sfight" ) == 0) ||
(strcmp(space->machine->gamedrv->name, "fvipers" ) == 0) ||
(strcmp(space->machine->gamedrv->name, "vstriker" ) == 0) ||
(strcmp(space->machine->gamedrv->name, "vstrikero" ) == 0) ||
(strcmp(space->machine->gamedrv->name, "gunblade" ) == 0) ||
(strcmp(space->machine->gamedrv->name, "von" ) == 0) ||
(strcmp(space->machine->gamedrv->name, "vonj" ) == 0) ||
(strcmp(space->machine->gamedrv->name, "rchase2" ) == 0))
if ((strcmp(space->machine->system().name, "schamp" ) == 0) ||
(strcmp(space->machine->system().name, "sfight" ) == 0) ||
(strcmp(space->machine->system().name, "fvipers" ) == 0) ||
(strcmp(space->machine->system().name, "vstriker" ) == 0) ||
(strcmp(space->machine->system().name, "vstrikero" ) == 0) ||
(strcmp(space->machine->system().name, "gunblade" ) == 0) ||
(strcmp(space->machine->system().name, "von" ) == 0) ||
(strcmp(space->machine->system().name, "vonj" ) == 0) ||
(strcmp(space->machine->system().name, "rchase2" ) == 0))
{
sharc_external_iop_write(space->machine->device("dsp"), offset, data);
}
@ -772,7 +772,7 @@ static WRITE32_HANDLER( geo_sharc_ctl1_w )
static READ32_HANDLER(geo_sharc_fifo_r)
{
if ((strcmp(space->machine->gamedrv->name, "manxtt" ) == 0) || (strcmp(space->machine->gamedrv->name, "srallyc" ) == 0))
if ((strcmp(space->machine->system().name, "manxtt" ) == 0) || (strcmp(space->machine->system().name, "srallyc" ) == 0))
{
return 8;
}
@ -801,7 +801,7 @@ static WRITE32_HANDLER(geo_sharc_fifo_w)
static WRITE32_HANDLER(geo_sharc_iop_w)
{
model2_state *state = space->machine->driver_data<model2_state>();
if ((strcmp(space->machine->gamedrv->name, "schamp" ) == 0))
if ((strcmp(space->machine->system().name, "schamp" ) == 0))
{
sharc_external_iop_write(space->machine->device("dsp2"), offset, data);
}

View File

@ -1232,9 +1232,9 @@ static void model3_init(running_machine *machine, int step)
model3_tap_reset(machine);
if(step < 0x20) {
if( mame_stricmp(machine->gamedrv->name, "vs215") == 0 ||
mame_stricmp(machine->gamedrv->name, "vs29815") == 0 ||
mame_stricmp(machine->gamedrv->name, "bass") == 0 )
if( mame_stricmp(machine->system().name, "vs215") == 0 ||
mame_stricmp(machine->system().name, "vs29815") == 0 ||
mame_stricmp(machine->system().name, "bass") == 0 )
{
mpc106_init(machine);
}
@ -1248,8 +1248,8 @@ static void model3_init(running_machine *machine, int step)
mpc106_init(machine);
// some step 2+ games need the older PCI ID (obvious symptom:
// vbl is enabled briefly then disabled so the game hangs)
if (mame_stricmp(machine->gamedrv->name, "magtruck") == 0 ||
mame_stricmp(machine->gamedrv->name, "von254g") == 0)
if (mame_stricmp(machine->system().name, "magtruck") == 0 ||
mame_stricmp(machine->system().name, "von254g") == 0)
{
state->real3d_device_id = 0x16c311db; /* PCI Vendor ID (11db = SEGA), Device ID (16c3 = 315-5827) */
}
@ -1717,13 +1717,13 @@ static READ64_HANDLER(model3_security_r)
case 0x00/8: return 0; /* status */
case 0x1c/8: /* security board data read */
{
if (mame_stricmp(space->machine->gamedrv->name, "vs299") == 0 ||
mame_stricmp(space->machine->gamedrv->name, "vs2v991") == 0)
if (mame_stricmp(space->machine->system().name, "vs299") == 0 ||
mame_stricmp(space->machine->system().name, "vs2v991") == 0)
{
return (UINT64)vs299_prot_data[state->prot_data_ptr++] << 48;
}
else if (mame_stricmp(space->machine->gamedrv->name, "swtrilgy") == 0 ||
mame_stricmp(space->machine->gamedrv->name, "swtrilgya") == 0)
else if (mame_stricmp(space->machine->system().name, "swtrilgy") == 0 ||
mame_stricmp(space->machine->system().name, "swtrilgya") == 0)
{
UINT64 data = (UINT64)swt_prot_data[state->prot_data_ptr++] << 16;
if (state->prot_data_ptr > 0x38)
@ -1732,7 +1732,7 @@ static READ64_HANDLER(model3_security_r)
}
return data;
}
else if (mame_stricmp(space->machine->gamedrv->name, "fvipers2") == 0)
else if (mame_stricmp(space->machine->system().name, "fvipers2") == 0)
{
UINT64 data = (UINT64)fvipers2_prot_data[state->prot_data_ptr++] << 16;
if (state->prot_data_ptr >= 0x41)
@ -1741,8 +1741,8 @@ static READ64_HANDLER(model3_security_r)
}
return data;
}
else if (mame_stricmp(space->machine->gamedrv->name, "spikeout") == 0 ||
mame_stricmp(space->machine->gamedrv->name, "spikeofe") == 0)
else if (mame_stricmp(space->machine->system().name, "spikeout") == 0 ||
mame_stricmp(space->machine->system().name, "spikeofe") == 0)
{
UINT64 data = (UINT64)spikeout_prot_data[state->prot_data_ptr++] << 16;
if (state->prot_data_ptr >= 0x55)
@ -1751,8 +1751,8 @@ static READ64_HANDLER(model3_security_r)
}
return data;
}
else if (mame_stricmp(space->machine->gamedrv->name, "eca") == 0 ||
mame_stricmp(space->machine->gamedrv->name, "ecax") == 0)
else if (mame_stricmp(space->machine->system().name, "eca") == 0 ||
mame_stricmp(space->machine->system().name, "ecax") == 0)
{
UINT64 data = (UINT64)eca_prot_data[state->prot_data_ptr++] << 16;
if (state->prot_data_ptr >= 0x31)
@ -1761,7 +1761,7 @@ static READ64_HANDLER(model3_security_r)
}
return data;
}
else if (mame_stricmp(space->machine->gamedrv->name, "oceanhun") == 0)
else if (mame_stricmp(space->machine->system().name, "oceanhun") == 0)
{
UINT64 data = (UINT64)oceanhun_prot_data[state->prot_data_ptr++] << 16;
if (state->prot_data_ptr >= 58)

View File

@ -916,7 +916,7 @@ ROM_END
static DRIVER_INIT( moo )
{
moo_state *state = machine->driver_data<moo_state>();
state->game_type = (!strcmp(machine->gamedrv->name, "bucky") || !strcmp(machine->gamedrv->name, "buckyua"));
state->game_type = (!strcmp(machine->system().name, "bucky") || !strcmp(machine->system().name, "buckyua"));
}

View File

@ -1116,7 +1116,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic5_porta_w )
awp_draw_reel(2);
}
if (mame_stricmp(device->machine->gamedrv->name, "m_gmball") == 0)
if (mame_stricmp(device->machine->system().name, "m_gmball") == 0)
{
/* The 'Gamball' device is a unique piece of mechanical equipment, designed to
provide a truly fair hi-lo gamble for an AWP machine. Functionally, it consists of

View File

@ -275,7 +275,7 @@ static void zdrawgfxzoom(
{
if( gfx )
{
int shadow_offset = (gfx->machine->config->m_video_attributes&VIDEO_HAS_SHADOWS)?gfx->machine->total_colors():0;
int shadow_offset = (gfx->machine->config().m_video_attributes&VIDEO_HAS_SHADOWS)?gfx->machine->total_colors():0;
const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;

View File

@ -586,7 +586,7 @@ static INTERRUPT_GEN( namcos11_vblank )
namcos11_state *state = device->machine->driver_data<namcos11_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
if( strcmp( device->machine->gamedrv->name, "pocketrc" ) == 0 )
if( strcmp( device->machine->system().name, "pocketrc" ) == 0 )
{
if( p_n_psxram[ 0x12c74 / 4 ] == 0x1440fff9 )
{
@ -917,7 +917,7 @@ static DRIVER_INIT( namcos11 )
machine->device("c76")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x82, 0x83, FUNC(c76_speedup_r), FUNC(c76_speedup_w));
if( strcmp( machine->gamedrv->name, "pocketrc" ) == 0 )
if( strcmp( machine->system().name, "pocketrc" ) == 0 )
{
machine->device("c76")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC0_L, FUNC(pocketrc_steer_r));
machine->device("c76")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC1_L, M37710_ADC1_L, FUNC(pocketrc_gas_r));
@ -928,7 +928,7 @@ static DRIVER_INIT( namcos11 )
n_game = 0;
while( namcos11_config_table[ n_game ].s_name != NULL )
{
if( strcmp( machine->gamedrv->name, namcos11_config_table[ n_game ].s_name ) == 0 )
if( strcmp( machine->system().name, namcos11_config_table[ n_game ].s_name ) == 0 )
{
if( namcos11_config_table[ n_game ].keycus_r != NULL )
{
@ -977,7 +977,7 @@ static DRIVER_INIT( namcos11 )
n_game++;
}
if( strcmp( machine->gamedrv->name, "ptblank2a" ) == 0 )
if( strcmp( machine->system().name, "ptblank2a" ) == 0 )
{
machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f788000, 0x1f788003, FUNC(lightgun_w) );
machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x1f780000, 0x1f78000f, FUNC(lightgun_r) );

View File

@ -1107,8 +1107,8 @@ static WRITE32_HANDLER( bankoffset_w )
namcos12_state *state = space->machine->driver_data<namcos12_state>();
// Golgo 13 has different banking (maybe the keycus controls it?)
if( strcmp( space->machine->gamedrv->name, "golgo13" ) == 0 ||
strcmp( space->machine->gamedrv->name, "g13knd" ) == 0 )
if( strcmp( space->machine->system().name, "golgo13" ) == 0 ||
strcmp( space->machine->system().name, "g13knd" ) == 0 )
{
if( ( data & 8 ) != 0 )
{
@ -1371,10 +1371,10 @@ static MACHINE_RESET( namcos12 )
bankoffset_w(space,0,0,0xffffffff);
state->has_tektagt_dma = 0;
if( strcmp( machine->gamedrv->name, "tektagt" ) == 0 ||
strcmp( machine->gamedrv->name, "tektagta" ) == 0 ||
strcmp( machine->gamedrv->name, "tektagtb" ) == 0 ||
strcmp( machine->gamedrv->name, "tektagtc" ) == 0 )
if( strcmp( machine->system().name, "tektagt" ) == 0 ||
strcmp( machine->system().name, "tektagta" ) == 0 ||
strcmp( machine->system().name, "tektagtb" ) == 0 ||
strcmp( machine->system().name, "tektagtc" ) == 0 )
{
state->has_tektagt_dma = 1;
space->install_legacy_readwrite_handler(0x1fb00000, 0x1fb00003, FUNC(tektagt_protection_1_r), FUNC(tektagt_protection_1_w) );
@ -1382,24 +1382,24 @@ static MACHINE_RESET( namcos12 )
space->install_legacy_read_handler(0x1f700000, 0x1f700003, FUNC(tektagt_protection_3_r) );
}
if( strcmp( machine->gamedrv->name, "tektagt" ) == 0 ||
strcmp( machine->gamedrv->name, "tektagta" ) == 0 ||
strcmp( machine->gamedrv->name, "tektagtb" ) == 0 ||
strcmp( machine->gamedrv->name, "tektagtc" ) == 0 ||
strcmp( machine->gamedrv->name, "fgtlayer" ) == 0 ||
strcmp( machine->gamedrv->name, "golgo13" ) == 0 ||
strcmp( machine->gamedrv->name, "g13knd" ) == 0 ||
strcmp( machine->gamedrv->name, "mrdrillr" ) == 0 ||
strcmp( machine->gamedrv->name, "pacapp" ) == 0 ||
strcmp( machine->gamedrv->name, "pacappsp" ) == 0 ||
strcmp( machine->gamedrv->name, "pacapp2" ) == 0 ||
strcmp( machine->gamedrv->name, "tenkomorj" ) == 0 ||
strcmp( machine->gamedrv->name, "tenkomor" ) == 0 ||
strcmp( machine->gamedrv->name, "ptblank2" ) == 0 ||
strcmp( machine->gamedrv->name, "sws2000" ) == 0 ||
strcmp( machine->gamedrv->name, "sws2001" ) == 0 ||
strcmp( machine->gamedrv->name, "truckk" ) == 0 ||
strcmp( machine->gamedrv->name, "ghlpanic" ) == 0 )
if( strcmp( machine->system().name, "tektagt" ) == 0 ||
strcmp( machine->system().name, "tektagta" ) == 0 ||
strcmp( machine->system().name, "tektagtb" ) == 0 ||
strcmp( machine->system().name, "tektagtc" ) == 0 ||
strcmp( machine->system().name, "fgtlayer" ) == 0 ||
strcmp( machine->system().name, "golgo13" ) == 0 ||
strcmp( machine->system().name, "g13knd" ) == 0 ||
strcmp( machine->system().name, "mrdrillr" ) == 0 ||
strcmp( machine->system().name, "pacapp" ) == 0 ||
strcmp( machine->system().name, "pacappsp" ) == 0 ||
strcmp( machine->system().name, "pacapp2" ) == 0 ||
strcmp( machine->system().name, "tenkomorj" ) == 0 ||
strcmp( machine->system().name, "tenkomor" ) == 0 ||
strcmp( machine->system().name, "ptblank2" ) == 0 ||
strcmp( machine->system().name, "sws2000" ) == 0 ||
strcmp( machine->system().name, "sws2001" ) == 0 ||
strcmp( machine->system().name, "truckk" ) == 0 ||
strcmp( machine->system().name, "ghlpanic" ) == 0 )
{
/* this is based on guesswork, it might not even be keycus. */
space->install_read_bank (0x1fc20280, 0x1fc2028b, "bank2" );

View File

@ -2598,7 +2598,7 @@ static WRITE8_HANDLER( mcu_port5_w )
// bit 1 = fan
// bit 2 = button light
if (!strcmp(space->machine->gamedrv->name, "propcycl"))
if (!strcmp(space->machine->system().name, "propcycl"))
{
output_set_value("fan0", data & 1);
set_led_status(space->machine, 0, data & 2);

View File

@ -2001,9 +2001,9 @@ static VIDEO_START( ss23 )
tilemap_set_transparent_pen(bgtilemap, 0xf);
// Gorgon's tilemap offset is 0, S23/SS23's is 860
if ((!strcmp(machine->gamedrv->name, "rapidrvr")) ||
(!strcmp(machine->gamedrv->name, "rapidrvr2")) ||
(!strcmp(machine->gamedrv->name, "finlflng")))
if ((!strcmp(machine->system().name, "rapidrvr")) ||
(!strcmp(machine->system().name, "rapidrvr2")) ||
(!strcmp(machine->system().name, "finlflng")))
{
tilemap_set_scrolldx(bgtilemap, 0, 0);
}
@ -2649,21 +2649,21 @@ static DRIVER_INIT(ss23)
render_count[0] = render_count[1] = 0;
render_cur = 0;
if ((!strcmp(machine->gamedrv->name, "motoxgo")) ||
(!strcmp(machine->gamedrv->name, "panicprk")) ||
(!strcmp(machine->gamedrv->name, "rapidrvr")) ||
(!strcmp(machine->gamedrv->name, "rapidrvr2")) ||
(!strcmp(machine->gamedrv->name, "finlflng")) ||
(!strcmp(machine->gamedrv->name, "gunwars")) ||
(!strcmp(machine->gamedrv->name, "downhill")) ||
(!strcmp(machine->gamedrv->name, "finfurl2")) ||
(!strcmp(machine->gamedrv->name, "finfurl2j")) ||
(!strcmp(machine->gamedrv->name, "raceon")) ||
(!strcmp(machine->gamedrv->name, "crszone")) ||
(!strcmp(machine->gamedrv->name, "crszonea")) ||
(!strcmp(machine->gamedrv->name, "crszoneb")) ||
(!strcmp(machine->gamedrv->name, "timecrs2b")) ||
(!strcmp(machine->gamedrv->name, "timecrs2")))
if ((!strcmp(machine->system().name, "motoxgo")) ||
(!strcmp(machine->system().name, "panicprk")) ||
(!strcmp(machine->system().name, "rapidrvr")) ||
(!strcmp(machine->system().name, "rapidrvr2")) ||
(!strcmp(machine->system().name, "finlflng")) ||
(!strcmp(machine->system().name, "gunwars")) ||
(!strcmp(machine->system().name, "downhill")) ||
(!strcmp(machine->system().name, "finfurl2")) ||
(!strcmp(machine->system().name, "finfurl2j")) ||
(!strcmp(machine->system().name, "raceon")) ||
(!strcmp(machine->system().name, "crszone")) ||
(!strcmp(machine->system().name, "crszonea")) ||
(!strcmp(machine->system().name, "crszoneb")) ||
(!strcmp(machine->system().name, "timecrs2b")) ||
(!strcmp(machine->system().name, "timecrs2")))
{
has_jvsio = 1;
}

View File

@ -1426,7 +1426,7 @@ static NVRAM_HANDLER( naomi_eeproms )
// some games require defaults to boot (vertical, 1 player etc.)
for (i=0; i<ARRAY_LENGTH(jvseeprom_default_game); i++)
if (!strcmp(machine->gamedrv->name, jvseeprom_default_game[i].name))
if (!strcmp(machine->system().name, jvseeprom_default_game[i].name))
{
jvseeprom_default = jvseeprom_default_game[i].eeprom;
break;

View File

@ -137,9 +137,9 @@ static READ8_HANDLER( tmpz84c011_pio_r )
nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
int portdata;
if ((!strcmp(space->machine->gamedrv->name, "mscoutm")) ||
(!strcmp(space->machine->gamedrv->name, "imekura")) ||
(!strcmp(space->machine->gamedrv->name, "mjegolf")))
if ((!strcmp(space->machine->system().name, "mscoutm")) ||
(!strcmp(space->machine->system().name, "imekura")) ||
(!strcmp(space->machine->system().name, "mjegolf")))
{
switch (offset)
@ -318,9 +318,9 @@ static READ8_HANDLER( tmpz84c011_pio_r )
static WRITE8_HANDLER( tmpz84c011_pio_w )
{
if ((!strcmp(space->machine->gamedrv->name, "imekura")) ||
(!strcmp(space->machine->gamedrv->name, "mscoutm")) ||
(!strcmp(space->machine->gamedrv->name, "mjegolf")))
if ((!strcmp(space->machine->system().name, "imekura")) ||
(!strcmp(space->machine->system().name, "mscoutm")) ||
(!strcmp(space->machine->system().name, "mjegolf")))
{
switch (offset)

View File

@ -459,7 +459,7 @@ static WRITE32_HANDLER( lanc2_w )
}
if (offset == 4)
{
if (mame_stricmp(space->machine->gamedrv->name, "thrilld") == 0)
if (mame_stricmp(space->machine->system().name, "thrilld") == 0)
{
state->work_ram[(0x3ffed0/4) + 0] = 0x472a3731;
state->work_ram[(0x3ffed0/4) + 1] = 0x33202020;

View File

@ -211,7 +211,7 @@ static SCREEN_UPDATE( pinkiri8 )
int game_type_hack = 0;
if (!strcmp(screen->machine->gamedrv->name,"janshi")) game_type_hack = 1;
if (!strcmp(screen->machine->system().name,"janshi")) game_type_hack = 1;
if ( input_code_pressed_once(screen->machine, KEYCODE_W) )
{

View File

@ -1854,7 +1854,7 @@ static DRIVER_INIT( sngkace )
/* Enable other regions */
#if 0
if (!strcmp(machine->gamedrv->name,"sngkace"))
if (!strcmp(machine->system().name,"sngkace"))
{
UINT8 *ROM = machine->region("maincpu")->base();
ROM[0x995] = 0x4e;

View File

@ -267,7 +267,7 @@ WRITE16_HANDLER( mcu_prog_w2 )
{
char tmp[64];
FILE *fp;
sprintf(tmp,"cop3_%s.data", space->machine->gamedrv->name);
sprintf(tmp,"cop3_%s.data", space->machine->system().name);
fp=fopen(tmp, "w+b");
if (fp)

View File

@ -1031,7 +1031,7 @@ static SCREEN_UPDATE(sfbonus)
state->_1800_regs[7]);
#endif
ipt = screen->machine->gamedrv->ipt;
ipt = screen->machine->system().ipt;
if ((ipt == INPUT_PORTS_NAME(amcoe2_reels3)) || (ipt == INPUT_PORTS_NAME(amcoe2_reels4))
|| (ipt == INPUT_PORTS_NAME(amcoe2_poker)))
{
@ -5526,7 +5526,7 @@ static DRIVER_INIT( sfbonus_common)
{
FILE *fp;
char filename[256];
sprintf(filename,"decr_%s", machine->gamedrv->name);
sprintf(filename,"decr_%s", machine->system().name);
fp = fopen(filename, "w+b");
if (fp)
{

View File

@ -822,7 +822,7 @@ static READ32_HANDLER ( stv_io_r32 )
}
case 0x47:
{
if ( strcmp(space->machine->gamedrv->name,"critcrsh") == 0 )
if ( strcmp(space->machine->system().name,"critcrsh") == 0 )
{
int data1 = 0, data2 = 0;
@ -844,7 +844,7 @@ static READ32_HANDLER ( stv_io_r32 )
return (input_port_read(space->machine, "P1") << 16) | (input_port_read(space->machine, "P2"));
}
case 0x04/4:
if ( strcmp(space->machine->gamedrv->name,"critcrsh") == 0 )
if ( strcmp(space->machine->system().name,"critcrsh") == 0 )
return ((input_port_read(space->machine, "SYSTEM") << 16) & ((input_port_read(space->machine, "P1") & 1) ? 0xffef0000 : 0xffff0000)) | (ioga[1]);
else
return (input_port_read(space->machine, "SYSTEM") << 16) | (ioga[1]);

View File

@ -3480,7 +3480,7 @@ void dump_decrypted(running_machine* machine, UINT8* decrypt)
{
FILE *fp;
char filename[256];
sprintf(filename,"dat_%s", machine->gamedrv->name);
sprintf(filename,"dat_%s", machine->system().name);
fp=fopen(filename, "w+b");
if (fp)
{

View File

@ -648,8 +648,8 @@ static WRITE32_HANDLER( skns_io_w )
/* idle skip for vblokbrk/sarukani, i can't find a better place to put it :-( but i think it works ok unless its making the game too fast */
if (cpu_get_pc(space->cpu)==0x04013B42)
{
if (!strcmp(space->machine->gamedrv->name,"vblokbrk") ||
!strcmp(space->machine->gamedrv->name,"sarukani"))
if (!strcmp(space->machine->system().name,"vblokbrk") ||
!strcmp(space->machine->system().name,"sarukani"))
device_spin_until_interrupt(space->cpu);
}

View File

@ -884,22 +884,22 @@ static READ8_HANDLER( fixeight_region_r )
// this code, and the default eeproms use should be considered subject
// to change
if (!strcmp(space->machine->gamedrv->name,"fixeightkt")) return 0x00;
if (!strcmp(space->machine->gamedrv->name,"fixeightk")) return 0x01;
if (!strcmp(space->machine->gamedrv->name,"fixeightht")) return 0x02;
if (!strcmp(space->machine->gamedrv->name,"fixeighth")) return 0x03;
if (!strcmp(space->machine->gamedrv->name,"fixeighttwt")) return 0x04;
if (!strcmp(space->machine->gamedrv->name,"fixeighttw")) return 0x05;
if (!strcmp(space->machine->gamedrv->name,"fixeightat")) return 0x06;
if (!strcmp(space->machine->gamedrv->name,"fixeighta")) return 0x07;
if (!strcmp(space->machine->gamedrv->name,"fixeightt")) return 0x08;
if (!strcmp(space->machine->gamedrv->name,"fixeight9")) return 0x09;
if (!strcmp(space->machine->gamedrv->name,"fixeighta")) return 0x0a;
if (!strcmp(space->machine->gamedrv->name,"fixeightu")) return 0x0b;
// if (!strcmp(space->machine->gamedrv->name,"fixeightc")) return 0x0c; // invalid
// if (!strcmp(space->machine->gamedrv->name,"fixeightd")) return 0x0d; // invalid
if (!strcmp(space->machine->gamedrv->name,"fixeightj")) return 0x0e;
if (!strcmp(space->machine->gamedrv->name,"fixeightjt")) return 0x0f;
if (!strcmp(space->machine->system().name,"fixeightkt")) return 0x00;
if (!strcmp(space->machine->system().name,"fixeightk")) return 0x01;
if (!strcmp(space->machine->system().name,"fixeightht")) return 0x02;
if (!strcmp(space->machine->system().name,"fixeighth")) return 0x03;
if (!strcmp(space->machine->system().name,"fixeighttwt")) return 0x04;
if (!strcmp(space->machine->system().name,"fixeighttw")) return 0x05;
if (!strcmp(space->machine->system().name,"fixeightat")) return 0x06;
if (!strcmp(space->machine->system().name,"fixeighta")) return 0x07;
if (!strcmp(space->machine->system().name,"fixeightt")) return 0x08;
if (!strcmp(space->machine->system().name,"fixeight9")) return 0x09;
if (!strcmp(space->machine->system().name,"fixeighta")) return 0x0a;
if (!strcmp(space->machine->system().name,"fixeightu")) return 0x0b;
// if (!strcmp(space->machine->system().name,"fixeightc")) return 0x0c; // invalid
// if (!strcmp(space->machine->system().name,"fixeightd")) return 0x0d; // invalid
if (!strcmp(space->machine->system().name,"fixeightj")) return 0x0e;
if (!strcmp(space->machine->system().name,"fixeightjt")) return 0x0f;
return 0x00;
}

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