Merge pull request #7397 from unknownbrackets/minor

Minor changes in font loading and GE debugger
This commit is contained in:
Henrik Rydgård 2015-02-01 11:11:45 +01:00
commit f9bb9d3862
3 changed files with 7 additions and 9 deletions

View File

@ -494,7 +494,7 @@ bool PGF::ReadCharGlyph(const u8 *fontdata, size_t charPtr, Glyph &glyph) {
{
int yAdjustIndex = consumeBits(8, fontdata, charPtr);
if (yAdjustIndex < header.xAdjustTableLength) {
if (yAdjustIndex < header.yAdjustTableLength) {
glyph.yAdjustH = yAdjustTable[0][yAdjustIndex];
glyph.yAdjustV = yAdjustTable[1][yAdjustIndex];
}

View File

@ -570,7 +570,7 @@ void GPUCommon::SlowRunLoop(DisplayList &list)
prev = 0;
}
GeDisassembleOp(list.pc, op, prev, temp, 256);
NOTICE_LOG(G3D, "%s", temp);
NOTICE_LOG(G3D, "%08x: %s", op, temp);
}
gstate.cmdmem[cmd] = op;

View File

@ -81,13 +81,10 @@ void GeDescribeVertexType(u32 op, char *buffer, int len) {
w[-2] = '\0';
}
void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *origbuf, int bufsize) {
void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer, int bufsize) {
u32 cmd = op >> 24;
u32 data = op & 0xFFFFFF;
char *buffer = origbuf + snprintf(origbuf, bufsize, "%08x: ", op);
bufsize -= (int)(buffer - origbuf);
// Handle control and drawing commands here directly. The others we delegate.
switch (cmd)
{
@ -113,8 +110,8 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *origbuf, int bufsize) {
case GE_CMD_PRIM:
{
u32 count = data & 0xFFFF;
u32 type = data >> 16;
static const char* types[7] = {
u32 type = (data >> 16) & 7;
static const char* types[8] = {
"POINTS",
"LINES",
"LINE_STRIP",
@ -122,6 +119,7 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *origbuf, int bufsize) {
"TRIANGLE_STRIP",
"TRIANGLE_FAN",
"RECTANGLES",
"CONTINUE_PREVIOUS",
};
if (gstate.vertType & GE_VTYPE_IDX_MASK)
snprintf(buffer, bufsize, "DRAW PRIM %s: count= %i vaddr= %08x, iaddr= %08x", type < 7 ? types[type] : "INVALID", count, gstate_c.vertexAddr, gstate_c.indexAddr);
@ -254,7 +252,7 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *origbuf, int bufsize) {
case GE_CMD_VERTEXTYPE:
{
int len = snprintf(buffer, bufsize, "SetVertexType: ");
GeDescribeVertexType(op, buffer + len, 256 - len);
GeDescribeVertexType(op, buffer + len, bufsize - len);
}
break;