Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
281f87d
Update settings_video.cpp
Nejsplitter Sep 28, 2026
316ede1
Update transform_matrix.cpp
Nejsplitter Sep 28, 2026
38fba3b
Update transform_matrix.cpp
Nejsplitter Sep 28, 2026
1136bfa
Reorganize Widescreen settings in UI
Nejsplitter Sep 28, 2026
cc14dee
Conditionally apply screen stretching based on framebuffer
Nejsplitter Sep 29, 2026
d3add96
Add applyScreenStretching function for aspect ratio
Nejsplitter Sep 29, 2026
2febdff
Refactor screen stretching calculation
Nejsplitter Sep 29, 2026
76a0193
Add files via upload
Nejsplitter Sep 29, 2026
4aae227
Add files via upload
Nejsplitter Sep 29, 2026
3980c01
Add files via upload
Nejsplitter Sep 29, 2026
8b8d1dc
Update option.h
Nejsplitter Sep 29, 2026
76d5530
Add StretchToFill option to rendering settings
Nejsplitter Sep 29, 2026
700c8da
Add StretchToFill option in option.cpp
Nejsplitter Sep 29, 2026
c7a059b
Refactor video settings options in settings_video.cpp
Nejsplitter Sep 29, 2026
93b2238
Add StretchToFill aspect ratio calculation
Nejsplitter Sep 29, 2026
5e35366
Add StretchToFill option for framebuffer aspect ratio
Nejsplitter Sep 29, 2026
044c724
Modify screenToNative function for StretchToFill
Nejsplitter Sep 29, 2026
5c95037
Update transform_matrix.cpp
Nejsplitter Sep 29, 2026
61b584b
Refactor widescreen cheat handling for aspect ratio
Nejsplitter Sep 29, 2026
deac451
Refactor Widescreen options with disabled scopes
Nejsplitter Sep 29, 2026
5d2fafb
Update settings_video.cpp
Nejsplitter Sep 29, 2026
5eace17
Refactor Widescreen checkbox handling
Nejsplitter Oct 3, 2026
029d6be
disable forced fill when ws cheats active
Nejsplitter Oct 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/cfg/option.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Option<bool> DumpTextures("rend.DumpTextures");
Option<bool> DumpUniqueTextures("rend.DumpUniqueTextures");
Option<bool> DumpReplacedTextures("rend.DumpReplacedTextures");
Option<int> ScreenStretching("rend.ScreenStretching", 100);
Option<bool> StretchToFill("rend.StretchToFill");
Option<bool> Fog("rend.Fog", true);
Option<bool> FloatVMUs("rend.FloatVMUs");
Option<bool> Rotate90("rend.Rotate90");
Expand Down
1 change: 1 addition & 0 deletions core/cfg/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ extern Option<bool> DumpTextures;
extern Option<bool> DumpUniqueTextures;
extern Option<bool> DumpReplacedTextures;
extern Option<int> ScreenStretching; // in percent. 150 means stretch from 4/3 to 6/3
extern Option<bool> StretchToFill;
extern Option<bool> Fog;
extern Option<bool> FloatVMUs;
extern Option<bool> Rotate90;
Expand Down
7 changes: 6 additions & 1 deletion core/input/mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ void SystemMouse::setWheel(int delta) {
static void screenToNative(int& x, int& y, int width, int height)
{
float fx, fy;
if (!config::Rotate90)
if (config::StretchToFill)
{
fx = x * 640.f / width;
fy = y * 480.f / height;
}
else if (!config::Rotate90)
{
float scale = 480.f / height;
fy = y * scale;
Expand Down
20 changes: 19 additions & 1 deletion core/rend/transform_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ float getOutputFramebufferAspectRatio()
aspectRatio = 4.f / 3.f;
}
}

if (config::StretchToFill)
return (float)settings.display.width / settings.display.height;

return aspectRatio * config::ScreenStretching / 100.f;
}

