Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbbert committed Aug 7, 2024
2 parents d7d1220 + 7e283c7 commit a569b46
Show file tree
Hide file tree
Showing 44 changed files with 421 additions and 106 deletions.
1 change: 1 addition & 0 deletions ctrlr/hotrod.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0"?>
<mameconfig version="10">
<system name="default">

Expand Down
1 change: 1 addition & 0 deletions ctrlr/hotrodse.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0"?>
<mameconfig version="10">
<system name="default">

Expand Down
1 change: 1 addition & 0 deletions ctrlr/scorpionxg.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0"?>
<mameconfig version="10">
<system name="default">

Expand Down
1 change: 1 addition & 0 deletions ctrlr/slikstik.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0"?>
<mameconfig version="10">
<system name="default">

Expand Down
1 change: 1 addition & 0 deletions ctrlr/xarcade.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0"?>
<mameconfig version="10">
<system name="default">

Expand Down
2 changes: 1 addition & 1 deletion plugins/hiscore/hiscore.dat
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,7 @@ gngprot:
@:maincpu,program,00d0,4,00,00


diamond:
diamrun:
@:maincpu,program,1200,80,4b,00


Expand Down
21 changes: 13 additions & 8 deletions src/devices/bus/nubus/nubus_specpdq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@

#include <algorithm>

#define VERBOSE 1
#define LOG_OUTPUT_FUNC osd_printf_info
//#define VERBOSE 1
#include "logmacro.h"


Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand All @@ -348,7 +347,7 @@ uint32_t nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32
{
auto const screenbase = util::big_endian_cast<uint8_t const>(&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();
Expand Down Expand Up @@ -509,6 +508,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;
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/ui/about.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<text_layout> &layout, float &width, int &lines) override;

Expand Down
16 changes: 8 additions & 8 deletions src/frontend/mame/ui/analogipt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand All @@ -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<int>(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<int>(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());
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/ui/analogipt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<int, bool, bool> custom_pointer_updated(bool changed, ui_event const &uievt) override;
virtual void menu_activated() override;

Expand Down
4 changes: 2 additions & 2 deletions src/frontend/mame/ui/auditmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/ui/auditmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/mame/ui/confswitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/ui/confswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<int, bool, bool> custom_pointer_updated(bool changed, ui_event const &uievt) override;

private:
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/mame/ui/custui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/ui/datmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<int, bool, bool> custom_pointer_updated(bool changed, ui_event const &uievt) override;

virtual void populate_text(std::optional<text_layout> &layout, float &width, int &lines) override;
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/mame/ui/dirmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/ui/filecreate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/ui/filemngr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/ui/filesel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<int, bool, bool> custom_pointer_updated(bool changed, ui_event const &uievt) override;
virtual void menu_activated() override;
Expand Down
20 changes: 10 additions & 10 deletions src/frontend/mame/ui/inputdevices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);

Expand All @@ -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)
{
Expand Down
Loading

0 comments on commit a569b46

Please sign in to comment.