(Android) Onscreen input debugging

This commit is contained in:
twinaphex 2012-12-16 15:46:53 +01:00
parent 49d35b2339
commit 3eabba50f9
2 changed files with 11 additions and 4 deletions

View File

@ -4,6 +4,7 @@ PERF_TEST := 0
HAVE_NEON := 1
HAVE_SINC := 1
HAVE_LOGGER := 1
DEBUG_INPUT := 0
include $(CLEAR_VARS)
@ -53,6 +54,10 @@ ifeq ($(PERF_TEST), 1)
LOCAL_CFLAGS += -DPERF_TEST
endif
ifeq ($(DEBUG_INPUT), 1)
LOCAL_CFLAGS += -DRARCH_INPUT_DEBUG
endif
LOCAL_CFLAGS += -O3 -fno-stack-protector -funroll-loops -DNDEBUG -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_VID_CONTEXT -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_GLSL -DHAVE_ZLIB -DWANT_RZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREAD -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DRARCH_PERFORMANCE_MODE -DRARCH_GPU_PERFORMANCE_MODE -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -std=gnu99
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL -lGLESv2 $(LOGGER_LDLIBS) -ldl

View File

@ -63,8 +63,6 @@ enum {
#define MAX_DEVICE_IDS 50
//#define RARCH_INPUT_DEBUG
static unsigned pads_connected;
static uint64_t state[MAX_PADS];
static int8_t state_device_ids[MAX_DEVICE_IDS];
@ -302,7 +300,9 @@ static void android_input_poll(void *data)
float x = AMotionEvent_getX(event, 0);
float y = AMotionEvent_getY(event, 0);
#ifdef RARCH_INPUT_DEBUG
RARCH_LOG("AINPUT_EVENT_TYPE_MOTION, pad: %d, x: %f, y: %f.\n", i, x, y);
char msg[128];
snprintf(msg, sizeof(msg), "RetroPad %d : x = %f, y = %f.\n", i, x, y);
msg_queue_push(g_extern.msg_queue, msg, 0, 30);
#endif
state[i] &= ~((1ULL << RETRO_DEVICE_ID_JOYPAD_LEFT) | (1ULL << RETRO_DEVICE_ID_JOYPAD_RIGHT) |
(1ULL << RETRO_DEVICE_ID_JOYPAD_UP) | (1ULL << RETRO_DEVICE_ID_JOYPAD_DOWN));
@ -316,7 +316,9 @@ static void android_input_poll(void *data)
int keycode = AKeyEvent_getKeyCode(event);
uint64_t input_state = keycode_lut[keycode];
#ifdef RARCH_INPUT_DEBUG
RARCH_LOG("Keycode RetroPad %d : %d.\n", i, keycode);
char msg[128];
snprintf(msg, sizeof(msg), "Keycode RetroPad %d : %d.\n", i, keycode);
msg_queue_push(g_extern.msg_queue, msg, 0, 30);
#endif
int action = AKeyEvent_getAction(event);
uint64_t *key = NULL;