Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8895 from sepalani/card
GCMemcard: Rename unknown field to m_dtv_status
  • Loading branch information
leoetlino committed Oct 21, 2020
2 parents 18b2553 + 7f3c4b1 commit 7b9a464
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions Source/Core/Core/HW/GCMemcard/GCMemcard.cpp
Expand Up @@ -1567,11 +1567,9 @@ void InitializeHeaderData(HeaderData* data, const CardFlashId& flash_id, u16 siz
}
data->m_sram_bias = rtc_bias;
data->m_sram_language = sram_language;
// TODO: determine the purpose of m_unknown_2
// TODO: determine the purpose of m_dtv_status
// 1 works for slot A, 0 works for both slot A and slot B
std::memset(
data->m_unknown_2.data(), 0,
data->m_unknown_2.size()); // = _viReg[55]; static vu16* const _viReg = (u16*)0xCC002000;
data->m_dtv_status = 0;
data->m_device_id = 0;
}

Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/HW/GCMemcard/GCMemcard.h
Expand Up @@ -175,7 +175,7 @@ static_assert(std::is_trivially_copyable_v<GCMBlock>);
struct HeaderData
{
// NOTE: libogc refers to 'Serial' as the first 0x20 bytes of the header,
// so the data from m_serial until m_unknown_2 (inclusive)
// so the data from m_serial until m_dtv_status (inclusive)

// 12 bytes at 0x0000
std::array<u8, 12> m_serial;
Expand All @@ -189,8 +189,8 @@ struct HeaderData
// 4 bytes at 0x0018: SRAM language
Common::BigEndianValue<u32> m_sram_language;

// 4 bytes at 0x001c: ? almost always 0
std::array<u8, 4> m_unknown_2;
// 4 bytes at 0x001c: VI DTV status register value (u16 from 0xCC00206E)
u32 m_dtv_status;

// 2 bytes at 0x0020: 0 if formated in slot A, 1 if formated in slot B
Common::BigEndianValue<u16> m_device_id;
Expand Down

0 comments on commit 7b9a464

Please sign in to comment.