mirror of
https://github.com/dborth/vbagx.git
synced 2024-11-22 02:29:16 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite(gbRam,
|
fwrite(gbMemoryMap[0x0a],
|
||||||
1,
|
1,
|
||||||
512,
|
512,
|
||||||
file);
|
file);
|
||||||
@ -2938,7 +2938,7 @@ bool gbReadSaveMBC2(const char * name)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t read = fread(gbRam,
|
size_t read = fread(gbMemoryMap[0x0a],
|
||||||
1,
|
1,
|
||||||
512,
|
512,
|
||||||
file);
|
file);
|
||||||
@ -5516,7 +5516,7 @@ int MemgbWriteSaveMBC1(char * membuffer) {
|
|||||||
|
|
||||||
int MemgbWriteSaveMBC2(char * membuffer) {
|
int MemgbWriteSaveMBC2(char * membuffer) {
|
||||||
if (gbRam) {
|
if (gbRam) {
|
||||||
memcpy(membuffer, gbRam, 512);
|
memcpy(membuffer, gbMemoryMap[0x0a], 512);
|
||||||
return 512;
|
return 512;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -5604,7 +5604,7 @@ bool MemgbReadSaveMBC2(char * membuffer, int read) {
|
|||||||
if (read != 512)
|
if (read != 512)
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
memcpy(gbRam, membuffer, read);
|
memcpy(gbMemoryMap[0x0a], membuffer, read);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user