Compare commits

...

5 Commits

Author SHA1 Message Date
TheLastRar
d3effdb176 CI/Windows: Use LLVM 19 with MSBuild and CMake
Now using the Chocolatey install of LLVM
2025-01-09 15:46:34 +01:00
JordanTheToaster
d7e1350b95 CI/Windows: Use Windows Server 2025 2025-01-09 15:46:34 +01:00
PCSX2 Bot
14ac653e45 [ci skip] Qt: Update Base Translation. 2025-01-09 15:45:02 +01:00
spixi
a5e4274cd2 common: Add support for MATE Desktop. (#12174)
This extends the screensaver inhibition function to MATE Desktop,
2025-01-09 15:07:09 +01:00
Ty Lamontagne
16b1095a7b EE Cache: Shrink tag size by 4 bytes 2025-01-08 18:34:30 -05:00
5 changed files with 104 additions and 58 deletions

View File

@@ -13,7 +13,7 @@ jobs:
lint_vs_proj_files:
name: Lint VS Project Files
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
runs-on: windows-2019
runs-on: windows-2025
steps:
- name: Checkout Repository
uses: actions/checkout@v4

View File

@@ -12,7 +12,7 @@ on:
os:
required: false
type: string
default: windows-2022
default: windows-2025
platform:
required: false
type: string
@@ -55,13 +55,31 @@ jobs:
POWERSHELL_TELEMETRY_OPTOUT: 1
steps:
- name: Tempfix Clang
if: inputs.configuration == 'CMake'
run: choco uninstall llvm
- name: Checkout Repository
uses: actions/checkout@v4
- name: Configure MSBuild Clang Version
if: inputs.configuration != 'CMake'
shell: pwsh
run: |
[string[]] $clang_cl = &clang-cl.exe --version
$version = [Regex]::Match($clang_cl[0], "(\d+\.\d+\.\d+)")
$path = $clang_cl[3].TrimStart("InstalledDir: ").TrimEnd("\bin")
$output = @"
<Project>
<PropertyGroup>
<LLVMInstallDir>$path</LLVMInstallDir>
<LLVMToolsVersion>$version</LLVMToolsVersion>
</PropertyGroup>
</Project>
"@
Write-Host $output
$output | Out-File Directory.build.props
# actions/checkout elides tags, fetch them primarily for releases
- name: Fetch Tags
if: ${{ inputs.fetchTags }}

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2002-2024 PCSX2 Dev Team
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "common/Pcsx2Types.h"
@@ -22,6 +22,8 @@
#include <sys/wait.h>
#include <unistd.h>
#include <dbus/dbus.h>
#include <cstdlib>
#include <cstring>
// Returns 0 on failure (not supported by the operating system).
u64 GetPhysicalMemory()
@@ -101,6 +103,7 @@ static bool SetScreensaverInhibitDBus(const bool inhibit_requested, const char*
DBusMessage* message = nullptr;
DBusMessage* response = nullptr;
DBusMessageIter message_itr;
char* desktop_session = nullptr;
ScopedGuard cleanup = [&]() {
if (dbus_error_is_set(&error_dbus))
@@ -122,7 +125,17 @@ static bool SetScreensaverInhibitDBus(const bool inhibit_requested, const char*
s_cookie = 0;
s_comparison_connection = connection;
}
message = dbus_message_new_method_call("org.freedesktop.ScreenSaver", "/org/freedesktop/ScreenSaver", "org.freedesktop.ScreenSaver", bus_method);
desktop_session = std::getenv("DESKTOP_SESSION");
if (desktop_session && std::strncmp(desktop_session, "mate", 4) == 0)
{
message = dbus_message_new_method_call("org.mate.ScreenSaver", "/org/mate/ScreenSaver", "org.mate.ScreenSaver", bus_method);
}
else
{
message = dbus_message_new_method_call("org.freedesktop.ScreenSaver", "/org/freedesktop/ScreenSaver", "org.freedesktop.ScreenSaver", bus_method);
}
if (!message)
return false;
// Initialize an append iterator for the message, gets freed with the message.

View File

@@ -18195,12 +18195,12 @@ Ejecting {3} and replacing it with {2}.</source>
<context>
<name>Patch</name>
<message>
<location filename="../../pcsx2/Patch.cpp" line="350"/>
<location filename="../../pcsx2/Patch.cpp" line="352"/>
<source>Failed to open {}. Built-in game patches are not available.</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location filename="../../pcsx2/Patch.cpp" line="726"/>
<location filename="../../pcsx2/Patch.cpp" line="760"/>
<source>%n GameDB patches are active.</source>
<comment>OSD Message</comment>
<translation type="unfinished">
@@ -18209,7 +18209,7 @@ Ejecting {3} and replacing it with {2}.</source>
</translation>
</message>
<message numerus="yes">
<location filename="../../pcsx2/Patch.cpp" line="733"/>
<location filename="../../pcsx2/Patch.cpp" line="767"/>
<source>%n game patches are active.</source>
<comment>OSD Message</comment>
<translation type="unfinished">
@@ -18218,7 +18218,7 @@ Ejecting {3} and replacing it with {2}.</source>
</translation>
</message>
<message numerus="yes">
<location filename="../../pcsx2/Patch.cpp" line="740"/>
<location filename="../../pcsx2/Patch.cpp" line="774"/>
<source>%n cheat patches are active.</source>
<comment>OSD Message</comment>
<translation type="unfinished">
@@ -18227,7 +18227,7 @@ Ejecting {3} and replacing it with {2}.</source>
</translation>
</message>
<message>
<location filename="../../pcsx2/Patch.cpp" line="755"/>
<location filename="../../pcsx2/Patch.cpp" line="789"/>
<source>No cheats or patches (widescreen, compatibility or others) are found / enabled.</source>
<translation type="unfinished"></translation>
</message>
@@ -21827,177 +21827,177 @@ Error was: {}</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3054"/>
<location filename="../../pcsx2/VMManager.cpp" line="3055"/>
<source>Cheats have been disabled due to achievements hardcore mode.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3107"/>
<location filename="../../pcsx2/VMManager.cpp" line="3108"/>
<source>Fast CDVD is enabled, this may break games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3111"/>
<location filename="../../pcsx2/VMManager.cpp" line="3112"/>
<source>Cycle rate/skip is not at default, this may crash or make games run too slow.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3121"/>
<location filename="../../pcsx2/VMManager.cpp" line="3122"/>
<source>Upscale multiplier is below native, this will break rendering.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3161"/>
<location filename="../../pcsx2/VMManager.cpp" line="3162"/>
<source>Mipmapping is disabled. This may break rendering in some games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3170"/>
<location filename="../../pcsx2/VMManager.cpp" line="3171"/>
<source>Renderer is not set to Automatic. This may cause performance problems and graphical issues.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3176"/>
<location filename="../../pcsx2/VMManager.cpp" line="3177"/>
<source>Texture filtering is not set to Bilinear (PS2). This will break rendering in some games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3639"/>
<location filename="../../pcsx2/VMManager.cpp" line="3640"/>
<source>No Game Running</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3126"/>
<location filename="../../pcsx2/VMManager.cpp" line="3127"/>
<source>Trilinear filtering is not set to automatic. This may break rendering in some games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3131"/>
<location filename="../../pcsx2/VMManager.cpp" line="3132"/>
<source>Blending Accuracy is below Basic, this may break effects in some games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3136"/>
<location filename="../../pcsx2/VMManager.cpp" line="3137"/>
<source>Hardware Download Mode is not set to Accurate, this may break rendering in some games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3182"/>
<location filename="../../pcsx2/VMManager.cpp" line="3183"/>
<source>EE FPU Round Mode is not set to default, this may break some games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3188"/>
<location filename="../../pcsx2/VMManager.cpp" line="3189"/>
<source>EE FPU Clamp Mode is not set to default, this may break some games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3193"/>
<location filename="../../pcsx2/VMManager.cpp" line="3194"/>
<source>VU0 Round Mode is not set to default, this may break some games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3198"/>
<location filename="../../pcsx2/VMManager.cpp" line="3199"/>
<source>VU1 Round Mode is not set to default, this may break some games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3205"/>
<location filename="../../pcsx2/VMManager.cpp" line="3206"/>
<source>VU Clamp Mode is not set to default, this may break some games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3210"/>
<location filename="../../pcsx2/VMManager.cpp" line="3211"/>
<source>128MB RAM is enabled. Compatibility with some games may be affected.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3215"/>
<location filename="../../pcsx2/VMManager.cpp" line="3216"/>
<source>Game Fixes are not enabled. Compatibility with some games may be affected.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3220"/>
<location filename="../../pcsx2/VMManager.cpp" line="3221"/>
<source>Compatibility Patches are not enabled. Compatibility with some games may be affected.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3224"/>
<location filename="../../pcsx2/VMManager.cpp" line="3225"/>
<source>Frame rate for NTSC is not default. This may break some games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3226"/>
<location filename="../../pcsx2/VMManager.cpp" line="3227"/>
<source>Frame rate for PAL is not default. This may break some games.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3245"/>
<location filename="../../pcsx2/VMManager.cpp" line="3246"/>
<source>EE Recompiler is not enabled, this will significantly reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3250"/>
<location filename="../../pcsx2/VMManager.cpp" line="3251"/>
<source>VU0 Recompiler is not enabled, this will significantly reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3255"/>
<location filename="../../pcsx2/VMManager.cpp" line="3256"/>
<source>VU1 Recompiler is not enabled, this will significantly reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3260"/>
<location filename="../../pcsx2/VMManager.cpp" line="3261"/>
<source>IOP Recompiler is not enabled, this will significantly reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3265"/>
<location filename="../../pcsx2/VMManager.cpp" line="3266"/>
<source>EE Cache is enabled, this will significantly reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3270"/>
<location filename="../../pcsx2/VMManager.cpp" line="3271"/>
<source>EE Wait Loop Detection is not enabled, this may reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3275"/>
<location filename="../../pcsx2/VMManager.cpp" line="3276"/>
<source>INTC Spin Detection is not enabled, this may reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3278"/>
<location filename="../../pcsx2/VMManager.cpp" line="3279"/>
<source>Fastmem is not enabled, this will reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3282"/>
<location filename="../../pcsx2/VMManager.cpp" line="3283"/>
<source>Instant VU1 is disabled, this may reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3287"/>
<location filename="../../pcsx2/VMManager.cpp" line="3288"/>
<source>mVU Flag Hack is not enabled, this may reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3141"/>
<location filename="../../pcsx2/VMManager.cpp" line="3142"/>
<source>GPU Palette Conversion is enabled, this may reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3146"/>
<location filename="../../pcsx2/VMManager.cpp" line="3147"/>
<source>Texture Preloading is not Full, this may reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3151"/>
<location filename="../../pcsx2/VMManager.cpp" line="3152"/>
<source>Estimate texture region is enabled, this may reduce performance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/VMManager.cpp" line="3156"/>
<location filename="../../pcsx2/VMManager.cpp" line="3157"/>
<source>Texture dumping is enabled, this will continually dump textures to disk.</source>
<translation type="unfinished"></translation>
</message>

View File

@@ -23,10 +23,11 @@ namespace
// When this happens, the cache still fills with the data and when it gets evicted the data is lost.
// We don't emulate memory access on a logic level, so we need to ensure that we don't try to load/store to a non-existant physical address.
// This fixes the Find My Own Way demo.
bool validPFN = true;
// The lower parts of a cache tags structure is as follows:
// 31 - 12: The physical address cache tag.
// 11 - 7: Unused.
// 11: Used by PCSX2 to indicate if the physical address is valid.
// 10 - 7: Unused.
// 6: Dirty flag.
// 5: Valid flag.
// 4: LRF flag - least recently filled flag.
@@ -39,7 +40,8 @@ namespace
VALID_FLAG = 0x20,
LRF_FLAG = 0x10,
LOCK_FLAG = 0x8,
ALL_FLAGS = 0xFFF
ALL_FLAGS = 0x7FF,
ALL_BITS = 0xFFF
};
int flags() const
@@ -65,23 +67,36 @@ namespace
void clearLocked() { rawValue &= ~LOCK_FLAG; }
void toggleLRF() { rawValue ^= LRF_FLAG; }
uptr addr() const { return rawValue & ~ALL_FLAGS; }
uptr addr() const { return rawValue & ~ALL_BITS; }
void setAddr(uptr addr)
{
rawValue &= ALL_FLAGS;
rawValue |= (addr & ~ALL_FLAGS);
rawValue &= ALL_BITS;
rawValue |= (addr & ~ALL_BITS);
}
bool matches(uptr other) const
{
return isValid() && addr() == (other & ~ALL_FLAGS);
return isValid() && addr() == (other & ~ALL_BITS);
}
void clear()
{
rawValue &= LRF_FLAG;
}
constexpr bool isValidPFN() const
{
return rawValue & 0x800;
}
constexpr void setValidPFN(bool valid)
{
if (valid)
rawValue |= 0x800;
else
rawValue &= ~0x800;
}
};
struct CacheLine
@@ -103,7 +118,7 @@ namespace
uptr target = addr();
CACHE_LOG("Write back at %zx", target);
if (tag.validPFN)
if (tag.isValidPFN())
*reinterpret_cast<CacheData*>(target) = data;
tag.clearDirty();
}
@@ -113,7 +128,7 @@ namespace
pxAssertMsg(!tag.isDirtyAndValid(), "Loaded a value into cache without writing back the old one!");
tag.setAddr(ppf);
if (!tag.validPFN)
if (!tag.isValidPFN())
{
// Reading from invalid physical addresses seems to return 0 on hardware
std::memset(&data, 0, sizeof(data));
@@ -238,7 +253,7 @@ static int getFreeCache(u32 mem, int* way, bool validPFN)
CacheLine line = cache.lineAt(setIdx, newWay);
line.writeBackIfNeeded();
line.tag.validPFN = validPFN;
line.tag.setValidPFN(validPFN);
line.load(ppf);
line.tag.toggleLRF();
}