mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Merge pull request #5322 from ligfx/cleanfifofile
FifoPlayer: replace union structures with explicit byte padding
This commit is contained in:
commit
e9ad0ec612
@ -340,7 +340,6 @@
|
|||||||
<ClInclude Include="ec_wii.h" />
|
<ClInclude Include="ec_wii.h" />
|
||||||
<ClInclude Include="FifoPlayer\FifoAnalyzer.h" />
|
<ClInclude Include="FifoPlayer\FifoAnalyzer.h" />
|
||||||
<ClInclude Include="FifoPlayer\FifoDataFile.h" />
|
<ClInclude Include="FifoPlayer\FifoDataFile.h" />
|
||||||
<ClInclude Include="FifoPlayer\FifoFileStruct.h" />
|
|
||||||
<ClInclude Include="FifoPlayer\FifoPlaybackAnalyzer.h" />
|
<ClInclude Include="FifoPlayer\FifoPlaybackAnalyzer.h" />
|
||||||
<ClInclude Include="FifoPlayer\FifoPlayer.h" />
|
<ClInclude Include="FifoPlayer\FifoPlayer.h" />
|
||||||
<ClInclude Include="FifoPlayer\FifoRecordAnalyzer.h" />
|
<ClInclude Include="FifoPlayer\FifoRecordAnalyzer.h" />
|
||||||
|
@ -961,9 +961,6 @@
|
|||||||
<ClInclude Include="FifoPlayer\FifoDataFile.h">
|
<ClInclude Include="FifoPlayer\FifoDataFile.h">
|
||||||
<Filter>FifoPlayer</Filter>
|
<Filter>FifoPlayer</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="FifoPlayer\FifoFileStruct.h">
|
|
||||||
<Filter>FifoPlayer</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="FifoPlayer\FifoPlaybackAnalyzer.h">
|
<ClInclude Include="FifoPlayer\FifoPlaybackAnalyzer.h">
|
||||||
<Filter>FifoPlayer</Filter>
|
<Filter>FifoPlayer</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -9,9 +9,62 @@
|
|||||||
#include "Common/FileUtil.h"
|
#include "Common/FileUtil.h"
|
||||||
|
|
||||||
#include "Core/FifoPlayer/FifoDataFile.h"
|
#include "Core/FifoPlayer/FifoDataFile.h"
|
||||||
#include "Core/FifoPlayer/FifoFileStruct.h"
|
|
||||||
|
|
||||||
using namespace FifoFileStruct;
|
enum
|
||||||
|
{
|
||||||
|
FILE_ID = 0x0d01f1f0,
|
||||||
|
VERSION_NUMBER = 4,
|
||||||
|
MIN_LOADER_VERSION = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
#pragma pack(push, 1)
|
||||||
|
|
||||||
|
struct FileHeader
|
||||||
|
{
|
||||||
|
u32 fileId;
|
||||||
|
u32 file_version;
|
||||||
|
u32 min_loader_version;
|
||||||
|
u64 bpMemOffset;
|
||||||
|
u32 bpMemSize;
|
||||||
|
u64 cpMemOffset;
|
||||||
|
u32 cpMemSize;
|
||||||
|
u64 xfMemOffset;
|
||||||
|
u32 xfMemSize;
|
||||||
|
u64 xfRegsOffset;
|
||||||
|
u32 xfRegsSize;
|
||||||
|
u64 frameListOffset;
|
||||||
|
u32 frameCount;
|
||||||
|
u32 flags;
|
||||||
|
u64 texMemOffset;
|
||||||
|
u32 texMemSize;
|
||||||
|
u8 reserved[40];
|
||||||
|
};
|
||||||
|
static_assert(sizeof(FileHeader) == 128, "FileHeader should be 128 bytes");
|
||||||
|
|
||||||
|
struct FileFrameInfo
|
||||||
|
{
|
||||||
|
u64 fifoDataOffset;
|
||||||
|
u32 fifoDataSize;
|
||||||
|
u32 fifoStart;
|
||||||
|
u32 fifoEnd;
|
||||||
|
u64 memoryUpdatesOffset;
|
||||||
|
u32 numMemoryUpdates;
|
||||||
|
u8 reserved[32];
|
||||||
|
};
|
||||||
|
static_assert(sizeof(FileFrameInfo) == 64, "FileFrameInfo should be 64 bytes");
|
||||||
|
|
||||||
|
struct FileMemoryUpdate
|
||||||
|
{
|
||||||
|
u32 fifoPosition;
|
||||||
|
u32 address;
|
||||||
|
u64 dataOffset;
|
||||||
|
u32 dataSize;
|
||||||
|
u8 type;
|
||||||
|
u8 reserved[3];
|
||||||
|
};
|
||||||
|
static_assert(sizeof(FileMemoryUpdate) == 24, "FileMemoryUpdate should be 24 bytes");
|
||||||
|
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
FifoDataFile::FifoDataFile() = default;
|
FifoDataFile::FifoDataFile() = default;
|
||||||
|
|
||||||
|
@ -1,68 +0,0 @@
|
|||||||
// Copyright 2011 Dolphin Emulator Project
|
|
||||||
// Licensed under GPLv2+
|
|
||||||
// Refer to the license.txt file included.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
|
||||||
|
|
||||||
namespace FifoFileStruct
|
|
||||||
{
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
FILE_ID = 0x0d01f1f0,
|
|
||||||
VERSION_NUMBER = 4,
|
|
||||||
MIN_LOADER_VERSION = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
#pragma pack(push, 4)
|
|
||||||
|
|
||||||
union FileHeader
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
u32 fileId;
|
|
||||||
u32 file_version;
|
|
||||||
u32 min_loader_version;
|
|
||||||
u64 bpMemOffset;
|
|
||||||
u32 bpMemSize;
|
|
||||||
u64 cpMemOffset;
|
|
||||||
u32 cpMemSize;
|
|
||||||
u64 xfMemOffset;
|
|
||||||
u32 xfMemSize;
|
|
||||||
u64 xfRegsOffset;
|
|
||||||
u32 xfRegsSize;
|
|
||||||
u64 frameListOffset;
|
|
||||||
u32 frameCount;
|
|
||||||
u32 flags;
|
|
||||||
u64 texMemOffset;
|
|
||||||
u32 texMemSize;
|
|
||||||
};
|
|
||||||
u32 rawData[32];
|
|
||||||
};
|
|
||||||
|
|
||||||
union FileFrameInfo
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
u64 fifoDataOffset;
|
|
||||||
u32 fifoDataSize;
|
|
||||||
u32 fifoStart;
|
|
||||||
u32 fifoEnd;
|
|
||||||
u64 memoryUpdatesOffset;
|
|
||||||
u32 numMemoryUpdates;
|
|
||||||
};
|
|
||||||
u32 rawData[16];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct FileMemoryUpdate
|
|
||||||
{
|
|
||||||
u32 fifoPosition;
|
|
||||||
u32 address;
|
|
||||||
u64 dataOffset;
|
|
||||||
u32 dataSize;
|
|
||||||
u8 type;
|
|
||||||
};
|
|
||||||
|
|
||||||
#pragma pack(pop)
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user