(Android) Build fix

(Android) Add GameMID to autodetection list
This commit is contained in:
twinaphex 2013-06-04 11:14:14 +02:00
parent 7c57563827
commit 2eac87630d
4 changed files with 45 additions and 5 deletions

View File

@ -365,6 +365,33 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BACK] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_GAMEMID:
g_settings.input.device[port] = device;
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
strlcpy(g_settings.input.device_names[port], "GameMID",
sizeof(g_settings.input.device_names[port]));
keycode_lut[AKEYCODE_DPAD_UP] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift);
keycode_lut[AKEYCODE_DPAD_DOWN] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift);
keycode_lut[AKEYCODE_DPAD_LEFT] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift);
keycode_lut[AKEYCODE_DPAD_RIGHT] |= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift);
keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
keycode_lut[AKEYCODE_BUTTON_SELECT] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
keycode_lut[AKEYCODE_BUTTON_L2] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift);
keycode_lut[AKEYCODE_BUTTON_R2] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift);
keycode_lut[AKEYCODE_BUTTON_THUMBR] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
keycode_lut[AKEYCODE_BUTTON_THUMBL] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift);
/* left analog stick - TODO */
/* right analog stick - TODO */
/* menu button? */
break;
case DEVICE_ICONTROLPAD_BLUEZ_IME:
g_settings.input.device[port] = device;
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;

View File

@ -195,6 +195,8 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned
device = DEVICE_THRUSTMASTER_T_MINI;
else if (strstr(name_buf, "2Axes 11Keys Game Pad"))
device = DEVICE_TOMEE_NES_USB;
else if (strstr(name_buf, "rk29-keypad") || strstr(name_buf, "GAMEMID"))
device = DEVICE_GAMEMID;
if (strstr(current_ime, "net.obsidianx.android.mogaime"))
{

View File

@ -264,6 +264,7 @@ enum input_devices
DEVICE_OUYA,
DEVICE_TOMEE_NES_USB,
DEVICE_THRUSTMASTER_T_MINI,
DEVICE_GAMEMID,
#elif defined(GEKKO)
DEVICE_GAMECUBE = 0,
#ifdef HW_RVL

View File

@ -235,22 +235,32 @@ static void *android_app_entry(void *data)
if (driver.video_poke->set_aspect_ratio)
driver.video_poke->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_THROTTLE_ENABLE))
audio_start_func();
// Main loop
while (rarch_main_iterate());
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_THROTTLE_ENABLE))
audio_stop_func();
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
}
else if(g_extern.lifecycle_mode_state & (1ULL << MODE_MENU))
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_PREINIT);
// Menu should always run with vsync on
video_set_nonblock_state_func(false);
if (driver.audio_data)
audio_stop_func();
while((input_key_pressed_func(RARCH_PAUSE_TOGGLE)) ?
android_run_events(android_app) : menu_iterate());
driver_set_nonblock_state(driver.nonblock_state);
if (driver.audio_data && !audio_start_func())
{
RARCH_ERR("Failed to resume audio driver. Will continue without audio.\n");
g_extern.audio_active = false;
}
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU);
}
else