mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-03 15:54:39 +00:00
(Android) Remove debug_input_enable
This commit is contained in:
parent
83edfab974
commit
c090ee634c
@ -19,15 +19,6 @@
|
|||||||
android:disableDependentsState="true" />
|
android:disableDependentsState="true" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<!-- Debug Input Reporting -->
|
|
||||||
<PreferenceCategory android:title="@string/debug_input_reporting" >
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="input_debug_enable"
|
|
||||||
android:summary="@string/debug_input_reporting_desc"
|
|
||||||
android:title="@string/enable" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<!-- Touchscreen Overlay -->
|
<!-- Touchscreen Overlay -->
|
||||||
<PreferenceCategory android:title="@string/touchscreen_overlay" >
|
<PreferenceCategory android:title="@string/touchscreen_overlay" >
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
|
@ -183,7 +183,6 @@ public final class UserPreferences
|
|||||||
config.setInt("rewind_granularity", Integer.parseInt(prefs.getString("rewind_granularity", "1")));
|
config.setInt("rewind_granularity", Integer.parseInt(prefs.getString("rewind_granularity", "1")));
|
||||||
config.setBoolean("video_vsync", prefs.getBoolean("video_vsync", true));
|
config.setBoolean("video_vsync", prefs.getBoolean("video_vsync", true));
|
||||||
config.setBoolean("input_autodetect_enable", prefs.getBoolean("input_autodetect_enable", true));
|
config.setBoolean("input_autodetect_enable", prefs.getBoolean("input_autodetect_enable", true));
|
||||||
config.setBoolean("input_debug_enable", prefs.getBoolean("input_debug_enable", false));
|
|
||||||
config.setDouble("video_refresh_rate", getRefreshRate(ctx));
|
config.setDouble("video_refresh_rate", getRefreshRate(ctx));
|
||||||
config.setBoolean("video_threaded", prefs.getBoolean("video_threaded", true));
|
config.setBoolean("video_threaded", prefs.getBoolean("video_threaded", true));
|
||||||
|
|
||||||
|
@ -555,9 +555,6 @@ static const float axis_threshold = 0.5;
|
|||||||
static const unsigned turbo_period = 6;
|
static const unsigned turbo_period = 6;
|
||||||
static const unsigned turbo_duty_cycle = 3;
|
static const unsigned turbo_duty_cycle = 3;
|
||||||
|
|
||||||
// Enable input debugging output.
|
|
||||||
static const bool input_debug_enable = false;
|
|
||||||
|
|
||||||
// Enable input auto-detection. Will attempt to autoconfigure
|
// Enable input auto-detection. Will attempt to autoconfigure
|
||||||
// gamepads, plug-and-play style.
|
// gamepads, plug-and-play style.
|
||||||
static const bool input_autodetect_enable = true;
|
static const bool input_autodetect_enable = true;
|
||||||
|
@ -282,7 +282,6 @@ struct settings
|
|||||||
int joypad_map[MAX_PLAYERS];
|
int joypad_map[MAX_PLAYERS];
|
||||||
unsigned device[MAX_PLAYERS];
|
unsigned device[MAX_PLAYERS];
|
||||||
char device_names[MAX_PLAYERS][64];
|
char device_names[MAX_PLAYERS][64];
|
||||||
bool debug_enable;
|
|
||||||
bool autodetect_enable;
|
bool autodetect_enable;
|
||||||
bool netplay_client_swap_input;
|
bool netplay_client_swap_input;
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ typedef struct android_input
|
|||||||
} android_input_t;
|
} android_input_t;
|
||||||
|
|
||||||
|
|
||||||
void (*engine_handle_dpad)(android_input_t *android, AInputEvent*, int, char*, size_t, int, bool);
|
void (*engine_handle_dpad)(android_input_t *android, AInputEvent*, int, int);
|
||||||
static bool android_input_set_sensor_state(void *data, unsigned port, enum retro_sensor_action action, unsigned event_rate);
|
static bool android_input_set_sensor_state(void *data, unsigned port, enum retro_sensor_action action, unsigned event_rate);
|
||||||
|
|
||||||
extern float AMotionEvent_getAxisValue(const AInputEvent* motion_event,
|
extern float AMotionEvent_getAxisValue(const AInputEvent* motion_event,
|
||||||
@ -173,9 +173,7 @@ static inline void set_bit(uint8_t *buf, unsigned bit)
|
|||||||
buf[bit >> 3] |= 1 << (bit & 7);
|
buf[bit >> 3] |= 1 << (bit & 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void engine_handle_dpad_default(android_input_t *android, AInputEvent *event,
|
static void engine_handle_dpad_default(android_input_t *android, AInputEvent *event, int port, int source)
|
||||||
int port, char *msg, size_t msg_sizeof,
|
|
||||||
int source, bool debug_enable)
|
|
||||||
{
|
{
|
||||||
size_t motion_pointer = AMotionEvent_getAction(event) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
|
size_t motion_pointer = AMotionEvent_getAction(event) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
|
||||||
float x = AMotionEvent_getX(event, motion_pointer);
|
float x = AMotionEvent_getX(event, motion_pointer);
|
||||||
@ -183,15 +181,9 @@ static void engine_handle_dpad_default(android_input_t *android, AInputEvent *ev
|
|||||||
|
|
||||||
android->analog_state[port][0] = (int16_t)(x * 32767.0f);
|
android->analog_state[port][0] = (int16_t)(x * 32767.0f);
|
||||||
android->analog_state[port][1] = (int16_t)(y * 32767.0f);
|
android->analog_state[port][1] = (int16_t)(y * 32767.0f);
|
||||||
|
|
||||||
if (debug_enable)
|
|
||||||
snprintf(msg, msg_sizeof, "Pad %d : x = %.2f, y = %.2f, src %d.\n",
|
|
||||||
port, x, y, source);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void engine_handle_dpad_getaxisvalue(android_input_t *android, AInputEvent *event,
|
static void engine_handle_dpad_getaxisvalue(android_input_t *android, AInputEvent *event, int port, int source)
|
||||||
int port, char *msg, size_t msg_sizeof, int source,
|
|
||||||
bool debug_enable)
|
|
||||||
{
|
{
|
||||||
size_t motion_pointer = AMotionEvent_getAction(event) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
|
size_t motion_pointer = AMotionEvent_getAction(event) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
|
||||||
float x = AMotionEvent_getAxisValue(event, AXIS_X, motion_pointer);
|
float x = AMotionEvent_getAxisValue(event, AXIS_X, motion_pointer);
|
||||||
@ -219,10 +211,6 @@ static void engine_handle_dpad_getaxisvalue(android_input_t *android, AInputEven
|
|||||||
android->analog_state[port][7] = (int16_t)(rtrig * 32767.0f);
|
android->analog_state[port][7] = (int16_t)(rtrig * 32767.0f);
|
||||||
android->analog_state[port][8] = (int16_t)(brake * 32767.0f);
|
android->analog_state[port][8] = (int16_t)(brake * 32767.0f);
|
||||||
android->analog_state[port][9] = (int16_t)(gas * 32767.0f);
|
android->analog_state[port][9] = (int16_t)(gas * 32767.0f);
|
||||||
|
|
||||||
if (debug_enable)
|
|
||||||
snprintf(msg, msg_sizeof, "Pad %d : x %.2f, y %.2f, z %.2f, rz %.2f, src %d.\n",
|
|
||||||
port, x, y, z, rz, source);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *android_input_init(void)
|
static void *android_input_init(void)
|
||||||
@ -577,7 +565,6 @@ static void android_input_poll(void *data)
|
|||||||
{
|
{
|
||||||
if (ident == LOOPER_ID_INPUT)
|
if (ident == LOOPER_ID_INPUT)
|
||||||
{
|
{
|
||||||
bool debug_enable = g_settings.input.debug_enable;
|
|
||||||
AInputEvent *event = NULL;
|
AInputEvent *event = NULL;
|
||||||
|
|
||||||
// Read all pending events.
|
// Read all pending events.
|
||||||
@ -585,13 +572,10 @@ static void android_input_poll(void *data)
|
|||||||
{
|
{
|
||||||
while (AInputQueue_getEvent(android_app->inputQueue, &event) >= 0)
|
while (AInputQueue_getEvent(android_app->inputQueue, &event) >= 0)
|
||||||
{
|
{
|
||||||
bool long_msg_enable = false;
|
|
||||||
int32_t handled = 1;
|
int32_t handled = 1;
|
||||||
char msg[128];
|
|
||||||
int source, id, keycode, type_event, port;
|
int source, id, keycode, type_event, port;
|
||||||
int predispatched;
|
int predispatched;
|
||||||
|
|
||||||
msg[0] = 0;
|
|
||||||
predispatched = AInputQueue_preDispatchEvent(android_app->inputQueue, event);
|
predispatched = AInputQueue_preDispatchEvent(android_app->inputQueue, event);
|
||||||
|
|
||||||
source = AInputEvent_getSource(event);
|
source = AInputEvent_getSource(event);
|
||||||
@ -625,26 +609,12 @@ static void android_input_poll(void *data)
|
|||||||
float y = 0.0f;
|
float y = 0.0f;
|
||||||
|
|
||||||
if (android_input_poll_event_type_motion(android, event, &x, &y, port, source))
|
if (android_input_poll_event_type_motion(android, event, &x, &y, port, source))
|
||||||
engine_handle_dpad(android, event, port, msg, sizeof(msg), source, debug_enable);
|
engine_handle_dpad(android, event, port, source);
|
||||||
else
|
|
||||||
{
|
|
||||||
if (debug_enable)
|
|
||||||
snprintf(msg, sizeof(msg), "Pad %d : x = %.2f, y = %.2f, src %d.\n", port, x, y, source);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (type_event == AINPUT_EVENT_TYPE_KEY)
|
else if (type_event == AINPUT_EVENT_TYPE_KEY)
|
||||||
{
|
{
|
||||||
keycode = AKeyEvent_getKeyCode(event);
|
keycode = AKeyEvent_getKeyCode(event);
|
||||||
android_input_poll_event_type_key(android, android_app, event, port, keycode, source, type_event, &handled);
|
android_input_poll_event_type_key(android, android_app, event, port, keycode, source, type_event, &handled);
|
||||||
if (debug_enable)
|
|
||||||
snprintf(msg, sizeof(msg), "Pad %d : %d, src = %d.\n", port, keycode, source);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg[0] != 0)
|
|
||||||
{
|
|
||||||
msg_queue_clear(g_extern.msg_queue);
|
|
||||||
msg_queue_push(g_extern.msg_queue, msg, 0, long_msg_enable ? 180 : 30);
|
|
||||||
RARCH_LOG("Input debug: %s\n", msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!predispatched)
|
if (!predispatched)
|
||||||
|
@ -288,9 +288,6 @@
|
|||||||
# Requires input_autodetect_enable to be enabled.
|
# Requires input_autodetect_enable to be enabled.
|
||||||
# joypad_autoconfig_dir =
|
# joypad_autoconfig_dir =
|
||||||
|
|
||||||
# Enable debug input key reporting on-screen.
|
|
||||||
# input_debug_enable = false
|
|
||||||
|
|
||||||
# Sets which libretro device is used for a player.
|
# Sets which libretro device is used for a player.
|
||||||
# Devices are indentified with a number.
|
# Devices are indentified with a number.
|
||||||
# This is normally saved by the menu.
|
# This is normally saved by the menu.
|
||||||
|
@ -394,7 +394,6 @@ void config_set_defaults(void)
|
|||||||
|
|
||||||
g_settings.input.overlay_opacity = 0.7f;
|
g_settings.input.overlay_opacity = 0.7f;
|
||||||
g_settings.input.overlay_scale = 1.0f;
|
g_settings.input.overlay_scale = 1.0f;
|
||||||
g_settings.input.debug_enable = input_debug_enable;
|
|
||||||
g_settings.input.autodetect_enable = input_autodetect_enable;
|
g_settings.input.autodetect_enable = input_autodetect_enable;
|
||||||
*g_settings.input.keyboard_layout = '\0';
|
*g_settings.input.keyboard_layout = '\0';
|
||||||
|
|
||||||
@ -1094,8 +1093,6 @@ bool config_load_file(const char *path, bool set_defaults)
|
|||||||
CONFIG_GET_INT(input.turbo_period, "input_turbo_period");
|
CONFIG_GET_INT(input.turbo_period, "input_turbo_period");
|
||||||
CONFIG_GET_INT(input.turbo_duty_cycle, "input_duty_cycle");
|
CONFIG_GET_INT(input.turbo_duty_cycle, "input_duty_cycle");
|
||||||
|
|
||||||
CONFIG_GET_BOOL(input.debug_enable, "input_debug_enable");
|
|
||||||
|
|
||||||
CONFIG_GET_BOOL(input.autodetect_enable, "input_autodetect_enable");
|
CONFIG_GET_BOOL(input.autodetect_enable, "input_autodetect_enable");
|
||||||
CONFIG_GET_PATH(input.autoconfig_dir, "joypad_autoconfig_dir");
|
CONFIG_GET_PATH(input.autoconfig_dir, "joypad_autoconfig_dir");
|
||||||
|
|
||||||
|
@ -668,7 +668,6 @@ const rarch_setting_t* setting_data_get_list(void)
|
|||||||
|
|
||||||
START_SUB_GROUP("Misc")
|
START_SUB_GROUP("Misc")
|
||||||
CONFIG_BOOL(g_settings.input.netplay_client_swap_input, "netplay_client_swap_input", "Swap Netplay Input", netplay_client_swap_input)
|
CONFIG_BOOL(g_settings.input.netplay_client_swap_input, "netplay_client_swap_input", "Swap Netplay Input", netplay_client_swap_input)
|
||||||
CONFIG_BOOL(g_settings.input.debug_enable, "input_debug_enable", "Enable Input Debugging", input_debug_enable)
|
|
||||||
END_SUB_GROUP()
|
END_SUB_GROUP()
|
||||||
|
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
|
Loading…
x
Reference in New Issue
Block a user