Merge pull request #202 from CatalystG/q10

(BlackBerry) Add support for Q10 and fix core info after lib name changes.
This commit is contained in:
Squarepusher 2013-05-08 00:54:55 -07:00
commit 6aa245c731
5 changed files with 51 additions and 11 deletions

View File

@ -3,7 +3,7 @@ APP_NAME = RetroArch-Cascades
CONFIG += qt warn_on cascades10
LIBS += -lscreen -lbps -lOpenAL -lpng -lEGL -lGLESv2
LIBS += -lbbcascadespickers -lbbdata
LIBS += -lbbcascadespickers -lbbdata -lbbdevice
DEFINES += HAVE_RGUI HAVE_NEON \
SINC_LOWER_QUALITY HAVE_RARCH_MAIN_IMPLEMENTATION \

View File

@ -1,5 +1,5 @@
{
"snes9x_next_libretro.so":{
"snes9x_next_libretro_qnx.so":{
"display_name":"SNES / Super Famicom",
"supported_extensions":"*.smc|*.fig|*.sfc|*.gd3|*.gd7|*.dx2|*.bsx|*.swc",
"corename":"SNES9x Next",
@ -7,7 +7,7 @@
"systemname":"Super Nintendo Entertainment System",
"default_overlay":"app/native/overlays/snes-landscape.cfg"
},
"genesis_plus_gx_libretro.so":{
"genesis_plus_gx_libretro_qnx.so":{
"display_name":"Sega (MS/GG/MD/CD)",
"supported_extensions":"*.md|*.smd|*.gen|*.sms|*.gg|*.sg|*.bin|*.cue|*.ios",
"corename":"Genesis Plus GX",
@ -15,7 +15,7 @@
"systemname":"Sega (Various)",
"default_overlay":"app/native/overlays/genesis6-landscape.cfg"
},
"vba_next_libretro.so":{
"vba_next_libretro_qnx.so":{
"display_name":"Game Boy Advance",
"supported_extensions":"*.gba",
"corename":"VBA Next",
@ -23,7 +23,7 @@
"systemname":"Game Boy Advance",
"default_overlay":"app/native/overlays/box-gba.cfg"
},
"pcsx_rearmed_libretro.so":{
"pcsx_rearmed_libretro_qnx.so":{
"display_name":"PlayStation1",
"supported_extensions":"*.bin|*.cue|*.img|*.mdf|*.pbp|*.cbn|*.toc",
"corename":"PCSX ReARMed",
@ -31,12 +31,20 @@
"systemname":"PlayStation",
"default_overlay":"app/native/overlays/psx-landscape.cfg"
},
"fb_alpha_libretro.so":{
"fb_alpha_libretro_qnx.so":{
"display_name":"Arcade",
"supported_extensions":"*.zip|*.ZIP",
"corename":"Final Burn Alpha",
"manufacturer":"Various",
"systemname":"Arcade (various)",
"default_overlay":"app/native/overlays/snes-landscape.cfg"
},
"gambatte_libretro_qnx.so":{
"display_name":"Game Boy / Game Boy Color",
"supported_extensions":"*.gb|*.gbc|*.dmg",
"corename":"gambatte",
"manufacturer":"Nintendo",
"systemname":"Game Boy Color",
"default_overlay":"app/native/overlays/gameboy-landscape.cfg"
}
}

View File

@ -28,6 +28,7 @@
#include <bb/cascades/Window>
#include <bb/cascades/pickers/FilePicker>
#include <bb/data/JsonDataAccess>
#include <bb/device/HardwareInfo>
#include <screen/screen.h>
#include <bps/screen.h>
@ -40,6 +41,7 @@
using namespace bb::cascades;
using namespace bb::data;
using namespace bb::device;
//Use after calling findCores
#define GET_CORE_INFO(x, y) coreInfo[coreList[x]].toMap()[y].toString()
@ -235,7 +237,8 @@ void RetroArch::startEmulator()
{
state = RETROARCH_START_REQUESTED;
if (OrientationSupport::instance()->orientation() == UIOrientation::Portrait)
if (OrientationSupport::instance()->orientation() == UIOrientation::Portrait &&
OrientationSupport::instance()->supportedDisplayOrientation() != SupportedDisplayOrientation::DeviceNorth)
{
OrientationSupport::instance()->setSupportedDisplayOrientation(SupportedDisplayOrientation::DisplayLandscape);
}
@ -305,6 +308,10 @@ void RetroArch::initRASettings()
{
strlcpy(g_settings.libretro,(char *)core.toAscii().constData(), sizeof(g_settings.libretro));
strlcpy(g_extern.fullpath, (char *)rom.toAscii().constData(), sizeof(g_extern.fullpath));
strlcpy(g_settings.input.overlay, GET_CORE_INFO(coreSelectedIndex, "default_overlay").toAscii().constData(), sizeof(g_settings.input.overlay));
HardwareInfo *hwInfo = new HardwareInfo();
if(!hwInfo->isPhysicalKeyboardDevice())
strlcpy(g_settings.input.overlay, GET_CORE_INFO(coreSelectedIndex, "default_overlay").toAscii().constData(), sizeof(g_settings.input.overlay));
}

View File

@ -218,6 +218,8 @@ static void qnx_input_autodetect_gamepad(input_device_t* controller)
device = DEVICE_WIIMOTE;
else if (strstr(controller->id, "0A5C-8502"))
device = DEVICE_KEYBOARD;
else if (strstr(controller->id, "qwerty:bb35"))
device = DEVICE_KEYPAD;
else if (controller->id)
device = DEVICE_UNKNOWN;
else
@ -502,7 +504,7 @@ static int16_t qnx_input_state(void *data, const struct retro_keybind **retro_ke
switch (device)
{
case RETRO_DEVICE_JOYPAD:
if (g_settings.input.device[port] == DEVICE_KEYBOARD)
if (g_settings.input.device[port] == DEVICE_KEYBOARD || g_settings.input.device[port] == DEVICE_KEYPAD)
return ((devices[port].buttons & (1 << id)) && (port < pads_connected));
else
return ((devices[port].buttons & retro_keybinds[port][id].joykey) && (port < pads_connected));
@ -616,7 +618,7 @@ static void qnx_input_set_keybinds(void *data, unsigned device, unsigned port,
strlcpy(g_settings.input.device_names[port], "Wiimote",
sizeof(g_settings.input.device_names[port]));
g_settings.input.device[port] = device;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_B].def_joykey = SCREEN_Y_GAME_BUTTON;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_B].def_joykey = SCREEN_X_GAME_BUTTON;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_Y].def_joykey = SCREEN_B_GAME_BUTTON;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_SELECT].def_joykey = SCREEN_MENU1_GAME_BUTTON;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_START].def_joykey = SCREEN_MENU2_GAME_BUTTON;
@ -624,7 +626,7 @@ static void qnx_input_set_keybinds(void *data, unsigned device, unsigned port,
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].def_joykey = SCREEN_DPAD_DOWN_GAME_BUTTON;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].def_joykey = SCREEN_DPAD_LEFT_GAME_BUTTON;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].def_joykey = SCREEN_DPAD_RIGHT_GAME_BUTTON;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_A].def_joykey = SCREEN_X_GAME_BUTTON;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_A].def_joykey = SCREEN_Y_GAME_BUTTON;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_X].def_joykey = SCREEN_A_GAME_BUTTON;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L].def_joykey = SCREEN_L1_GAME_BUTTON;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R].def_joykey = SCREEN_R1_GAME_BUTTON;
@ -634,6 +636,28 @@ static void qnx_input_set_keybinds(void *data, unsigned device, unsigned port,
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R3].def_joykey = SCREEN_R3_GAME_BUTTON;
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
break;
case DEVICE_KEYPAD:
strlcpy(g_settings.input.device_names[port], "BlackBerry Q10 Keypad",
sizeof(g_settings.input.device_names[port]));
g_settings.input.device[port] = device;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_B].def_joykey = KEYCODE_M & 0xFF;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_Y].def_joykey = KEYCODE_J & 0xFF;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_SELECT].def_joykey = KEYCODE_RIGHT_SHIFT & 0xFF;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_START].def_joykey = KEYCODE_RETURN & 0xFF;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].def_joykey = KEYCODE_W & 0xFF;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].def_joykey = KEYCODE_S & 0xFF;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].def_joykey = KEYCODE_A & 0xFF;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].def_joykey = KEYCODE_D & 0xFF;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_A].def_joykey = KEYCODE_N & 0xFF;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_X].def_joykey = KEYCODE_K & 0xFF;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L].def_joykey = KEYCODE_U & 0xFF;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R].def_joykey = KEYCODE_I & 0xFF;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L2].def_joykey = 0;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R2].def_joykey = 0;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L3].def_joykey = 0;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R3].def_joykey = 0;
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
break;
#endif
case DEVICE_KEYBOARD:
strlcpy(g_settings.input.device_names[port], "BlackBerry BT Keyboard",

View File

@ -276,6 +276,7 @@ enum input_devices
DEVICE_NONE,
DEVICE_WIIMOTE,
DEVICE_KEYBOARD,
DEVICE_KEYPAD,
DEVICE_UNKNOWN,
#endif
DEVICE_LAST