Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression fixes #19895

Merged
merged 3 commits into from
Jan 20, 2025
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
1 change: 1 addition & 0 deletions Core/HLE/HLE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ void CallSyscall(MIPSOpcode op) {
}
}

// TODO: Also add support for argument names.
size_t hleFormatLogArgs(char *message, size_t sz, const char *argmask) {
char *p = message;
size_t used = 0;
Expand Down
2 changes: 1 addition & 1 deletion Core/HLE/sceDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ static u32 sceDisplaySetBrightness(int level, int other) {
static u32 sceDisplaySetHoldMode(u32 hMode) {
// Not sure what this does, seems to do nothing in tests and accept all values.
holdMode = hMode;
return hleReportError(Log::sceDisplay, 0, "unsupported");
return hleLogWarning(Log::sceDisplay, 0, "UNIMPL");
}

const HLEFunction sceDisplay[] = {
Expand Down
19 changes: 9 additions & 10 deletions Core/HLE/sceGe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,28 +332,24 @@ bool __GeTriggerWait(GPUSyncType type, SceUID waitId) {
return false;
}

// Some games spam this, like MediEvil.
static u32 sceGeEdramGetAddr() {
u32 retVal = 0x04000000;
DEBUG_LOG(Log::sceGe, "%08x = sceGeEdramGetAddr", retVal);
hleEatCycles(150);
return retVal;
return hleLogVerbose(Log::sceGe, retVal);
}

// TODO: Return a different value for the PS3 enhanced-emulator games?
static u32 sceGeEdramGetSize() {
const u32 retVal = 0x00200000;
DEBUG_LOG(Log::sceGe, "%08x = sceGeEdramGetSize()", retVal);
return retVal;
return hleLogVerbose(Log::sceGe, retVal);
}

static int __GeSubIntrBase(int callbackId) {
return callbackId * 2;
}

u32 sceGeListEnQueue(u32 listAddress, u32 stallAddress, int callbackId, u32 optParamAddr) {
DEBUG_LOG(Log::sceGe,
"sceGeListEnQueue(addr=%08x, stall=%08x, cbid=%08x, param=%08x) ticks=%d",
listAddress, stallAddress, callbackId, optParamAddr, (int)CoreTiming::GetTicks());
auto optParam = PSPPointer<PspGeListArgs>::Create(optParamAddr);

bool runList;
Expand All @@ -369,13 +365,16 @@ u32 sceGeListEnQueue(u32 listAddress, u32 stallAddress, int callbackId, u32 optP
}
hleEatCycles(490);
hleCoreTimingForceCheck();
return listID; // We already logged above, logs get confusing if we use hleLogSuccess.
DEBUG_LOG(Log::sceGe,
"%08x=sceGeListEnQueue(addr=%08x, stall=%08x, cbid=%08x, param=%08x) ticks=%lld", listID,
listAddress, stallAddress, callbackId, optParamAddr, (long long)CoreTiming::GetTicks());
return hleNoLog(listID); // We already logged above, logs get confusing if we use hleLogSuccess.
}

u32 sceGeListEnQueueHead(u32 listAddress, u32 stallAddress, int callbackId, u32 optParamAddr) {
DEBUG_LOG(Log::sceGe,
"sceGeListEnQueueHead(addr=%08x, stall=%08x, cbid=%08x, param=%08x) ticks=%d",
listAddress, stallAddress, callbackId, optParamAddr, (int)CoreTiming::GetTicks());
"sceGeListEnQueueHead(addr=%08x, stall=%08x, cbid=%08x, param=%08x) ticks=%lld",
listAddress, stallAddress, callbackId, optParamAddr, (long long)CoreTiming::GetTicks());
auto optParam = PSPPointer<PspGeListArgs>::Create(optParamAddr);

bool runList;
Expand Down
2 changes: 1 addition & 1 deletion Core/HLE/sceKernelInterrupt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ static u32 sceKernelMemset(u32 addr, u32 fillc, u32 n) {
}
}
NotifyMemInfo(MemBlockFlags::WRITE, addr, n, "KernelMemset");
return hleLogDebug(Log::sceIntc, addr);
return hleLogDebug(Log::sceKernel, addr);
}

static u32 sceKernelMemcpy(u32 dst, u32 src, u32 size) {
Expand Down
3 changes: 2 additions & 1 deletion Core/HLE/sceKernelModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,8 @@ u32 sceKernelLoadModule(const char *name, u32 flags, u32 optionAddr) {

if (!module) {
if (magic == 0x46535000) {
// TODO: What's actually going on here?
// TODO: What's actually going on here? This is needed to keep Tekken 6 working, the "proper" error breaks it, when it tries to load PARAM.SFO as a module.
error = -1;
return hleDelayResult(hleLogError(Log::Loader, error, "Game tried to load an SFO as a module. Go figure? Magic = %08x", magic), "module loaded", 500);
}

Expand Down
22 changes: 15 additions & 7 deletions GPU/GPUCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,18 +748,20 @@ DLResult GPUCommon::ProcessDLQueue() {
for (int listIndex = GetNextListIndex(); listIndex != -1; listIndex = GetNextListIndex()) {
DisplayList &list = dls[listIndex];

if (!Memory::IsValidAddress(list.pc)) {
ERROR_LOG(Log::G3D, "DL PC = %08x WTF!!!!", list.pc);
return DLResult::Error;
if (list.state == PSP_GE_DL_STATE_PAUSED) {
return DLResult::Done;
}

DEBUG_LOG(Log::G3D, "%s DL execution at %08x - stall = %08x (startingTicks=%lld)",
list.pc == list.startpc ? "Starting" : "Resuming", list.pc, list.stall, startingTicks);

if (list.state == PSP_GE_DL_STATE_PAUSED) {
// Temporary workaround for Crazy Taxi, see #19894
if (list.state == PSP_GE_DL_STATE_NONE) {
WARN_LOG(Log::G3D, "Discarding display list with state NONE (pc=%08x). This is odd.", list.pc);
dlQueue.erase(std::remove(dlQueue.begin(), dlQueue.end(), listIndex), dlQueue.end());
return DLResult::Done;
}

DEBUG_LOG(Log::G3D, "%s DL execution at %08x - stall = %08x (startingTicks=%lld)",
list.pc == list.startpc ? "Starting" : "Resuming", list.pc, list.stall, startingTicks);

if (!resumingFromDebugBreak_) {
// TODO: Need to be careful when *resuming* a list (when it wasn't from a stall...)
currentList = &list;
Expand All @@ -771,6 +773,11 @@ DLResult GPUCommon::ProcessDLQueue() {

gstate_c.offsetAddr = list.offsetAddr;

if (!Memory::IsValidAddress(list.pc)) {
ERROR_LOG(Log::G3D, "DL PC = %08x WTF!!!!", list.pc);
return DLResult::Done;
}

cycleLastPC = list.pc;
cyclesExecuted += 60;
downcount = list.stall == 0 ? 0x0FFFFFFF : (list.stall - list.pc) / 4;
Expand Down Expand Up @@ -842,6 +849,7 @@ DLResult GPUCommon::ProcessDLQueue() {
// don't do anything - though dunno about error...
break;
case GPUSTATE_STALL:
// Resume work on this same display list later.
return DLResult::Done;
default:
return DLResult::Error;
Expand Down
Loading