diff --git a/Makefile.common b/Makefile.common index ae667704fa..972d61e34e 100644 --- a/Makefile.common +++ b/Makefile.common @@ -259,12 +259,16 @@ OBJ += frontend/frontend.o \ $(LIBRETRO_COMM_DIR)/features/features_cpu.o \ performance_counters.o \ verbosity.o \ - runahead/copy_load_info.o \ + +ifeq ($(HAVE_RUNAHEAD), 1) +DEFINES += -DHAVE_RUNAHEAD +OBJ += runahead/copy_load_info.o \ runahead/dirty_input.o \ runahead/mem_util.o \ runahead/mylist.o \ runahead/run_ahead.o \ runahead/secondary_core.o +endif diff --git a/core_impl.c b/core_impl.c index ce33e8e4d0..5acc659943 100644 --- a/core_impl.c +++ b/core_impl.c @@ -44,8 +44,10 @@ #include "gfx/video_driver.h" #include "audio/audio_driver.h" +#ifdef HAVE_RUNAHEAD #include "runahead/copy_load_info.h" #include "runahead/secondary_core.h" +#endif struct retro_callbacks retro_ctx; struct retro_core_t current_core; @@ -266,7 +268,9 @@ bool core_set_controller_port_device(retro_ctx_controller_info_t *pad) if (!pad) return false; +#ifdef HAVE_RUNAHEAD remember_controller_port_device(pad->port, pad->device); +#endif current_core.retro_set_controller_port_device(pad->port, pad->device); return true; @@ -286,7 +290,9 @@ bool core_load_game(retro_ctx_load_content_info_t *load_info) bool contentless = false; bool is_inited = false; +#ifdef HAVE_RUNAHEAD set_load_content_info(load_info); +#endif content_get_status(&contentless, &is_inited); diff --git a/dynamic.c b/dynamic.c index 22d4476900..e312e03cc6 100644 --- a/dynamic.c +++ b/dynamic.c @@ -66,7 +66,9 @@ #include "msg_hash.h" #include "verbosity.h" +#ifdef HAVE_RUNAHEAD #include "runahead/secondary_core.h" +#endif #ifdef HAVE_DYNAMIC #define SYMBOL(x) do { \ @@ -393,24 +395,28 @@ bool init_libretro_sym_custom(enum rarch_core_type type, struct retro_core_t *cu { case CORE_TYPE_PLAIN: #ifdef HAVE_DYNAMIC - - if (lib_path == NULL || lib_handle_p == NULL) +#ifdef HAVE_RUNAHEAD + if (!lib_path || !lib_handle_p) +#endif { if (!load_dynamic_core()) return false; lib_handle_local = lib_handle; } +#ifdef HAVE_RUNAHEAD else { - /* for a secondary core, we already have a primary library loaded, so we can skip some checks and just load the library */ + /* for a secondary core, we already have a + * primary library loaded, so we can skip + * some checks and just load the library */ retro_assert(lib_path != NULL && lib_handle_p != NULL); lib_handle_local = dylib_load(lib_path); - if (lib_handle_local == NULL) - { + + if (!lib_handle_local) return false; - } *lib_handle_p = lib_handle_local; } +#endif #endif SYMBOL(retro_init); @@ -659,8 +665,11 @@ bool init_libretro_sym(enum rarch_core_type type, struct retro_core_t *current_c if (!load_symbols(type, current_core)) return false; - /* remember last core type created, so creating a secondary core will know what core type to use */ +#ifdef HAVE_RUNAHEAD + /* remember last core type created, so creating a + * secondary core will know what core type to use. */ set_last_core_type(type); +#endif return true; } diff --git a/griffin/griffin.c b/griffin/griffin.c index 40b0f89ac7..5cf227c954 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -1255,12 +1255,14 @@ MENU #include "../libretro-common/net/net_http_parse.c" #endif +#ifdef HAVE_RUNAHEAD #include "../runahead/mem_util.c" #include "../runahead/secondary_core.c" #include "../runahead/run_ahead.c" #include "../runahead/copy_load_info.c" #include "../runahead/dirty_input.c" #include "../runahead/mylist.c" +#endif /*============================================================ DEPENDENCIES diff --git a/qb/config.params.sh b/qb/config.params.sh index a1be97d869..94135f94f6 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -11,6 +11,7 @@ HAVE_MATERIALUI=auto # MaterialUI menu HAVE_XMB=auto # XMB menu HAVE_ZARCH=no # Zarch menu HAVE_NUKLEAR=no # Nuklear menu +HAVE_RUNAHEAD=yes # Runahead support HAVE_OVERLAY=yes # Overlay support HAVE_DYNAMIC=yes # Dynamic loading of libretro library HAVE_SDL=auto # SDL support diff --git a/retroarch.c b/retroarch.c index a15ab8e714..eee794302a 100644 --- a/retroarch.c +++ b/retroarch.c @@ -118,7 +118,9 @@ #include "command.h" +#ifdef HAVE_RUNAHEAD #include "runahead/run_ahead.h" +#endif #define _PSUPP(var, name, desc) printf(" %s:\n\t\t%s: %s\n", name, desc, _##var##_supp ? "yes" : "no") @@ -3250,10 +3252,12 @@ int runloop_iterate(unsigned *sleep_ms) if ((settings->uints.video_frame_delay > 0) && !input_nonblock_state) retro_sleep(settings->uints.video_frame_delay); +#ifdef HAVE_RUNAHEAD /* Run Ahead Feature replaces the call to core_run in this loop */ if (settings->bools.run_ahead_enabled && settings->uints.run_ahead_frames > 0) run_ahead(settings->uints.run_ahead_frames, settings->bools.run_ahead_secondary_instance); else +#endif core_run(); #ifdef HAVE_CHEEVOS