mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-01-31 01:15:24 +01:00
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4dccc237c | ||
|
|
92d8c740d4 | ||
|
|
b6eddade00 | ||
|
|
04fdd09d1e | ||
|
|
69574aecc6 | ||
|
|
c72d98d4cd | ||
|
|
4f405adea9 | ||
|
|
5217ec375d | ||
|
|
10b264b9ec | ||
|
|
dc741e95bd | ||
|
|
a1ca0a9a02 | ||
|
|
c076c50b68 | ||
|
|
c688db8f08 | ||
|
|
469053de9b | ||
|
|
185b85f86a | ||
|
|
11096a520e | ||
|
|
07fd035aa2 | ||
|
|
6bedcd768f | ||
|
|
0c949db506 | ||
|
|
4c5253c0f5 | ||
|
|
325133e54c | ||
|
|
4113ac574d | ||
|
|
2d6c687913 | ||
|
|
f9fbecc783 | ||
|
|
c5ceba35b6 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -119,3 +119,4 @@ oprofile_data/
|
||||
CMakeSettings.json
|
||||
/ci-artifacts/
|
||||
/out/
|
||||
/.cache/
|
||||
|
||||
2
3rdparty/imgui/include/imconfig.h
vendored
2
3rdparty/imgui/include/imconfig.h
vendored
@@ -28,7 +28,7 @@
|
||||
//#define IMGUI_API __attribute__((visibility("default"))) // GCC/Clang: override visibility when set is hidden
|
||||
|
||||
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
|
||||
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87+ disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This is automatically done by IMGUI_DISABLE_OBSOLETE_FUNCTIONS.
|
||||
|
||||
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
|
||||
|
||||
4
3rdparty/imgui/include/imgui_internal.h
vendored
4
3rdparty/imgui/include/imgui_internal.h
vendored
@@ -1357,8 +1357,8 @@ typedef ImBitArray<ImGuiKey_NamedKey_COUNT, -ImGuiKey_NamedKey_BEGIN> ImBitAr
|
||||
#define ImGuiKey_NavKeyboardTweakFast ImGuiMod_Shift
|
||||
#define ImGuiKey_NavGamepadTweakSlow ImGuiKey_GamepadL1
|
||||
#define ImGuiKey_NavGamepadTweakFast ImGuiKey_GamepadR1
|
||||
#define ImGuiKey_NavGamepadActivate ImGuiKey_GamepadFaceDown
|
||||
#define ImGuiKey_NavGamepadCancel ImGuiKey_GamepadFaceRight
|
||||
#define ImGuiKey_NavGamepadActivate (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceRight : ImGuiKey_GamepadFaceDown)
|
||||
#define ImGuiKey_NavGamepadCancel (g.IO.ConfigNavSwapGamepadButtons ? ImGuiKey_GamepadFaceDown : ImGuiKey_GamepadFaceRight)
|
||||
#define ImGuiKey_NavGamepadMenu ImGuiKey_GamepadFaceLeft
|
||||
#define ImGuiKey_NavGamepadInput ImGuiKey_GamepadFaceUp
|
||||
|
||||
|
||||
5
3rdparty/imgui/src/imgui.cpp
vendored
5
3rdparty/imgui/src/imgui.cpp
vendored
@@ -13005,6 +13005,9 @@ static void ImGui::NavUpdateWindowing()
|
||||
const bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
|
||||
const bool keyboard_next_window = allow_windowing && g.ConfigNavWindowingKeyNext && Shortcut(g.ConfigNavWindowingKeyNext, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways, owner_id);
|
||||
const bool keyboard_prev_window = allow_windowing && g.ConfigNavWindowingKeyPrev && Shortcut(g.ConfigNavWindowingKeyPrev, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways, owner_id);
|
||||
/*
|
||||
Why do we need to patch ImGui to disable the nav menu...
|
||||
|
||||
const bool start_windowing_with_gamepad = allow_windowing && nav_gamepad_active && !g.NavWindowingTarget && IsKeyPressed(ImGuiKey_NavGamepadMenu, ImGuiInputFlags_None);
|
||||
const bool start_windowing_with_keyboard = allow_windowing && !g.NavWindowingTarget && (keyboard_next_window || keyboard_prev_window); // Note: enabled even without NavEnableKeyboard!
|
||||
if (start_windowing_with_gamepad || start_windowing_with_keyboard)
|
||||
@@ -13020,7 +13023,7 @@ static void ImGui::NavUpdateWindowing()
|
||||
if (keyboard_next_window || keyboard_prev_window)
|
||||
SetKeyOwnersForKeyChord((g.ConfigNavWindowingKeyNext | g.ConfigNavWindowingKeyPrev) & ImGuiMod_Mask_, owner_id);
|
||||
}
|
||||
|
||||
*/
|
||||
// Gamepad update
|
||||
g.NavWindowingTimer += io.DeltaTime;
|
||||
if (g.NavWindowingTarget && g.NavInputSource == ImGuiInputSource_Gamepad)
|
||||
|
||||
@@ -7169,6 +7169,12 @@ SCKA-20087:
|
||||
nativeScaling: 2 # Fixes post processing smoothness and position.
|
||||
memcardFilters:
|
||||
- "SCKA-20086"
|
||||
SCKA-20088:
|
||||
name: "모두의 테니스"
|
||||
name-en: "Everybody's Tennis"
|
||||
region: "NTSC-K"
|
||||
roundModes:
|
||||
vu1RoundMode: 1 # Fixes the display of scores and text ingame.
|
||||
SCKA-20089:
|
||||
name: "BioHazard 4"
|
||||
region: "NTSC-K"
|
||||
@@ -10406,6 +10412,8 @@ SCUS-97211:
|
||||
name: "ATV Offroad Fury 2"
|
||||
region: "NTSC-U"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
bilinearUpscale: 2 # Fixes broken textures.
|
||||
SCUS-97212:
|
||||
name: "My Street"
|
||||
region: "NTSC-U"
|
||||
@@ -10523,6 +10531,8 @@ SCUS-97236:
|
||||
SCUS-97238:
|
||||
name: "ATV Offroad Fury 2 [Demo]"
|
||||
region: "NTSC-U"
|
||||
gsHWFixes:
|
||||
bilinearUpscale: 2 # Fixes broken textures.
|
||||
SCUS-97239:
|
||||
name: "Jet X2O [Demo]"
|
||||
region: "NTSC-U"
|
||||
@@ -10929,6 +10939,8 @@ SCUS-97369:
|
||||
name: "ATV Offroad Fury 2"
|
||||
region: "NTSC-U"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
bilinearUpscale: 2 # Fixes broken textures.
|
||||
SCUS-97370:
|
||||
name: "NCAA Final Four 2004"
|
||||
region: "NTSC-U"
|
||||
@@ -11571,6 +11583,8 @@ SCUS-97509:
|
||||
SCUS-97510:
|
||||
name: "ATV Offroad Fury 2 [Greatest Hits]"
|
||||
region: "NTSC-U"
|
||||
gsHWFixes:
|
||||
bilinearUpscale: 2 # Fixes broken textures.
|
||||
SCUS-97511:
|
||||
name: "SOCOM II - U.S. Navy SEALs [Greatest Hits]"
|
||||
region: "NTSC-U"
|
||||
@@ -17359,6 +17373,8 @@ SLES-51813:
|
||||
SLES-51814:
|
||||
name: "ATV Offroad Fury 2"
|
||||
region: "PAL-E"
|
||||
gsHWFixes:
|
||||
bilinearUpscale: 2 # Fixes broken textures.
|
||||
SLES-51815:
|
||||
name: "Final Fantasy X-2"
|
||||
region: "PAL-E"
|
||||
@@ -67117,6 +67133,8 @@ SLUS-21638:
|
||||
compat: 5
|
||||
clampModes:
|
||||
vuClampMode: 3 # Missing geometry with microVU.
|
||||
memcardFilters:
|
||||
- "SLUS-21620"
|
||||
SLUS-21639:
|
||||
name: "NASCAR 08"
|
||||
region: "NTSC-U"
|
||||
|
||||
@@ -1172,7 +1172,6 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
||||
05000000a00500003232000001000000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux,
|
||||
05000000a00500003232000008010000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux,
|
||||
03000000c82d00001890000011010000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,
|
||||
050000005e040000e002000030110000,8BitDo Zero 2,a:b0,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Linux,
|
||||
05000000c82d00003032000000010000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
|
||||
03000000c01100000355000011010000,Acrux Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||
030000006f0e00008801000011010000,Afterglow Deluxe Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||
@@ -1694,7 +1693,6 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
||||
050000005e040000220b000013050000,Xbox One Elite 2 Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||
050000005e040000050b000002090000,Xbox One Elite Series 2,a:b0,b:b1,back:b136,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||
030000005e040000ea02000011050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
050082795e040000e002000003090000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
060000005e040000ea0200000b050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
060000005e040000ea0200000d050000,Xbox One S Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
030000005e040000120b000001050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
|
||||
@@ -772,17 +772,17 @@ float4 ps_color(PS_INPUT input)
|
||||
uint4 denorm_c_before = uint4(T);
|
||||
if (PS_PROCESS_BA & SHUFFLE_READ)
|
||||
{
|
||||
T.r = float((denorm_c_before.b << 3) & 0xF8);
|
||||
T.g = float(((denorm_c_before.b >> 2) & 0x38) | ((denorm_c_before.a << 6) & 0xC0));
|
||||
T.b = float((denorm_c_before.a << 1) & 0xF8);
|
||||
T.a = float(denorm_c_before.a & 0x80);
|
||||
T.r = float((denorm_c_before.b << 3) & 0xF8u);
|
||||
T.g = float(((denorm_c_before.b >> 2) & 0x38u) | ((denorm_c_before.a << 6) & 0xC0u));
|
||||
T.b = float((denorm_c_before.a << 1) & 0xF8u);
|
||||
T.a = float(denorm_c_before.a & 0x80u);
|
||||
}
|
||||
else
|
||||
{
|
||||
T.r = float((denorm_c_before.r << 3) & 0xF8);
|
||||
T.g = float(((denorm_c_before.r >> 2) & 0x38) | ((denorm_c_before.g << 6) & 0xC0));
|
||||
T.b = float((denorm_c_before.g << 1) & 0xF8);
|
||||
T.a = float(denorm_c_before.g & 0x80);
|
||||
T.r = float((denorm_c_before.r << 3) & 0xF8u);
|
||||
T.g = float(((denorm_c_before.r >> 2) & 0x38u) | ((denorm_c_before.g << 6) & 0xC0u));
|
||||
T.b = float((denorm_c_before.g << 1) & 0xF8u);
|
||||
T.a = float(denorm_c_before.g & 0x80u);
|
||||
}
|
||||
|
||||
T.a = (T.a >= 127.5f ? TA.y : !PS_AEM || any(int3(T.rgb) & 0xF8) ? TA.x : 0) * 255.0f;
|
||||
@@ -874,17 +874,17 @@ void ps_blend(inout float4 Color, inout float4 As_rgba, float2 pos_xy)
|
||||
uint4 denorm_rt = uint4(RT);
|
||||
if (PS_PROCESS_BA & SHUFFLE_WRITE)
|
||||
{
|
||||
RT.r = float((denorm_rt.b << 3) & 0xF8);
|
||||
RT.g = float(((denorm_rt.b >> 2) & 0x38) | ((denorm_rt.a << 6) & 0xC0));
|
||||
RT.b = float((denorm_rt.a << 1) & 0xF8);
|
||||
RT.a = float(denorm_rt.a & 0x80);
|
||||
RT.r = float((denorm_rt.b << 3) & 0xF8u);
|
||||
RT.g = float(((denorm_rt.b >> 2) & 0x38u) | ((denorm_rt.a << 6) & 0xC0u));
|
||||
RT.b = float((denorm_rt.a << 1) & 0xF8u);
|
||||
RT.a = float(denorm_rt.a & 0x80u);
|
||||
}
|
||||
else
|
||||
{
|
||||
RT.r = float((denorm_rt.r << 3) & 0xF8);
|
||||
RT.g = float(((denorm_rt.r >> 2) & 0x38) | ((denorm_rt.g << 6) & 0xC0));
|
||||
RT.b = float((denorm_rt.g << 1) & 0xF8);
|
||||
RT.a = float(denorm_rt.g & 0x80);
|
||||
RT.r = float((denorm_rt.r << 3) & 0xF8u);
|
||||
RT.g = float(((denorm_rt.r >> 2) & 0x38u) | ((denorm_rt.g << 6) & 0xC0u));
|
||||
RT.b = float((denorm_rt.g << 1) & 0xF8u);
|
||||
RT.a = float(denorm_rt.g & 0x80u);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1067,13 +1067,13 @@ PS_OUTPUT ps_main(PS_INPUT input)
|
||||
uint4 denorm_c_after = uint4(C);
|
||||
if (PS_PROCESS_BA & SHUFFLE_READ)
|
||||
{
|
||||
C.b = float(((denorm_c_after.r >> 3) & 0x1F) | ((denorm_c_after.g << 2) & 0xE0));
|
||||
C.a = float(((denorm_c_after.g >> 6) & 0x3) | ((denorm_c_after.b >> 1) & 0x7C) | (denorm_c_after.a & 0x80));
|
||||
C.b = float(((denorm_c_after.r >> 3) & 0x1Fu) | ((denorm_c_after.g << 2) & 0xE0u));
|
||||
C.a = float(((denorm_c_after.g >> 6) & 0x3u) | ((denorm_c_after.b >> 1) & 0x7Cu) | (denorm_c_after.a & 0x80u));
|
||||
}
|
||||
else
|
||||
{
|
||||
C.r = float(((denorm_c_after.r >> 3) & 0x1F) | ((denorm_c_after.g << 2) & 0xE0));
|
||||
C.g = float(((denorm_c_after.g >> 6) & 0x3) | ((denorm_c_after.b >> 1) & 0x7C) | (denorm_c_after.a & 0x80));
|
||||
C.r = float(((denorm_c_after.r >> 3) & 0x1Fu) | ((denorm_c_after.g << 2) & 0xE0u));
|
||||
C.g = float(((denorm_c_after.g >> 6) & 0x3u) | ((denorm_c_after.b >> 1) & 0x7Cu) | (denorm_c_after.a & 0x80u));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -681,15 +681,15 @@ vec4 ps_color()
|
||||
#if PS_SHUFFLE && !PS_READ16_SRC && !PS_SHUFFLE_SAME
|
||||
uvec4 denorm_c_before = uvec4(T);
|
||||
#if (PS_PROCESS_BA & SHUFFLE_READ)
|
||||
T.r = float((denorm_c_before.b << 3) & 0xF8);
|
||||
T.g = float(((denorm_c_before.b >> 2) & 0x38) | ((denorm_c_before.a << 6) & 0xC0));
|
||||
T.b = float((denorm_c_before.a << 1) & 0xF8);
|
||||
T.a = float(denorm_c_before.a & 0x80);
|
||||
T.r = float((denorm_c_before.b << 3) & 0xF8u);
|
||||
T.g = float(((denorm_c_before.b >> 2) & 0x38u) | ((denorm_c_before.a << 6) & 0xC0u));
|
||||
T.b = float((denorm_c_before.a << 1) & 0xF8u);
|
||||
T.a = float(denorm_c_before.a & 0x80u);
|
||||
#else
|
||||
T.r = float((denorm_c_before.r << 3) & 0xF8);
|
||||
T.g = float(((denorm_c_before.r >> 2) & 0x38) | ((denorm_c_before.g << 6) & 0xC0));
|
||||
T.b = float((denorm_c_before.g << 1) & 0xF8);
|
||||
T.a = float(denorm_c_before.g & 0x80);
|
||||
T.r = float((denorm_c_before.r << 3) & 0xF8u);
|
||||
T.g = float(((denorm_c_before.r >> 2) & 0x38u) | ((denorm_c_before.g << 6) & 0xC0u));
|
||||
T.b = float((denorm_c_before.g << 1) & 0xF8u);
|
||||
T.a = float(denorm_c_before.g & 0x80u);
|
||||
#endif
|
||||
|
||||
T.a = ((T.a >= 127.5f) ? TA.y : ((PS_AEM == 0 || any(bvec3(ivec3(T.rgb) & ivec3(0xF8)))) ? TA.x : 0.0f)) * 255.0f;
|
||||
@@ -804,15 +804,15 @@ float As = As_rgba.a;
|
||||
#if PS_SHUFFLE && SW_BLEND_NEEDS_RT
|
||||
uvec4 denorm_rt = uvec4(RT);
|
||||
#if (PS_PROCESS_BA & SHUFFLE_WRITE)
|
||||
RT.r = float((denorm_rt.b << 3) & 0xF8);
|
||||
RT.g = float(((denorm_rt.b >> 2) & 0x38) | ((denorm_rt.a << 6) & 0xC0));
|
||||
RT.b = float((denorm_rt.a << 1) & 0xF8);
|
||||
RT.a = float(denorm_rt.a & 0x80);
|
||||
RT.r = float((denorm_rt.b << 3) & 0xF8u);
|
||||
RT.g = float(((denorm_rt.b >> 2) & 0x38u) | ((denorm_rt.a << 6) & 0xC0u));
|
||||
RT.b = float((denorm_rt.a << 1) & 0xF8u);
|
||||
RT.a = float(denorm_rt.a & 0x80u);
|
||||
#else
|
||||
RT.r = float((denorm_rt.r << 3) & 0xF8);
|
||||
RT.g = float(((denorm_rt.r >> 2) & 0x38) | ((denorm_rt.g << 6) & 0xC0));
|
||||
RT.b = float((denorm_rt.g << 1) & 0xF8);
|
||||
RT.a = float(denorm_rt.g & 0x80);
|
||||
RT.r = float((denorm_rt.r << 3) & 0xF8u);
|
||||
RT.g = float(((denorm_rt.r >> 2) & 0x38u) | ((denorm_rt.g << 6) & 0xC0u));
|
||||
RT.b = float((denorm_rt.g << 1) & 0xF8u);
|
||||
RT.a = float(denorm_rt.g & 0x80u);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1046,11 +1046,11 @@ void ps_main()
|
||||
#if !PS_READ16_SRC && !PS_SHUFFLE_SAME
|
||||
uvec4 denorm_c_after = uvec4(C);
|
||||
#if (PS_PROCESS_BA & SHUFFLE_READ)
|
||||
C.b = float(((denorm_c_after.r >> 3) & 0x1F) | ((denorm_c_after.g << 2) & 0xE0));
|
||||
C.a = float(((denorm_c_after.g >> 6) & 0x3) | ((denorm_c_after.b >> 1) & 0x7C) | (denorm_c_after.a & 0x80));
|
||||
C.b = float(((denorm_c_after.r >> 3) & 0x1Fu) | ((denorm_c_after.g << 2) & 0xE0u));
|
||||
C.a = float(((denorm_c_after.g >> 6) & 0x3u) | ((denorm_c_after.b >> 1) & 0x7Cu) | (denorm_c_after.a & 0x80u));
|
||||
#else
|
||||
C.r = float(((denorm_c_after.r >> 3) & 0x1F) | ((denorm_c_after.g << 2) & 0xE0));
|
||||
C.g = float(((denorm_c_after.g >> 6) & 0x3) | ((denorm_c_after.b >> 1) & 0x7C) | (denorm_c_after.a & 0x80));
|
||||
C.r = float(((denorm_c_after.r >> 3) & 0x1Fu) | ((denorm_c_after.g << 2) & 0xE0u));
|
||||
C.g = float(((denorm_c_after.g >> 6) & 0x3u) | ((denorm_c_after.b >> 1) & 0x7Cu) | (denorm_c_after.a & 0x80u));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -948,15 +948,15 @@ vec4 ps_color()
|
||||
#if PS_SHUFFLE && !PS_READ16_SRC && !PS_SHUFFLE_SAME
|
||||
uvec4 denorm_c_before = uvec4(T);
|
||||
#if (PS_PROCESS_BA & SHUFFLE_READ)
|
||||
T.r = float((denorm_c_before.b << 3) & 0xF8);
|
||||
T.g = float(((denorm_c_before.b >> 2) & 0x38) | ((denorm_c_before.a << 6) & 0xC0));
|
||||
T.b = float((denorm_c_before.a << 1) & 0xF8);
|
||||
T.a = float(denorm_c_before.a & 0x80);
|
||||
T.r = float((denorm_c_before.b << 3) & 0xF8u);
|
||||
T.g = float(((denorm_c_before.b >> 2) & 0x38u) | ((denorm_c_before.a << 6) & 0xC0u));
|
||||
T.b = float((denorm_c_before.a << 1) & 0xF8u);
|
||||
T.a = float(denorm_c_before.a & 0x80u);
|
||||
#else
|
||||
T.r = float((denorm_c_before.r << 3) & 0xF8);
|
||||
T.g = float(((denorm_c_before.r >> 2) & 0x38) | ((denorm_c_before.g << 6) & 0xC0));
|
||||
T.b = float((denorm_c_before.g << 1) & 0xF8);
|
||||
T.a = float(denorm_c_before.g & 0x80);
|
||||
T.r = float((denorm_c_before.r << 3) & 0xF8u);
|
||||
T.g = float(((denorm_c_before.r >> 2) & 0x38) | ((denorm_c_before.g << 6) & 0xC0u));
|
||||
T.b = float((denorm_c_before.g << 1) & 0xF8u);
|
||||
T.a = float(denorm_c_before.g & 0x80u);
|
||||
#endif
|
||||
|
||||
T.a = ((T.a >= 127.5f) ? TA.y : ((PS_AEM == 0 || any(bvec3(ivec3(T.rgb) & ivec3(0xF8)))) ? TA.x : 0.0f)) * 255.0f;
|
||||
@@ -1071,15 +1071,15 @@ void ps_blend(inout vec4 Color, inout vec4 As_rgba)
|
||||
#if PS_SHUFFLE && PS_FEEDBACK_LOOP_IS_NEEDED
|
||||
uvec4 denorm_rt = uvec4(RT);
|
||||
#if (PS_PROCESS_BA & SHUFFLE_WRITE)
|
||||
RT.r = float((denorm_rt.b << 3) & 0xF8);
|
||||
RT.g = float(((denorm_rt.b >> 2) & 0x38) | ((denorm_rt.a << 6) & 0xC0));
|
||||
RT.b = float((denorm_rt.a << 1) & 0xF8);
|
||||
RT.a = float(denorm_rt.a & 0x80);
|
||||
RT.r = float((denorm_rt.b << 3) & 0xF8u);
|
||||
RT.g = float(((denorm_rt.b >> 2) & 0x38u) | ((denorm_rt.a << 6) & 0xC0u));
|
||||
RT.b = float((denorm_rt.a << 1) & 0xF8u);
|
||||
RT.a = float(denorm_rt.a & 0x80u);
|
||||
#else
|
||||
RT.r = float((denorm_rt.r << 3) & 0xF8);
|
||||
RT.g = float(((denorm_rt.r >> 2) & 0x38) | ((denorm_rt.g << 6) & 0xC0));
|
||||
RT.b = float((denorm_rt.g << 1) & 0xF8);
|
||||
RT.a = float(denorm_rt.g & 0x80);
|
||||
RT.r = float((denorm_rt.r << 3) & 0xF8u);
|
||||
RT.g = float(((denorm_rt.r >> 2) & 0x38u) | ((denorm_rt.g << 6) & 0xC0u));
|
||||
RT.b = float((denorm_rt.g << 1) & 0xF8u);
|
||||
RT.a = float(denorm_rt.g & 0x80u);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1312,11 +1312,11 @@ void main()
|
||||
#if !PS_READ16_SRC && !PS_SHUFFLE_SAME
|
||||
uvec4 denorm_c_after = uvec4(C);
|
||||
#if (PS_PROCESS_BA & SHUFFLE_READ)
|
||||
C.b = float(((denorm_c_after.r >> 3) & 0x1F) | ((denorm_c_after.g << 2) & 0xE0));
|
||||
C.a = float(((denorm_c_after.g >> 6) & 0x3) | ((denorm_c_after.b >> 1) & 0x7C) | (denorm_c_after.a & 0x80));
|
||||
C.b = float(((denorm_c_after.r >> 3) & 0x1Fu) | ((denorm_c_after.g << 2) & 0xE0u));
|
||||
C.a = float(((denorm_c_after.g >> 6) & 0x3u) | ((denorm_c_after.b >> 1) & 0x7Cu) | (denorm_c_after.a & 0x80u));
|
||||
#else
|
||||
C.r = float(((denorm_c_after.r >> 3) & 0x1F) | ((denorm_c_after.g << 2) & 0xE0));
|
||||
C.g = float(((denorm_c_after.g >> 6) & 0x3) | ((denorm_c_after.b >> 1) & 0x7C) | (denorm_c_after.a & 0x80));
|
||||
C.r = float(((denorm_c_after.r >> 3) & 0x1Fu) | ((denorm_c_after.g << 2) & 0xE0u));
|
||||
C.g = float(((denorm_c_after.g >> 6) & 0x3u) | ((denorm_c_after.b >> 1) & 0x7Cu) | (denorm_c_after.a & 0x80u));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# Extra preprocessor definitions that will be added to all pcsx2 builds
|
||||
set(PCSX2_DEFS "")
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Misc option
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -8,6 +10,7 @@ option(ENABLE_TESTS "Enables building the unit tests" ON)
|
||||
option(ENABLE_GSRUNNER "Enables building the GSRunner" OFF)
|
||||
option(LTO_PCSX2_CORE "Enable LTO/IPO/LTCG on the subset of pcsx2 that benefits most from it but not anything else")
|
||||
option(USE_VTUNE "Plug VTUNE to profile GS JIT.")
|
||||
option(PACKAGE_MODE "Use this option to ease packaging of PCSX2 (developer/distribution option)")
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Graphical option
|
||||
@@ -199,6 +202,15 @@ if(MSVC)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(PACKAGE_MODE)
|
||||
file(RELATIVE_PATH relative_datadir ${CMAKE_INSTALL_FULL_BINDIR} ${CMAKE_INSTALL_FULL_DATADIR}/PCSX2)
|
||||
|
||||
# Compile all source codes with those defines
|
||||
list(APPEND PCSX2_DEFS
|
||||
PCSX2_APP_DATADIR="${relative_datadir}")
|
||||
endif()
|
||||
|
||||
|
||||
if(USE_VTUNE)
|
||||
list(APPEND PCSX2_DEFS ENABLE_VTUNE)
|
||||
endif()
|
||||
|
||||
@@ -349,7 +349,7 @@ void GameListWidget::onCoverScaleChanged()
|
||||
m_list_view->setSpacing(m_model->getCoverArtSpacing());
|
||||
|
||||
QFont font;
|
||||
font.setPointSizeF(16.0f * m_model->getCoverScale());
|
||||
font.setPointSizeF(20.0f * m_model->getCoverScale());
|
||||
m_list_view->setFont(font);
|
||||
}
|
||||
|
||||
|
||||
@@ -509,10 +509,18 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
|
||||
m_ui.mipmapping, tr("Mipmapping"), tr("Checked"), tr("Enables mipmapping, which some games require to render correctly."));
|
||||
|
||||
dialog->registerWidgetHelp(
|
||||
m_ui.textureFiltering, tr("Texture Filtering"), tr("Bilinear (PS2)"), tr("Control the texture filtering of the emulation."));
|
||||
m_ui.textureFiltering, tr("Texture Filtering"), tr("Bilinear (PS2)"),
|
||||
tr("Changes what filtering algorithm is used to map textures to surfaces.<br> "
|
||||
"Nearest: Makes no attempt to blend colors.<br> "
|
||||
"Bilinear (Forced): Will blend colors together to remove harsh edges between different colored pixels even if the game told the PS2 not to.<br> "
|
||||
"Bilinear (PS2): Will apply filtering to all surfaces that a game instructs the PS2 to filter.<br> "
|
||||
"Bilinear (Forced Excluding Sprites): Will apply filtering to all surfaces, even if the game told the PS2 not to, except sprites."));
|
||||
|
||||
dialog->registerWidgetHelp(m_ui.trilinearFiltering, tr("Trilinear Filtering"), tr("Automatic (Default)"),
|
||||
tr("Control the texture's trilinear filtering of the emulation."));
|
||||
tr("Reduces blurriness of large textures applied to small, steeply angled surfaces by sampling colors from the two nearest Mipmaps. Requires Mipmapping to be 'on'.<br> "
|
||||
"Off: Disables the feature.<br> "
|
||||
"Trilinear (PS2): Applies Trilinear filtering to all surfaces that a game instructs the PS2 to.<br> "
|
||||
"Trilinear (Forced): Applies Trilinear filtering to all surfaces, even if the game told the PS2 not to."));
|
||||
|
||||
dialog->registerWidgetHelp(m_ui.anisotropicFiltering, tr("Anisotropic Filtering"), tr("Off (Default)"),
|
||||
tr("Reduces texture aliasing at extreme viewing angles."));
|
||||
|
||||
@@ -1938,7 +1938,7 @@
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100000</number>
|
||||
<number>200000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>100</number>
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace QtHost
|
||||
} // namespace QtHost
|
||||
|
||||
static QString s_unthemed_style_name;
|
||||
static QPalette s_unthemed_palette;
|
||||
static bool s_unthemed_style_name_set;
|
||||
|
||||
const char* QtHost::GetDefaultThemeName()
|
||||
@@ -37,6 +38,7 @@ void QtHost::UpdateApplicationTheme()
|
||||
{
|
||||
s_unthemed_style_name_set = true;
|
||||
s_unthemed_style_name = QApplication::style()->objectName();
|
||||
s_unthemed_palette = QApplication::palette();
|
||||
}
|
||||
|
||||
SetStyleFromSettings();
|
||||
@@ -49,7 +51,7 @@ void QtHost::SetStyleFromSettings()
|
||||
|
||||
// setPalette() shouldn't be necessary, as the documentation claims that setStyle() resets the palette, but it
|
||||
// is here, to work around a bug in 6.4.x and 6.5.x where the palette doesn't restore after changing themes.
|
||||
qApp->setPalette(QPalette());
|
||||
qApp->setPalette(QPalette(s_unthemed_palette));
|
||||
|
||||
if (theme == "fusion")
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1282,6 +1282,16 @@ function(setup_main_executable target)
|
||||
install(CODE "file(WRITE \"${CMAKE_SOURCE_DIR}/bin/qt.conf\" \"[Paths]\\nPlugins = ./QtPlugins\")")
|
||||
endif()
|
||||
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
if (PACKAGE_MODE)
|
||||
install(TARGETS pcsx2-qt DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/resources DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/PCSX2)
|
||||
else()
|
||||
install(TARGETS pcsx2-qt DESTINATION ${CMAKE_SOURCE_DIR}/bin)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
if(CMAKE_GENERATOR MATCHES "Xcode")
|
||||
# If we're generating an xcode project, you can just add the shaders to the main pcsx2 target and xcode will deal with them properly
|
||||
|
||||
@@ -592,7 +592,7 @@ struct Pcsx2Config
|
||||
static constexpr int DEFAULT_VIDEO_CAPTURE_BITRATE = 6000;
|
||||
static constexpr int DEFAULT_VIDEO_CAPTURE_WIDTH = 640;
|
||||
static constexpr int DEFAULT_VIDEO_CAPTURE_HEIGHT = 480;
|
||||
static constexpr int DEFAULT_AUDIO_CAPTURE_BITRATE = 160;
|
||||
static constexpr int DEFAULT_AUDIO_CAPTURE_BITRATE = 192;
|
||||
static const char* DEFAULT_CAPTURE_CONTAINER;
|
||||
|
||||
union
|
||||
|
||||
@@ -1799,7 +1799,7 @@ public:
|
||||
|
||||
// TODO: ReadAndExpandBlock4_16
|
||||
|
||||
// ReadAndExpandBlock8H for AVX2 platforms with slow VPGATHERDD (Haswell, Zen, Zen2, Zen3)
|
||||
// ReadAndExpandBlock8H for AVX2 platforms with slow VPGATHERDD (Haswell, Zen, Zen2, Zen3, Zen4)
|
||||
// Also serves as the implementation for AVX / SSE
|
||||
__forceinline static void ReadAndExpandBlock8H_32HSW(const u8* RESTRICT src, u8* RESTRICT dst, int dstpitch, const u32* RESTRICT pal)
|
||||
{
|
||||
|
||||
@@ -715,16 +715,16 @@ struct alignas(16) GSHWDrawConfig
|
||||
|
||||
AlphaPass alpha_second_pass;
|
||||
|
||||
struct BlendPass
|
||||
struct BlendMultiPass
|
||||
{
|
||||
BlendState blend;
|
||||
u8 blend_hw;
|
||||
u8 dither;
|
||||
bool enable;
|
||||
};
|
||||
static_assert(sizeof(BlendPass) == 8, "blend pass is 8 bytes");
|
||||
static_assert(sizeof(BlendMultiPass) == 8, "blend multi pass is 8 bytes");
|
||||
|
||||
BlendPass blend_second_pass;
|
||||
BlendMultiPass blend_multi_pass;
|
||||
|
||||
VSConstantBuffer cb_vs;
|
||||
PSConstantBuffer cb_ps;
|
||||
|
||||
@@ -1603,7 +1603,7 @@ void GSDevice11::DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex,
|
||||
|
||||
if (feedback_write_1)
|
||||
{
|
||||
StretchRect(sTex[0], full_r, sTex[2], dRect[2], m_convert.ps[static_cast<int>(ShaderConvert::YUV)].get(),
|
||||
StretchRect(dTex, full_r, sTex[2], dRect[2], m_convert.ps[static_cast<int>(ShaderConvert::YUV)].get(),
|
||||
m_merge.cb.get(), nullptr, linear);
|
||||
}
|
||||
}
|
||||
@@ -2000,9 +2000,9 @@ bool GSDevice11::CreateImGuiResources()
|
||||
// clang-format off
|
||||
static constexpr D3D11_INPUT_ELEMENT_DESC layout[] =
|
||||
{
|
||||
{ "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)IM_OFFSETOF(ImDrawVert, pos), D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)IM_OFFSETOF(ImDrawVert, uv), D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, (UINT)IM_OFFSETOF(ImDrawVert, col), D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)offsetof(ImDrawVert, pos), D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)offsetof(ImDrawVert, uv), D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, (UINT)offsetof(ImDrawVert, col), D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
@@ -2653,12 +2653,12 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
|
||||
OMSetRenderTargets(hdr_rt ? hdr_rt : config.rt, config.ds, &config.scissor);
|
||||
DrawIndexedPrimitive();
|
||||
|
||||
if (config.blend_second_pass.enable)
|
||||
if (config.blend_multi_pass.enable)
|
||||
{
|
||||
config.ps.blend_hw = config.blend_second_pass.blend_hw;
|
||||
config.ps.dither = config.blend_second_pass.dither;
|
||||
config.ps.blend_hw = config.blend_multi_pass.blend_hw;
|
||||
config.ps.dither = config.blend_multi_pass.dither;
|
||||
SetupPS(config.ps, &config.cb_ps, config.sampler);
|
||||
SetupOM(config.depth, OMBlendSelector(config.colormask, config.blend_second_pass.blend), config.blend_second_pass.blend.constant);
|
||||
SetupOM(config.depth, OMBlendSelector(config.colormask, config.blend_multi_pass.blend), config.blend_multi_pass.blend.constant);
|
||||
DrawIndexedPrimitive();
|
||||
}
|
||||
|
||||
|
||||
@@ -3980,14 +3980,14 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config)
|
||||
DrawIndexedPrimitive();
|
||||
|
||||
// blend second pass
|
||||
if (config.blend_second_pass.enable)
|
||||
if (config.blend_multi_pass.enable)
|
||||
{
|
||||
if (config.blend_second_pass.blend.constant_enable)
|
||||
SetBlendConstants(config.blend_second_pass.blend.constant);
|
||||
if (config.blend_multi_pass.blend.constant_enable)
|
||||
SetBlendConstants(config.blend_multi_pass.blend.constant);
|
||||
|
||||
pipe.bs = config.blend_second_pass.blend;
|
||||
pipe.ps.blend_hw = config.blend_second_pass.blend_hw;
|
||||
pipe.ps.dither = config.blend_second_pass.dither;
|
||||
pipe.bs = config.blend_multi_pass.blend;
|
||||
pipe.ps.blend_hw = config.blend_multi_pass.blend_hw;
|
||||
pipe.ps.dither = config.blend_multi_pass.dither;
|
||||
if (BindDrawPipeline(pipe))
|
||||
DrawIndexedPrimitive();
|
||||
}
|
||||
|
||||
@@ -4258,8 +4258,8 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
// HW blend can be done in multiple passes when there's no overlap.
|
||||
// Blend second pass is only useful when texture barriers aren't supported.
|
||||
// Speed wise Texture barriers > blend second pass > texture copies.
|
||||
const bool blend_second_pass_support = !features.texture_barrier && no_prim_overlap && is_basic_blend;
|
||||
const bool bmix1_second_pass = blend_second_pass_support && blend_mix1 && (alpha_c0_high_max_one || alpha_c2_high_one) && m_conf.ps.blend_d == 2;
|
||||
const bool blend_multi_pass_support = !features.texture_barrier && no_prim_overlap && is_basic_blend;
|
||||
const bool bmix1_second_pass = blend_multi_pass_support && blend_mix1 && (alpha_c0_high_max_one || alpha_c2_high_one) && m_conf.ps.blend_d == 2;
|
||||
// We don't want to enable blend mix if we are doing a second pass, it's useless.
|
||||
blend_mix &= !bmix1_second_pass;
|
||||
|
||||
@@ -4323,7 +4323,7 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
}
|
||||
else
|
||||
{
|
||||
const bool ad_second_pass = blend_second_pass_support && alpha_c1_high_no_rta_correct && COLCLAMP.CLAMP &&
|
||||
const bool ad_second_pass = blend_multi_pass_support && alpha_c1_high_no_rta_correct && COLCLAMP.CLAMP &&
|
||||
(blend_flag & (BLEND_HW3 | BLEND_HW5 | BLEND_HW6 | BLEND_HW7 | BLEND_HW9));
|
||||
|
||||
switch (GSConfig.AccurateBlendingUnit)
|
||||
@@ -4619,9 +4619,9 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
m_conf.ps.rta_correction = rt->m_rt_alpha_scale;
|
||||
}
|
||||
|
||||
if (blend_second_pass_support)
|
||||
if (blend_multi_pass_support)
|
||||
{
|
||||
const HWBlend blend_second_pass = GSDevice::GetBlend(blend_index);
|
||||
const HWBlend blend_multi_pass = GSDevice::GetBlend(blend_index);
|
||||
if (bmix1_second_pass)
|
||||
{
|
||||
// Alpha = As or Af.
|
||||
@@ -4630,9 +4630,9 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
blend.src = GSDevice::CONST_ONE;
|
||||
blend.dst = GSDevice::CONST_ONE;
|
||||
// Render pass 2: Blend the result (Cd) from render pass 1 with alpha range of 0-2.
|
||||
m_conf.blend_second_pass.enable = true;
|
||||
m_conf.blend_second_pass.blend_hw = static_cast<u8>(HWBlendType::SRC_ALPHA_DST_FACTOR);
|
||||
m_conf.blend_second_pass.blend = {true, GSDevice::DST_COLOR, (m_conf.ps.blend_c == 2) ? GSDevice::CONST_COLOR : GSDevice::SRC1_COLOR, GSDevice::OP_ADD, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, m_conf.ps.blend_c == 2, AFIX};
|
||||
m_conf.blend_multi_pass.enable = true;
|
||||
m_conf.blend_multi_pass.blend_hw = static_cast<u8>(HWBlendType::SRC_ALPHA_DST_FACTOR);
|
||||
m_conf.blend_multi_pass.blend = {true, GSDevice::DST_COLOR, (m_conf.ps.blend_c == 2) ? GSDevice::CONST_COLOR : GSDevice::SRC1_COLOR, GSDevice::OP_ADD, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, m_conf.ps.blend_c == 2, AFIX};
|
||||
}
|
||||
else if ((alpha_c0_high_max_one || alpha_c1_high_no_rta_correct || alpha_c2_high_one) && (blend_flag & BLEND_HW1))
|
||||
{
|
||||
@@ -4642,9 +4642,9 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
m_conf.ps.blend_hw = static_cast<u8>(HWBlendType::SRC_HALF_ONE_DST_FACTOR);
|
||||
blend.dst = (m_conf.ps.blend_c == 1) ? GSDevice::DST_ALPHA : GSDevice::SRC1_COLOR;
|
||||
// Render pass 2: Take result (Cd) from render pass 1 and double it.
|
||||
m_conf.blend_second_pass.enable = true;
|
||||
m_conf.blend_second_pass.blend_hw = static_cast<u8>(HWBlendType::SRC_ONE_DST_FACTOR);
|
||||
m_conf.blend_second_pass.blend = {true, blend_second_pass.src, GSDevice::CONST_ONE, blend_second_pass.op, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
m_conf.blend_multi_pass.enable = true;
|
||||
m_conf.blend_multi_pass.blend_hw = static_cast<u8>(HWBlendType::SRC_ONE_DST_FACTOR);
|
||||
m_conf.blend_multi_pass.blend = {true, blend_multi_pass.src, GSDevice::CONST_ONE, blend_multi_pass.op, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
}
|
||||
else if (alpha_c1_high_no_rta_correct && (blend_flag & BLEND_HW3))
|
||||
{
|
||||
@@ -4652,8 +4652,8 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
// Cs*Alpha, Cs*Alpha + Cd, Cd - Cs*Alpha.
|
||||
// Render pass 1: Do Cs*Alpha, Cs*Alpha + Cd or Cd - Cs*Alpha on first pass.
|
||||
// Render pass 2: Take result (Cd) from render pass 1 and either add or rev subtract Cs*Alpha based on the blend operation.
|
||||
m_conf.blend_second_pass.enable = true;
|
||||
m_conf.blend_second_pass.blend = {true, blend_second_pass.src, GSDevice::CONST_ONE, blend_second_pass.op, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
m_conf.blend_multi_pass.enable = true;
|
||||
m_conf.blend_multi_pass.blend = {true, blend_multi_pass.src, GSDevice::CONST_ONE, blend_multi_pass.op, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
}
|
||||
else if ((alpha_c0_high_max_one || alpha_c2_high_one) && (blend_flag & BLEND_HW4))
|
||||
{
|
||||
@@ -4667,9 +4667,9 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
blend.dst = (m_conf.ps.blend_c == 2) ? GSDevice::CONST_COLOR : GSDevice::SRC1_COLOR;
|
||||
blend.op = GSDevice::OP_ADD;
|
||||
// Render pass 2: Add or subtract result of render pass 1(Cd) from Cs.
|
||||
m_conf.blend_second_pass.enable = true;
|
||||
m_conf.blend_second_pass.dither = dither * GSConfig.Dithering;
|
||||
m_conf.blend_second_pass.blend = {true, blend_second_pass.src, GSDevice::CONST_ONE, blend_second_pass.op, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
m_conf.blend_multi_pass.enable = true;
|
||||
m_conf.blend_multi_pass.dither = dither * GSConfig.Dithering;
|
||||
m_conf.blend_multi_pass.blend = {true, blend_multi_pass.src, GSDevice::CONST_ONE, blend_multi_pass.op, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
}
|
||||
else if (alpha_c1_high_no_rta_correct && (blend_flag & BLEND_HW5))
|
||||
{
|
||||
@@ -4677,9 +4677,9 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
// Cd*Alpha - Cs*Alpha, Cs*Alpha - Cd*Alpha.
|
||||
// Render pass 1: Do (Cd - Cs)*Alpha, (Cs - Cd)*Alpha or Cd*Alpha on first pass.
|
||||
// Render pass 2: Take result (Cd) from render pass 1 and double it.
|
||||
m_conf.blend_second_pass.enable = true;
|
||||
m_conf.blend_second_pass.blend_hw = static_cast<u8>(HWBlendType::SRC_ONE_DST_FACTOR);
|
||||
m_conf.blend_second_pass.blend = {true, GSDevice::DST_COLOR, GSDevice::CONST_ONE, GSDevice::OP_ADD, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
m_conf.blend_multi_pass.enable = true;
|
||||
m_conf.blend_multi_pass.blend_hw = static_cast<u8>(HWBlendType::SRC_ONE_DST_FACTOR);
|
||||
m_conf.blend_multi_pass.blend = {true, GSDevice::DST_COLOR, GSDevice::CONST_ONE, GSDevice::OP_ADD, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
}
|
||||
else if (alpha_c1_high_no_rta_correct && (blend_flag & BLEND_HW6))
|
||||
{
|
||||
@@ -4690,9 +4690,9 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
AFIX = 64;
|
||||
blend.src = GSDevice::CONST_COLOR;
|
||||
// Render pass 2: Take result (Cd) from render pass 1 and double it.
|
||||
m_conf.blend_second_pass.enable = true;
|
||||
m_conf.blend_second_pass.blend_hw = static_cast<u8>(HWBlendType::SRC_ONE_DST_FACTOR);
|
||||
m_conf.blend_second_pass.blend = {true, GSDevice::DST_COLOR, GSDevice::CONST_ONE, GSDevice::OP_ADD, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
m_conf.blend_multi_pass.enable = true;
|
||||
m_conf.blend_multi_pass.blend_hw = static_cast<u8>(HWBlendType::SRC_ONE_DST_FACTOR);
|
||||
m_conf.blend_multi_pass.blend = {true, GSDevice::DST_COLOR, GSDevice::CONST_ONE, GSDevice::OP_ADD, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
}
|
||||
else if (alpha_c1_high_no_rta_correct && (blend_flag & BLEND_HW7))
|
||||
{
|
||||
@@ -4704,9 +4704,9 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
blend.dst = GSDevice::DST_ALPHA;
|
||||
blend.op = GSDevice::OP_SUBTRACT;
|
||||
// Render pass 2: Take result (Cd) from render pass 1 and double it.
|
||||
m_conf.blend_second_pass.enable = true;
|
||||
m_conf.blend_second_pass.blend_hw = static_cast<u8>(HWBlendType::SRC_ONE_DST_FACTOR);
|
||||
m_conf.blend_second_pass.blend = {true, GSDevice::DST_COLOR, GSDevice::CONST_ONE, GSDevice::OP_ADD, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
m_conf.blend_multi_pass.enable = true;
|
||||
m_conf.blend_multi_pass.blend_hw = static_cast<u8>(HWBlendType::SRC_ONE_DST_FACTOR);
|
||||
m_conf.blend_multi_pass.blend = {true, GSDevice::DST_COLOR, GSDevice::CONST_ONE, GSDevice::OP_ADD, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
}
|
||||
else if (blend_flag & BLEND_HW8)
|
||||
{
|
||||
@@ -4714,9 +4714,9 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
// Cs*(1 + Alpha).
|
||||
// Render pass 1: Do Cs.
|
||||
// Render pass 2: Try to double Cs, then take result (Cd) from render pass 1 and add Cs*Alpha to it.
|
||||
m_conf.blend_second_pass.enable = true;
|
||||
m_conf.blend_second_pass.blend_hw = static_cast<u8>(HWBlendType::SRC_DOUBLE);
|
||||
m_conf.blend_second_pass.blend = {true, GSDevice::DST_ALPHA, GSDevice::CONST_ONE, blend_second_pass.op, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
m_conf.blend_multi_pass.enable = true;
|
||||
m_conf.blend_multi_pass.blend_hw = static_cast<u8>(HWBlendType::SRC_DOUBLE);
|
||||
m_conf.blend_multi_pass.blend = {true, GSDevice::DST_ALPHA, GSDevice::CONST_ONE, blend_multi_pass.op, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
}
|
||||
else if (alpha_c1_high_no_rta_correct && (blend_flag & BLEND_HW9))
|
||||
{
|
||||
@@ -4724,12 +4724,12 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
// Cs*(1 - Alpha).
|
||||
// Render pass 1: Do Cs*(1 - Alpha).
|
||||
// Render pass 2: Take result (Cd) from render pass 1 and subtract Cs*Alpha from it.
|
||||
m_conf.blend_second_pass.enable = true;
|
||||
m_conf.blend_second_pass.blend = {true, GSDevice::DST_ALPHA, GSDevice::CONST_ONE, GSDevice::OP_REV_SUBTRACT, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
m_conf.blend_multi_pass.enable = true;
|
||||
m_conf.blend_multi_pass.blend = {true, GSDevice::DST_ALPHA, GSDevice::CONST_ONE, GSDevice::OP_REV_SUBTRACT, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0};
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_conf.blend_second_pass.enable && blend_flag & BLEND_HW1)
|
||||
if (!m_conf.blend_multi_pass.enable && blend_flag & BLEND_HW1)
|
||||
{
|
||||
m_conf.ps.blend_hw = static_cast<u8>(HWBlendType::SRC_ONE_DST_FACTOR);
|
||||
}
|
||||
@@ -4737,27 +4737,27 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
{
|
||||
m_conf.ps.blend_hw = static_cast<u8>(HWBlendType::SRC_ALPHA_DST_FACTOR);
|
||||
}
|
||||
else if (!m_conf.blend_second_pass.enable && alpha_c1_high_no_rta_correct && (blend_flag & BLEND_HW3))
|
||||
else if (!m_conf.blend_multi_pass.enable && alpha_c1_high_no_rta_correct && (blend_flag & BLEND_HW3))
|
||||
{
|
||||
m_conf.ps.blend_hw = static_cast<u8>(HWBlendType::SRC_DOUBLE);
|
||||
}
|
||||
|
||||
if (m_conf.ps.blend_c == 2 && (m_conf.ps.blend_hw == static_cast<u8>(HWBlendType::SRC_ALPHA_DST_FACTOR)
|
||||
|| m_conf.ps.blend_hw == static_cast<u8>(HWBlendType::SRC_HALF_ONE_DST_FACTOR)
|
||||
|| m_conf.blend_second_pass.blend_hw == static_cast<u8>(HWBlendType::SRC_ALPHA_DST_FACTOR)))
|
||||
|| m_conf.blend_multi_pass.blend_hw == static_cast<u8>(HWBlendType::SRC_ALPHA_DST_FACTOR)))
|
||||
{
|
||||
m_conf.cb_ps.TA_MaxDepth_Af.a = static_cast<float>(AFIX) / 128.0f;
|
||||
}
|
||||
|
||||
const GSDevice::BlendFactor src_factor_alpha = m_conf.blend_second_pass.enable ? GSDevice::CONST_ZERO : GSDevice::CONST_ONE;
|
||||
const GSDevice::BlendFactor dst_factor_alpha = m_conf.blend_second_pass.enable ? GSDevice::CONST_ONE : GSDevice::CONST_ZERO;
|
||||
const GSDevice::BlendFactor src_factor_alpha = m_conf.blend_multi_pass.enable ? GSDevice::CONST_ZERO : GSDevice::CONST_ONE;
|
||||
const GSDevice::BlendFactor dst_factor_alpha = m_conf.blend_multi_pass.enable ? GSDevice::CONST_ONE : GSDevice::CONST_ZERO;
|
||||
m_conf.blend = {true, blend.src, blend.dst, blend.op, src_factor_alpha, dst_factor_alpha, m_conf.ps.blend_c == 2, AFIX};
|
||||
|
||||
// Remove second color output when unused. Works around bugs in some drivers (e.g. Intel).
|
||||
m_conf.ps.no_color1 = !GSDevice::IsDualSourceBlendFactor(m_conf.blend.src_factor) &&
|
||||
!GSDevice::IsDualSourceBlendFactor(m_conf.blend.dst_factor) &&
|
||||
!GSDevice::IsDualSourceBlendFactor(m_conf.blend_second_pass.blend.src_factor) &&
|
||||
!GSDevice::IsDualSourceBlendFactor(m_conf.blend_second_pass.blend.dst_factor);
|
||||
!GSDevice::IsDualSourceBlendFactor(m_conf.blend_multi_pass.blend.src_factor) &&
|
||||
!GSDevice::IsDualSourceBlendFactor(m_conf.blend_multi_pass.blend.dst_factor);
|
||||
}
|
||||
|
||||
// Notify the shader that it needs to invert rounding
|
||||
@@ -5959,10 +5959,10 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_conf.blend_second_pass.enable)
|
||||
if (m_conf.blend_multi_pass.enable)
|
||||
{
|
||||
m_conf.blend_second_pass.blend.src_factor_alpha = GSDevice::SRC1_ALPHA;
|
||||
m_conf.blend_second_pass.blend.dst_factor_alpha = GSDevice::INV_SRC1_ALPHA;
|
||||
m_conf.blend_multi_pass.blend.src_factor_alpha = GSDevice::SRC1_ALPHA;
|
||||
m_conf.blend_multi_pass.blend.dst_factor_alpha = GSDevice::INV_SRC1_ALPHA;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6106,7 +6106,7 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
|
||||
|
||||
m_conf.ps.fba = m_context->FBA.FBA;
|
||||
|
||||
if (m_conf.ps.dither || m_conf.blend_second_pass.dither)
|
||||
if (m_conf.ps.dither || m_conf.blend_multi_pass.dither)
|
||||
{
|
||||
const GIFRegDIMX& DIMX = m_draw_env->DIMX;
|
||||
GL_DBG("DITHERING mode %d (%d)", (GSConfig.Dithering == 3) ? "Force 32bit" : ((GSConfig.Dithering == 0) ? "Disabled" : "Enabled"), GSConfig.Dithering);
|
||||
@@ -6122,7 +6122,7 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
|
||||
else if (GSConfig.Dithering > 2)
|
||||
{
|
||||
m_conf.ps.dither = GSConfig.Dithering;
|
||||
m_conf.blend_second_pass.dither = GSConfig.Dithering;
|
||||
m_conf.blend_multi_pass.dither = GSConfig.Dithering;
|
||||
}
|
||||
|
||||
if (PRIM->FGE)
|
||||
|
||||
@@ -6305,16 +6305,17 @@ void GSTextureCache::Target::Update(bool cannot_scale)
|
||||
m_rt_alpha_scale = true;
|
||||
}
|
||||
|
||||
ShaderConvert depth_shader = upscaled ? ShaderConvert::RGBA8_TO_FLOAT32_BILN : ShaderConvert::RGBA8_TO_FLOAT32;
|
||||
const bool linear = upscaled && GSConfig.UserHacks_BilinearHack != GSBilinearDirtyMode::ForceNearest;
|
||||
ShaderConvert depth_shader = linear ? ShaderConvert::RGBA8_TO_FLOAT32_BILN : ShaderConvert::RGBA8_TO_FLOAT32;
|
||||
if (m_type == DepthStencil && GSLocalMemory::m_psm[m_TEX0.PSM].trbpp != 32)
|
||||
{
|
||||
switch (GSLocalMemory::m_psm[m_TEX0.PSM].trbpp)
|
||||
{
|
||||
case 24:
|
||||
depth_shader = upscaled ? ShaderConvert::RGBA8_TO_FLOAT24_BILN : ShaderConvert::RGBA8_TO_FLOAT24;
|
||||
depth_shader = linear ? ShaderConvert::RGBA8_TO_FLOAT24_BILN : ShaderConvert::RGBA8_TO_FLOAT24;
|
||||
break;
|
||||
case 16:
|
||||
depth_shader = upscaled ? ShaderConvert::RGB5A1_TO_FLOAT16_BILN : ShaderConvert::RGB5A1_TO_FLOAT16;
|
||||
depth_shader = linear ? ShaderConvert::RGB5A1_TO_FLOAT16_BILN : ShaderConvert::RGB5A1_TO_FLOAT16;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -2088,9 +2088,9 @@ bool GSDeviceOGL::CreateImGuiProgram()
|
||||
glEnableVertexAttribArray(0);
|
||||
glEnableVertexAttribArray(1);
|
||||
glEnableVertexAttribArray(2);
|
||||
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid*)IM_OFFSETOF(ImDrawVert, pos));
|
||||
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid*)IM_OFFSETOF(ImDrawVert, uv));
|
||||
glVertexAttribPointer(2, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ImDrawVert), (GLvoid*)IM_OFFSETOF(ImDrawVert, col));
|
||||
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid*)offsetof(ImDrawVert, pos));
|
||||
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid*)offsetof(ImDrawVert, uv));
|
||||
glVertexAttribPointer(2, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ImDrawVert), (GLvoid*)offsetof(ImDrawVert, col));
|
||||
|
||||
glBindVertexArray(GLState::vao);
|
||||
return true;
|
||||
@@ -2612,21 +2612,21 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
|
||||
|
||||
SendHWDraw(config, psel.ps.IsFeedbackLoop());
|
||||
|
||||
if (config.blend_second_pass.enable)
|
||||
if (config.blend_multi_pass.enable)
|
||||
{
|
||||
if (config.blend.IsEffective(config.colormask))
|
||||
{
|
||||
OMSetBlendState(config.blend_second_pass.blend.enable, s_gl_blend_factors[config.blend_second_pass.blend.src_factor],
|
||||
s_gl_blend_factors[config.blend_second_pass.blend.dst_factor], s_gl_blend_ops[config.blend_second_pass.blend.op],
|
||||
s_gl_blend_factors[config.blend_second_pass.blend.src_factor_alpha], s_gl_blend_factors[config.blend_second_pass.blend.dst_factor_alpha],
|
||||
config.blend_second_pass.blend.constant_enable, config.blend_second_pass.blend.constant);
|
||||
OMSetBlendState(config.blend_multi_pass.blend.enable, s_gl_blend_factors[config.blend_multi_pass.blend.src_factor],
|
||||
s_gl_blend_factors[config.blend_multi_pass.blend.dst_factor], s_gl_blend_ops[config.blend_multi_pass.blend.op],
|
||||
s_gl_blend_factors[config.blend_multi_pass.blend.src_factor_alpha], s_gl_blend_factors[config.blend_multi_pass.blend.dst_factor_alpha],
|
||||
config.blend_multi_pass.blend.constant_enable, config.blend_multi_pass.blend.constant);
|
||||
}
|
||||
else
|
||||
{
|
||||
OMSetBlendState();
|
||||
}
|
||||
psel.ps.blend_hw = config.blend_second_pass.blend_hw;
|
||||
psel.ps.dither = config.blend_second_pass.dither;
|
||||
psel.ps.blend_hw = config.blend_multi_pass.blend_hw;
|
||||
psel.ps.dither = config.blend_multi_pass.dither;
|
||||
SetupPipeline(psel);
|
||||
SendHWDraw(config, psel.ps.IsFeedbackLoop());
|
||||
}
|
||||
|
||||
@@ -5826,14 +5826,14 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config)
|
||||
SendHWDraw(config, draw_rt, config.require_one_barrier, config.require_full_barrier, skip_first_barrier);
|
||||
|
||||
// blend second pass
|
||||
if (config.blend_second_pass.enable)
|
||||
if (config.blend_multi_pass.enable)
|
||||
{
|
||||
if (config.blend_second_pass.blend.constant_enable)
|
||||
SetBlendConstants(config.blend_second_pass.blend.constant);
|
||||
if (config.blend_multi_pass.blend.constant_enable)
|
||||
SetBlendConstants(config.blend_multi_pass.blend.constant);
|
||||
|
||||
pipe.bs = config.blend_second_pass.blend;
|
||||
pipe.ps.blend_hw = config.blend_second_pass.blend_hw;
|
||||
pipe.ps.dither = config.blend_second_pass.dither;
|
||||
pipe.bs = config.blend_multi_pass.blend;
|
||||
pipe.ps.blend_hw = config.blend_multi_pass.blend_hw;
|
||||
pipe.ps.dither = config.blend_multi_pass.dither;
|
||||
if (BindDrawPipeline(pipe))
|
||||
{
|
||||
// TODO: This probably should have barriers, in case we want to use it conditionally.
|
||||
|
||||
@@ -81,6 +81,7 @@ namespace
|
||||
#define FSUI_FSTR(str) fmt::runtime(Host::TranslateToStringView(TR_CONTEXT, str))
|
||||
#define FSUI_NSTR(str) str
|
||||
|
||||
using ImGuiFullscreen::FocusResetType;
|
||||
using ImGuiFullscreen::g_large_font;
|
||||
using ImGuiFullscreen::g_layout_padding_left;
|
||||
using ImGuiFullscreen::g_layout_padding_top;
|
||||
@@ -134,6 +135,7 @@ using ImGuiFullscreen::ForceKeyNavEnabled;
|
||||
using ImGuiFullscreen::GetCachedTexture;
|
||||
using ImGuiFullscreen::GetCachedTextureAsync;
|
||||
using ImGuiFullscreen::GetPlaceholderTexture;
|
||||
using ImGuiFullscreen::GetQueuedFocusResetType;
|
||||
using ImGuiFullscreen::HorizontalMenuItem;
|
||||
using ImGuiFullscreen::IsFocusResetQueued;
|
||||
using ImGuiFullscreen::IsGamepadInputSource;
|
||||
@@ -655,7 +657,7 @@ void FullscreenUI::OnVMStarted()
|
||||
return;
|
||||
|
||||
s_current_main_window = MainWindowType::None;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -723,7 +725,7 @@ void FullscreenUI::OpenPauseMenu()
|
||||
ForceKeyNavEnabled();
|
||||
s_current_main_window = MainWindowType::PauseMenu;
|
||||
s_current_pause_submenu = PauseSubMenu::None;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -738,14 +740,14 @@ void FullscreenUI::ClosePauseMenu()
|
||||
s_current_main_window = MainWindowType::None;
|
||||
s_current_pause_submenu = PauseSubMenu::None;
|
||||
s_pause_menu_was_open = false;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
void FullscreenUI::OpenPauseSubMenu(PauseSubMenu submenu)
|
||||
{
|
||||
s_current_main_window = MainWindowType::PauseMenu;
|
||||
s_current_pause_submenu = submenu;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
void FullscreenUI::Shutdown(bool clear_state)
|
||||
@@ -901,7 +903,7 @@ void FullscreenUI::ReturnToPreviousWindow()
|
||||
if (VMManager::HasValidVM() && s_pause_menu_was_open)
|
||||
{
|
||||
s_current_main_window = MainWindowType::PauseMenu;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -976,7 +978,6 @@ void FullscreenUI::DoStartFile()
|
||||
if (!path.empty())
|
||||
DoStartPath(path);
|
||||
|
||||
QueueResetFocus();
|
||||
CloseFileSelector();
|
||||
};
|
||||
|
||||
@@ -1040,7 +1041,6 @@ void FullscreenUI::DoStartDisc()
|
||||
FSUI_ICONSTR(ICON_FA_COMPACT_DISC, "Select Disc Drive"), false, std::move(options), [](s32, const std::string& path, bool) {
|
||||
DoStartDisc(path);
|
||||
CloseChoiceDialog();
|
||||
QueueResetFocus();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1115,7 +1115,6 @@ void FullscreenUI::DoChangeDiscFromFile()
|
||||
}
|
||||
}
|
||||
|
||||
QueueResetFocus();
|
||||
CloseFileSelector();
|
||||
ReturnToPreviousWindow();
|
||||
ClosePauseMenu();
|
||||
@@ -1170,7 +1169,7 @@ void FullscreenUI::ConfirmShutdownIfMemcardBusy(std::function<void(bool)> callba
|
||||
void FullscreenUI::SwitchToLanding()
|
||||
{
|
||||
s_current_main_window = MainWindowType::Landing;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
void FullscreenUI::DrawLandingTemplate(ImVec2* menu_pos, ImVec2* menu_size)
|
||||
@@ -1267,7 +1266,7 @@ void FullscreenUI::DrawLandingWindow()
|
||||
FSUI_CSTR("Launch a game from a file, disc, or starts the console without any disc inserted.")))
|
||||
{
|
||||
s_current_main_window = MainWindowType::StartGame;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
if (HorizontalMenuItem(GetCachedTexture("fullscreenui/applications-system.png"), FSUI_CSTR("Settings"),
|
||||
@@ -1281,7 +1280,7 @@ void FullscreenUI::DrawLandingWindow()
|
||||
(!AreAnyDialogsOpen() && WantsToCloseMenu()))
|
||||
{
|
||||
s_current_main_window = MainWindowType::Exit;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
}
|
||||
EndHorizontalMenu();
|
||||
@@ -1349,7 +1348,7 @@ void FullscreenUI::DrawStartGameWindow()
|
||||
(!AreAnyDialogsOpen() && WantsToCloseMenu()))
|
||||
{
|
||||
s_current_main_window = MainWindowType::Landing;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
}
|
||||
EndHorizontalMenu();
|
||||
@@ -1395,7 +1394,7 @@ void FullscreenUI::DrawExitWindow()
|
||||
WantsToCloseMenu())
|
||||
{
|
||||
s_current_main_window = MainWindowType::Landing;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
if (HorizontalMenuItem(GetCachedTexture("fullscreenui/exit.png"), FSUI_CSTR("Exit PCSX2"),
|
||||
@@ -2701,7 +2700,7 @@ void FullscreenUI::SwitchToGameSettings(const std::string_view serial, u32 crc)
|
||||
PopulatePatchesAndCheatsList(serial, crc);
|
||||
s_current_main_window = MainWindowType::Settings;
|
||||
s_settings_page = SettingsPage::Summary;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
void FullscreenUI::SwitchToGameSettings()
|
||||
@@ -2844,7 +2843,7 @@ void FullscreenUI::DrawSettingsWindow()
|
||||
{
|
||||
index = (index == 0) ? (count - 1) : (index - 1);
|
||||
s_settings_page = pages[index];
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
else if (ImGui::IsKeyPressed(ImGuiKey_GamepadDpadRight, true) ||
|
||||
ImGui::IsKeyPressed(ImGuiKey_NavGamepadTweakFast, true) ||
|
||||
@@ -2852,7 +2851,7 @@ void FullscreenUI::DrawSettingsWindow()
|
||||
{
|
||||
index = (index + 1) % count;
|
||||
s_settings_page = pages[index];
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2876,6 +2875,7 @@ void FullscreenUI::DrawSettingsWindow()
|
||||
if (NavButton(icons[i], i == index, true, ITEM_WIDTH, LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY))
|
||||
{
|
||||
s_settings_page = pages[i];
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2886,7 +2886,12 @@ void FullscreenUI::DrawSettingsWindow()
|
||||
|
||||
// we have to do this here, because otherwise it uses target, and jumps a frame later.
|
||||
if (IsFocusResetQueued())
|
||||
ImGui::SetNextWindowScroll(ImVec2(0.0f, 0.0f));
|
||||
if (FocusResetType focus_reset = GetQueuedFocusResetType(); focus_reset != FocusResetType::None &&
|
||||
focus_reset != FocusResetType::PopupOpened &&
|
||||
focus_reset != FocusResetType::PopupClosed)
|
||||
{
|
||||
ImGui::SetNextWindowScroll(ImVec2(0.0f, 0.0f));
|
||||
}
|
||||
|
||||
if (BeginFullscreenWindow(
|
||||
ImVec2(0.0f, heading_size.y),
|
||||
@@ -3046,7 +3051,7 @@ void FullscreenUI::DrawSummarySettingsPage()
|
||||
}
|
||||
}
|
||||
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::PopupClosed);
|
||||
CloseFileSelector();
|
||||
};
|
||||
|
||||
@@ -5370,7 +5375,7 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_ChildBg, ModAlpha(UIPrimaryColor, 0.9f));
|
||||
|
||||
if (ImGui::BeginChild("state_titlebar", heading_size, false, ImGuiWindowFlags_NavFlattened))
|
||||
if (ImGui::BeginChild("state_titlebar", heading_size, ImGuiChildFlags_NavFlattened, 0))
|
||||
{
|
||||
BeginNavBar();
|
||||
if (NavButton(ICON_PF_BACKWARD, true, true))
|
||||
@@ -5391,7 +5396,7 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
|
||||
bool close_handled = false;
|
||||
if (s_save_state_selector_open &&
|
||||
ImGui::BeginChild("state_list", ImVec2(io.DisplaySize.x, io.DisplaySize.y - LayoutScale(LAYOUT_FOOTER_HEIGHT) - heading_size.y),
|
||||
false, ImGuiWindowFlags_NavFlattened))
|
||||
ImGuiChildFlags_NavFlattened, 0))
|
||||
{
|
||||
BeginMenuButtons();
|
||||
|
||||
@@ -5517,7 +5522,7 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
|
||||
{
|
||||
s_save_state_selector_submenu_index = -1;
|
||||
if (!closed)
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(4);
|
||||
@@ -5900,7 +5905,7 @@ void FullscreenUI::DrawGameListWindow()
|
||||
else if (ImGui::IsKeyPressed(ImGuiKey_GamepadStart, false) || ImGui::IsKeyPressed(ImGuiKey_F2))
|
||||
{
|
||||
s_current_main_window = MainWindowType::GameListSettings;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
switch (s_game_list_view)
|
||||
@@ -6318,7 +6323,7 @@ void FullscreenUI::DrawGameListSettingsWindow()
|
||||
if (NavButton(ICON_PF_BACKWARD, true, true))
|
||||
{
|
||||
s_current_main_window = MainWindowType::GameList;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
NavTitle(FSUI_CSTR("Game List Settings"));
|
||||
@@ -6339,7 +6344,7 @@ void FullscreenUI::DrawGameListSettingsWindow()
|
||||
if (ImGui::IsWindowFocused() && WantsToCloseMenu())
|
||||
{
|
||||
s_current_main_window = MainWindowType::GameList;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
auto lock = Host::GetSettingsLock();
|
||||
@@ -6495,7 +6500,7 @@ void FullscreenUI::SwitchToGameList()
|
||||
auto lock = Host::GetSettingsLock();
|
||||
PopulateGameListDirectoryCache(Host::Internal::GetBaseSettingsLayer());
|
||||
}
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
GSTexture* FullscreenUI::GetGameListCover(const GameList::Entry* entry)
|
||||
@@ -6665,7 +6670,7 @@ void FullscreenUI::SwitchToAchievementsWindow()
|
||||
}
|
||||
|
||||
s_current_main_window = MainWindowType::Achievements;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
bool FullscreenUI::OpenLeaderboardsWindow()
|
||||
@@ -6709,7 +6714,7 @@ void FullscreenUI::SwitchToLeaderboardsWindow()
|
||||
}
|
||||
|
||||
s_current_main_window = MainWindowType::Leaderboards;
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::WindowChanged);
|
||||
}
|
||||
|
||||
void FullscreenUI::DrawAchievementsSettingsPage(std::unique_lock<std::mutex>& settings_lock)
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace ImGuiFullscreen
|
||||
|
||||
static u32 s_menu_button_index = 0;
|
||||
static u32 s_close_button_state = 0;
|
||||
static bool s_focus_reset_queued = false;
|
||||
static FocusResetType s_focus_reset_queued = FocusResetType::None;
|
||||
static bool s_light_theme = false;
|
||||
|
||||
static LRUCache<std::string, std::shared_ptr<GSTexture>> s_texture_cache(128, true);
|
||||
@@ -204,7 +204,7 @@ void ImGuiFullscreen::SetFonts(ImFont* standard_font, ImFont* medium_font, ImFon
|
||||
|
||||
bool ImGuiFullscreen::Initialize(const char* placeholder_image_path)
|
||||
{
|
||||
s_focus_reset_queued = true;
|
||||
s_focus_reset_queued = FocusResetType::WindowChanged;
|
||||
s_close_button_state = 0;
|
||||
|
||||
s_placeholder_texture = LoadTexture(placeholder_image_path);
|
||||
@@ -552,22 +552,22 @@ void ImGuiFullscreen::PopResetLayout()
|
||||
ImGui::PopStyleVar(12);
|
||||
}
|
||||
|
||||
void ImGuiFullscreen::QueueResetFocus()
|
||||
void ImGuiFullscreen::QueueResetFocus(FocusResetType type)
|
||||
{
|
||||
s_focus_reset_queued = true;
|
||||
s_focus_reset_queued = type;
|
||||
s_close_button_state = 0;
|
||||
}
|
||||
|
||||
bool ImGuiFullscreen::ResetFocusHere()
|
||||
{
|
||||
if (!s_focus_reset_queued)
|
||||
if (s_focus_reset_queued == FocusResetType::None)
|
||||
return false;
|
||||
|
||||
// don't take focus from dialogs
|
||||
if (ImGui::FindBlockingModal(ImGui::GetCurrentWindow()))
|
||||
return false;
|
||||
|
||||
s_focus_reset_queued = false;
|
||||
s_focus_reset_queued = FocusResetType::None;
|
||||
ImGui::SetWindowFocus();
|
||||
|
||||
// only do the active selection magic when we're using keyboard/gamepad
|
||||
@@ -575,6 +575,11 @@ bool ImGuiFullscreen::ResetFocusHere()
|
||||
}
|
||||
|
||||
bool ImGuiFullscreen::IsFocusResetQueued()
|
||||
{
|
||||
return (s_focus_reset_queued != FocusResetType::None);
|
||||
}
|
||||
|
||||
ImGuiFullscreen::FocusResetType ImGuiFullscreen::GetQueuedFocusResetType()
|
||||
{
|
||||
return s_focus_reset_queued;
|
||||
}
|
||||
@@ -590,6 +595,9 @@ void ImGuiFullscreen::ForceKeyNavEnabled()
|
||||
|
||||
bool ImGuiFullscreen::WantsToCloseMenu()
|
||||
{
|
||||
// Used for the key macros below.
|
||||
ImGuiContext& g = *ImGui::GetCurrentContext();
|
||||
|
||||
// Wait for the Close button to be released, THEN pressed
|
||||
if (s_close_button_state == 0)
|
||||
{
|
||||
@@ -679,7 +687,7 @@ bool ImGuiFullscreen::BeginFullscreenColumnWindow(float start, float end, const
|
||||
|
||||
ImGui::SetCursorPos(pos);
|
||||
|
||||
return ImGui::BeginChild(name, size, false, ImGuiWindowFlags_NavFlattened);
|
||||
return ImGui::BeginChild(name, size, ImGuiChildFlags_NavFlattened, 0);
|
||||
}
|
||||
|
||||
void ImGuiFullscreen::EndFullscreenColumnWindow()
|
||||
@@ -1080,12 +1088,21 @@ bool ImGuiFullscreen::MenuHeadingButton(
|
||||
}
|
||||
|
||||
bool ImGuiFullscreen::ActiveButton(const char* title, bool is_active, bool enabled, float height, ImFont* font)
|
||||
{
|
||||
return ActiveButtonWithRightText(title, nullptr, is_active, enabled, height, font);
|
||||
}
|
||||
|
||||
bool ImGuiFullscreen::ActiveButtonWithRightText(const char* title, const char* right_title, bool is_active,
|
||||
bool enabled, float height, ImFont* font)
|
||||
{
|
||||
if (is_active)
|
||||
{
|
||||
// don't draw over a prerendered border
|
||||
const float border_size = ImGui::GetStyle().FrameBorderSize;
|
||||
const ImVec2 border_size_v = ImVec2(border_size, border_size);
|
||||
ImVec2 pos, size;
|
||||
GetMenuButtonFrameBounds(height, &pos, &size);
|
||||
ImGui::RenderFrame(pos, pos + size, ImGui::GetColorU32(UIPrimaryColor), false);
|
||||
ImGui::RenderFrame(pos + border_size_v, pos + size - border_size_v, ImGui::GetColorU32(UIPrimaryColor), false);
|
||||
}
|
||||
|
||||
ImRect bb;
|
||||
@@ -1101,6 +1118,16 @@ bool ImGuiFullscreen::ActiveButton(const char* title, bool is_active, bool enabl
|
||||
|
||||
ImGui::PushFont(font);
|
||||
ImGui::RenderTextClipped(title_bb.Min, title_bb.Max, title, nullptr, nullptr, ImVec2(0.0f, 0.0f), &title_bb);
|
||||
|
||||
|
||||
if (right_title && *right_title)
|
||||
{
|
||||
const ImVec2 right_text_size = font->CalcTextSizeA(font->FontSize, title_bb.GetWidth(), 0.0f, right_title);
|
||||
const ImVec2 right_text_start = ImVec2(title_bb.Max.x - right_text_size.x, title_bb.Min.y);
|
||||
ImGui::RenderTextClipped(right_text_start, title_bb.Max, right_title, nullptr, &right_text_size, ImVec2(0.0f, 0.0f),
|
||||
&title_bb);
|
||||
}
|
||||
|
||||
ImGui::PopFont();
|
||||
|
||||
if (!enabled)
|
||||
@@ -1921,7 +1948,7 @@ void ImGuiFullscreen::OpenFileSelector(std::string_view title, bool select_direc
|
||||
s_file_selector_filters = std::move(filters);
|
||||
|
||||
SetFileSelectorDirectory(std::move(initial_directory));
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::PopupOpened);
|
||||
}
|
||||
|
||||
void ImGuiFullscreen::CloseFileSelector()
|
||||
@@ -1937,7 +1964,7 @@ void ImGuiFullscreen::CloseFileSelector()
|
||||
std::string().swap(s_file_selector_current_directory);
|
||||
s_file_selector_items.clear();
|
||||
ImGui::CloseCurrentPopup();
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::PopupClosed);
|
||||
}
|
||||
|
||||
void ImGuiFullscreen::DrawFileSelector()
|
||||
@@ -1972,8 +1999,8 @@ void ImGuiFullscreen::DrawFileSelector()
|
||||
|
||||
if (!s_file_selector_current_directory.empty())
|
||||
{
|
||||
MenuButton(fmt::format(ICON_FA_FOLDER_OPEN " {}", s_file_selector_current_directory).c_str(), nullptr, false,
|
||||
LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY);
|
||||
MenuButton(SmallString::from_format(ICON_FA_FOLDER_OPEN " {}", s_file_selector_current_directory).c_str(),
|
||||
nullptr, false, LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY);
|
||||
}
|
||||
|
||||
if (s_file_selector_directory && !s_file_selector_current_directory.empty())
|
||||
@@ -2011,7 +2038,7 @@ void ImGuiFullscreen::DrawFileSelector()
|
||||
if (selected->is_file)
|
||||
{
|
||||
s_file_selector_callback(selected->full_path);
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::Other);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2036,7 +2063,7 @@ void ImGuiFullscreen::DrawFileSelector()
|
||||
" <Parent Directory>")
|
||||
{
|
||||
SetFileSelectorDirectory(std::move(s_file_selector_items.front().full_path));
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::Other);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2057,7 +2084,7 @@ void ImGuiFullscreen::OpenChoiceDialog(std::string_view title, bool checkable, C
|
||||
s_choice_dialog_title = fmt::format("{}##choice_dialog", title);
|
||||
s_choice_dialog_options = std::move(options);
|
||||
s_choice_dialog_callback = std::move(callback);
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::PopupOpened);
|
||||
}
|
||||
|
||||
void ImGuiFullscreen::CloseChoiceDialog()
|
||||
@@ -2070,7 +2097,7 @@ void ImGuiFullscreen::CloseChoiceDialog()
|
||||
std::string().swap(s_choice_dialog_title);
|
||||
ChoiceDialogOptions().swap(s_choice_dialog_options);
|
||||
ChoiceDialogCallback().swap(s_choice_dialog_callback);
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::PopupClosed);
|
||||
}
|
||||
|
||||
void ImGuiFullscreen::DrawChoiceDialog()
|
||||
@@ -2113,7 +2140,8 @@ void ImGuiFullscreen::DrawChoiceDialog()
|
||||
{
|
||||
auto& option = s_choice_dialog_options[i];
|
||||
|
||||
const std::string title(fmt::format("{0} {1}", option.second ? ICON_FA_CHECK_SQUARE : ICON_FA_SQUARE, option.first));
|
||||
const SmallString title =
|
||||
SmallString::from_format("{0} {1}", option.second ? ICON_FA_CHECK_SQUARE : ICON_FA_SQUARE, option.first);
|
||||
if (MenuButton(title.c_str(), nullptr, true, LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY))
|
||||
{
|
||||
choice = i;
|
||||
@@ -2131,7 +2159,8 @@ void ImGuiFullscreen::DrawChoiceDialog()
|
||||
title += ICON_FA_CHECK " ";
|
||||
title += option.first;
|
||||
|
||||
if (ActiveButton(title.c_str(), option.second, true, LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY))
|
||||
if (ActiveButtonWithRightText(option.first.c_str(), option.second ? ICON_FA_CHECK : nullptr, option.second,
|
||||
true, LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY))
|
||||
{
|
||||
choice = i;
|
||||
for (s32 j = 0; j < static_cast<s32>(s_choice_dialog_options.size()); j++)
|
||||
@@ -2187,7 +2216,7 @@ void ImGuiFullscreen::OpenInputStringDialog(
|
||||
s_input_dialog_caption = std::move(caption);
|
||||
s_input_dialog_ok_text = std::move(ok_button_text);
|
||||
s_input_dialog_callback = std::move(callback);
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::PopupOpened);
|
||||
}
|
||||
|
||||
void ImGuiFullscreen::DrawInputDialog()
|
||||
@@ -2296,7 +2325,7 @@ void ImGuiFullscreen::OpenConfirmMessageDialog(
|
||||
s_message_dialog_callback = std::move(callback);
|
||||
s_message_dialog_buttons[0] = std::move(yes_button_text);
|
||||
s_message_dialog_buttons[1] = std::move(no_button_text);
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::PopupOpened);
|
||||
}
|
||||
|
||||
void ImGuiFullscreen::OpenInfoMessageDialog(
|
||||
@@ -2309,7 +2338,7 @@ void ImGuiFullscreen::OpenInfoMessageDialog(
|
||||
s_message_dialog_message = std::move(message);
|
||||
s_message_dialog_callback = std::move(callback);
|
||||
s_message_dialog_buttons[0] = std::move(button_text);
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::PopupOpened);
|
||||
}
|
||||
|
||||
void ImGuiFullscreen::OpenMessageDialog(std::string title, std::string message, MessageDialogCallback callback,
|
||||
@@ -2324,7 +2353,7 @@ void ImGuiFullscreen::OpenMessageDialog(std::string title, std::string message,
|
||||
s_message_dialog_buttons[0] = std::move(first_button_text);
|
||||
s_message_dialog_buttons[1] = std::move(second_button_text);
|
||||
s_message_dialog_buttons[2] = std::move(third_button_text);
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::PopupOpened);
|
||||
}
|
||||
|
||||
void ImGuiFullscreen::CloseMessageDialog()
|
||||
@@ -2337,7 +2366,7 @@ void ImGuiFullscreen::CloseMessageDialog()
|
||||
s_message_dialog_message = {};
|
||||
s_message_dialog_buttons = {};
|
||||
s_message_dialog_callback = {};
|
||||
QueueResetFocus();
|
||||
QueueResetFocus(FocusResetType::PopupClosed);
|
||||
}
|
||||
|
||||
void ImGuiFullscreen::DrawMessageDialog()
|
||||
|
||||
@@ -112,9 +112,18 @@ namespace ImGuiFullscreen
|
||||
void PushResetLayout();
|
||||
void PopResetLayout();
|
||||
|
||||
void QueueResetFocus();
|
||||
enum class FocusResetType : u8
|
||||
{
|
||||
None,
|
||||
PopupOpened,
|
||||
PopupClosed,
|
||||
WindowChanged,
|
||||
Other,
|
||||
};
|
||||
void QueueResetFocus(FocusResetType type);
|
||||
bool ResetFocusHere();
|
||||
bool IsFocusResetQueued();
|
||||
FocusResetType GetQueuedFocusResetType();
|
||||
void ForceKeyNavEnabled();
|
||||
|
||||
bool WantsToCloseMenu();
|
||||
@@ -158,6 +167,8 @@ namespace ImGuiFullscreen
|
||||
bool MenuHeadingButton(const char* title, const char* value = nullptr, bool enabled = true, bool draw_line = true);
|
||||
bool ActiveButton(const char* title, bool is_active, bool enabled = true, float height = LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY,
|
||||
ImFont* font = g_large_font);
|
||||
bool ActiveButtonWithRightText(const char* title, const char* right_title, bool is_active, bool enabled = true,
|
||||
float height = LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY, ImFont* font = g_large_font);
|
||||
bool MenuButton(const char* title, const char* summary, bool enabled = true, float height = LAYOUT_MENU_BUTTON_HEIGHT,
|
||||
ImFont* font = g_large_font, ImFont* summary_font = g_medium_font);
|
||||
bool MenuButtonWithoutSummary(const char* title, bool enabled = true, float height = LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY,
|
||||
|
||||
@@ -335,9 +335,9 @@ void ImGuiManager::SetStyle()
|
||||
colors[ImGuiCol_ResizeGripActive] = ImVec4(0.27f, 0.32f, 0.38f, 1.00f);
|
||||
colors[ImGuiCol_Tab] = ImVec4(0.11f, 0.15f, 0.17f, 1.00f);
|
||||
colors[ImGuiCol_TabHovered] = ImVec4(0.33f, 0.38f, 0.46f, 1.00f);
|
||||
colors[ImGuiCol_TabActive] = ImVec4(0.27f, 0.32f, 0.38f, 1.00f);
|
||||
colors[ImGuiCol_TabUnfocused] = ImVec4(0.11f, 0.15f, 0.17f, 1.00f);
|
||||
colors[ImGuiCol_TabUnfocusedActive] = ImVec4(0.11f, 0.15f, 0.17f, 1.00f);
|
||||
colors[ImGuiCol_TabSelected] = ImVec4(0.27f, 0.32f, 0.38f, 1.00f);
|
||||
colors[ImGuiCol_TabDimmed] = ImVec4(0.11f, 0.15f, 0.17f, 1.00f);
|
||||
colors[ImGuiCol_TabDimmedSelected] = ImVec4(0.11f, 0.15f, 0.17f, 1.00f);
|
||||
colors[ImGuiCol_PlotLines] = ImVec4(0.61f, 0.61f, 0.61f, 1.00f);
|
||||
colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f);
|
||||
colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2002-2024 PCSX2 Dev Team
|
||||
// SPDX-License-Identifier: GPL-3.0+
|
||||
|
||||
#include "common/CocoaTools.h"
|
||||
#include "common/FileSystem.h"
|
||||
#include "common/Path.h"
|
||||
#include "common/SettingsInterface.h"
|
||||
@@ -1859,7 +1860,15 @@ void Pcsx2Config::ClearInvalidPerGameConfiguration(SettingsInterface* si)
|
||||
|
||||
void EmuFolders::SetAppRoot()
|
||||
{
|
||||
const std::string program_path = FileSystem::GetProgramPath();
|
||||
std::string program_path = FileSystem::GetProgramPath();
|
||||
#ifdef __APPLE__
|
||||
const auto bundle_path = CocoaTools::GetNonTranslocatedBundlePath();
|
||||
if (bundle_path.has_value())
|
||||
{
|
||||
// On macOS, override with the bundle path if launched from a bundle.
|
||||
program_path = bundle_path.value();
|
||||
}
|
||||
#endif
|
||||
Console.WriteLnFmt("Program Path: {}", program_path);
|
||||
|
||||
AppRoot = Path::Canonicalize(Path::GetDirectory(program_path));
|
||||
@@ -1870,12 +1879,17 @@ void EmuFolders::SetAppRoot()
|
||||
|
||||
bool EmuFolders::SetResourcesDirectory()
|
||||
{
|
||||
#ifndef __APPLE__
|
||||
// On Windows/Linux, these are in the binary directory.
|
||||
Resources = Path::Combine(AppRoot, "resources");
|
||||
#ifndef __APPLE__
|
||||
#ifndef PCSX2_APP_DATADIR
|
||||
// On Windows/Linux, these are in the binary directory.
|
||||
Resources = Path::Combine(AppRoot, "resources");
|
||||
#else
|
||||
Resources = Path::Canonicalize(Path::Combine(AppRoot, PCSX2_APP_DATADIR "/resources"));
|
||||
#endif
|
||||
#else
|
||||
// On macOS, this is in the bundle resources directory.
|
||||
Resources = Path::Canonicalize(Path::Combine(AppRoot, "../Resources"));
|
||||
const std::string program_path = FileSystem::GetProgramPath();
|
||||
Resources = Path::Canonicalize(Path::Combine(Path::GetDirectory(program_path), "../Resources"));
|
||||
#endif
|
||||
|
||||
Console.WriteLnFmt("Resources Directory: {}", Resources);
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
/// Version number for GS and other shaders. Increment whenever any of the contents of the
|
||||
/// shaders change, to invalidate the cache.
|
||||
static constexpr u32 SHADER_CACHE_VERSION = 54;
|
||||
static constexpr u32 SHADER_CACHE_VERSION = 55;
|
||||
|
||||
@@ -367,14 +367,14 @@ namespace usb_eyetoy
|
||||
break;
|
||||
}
|
||||
|
||||
static const unsigned int max_ep_size = 960; // 961
|
||||
static const unsigned int max_ep_size = 961;
|
||||
u8 data[max_ep_size];
|
||||
pxAssert(p->buffer_size <= max_ep_size);
|
||||
|
||||
static constexpr const u8 header[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28}; // 28 <> 29
|
||||
std::memcpy(data, header, sizeof(header));
|
||||
|
||||
const u32 data_pk = std::min(p->buffer_size - static_cast<u32>(sizeof(header)), s->mpeg_frame_size);
|
||||
const u32 data_pk = std::min(p->buffer_size - 1 - static_cast<u32>(sizeof(header)), s->mpeg_frame_size);
|
||||
std::memcpy(data + sizeof(header), s->mpeg_frame_data.get(), data_pk);
|
||||
usb_packet_copy(p, data, sizeof(header) + data_pk);
|
||||
|
||||
@@ -383,7 +383,7 @@ namespace usb_eyetoy
|
||||
}
|
||||
else if (s->mpeg_frame_offset < s->mpeg_frame_size)
|
||||
{
|
||||
const u32 data_pk = std::min(s->mpeg_frame_size - s->mpeg_frame_offset, p->buffer_size);
|
||||
const u32 data_pk = std::min(s->mpeg_frame_size - s->mpeg_frame_offset, p->buffer_size - 1);
|
||||
usb_packet_copy(p, s->mpeg_frame_data.get() + s->mpeg_frame_offset, data_pk);
|
||||
|
||||
s->mpeg_frame_offset += data_pk;
|
||||
|
||||
@@ -1108,7 +1108,37 @@ namespace usb_msd
|
||||
{
|
||||
MSDState* s = new MSDState();
|
||||
|
||||
std::string path(USB::GetConfigString(si, port, TypeName(), "ImagePath"));
|
||||
std::string path;
|
||||
s->dev.speed = USB_SPEED_FULL;
|
||||
s->desc.full = &s->desc_dev;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case IOMEGA_ZIP_100:
|
||||
path = USB::GetConfigString(si, port, TypeName(), "ImagePathMsd");
|
||||
s->desc.str = zip100_desc_strings;
|
||||
if (usb_desc_parse_dev(zip100_dev_descriptor, sizeof(zip100_dev_descriptor), s->desc, s->desc_dev) < 0)
|
||||
goto fail;
|
||||
if (usb_desc_parse_config(zip100_config_descriptor, sizeof(zip100_config_descriptor), s->desc_dev) < 0)
|
||||
goto fail;
|
||||
s->dev.klass.handle_control = usb_msd_handle_control;
|
||||
s->dev.klass.handle_data = usb_msd_handle_data;
|
||||
break;
|
||||
case SONY_MSAC_US1:
|
||||
path = USB::GetConfigString(si, port, TypeName(), "ImagePathMsac");
|
||||
s->desc.str = sony_msac_desc_strings;
|
||||
if (usb_desc_parse_dev(sony_msac_dev_descriptor, sizeof(sony_msac_dev_descriptor), s->desc, s->desc_dev) < 0)
|
||||
goto fail;
|
||||
if (usb_desc_parse_config(sony_msac_config_descriptor, sizeof(sony_msac_config_descriptor), s->desc_dev) < 0)
|
||||
goto fail;
|
||||
s->dev.klass.handle_control = usb_msac_handle_control;
|
||||
s->dev.klass.handle_data = usb_msac_handle_data;
|
||||
break;
|
||||
default:
|
||||
pxAssertMsg(false, "Unhandled type");
|
||||
break;
|
||||
}
|
||||
|
||||
if (path.empty() || !(s->file = FileSystem::OpenCFile(path.c_str(), "r+b")))
|
||||
{
|
||||
Host::AddOSDMessage(fmt::format(TRANSLATE_FS("USB", "usb-msd: Could not open image file '{}'"), path),
|
||||
@@ -1123,33 +1153,6 @@ namespace usb_msd
|
||||
s->file_size = sd.Size;
|
||||
s->f.mtime = sd.ModificationTime;
|
||||
s->f.last_cmd = -1;
|
||||
s->dev.speed = USB_SPEED_FULL;
|
||||
s->desc.full = &s->desc_dev;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case IOMEGA_ZIP_100:
|
||||
s->desc.str = zip100_desc_strings;
|
||||
if (usb_desc_parse_dev(zip100_dev_descriptor, sizeof(zip100_dev_descriptor), s->desc, s->desc_dev) < 0)
|
||||
goto fail;
|
||||
if (usb_desc_parse_config(zip100_config_descriptor, sizeof(zip100_config_descriptor), s->desc_dev) < 0)
|
||||
goto fail;
|
||||
s->dev.klass.handle_control = usb_msd_handle_control;
|
||||
s->dev.klass.handle_data = usb_msd_handle_data;
|
||||
break;
|
||||
case SONY_MSAC_US1:
|
||||
s->desc.str = sony_msac_desc_strings;
|
||||
if (usb_desc_parse_dev(sony_msac_dev_descriptor, sizeof(sony_msac_dev_descriptor), s->desc, s->desc_dev) < 0)
|
||||
goto fail;
|
||||
if (usb_desc_parse_config(sony_msac_config_descriptor, sizeof(sony_msac_config_descriptor), s->desc_dev) < 0)
|
||||
goto fail;
|
||||
s->dev.klass.handle_control = usb_msac_handle_control;
|
||||
s->dev.klass.handle_data = usb_msac_handle_data;
|
||||
break;
|
||||
default:
|
||||
pxAssertMsg(false, "Unhandled type");
|
||||
break;
|
||||
}
|
||||
|
||||
s->dev.klass.cancel_packet = usb_msd_cancel_io;
|
||||
s->dev.klass.handle_attach = usb_desc_attach;
|
||||
@@ -1221,10 +1224,26 @@ namespace usb_msd
|
||||
|
||||
std::span<const SettingInfo> MsdDevice::Settings(u32 subtype) const
|
||||
{
|
||||
static constexpr const SettingInfo settings[] = {
|
||||
{SettingInfo::Type::Path, "ImagePath", TRANSLATE_NOOP("USB", "Image Path"),
|
||||
TRANSLATE_NOOP("USB", "Sets the path to image which will back the virtual mass storage device.")},
|
||||
};
|
||||
return settings;
|
||||
switch (subtype)
|
||||
{
|
||||
case IOMEGA_ZIP_100:
|
||||
{
|
||||
static constexpr const SettingInfo settings[] = {
|
||||
{SettingInfo::Type::Path, "ImagePathMsd", TRANSLATE_NOOP("USB", "Image Path"),
|
||||
TRANSLATE_NOOP("USB", "Sets the path to image which will back the virtual mass storage device.")},
|
||||
};
|
||||
return settings;
|
||||
}
|
||||
case SONY_MSAC_US1:
|
||||
{
|
||||
static constexpr const SettingInfo settings[] = {
|
||||
{SettingInfo::Type::Path, "ImagePathMsac", TRANSLATE_NOOP("USB", "Image Path"),
|
||||
TRANSLATE_NOOP("USB", "Sets the path to image which will back the virtual mass storage device.")},
|
||||
};
|
||||
return settings;
|
||||
}
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
}
|
||||
} // namespace usb_msd
|
||||
|
||||
@@ -133,7 +133,8 @@ namespace usb_pad
|
||||
{
|
||||
case USB_DT_REPORT:
|
||||
ret = sizeof(hid_report_descriptor);
|
||||
memcpy(data, hid_report_descriptor, ret);
|
||||
std::memcpy(data, hid_report_descriptor, ret);
|
||||
p->actual_length = ret;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -166,7 +166,8 @@ namespace usb_pad
|
||||
{
|
||||
case USB_DT_REPORT:
|
||||
ret = sizeof(hid_report_descriptor);
|
||||
memcpy(data, hid_report_descriptor, ret);
|
||||
std::memcpy(data, hid_report_descriptor, ret);
|
||||
p->actual_length = ret;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -216,7 +216,8 @@ namespace usb_pad
|
||||
{
|
||||
case USB_DT_REPORT:
|
||||
ret = sizeof(hid_report_descriptor);
|
||||
memcpy(data, hid_report_descriptor, ret);
|
||||
std::memcpy(data, hid_report_descriptor, ret);
|
||||
p->actual_length = ret;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace usb_pad
|
||||
{
|
||||
case USB_DT_REPORT:
|
||||
ret = sizeof(hid_report_descriptor);
|
||||
memcpy(data, hid_report_descriptor, ret);
|
||||
std::memcpy(data, hid_report_descriptor, ret);
|
||||
p->actual_length = ret;
|
||||
break;
|
||||
default:
|
||||
@@ -308,7 +308,6 @@ namespace usb_pad
|
||||
if (length > 0)
|
||||
{
|
||||
p->actual_length = 0;
|
||||
//p->status = USB_RET_SUCCESS;
|
||||
}
|
||||
break;
|
||||
case SET_IDLE:
|
||||
|
||||
Reference in New Issue
Block a user