libretro: Pass the filename to the underlying emulation, since we can detect things based on what it contains.

This commit is contained in:
Stephen Anthony 2020-03-21 18:35:12 -02:30
parent 4d248c97df
commit a3b536c94d
3 changed files with 8 additions and 5 deletions

View File

@ -61,8 +61,6 @@ bool StellaLIBRETRO::create(bool logging)
{
system_ready = false;
FilesystemNode rom("rom");
// build play system
destroy();
@ -115,6 +113,8 @@ bool StellaLIBRETRO::create(bool logging)
settings.setValue(AudioSettings::SETTING_VOLUME, 100);
settings.setValue(AudioSettings::SETTING_STEREO, audio_mode);
FilesystemNode rom(rom_path);
if(myOSystem->createConsole(rom) != EmptyString)
return false;
@ -334,8 +334,10 @@ bool StellaLIBRETRO::getVideoResize()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void StellaLIBRETRO::setROM(const void* data, size_t size)
void StellaLIBRETRO::setROM(const char* path, const void* data, size_t size)
{
rom_path = path;
memcpy(rom_image.get(), data, size);
rom_size = static_cast<uInt32>(size);

View File

@ -96,7 +96,7 @@ class StellaLIBRETRO
Int16* getAudioBuffer() { return audio_buffer.get(); }
public:
void setROM(const void* data, size_t size);
void setROM(const char* path, const void* data, size_t size);
void setConsoleFormat(uInt32 mode);
@ -139,6 +139,7 @@ class StellaLIBRETRO
unique_ptr<uInt8[]> rom_image;
uInt32 rom_size;
string rom_path;
ConsoleTiming console_timing;
string console_format;

View File

@ -574,7 +574,7 @@ bool retro_load_game(const struct retro_game_info *info)
}
stella.setROM(info->data, info->size);
stella.setROM(info->path, info->data, info->size);
return reset_system();
}