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

@ -650,7 +650,7 @@ void FifoPlayerDlg::OnObjectListSelectionChanged(wxCommandEvent& event)
int command = *objectdata++;
switch (command)
{
case GX_NOP:
case OpcodeDecoder::GX_NOP:
newLabel = "NOP";
break;
@ -658,11 +658,11 @@ void FifoPlayerDlg::OnObjectListSelectionChanged(wxCommandEvent& event)
newLabel = "0x44";
break;
case GX_CMD_INVL_VC:
case OpcodeDecoder::GX_CMD_INVL_VC:
newLabel = "GX_CMD_INVL_VC";
break;
case GX_LOAD_CP_REG:
case OpcodeDecoder::GX_LOAD_CP_REG:
{
u32 cmd2 = *objectdata++;
u32 value = Common::swap32(objectdata);
@ -672,7 +672,7 @@ void FifoPlayerDlg::OnObjectListSelectionChanged(wxCommandEvent& event)
}
break;
case GX_LOAD_XF_REG:
case OpcodeDecoder::GX_LOAD_XF_REG:
{
u32 cmd2 = Common::swap32(objectdata);
objectdata += 4;
@ -693,19 +693,22 @@ void FifoPlayerDlg::OnObjectListSelectionChanged(wxCommandEvent& event)
}
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:
{
objectdata += 4;
newLabel = wxString::Format("LOAD INDX %s", (command == GX_LOAD_INDX_A) ?
"A" :
(command == GX_LOAD_INDX_B) ?
"B" :
(command == GX_LOAD_INDX_C) ? "C" : "D");
break;
newLabel = wxString::Format("LOAD INDX %s",
(command == OpcodeDecoder::GX_LOAD_INDX_A) ?
"A" :
(command == OpcodeDecoder::GX_LOAD_INDX_B) ?
"B" :
(command == OpcodeDecoder::GX_LOAD_INDX_C) ? "C" : "D");
}
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
@ -714,7 +717,7 @@ void FifoPlayerDlg::OnObjectListSelectionChanged(wxCommandEvent& event)
newLabel = wxString::Format("CALL DL");
break;
case GX_LOAD_BP_REG:
case OpcodeDecoder::GX_LOAD_BP_REG:
{
u32 cmd2 = Common::swap32(objectdata);
objectdata += 4;
@ -759,7 +762,7 @@ void FifoPlayerDlg::OnObjectCmdListSelectionChanged(wxCommandEvent& event)
// TODO: Not sure whether we should bother translating the descriptions
wxString newLabel;
if (*cmddata == GX_LOAD_BP_REG)
if (*cmddata == OpcodeDecoder::GX_LOAD_BP_REG)
{
std::string name;
std::string desc;
@ -775,11 +778,11 @@ void FifoPlayerDlg::OnObjectCmdListSelectionChanged(wxCommandEvent& event)
else
newLabel += StrToWxStr(desc);
}
else if (*cmddata == GX_LOAD_CP_REG)
else if (*cmddata == OpcodeDecoder::GX_LOAD_CP_REG)
{
newLabel = _("CP register ");
}
else if (*cmddata == GX_LOAD_XF_REG)
else if (*cmddata == OpcodeDecoder::GX_LOAD_XF_REG)
{
newLabel = _("XF register ");
}