mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
GCMemcard: Use BigEndianValue for DEntry.m_icon_format.
This commit is contained in:
@ -452,12 +452,14 @@ std::string GCMemcard::DEntry_IconFmt(u8 index) const
|
|||||||
if (!m_valid || index >= DIRLEN)
|
if (!m_valid || index >= DIRLEN)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
int x = CurrentDir->m_dir_entries[index].m_icon_format[0];
|
std::array<u8, 2> tmp;
|
||||||
|
memcpy(tmp.data(), &CurrentDir->m_dir_entries[index].m_icon_format, 2);
|
||||||
|
int x = tmp[0];
|
||||||
std::string format;
|
std::string format;
|
||||||
for (int i = 0; i < 16; i++)
|
for (int i = 0; i < 16; i++)
|
||||||
{
|
{
|
||||||
if (i == 8)
|
if (i == 8)
|
||||||
x = CurrentDir->m_dir_entries[index].m_icon_format[1];
|
x = tmp[1];
|
||||||
format.push_back((x & 0x80) ? '1' : '0');
|
format.push_back((x & 0x80) ? '1' : '0');
|
||||||
x = x << 1;
|
x = x << 1;
|
||||||
}
|
}
|
||||||
@ -1047,7 +1049,10 @@ void GCMemcard::Gcs_SavConvert(DEntry& tempDEntry, int saveType, int length)
|
|||||||
ByteSwap(&tmp[2], &tmp[3]);
|
ByteSwap(&tmp[2], &tmp[3]);
|
||||||
memcpy(&tempDEntry.m_image_offset, tmp.data(), 4);
|
memcpy(&tempDEntry.m_image_offset, tmp.data(), 4);
|
||||||
|
|
||||||
ArrayByteSwap((tempDEntry.m_icon_format));
|
memcpy(tmp.data(), &tempDEntry.m_icon_format, 2);
|
||||||
|
ByteSwap(&tmp[0], &tmp[1]);
|
||||||
|
memcpy(&tempDEntry.m_icon_format, tmp.data(), 2);
|
||||||
|
|
||||||
ArrayByteSwap((tempDEntry.m_animation_speed));
|
ArrayByteSwap((tempDEntry.m_animation_speed));
|
||||||
ByteSwap(&tempDEntry.m_file_permissions, &tempDEntry.m_copy_counter);
|
ByteSwap(&tempDEntry.m_file_permissions, &tempDEntry.m_copy_counter);
|
||||||
ArrayByteSwap((tempDEntry.m_first_block));
|
ArrayByteSwap((tempDEntry.m_first_block));
|
||||||
@ -1112,7 +1117,7 @@ u32 GCMemcard::ReadAnimRGBA8(u8 index, u32* buffer, u8* delays) const
|
|||||||
// Sonic Heroes it the only game I have seen that tries to use a CI8 and RGB5A3 icon
|
// Sonic Heroes it the only game I have seen that tries to use a CI8 and RGB5A3 icon
|
||||||
// int fmtCheck = 0;
|
// int fmtCheck = 0;
|
||||||
|
|
||||||
int formats = BE16(CurrentDir->m_dir_entries[index].m_icon_format);
|
int formats = CurrentDir->m_dir_entries[index].m_icon_format;
|
||||||
int fdelays = BE16(CurrentDir->m_dir_entries[index].m_animation_speed);
|
int fdelays = BE16(CurrentDir->m_dir_entries[index].m_animation_speed);
|
||||||
|
|
||||||
int flags = CurrentDir->m_dir_entries[index].m_banner_and_icon_flags;
|
int flags = CurrentDir->m_dir_entries[index].m_banner_and_icon_flags;
|
||||||
|
@ -191,7 +191,7 @@ struct DEntry
|
|||||||
m_modification_time; // 0x28 0x04 Time of file's last modification in seconds since
|
m_modification_time; // 0x28 0x04 Time of file's last modification in seconds since
|
||||||
// 12am, January 1st, 2000
|
// 12am, January 1st, 2000
|
||||||
Common::BigEndianValue<u32> m_image_offset; // 0x2c 0x04 image data offset
|
Common::BigEndianValue<u32> m_image_offset; // 0x2c 0x04 image data offset
|
||||||
u8 m_icon_format[2]; // 0x30 0x02 icon gfx format (2bits per icon)
|
Common::BigEndianValue<u16> m_icon_format; // 0x30 0x02 icon gfx format (2bits per icon)
|
||||||
// Bits Description
|
// Bits Description
|
||||||
// 00 No icon
|
// 00 No icon
|
||||||
// 01 CI8 with a shared color palette after the last frame
|
// 01 CI8 with a shared color palette after the last frame
|
||||||
|
Reference in New Issue
Block a user