public static void get_system_warnings(ref string buf, running_machine machine, machine_flags.type flags, device_t_feature_type unemulated, device_t_feature_type imperfect) { // start with the unemulated/imperfect features get_device_warnings(ref buf, unemulated, imperfect); // add one line per machine warning flag if ((flags & machine_flags.type.NO_COCKTAIL) != 0) { buf += __("Screen flipping in cocktail mode is not supported.\n"); } if ((flags & machine_flags.type.REQUIRES_ARTWORK) != 0) { buf += __("This machine requires external artwork files.\n"); } if ((flags & machine_flags.type.IS_INCOMPLETE) != 0) { buf += __("This machine was never completed. It may exhibit strange behavior or missing elements that are not bugs in the emulation.\n"); } if ((flags & machine_flags.type.NO_SOUND_HW) != 0) { buf += __("This machine has no sound hardware, MAME will produce no sounds, this is expected behaviour.\n"); } // these are more severe warnings if ((flags & machine_flags.type.NOT_WORKING) != 0) { buf += __("\nTHIS MACHINE DOESN'T WORK. The emulation for this machine 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 ((flags & machine_flags.type.MECHANICAL) != 0) { buf += __("\nElements of this machine cannot be emulated as they require physical interaction or consist of mechanical devices. It is not possible to fully experience this machine.\n"); } if ((flags & MACHINE_ERRORS) != 0 || ((machine.system().type.unemulated_features() | machine.system().type.imperfect_features()) & device_t_feature.type.PROTECTION) != 0) { // find the parent of this driver driver_enumerator drivlist = new driver_enumerator(machine.options()); int maindrv = driver_list.find(machine.system()); int clone_of = driver_list.non_bios_clone((size_t)maindrv); if (clone_of != -1) { maindrv = clone_of; } // scan the driver list for any working clones and add them bool foundworking = false; while (drivlist.next()) { if (drivlist.current() == maindrv || drivlist.clone() == maindrv) { game_driver driver = drivlist.driver(); if ((driver.flags & MACHINE_ERRORS) == 0 && ((driver.type.unemulated_features() | driver.type.imperfect_features()) & device_t_feature.type.PROTECTION) == 0) { // this one works, add a header and display the name of the clone if (!foundworking) { util.stream_format(ref buf, __("\n\nThere are working clones of this machine: {0}"), driver.name); } else { util.stream_format(ref buf, __(", {0}"), driver.name); } foundworking = true; } } } if (foundworking) { buf += '\n'; } } }
// handlers //------------------------------------------------- // handle select key event //------------------------------------------------- void inkey_select(event_ menu_event) { var system = (ui_system_info)menu_event.itemref; int driverint = menu_event.itemref is int?(int)menu_event.itemref : -1; if (driverint == CONF_OPTS) { // special case for configure options throw new emu_unimplemented(); #if false #endif } else if (driverint == CONF_MACHINE) { // special case for configure machine throw new emu_unimplemented(); #if false #endif } else { // anything else is a driver driver_enumerator enumerator = new driver_enumerator(machine().options(), system.driver); enumerator.next(); // if there are software entries, show a software selection menu foreach (software_list_device swlistdev in new software_list_device_enumerator(enumerator.config().root_device())) { if (!swlistdev.get_info().empty()) { throw new emu_unimplemented(); #if false #endif } } // audit the system ROMs first to see if we're going to work media_auditor auditor = new media_auditor(enumerator); media_auditor.summary summary = auditor.audit_media(media_auditor.AUDIT_VALIDATE_FAST); // MCS - always pass audit //throw new emu_unimplemented(); summary = media_auditor.summary.CORRECT; // if everything looks good, schedule the new driver if (audit_passed(summary)) { if (!select_bios(system.driver, false)) { launch_system(system.driver); } } else { // otherwise, display an error set_error(reset_options.REMEMBER_REF, make_system_audit_fail_text(auditor, summary)); } } }
// text generators //------------------------------------------------- // warnings_string - print the warning flags // text to the given buffer //------------------------------------------------- public string warnings_string() { string buf = ""; // add a warning if any ROMs were loaded with warnings if (m_machine.rom_load().warnings() > 0) { buf += "One or more ROMs/CHDs for this machine are incorrect. The machine may not run correctly.\n"; } if (!m_machine.rom_load().software_load_warnings_message().empty()) { buf += m_machine.rom_load().software_load_warnings_message(); } // if we have at least one warning flag, print the general header if ((m_machine.rom_load().knownbad() > 0) || (machine_flags_get() & (MACHINE_ERRORS | MACHINE_WARNINGS | MACHINE_BTANB)) != 0 || unemulated_features() != 0 || imperfect_features() != 0) { if (!buf.str().empty()) { buf += "\n"; } buf += "There are known problems with this machine\n\n"; } // add a warning if any ROMs are flagged BAD_DUMP/NO_DUMP if (m_machine.rom_load().knownbad() > 0) { buf += "One or more ROMs/CHDs for this machine have not been correctly dumped.\n"; } // add line for unemulated features if (unemulated_features() != 0) { buf += "Completely unemulated features: "; bool first = true; foreach (var feature in FEATURE_NAMES) { if ((unemulated_features() & feature.Key) != 0) { buf += string.Format(first ? "{0}" : ", {0}", feature.Value); first = false; } } buf += "\n"; } // add line for imperfect features if (imperfect_features() != 0) { buf += "Imperfectly emulated features: "; bool first = true; foreach (var feature in FEATURE_NAMES) { if ((imperfect_features() & feature.Key) != 0) { buf += string.Format(first ? "{0}" : ", {0}", feature.Value); first = false; } } buf += "\n"; } // add one line per machine warning flag if ((machine_flags_get() & machine_flags.type.NO_COCKTAIL) != 0) { buf += "Screen flipping in cocktail mode is not supported.\n"; } if ((machine_flags_get() & machine_flags.type.REQUIRES_ARTWORK) != 0) // check if external artwork is present before displaying this warning? { buf += "This machine requires external artwork files.\n"; } if ((machine_flags_get() & machine_flags.type.IS_INCOMPLETE) != 0) { buf += "This machine was never completed. It may exhibit strange behavior or missing elements that are not bugs in the emulation.\n"; } if ((machine_flags_get() & machine_flags.type.NO_SOUND_HW) != 0) { buf += "This machine has no sound hardware, MAME will produce no sounds, this is expected behaviour.\n"; } // these are more severe warnings if ((machine_flags_get() & machine_flags.type.NOT_WORKING) != 0) { buf += "\nTHIS MACHINE DOESN'T WORK. The emulation for this machine 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_flags_get() & machine_flags.type.MECHANICAL) != 0) { buf += "\nElements of this machine cannot be emulated as they requires physical interaction or consist of mechanical devices. It is not possible to fully experience this machine.\n"; } if ((machine_flags_get() & MACHINE_ERRORS) != 0 || ((m_machine.system().type.unemulated_features() | m_machine.system().type.imperfect_features()) & emu.detail.device_feature.type.PROTECTION) != 0) { // find the parent of this driver driver_enumerator drivlist = new driver_enumerator(m_machine.options()); int maindrv = driver_list.find(m_machine.system()); int clone_of = driver_list.non_bios_clone(maindrv); if (clone_of != -1) { maindrv = clone_of; } // scan the driver list for any working clones and add them bool foundworking = false; while (drivlist.next()) { if (drivlist.current() == maindrv || drivlist.clone() == maindrv) { game_driver driver = drivlist.driver(); if ((driver.flags & MACHINE_ERRORS) == 0 && ((driver.type.unemulated_features() | driver.type.imperfect_features()) & emu.detail.device_feature.type.PROTECTION) == 0) { // this one works, add a header and display the name of the clone if (!foundworking) { buf += string.Format("\n\nThere are working clones of this machine: {0}", driver.name); } else { buf += string.Format(", {0}", driver.name); } foundworking = true; } } } if (foundworking) { buf += "\n"; } } // add the 'press OK' string if (!buf.str().empty()) { buf += "\n\nPress any key to continue"; } return(buf.str()); }
//------------------------------------------------- // handle select key event for favorites menu //------------------------------------------------- void inkey_select_favorite(event_ menu_event) { ui_software_info ui_swinfo = (ui_software_info)menu_event.itemref; int ui_swinfoint = (int)menu_event.itemref; if (ui_swinfoint == CONF_OPTS) { throw new emu_unimplemented(); #if false #endif } else if (ui_swinfoint == CONF_MACHINE) { // special case for configure machine if (m_prev_selected != null) { ui_software_info swinfo = (ui_software_info)m_prev_selected; throw new emu_unimplemented(); #if false #endif } return; } else if (ui_swinfo.startempty == 1) { driver_enumerator enumerator = new driver_enumerator(machine().options(), ui_swinfo.driver); enumerator.next(); // if there are software entries, show a software selection menu foreach (software_list_device swlistdev in new software_list_device_enumerator(enumerator.config().root_device())) { if (!swlistdev.get_info().empty()) { throw new emu_unimplemented(); #if false #endif } } // audit the system ROMs first to see if we're going to work media_auditor auditor = new media_auditor(enumerator); media_auditor.summary summary = auditor.audit_media(media_auditor.AUDIT_VALIDATE_FAST); if (audit_passed(summary)) { // if everything looks good, schedule the new driver if (!select_bios(ui_swinfo.driver, false)) { reselect_last.reselect(true); launch_system(ui_swinfo.driver); } } else { // otherwise, display an error set_error(reset_options.REMEMBER_REF, make_system_audit_fail_text(auditor, summary)); } } else { // first audit the system ROMs driver_enumerator drv = new driver_enumerator(machine().options(), ui_swinfo.driver); media_auditor auditor = new media_auditor(drv); drv.next(); media_auditor.summary sysaudit = auditor.audit_media(media_auditor.AUDIT_VALIDATE_FAST); if (!audit_passed(sysaudit)) { set_error(reset_options.REMEMBER_REF, make_system_audit_fail_text(auditor, sysaudit)); } else { // now audit the software software_list_device swlist = software_list_device.find_by_name(drv.config(), ui_swinfo.listname); software_info swinfo = swlist.find(ui_swinfo.shortname); media_auditor.summary swaudit = auditor.audit_software(swlist, swinfo, media_auditor.AUDIT_VALIDATE_FAST); if (audit_passed(swaudit)) { throw new emu_unimplemented(); #if false #endif } else { // otherwise, display an error set_error(reset_options.REMEMBER_REF, make_software_audit_fail_text(auditor, swaudit)); } } } }