Correct crash when texture too small loaded in memory tex viewer

Correct current thread PC in the list.
This commit is contained in:
Xele02 2013-02-17 13:10:40 +01:00
parent cba9baaca6
commit 6339c2fc9a
2 changed files with 6 additions and 1 deletions

View file

@ -2805,7 +2805,10 @@ std::vector<DebugThreadInfo> 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);
}

View file

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