mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 12:40:23 +00:00
Merge remote-tracking branch 'upstream/master' into patch-1
This commit is contained in:
commit
414ce2d5a6
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 };
|
||||
|
@ -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')
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -1919,6 +1919,29 @@ 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)
|
||||
{
|
||||
if (!strcmp(setting->name, "fastforward_ratio"))
|
||||
{
|
||||
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:
|
||||
@ -1946,6 +1969,7 @@ static void menu_common_setting_set_current_fraction(rarch_setting_t *setting, u
|
||||
*setting->value.fraction = setting->default_value.fraction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (setting->change_handler)
|
||||
setting->change_handler(setting);
|
||||
|
58
retroarch.c
58
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;
|
||||
|
||||
// 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,6 +2802,11 @@ static void do_state_checks(void)
|
||||
rarch_check_overlay();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
if (g_extern.netplay)
|
||||
check_netplay_flip();
|
||||
else
|
||||
#endif
|
||||
check_flip();
|
||||
}
|
||||
|
||||
@ -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,9 +3219,7 @@ void rarch_main_command(unsigned action)
|
||||
deinit_recording();
|
||||
break;
|
||||
case RARCH_CMD_HISTORY_INIT:
|
||||
if (g_extern.history)
|
||||
return;
|
||||
|
||||
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:
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user