} //driver_callback_delegate(&_class::MACHINE_RESET_NAME(_func), #_class "::machine_reset_" #_func, downcast<_class *>(owner))); //define MCFG_MACHINE_RESET_REMOVE() driver_device::static_set_callback(config.root_device(), driver_device::CB_MACHINE_RESET, driver_callback_delegate()); // core video callbacks public static void MCFG_VIDEO_START_OVERRIDE(machine_config config, driver_callback_delegate func) { driver_device.static_set_callback(config.root_device(), driver_device.callback_type.CB_VIDEO_START, func); } //driver_callback_delegate(&_class::VIDEO_START_NAME(_func), #_class "::video_start_" #_func, downcast<_class *>(owner)));
} //driver_callback_delegate(&_class::MACHINE_START_NAME(_func), #_class "::machine_start_" #_func, downcast<_class *>(owner))); public static void MCFG_MACHINE_RESET_OVERRIDE(machine_config config, driver_callback_delegate func) { driver_device.static_set_callback(config.root_device(), driver_device.callback_type.CB_MACHINE_RESET, func); } //driver_callback_delegate(&_class::MACHINE_RESET_NAME(_func), #_class "::machine_reset_" #_func, downcast<_class *>(owner)));
// parsing wrappers //------------------------------------------------- // parse_standard_inis - parse the standard set // of INI files //------------------------------------------------- public static void parse_standard_inis(emu_options options, out string error_stream, game_driver driver = null) { error_stream = ""; // parse the INI file defined by the platform (e.g., "mame.ini") // we do this twice so that the first file can change the INI path parse_one_ini(options, emulator_info.get_configname(), OPTION_PRIORITY_MAME_INI, ref error_stream); parse_one_ini(options, emulator_info.get_configname(), OPTION_PRIORITY_MAME_INI, ref error_stream); // debug mode: parse "debug.ini" as well if (options.debug()) { parse_one_ini(options, "debug", OPTION_PRIORITY_DEBUG_INI, ref error_stream); } // if we have a valid system driver, parse system-specific INI files game_driver cursystem = driver == null?system(options) : driver; if (cursystem == null) { return; } // parse "vertical.ini" or "horizont.ini" if (((UInt32)cursystem.flags & ORIENTATION_SWAP_XY) != 0) { parse_one_ini(options, "vertical", OPTION_PRIORITY_ORIENTATION_INI, ref error_stream); } else { parse_one_ini(options, "horizont", OPTION_PRIORITY_ORIENTATION_INI, ref error_stream); } switch (cursystem.flags & machine_flags.type.MASK_TYPE) { case machine_flags.type.TYPE_ARCADE: parse_one_ini(options, "arcade", OPTION_PRIORITY_SYSTYPE_INI, ref error_stream); break; case machine_flags.type.TYPE_CONSOLE: parse_one_ini(options, "console", OPTION_PRIORITY_SYSTYPE_INI, ref error_stream); break; case machine_flags.type.TYPE_COMPUTER: parse_one_ini(options, "computer", OPTION_PRIORITY_SYSTYPE_INI, ref error_stream); break; case machine_flags.type.TYPE_OTHER: parse_one_ini(options, "othersys", OPTION_PRIORITY_SYSTYPE_INI, ref error_stream); break; default: break; } machine_config config = new machine_config(cursystem, options); foreach (screen_device device in new screen_device_iterator(config.root_device())) { // parse "raster.ini" for raster games if (device.screen_type() == screen_type_enum.SCREEN_TYPE_RASTER) { parse_one_ini(options, "raster", OPTION_PRIORITY_SCREEN_INI, ref error_stream); break; } // parse "vector.ini" for vector games if (device.screen_type() == screen_type_enum.SCREEN_TYPE_VECTOR) { parse_one_ini(options, "vector", OPTION_PRIORITY_SCREEN_INI, ref error_stream); break; } // parse "lcd.ini" for lcd games if (device.screen_type() == screen_type_enum.SCREEN_TYPE_LCD) { parse_one_ini(options, "lcd", OPTION_PRIORITY_SCREEN_INI, ref error_stream); break; } } // next parse "source/<sourcefile>.ini" string sourcename = core_filename_extract_base(cursystem.type.source(), true).Insert(0, "source" + PATH_SEPARATOR); parse_one_ini(options, sourcename, OPTION_PRIORITY_SOURCE_INI, ref error_stream); // then parse the grandparent, parent, and system-specific INIs int parent = driver_list.clone(cursystem); int gparent = (parent != -1) ? driver_list.clone(parent) : -1; if (gparent != -1) { parse_one_ini(options, driver_list.driver(gparent).name, OPTION_PRIORITY_GPARENT_INI, ref error_stream); } if (parent != -1) { parse_one_ini(options, driver_list.driver(parent).name, OPTION_PRIORITY_PARENT_INI, ref error_stream); } parse_one_ini(options, cursystem.name, OPTION_PRIORITY_DRIVER_INI, ref error_stream); }
public device_t root_device() { return(m_config.root_device()); }
//------------------------------------------------- // validate_drivers - master validity checker //------------------------------------------------- void validate_one(game_driver driver) { // help verbose validation detect configuration-related crashes if (m_print_verbose) { output_via_delegate(osd_output_channel.OSD_OUTPUT_CHANNEL_ERROR, "Validating driver {0} ({1})...\n", driver.name, core_filename_extract_base(driver.type.source()).c_str()); } // set the current driver m_current_driver = driver; m_current_config = null; m_current_device = null; m_current_ioport = null; m_region_map.clear(); // reset error/warning state int start_errors = m_errors; int start_warnings = m_warnings; m_error_text = ""; m_warning_text = ""; m_verbose_text = ""; // wrap in try/except to catch fatalerrors try { machine_config config = new machine_config(driver, m_blank_options); m_current_config = config; validate_driver(); validate_roms(m_current_config.root_device()); validate_inputs(); validate_devices(); m_current_config = null; } catch (emu_fatalerror err) { osd_printf_error("Fatal error {0}", err.str()); } // if we had warnings or errors, output if (m_errors > start_errors || m_warnings > start_warnings || !string.IsNullOrEmpty(m_verbose_text)) { if (!m_print_verbose) { output_via_delegate(osd_output_channel.OSD_OUTPUT_CHANNEL_ERROR, "Driver {0} (file {1}): {2} errors, {3} warnings\n", driver.name, core_filename_extract_base(driver.type.source()), m_errors - start_errors, m_warnings - start_warnings); } output_via_delegate(osd_output_channel.OSD_OUTPUT_CHANNEL_ERROR, "{0} errors, {1} warnings\n", m_errors - start_errors, m_warnings - start_warnings); if (m_errors > start_errors) { output_indented_errors(m_error_text, "Errors"); } if (m_warnings > start_warnings) { output_indented_errors(m_warning_text, "Warnings"); } if (!string.IsNullOrEmpty(m_verbose_text)) { output_indented_errors(m_verbose_text, "Messages"); } output_via_delegate(osd_output_channel.OSD_OUTPUT_CHANNEL_ERROR, "\n"); } // reset the driver/device m_current_driver = null; m_current_config = null; m_current_device = null; m_current_ioport = null; }