<commit_before>#include "FrameDump.h"
#include "MemoryStateFile.h"
#include "RegisterStateFile.h"

#define STATE_INITIAL_GSRAM				"init/gsram"
#define STATE_INITIAL_GSREGS			"init/gsregs"
#define STATE_PACKET_PREFIX				"packet_"
#define STATE_PACKET_METADATA_PREFIX	"packetmetadata_"

CFrameDump::CFrameDump()
{
	m_initialGsRam = new uint8[CGSHandler::RAMSIZE];
	Reset();
}

CFrameDump::~CFrameDump()
{
	delete [] m_initialGsRam;
}

void CFrameDump::Reset()
{
	m_packets.clear();
}

uint8* CFrameDump::GetInitialGsRam()
{
	return m_initialGsRam;
}

uint64* CFrameDump::GetInitialGsRegisters()
{
	return m_initialGsRegisters;
}

const CFrameDump::PacketArray& CFrameDump::GetPackets() const
{
	return m_packets;
}

void CFrameDump::AddPacket(const CGSHandler::RegisterWrite* registerWrites, uint32 count, const CGsPacketMetadata* metadata)
{
	CGsPacket packet;
	packet.writes = CGsPacket::WriteArray(registerWrites, registerWrites + count);
	if(metadata)
	{
		packet.metadata = *metadata;
	}
	m_packets.push_back(packet);
}

void CFrameDump::Read(Framework::CStream& input)
{
	Reset();<commit_msg>Clear frame dump contents when they are cleared.<commit_after>#include "FrameDump.h"
#include "MemoryStateFile.h"
#include "RegisterStateFile.h"

#define STATE_INITIAL_GSRAM				"init/gsram"
#define STATE_INITIAL_GSREGS			"init/gsregs"
#define STATE_PACKET_PREFIX				"packet_"
#define STATE_PACKET_METADATA_PREFIX	"packetmetadata_"

CFrameDump::CFrameDump()
{
	m_initialGsRam = new uint8[CGSHandler::RAMSIZE];
	Reset();
}

CFrameDump::~CFrameDump()
{
	delete [] m_initialGsRam;
}

void CFrameDump::Reset()
{
	m_packets.clear();
	memset(m_initialGsRam, 0, CGSHandler::RAMSIZE);
	memset(&m_initialGsRegisters, 0, sizeof(m_initialGsRegisters));
}

uint8* CFrameDump::GetInitialGsRam()
{
	return m_initialGsRam;
}

uint64* CFrameDump::GetInitialGsRegisters()
{
	return m_initialGsRegisters;
}

const CFrameDump::PacketArray& CFrameDump::GetPackets() const
{
	return m_packets;
}

void CFrameDump::AddPacket(const CGSHandler::RegisterWrite* registerWrites, uint32 count, const CGsPacketMetadata* metadata)
{
	CGsPacket packet;
	packet.writes = CGsPacket::WriteArray(registerWrites, registerWrites + count);
	if(metadata)
	{
		packet.metadata = *metadata;
	}
	m_packets.push_back(packet);
}

void CFrameDump::Read(Framework::CStream& input)
{
	Reset();
{'fraction_non_alphanumeric': 0.12217001281503631, 'fraction_numerical': 0.00598035027765912, 'mean_word_length': 7.516363636363637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1735902', 'n_tokens_mistral': 940, 'n_tokens_neox': 885, 'n_words': 144}