FifoFileStruct: replace unions with explicit padding

This commit is contained in:
Michael Maltese 2017-04-25 17:29:49 -07:00
parent 4d52df150b
commit f9a67fbf6f
1 changed files with 28 additions and 33 deletions

View File

@ -15,44 +15,38 @@ enum
MIN_LOADER_VERSION = 1, MIN_LOADER_VERSION = 1,
}; };
#pragma pack(push, 4) #pragma pack(push, 1)
union FileHeader struct FileHeader
{ {
struct u32 fileId;
{ u32 file_version;
u32 fileId; u32 min_loader_version;
u32 file_version; u64 bpMemOffset;
u32 min_loader_version; u32 bpMemSize;
u64 bpMemOffset; u64 cpMemOffset;
u32 bpMemSize; u32 cpMemSize;
u64 cpMemOffset; u64 xfMemOffset;
u32 cpMemSize; u32 xfMemSize;
u64 xfMemOffset; u64 xfRegsOffset;
u32 xfMemSize; u32 xfRegsSize;
u64 xfRegsOffset; u64 frameListOffset;
u32 xfRegsSize; u32 frameCount;
u64 frameListOffset; u32 flags;
u32 frameCount; u64 texMemOffset;
u32 flags; u32 texMemSize;
u64 texMemOffset; u8 reserved[40];
u32 texMemSize;
};
u32 rawData[32];
}; };
union FileFrameInfo struct FileFrameInfo
{ {
struct u64 fifoDataOffset;
{ u32 fifoDataSize;
u64 fifoDataOffset; u32 fifoStart;
u32 fifoDataSize; u32 fifoEnd;
u32 fifoStart; u64 memoryUpdatesOffset;
u32 fifoEnd; u32 numMemoryUpdates;
u64 memoryUpdatesOffset; u8 reserved[32];
u32 numMemoryUpdates;
};
u32 rawData[16];
}; };
struct FileMemoryUpdate struct FileMemoryUpdate
@ -62,6 +56,7 @@ struct FileMemoryUpdate
u64 dataOffset; u64 dataOffset;
u32 dataSize; u32 dataSize;
u8 type; u8 type;
u8 reserved[3];
}; };
#pragma pack(pop) #pragma pack(pop)