diff options
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/mame/clifront.cpp | 6 | ||||
-rw-r--r-- | src/frontend/mame/infoxml.cpp | 10 | ||||
-rw-r--r-- | src/frontend/mame/luaengine.cpp | 2 | ||||
-rw-r--r-- | src/frontend/mame/media_ident.cpp | 2 | ||||
-rw-r--r-- | src/frontend/mame/ui/devopt.cpp | 10 | ||||
-rw-r--r-- | src/frontend/mame/ui/info.cpp | 8 | ||||
-rw-r--r-- | src/frontend/mame/ui/ui.cpp | 2 |
7 files changed, 20 insertions, 20 deletions
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index dfe0436e079..3552eff559a 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -766,7 +766,7 @@ void cli_frontend::listdevices(const std::vector<std::string> &args) printf(" %*s%-*s %s", depth * 2, "", 30 - depth * 2, tag, device->name()); // add more information - uint32_t clock = device->clock(); + uint32_t clock = device->clock().value(); if (clock >= 1000000000) printf(" @ %d.%02d GHz\n", clock / 1000000000, (clock / 10000000) % 100); else if (clock >= 1000000) @@ -974,7 +974,7 @@ void cli_frontend::verifyroms(const std::vector<std::string> &args) if (included(type.shortname())) { // audit the ROMs in this set - device_t *const dev = config.device_add("_tmp", type, 0); + device_t *const dev = config.device_add("_tmp", type); media_auditor::summary summary = auditor.audit_device(*dev, AUDIT_VALIDATE_FAST); print_summary( @@ -1620,7 +1620,7 @@ template <typename T> void cli_frontend::apply_device_action(const std::vector<s }, [&action, &config] (device_type type, bool first) { - device_t *const dev = config.device_add("_tmp", type, 0); + device_t *const dev = config.device_add("_tmp", type); action(*dev, "device", first); config.device_remove("_tmp"); }); diff --git a/src/frontend/mame/infoxml.cpp b/src/frontend/mame/infoxml.cpp index 4b5d3902c98..4a085b9e6bb 100644 --- a/src/frontend/mame/infoxml.cpp +++ b/src/frontend/mame/infoxml.cpp @@ -900,7 +900,7 @@ void output_devices(std::ostream &out, emu_options &lookup_options, device_type_ device_t *dev; { machine_config::token const tok(config.begin_configuration(config.root_device())); - dev = config.device_add("_tmp", type, 0); + dev = config.device_add("_tmp", type); } // notify this device and all its subdevices that they are now configured @@ -1171,7 +1171,7 @@ void output_chips(std::ostream &out, device_t &device, const char *root_tag) out << " type=\"cpu\""; util::stream_format(out, " tag=\"%s\"", normalize_string(newtag)); util::stream_format(out, " name=\"%s\"", normalize_string(exec.device().name())); - util::stream_format(out, " clock=\"%d\"", exec.device().clock()); + util::stream_format(out, " clock=\"%d\"", exec.device().clock().value()); out << "/>\n"; } } @@ -1188,8 +1188,8 @@ void output_chips(std::ostream &out, device_t &device, const char *root_tag) out << " type=\"audio\""; util::stream_format(out, " tag=\"%s\"", normalize_string(newtag)); util::stream_format(out, " name=\"%s\"", normalize_string(sound.device().name())); - if (sound.device().clock() != 0) - util::stream_format(out, " clock=\"%d\"", sound.device().clock()); + if (!sound.device().clock().disabled()) + util::stream_format(out, " clock=\"%d\"", sound.device().clock().value()); out << "/>\n"; } } @@ -2203,7 +2203,7 @@ char const *get_merge_name(machine_config &config, device_t const &device, util: { // instantiate the parent device machine_config::token const tok(config.begin_configuration(config.root_device())); - device_t *const parent = config.device_add("_parent", *parenttype, 0); + device_t *const parent = config.device_add("_parent", *parenttype); // look in the parent's ROMs result = get_merge_name(parent->rom_region(), romhashes); diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index 386d6dc841d..d0a3a8ee141 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -1752,7 +1752,7 @@ void lua_engine::initialize() dislot_option_type["device_shortname"] = sol::property([] (device_slot_interface::slot_option &opt) { return opt.devtype().shortname(); }); dislot_option_type["selectable"] = sol::property(&device_slot_interface::slot_option::selectable); dislot_option_type["default_bios"] = sol::property(static_cast<char const * (device_slot_interface::slot_option::*)() const>(&device_slot_interface::slot_option::default_bios)); - dislot_option_type["clock"] = sol::property(static_cast<u32 (device_slot_interface::slot_option::*)() const>(&device_slot_interface::slot_option::clock)); + dislot_option_type["clock"] = sol::property([] (device_slot_interface::slot_option &opt) -> u32 { return opt.clock().value(); }); auto parameters_type = sol().registry().new_usertype<parameters_manager>("parameters", sol::no_constructor); diff --git a/src/frontend/mame/media_ident.cpp b/src/frontend/mame/media_ident.cpp index d09858198ea..e8e646924d9 100644 --- a/src/frontend/mame/media_ident.cpp +++ b/src/frontend/mame/media_ident.cpp @@ -389,7 +389,7 @@ void media_identifier::match_hashes(std::vector<file_info> &info) machine_config::token const tok(config.begin_configuration(config.root_device())); for (device_type type : registered_device_types) { - match_device(*config.device_add("_tmp", type, 0)); + match_device(*config.device_add("_tmp", type)); config.device_remove("_tmp"); } } diff --git a/src/frontend/mame/ui/devopt.cpp b/src/frontend/mame/ui/devopt.cpp index 1fc1e83564f..35d362aa354 100644 --- a/src/frontend/mame/ui/devopt.cpp +++ b/src/frontend/mame/ui/devopt.cpp @@ -50,7 +50,7 @@ void menu_device_config::populate_text(std::optional<text_layout> &layout, float machine_config &mconfig(const_cast<machine_config &>(machine().config())); machine_config::token const tok(mconfig.begin_configuration(mconfig.root_device())); - device_t *const dev = mconfig.device_add(m_option->name(), m_option->devtype(), 0); + device_t *const dev = mconfig.device_add(m_option->name(), m_option->devtype()); for (device_t &d : device_enumerator(*dev)) if (!d.configured()) d.config_complete(); @@ -76,14 +76,14 @@ void menu_device_config::populate_text(std::optional<text_layout> &layout, float continue; // get cpu specific clock that takes internal multiplier/dividers into account - u32 clock = exec.device().clock(); + u32 clock = exec.device().clock().value(); // count how many identical CPUs we have int count = 1; const char *name = exec.device().name(); for (device_execute_interface &scan : execiter) { - if (exec.device().type() == scan.device().type() && strcmp(name, scan.device().name()) == 0 && exec.device().clock() == scan.device().clock()) + if (exec.device().type() == scan.device().type() && strcmp(name, scan.device().name()) == 0 && exec.device().clock().value() == scan.device().clock().value()) if (exectags.insert(scan.device().tag()).second) count++; } @@ -164,12 +164,12 @@ void menu_device_config::populate_text(std::optional<text_layout> &layout, float int count = 1; for (device_sound_interface &scan : snditer) { - if (sound.device().type() == scan.device().type() && sound.device().clock() == scan.device().clock()) + if (sound.device().type() == scan.device().type() && sound.device().clock().value() == scan.device().clock().value()) if (soundtags.insert(scan.device().tag()).second) count++; } - const u32 clock = sound.device().clock(); + const u32 clock = sound.device().clock().value(); std::string hz(std::to_string(clock)); int d = (clock >= 1'000'000'000) ? 9 : (clock >= 1'000'000) ? 6 : (clock >= 1000) ? 3 : 0; if (d > 0) diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp index e2d1435b1ba..e9f4f272bd2 100644 --- a/src/frontend/mame/ui/info.cpp +++ b/src/frontend/mame/ui/info.cpp @@ -385,14 +385,14 @@ std::string machine_info::game_info_string() const if (!exectags.insert(exec.device().tag()).second) continue; // get cpu specific clock that takes internal multiplier/dividers into account - u32 clock = exec.device().clock(); + u32 clock = exec.device().clock().value(); // count how many identical CPUs we have int count = 1; const char *name = exec.device().name(); for (device_execute_interface &scan : execiter) { - if (exec.device().type() == scan.device().type() && strcmp(name, scan.device().name()) == 0 && exec.device().clock() == scan.device().clock()) + if (exec.device().type() == scan.device().type() && strcmp(name, scan.device().name()) == 0 && exec.device().clock().value() == scan.device().clock().value()) if (exectags.insert(scan.device().tag()).second) count++; } @@ -434,12 +434,12 @@ std::string machine_info::game_info_string() const int count = 1; for (device_sound_interface &scan : snditer) { - if (sound.device().type() == scan.device().type() && sound.device().clock() == scan.device().clock()) + if (sound.device().type() == scan.device().type() && sound.device().clock().value() == scan.device().clock().value()) if (soundtags.insert(scan.device().tag()).second) count++; } - const u32 clock = sound.device().clock(); + const u32 clock = sound.device().clock().value(); std::string hz(std::to_string(clock)); int d = (clock >= 1'000'000'000) ? 9 : (clock >= 1'000'000) ? 6 : (clock >= 1000) ? 3 : 0; if (d > 0) diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index 878e175d22a..a6b7c09a010 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -1499,7 +1499,7 @@ std::vector<ui::menu_item> mame_ui_manager::slider_init(running_machine &machine for (device_sound_interface &snd : sound_interface_enumerator(machine.root_device())) { device_execute_interface *exec; - if (!snd.device().interface(exec) && snd.device().unscaled_clock() != 0) + if (!snd.device().interface(exec) && !snd.device().unscaled_clock().disabled()) { std::string str = string_format(_("Overclock %1$s sound"), snd.device().tag()); slider_alloc(std::move(str), 100, 1000, 4000, 10, std::bind(&mame_ui_manager::slider_overclock, this, std::ref(snd.device()), _1, _2)); |