Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FifoRecorder: Use std::vector for m_Ram and m_ExRam #1670

Merged
merged 1 commit into from
Dec 11, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 4 additions & 9 deletions Source/Core/Core/FifoPlayer/FifoRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ FifoRecorder::FifoRecorder() :
m_SkipNextData(true),
m_SkipFutureData(true),
m_FrameEnded(false),
m_Ram(nullptr),
m_ExRam(nullptr)
m_Ram(Memory::RAM_SIZE),
m_ExRam(Memory::EXRAM_SIZE)
{
}

Expand All @@ -38,15 +38,10 @@ void FifoRecorder::StartRecording(s32 numFrames, CallbackFunc finishedCb)
sMutex.lock();

delete m_File;
delete []m_Ram;
delete []m_ExRam;

m_File = new FifoDataFile;

m_Ram = new u8[Memory::RAM_SIZE];
m_ExRam = new u8[Memory::EXRAM_SIZE];
memset(m_Ram, 0, Memory::RAM_SIZE);
memset(m_ExRam, 0, Memory::EXRAM_SIZE);
std::fill(m_Ram.begin(), m_Ram.end(), 0);
std::fill(m_ExRam.begin(), m_ExRam.end(), 0);

This comment was marked as off-topic.


m_File->SetIsWii(SConfig::GetInstance().m_LocalCoreStartupParameter.bWii);

Expand Down
6 changes: 4 additions & 2 deletions Source/Core/Core/FifoPlayer/FifoRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#pragma once

#include <vector>

#include "Core/FifoPlayer/FifoDataFile.h"
#include "Core/FifoPlayer/FifoRecordAnalyzer.h"

Expand Down Expand Up @@ -58,7 +60,7 @@ class FifoRecorder
bool m_FrameEnded;
FifoFrameInfo m_CurrentFrame;
std::vector<u8> m_FifoData;
u8 *m_Ram;
u8 *m_ExRam;
std::vector<u8> m_Ram;
std::vector<u8> m_ExRam;
FifoRecordAnalyzer m_RecordAnalyzer;
};