Skip to content

Commit

Permalink
Merge branch 'PCSX2:master' into block-jump
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek authored Jun 17, 2024
2 parents f91cb62 + d626028 commit aaedc5b
Show file tree
Hide file tree
Showing 18 changed files with 275 additions and 305 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/scripts/linux/appimage-qt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ declare -a MANUAL_QT_PLUGINS=(
"wayland-shell-integration"
)

declare -a REMOVE_LIBS=(
'libwayland-client.so*'
'libwayland-cursor.so*'
'libwayland-egl.so*'
)

set -e

LINUXDEPLOY=./linuxdeploy-x86_64.AppImage
Expand Down Expand Up @@ -158,6 +164,16 @@ for GROUP in "${MANUAL_QT_PLUGINS[@]}"; do
done
done

# Why do we have to manually remove these libs? Because the linuxdeploy Qt plugin
# copies them, not the "main" linuxdeploy binary, and plugins don't inherit the
# include list...
for lib in "${REMOVE_LIBS[@]}"; do
for libpath in $(find "$OUTDIR/usr/lib" -name "$lib"); do
echo " Removing problematic library ${libpath}."
rm -f "$libpath"
done
done

# Restore unstripped deps (for cache).
rm -fr "$DEPSDIR"
mv "$DEPSDIR.bak" "$DEPSDIR"
Expand Down
4 changes: 4 additions & 0 deletions pcsx2-qt/Settings/AdvancedSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsWindow* dialog, QWidget*
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu0Recompiler, "EmuCore/CPU/Recompiler", "EnableVU0", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vu1Recompiler, "EmuCore/CPU/Recompiler", "EnableVU1", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.vuFlagHack, "EmuCore/Speedhacks", "vuFlagHack", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.instantVU1, "EmuCore/Speedhacks", "vu1Instant", true);

SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.eeRoundingMode, "EmuCore/CPU", "FPU.Roundmode", static_cast<int>(FPRoundMode::ChopZero));
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.eeDivRoundingMode, "EmuCore/CPU", "FPUDiv.Roundmode", static_cast<int>(FPRoundMode::Nearest));
Expand Down Expand Up @@ -101,6 +102,9 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsWindow* dialog, QWidget*
dialog->registerWidgetHelp(m_ui.vu1ClampMode, tr("VU1 Clamping Mode"), tr("Normal (Default)"), tr("Changes how PCSX2 handles keeping floats in a standard x86 range in the Emotion Engine's Vector Unit 1 (EE VU1). "
"The default value handles the vast majority of games; <b>modifying this setting when a game is not having a visible problem can cause instability.</b>"));

dialog->registerWidgetHelp(m_ui.instantVU1, tr("Enable Instant VU1"), tr("Checked"), tr("Runs VU1 instantly. Provides a modest speed improvement in most games. "
"Safe for most games, but a few games may exhibit graphical errors."));

//: VU0 = Vector Unit 0. One of the PS2's processors.
dialog->registerWidgetHelp(m_ui.vu0Recompiler, tr("Enable VU0 Recompiler (Micro Mode)"), tr("Checked"), tr("Enables VU0 Recompiler."));

Expand Down
15 changes: 11 additions & 4 deletions pcsx2-qt/Settings/AdvancedSettingsWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>807</width>
<height>723</height>
<width>790</width>
<height>765</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand Down Expand Up @@ -202,7 +202,7 @@
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="extraMemory">
<property name="text">
<property name="text">
<string>Enable 128MB RAM (Dev Console)</string>
</property>
</widget>
Expand Down Expand Up @@ -272,6 +272,13 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="instantVU1">
<property name="text">
<string>Enable Instant VU1</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
Expand Down Expand Up @@ -494,7 +501,7 @@
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand Down
8 changes: 2 additions & 6 deletions pcsx2-qt/Settings/EmulationSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ EmulationSettingsWidget::EmulationSettingsWidget(SettingsWindow* dialog, QWidget
m_ui.optimalFramePacing->setTristate(dialog->isPerGameSettings());

SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.eeCycleSkipping, "EmuCore/Speedhacks", "EECycleSkip", DEFAULT_EE_CYCLE_SKIP);
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.affinityControl, "EmuCore/CPU", "AffinityControlMode", 0);

SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.MTVU, "EmuCore/Speedhacks", "vuThread", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.instantVU1, "EmuCore/Speedhacks", "vu1Instant", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.threadPinning, "EmuCore", "EnableThreadPinning", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.fastCDVD, "EmuCore/Speedhacks", "fastCDVD", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.precacheCDVD, "EmuCore", "CdvdPrecache", false);

