Simplify copy_core_to_temp_file

This commit is contained in:
twinaphex 2020-01-30 21:45:43 +01:00
parent 0421d463f8
commit 5ef559f6d8
1 changed files with 16 additions and 43 deletions

View File

@ -11050,46 +11050,28 @@ static bool secondary_core_create(void)
secondary_core.inited = is_inited; secondary_core.inited = is_inited;
/* Load Content */ /* Load Content */
if (!load_content_info || load_content_info->special)
{
/* disabled due to crashes */ /* disabled due to crashes */
if (!load_content_info || load_content_info->special)
return false; return false;
#if 0
secondary_core.game_loaded = secondary_core.retro_load_game_special( if (load_content_info->content->size > 0 && load_content_info->content->elems[0].data)
loadContentInfo.special->id, loadContentInfo.info, loadContentInfo.content->size); {
secondary_core.game_loaded = secondary_core.retro_load_game(
load_content_info->info);
if (!secondary_core.game_loaded) if (!secondary_core.game_loaded)
{ goto error;
secondary_core_destroy();
return false;
}
#endif
}
else if (load_content_info->content->size > 0 && load_content_info->content->elems[0].data)
{
secondary_core.game_loaded = secondary_core.retro_load_game(load_content_info->info);
if (!secondary_core.game_loaded)
{
secondary_core_destroy();
return false;
}
} }
else if (contentless) else if (contentless)
{ {
secondary_core.game_loaded = secondary_core.retro_load_game(NULL); secondary_core.game_loaded = secondary_core.retro_load_game(NULL);
if (!secondary_core.game_loaded) if (!secondary_core.game_loaded)
{ goto error;
secondary_core_destroy();
return false;
}
} }
else else
secondary_core.game_loaded = false; secondary_core.game_loaded = false;
if (!secondary_core.inited) if (!secondary_core.inited)
{ goto error;
secondary_core_destroy();
return false;
}
core_set_default_callbacks(&secondary_callbacks); core_set_default_callbacks(&secondary_callbacks);
secondary_core.retro_set_video_refresh(secondary_callbacks.frame_cb); secondary_core.retro_set_video_refresh(secondary_callbacks.frame_cb);
@ -11108,6 +11090,10 @@ static bool secondary_core_create(void)
clear_controller_port_map(); clear_controller_port_map();
return true; return true;
error:
secondary_core_destroy();
return false;
} }
static void secondary_core_input_poll_null(void) { } static void secondary_core_input_poll_null(void) { }
@ -11139,24 +11125,11 @@ bool secondary_core_run_use_last_input(void)
return true; return true;
} }
#else #else
bool secondary_core_deserialize(const void *buffer, int size) bool secondary_core_deserialize(const void *buffer, int size) { return false; }
{ static void secondary_core_destroy(void) { }
return false; static void remember_controller_port_device(long port, long device) { }
} static void clear_controller_port_map(void) { }
static void secondary_core_destroy(void)
{
}
static void remember_controller_port_device(long port, long device)
{
}
static void clear_controller_port_map(void)
{
}
#endif #endif
#endif #endif