From 96d56cd8effd5fd847ea489bb48a9b02fe6fb2ec Mon Sep 17 00:00:00 2001 From: LPFaint99 Date: Wed, 18 Jan 2012 22:41:35 -0800 Subject: [PATCH] fix for memcard manager using sjis for ascii encoded string thanks to gerbilsoft for finding my mistake, fixes issue 5148 --- Source/Core/Core/Src/HW/GCMemcard.cpp | 4 ++-- Source/Core/Core/Src/HW/GCMemcard.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/HW/GCMemcard.cpp b/Source/Core/Core/Src/HW/GCMemcard.cpp index 2471e76599..cab7d950a2 100644 --- a/Source/Core/Core/Src/HW/GCMemcard.cpp +++ b/Source/Core/Core/Src/HW/GCMemcard.cpp @@ -1126,7 +1126,7 @@ bool GCMemcard::Format(u8 * card_data, bool sjis, u16 SizeMb) gcp.bat_backup = (BlockAlloc *)(card_data + BLOCK_SIZE*4); *(u16*)gcp.hdr->SizeMb = BE16(SizeMb); - *(u16*)gcp.hdr->Encoding = BE16(sjis ? 1 : 0); + gcp.hdr->Encoding = BE16(sjis ? 1 : 0); FormatInternal(gcp); return true; @@ -1148,7 +1148,7 @@ bool GCMemcard::Format(bool sjis, u16 SizeMb) gcp.bat_backup = &bat_backup; *(u16*)hdr.SizeMb = BE16(SizeMb); - *(u16*)hdr.Encoding = BE16(sjis ? 1 : 0); + hdr.Encoding = BE16(sjis ? 1 : 0); FormatInternal(gcp); m_sizeMb = SizeMb; diff --git a/Source/Core/Core/Src/HW/GCMemcard.h b/Source/Core/Core/Src/HW/GCMemcard.h index 5aa0a3c97f..8c7baa4774 100644 --- a/Source/Core/Core/Src/HW/GCMemcard.h +++ b/Source/Core/Core/Src/HW/GCMemcard.h @@ -91,7 +91,7 @@ private: // end Serial in libogc u8 deviceID[2]; //0x0020 2 0 if formated in slot A 1 if formated in slot B u8 SizeMb[2]; //0x0022 2 size of memcard in Mbits - u8 Encoding[2]; //0x0024 2 encoding (ASCII or japanese) + u16 Encoding; //0x0024 2 encoding (ASCII or japanese) u8 Unused1[468]; //0x0026 468 unused (0xff) u8 UpdateCounter[2];//0x01fa 2 update Counter (?, probably unused) u16 Checksum; //0x01fc 2 Additive Checksum