OpcodeDecoding: Convert #defines into enum constants

Gets several constants out of global scope.
This commit is contained in:
Lioncash
2017-02-07 23:11:04 -05:00
parent 22fbcc67fc
commit d9d069e024
7 changed files with 110 additions and 97 deletions

View File

@ -55,12 +55,12 @@ u32 AnalyzeCommand(const u8* data, DecodeMode mode)
switch (cmd)
{
case GX_NOP:
case OpcodeDecoder::GX_NOP:
case 0x44:
case GX_CMD_INVL_VC:
case OpcodeDecoder::GX_CMD_INVL_VC:
break;
case GX_LOAD_CP_REG:
case OpcodeDecoder::GX_LOAD_CP_REG:
{
s_DrawingObject = false;
@ -70,7 +70,7 @@ u32 AnalyzeCommand(const u8* data, DecodeMode mode)
break;
}
case GX_LOAD_XF_REG:
case OpcodeDecoder::GX_LOAD_XF_REG:
{
s_DrawingObject = false;
@ -81,14 +81,14 @@ u32 AnalyzeCommand(const u8* data, DecodeMode mode)
break;
}
case GX_LOAD_INDX_A:
case GX_LOAD_INDX_B:
case GX_LOAD_INDX_C:
case GX_LOAD_INDX_D:
case OpcodeDecoder::GX_LOAD_INDX_A:
case OpcodeDecoder::GX_LOAD_INDX_B:
case OpcodeDecoder::GX_LOAD_INDX_C:
case OpcodeDecoder::GX_LOAD_INDX_D:
{
s_DrawingObject = false;
int array = 0xc + (cmd - GX_LOAD_INDX_A) / 8;
int array = 0xc + (cmd - OpcodeDecoder::GX_LOAD_INDX_A) / 8;
u32 value = ReadFifo32(data);
if (mode == DECODE_RECORD)
@ -96,7 +96,7 @@ u32 AnalyzeCommand(const u8* data, DecodeMode mode)
break;
}
case GX_CMD_CALL_DL:
case OpcodeDecoder::GX_CMD_CALL_DL:
// The recorder should have expanded display lists into the fifo stream and skipped the call to
// start them
// That is done to make it easier to track where memory is updated
@ -104,7 +104,7 @@ u32 AnalyzeCommand(const u8* data, DecodeMode mode)
data += 8;
break;
case GX_LOAD_BP_REG:
case OpcodeDecoder::GX_LOAD_BP_REG:
{
s_DrawingObject = false;
ReadFifo32(data);
@ -117,7 +117,7 @@ u32 AnalyzeCommand(const u8* data, DecodeMode mode)
s_DrawingObject = true;
int sizes[21];
FifoAnalyzer::CalculateVertexElementSizes(sizes, cmd & GX_VAT_MASK, s_CpMem);
CalculateVertexElementSizes(sizes, cmd & OpcodeDecoder::GX_VAT_MASK, s_CpMem);
// Determine offset of each element that might be a vertex array
// The first 9 elements are never vertex arrays so we just accumulate their sizes.