flush to file after importing SRAM
This commit is contained in:
parent
0d845c9e69
commit
ef4215e172
|
@ -1037,6 +1037,13 @@ void RelocateSave(const char* path, bool write)
|
||||||
int ImportSRAM(const u8* data, u32 length)
|
int ImportSRAM(const u8* data, u32 length)
|
||||||
{
|
{
|
||||||
memcpy(NDSCart_SRAM::SRAM, data, std::min(length, NDSCart_SRAM::SRAMLength));
|
memcpy(NDSCart_SRAM::SRAM, data, std::min(length, NDSCart_SRAM::SRAMLength));
|
||||||
|
FILE* f = Platform::OpenFile(NDSCart_SRAM::SRAMPath, "wb");
|
||||||
|
if (f)
|
||||||
|
{
|
||||||
|
fwrite(NDSCart_SRAM::SRAM, NDSCart_SRAM::SRAMLength, 1, f);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
|
||||||
return length - NDSCart_SRAM::SRAMLength;
|
return length - NDSCart_SRAM::SRAMLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue