Compare commits

...

10 Commits

Author SHA1 Message Date
lightningterror
98cdd3446b GS/HW: Properly check PABE with source alpha for blends that check for PABE. 2025-03-06 19:18:29 +01:00
lightningterror
9bcbf43695 GS/HW: Check if pabe sw is actually enabled for ate second pass.
No need to check for PABE if it's not enabled on sw blend.
In fact on ICO flag is enabled even if ABE is disabled which is pointless.
2025-03-06 19:18:29 +01:00
TheLastRar
e3c988aa8b FileSystem: Improve handling of relative paths in RealPath() 2025-03-06 13:08:32 -05:00
TheLastRar
06be543d32 FileSystem: Don't pass file access mode into GetWin32Path() 2025-03-06 13:08:32 -05:00
Ty
1fd22dcc1c Windows: Make PCSX2 long path aware 2025-03-04 09:14:25 -05:00
refractionpcsx2
e3afdde981 GSDumpRunner: Fix compilation 2025-03-04 13:28:42 +00:00
lightningterror
698df49e5e Qt: Fix -Wsign-compare warnings. 2025-03-04 13:29:13 +01:00
TheLastRar
ff5c90ec5e SDLInputSource: Correct joystick types 2025-03-04 05:07:56 +01:00
TheLastRar
1e075d23b2 Input: Fix warnings 2025-03-04 05:07:56 +01:00
PCSX2 Bot
2b172903b9 [ci skip] Qt: Update Base Translation. 2025-03-04 01:04:44 +01:00
10 changed files with 948 additions and 926 deletions

View File

