From 6339c2fc9a2f909a291a2f44ffe61ef5a0f8a995 Mon Sep 17 00:00:00 2001 From: Xele02 Date: Sun, 17 Feb 2013 13:10:40 +0100 Subject: [PATCH] Correct crash when texture too small loaded in memory tex viewer Correct current thread PC in the list. --- Core/HLE/sceKernelThread.cpp | 5 ++++- Qt/debugger_memorytex.cpp | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index ea1f8730ef..52aa4981c5 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -2805,7 +2805,10 @@ std::vector GetThreadsInfo() info.name[KERNELOBJECT_MAX_NAME_LENGTH+1] = 0; info.status = t->nt.status; info.entrypoint = t->nt.entrypoint; - info.curPC = t->context.pc; + if(*iter == currentThread) + info.curPC = currentMIPS->pc; + else + info.curPC = t->context.pc; info.isCurrent = (*iter == currentThread); threadList.push_back(info); } diff --git a/Qt/debugger_memorytex.cpp b/Qt/debugger_memorytex.cpp index bc9ea6272d..cdbf4ae640 100644 --- a/Qt/debugger_memorytex.cpp +++ b/Qt/debugger_memorytex.cpp @@ -70,8 +70,10 @@ void Debugger_MemoryTex::on_readBtn_clicked() state.clutaddr = ui->clutaddr->text().toInt(0,16); state.clutaddrupper = ui->clutaddrupper->text().toInt(0,16); state.loadclut = ui->loadclut->text().toInt(0,16); + int bufW = state.texbufwidth[0] & 0x3ff; int w = 1 << (state.texsize[0] & 0xf); int h = 1 << ((state.texsize[0]>>8) & 0xf); + w = std::max(bufW,w); uchar* newData = new uchar[w*h*4]; if(gpu->DecodeTexture(newData, state))