mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 13:20:43 +00:00
Fix subsystem loading
This commit is contained in:
parent
14227c101b
commit
0f35e0639e
29
content.c
29
content.c
@ -593,13 +593,12 @@ static bool load_content(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool init_content_file_subsystem(
|
static const struct retro_subsystem_info *init_content_file_subsystem(
|
||||||
const struct retro_subsystem_info *special,
|
bool *ret, rarch_system_info_t *system)
|
||||||
rarch_system_info_t *system
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
special = libretro_find_subsystem_info(system->special,
|
const struct retro_subsystem_info *special =
|
||||||
|
libretro_find_subsystem_info(system->special,
|
||||||
system->num_special, global->subsystem);
|
system->num_special, global->subsystem);
|
||||||
|
|
||||||
if (!special)
|
if (!special)
|
||||||
@ -607,14 +606,14 @@ static bool init_content_file_subsystem(
|
|||||||
RARCH_ERR(
|
RARCH_ERR(
|
||||||
"Failed to find subsystem \"%s\" in libretro implementation.\n",
|
"Failed to find subsystem \"%s\" in libretro implementation.\n",
|
||||||
global->subsystem);
|
global->subsystem);
|
||||||
return false;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (special->num_roms && !global->subsystem_fullpaths)
|
if (special->num_roms && !global->subsystem_fullpaths)
|
||||||
{
|
{
|
||||||
RARCH_ERR("libretro core requires special content, "
|
RARCH_ERR("libretro core requires special content, "
|
||||||
"but none were provided.\n");
|
"but none were provided.\n");
|
||||||
return false;
|
goto error;
|
||||||
}
|
}
|
||||||
else if (special->num_roms && special->num_roms
|
else if (special->num_roms && special->num_roms
|
||||||
!= global->subsystem_fullpaths->size)
|
!= global->subsystem_fullpaths->size)
|
||||||
@ -623,7 +622,7 @@ static bool init_content_file_subsystem(
|
|||||||
"subsystem \"%s\", but %u content files were provided.\n",
|
"subsystem \"%s\", but %u content files were provided.\n",
|
||||||
special->num_roms, special->desc,
|
special->num_roms, special->desc,
|
||||||
(unsigned)global->subsystem_fullpaths->size);
|
(unsigned)global->subsystem_fullpaths->size);
|
||||||
return false;
|
goto error;
|
||||||
}
|
}
|
||||||
else if (!special->num_roms && global->subsystem_fullpaths
|
else if (!special->num_roms && global->subsystem_fullpaths
|
||||||
&& global->subsystem_fullpaths->size)
|
&& global->subsystem_fullpaths->size)
|
||||||
@ -632,10 +631,15 @@ static bool init_content_file_subsystem(
|
|||||||
"but %u content files were provided.\n",
|
"but %u content files were provided.\n",
|
||||||
special->desc,
|
special->desc,
|
||||||
(unsigned)global->subsystem_fullpaths->size);
|
(unsigned)global->subsystem_fullpaths->size);
|
||||||
return false;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
*ret = true;
|
||||||
|
return special;
|
||||||
|
|
||||||
|
error:
|
||||||
|
*ret = false;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_ZLIB
|
#ifdef HAVE_ZLIB
|
||||||
@ -773,8 +777,11 @@ static bool content_init_file(struct string_list *temporary_content)
|
|||||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
||||||
|
|
||||||
if (*global->subsystem)
|
if (*global->subsystem)
|
||||||
if (!init_content_file_subsystem(special, system))
|
{
|
||||||
|
special = init_content_file_subsystem(&ret, system);
|
||||||
|
if (!ret)
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
content = string_list_new();
|
content = string_list_new();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user