Expand Down Expand Up @@ -113,16 +112,13 @@ EmulationSettingsWidget::EmulationSettingsWidget(SettingsWindow* dialog, QWidget
tr("Makes the emulated Emotion Engine skip cycles. "
//: SOTC = Shadow of the Colossus. A game's title, should not be translated unless an official translation exists.
"Helps a small subset of games like SOTC. Most of the time it's harmful to performance."));
dialog->registerWidgetHelp(m_ui.affinityControl, tr("Affinity Control"), tr("Disabled"),
dialog->registerWidgetHelp(m_ui.threadPinning, tr("Enable Thread Pinning"), tr("Unchecked"),
tr("Sets the priority for specific threads in a specific order ignoring the system scheduler. "
//: P-Core = Performance Core, E-Core = Efficiency Core. See if Intel has official translations for these terms.
"May help CPUs with big (P) and little (E) cores (e.g. Intel 12th or newer generation CPUs from Intel or other vendors such as AMD)."));
dialog->registerWidgetHelp(m_ui.MTVU, tr("Enable Multithreaded VU1 (MTVU1)"), tr("Checked"),
tr("Generally a speedup on CPUs with 4 or more cores. "
"Safe for most games, but a few are incompatible and may hang."));
dialog->registerWidgetHelp(m_ui.instantVU1, tr("Enable Instant VU1"), tr("Checked"),
tr("Runs VU1 instantly. Provides a modest speed improvement in most games. "
"Safe for most games, but a few games may exhibit graphical errors."));
dialog->registerWidgetHelp(m_ui.fastCDVD, tr("Enable Fast CDVD"), tr("Unchecked"),
tr("Fast disc access, less loading times. Check HDLoader compatibility lists for known games that have issues with this."));
dialog->registerWidgetHelp(m_ui.precacheCDVD, tr("Enable CDVD Precaching"), tr("Unchecked"),
Expand Down
170 changes: 62 additions & 108 deletions pcsx2-qt/Settings/EmulationSettingsWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -68,90 +68,6 @@
<string>System Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="3" column="0" colspan="2">
<layout class="QGridLayout" name="systemSettingsLayout">
<item row="0" column="1">
<widget class="QCheckBox" name="instantVU1">
<property name="text">
<string>Enable Instant VU1</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cheats">
<property name="text">
<string>Enable Cheats</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="MTVU">
<property name="text">
<string>Enable Multithreaded VU1 (MTVU)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="hostFilesystem">
<property name="text">
<string>Enable Host Filesystem</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="fastCDVD">
<property name="text">
<string>Enable Fast CDVD</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="precacheCDVD">
<property name="text">
<string>Enable CDVD Precaching</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>EE Cycle Skipping:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="eeCycleSkipping">
<item>
<property name="text">
<string>Disabled</string>
</property>
</item>
<item>
<property name="text">
<string>Mild Underclock</string>
</property>
</item>
<item>
<property name="text">
<string>Moderate Underclock</string>
</property>
</item>
<item>
<property name="text">
<string>Maximum Underclock</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>EE Cycle Rate:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="eeCycleRate">
<item>
Expand Down Expand Up @@ -191,50 +107,88 @@
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Affinity Control:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="affinityControl">
<item row="1" column="1">
<widget class="QComboBox" name="eeCycleSkipping">
<item>
<property name="text">
<string>Disabled</string>
</property>
</item>
<item>
<property name="text">
<string>EE &gt; VU &gt; GS</string>
<string>Mild Underclock</string>
</property>
</item>
<item>
<property name="text">
<string>EE &gt; GS &gt; VU</string>
<string>Moderate Underclock</string>
</property>
</item>
<item>
<property name="text">
<string>VU &gt; EE &gt; GS</string>
<string>Maximum Underclock</string>
</property>
</item>
<item>
<property name="text">
<string>VU &gt; GS &gt; EE</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<layout class="QGridLayout" name="systemSettingsLayout">
<item row="1" column="0">
<widget class="QCheckBox" name="cheats">
<property name="text">
<string>Enable Cheats</string>
</property>
</widget>
</item>
<item>
<property name="text">
<string>GS &gt; EE &gt; VU</string>
</property>
<item row="0" column="0">
<widget class="QCheckBox" name="MTVU">
<property name="text">
<string>Enable Multithreaded VU1 (MTVU)</string>
</property>
</widget>
</item>
<item>
<property name="text">
<string>GS &gt; VU &gt; EE</string>
</property>
<item row="1" column="1">
<widget class="QCheckBox" name="hostFilesystem">
<property name="text">
<string>Enable Host Filesystem</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="fastCDVD">
<property name="text">
<string>Enable Fast CDVD</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="precacheCDVD">
<property name="text">
<string>Enable CDVD Precaching</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="threadPinning">
<property name="text">
<string>Enable Thread Pinning</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>EE Cycle Rate:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>EE Cycle Skipping:</string>
</property>
</widget>
</item>
</layout>
Expand Down
5 changes: 2 additions & 3 deletions pcsx2/CDVD/CDVD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void cdvdSaveNVRAM()
static void cdvdReadNVM(u8* dst, int offset, int bytes)
{
int to_read = bytes;
if ((offset + bytes) > sizeof(s_nvram)) [[unlikely]]
if (static_cast<size_t>(offset + bytes) > sizeof(s_nvram)) [[unlikely]]
{
WARNING_LOG("CDVD: Out of bounds NVRAM read: offset={}, bytes={}", offset, bytes);
to_read = std::max(static_cast<int>(sizeof(s_nvram)) - offset, 0);
Expand All @@ -245,7 +245,7 @@ static void cdvdReadNVM(u8* dst, int offset, int bytes)
static void cdvdWriteNVM(const u8* src, int offset, int bytes)
{
int to_write = bytes;
if ((offset + bytes) > sizeof(s_nvram)) [[unlikely]]
if (static_cast<size_t>(offset + bytes) > sizeof(s_nvram)) [[unlikely]]
{
WARNING_LOG("CDVD: Out of bounds NVRAM write: offset={}, bytes={}", offset, bytes);
to_write = std::max(static_cast<int>(sizeof(s_nvram)) - offset, 0);
Expand Down Expand Up @@ -339,7 +339,6 @@ s32 cdvdReadConfig(u8* config)
default:
{
cdvdReadNVM(config, nvmLayout->config1 + (cdvd.CBlockIndex * 16), 16);
DEV_LOG("CONF1: {:02X} {:02X} {:02X} {:02X} {:02X} {:02X}", config[0], config[1], config[2], config[3], config[4], config[5]);
if (cdvd.CBlockIndex == 1 && (NoOSD || VMManager::Internal::WasFastBooted()))
{
// HACK: Set the "initialized" flag when fast booting, otherwise some games crash (e.g. Jak 1).
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/CDVD/GzippedFileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ ThreadedFileReader::Chunk GzippedFileReader::ChunkForOffset(u64 offset)
else
{
chunk.chunkID = static_cast<s64>(offset) / m_index->span;
chunk.length = static_cast<u32>(std::min<u64>(m_index->uncompressed_size - offset, m_index->span));
chunk.length = m_index->span;
chunk.offset = static_cast<u64>(chunk.chunkID) * m_index->span;
}

Expand Down
3 changes: 1 addition & 2 deletions pcsx2/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,6 @@ struct Pcsx2Config
FPControlRegister VU0FPCR;
FPControlRegister VU1FPCR;

u32 AffinityControlMode;

CpuOptions();
void LoadSave(SettingsWrapper& wrap);
void ApplySanityCheck();
Expand Down Expand Up @@ -1119,6 +1117,7 @@ struct Pcsx2Config
EnableNoInterlacingPatches : 1,
EnableFastBoot : 1,
EnableFastBootFastForward : 1,
EnableThreadPinning : 1,
// TODO - Vaser - where are these settings exposed in the Qt UI?
EnableRecordingTools : 1,
EnableGameFixes : 1, // enables automatic game fixes
Expand Down
4 changes: 3 additions & 1 deletion pcsx2/GS/Renderers/HW/GSHwHack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,12 @@ bool GSHwHack::GSC_Tekken5(GSRendererHW& r, int& skip)
return true;
}

if (!s_nativeres && RTME && RTEX0.TFX == 1 && RFPSM == RTPSM && std::abs(static_cast<int>(RFBP - RTBP0)) == 0x180 && RTPSM == PSMCT32 && RFBMSK == 0xFF000000)
if (!s_nativeres && r.PRIM->PRIM == GS_SPRITE && RTME && RTEX0.TFX == 1 && RFPSM == RTPSM && RTPSM == PSMCT32 && RFBMSK == 0xFF000000 && r.m_index.tail > 2)
{
// Don't enable hack on native res.
// Fixes ghosting/blur effect and white lines appearing in stages: Moonfit Wilderness, Acid Rain - caused by upscaling.
// Game copies the framebuffer as individual page rects with slight offsets (like 1/16 of a pixel etc) which doesn't wokr well with upscaling.
// This should catch all the scenarios, maybe overdoes it, but it's for 1 game and it's non-detrimental, it's better than squares all over the screen.
const GSVector4i draw_size(r.m_vt.m_min.p.x, r.m_vt.m_min.p.y, r.m_vt.m_max.p.x + 1.0f, r.m_vt.m_max.p.y + 1.0f);
const GSVector4i read_size(r.m_vt.m_min.t.x, r.m_vt.m_min.t.y, r.m_vt.m_max.t.x + 0.5f, r.m_vt.m_max.t.y + 0.5f);
r.ReplaceVerticesWithSprite(draw_size, read_size, GSVector2i(read_size.width(), read_size.height()), draw_size);
Expand Down
Loading

0 comments on commit aaedc5b

Please sign in to comment.