@@ -65,6 +65,7 @@
#include "VideoCommon/NetPlayChatUI.h"
#include "VideoCommon/NetPlayGolfUI.h"
#include "VideoCommon/OnScreenDisplay.h"
#include "VideoCommon/OpcodeDecoding.h"
#include "VideoCommon/PixelEngine.h"
#include "VideoCommon/PixelShaderManager.h"
#include "VideoCommon/PostProcessing.h"
@@ -880,19 +881,18 @@ std::tuple<int, int> Renderer::CalculateOutputDimensions(int width, int height)

void Renderer::CheckFifoRecording()
{
bool wasRecording = g_bRecordFifoData;
g_bRecordFifoData = FifoRecorder::GetInstance().IsRecording();
const bool was_recording = OpcodeDecoder::g_record_fifo_data;
OpcodeDecoder::g_record_fifo_data = FifoRecorder::GetInstance().IsRecording();

if (g_bRecordFifoData)
{
if (!wasRecording)
{
RecordVideoMemory();
}
if (!OpcodeDecoder::g_record_fifo_data)
return;

FifoRecorder::GetInstance().EndFrame(CommandProcessor::fifo.CPBase,
CommandProcessor::fifo.CPEnd);
if (!was_recording)
{
RecordVideoMemory();
}

FifoRecorder::GetInstance().EndFrame(CommandProcessor::fifo.CPBase, CommandProcessor::fifo.CPEnd);
}

void Renderer::RecordVideoMemory()
@@ -38,6 +38,7 @@
#include "VideoCommon/BPMemory.h"
#include "VideoCommon/FramebufferManager.h"
#include "VideoCommon/HiresTextures.h"
#include "VideoCommon/OpcodeDecoding.h"
#include "VideoCommon/PixelShaderManager.h"
#include "VideoCommon/RenderBase.h"
#include "VideoCommon/SamplerCommon.h"
@@ -1260,9 +1261,11 @@ TextureCacheBase::GetTexture(u32 address, u32 width, u32 height, const TextureFo

// If we are recording a FifoLog, keep track of what memory we read. FifoRecorder does
// its own memory modification tracking independent of the texture hashing below.
if (g_bRecordFifoData && !from_tmem)
if (OpcodeDecoder::g_record_fifo_data && !from_tmem)
{
FifoRecorder::GetInstance().UseMemory(address, texture_size + additional_mips_size,
MemoryUpdate::TEXTURE_MAP);
}

// TODO: This doesn't hash GB tiles for preloaded RGBA8 textures (instead, it's hashing more data
// from the low tmem bank than it should)
@@ -2294,7 +2297,7 @@ void TextureCacheBase::CopyRenderTargetToTexture(
++iter.first;
}

if (g_bRecordFifoData)
if (OpcodeDecoder::g_record_fifo_data)
{
// Mark the memory behind this efb copy as dynamicly generated for the Fifo log
u32 address = dstAddr;
@@ -6,9 +6,6 @@

#include "Common/CommonTypes.h"

// Global flag to signal if FifoRecorder is active.
extern bool g_bRecordFifoData;

// These are accurate (disregarding AA modes).
constexpr u32 EFB_WIDTH = 640;
constexpr u32 EFB_HEIGHT = 528;