diff --git a/blackberry-qnx/bb10/assets/Controllers.qml b/blackberry-qnx/bb10/assets/Controllers.qml new file mode 100644 index 0000000000..367536bb69 --- /dev/null +++ b/blackberry-qnx/bb10/assets/Controllers.qml @@ -0,0 +1,130 @@ +import bb.cascades 1.0 + +Page +{ + titleBar: TitleBar { + id: players + kind: TitleBarKind.Segmented + options: [ + Option { + id: p1 + text: "Player 1" + value: 0 + selected: true + }, + Option { + id: p2 + text: "Player 2" + value: 1 + }, + Option { + id: p3 + text: "Player 3" + value: 2 + }, + Option { + id: p4 + text: "Player 4" + value: 3 + } + ] + } + + actions: [ + ActionItem { + title: "Rescan" + ActionBar.placement: ActionBarPlacement.OnBar + imageSource: "asset:///images/search.png" + onTriggered: { + RetroArch.discoverController(); + } + } + ] + + Container + { + Container + { + preferredWidth: 650 + horizontalAlignment: HorizontalAlignment.Center + + DropDown + { + objectName: "dropdown_devices" + title: "Device" + } + + ListView + { + id: buttonMapList + objectName: "buttonMapList" + + listItemComponents: [ + ListItemComponent + { + type: "item" + + Container + { + id: itemRoot + horizontalAlignment: HorizontalAlignment.Center + rightPadding: 20 + + Divider {} + + Container + { + horizontalAlignment: HorizontalAlignment.Fill + topPadding: 10 + bottomPadding: 10 + + + layout: DockLayout { + } + + Label + { + horizontalAlignment: HorizontalAlignment.Left + verticalAlignment: VerticalAlignment.Center + text: ListItemData.label + textStyle + { + base: SystemDefaults.TextStyles.PrimaryText + } + } + + Label + { + horizontalAlignment: HorizontalAlignment.Right + verticalAlignment: VerticalAlignment.Center + text: ListItemData.button + textStyle + { + base: SystemDefaults.TextStyles.PrimaryText + } + } + } + + Divider {} + } + } + ] + + //TODO: Map specific devices instead of 0. + onTriggered: + { + var sym, data; + data = dataModel.data(indexPath); + sym = RetroArch.mapButton(0, players.selectedValue, data["index"]); + data["button"] = RetroArch.buttonToString(0, sym); + dataModel.replace(indexPath, data); + } + + function itemType(data, indexPath) + { + return "item"; + } + } + } + } +} \ No newline at end of file diff --git a/blackberry-qnx/bb10/assets/coreInfo.json b/blackberry-qnx/bb10/assets/coreInfo.json index 627e9e5c70..3c9258d119 100644 --- a/blackberry-qnx/bb10/assets/coreInfo.json +++ b/blackberry-qnx/bb10/assets/coreInfo.json @@ -1,6 +1,6 @@ { "snes9x_next_libretro_qnx.so":{ - "display_name":"SNES / Super Famicom", + "display_name":"SNES / Super Famicom (SNES9x Next)", "supported_extensions":"*.smc|*.fig|*.sfc|*.gd3|*.gd7|*.dx2|*.bsx|*.swc", "corename":"SNES9x Next", "manufacturer":"Nintendo", @@ -46,5 +46,141 @@ "manufacturer":"Nintendo", "systemname":"Game Boy Color", "default_overlay":"app/native/overlays/gameboy-landscape.cfg" + }, + "stella_libretro_qnx.so":{ + "display_name":"Atari 2600", + "supported_extensions":"*.a26|*.bin", + "corename":"Stella", + "manufacturer":"Atari", + "systemname":"Atari 2600", + "default_overlay":"app/native/overlays/snes-landscape.cfg" + }, + "tyrquake_libretro_qnx.so":{ + "display_name":"TyrQuake", + "supported_extensions":"*.pak", + "corename":"prboom", + "manufacturer":"", + "systemname":"", + "default_overlay":"app/native/overlays/snes-landscape.cfg" + }, + "desmume_libretro_qnx.so":{ + "display_name":"Nintendo DS", + "supported_extensions":"*.nds", + "corename":"DeSmuME", + "manufacturer":"Nintendo", + "systemname":"Nintendo DS", + "default_overlay":"app/native/overlays/snes-landscape.cfg" + }, + "mednafen_ngp_libretro_qnx.so":{ + "display_name":"Neo Geo Pocket (Color)", + "supported_extensions":"*.ngp|*.ngc", + "corename":"Mednafen Neopop", + "manufacturer":"SNK", + "systemname":"Neo Geo Pocket (Color)", + "default_overlay":"app/native/overlays/snes-landscape.cfg" + }, + "mednafen_pce_libretro_qnx.so":{ + "display_name":"PC Engine/TurboGrafx-16", + "supported_extensions":"*.pce|*.sgx|*.cue", + "corename":"Mednafen PCE Fast", + "manufacturer":"NEC", + "systemname":"PC Engine/TurboGrafx-16", + "default_overlay":"app/native/overlays/snes-landscape.cfg" + }, + "mednafen_psx_libretro_qnx.so":{ + "display_name":"PlayStation1 (Mednafen PSX)", + "supported_extensions":"*.cue|*.toc", + "corename":"Mednafen PSX", + "manufacturer":"Sony", + "systemname":"PlayStation", + "default_overlay":"app/native/overlays/psx-landscape.cfg" + }, + "mednafen_vb_libretro_qnx.so":{ + "display_name":"Virtual Boy", + "supported_extensions":"*.vb|*.vboy|*.bin", + "corename":"Mednafen VB", + "manufacturer":"Nintendo", + "systemname":"Virtual Boy", + "default_overlay":"app/native/overlays/snes-landscape.cfg" + }, + "mednafen_wswan_libretro_qnx.so":{ + "display_name":"WonderSwan (Color)", + "supported_extensions":"*.ws|*.wsc", + "corename":"Mednafen WonderSwan", + "manufacturer":"Bandai", + "systemname":"WonderSwan (Color)", + "default_overlay":"app/native/overlays/snes-landscape.cfg" + }, + "mednafen_gba_libretro_qnx.so":{ + "display_name":"Game Boy Advance (Mednafen VBA)", + "supported_extensions":"*.gba", + "corename":"Mednafen VBA", + "manufacturer":"Nintendo", + "systemname":"Game Boy Advance", + "default_overlay":"app/native/overlays/gba-landscape.cfg" + }, + "nestopia_libretro_qnx.so":{ + "display_name":"NES / Famicom (NEStopia)", + "supported_extensions":"*.nes|*.fds", + "corename":"Nestopia", + "manufacturer":"Nintendo", + "systemname":"Nintendo Entertainment System", + "default_overlay":"app/native/overlays/nes-landscape.cfg" + }, + "nxengine_libretro_qnx.so":{ + "display_name":"NXEngine (Cave Story)", + "supported_extensions":"*.exe", + "corename":"NXEngine", + "manufacturer":"", + "systemname":"", + "default_overlay":"app/native/overlays/snes-landscape.cfg" + }, + "prboom_libretro_qnx.so":{ + "display_name":"PrBoom (DOOM)", + "supported_extensions":"*.wad|*.iwad", + "corename":"prboom", + "manufacturer":"", + "systemname":"", + "default_overlay":"app/native/overlays/snes-landscape.cfg" + }, + "fceumm_libretro_qnx.so":{ + "display_name":"NES / Famicom (FCEUmm)", + "supported_extensions":"*.nes|*.unif", + "corename":"FCEUmm", + "manufacturer":"Nintendo", + "systemname":"Nintendo Entertainment System", + "default_overlay":"app/native/overlays/nes-landscape.cfg" + }, + "modelviewer_libretro_qnx.so":{ + "display_name":"Modelviewer", + "supported_extensions":"*.obj", + "corename":"Modelviewer", + "manufacturer":"Various", + "systemname":"3D Models", + "default_overlay":"app/native/overlays/snes-landscape.cfg" + }, + "quicknes_libretro_qnx.so":{ + "display_name":"NES / Famicom (QuickNES)", + "supported_extensions":"*.nes", + "corename":"QuickNES", + "manufacturer":"Nintendo", + "systemname":"Nintendo Entertainment System", + "default_overlay":"app/native/overlays/nes-landscape.cfg" + }, + "scenewalker_libretro_qnx.so":{ + "display_name":"SceneWalker", + "supported_extensions":"*.obj", + "corename":"SceneWalker", + "manufacturer":"Various", + "systemname":"3D Models", + "default_overlay":"app/native/overlays/snes-landscape.cfg" + }, + "snes9x_libretro_qnx.so":{ + "display_name":"SNES / Super Famicom (SNES9x)", + "supported_extensions":"*.smc|*.fig|*.sfc|*.gd3|*.gd7|*.dx2|*.bsx|*.swc", + "corename":"SNES9x", + "manufacturer":"Nintendo", + "systemname":"Super Nintendo Entertainment System", + "default_overlay":"app/native/overlays/snes-landscape.cfg" } } diff --git a/blackberry-qnx/bb10/assets/images/search.png b/blackberry-qnx/bb10/assets/images/search.png new file mode 100644 index 0000000000..4c1b4700da Binary files /dev/null and b/blackberry-qnx/bb10/assets/images/search.png differ diff --git a/blackberry-qnx/bb10/assets/main.qml b/blackberry-qnx/bb10/assets/main.qml index ab8cd70a1c..fed5ce5c50 100644 --- a/blackberry-qnx/bb10/assets/main.qml +++ b/blackberry-qnx/bb10/assets/main.qml @@ -3,9 +3,17 @@ import bb.cascades.pickers 1.0 TabbedPane { Tab { + title: "Main Menu" MainMenu { + } + } + Tab { + title: "Input" + Controllers + { + } } } diff --git a/blackberry-qnx/bb10/bar-descriptor.xml b/blackberry-qnx/bb10/bar-descriptor.xml index e04a5c2f4d..64ce5cc9d3 100644 --- a/blackberry-qnx/bb10/bar-descriptor.xml +++ b/blackberry-qnx/bb10/bar-descriptor.xml @@ -22,7 +22,7 @@ - 1 + 2 diff --git a/blackberry-qnx/bb10/config.pri b/blackberry-qnx/bb10/config.pri deleted file mode 100644 index 4abec4b0da..0000000000 --- a/blackberry-qnx/bb10/config.pri +++ /dev/null @@ -1,46 +0,0 @@ -# Auto-generated by IDE. Changes by user will be lost! -BASEDIR = $$quote($$_PRO_FILE_PWD_) - -device { - CONFIG(debug, debug|release) { - SOURCES += $$quote($$BASEDIR/src/RetroArch-Cascades.cpp) \ - $$quote($$BASEDIR/src/main.cpp) - - HEADERS += $$quote($$BASEDIR/src/RetroArch-Cascades.h) - - } - - CONFIG(release, debug|release) { - SOURCES += $$quote($$BASEDIR/src/RetroArch-Cascades.cpp) \ - $$quote($$BASEDIR/src/main.cpp) - - HEADERS += $$quote($$BASEDIR/src/RetroArch-Cascades.h) - - } - -} - -simulator { - CONFIG(debug, debug|release) { - SOURCES += $$quote($$BASEDIR/src/RetroArch-Cascades.cpp) \ - $$quote($$BASEDIR/src/main.cpp) - - HEADERS += $$quote($$BASEDIR/src/RetroArch-Cascades.h) - - } - -} - -INCLUDEPATH += $$quote($$BASEDIR/src) - -CONFIG += precompile_header - -PRECOMPILED_HEADER = $$quote($$BASEDIR/precompiled.h) - -lupdate_inclusion { - SOURCES += $$quote($$BASEDIR/../assets/*.qml) - -} - -TRANSLATIONS = $$quote($${TARGET}.ts) - diff --git a/blackberry-qnx/bb10/src/ButtonMap.cpp b/blackberry-qnx/bb10/src/ButtonMap.cpp new file mode 100644 index 0000000000..537db71bdc --- /dev/null +++ b/blackberry-qnx/bb10/src/ButtonMap.cpp @@ -0,0 +1,212 @@ +#include +#include +#include +#include + +#include "ButtonMap.h" +#include "RetroArch-Cascades.h" +#include "input/input_common.h" +#include "../../frontend_qnx.h" + +ButtonMap::ButtonMap(screen_context_t screen_ctx, QString groupId, int coid) +{ + this->screen_cxt = screen_ctx; + this->groupId = groupId; + this->coid = coid; + + const int usage = SCREEN_USAGE_NATIVE | SCREEN_USAGE_WRITE | SCREEN_USAGE_READ; + int rc; + + if(screen_create_window_type(&screen_win, screen_cxt, SCREEN_CHILD_WINDOW)) + { + RARCH_ERR("ButtonMap: screen_create_window_type failed.\n"); + } + + screen_join_window_group(screen_win, (const char *)groupId.toAscii().constData()); + int format = SCREEN_FORMAT_RGBA8888; + screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_FORMAT, &format); + + screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_USAGE, &usage); + + screen_display_t screen_disp; + if (screen_get_window_property_pv(screen_win, SCREEN_PROPERTY_DISPLAY, (void **)&screen_disp)) + { + RARCH_ERR("screen_get_window_property_pv [SCREEN_PROPERTY_DISPLAY] failed.\n"); + } + + if (screen_get_display_property_iv(screen_disp, SCREEN_PROPERTY_SIZE, screen_resolution)) + { + RARCH_ERR("screen_get_window_property_iv [SCREEN_PROPERTY_SIZE] failed.\n"); + } + + rc = screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_BUFFER_SIZE, screen_resolution); + if (rc) { + perror("screen_set_window_property_iv"); + } + + int z = -10; + if (screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_ZORDER, &z) != 0) { + return; + } + + rc = screen_create_window_buffers(screen_win, 1); + if (rc) { + perror("screen_create_window_buffers"); + } + + screen_get_window_property_pv(screen_win, SCREEN_PROPERTY_RENDER_BUFFERS, (void **)&screen_buf); + + int bg[] = { SCREEN_BLIT_COLOR, 0x00000000, + SCREEN_BLIT_GLOBAL_ALPHA, 0x80, + SCREEN_BLIT_END }; + screen_fill(screen_cxt, screen_buf, bg); + + screen_post_window(screen_win, screen_buf, 1, screen_resolution, 0); + + buttonDataModel = new ArrayDataModel(); + + refreshButtonMap(); +} + +ButtonMap::~ButtonMap() +{ + +} + +QString ButtonMap::getLabel(int button) +{ + return QString((uint)platform_keys[button].joykey); +} + +//pass in RARCH button enum for button, map to g_setting + int ButtonMap::mapNextButtonPressed() + { + bps_event_t *event = NULL; + int sym; + + //use in frontend run loop, get key pressed back, and map + int z = 10; + if (screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_ZORDER, &z) != 0) + { + return -1; + } + + screen_post_window(screen_win, screen_buf, 1, screen_resolution, 0); + + while(1){ + if (BPS_SUCCESS != bps_get_event(&event, -1)) + { + fprintf(stderr, "bps_get_event failed\n"); + break; + } + + if (event) + { + int domain = bps_event_get_domain(event); + + if (domain == screen_get_domain()) + { + screen_event_t screen_event = screen_event_get_event(event); + int screen_val; + screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TYPE, &screen_val); + + //TODO: Should we only let the buttons through that we are trying to map? + if(screen_val == SCREEN_EVENT_MTOUCH_TOUCH) + { + //This is touch screen event + sym = -1; + break; + } + else if(screen_val == SCREEN_EVENT_KEYBOARD) + { + screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_KEY_SYM, &sym); + sym &= 0xFF; + break; + } + else if( (screen_val == SCREEN_EVENT_GAMEPAD) || (screen_val == SCREEN_EVENT_JOYSTICK) ) + { + screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_BUTTONS, &sym); + break; + } + } + } + } + + z = -10; + if (screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_ZORDER, &z) != 0) { + return -1; + } + + screen_post_window(screen_win, screen_buf, 1, screen_resolution, 0); + + return (g_settings.input.binds[player][button].joykey = sym); + } + + int ButtonMap::getButtonMapping(int player, int button) + { + return g_settings.input.binds[player][button].joykey; + } + + QString ButtonMap::buttonToString(int button) + { + for(int i=0;i<20;++i) + { + if(platform_keys[i].joykey == (uint)button) + { + return QString(platform_keys[i].desc); + } + } + + return (button!=NO_BTN) ? QString(button) : QString("Not Mapped"); + } + + int ButtonMap::requestButtonMapping(screen_device_t device, int player, int button) + { + //Send message to run thread to start mapping, wait for reply. + recv_msg msg; + msg.code = RETROARCH_BUTTON_MAP; + + this->device = device; + this->player = player; + this->button = button; + + return MsgSend(coid, (void*)&msg, sizeof(msg), (void*)NULL, 0); + } + +void ButtonMap::mapDevice(int index, int player) +{ + if (input_qnx.set_keybinds) + input_qnx.set_keybinds((void*)&devices[index], devices[index].device, player, 0, + (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS)); + + refreshButtonMap(); +} + + void ButtonMap::refreshButtonMap() + { + QVariantMap map; + + buttonDataModel->clear(); + + for(int i=0; i<16; ++i) + { + QString desc = QString(input_config_bind_map[i].desc); + int index = desc.indexOf("("); + if(index != -1) + { + desc.truncate(index); + } + + map.insert("label",QVariant(desc)); + map.insert("button", buttonToString(g_settings.input.binds[0][i].joykey)); + map.insert("type", QVariant("item")); + map.insert("index", QVariant(i)); + buttonDataModel->append(map); + } + + map.insert("label",QVariant("RetroArch Menu")); + map.insert("button", buttonToString(g_settings.input.binds[0][RARCH_MENU_TOGGLE].joykey)); + map.insert("type", QVariant("item")); + map.insert("index", QVariant(RARCH_MENU_TOGGLE)); + buttonDataModel->append(map); + } diff --git a/blackberry-qnx/bb10/src/ButtonMap.h b/blackberry-qnx/bb10/src/ButtonMap.h new file mode 100644 index 0000000000..99cf2c6adc --- /dev/null +++ b/blackberry-qnx/bb10/src/ButtonMap.h @@ -0,0 +1,57 @@ +#ifndef _BUTTONMAP_H_ +#define _BUTTONMAP_H_ + +#include +#include + +#include +#include +#include "general.h" +#include "conf/config_file.h" +#include "file.h" + +/* +typedef struct { + int32_t button; + QString label; +} ButtonMap_t; +*/ + +using namespace bb::cascades; + +class ButtonMap +{ + +public: + ButtonMap(screen_context_t screen_cxt, QString groupId, int coid); + ~ ButtonMap(); + + QString getLabel(int button); + //pass in RARCH button enum for button, map to g_setting + int mapNextButtonPressed(); + //Call in our emulator thread with seperate screen_cxt + int getButtonMapping(int player, int button); + //Call from frontend + int requestButtonMapping(screen_device_t device, int player, int button); + void refreshButtonMap(); + void mapDevice(int index, int player); + + QString buttonToString(int button); + + ArrayDataModel *buttonDataModel; + +private: + screen_context_t screen_cxt; + screen_window_t screen_win; + screen_buffer_t screen_buf; + screen_device_t device; + int player; + int button; + int screen_resolution[2]; + QString groupId; + int coid; + + //use g_settings.input.binds[port][i].joykey = SCREEN_* for mapping +}; + +#endif diff --git a/blackberry-qnx/bb10/src/RetroArch-Cascades.cpp b/blackberry-qnx/bb10/src/RetroArch-Cascades.cpp index c2529ed563..c48a893a64 100644 --- a/blackberry-qnx/bb10/src/RetroArch-Cascades.cpp +++ b/blackberry-qnx/bb10/src/RetroArch-Cascades.cpp @@ -21,6 +21,8 @@ #include "frontend/menu/rgui.h" #endif +#include "../../frontend_qnx.h" + #include #include #include @@ -29,6 +31,8 @@ #include #include #include +#include + #include #include @@ -43,7 +47,11 @@ using namespace bb::cascades; using namespace bb::data; using namespace bb::device; +extern screen_window_t screen_win; +extern screen_context_t screen_ctx; + //Use after calling findCores +//If we allow user added libs, this needs to be error checked #define GET_CORE_INFO(x, y) coreInfo[coreList[x]].toMap()[y].toString() RetroArch::RetroArch() @@ -60,10 +68,15 @@ RetroArch::RetroArch() this, SLOT(onRotationCompleted())); rarch_main_clear_state(); + strlcpy(g_extern.config_path, "app/native/retroarch.cfg", sizeof(g_extern.config_path)); + config_load(); strlcpy(g_settings.libretro, "app/native/lib", sizeof(g_settings.libretro)); coreSelectedIndex = -1; + //Stop config overwritting values + g_extern.block_config_read = true; + QmlDocument *qml = QmlDocument::create("asset:///main.qml"); if (!qml->hasErrors()) @@ -81,6 +94,17 @@ RetroArch::RetroArch() Application::instance()->setScene(mAppPane); + screen_create_context(&screen_ctx, 0); + input_qnx.init(); + buttonMap = new ButtonMap(screen_ctx, (const char*)Application::instance()->mainWindow()->groupId().toAscii().constData(), coid); + + deviceSelection = mAppPane->findChild("dropdown_devices"); + connect(deviceSelection, SIGNAL(selectedValueChanged(QVariant)), this, SLOT(onDeviceSelected(QVariant))); + findDevices(); + + //Setup the datamodel for button mapping. + mAppPane->findChild("buttonMapList")->setDataModel(buttonMap->buttonDataModel); + // Start the thread in which we render to the custom window. start(); } @@ -103,14 +127,30 @@ void RetroArch::aboutToQuit() wait(); } -extern screen_window_t screen_win; -extern screen_context_t screen_ctx; void RetroArch::run() { int rcvid = -1; recv_msg msg; - while (true) { + bps_initialize(); + + if (screen_request_events(screen_ctx) != BPS_SUCCESS) + { + RARCH_ERR("screen_request_events failed.\n"); + } + + if (navigator_request_events(0) != BPS_SUCCESS) + { + RARCH_ERR("navigator_request_events failed.\n"); + } + + if (navigator_rotation_lock(false) != BPS_SUCCESS) + { + RARCH_ERR("navigator_location_lock failed.\n"); + } + + while (true) + { rcvid = MsgReceive(chid, &msg, sizeof(msg), 0); if (rcvid > 0) @@ -119,33 +159,17 @@ void RetroArch::run() { case RETROARCH_START_REQUESTED: { - printf("RetroArch Started Received\n");fflush(stdout); - MsgReply(rcvid,0,NULL,0); - screen_create_context(&screen_ctx, 0); - - bps_initialize(); - - if (screen_request_events(screen_ctx) != BPS_SUCCESS) + if (screen_create_window_type(&screen_win, screen_ctx, SCREEN_CHILD_WINDOW) != BPS_SUCCESS) { - RARCH_ERR("screen_request_events failed.\n"); + RARCH_ERR("Screen create window failed.\n"); } - - if (navigator_request_events(0) != BPS_SUCCESS) + if (screen_join_window_group(screen_win, (const char*)Application::instance()->mainWindow()->groupId().toAscii().constData()) != BPS_SUCCESS) { - RARCH_ERR("navigator_request_events failed.\n"); + RARCH_ERR("Screen join window group failed.\n"); } - if (navigator_rotation_lock(false) != BPS_SUCCESS) - { - RARCH_ERR("navigator_location_lock failed.\n"); - } - - screen_create_window_type(&screen_win, screen_ctx, SCREEN_CHILD_WINDOW); - - screen_join_window_group(screen_win, Application::instance()->mainWindow()->groupId().toAscii().constData()); - char *win_id = "RetroArch_Emulator_Window"; screen_set_window_property_cv(screen_win, SCREEN_PROPERTY_ID_STRING, strlen(win_id), win_id); @@ -157,8 +181,13 @@ void RetroArch::run() initRASettings(); rarch_main(0, NULL); + Application::instance()->exit(); break; } + //The class should probably be it's own QThread, simplify things + case RETROARCH_BUTTON_MAP: + MsgReply(rcvid, buttonMap->mapNextButtonPressed(), NULL, 0); + break; case RETROARCH_EXIT: MsgReply(rcvid,0,NULL,0); goto exit; @@ -167,7 +196,7 @@ void RetroArch::run() } } } - exit: +exit: return; } @@ -230,6 +259,13 @@ void RetroArch::onCoreSelected(QVariant value) qDebug() << "Supported Extensions: " << romExtensions; } +void RetroArch::onDeviceSelected(QVariant value) +{ + //Change the binds for current player to device[value] + //TODO: Don't hardcode player 0 + buttonMap->mapDevice(value.toInt(), 0); +} + /* * Functions */ @@ -260,8 +296,10 @@ void RetroArch::findCores() int count=0, i=0; dirp = opendir(g_settings.libretro); - if( dirp != NULL ) { - for(;;) { + if( dirp != NULL ) + { + for(;;) + { direntp = readdir( dirp ); if( direntp == NULL ) break; count++; @@ -269,14 +307,16 @@ void RetroArch::findCores() fflush(stdout); rewinddir(dirp); - if(count==2){ + if(count==2) + { printf("No Cores Found");fflush(stdout); } coreList = (char**)malloc(count*sizeof(char*)); count = 0; - for(;;){ + for(;;) + { direntp = readdir( dirp ); if( direntp == NULL ) break; coreList[count++] = strdup((char*)direntp->d_name); @@ -304,6 +344,29 @@ void RetroArch::findCores() closedir(dirp); } +void RetroArch::findDevices() +{ + //Find all connected devices. + Option *tmp; + + deviceSelection->removeAll(); + + //Populate DropDown + for (int i = 0; i < pads_connected; ++i) + { + tmp = Option::create().text(devices[i].device_name) + .value(i); + + deviceSelection->add(tmp); + + //QML shows player 1 by default, so set dropdown to their controller. + if(devices[i].port == 0 || devices[i].device == DEVICE_KEYPAD) + { + deviceSelection->setSelectedIndex(i); + } + } +} + void RetroArch::initRASettings() { strlcpy(g_settings.libretro,(char *)core.toAscii().constData(), sizeof(g_settings.libretro)); @@ -311,7 +374,35 @@ void RetroArch::initRASettings() HardwareInfo *hwInfo = new HardwareInfo(); - if(!hwInfo->isPhysicalKeyboardDevice()) + //If Physical keyboard or a device mapped to player 1, hide overlay + //TODO: Should there be a minimized/quick settings only overlay? + if(!hwInfo->isPhysicalKeyboardDevice() && !port_device[0]) strlcpy(g_settings.input.overlay, GET_CORE_INFO(coreSelectedIndex, "default_overlay").toAscii().constData(), sizeof(g_settings.input.overlay)); + else + *g_settings.input.overlay = '\0'; } +int RetroArch::mapButton(void* deviceVp, int player, int button) +{ + screen_device_t device = (screen_device_t)deviceVp; + return buttonMap->requestButtonMapping(device, player, button); +} + +QString RetroArch::buttonToString(void* deviceVp, int button) +{ + //TODO: Check deviceVp, gamepad/keyboard and return accordingly. + if(g_settings.input.device[0] == DEVICE_KEYPAD || g_settings.input.device[0] == DEVICE_KEYBOARD) + return QString(button); + else + return buttonMap->buttonToString(button); +} + +extern "C" void discoverControllers(); +void RetroArch::discoverController() +{ + //TODO: Check device, gamepad/keyboard and return accordingly. + discoverControllers(); + findDevices(); + buttonMap->refreshButtonMap(); + return; +} diff --git a/blackberry-qnx/bb10/src/RetroArch-Cascades.h b/blackberry-qnx/bb10/src/RetroArch-Cascades.h index aa58391922..14d51ca128 100644 --- a/blackberry-qnx/bb10/src/RetroArch-Cascades.h +++ b/blackberry-qnx/bb10/src/RetroArch-Cascades.h @@ -8,6 +8,7 @@ #include #include +#include "ButtonMap.h" using namespace bb::cascades; @@ -33,6 +34,10 @@ public: Q_INVOKABLE void startEmulator(); Q_INVOKABLE void findCores(); + Q_INVOKABLE void findDevices(); + Q_INVOKABLE int mapButton(void* device, int player, int button); + Q_INVOKABLE QString buttonToString(void* deviceVp, int button); + Q_INVOKABLE void discoverController(); signals: void romChanged(QString); @@ -43,6 +48,7 @@ public slots: void aboutToQuit(); void onRotationCompleted(); void onCoreSelected(QVariant); + void onDeviceSelected(QVariant); private: /** @@ -67,21 +73,25 @@ private: int chid, coid; int state; DropDown *coreSelection; + DropDown *deviceSelection; QVariantMap coreInfo; char **coreList; int coreSelectedIndex; + + ButtonMap *buttonMap; }; enum { RETROARCH_RUNNING, RETROARCH_START_REQUESTED, + RETROARCH_BUTTON_MAP, RETROARCH_EXIT }; typedef union { _pulse pulse; - int code; + int code; } recv_msg; #endif diff --git a/blackberry-qnx/frontend_qnx.h b/blackberry-qnx/frontend_qnx.h new file mode 100644 index 0000000000..13c35ba132 --- /dev/null +++ b/blackberry-qnx/frontend_qnx.h @@ -0,0 +1,61 @@ +#ifndef _FRONTENDQNX_H_ +#define _FRONTENDQNX_H_ + +#define MAX_PADS 8 + +//Internal helper functions +typedef struct { + // Static device info. +#ifdef HAVE_BB10 + screen_device_t handle; +#endif + int type; + int analogCount; + int buttonCount; + char id[64]; + char vendor[64]; + char product[64]; + + char device_name[64]; + int device; + int port; + + // Current state. + int buttons; + int analog0[3]; + int analog1[3]; +} input_device_t; + +//Device struct to port mapping +extern input_device_t *port_device[MAX_PADS]; + +extern unsigned pads_connected; + +#ifdef HAVE_BB10 +const struct platform_bind platform_keys[] = { + { SCREEN_A_GAME_BUTTON, "A button" }, + { SCREEN_B_GAME_BUTTON, "B button" }, + { SCREEN_C_GAME_BUTTON, "C button" }, + { SCREEN_X_GAME_BUTTON, "X button" }, + { SCREEN_Y_GAME_BUTTON, "Y button" }, + { SCREEN_Z_GAME_BUTTON, "Z button" }, + { SCREEN_MENU1_GAME_BUTTON, "Menu1 button" }, + { SCREEN_MENU2_GAME_BUTTON, "Menu2 button" }, + { SCREEN_MENU3_GAME_BUTTON, "Menu3 button" }, + { SCREEN_MENU4_GAME_BUTTON, "Menu4 button" }, + { SCREEN_L1_GAME_BUTTON, "L1 Button" }, + { SCREEN_L2_GAME_BUTTON, "L2 Button" }, + { SCREEN_L3_GAME_BUTTON, "L3 Button" }, + { SCREEN_R1_GAME_BUTTON, "R1 Button" }, + { SCREEN_R2_GAME_BUTTON, "R2 Button" }, + { SCREEN_R3_GAME_BUTTON, "R3 Button" }, + { SCREEN_DPAD_UP_GAME_BUTTON, "Up D-pad" }, + { SCREEN_DPAD_DOWN_GAME_BUTTON, "Down D-pad" }, + { SCREEN_DPAD_LEFT_GAME_BUTTON, "Left D-pad" }, + { SCREEN_DPAD_RIGHT_GAME_BUTTON, "Right D-pad" }, +}; +#endif + +extern input_device_t devices[MAX_PADS]; + +#endif diff --git a/blackberry-qnx/qnx_input.c b/blackberry-qnx/qnx_input.c index 1525ee1c05..753f2ce539 100644 --- a/blackberry-qnx/qnx_input.c +++ b/blackberry-qnx/qnx_input.c @@ -20,8 +20,9 @@ #include #include +#include "frontend_qnx.h" + #define MAX_TOUCH 16 -#define MAX_PADS 8 struct touches { @@ -33,56 +34,15 @@ struct touches static struct touches touch[MAX_TOUCH]; static unsigned touch_count; -//Internal helper functions -typedef struct { - // Static device info. -#ifdef HAVE_BB10 - screen_device_t handle; -#endif - int type; - int analogCount; - int buttonCount; - char id[64]; - char vendor[64]; - char product[64]; - - // Current state. - int buttons; - int analog0[3]; - int analog1[3]; -} input_device_t; - input_device_t devices[MAX_PADS]; +input_device_t *port_device[MAX_PADS]; -static unsigned pads_connected; +unsigned pads_connected; static void qnx_input_autodetect_gamepad(input_device_t* controller); +static void initController(input_device_t* controller); #ifdef HAVE_BB10 - -const struct platform_bind platform_keys[] = { - { SCREEN_A_GAME_BUTTON, "A button" }, - { SCREEN_B_GAME_BUTTON, "B button" }, - { SCREEN_C_GAME_BUTTON, "C button" }, - { SCREEN_X_GAME_BUTTON, "X button" }, - { SCREEN_Y_GAME_BUTTON, "Y button" }, - { SCREEN_Z_GAME_BUTTON, "Z button" }, - { SCREEN_MENU1_GAME_BUTTON, "Menu1 button" }, - { SCREEN_MENU2_GAME_BUTTON, "Menu2 button" }, - { SCREEN_MENU3_GAME_BUTTON, "Menu3 button" }, - { SCREEN_MENU4_GAME_BUTTON, "Menu4 button" }, - { SCREEN_L1_GAME_BUTTON, "L1 Button" }, - { SCREEN_L2_GAME_BUTTON, "L2 Button" }, - { SCREEN_L3_GAME_BUTTON, "L3 Button" }, - { SCREEN_R1_GAME_BUTTON, "R1 Button" }, - { SCREEN_R2_GAME_BUTTON, "R2 Button" }, - { SCREEN_R3_GAME_BUTTON, "R3 Button" }, - { SCREEN_DPAD_UP_GAME_BUTTON, "D-Pad Up" }, - { SCREEN_DPAD_DOWN_GAME_BUTTON, "D-Pad Down" }, - { SCREEN_DPAD_LEFT_GAME_BUTTON, "D-Pad Left" }, - { SCREEN_DPAD_RIGHT_GAME_BUTTON, "D-Pad Right" }, -}; - static void process_gamepad_event(screen_event_t screen_event, int type) { screen_device_t device; @@ -110,6 +70,11 @@ static void process_gamepad_event(screen_event_t screen_event, int type) if (controller->analogCount == 2) screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_ANALOG1, controller->analog1); + + //Only player 1 + //TODO: Am I missing something? Is there a better way? + if((controller->port == 0) && (controller->buttons & g_settings.input.binds[0][RARCH_MENU_TOGGLE].joykey)) + g_extern.lifecycle_state ^= (1ULL << RARCH_MENU_TOGGLE); } static void loadController(input_device_t* controller) @@ -152,7 +117,7 @@ static void loadController(input_device_t* controller) } extern screen_context_t screen_ctx; -static void discoverControllers() +void discoverControllers() { // Get an array of all available devices. int deviceCount; @@ -163,6 +128,11 @@ static void discoverControllers() // Scan the list for gamepad and joystick devices. int i; + for(i=0;ibuttons = 0; controller->analog0[0] = controller->analog0[1] = controller->analog0[2] = 0; controller->analog1[0] = controller->analog1[1] = controller->analog1[2] = 0; + controller->port = -1; + controller->device = -1; memset(controller->id, 0, sizeof(controller->id)); } static void qnx_input_autodetect_gamepad(input_device_t* controller) { - int device; - //ID: A-BBBB-CCCC-D.D //A is the device's index in the array returned by screen_get_context_property_pv() //BBBB is the device's Vendor ID (in hexadecimal) //CCCC is the device's Product ID (also in hexadecimal) //D.D is the device's version number if (strstr(controller->id, "057E-0306")) - device = DEVICE_WIIMOTE; + { + controller->device = DEVICE_WIIMOTE; + strlcpy(controller->device_name, "Wiimote", sizeof(controller->device_name)); + } else if (strstr(controller->id, "0A5C-8502")) - device = DEVICE_KEYBOARD; + { + controller->device = DEVICE_KEYBOARD; + strlcpy(controller->device_name, "BlackBerry BT Keyboard", sizeof(controller->device_name)); + } else if (strstr(controller->id, "qwerty:bb35")) - device = DEVICE_KEYPAD; - else if (controller->id) - device = DEVICE_UNKNOWN; + { + controller->device = DEVICE_KEYPAD; + strlcpy(controller->device_name, "BlackBerry Q10 Keypad", sizeof(controller->device_name)); + } + else if (strstr(controller->id, "BB-VKB")) + { + controller->device = DEVICE_NONE; + strlcpy(controller->device_name, "None", sizeof(controller->device_name)); + } + else if (controller->id[0]) + { + controller->device = DEVICE_UNKNOWN; + strlcpy(controller->device_name, "Unknown", sizeof(controller->device_name)); + } else - device = DEVICE_NONE; + { + controller->device = DEVICE_NONE; + strlcpy(controller->device_name, "None", sizeof(controller->device_name)); + } - if (driver.input->set_keybinds) - driver.input->set_keybinds((void*)controller, device, pads_connected, 0, + if (input_qnx.set_keybinds) + input_qnx.set_keybinds((void*)controller, controller->device, pads_connected, 0, (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS)); } @@ -267,10 +257,13 @@ static void process_keyboard_event(screen_event_t event, int type) controller = &devices[0]; #endif + if(controller->port == -1) + return; + int b; for (b = 0; b < RARCH_FIRST_CUSTOM_BIND; ++b) { - if ((unsigned int)g_settings.input.binds[i][b].joykey == (unsigned int)(sym&0xFF)) + if ((unsigned int)g_settings.input.binds[controller->port][b].joykey == (unsigned int)(sym&0xFF)) { if (flags & KEY_DOWN) controller->buttons |= 1 << b; @@ -279,6 +272,11 @@ static void process_keyboard_event(screen_event_t event, int type) } } + + //TODO: Am I missing something? Is there a better way? + if((controller->port == 0) && ((unsigned int)g_settings.input.binds[0][RARCH_MENU_TOGGLE].joykey == (unsigned int)(sym&0xFF))) + if (flags & KEY_DOWN) + g_extern.lifecycle_state ^= (1ULL << RARCH_MENU_TOGGLE); } static void process_touch_event(screen_event_t event, int type) @@ -450,21 +448,28 @@ static void handle_navigator_event(bps_event_t *event) static void *qnx_input_init(void) { int i; + static int initialized = 0; + + if(initialized) + return (void*)-1; for (i = 0; i < MAX_TOUCH; ++i) touch[i].contact_id = -1; for (i = 0; i < MAX_PADS; ++i) + { initController(&devices[i]); + port_device[i] = 0; + } #ifdef HAVE_BB10 - pads_connected = 0; - //Find currently connected gamepads discoverControllers(); #else init_playbook_keyboard(); #endif + initialized = 1; + return (void*)-1; } @@ -504,31 +509,39 @@ 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 || 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)); + if(port_device[port]) + { + if (port_device[port]->device == DEVICE_KEYBOARD || port_device[port]->device == DEVICE_KEYPAD) + return ((port_device[port]->buttons & (1 << id)) && (port < pads_connected) ); + else{ + return ((port_device[port]->buttons & retro_keybinds[port][id].joykey) && (port < pads_connected)); + } + } #ifdef HAVE_BB10 case RETRO_DEVICE_ANALOG: //Need to return [-0x8000, 0x7fff] //Gamepad API gives us [-128, 127] with (0,0) center //Untested - switch ((index << 1) | id) + if(port_device[port]) { - case (RETRO_DEVICE_INDEX_ANALOG_LEFT << 1) | RETRO_DEVICE_ID_ANALOG_X: - return devices[port].analog0[0] * 256; - case (RETRO_DEVICE_INDEX_ANALOG_LEFT << 1) | RETRO_DEVICE_ID_ANALOG_Y: - return devices[port].analog0[1] * 256; - case (RETRO_DEVICE_INDEX_ANALOG_RIGHT << 1) | RETRO_DEVICE_ID_ANALOG_X: - return devices[port].analog1[0] * 256; - case (RETRO_DEVICE_INDEX_ANALOG_RIGHT << 1) | RETRO_DEVICE_ID_ANALOG_Y: - return devices[port].analog1[1] * 256; - default: - break; + switch ((index << 1) | id) + { + case (RETRO_DEVICE_INDEX_ANALOG_LEFT << 1) | RETRO_DEVICE_ID_ANALOG_X: + return port_device[port]->analog0[0] * 256; + case (RETRO_DEVICE_INDEX_ANALOG_LEFT << 1) | RETRO_DEVICE_ID_ANALOG_Y: + return port_device[port]->analog0[1] * 256; + case (RETRO_DEVICE_INDEX_ANALOG_RIGHT << 1) | RETRO_DEVICE_ID_ANALOG_X: + return port_device[port]->analog1[0] * 256; + case (RETRO_DEVICE_INDEX_ANALOG_RIGHT << 1) | RETRO_DEVICE_ID_ANALOG_Y: + return port_device[port]->analog1[1] * 256; + default: + break; + } } break; #endif case RARCH_DEVICE_POINTER_SCREEN: + case RETRO_DEVICE_POINTER: { switch (id) { @@ -548,7 +561,7 @@ static int16_t qnx_input_state(void *data, const struct retro_keybind **retro_ke static bool qnx_input_key_pressed(void *data, int key) { - return ((g_extern.lifecycle_state | driver.overlay_state) & (1ULL << key)); + return ((g_extern.lifecycle_state | driver.overlay_state ) & (1ULL << key)); } static void qnx_input_free_input(void *data) @@ -559,6 +572,7 @@ static void qnx_input_free_input(void *data) static void qnx_input_set_keybinds(void *data, unsigned device, unsigned port, unsigned id, unsigned keybind_action) { + input_device_t *controller = (input_device_t*)data; #ifdef HAVE_BB10 uint64_t *key = &g_settings.input.binds[port][id].joykey; uint64_t joykey = *key; @@ -615,6 +629,7 @@ static void qnx_input_set_keybinds(void *data, unsigned device, unsigned port, { #ifdef HAVE_BB10 case DEVICE_WIIMOTE: + //TODO:Have enum lookup for string strlcpy(g_settings.input.device_names[port], "Wiimote", sizeof(g_settings.input.device_names[port])); g_settings.input.device[port] = device; @@ -634,7 +649,10 @@ static void qnx_input_set_keybinds(void *data, unsigned device, unsigned port, g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R2].def_joykey = SCREEN_R2_GAME_BUTTON; g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L3].def_joykey = SCREEN_L3_GAME_BUTTON; g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R3].def_joykey = SCREEN_R3_GAME_BUTTON; + g_settings.input.binds[port][RARCH_MENU_TOGGLE].def_joykey = SCREEN_MENU3_GAME_BUTTON; g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE; + controller->port = port; + port_device[port] = controller; break; case DEVICE_KEYPAD: strlcpy(g_settings.input.device_names[port], "BlackBerry Q10 Keypad", @@ -656,7 +674,10 @@ static void qnx_input_set_keybinds(void *data, unsigned device, unsigned port, 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.binds[port][RARCH_MENU_TOGGLE].def_joykey = KEYCODE_P & 0xFF; g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE; + controller->port = port; + port_device[port] = controller; break; #endif case DEVICE_KEYBOARD: @@ -679,7 +700,10 @@ static void qnx_input_set_keybinds(void *data, unsigned device, unsigned port, 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.binds[port][RARCH_MENU_TOGGLE].def_joykey = KEYCODE_TILDE; g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE; + controller->port = port; + port_device[port] = controller; break; #ifdef HAVE_BB10 case DEVICE_UNKNOWN: @@ -702,7 +726,10 @@ static void qnx_input_set_keybinds(void *data, unsigned device, unsigned port, g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R2].def_joykey = SCREEN_R2_GAME_BUTTON; g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L3].def_joykey = SCREEN_L3_GAME_BUTTON; g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R3].def_joykey = SCREEN_R3_GAME_BUTTON; + g_settings.input.binds[port][RARCH_MENU_TOGGLE].def_joykey = 0; //TODO: Find a good mappnig g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE; + controller->port = port; + port_device[port] = controller; break; case DEVICE_NONE: default: @@ -725,6 +752,9 @@ static void qnx_input_set_keybinds(void *data, unsigned device, unsigned port, 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.binds[port][RARCH_MENU_TOGGLE].def_joykey = 0; + controller->port = -1; + port_device[port] = 0; break; #endif } @@ -734,6 +764,9 @@ static void qnx_input_set_keybinds(void *data, unsigned device, unsigned port, g_settings.input.binds[port][i].id = i; g_settings.input.binds[port][i].joykey = g_settings.input.binds[port][i].def_joykey; } + + g_settings.input.binds[port][RARCH_MENU_TOGGLE].id = RARCH_MENU_TOGGLE; + g_settings.input.binds[port][RARCH_MENU_TOGGLE].joykey = g_settings.input.binds[port][RARCH_MENU_TOGGLE].def_joykey; } #ifdef HAVE_BB10 diff --git a/driver.h b/driver.h index 2bd3c9c55d..6267c2af05 100644 --- a/driver.h +++ b/driver.h @@ -522,6 +522,7 @@ extern const input_driver_t input_gx; extern const input_driver_t input_xinput; extern const input_driver_t input_linuxraw; extern const input_driver_t input_ios; +extern const input_driver_t input_qnx; extern const input_driver_t input_null; #include "driver_funcs.h" diff --git a/frontend/frontend_bbqnx.c b/frontend/frontend_bbqnx.c index c9765ffba9..837831ab45 100644 --- a/frontend/frontend_bbqnx.c +++ b/frontend/frontend_bbqnx.c @@ -30,11 +30,11 @@ int rarch_main(int argc, char *argv[]) bps_initialize(); rarch_main_clear_state(); strlcpy(g_settings.libretro, "app/native/lib", sizeof(g_settings.libretro)); -#endif strlcpy(g_extern.config_path, "app/native/retroarch.cfg", sizeof(g_extern.config_path)); strlcpy(g_settings.video.shader_dir, "app/native/shaders_glsl", sizeof(g_settings.video.shader_dir)); config_load(); +#endif g_extern.verbose = true; @@ -42,11 +42,6 @@ int rarch_main(int argc, char *argv[]) g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME); -#ifdef HAVE_BB10 - if (!g_extern.libretro_dummy) - menu_rom_history_push_current(); -#endif - for (;;) { if (g_extern.system.shutdown) diff --git a/griffin/griffin.c b/griffin/griffin.c index fef0790200..0893c69a8d 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -403,7 +403,7 @@ MAIN #include "../frontend/frontend_ios.c" #endif -#if defined(__QNX__) || !defined(RARCH_MOBILE) +#if (defined(__QNX__) && !defined(HAVE_BB10)) || !defined(RARCH_MOBILE) #include "../frontend/frontend.c" #endif