From 508042b60d83ec87ea0813010143781dc3ac0dda Mon Sep 17 00:00:00 2001 From: Antonio Giner Date: Sat, 6 Jan 2024 12:06:56 +0100 Subject: [PATCH] [nogpu] Properly compute pixel aspect based on option -aspect and current output resolution. --- src/osd/modules/render/drawnogpu.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/osd/modules/render/drawnogpu.cpp b/src/osd/modules/render/drawnogpu.cpp index d7a36aed7afcc..104a9a8267b1c 100644 --- a/src/osd/modules/render/drawnogpu.cpp +++ b/src/osd/modules/render/drawnogpu.cpp @@ -189,6 +189,8 @@ class renderer_nogpu : public osd_renderer double m_line_period = 0.064; double m_frame_delay = 0.0; double m_fd_margin = 1.5; + float m_aspect = 4.0 / 3.0; + float m_pixel_aspect = 1.0; nogpu_status m_status; nogpu_blit_status m_blit_status; modeline m_current_mode; @@ -273,7 +275,7 @@ render_primitive_list *renderer_nogpu::get_primitives() m_height = std::min(dimensions.height(), MAX_BUFFER_HEIGHT); } - window().target()->set_bounds(m_width, m_height, window().pixel_aspect()); + window().target()->set_bounds(m_width, m_height, m_pixel_aspect); return &window().target()->get_primitives(); } @@ -584,6 +586,9 @@ bool renderer_nogpu::nogpu_switch_video_mode() m_line_period = 1000.0 / mode->hfreq; m_field = 0; + m_aspect = m_switchres->display(window().index())->monitor_aspect(); + m_pixel_aspect = m_aspect / ((float)m_width / m_height); + return nogpu_send_command(&command, sizeof(command)); }