From f1b0eee723eccd786568bcd4b35868dfc38a62d5 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 6 Aug 2024 11:33:43 +0200 Subject: [PATCH 01/11] ui pointer options: set inc/dec to 1s (hold shift for shorter 0.1s), reset options to default when pressing Del --- plugins/hiscore/hiscore.dat | 2 +- src/frontend/mame/ui/ui.cpp | 27 ++++++++++++++++++---- src/frontend/mame/ui/ui.h | 1 + src/frontend/mame/ui/videoopt.cpp | 38 +++++++++++++++++++------------ src/mame/konami/xmen.cpp | 2 +- 5 files changed, 49 insertions(+), 21 deletions(-) diff --git a/plugins/hiscore/hiscore.dat b/plugins/hiscore/hiscore.dat index 96315ad875e..1cd88bfbde0 100644 --- a/plugins/hiscore/hiscore.dat +++ b/plugins/hiscore/hiscore.dat @@ -1978,7 +1978,7 @@ gngprot: @:maincpu,program,00d0,4,00,00 -diamond: +diamrun: @:maincpu,program,1200,80,4b,00 diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index e697f861da2..2f0a2388c9f 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -191,11 +191,16 @@ struct mame_ui_manager::active_pointer struct mame_ui_manager::pointer_options { pointer_options() - : timeout(std::chrono::seconds(3)) - , hide_inactive(true) - , timeout_set(false) - , hide_inactive_set(false) { + reset(); + } + + void reset() + { + timeout = std::chrono::seconds(3); + hide_inactive = true; + timeout_set = false; + hide_inactive_set = false; } bool options_set() const @@ -1773,7 +1778,6 @@ std::chrono::steady_clock::duration mame_ui_manager::pointer_activity_timeout(in } - //------------------------------------------------- // hide_inactive_pointers - get per-target hide // inactive pointers setting @@ -1789,6 +1793,19 @@ bool mame_ui_manager::hide_inactive_pointers(int target) const noexcept } +//------------------------------------------------- +// reset_pointer_options - reset per-target +// pointer options +//------------------------------------------------- + +void mame_ui_manager::reset_pointer_options(int target) noexcept +{ + assert((0 <= target) && (m_pointer_options.size() > target)); + if ((0 <= target) && (m_pointer_options.size() > target)) + m_pointer_options[target].reset(); +} + + /*************************************************************************** SLIDER CONTROLS diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h index 128300576e5..8fb6099dcc4 100644 --- a/src/frontend/mame/ui/ui.h +++ b/src/frontend/mame/ui/ui.h @@ -211,6 +211,7 @@ class mame_ui_manager : public ui_manager void set_hide_inactive_pointers(int target, bool hide) noexcept; std::chrono::steady_clock::duration pointer_activity_timeout(int target) const noexcept; bool hide_inactive_pointers(int target) const noexcept; + void reset_pointer_options(int target) noexcept; // drawing informational overlays void draw_fps_counter(render_container &container); diff --git a/src/frontend/mame/ui/videoopt.cpp b/src/frontend/mame/ui/videoopt.cpp index a179a2ec16f..8f1dd1e7b62 100644 --- a/src/frontend/mame/ui/videoopt.cpp +++ b/src/frontend/mame/ui/videoopt.cpp @@ -346,14 +346,10 @@ bool menu_video_options::handle(event const *ev) // pointer inactivity timeout case ITEM_POINTERTIMEOUT: - if (ev->iptkey == IPT_UI_SELECT) - { - // toggle hide after delay - ui().set_hide_inactive_pointers(m_target.index(), !ui().hide_inactive_pointers(m_target.index())); - changed = true; - } - else if (ev->iptkey == IPT_UI_LEFT) + switch (ev->iptkey) { + // decrease value + case IPT_UI_LEFT: if (!ui().hide_inactive_pointers(m_target.index())) { ui().set_hide_inactive_pointers(m_target.index(), true); @@ -362,8 +358,8 @@ bool menu_video_options::handle(event const *ev) } else { - bool const ctrl_pressed = machine().input().code_pressed(KEYCODE_LCONTROL) || machine().input().code_pressed(KEYCODE_RCONTROL); - std::chrono::milliseconds const increment(ctrl_pressed ? 1'000 : 100); + bool const shift_pressed = machine().input().code_pressed(KEYCODE_LSHIFT) || machine().input().code_pressed(KEYCODE_RSHIFT); + std::chrono::milliseconds const increment(shift_pressed ? 100 : 1'000); auto timeout = ui().pointer_activity_timeout(m_target.index()); auto const remainder = timeout % increment; timeout -= remainder.count() ? remainder : increment; @@ -373,9 +369,10 @@ bool menu_video_options::handle(event const *ev) changed = true; } } - } - else if (ev->iptkey == IPT_UI_RIGHT) - { + break; + + // increase value + case IPT_UI_RIGHT: if (ui().hide_inactive_pointers(m_target.index())) { auto const timeout = ui().pointer_activity_timeout(m_target.index()); @@ -385,14 +382,27 @@ bool menu_video_options::handle(event const *ev) } else { - bool const ctrl_pressed = machine().input().code_pressed(KEYCODE_LCONTROL) || machine().input().code_pressed(KEYCODE_RCONTROL); - int const increment(ctrl_pressed ? 1'000 : 100); + bool const shift_pressed = machine().input().code_pressed(KEYCODE_LSHIFT) || machine().input().code_pressed(KEYCODE_RSHIFT); + int const increment(shift_pressed ? 100 : 1'000); ui().set_pointer_activity_timeout( m_target.index(), std::chrono::milliseconds((1 + (timeout / std::chrono::milliseconds(increment))) * increment)); } changed = true; } + break; + + // toggle hide after delay + case IPT_UI_SELECT: + ui().set_hide_inactive_pointers(m_target.index(), !ui().hide_inactive_pointers(m_target.index())); + changed = true; + break; + + // restore default + case IPT_UI_CLEAR: + ui().reset_pointer_options(m_target.index()); + changed = true; + break; } break; diff --git a/src/mame/konami/xmen.cpp b/src/mame/konami/xmen.cpp index 94ab650941d..23703c4cada 100644 --- a/src/mame/konami/xmen.cpp +++ b/src/mame/konami/xmen.cpp @@ -514,7 +514,7 @@ static INPUT_PORTS_START( xmen ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE4 ) - PORT_BIT( 0x0030, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused + PORT_BIT( 0x0030, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, do_read) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, ready_read) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) From 0f3a9e4ced3bd70754e5add15593582dced52678 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 6 Aug 2024 12:24:58 +0200 Subject: [PATCH 02/11] ui pointer options: allow 0.0s hide delay to disable pointer --- src/frontend/mame/ui/ui.cpp | 2 +- src/frontend/mame/ui/videoopt.cpp | 29 ++++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index 2f0a2388c9f..aba04366d22 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -455,7 +455,7 @@ void mame_ui_manager::config_load_pointers( { auto const timeout(targetnode->get_attribute_float("activity_timeout", -1.0F)); auto const ms(std::lround(timeout * 1000.0F)); - if ((100 <= ms) && (10'000 >= ms)) + if ((0 <= ms) && (10'000 >= ms)) { m_pointer_options[index].timeout = std::chrono::milliseconds(ms); if (config_type::SYSTEM == cfg_type) diff --git a/src/frontend/mame/ui/videoopt.cpp b/src/frontend/mame/ui/videoopt.cpp index 8f1dd1e7b62..e8a01c17391 100644 --- a/src/frontend/mame/ui/videoopt.cpp +++ b/src/frontend/mame/ui/videoopt.cpp @@ -205,17 +205,20 @@ void menu_video_options::populate() bool const hide = ui().hide_inactive_pointers(m_target.index()); if (hide) { - int const precision = (timeout.count() % 10) ? 3 : (timeout.count() % 100) ? 2 : 1; - item_append( - _("Hide Inactive Pointers After Delay"), - util::string_format(_("%1$.*2$f s"), timeout.count() * 1e-3, precision), - ((timeout > std::chrono::milliseconds(100)) ? FLAG_LEFT_ARROW : 0) | FLAG_RIGHT_ARROW, - reinterpret_cast(ITEM_POINTERTIMEOUT)); + if (timeout.count()) + { + int const precision = (timeout.count() % 10) ? 3 : (timeout.count() % 100) ? 2 : 1; + item_append( + _("Hide Inactive Pointers After Delay"), + util::string_format(_("%1$.*2$f s"), timeout.count() * 1e-3, precision), + ((timeout >= std::chrono::milliseconds(100)) ? FLAG_LEFT_ARROW : 0) | FLAG_RIGHT_ARROW, + reinterpret_cast(ITEM_POINTERTIMEOUT)); + } + else + item_append(_("Hide Inactive Pointers After Delay"), _("Always"), FLAG_RIGHT_ARROW, reinterpret_cast(ITEM_POINTERTIMEOUT)); } else - { item_append(_("Hide Inactive Pointers After Delay"), _("Never"), FLAG_LEFT_ARROW, reinterpret_cast(ITEM_POINTERTIMEOUT)); - } } item_append(menu_item_type::SEPARATOR); @@ -358,13 +361,13 @@ bool menu_video_options::handle(event const *ev) } else { - bool const shift_pressed = machine().input().code_pressed(KEYCODE_LSHIFT) || machine().input().code_pressed(KEYCODE_RSHIFT); - std::chrono::milliseconds const increment(shift_pressed ? 100 : 1'000); auto timeout = ui().pointer_activity_timeout(m_target.index()); - auto const remainder = timeout % increment; - timeout -= remainder.count() ? remainder : increment; - if (std::chrono::milliseconds(100) <= timeout) + if (timeout >= std::chrono::milliseconds(100)) { + bool const shift_pressed = machine().input().code_pressed(KEYCODE_LSHIFT) || machine().input().code_pressed(KEYCODE_RSHIFT); + std::chrono::milliseconds const increment(shift_pressed ? 100 : 1'000); + auto const remainder = timeout % increment; + timeout -= remainder.count() ? remainder : increment; ui().set_pointer_activity_timeout(m_target.index(), timeout); changed = true; } From 8c8c25f5e31fd5d6e4b4fc60baac6f33a6d97ea8 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 6 Aug 2024 13:39:31 +0200 Subject: [PATCH 03/11] ui pointer options: revert reset options to default when pressing Del (conflict with ctrlr cfg) --- src/frontend/mame/ui/ui.cpp | 26 ++++---------------------- src/frontend/mame/ui/ui.h | 1 - src/frontend/mame/ui/videoopt.cpp | 6 ------ 3 files changed, 4 insertions(+), 29 deletions(-) diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index aba04366d22..1f2bff2927c 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -191,16 +191,11 @@ struct mame_ui_manager::active_pointer struct mame_ui_manager::pointer_options { pointer_options() + : timeout(std::chrono::seconds(3)) + , hide_inactive(true) + , timeout_set(false) + , hide_inactive_set(false) { - reset(); - } - - void reset() - { - timeout = std::chrono::seconds(3); - hide_inactive = true; - timeout_set = false; - hide_inactive_set = false; } bool options_set() const @@ -1793,19 +1788,6 @@ bool mame_ui_manager::hide_inactive_pointers(int target) const noexcept } -//------------------------------------------------- -// reset_pointer_options - reset per-target -// pointer options -//------------------------------------------------- - -void mame_ui_manager::reset_pointer_options(int target) noexcept -{ - assert((0 <= target) && (m_pointer_options.size() > target)); - if ((0 <= target) && (m_pointer_options.size() > target)) - m_pointer_options[target].reset(); -} - - /*************************************************************************** SLIDER CONTROLS diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h index 8fb6099dcc4..128300576e5 100644 --- a/src/frontend/mame/ui/ui.h +++ b/src/frontend/mame/ui/ui.h @@ -211,7 +211,6 @@ class mame_ui_manager : public ui_manager void set_hide_inactive_pointers(int target, bool hide) noexcept; std::chrono::steady_clock::duration pointer_activity_timeout(int target) const noexcept; bool hide_inactive_pointers(int target) const noexcept; - void reset_pointer_options(int target) noexcept; // drawing informational overlays void draw_fps_counter(render_container &container); diff --git a/src/frontend/mame/ui/videoopt.cpp b/src/frontend/mame/ui/videoopt.cpp index e8a01c17391..e955590b0d8 100644 --- a/src/frontend/mame/ui/videoopt.cpp +++ b/src/frontend/mame/ui/videoopt.cpp @@ -400,12 +400,6 @@ bool menu_video_options::handle(event const *ev) ui().set_hide_inactive_pointers(m_target.index(), !ui().hide_inactive_pointers(m_target.index())); changed = true; break; - - // restore default - case IPT_UI_CLEAR: - ui().reset_pointer_options(m_target.index()); - changed = true; - break; } break; From ca65298fd4ca5fdd04ebf79cfd43ae4432af2692 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 6 Aug 2024 13:40:11 +0200 Subject: [PATCH 04/11] ui pointer options: warning message if delay is set to 0.0s --- src/frontend/mame/ui/videoopt.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontend/mame/ui/videoopt.cpp b/src/frontend/mame/ui/videoopt.cpp index e955590b0d8..fb4fd14c358 100644 --- a/src/frontend/mame/ui/videoopt.cpp +++ b/src/frontend/mame/ui/videoopt.cpp @@ -370,6 +370,9 @@ bool menu_video_options::handle(event const *ev) timeout -= remainder.count() ? remainder : increment; ui().set_pointer_activity_timeout(m_target.index(), timeout); changed = true; + + if (!timeout.count()) + machine().popmessage(_("Clickable artwork is still active when pointer is hidden.")); } } break; From a75bb5341d9c39a84e6aecab10b734bafc1d6d9d Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 6 Aug 2024 14:18:40 +0200 Subject: [PATCH 05/11] ui: be consistent with custom_render passed variable names --- src/frontend/mame/ui/about.h | 2 +- src/frontend/mame/ui/analogipt.cpp | 16 ++++++++-------- src/frontend/mame/ui/analogipt.h | 2 +- src/frontend/mame/ui/auditmenu.cpp | 4 ++-- src/frontend/mame/ui/auditmenu.h | 2 +- src/frontend/mame/ui/confswitch.cpp | 8 ++++---- src/frontend/mame/ui/confswitch.h | 2 +- src/frontend/mame/ui/custui.h | 6 +++--- src/frontend/mame/ui/datmenu.h | 2 +- src/frontend/mame/ui/dirmenu.cpp | 4 ++-- src/frontend/mame/ui/filecreate.h | 2 +- src/frontend/mame/ui/filemngr.h | 2 +- src/frontend/mame/ui/filesel.h | 2 +- src/frontend/mame/ui/inputdevices.cpp | 20 ++++++++++---------- src/frontend/mame/ui/inputmap.cpp | 10 +++++----- src/frontend/mame/ui/inputmap.h | 2 +- src/frontend/mame/ui/menu.cpp | 2 +- src/frontend/mame/ui/menu.h | 2 +- src/frontend/mame/ui/selector.h | 2 +- src/frontend/mame/ui/selmenu.cpp | 2 +- src/frontend/mame/ui/selmenu.h | 2 +- src/frontend/mame/ui/simpleselgame.h | 2 +- src/frontend/mame/ui/sliders.cpp | 10 +++++----- src/frontend/mame/ui/sliders.h | 2 +- src/frontend/mame/ui/state.h | 2 +- src/frontend/mame/ui/submenu.h | 2 +- src/frontend/mame/ui/textbox.cpp | 4 ++-- src/frontend/mame/ui/textbox.h | 2 +- 28 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/frontend/mame/ui/about.h b/src/frontend/mame/ui/about.h index 90e9d738fa3..05026b318f6 100644 --- a/src/frontend/mame/ui/about.h +++ b/src/frontend/mame/ui/about.h @@ -30,7 +30,7 @@ class menu_about : public menu_textbox protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual void populate_text(std::optional &layout, float &width, int &lines) override; diff --git a/src/frontend/mame/ui/analogipt.cpp b/src/frontend/mame/ui/analogipt.cpp index aa6ffa5a07f..14b09f9c23d 100644 --- a/src/frontend/mame/ui/analogipt.cpp +++ b/src/frontend/mame/ui/analogipt.cpp @@ -113,7 +113,7 @@ void menu_analog::recompute_metrics(uint32_t width, uint32_t height, float aspec } -void menu_analog::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) +void menu_analog::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { // work out how much space to use for field names float const extrawidth(0.4F + (((ui().box_lr_border() * 2.0F) + ui().get_line_height()) * x_aspect())); @@ -133,19 +133,19 @@ void menu_analog::custom_render(uint32_t flags, void *selectedref, float top, fl m_prompt = util::string_format(_("menu-analoginput", "Press %s to show settings"), ui().get_general_input_setting(IPT_UI_ON_SCREEN_DISPLAY)); draw_text_box( &m_prompt, &m_prompt + 1, - m_box_left, m_box_right, y - top, y - top + line_height() + (tb_border() * 2.0F), + m_box_left, m_box_right, origy1 - top, origy1 - top + line_height() + (tb_border() * 2.0F), text_layout::text_justify::CENTER, text_layout::word_wrapping::TRUNCATE, false, fgcolor, ui().colors().background_color()); - m_box_top = y - top + line_height() + (tb_border() * 3.0F); - firstliney = y - top + line_height() + (tb_border() * 4.0F); - m_visible_fields = std::min(m_field_data.size(), int((y2 + bottom - tb_border() - firstliney) / line_height())); + m_box_top = origy1 - top + line_height() + (tb_border() * 3.0F); + firstliney = origy1 - top + line_height() + (tb_border() * 4.0F); + m_visible_fields = std::min(m_field_data.size(), int((origy2 + bottom - tb_border() - firstliney) / line_height())); m_box_bottom = firstliney + (line_height() * m_visible_fields) + tb_border(); } else { - m_box_top = y2 + tb_border(); - m_box_bottom = y2 + bottom; - firstliney = y2 + (tb_border() * 2.0F); + m_box_top = origy2 + tb_border(); + m_box_bottom = origy2 + bottom; + firstliney = origy2 + (tb_border() * 2.0F); m_visible_fields = m_bottom_fields; } ui().draw_outlined_box(container(), m_box_left, m_box_top, m_box_right, m_box_bottom, ui().colors().background_color()); diff --git a/src/frontend/mame/ui/analogipt.h b/src/frontend/mame/ui/analogipt.h index ee59954911c..8caba0e8f7d 100644 --- a/src/frontend/mame/ui/analogipt.h +++ b/src/frontend/mame/ui/analogipt.h @@ -31,7 +31,7 @@ class menu_analog : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual std::tuple custom_pointer_updated(bool changed, ui_event const &uievt) override; virtual void menu_activated() override; diff --git a/src/frontend/mame/ui/auditmenu.cpp b/src/frontend/mame/ui/auditmenu.cpp index 180c3005b73..22d4eb9e8c2 100644 --- a/src/frontend/mame/ui/auditmenu.cpp +++ b/src/frontend/mame/ui/auditmenu.cpp @@ -83,7 +83,7 @@ void menu_audit::recompute_metrics(uint32_t width, uint32_t height, float aspect } -void menu_audit::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) +void menu_audit::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { switch (m_phase) { @@ -92,7 +92,7 @@ void menu_audit::custom_render(uint32_t flags, void *selectedref, float top, flo { draw_text_box( &m_prompt, &m_prompt + 1, - x, x2, y2 + tb_border(), y2 + bottom, + origx1, origx2, origy2 + tb_border(), origy2 + bottom, text_layout::text_justify::CENTER, text_layout::word_wrapping::NEVER, false, ui().colors().text_color(), UI_GREEN_COLOR); } diff --git a/src/frontend/mame/ui/auditmenu.h b/src/frontend/mame/ui/auditmenu.h index 3a1c236549d..7341340804a 100644 --- a/src/frontend/mame/ui/auditmenu.h +++ b/src/frontend/mame/ui/auditmenu.h @@ -30,7 +30,7 @@ class menu_audit : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool custom_ui_back() override; private: diff --git a/src/frontend/mame/ui/confswitch.cpp b/src/frontend/mame/ui/confswitch.cpp index 9c17d39fdee..cf69bb7cfbb 100644 --- a/src/frontend/mame/ui/confswitch.cpp +++ b/src/frontend/mame/ui/confswitch.cpp @@ -348,7 +348,7 @@ void menu_settings_dip_switches::recompute_metrics(uint32_t width, uint32_t heig } -void menu_settings_dip_switches::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) +void menu_settings_dip_switches::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { // catch if no DIP locations have to be drawn if (!m_visible_switch_groups) @@ -371,9 +371,9 @@ void menu_settings_dip_switches::custom_render(uint32_t flags, void *selectedref } // draw extra menu area - float const boxwidth((std::max)(width + (lr_border() * 2.0f), x2 - x1)); + float const boxwidth((std::max)(width + (lr_border() * 2.0f), origx2 - origx1)); float const boxleft((1.0f - boxwidth) * 0.5f); - ui().draw_outlined_box(container(), boxleft, y2 + tb_border(), boxleft + boxwidth, y2 + bottom, ui().colors().background_color()); + ui().draw_outlined_box(container(), boxleft, origy2 + tb_border(), boxleft + boxwidth, origy2 + bottom, ui().colors().background_color()); // calculate centred layout float const nameleft((1.0f - width) * 0.5f); @@ -404,7 +404,7 @@ void menu_settings_dip_switches::custom_render(uint32_t flags, void *selectedref } // draw the name - float const liney(y2 + (tb_border() * 2.0f) + (line_height() * (DIP_SWITCH_HEIGHT + DIP_SWITCH_SPACING) * line)); + float const liney(origy2 + (tb_border() * 2.0f) + (line_height() * (DIP_SWITCH_HEIGHT + DIP_SWITCH_SPACING) * line)); draw_text_normal( group.name, nameleft, liney + (line_height() * (DIP_SWITCH_HEIGHT - 1.0f) / 2.0f), namewidth, diff --git a/src/frontend/mame/ui/confswitch.h b/src/frontend/mame/ui/confswitch.h index 4c04a18c601..3a3aba3c97e 100644 --- a/src/frontend/mame/ui/confswitch.h +++ b/src/frontend/mame/ui/confswitch.h @@ -84,7 +84,7 @@ class menu_settings_dip_switches : public menu_confswitch protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual std::tuple custom_pointer_updated(bool changed, ui_event const &uievt) override; private: diff --git a/src/frontend/mame/ui/custui.h b/src/frontend/mame/ui/custui.h index be9df136f7e..0a916b82f2a 100644 --- a/src/frontend/mame/ui/custui.h +++ b/src/frontend/mame/ui/custui.h @@ -60,7 +60,7 @@ class menu_font_ui : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual void menu_dismissed() override; private: @@ -96,7 +96,7 @@ class menu_colors_ui : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual void menu_dismissed() override; private: @@ -145,7 +145,7 @@ class menu_rgb_ui : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; private: enum diff --git a/src/frontend/mame/ui/datmenu.h b/src/frontend/mame/ui/datmenu.h index e8e7cea2887..a55f659a84d 100644 --- a/src/frontend/mame/ui/datmenu.h +++ b/src/frontend/mame/ui/datmenu.h @@ -44,7 +44,7 @@ class menu_dats_view : public menu_textbox protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual std::tuple custom_pointer_updated(bool changed, ui_event const &uievt) override; virtual void populate_text(std::optional &layout, float &width, int &lines) override; diff --git a/src/frontend/mame/ui/dirmenu.cpp b/src/frontend/mame/ui/dirmenu.cpp index 083dfbeba79..fba8f7fcb0c 100644 --- a/src/frontend/mame/ui/dirmenu.cpp +++ b/src/frontend/mame/ui/dirmenu.cpp @@ -165,7 +165,7 @@ class menu_add_change_folder : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool custom_ui_back() override { return !m_search.empty(); } @@ -447,7 +447,7 @@ class menu_display_actual : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; private: enum diff --git a/src/frontend/mame/ui/filecreate.h b/src/frontend/mame/ui/filecreate.h index a5f1ab92857..aeb6bcfb159 100644 --- a/src/frontend/mame/ui/filecreate.h +++ b/src/frontend/mame/ui/filecreate.h @@ -48,7 +48,7 @@ class menu_file_create : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool custom_ui_back() override; private: diff --git a/src/frontend/mame/ui/filemngr.h b/src/frontend/mame/ui/filemngr.h index a8c68ceb211..ba031a0ab21 100644 --- a/src/frontend/mame/ui/filemngr.h +++ b/src/frontend/mame/ui/filemngr.h @@ -32,7 +32,7 @@ class menu_file_manager : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; private: virtual void populate() override; diff --git a/src/frontend/mame/ui/filesel.h b/src/frontend/mame/ui/filesel.h index 6ca9cafbe68..8c19100259c 100644 --- a/src/frontend/mame/ui/filesel.h +++ b/src/frontend/mame/ui/filesel.h @@ -56,7 +56,7 @@ class menu_file_selector : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool custom_ui_back() override { return !m_filename.empty(); } virtual std::tuple custom_pointer_updated(bool changed, ui_event const &uievt) override; virtual void menu_activated() override; diff --git a/src/frontend/mame/ui/inputdevices.cpp b/src/frontend/mame/ui/inputdevices.cpp index 1ee03ad5c81..8f006ea55e7 100644 --- a/src/frontend/mame/ui/inputdevices.cpp +++ b/src/frontend/mame/ui/inputdevices.cpp @@ -44,7 +44,7 @@ class menu_input_device : public menu set_custom_space(0.0F, (line_height() * (m_have_analog ? 2.0F : 1.0F)) + (tb_border() * 3.0F)); } - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override { if (selectedref) { @@ -57,20 +57,20 @@ class menu_input_device : public menu // measure the name of the token string float const tokenwidth = (std::min)(get_string_width(token) + (gutter_width() * 2.0F), 1.0F); - float const boxwidth = (std::max)(tokenwidth, x2 - x); + float const boxwidth = (std::max)(tokenwidth, origx2 - origx1); rgb_t const fgcolor(ui().colors().text_color()); // draw the outer box ui().draw_outlined_box( container(), - (1.0F - boxwidth) * 0.5F, y2 + tb_border(), - (1.0F + boxwidth) * 0.5F, y2 + bottom, + (1.0F - boxwidth) * 0.5F, origy2 + tb_border(), + (1.0F + boxwidth) * 0.5F, origy2 + bottom, ui().colors().background_color()); // show the token draw_text_normal( token, - (1.0F - boxwidth) * 0.5F, y2 + (tb_border() * 2.0F), boxwidth, + (1.0F - boxwidth) * 0.5F, origy2 + (tb_border() * 2.0F), boxwidth, text_layout::text_justify::CENTER, text_layout::word_wrapping::TRUNCATE, fgcolor); @@ -81,11 +81,11 @@ class menu_input_device : public menu case ITEM_CLASS_RELATIVE: { // draw the indicator - float const indleft = x + gutter_width(); - float const indright = x2 - gutter_width(); - float const indtop = y2 + (tb_border() * 2.0F) + (line_height() * 1.2F); - float const indbottom = y2 + (tb_border() * 2.0F) + (line_height() * 1.8F); - float const indcentre = (x + x2) * 0.5F; + float const indleft = origx1 + gutter_width(); + float const indright = origx2 - gutter_width(); + float const indtop = origy2 + (tb_border() * 2.0F) + (line_height() * 1.2F); + float const indbottom = origy2 + (tb_border() * 2.0F) + (line_height() * 1.8F); + float const indcentre = (origx1 + origx2) * 0.5F; s32 const value = (input.itemclass() == ITEM_CLASS_ABSOLUTE) ? input.read_as_absolute(ITEM_MODIFIER_NONE) : input.read_as_relative(ITEM_MODIFIER_NONE); if (0 < value) { diff --git a/src/frontend/mame/ui/inputmap.cpp b/src/frontend/mame/ui/inputmap.cpp index d8a4d9656f4..b135780a08f 100644 --- a/src/frontend/mame/ui/inputmap.cpp +++ b/src/frontend/mame/ui/inputmap.cpp @@ -322,7 +322,7 @@ void menu_input::recompute_metrics(uint32_t width, uint32_t height, float aspect } -void menu_input::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) +void menu_input::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { if (pollingitem) { @@ -330,7 +330,7 @@ void menu_input::custom_render(uint32_t flags, void *selectedref, float top, flo char const *const text[] = { seqname.c_str() }; draw_text_box( std::begin(text), std::end(text), - x1, x2, y2 + tb_border(), y2 + bottom, + origx1, origx2, origy2 + tb_border(), origy2 + bottom, text_layout::text_justify::CENTER, text_layout::word_wrapping::NEVER, false, ui().colors().text_color(), ui().colors().background_color()); } @@ -347,7 +347,7 @@ void menu_input::custom_render(uint32_t flags, void *selectedref, float top, flo char const *const text[] = { errormsg.c_str() }; draw_text_box( std::begin(text), std::end(text), - x1, x2, y2 + tb_border(), y2 + bottom, + origx1, origx2, origy2 + tb_border(), origy2 + bottom, text_layout::text_justify::CENTER, text_layout::word_wrapping::NEVER, false, ui().colors().text_color(), UI_RED_COLOR); } @@ -359,7 +359,7 @@ void menu_input::custom_render(uint32_t flags, void *selectedref, float top, flo char const *const text[] = { _("Pressed") }; draw_text_box( std::begin(text), std::end(text), - x1, x2, y2 + tb_border(), y2 + bottom, + origx1, origx2, origy2 + tb_border(), origy2 + bottom, text_layout::text_justify::CENTER, text_layout::word_wrapping::NEVER, false, ui().colors().text_color(), ui().colors().background_color()); } @@ -370,7 +370,7 @@ void menu_input::custom_render(uint32_t flags, void *selectedref, float top, flo (!item.seq.empty() || item.defseq->empty()) ? clearprompt.c_str() : defaultprompt.c_str() }; draw_text_box( std::begin(text), std::end(text), - x1, x2, y2 + tb_border(), y2 + bottom, + origx1, origx2, origy2 + tb_border(), origy2 + bottom, text_layout::text_justify::CENTER, text_layout::word_wrapping::NEVER, false, ui().colors().text_color(), ui().colors().background_color()); } diff --git a/src/frontend/mame/ui/inputmap.h b/src/frontend/mame/ui/inputmap.h index 585d8002a8c..e27e58e67fc 100644 --- a/src/frontend/mame/ui/inputmap.h +++ b/src/frontend/mame/ui/inputmap.h @@ -65,7 +65,7 @@ class menu_input : public menu menu_input(mame_ui_manager &mui, render_container &container); virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; void populate_sorted(); void toggle_none_default(input_seq &selected_seq, input_seq &original_seq, const input_seq &selected_defseq); diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp index 00710e073a9..d6b6d29fccf 100644 --- a/src/frontend/mame/ui/menu.cpp +++ b/src/frontend/mame/ui/menu.cpp @@ -978,7 +978,7 @@ void menu::recompute_metrics(uint32_t width, uint32_t height, float aspect) } -void menu::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) +void menu::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { } diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h index 14031fb2c08..b59913df1a7 100644 --- a/src/frontend/mame/ui/menu.h +++ b/src/frontend/mame/ui/menu.h @@ -338,7 +338,7 @@ class menu // draw additional menu content virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect); - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2); + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2); // access to pointer state bool have_pointer() const noexcept { return m_global_state.have_pointer(); } diff --git a/src/frontend/mame/ui/selector.h b/src/frontend/mame/ui/selector.h index 58b93c5185a..d52c081da05 100644 --- a/src/frontend/mame/ui/selector.h +++ b/src/frontend/mame/ui/selector.h @@ -39,7 +39,7 @@ class menu_selector : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool custom_ui_back() override { return !m_search.empty(); } private: diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp index db16681e247..75631742a0b 100644 --- a/src/frontend/mame/ui/selmenu.cpp +++ b/src/frontend/mame/ui/selmenu.cpp @@ -797,7 +797,7 @@ void menu_select_launch::recompute_metrics(uint32_t width, uint32_t height, floa // perform our special rendering //------------------------------------------------- -void menu_select_launch::custom_render(u32 flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) +void menu_select_launch::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { std::string tempbuf[4]; diff --git a/src/frontend/mame/ui/selmenu.h b/src/frontend/mame/ui/selmenu.h index 29c8e2b94cd..3d1409ab68e 100644 --- a/src/frontend/mame/ui/selmenu.h +++ b/src/frontend/mame/ui/selmenu.h @@ -137,7 +137,7 @@ class menu_select_launch : public menu void launch_system(game_driver const &driver, ui_software_info const &swinfo, std::string const &part) { launch_system(ui(), driver, &swinfo, &part, nullptr); } virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(u32 flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual void menu_activated() override; virtual void menu_deactivated() override; diff --git a/src/frontend/mame/ui/simpleselgame.h b/src/frontend/mame/ui/simpleselgame.h index fcfe94e6109..5b278450d7f 100644 --- a/src/frontend/mame/ui/simpleselgame.h +++ b/src/frontend/mame/ui/simpleselgame.h @@ -32,7 +32,7 @@ class simple_menu_select_game : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool custom_ui_back() override { return !m_search.empty(); } virtual std::tuple custom_pointer_updated(bool changed, ui_event const &uievt) override; diff --git a/src/frontend/mame/ui/sliders.cpp b/src/frontend/mame/ui/sliders.cpp index 1cbec4e3528..218b4f5c1ea 100644 --- a/src/frontend/mame/ui/sliders.cpp +++ b/src/frontend/mame/ui/sliders.cpp @@ -258,7 +258,7 @@ void menu_sliders::recompute_metrics(uint32_t width, uint32_t height, float aspe // custom_render - perform our special rendering //------------------------------------------------- -void menu_sliders::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) +void menu_sliders::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { const slider_state *curslider = (const slider_state *)selectedref; if (curslider != nullptr) @@ -280,10 +280,10 @@ void menu_sliders::custom_render(uint32_t flags, void *selectedref, float top, f tempstring.insert(0, " ").insert(0, curslider->description); // move us to the bottom of the screen, and expand to full width - y2 = 1.0f - tb_border(); - y1 = y2 - bottom; - x1 = lr_border(); - x2 = 1.0f - lr_border(); + float x1 = lr_border(); + float x2 = 1.0f - lr_border(); + float y1 = origy2 - bottom; + float y2 = 1.0f - tb_border(); // draw extra menu area ui().draw_outlined_box(container(), x1, y1, x2, y2, ui().colors().background_color()); diff --git a/src/frontend/mame/ui/sliders.h b/src/frontend/mame/ui/sliders.h index b3c8ae3aca7..a705204d082 100644 --- a/src/frontend/mame/ui/sliders.h +++ b/src/frontend/mame/ui/sliders.h @@ -26,7 +26,7 @@ class menu_sliders : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual void menu_activated() override; virtual void menu_deactivated() override; diff --git a/src/frontend/mame/ui/state.h b/src/frontend/mame/ui/state.h index 1bbdd1396ae..cff9f3013ff 100644 --- a/src/frontend/mame/ui/state.h +++ b/src/frontend/mame/ui/state.h @@ -38,7 +38,7 @@ class menu_load_save_state_base : public autopause_menu<> bool one_shot); virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool handle_keys(uint32_t flags, int &iptkey) override; virtual std::tuple custom_pointer_updated(bool changed, ui_event const &uievt) override; virtual void populate() override; diff --git a/src/frontend/mame/ui/submenu.h b/src/frontend/mame/ui/submenu.h index 80c836e67e8..7ad92467d46 100644 --- a/src/frontend/mame/ui/submenu.h +++ b/src/frontend/mame/ui/submenu.h @@ -61,7 +61,7 @@ class submenu : public menu protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; private: virtual void populate() override; diff --git a/src/frontend/mame/ui/textbox.cpp b/src/frontend/mame/ui/textbox.cpp index 33319047bd8..223af5e67cf 100644 --- a/src/frontend/mame/ui/textbox.cpp +++ b/src/frontend/mame/ui/textbox.cpp @@ -492,12 +492,12 @@ void menu_fixed_textbox::recompute_metrics(uint32_t width, uint32_t height, floa } -void menu_fixed_textbox::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) +void menu_fixed_textbox::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { std::string_view const toptext[] = { m_heading }; draw_text_box( std::begin(toptext), std::end(toptext), - x1, x2, y1 - top, y1 - tb_border(), + origx1, origx2, origy1 - top, origy1 - tb_border(), text_layout::text_justify::CENTER, text_layout::word_wrapping::NEVER, false, ui().colors().text_color(), UI_GREEN_COLOR); } diff --git a/src/frontend/mame/ui/textbox.h b/src/frontend/mame/ui/textbox.h index 3a123980c83..ff8c7a62930 100644 --- a/src/frontend/mame/ui/textbox.h +++ b/src/frontend/mame/ui/textbox.h @@ -84,7 +84,7 @@ class menu_fixed_textbox : public menu_textbox protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual void populate_text(std::optional &layout, float &width, int &lines) override; From 0f12d810cb9ad3139fafb10e13f4a262298b781d Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 6 Aug 2024 14:31:12 +0200 Subject: [PATCH 06/11] ctrlr: add xml tag to cfg files --- ctrlr/hotrod.cfg | 1 + ctrlr/hotrodse.cfg | 1 + ctrlr/scorpionxg.cfg | 1 + ctrlr/slikstik.cfg | 1 + ctrlr/xarcade.cfg | 1 + 5 files changed, 5 insertions(+) diff --git a/ctrlr/hotrod.cfg b/ctrlr/hotrod.cfg index 93d44424a46..914e2cf6c2c 100644 --- a/ctrlr/hotrod.cfg +++ b/ctrlr/hotrod.cfg @@ -1,3 +1,4 @@ + diff --git a/ctrlr/hotrodse.cfg b/ctrlr/hotrodse.cfg index f91a45dfde4..81391c90e60 100644 --- a/ctrlr/hotrodse.cfg +++ b/ctrlr/hotrodse.cfg @@ -1,3 +1,4 @@ + diff --git a/ctrlr/scorpionxg.cfg b/ctrlr/scorpionxg.cfg index cf7d544981c..6db01dd047e 100644 --- a/ctrlr/scorpionxg.cfg +++ b/ctrlr/scorpionxg.cfg @@ -1,3 +1,4 @@ + diff --git a/ctrlr/slikstik.cfg b/ctrlr/slikstik.cfg index d1ffe4c46b4..172a157f6b6 100644 --- a/ctrlr/slikstik.cfg +++ b/ctrlr/slikstik.cfg @@ -1,3 +1,4 @@ + diff --git a/ctrlr/xarcade.cfg b/ctrlr/xarcade.cfg index b05fce74b1d..1aca512873c 100644 --- a/ctrlr/xarcade.cfg +++ b/ctrlr/xarcade.cfg @@ -1,3 +1,4 @@ + From 667e7670b79d3b2f9549e0424698485399195590 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 6 Aug 2024 15:01:46 +0200 Subject: [PATCH 07/11] sliders: fix regression after a75bb5341d9c39a84e6aecab10b734bafc1d6d9d --- src/frontend/mame/ui/sliders.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/mame/ui/sliders.cpp b/src/frontend/mame/ui/sliders.cpp index 218b4f5c1ea..2f92fe9e4fa 100644 --- a/src/frontend/mame/ui/sliders.cpp +++ b/src/frontend/mame/ui/sliders.cpp @@ -280,10 +280,10 @@ void menu_sliders::custom_render(uint32_t flags, void *selectedref, float top, f tempstring.insert(0, " ").insert(0, curslider->description); // move us to the bottom of the screen, and expand to full width + float y2 = 1.0f - tb_border(); + float y1 = y2 - bottom; float x1 = lr_border(); float x2 = 1.0f - lr_border(); - float y1 = origy2 - bottom; - float y2 = 1.0f - tb_border(); // draw extra menu area ui().draw_outlined_box(container(), x1, y1, x2, y2, ui().colors().background_color()); From 3f5fca9c4976b73f87861812609838b37e6fdda5 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 6 Aug 2024 19:00:17 +0200 Subject: [PATCH 08/11] New systems marked not working ------------------------------ PK [Hammy] Turbo PK [Hammy] New working clones ------------------ Tarzan Chuang Tian Guan (China, V110) [Hammy] - igs\igs_m027.cpp: dumped MX10EXA for crzybugs US sets and wldfruit, matches dumps for crzybugsj and haunthig [Ioannis Bampoulas] --- src/mame/amiga/mquake.cpp | 2 +- src/mame/igs/igs017.cpp | 23 +++ src/mame/igs/igs_m027.cpp | 14 +- src/mame/mame.lst | 5 + src/mame/misc/gei.cpp | 2 +- src/mame/skeleton/boramz80.cpp | 271 +++++++++++++++++++++++++++++++++ 6 files changed, 308 insertions(+), 9 deletions(-) create mode 100644 src/mame/skeleton/boramz80.cpp diff --git a/src/mame/amiga/mquake.cpp b/src/mame/amiga/mquake.cpp index b6b8f4cecb2..0dcb485438b 100644 --- a/src/mame/amiga/mquake.cpp +++ b/src/mame/amiga/mquake.cpp @@ -397,7 +397,7 @@ U09 MC68705P5S - Label detached / fell off ROMs had handwritten labels and are TMS 27C512: -U08 / QROM3 MQ_ROM3 0 5-28-87 +U08 / QROM3 MQ-ROM3 0 5-28-87 U07 / QROM2 MQ-ROM2 0 5-28-87 U06 / QROM1 MQ-ROM1 0 5-28 U05 / QROM0 MQ-ROM0 0 5-28 diff --git a/src/mame/igs/igs017.cpp b/src/mame/igs/igs017.cpp index c45d66ffef7..a7dd8752df3 100644 --- a/src/mame/igs/igs017.cpp +++ b/src/mame/igs/igs017.cpp @@ -5764,6 +5764,28 @@ ROM_START( tarzana ) ROM_LOAD( "tarzan_string.key", 0x00, 0xec, CRC(595fe40c) SHA1(0b46983400d237d8bde97a72eaa99b718a03387e) ) ROM_END +// IGS PCB NO-0248-1 +ROM_START( tarzanb ) // V110 TARZAN C + ROM_REGION( 0x40000, "maincpu", 0 ) + ROM_LOAD( "v110.u19", 0x00000, 0x40000, CRC(16026d12) SHA1(df08641b4bc1437648f0a8cd5f7a8a4786c07041) ) + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "igs_a2103_cg_v100f.u15", 0x00000, 0x400000, BAD_DUMP CRC(dcbff16f) SHA1(2bf77ef4448c26124c8d8d18bb7ffe4105cfa940) ) // using tarzanc's one for now, but versions differ + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD( "text.u5", 0x00000, 0x80000, CRC(1724e039) SHA1(d628499b61f98f7c9034d70b82ee25e002190ece) ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "igs_s2102_sp_v102.u14", 0x00000, 0x80000, BAD_DUMP CRC(90dda82d) SHA1(67fbc1e8d76b85e124136e2f1df09c8b6c5a8f97) ) // not dumped for this set, using tarzanc's one for now + + ROM_REGION( 0x2dd * 2, "plds", ROMREGION_ERASE ) + ROM_LOAD( "eg.u20", 0x000, 0x2dd, NO_DUMP ) + ROM_LOAD( "eg.u21", 0x2dd, 0x2dd, NO_DUMP ) + + ROM_REGION( 0xec, "igs_string", 0 ) + ROM_LOAD( "tarzanb_string.key", 0x00, 0xec, CRC(595fe40c) SHA1(0b46983400d237d8bde97a72eaa99b718a03387e) ) +ROM_END + /*************************************************************************** Super Tarzan (Italy, V100I) @@ -5950,6 +5972,7 @@ GAME ( 1998, slqz2, 0, slqz2, slqz2, igs017_state, init_slqz2, GAME ( 1999, tarzanc, 0, tarzan, tarzan, igs017_state, init_tarzanc, ROT0, "IGS", "Tarzan Chuang Tian Guan (China, V109C, set 1)", 0 ) // 泰山闯天关 GAME ( 1999, tarzan, tarzanc, tarzan, tarzan, igs017_state, init_tarzan, ROT0, "IGS", "Tarzan Chuang Tian Guan (China, V109C, set 2)", MACHINE_NOT_WORKING ) // missing sprites and sound rom, imperfect tiles decryption GAME ( 1999, tarzana, tarzanc, tarzan, tarzan, igs017_state, init_tarzana, ROT0, "IGS", "Tarzan (V107)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // missing IGS029 protection, missing sprites and sound rom +GAME ( 1999, tarzanb, tarzanc, tarzan, tarzan, igs017_state, init_tarzanc, ROT0, "IGS", "Tarzan Chuang Tian Guan (China, V110)", 0 ) GAME ( 2000, sdmg2p, 0, sdmg2p, sdmg2p, igs017_state, init_sdmg2p, ROT0, "IGS", "Maque Wangchao / Chaoji Damanguan 2 - Jiaqiang Ban (China, V100C)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // 麻雀王朝 / 超級大滿貫 2 -加強版 protection kicks in after starting game, hopper isn't hooked up correctly GAMEL( 2000?, starzan, 0, starzan, starzan, igs017_state, init_starzan, ROT0, "IGS (G.F. Gioca license)", "Super Tarzan (Italy, V100I)", 0, layout_igsslot ) GAMEL( 2000?, happyskl, 0, happyskl, happyskl, igs017_state, init_happyskl, ROT0, "IGS", "Happy Skill (Italy, V611IT)", 0, layout_igspoker ) diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index 551685c51c1..c30df42763c 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -1090,8 +1090,8 @@ ROM_START( crzybugs ) // IGS PCB-0447-05-GM - Has IGS027A, MX10EXAQC, IGS031, Ok ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "crazy_bugs_v-204us.u23", 0x000000, 0x80000, CRC(d1232462) SHA1(685a292f39bf57a80d6ef31289cf9f673ba06dd4) ) // MX27C4096 - ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) marked J9, probably same as haunthig, but not dumped for this set - ROM_LOAD( "j9.u27", 0x00000, 0x10000, BAD_DUMP CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) + ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) marked J9 + ROM_LOAD( "j9.u27", 0x00000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) // not dumped for this set ROM_LOAD( "crazy_bugs_text_u10.u10", 0x000000, 0x80000, BAD_DUMP CRC(db0d679a) SHA1(c5d039aa4fa2218b6f574ccb5b6da983b8d4067d) ) @@ -1113,8 +1113,8 @@ ROM_START( crzybugsa ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "crazy_bugs_v-202us.u23", 0x000000, 0x80000, CRC(210da1e6) SHA1(c726497bebd25d6a9053e331b4c26acc7e2db0b2) ) // MX27C4096 - ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) probably same as haunthig, but not dumped for this set - ROM_LOAD( "j9.u27", 0x00000, 0x10000, BAD_DUMP CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) + ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) + ROM_LOAD( "j9.u27", 0x00000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD( "crazy_bugs_text_u10.u10", 0x000000, 0x80000, CRC(db0d679a) SHA1(c5d039aa4fa2218b6f574ccb5b6da983b8d4067d) ) // M27C4002 @@ -1136,8 +1136,8 @@ ROM_START( crzybugsb ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg ROM_LOAD( "crazy_bugs_v-202us.u23", 0x000000, 0x80000, CRC(129e36e9) SHA1(53f20bc3792249de8ef276f84283baa9abd30acd) ) // MX27C4096 - ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) probably same as haunthig, but not dumped for this set - ROM_LOAD( "j9.u27", 0x00000, 0x10000, BAD_DUMP CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) + ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) + ROM_LOAD( "j9.u27", 0x00000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD( "crazy_bugs_text_u10.u10", 0x000000, 0x80000, BAD_DUMP CRC(db0d679a) SHA1(c5d039aa4fa2218b6f574ccb5b6da983b8d4067d) ) // not dumped for this set @@ -1309,7 +1309,7 @@ ROM_START( wldfruit ) // IGS PCB-0447-05-GM - Has IGS027A, MX10EXAQC, IGS031, Ok ROM_LOAD( "wild_fruit_v-208us.u23", 0x000000, 0x80000, CRC(d43398f1) SHA1(ecc4bd5cb6da16b35c63b843cf7beec1ab84ed9d) ) // M27C4002 ROM_REGION( 0x10000, "xa", 0 ) // MX10EXAQC (80C51 XA based MCU) marked J9 - ROM_LOAD( "j9.u27", 0x00000, 0x10000, NO_DUMP ) + ROM_LOAD( "j9.u27", 0x00000, 0x10000, CRC(3c76b157) SHA1(d8d3a434fd649577a30d5855e3fb34998041f4e5) ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD( "wild_fruit_text.u10", 0x000000, 0x80000, CRC(d6f0fd58) SHA1(5ddae5d4df53504dbb2e0fe9f7caea961c961ef8) ) // 27C4096 diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 6bc0e77fd1e..ec11de34f56 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -20200,6 +20200,7 @@ spkrform // (c) 2000? starzan // (c) 2000? tarzan // (c) 1999 tarzana // (c) 1999 +tarzanb // (c) 1999 tarzanc // (c) 1999 tjsb // (c) 1997 @@ -41843,6 +41844,10 @@ bolsaint // (c) 2000 Sleic/Petaco @source:skeleton/boo.cpp boo1000 +@source:skeleton/boramz80.cpp +pkboram +tpkboram + @source:skeleton/bpmmicro.cpp bp1200 // (c) 1991 BP Microsystems diff --git a/src/mame/misc/gei.cpp b/src/mame/misc/gei.cpp index 3ee866dd6ce..a06d3112eed 100644 --- a/src/mame/misc/gei.cpp +++ b/src/mame/misc/gei.cpp @@ -1311,7 +1311,7 @@ ROM_START( gtsers7a ) // Series 7 (Complete - question ROMs dated 7/9) ROM_LOAD( "general_v", 0x14000, 0x4000, CRC(81bf07c7) SHA1(a53f050b4ef8ffc0499b50224d4bbed4af0ca09c) ) ROM_LOAD( "kids_korner", 0x18000, 0x4000, CRC(66631b79) SHA1(ec534941add7113c9bb96d00f2e09834275e314b) ) ROM_LOAD( "good_guys", 0x1c000, 0x4000, CRC(4d638326) SHA1(2d6d00ae7f02d1607f37eb1cefae31c42797b2cf) ) - ROM_LOAD( "sex_triv.", 0x20000, 0x4000, CRC(cd0ce4e2) SHA1(2046ee3da94f00bf4a8b3fc62b1190d58e83cc89) ) // Listed as an alternate question set + ROM_LOAD( "sex_triv", 0x20000, 0x4000, CRC(cd0ce4e2) SHA1(2046ee3da94f00bf4a8b3fc62b1190d58e83cc89) ) // Listed as an alternate question set ROM_END ROM_START( gtsersa ) // alt or older version questions diff --git a/src/mame/skeleton/boramz80.cpp b/src/mame/skeleton/boramz80.cpp new file mode 100644 index 00000000000..951a8e31620 --- /dev/null +++ b/src/mame/skeleton/boramz80.cpp @@ -0,0 +1,271 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* +Boram Z80-based poker games + +The 2 dumped games come from 2 similar PCBs: +PK uses the ATPK-BORAM 0211 PCB, while Turbo PK uses the ATPK-BORAM 0300 III PCB. +Main components are: +Z80A CPU (different variants) +HD46505SP CRT +I8255 PPI +2 XTALs with solder blobs on them (value not readable) +AY-8910 sound chip +on 0211 PCB: 2x 8-DIP banks +on 0300 III PCB: 4x 8-DIP banks +*/ + + +#include "emu.h" + +#include "cpu/z80/z80.h" +#include "machine/i8255.h" +#include "sound/ay8910.h" +#include "video/mc6845.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class boramz80_state : public driver_device +{ +public: + boramz80_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_char_ram(*this, "char_ram"), + m_tile_ram(*this, "tile_ram") + { } + + void pk(machine_config &config) ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + +private: + required_device m_maincpu; + required_device m_gfxdecode; + + required_shared_ptr m_char_ram; + required_shared_ptr m_tile_ram; + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void program_map(address_map &map) ATTR_COLD; + void io_map(address_map &map) ATTR_COLD; +}; + + +void boramz80_state::video_start() +{ +} + +uint32_t boramz80_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(rgb_t::black(), cliprect); + + return 0; +} + + +void boramz80_state::program_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0x8fff).ram(); // TODO: only 0x800 for pkboram + map(0xa000, 0xa7ff).ram().share(m_char_ram); + map(0xc000, 0xc7ff).ram().share(m_tile_ram); + map(0xe000, 0xe3ff).ram().w("palette", FUNC(palette_device::write8)).share("palette"); + map(0xf000, 0xf3ff).ram().w("palette", FUNC(palette_device::write8_ext)).share("palette_ext"); +} + +void boramz80_state::io_map(address_map &map) +{ + map.global_mask(0xff); + + map(0x00, 0x03).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); + //map(0x20, 0x20).r(); + //map(0x40, 0x40).r(); + //map(0x60, 0x60).r(); + map(0x80, 0x81).w("aysnd", FUNC(ay8910_device::data_address_w)); + map(0x81, 0x81).r("aysnd", FUNC(ay8910_device::data_r)); + //map(0xa0, 0xa0).r(); + map(0xc0, 0xc0).w("crtc", FUNC(mc6845_device::address_w)); + map(0xc1, 0xc1).w("crtc", FUNC(mc6845_device::register_w)); +} + + +static INPUT_PORTS_START( pkboram ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("DSW1") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8") + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW2:8") +INPUT_PORTS_END + +static INPUT_PORTS_START( tpkboram ) + PORT_INCLUDE( pkboram ) + + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW3:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW3:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW3:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW3:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW3:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW3:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW3:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW3:8") + + PORT_START("DSW4") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW4:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW4:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW4:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW4:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW4:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW4:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW4:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW4:8") +INPUT_PORTS_END + + +static GFXDECODE_START( gfx_boram ) + GFXDECODE_ENTRY( "chars", 0, gfx_8x8x2_planar, 0, 16 ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x4_planar, 0, 16 ) // probably wrong +GFXDECODE_END + + +void boramz80_state::pk(machine_config &config) +{ + // basic machine hardware + Z80(config, m_maincpu, 4'000'000); // clock unknown + m_maincpu->set_addrmap(AS_PROGRAM, &boramz80_state::program_map); + m_maincpu->set_addrmap(AS_IO, &boramz80_state::io_map); + //m_maincpu->set_vblank_int("screen", FUNC(boramz80_state::irq0_line_hold)); + + i8255_device &ppi(I8255A(config, "ppi")); + ppi.in_pa_callback().set([this] () { logerror("%s: PPI port A read\n", machine().describe_context()); return ioport("IN0")->read(); }); + ppi.in_pb_callback().set([this] () { logerror("%s: PPI port B read\n", machine().describe_context()); return ioport("IN1")->read(); }); + ppi.in_pc_callback().set([this] () { logerror("%s: PPI port C read\n", machine().describe_context()); return ioport("IN2")->read(); }); + ppi.out_pc_callback().set([this] (u8 data) { logerror("%s: PPI port C write %02x\n", machine().describe_context(), data); }); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO: everything + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(32*8, 32*8); + screen.set_visarea_full(); + screen.set_screen_update(FUNC(boramz80_state::screen_update)); + + hd6845s_device &crtc(HD6845S(config, "crtc", 1'000'000)); // clock unknown + crtc.set_screen("screen"); + crtc.set_show_border_area(false); + crtc.set_char_width(8); + + GFXDECODE(config, "gfxdecode", "palette", gfx_boram); + PALETTE(config, "palette").set_format(palette_device::xRGB_555, 0x400); // TODO: verify once it works + + SPEAKER(config, "mono").front_center(); + + ay8910_device &aysnd(AY8910(config, "aysnd", 1'000'000)); // clock unknown + aysnd.port_a_read_callback().set_ioport("DSW1"); // TODO: verify once it works + aysnd.port_b_read_callback().set_ioport("DSW2"); // TODO: verify once it works + aysnd.port_a_write_callback().set([this] (uint8_t data) { logerror("%s: AY port A write %02x\n", machine().describe_context(), data); }); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); +} + + +ROM_START( pkboram ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD( "b.rom", 0x0000, 0x8000, CRC(5f38640d) SHA1(914cbd3c5e0406e2daa9bdad6bd46758498aabb5) ) + + ROM_REGION( 0x4000, "chars", 0 ) + ROM_LOAD( "1.cg1", 0x0000, 0x2000, CRC(a5c43569) SHA1(17a5d529ee2ef18019dabf9aefcf595d1193c7d0) ) + ROM_LOAD( "2.cg2", 0x2000, 0x2000, CRC(68906bae) SHA1(4ccec70f4d6044a7e23e4e50c98916278fe7dfd0) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "3.pg1", 0x00000, 0x8000, CRC(5bd66a9b) SHA1(52fcda1e818c19910b88956ed28a479b6d5f3385) ) + ROM_LOAD( "4.pg2", 0x08000, 0x8000, CRC(a8832475) SHA1(f0ec6cd74992cd6f27c12e0c6da6aaabdb8b2e52) ) + ROM_LOAD( "5.pg3", 0x10000, 0x8000, CRC(bf00fe98) SHA1(218103db220d96c6f16e685f48df8a63443d24f7) ) + ROM_LOAD( "6.pg4", 0x18000, 0x8000, CRC(5fe7b018) SHA1(26a41f96a4b4722b73dbee08cfa1272aa6d83ca8) ) + ROM_LOAD( "7.pg5", 0x20000, 0x8000, CRC(c19d09bf) SHA1(124169b22e566b2a44ae1d0ae1259cdb188e8769) ) + ROM_LOAD( "8.pg6", 0x28000, 0x8000, CRC(191d2ab3) SHA1(ad8bfc3f28ccf503cf388791634f32f745559c3c) ) + ROM_LOAD( "9.pg7", 0x30000, 0x8000, CRC(fd182a3a) SHA1(0d7e9e905b33fd6925962d6992c595830a35ac26) ) + ROM_LOAD( "10.pg8", 0x38000, 0x8000, CRC(7c2e9f86) SHA1(b82efdd718fa49cb57330fdcf05df6a9e025a822) ) + + // TODO: PROMs? +ROM_END + +ROM_START( tpkboram ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD( "pkt-21spko.rom", 0x0000, 0x8000, CRC(a024d82b) SHA1(4d656261747930415807cd084536ef145fbf0f5b) ) + + ROM_REGION( 0x4000, "chars", 0 ) + ROM_LOAD( "1.cg1", 0x0000, 0x2000, CRC(69f44d04) SHA1(2f98805e4b70ce3426078f35ff260a3bc97fab86) ) + ROM_LOAD( "2.cg2", 0x2000, 0x2000, CRC(c1adf009) SHA1(0d5d8b39d40c807b9b5ed7418ba871c4d683286a) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "3.pg1", 0x00000, 0x8000, CRC(5506285c) SHA1(017095d0c293b8a5ae73e40a4e5f662d8ba01a06) ) + ROM_LOAD( "4.pg2", 0x08000, 0x8000, CRC(6d62a734) SHA1(42716934bc93f3c815af961a6efbae120bec2793) ) + ROM_LOAD( "5.pg3", 0x10000, 0x8000, CRC(644c44a6) SHA1(a407735ccdefc4ff7a6f2f007b9e1c4846202dfe) ) + ROM_LOAD( "6.pg4", 0x18000, 0x8000, CRC(029cc0d1) SHA1(d41ec3fa38c1729fee3026f5c9365175738ecc99) ) + ROM_LOAD( "7.pg5", 0x20000, 0x8000, CRC(c07a3cac) SHA1(19c1f996494cf0b200c7d781ba3ffd4af9bfe73b) ) + ROM_LOAD( "8.pg6", 0x28000, 0x8000, CRC(8f2a8c3e) SHA1(5ec031dc1fa21a09c1a4ebc0b6bb5f899038801a) ) + ROM_LOAD( "9.pg7", 0x30000, 0x8000, CRC(7dbbdeb5) SHA1(4d379b9e0c825174bf151117e3550809948e1763) ) + ROM_LOAD( "10.pg8", 0x38000, 0x8000, CRC(4a293afa) SHA1(be532e6a476f78638e7f558bf8093e1914bc3688) ) + + // TODO: PROMs? +ROM_END + +} // anonymous namespace + + +GAME( 1987, pkboram, 0, pk, pkboram, boramz80_state, empty_init, ROT0, "Boram", "PK", MACHINE_IS_SKELETON ) // PK-BORAM 0211 aug.04.1987. BORAM CORP +GAME( 1988, tpkboram, 0, pk, tpkboram, boramz80_state, empty_init, ROT0, "Boram", "Turbo PK", MACHINE_IS_SKELETON ) // PK-TURBO jan.29.1988. BORAM CORP. From 22f6b8870b7ca9d08fa769eb2729c1a91e07a7d3 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 6 Aug 2024 20:55:10 +0200 Subject: [PATCH 09/11] igs/igs017.cpp, skeleton/boramz80.cpp: improvements to documentation --- src/mame/igs/igs017.cpp | 8 ++++---- src/mame/skeleton/boramz80.cpp | 13 +++++-------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/mame/igs/igs017.cpp b/src/mame/igs/igs017.cpp index a7dd8752df3..52adf6eed63 100644 --- a/src/mame/igs/igs017.cpp +++ b/src/mame/igs/igs017.cpp @@ -5764,19 +5764,19 @@ ROM_START( tarzana ) ROM_LOAD( "tarzan_string.key", 0x00, 0xec, CRC(595fe40c) SHA1(0b46983400d237d8bde97a72eaa99b718a03387e) ) ROM_END -// IGS PCB NO-0248-1 +// IGS PCB NO-0248 ROM_START( tarzanb ) // V110 TARZAN C ROM_REGION( 0x40000, "maincpu", 0 ) - ROM_LOAD( "v110.u19", 0x00000, 0x40000, CRC(16026d12) SHA1(df08641b4bc1437648f0a8cd5f7a8a4786c07041) ) + ROM_LOAD( "t.z._v110.u19", 0x00000, 0x40000, CRC(16026d12) SHA1(df08641b4bc1437648f0a8cd5f7a8a4786c07041) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "igs_a2103_cg_v100f.u15", 0x00000, 0x400000, BAD_DUMP CRC(dcbff16f) SHA1(2bf77ef4448c26124c8d8d18bb7ffe4105cfa940) ) // using tarzanc's one for now, but versions differ ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD( "text.u5", 0x00000, 0x80000, CRC(1724e039) SHA1(d628499b61f98f7c9034d70b82ee25e002190ece) ) + ROM_LOAD( "t.z._text_u5.u5", 0x00000, 0x80000, CRC(1724e039) SHA1(d628499b61f98f7c9034d70b82ee25e002190ece) ) ROM_REGION( 0x80000, "oki", 0 ) - ROM_LOAD( "igs_s2102_sp_v102.u14", 0x00000, 0x80000, BAD_DUMP CRC(90dda82d) SHA1(67fbc1e8d76b85e124136e2f1df09c8b6c5a8f97) ) // not dumped for this set, using tarzanc's one for now + ROM_LOAD( "igs_s2102_sp_v102.u14", 0x00000, 0x80000, CRC(90dda82d) SHA1(67fbc1e8d76b85e124136e2f1df09c8b6c5a8f97) ) // not dumped for this set, but same markings as tarzanc's one ROM_REGION( 0x2dd * 2, "plds", ROMREGION_ERASE ) ROM_LOAD( "eg.u20", 0x000, 0x2dd, NO_DUMP ) diff --git a/src/mame/skeleton/boramz80.cpp b/src/mame/skeleton/boramz80.cpp index 951a8e31620..59e7c09788a 100644 --- a/src/mame/skeleton/boramz80.cpp +++ b/src/mame/skeleton/boramz80.cpp @@ -10,7 +10,8 @@ Main components are: Z80A CPU (different variants) HD46505SP CRT I8255 PPI -2 XTALs with solder blobs on them (value not readable) +4 MHz XTAL +13 MHz XTAL AY-8910 sound chip on 0211 PCB: 2x 8-DIP banks on 0300 III PCB: 4x 8-DIP banks @@ -186,7 +187,7 @@ GFXDECODE_END void boramz80_state::pk(machine_config &config) { // basic machine hardware - Z80(config, m_maincpu, 4'000'000); // clock unknown + Z80(config, m_maincpu, 4_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &boramz80_state::program_map); m_maincpu->set_addrmap(AS_IO, &boramz80_state::io_map); //m_maincpu->set_vblank_int("screen", FUNC(boramz80_state::irq0_line_hold)); @@ -204,7 +205,7 @@ void boramz80_state::pk(machine_config &config) screen.set_visarea_full(); screen.set_screen_update(FUNC(boramz80_state::screen_update)); - hd6845s_device &crtc(HD6845S(config, "crtc", 1'000'000)); // clock unknown + hd6845s_device &crtc(HD6845S(config, "crtc", 13_MHz_XTAL / 16)); // divisor guessed crtc.set_screen("screen"); crtc.set_show_border_area(false); crtc.set_char_width(8); @@ -214,7 +215,7 @@ void boramz80_state::pk(machine_config &config) SPEAKER(config, "mono").front_center(); - ay8910_device &aysnd(AY8910(config, "aysnd", 1'000'000)); // clock unknown + ay8910_device &aysnd(AY8910(config, "aysnd", 4_MHz_XTAL / 4)); // not sure, could derive from 13 MHz XTAL aysnd.port_a_read_callback().set_ioport("DSW1"); // TODO: verify once it works aysnd.port_b_read_callback().set_ioport("DSW2"); // TODO: verify once it works aysnd.port_a_write_callback().set([this] (uint8_t data) { logerror("%s: AY port A write %02x\n", machine().describe_context(), data); }); @@ -239,8 +240,6 @@ ROM_START( pkboram ) ROM_LOAD( "8.pg6", 0x28000, 0x8000, CRC(191d2ab3) SHA1(ad8bfc3f28ccf503cf388791634f32f745559c3c) ) ROM_LOAD( "9.pg7", 0x30000, 0x8000, CRC(fd182a3a) SHA1(0d7e9e905b33fd6925962d6992c595830a35ac26) ) ROM_LOAD( "10.pg8", 0x38000, 0x8000, CRC(7c2e9f86) SHA1(b82efdd718fa49cb57330fdcf05df6a9e025a822) ) - - // TODO: PROMs? ROM_END ROM_START( tpkboram ) @@ -260,8 +259,6 @@ ROM_START( tpkboram ) ROM_LOAD( "8.pg6", 0x28000, 0x8000, CRC(8f2a8c3e) SHA1(5ec031dc1fa21a09c1a4ebc0b6bb5f899038801a) ) ROM_LOAD( "9.pg7", 0x30000, 0x8000, CRC(7dbbdeb5) SHA1(4d379b9e0c825174bf151117e3550809948e1763) ) ROM_LOAD( "10.pg8", 0x38000, 0x8000, CRC(4a293afa) SHA1(be532e6a476f78638e7f558bf8093e1914bc3688) ) - - // TODO: PROMs? ROM_END } // anonymous namespace From c49e6d37a6d2c8c59e2da628210ef4641af6a8e9 Mon Sep 17 00:00:00 2001 From: arbee Date: Tue, 6 Aug 2024 23:05:33 -0400 Subject: [PATCH 10/11] nubus/nubus_specpdq.cpp: Better derivation of the active width. [R. Belmont] --- src/devices/bus/nubus/nubus_specpdq.cpp | 26 +++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/devices/bus/nubus/nubus_specpdq.cpp b/src/devices/bus/nubus/nubus_specpdq.cpp index f6903b6d21e..ea2ed5f8327 100644 --- a/src/devices/bus/nubus/nubus_specpdq.cpp +++ b/src/devices/bus/nubus/nubus_specpdq.cpp @@ -38,8 +38,7 @@ #include -#define VERBOSE 1 -#define LOG_OUTPUT_FUNC osd_printf_info +//#define VERBOSE 1 #include "logmacro.h" @@ -108,7 +107,7 @@ class nubus_specpdq_device : uint16_t m_stride; uint16_t m_vint; - uint8_t m_hdelay; + uint8_t m_hdelay, m_hadjust; uint8_t m_osc; uint16_t m_blit_stride; @@ -231,6 +230,7 @@ void nubus_specpdq_device::device_start() save_item(NAME(m_stride)); save_item(NAME(m_vint)); save_item(NAME(m_hdelay)); + save_item(NAME(m_hadjust)); save_item(NAME(m_osc)); save_item(NAME(m_blit_stride)); save_item(NAME(m_blit_src)); @@ -261,6 +261,7 @@ void nubus_specpdq_device::device_reset() m_stride = 0; m_vint = 0; m_hdelay = 0; + m_hadjust = 0; m_osc = 0; m_blit_stride = 0; @@ -326,11 +327,9 @@ void nubus_specpdq_device::update_crtc() // for some reason you temporarily get invalid screen parameters - ignore them if (m_crtc.valid(*this)) { - int h_start_adj = (m_crtc.h_start(1) + 3) * 16; - rectangle active( - h_start_adj, - m_crtc.h_end(16) - 1, + m_crtc.h_start(16) + (m_hdelay * 4), + m_crtc.h_end(16) - (m_hadjust - (m_hdelay * 4)) - 1, m_crtc.v_start(), m_crtc.v_end() - 1); @@ -348,7 +347,7 @@ uint32_t nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32 { auto const screenbase = util::big_endian_cast(&m_vram[0]) + 0x9000; - int const hstart = (m_crtc.h_start(1) + 3) << 4; + int const hstart = m_crtc.h_start(16); int const width = m_crtc.h_active(16); int const vstart = m_crtc.v_start(); int const vend = m_crtc.v_end(); @@ -467,6 +466,11 @@ void nubus_specpdq_device::specpdq_w(offs_t offset, uint32_t data, uint32_t mem_ COMBINE_DATA(&m_7xxxxx_regs[offset-0xc0000]); } + if ((offset >= 0xc0000) && (offset < 0xd0000)) + { + printf("Write %02x (%d) to %x\n", ~data & 0xff, ~data & 0xff, offset); + } + if ((offset >= 0xc0000) && (offset <= 0xc002a)) { m_crtc.write(*this, offset - 0xc0000, data >> 24); @@ -509,6 +513,12 @@ void nubus_specpdq_device::specpdq_w(offs_t offset, uint32_t data, uint32_t mem_ case 0xc005e: // not sure, interrupt related? break; + case 0xc0066: + LOG("%s: %u to hadjust\n", machine().describe_context(), ~data & 0xff); + m_hadjust = ~data & 0xff; + update_crtc(); + break; + case 0xc006a: LOG("%s: %u to hdelay\n", machine().describe_context(), ~data & 0xff); m_hdelay = ~data & 0xff; From 7e283c758ff25dead369025de548c6ea9dee87df Mon Sep 17 00:00:00 2001 From: arbee Date: Tue, 6 Aug 2024 23:08:21 -0400 Subject: [PATCH 11/11] nubus/nubus_specpdq.cpp: Remove debug print. [skip ci] [R. Belmont] --- src/devices/bus/nubus/nubus_specpdq.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/devices/bus/nubus/nubus_specpdq.cpp b/src/devices/bus/nubus/nubus_specpdq.cpp index ea2ed5f8327..bdd4d0df38c 100644 --- a/src/devices/bus/nubus/nubus_specpdq.cpp +++ b/src/devices/bus/nubus/nubus_specpdq.cpp @@ -466,11 +466,6 @@ void nubus_specpdq_device::specpdq_w(offs_t offset, uint32_t data, uint32_t mem_ COMBINE_DATA(&m_7xxxxx_regs[offset-0xc0000]); } - if ((offset >= 0xc0000) && (offset < 0xd0000)) - { - printf("Write %02x (%d) to %x\n", ~data & 0xff, ~data & 0xff, offset); - } - if ((offset >= 0xc0000) && (offset <= 0xc002a)) { m_crtc.write(*this, offset - 0xc0000, data >> 24);