BPMemory: Expose more register descriptions for FifoPlayer

This commit is contained in:
NeoBrainX 2013-01-12 15:06:06 +01:00
parent 2cd415dd83
commit f7b0c8684b

View File

@ -55,6 +55,11 @@ void GetBPRegInfo(const u8* data, char* name, size_t name_size, char* desc, size
snprintf(name, name_size, #reg); \
(void)(reg);
case BPMEM_GENMODE: // 0x00
SetRegName(BPMEM_GENMODE);
// TODO: Description
break;
case BPMEM_DISPLAYCOPYFILER: // 0x01
// TODO: This is actually the sample pattern used for copies from an antialiased EFB
SetRegName(BPMEM_DISPLAYCOPYFILER);
@ -75,6 +80,28 @@ void GetBPRegInfo(const u8* data, char* name, size_t name_size, char* desc, size
}
break;
case BPMEM_BLENDMODE: // 0x41
{
SetRegName(BPMEM_BLENDMODE);
BlendMode mode; mode.hex = cmddata;
const char* dstfactors[] = { "0", "1", "src_color", "1-src_color", "src_alpha", "1-src_alpha", "dst_alpha", "1-dst_alpha" };
const char* srcfactors[] = { "0", "1", "dst_color", "1-dst_color", "src_alpha", "1-src_alpha", "dst_alpha", "1-dst_alpha" };
const char* logicmodes[] = { "0", "s & d", "s & ~d", "s", "~s & d", "d", "s ^ d", "s | d", "~(s | d)", "~(s ^ d)", "~d", "s | ~d", "~s", "~s | d", "~(s & d)", "1" };
snprintf(desc, desc_size, "Enable: %s\n"
"Logic ops: %s\n"
"Dither: %s\n"
"Color write: %s\n"
"Alpha write: %s\n"
"Dest factor: %s\n"
"Source factor: %s\n"
"Subtract: %s\n"
"Logic mode: %s\n",
no_yes[mode.blendenable], no_yes[mode.logicopenable], no_yes[mode.dither],
no_yes[mode.colorupdate], no_yes[mode.alphaupdate], dstfactors[mode.dstfactor],
srcfactors[mode.srcfactor], no_yes[mode.subtract], logicmodes[mode.logicmode]);
}
break;
case BPMEM_EFB_BR: // 0x4A
{
// TODO: Misleading name, should be BPMEM_EFB_WH instead
@ -148,7 +175,113 @@ void GetBPRegInfo(const u8* data, char* name, size_t name_size, char* desc, size
// TODO: Description
break;
#undef SET_REG_NAME
case BPMEM_TEV_COLOR_ENV: // 0xC0
case BPMEM_TEV_COLOR_ENV+2:
case BPMEM_TEV_COLOR_ENV+4:
case BPMEM_TEV_COLOR_ENV+8:
case BPMEM_TEV_COLOR_ENV+10:
case BPMEM_TEV_COLOR_ENV+12:
case BPMEM_TEV_COLOR_ENV+14:
case BPMEM_TEV_COLOR_ENV+16:
case BPMEM_TEV_COLOR_ENV+18:
case BPMEM_TEV_COLOR_ENV+20:
case BPMEM_TEV_COLOR_ENV+22:
case BPMEM_TEV_COLOR_ENV+24:
case BPMEM_TEV_COLOR_ENV+26:
case BPMEM_TEV_COLOR_ENV+28:
case BPMEM_TEV_COLOR_ENV+30:
{
SetRegName(BPMEM_TEV_COLOR_ENV);
TevStageCombiner::ColorCombiner cc; cc.hex = cmddata;
const char* tevin[] =
{
"prev.rgb", "prev.aaa",
"c0.rgb", "c0.aaa",
"c1.rgb", "c1.aaa",
"c2.rgb", "c2.aaa",
"tex.rgb", "tex.aaa",
"ras.rgb", "ras.aaa",
"ONE", "HALF", "konst.rgb", "ZERO",
};
const char* tevbias[] = { "0", "+0.5", "-0.5", "compare" };
const char* tevop[] = { "add", "sub" };
const char* tevscale[] = { "1", "2", "4", "0.5" };
const char* tevout[] = { "prev.rgb", "c0.rgb", "c1.rgb", "c2.rgb" };
snprintf(desc, desc_size, "tev stage: %d\n"
"a: %s\n"
"b: %s\n"
"c: %s\n"
"d: %s\n"
"bias: %s\n"
"op: %s\n"
"clamp: %s\n"
"scale factor: %s\n"
"dest: %s\n",
(data[0] - BPMEM_TEV_COLOR_ENV)/2, tevin[cc.a], tevin[cc.b], tevin[cc.c], tevin[cc.d],
tevbias[cc.bias], tevop[cc.op], no_yes[cc.clamp], tevscale[cc.shift], tevout[cc.dest]);
break;
}
case BPMEM_TEV_ALPHA_ENV: // 0xC1
case BPMEM_TEV_ALPHA_ENV+2:
case BPMEM_TEV_ALPHA_ENV+4:
case BPMEM_TEV_ALPHA_ENV+6:
case BPMEM_TEV_ALPHA_ENV+8:
case BPMEM_TEV_ALPHA_ENV+10:
case BPMEM_TEV_ALPHA_ENV+12:
case BPMEM_TEV_ALPHA_ENV+14:
case BPMEM_TEV_ALPHA_ENV+16:
case BPMEM_TEV_ALPHA_ENV+18:
case BPMEM_TEV_ALPHA_ENV+20:
case BPMEM_TEV_ALPHA_ENV+22:
case BPMEM_TEV_ALPHA_ENV+24:
case BPMEM_TEV_ALPHA_ENV+26:
case BPMEM_TEV_ALPHA_ENV+28:
case BPMEM_TEV_ALPHA_ENV+30:
{
SetRegName(BPMEM_TEV_ALPHA_ENV);
TevStageCombiner::AlphaCombiner ac; ac.hex = cmddata;
const char* tevin[] =
{
"prev", "c0", "c1", "c2",
"tex", "ras", "konst", "ZERO",
};
const char* tevbias[] = { "0", "+0.5", "-0.5", "compare" };
const char* tevop[] = { "add", "sub" };
const char* tevscale[] = { "1", "2", "4", "0.5" };
const char* tevout[] = { "prev", "c0", "c1", "c2" };
snprintf(desc, desc_size, "tev stage: %d\n"
"a: %s\n"
"b: %s\n"
"c: %s\n"
"d: %s\n"
"bias: %s\n"
"op: %s\n"
"clamp: %s\n"
"scale factor: %s\n"
"dest: %s\n"
"ras sel: %d\n"
"tex sel: %d\n",
(data[0] - BPMEM_TEV_ALPHA_ENV)/2, tevin[ac.a], tevin[ac.b], tevin[ac.c], tevin[ac.d],
tevbias[ac.bias], tevop[ac.op], no_yes[ac.clamp], tevscale[ac.shift], tevout[ac.dest],
ac.rswap, ac.tswap);
break;
}
case BPMEM_ALPHACOMPARE: // 0xF3
{
SetRegName(BPMEM_ALPHACOMPARE);
AlphaTest test; test.hex = cmddata;
const char* functions[] = { "NEVER", "LESS", "EQUAL", "LEQUAL", "GREATER", "NEQUAL", "GEQUAL", "ALWAYS" };
const char* logic[] = { "AND", "OR", "XOR", "XNOR" };
snprintf(desc, desc_size, "test 1: %s (ref: %#02x)\n"
"test 2: %s (ref: %#02x)\n"
"logic: %s\n",
functions[test.comp0], test.ref0, functions[test.comp1], test.ref1, logic[test.logic]);
break;
}
#undef SetRegName
}
}