mirror of
https://github.com/dborth/vbagx.git
synced 2024-12-25 02:02:02 +01:00
attempt to use upstream MBC2 save handling. (#474)
Taken from upstream VisualBoyAdvance-M code. Hope i didn't break MBC2 saving this time...
This commit is contained in:
parent
ffc8f4aadb
commit
9655bf6a22
@ -2756,7 +2756,7 @@ void gbWriteSaveMBC2(const char * name)
|
||||
return;
|
||||
}
|
||||
|
||||
fwrite(gbRam,
|
||||
fwrite(gbMemoryMap[0x0a],
|
||||
1,
|
||||
512,
|
||||
file);
|
||||
@ -2938,7 +2938,7 @@ bool gbReadSaveMBC2(const char * name)
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t read = fread(gbRam,
|
||||
size_t read = fread(gbMemoryMap[0x0a],
|
||||
1,
|
||||
512,
|
||||
file);
|
||||
@ -5516,7 +5516,7 @@ int MemgbWriteSaveMBC1(char * membuffer) {
|
||||
|
||||
int MemgbWriteSaveMBC2(char * membuffer) {
|
||||
if (gbRam) {
|
||||
memcpy(membuffer, gbRam, 512);
|
||||
memcpy(membuffer, gbMemoryMap[0x0a], 512);
|
||||
return 512;
|
||||
}
|
||||
return 0;
|
||||
@ -5604,7 +5604,7 @@ bool MemgbReadSaveMBC2(char * membuffer, int read) {
|
||||
if (read != 512)
|
||||
return false;
|
||||
else
|
||||
memcpy(gbRam, membuffer, read);
|
||||
memcpy(gbMemoryMap[0x0a], membuffer, read);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user