GCMemcard: Use BigEndianValue for Header.m_format_time.

This commit is contained in:
Admiral H. Curtiss
2018-11-18 16:42:22 +01:00
parent 9f03c2f358
commit 905a16e7e7

View File

@ -103,7 +103,7 @@ struct Header // Offset Size Description
{ {
// Serial in libogc // Serial in libogc
u8 m_serial[12]; // 0x0000 12 ? u8 m_serial[12]; // 0x0000 12 ?
u64 m_format_time; // 0x000c 8 Time of format (OSTime value) Common::BigEndianValue<u64> m_format_time; // 0x000c 8 Time of format (OSTime value)
u32 m_sram_bias; // 0x0014 4 SRAM bias at time of format u32 m_sram_bias; // 0x0014 4 SRAM bias at time of format
u32 m_sram_language; // 0x0018 4 SRAM language u32 m_sram_language; // 0x0018 4 SRAM language
u8 m_unknown_2[4]; // 0x001c 4 ? almost always 0 u8 m_unknown_2[4]; // 0x001c 4 ? almost always 0
@ -139,7 +139,7 @@ struct Header // Offset Size Description
*(u16*)m_size_mb = BE16(sizeMb); *(u16*)m_size_mb = BE16(sizeMb);
m_encoding = BE16(shift_jis ? 1 : 0); m_encoding = BE16(shift_jis ? 1 : 0);
u64 rand = Common::Timer::GetLocalTimeSinceJan1970() - ExpansionInterface::CEXIIPL::GC_EPOCH; u64 rand = Common::Timer::GetLocalTimeSinceJan1970() - ExpansionInterface::CEXIIPL::GC_EPOCH;
m_format_time = Common::swap64(rand); m_format_time = rand;
for (int i = 0; i < 12; i++) for (int i = 0; i < 12; i++)
{ {
rand = (((rand * (u64)0x0000000041c64e6dULL) + (u64)0x0000000000003039ULL) >> 16); rand = (((rand * (u64)0x0000000041c64e6dULL) + (u64)0x0000000000003039ULL) >> 16);