diff --git a/Makefile.ps3 b/Makefile.ps3 index f753764956..a3ca25e517 100644 --- a/Makefile.ps3 +++ b/Makefile.ps3 @@ -106,7 +106,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe -DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -DWANT_MINIZ -DSINC_LOWER_QUALITY -DHAVE_CC_RESAMPLER -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN -DHAVE_BUILTIN_AUTOCONFIG +DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -DWANT_MINIZ -DSINC_LOWER_QUALITY -DHAVE_CC_RESAMPLER -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN -DHAVE_BUILTIN_AUTOCONFIG ifeq ($(DEBUG), 1) PPU_OPTIMIZE_LV := -O0 -g diff --git a/android/phoenix/jni/Application.mk b/android/phoenix/jni/Application.mk index e86c6a1747..f332ad4667 100644 --- a/android/phoenix/jni/Application.mk +++ b/android/phoenix/jni/Application.mk @@ -3,4 +3,9 @@ ifeq ($(GLES),3) else APP_PLATFORM := $(NDK_NO_GL_HEADER_VER) endif -APP_ABI := armeabi-v7a mips x86 + +ifndef TARGET_ABIS + APP_ABI := armeabi-v7a mips x86 +else + APP_ABI := $(TARGET_ABIS) +endif diff --git a/apple/common/main.m b/apple/common/main.m index db680102bd..95dc201fbf 100644 --- a/apple/common/main.m +++ b/apple/common/main.m @@ -42,7 +42,7 @@ void apple_run_core(int argc, char **argv, const char* core, strlcpy(core_path, core, sizeof(core_path)); strlcpy(config_path, g_defaults.config_path, sizeof(config_path)); - core_info_has_custom_config(core, config_path, sizeof(config_path)); + core_info_get_custom_config(core, config_path, sizeof(config_path)); static const char* const argv_game[] = { "retroarch", "-c", config_path, "-L", core_path, file_path, 0 }; static const char* const argv_menu[] = { "retroarch", "-c", config_path, "--menu", 0 }; diff --git a/apple/iOS/menu.m b/apple/iOS/menu.m index edeeaba491..3baff5d374 100644 --- a/apple/iOS/menu.m +++ b/apple/iOS/menu.m @@ -787,7 +787,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, U rarch_setting_t *setting_data, *setting; NSMutableArray* settings; - _isCustom = core_info_has_custom_config(core.UTF8String, buffer, sizeof(buffer)); + _isCustom = core_info_get_custom_config(core.UTF8String, buffer, sizeof(buffer)); if (_isCustom) { const core_info_t *tmp = (const core_info_t*)core_info_list_get_by_id(core.UTF8String); @@ -925,7 +925,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, U char path[PATH_MAX]; NSString* core_id = BOXSTRING(core_list->list[i].path); - if (core_info_has_custom_config(core_id.UTF8String, path, sizeof(path))) + if (core_info_get_custom_config(core_id.UTF8String, path, sizeof(path))) { [cores addObject:[RAMenuItemBasic itemWithDescription:BOXSTRING(core_list->list[i].display_name) association:core_id @@ -979,7 +979,7 @@ static bool copy_config(const char *src_path, const char *dst_path) action:^(NSString* core) { char path[PATH_MAX]; - if (!core_info_has_custom_config(core.UTF8String, path, sizeof(path))) + if (!core_info_get_custom_config(core.UTF8String, path, sizeof(path))) { if (g_defaults.config_path[0] != '\0' && path[0] != '\0') { diff --git a/config.def.h b/config.def.h index 22696754ea..d7f5cc54d5 100644 --- a/config.def.h +++ b/config.def.h @@ -494,7 +494,7 @@ static const bool savestate_auto_load = true; static const float slowmotion_ratio = 3.0; // Maximum fast forward ratio (Zero => no limit). -static const float fastforward_ratio = 0.0; +static const float fastforward_ratio = -1.0; // Enable stdin/network command interface static const bool network_cmd_enable = false; diff --git a/core_info.c b/core_info.c index 2e872ab28e..16c8e87acc 100644 --- a/core_info.c +++ b/core_info.c @@ -456,7 +456,7 @@ const core_info_t *core_info_list_get_by_id(const char *core_id) return NULL; } -bool core_info_has_custom_config(const char *core_id, +bool core_info_get_custom_config(const char *core_id, char *buf, size_t sizeof_buf) { if (!core_id || !buf || !sizeof_buf) diff --git a/core_info.h b/core_info.h index d6a4807d43..74bd7b8bd9 100644 --- a/core_info.h +++ b/core_info.h @@ -92,7 +92,7 @@ void core_info_set_core_path(void); core_info_list_t *core_info_list_get(void); const core_info_t *core_info_list_get_by_id(const char *core_id); -bool core_info_has_custom_config(const char *core_id, char *buf, size_t sizeof_buf); +bool core_info_get_custom_config(const char *core_id, char *buf, size_t sizeof_buf); #ifdef __cplusplus } diff --git a/frontend/menu/backend/menu_common_backend.c b/frontend/menu/backend/menu_common_backend.c index f3f2e2021a..1346413393 100644 --- a/frontend/menu/backend/menu_common_backend.c +++ b/frontend/menu/backend/menu_common_backend.c @@ -1919,32 +1919,56 @@ static void menu_common_setting_set_current_path_selection(rarch_setting_t *sett static void menu_common_setting_set_current_fraction(rarch_setting_t *setting, unsigned action) { - switch (action) + if (!strcmp(setting->name, "fastforward_ratio")) { - case MENU_ACTION_LEFT: - *setting->value.fraction = *setting->value.fraction - setting->step; + bool clamp_value = false; + if (action == MENU_ACTION_START) + *setting->value.fraction = setting->default_value.fraction; + else if (action == MENU_ACTION_LEFT) + { + *setting->value.fraction -= setting->step; + if (*setting->value.fraction < 0.95f) // Avoid potential rounding errors when going from 1.1 to 1.0. + *setting->value.fraction = setting->default_value.fraction; + else + clamp_value = true; + } + else if (action == MENU_ACTION_RIGHT) + { + *setting->value.fraction += setting->step; + clamp_value = true; + } + if (clamp_value) + g_settings.fastforward_ratio = max(min(*setting->value.fraction, setting->max), 1.0f); + } + else + { + switch (action) + { + case MENU_ACTION_LEFT: + *setting->value.fraction = *setting->value.fraction - setting->step; - if (setting->enforce_minrange) - { - if (*setting->value.fraction < setting->min) - *setting->value.fraction = setting->min; - } - break; + if (setting->enforce_minrange) + { + if (*setting->value.fraction < setting->min) + *setting->value.fraction = setting->min; + } + break; - case MENU_ACTION_RIGHT: - case MENU_ACTION_OK: - *setting->value.fraction = *setting->value.fraction + setting->step; + case MENU_ACTION_RIGHT: + case MENU_ACTION_OK: + *setting->value.fraction = *setting->value.fraction + setting->step; - if (setting->enforce_maxrange) - { - if (*setting->value.fraction > setting->max) - *setting->value.fraction = setting->max; - } - break; + if (setting->enforce_maxrange) + { + if (*setting->value.fraction > setting->max) + *setting->value.fraction = setting->max; + } + break; - case MENU_ACTION_START: - *setting->value.fraction = setting->default_value.fraction; - break; + case MENU_ACTION_START: + *setting->value.fraction = setting->default_value.fraction; + break; + } } if (setting->change_handler) diff --git a/retroarch.c b/retroarch.c index 6bb9f7b0ce..b8c84645a1 100644 --- a/retroarch.c +++ b/retroarch.c @@ -81,7 +81,7 @@ static void check_fast_forward_button(void) static bool take_screenshot_viewport(void) { char screenshot_path[PATH_MAX]; - const char *screenshot_dir; + const char *screenshot_dir = NULL; uint8_t *buffer = NULL; bool retval = false; struct rarch_viewport vp = {0}; @@ -444,7 +444,9 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_ if (g_extern.filter.filter && data) { - unsigned owidth, oheight, opitch = 0; + unsigned owidth = 0; + unsigned oheight = 0; + unsigned opitch = 0; rarch_softfilter_get_output_size(g_extern.filter.filter, &owidth, &oheight, width, height); @@ -474,13 +476,13 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_ void rarch_render_cached_frame(void) { const void *frame = g_extern.frame_cache.data; + void *recording = g_extern.rec; - // Cannot allow recording when pushing duped frames. - void *recording = g_extern.rec; + /* Cannot allow recording when pushing duped frames. */ g_extern.rec = NULL; if (frame == RETRO_HW_FRAME_BUFFER_VALID) - frame = NULL; // Dupe + frame = NULL; /* Dupe */ // Not 100% safe, since the library might have // freed the memory, but no known implementations do this :D @@ -612,17 +614,18 @@ static size_t audio_sample_batch(const int16_t *data, size_t frames) frames = AUDIO_CHUNK_SIZE_NONBLOCKING >> 1; g_extern.audio_active = audio_flush(data, frames << 1) && g_extern.audio_active; + return frames; } #ifdef HAVE_OVERLAY static inline void input_poll_overlay(void) { + input_overlay_state_t old_key_state; unsigned i, j, device; uint16_t key_mod = 0; bool polled = false; - input_overlay_state_t old_key_state; memcpy(old_key_state.keys, driver.overlay_state.keys, sizeof(driver.overlay_state.keys)); memset(&driver.overlay_state, 0, sizeof(driver.overlay_state)); @@ -1379,15 +1382,18 @@ static void parse_input(int argc, char *argv[]) static void init_controllers(void) { unsigned i; + for (i = 0; i < MAX_PLAYERS; i++) { unsigned device = g_settings.input.libretro_device[i]; const struct retro_controller_description *desc = NULL; + const char *ident = NULL; if (i < g_extern.system.num_ports) desc = libretro_find_controller_description(&g_extern.system.ports[i], device); - const char *ident = desc ? desc->desc : NULL; + if (desc) + ident = desc->desc; if (!ident) { @@ -2135,7 +2141,7 @@ static void check_rewind(void) if (input_key_pressed_func(RARCH_REWIND)) { - const void *buf; + const void *buf = NULL; msg_queue_clear(g_extern.msg_queue); if (state_manager_pop(g_extern.state_manager, &buf)) @@ -2720,12 +2726,11 @@ void rarch_check_block_hotkey(void) void rarch_check_overlay(void) { static bool old_pressed = false; - bool pressed; + bool pressed = input_key_pressed_func(RARCH_OVERLAY_NEXT); if (!driver.overlay) return; - pressed = input_key_pressed_func(RARCH_OVERLAY_NEXT); if (pressed && !old_pressed) input_overlay_next(driver.overlay); @@ -2755,14 +2760,6 @@ static void check_grab_mouse_toggle(void) static void check_flip(void) { -#ifdef HAVE_NETPLAY - if (g_extern.netplay) - { - check_netplay_flip(); - return; - } -#endif - check_pause(); check_oneshot(); @@ -2805,7 +2802,12 @@ static void do_state_checks(void) rarch_check_overlay(); #endif - check_flip(); +#ifdef HAVE_NETPLAY + if (g_extern.netplay) + check_netplay_flip(); + else +#endif + check_flip(); } static void init_state(void) @@ -3028,7 +3030,8 @@ error: static inline bool check_enter_menu(void) { static bool old_rmenu_toggle = true; - bool rmenu_toggle = input_key_pressed_func(RARCH_MENU_TOGGLE) || (g_extern.libretro_dummy && !old_rmenu_toggle); + bool rmenu_toggle = input_key_pressed_func(RARCH_MENU_TOGGLE) + || (g_extern.libretro_dummy && !old_rmenu_toggle); // Always go into menu if dummy core is loaded. if (rmenu_toggle && !old_rmenu_toggle) @@ -3074,19 +3077,14 @@ static inline void update_frame_time(void) static inline void limit_frame_time(void) { - retro_time_t current = 0; - retro_time_t target = 0; - retro_time_t to_sleep_ms = 0; - - if (g_settings.fastforward_ratio <= 0.0f) + if (g_settings.fastforward_ratio < 0.0f) return; g_extern.frame_limit.minimum_frame_time = (retro_time_t)roundf(1000000.0f / (g_extern.system.av_info.timing.fps * g_settings.fastforward_ratio)); - current = rarch_get_time_usec(); - target = g_extern.frame_limit.last_frame_time + g_extern.frame_limit.minimum_frame_time; - to_sleep_ms = (target - current) / 1000; - + retro_time_t current = rarch_get_time_usec(); + retro_time_t target = g_extern.frame_limit.last_frame_time + g_extern.frame_limit.minimum_frame_time; + retro_time_t to_sleep_ms = (target - current) / 1000; if (to_sleep_ms > 0) { rarch_sleep((unsigned int)to_sleep_ms); @@ -3221,10 +3219,8 @@ void rarch_main_command(unsigned action) deinit_recording(); break; case RARCH_CMD_HISTORY_INIT: - if (g_extern.history) - return; - - g_extern.history = content_playlist_init(g_settings.content_history_path, g_settings.content_history_size); + if (!g_extern.history) + g_extern.history = content_playlist_init(g_settings.content_history_path, g_settings.content_history_size); break; case RARCH_CMD_HISTORY_DEINIT: if (g_extern.history) diff --git a/settings_data.c b/settings_data.c index e17abba623..26b5824df5 100644 --- a/settings_data.c +++ b/settings_data.c @@ -1595,7 +1595,6 @@ rarch_setting_t* setting_data_get_list(void) { int i, player, index; static rarch_setting_t* list = NULL; - static bool initialized = false; if (!list) { @@ -1647,7 +1646,7 @@ rarch_setting_t* setting_data_get_list(void) #endif CONFIG_BOOL(g_settings.video.disable_composition, "video_disable_composition", "Window Compositing", disable_composition, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) CONFIG_BOOL(g_settings.pause_nonactive, "pause_nonactive", "Window Unfocus Pause", pause_nonactive, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) - CONFIG_FLOAT(g_settings.fastforward_ratio, "fastforward_ratio", "Maximum Run Speed", fastforward_ratio, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_RANGE(0, 10, 1.0, true, true) + CONFIG_FLOAT(g_settings.fastforward_ratio, "fastforward_ratio", "Maximum Run Speed", fastforward_ratio, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_RANGE(0, 10, 0.1, true, true) CONFIG_FLOAT(g_settings.slowmotion_ratio, "slowmotion_ratio", "Slow-Motion Ratio", slowmotion_ratio, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_RANGE(1, 10, 1.0, true, true) CONFIG_BOOL(g_settings.savestate_auto_index, "savestate_auto_index", "Save State Auto Index", savestate_auto_index, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) CONFIG_BOOL(g_settings.savestate_auto_save, "savestate_auto_save", "Auto Save State", savestate_auto_save, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)