From b18fd3d3ce9d4de87635eb998da02467a1dca67c Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Tue, 24 May 2022 02:53:03 +0200 Subject: [PATCH] Core/State: Make memory layout of StateHeader more explicit. --- Source/Core/Core/State.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Core/Core/State.h b/Source/Core/Core/State.h index 03b548df29..0746fe332d 100644 --- a/Source/Core/Core/State.h +++ b/Source/Core/Core/State.h @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include @@ -19,9 +20,15 @@ static const u32 NUM_STATES = 10; struct StateHeader { char gameID[6]; + u16 reserved1; u32 size; + u32 reserved2; double time; }; +constexpr size_t STATE_HEADER_SIZE = sizeof(StateHeader); +static_assert(STATE_HEADER_SIZE == 24); +static_assert(offsetof(StateHeader, size) == 8); +static_assert(offsetof(StateHeader, time) == 16); void Init();