Libretro: Fixed save ram not being saved/loaded by frontend
This commit is contained in:
parent
2fa5ec2bc3
commit
9dbca4f26d
2 changed files with 8 additions and 1 deletions
|
@ -25,6 +25,13 @@ void BatteryManager::SetBatteryRecorder(shared_ptr<IBatteryRecorder> recorder)
|
|||
|
||||
void BatteryManager::SaveBattery(string extension, uint8_t* data, uint32_t length)
|
||||
{
|
||||
#ifdef LIBRETRO
|
||||
if(extension == ".srm") {
|
||||
//Disable .srm files for libretro, let the frontend handle save ram
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
ofstream out(GetBasePath() + extension, ios::binary);
|
||||
if(out) {
|
||||
out.write((char*)data, length);
|
||||
|
|
|
@ -677,7 +677,7 @@ extern "C" {
|
|||
RETRO_API size_t retro_get_memory_size(unsigned id)
|
||||
{
|
||||
switch(id) {
|
||||
case RETRO_MEMORY_SAVE_RAM: _console->GetCartridge()->DebugGetSaveRamSize(); break;
|
||||
case RETRO_MEMORY_SAVE_RAM: return _console->GetCartridge()->DebugGetSaveRamSize(); break;
|
||||
case RETRO_MEMORY_SYSTEM_RAM: return MemoryManager::WorkRamSize;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue