Merge pull request #448 from lioncash/fifo-cleanup

Expand GetBPRegInfo to include the rest of the BP registers.
This commit is contained in:
Tony Wasserka 2014-06-05 13:21:05 +02:00
commit e2cfb7f0fa
2 changed files with 475 additions and 101 deletions

View File

@ -77,7 +77,7 @@
#define BPMEM_TX_SETIMAGE1_4 0xAC // 0xA4 + 4
#define BPMEM_TX_SETIMAGE2_4 0xB0 // 0xB0 + 4
#define BPMEM_TX_SETIMAGE3_4 0xB4 // 0xB4 + 4
#define BPMEM_TX_SETLUT_4 0xB8 // 0xB8 + 4
#define BPMEM_TX_SETTLUT_4 0xB8 // 0xB8 + 4
#define BPMEM_TEV_COLOR_ENV 0xC0 // 0xC0 + (2 * 16)
#define BPMEM_TEV_ALPHA_ENV 0xC1 // 0xC1 + (2 * 16)
#define BPMEM_TEV_REGISTER_L 0xE0 // 0xE0 + (2 * 4)

View File

@ -545,7 +545,7 @@ static void BPWritten(const BPCmd& bp)
// BPMEM_TX_SETTLUT - Format, TMEM Offset (offset of TLUT from start of TMEM high bank > > 5)
// -------------------------------
case BPMEM_TX_SETTLUT:
case BPMEM_TX_SETLUT_4:
case BPMEM_TX_SETTLUT_4:
return;
// ---------------------------------------------------
@ -688,12 +688,131 @@ void GetBPRegInfo(const u8* data, std::string* name, std::string* desc)
// TODO: same as BPMEM_DISPLAYCOPYFILTER
break;
case BPMEM_EFB_TL: // 0x49
{
SetRegName(BPMEM_EFB_TL);
X10Y10 left_top; left_top.hex = cmddata;
*desc = StringFromFormat("Left: %d\nTop: %d", left_top.x, left_top.y);
}
case BPMEM_IND_MTXA: // 0x06
case BPMEM_IND_MTXA+3:
case BPMEM_IND_MTXA+6:
SetRegName(BPMEM_IND_MTXA);
// TODO: Description
break;
case BPMEM_IND_MTXB: // 0x07
case BPMEM_IND_MTXB+3:
case BPMEM_IND_MTXB+6:
SetRegName(BPMEM_IND_MTXB);
// TODO: Descriptio
break;
case BPMEM_IND_MTXC: // 0x08
case BPMEM_IND_MTXC+3:
case BPMEM_IND_MTXC+6:
SetRegName(BPMEM_IND_MTXC);
// TODO: Description
break;
case BPMEM_IND_IMASK: // 0x0F
SetRegName(BPMEM_IND_IMASK);
// TODO: Description
break;
case BPMEM_IND_CMD: // 0x10
case BPMEM_IND_CMD+1:
case BPMEM_IND_CMD+2:
case BPMEM_IND_CMD+3:
case BPMEM_IND_CMD+4:
case BPMEM_IND_CMD+5:
case BPMEM_IND_CMD+6:
case BPMEM_IND_CMD+7:
case BPMEM_IND_CMD+8:
case BPMEM_IND_CMD+9:
case BPMEM_IND_CMD+10:
case BPMEM_IND_CMD+11:
case BPMEM_IND_CMD+12:
case BPMEM_IND_CMD+13:
case BPMEM_IND_CMD+14:
case BPMEM_IND_CMD+15:
SetRegName(BPMEM_IND_CMD);
// TODO: Description
break;
case BPMEM_SCISSORTL: // 0x20
SetRegName(BPMEM_SCISSORTL);
// TODO: Description
break;
case BPMEM_SCISSORBR: // 0x21
SetRegName(BPMEM_SCISSORBR);
// TODO: Description
break;
case BPMEM_LINEPTWIDTH: // 0x22
SetRegName(BPMEM_LINEPTWIDTH);
// TODO: Description
break;
case BPMEM_PERF0_TRI: // 0x23
SetRegName(BPMEM_PERF0_TRI);
// TODO: Description
break;
case BPMEM_PERF0_QUAD: // 0x24
SetRegName(BPMEM_PERF0_QUAD);
// TODO: Description
break;
case BPMEM_RAS1_SS0: // 0x25
SetRegName(BPMEM_RAS1_SS0);
// TODO: Description
break;
case BPMEM_RAS1_SS1: // 0x26
SetRegName(BPMEM_RAS1_SS1);
// TODO: Description
break;
case BPMEM_IREF: // 0x27
SetRegName(BPMEM_IREF);
// TODO: Description
break;
case BPMEM_TREF: // 0x28
case BPMEM_TREF+1:
case BPMEM_TREF+2:
case BPMEM_TREF+3:
case BPMEM_TREF+4:
case BPMEM_TREF+5:
case BPMEM_TREF+6:
case BPMEM_TREF+7:
SetRegName(BPMEM_TREF);
// TODO: Description
break;
case BPMEM_SU_SSIZE: // 0x30
case BPMEM_SU_SSIZE+2:
case BPMEM_SU_SSIZE+4:
case BPMEM_SU_SSIZE+6:
case BPMEM_SU_SSIZE+8:
case BPMEM_SU_SSIZE+10:
case BPMEM_SU_SSIZE+12:
case BPMEM_SU_SSIZE+14:
SetRegName(BPMEM_SU_SSIZE);
// TODO: Description
break;
case BPMEM_SU_TSIZE: // 0x31
case BPMEM_SU_TSIZE+2:
case BPMEM_SU_TSIZE+4:
case BPMEM_SU_TSIZE+6:
case BPMEM_SU_TSIZE+8:
case BPMEM_SU_TSIZE+10:
case BPMEM_SU_TSIZE+12:
case BPMEM_SU_TSIZE+14:
SetRegName(BPMEM_SU_TSIZE);
// TODO: Description
break;
case BPMEM_ZMODE: // 0x40
SetRegName(BPMEM_ZMODE);
// TODO: Description
break;
case BPMEM_BLENDMODE: // 0x41
@ -718,7 +837,12 @@ void GetBPRegInfo(const u8* data, std::string* name, std::string* desc)
}
break;
case BPMEM_ZCOMPARE:
case BPMEM_CONSTANTALPHA: // 0x42
SetRegName(BPMEM_CONSTANTALPHA);
// TODO: Description
break;
case BPMEM_ZCOMPARE: // 0x43
{
SetRegName(BPMEM_ZCOMPARE);
PEControl config; config.hex = cmddata;
@ -731,6 +855,39 @@ void GetBPRegInfo(const u8* data, std::string* name, std::string* desc)
}
break;
case BPMEM_FIELDMASK: // 0x44
SetRegName(BPMEM_FIELDMASK);
// TODO: Description
break;
case BPMEM_SETDRAWDONE: // 0x45
SetRegName(BPMEM_SETDRAWDONE);
// TODO: Description
break;
case BPMEM_BUSCLOCK0: // 0x46
SetRegName(BPMEM_BUSCLOCK0);
// TODO: Description
break;
case BPMEM_PE_TOKEN_ID: // 0x47
SetRegName(BPMEM_PE_TOKEN_ID);
// TODO: Description
break;
case BPMEM_PE_TOKEN_INT_ID: // 0x48
SetRegName(BPMEM_PE_TOKEN_INT_ID);
// TODO: Description
break;
case BPMEM_EFB_TL: // 0x49
{
SetRegName(BPMEM_EFB_TL);
X10Y10 left_top; left_top.hex = cmddata;
*desc = StringFromFormat("Left: %d\nTop: %d", left_top.x, left_top.y);
}
break;
case BPMEM_EFB_BR: // 0x4A
{
// TODO: Misleading name, should be BPMEM_EFB_WH instead
@ -745,6 +902,11 @@ void GetBPRegInfo(const u8* data, std::string* name, std::string* desc)
*desc = StringFromFormat("Target address (32 byte aligned): 0x%06X", cmddata << 5);
break;
case BPMEM_MIPMAP_STRIDE: // 0x4D
SetRegName(BPMEM_MIPMAP_STRIDE);
// TODO: Description
break;
case BPMEM_COPYYSCALE: // 0x4E
SetRegName(BPMEM_COPYYSCALE);
*desc = StringFromFormat("Scaling factor (XFB copy only): 0x%X (%f or inverted %f)", cmddata, (float)cmddata/256.f, 256.f/(float)cmddata);
@ -804,6 +966,133 @@ void GetBPRegInfo(const u8* data, std::string* name, std::string* desc)
// TODO: Description
break;
case BPMEM_CLEARBBOX1: // 0x55
SetRegName(BPMEM_CLEARBBOX1);
// TODO: Description
break;
case BPMEM_CLEARBBOX2: // 0x56
SetRegName(BPMEM_CLEARBBOX2);
// TODO: Description
break;
case BPMEM_CLEAR_PIXEL_PERF: // 0x57
SetRegName(BPMEM_CLEAR_PIXEL_PERF);
// TODO: Description
break;
case BPMEM_REVBITS: // 0x58
SetRegName(BPMEM_REVBITS);
// TODO: Description
break;
case BPMEM_SCISSOROFFSET: // 0x59
SetRegName(BPMEM_SCISSOROFFSET);
// TODO: Description
break;
case BPMEM_PRELOAD_ADDR: // 0x60
SetRegName(BPMEM_PRELOAD_ADDR);
// TODO: Description
break;
case BPMEM_PRELOAD_TMEMEVEN: // 0x61
SetRegName(BPMEM_PRELOAD_TMEMEVEN);
// TODO: Description
break;
case BPMEM_PRELOAD_TMEMODD: // 0x62
SetRegName(BPMEM_PRELOAD_TMEMODD);
// TODO: Description
break;
case BPMEM_PRELOAD_MODE: // 0x63
SetRegName(BPMEM_PRELOAD_MODE);
// TODO: Description
break;
case BPMEM_LOADTLUT0: // 0x64
SetRegName(BPMEM_LOADTLUT0);
// TODO: Description
break;
case BPMEM_LOADTLUT1: // 0x65
SetRegName(BPMEM_LOADTLUT1);
// TODO: Description
break;
case BPMEM_TEXINVALIDATE: // 0x66
SetRegName(BPMEM_TEXINVALIDATE);
// TODO: Description
break;
case BPMEM_PERF1: // 0x67
SetRegName(BPMEM_PERF1);
// TODO: Description
break;
case BPMEM_FIELDMODE: // 0x68
SetRegName(BPMEM_FIELDMODE);
// TODO: Description
break;
case BPMEM_BUSCLOCK1: // 0x69
SetRegName(BPMEM_BUSCLOCK1);
// TODO: Description
break;
case BPMEM_TX_SETMODE0: // 0x80
case BPMEM_TX_SETMODE0+1:
case BPMEM_TX_SETMODE0+2:
case BPMEM_TX_SETMODE0+3:
SetRegName(BPMEM_TX_SETMODE0);
// TODO: Description
break;
case BPMEM_TX_SETMODE1: // 0x84
case BPMEM_TX_SETMODE1+1:
case BPMEM_TX_SETMODE1+2:
case BPMEM_TX_SETMODE1+3:
SetRegName(BPMEM_TX_SETMODE1);
// TODO: Description
break;
case BPMEM_TX_SETIMAGE0: // 0x88
case BPMEM_TX_SETIMAGE0+1:
case BPMEM_TX_SETIMAGE0+2:
case BPMEM_TX_SETIMAGE0+3:
case BPMEM_TX_SETIMAGE0_4: // 0xA8
case BPMEM_TX_SETIMAGE0_4+1:
case BPMEM_TX_SETIMAGE0_4+2:
case BPMEM_TX_SETIMAGE0_4+3:
SetRegName(BPMEM_TX_SETIMAGE0);
// TODO: Description
break;
case BPMEM_TX_SETIMAGE1: // 0x8C
case BPMEM_TX_SETIMAGE1+1:
case BPMEM_TX_SETIMAGE1+2:
case BPMEM_TX_SETIMAGE1+3:
case BPMEM_TX_SETIMAGE1_4: // 0xAC
case BPMEM_TX_SETIMAGE1_4+1:
case BPMEM_TX_SETIMAGE1_4+2:
case BPMEM_TX_SETIMAGE1_4+3:
SetRegName(BPMEM_TX_SETIMAGE1);
// TODO: Description
break;
case BPMEM_TX_SETIMAGE2: // 0x90
case BPMEM_TX_SETIMAGE2+1:
case BPMEM_TX_SETIMAGE2+2:
case BPMEM_TX_SETIMAGE2+3:
case BPMEM_TX_SETIMAGE2_4: // 0xB0
case BPMEM_TX_SETIMAGE2_4+1:
case BPMEM_TX_SETIMAGE2_4+2:
case BPMEM_TX_SETIMAGE2_4+3:
SetRegName(BPMEM_TX_SETIMAGE2);
// TODO: Description
break;
case BPMEM_TX_SETIMAGE3: // 0x94
case BPMEM_TX_SETIMAGE3+1:
case BPMEM_TX_SETIMAGE3+2:
@ -819,6 +1108,18 @@ void GetBPRegInfo(const u8* data, std::string* name, std::string* desc)
}
break;
case BPMEM_TX_SETTLUT: // 0x98
case BPMEM_TX_SETTLUT+1:
case BPMEM_TX_SETTLUT+2:
case BPMEM_TX_SETTLUT+3:
case BPMEM_TX_SETTLUT_4: // 0xB8
case BPMEM_TX_SETTLUT_4+1:
case BPMEM_TX_SETTLUT_4+2:
case BPMEM_TX_SETTLUT_4+3:
SetRegName(BPMEM_TX_SETTLUT);
// TODO: Description
break;
case BPMEM_TEV_COLOR_ENV: // 0xC0
case BPMEM_TEV_COLOR_ENV+2:
case BPMEM_TEV_COLOR_ENV+4:
@ -912,6 +1213,57 @@ void GetBPRegInfo(const u8* data, std::string* name, std::string* desc)
break;
}
case BPMEM_TEV_REGISTER_L: // 0xE0
case BPMEM_TEV_REGISTER_L+2:
case BPMEM_TEV_REGISTER_L+4:
case BPMEM_TEV_REGISTER_L+6:
SetRegName(BPMEM_TEV_REGISTER_L);
// TODO: Description
break;
case BPMEM_TEV_REGISTER_H: // 0xE1
case BPMEM_TEV_REGISTER_H+2:
case BPMEM_TEV_REGISTER_H+4:
case BPMEM_TEV_REGISTER_H+6:
SetRegName(BPMEM_TEV_REGISTER_H);
// TODO: Description
break;
case BPMEM_FOGRANGE: // 0xE8
case BPMEM_FOGRANGE+1:
case BPMEM_FOGRANGE+2:
case BPMEM_FOGRANGE+3:
case BPMEM_FOGRANGE+4:
case BPMEM_FOGRANGE+5:
SetRegName(BPMEM_FOGRANGE);
// TODO: Description
break;
case BPMEM_FOGPARAM0: // 0xEE
SetRegName(BPMEM_FOGPARAM0);
// TODO: Description
break;
case BPMEM_FOGBMAGNITUDE: // 0xEF
SetRegName(BPMEM_FOGBMAGNITUDE);
// TODO: Description
break;
case BPMEM_FOGBEXPONENT: // 0xF0
SetRegName(BPMEM_FOGBEXPONENT);
// TODO: Description
break;
case BPMEM_FOGPARAM3: // 0xF1
SetRegName(BPMEM_FOGPARAM3);
// TODO: Description
break;
case BPMEM_FOGCOLOR: // 0xF2
SetRegName(BPMEM_FOGCOLOR);
// TODO: Description
break;
case BPMEM_ALPHACOMPARE: // 0xF3
{
SetRegName(BPMEM_ALPHACOMPARE);
@ -925,6 +1277,28 @@ void GetBPRegInfo(const u8* data, std::string* name, std::string* desc)
break;
}
case BPMEM_BIAS: // 0xF4
SetRegName(BPMEM_BIAS);
// TODO: Description
break;
case BPMEM_ZTEX2: // 0xF5
SetRegName(BPMEM_ZTEX2);
// TODO: Description
break;
case BPMEM_TEV_KSEL: // 0xF6
case BPMEM_TEV_KSEL+1:
case BPMEM_TEV_KSEL+2:
case BPMEM_TEV_KSEL+3:
case BPMEM_TEV_KSEL+4:
case BPMEM_TEV_KSEL+5:
case BPMEM_TEV_KSEL+6:
case BPMEM_TEV_KSEL+7:
SetRegName(BPMEM_TEV_KSEL);
// TODO: Description
break;
#undef SetRegName
}
}