diff --git a/CHANGES.md b/CHANGES.md index 4ea542a340..579f137c3a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -48,6 +48,7 @@ - SHADERS: SPIRV-Cross/slang shader support for D3D11. - SHIELD ATV: Allow the remote / gamepad takeover hack to work with the 2017 gamepad - SUBSYSTEM: Subsystem saves now respect the save directory +- SUBSYSTEM: You can now load subsystem games from the menu (see https://github.com/libretro/RetroArch/pull/6282 for caveats) - VULKAN: Fix swapchain recreation bug on Nvidia GPUs with Windows 10 (resolved in Windows Nvidia driver version 390.77). - WINDOWS: Improved Unicode support (for cores/directory creation and 7zip archives). - WINDOWS: Show progress meter on taskbar for downloads (Windows 7 and up). diff --git a/command.c b/command.c index 27ebfdeb72..ec707f5285 100644 --- a/command.c +++ b/command.c @@ -1219,6 +1219,8 @@ static bool event_init_content(void) if (rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL)) return true; + content_set_subsystem_info(); + if (!contentless) path_fill_names(); diff --git a/content.h b/content.h index eca57fa833..ad4211c5a0 100644 --- a/content.h +++ b/content.h @@ -100,6 +100,9 @@ void content_add_subsystem(const char* path); /* Get the current subsystem rom id */ int content_get_subsystem_rom_id(); +/* Set environment variables before a subsystem load */ +void content_set_subsystem_info(); + RETRO_END_DECLS diff --git a/paths.c b/paths.c index ab20de391c..8b8c4c8bd4 100644 --- a/paths.c +++ b/paths.c @@ -297,7 +297,6 @@ static bool path_init_subsystem(void) if (!system || path_is_empty(RARCH_PATH_SUBSYSTEM)) return false; - /* For subsystems, we know exactly which RAM types are supported. */ info = libretro_find_subsystem_info( @@ -306,7 +305,6 @@ static bool path_init_subsystem(void) path_get(RARCH_PATH_SUBSYSTEM)); /* We'll handle this error gracefully later. */ - if (info) { unsigned num_content = MIN(info->num_roms, diff --git a/tasks/task_content.c b/tasks/task_content.c index 9df179147b..3dd32415b3 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -285,7 +285,7 @@ static bool content_load(content_ctx_info_t *info) if (pending_subsystem_init) { - content_init(); + command_event(CMD_EVENT_CORE_INIT, NULL); content_clear_subsystem(); } @@ -1834,9 +1834,8 @@ void content_deinit(void) core_does_not_need_content = false; } -/* Initializes and loads a content file for the currently - * selected libretro core. */ -bool content_init(void) +/* Set environment variables before a subsystem load */ +void content_set_subsystem_info() { if (pending_subsystem_init) { @@ -1845,6 +1844,12 @@ bool content_init(void) /* hardcoded to 2 for testing please fix */ path_set_special(roms, pending_subsystem_rom_num); } +} + +/* Initializes and loads a content file for the currently + * selected libretro core. */ +bool content_init(void) +{ content_information_ctx_t content_ctx; bool ret = true;