Expand Down Expand Up @@ -450,7 +454,21 @@ void getVideoShift(float& x, float& y)
x *= config::RenderResolution / 480.f;
y *= config::RenderResolution / 480.f;
}
x *= config::ScreenStretching / 100.f;
if (config::StretchToFill)
{
float aspectRatio = config::Rotate90 ? 3.f / 4.f : 4.f / 3.f;

if (!config::Rotate90 && config::Widescreen && !config::EmulateFramebuffer)
aspectRatio = config::SuperWidescreen
? (float)settings.display.width / settings.display.height
: 16.f / 9.f;

x *= ((float)settings.display.width / settings.display.height) / aspectRatio;
}
else
{
x *= config::ScreenStretching / 100.f;
}
}

void getWriteFBToVramParams(const rend_context& ctx, glm::ivec2& scaledSize, Rect& finalClip)
Expand Down
3 changes: 3 additions & 0 deletions core/rend/transform_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ void getDCFramebufferReadSize(const FramebufferInfo& info, int& width, int& heig
void getWriteFBToVramParams(const rend_context& ctx, glm::ivec2& scaledSize, Rect& finalClip);

inline static float getDCFramebufferAspectRatio() {
if (config::StretchToFill)
return (float)settings.display.width / settings.display.height;

float aspectRatio = config::Rotate90 ? 3.f / 4.f : 4.f / 3.f;
return aspectRatio * config::ScreenStretching / 100.f;
}
Expand Down
20 changes: 14 additions & 6 deletions core/ui/settings_video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,20 +263,28 @@ void gui_settings_video()
ImGui::Spacing();
header(T("Aspect Ratio"));
{
OptionCheckbox(T("Widescreen"), config::Widescreen,
T("Draw geometry outside of the normal 4:3 aspect ratio. May produce graphical glitches in the revealed areas.\nAspect Fit and shows the full 16:9 content."));
OptionCheckbox(T("Widescreen"), config::Widescreen,
T("Draw geometry outside of the normal 4:3 aspect ratio. May produce graphical glitches in the revealed areas.\nAspect Fit and shows the full 16:9 content."));
{
DisabledScope scope(!config::Widescreen || config::IntegerScale);
DisabledScope scope(!config::Widescreen || config::IntegerScale || config::StretchToFill);

ImGui::Indent();
OptionCheckbox(T("Super Widescreen"), config::SuperWidescreen,
T("Use the full width of the screen or window when its aspect ratio is greater than 16:9.\nAspect Fill and remove black bars. Not compatible with integer scaling."));
ImGui::Unindent();
}
OptionCheckbox(T("Widescreen Game Cheats"), config::WidescreenGameHacks,
OptionCheckbox(T("Widescreen Game Cheats"), config::WidescreenGameHacks,
T("Modify the game so that it displays in 16:9 anamorphic format and use horizontal screen stretching. Only some games are supported."));
OptionSlider(T("Horizontal Stretching"), config::ScreenStretching, 100, 250,
T("Stretch the screen horizontally"), "%d%%");
{
DisabledScope scope(config::SuperWidescreen);
OptionCheckbox(T("Stretch to Fill"), config::StretchToFill,
T("Stretch the screen to fill the entire screen or window."));
}
{
DisabledScope scope(config::StretchToFill);
OptionSlider(T("Horizontal Stretching"), config::ScreenStretching, 100, 250,
T("Stretch the screen horizontally"), "%d%%");
}
OptionCheckbox(T("Rotate Screen 90°"), config::Rotate90, T("Rotate the screen 90° counterclockwise"));
}
if (perPixel)
Expand Down
1 change: 1 addition & 0 deletions shell/libretro/option.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Option<bool> DumpTextures(CORE_OPTION_NAME "_dump_textures");
Option<bool> DumpUniqueTextures(CORE_OPTION_NAME "_dump_unique_textures");
Option<bool> DumpReplacedTextures(CORE_OPTION_NAME "_dump_replaced_textures");
Option<int> ScreenStretching("", 100);
Option<bool> StretchToFill("");
Option<bool> Fog(CORE_OPTION_NAME "_fog", true);
Option<bool> FloatVMUs("");
Option<bool> Rotate90("");
Expand Down
Loading