Merge pull request #20469 from hrydgard/more-fixes

Fix RetroAchievements for multi-exe games, add some sanity checks
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2025-06-07 18:08:19 +02:00
commit da12538589
11 files changed
+23 -13

No files matched your search

+4 -2
View File
@@ -164,9 +164,11 @@ public:
void Cancel() {
std::lock_guard<std::mutex> guard(readyMutex_);
if (!ready_) {
_dbg_assert_(task_);
ready_ = true;
task_->Cancel();
_dbg_assert_(task_);
if (task_) {
task_->Cancel();
}
rx_->Release();
rx_ = nullptr;
}
+1 -1
View File
@@ -10,7 +10,7 @@
ZipFileLoader::ZipFileLoader(FileLoader *sourceLoader)
: ProxiedFileLoader(sourceLoader), zipArchive_(nullptr) {
if (!backend_ || !backend_->Exists() || backend_->IsDirectory()) {
// bad
return;
}
zip_error_t error{};
+1 -2
View File
@@ -175,7 +175,7 @@ static void ScheduleLagSync(int over = 0) {
void __DisplayInit() {
__DisplaySetFramerate();
DisplayHWInit();
DisplayHWReset();
hasSetMode = false;
mode = 0;
resumeMode = 0;
@@ -296,7 +296,6 @@ void __DisplayDoState(PointerWrap &p) {
}
void __DisplayShutdown() {
DisplayHWShutdown();
vblankWaitingThreads.clear();
}
+3 -3
View File
@@ -1323,10 +1323,10 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load
bool insertSymbols = scan && !reader.LoadSymbols();
std::vector<SectionID> codeSections = reader.GetCodeSections();
for (SectionID id : codeSections) {
u32 start = reader.GetSectionAddr(id);
const u32 start = reader.GetSectionAddr(id);
// Note: scan end is inclusive.
u32 end = start + reader.GetSectionSize(id) - 4;
u32 len = end + 4 - start;
const u32 end = start + reader.GetSectionSize(id) - 4;
const u32 len = end + 4 - start;
if (len == 0) {
// Seen in WWE: Smackdown vs Raw 2009. See #17435.
continue;
+3 -1
View File
@@ -308,7 +308,7 @@ int DisplayCalculateFrameSkip() {
return frameSkipNum;
}
void DisplayHWInit() {
void DisplayHWReset() {
frameStartTicks = 0;
numVBlanks = 0;
isVblank = 0;
@@ -329,6 +329,8 @@ void DisplayHWInit() {
lastFrameTimeHistory = 0.0;
}
void DisplayHWInit() {}
void DisplayHWShutdown() {
std::lock_guard<std::mutex> guard(listenersLock);
vblankListeners.clear();
+1
View File
@@ -55,5 +55,6 @@ void DisplayFireActualFlip();
int DisplayCalculateFrameSkip();
void DisplayHWInit();
void DisplayHWReset();
void DisplayHWShutdown();
void DisplayHWDoState(PointerWrap &p, int hleCompatV2);
+1 -1
View File
@@ -1023,7 +1023,7 @@ skip:
}
bool ScanForFunctions(u32 startAddr, u32 endAddr, bool insertSymbols) {
_assert_(((startAddr | endAddr) & 3) == 0);
_assert_((startAddr & 3) == 0);
std::lock_guard<std::recursive_mutex> guard(functions_lock);
+5
View File
@@ -54,6 +54,7 @@
#include "Core/HLE/Plugins.h"
#include "Core/HLE/ReplaceTables.h"
#include "Core/HLE/sceKernel.h"
#include "Core/HW/Display.h"
#include "Core/Config.h"
#include "Core/Core.h"
#include "Core/CoreTiming.h"
@@ -409,6 +410,8 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin
CoreTiming::Init();
DisplayHWInit();
// Init all the HLE modules
HLEInit();
@@ -496,6 +499,8 @@ void CPU_Shutdown(bool success) {
__KernelShutdown();
HLEShutdown();
DisplayHWShutdown();
pspFileSystem.Shutdown();
mipsr4k.Shutdown();
Memory::Shutdown();
+2 -1
View File
@@ -35,6 +35,7 @@
#include "Common/Thread/ThreadUtil.h"
#include "Common/System/OSD.h"
#include "Common/Log.h"
#include "Common/StringUtils.h"
#include "Core/Config.h"
#include "Core/Core.h"
#include "Core/System.h"
@@ -200,7 +201,7 @@ bool PortManager::Initialize(const unsigned int timeout) {
ERROR_LOG(Log::sceNet, "PortManager - upnpDiscover failed (error: %i) or No UPnP device detected", error);
if (g_Config.bEnableUPnP) {
auto n = GetI18NCategory(I18NCat::NETWORKING);
g_OSD.Show(OSDType::MESSAGE_ERROR, n->T("Unable to find UPnP device"));
g_OSD.Show(OSDType::MESSAGE_ERROR, StringFromFormat("%s (%d)", n->T_cstr("Unable to find UPnP device"), error), 0.0f, "upnp_warning");
}
m_InitState = UPNP_INITSTATE_NONE;
#endif // WITH_UPNP
+1 -1
View File
@@ -111,7 +111,7 @@ public:
}
void FlushSkin() {
if (dec_->skinInDecode) {
if (dec_ && dec_->skinInDecode) {
FlushPartialDecode();
}
}
+1 -1
View File
@@ -661,7 +661,7 @@ void SoftGPU::BeginHostFrame() {
}
bool SoftGPU::PresentedThisFrame() const {
return presentation_->PresentedThisFrame();
return presentation_ ? presentation_->PresentedThisFrame() : false;
}
void SoftGPU::MarkDirty(uint32_t addr, uint32_t stride, uint32_t height, GEBufferFormat fmt, SoftGPUVRAMDirty value) {