Merge pull request #727 from Xele02/qt_work

[Qt-desktop] Debug tools fix/improvements
This commit is contained in:
Henrik Rydgård committed 2013-02-17 13:09:40 -08:00
commit f3936e3dfa
12 files changed
+470 -71

No files matched your search

+4 -1
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);
}
+2 -2
View File
@@ -65,8 +65,8 @@ public:
virtual bool GpuStep() { return false; }
virtual void SendGPUStart() {}
virtual void SendGPUWait(u32 cmd) {}
virtual void SetGPUStep(bool value, int flag = 0) {}
virtual void SendGPUWait(u32 cmd, u32 addr, void* data) {}
virtual void SetGPUStep(bool value, int flag = 0, int data = 0) {}
virtual void NextGPUStep() {}
// Used for headless.
+1 -1
View File
@@ -98,7 +98,7 @@ bool GPUCommon::InterpretList(DisplayList &list)
#if defined(USING_QT_UI)
if(host->GpuStep())
{
host->SendGPUWait(cmd);
host->SendGPUWait(cmd, list.pc, &gstate);
}
#endif
u32 diff = op ^ gstate.cmdmem[cmd];
+21 -3
View File
@@ -28,6 +28,7 @@ recursive_mutex m_hGPUStepMutex;
QtHost::QtHost(MainWindow *mainWindow_)
: mainWindow(mainWindow_)
, m_GPUStep(false)
, m_GPUFlag(0)
{
QObject::connect(this,SIGNAL(BootDoneSignal()),mainWindow,SLOT(Boot()));
}
@@ -162,7 +163,7 @@ void QtHost::SendGPUStart()
EmuThread_LockDraw(true);
}
void QtHost::SendGPUWait(u32 cmd)
void QtHost::SendGPUWait(u32 cmd, u32 addr, void *data)
{
EmuThread_LockDraw(false);
@@ -173,19 +174,36 @@ void QtHost::SendGPUWait(u32 cmd)
}
else if(m_GPUFlag == 0)
{
mainWindow->GetDialogDisasm()->UpdateDisplayList();
mainWindow->GetDialogDisplaylist()->Update();
m_hGPUStepEvent.wait(m_hGPUStepMutex);
}
else if(m_GPUFlag == 2 && addr == m_GPUData)
{
mainWindow->GetDialogDisasm()->UpdateDisplayList();
mainWindow->GetDialogDisplaylist()->Update();
m_hGPUStepEvent.wait(m_hGPUStepMutex);
}
else if(m_GPUFlag == 3 && (cmd == GE_CMD_PRIM || cmd == GE_CMD_BEZIER || cmd == GE_CMD_SPLINE))
{
GPUgstate *state = (GPUgstate*)data;
u32 texAddr = (state->texaddr[0] & 0xFFFFF0) | ((state->texbufwidth[0]<<8) & 0x0F000000);
if(texAddr == m_GPUData)
{
mainWindow->GetDialogDisasm()->UpdateDisplayList();
mainWindow->GetDialogDisplaylist()->Update();
m_hGPUStepEvent.wait(m_hGPUStepMutex);
}
}
EmuThread_LockDraw(true);
}
void QtHost::SetGPUStep(bool value, int flag)
void QtHost::SetGPUStep(bool value, int flag, int data)
{
m_GPUStep = value;
m_GPUFlag = flag;
m_GPUData = data;
}
void QtHost::NextGPUStep()
+3 -2
View File
@@ -51,9 +51,9 @@ public:
void SendCoreWait(bool);
bool GpuStep();
void SendGPUWait(u32 cmd);
void SendGPUWait(u32 cmd, u32 addr, void* data);
void SendGPUStart();
void SetGPUStep(bool value, int flag = 0);
void SetGPUStep(bool value, int flag = 0, int data = 0);
void NextGPUStep();
signals:
@@ -62,6 +62,7 @@ private:
MainWindow* mainWindow;
bool m_GPUStep;
int m_GPUFlag;
int m_GPUData;
};
#endif // QTAPP_H
+28
View File
@@ -6,6 +6,7 @@
#include <QMessageBox>
#include <QApplication>
#include <QClipboard>
#include <QInputDialog>
#include "EmuThread.h"
#include "Core/MemMap.h"
@@ -221,6 +222,10 @@ void CtrlMemView::contextMenu(const QPoint &pos)
connect(copyValue, SIGNAL(triggered()), this, SLOT(CopyValue()));
menu.addAction(copyValue);
QAction *changeValue = new QAction(tr("C&hange value"), this);
connect(changeValue, SIGNAL(triggered()), this, SLOT(Change()));
menu.addAction(changeValue);
QAction *dump = new QAction(tr("Dump..."), this);
connect(dump, SIGNAL(triggered()), this, SLOT(Dump()));
menu.addAction(dump);
@@ -230,7 +235,9 @@ void CtrlMemView::contextMenu(const QPoint &pos)
void CtrlMemView::CopyValue()
{
EmuThread_LockDraw(true);
QApplication::clipboard()->setText(QString("%1").arg(Memory::ReadUnchecked_U32(selection),8,16,QChar('0')));
EmuThread_LockDraw(false);
}
void CtrlMemView::Dump()
@@ -238,6 +245,27 @@ void CtrlMemView::Dump()
QMessageBox::information(this,"Sorry","This feature has not been implemented.",QMessageBox::Ok);
}
void CtrlMemView::Change()
{
EmuThread_LockDraw(true);
QString curVal = QString("%1").arg(Memory::ReadUnchecked_U32(selection),8,16,QChar('0'));
EmuThread_LockDraw(false);
bool ok;
QString text = QInputDialog::getText(this, tr("Set new value"),
tr("Set new value:"), QLineEdit::Normal,
curVal, &ok);
if (ok && !text.isEmpty())
{
EmuThread_LockDraw(true);
Memory::WriteUnchecked_U32(text.toInt(0,16),selection);
EmuThread_LockDraw(false);
redraw();
}
}
int CtrlMemView::yToAddress(int y)
{
int ydiff=y-rect().bottom()/2-rowHeight/2;
+1
View File
@@ -72,6 +72,7 @@ signals:
public slots:
void CopyValue();
void Dump();
void Change();
private:
int curAddress;
int align;
+391 -61
View File
@@ -2,6 +2,7 @@
#include <QTimer>
#include <set>
#include <QMenu>
#include "Core/CPU.h"
#include "ui_debugger_displaylist.h"
@@ -30,6 +31,7 @@ Debugger_DisplayList::Debugger_DisplayList(DebugInterface *_cpu, MainWindow* mai
QObject::connect(this, SIGNAL(updateDisplayList_()), this, SLOT(UpdateDisplayListGUI()));
QObject::connect(this, SIGNAL(updateRenderBufferList_()), this, SLOT(UpdateRenderBufferListGUI()));
QObject::connect(this, SIGNAL(updateRenderBuffer_()), this, SLOT(UpdateRenderBufferGUI()));
}
@@ -308,15 +310,16 @@ void Debugger_DisplayList::ShowDLCode()
}
usedIdxAddr.insert(iaddr);
}
for(int i = 0; i < ui->texturesList->columnCount(); i++)
ui->texturesList->resizeColumnToContents(i);
for(int i = 0; i < ui->vertexList->columnCount(); i++)
ui->vertexList->resizeColumnToContents(i);
for(int i = 0; i < ui->indexList->columnCount(); i++)
ui->indexList->resizeColumnToContents(i);
}
for(int i = 0; i < ui->texturesList->columnCount(); i++)
ui->texturesList->resizeColumnToContents(i);
for(int i = 0; i < ui->vertexList->columnCount(); i++)
ui->vertexList->resizeColumnToContents(i);
for(int i = 0; i < ui->indexList->columnCount(); i++)
ui->indexList->resizeColumnToContents(i);
UpdateVertexInfo();
UpdateIndexInfo();
}
@@ -371,7 +374,7 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
{
int bz_ucount = data & 0xFF;
int bz_vcount = (data >> 8) & 0xFF;
return QString("DRAW BEZIER: %1 x %2").arg(bz_ucount).arg(bz_vcount);
return QString("DRAW BEZIER: U=%1 x V=%2").arg(bz_ucount).arg(bz_vcount);
}
break;
@@ -379,9 +382,15 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
{
int sp_ucount = data & 0xFF;
int sp_vcount = (data >> 8) & 0xFF;
static const char* type[4] = {
"Close/Close",
"Open/Close",
"Close/Open",
"Open/Open"
};
int sp_utype = (data >> 16) & 0x3;
int sp_vtype = (data >> 18) & 0x3;
return QString("DRAW SPLINE: %1 x %2, %3 x %4").arg(sp_ucount).arg(sp_vcount).arg(sp_utype).arg(sp_vtype);
return QString("DRAW SPLINE: U=%1 x V=%2, U Type = %3 , V Type = %4").arg(sp_ucount).arg(sp_vcount).arg(type[sp_utype]).arg(type[sp_vtype]);
}
break;
@@ -458,13 +467,15 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
break;
case GE_CMD_BJUMP:
{
// bounding box jump. Let's just not jump, for now.
return QString("BBOX JUMP - unimplemented");
u32 target = (((state.base & 0x00FF0000) << 8) | (op & 0xFFFFFC)) & 0x0FFFFFFF;
return QString("BBOX JUMP - %1 to %2").arg(pc,8,16,QChar('0')).arg(target,8,16,QChar('0'));
break;
}
case GE_CMD_BOUNDINGBOX:
// bounding box test. Let's do nothing.
return QString("BBOX TEST - unimplemented");
return QString("BBOX TEST - number : %1").arg(data & 0xFFFF,4,16,QChar('0'));
break;
case GE_CMD_ORIGIN:
@@ -472,9 +483,57 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
break;
case GE_CMD_VERTEXTYPE:
return QString("SetVertexType: %1").arg(data,6,16,QChar('0'));
break;
{
const char* format[4] =
{
"No",
"8 Bits fixed",
"16 Bits fixed",
"Float"
};
const char* colFormat[8] =
{
"No",
"",
"",
"",
"16-bit BGR-5650",
"16-bit ABGR-5551",
"16-bit ABGR-4444",
"32-bit ABGR-8888"
};
QString retString = "SetVertexType:";
u32 transform = data & GE_VTYPE_THROUGH_MASK;
retString += QString(" Transform : %1").arg(transform==0?"Transformed":"Raw");
u32 numVertMorph = (data & GE_VTYPE_MORPHCOUNT_MASK) >> GE_VTYPE_MORPHCOUNT_SHIFT;
retString += QString(", Num Vtx Morph : %1").arg(numVertMorph);
u32 numWeight = (data & GE_VTYPE_WEIGHTCOUNT_MASK) >> GE_VTYPE_WEIGHTCOUNT_SHIFT;
retString += QString(", Num Weights : %1").arg(numWeight);
u32 indexFmt = (data & GE_VTYPE_IDX_MASK) >> GE_VTYPE_IDX_SHIFT;
retString += QString(", Index Format : %1").arg(format[indexFmt]);
u32 weightFmt = (data & GE_VTYPE_WEIGHT_MASK) >> GE_VTYPE_WEIGHT_SHIFT;
retString += QString(", Weight Format : %1").arg(format[weightFmt]);
u32 posFmt = (data & GE_VTYPE_POS_MASK) >> GE_VTYPE_POS_SHIFT;
retString += QString(", Position Format : %1").arg(format[posFmt]);
u32 nrmFmt = (data & GE_VTYPE_NRM_MASK) >> GE_VTYPE_NRM_SHIFT;
retString += QString(", Normal Format : %1").arg(format[nrmFmt]);
u32 colFmt = (data & GE_VTYPE_COL_MASK) >> GE_VTYPE_COL_SHIFT;
retString += QString(", Color Format : %1").arg(colFormat[colFmt]);
u32 tcFmt = (data & GE_VTYPE_TC_MASK) >> GE_VTYPE_TC_SHIFT;
retString += QString(", Texture UV Format : %1").arg(format[tcFmt]);
return retString;
break;
}
case GE_CMD_OFFSETADDR:
return QString("OffsetAddr: %1").arg(data,6,16,QChar('0'));
break;
@@ -587,9 +646,17 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
break;
case GE_CMD_FRAMEBUFPIXFORMAT:
return QString("FramebufPixeFormat: %1").arg(data);
{
const char* fmt[4] =
{
"16-bit BGR 5650",
"16-bit ABGR 5551",
"16-bit ABGR 4444",
"32-bit ABGR 8888"
};
return QString("FramebufPixeFormat: %1").arg(fmt[data]);
break;
}
case GE_CMD_TEXADDR0:
case GE_CMD_TEXADDR1:
case GE_CMD_TEXADDR2:
@@ -609,7 +676,7 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
case GE_CMD_TEXBUFWIDTH5:
case GE_CMD_TEXBUFWIDTH6:
case GE_CMD_TEXBUFWIDTH7:
return QString("Texture BUFWIDTHess %1: %2").arg(cmd-GE_CMD_TEXBUFWIDTH0).arg(data,6,16,QChar('0'));
return QString("Texture BUFWIDTHess %1: %2 width : %3").arg(cmd-GE_CMD_TEXBUFWIDTH0).arg(data,6,16,QChar('0')).arg(data & 0xFFFF);
break;
case GE_CMD_CLUTADDR:
@@ -622,20 +689,41 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
case GE_CMD_LOADCLUT:
// This could be used to "dirty" textures with clut.
return QString("Clut load");
return QString("Clut load, numColor : %1").arg(data*8);
break;
case GE_CMD_TEXMAPMODE:
return QString("Tex map mode: %1").arg(data,6,16,QChar('0'));
{
const char* texMapMode[3] =
{
"Texture Coordinates (UV)",
"Texture Matrix",
"Environment Map"
};
const char* texProjMode[4] =
{
"Position",
"Texture Coordinates",
"Normalized Normal",
"Normal"
};
return QString("Tex map mode: Map mode : %1, Proj Mode : %2").arg(texMapMode[data & 0x3]).arg(texProjMode[(data >> 8) & 0x3]);
break;
}
case GE_CMD_TEXSHADELS:
return QString("Tex shade light sources: %1").arg(data,6,16,QChar('0'));
break;
case GE_CMD_CLUTFORMAT:
{
return QString("Clut format: %1").arg(data,6,16,QChar('0'));
const char* fmt[4] =
{
"16-bit BGR 5650",
"16-bit ABGR 5551",
"16-bit ABGR 4444",
"32-bit ABGR 8888"
};
return QString("Clut format: %1 , Fmt : %2").arg(data,6,16,QChar('0')).arg(fmt[data & 0x3]);
}
break;
@@ -695,7 +783,7 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
case GE_CMD_TRANSFERSTART: // Orphis calls this TRXKICK
{
return QString("Block Transfer Start");
return QString("Block Transfer Start : %1").arg(data ? "32-bit texel size" : "16-bit texel size");
break;
}
@@ -771,9 +859,22 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
case GE_CMD_LIGHTTYPE1:
case GE_CMD_LIGHTTYPE2:
case GE_CMD_LIGHTTYPE3:
return QString("Light %1 type: %2").arg(cmd-GE_CMD_LIGHTTYPE0).arg(data,6,16,QChar('0'));
{
const char* lightType[3] =
{
"Directional Light",
"Point Light",
"Spot Light"
};
const char* lightComp[3] =
{
"Ambient & Diffuse",
"Diffuse & Specular",
"Unknown (diffuse color, affected by specular power)"
};
return QString("Light %1 type: %2 %3").arg(cmd-GE_CMD_LIGHTTYPE0).arg(lightType[(data) >> 8 & 0x3]).arg(lightComp[data & 0x3]);
break;
}
case GE_CMD_LX0:case GE_CMD_LY0:case GE_CMD_LZ0:
case GE_CMD_LX1:case GE_CMD_LY1:case GE_CMD_LZ1:
case GE_CMD_LX2:case GE_CMD_LY2:case GE_CMD_LZ2:
@@ -854,42 +955,78 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
break;
case GE_CMD_CULL:
return QString("cull: %1").arg(data,6,16,QChar('0'));
{
const char* cull[2] =
{
"Clockwise visible",
"Counter-clockwise visible"
};
return QString("cull: %1").arg(cull[data & 0x1]);
break;
}
case GE_CMD_PATCHDIVISION:
{
int patch_div_s = data & 0xFF;
int patch_div_t = (data >> 8) & 0xFF;
return QString("Patch subdivision: %1 x %2").arg(patch_div_s).arg(patch_div_t);
return QString("Patch subdivision: S=%1 x T=%2").arg(patch_div_s).arg(patch_div_t);
}
break;
case GE_CMD_PATCHPRIMITIVE:
return QString("Patch Primitive: %1").arg(data);
{
const char* type[3] =
{
"Triangles",
"Lines",
"Points"
};
return QString("Patch Primitive: %1").arg(type[data]);
break;
}
case GE_CMD_PATCHFACING:
return QString( "Patch Facing: %1").arg(data);
{
const char* val[2] =
{
"Clockwise",
"Counter-Clockwise"
};
return QString( "Patch Facing: %1").arg(val[data]);
break;
}
case GE_CMD_REVERSENORMAL:
return QString("Reverse normal: %1").arg(data);
break;
case GE_CMD_MATERIALUPDATE:
return QString("Material Update: %1").arg(data);
{
QString txt = "";
if(data & 1) txt += " Ambient";
if(data & 2) txt += " Diffuse";
if(data & 4) txt += " Specular";
return QString("Material Update: %1").arg(txt);
break;
}
//////////////////////////////////////////////////////////////////
// CLEARING
//////////////////////////////////////////////////////////////////
case GE_CMD_CLEARMODE:
{
// If it becomes a performance problem, check diff&1
return QString("Clear mode: %1").arg(data,6,16,QChar('0'));
const char* clearMode[8] =
{
"",
"Clear Color Buffer",
"Clear Stencil/Alpha Buffer",
"",
"Clear Depth Buffer",
"",
"",
""
};
return QString("Clear mode: %1, enabled : %2").arg(clearMode[(data >> 8) & 0xF]).arg(data & 0x1);
break;
}
//////////////////////////////////////////////////////////////////
// ALPHA BLENDING
@@ -899,9 +1036,31 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
break;
case GE_CMD_BLENDMODE:
return QString("Blend mode: %1").arg(data,6,16,QChar('0'));
{
const char* func[9] =
{
"Source Color",
"One Minus Source Color",
"Source Alpha",
"One Minus Source Alpha",
"Destination Color",
"One Minus Destination Color",
"Destination Alpha",
"One Minus Destination Alpha",
"Fix"
};
const char* op[6] =
{
"Add",
"Subtract",
"Reverse Subtract",
"Minimum Value",
"Maximum Value",
"Absolute Value"
};
return QString("Blend mode: Src : %1, Dest : %2, Op : %3").arg(func[(data >> 4) & 0xF]).arg(func[(data >> 8) & 0xF]).arg(op[(data) & 0x7]);
break;
}
case GE_CMD_BLENDFIXEDA:
return QString("Blend fix A: %1").arg(data,6,16,QChar('0'));
break;
@@ -915,9 +1074,21 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
break;
case GE_CMD_ALPHATEST:
return QString("Alpha test settings");
{
const char* testFunc[8] =
{
"Never pass pixel",
"Always pass pixel",
"Pass pixel if match",
"Pass pixel if difference",
"Pass pixel if less",
"Pass pixel if less or equal",
"Pass pixel if greater",
"Pass pixel if greater or equal"
};
return QString("Alpha test settings, Mask : %1, Ref : %2, Test : %3").arg((data >> 8) & 0xFF).arg((data >> 16) & 0xFF).arg(testFunc[data & 0x7]);
break;
}
case GE_CMD_ANTIALIASENABLE:
return QString("Antialias enable: %1").arg(data);
break;
@@ -927,22 +1098,71 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
break;
case GE_CMD_COLORTESTENABLE:
return QString("Color Test enable: %1").arg(data);
{
const char* colorTest[4] =
{
"Never pass pixel",
"Always pass pixel",
"Pass pixel if color matches",
"Pass pixel if color differs"
};
return QString("Color Test enable: %1").arg(colorTest[data]);
break;
}
case GE_CMD_LOGICOPENABLE:
return QString("Logic op enable: %1").arg(data);
{
const char* logicOp[16] =
{
"Clear",
"And",
"Reverse And",
"Copy",
"Inverted And",
"No Operation",
"Exclusive Or",
"Or",
"Negated Or",
"Equivalence",
"Inverted",
"Reverse Or",
"Inverted Copy",
"Inverted Or",
"Negated And",
"Set"
};
return QString("Logic op enable: %1").arg(logicOp[data]);
break;
}
case GE_CMD_TEXFUNC:
return QString("TexFunc %1").arg(data&7);
{
const char* effect[8] =
{
"Modulate",
"Decal",
"Blend",
"Replace",
"Add",
"","",""
};
return QString("TexFunc %1 / %2 / %3").arg((data&0x100)?"Texture alpha is read":"Texture alpha is ignored").arg((data & 0x10000)?"Fragment color is doubled":"Fragment color is untouched").arg(effect[data & 0x7]);
break;
}
case GE_CMD_TEXFILTER:
{
int min = data & 7;
int mag = (data >> 8) & 1;
return QString("TexFilter min: %1 mag: %2").arg( min).arg(mag);
const char* filter[8]=
{
"Nearest",
"Linear",
"",
"",
"Nearest; Mipmap Nearest",
"Linear; Mipmap Nearest",
"Nearest; Mipmap Linear",
"Linear; Mipmap Linear"
};
int min = data & 0x7;
int mag = (data >> 8) & 0x7;
return QString("TexFilter min: %1 mag: %2").arg(filter[min]).arg(filter[mag]);
}
break;
@@ -951,13 +1171,30 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
break;
case GE_CMD_TEXMODE:
return QString("TexMode %1").arg(data,8,16,QChar('0'));
{
u32 maxMipMap = (data >> 16) & 0xF;
return QString("TexMode MaxmipMap : %1, Swizzle : %2").arg(maxMipMap).arg(data & 0x1);
break;
}
case GE_CMD_TEXFORMAT:
return QString("TexFormat %1").arg(data,8,16,QChar('0'));
{
const char* texFmt[11] =
{
"16-bit BGR 5650",
"16-bit ABGR 5551",
"16-bit ABGR 4444",
"32-bit ABGR 8888",
"4-bit indexed",
"8-bit indexed",
"16-bit indexed",
"32-bit indexed",
"DXT1",
"DXT3",
"DXT5"
};
return QString("TexFormat %1").arg(texFmt[data]);
break;
}
case GE_CMD_TEXFLUSH:
return QString("TexFlush");
break;
@@ -967,9 +1204,15 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
break;
case GE_CMD_TEXWRAP:
return QString("TexWrap %1").arg(data,8,16,QChar('0'));
{
const char* wrapMode[2] =
{
"Repeat",
"Clamp"
};
return QString("TexWrap U : %1, V : %2").arg(wrapMode[data & 0x1]).arg(wrapMode[(data >> 8) & 0x1]);
break;
}
case GE_CMD_TEXLEVEL:
return QString("TexWrap Mode: %1 Offset: %2").arg(data&3).arg(data >> 16);
break;
@@ -999,21 +1242,57 @@ QString Debugger_DisplayList::DisassembleOp(u32 pc, u32 op, u32 prev, const GPUg
break;
case GE_CMD_STENCILOP:
return QString("Stencil op: %1").arg(data,6,16,QChar('0'));
{
const char* stencilOp[8] =
{
"Keep stencil value",
"Zero stencil value",
"Replace stencil value",
"Invert stencil value",
"Increment stencil value",
"Decrement stencil value",
"",""
};
return QString("Stencil op: ZFail : %1, Fail : %2, Pass : %3").arg(stencilOp[(data >> 16) & 0x7]).arg(stencilOp[(data >> 8) & 0x7]).arg(stencilOp[(data) & 0x7]);
break;
}
case GE_CMD_STENCILTEST:
return QString("Stencil test: %1").arg(data,6,16,QChar('0'));
{
const char* testFunc[8] =
{
"Never pass stencil pixel",
"Always pass stencil pixel",
"Pass test if match",
"Pass test if difference",
"Pass test if less",
"Pass test if less or equal",
"Pass test if greater",
"Pass test if greater or equal"
};
return QString("Stencil test, Mask : %1, Ref : %2, Test : %3").arg((data >> 8) & 0xFF).arg((data >> 16) & 0xFF).arg(testFunc[data & 0x7]);
break;
}
case GE_CMD_STENCILTESTENABLE:
return QString("Stencil test enable: %1").arg(data);
break;
case GE_CMD_ZTEST:
return QString("Z test mode: %1").arg(data);
{
const char* testFunc[8] =
{
"Never pass stencil pixel",
"Always pass stencil pixel",
"Pass pixel if match",
"Pass pixel if difference",
"Pass pixel if less",
"Pass pixel if less or equal",
"Pass pixel if greater",
"Pass pixel if greater or equal"
};
return QString("Z test mode: %1").arg(testFunc[data & 0x7]);
break;
}
case GE_CMD_MORPHWEIGHT0:
case GE_CMD_MORPHWEIGHT1:
case GE_CMD_MORPHWEIGHT2:
@@ -1220,6 +1499,11 @@ void Debugger_DisplayList::on_stopBtn_clicked()
}
void Debugger_DisplayList::UpdateRenderBuffer()
{
emit updateRenderBuffer_();
}
void Debugger_DisplayList::UpdateRenderBufferGUI()
{
EmuThread_LockDraw(true);
@@ -1302,7 +1586,7 @@ void Debugger_DisplayList::on_texturesList_itemDoubleClicked(QTreeWidgetItem *it
void Debugger_DisplayList::on_comboBox_currentIndexChanged(int index)
{
currentRenderFrameDisplay = index;
UpdateRenderBuffer();
UpdateRenderBufferGUI();
}
void Debugger_DisplayList::UpdateRenderBufferList()
@@ -1344,7 +1628,7 @@ void Debugger_DisplayList::on_fboList_itemClicked(QTreeWidgetItem *item, int col
u64 addr = item->data(0,Qt::UserRole).toULongLong();
FBO* fbo = (FBO*)addr;
currentTextureDisplay = fbo;
UpdateRenderBuffer();
UpdateRenderBufferGUI();
}
void Debugger_DisplayList::on_nextDLBtn_clicked()
@@ -1518,3 +1802,49 @@ void Debugger_DisplayList::on_indexList_itemClicked(QTreeWidgetItem *item, int c
{
UpdateIndexInfo();
}
void Debugger_DisplayList::on_displayListData_customContextMenuRequested(const QPoint &pos)
{
QTreeWidgetItem* item = ui->displayListData->itemAt(pos);
if(!item)
return;
displayListDataSelected = item;
QMenu menu(this);
QAction *runToHere = new QAction(tr("Run to here"), this);
connect(runToHere, SIGNAL(triggered()), this, SLOT(RunToDLPC()));
menu.addAction(runToHere);
menu.exec( ui->displayListData->mapToGlobal(pos));
}
void Debugger_DisplayList::RunToDLPC()
{
u32 addr = displayListDataSelected->text(0).toInt(0,16);
host->SetGPUStep(true, 2, addr);
host->NextGPUStep();
}
void Debugger_DisplayList::on_texturesList_customContextMenuRequested(const QPoint &pos)
{
QTreeWidgetItem* item = ui->texturesList->itemAt(pos);
if(!item)
return;
textureDataSelected = item;
QMenu menu(this);
QAction *runToDraw = new QAction(tr("Run to draw using this texture"), this);
connect(runToDraw, SIGNAL(triggered()), this, SLOT(RunToDrawTex()));
menu.addAction(runToDraw);
menu.exec( ui->texturesList->mapToGlobal(pos));
}
void Debugger_DisplayList::RunToDrawTex()
{
u32 addr = textureDataSelected->text(0).toInt(0,16);
host->SetGPUStep(true, 3, addr);
host->NextGPUStep();
}
+10
View File
@@ -54,10 +54,12 @@ protected:
signals:
void updateDisplayList_();
void updateRenderBufferList_();
void updateRenderBuffer_();
private slots:
void UpdateDisplayListGUI();
void UpdateRenderBufferListGUI();
void UpdateRenderBufferGUI();
void releaseLock();
void on_displayList_itemClicked(QTreeWidgetItem *item, int column);
@@ -93,6 +95,12 @@ private slots:
void on_indexList_itemClicked(QTreeWidgetItem *item, int column);
void on_displayListData_customContextMenuRequested(const QPoint &pos);
void on_texturesList_customContextMenuRequested(const QPoint &pos);
void RunToDLPC();
void RunToDrawTex();
private:
QString DisassembleOp(u32 pc, u32 op, u32 prev, const GPUgstate &state);
@@ -100,6 +108,8 @@ private:
DebugInterface* cpu;
MainWindow* mainWindow;
QTreeWidgetItem* displayListRowSelected;
QTreeWidgetItem* displayListDataSelected;
QTreeWidgetItem* textureDataSelected;
int currentRenderFrameDisplay;
FBO* currentTextureDisplay;
float fboZoomFactor;
+6
View File
@@ -118,6 +118,9 @@
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTreeWidget" name="displayListData">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
@@ -192,6 +195,9 @@
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QTreeWidget" name="texturesList">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<column>
<property name="text">
<string>Address</string>
+2
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))
+1 -1
Submodule native updated: f5e7bd5a9c...f7db8ff0be.