diff --git a/Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp b/Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp index c0b1bd2e9c..f2a369a84f 100644 --- a/Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp +++ b/Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp @@ -188,7 +188,7 @@ u32 AnalyzeCommand(const u8* data, DecodeMode mode) int array = 0xc + (cmd - OpcodeDecoder::GX_LOAD_INDX_A) / 8; u32 value = ReadFifo32(data); - if (mode == DECODE_RECORD) + if (mode == DecodeMode::Record) FifoRecordAnalyzer::ProcessLoadIndexedXf(value, array); break; } @@ -229,7 +229,7 @@ u32 AnalyzeCommand(const u8* data, DecodeMode mode) int vertexSize = offset; int numVertices = ReadFifo16(data); - if (mode == DECODE_RECORD && numVertices > 0) + if (mode == DecodeMode::Record && numVertices > 0) { for (int i = 0; i < 12; ++i) { diff --git a/Source/Core/Core/FifoPlayer/FifoAnalyzer.h b/Source/Core/Core/FifoPlayer/FifoAnalyzer.h index 550fe15489..52fbeb7179 100644 --- a/Source/Core/Core/FifoPlayer/FifoAnalyzer.h +++ b/Source/Core/Core/FifoPlayer/FifoAnalyzer.h @@ -10,10 +10,10 @@ namespace FifoAnalyzer { -enum DecodeMode +enum class DecodeMode { - DECODE_RECORD, - DECODE_PLAYBACK, + Record, + Playback, }; u32 AnalyzeCommand(const u8* data, DecodeMode mode); diff --git a/Source/Core/Core/FifoPlayer/FifoPlaybackAnalyzer.cpp b/Source/Core/Core/FifoPlayer/FifoPlaybackAnalyzer.cpp index 0458fe2fde..4b8da762bc 100644 --- a/Source/Core/Core/FifoPlayer/FifoPlaybackAnalyzer.cpp +++ b/Source/Core/Core/FifoPlayer/FifoPlaybackAnalyzer.cpp @@ -63,9 +63,9 @@ void FifoPlaybackAnalyzer::AnalyzeFrames(FifoDataFile* file, ++nextMemUpdate; } - bool wasDrawing = s_DrawingObject; - - u32 cmdSize = FifoAnalyzer::AnalyzeCommand(&frame.fifoData[cmdStart], DECODE_PLAYBACK); + const bool wasDrawing = s_DrawingObject; + const u32 cmdSize = + FifoAnalyzer::AnalyzeCommand(&frame.fifoData[cmdStart], DecodeMode::Playback); #if LOG_FIFO_CMDS CmdData cmdData; diff --git a/Source/Core/Core/FifoPlayer/FifoRecorder.cpp b/Source/Core/Core/FifoPlayer/FifoRecorder.cpp index f85eeb9aef..96329d695b 100644 --- a/Source/Core/Core/FifoPlayer/FifoRecorder.cpp +++ b/Source/Core/Core/FifoPlayer/FifoRecorder.cpp @@ -77,12 +77,14 @@ void FifoRecorder::WriteGPCommand(const u8* data, u32 size) { // Assumes data contains all information for the command // Calls FifoRecorder::UseMemory - u32 analyzed_size = FifoAnalyzer::AnalyzeCommand(data, FifoAnalyzer::DECODE_RECORD); + const u32 analyzed_size = FifoAnalyzer::AnalyzeCommand(data, FifoAnalyzer::DecodeMode::Record); // Make sure FifoPlayer's command analyzer agrees about the size of the command. if (analyzed_size != size) + { PanicAlert("FifoRecorder: Expected command to be %i bytes long, we were given %i bytes", analyzed_size, size); + } // Copy data to buffer size_t currentSize = m_FifoData.size();