System: Fix patch settings not clearing on game change

Also the redundant memory card notification when loading state.
pull/3576/head
Stenzek 2 months ago
parent 7de84817f8
commit ba0390f6e0
No known key found for this signature in database

@ -66,7 +66,7 @@ Other features include:
## System Requirements
- A CPU faster than a potato. But it needs to be x86_64, AArch32/armv7, AArch64/ARMv8, or RISC-V/RV64.
- For the hardware renderers, a GPU capable of OpenGL 3.1/OpenGL ES 3.1/Direct3D 11 Feature Level 10.0 (or Vulkan 1.0) and above. So, basically anything made in the last 10 years or so.
- A GPU capable of OpenGL 3.1/OpenGL ES 3.1/Direct3D 11 Feature Level 10.0/Vulkan 1.0. So, basically anything made in the last 10 years or so.
- SDL, XInput or DInput compatible game controller (e.g. XB360/XBOne/XBSeries). DualShock 3 users on Windows will need to install the official DualShock 3 drivers included as part of PlayStation Now.
## Downloading and running
@ -162,7 +162,7 @@ For example, if your disc image was named `Spyro3.cue`, you would place the SBI
CHD images with built-in subchannel information are also supported.
If you are playing directly from a disc and your CD/DVD drive does not support subchannel reading, or has a skew with the returned SubQ, you can place the SBI file in the `subchannel` directory under the user directory, with the serial or title of the game.
If you are playing directly from a disc and your CD/DVD drive does not support subchannel reading, or has a skew with the returned SubQ, you can place the SBI file in the `subchannels` directory under the user directory, with the serial or title of the game.
### Cheats and patch database
@ -197,11 +197,6 @@ Fedora package names:
alsa-lib-devel autoconf automake brotli-devel clang cmake dbus-devel egl-wayland-devel extra-cmake-modules fontconfig-devel gcc-c++ gtk3-devel libavcodec-free-devel libavformat-free-devel libavutil-free-devel libcurl-devel libdecor-devel libevdev-devel libICE-devel libinput-devel libSM-devel libswresample-free-devel libswscale-free-devel libX11-devel libXau-devel libxcb-devel libXcomposite-devel libXcursor-devel libXext-devel libXfixes-devel libXft-devel libXi-devel libxkbcommon-devel libxkbcommon-x11-devel libXpresent-devel libXrandr-devel libXrender-devel libtool lld llvm make mesa-libEGL-devel mesa-libGL-devel nasm ninja-build openssl-devel patch pcre2-devel perl-Digest-SHA pipewire-devel pulseaudio-libs-devel systemd-devel wayland-devel xcb-util-cursor-devel xcb-util-devel xcb-util-errors-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel xcb-util-xrm-devel zlib-devel
```
Arch package names:
```
base-devel clang cmake curl dbus extra-cmake-modules freetype git libjpeg-turbo libpng libwebp libx11 libxrandr lld llvm ninja qt6-base qt6-imageformats qt6-svg qt6-tools wayland zstd
```
#### Building
1. Clone the repository: `git clone https://github.com/stenzek/duckstation.git`, `cd duckstation`.

@ -640,8 +640,16 @@ bool CPU::PGXP::GetPreciseVertex(u32 addr, u32 value, int x, int y, int xOffs, i
*out_y = TruncateVertexPosition(vert->y) + static_cast<float>(yOffs);
*out_w = vert->z / static_cast<float>(GTE::MAX_Z);
GL_INS_FMT("0x{:08X} {},{} => VERTEX_CACHE{{{},{} ({},{},{}) ({},{})}}", addr, x, y, *out_x, *out_y,
TruncateVertexPosition(vert->x), TruncateVertexPosition(vert->y), vert->z, std::abs(*out_x - x),
std::abs(*out_y - y));
if (IsWithinTolerance(*out_x, *out_y, x, y))
{
// This is only really used for Syphon Filter 3, and including Z tends to make things worse.
// At least it can get rid of the jitter, but not the warping.
return false;
}
}
}
@ -649,6 +657,8 @@ bool CPU::PGXP::GetPreciseVertex(u32 addr, u32 value, int x, int y, int xOffs, i
*out_x = static_cast<float>(x);
*out_y = static_cast<float>(y);
*out_w = 1.0f;
GL_INS_FMT("0x{:08X} {},{} => MISS", addr, x, y);
return false;
}
@ -702,8 +712,6 @@ void CPU::PGXP::CPU_SW(Instruction instr, u32 addr, u32 rtVal)
void CPU::PGXP::CPU_LWx(Instruction instr, u32 addr, u32 rtVal)
{
LOG_VALUES_LOAD(addr, memVal);
const u32 aligned_addr = addr & ~3u;
PGXPValue* pmemVal = GetPtr(aligned_addr);
u32 memVal;

@ -3003,12 +3003,10 @@ bool System::LoadStateFromBuffer(const SaveStateBuffer& buffer, Error* error, bo
else
{
// state has no disc
CDROM::RemoveMedia(false);
if (CDROM::RemoveMedia(false))
UpdateRunningGame(std::string(), nullptr, false);
}
// ensure the correct card is loaded
ReloadMemoryCardsFromGameChange();
ClearMemorySaveStates(false, false);
// Updating game/loading settings can turn on hardcore mode. Catch this.
@ -4121,7 +4119,6 @@ bool System::InsertMedia(const char* path)
s_state.running_game_title, s_state.running_game_serial),
Host::OSD_INFO_DURATION);
ReloadMemoryCardsFromGameChange();
return true;
}
@ -4229,7 +4226,13 @@ void System::UpdateRunningGame(const std::string& path, CDImage* image, bool boo
if (!booting)
{
Achievements::GameChanged(image);
const bool had_setting_overrides = Cheats::HasAnySettingOverrides();
Cheats::ReloadCheats(true, true, false, true, true);
if (had_setting_overrides)
ApplySettings(true);
ReloadMemoryCardsFromGameChange();
}
}
@ -4330,7 +4333,6 @@ bool System::SwitchMediaSubImage(u32 index)
subimage_title = image->GetSubImageTitle(index);
title = FileSystem::GetDisplayNameFromPath(image->GetPath());
UpdateRunningGame(image->GetPath(), image.get(), false);
ReloadMemoryCardsFromGameChange();
okay = CDROM::InsertMedia(image, region, s_state.running_game_serial, s_state.running_game_title,
GetCurrentGameSaveTitle(), &error);
}

Loading…
Cancel
Save