GCMemcard: Use BigEndianValue for Header.m_sram_language.

This commit is contained in:
Admiral H. Curtiss 2018-11-18 16:46:30 +01:00
parent 905a16e7e7
commit b3ce882109
1 changed files with 6 additions and 6 deletions

View File

@ -102,11 +102,11 @@ void calc_checksumsBE(const u16* buf, u32 length, u16* csum, u16* inv_csum);
struct Header // Offset Size Description
{
// Serial in libogc
u8 m_serial[12]; // 0x0000 12 ?
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_language; // 0x0018 4 SRAM language
u8 m_unknown_2[4]; // 0x001c 4 ? almost always 0
u8 m_serial[12]; // 0x0000 12 ?
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
Common::BigEndianValue<u32> m_sram_language; // 0x0018 4 SRAM language
u8 m_unknown_2[4]; // 0x001c 4 ? almost always 0
// end Serial in libogc
u8 m_device_id[2]; // 0x0020 2 0 if formated in slot A 1 if formated in slot B
u8 m_size_mb[2]; // 0x0022 2 Size of memcard in Mbits
@ -148,7 +148,7 @@ struct Header // Offset Size Description
rand &= (u64)0x0000000000007fffULL;
}
m_sram_bias = g_SRAM.settings.rtc_bias;
m_sram_language = BE32(g_SRAM.settings.language);
m_sram_language = static_cast<u32>(g_SRAM.settings.language);
// TODO: determine the purpose of m_unknown_2
// 1 works for slot A, 0 works for both slot A and slot B
*(u32*)&m_unknown_2 = 0; // = _viReg[55]; static vu16* const _viReg = (u16*)0xCC002000;