From 448a5996ce2cc467875106189ed24ce6836a90e5 Mon Sep 17 00:00:00 2001 From: spacy51 Date: Fri, 18 Sep 2009 19:43:59 +0000 Subject: [PATCH] FIX MBC2 saving/loading keep in mind VBA-M does NOT truncate the MBC2 ram reads/writes to 4bits, even though it should. FF Legend still saves&loads fine, though git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@909 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/gb/GB.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gb/GB.cpp b/src/gb/GB.cpp index 53ccef8e..794a5920 100644 --- a/src/gb/GB.cpp +++ b/src/gb/GB.cpp @@ -2715,9 +2715,9 @@ void gbWriteSaveMBC2(const char * name) return; } - fwrite(&gbMemory[0xa000], + fwrite(gbMemoryMap[0x0a], 1, - 256, + 512, file); fclose(file); @@ -2897,12 +2897,12 @@ bool gbReadSaveMBC2(const char * name) return false; } - size_t read = fread(&gbMemory[0xa000], + size_t read = fread(gbMemoryMap[0x0a], 1, - 256, + 512, file); - if(read != 256) { + if(read != 512) { systemMessage(MSG_FAILED_TO_READ_SGM, N_("Battery file's size incompatible with the rom settings %s (%d).\nWarning : save of the battery file is now disabled !"), name, read); fclose(file);