Example #1
0
        //-------------------------------------------------
        //  game_info_string - return the game info text
        //-------------------------------------------------
        public string game_info_string()
        {
            string buf = "";  //std::ostringstream buf;

            // print description, manufacturer, and CPU:
            util.stream_format(ref buf, __("{0}\n{1} {2}\nDriver: {3}\n\nCPU:\n"),  //util::stream_format(buf, _("%1$s\n%2$s %3$s\nDriver: %4$s\n\nCPU:\n"),
                               system_list.instance().systems()[driver_list.find(m_machine.system().name)].description,
                               m_machine.system().year,
                               m_machine.system().manufacturer,
                               core_filename_extract_base(m_machine.system().type.source()));

            // loop over all CPUs
            execute_interface_enumerator execiter = new execute_interface_enumerator(m_machine.root_device());

            std.unordered_set <string> exectags = new std.unordered_set <string>();
            foreach (device_execute_interface exec in execiter)
            {
                if (!exectags.insert(exec.device().tag()))  //.second)
                {
                    continue;
                }

                // get cpu specific clock that takes internal multiplier/dividers into account
                u32 clock = exec.device().clock();

                // count how many identical CPUs we have
                int    count = 1;
                string name  = exec.device().name();
                foreach (device_execute_interface scan in execiter)
                {
                    if (exec.device().type() == scan.device().type() && std.strcmp(name, scan.device().name()) == 0 && exec.device().clock() == scan.device().clock())
                    {
                        if (exectags.insert(scan.device().tag()))  //.second)
                        {
                            count++;
                        }
                    }
                }

                string hz = std.to_string(clock);
                int    d  = (clock >= 1000000000) ? 9 : (clock >= 1000000) ? 6 : (clock >= 1000) ? 3 : 0;
                if (d > 0)
                {
                    size_t dpos = hz.length() - (size_t)d;
                    hz = hz.insert_(dpos, ".");
                    size_t last = hz.find_last_not_of('0');
                    hz = hz.substr(0, last + (last != dpos ? 1U : 0U));
                }

                // if more than one, prepend a #x in front of the CPU name and display clock
                util.stream_format(ref buf,
                                   (count > 1)
                            ? ((clock != 0) ? "{0}X{1} {2} {3}\n" : "{1}x{2}\n") //? ((clock != 0) ? "%1$d" UTF8_MULTIPLY "%2$s %3$s" UTF8_NBSP "%4$s\n" : "%1$d" UTF8_MULTIPLY "%2$s\n")
                            : ((clock != 0) ? "{1} {2} {3}\n" : "{1}\n"),        //: ((clock != 0) ? "%2$s %3$s" UTF8_NBSP "%4$s\n" : "%2$s\n"),
                                   count, name, hz,
                                   (d == 9) ? __("GHz") : (d == 6) ? __("MHz") : (d == 3) ? __("kHz") : __("Hz"));
            }

            // loop over all sound chips
            sound_interface_enumerator snditer = new sound_interface_enumerator(m_machine.root_device());

            std.unordered_set <string> soundtags = new std.unordered_set <string>();
            bool found_sound = false;

            foreach (device_sound_interface sound in snditer)
            {
                if (!sound.issound() || !soundtags.insert(sound.device().tag()))  //.second)
                {
                    continue;
                }

                // append the Sound: string
                if (!found_sound)
                {
                    buf += __("\nSound:\n");
                }

                found_sound = true;

                // count how many identical sound chips we have
                int count = 1;
                foreach (device_sound_interface scan in snditer)
                {
                    if (sound.device().type() == scan.device().type() && sound.device().clock() == scan.device().clock())
                    {
                        if (soundtags.insert(scan.device().tag()))  //.second)
                        {
                            count++;
                        }
                    }
                }

                u32    clock = sound.device().clock();
                string hz    = std.to_string(clock);
                int    d     = (clock >= 1000000000) ? 9 : (clock >= 1000000) ? 6 : (clock >= 1000) ? 3 : 0;
                if (d > 0)
                {
                    size_t dpos = hz.length() - (size_t)d;
                    hz = hz.insert_(dpos, ".");
                    size_t last = hz.find_last_not_of('0');
                    hz = hz.substr(0, last + (last != dpos ? 1U : 0U));
                }

                // if more than one, prepend a #x in front of the soundchip name and display clock
                util.stream_format(ref buf,
                                   (count > 1)
                            ? ((clock != 0) ? "{0}X{1} {2} {3}\n" : "{0}X{1}\n") //? ((clock != 0) ? "%1$d" UTF8_MULTIPLY "%2$s %3$s" UTF8_NBSP "%4$s\n" : "%1$d" UTF8_MULTIPLY "%2$s\n")
                            : ((clock != 0) ? "{1} {2} {3}\n" : "{1}\n"),        //: ((clock != 0) ? "%2$s %3$s" UTF8_NBSP "%4$s\n" : "%2$s\n"),
                                   count, sound.device().name(), hz,
                                   (d == 9) ? __("GHz") : (d == 6) ? __("MHz") : (d == 3) ? __("kHz") : __("Hz"));
            }

            // display screen information
            buf += __("\nVideo:\n");
            screen_device_enumerator scriter = new screen_device_enumerator(m_machine.root_device());
            int scrcount = scriter.count();

            if (scrcount == 0)
            {
                buf += __("None\n");
            }
            else
            {
                foreach (screen_device screen in scriter)
                {
                    string detail;
                    if (screen.screen_type() == screen_type_enum.SCREEN_TYPE_VECTOR)
                    {
                        detail = __("Vector");
                    }
                    else
                    {
                        string hz   = std.to_string((float)screen.frame_period().as_hz());
                        size_t last = hz.find_last_not_of('0');
                        size_t dpos = hz.find_last_of('.');
                        hz = hz.substr(0, last + (last != dpos ? 1U : 0U));

                        rectangle visarea = screen.visible_area();
                        detail = util.string_format("{0} X {1} ({2}) {3} Hz",  //detail = string_format("%d " UTF8_MULTIPLY " %d (%s) %s" UTF8_NBSP "Hz",
                                                    visarea.width(), visarea.height(),
                                                    (screen.orientation() & ORIENTATION_SWAP_XY) != 0 ? "V" : "H",
                                                    hz);
                    }

                    util.stream_format(ref buf,
                                       (scrcount > 1) ? __("{0}: {1}\n") : __("{1}\n"), //(scrcount > 1) ? _("%1$s: %2$s\n") : _("%2$s\n"),
                                       get_screen_desc(screen), detail);
                }
            }

            return(buf);
        }
Example #2
0
        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';
                }
            }
        }
Example #3
0
File: info.cs Project: kwanboy/mcs
        // 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());
        }