From 1e08ceb6ead52fcc4c783c1f39dde3ec6e2e6e83 Mon Sep 17 00:00:00 2001 From: skidau Date: Wed, 6 May 2015 09:43:09 +0000 Subject: [PATCH] Made EEPROM and SRAM save type detection override the general FLASH 64KB detection. Fixes the save auto-detect of Saibara Rieko no Dendou Mahjong. git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1393 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/Util.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Util.cpp b/src/Util.cpp index fdcc58e9..aa296b5a 100644 --- a/src/Util.cpp +++ b/src/Util.cpp @@ -709,12 +709,12 @@ void utilGBAFindSave(const int size) if(d == 0x52504545) { if(memcmp(p, "EEPROM_", 7) == 0) { - if(detectedSaveType == 0) + if(detectedSaveType == 0 || detectedSaveType == 4) detectedSaveType = 1; } } else if (d == 0x4D415253) { if(memcmp(p, "SRAM_", 5) == 0) { - if(detectedSaveType == 0) + if(detectedSaveType == 0 || detectedSaveType == 4) detectedSaveType = 2; } } else if (d == 0x53414C46) { @@ -725,7 +725,7 @@ void utilGBAFindSave(const int size) } } else if(memcmp(p, "FLASH", 5) == 0) { if(detectedSaveType == 0) { - detectedSaveType = 3; + detectedSaveType = 4; flashSize = 0x10000; } } @@ -739,6 +739,9 @@ void utilGBAFindSave(const int size) if(detectedSaveType == 0) { detectedSaveType = 5; } + if(detectedSaveType == 4) { + detectedSaveType = 3; + } rtcEnable(rtcFound); saveType = detectedSaveType; flashSetSize(flashSize);