mirror of
https://github.com/libretro/RetroArch
synced 2024-12-26 21:29:08 +00:00
[netplay] load subsystem content
cleanup cleanup
This commit is contained in:
parent
9d0472c3ac
commit
dad3fe42db
@ -109,6 +109,9 @@ void content_set_subsystem_info(void);
|
||||
/* Get the path to the last selected subsystem rom */
|
||||
char* content_get_subsystem_rom(unsigned index);
|
||||
|
||||
/* Sets the subsystem by name */
|
||||
bool content_set_subsystem_by_name(const char* subsystem_name);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -741,6 +741,7 @@ static int action_bind_sublabel_netplay_room(
|
||||
corename, core_ver, subsystem,
|
||||
!string_is_equal(gamename, na) ? buf : na
|
||||
);
|
||||
string_list_free(list);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -332,7 +332,6 @@ bool netplay_lan_ad_server(netplay_t *netplay)
|
||||
if (i < subsystem->size - 1)
|
||||
strlcat(buf, "|", NETPLAY_HOST_LONGSTR_LEN);
|
||||
}
|
||||
RARCH_LOG("%s\n", buf);
|
||||
strlcpy(ad_packet_buffer.content, buf,
|
||||
NETPLAY_HOST_LONGSTR_LEN);
|
||||
strlcpy(ad_packet_buffer.subsystem_name, path_get(RARCH_PATH_SUBSYSTEM),
|
||||
|
@ -1811,6 +1811,32 @@ void content_set_subsystem(unsigned idx)
|
||||
pending_subsystem_id, pending_subsystem_ident, pending_subsystem_rom_num);
|
||||
}
|
||||
|
||||
/* Sets the subsystem by name */
|
||||
bool content_set_subsystem_by_name(const char* subsystem_name)
|
||||
{
|
||||
rarch_system_info_t *system = runloop_get_system_info();
|
||||
const struct retro_subsystem_info *subsystem;
|
||||
unsigned i = 0;
|
||||
|
||||
/* Core fully loaded, use the subsystem data */
|
||||
if (system->subsystem.data)
|
||||
subsystem = system->subsystem.data;
|
||||
/* Core not loaded completely, use the data we peeked on load core */
|
||||
else
|
||||
subsystem = subsystem_data;
|
||||
|
||||
for (i = 0; i < subsystem_current_count; i++, subsystem++)
|
||||
{
|
||||
if (string_is_equal(subsystem_name, subsystem->ident))
|
||||
{
|
||||
content_set_subsystem(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Add a rom to the subsystem rom buffer */
|
||||
void content_add_subsystem(const char* path)
|
||||
{
|
||||
|
@ -66,7 +66,22 @@ static void netplay_crc_scan_callback(void *task_data,
|
||||
|
||||
if (!string_is_empty(state->subsystem_name) && !string_is_equal(state->subsystem_name, "N/A"))
|
||||
{
|
||||
RARCH_LOG("[lobby] subsystem not supported\n");
|
||||
content_ctx_info_t content_info = {0};
|
||||
struct string_list *game_list = string_split(state->content_path, "|");
|
||||
unsigned i = 0;
|
||||
|
||||
task_push_load_new_core(state->core_path, NULL,
|
||||
&content_info, CORE_TYPE_PLAIN, NULL, NULL);
|
||||
content_clear_subsystem();
|
||||
if (!content_set_subsystem_by_name(state->subsystem_name))
|
||||
RARCH_LOG("[lobby] subsystem not found in implementation\n");
|
||||
|
||||
for (i = 0; i < game_list->size; i++)
|
||||
content_add_subsystem(game_list->elems[i].data);
|
||||
task_push_load_subsystem_with_core_from_menu(
|
||||
NULL, &content_info,
|
||||
CORE_TYPE_PLAIN, NULL, NULL);
|
||||
string_list_free(game_list);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -301,7 +316,6 @@ static void task_netplay_crc_scan_handler(retro_task_t *task)
|
||||
}
|
||||
task_set_progress(task, (int)(j / playlist_size * 100.0));
|
||||
}
|
||||
|
||||
free(playlist);
|
||||
}
|
||||
}
|
||||
@ -357,7 +371,6 @@ static void task_netplay_crc_scan_handler(retro_task_t *task)
|
||||
}
|
||||
task_set_progress(task, (int)(j / playlist_size * 100.0));
|
||||
}
|
||||
|
||||
free(playlist);
|
||||
}
|
||||
}
|
||||
@ -368,7 +381,7 @@ static void task_netplay_crc_scan_handler(retro_task_t *task)
|
||||
if (found[i] == false)
|
||||
{
|
||||
state->found = false;
|
||||
filename_match[0] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -377,10 +390,10 @@ static void task_netplay_crc_scan_handler(retro_task_t *task)
|
||||
RARCH_LOG("[lobby] subsystem matching set found %s\n", state->content_path);
|
||||
task_set_data(task, state);
|
||||
finish_task(task, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_COMPAT_CONTENT_FOUND));
|
||||
string_list_free(state->lpl_list);
|
||||
string_list_free(game_list);
|
||||
return;
|
||||
}
|
||||
string_list_free(state->lpl_list);
|
||||
string_list_free(game_list);
|
||||
return;
|
||||
}
|
||||
|
||||
if(filename_match != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user