From cd2f3cf173e88c8c1e18108f9f21405c077352e8 Mon Sep 17 00:00:00 2001 From: Nekokabu Date: Fri, 30 Oct 2015 22:09:56 +0900 Subject: [PATCH] Support Dezaemon 3D saves (SRAM 96KB) Support Dezaemon 3D saves (SRAM 96KB) --- Source/Project64/N64 System/Mips/Sram.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/Project64/N64 System/Mips/Sram.cpp b/Source/Project64/N64 System/Mips/Sram.cpp index fc70b7f96..d1f588691 100644 --- a/Source/Project64/N64 System/Mips/Sram.cpp +++ b/Source/Project64/N64 System/Mips/Sram.cpp @@ -63,6 +63,10 @@ void CSram::DmaFromSram(BYTE * dest, int StartOffset, int len) return; } } + + // Fix Dezaemon 3D saves + StartOffset = ((StartOffset >> 3) & 0xFFFF8000) | (StartOffset & 0x7FFF); + DWORD Offset = StartOffset & 3; if (Offset == 0) @@ -145,7 +149,12 @@ void CSram::DmaToSram(BYTE * Source, int StartOffset, int len) return; } } + + // Fix Dezaemon 3D saves + StartOffset = ((StartOffset >> 3) & 0xFFFF8000) | (StartOffset & 0x7FFF); + DWORD Offset = StartOffset & 3; + if (Offset == 0) { SetFilePointer(m_hFile, StartOffset, NULL, FILE_BEGIN);