summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2021-11-13 22:09:24 +1100
committer Robbbert <Robbbert@users.noreply.github.com>2021-11-13 22:09:24 +1100
commitd8dd9bbee9c7fe319b6f16daa2349b3bb09b82e8 (patch)
tree0f7adaab0e1dee0b64071eca5fe49f4c50f45e80
parent64af120bab29a76161b960ed2a3639c6a2b19afd (diff)
parentd5848b215bb566c0dfbef95a2c55c59a81771c29 (diff)
Merge remote-tracking branch 'upstream/master'
-rw-r--r--hash/pockchalw.xml16
-rw-r--r--src/devices/bus/saitek_osa/sparc.cpp21
-rw-r--r--src/frontend/mame/ui/confswitch.cpp8
-rw-r--r--src/frontend/mame/ui/custui.cpp4
-rw-r--r--src/frontend/mame/ui/dirmenu.cpp18
-rw-r--r--src/frontend/mame/ui/menu.cpp89
-rw-r--r--src/frontend/mame/ui/menu.h6
-rw-r--r--src/frontend/mame/ui/menuitem.h32
-rw-r--r--src/frontend/mame/ui/selgame.cpp2
-rw-r--r--src/frontend/mame/ui/selmenu.cpp24
-rw-r--r--src/frontend/mame/ui/selmenu.h2
-rw-r--r--src/frontend/mame/ui/selsoft.cpp2
-rw-r--r--src/frontend/mame/ui/sliders.cpp8
-rw-r--r--src/frontend/mame/ui/state.cpp2
-rw-r--r--src/frontend/mame/ui/textbox.cpp2
-rw-r--r--src/frontend/mame/ui/ui.cpp19
-rw-r--r--src/frontend/mame/ui/ui.h1
-rw-r--r--src/frontend/mame/ui/videoopt.cpp2
-rw-r--r--src/mame/drivers/novag_diablo.cpp14
-rw-r--r--src/osd/modules/render/bgfx/chainmanager.cpp38
-rw-r--r--src/osd/modules/render/bgfx/inputpair.cpp8
-rw-r--r--src/osd/modules/render/d3d/d3dhlsl.cpp12
-rw-r--r--src/osd/windows/winmain.cpp7
23 files changed, 168 insertions, 169 deletions
diff --git a/hash/pockchalw.xml b/hash/pockchalw.xml
index 55b47a8b66b..d7f1935a034 100644
--- a/hash/pockchalw.xml
+++ b/hash/pockchalw.xml
@@ -328,8 +328,8 @@ license:CC0
<feature name="u12" value="7W00F" />
<feature name="u13" value="946 80B" />
<feature name="bt1" value="BATTERY" />
- <dataarea name="rom" size="2097152">
- <rom name="ps 0bd400 00repcs c1d1.u9" size="2097152" crc="21895af8" sha1="3f3149fdb7ceb36f7f3262eb9b29eda973c8d1ef" />
+ <dataarea name="rom" size="4194304">
+ <rom name="ps 0bd400 00repcs c1d1.u9" size="4194304" crc="5601f35c" sha1="7b55ba4fe8ff7203fa60190106f2f79befb06aae" />
</dataarea>
</part>
</software>
@@ -341,8 +341,8 @@ license:CC0
<info name="serial" value="8BD400" />
<info name="alt_title" value="進研ゼミ 中学講座 - 中学地理・歴史パック (地理ソフト・歴史ソフト完全対応版) (CR)" />
<part name="cart" interface="pockchalw_cart">
- <dataarea name="rom" size="2097152">
- <rom name="8BD400 [CR].pcw" size="2097152" crc="77d1d534" sha1="4363f4c650ea5d91d88307eee4424434df9e489f" />
+ <dataarea name="rom" size="4194304">
+ <rom name="8BD400 [CR].pcw" size="4194304" crc="f27575fe" sha1="92f3ae2db233d3fd84809c7658f2feaa85477ecf" />
</dataarea>
</part>
</software>
@@ -395,8 +395,8 @@ license:CC0
<feature name="u12" value="7W00F" />
<feature name="u13" value="012 80B" />
<feature name="bt1" value="BATTERY" />
- <dataarea name="rom" size="2097152">
- <rom name="pl 0bf400 00pcr c1d1.u9" size="2097152" crc="341e732b" sha1="cf6fd71ced47d67bcad3e9e45a1ecb295bc7eb68" />
+ <dataarea name="rom" size="4194304">
+ <rom name="pl 0bf400 00pcr c1d1.u9" size="4194304" crc="50016928" sha1="16287268d138b99ca90421d6c1aff737b4273451" />
</dataarea>
</part>
</software>
@@ -408,8 +408,8 @@ license:CC0
<info name="serial" value="8BF400" />
<info name="alt_title" value="進研ゼミ 中学講座 - 中学理科パック (1分野ソフト・2分野ソフト完全対応版) (LP)" />
<part name="cart" interface="pockchalw_cart">
- <dataarea name="rom" size="2097152">
- <rom name="8BF400 [LP].pcw" size="2097152" crc="e1d5c9e0" sha1="067728493a94f88e603a3d92d672683d7dc9ecd0" />
+ <dataarea name="rom" size="4194304">
+ <rom name="8BF400 [LP].pcw" size="4194304" crc="d35a38da" sha1="eb17b2a7a791f68898e0162bd4ab5e0f1c2fa9e2" />
</dataarea>
</part>
</software>
diff --git a/src/devices/bus/saitek_osa/sparc.cpp b/src/devices/bus/saitek_osa/sparc.cpp
index b04ab070bce..3b3a4222665 100644
--- a/src/devices/bus/saitek_osa/sparc.cpp
+++ b/src/devices/bus/saitek_osa/sparc.cpp
@@ -50,12 +50,25 @@ void saitekosa_sparc_device::device_reset()
// rom_region - device-specific ROM region
//-------------------------------------------------
+#define ROM_LOAD32_BYTE_BIOS(bios, name, offset, length, hash) \
+ ROMX_LOAD(name, offset, length, hash, ROM_SKIP(3) | ROM_BIOS(bios))
+
ROM_START( sparc )
ROM_REGION32_BE(0x40000, "maincpu", 0)
- ROM_LOAD32_BYTE("sm16b_512.u5", 0x000000, 0x10000, CRC(96bca59d) SHA1(2c7e693d0cdf69b6e566c6dd03bd24d39e32aa82) )
- ROM_LOAD32_BYTE("sm16b_512.u4", 0x000001, 0x10000, CRC(15dd621d) SHA1(e8f7404e84fe027b086fcb918fbcaf2ce4203567) )
- ROM_LOAD32_BYTE("sm16b_512.u3", 0x000002, 0x10000, CRC(3201c6e4) SHA1(9a209219a0ab4b4f874381a16773bf33f8f7ba25) )
- ROM_LOAD32_BYTE("sm16b_512a.u2", 0x000003, 0x10000, CRC(56dedec7) SHA1(4f9d37e0ca639f892a574aa10a3fb42bba9b82c6) )
+
+ ROM_DEFAULT_BIOS("v518")
+
+ ROM_SYSTEM_BIOS(0, "v512a", "Sparc (rev. 512A)")
+ ROM_LOAD32_BYTE_BIOS(0, "sm16b_512.u5", 0x000000, 0x10000, CRC(96bca59d) SHA1(2c7e693d0cdf69b6e566c6dd03bd24d39e32aa82) )
+ ROM_LOAD32_BYTE_BIOS(0, "sm16b_512.u4", 0x000001, 0x10000, CRC(15dd621d) SHA1(e8f7404e84fe027b086fcb918fbcaf2ce4203567) )
+ ROM_LOAD32_BYTE_BIOS(0, "sm16b_512.u3", 0x000002, 0x10000, CRC(3201c6e4) SHA1(9a209219a0ab4b4f874381a16773bf33f8f7ba25) )
+ ROM_LOAD32_BYTE_BIOS(0, "sm16b_512a.u2", 0x000003, 0x10000, CRC(56dedec7) SHA1(4f9d37e0ca639f892a574aa10a3fb42bba9b82c6) )
+
+ ROM_SYSTEM_BIOS(1, "v518", "Sparc (rev. 518)")
+ ROM_LOAD32_BYTE_BIOS(1, "sm16b_518.u5", 0x000000, 0x10000, CRC(cee97a8f) SHA1(541d9d3ee469bacb5a4c537f443836a684e5d168) )
+ ROM_LOAD32_BYTE_BIOS(1, "sm16b_518.u4", 0x000001, 0x10000, CRC(7ac37299) SHA1(36f95520fbc9dfed2078d848bf6c3cc7c5823895) )
+ ROM_LOAD32_BYTE_BIOS(1, "sm16b_518.u3", 0x000002, 0x10000, CRC(29426d9e) SHA1(ad14f6f2f3e6460d834382faeab78dca9ceb2a63) )
+ ROM_LOAD32_BYTE_BIOS(1, "sm16b_518.u2", 0x000003, 0x10000, CRC(b2274cf5) SHA1(d04f41fa1f61439a4655003398f3ae27c2d06f82) )
ROM_REGION(0x1000, "pals", 0)
ROM_LOAD("palce16v8h.u23.jed", 0x0000, 0x0c25, CRC(de79fabc) SHA1(27e01ec405e261109dbe10c254b7127eda0f1886) )
diff --git a/src/frontend/mame/ui/confswitch.cpp b/src/frontend/mame/ui/confswitch.cpp
index 1e89cb48d58..aeed0024b69 100644
--- a/src/frontend/mame/ui/confswitch.cpp
+++ b/src/frontend/mame/ui/confswitch.cpp
@@ -222,10 +222,10 @@ void menu_confswitch::handle(event const *ev)
{
if (!found_break)
{
- if (!item(--current).ref)
+ if (!item(--current).ref())
found_break = true;
}
- else if (!item(current - 1).ref)
+ else if (!item(current - 1).ref())
{
set_selected_index(current);
set_top_line(current - 1);
@@ -245,9 +245,9 @@ void menu_confswitch::handle(event const *ev)
auto current = selected_index();
while (item_count() > ++current)
{
- if (!item(current).ref)
+ if (!item(current).ref())
{
- if ((item_count() > (current + 1)) && (uintptr_t(item(current + 1).ref) != 1))
+ if ((item_count() > (current + 1)) && (uintptr_t(item(current + 1).ref()) != 1))
{
set_selected_index(current + 1);
set_top_line(current);
diff --git a/src/frontend/mame/ui/custui.cpp b/src/frontend/mame/ui/custui.cpp
index 982ec8bde39..89d06ba74d6 100644
--- a/src/frontend/mame/ui/custui.cpp
+++ b/src/frontend/mame/ui/custui.cpp
@@ -559,7 +559,7 @@ void menu_colors_ui::handle(event const *ev)
{
if ((uintptr_t)ev->itemref != MUI_RESTORE)
{
- menu::stack_push<menu_rgb_ui>(ui(), container(), &m_color_table[(uintptr_t)ev->itemref].color, selected_item().text);
+ menu::stack_push<menu_rgb_ui>(ui(), container(), &m_color_table[(uintptr_t)ev->itemref].color, selected_item().text());
}
else
{
@@ -1080,7 +1080,7 @@ void menu_palette_sel::handle(event const *ev)
{
if (ev->iptkey == IPT_UI_SELECT)
{
- m_original = rgb_t(uint32_t(strtoul(selected_item().subtext.c_str(), nullptr, 16)));
+ m_original = rgb_t(uint32_t(strtoul(selected_item().subtext().c_str(), nullptr, 16)));
reset_parent(reset_options::SELECT_FIRST);
stack_pop();
}
diff --git a/src/frontend/mame/ui/dirmenu.cpp b/src/frontend/mame/ui/dirmenu.cpp
index 9a6b3c09b8d..3b92204ae3e 100644
--- a/src/frontend/mame/ui/dirmenu.cpp
+++ b/src/frontend/mame/ui/dirmenu.cpp
@@ -253,7 +253,7 @@ void menu_add_change_folder::handle(event const *ev)
const menu_item &pitem = item(index);
// go up to the parent path
- if (pitem.text == "..")
+ if (pitem.text() == "..")
{
size_t first_sep = m_current_path.find_first_of(PATH_SEPARATOR[0]);
size_t last_sep = m_current_path.find_last_of(PATH_SEPARATOR[0]);
@@ -263,15 +263,15 @@ void menu_add_change_folder::handle(event const *ev)
else
{
// if isn't a drive, appends the directory
- if (pitem.subtext != "[DRIVE]")
+ if (pitem.subtext() != "[DRIVE]")
{
if (m_current_path[m_current_path.length() - 1] == PATH_SEPARATOR[0])
- m_current_path.append(pitem.text);
+ m_current_path.append(pitem.text());
else
- m_current_path.append(PATH_SEPARATOR).append(pitem.text);
+ m_current_path.append(PATH_SEPARATOR).append(pitem.text());
}
else
- m_current_path = pitem.text;
+ m_current_path = pitem.text();
}
// reset the char buffer also in this case
@@ -331,12 +331,12 @@ void menu_add_change_folder::handle(event const *ev)
// from current item to the end
for (entry = cur_selected; entry < item_count(); entry++)
- if (item(entry).ref != nullptr && !m_search.empty())
+ if (item(entry).ref() && !m_search.empty())
{
int match = 0;
for (int i = 0; i < m_search.size() + 1; i++)
{
- if (core_strnicmp(item(entry).text.c_str(), m_search.data(), i) == 0)
+ if (core_strnicmp(item(entry).text().c_str(), m_search.data(), i) == 0)
match = i;
}
@@ -350,12 +350,12 @@ void menu_add_change_folder::handle(event const *ev)
// and from the first item to current one
for (entry = 0; entry < cur_selected; entry++)
{
- if (item(entry).ref != nullptr && !m_search.empty())
+ if (item(entry).ref() && !m_search.empty())
{
int match = 0;
for (int i = 0; i < m_search.size() + 1; i++)
{
- if (core_strnicmp(item(entry).text.c_str(), m_search.data(), i) == 0)
+ if (core_strnicmp(item(entry).text().c_str(), m_search.data(), i) == 0)
match = i;
}
diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp
index 525e378dca6..4313a956643 100644
--- a/src/frontend/mame/ui/menu.cpp
+++ b/src/frontend/mame/ui/menu.cpp
@@ -321,12 +321,9 @@ void menu::item_append(menu_item_type type, uint32_t flags)
void menu::item_append(std::string &&text, std::string &&subtext, uint32_t flags, void *ref, menu_item_type type)
{
// allocate a new item and populate it
- menu_item pitem;
- pitem.text = std::move(text);
- pitem.subtext = std::move(subtext);
- pitem.flags = flags;
- pitem.ref = ref;
- pitem.type = type;
+ menu_item pitem(type, ref, flags);
+ pitem.set_text(std::move(text));
+ pitem.set_subtext(std::move(subtext));
// append to array
auto index = m_items.size();
@@ -336,10 +333,12 @@ void menu::item_append(std::string &&text, std::string &&subtext, uint32_t flags
--index;
}
else
+ {
m_items.emplace_back(std::move(pitem));
+ }
// update the selection if we need to
- if (m_resetpos == index || (m_resetref != nullptr && m_resetref == ref))
+ if ((m_resetpos == index) || (m_resetref && (m_resetref == ref)))
m_selected = index;
if (m_resetpos == (m_items.size() - 1))
m_selected = m_items.size() - 1;
@@ -406,7 +405,7 @@ const menu::event *menu::process()
if ((m_event.iptkey != IPT_INVALID) && selection_valid())
{
m_event.itemref = get_selection_ref();
- m_event.type = m_items[m_selected].type;
+ m_event.type = m_items[m_selected].type();
return &m_event;
}
else
@@ -426,7 +425,7 @@ void menu::set_selection(void *selected_itemref)
m_selected = -1;
for (int itemnum = 0; itemnum < m_items.size(); itemnum++)
{
- if (m_items[itemnum].ref == selected_itemref)
+ if (m_items[itemnum].ref() == selected_itemref)
{
m_selected = itemnum;
break;
@@ -476,11 +475,11 @@ void menu::draw(uint32_t flags)
for (auto const &pitem : m_items)
{
// compute width of left hand side
- float total_width = gutter_width + ui().get_string_width(pitem.text) + gutter_width;
+ float total_width = gutter_width + ui().get_string_width(pitem.text()) + gutter_width;
// add in width of right hand side
- if (!pitem.subtext.empty())
- total_width += 2.0f * gutter_width + ui().get_string_width(pitem.subtext);
+ if (!pitem.subtext().empty())
+ total_width += 2.0f * gutter_width + ui().get_string_width(pitem.subtext());
// track the maximum
if (total_width > visible_width)
@@ -556,7 +555,7 @@ void menu::draw(uint32_t flags)
{
auto const itemnum = top_line + linenum;
menu_item const &pitem = m_items[itemnum];
- std::string_view const itemtext = pitem.text;
+ std::string_view const itemtext = pitem.text();
rgb_t fgcolor = ui().colors().text_color();
rgb_t bgcolor = ui().colors().text_bg_color();
rgb_t fgcolor2 = ui().colors().subitem_color();
@@ -601,33 +600,33 @@ void menu::draw(uint32_t flags)
{
// if we're on the top line, display the up arrow
draw_arrow(
- 0.5f * (x1 + x2) - 0.5f * ud_arrow_width,
- line_y0 + 0.25f * line_height,
- 0.5f * (x1 + x2) + 0.5f * ud_arrow_width,
- line_y0 + 0.75f * line_height,
- fgcolor,
- ROT0);
+ 0.5f * (x1 + x2) - 0.5f * ud_arrow_width,
+ line_y0 + 0.25f * line_height,
+ 0.5f * (x1 + x2) + 0.5f * ud_arrow_width,
+ line_y0 + 0.75f * line_height,
+ fgcolor,
+ ROT0);
}
else if (downarrow)
{
// if we're on the bottom line, display the down arrow
draw_arrow(
- 0.5f * (x1 + x2) - 0.5f * ud_arrow_width,
- line_y0 + 0.25f * line_height,
- 0.5f * (x1 + x2) + 0.5f * ud_arrow_width,
- line_y0 + 0.75f * line_height,
- fgcolor,
- ROT0 ^ ORIENTATION_FLIP_Y);
+ 0.5f * (x1 + x2) - 0.5f * ud_arrow_width,
+ line_y0 + 0.25f * line_height,
+ 0.5f * (x1 + x2) + 0.5f * ud_arrow_width,
+ line_y0 + 0.75f * line_height,
+ fgcolor,
+ ROT0 ^ ORIENTATION_FLIP_Y);
}
- else if (pitem.type == menu_item_type::SEPARATOR)
+ else if (pitem.type() == menu_item_type::SEPARATOR)
{
// if we're just a divider, draw a line
container().add_line(visible_left, line_y0 + 0.5f * line_height, visible_left + visible_width, line_y0 + 0.5f * line_height, UI_LINE_WIDTH, ui().colors().border_color(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
}
- else if (pitem.subtext.empty())
+ else if (pitem.subtext().empty())
{
// if we don't have a subitem, just draw the string centered
- if (pitem.flags & FLAG_UI_HEADING)
+ if (pitem.flags() & FLAG_UI_HEADING)
{
float heading_width = ui().get_string_width(itemtext);
container().add_line(visible_left, line_y0 + 0.5f * line_height, visible_left + ((visible_width - heading_width) / 2) - lr_border, line_y0 + 0.5f * line_height, UI_LINE_WIDTH, ui().colors().border_color(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
@@ -644,7 +643,7 @@ void menu::draw(uint32_t flags)
else
{
// otherwise, draw the item on the left and the subitem text on the right
- bool const subitem_invert(pitem.flags & FLAG_INVERT);
+ bool const subitem_invert(pitem.flags() & FLAG_INVERT);
float item_width, subitem_width;
// draw the left-side text
@@ -656,9 +655,9 @@ void menu::draw(uint32_t flags)
mame_ui_manager::NORMAL, fgcolor, bgcolor,
&item_width, nullptr);
- if (pitem.flags & FLAG_COLOR_BOX)
+ if (pitem.flags() & FLAG_COLOR_BOX)
{
- rgb_t color = rgb_t((uint32_t)strtoul(pitem.subtext.c_str(), nullptr, 16));
+ rgb_t color = rgb_t((uint32_t)strtoul(pitem.subtext().c_str(), nullptr, 16));
// give 2 spaces worth of padding
subitem_width = ui().get_string_width("FF00FF00");
@@ -671,7 +670,7 @@ void menu::draw(uint32_t flags)
}
else
{
- std::string_view subitem_text(pitem.subtext);
+ std::string_view subitem_text(pitem.subtext());
// give 2 spaces worth of padding
item_width += 2.0f * gutter_width;
@@ -685,13 +684,13 @@ void menu::draw(uint32_t flags)
}
// customize subitem text color
- if (!core_stricmp(pitem.subtext.c_str(), _("On")))
+ if (!core_stricmp(pitem.subtext().c_str(), _("On")))
fgcolor2 = rgb_t(0x00,0xff,0x00);
- if (!core_stricmp(pitem.subtext.c_str(), _("Off")))
+ if (!core_stricmp(pitem.subtext().c_str(), _("Off")))
fgcolor2 = rgb_t(0xff,0x00,0x00);
- if (!core_stricmp(pitem.subtext.c_str(), _("Auto")))
+ if (!core_stricmp(pitem.subtext().c_str(), _("Auto")))
fgcolor2 = rgb_t(0xff,0xff,0x00);
// draw the subitem right-justified
@@ -705,7 +704,7 @@ void menu::draw(uint32_t flags)
}
// apply arrows
- if (is_selected(itemnum) && (pitem.flags & FLAG_LEFT_ARROW))
+ if (is_selected(itemnum) && (pitem.flags() & FLAG_LEFT_ARROW))
{
float const l = effective_left + effective_width - subitem_width - gutter_width;
float const r = l + lr_arrow_width;
@@ -716,14 +715,14 @@ void menu::draw(uint32_t flags)
if (mouse_in_rect(l, line_y0 + 0.1f * line_height, r, line_y0 + 0.9f * line_height))
m_hover = HOVER_UI_LEFT;
}
- if (is_selected(itemnum) && (pitem.flags & FLAG_RIGHT_ARROW))
+ if (is_selected(itemnum) && (pitem.flags() & FLAG_RIGHT_ARROW))
{
float const r = effective_left + effective_width + gutter_width;
float const l = r - lr_arrow_width;
draw_arrow(
- l, line_y0 + 0.1f * line_height, r, line_y0 + 0.9f * line_height,
- fgcolor,
- ROT90);
+ l, line_y0 + 0.1f * line_height, r, line_y0 + 0.9f * line_height,
+ fgcolor,
+ ROT90);
if (mouse_in_rect(l, line_y0 + 0.1f * line_height, r, line_y0 + 0.9f * line_height))
m_hover = HOVER_UI_RIGHT;
}
@@ -735,7 +734,7 @@ void menu::draw(uint32_t flags)
if (selected_subitem_too_big)
{
menu_item const &pitem = selected_item();
- bool const subitem_invert(pitem.flags & FLAG_INVERT);
+ bool const subitem_invert(pitem.flags() & FLAG_INVERT);
auto const linenum = m_selected - top_line;
float const line_y = visible_top + (float)linenum * line_height;
float target_width, target_height;
@@ -743,7 +742,7 @@ void menu::draw(uint32_t flags)
// compute the multi-line target width/height
ui().draw_text_full(
container(),
- pitem.subtext,
+ pitem.subtext(),
0, 0, visible_width * 0.75f,
text_layout::text_justify::RIGHT, text_layout::word_wrapping::WORD,
mame_ui_manager::NONE, rgb_t::white(), rgb_t::black(),
@@ -764,7 +763,7 @@ void menu::draw(uint32_t flags)
ui().draw_text_full(
container(),
- pitem.subtext,
+ pitem.subtext(),
target_x, target_y, target_width,
text_layout::text_justify::RIGHT, text_layout::word_wrapping::WORD,
mame_ui_manager::NORMAL, ui().colors().selected_color(), ui().colors().selected_bg_color(),
@@ -1006,8 +1005,8 @@ void menu::handle_keys(uint32_t flags, int &iptkey)
validate_selection(1);
// swallow left/right keys if they are not appropriate
- bool const ignoreleft = !(flags & PROCESS_LR_ALWAYS) && !(selected_item().flags & FLAG_LEFT_ARROW);
- bool const ignoreright = !(flags & PROCESS_LR_ALWAYS) && !(selected_item().flags & FLAG_RIGHT_ARROW);
+ bool const ignoreleft = !(flags & PROCESS_LR_ALWAYS) && !(selected_item().flags() & FLAG_LEFT_ARROW);
+ bool const ignoreright = !(flags & PROCESS_LR_ALWAYS) && !(selected_item().flags() & FLAG_RIGHT_ARROW);
// accept left/right/prev/next keys as-is with repeat if appropriate
if (!ignoreleft && exclusive_input_pressed(iptkey, IPT_UI_LEFT, (flags & PROCESS_LR_REPEAT) ? 6 : 0))
diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h
index e5904f2f347..a6e6c25d174 100644
--- a/src/frontend/mame/ui/menu.h
+++ b/src/frontend/mame/ui/menu.h
@@ -54,7 +54,7 @@ public:
void item_append(const std::string &text, const std::string &subtext, uint32_t flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN) { item_append(std::string(text), std::string(subtext), flags, ref, type); }
void item_append(std::string &&text, uint32_t flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN) { item_append(text, std::string(), flags, ref, type); }
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) { item_append(item.text, item.subtext, item.flags, item.ref, item.type); }
+ void item_append(menu_item item) { item_append(item.text(), item.subtext(), item.flags(), item.ref(), item.type()); }
void item_append(menu_item_type type, uint32_t flags = 0);
void item_append_on_off(const std::string &text, bool state, uint32_t flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN);
@@ -150,7 +150,7 @@ protected:
int item_count() const { return m_items.size(); }
// retrieves the ref of the currently selected menu item or nullptr
- void *get_selection_ref() const { return selection_valid() ? m_items[m_selected].ref : nullptr; }
+ void *get_selection_ref() const { return selection_valid() ? m_items[m_selected].ref() : nullptr; }
menu_item &selected_item() { return m_items[m_selected]; }
menu_item const &selected_item() const { return m_items[m_selected]; }
@@ -279,7 +279,7 @@ protected:
static bool is_selectable(menu_item const &item)
{
- return (!(item.flags & menu::FLAG_DISABLE) && (item.type != menu_item_type::SEPARATOR));
+ return (!(item.flags() & menu::FLAG_DISABLE) && (item.type() != menu_item_type::SEPARATOR));
}
// get arrows status
diff --git a/src/frontend/mame/ui/menuitem.h b/src/frontend/mame/ui/menuitem.h
index 4900e78485b..d92e4153ee4 100644
--- a/src/frontend/mame/ui/menuitem.h
+++ b/src/frontend/mame/ui/menuitem.h
@@ -15,6 +15,11 @@
#pragma once
+#include <cstdint>
+#include <string>
+#include <utility>
+
+
namespace ui {
// special menu item for separators
@@ -31,17 +36,32 @@ enum class menu_item_type
class menu_item
{
public:
- menu_item() = default;
menu_item(menu_item const &) = default;
menu_item(menu_item &&) = default;
menu_item &operator=(menu_item const &) = default;
menu_item &operator=(menu_item &&) = default;
- std::string text;
- std::string subtext;
- 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*)
+ menu_item(menu_item_type t = menu_item_type::UNKNOWN, void *r = nullptr, uint32_t f = 0) : m_ref(r), m_flags(f), m_type(t)
+ { }
+
+ std::string const &text() const noexcept { return m_text; }
+ std::string const &subtext() const noexcept { return m_subtext; }
+ void *ref() const noexcept { return m_ref; }
+ uint32_t flags() const noexcept { return m_flags; }
+ unsigned generation() const noexcept { return m_generation; }
+ menu_item_type type() const noexcept { return m_type; }
+
+ template <typename... T> void set_text(T &&... args) { m_text.assign(std::forward<T>(args)...); ++m_generation; }
+ template <typename... T> void set_subtext(T &&... args) { m_subtext.assign(std::forward<T>(args)...); ++m_generation; }
+ void set_flags(uint32_t f) noexcept { m_flags = f; ++m_generation; }
+
+private:
+ std::string m_text;
+ std::string m_subtext;
+ void *m_ref;
+ uint32_t m_flags;
+ unsigned m_generation = 0;
+ menu_item_type m_type;
};
} // namespace ui
diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp
index 315722922d2..e555bdfc15b 100644
--- a/src/frontend/mame/ui/selgame.cpp
+++ b/src/frontend/mame/ui/selgame.cpp
@@ -167,7 +167,7 @@ void menu_select_game::menu_activated()
void menu_select_game::handle(event const *ev)
{
if (!m_prev_selected)
- m_prev_selected = item(0).ref;
+ m_prev_selected = item(0).ref();
// if I have to select software, force software list submenu
if (reselect_last::get())
diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp
index b299c7e4167..fc20bc0c9ee 100644
--- a/src/frontend/mame/ui/selmenu.cpp
+++ b/src/frontend/mame/ui/selmenu.cpp
@@ -1980,7 +1980,7 @@ void menu_select_launch::draw(uint32_t flags)
float line_y = visible_top + (float(linenum) * line_height);
int itemnum = top_line + linenum;
const menu_item &pitem = item(itemnum);
- const std::string_view itemtext = pitem.text;
+ const std::string_view itemtext = pitem.text();
rgb_t fgcolor = ui().colors().text_color();
rgb_t bgcolor = ui().colors().text_bg_color();
rgb_t fgcolor3 = ui().colors().clone_color();
@@ -2012,7 +2012,7 @@ void menu_select_launch::draw(uint32_t flags)
bgcolor = ui().colors().mouseover_bg_color();
highlight(line_x0, line_y0, line_x1, line_y1, bgcolor);
}
- else if (pitem.ref == m_prev_selected)
+ else if (pitem.ref() == m_prev_selected)
{
fgcolor = fgcolor3 = ui().options().mouseover_color();
bgcolor = ui().colors().mouseover_bg_color();
@@ -2038,18 +2038,18 @@ void menu_select_launch::draw(uint32_t flags)
if (hover() == itemnum)
set_hover(HOVER_ARROW_DOWN);
}
- else if (pitem.type == menu_item_type::SEPARATOR)
+ else if (pitem.type() == menu_item_type::SEPARATOR)
{
// if we're just a divider, draw a line
container().add_line(visible_left, line_y + 0.5f * line_height, visible_left + visible_width, line_y + 0.5f * line_height,
UI_LINE_WIDTH, ui().colors().text_color(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
}
- else if (pitem.subtext.empty())
+ else if (pitem.subtext().empty())
{
// draw the item centered
- int const item_invert = pitem.flags & FLAG_INVERT;
+ int const item_invert = pitem.flags() & FLAG_INVERT;
if (m_has_icons)
- draw_icon(linenum, item(itemnum).ref, effective_left, line_y);
+ draw_icon(linenum, item(itemnum).ref(), effective_left, line_y);
ui().draw_text_full(
container(),
itemtext,
@@ -2060,15 +2060,15 @@ void menu_select_launch::draw(uint32_t flags)
}
else
{
- int const item_invert = pitem.flags & FLAG_INVERT;
- std::string_view const subitem_text = pitem.subtext;
+ int const item_invert = pitem.flags() & FLAG_INVERT;
+ std::string_view const subitem_text = pitem.subtext();
float item_width, subitem_width;
// compute right space for subitem
ui().draw_text_full(
container(),
subitem_text,
- effective_left + icon_offset, line_y, ui().get_string_width(pitem.subtext),
+ effective_left + icon_offset, line_y, ui().get_string_width(pitem.subtext()),
text_layout::text_justify::RIGHT, text_layout::word_wrapping::NEVER,
mame_ui_manager::NONE, item_invert ? fgcolor3 : fgcolor, bgcolor,
&subitem_width, nullptr);
@@ -2076,7 +2076,7 @@ void menu_select_launch::draw(uint32_t flags)
// draw the item left-justified
if (m_has_icons)
- draw_icon(linenum, item(itemnum).ref, effective_left, line_y);
+ draw_icon(linenum, item(itemnum).ref(), effective_left, line_y);
ui().draw_text_full(
container(),
itemtext,
@@ -2099,7 +2099,7 @@ void menu_select_launch::draw(uint32_t flags)
for (size_t count = m_available_items; count < item_count(); count++)
{
const menu_item &pitem = item(count);
- const std::string_view itemtext = pitem.text;
+ const std::string_view itemtext = pitem.text();
float line_x0 = x1 + 0.5f * UI_LINE_WIDTH;
float line_y0 = line;
float line_x1 = x2 - 0.5f * UI_LINE_WIDTH;
@@ -2126,7 +2126,7 @@ void menu_select_launch::draw(uint32_t flags)
highlight(line_x0, line_y0, line_x1, line_y1, bgcolor);
}
- if (pitem.type == menu_item_type::SEPARATOR)
+ if (pitem.type() == menu_item_type::SEPARATOR)
{
container().add_line(
visible_left, line + 0.5f * line_height,
diff --git a/src/frontend/mame/ui/selmenu.h b/src/frontend/mame/ui/selmenu.h
index 12da4d2b1f9..6568ca14a44 100644
--- a/src/frontend/mame/ui/selmenu.h
+++ b/src/frontend/mame/ui/selmenu.h
@@ -257,7 +257,7 @@ private:
{
for (int x = 0; x < item_count(); ++x)
{
- if (item(x).ref == m_prev_selected)
+ if (item(x).ref() == m_prev_selected)
{
set_selected_index(x);
break;
diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp
index e129b1c064e..25baf9fe32c 100644
--- a/src/frontend/mame/ui/selsoft.cpp
+++ b/src/frontend/mame/ui/selsoft.cpp
@@ -397,7 +397,7 @@ menu_select_software::~menu_select_software()
void menu_select_software::handle(event const *ev)
{
if (m_prev_selected == nullptr)
- m_prev_selected = item(0).ref;
+ m_prev_selected = item(0).ref();
// FIXME: everything above here used run before events were processed
diff --git a/src/frontend/mame/ui/sliders.cpp b/src/frontend/mame/ui/sliders.cpp
index 4dbb69baa1a..f17a0bf9781 100644
--- a/src/frontend/mame/ui/sliders.cpp
+++ b/src/frontend/mame/ui/sliders.cpp
@@ -160,9 +160,9 @@ void menu_sliders::populate(float &customtop, float &custombottom)
std::vector<menu_item> ui_sliders = ui().get_slider_list();
for (const menu_item &item : ui_sliders)
{
- if (item.type == menu_item_type::SLIDER)
+ if (item.type() == menu_item_type::SLIDER)
{
- slider_state *const slider = reinterpret_cast<slider_state *>(item.ref);
+ slider_state *const slider = reinterpret_cast<slider_state *>(item.ref());
bool display(true);
#if 0
// FIXME: this test should be reimplemented in a dedicated menu
@@ -192,9 +192,9 @@ void menu_sliders::populate(float &customtop, float &custombottom)
std::vector<menu_item> osd_sliders = machine().osd().get_slider_list();
for (const menu_item &item : osd_sliders)
{
- if (item.type == menu_item_type::SLIDER)
+ if (item.type() == menu_item_type::SLIDER)
{
- slider_state* slider = reinterpret_cast<slider_state *>(item.ref);
+ slider_state* slider = reinterpret_cast<slider_state *>(item.ref());
int32_t curval = slider->update(&tempstring, SLIDER_NOCHANGE);
uint32_t flags = 0;
if (curval > slider->minval)
diff --git a/src/frontend/mame/ui/state.cpp b/src/frontend/mame/ui/state.cpp
index afd02a3b08d..4bda4d473ba 100644
--- a/src/frontend/mame/ui/state.cpp
+++ b/src/frontend/mame/ui/state.cpp
@@ -420,7 +420,7 @@ void menu_load_save_state_base::custom_render(void *selectedref, float top, floa
text[count++] = m_footer;
// provide a prompt to delete if a state is selected
- if (selected_item().ref)
+ if (selected_item().ref())
{
if (m_delete_prompt.empty())
m_delete_prompt = util::string_format(_("Press %1$s to delete"), machine().input().seq_name(machine().ioport().type_seq(IPT_UI_CLEAR)));
diff --git a/src/frontend/mame/ui/textbox.cpp b/src/frontend/mame/ui/textbox.cpp
index 9761491bf78..71de239b35f 100644
--- a/src/frontend/mame/ui/textbox.cpp
+++ b/src/frontend/mame/ui/textbox.cpp
@@ -141,7 +141,7 @@ void menu_textbox::draw(uint32_t flags)
// get width required to draw the sole menu item
menu_item const &pitem = item(0);
- std::string_view const itemtext = pitem.text;
+ std::string_view const itemtext = pitem.text();
float const itemwidth = gutter_width + ui().get_string_width(itemtext) + gutter_width;
float const draw_width = std::min(maximum_width, std::max(itemwidth, m_desired_width));
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index 20fbab9b626..2eaebcb8d7e 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -117,7 +117,6 @@ std::string mame_ui_manager::messagebox_poptext;
// slider info
std::vector<ui::menu_item> mame_ui_manager::slider_list;
-slider_state *mame_ui_manager::slider_current;
/***************************************************************************
@@ -345,14 +344,6 @@ void mame_ui_manager::initialize(running_machine &machine)
// initialize the on-screen display system
slider_list = slider_init(machine);
- if (slider_list.size() > 0)
- {
- slider_current = reinterpret_cast<slider_state *>(slider_list[0].ref);
- }
- else
- {
- slider_current = nullptr;
- }
// if no test switch found, assign its input sequence to a service mode DIP
if (!m_machine_info->has_test_switch() && m_machine_info->has_dips())
@@ -1606,13 +1597,9 @@ std::vector<ui::menu_item> mame_ui_manager::slider_init(running_machine &machine
std::vector<ui::menu_item> items;
for (auto &slider : m_sliders)
{
- ui::menu_item item;
- item.text = slider->description;
- item.subtext = "";
- item.flags = 0;
- item.ref = slider.get();
- item.type = ui::menu_item_type::SLIDER;
- items.push_back(item);
+ ui::menu_item item(ui::menu_item_type::SLIDER, slider.get());
+ item.set_text(slider->description);
+ items.emplace_back(std::move(item));
}
return items;
diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h
index 639015f8733..89f1aa66743 100644
--- a/src/frontend/mame/ui/ui.h
+++ b/src/frontend/mame/ui/ui.h
@@ -267,7 +267,6 @@ private:
static std::string messagebox_poptext;
static std::vector<ui::menu_item> slider_list;
- static slider_state *slider_current;
// UI handlers
uint32_t handler_ingame(render_container &container);
diff --git a/src/frontend/mame/ui/videoopt.cpp b/src/frontend/mame/ui/videoopt.cpp
index 60d2b25c66b..e677993dec2 100644
--- a/src/frontend/mame/ui/videoopt.cpp
+++ b/src/frontend/mame/ui/videoopt.cpp
@@ -75,7 +75,7 @@ void menu_video_targets::handle(event const *ev)
menu::stack_push<menu_video_options>(
ui(),
container(),
- std::string(selected_item().text),
+ std::string(selected_item().text()),
*target,
&machine().video().snapshot_target() == target);
}
diff --git a/src/mame/drivers/novag_diablo.cpp b/src/mame/drivers/novag_diablo.cpp
index e4034229f05..4e641d3d89b 100644
--- a/src/mame/drivers/novag_diablo.cpp
+++ b/src/mame/drivers/novag_diablo.cpp
@@ -1,6 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:hap
-// thanks-to:yoyo_chessboard
+// thanks-to:yoyo_chessboard, Berger
/******************************************************************************
Novag Diablo 68000 (model 908)
@@ -346,16 +346,16 @@ void diablo_state::scorpio68k(machine_config &config)
ROM_START( diablo68 ) // ID = D 1.08
ROM_REGION16_BE( 0x20000, "maincpu", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE("d_evn_904.u3", 0x00000, 0x8000, CRC(03477746) SHA1(8bffcb159a61e59bfc45411e319aea6501ebe2f9) )
- ROM_LOAD16_BYTE("d_odd_904.u2", 0x00001, 0x8000, CRC(d46fcc7a) SHA1(8ed69cd0fec07bf5451eaa882c87cf7cf70c87eb) )
- ROM_LOAD16_BYTE("ds_bk.u4", 0x10000, 0x8000, CRC(553a5c8c) SHA1(ccb5460ff10766a5ca8008ae2cffcff794318108) ) // no odd rom
+ ROM_LOAD16_BYTE("d_904.u3", 0x00000, 0x8000, CRC(03477746) SHA1(8bffcb159a61e59bfc45411e319aea6501ebe2f9) )
+ ROM_LOAD16_BYTE("d_924.u2", 0x00001, 0x8000, CRC(e182dbdd) SHA1(24dacbef2173fa737636e4729ff22ec1e6623ca5) ) // only 2 bytes differ (one of them is the checksum)
+ ROM_LOAD16_BYTE("502.u4", 0x10000, 0x8000, CRC(553a5c8c) SHA1(ccb5460ff10766a5ca8008ae2cffcff794318108) ) // no odd rom
ROM_END
ROM_START( diablo68a ) // ID = D 1.08
ROM_REGION16_BE( 0x20000, "maincpu", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE("d_904.u3", 0x00000, 0x8000, CRC(03477746) SHA1(8bffcb159a61e59bfc45411e319aea6501ebe2f9) )
- ROM_LOAD16_BYTE("d_924.u2", 0x00001, 0x8000, CRC(e182dbdd) SHA1(24dacbef2173fa737636e4729ff22ec1e6623ca5) ) // only 2 bytes differ (one of them is the checksum)
- ROM_LOAD16_BYTE("502.u4", 0x10000, 0x8000, CRC(553a5c8c) SHA1(ccb5460ff10766a5ca8008ae2cffcff794318108) ) // no odd rom
+ ROM_LOAD16_BYTE("d_evn_904.u3", 0x00000, 0x8000, CRC(03477746) SHA1(8bffcb159a61e59bfc45411e319aea6501ebe2f9) )
+ ROM_LOAD16_BYTE("d_odd_904.u2", 0x00001, 0x8000, CRC(d46fcc7a) SHA1(8ed69cd0fec07bf5451eaa882c87cf7cf70c87eb) )
+ ROM_LOAD16_BYTE("ds_bk.u4", 0x10000, 0x8000, CRC(553a5c8c) SHA1(ccb5460ff10766a5ca8008ae2cffcff794318108) ) // no odd rom
ROM_END
diff --git a/src/osd/modules/render/bgfx/chainmanager.cpp b/src/osd/modules/render/bgfx/chainmanager.cpp
index 2de2870fdd2..73128c12a0b 100644
--- a/src/osd/modules/render/bgfx/chainmanager.cpp
+++ b/src/osd/modules/render/bgfx/chainmanager.cpp
@@ -417,14 +417,10 @@ void chain_manager::create_selection_slider(uint32_t screen_index)
auto state = std::make_unique<slider_state>(std::move(description), minval, defval, maxval, incval,
std::bind(&chain_manager::slider_changed, this, screen_index, _1, _2));
- ui::menu_item item;
- item.text = state->description;
- item.subtext = "";
- item.flags = 0;
- item.ref = state.get();
- item.type = ui::menu_item_type::SLIDER;
- m_selection_sliders.push_back(item);
- m_core_sliders.push_back(std::move(state));
+ ui::menu_item item(ui::menu_item_type::SLIDER, state.get());
+ item.set_text(state->description);
+ m_selection_sliders.emplace_back(item);
+ m_core_sliders.emplace_back(std::move(state));
}
uint32_t chain_manager::update_screen_textures(uint32_t view, render_primitive *starting_prim, osd_window& window)
@@ -685,7 +681,7 @@ std::vector<ui::menu_item> chain_manager::get_slider_list()
std::vector<ui::menu_item> input_sliders = input->get_slider_list();
for (ui::menu_item slider : input_sliders)
{
- sliders.push_back(slider);
+ sliders.emplace_back(slider);
}
}
}
@@ -695,27 +691,19 @@ std::vector<ui::menu_item> chain_manager::get_slider_list()
{
slider_state* core_slider = slider->core_slider();
- ui::menu_item item;
- item.text = core_slider->description;
- item.subtext = "";
- item.flags = 0;
- item.ref = core_slider;
- item.type = ui::menu_item_type::SLIDER;
- m_selection_sliders.push_back(item);
+ ui::menu_item item(ui::menu_item_type::SLIDER, core_slider);
+ item.set_text(core_slider->description);
+ m_selection_sliders.emplace_back(item);
- sliders.push_back(item);
+ sliders.emplace_back(std::move(item));
}
if (chain_sliders.size() > 0)
{
- ui::menu_item item;
- item.text = MENU_SEPARATOR_ITEM;
- item.subtext = "";
- item.flags = 0;
- item.ref = nullptr;
- item.type = ui::menu_item_type::SEPARATOR;
-
- sliders.push_back(item);
+ ui::menu_item item(ui::menu_item_type::SEPARATOR);
+ item.set_text(MENU_SEPARATOR_ITEM);
+
+ sliders.emplace_back(std::move(item));
}
}
diff --git a/src/osd/modules/render/bgfx/inputpair.cpp b/src/osd/modules/render/bgfx/inputpair.cpp
index 4f185db86ab..ea82ac5f814 100644
--- a/src/osd/modules/render/bgfx/inputpair.cpp
+++ b/src/osd/modules/render/bgfx/inputpair.cpp
@@ -118,12 +118,8 @@ void bgfx_input_pair::create_selection_slider(uint32_t screen_index)
m_slider_state = std::make_unique<slider_state>(std::move(description), minval, defval, maxval, incval,
std::bind(&bgfx_input_pair::texture_changed, this, screen_index, _1, _2));
- ui::menu_item item;
- item.text = m_slider_state->description;
- item.subtext = "";
- item.flags = 0;
- item.ref = m_slider_state.get();
- item.type = ui::menu_item_type::SLIDER;
+ ui::menu_item item(ui::menu_item_type::SLIDER, m_slider_state.get());
+ item.set_text(m_slider_state->description);
m_selection_slider = item;
}
diff --git a/src/osd/modules/render/d3d/d3dhlsl.cpp b/src/osd/modules/render/d3d/d3dhlsl.cpp
index 5e760de0e58..eabcd5bcb81 100644
--- a/src/osd/modules/render/d3d/d3dhlsl.cpp
+++ b/src/osd/modules/render/d3d/d3dhlsl.cpp
@@ -2371,14 +2371,10 @@ void shaders::init_slider_list()
std::unique_ptr<slider_state> core_slider = slider_alloc(std::move(name), desc->minval, desc->defval, desc->maxval, desc->step, slider_arg);
- ui::menu_item item;
- item.text = core_slider->description;
- item.subtext = "";
- item.flags = 0;
- item.ref = core_slider.get();
- item.type = ui::menu_item_type::SLIDER;
- m_sliders.push_back(item);
- m_core_sliders.push_back(std::move(core_slider));
+ ui::menu_item item(ui::menu_item_type::SLIDER, core_slider.get());
+ item.set_text(core_slider->description);
+ m_sliders.emplace_back(item);
+ m_core_sliders.emplace_back(std::move(core_slider));
}
}
}
diff --git a/src/osd/windows/winmain.cpp b/src/osd/windows/winmain.cpp
index 6211aafd720..3b05119009a 100644
--- a/src/osd/windows/winmain.cpp
+++ b/src/osd/windows/winmain.cpp
@@ -64,7 +64,6 @@ private:
{
~ui_state()
{
- std::lock_guard guard(mutex);
if (thread)
thread->join();
}
@@ -120,8 +119,10 @@ public:
}
state.buffer.str(std::string());
}
- // don't hold any locks lock while calling MessageBox
- win_message_box_utf8(parent, message.c_str(), emulator_info::get_appname(), MB_OK);
+ // Don't hold any locks lock while calling MessageBox.
+ // Parent window isn't set because MAME could destroy
+ // the window out from under us on a fatal error.
+ win_message_box_utf8(nullptr, message.c_str(), emulator_info::get_appname(), MB_OK);
}
});
state.active = true;