public static void get_general_warnings(ref string buf, running_machine machine, machine_flags.type flags, device_t_feature_type unemulated, device_t_feature_type imperfect) //void get_general_warnings(std::ostream &buf, running_machine &machine, machine_flags::type flags, device_t::feature_type unemulated, device_t::feature_type imperfect) { // add a warning if any ROMs were loaded with warnings bool bad_roms = false; if (machine.rom_load().warnings() > 0) { bad_roms = true; buf += __("One or more ROMs/CHDs for this machine are incorrect. The machine may not run correctly.\n"); } if (!machine.rom_load().software_load_warnings_message().empty()) { bad_roms = true; buf += machine.rom_load().software_load_warnings_message(); } // if we have at least one warning flag, print the general header if ((machine.rom_load().knownbad() > 0) || (flags & (MACHINE_ERRORS | MACHINE_WARNINGS | MACHINE_BTANB)) != 0 || unemulated != 0 || imperfect != 0) { if (bad_roms) { 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 (machine.rom_load().knownbad() > 0) { buf += __("One or more ROMs/CHDs for this machine have not been correctly dumped.\n"); } }
// 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()); }