@@ -288,8 +288,14 @@ std::string Path::RealPath(const std::string_view path)
{
// Resolve non-absolute paths first.
std::vector<std::string_view> components;
// We need to keep the full combined path in scope
// as SplitNativePath() returns string_views to it.
std::string buf;
if (!IsAbsolute(path))
components = Path::SplitNativePath(Path::Combine(FileSystem::GetWorkingDirectory(), path));
{
buf = Path::Combine(FileSystem::GetWorkingDirectory(), path);
components = Path::SplitNativePath(buf);
}
else
components = Path::SplitNativePath(path);
@@ -968,7 +974,7 @@ std::FILE* FileSystem::OpenCFile(const char* filename, const char* mode, Error*
{
#ifdef _WIN32
const std::wstring wfilename = GetWin32Path(filename);
const std::wstring wmode = GetWin32Path(mode);
const std::wstring wmode = StringUtil::UTF8StringToWideString(mode);
if (!wfilename.empty() && !wmode.empty())
{
std::FILE* fp;
@@ -1060,7 +1066,7 @@ std::FILE* FileSystem::OpenSharedCFile(const char* filename, const char* mode, F
{
#ifdef _WIN32
const std::wstring wfilename = GetWin32Path(filename);
const std::wstring wmode = GetWin32Path(mode);
const std::wstring wmode = StringUtil::UTF8StringToWideString(mode);
if (wfilename.empty() || wmode.empty())
return nullptr;

View File

@@ -169,6 +169,12 @@ void Host::SetDefaultUISettings(SettingsInterface& si)
// nothing
}
bool Host::LocaleCircleConfirm()
{
// not running any UI, so no settings requests will come in
return false;
}
std::unique_ptr<ProgressCallback> Host::CreateHostProgressCallback()
{
return ProgressCallback::CreateNullProgressCallback();

View File

@@ -375,7 +375,7 @@ void InputBindingDialog::ReloadBindNames()
{
m_bindings_ui.clear();
m_bindings_ui.reserve(m_bindings_settings.size());
for (int i = 0; i < m_bindings_settings.size(); i++)
for (size_t i = 0; i < m_bindings_settings.size(); i++)
{
SmallString binding{std::string_view{m_bindings_settings[i]}};
InputManager::PrettifyInputBinding(binding, false);

View File

@@ -264,7 +264,7 @@ void InputBindingWidget::reloadBinding()
m_bindings_ui.clear();
m_bindings_ui.reserve(m_bindings_settings.size());
for (int i = 0; i < m_bindings_settings.size(); i++)
for (size_t i = 0; i < m_bindings_settings.size(); i++)
{
SmallString binding{std::string_view{m_bindings_settings[i]}};
InputManager::PrettifyInputBinding(binding, false);

File diff suppressed because it is too large Load Diff

View File

@@ -4205,14 +4205,14 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
const bool AA1 = PRIM->AA1 && (m_vt.m_primclass == GS_LINE_CLASS || m_vt.m_primclass == GS_TRIANGLE_CLASS);
// PABE: Check condition early as an optimization, no blending when As < 128.
// For Cs*As + Cd*(1 - As) if As is 128 then blending can be disabled as well.
const bool PABE = PRIM->ABE && m_draw_env->PABE.PABE &&
const bool PABE_skip = PRIM->ABE && m_draw_env->PABE.PABE &&
((GetAlphaMinMax().max < 128) || (GetAlphaMinMax().max == 128 && ALPHA.A == 0 && ALPHA.B == 1 && ALPHA.C == 0 && ALPHA.D == 1));
// FBMASK: Color is not written, no need to do blending.
const u32 temp_fbmask = m_conf.ps.dst_fmt == GSLocalMemory::PSM_FMT_16 ? 0x00F8F8F8 : 0x00FFFFFF;
const bool FBMASK = (m_cached_ctx.FRAME.FBMSK & temp_fbmask) == temp_fbmask;
const bool FBMASK_skip = (m_cached_ctx.FRAME.FBMSK & temp_fbmask) == temp_fbmask;
// No blending or coverage anti-aliasing so early exit
if (FBMASK || PABE || !(PRIM->ABE || AA1))
if (FBMASK_skip || PABE_skip || !(PRIM->ABE || AA1))
{
m_conf.blend = {};
m_conf.ps.no_color1 = true;
@@ -4374,11 +4374,14 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
// HW blend can handle Cd output.
bool color_dest_blend = !!(blend_flag & BLEND_CD);
// Per pixel alpha blending.
const bool PABE = m_draw_env->PABE.PABE && GetAlphaMinMax().min < 128;
// HW blend can handle it, no need for sw or hdr colclip, Cd*Alpha or Cd*(1 - Alpha) where Alpha <= 128.
bool color_dest_blend2 = !m_draw_env->PABE.PABE && ((m_conf.ps.blend_a == 1 && m_conf.ps.blend_b == 2 && m_conf.ps.blend_d == 2) || (m_conf.ps.blend_a == 2 && m_conf.ps.blend_b == 1 && m_conf.ps.blend_d == 1)) &&
bool color_dest_blend2 = !PABE && ((m_conf.ps.blend_a == 1 && m_conf.ps.blend_b == 2 && m_conf.ps.blend_d == 2) || (m_conf.ps.blend_a == 2 && m_conf.ps.blend_b == 1 && m_conf.ps.blend_d == 1)) &&
(alpha_eq_less_one || (alpha_c1_eq_less_max_one && new_rt_alpha_scale));
// HW blend can handle it, no need for sw or hdr colclip, Cs*Alpha + Cd*(1 - Alpha) or Cd*Alpha + Cs*(1 - Alpha) where Alpha <= 128.
bool blend_zero_to_one_range = !m_draw_env->PABE.PABE && ((m_conf.ps.blend_a == 0 && m_conf.ps.blend_b == 1 && m_conf.ps.blend_d == 1) || (blend_flag & BLEND_MIX3)) &&
bool blend_zero_to_one_range = !PABE && ((m_conf.ps.blend_a == 0 && m_conf.ps.blend_b == 1 && m_conf.ps.blend_d == 1) || (blend_flag & BLEND_MIX3)) &&
(alpha_eq_less_one || (alpha_c1_eq_less_max_one && new_rt_alpha_scale));
// Do the multiplication in shader for blending accumulation: Cs*As + Cd or Cs*Af + Cd
@@ -4597,7 +4600,7 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
}
// Per pixel alpha blending
if (m_draw_env->PABE.PABE && GetAlphaMinMax().min < 128)
if (PABE)
{
// Breath of Fire Dragon Quarter, Strawberry Shortcake, Super Robot Wars, Cartoon Network Racing, Simple 2000 Series Vol.81, SOTC.
@@ -4627,7 +4630,7 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
// HDR mode should be disabled when doing sw blend, swap with sw colclip.
if (m_conf.ps.hdr)
{
bool has_HDR_texture = g_gs_device->GetHDRTexture() != nullptr;
const bool has_HDR_texture = g_gs_device->GetHDRTexture() != nullptr;
m_conf.ps.hdr = 0;
m_conf.ps.colclip = 1;
m_conf.hdr_mode = has_HDR_texture ? GSHWDrawConfig::HDRMode::EarlyResolve : GSHWDrawConfig::HDRMode::NoModify;
@@ -6490,7 +6493,7 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
if (ate_second_pass)
{
pxAssert(!env.PABE.PABE);
pxAssert(!m_conf.ps.pabe);
std::memcpy(&m_conf.alpha_second_pass.ps, &m_conf.ps, sizeof(m_conf.ps));
std::memcpy(&m_conf.alpha_second_pass.colormask, &m_conf.colormask, sizeof(m_conf.colormask));

View File

@@ -284,11 +284,13 @@ TinyString InputManager::ConvertKeyboardKeyToString(InputBindingKey key, bool di
{
const std::optional<std::string> str(ConvertHostKeyboardCodeToString(key.data));
if (str.has_value() && !str->empty())
{
if (display)
// Keyboard keys arn't spaced out for display yet
ret.format("Keyboard {}", str->c_str());
else
ret.format("Keyboard/{}", str->c_str());
}
}
return ret;
@@ -320,7 +322,7 @@ TinyString InputManager::ConvertPointerKeyToString(InputBindingKey key, bool dis
else if (key.source_subtype == InputSubclass::PointerAxis)
{
if (display)
ret.format("Pointer-{} {}{:c}", u32{key.source_index}, s_pointer_axis_setting_names[key.data],
ret.format("Pointer-{} {}{:c}", u32{key.source_index}, s_pointer_axis_names[key.data],
key.modifier == InputModifier::Negate ? '-' : '+');
else
ret.format("Pointer-{}/{}{:c}", u32{key.source_index}, s_pointer_axis_setting_names[key.data],
@@ -608,7 +610,7 @@ void InputManager::AddBindings(const std::vector<std::string>& bindings, const I
std::vector<std::string> new_bindings;
new_bindings.reserve(bindings.size());
for (int i = 0; i < bindings.size(); i++)
for (size_t i = 0; i < bindings.size(); i++)
{
if (ibindings[i])
new_bindings.push_back(ConvertInputBindingKeysToString(binding_type, ibindings[i]->keys, ibindings[i]->num_keys, true));
@@ -627,7 +629,7 @@ void InputManager::AddBindings(const std::vector<std::string>& bindings, const I
{
// LayeredSettingsInterface, Need to find which layer our binding came from
LayeredSettingsInterface& lsi = static_cast<LayeredSettingsInterface&>(si);
for (int i = 0; i < LayeredSettingsInterface::NUM_LAYERS; i++)
for (u32 i = 0; i < LayeredSettingsInterface::NUM_LAYERS; i++)
{
SettingsInterface* layer = lsi.GetLayer(static_cast<LayeredSettingsInterface::Layer>(i));
if (layer && layer->GetStringList(section, key) == bindings)

View File

@@ -1047,15 +1047,15 @@ bool SDLInputSource::ProcessSDLEvent(const SDL_Event* event)
{
case SDL_EVENT_GAMEPAD_ADDED:
{
Console.WriteLn("SDLInputSource: Gamepad %d inserted", event->cdevice.which);
OpenDevice(event->cdevice.which, true);
Console.WriteLn("SDLInputSource: Gamepad %d inserted", event->gdevice.which);
OpenDevice(event->gdevice.which, true);
return true;
}
case SDL_EVENT_GAMEPAD_REMOVED:
{
Console.WriteLn("SDLInputSource: Gamepad %d removed", event->cdevice.which);
CloseDevice(event->cdevice.which);
Console.WriteLn("SDLInputSource: Gamepad %d removed", event->gdevice.which);
CloseDevice(event->gdevice.which);
return true;
}
@@ -1066,18 +1066,18 @@ bool SDLInputSource::ProcessSDLEvent(const SDL_Event* event)
return false;
Console.WriteLn("SDLInputSource: Joystick %d inserted", event->jdevice.which);
OpenDevice(event->cdevice.which, false);
OpenDevice(event->jdevice.which, false);
return true;
}
break;
case SDL_EVENT_JOYSTICK_REMOVED:
{
if (auto it = GetControllerDataForJoystickId(event->cdevice.which); it != m_controllers.end() && it->gamepad)
if (auto it = GetControllerDataForJoystickId(event->jdevice.which); it != m_controllers.end() && it->gamepad)
return false;
Console.WriteLn("SDLInputSource: Joystick %d removed", event->jdevice.which);
CloseDevice(event->cdevice.which);
CloseDevice(event->jdevice.which);
return true;
}
@@ -1119,7 +1119,7 @@ SDL_Joystick* SDLInputSource::GetJoystickForDevice(const std::string_view device
return it->joystick;
}
SDLInputSource::ControllerDataVector::iterator SDLInputSource::GetControllerDataForJoystickId(int id)
SDLInputSource::ControllerDataVector::iterator SDLInputSource::GetControllerDataForJoystickId(SDL_JoystickID id)
{
return std::find_if(m_controllers.begin(), m_controllers.end(), [id](const ControllerData& cd) { return cd.joystick_id == id; });
}
@@ -1146,7 +1146,7 @@ int SDLInputSource::GetFreePlayerId() const
return 0;
}
bool SDLInputSource::OpenDevice(int index, bool is_gamepad)
bool SDLInputSource::OpenDevice(SDL_JoystickID index, bool is_gamepad)
{
SDL_Gamepad* gamepad;
SDL_Joystick* joystick;
@@ -1327,7 +1327,7 @@ bool SDLInputSource::OpenDevice(int index, bool is_gamepad)
return true;
}
bool SDLInputSource::CloseDevice(int joystick_index)
bool SDLInputSource::CloseDevice(SDL_JoystickID joystick_index)
{
auto it = GetControllerDataForJoystickId(joystick_index);
if (it == m_controllers.end())

View File

@@ -74,12 +74,12 @@ private:
void LoadSettings(SettingsInterface& si);
void SetHints();
ControllerDataVector::iterator GetControllerDataForJoystickId(int id);
ControllerDataVector::iterator GetControllerDataForJoystickId(SDL_JoystickID id);
ControllerDataVector::iterator GetControllerDataForPlayerId(int id);
int GetFreePlayerId() const;
bool OpenDevice(int index, bool is_gamepad);
bool CloseDevice(int joystick_index);
bool OpenDevice(SDL_JoystickID index, bool is_gamepad);
bool CloseDevice(SDL_JoystickID joystick_index);
bool HandleGamepadAxisEvent(const SDL_GamepadAxisEvent* ev);
bool HandleGamepadButtonEvent(const SDL_GamepadButtonEvent* ev);
bool HandleJoystickAxisEvent(const SDL_JoyAxisEvent* ev);

View File

@@ -11,4 +11,9 @@
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</assembly>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<ws2:longPathAware>true</ws2:longPathAware>
</windowsSettings>
</application>
</assembly>