mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Cleanups
This commit is contained in:
parent
295aa84a9e
commit
d2af43d457
@ -178,8 +178,6 @@ enum frontend_architecture frontend_driver_get_cpu_architecture(void);
|
||||
const void *frontend_driver_get_cpu_architecture_str(
|
||||
char *frontend_architecture, size_t size);
|
||||
|
||||
environment_get_t frontend_driver_environment_get_ptr(void);
|
||||
|
||||
bool frontend_driver_has_get_video_driver_func(void);
|
||||
|
||||
const struct video_driver *frontend_driver_get_video_driver(void);
|
||||
|
@ -346,8 +346,7 @@ bool input_driver_set_rumble_gain(
|
||||
driver_state->primary_joypad->set_rumble_gain(i, gain);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**************************************/
|
||||
@ -510,83 +509,82 @@ bool input_driver_toggle_button_combo(
|
||||
return true;
|
||||
break;
|
||||
case INPUT_TOGGLE_HOLD_START:
|
||||
{
|
||||
static rarch_timer_t timer = {0};
|
||||
|
||||
if (!BIT256_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_START))
|
||||
{
|
||||
/* timer only runs while start is held down */
|
||||
timer.timer_end = true;
|
||||
timer.timer_begin = false;
|
||||
timer.timeout_end = 0;
|
||||
return false;
|
||||
static rarch_timer_t timer = {0};
|
||||
|
||||
if (!BIT256_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_START))
|
||||
{
|
||||
/* timer only runs while start is held down */
|
||||
timer.timer_end = true;
|
||||
timer.timer_begin = false;
|
||||
timer.timeout_end = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* User started holding down the start button, start the timer */
|
||||
if (!timer.timer_begin)
|
||||
{
|
||||
uint64_t current_usec = cpu_features_get_time_usec();
|
||||
timer.timeout_us = HOLD_BTN_DELAY_SEC * 1000000;
|
||||
timer.current = current_usec;
|
||||
timer.timeout_end = timer.current + timer.timeout_us;
|
||||
timer.timer_begin = true;
|
||||
timer.timer_end = false;
|
||||
}
|
||||
|
||||
timer.current = current_time;
|
||||
timer.timeout_us = (timer.timeout_end - timer.current);
|
||||
|
||||
if (!timer.timer_end && (timer.timeout_us <= 0))
|
||||
{
|
||||
/* start has been held down long enough,
|
||||
* stop timer and enter menu */
|
||||
timer.timer_end = true;
|
||||
timer.timer_begin = false;
|
||||
timer.timeout_end = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* User started holding down the start button, start the timer */
|
||||
if (!timer.timer_begin)
|
||||
{
|
||||
uint64_t current_usec = cpu_features_get_time_usec();
|
||||
timer.timeout_us = HOLD_BTN_DELAY_SEC * 1000000;
|
||||
timer.current = current_usec;
|
||||
timer.timeout_end = timer.current + timer.timeout_us;
|
||||
timer.timer_begin = true;
|
||||
timer.timer_end = false;
|
||||
}
|
||||
|
||||
timer.current = current_time;
|
||||
timer.timeout_us = (timer.timeout_end - timer.current);
|
||||
|
||||
if (!timer.timer_end && (timer.timeout_us <= 0))
|
||||
{
|
||||
/* start has been held down long enough,
|
||||
* stop timer and enter menu */
|
||||
timer.timer_end = true;
|
||||
timer.timer_begin = false;
|
||||
timer.timeout_end = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case INPUT_TOGGLE_HOLD_SELECT:
|
||||
{
|
||||
static rarch_timer_t timer = {0};
|
||||
|
||||
if (!BIT256_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_SELECT))
|
||||
{
|
||||
/* timer only runs while select is held down */
|
||||
timer.timer_end = true;
|
||||
timer.timer_begin = false;
|
||||
timer.timeout_end = 0;
|
||||
return false;
|
||||
static rarch_timer_t timer = {0};
|
||||
|
||||
if (!BIT256_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_SELECT))
|
||||
{
|
||||
/* timer only runs while select is held down */
|
||||
timer.timer_end = true;
|
||||
timer.timer_begin = false;
|
||||
timer.timeout_end = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* user started holding down the select button, start the timer */
|
||||
if (!timer.timer_begin)
|
||||
{
|
||||
uint64_t current_usec = cpu_features_get_time_usec();
|
||||
timer.timeout_us = HOLD_BTN_DELAY_SEC * 1000000;
|
||||
timer.current = current_usec;
|
||||
timer.timeout_end = timer.current + timer.timeout_us;
|
||||
timer.timer_begin = true;
|
||||
timer.timer_end = false;
|
||||
}
|
||||
|
||||
timer.current = current_time;
|
||||
timer.timeout_us = (timer.timeout_end - timer.current);
|
||||
|
||||
if (!timer.timer_end && (timer.timeout_us <= 0))
|
||||
{
|
||||
/* select has been held down long enough,
|
||||
* stop timer and enter menu */
|
||||
timer.timer_end = true;
|
||||
timer.timer_begin = false;
|
||||
timer.timeout_end = 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* user started holding down the select button, start the timer */
|
||||
if (!timer.timer_begin)
|
||||
{
|
||||
uint64_t current_usec = cpu_features_get_time_usec();
|
||||
timer.timeout_us = HOLD_BTN_DELAY_SEC * 1000000;
|
||||
timer.current = current_usec;
|
||||
timer.timeout_end = timer.current + timer.timeout_us;
|
||||
timer.timer_begin = true;
|
||||
timer.timer_end = false;
|
||||
}
|
||||
|
||||
timer.current = current_time;
|
||||
timer.timeout_us = (timer.timeout_end - timer.current);
|
||||
|
||||
if (!timer.timer_end && (timer.timeout_us <= 0))
|
||||
{
|
||||
/* select has been held down long enough,
|
||||
* stop timer and enter menu */
|
||||
timer.timer_end = true;
|
||||
timer.timer_begin = false;
|
||||
timer.timeout_end = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case INPUT_TOGGLE_NONE:
|
||||
break;
|
||||
|
@ -32773,15 +32773,6 @@ void frontend_driver_free(void)
|
||||
p_rarch->current_frontend_ctx = NULL;
|
||||
}
|
||||
|
||||
environment_get_t frontend_driver_environment_get_ptr(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
frontend_ctx_driver_t *frontend = p_rarch->current_frontend_ctx;
|
||||
if (frontend)
|
||||
return frontend->environment_get;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool frontend_driver_has_get_video_driver_func(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
|
Loading…
x
Reference in New Issue
Block a user