Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Common/Thread/Promise.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ class Promise {
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;
}
Expand Down
2 changes: 1 addition & 1 deletion Core/FileLoaders/ZipFileLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ZipFileLoader::ZipFileLoader(FileLoader *sourceLoader)
: ProxiedFileLoader(sourceLoader), zipArchive_(nullptr) {
if (!backend_ || !backend_->Exists() || backend_->IsDirectory()) {
// bad
return;
}

zip_error_t error{};
Expand Down
3 changes: 1 addition & 2 deletions Core/HLE/sceDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static void ScheduleLagSync(int over = 0) {

void __DisplayInit() {
__DisplaySetFramerate();
DisplayHWInit();
DisplayHWReset();
hasSetMode = false;
mode = 0;
resumeMode = 0;
Expand Down Expand Up @@ -296,7 +296,6 @@ void __DisplayDoState(PointerWrap &p) {
}

void __DisplayShutdown() {
DisplayHWShutdown();
vblankWaitingThreads.clear();
}

Expand Down
6 changes: 3 additions & 3 deletions Core/HLE/sceKernelModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion Core/HW/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ int DisplayCalculateFrameSkip() {
return frameSkipNum;
}

void DisplayHWInit() {
void DisplayHWReset() {
frameStartTicks = 0;
numVBlanks = 0;
isVblank = 0;
Expand All @@ -329,6 +329,8 @@ void DisplayHWInit() {
lastFrameTimeHistory = 0.0;
}

void DisplayHWInit() {}

void DisplayHWShutdown() {
std::lock_guard<std::mutex> guard(listenersLock);
vblankListeners.clear();
Expand Down
1 change: 1 addition & 0 deletions Core/HW/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ void DisplayFireActualFlip();
int DisplayCalculateFrameSkip();

void DisplayHWInit();
void DisplayHWReset();
void DisplayHWShutdown();
void DisplayHWDoState(PointerWrap &p, int hleCompatV2);
2 changes: 1 addition & 1 deletion Core/MIPS/MIPSAnalyst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ namespace MIPSAnalyst {
}

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);

Expand Down
5 changes: 5 additions & 0 deletions Core/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -409,6 +410,8 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin

CoreTiming::Init();

DisplayHWInit();

// Init all the HLE modules
HLEInit();

Expand Down Expand Up @@ -496,6 +499,8 @@ void CPU_Shutdown(bool success) {
__KernelShutdown();
HLEShutdown();

DisplayHWShutdown();

pspFileSystem.Shutdown();
mipsr4k.Shutdown();
Memory::Shutdown();
Expand Down
3 changes: 2 additions & 1 deletion Core/Util/PortManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion GPU/Common/DrawEngineCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class DrawEngineCommon {
}

void FlushSkin() {
if (dec_->skinInDecode) {
if (dec_ && dec_->skinInDecode) {
FlushPartialDecode();
}
}
Expand Down
2 changes: 1 addition & 1 deletion GPU/Software/SoftGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading