From d86d5d62ad9d876727e006f18eb31cfd45665bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 6 Aug 2017 19:00:19 +0800 Subject: [PATCH 1/3] IOS/SDIO: Add missing save calls in DoState --- Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp | 2 ++ Source/Core/Core/State.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp index d75135d5b9..8d28792f3e 100644 --- a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp +++ b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp @@ -61,6 +61,8 @@ void SDIOSlot0::DoState(PointerWrap& p) p.Do(m_block_length); p.Do(m_bus_width); p.Do(m_registers); + p.Do(m_protocol); + p.Do(m_sdhc_supported); } void SDIOSlot0::EventNotify() diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index 9af7b25439..73ce9271af 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -73,7 +73,7 @@ static Common::Event g_compressAndDumpStateSyncEvent; static std::thread g_save_thread; // Don't forget to increase this after doing changes on the savestate system -static const u32 STATE_VERSION = 88; // Last changed in PR 5733 +static const u32 STATE_VERSION = 89; // Last changed in PR 5890 // Maps savestate versions to Dolphin versions. // Versions after 42 don't need to be added to this list, From c24418a82263705582597b622a8b281d36f326e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 6 Aug 2017 19:00:56 +0800 Subject: [PATCH 2/3] IOS/SDIO: Fix warnings about missing braces --- Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp index 8d28792f3e..7b13e6df6b 100644 --- a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp +++ b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp @@ -579,10 +579,10 @@ std::array SDIOSlot0::GetCSDv1() constexpr u32 crc = 0; // Form the csd using the description above - return { + return {{ 0x007f003, 0x5b5f8000 | (c_size >> 2), 0x3ffc7f80 | (c_size << 30) | (c_size_mult << 15), 0x07c04001 | (crc << 1), - }; + }}; } std::array SDIOSlot0::GetCSDv2() @@ -634,9 +634,9 @@ std::array SDIOSlot0::GetCSDv2() constexpr u32 crc = 0; // Form the csd using the description above - return { + return {{ 0x400e005a, 0x5f590000 | (c_size >> 16), 0x00007f80 | (c_size << 16), 0x0a400001 | (crc << 1), - }; + }}; } u64 SDIOSlot0::GetAddressFromRequest(u32 arg) const From 9f36499f9e586a0360b259898de8dd3d487cb267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 7 Aug 2017 00:48:51 +0800 Subject: [PATCH 3/3] IOS/SDIO: Make GetCSDv1/v2 const member functions --- Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp | 4 ++-- Source/Core/Core/IOS/SDIO/SDIOSlot0.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp index 7b13e6df6b..a832c66b38 100644 --- a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp +++ b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp @@ -503,7 +503,7 @@ u32 SDIOSlot0::GetOCRegister() const return ocr; } -std::array SDIOSlot0::GetCSDv1() +std::array SDIOSlot0::GetCSDv1() const { u64 size = m_card.GetSize(); @@ -585,7 +585,7 @@ std::array SDIOSlot0::GetCSDv1() }}; } -std::array SDIOSlot0::GetCSDv2() +std::array SDIOSlot0::GetCSDv2() const { const u64 size = m_card.GetSize(); diff --git a/Source/Core/Core/IOS/SDIO/SDIOSlot0.h b/Source/Core/Core/IOS/SDIO/SDIOSlot0.h index 6f0f0255c6..ee6e3115e0 100644 --- a/Source/Core/Core/IOS/SDIO/SDIOSlot0.h +++ b/Source/Core/Core/IOS/SDIO/SDIOSlot0.h @@ -145,8 +145,8 @@ private: u32 GetOCRegister() const; - std::array GetCSDv1(); - std::array GetCSDv2(); + std::array GetCSDv1() const; + std::array GetCSDv2() const; void InitSDHC(); u64 GetAddressFromRequest(u32 arg) const;