commit fbd9b632f52c12828dca56b6447209c6e4af5bb9
Author: Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Wed Sep 6 19:52:19 2023 -0600
Commit: Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Wed Sep 6 19:52:19 2023 -0600
handle null retro_game_info by loading bios
---
platform/libretro/libretro.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/platform/libretro/libretro.cpp b/platform/libretro/libretro.cpp
index b3a119e..4291cc6 100644
--- a/platform/libretro/libretro.cpp
+++ b/platform/libretro/libretro.cpp
@@ -618,6 +618,11 @@ EXPORT void retro_cheat_set(unsigned index, bool enabled, const char *code)
EXPORT bool retro_load_game(struct retro_game_info const *info)
{
+ if (!info) {
+ _vm->QueueCartChange("__FAKE08-BIOS.p8");
+ return true;
+ }
+
auto containingDir = getDirectory(info->path);
if (containingDir.length() > 0) {
@@ -627,7 +632,6 @@ EXPORT bool retro_load_game(struct retro_game_info const *info)
if (info->size > 0) {
const unsigned char* data = reinterpret_cast<const unsigned char*>(info->data);
_vm->QueueCartChange(data, info->size);
-
}
else {
_vm->QueueCartChange(info->path);