mirror of https://github.com/stella-emu/stella.git
libretro: Pass the filename to the underlying emulation, since we can detect things based on what it contains.
This commit is contained in:
parent
4d248c97df
commit
a3b536c94d
|
@ -61,8 +61,6 @@ bool StellaLIBRETRO::create(bool logging)
|
||||||
{
|
{
|
||||||
system_ready = false;
|
system_ready = false;
|
||||||
|
|
||||||
FilesystemNode rom("rom");
|
|
||||||
|
|
||||||
// build play system
|
// build play system
|
||||||
destroy();
|
destroy();
|
||||||
|
|
||||||
|
@ -115,6 +113,8 @@ bool StellaLIBRETRO::create(bool logging)
|
||||||
settings.setValue(AudioSettings::SETTING_VOLUME, 100);
|
settings.setValue(AudioSettings::SETTING_VOLUME, 100);
|
||||||
settings.setValue(AudioSettings::SETTING_STEREO, audio_mode);
|
settings.setValue(AudioSettings::SETTING_STEREO, audio_mode);
|
||||||
|
|
||||||
|
FilesystemNode rom(rom_path);
|
||||||
|
|
||||||
if(myOSystem->createConsole(rom) != EmptyString)
|
if(myOSystem->createConsole(rom) != EmptyString)
|
||||||
return false;
|
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);
|
memcpy(rom_image.get(), data, size);
|
||||||
|
|
||||||
rom_size = static_cast<uInt32>(size);
|
rom_size = static_cast<uInt32>(size);
|
||||||
|
|
|
@ -96,7 +96,7 @@ class StellaLIBRETRO
|
||||||
Int16* getAudioBuffer() { return audio_buffer.get(); }
|
Int16* getAudioBuffer() { return audio_buffer.get(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void setROM(const void* data, size_t size);
|
void setROM(const char* path, const void* data, size_t size);
|
||||||
|
|
||||||
void setConsoleFormat(uInt32 mode);
|
void setConsoleFormat(uInt32 mode);
|
||||||
|
|
||||||
|
@ -139,6 +139,7 @@ class StellaLIBRETRO
|
||||||
|
|
||||||
unique_ptr<uInt8[]> rom_image;
|
unique_ptr<uInt8[]> rom_image;
|
||||||
uInt32 rom_size;
|
uInt32 rom_size;
|
||||||
|
string rom_path;
|
||||||
|
|
||||||
ConsoleTiming console_timing;
|
ConsoleTiming console_timing;
|
||||||
string console_format;
|
string console_format;
|
||||||
|
|
|
@ -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();
|
return reset_system();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue