diff options
Diffstat (limited to 'src/frontend/mame/ui')
48 files changed, 358 insertions, 358 deletions
diff --git a/src/frontend/mame/ui/cheatopt.cpp b/src/frontend/mame/ui/cheatopt.cpp index b3838a296e7..d04b4e2e289 100644 --- a/src/frontend/mame/ui/cheatopt.cpp +++ b/src/frontend/mame/ui/cheatopt.cpp @@ -142,7 +142,7 @@ void menu_cheat::populate() if (!mame_machine_manager::instance()->cheat().entries().empty()) { for (auto &curcheat : mame_machine_manager::instance()->cheat().entries()) { - UINT32 flags; + uint32_t flags; curcheat->menu_text(text, subtext, flags); if (text == MENU_SEPARATOR_ITEM) item_append(menu_item_type::SEPARATOR, flags); diff --git a/src/frontend/mame/ui/custmenu.cpp b/src/frontend/mame/ui/custmenu.cpp index 71f65a4093f..6e0e6d6576f 100644 --- a/src/frontend/mame/ui/custmenu.cpp +++ b/src/frontend/mame/ui/custmenu.cpp @@ -155,7 +155,7 @@ void menu_custom_filter::handle() void menu_custom_filter::populate() { // add main filter - UINT32 arrow_flags = get_arrow_flags<UINT16>(FILTER_ALL, FILTER_UNAVAILABLE, custfltr::main); + uint32_t arrow_flags = get_arrow_flags<uint16_t>(FILTER_ALL, FILTER_UNAVAILABLE, custfltr::main); item_append(_("Main filter"), main_filters::text[custfltr::main], arrow_flags, (void *)(uintptr_t)MAIN_FILTER); // add other filters @@ -164,7 +164,7 @@ void menu_custom_filter::populate() item_append(menu_item_type::SEPARATOR); // add filter items - arrow_flags = get_arrow_flags<UINT16>(FILTER_UNAVAILABLE + 1, FILTER_LAST - 1, custfltr::other[x]); + arrow_flags = get_arrow_flags<uint16_t>(FILTER_UNAVAILABLE + 1, FILTER_LAST - 1, custfltr::other[x]); item_append(_("Other filter"), main_filters::text[custfltr::other[x]], arrow_flags, (void *)(uintptr_t)(OTHER_FILTER + x)); if (m_added) @@ -173,7 +173,7 @@ void menu_custom_filter::populate() // add manufacturer subitem if (custfltr::other[x] == FILTER_MANUFACTURER && c_mnfct::ui.size() > 0) { - arrow_flags = get_arrow_flags<UINT16>(0, c_mnfct::ui.size() - 1, custfltr::mnfct[x]); + arrow_flags = get_arrow_flags<uint16_t>(0, c_mnfct::ui.size() - 1, custfltr::mnfct[x]); std::string fbuff(_("^!Manufacturer")); convert_command_glyph(fbuff); item_append(fbuff, c_mnfct::ui[custfltr::mnfct[x]], arrow_flags, (void *)(uintptr_t)(MNFCT_FILTER + x)); @@ -182,7 +182,7 @@ void menu_custom_filter::populate() // add year subitem else if (custfltr::other[x] == FILTER_YEAR && c_year::ui.size() > 0) { - arrow_flags = get_arrow_flags<UINT16>(0, c_year::ui.size() - 1, custfltr::year[x]); + arrow_flags = get_arrow_flags<uint16_t>(0, c_year::ui.size() - 1, custfltr::year[x]); std::string fbuff(_("^!Year")); convert_command_glyph(fbuff); item_append(fbuff, c_year::ui[custfltr::year[x]], arrow_flags, (void *)(uintptr_t)(YEAR_FILTER + x)); @@ -442,7 +442,7 @@ void menu_swcustom_filter::handle() void menu_swcustom_filter::populate() { // add main filter - UINT32 arrow_flags = get_arrow_flags<UINT16>(UI_SW_ALL, UI_SW_UNAVAILABLE, sw_custfltr::main); + uint32_t arrow_flags = get_arrow_flags<uint16_t>(UI_SW_ALL, UI_SW_UNAVAILABLE, sw_custfltr::main); item_append(_("Main filter"), sw_filters::text[sw_custfltr::main], arrow_flags, (void *)(uintptr_t)MAIN_FILTER); // add other filters @@ -451,7 +451,7 @@ void menu_swcustom_filter::populate() item_append(menu_item_type::SEPARATOR); // add filter items - arrow_flags = get_arrow_flags<UINT16>(UI_SW_UNAVAILABLE + 1, UI_SW_LAST - 1, sw_custfltr::other[x]); + arrow_flags = get_arrow_flags<uint16_t>(UI_SW_UNAVAILABLE + 1, UI_SW_LAST - 1, sw_custfltr::other[x]); item_append(_("Other filter"), sw_filters::text[sw_custfltr::other[x]], arrow_flags, (void *)(uintptr_t)(OTHER_FILTER + x)); if (m_added) @@ -460,7 +460,7 @@ void menu_swcustom_filter::populate() // add publisher subitem if (sw_custfltr::other[x] == UI_SW_PUBLISHERS && m_filter.publisher.ui.size() > 0) { - arrow_flags = get_arrow_flags<UINT16>(0, m_filter.publisher.ui.size() - 1, sw_custfltr::mnfct[x]); + arrow_flags = get_arrow_flags<uint16_t>(0, m_filter.publisher.ui.size() - 1, sw_custfltr::mnfct[x]); std::string fbuff(_("^!Publisher")); convert_command_glyph(fbuff); item_append(fbuff, m_filter.publisher.ui[sw_custfltr::mnfct[x]], arrow_flags, (void *)(uintptr_t)(MNFCT_FILTER + x)); @@ -469,7 +469,7 @@ void menu_swcustom_filter::populate() // add year subitem else if (sw_custfltr::other[x] == UI_SW_YEARS && m_filter.year.ui.size() > 0) { - arrow_flags = get_arrow_flags<UINT16>(0, m_filter.year.ui.size() - 1, sw_custfltr::year[x]); + arrow_flags = get_arrow_flags<uint16_t>(0, m_filter.year.ui.size() - 1, sw_custfltr::year[x]); std::string fbuff(_("^!Year")); convert_command_glyph(fbuff); item_append(fbuff, m_filter.year.ui[sw_custfltr::year[x]], arrow_flags, (void *)(uintptr_t)(YEAR_FILTER + x)); @@ -478,7 +478,7 @@ void menu_swcustom_filter::populate() // add year subitem else if (sw_custfltr::other[x] == UI_SW_LIST && m_filter.swlist.name.size() > 0) { - arrow_flags = get_arrow_flags<UINT16>(0, m_filter.swlist.name.size() - 1, sw_custfltr::list[x]); + arrow_flags = get_arrow_flags<uint16_t>(0, m_filter.swlist.name.size() - 1, sw_custfltr::list[x]); std::string fbuff(_("^!Software List")); convert_command_glyph(fbuff); item_append(fbuff, m_filter.swlist.description[sw_custfltr::list[x]], arrow_flags, (void *)(uintptr_t)(LIST_FILTER + x)); @@ -487,7 +487,7 @@ void menu_swcustom_filter::populate() // add device type subitem else if (sw_custfltr::other[x] == UI_SW_TYPE && m_filter.type.ui.size() > 0) { - arrow_flags = get_arrow_flags<UINT16>(0, m_filter.type.ui.size() - 1, sw_custfltr::type[x]); + arrow_flags = get_arrow_flags<uint16_t>(0, m_filter.type.ui.size() - 1, sw_custfltr::type[x]); std::string fbuff(_("^!Device type")); convert_command_glyph(fbuff); item_append(fbuff, m_filter.type.ui[sw_custfltr::type[x]], arrow_flags, (void *)(uintptr_t)(TYPE_FILTER + x)); @@ -496,7 +496,7 @@ void menu_swcustom_filter::populate() // add region subitem else if (sw_custfltr::other[x] == UI_SW_REGION && m_filter.region.ui.size() > 0) { - arrow_flags = get_arrow_flags<UINT16>(0, m_filter.region.ui.size() - 1, sw_custfltr::region[x]); + arrow_flags = get_arrow_flags<uint16_t>(0, m_filter.region.ui.size() - 1, sw_custfltr::region[x]); std::string fbuff(_("^!Region")); convert_command_glyph(fbuff); item_append(fbuff, m_filter.region.ui[sw_custfltr::region[x]], arrow_flags, (void *)(uintptr_t)(REGION_FILTER + x)); diff --git a/src/frontend/mame/ui/custmenu.h b/src/frontend/mame/ui/custmenu.h index 5d3084f9121..8fef83c0cac 100644 --- a/src/frontend/mame/ui/custmenu.h +++ b/src/frontend/mame/ui/custmenu.h @@ -22,7 +22,7 @@ namespace ui { struct c_sw_region { std::vector<std::string> ui; - UINT16 actual; + uint16_t actual; void set(std::string &str); std::string getname(std::string &str); }; @@ -31,7 +31,7 @@ struct c_sw_region struct c_sw_publisher { std::vector<std::string> ui; - UINT16 actual; + uint16_t actual; void set(std::string &str); std::string getname(std::string &str); }; @@ -40,7 +40,7 @@ struct c_sw_publisher struct c_sw_type { std::vector<std::string> ui; - UINT16 actual; + uint16_t actual; void set(std::string &str); }; @@ -49,14 +49,14 @@ struct c_sw_list { std::vector<std::string> name; std::vector<std::string> description; - UINT16 actual; + uint16_t actual; }; // Software years struct c_sw_year { std::vector<std::string> ui; - UINT16 actual; + uint16_t actual; void set(std::string &str); }; diff --git a/src/frontend/mame/ui/custui.cpp b/src/frontend/mame/ui/custui.cpp index f71c9525019..81d16c22741 100644 --- a/src/frontend/mame/ui/custui.cpp +++ b/src/frontend/mame/ui/custui.cpp @@ -139,7 +139,7 @@ void menu_custom_ui::handle() void menu_custom_ui::populate() { - UINT32 arrow_flags; + uint32_t arrow_flags; item_append(_("Fonts"), "", 0, (void *)(uintptr_t)FONT_MENU); item_append(_("Colors"), "", 0, (void *)(uintptr_t)COLORS_MENU); @@ -149,7 +149,7 @@ void menu_custom_ui::populate() item_append(_("Language"), m_lang[m_currlang].c_str(), arrow_flags, (void *)(uintptr_t)LANGUAGE_MENU); } - arrow_flags = get_arrow_flags<UINT16>(0, HIDE_BOTH, ui_globals::panels_status); + arrow_flags = get_arrow_flags<uint16_t>(0, HIDE_BOTH, ui_globals::panels_status); item_append(_("Show side panels"), _(HIDE_STATUS[ui_globals::panels_status]), arrow_flags, (void *)(uintptr_t)HIDE_MENU); item_append(menu_item_type::SEPARATOR); @@ -341,7 +341,7 @@ void menu_font_ui::handle() void menu_font_ui::populate() { // set filter arrow - UINT32 arrow_flags; + uint32_t arrow_flags; // add fonts option arrow_flags = get_arrow_flags<std::uint16_t>(0, m_fonts.size() - 1, m_actual); @@ -466,7 +466,7 @@ menu_colors_ui::~menu_colors_ui() std::string error_string, dec_color; for (int index = 1; index < MUI_RESTORE; index++) { - dec_color = string_format("%x", (UINT32)m_color_table[index].color); + dec_color = string_format("%x", (uint32_t)m_color_table[index].color); ui().options().set_value(m_color_table[index].option, dec_color.c_str(), OPTION_PRIORITY_CMDLINE, error_string); } } @@ -681,7 +681,7 @@ void menu_colors_ui::restore_colors() { ui_options options; for (int index = 1; index < MUI_RESTORE; index++) - m_color_table[index].color = rgb_t((UINT32)strtoul(options.value(m_color_table[index].option), nullptr, 16)); + m_color_table[index].color = rgb_t((uint32_t)strtoul(options.value(m_color_table[index].option), nullptr, 16)); } //------------------------------------------------- @@ -827,13 +827,13 @@ void menu_rgb_ui::handle() void menu_rgb_ui::populate() { // set filter arrow - UINT32 arrow_flags = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; + uint32_t arrow_flags = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; std::string s_text = std::string(m_search).append("_"); item_append(_("ARGB Settings"), "", FLAG_DISABLE | FLAG_UI_HEADING, nullptr); if (m_lock_ref != RGB_ALPHA) { - arrow_flags = get_arrow_flags<UINT8>(0, 255, m_color->a()); + arrow_flags = get_arrow_flags<uint8_t>(0, 255, m_color->a()); item_append(_("Alpha"), string_format("%3u", m_color->a()), arrow_flags, (void *)(uintptr_t)RGB_ALPHA); } else @@ -841,7 +841,7 @@ void menu_rgb_ui::populate() if (m_lock_ref != RGB_RED) { - arrow_flags = get_arrow_flags<UINT8>(0, 255, m_color->r()); + arrow_flags = get_arrow_flags<uint8_t>(0, 255, m_color->r()); item_append(_("Red"), string_format("%3u", m_color->r()), arrow_flags, (void *)(uintptr_t)RGB_RED); } else @@ -849,7 +849,7 @@ void menu_rgb_ui::populate() if (m_lock_ref != RGB_GREEN) { - arrow_flags = get_arrow_flags<UINT8>(0, 255, m_color->g()); + arrow_flags = get_arrow_flags<uint8_t>(0, 255, m_color->g()); item_append(_("Green"), string_format("%3u", m_color->g()), arrow_flags, (void *)(uintptr_t)RGB_GREEN); } else @@ -857,7 +857,7 @@ void menu_rgb_ui::populate() if (m_lock_ref != RGB_BLUE) { - arrow_flags = get_arrow_flags<UINT8>(0, 255, m_color->b()); + arrow_flags = get_arrow_flags<uint8_t>(0, 255, m_color->b()); item_append(_("Blue"), string_format("%3u", m_color->b()), arrow_flags, (void *)(uintptr_t)RGB_BLUE); } else @@ -1024,7 +1024,7 @@ void menu_palette_sel::handle() { if (menu_event->iptkey == IPT_UI_SELECT) { - m_original = rgb_t((UINT32)strtoul(item[selected].subtext.c_str(), nullptr, 16)); + m_original = rgb_t((uint32_t)strtoul(item[selected].subtext.c_str(), nullptr, 16)); reset_parent(reset_options::SELECT_FIRST); stack_pop(); } @@ -1055,7 +1055,7 @@ void menu_palette_sel::custom_render(void *selectedref, float top, float bottom, // draw - draw palette menu //------------------------------------------------- -void menu_palette_sel::draw(UINT32 flags) +void menu_palette_sel::draw(uint32_t flags) { auto line_height = ui().get_line_height(); auto lr_arrow_width = 0.4f * line_height * machine().render().ui_aspect(); @@ -1216,7 +1216,7 @@ void menu_palette_sel::draw(UINT32 flags) else { const char *subitem_text = pitem.subtext.c_str(); - rgb_t color = rgb_t((UINT32)strtoul(subitem_text, nullptr, 16)); + rgb_t color = rgb_t((uint32_t)strtoul(subitem_text, nullptr, 16)); // draw the left-side text ui().draw_text_full(container(), itemtext, effective_left, line_y, effective_width, diff --git a/src/frontend/mame/ui/custui.h b/src/frontend/mame/ui/custui.h index 864d980186b..ed4ebc12585 100644 --- a/src/frontend/mame/ui/custui.h +++ b/src/frontend/mame/ui/custui.h @@ -183,7 +183,7 @@ protected: private: // draw palette menu - virtual void draw(UINT32 flags) override; + virtual void draw(uint32_t flags) override; virtual void populate() override; virtual void handle() override; diff --git a/src/frontend/mame/ui/datmenu.cpp b/src/frontend/mame/ui/datmenu.cpp index c2126d50d15..b4982064cdd 100644 --- a/src/frontend/mame/ui/datmenu.cpp +++ b/src/frontend/mame/ui/datmenu.cpp @@ -148,7 +148,7 @@ void menu_dats_view::populate() // draw - draw dats menu //------------------------------------------------- -void menu_dats_view::draw(UINT32 flags) +void menu_dats_view::draw(uint32_t flags) { auto line_height = ui().get_line_height(); auto ud_arrow_width = line_height * machine().render().ui_aspect(); diff --git a/src/frontend/mame/ui/datmenu.h b/src/frontend/mame/ui/datmenu.h index 9c76cc7141f..ed16d276d3d 100644 --- a/src/frontend/mame/ui/datmenu.h +++ b/src/frontend/mame/ui/datmenu.h @@ -39,7 +39,7 @@ protected: private: // draw dats menu - virtual void draw(UINT32 flags) override; + virtual void draw(uint32_t flags) override; virtual void populate() override; virtual void handle() override; diff --git a/src/frontend/mame/ui/defimg.ipp b/src/frontend/mame/ui/defimg.ipp index 0d348a1ebc9..396c2ec4fd6 100644 --- a/src/frontend/mame/ui/defimg.ipp +++ b/src/frontend/mame/ui/defimg.ipp @@ -8,7 +8,7 @@ namespace ui { namespace { // TODO: move this to an external image file and zlib compress it into a souce file as part of the build process -UINT32 const no_avail_bmp[] = { +uint32_t const no_avail_bmp[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x01231f20, 0x04231f20, 0x11231f20, 0x2e231f20, 0x62231f20, 0x8e231f20, 0xb4231f20, 0xd4231f20, 0xe5231f20, 0xf2231f20, 0xfd231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xfd231f20, 0xf2231f20, 0xe5231f20, 0xd4231f20, 0xb4231f20, 0x8e231f20, 0x62231f20, 0x2e231f20, 0x11231f20, 0x04231f20, 0x01231f20, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00231f20, 0x00000000, 0x00000000, 0x06231f20, 0x1c231f20, 0x49231f20, 0x8c231f20, 0xc4231f20, 0xf0231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf0231f20, 0xc4231f20, 0x8c231f20, 0x49231f20, 0x1c231f20, 0x06231f20, 0x00000000, 0x00000000, 0x00231f20, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x04231f20, 0x32231f20, 0x7b231f20, 0xc2231f20, 0xf3231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf3231f20, 0xc2231f20, 0x7b231f20, 0x32231f20, 0x04231f20, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, diff --git a/src/frontend/mame/ui/devctrl.h b/src/frontend/mame/ui/devctrl.h index 332d020144e..e0b757cccca 100644 --- a/src/frontend/mame/ui/devctrl.h +++ b/src/frontend/mame/ui/devctrl.h @@ -40,7 +40,7 @@ protected: void previous(); void next(); std::string current_display_name(); - UINT32 current_display_flags(); + uint32_t current_display_flags(); private: // device iterator @@ -139,9 +139,9 @@ std::string menu_device_control<DeviceType>::current_display_name() //------------------------------------------------- template<class DeviceType> -UINT32 menu_device_control<DeviceType>::current_display_flags() +uint32_t menu_device_control<DeviceType>::current_display_flags() { - UINT32 flags = 0; + uint32_t flags = 0; if (count() > 1) { if (current_index() > 0) diff --git a/src/frontend/mame/ui/icorender.h b/src/frontend/mame/ui/icorender.h index 677ebf001c7..864969b616d 100644 --- a/src/frontend/mame/ui/icorender.h +++ b/src/frontend/mame/ui/icorender.h @@ -19,45 +19,45 @@ // in an ICO file. typedef struct { - UINT8 bWidth; // Width of the image - UINT8 bHeight; // Height of the image (times 2) - UINT8 bColorCount; // Number of colors in image (0 if >=8bpp) - UINT8 bReserved; // Reserved - UINT16 wPlanes; // Color Planes - UINT16 wBitCount; // Bits per pixel - UINT32 dwBytesInRes; // how many bytes in this resource? - UINT32 dwImageOffset; // where in the file is this image + uint8_t bWidth; // Width of the image + uint8_t bHeight; // Height of the image (times 2) + uint8_t bColorCount; // Number of colors in image (0 if >=8bpp) + uint8_t bReserved; // Reserved + uint16_t wPlanes; // Color Planes + uint16_t wBitCount; // Bits per pixel + uint32_t dwBytesInRes; // how many bytes in this resource? + uint32_t dwImageOffset; // where in the file is this image } ICONDIRENTRY, *LPICONDIRENTRY; typedef struct { - UINT16 idReserved; // Reserved - UINT16 idType; // resource type (1 for icons) - UINT16 idCount; // how many images? + uint16_t idReserved; // Reserved + uint16_t idType; // resource type (1 for icons) + uint16_t idCount; // how many images? //ICONDIRENTRY idEntries[1]; // the entries for each image } ICONDIR, *LPICONDIR; // size - 40 bytes typedef struct { - UINT32 biSize; - UINT32 biWidth; - UINT32 biHeight; // Icon Height (added height of XOR-Bitmap and AND-Bitmap) - UINT16 biPlanes; - UINT16 biBitCount; - UINT32 biCompression; - INT32 biSizeImage; - UINT32 biXPelsPerMeter; - UINT32 biYPelsPerMeter; - UINT32 biClrUsed; - UINT32 biClrImportant; + uint32_t biSize; + uint32_t biWidth; + uint32_t biHeight; // Icon Height (added height of XOR-Bitmap and AND-Bitmap) + uint16_t biPlanes; + uint16_t biBitCount; + uint32_t biCompression; + int32_t biSizeImage; + uint32_t biXPelsPerMeter; + uint32_t biYPelsPerMeter; + uint32_t biClrUsed; + uint32_t biClrImportant; } s_BITMAPINFOHEADER, *s_PBITMAPINFOHEADER; // 46 bytes typedef struct{ s_BITMAPINFOHEADER icHeader; // DIB header - UINT32 icColors[1]; // Color table (short 4 bytes) //RGBQUAD - UINT8 icXOR[1]; // DIB bits for XOR mask - UINT8 icAND[1]; // DIB bits for AND mask + uint32_t icColors[1]; // Color table (short 4 bytes) //RGBQUAD + uint8_t icXOR[1]; // DIB bits for XOR mask + uint8_t icAND[1]; // DIB bits for AND mask } ICONIMAGE, *LPICONIMAGE; //------------------------------------------------- @@ -66,8 +66,8 @@ typedef struct{ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *dirname, const char *filename) { - INT32 width = 0; - INT32 height = 0; + int32_t width = 0; + int32_t height = 0; // deallocate previous bitmap bitmap.reset(); @@ -86,8 +86,8 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d return; // allocates a buffer for the image - UINT64 size = file.size(); - UINT8 *buffer = global_alloc_array(UINT8, size + 1); + uint64_t size = file.size(); + uint8_t *buffer = global_alloc_array(uint8_t, size + 1); // read data from the file and set them in the buffer file.read(buffer, size); @@ -102,7 +102,7 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d return; } - UINT8* cursor = buffer; + uint8_t* cursor = buffer; cursor += 6; ICONDIRENTRY* dirEntry = (ICONDIRENTRY*)(cursor); int maxSize = 0; @@ -153,7 +153,7 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d else if (realBitsCount == 8) // 256 colors { // 256 color table - UINT8 *colors = cursor; + uint8_t *colors = cursor; cursor += 256 * 4; for (int x = 0; x < width; ++x) for (int y = 0; y < height; ++y) @@ -166,13 +166,13 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d else if (realBitsCount == 4) // 16 colors { // 16 color table - UINT8 *colors = cursor; + uint8_t *colors = cursor; cursor += 16 * 4; for (int x = 0; x < width; ++x) for (int y = 0; y < height; ++y) { int shift2 = (x + (height - y - 1) * width); - UINT8 index = cursor[shift2 / 2]; + uint8_t index = cursor[shift2 / 2]; if (shift2 % 2 == 0) index = (index >> 4) & 0xF; else @@ -184,7 +184,7 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d else if (realBitsCount == 1) // 2 colors { // 2 color table - UINT8 *colors = cursor; + uint8_t *colors = cursor; cursor += 2 * 4; int boundary = width; // !!! 32 bit boundary (http://www.daubnet.com/en/file-format-ico) while (boundary % 32 != 0) boundary++; @@ -193,10 +193,10 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d for (int y = 0; y < height; ++y) { int shift2 = (x + (height - y - 1) * boundary); - UINT8 index = cursor[shift2 / 8]; + uint8_t index = cursor[shift2 / 8]; // select 1 bit only - UINT8 bit = 7 - (x % 8); + uint8_t bit = 7 - (x % 8); index = (index >> bit) & 0x01; index *= 4; bitmap.pix32(y, x) = rgb_t(255, colors[index + 2], colors[index + 1], colors[index]); @@ -216,11 +216,11 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d for (int y = 0; y < height; ++y) for (int x = 0; x < width; ++x) { - UINT8 bit = 7 - (x % 8); + uint8_t bit = 7 - (x % 8); int shift2 = (x + (height - y - 1) * boundary) / 8; - int mask = (0x01 & ((UINT8)cursor[shift2] >> bit)); + int mask = (0x01 & ((uint8_t)cursor[shift2] >> bit)); rgb_t colors = bitmap.pix32(y, x); - UINT8 alpha = colors.a(); + uint8_t alpha = colors.a(); alpha *= 1 - mask; colors.set_a(alpha); bitmap.pix32(y, x) = colors; diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp index 8d5d468332b..bee0430d063 100644 --- a/src/frontend/mame/ui/info.cpp +++ b/src/frontend/mame/ui/info.cpp @@ -62,7 +62,7 @@ machine_info::machine_info(running_machine &machine) std::string machine_info::warnings_string() { - constexpr UINT32 warning_flags = ( MACHINE_FATAL_FLAGS | MACHINE_WARNING_FLAGS | MACHINE_BTANB_FLAGS ); + constexpr uint32_t warning_flags = ( MACHINE_FATAL_FLAGS | MACHINE_WARNING_FLAGS | MACHINE_BTANB_FLAGS ); // if no warnings, nothing to return if (m_machine.rom_load().warnings() == 0 && m_machine.rom_load().knownbad() == 0 && !(m_machine.system().flags & warning_flags) && m_machine.rom_load().software_load_warnings_message().length() == 0) diff --git a/src/frontend/mame/ui/inifile.cpp b/src/frontend/mame/ui/inifile.cpp index b76adb689b6..6889bebf1d4 100644 --- a/src/frontend/mame/ui/inifile.cpp +++ b/src/frontend/mame/ui/inifile.cpp @@ -17,8 +17,8 @@ //------------------------------------------------- // GLOBAL VARIABLES //------------------------------------------------- -UINT16 inifile_manager::c_cat = 0; -UINT16 inifile_manager::c_file = 0; +uint16_t inifile_manager::c_cat = 0; +uint16_t inifile_manager::c_file = 0; //------------------------------------------------- // ctor diff --git a/src/frontend/mame/ui/inifile.h b/src/frontend/mame/ui/inifile.h index f0ed83adbd2..0ac927f3094 100644 --- a/src/frontend/mame/ui/inifile.h +++ b/src/frontend/mame/ui/inifile.h @@ -35,8 +35,8 @@ public: std::string get_category() { return ini_index[c_file].second[c_cat].first; } size_t total() { return ini_index.size(); } size_t cat_total() { return ini_index[c_file].second.size(); } - UINT16 &cur_file() { return c_file; } - UINT16 &cur_cat() { return c_cat; } + uint16_t &cur_file() { return c_file; } + uint16_t &cur_cat() { return c_cat; } // load games from category void load_ini_category(std::vector<int> &temp_filter); @@ -53,7 +53,7 @@ private: using categoryindex = std::vector<std::pair<std::string, long>>; // files indices - static UINT16 c_file, c_cat; + static uint16_t c_file, c_cat; std::vector<std::pair<std::string, categoryindex>> ini_index; // init category index diff --git a/src/frontend/mame/ui/inputmap.cpp b/src/frontend/mame/ui/inputmap.cpp index a45438f38ba..c4071f503be 100644 --- a/src/frontend/mame/ui/inputmap.cpp +++ b/src/frontend/mame/ui/inputmap.cpp @@ -174,7 +174,7 @@ void menu_input_specific::populate() if (field.enabled() && (type_class == INPUT_CLASS_CONTROLLER || type_class == INPUT_CLASS_MISC || type_class == INPUT_CLASS_KEYBOARD)) { input_seq_type seqtype; - UINT32 sortorder; + uint32_t sortorder; /* determine the sorting order */ if (type_class == INPUT_CLASS_CONTROLLER) @@ -405,7 +405,7 @@ void menu_input::populate_and_sort(input_item_data *itemlist) /* build the menu */ for (curitem = 0; curitem < numitems; curitem++) { - UINT32 flags = 0; + uint32_t flags = 0; /* generate the name of the item itself, based off the base name and the type */ item = itemarray[curitem]; @@ -533,7 +533,7 @@ void menu_settings::handle() switches menus -------------------------------------------------*/ -menu_settings::menu_settings(mame_ui_manager &mui, render_container &container, UINT32 _type) : menu(mui, container), diplist(nullptr), dipcount(0) +menu_settings::menu_settings(mame_ui_manager &mui, render_container &container, uint32_t _type) : menu(mui, container), diplist(nullptr), dipcount(0) { type = _type; } @@ -554,7 +554,7 @@ void menu_settings::populate() for (ioport_field &field : port.second->fields()) if (field.type() == type && field.enabled()) { - UINT32 flags = 0; + uint32_t flags = 0; /* set the left/right flags appropriately */ if (field.has_previous_setting()) @@ -580,7 +580,7 @@ void menu_settings::populate() if (type == IPT_DIPSWITCH && !field.diplocations().empty()) { ioport_field::user_settings settings; - UINT32 accummask = field.mask(); + uint32_t accummask = field.mask(); /* get current settings */ field.get_user_settings(settings); @@ -588,7 +588,7 @@ void menu_settings::populate() /* iterate over each bit in the field */ for (const ioport_diplocation &diploc : field.diplocations()) { - UINT32 mask = accummask & ~(accummask - 1); + uint32_t mask = accummask & ~(accummask - 1); dip_descriptor *dip; /* find the matching switch name */ @@ -651,7 +651,7 @@ void menu_settings_dip_switches::custom_render(void *selectedref, float top, flo // iterate over DIP switches for (dip_descriptor *dip = diplist; dip != nullptr; dip = dip->next) { - UINT32 selectedmask = 0; + uint32_t selectedmask = 0; // determine the mask of selected bits if ((uintptr_t)selectedref != 1) @@ -676,7 +676,7 @@ void menu_settings_dip_switches::custom_render(void *selectedref, float top, flo DIP switch -------------------------------------------------*/ -void menu_settings_dip_switches::custom_render_one(float x1, float y1, float x2, float y2, const dip_descriptor *dip, UINT32 selectedmask) +void menu_settings_dip_switches::custom_render_one(float x1, float y1, float x2, float y2, const dip_descriptor *dip, uint32_t selectedmask) { float switch_field_width = SINGLE_TOGGLE_SWITCH_FIELD_WIDTH * container().manager().ui_aspect(); float switch_width = SINGLE_TOGGLE_SWITCH_WIDTH * container().manager().ui_aspect(); @@ -857,7 +857,7 @@ void menu_analog::populate() if (type != ANALOG_ITEM_CENTERSPEED || use_autocenter) { analog_item_data *data; - UINT32 flags = 0; + uint32_t flags = 0; std::string text; std::string subtext; if (strcmp(field.device().tag(), prev_owner.c_str()) != 0) diff --git a/src/frontend/mame/ui/inputmap.h b/src/frontend/mame/ui/inputmap.h index 9acee915025..b6934a1d4d6 100644 --- a/src/frontend/mame/ui/inputmap.h +++ b/src/frontend/mame/ui/inputmap.h @@ -53,8 +53,8 @@ protected: const input_seq * defseq; /* pointer to the default sequence */ const char * name; /* pointer to the base name of the item */ const char * owner_name; /* pointer to the name of the owner of the item */ - UINT32 sortorder; /* sorting information */ - UINT8 type; /* type of port */ + uint32_t sortorder; /* sorting information */ + uint8_t type; /* type of port */ bool is_optional; /* true if this input is considered optional */ }; @@ -66,7 +66,7 @@ protected: input_item_data * pollingitem; private: - UINT16 last_sortorder; + uint16_t last_sortorder; bool record_next; input_seq starting_seq; @@ -103,7 +103,7 @@ private: class menu_settings : public menu { public: - menu_settings(mame_ui_manager &mui, render_container &container, UINT32 type); + menu_settings(mame_ui_manager &mui, render_container &container, uint32_t type); virtual ~menu_settings() override; protected: @@ -112,8 +112,8 @@ protected: { dip_descriptor * next; const char * name; - UINT32 mask; - UINT32 state; + uint32_t mask; + uint32_t state; }; dip_descriptor * diplist; @@ -135,7 +135,7 @@ protected: virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; private: - void custom_render_one(float x1, float y1, float x2, float y2, const dip_descriptor *dip, UINT32 selectedmask); + void custom_render_one(float x1, float y1, float x2, float y2, const dip_descriptor *dip, uint32_t selectedmask); }; class menu_settings_driver_config : public menu_settings diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp index 32039886450..7f0f0df8d50 100644 --- a/src/frontend/mame/ui/menu.cpp +++ b/src/frontend/mame/ui/menu.cpp @@ -277,7 +277,7 @@ void menu::reset(reset_options options) // reset all the pools and the item.size() back to 0 for (pool *ppool = m_pool; ppool != nullptr; ppool = ppool->next) - ppool->top = (UINT8 *)(ppool + 1); + ppool->top = (uint8_t *)(ppool + 1); item.clear(); m_visible_items = 0; selected = 0; @@ -342,7 +342,7 @@ void menu::item_append(menu_item item) // end of the menu //------------------------------------------------- -void menu::item_append(menu_item_type type, UINT32 flags) +void menu::item_append(menu_item_type type, uint32_t flags) { if (type == menu_item_type::SEPARATOR) item_append(MENU_SEPARATOR_ITEM, "", flags, nullptr, menu_item_type::SEPARATOR); @@ -353,7 +353,7 @@ void menu::item_append(menu_item_type type, UINT32 flags) // end of the menu //------------------------------------------------- -void menu::item_append(const std::string &text, const std::string &subtext, UINT32 flags, void *ref, menu_item_type type) +void menu::item_append(const std::string &text, const std::string &subtext, uint32_t flags, void *ref, menu_item_type type) { item_append(std::string(text), std::string(subtext), flags, ref, type); } @@ -363,7 +363,7 @@ void menu::item_append(const std::string &text, const std::string &subtext, UINT // end of the menu //------------------------------------------------- -void menu::item_append(std::string &&text, std::string &&subtext, UINT32 flags, void *ref, menu_item_type type) +void menu::item_append(std::string &&text, std::string &&subtext, uint32_t flags, void *ref, menu_item_type type) { // only allow multiline as the first item if ((flags & FLAG_MULTILINE) != 0) @@ -404,7 +404,7 @@ void menu::item_append(std::string &&text, std::string &&subtext, UINT32 flags, // and returning any interesting events //------------------------------------------------- -const menu::event *menu::process(UINT32 flags, float x0, float y0) +const menu::event *menu::process(uint32_t flags, float x0, float y0) { // reset the event m_event.iptkey = IPT_INVALID; @@ -461,12 +461,12 @@ void *menu::m_pool_alloc(size_t size) } // allocate a new pool - pool *ppool = (pool *)global_alloc_array_clear<UINT8>(sizeof(*ppool) + UI_MENU_POOL_SIZE); + pool *ppool = (pool *)global_alloc_array_clear<uint8_t>(sizeof(*ppool) + UI_MENU_POOL_SIZE); // wire it up ppool->next = m_pool; m_pool = ppool; - ppool->top = (UINT8 *)(ppool + 1); + ppool->top = (uint8_t *)(ppool + 1); ppool->end = ppool->top + UI_MENU_POOL_SIZE; return m_pool_alloc(size); } @@ -500,7 +500,7 @@ void menu::set_selection(void *selected_itemref) // draw - draw a menu //------------------------------------------------- -void menu::draw(UINT32 flags) +void menu::draw(uint32_t flags) { // first draw the FPS counter if (ui().show_fps_counter()) @@ -593,7 +593,7 @@ void menu::draw(UINT32 flags) mouse_button = false; if (!customonly && !noinput) { - INT32 mouse_target_x, mouse_target_y; + int32_t mouse_target_x, mouse_target_y; render_target *mouse_target = machine().ui_input().find_mouse(&mouse_target_x, &mouse_target_y, &mouse_button); if (mouse_target != nullptr) if (mouse_target->map_point_container(mouse_target_x, mouse_target_y, container(), mouse_x, mouse_y)) @@ -853,7 +853,7 @@ void menu::draw_text_box() // input events for a menu //------------------------------------------------- -void menu::handle_events(UINT32 flags, event &ev) +void menu::handle_events(uint32_t flags, event &ev) { bool stop = false; ui_event local_menu_event; @@ -967,7 +967,7 @@ void menu::handle_events(UINT32 flags, event &ev) // keys for a menu //------------------------------------------------- -void menu::handle_keys(UINT32 flags, int &iptkey) +void menu::handle_keys(uint32_t flags, int &iptkey) { bool ignorepause = stack_has_special_main_menu(); int code; @@ -1149,7 +1149,7 @@ void menu::do_handle() // and calls the menu handler //------------------------------------------------- -UINT32 menu::ui_handler(render_container &container, mame_ui_manager &mui) +uint32_t menu::ui_handler(render_container &container, mame_ui_manager &mui) { global_state_ptr const state(get_global_state(mui.machine())); @@ -1189,7 +1189,7 @@ void menu::highlight(float x0, float y0, float x1, float y1, rgb_t bgcolor) // draw_arrow //------------------------------------------------- -void menu::draw_arrow(float x0, float y0, float x1, float y1, rgb_t fgcolor, UINT32 orientation) +void menu::draw_arrow(float x0, float y0, float x1, float y1, rgb_t fgcolor, uint32_t orientation) { container().add_quad(x0, y0, x1, y1, fgcolor, m_global_state->arrow_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(orientation) | PRIMFLAG_PACKABLE); } diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h index cee07c6da88..554a70fddd2 100644 --- a/src/frontend/mame/ui/menu.h +++ b/src/frontend/mame/ui/menu.h @@ -56,10 +56,10 @@ public: std::vector<menu_item> item; // array of items // append a new item to the end of the menu - void item_append(const std::string &text, const std::string &subtext, UINT32 flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN); - void item_append(std::string &&text, std::string &&subtext, UINT32 flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN); + void item_append(const std::string &text, const std::string &subtext, uint32_t flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN); + void item_append(std::string &&text, std::string &&subtext, uint32_t flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN); void item_append(menu_item item); - void item_append(menu_item_type type, UINT32 flags = 0); + void item_append(menu_item_type type, uint32_t flags = 0); // Global initialization static void init(running_machine &machine, ui_options &mopt); @@ -88,7 +88,7 @@ public: static bool stack_has_special_main_menu(running_machine &machine) { return get_global_state(machine)->stack_has_special_main_menu(); } // master handler - static UINT32 ui_handler(render_container &container, mame_ui_manager &mui); + static uint32_t ui_handler(render_container &container, mame_ui_manager &mui); // Used by sliders void validate_selection(int scandir); @@ -96,14 +96,14 @@ public: void do_handle(); private: - virtual void draw(UINT32 flags); + virtual void draw(uint32_t flags); void draw_text_box(); public: // mouse handling bool mouse_hit, mouse_button; render_target *mouse_target; - INT32 mouse_target_x, mouse_target_y; + int32_t mouse_target_x, mouse_target_y; float mouse_x, mouse_y; protected: @@ -171,7 +171,7 @@ protected: void add_cleanup_callback(cleanup_callback &&callback) { m_global_state->add_cleanup_callback(std::move(callback)); } // process a menu, drawing it and returning any interesting events - const event *process(UINT32 flags, float x0 = 0.0f, float y0 = 0.0f); + const event *process(uint32_t flags, float x0 = 0.0f, float y0 = 0.0f); void process_parent() { m_parent->process(PROCESS_NOINPUT); } // retrieves the ref of the currently selected menu item or nullptr @@ -194,7 +194,7 @@ protected: render_texture *hilight_main_texture() { return m_global_state->hilight_main_texture(); } // draw arrow - void draw_arrow(float x0, float y0, float x1, float y1, rgb_t fgcolor, UINT32 orientation); + void draw_arrow(float x0, float y0, float x1, float y1, rgb_t fgcolor, uint32_t orientation); // draw header and footer text void extra_text_render(float top, float bottom, float origx1, float origy1, float origx2, float origy2, const char *header, const char *footer); @@ -207,8 +207,8 @@ protected: virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2); // overridable event handling - virtual void handle_events(UINT32 flags, event &ev); - virtual void handle_keys(UINT32 flags, int &iptkey); + virtual void handle_events(uint32_t flags, event &ev); + virtual void handle_keys(uint32_t flags, int &iptkey); virtual bool custom_mouse_down() { return false; } // test if search is active @@ -221,7 +221,7 @@ protected: // get arrows status template <typename T> - UINT32 get_arrow_flags(T min, T max, T actual) + uint32_t get_arrow_flags(T min, T max, T actual) { return ((actual > min) ? FLAG_LEFT_ARROW : 0) | ((actual < max) ? FLAG_RIGHT_ARROW : 0); } @@ -271,8 +271,8 @@ private: struct pool { pool *next; // chain to next one - UINT8 *top; // top of the pool - UINT8 *end; // end of the pool + uint8_t *top; // top of the pool + uint8_t *end; // end of the pool }; // request the specific handling of the game selection main menu diff --git a/src/frontend/mame/ui/menuitem.h b/src/frontend/mame/ui/menuitem.h index dbf294a89ae..b906b6e9a5a 100644 --- a/src/frontend/mame/ui/menuitem.h +++ b/src/frontend/mame/ui/menuitem.h @@ -39,7 +39,7 @@ public: std::string text; std::string subtext; - UINT32 flags; + uint32_t flags; void *ref; menu_item_type type; // item type (eventually will go away when itemref is proper ui_menu_item class rather than void*) }; diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp index e33502ea606..097586d5b92 100644 --- a/src/frontend/mame/ui/miscmenu.cpp +++ b/src/frontend/mame/ui/miscmenu.cpp @@ -380,8 +380,8 @@ void menu_crosshair::populate() crosshair_item_data *data; char temp_text[16]; int player; - UINT8 use_auto = false; - UINT32 flags = 0; + uint8_t use_auto = false; + uint32_t flags = 0; /* loop over player and add the manual items */ for (player = 0; player < MAX_PLAYERS; player++) @@ -775,7 +775,7 @@ void menu_machine_configure::populate() item_append(_("Bios"), "", FLAG_DISABLE | FLAG_UI_HEADING, nullptr); if (!m_bios.empty()) { - UINT32 arrows = get_arrow_flags(std::size_t(0), m_bios.size() - 1, m_curbios); + uint32_t arrows = get_arrow_flags(std::size_t(0), m_bios.size() - 1, m_curbios); item_append(_("Driver"), m_bios[m_curbios].first, arrows, (void *)(uintptr_t)BIOS); } else diff --git a/src/frontend/mame/ui/miscmenu.h b/src/frontend/mame/ui/miscmenu.h index 22d2555b204..11909f099f5 100644 --- a/src/frontend/mame/ui/miscmenu.h +++ b/src/frontend/mame/ui/miscmenu.h @@ -75,11 +75,11 @@ private: /* internal crosshair menu item data */ struct crosshair_item_data { - UINT8 type; - UINT8 player; - UINT8 min, max; - UINT8 cur; - UINT8 defvalue; + uint8_t type; + uint8_t player; + uint8_t min, max; + uint8_t cur; + uint8_t defvalue; char last_name[CROSSHAIR_PIC_NAME_LENGTH + 1]; char next_name[CROSSHAIR_PIC_NAME_LENGTH + 1]; }; diff --git a/src/frontend/mame/ui/optsmenu.cpp b/src/frontend/mame/ui/optsmenu.cpp index eab7a415ac5..cbe5a641400 100644 --- a/src/frontend/mame/ui/optsmenu.cpp +++ b/src/frontend/mame/ui/optsmenu.cpp @@ -228,7 +228,7 @@ void menu_game_options::populate() std::string fbuff; // add filter item - UINT32 arrow_flags = get_arrow_flags<UINT16>(FILTER_FIRST, FILTER_LAST, m_main); + uint32_t arrow_flags = get_arrow_flags<uint16_t>(FILTER_FIRST, FILTER_LAST, m_main); item_append(_("Filter"), main_filters::text[m_main], arrow_flags, (void *)(uintptr_t)FILTER_MENU); // add category subitem @@ -236,12 +236,12 @@ void menu_game_options::populate() { inifile_manager &inif = mame_machine_manager::instance()->inifile(); - arrow_flags = get_arrow_flags(UINT16(0), UINT16(inif.total() - 1), inif.cur_file()); + arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(inif.total() - 1), inif.cur_file()); fbuff = _(" ^!File"); convert_command_glyph(fbuff); item_append(fbuff, inif.get_file(), arrow_flags, (void *)(uintptr_t)FILE_CATEGORY_FILTER); - arrow_flags = get_arrow_flags(UINT16(0), UINT16(inif.cat_total() - 1), inif.cur_cat()); + arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(inif.cat_total() - 1), inif.cur_cat()); fbuff = _(" ^!Category"); convert_command_glyph(fbuff); item_append(fbuff, inif.get_category(), arrow_flags, (void *)(uintptr_t)CATEGORY_FILTER); @@ -249,7 +249,7 @@ void menu_game_options::populate() // add manufacturer subitem else if (m_main == FILTER_MANUFACTURER && c_mnfct::ui.size() > 0) { - arrow_flags = get_arrow_flags(UINT16(0), UINT16(c_mnfct::ui.size() - 1), c_mnfct::actual); + arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(c_mnfct::ui.size() - 1), c_mnfct::actual); fbuff = _("^!Manufacturer"); convert_command_glyph(fbuff); item_append(fbuff, c_mnfct::ui[c_mnfct::actual], arrow_flags, (void *)(uintptr_t)MANUFACT_CAT_FILTER); @@ -257,7 +257,7 @@ void menu_game_options::populate() // add year subitem else if (m_main == FILTER_YEAR && c_year::ui.size() > 0) { - arrow_flags = get_arrow_flags(UINT16(0), UINT16(c_year::ui.size() - 1), c_year::actual); + arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(c_year::ui.size() - 1), c_year::actual); fbuff.assign(_("^!Year")); convert_command_glyph(fbuff); item_append(fbuff, c_year::ui[c_year::actual], arrow_flags, (void *)(uintptr_t)YEAR_CAT_FILTER); diff --git a/src/frontend/mame/ui/optsmenu.h b/src/frontend/mame/ui/optsmenu.h index c131aa76639..96e951da6e4 100644 --- a/src/frontend/mame/ui/optsmenu.h +++ b/src/frontend/mame/ui/optsmenu.h @@ -49,7 +49,7 @@ private: virtual void populate() override; virtual void handle() override; - UINT16 m_main; + uint16_t m_main; }; } // namespace ui diff --git a/src/frontend/mame/ui/pluginopt.cpp b/src/frontend/mame/ui/pluginopt.cpp index e456562c4fc..b9167150b6f 100644 --- a/src/frontend/mame/ui/pluginopt.cpp +++ b/src/frontend/mame/ui/pluginopt.cpp @@ -96,7 +96,7 @@ void menu_plugin_opt::populate() uintptr_t i = 1; for(auto &item : menu_list) { - UINT32 flags = 0; + uint32_t flags = 0; if(item.flags == "off") flags = FLAG_DISABLE; else if(item.flags == "l") diff --git a/src/frontend/mame/ui/selector.cpp b/src/frontend/mame/ui/selector.cpp index 8f32c5530dc..d94c7085792 100644 --- a/src/frontend/mame/ui/selector.cpp +++ b/src/frontend/mame/ui/selector.cpp @@ -21,7 +21,7 @@ namespace ui { // ctor / dtor //------------------------------------------------- -menu_selector::menu_selector(mame_ui_manager &mui, render_container &container, std::vector<std::string> const &s_sel, UINT16 &s_actual, int category, int _hover) +menu_selector::menu_selector(mame_ui_manager &mui, render_container &container, std::vector<std::string> const &s_sel, uint16_t &s_actual, int category, int _hover) : menu(mui, container) , m_selector(s_actual) , m_category(category) @@ -33,7 +33,7 @@ menu_selector::menu_selector(mame_ui_manager &mui, render_container &container, m_searchlist[0] = nullptr; } -menu_selector::menu_selector(mame_ui_manager &mui, render_container &container, std::vector<std::string> &&s_sel, UINT16 &s_actual, int category, int _hover) +menu_selector::menu_selector(mame_ui_manager &mui, render_container &container, std::vector<std::string> &&s_sel, uint16_t &s_actual, int category, int _hover) : menu(mui, container) , m_selector(s_actual) , m_category(category) diff --git a/src/frontend/mame/ui/selector.h b/src/frontend/mame/ui/selector.h index 36d97755ee4..8b3d4cac8e8 100644 --- a/src/frontend/mame/ui/selector.h +++ b/src/frontend/mame/ui/selector.h @@ -31,8 +31,8 @@ public: SOFTWARE }; - menu_selector(mame_ui_manager &mui, render_container &container, std::vector<std::string> const &_sel, UINT16 &_actual, int _category = 0, int _hover = 0); - menu_selector(mame_ui_manager &mui, render_container &container, std::vector<std::string> &&_sel, UINT16 &_actual, int _category = 0, int _hover = 0); + menu_selector(mame_ui_manager &mui, render_container &container, std::vector<std::string> const &_sel, uint16_t &_actual, int _category = 0, int _hover = 0); + menu_selector(mame_ui_manager &mui, render_container &container, std::vector<std::string> &&_sel, uint16_t &_actual, int _category = 0, int _hover = 0); virtual ~menu_selector() override; protected: @@ -48,7 +48,7 @@ private: void find_matches(const char *str); std::string m_search; - UINT16 &m_selector; + uint16_t &m_selector; int m_category, m_hover; bool m_first_pass; std::vector<std::string> m_str_items; diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp index 9a7251d5290..f3b42810bef 100644 --- a/src/frontend/mame/ui/selgame.cpp +++ b/src/frontend/mame/ui/selgame.cpp @@ -498,7 +498,7 @@ void menu_select_game::populate() ui_globals::redraw_icon = true; ui_globals::switch_image = true; int old_item_selected = -1; - UINT32 flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; + uint32_t flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; if (!isfavorite()) { @@ -646,7 +646,7 @@ void menu_select_game::build_available_list() // build a name for it for (src = dir->name; *src != 0 && *src != '.' && dst < &drivername[ARRAY_LENGTH(drivername) - 1]; ++src) - *dst++ = tolower((UINT8) * src); + *dst++ = tolower((uint8_t) * src); *dst = 0; int drivnum = driver_list::find(drivername); @@ -700,7 +700,7 @@ void menu_select_game::build_available_list() if (hashes.flag(util::hash_collection::FLAG_NO_DUMP) || ROM_ISOPTIONAL(rom)) continue; - UINT64 lenght = ROM_GETLENGTH(rom); + uint64_t lenght = ROM_GETLENGTH(rom); auto found = false; auto parent_entries = rom_build_entries(drv->rom); for (auto parentrom = parent_entries.data(); !ROMENTRY_ISEND(parentrom) && found == false; ++parentrom) @@ -1209,7 +1209,7 @@ void menu_select_game::populate_search() } (index < VISIBLE_GAMES_IN_SEARCH) ? m_searchlist[index] = nullptr : m_searchlist[VISIBLE_GAMES_IN_SEARCH] = nullptr; - UINT32 flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; + uint32_t flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; for (int curitem = 0; m_searchlist[curitem]; ++curitem) { bool cloneof = strcmp(m_searchlist[curitem]->parent, "0"); diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp index 20f80651307..34b39137504 100644 --- a/src/frontend/mame/ui/selmenu.cpp +++ b/src/frontend/mame/ui/selmenu.cpp @@ -92,9 +92,9 @@ menu_select_launch::cache::cache(running_machine &machine) // create a texture for snapshot m_snapx_texture = texture_ptr(render.texture_alloc(render_texture::hq_scale), texture_free); - std::memcpy(&m_no_avail_bitmap->pix32(0), no_avail_bmp, 256 * 256 * sizeof(UINT32)); + std::memcpy(&m_no_avail_bitmap->pix32(0), no_avail_bmp, 256 * 256 * sizeof(uint32_t)); - std::memcpy(&m_star_bitmap->pix32(0), favorite_star_bmp, 32 * 32 * sizeof(UINT32)); + std::memcpy(&m_star_bitmap->pix32(0), favorite_star_bmp, 32 * 32 * sizeof(uint32_t)); m_star_texture = texture_ptr(render.texture_alloc(), texture_free); m_star_texture->set_bitmap(*m_star_bitmap, m_star_bitmap->cliprect(), TEXFORMAT_ARGB32); @@ -110,7 +110,7 @@ menu_select_launch::cache::cache(running_machine &machine) m_toolbar_texture.emplace_back(texture_ptr(render.texture_alloc(), texture_free)); m_sw_toolbar_texture.emplace_back(texture_ptr(render.texture_alloc(), texture_free)); - std::memcpy(&m_toolbar_bitmap.back()->pix32(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(UINT32)); + std::memcpy(&m_toolbar_bitmap.back()->pix32(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(uint32_t)); if (m_toolbar_bitmap.back()->valid()) m_toolbar_texture.back()->set_bitmap(*m_toolbar_bitmap.back(), m_toolbar_bitmap.back()->cliprect(), TEXFORMAT_ARGB32); else @@ -118,7 +118,7 @@ menu_select_launch::cache::cache(running_machine &machine) if ((i == 0U) || (i == 2U)) { - std::memcpy(&m_sw_toolbar_bitmap.back()->pix32(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(UINT32)); + std::memcpy(&m_sw_toolbar_bitmap.back()->pix32(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(uint32_t)); if (m_sw_toolbar_bitmap.back()->valid()) m_sw_toolbar_texture.back()->set_bitmap(*m_sw_toolbar_bitmap.back(), m_sw_toolbar_bitmap.back()->cliprect(), TEXFORMAT_ARGB32); else @@ -519,7 +519,7 @@ void menu_select_launch::draw_common_arrow(float origx1, float origy1, float ori void menu_select_launch::draw_info_arrow(int ub, float origx1, float origx2, float oy1, float line_height, float text_size, float ud_arrow_width) { rgb_t fgcolor = UI_TEXT_COLOR; - UINT32 orientation = (!ub) ? ROT0 : ROT0 ^ ORIENTATION_FLIP_Y; + uint32_t orientation = (!ub) ? ROT0 : ROT0 ^ ORIENTATION_FLIP_Y; if (mouse_hit && origx1 <= mouse_x && origx2 > mouse_x && oy1 <= mouse_y && oy1 + (line_height * text_size) > mouse_y) { @@ -762,7 +762,7 @@ void menu_select_launch::get_title_search(std::string &snaptext, std::string &se // handle keys for main menu //------------------------------------------------- -void menu_select_launch::handle_keys(UINT32 flags, int &iptkey) +void menu_select_launch::handle_keys(uint32_t flags, int &iptkey) { bool const ignorepause = stack_has_special_main_menu(); @@ -978,7 +978,7 @@ void menu_select_launch::handle_keys(UINT32 flags, int &iptkey) // handle input events for main menu //------------------------------------------------- -void menu_select_launch::handle_events(UINT32 flags, event &ev) +void menu_select_launch::handle_events(uint32_t flags, event &ev) { auto stop = false; ui_event local_menu_event; @@ -986,7 +986,7 @@ void menu_select_launch::handle_events(UINT32 flags, event &ev) if (m_pressed) { bool pressed = mouse_pressed(); - INT32 m_target_x, m_target_y; + int32_t m_target_x, m_target_y; bool m_button; auto mouse_target = machine().ui_input().find_mouse(&m_target_x, &m_target_y, &m_button); if (mouse_target && m_button && (hover == HOVER_ARROW_DOWN || hover == HOVER_ARROW_UP)) @@ -1183,7 +1183,7 @@ void menu_select_launch::handle_events(UINT32 flags, event &ev) // draw main menu //------------------------------------------------- -void menu_select_launch::draw(UINT32 flags) +void menu_select_launch::draw(uint32_t flags) { bool noinput = (flags & PROCESS_NOINPUT); float line_height = ui().get_line_height(); diff --git a/src/frontend/mame/ui/selmenu.h b/src/frontend/mame/ui/selmenu.h index 9b1e4c41d62..7741cc8b2d5 100644 --- a/src/frontend/mame/ui/selmenu.h +++ b/src/frontend/mame/ui/selmenu.h @@ -153,13 +153,13 @@ private: void get_title_search(std::string &title, std::string &search); // handle keys - virtual void handle_keys(UINT32 flags, int &iptkey) override; + virtual void handle_keys(uint32_t flags, int &iptkey) override; // handle mouse - virtual void handle_events(UINT32 flags, event &ev) override; + virtual void handle_events(uint32_t flags, event &ev) override; // draw game list - virtual void draw(UINT32 flags) override; + virtual void draw(uint32_t flags) override; // draw right panel void draw_right_panel(float origx1, float origy1, float origx2, float origy2); diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp index bafcbfda82f..421dc010467 100644 --- a/src/frontend/mame/ui/selsoft.cpp +++ b/src/frontend/mame/ui/selsoft.cpp @@ -419,7 +419,7 @@ void menu_select_software::handle() void menu_select_software::populate() { - UINT32 flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; + uint32_t flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; m_has_empty_start = true; int old_software = -1; diff --git a/src/frontend/mame/ui/simpleselgame.cpp b/src/frontend/mame/ui/simpleselgame.cpp index f4c583eb55f..6c52d2d46bd 100644 --- a/src/frontend/mame/ui/simpleselgame.cpp +++ b/src/frontend/mame/ui/simpleselgame.cpp @@ -74,7 +74,7 @@ void simple_menu_select_game::build_driver_list() // build a name for it for (src = dir->name; *src != 0 && *src != '.' && dst < &drivername[ARRAY_LENGTH(drivername) - 1]; src++) - *dst++ = tolower((UINT8)*src); + *dst++ = tolower((uint8_t)*src); *dst = 0; int drivnum = m_drivlist->find(drivername); diff --git a/src/frontend/mame/ui/simpleselgame.h b/src/frontend/mame/ui/simpleselgame.h index 8570170d465..a368e61b40e 100644 --- a/src/frontend/mame/ui/simpleselgame.h +++ b/src/frontend/mame/ui/simpleselgame.h @@ -43,7 +43,7 @@ private: void inkey_special(const event *menu_event); // internal state - UINT8 m_error; + uint8_t m_error; bool m_rerandomize; std::string m_search; int m_matchlist[VISIBLE_GAMES_IN_LIST]; diff --git a/src/frontend/mame/ui/slider.h b/src/frontend/mame/ui/slider.h index 431fa8fcb94..8bca79c752f 100644 --- a/src/frontend/mame/ui/slider.h +++ b/src/frontend/mame/ui/slider.h @@ -21,17 +21,17 @@ #define SLIDER_NOCHANGE 0x12345678 -typedef std::function<INT32(running_machine&, void*, int, std::string*, INT32)> slider_update; +typedef std::function<int32_t(running_machine&, void*, int, std::string*, int32_t)> slider_update; struct slider_state { slider_state * next; /* pointer to next slider */ slider_update update; /* callback */ void * arg; /* argument */ - INT32 minval; /* minimum value */ - INT32 defval; /* default value */ - INT32 maxval; /* maximum value */ - INT32 incval; /* increment value */ + int32_t minval; /* minimum value */ + int32_t defval; /* default value */ + int32_t maxval; /* maximum value */ + int32_t incval; /* increment value */ int id; char description[1]; /* textual description */ }; diff --git a/src/frontend/mame/ui/sliderchangednotifier.h b/src/frontend/mame/ui/sliderchangednotifier.h index 40e6df4b4bf..60bcf9c79fe 100644 --- a/src/frontend/mame/ui/sliderchangednotifier.h +++ b/src/frontend/mame/ui/sliderchangednotifier.h @@ -14,7 +14,7 @@ #include <cstdint> #include <string> -using INT32 = std::int32_t; +using int32_t = std::int32_t; class running_machine; @@ -23,7 +23,7 @@ class slider_changed_notifier public: virtual ~slider_changed_notifier() { } - virtual INT32 slider_changed(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) = 0; + virtual int32_t slider_changed(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) = 0; }; #endif // __SLIDER_CHANGED_NOTIFIER__ diff --git a/src/frontend/mame/ui/sliders.cpp b/src/frontend/mame/ui/sliders.cpp index a4e66b74802..f311243f1ae 100644 --- a/src/frontend/mame/ui/sliders.cpp +++ b/src/frontend/mame/ui/sliders.cpp @@ -42,8 +42,8 @@ void menu_sliders::handle() if (menu_event->itemref != nullptr && menu_event->type == menu_item_type::SLIDER) { const slider_state *slider = (const slider_state *)menu_event->itemref; - INT32 curvalue = slider->update(machine(), slider->arg, slider->id, nullptr, SLIDER_NOCHANGE); - INT32 increment = 0; + int32_t curvalue = slider->update(machine(), slider->arg, slider->id, nullptr, SLIDER_NOCHANGE); + int32_t increment = 0; bool alt_pressed = machine().input().code_pressed(KEYCODE_LALT) || machine().input().code_pressed(KEYCODE_RALT); bool ctrl_pressed = machine().input().code_pressed(KEYCODE_LCONTROL) || machine().input().code_pressed(KEYCODE_RCONTROL); bool shift_pressed = machine().input().code_pressed(KEYCODE_LSHIFT) || machine().input().code_pressed(KEYCODE_RSHIFT); @@ -95,7 +95,7 @@ void menu_sliders::handle() // handle any changes if (increment != 0) { - INT32 newvalue = curvalue + increment; + int32_t newvalue = curvalue + increment; // clamp within bounds if (newvalue < slider->minval) @@ -146,8 +146,8 @@ void menu_sliders::populate() if (item.type == menu_item_type::SLIDER) { slider_state* slider = reinterpret_cast<slider_state *>(item.ref); - INT32 curval = slider->update(machine(), slider->arg, slider->id, &tempstring, SLIDER_NOCHANGE); - UINT32 flags = 0; + int32_t curval = slider->update(machine(), slider->arg, slider->id, &tempstring, SLIDER_NOCHANGE); + uint32_t flags = 0; if (curval > slider->minval) flags |= FLAG_LEFT_ARROW; if (curval < slider->maxval) @@ -169,8 +169,8 @@ void menu_sliders::populate() if (item.type == menu_item_type::SLIDER) { slider_state* slider = reinterpret_cast<slider_state *>(item.ref); - INT32 curval = slider->update(machine(), slider->arg, slider->id, &tempstring, SLIDER_NOCHANGE); - UINT32 flags = 0; + int32_t curval = slider->update(machine(), slider->arg, slider->id, &tempstring, SLIDER_NOCHANGE); + uint32_t flags = 0; if (curval > slider->minval) flags |= FLAG_LEFT_ARROW; if (curval < slider->maxval) @@ -201,7 +201,7 @@ void menu_sliders::custom_render(void *selectedref, float top, float bottom, flo float percentage, default_percentage; std::string tempstring; float text_height; - INT32 curval; + int32_t curval; // determine the current value and text curval = curslider->update(machine(), curslider->arg, curslider->id, &tempstring, SLIDER_NOCHANGE); @@ -263,9 +263,9 @@ void menu_sliders::custom_render(void *selectedref, float top, float bottom, flo // standard menu handler //------------------------------------------------- -UINT32 menu_sliders::ui_handler(render_container &container, mame_ui_manager &mui) +uint32_t menu_sliders::ui_handler(render_container &container, mame_ui_manager &mui) { - UINT32 result; + uint32_t result; // if this is the first call, push the sliders menu if (topmost_menu<menu_sliders>(mui.machine()) == nullptr) diff --git a/src/frontend/mame/ui/sliders.h b/src/frontend/mame/ui/sliders.h index 6e3affb53b8..54b2af38f78 100644 --- a/src/frontend/mame/ui/sliders.h +++ b/src/frontend/mame/ui/sliders.h @@ -22,7 +22,7 @@ public: menu_sliders(mame_ui_manager &mui, render_container &container, bool menuless_mode = false); virtual ~menu_sliders() override; - static UINT32 ui_handler(render_container &container, mame_ui_manager &mui); + static uint32_t ui_handler(render_container &container, mame_ui_manager &mui); protected: virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; diff --git a/src/frontend/mame/ui/sndmenu.cpp b/src/frontend/mame/ui/sndmenu.cpp index a5c8425f337..2496a18186b 100644 --- a/src/frontend/mame/ui/sndmenu.cpp +++ b/src/frontend/mame/ui/sndmenu.cpp @@ -126,7 +126,7 @@ void menu_sound_options::handle() void menu_sound_options::populate() { - UINT32 arrow_flags = get_arrow_flags(UINT16(0), UINT16(ARRAY_LENGTH(m_sound_rate) - 1), m_cur_rates); + uint32_t arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(ARRAY_LENGTH(m_sound_rate) - 1), m_cur_rates); m_sample_rate = m_sound_rate[m_cur_rates]; // add options items diff --git a/src/frontend/mame/ui/sndmenu.h b/src/frontend/mame/ui/sndmenu.h index 19e110bbc7e..8cb78d47650 100644 --- a/src/frontend/mame/ui/sndmenu.h +++ b/src/frontend/mame/ui/sndmenu.h @@ -39,7 +39,7 @@ private: virtual void populate() override; virtual void handle() override; - UINT16 m_cur_rates; + uint16_t m_cur_rates; static const int m_sound_rate[]; int m_sample_rate; bool m_samples, m_sound; diff --git a/src/frontend/mame/ui/starimg.ipp b/src/frontend/mame/ui/starimg.ipp index 6918c3315ea..7f7f84e2c9a 100644 --- a/src/frontend/mame/ui/starimg.ipp +++ b/src/frontend/mame/ui/starimg.ipp @@ -8,7 +8,7 @@ namespace ui { namespace { // TODO: move this to an external image file and zlib compress it into a souce file as part of the build process -UINT32 const favorite_star_bmp[] = { +uint32_t const favorite_star_bmp[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02D07A00, 0x15D07A00, 0x0FD07A00, 0x00D07A00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, diff --git a/src/frontend/mame/ui/submenu.cpp b/src/frontend/mame/ui/submenu.cpp index 9b4b85331a8..1467a0e2921 100644 --- a/src/frontend/mame/ui/submenu.cpp +++ b/src/frontend/mame/ui/submenu.cpp @@ -315,7 +315,7 @@ void submenu::handle() void submenu::populate() { - UINT32 arrow_flags; + uint32_t arrow_flags; // add options for (auto sm_option = m_options.begin(); sm_option < m_options.end(); ++sm_option) diff --git a/src/frontend/mame/ui/tapectrl.cpp b/src/frontend/mame/ui/tapectrl.cpp index 9160ec5c1d7..57432ecd14e 100644 --- a/src/frontend/mame/ui/tapectrl.cpp +++ b/src/frontend/mame/ui/tapectrl.cpp @@ -67,7 +67,7 @@ void menu_tape_control::populate() cassette_state state; double t0 = current_device()->get_position(); double t1 = current_device()->get_length(); - UINT32 tapeflags = 0; + uint32_t tapeflags = 0; // state if (t1 > 0) diff --git a/src/frontend/mame/ui/toolbar.ipp b/src/frontend/mame/ui/toolbar.ipp index 3b2473a49de..933bf9c2d40 100644 --- a/src/frontend/mame/ui/toolbar.ipp +++ b/src/frontend/mame/ui/toolbar.ipp @@ -8,7 +8,7 @@ namespace ui { namespace { // TODO: move this to an external image file and zlib compress it into a souce file as part of the build process -UINT32 const toolbar_bitmap_bmp[][1024] = { +uint32_t const toolbar_bitmap_bmp[][1024] = { { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index 4499109f5c7..9d1adf2d1d8 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -130,7 +130,7 @@ slider_state *mame_ui_manager::slider_current; CORE IMPLEMENTATION ***************************************************************************/ -static const UINT32 mouse_bitmap[32*32] = +static const uint32_t mouse_bitmap[32*32] = { 0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff, 0x09a46f30,0x81ac7c43,0x24af8049,0x00ad7d45,0x00a8753a,0x00a46f30,0x009f6725,0x009b611c,0x00985b14,0x0095560d,0x00935308,0x00915004,0x00904e02,0x008f4e01,0x008f4d00,0x008f4d00,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff, @@ -204,7 +204,7 @@ void mame_ui_manager::init() // more initialization using namespace std::placeholders; set_handler(ui_callback_type::GENERAL, std::bind(&mame_ui_manager::handler_messagebox, this, _1)); - m_non_char_keys_down = std::make_unique<UINT8[]>((ARRAY_LENGTH(non_char_keys) + 7) / 8); + m_non_char_keys_down = std::make_unique<uint8_t[]>((ARRAY_LENGTH(non_char_keys) + 7) / 8); m_mouse_show = machine().system().flags & MACHINE_CLICKABLE_ARTWORK ? true : false; // request a callback upon exiting @@ -212,8 +212,8 @@ void mame_ui_manager::init() // create mouse bitmap bitmap_argb32 *ui_mouse_bitmap = auto_alloc(machine(), bitmap_argb32(32, 32)); - UINT32 *dst = &ui_mouse_bitmap->pix32(0); - memcpy(dst,mouse_bitmap,32*32*sizeof(UINT32)); + uint32_t *dst = &ui_mouse_bitmap->pix32(0); + memcpy(dst,mouse_bitmap,32*32*sizeof(uint32_t)); m_mouse_arrow_texture = machine().render().texture_alloc(); m_mouse_arrow_texture->set_bitmap(*ui_mouse_bitmap, ui_mouse_bitmap->cliprect(), TEXFORMAT_ARGB32); } @@ -264,7 +264,7 @@ void mame_ui_manager::initialize(running_machine &machine) // pair for the current UI handler //------------------------------------------------- -void mame_ui_manager::set_handler(ui_callback_type callback_type, const std::function<UINT32 (render_container &)> &&callback) +void mame_ui_manager::set_handler(ui_callback_type callback_type, const std::function<uint32_t (render_container &)> &&callback) { m_handler_callback = std::move(callback); m_handler_callback_type = callback_type; @@ -424,7 +424,7 @@ void mame_ui_manager::update_and_render(render_container &container) // display the internal mouse cursor if (m_mouse_show || (is_menu_active() && machine().options().ui_mouse())) { - INT32 mouse_target_x, mouse_target_y; + int32_t mouse_target_x, mouse_target_y; bool mouse_button; render_target *mouse_target = machine().ui_input().find_mouse(&mouse_target_x, &mouse_target_y, &mouse_button); @@ -468,9 +468,9 @@ render_font *mame_ui_manager::get_font() float mame_ui_manager::get_line_height() { - INT32 raw_font_pixel_height = get_font()->pixel_height(); + int32_t raw_font_pixel_height = get_font()->pixel_height(); render_target &ui_target = machine().render().ui_target(); - INT32 target_pixel_height = ui_target.height(); + int32_t target_pixel_height = ui_target.height(); float one_to_one_line_height; float scale_factor; @@ -498,7 +498,7 @@ float mame_ui_manager::get_line_height() // otherwise, just make sure we hit an even number of pixels else { - INT32 height = scale_factor * one_to_one_line_height * (float)target_pixel_height; + int32_t height = scale_factor * one_to_one_line_height * (float)target_pixel_height; scale_factor = (float)height / (one_to_one_line_height * (float)target_pixel_height); } @@ -770,7 +770,7 @@ bool mame_ui_manager::is_menu_active(void) // messagebox_text string but handles no input //------------------------------------------------- -UINT32 mame_ui_manager::handler_messagebox(render_container &container) +uint32_t mame_ui_manager::handler_messagebox(render_container &container) { draw_text_box(container, messagebox_text.c_str(), ui::text_layout::LEFT, 0.5f, 0.5f, messagebox_backcolor); return 0; @@ -783,9 +783,9 @@ UINT32 mame_ui_manager::handler_messagebox(render_container &container) // any keypress //------------------------------------------------- -UINT32 mame_ui_manager::handler_messagebox_anykey(render_container &container) +uint32_t mame_ui_manager::handler_messagebox_anykey(render_container &container) { - UINT32 state = 0; + uint32_t state = 0; // draw a standard message window draw_text_box(container, messagebox_text.c_str(), ui::text_layout::LEFT, 0.5f, 0.5f, messagebox_backcolor); @@ -816,8 +816,8 @@ void mame_ui_manager::process_natural_keyboard() int i, pressed; input_item_id itemid; input_code code; - UINT8 *key_down_ptr; - UINT8 key_down_mask; + uint8_t *key_down_ptr; + uint8_t key_down_mask; // loop while we have interesting events while (machine().ui_input().pop_event(&event)) @@ -986,7 +986,7 @@ void mame_ui_manager::start_save_state() machine().pause(); m_load_save_hold = true; using namespace std::placeholders; - set_handler(ui_callback_type::GENERAL, std::bind(&mame_ui_manager::handler_load_save, this, _1, UINT32(LOADSAVE_SAVE))); + set_handler(ui_callback_type::GENERAL, std::bind(&mame_ui_manager::handler_load_save, this, _1, uint32_t(LOADSAVE_SAVE))); } @@ -999,7 +999,7 @@ void mame_ui_manager::start_load_state() machine().pause(); m_load_save_hold = true; using namespace std::placeholders; - set_handler(ui_callback_type::GENERAL, std::bind(&mame_ui_manager::handler_load_save, this, _1, UINT32(LOADSAVE_LOAD))); + set_handler(ui_callback_type::GENERAL, std::bind(&mame_ui_manager::handler_load_save, this, _1, uint32_t(LOADSAVE_LOAD))); } @@ -1041,7 +1041,7 @@ void mame_ui_manager::image_handler_ingame() // of the standard keypresses //------------------------------------------------- -UINT32 mame_ui_manager::handler_ingame(render_container &container) +uint32_t mame_ui_manager::handler_ingame(render_container &container) { bool is_paused = machine().paused(); @@ -1269,7 +1269,7 @@ UINT32 mame_ui_manager::handler_ingame(render_container &container) // specifying a game to save or load //------------------------------------------------- -UINT32 mame_ui_manager::handler_load_save(render_container &container, UINT32 state) +uint32_t mame_ui_manager::handler_load_save(render_container &container, uint32_t state) { char filename[20]; char file = 0; @@ -1388,9 +1388,9 @@ void mame_ui_manager::request_quit() // confirming quit emulation //------------------------------------------------- -UINT32 mame_ui_manager::handler_confirm_quit(render_container &container) +uint32_t mame_ui_manager::handler_confirm_quit(render_container &container) { - UINT32 state = 0; + uint32_t state = 0; // get the text for 'UI Select' std::string ui_select_text = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD)); @@ -1441,10 +1441,10 @@ std::vector<ui::menu_item>& mame_ui_manager::get_slider_list(void) // slider_alloc - allocate a new slider entry //------------------------------------------------- -slider_state* mame_ui_manager::slider_alloc(running_machine &machine, int id, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, void *arg) +slider_state* mame_ui_manager::slider_alloc(running_machine &machine, int id, const char *title, int32_t minval, int32_t defval, int32_t maxval, int32_t incval, void *arg) { int size = sizeof(slider_state) + strlen(title); - slider_state *state = (slider_state *)auto_alloc_array_clear(machine, UINT8, size); + slider_state *state = (slider_state *)auto_alloc_array_clear(machine, uint8_t, size); state->minval = minval; state->defval = defval; @@ -1478,8 +1478,8 @@ std::vector<ui::menu_item> mame_ui_manager::slider_init(running_machine &machine mixer_input info; for (int item = 0; machine.sound().indexed_mixer_input(item, info); item++) { - INT32 maxval = 2000; - INT32 defval = 1000; + int32_t maxval = 2000; + int32_t defval = 1000; std::string str = string_format(_("%1$s Volume"), info.stream->input_name(info.inputnum)); sliders.push_back(slider_alloc(machine, SLIDER_ID_MIXERVOL + item, str.c_str(), 0, defval, maxval, 20, (void *)(uintptr_t)item)); @@ -1627,7 +1627,7 @@ std::vector<ui::menu_item> mame_ui_manager::slider_init(running_machine &machine // slider_changed - global slider-modified callback //---------------------------------------------------- -INT32 mame_ui_manager::slider_changed(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_changed(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { if (id == SLIDER_ID_VOLUME) return slider_volume(machine, arg, id, str, newval); @@ -1684,7 +1684,7 @@ INT32 mame_ui_manager::slider_changed(running_machine &machine, void *arg, int i // slider_volume - global volume slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_volume(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_volume(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { if (newval != SLIDER_NOCHANGE) machine.sound().set_attenuation(newval); @@ -1699,14 +1699,14 @@ INT32 mame_ui_manager::slider_volume(running_machine &machine, void *arg, int id // slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_mixervol(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_mixervol(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { mixer_input info; if (!machine.sound().indexed_mixer_input((uintptr_t)arg, info)) return 0; if (newval != SLIDER_NOCHANGE) { - INT32 curval = floor(info.stream->user_gain(info.inputnum) * 1000.0f + 0.5f); + int32_t curval = floor(info.stream->user_gain(info.inputnum) * 1000.0f + 0.5f); if (newval > curval && (newval - curval) <= 4) newval += 4; // round up on increment info.stream->set_user_gain(info.inputnum, (float)newval * 0.001f); } @@ -1721,7 +1721,7 @@ INT32 mame_ui_manager::slider_mixervol(running_machine &machine, void *arg, int // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_adjuster(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_adjuster(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { ioport_field *field = (ioport_field *)arg; ioport_field::user_settings settings; @@ -1743,7 +1743,7 @@ INT32 mame_ui_manager::slider_adjuster(running_machine &machine, void *arg, int // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_overclock(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_overclock(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { device_t *cpu = (device_t *)arg; if (newval != SLIDER_NOCHANGE) @@ -1758,7 +1758,7 @@ INT32 mame_ui_manager::slider_overclock(running_machine &machine, void *arg, int // slider_refresh - refresh rate slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_refresh(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_refresh(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast<screen_device *>(arg); double defrefresh = ATTOSECONDS_TO_HZ(screen->refresh_attoseconds()); @@ -1783,7 +1783,7 @@ INT32 mame_ui_manager::slider_refresh(running_machine &machine, void *arg, int i // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_brightness(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_brightness(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast<screen_device *>(arg); render_container::user_settings settings; @@ -1805,7 +1805,7 @@ INT32 mame_ui_manager::slider_brightness(running_machine &machine, void *arg, in // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_contrast(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_contrast(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast<screen_device *>(arg); render_container::user_settings settings; @@ -1826,7 +1826,7 @@ INT32 mame_ui_manager::slider_contrast(running_machine &machine, void *arg, int // slider_gamma - screen gamma slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_gamma(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_gamma(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast<screen_device *>(arg); render_container::user_settings settings; @@ -1848,7 +1848,7 @@ INT32 mame_ui_manager::slider_gamma(running_machine &machine, void *arg, int id, // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_xscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_xscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast<screen_device *>(arg); render_container::user_settings settings; @@ -1870,7 +1870,7 @@ INT32 mame_ui_manager::slider_xscale(running_machine &machine, void *arg, int id // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_yscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_yscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast<screen_device *>(arg); render_container::user_settings settings; @@ -1892,7 +1892,7 @@ INT32 mame_ui_manager::slider_yscale(running_machine &machine, void *arg, int id // slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_xoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_xoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast<screen_device *>(arg); render_container::user_settings settings; @@ -1914,7 +1914,7 @@ INT32 mame_ui_manager::slider_xoffset(running_machine &machine, void *arg, int i // slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_yoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_yoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast<screen_device *>(arg); render_container::user_settings settings; @@ -1936,7 +1936,7 @@ INT32 mame_ui_manager::slider_yoffset(running_machine &machine, void *arg, int i // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_overxscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_overxscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { laserdisc_device *laserdisc = (laserdisc_device *)arg; laserdisc_overlay_config settings; @@ -1958,7 +1958,7 @@ INT32 mame_ui_manager::slider_overxscale(running_machine &machine, void *arg, in // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_overyscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_overyscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { laserdisc_device *laserdisc = (laserdisc_device *)arg; laserdisc_overlay_config settings; @@ -1980,7 +1980,7 @@ INT32 mame_ui_manager::slider_overyscale(running_machine &machine, void *arg, in // slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_overxoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_overxoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { laserdisc_device *laserdisc = (laserdisc_device *)arg; laserdisc_overlay_config settings; @@ -2002,7 +2002,7 @@ INT32 mame_ui_manager::slider_overxoffset(running_machine &machine, void *arg, i // slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_overyoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_overyoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { laserdisc_device *laserdisc = (laserdisc_device *)arg; laserdisc_overlay_config settings; @@ -2024,7 +2024,7 @@ INT32 mame_ui_manager::slider_overyoffset(running_machine &machine, void *arg, i // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_flicker(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_flicker(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { if (newval != SLIDER_NOCHANGE) vector_options::s_flicker = (float)newval * 0.001f; @@ -2039,7 +2039,7 @@ INT32 mame_ui_manager::slider_flicker(running_machine &machine, void *arg, int i // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_beam_width_min(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_beam_width_min(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { if (newval != SLIDER_NOCHANGE) vector_options::s_beam_width_min = std::min((float)newval * 0.01f, vector_options::s_beam_width_max); @@ -2054,7 +2054,7 @@ INT32 mame_ui_manager::slider_beam_width_min(running_machine &machine, void *arg // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_beam_width_max(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_beam_width_max(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { if (newval != SLIDER_NOCHANGE) vector_options::s_beam_width_max = std::max((float)newval * 0.01f, vector_options::s_beam_width_min); @@ -2069,7 +2069,7 @@ INT32 mame_ui_manager::slider_beam_width_max(running_machine &machine, void *arg // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_beam_intensity_weight(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_beam_intensity_weight(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { if (newval != SLIDER_NOCHANGE) vector_options::s_beam_intensity_weight = (float)newval * 0.001f; @@ -2085,7 +2085,7 @@ INT32 mame_ui_manager::slider_beam_intensity_weight(running_machine &machine, vo //------------------------------------------------- #ifdef MAME_DEBUG -INT32 mame_ui_manager::slider_crossscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_crossscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { ioport_field *field = (ioport_field *)arg; @@ -2104,7 +2104,7 @@ INT32 mame_ui_manager::slider_crossscale(running_machine &machine, void *arg, in //------------------------------------------------- #ifdef MAME_DEBUG -INT32 mame_ui_manager::slider_crossoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_crossoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { ioport_field *field = (ioport_field *)arg; @@ -2158,7 +2158,7 @@ int mame_ui_manager::wrap_text(render_container &container, const char *origs, f // textured background and line color //------------------------------------------------- -void mame_ui_manager::draw_textured_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture, UINT32 flags) +void mame_ui_manager::draw_textured_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture, uint32_t flags) { container.add_quad(x0, y0, x1, y1, backcolor, texture, flags); container.add_line(x0, y0, x1, y0, UI_LINE_WIDTH, linecolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); @@ -2182,9 +2182,9 @@ rgb_t decode_ui_color(int id, running_machine *machine) const char *s_option = mame_machine_manager::instance()->ui().options().value(s_color_list[x]); int len = strlen(s_option); if (len != 8) - color[x] = rgb_t((UINT32)strtoul(o_default, nullptr, 16)); + color[x] = rgb_t((uint32_t)strtoul(o_default, nullptr, 16)); else - color[x] = rgb_t((UINT32)strtoul(s_option, nullptr, 16)); + color[x] = rgb_t((uint32_t)strtoul(s_option, nullptr, 16)); } } return color[id]; diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h index aa9852005ef..8364fa69ec2 100644 --- a/src/frontend/mame/ui/ui.h +++ b/src/frontend/mame/ui/ui.h @@ -68,7 +68,7 @@ class machine_info; #define UI_SLIDER_COLOR decode_ui_color(15) /* cancel return value for a UI handler */ -#define UI_HANDLER_CANCEL ((UINT32)~0) +#define UI_HANDLER_CANCEL ((uint32_t)~0) #define SLIDER_DEVICE_SPACING 0x0ff #define SLIDER_SCREEN_SPACING 0x0f @@ -129,7 +129,7 @@ enum ***************************************************************************/ class mame_ui_manager; -typedef UINT32 (*ui_callback)(mame_ui_manager &, render_container &, UINT32); +typedef uint32_t (*ui_callback)(mame_ui_manager &, render_container &, uint32_t); enum class ui_callback_type { @@ -170,7 +170,7 @@ public: void initialize(running_machine &machine); std::vector<ui::menu_item> slider_init(running_machine &machine); - void set_handler(ui_callback_type callback_type, const std::function<UINT32 (render_container &)> &&callback); + void set_handler(ui_callback_type callback_type, const std::function<uint32_t (render_container &)> &&callback); void display_startup_screens(bool first_time); virtual void set_startup_text(const char *text, bool force) override; @@ -226,7 +226,7 @@ public: int wrap_text(render_container &container, const char *origs, float x, float y, float origwrapwidth, std::vector<int> &xstart, std::vector<int> &xend, float text_size = 1.0f); // draw an outlined box with given line color and filled with a texture - void draw_textured_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture = nullptr, UINT32 flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); + void draw_textured_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture = nullptr, uint32_t flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); virtual void popup_time_string(int seconds, std::string message) override; virtual void menu_reset() override; @@ -234,15 +234,15 @@ public: private: // instance variables render_font * m_font; - std::function<UINT32 (render_container &)> m_handler_callback; + std::function<uint32_t (render_container &)> m_handler_callback; ui_callback_type m_handler_callback_type; - UINT32 m_handler_param; + uint32_t m_handler_param; bool m_single_step; bool m_showfps; osd_ticks_t m_showfps_end; bool m_show_profiler; osd_ticks_t m_popup_text_end; - std::unique_ptr<UINT8[]> m_non_char_keys_down; + std::unique_ptr<uint8_t[]> m_non_char_keys_down; render_texture * m_mouse_arrow_texture; bool m_mouse_show; bool m_load_save_hold; @@ -259,43 +259,43 @@ private: static slider_state *slider_current; // UI handlers - UINT32 handler_messagebox(render_container &container); - UINT32 handler_messagebox_anykey(render_container &container); - UINT32 handler_ingame(render_container &container); - UINT32 handler_load_save(render_container &container, UINT32 state); - UINT32 handler_confirm_quit(render_container &container); + uint32_t handler_messagebox(render_container &container); + uint32_t handler_messagebox_anykey(render_container &container); + uint32_t handler_ingame(render_container &container); + uint32_t handler_load_save(render_container &container, uint32_t state); + uint32_t handler_confirm_quit(render_container &container); // private methods void exit(); - slider_state* slider_alloc(running_machine &machine, int id, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, void *arg); + slider_state* slider_alloc(running_machine &machine, int id, const char *title, int32_t minval, int32_t defval, int32_t maxval, int32_t incval, void *arg); // slider controls - virtual INT32 slider_changed(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) override; - - INT32 slider_volume(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_mixervol(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_adjuster(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_overclock(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_refresh(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_brightness(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_contrast(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_gamma(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_xscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_yscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_xoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_yoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_overxscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_overyscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_overxoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_overyoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_flicker(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_beam_width_min(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_beam_width_max(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_beam_intensity_weight(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); + virtual int32_t slider_changed(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) override; + + int32_t slider_volume(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_mixervol(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_adjuster(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_overclock(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_refresh(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_brightness(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_contrast(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_gamma(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_xscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_yscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_xoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_yoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_overxscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_overyscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_overxoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_overyoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_flicker(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_beam_width_min(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_beam_width_max(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_beam_intensity_weight(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); std::string slider_get_screen_desc(screen_device &screen); #ifdef MAME_DEBUG - INT32 slider_crossscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_crossoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); + int32_t slider_crossscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_crossoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); #endif }; diff --git a/src/frontend/mame/ui/utils.cpp b/src/frontend/mame/ui/utils.cpp index 0f80d20be6e..937d0a0cc3f 100644 --- a/src/frontend/mame/ui/utils.cpp +++ b/src/frontend/mame/ui/utils.cpp @@ -15,60 +15,60 @@ extern const char UI_VERSION_TAG[]; const char UI_VERSION_TAG[] = "# UI INFO "; // Years index -UINT16 c_year::actual = 0; +uint16_t c_year::actual = 0; std::vector<std::string> c_year::ui; // Manufacturers index -UINT16 c_mnfct::actual = 0; +uint16_t c_mnfct::actual = 0; std::vector<std::string> c_mnfct::ui; std::unordered_map<std::string, int> c_mnfct::uimap; // Main filters -UINT16 main_filters::actual = 0; +uint16_t main_filters::actual = 0; const char *main_filters::text[] = { "All", "Available", "Unavailable", "Working", "Not Working", "Mechanical", "Not Mechanical", "Category", "Favorites", "BIOS", "Parents", "Clones", "Manufacturers", "Years", "Support Save", "Not Support Save", "CHD", "No CHD", "Vertical", "Horizontal", "Custom" }; size_t main_filters::length = ARRAY_LENGTH(main_filters::text); // Software filters -UINT16 sw_filters::actual = 0; +uint16_t sw_filters::actual = 0; const char *sw_filters::text[] = { "All", "Available", "Unavailable", "Parents", "Clones", "Years", "Publishers", "Supported", "Partial Supported", "Unsupported", "Region", "Device Type", "Software List", "Custom" }; size_t sw_filters::length = ARRAY_LENGTH(sw_filters::text); // Globals -UINT8 ui_globals::rpanel = 0; -UINT8 ui_globals::curimage_view = 0; -UINT8 ui_globals::curdats_view = 0; -UINT8 ui_globals::cur_sw_dats_total = 0; -UINT8 ui_globals::curdats_total = 0; -UINT8 ui_globals::cur_sw_dats_view = 0; +uint8_t ui_globals::rpanel = 0; +uint8_t ui_globals::curimage_view = 0; +uint8_t ui_globals::curdats_view = 0; +uint8_t ui_globals::cur_sw_dats_total = 0; +uint8_t ui_globals::curdats_total = 0; +uint8_t ui_globals::cur_sw_dats_view = 0; bool ui_globals::switch_image = false; bool ui_globals::default_image = true; bool ui_globals::reset = false; bool ui_globals::redraw_icon = false; int ui_globals::visible_main_lines = 0; int ui_globals::visible_sw_lines = 0; -UINT16 ui_globals::panels_status = 0; +uint16_t ui_globals::panels_status = 0; bool ui_globals::has_icons = false; // Custom filter -UINT16 custfltr::main = 0; -UINT16 custfltr::numother = 0; -UINT16 custfltr::other[MAX_CUST_FILTER]; -UINT16 custfltr::mnfct[MAX_CUST_FILTER]; -UINT16 custfltr::year[MAX_CUST_FILTER]; -UINT16 custfltr::screen[MAX_CUST_FILTER]; +uint16_t custfltr::main = 0; +uint16_t custfltr::numother = 0; +uint16_t custfltr::other[MAX_CUST_FILTER]; +uint16_t custfltr::mnfct[MAX_CUST_FILTER]; +uint16_t custfltr::year[MAX_CUST_FILTER]; +uint16_t custfltr::screen[MAX_CUST_FILTER]; // Custom filter -UINT16 sw_custfltr::main = 0; -UINT16 sw_custfltr::numother = 0; -UINT16 sw_custfltr::other[MAX_CUST_FILTER]; -UINT16 sw_custfltr::mnfct[MAX_CUST_FILTER]; -UINT16 sw_custfltr::year[MAX_CUST_FILTER]; -UINT16 sw_custfltr::region[MAX_CUST_FILTER]; -UINT16 sw_custfltr::type[MAX_CUST_FILTER]; -UINT16 sw_custfltr::list[MAX_CUST_FILTER]; +uint16_t sw_custfltr::main = 0; +uint16_t sw_custfltr::numother = 0; +uint16_t sw_custfltr::other[MAX_CUST_FILTER]; +uint16_t sw_custfltr::mnfct[MAX_CUST_FILTER]; +uint16_t sw_custfltr::year[MAX_CUST_FILTER]; +uint16_t sw_custfltr::region[MAX_CUST_FILTER]; +uint16_t sw_custfltr::type[MAX_CUST_FILTER]; +uint16_t sw_custfltr::list[MAX_CUST_FILTER]; char* chartrimcarriage(char str[]) { diff --git a/src/frontend/mame/ui/utils.h b/src/frontend/mame/ui/utils.h index 5e6c2f6acfd..29ce34abe87 100644 --- a/src/frontend/mame/ui/utils.h +++ b/src/frontend/mame/ui/utils.h @@ -19,7 +19,7 @@ #define MAX_CUST_FILTER 8 // GLOBAL ENUMERATORS -enum : UINT16 +enum : uint16_t { FILTER_FIRST = 0, FILTER_ALL = FILTER_FIRST, @@ -84,7 +84,7 @@ enum HIDE_BOTH }; -enum : UINT16 +enum : uint16_t { UI_SW_FIRST = 0, UI_SW_ALL = UI_SW_FIRST, @@ -130,7 +130,7 @@ struct ui_software_info { ui_software_info() {} ui_software_info(std::string sname, std::string lname, std::string pname, std::string y, std::string pub, - UINT8 s, std::string pa, const game_driver *d, std::string li, std::string i, std::string is, UINT8 em, + uint8_t s, std::string pa, const game_driver *d, std::string li, std::string i, std::string is, uint8_t em, std::string plong, std::string u, std::string de, bool av) { shortname = sname; longname = lname; parentname = pname; year = y; publisher = pub; @@ -142,13 +142,13 @@ struct ui_software_info std::string parentname; std::string year; std::string publisher; - UINT8 supported = 0; + uint8_t supported = 0; std::string part; const game_driver *driver = nullptr; std::string listname; std::string interface; std::string instance; - UINT8 startempty = 0; + uint8_t startempty = 0; std::string parentlongname; std::string usage; std::string devicetype; @@ -174,7 +174,7 @@ struct c_mnfct static std::string getname(const char *str); static std::vector<std::string> ui; static std::unordered_map<std::string, int> uimap; - static UINT16 actual; + static uint16_t actual; }; // Years @@ -182,23 +182,23 @@ struct c_year { static void set(const char *str); static std::vector<std::string> ui; - static UINT16 actual; + static uint16_t actual; }; // GLOBAL CLASS struct ui_globals { - static UINT8 curimage_view, curdats_view, curdats_total, cur_sw_dats_view, cur_sw_dats_total, rpanel; + static uint8_t curimage_view, curdats_view, curdats_total, cur_sw_dats_view, cur_sw_dats_total, rpanel; static bool switch_image, redraw_icon, default_image, reset; static int visible_main_lines, visible_sw_lines; - static UINT16 panels_status; + static uint16_t panels_status; static bool has_icons; }; #define main_struct(name) \ struct name##_filters \ { \ - static UINT16 actual; \ + static uint16_t actual; \ static const char *text[]; \ static size_t length; \ }; @@ -209,25 +209,25 @@ main_struct(sw); // Custom filter struct custfltr { - static UINT16 main; - static UINT16 numother; - static UINT16 other[MAX_CUST_FILTER]; - static UINT16 mnfct[MAX_CUST_FILTER]; - static UINT16 screen[MAX_CUST_FILTER]; - static UINT16 year[MAX_CUST_FILTER]; + static uint16_t main; + static uint16_t numother; + static uint16_t other[MAX_CUST_FILTER]; + static uint16_t mnfct[MAX_CUST_FILTER]; + static uint16_t screen[MAX_CUST_FILTER]; + static uint16_t year[MAX_CUST_FILTER]; }; // Software custom filter struct sw_custfltr { - static UINT16 main; - static UINT16 numother; - static UINT16 other[MAX_CUST_FILTER]; - static UINT16 mnfct[MAX_CUST_FILTER]; - static UINT16 year[MAX_CUST_FILTER]; - static UINT16 region[MAX_CUST_FILTER]; - static UINT16 type[MAX_CUST_FILTER]; - static UINT16 list[MAX_CUST_FILTER]; + static uint16_t main; + static uint16_t numother; + static uint16_t other[MAX_CUST_FILTER]; + static uint16_t mnfct[MAX_CUST_FILTER]; + static uint16_t year[MAX_CUST_FILTER]; + static uint16_t region[MAX_CUST_FILTER]; + static uint16_t type[MAX_CUST_FILTER]; + static uint16_t list[MAX_CUST_FILTER]; }; // GLOBAL FUNCTIONS diff --git a/src/frontend/mame/ui/viewgfx.cpp b/src/frontend/mame/ui/viewgfx.cpp index c7ffa27fbc6..d841757ad40 100644 --- a/src/frontend/mame/ui/viewgfx.cpp +++ b/src/frontend/mame/ui/viewgfx.cpp @@ -29,7 +29,7 @@ enum ui_gfx_modes UI_GFX_TILEMAP }; -const UINT8 MAX_GFX_DECODERS = 8; +const uint8_t MAX_GFX_DECODERS = 8; @@ -41,9 +41,9 @@ const UINT8 MAX_GFX_DECODERS = 8; struct ui_gfx_info { device_gfx_interface *interface; // pointer to device's gfx interface - UINT8 setcount; // how many gfx sets device has - UINT8 rotate[MAX_GFX_ELEMENTS]; // current rotation (orientation) value - UINT8 columns[MAX_GFX_ELEMENTS]; // number of items per row + uint8_t setcount; // how many gfx sets device has + uint8_t rotate[MAX_GFX_ELEMENTS]; // current rotation (orientation) value + uint8_t columns[MAX_GFX_ELEMENTS]; // number of items per row int offset[MAX_GFX_ELEMENTS]; // current offset of top,left item int color[MAX_GFX_ELEMENTS]; // current color selected }; @@ -51,7 +51,7 @@ struct ui_gfx_info struct ui_gfx_state { bool started; // have we called ui_gfx_count_devices() yet? - UINT8 mode; // which mode are we in? + uint8_t mode; // which mode are we in? // intermediate bitmaps bool bitmap_dirty; // is the bitmap dirty? @@ -64,17 +64,17 @@ struct ui_gfx_state palette_device *device; // pointer to current device int devcount; // how many palette devices exist int devindex; // which palette device is visible - UINT8 which; // which subset (pens or indirect colors)? - UINT8 columns; // number of items per row + uint8_t which; // which subset (pens or indirect colors)? + uint8_t columns; // number of items per row int offset; // current offset of top left item } palette; // graphics-specific data struct { - UINT8 devcount; // how many gfx devices exist - UINT8 devindex; // which device is visible - UINT8 set; // which set is visible + uint8_t devcount; // how many gfx devices exist + uint8_t devindex; // which device is visible + uint8_t set; // which set is visible } gfxset; // information about each gfx device @@ -87,7 +87,7 @@ struct ui_gfx_state int xoffs; // current X offset int yoffs; // current Y offset int zoom; // zoom factor - UINT8 rotate; // current rotation (orientation) value + uint8_t rotate; // current rotation (orientation) value } tilemap; }; @@ -137,7 +137,7 @@ static void tilemap_handler(mame_ui_manager &mui, render_container &container, u void ui_gfx_init(running_machine &machine) { ui_gfx_state *state = &ui_gfx; - UINT8 rotate = machine.system().flags & ORIENTATION_MASK; + uint8_t rotate = machine.system().flags & ORIENTATION_MASK; // make sure we clean up after ourselves machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ui_gfx_exit), &machine)); @@ -149,8 +149,8 @@ void ui_gfx_init(running_machine &machine) state->palette.columns = 16; // set up the graphics state - for (UINT8 i = 0; i < MAX_GFX_DECODERS; i++) - for (UINT8 j = 0; j < MAX_GFX_ELEMENTS; j++) + for (uint8_t i = 0; i < MAX_GFX_DECODERS; i++) + for (uint8_t j = 0; j < MAX_GFX_ELEMENTS; j++) { state->gfxdev[i].rotate[j] = rotate; state->gfxdev[i].columns[j] = 16; @@ -180,7 +180,7 @@ static void ui_gfx_count_devices(running_machine &machine, ui_gfx_state &state) for (device_gfx_interface &interface : gfx_interface_iterator(machine.root_device())) { // count the gfx sets in each device, skipping devices with none - UINT8 count = 0; + uint8_t count = 0; while (count < MAX_GFX_ELEMENTS && interface.gfx(count) != nullptr) count++; @@ -240,7 +240,7 @@ bool ui_gfx_is_relevant(running_machine &machine) // ui_gfx_ui_handler - primary UI handler //------------------------------------------------- -UINT32 ui_gfx_ui_handler(render_container &container, mame_ui_manager &mui, bool uistate) +uint32_t ui_gfx_ui_handler(render_container &container, mame_ui_manager &mui, bool uistate) { ui_gfx_state &state = ui_gfx; @@ -386,7 +386,7 @@ static void palette_handler(mame_ui_manager &mui, render_container &container, u title_buf << (state.palette.which ? _(" COLORS") : _(" PENS")); // if the mouse pointer is over one of our cells, add some info about the corresponding palette entry - INT32 mouse_target_x, mouse_target_y; + int32_t mouse_target_x, mouse_target_y; float mouse_x, mouse_y; bool mouse_button; render_target *mouse_target = mui.machine().ui_input().find_mouse(&mouse_target_x, &mouse_target_y, &mouse_button); @@ -673,7 +673,7 @@ static void gfxset_handler(mame_ui_manager &mui, render_container &container, ui // if the mouse pointer is over a pixel in a tile, add some info about the tile and pixel bool found_pixel = false; - INT32 mouse_target_x, mouse_target_y; + int32_t mouse_target_x, mouse_target_y; float mouse_x, mouse_y; bool mouse_button; render_target *mouse_target = mui.machine().ui_input().find_mouse(&mouse_target_x, &mouse_target_y, &mouse_button); @@ -693,7 +693,7 @@ static void gfxset_handler(mame_ui_manager &mui, render_container &container, ui ypixel = (cellypix - 2) - ypixel; if (info.rotate[set] & ORIENTATION_SWAP_XY) std::swap(xpixel, ypixel); - UINT8 pixdata = gfx.get_data(code)[xpixel + ypixel * gfx.rowbytes()]; + uint8_t pixdata = gfx.get_data(code)[xpixel + ypixel * gfx.rowbytes()]; util::stream_format(title_buf, " #%X:%X @ %d,%d = %X", code, info.color[set], xpixel, ypixel, gfx.colorbase() + info.color[set] * gfx.granularity() + pixdata); @@ -959,14 +959,14 @@ static void gfxset_draw_item(running_machine &machine, gfx_element &gfx, int ind // loop over rows in the cell for (y = 0; y < height; y++) { - UINT32 *dest = &bitmap.pix32(dsty + y, dstx); - const UINT8 *src = gfx.get_data(index); + uint32_t *dest = &bitmap.pix32(dsty + y, dstx); + const uint8_t *src = gfx.get_data(index); // loop over columns in the cell for (x = 0; x < width; x++) { int effx = x, effy = y; - const UINT8 *s; + const uint8_t *s; // compute effective x,y values after rotation if (!(rotate & ORIENTATION_SWAP_XY)) @@ -1019,8 +1019,8 @@ static void tilemap_handler(mame_ui_manager &mui, render_container &container, u // get the size of the tilemap itself tilemap_t *tilemap = mui.machine().tilemap().find(state.tilemap.which); - UINT32 mapwidth = tilemap->width(); - UINT32 mapheight = tilemap->height(); + uint32_t mapwidth = tilemap->width(); + uint32_t mapheight = tilemap->height(); if (state.tilemap.rotate & ORIENTATION_SWAP_XY) std::swap(mapwidth, mapheight); @@ -1077,7 +1077,7 @@ static void tilemap_handler(mame_ui_manager &mui, render_container &container, u util::stream_format(title_buf, "TILEMAP %d/%d", state.tilemap.which, mui.machine().tilemap().count() - 1); // if the mouse pointer is over a tile, add some info about its coordinates and color - INT32 mouse_target_x, mouse_target_y; + int32_t mouse_target_x, mouse_target_y; float mouse_x, mouse_y; bool mouse_button; render_target *mouse_target = mui.machine().ui_input().find_mouse(&mouse_target_x, &mouse_target_y, &mouse_button); @@ -1093,10 +1093,10 @@ static void tilemap_handler(mame_ui_manager &mui, render_container &container, u ypixel = (mapboxheight - 1) - ypixel; if (state.tilemap.rotate & ORIENTATION_SWAP_XY) std::swap(xpixel, ypixel); - UINT32 col = ((xpixel / pixelscale + state.tilemap.xoffs) / tilemap->tilewidth()) % tilemap->cols(); - UINT32 row = ((ypixel / pixelscale + state.tilemap.yoffs) / tilemap->tileheight()) % tilemap->rows(); - UINT8 gfxnum; - UINT32 code, color; + uint32_t col = ((xpixel / pixelscale + state.tilemap.xoffs) / tilemap->tilewidth()) % tilemap->cols(); + uint32_t row = ((ypixel / pixelscale + state.tilemap.yoffs) / tilemap->tileheight()) % tilemap->rows(); + uint8_t gfxnum; + uint32_t code, color; tilemap->get_info_debug(col, row, gfxnum, code, color); util::stream_format(title_buf, " @ %d,%d = GFX%d #%X:%X", col * tilemap->tilewidth(), row * tilemap->tileheight(), @@ -1155,8 +1155,8 @@ static void tilemap_handle_keys(running_machine &machine, ui_gfx_state &state, i // cache some info in locals tilemap_t *tilemap = machine.tilemap().find(state.tilemap.which); - UINT32 mapwidth = tilemap->width(); - UINT32 mapheight = tilemap->height(); + uint32_t mapwidth = tilemap->width(); + uint32_t mapheight = tilemap->height(); // handle zoom (minus,plus) if (machine.ui_input().pressed(IPT_UI_ZOOM_OUT) && state.tilemap.zoom > 0) diff --git a/src/frontend/mame/ui/viewgfx.h b/src/frontend/mame/ui/viewgfx.h index c7fec1d9260..5043ded0a27 100644 --- a/src/frontend/mame/ui/viewgfx.h +++ b/src/frontend/mame/ui/viewgfx.h @@ -26,7 +26,7 @@ void ui_gfx_init(running_machine &machine); bool ui_gfx_is_relevant(running_machine &machine); // master handler -UINT32 ui_gfx_ui_handler(render_container &container, mame_ui_manager &mui, bool uistate); +uint32_t ui_gfx_ui_handler(render_container &container, mame_ui_manager &mui, bool uistate); #endif /* __UI_VIEWGFX_H__ */ diff --git a/src/frontend/mame/ui/widgets.cpp b/src/frontend/mame/ui/widgets.cpp index da0b6c12538..cc2c276abfc 100644 --- a/src/frontend/mame/ui/widgets.cpp +++ b/src/frontend/mame/ui/widgets.cpp @@ -77,7 +77,7 @@ void widgets_manager::render_triangle(bitmap_argb32 &dest, bitmap_argb32 &source for (y = 0; y < height; y++) { int linewidth = (y * (halfwidth - 1) + (height / 2)) * 255 * 2 / height; - UINT32 *target = &dest.pix32(y, halfwidth); + uint32_t *target = &dest.pix32(y, halfwidth); // don't antialias if height < 12 if (dest.height() < 12) |