Create HAVE_BTSTACK ifdef

This commit is contained in:
twinaphex 2015-11-16 04:17:13 +01:00
parent 7b7869eb4c
commit 4f55b360ac
4 changed files with 23 additions and 9 deletions

View File

@ -395,9 +395,11 @@ INPUT (HID)
#include "../input/drivers_hid/libusb_hid.c" #include "../input/drivers_hid/libusb_hid.c"
#endif #endif
#if defined(__APPLE__) && defined(IOS) #ifdef HAVE_BTSTACK
#include "../input/drivers_hid/btstack_hid.c" #include "../input/drivers_hid/btstack_hid.c"
#elif defined(__APPLE__) && defined(HAVE_IOHIDMANAGER) #endif
#if defined(__APPLE__) && defined(HAVE_IOHIDMANAGER)
#include "../input/drivers_hid/iohidmanager_hid.c" #include "../input/drivers_hid/iohidmanager_hid.c"
#endif #endif

View File

@ -23,7 +23,7 @@
#include "../string_list_special.h" #include "../string_list_special.h"
static hid_driver_t *hid_drivers[] = { static hid_driver_t *hid_drivers[] = {
#if defined(__APPLE__) && defined(IOS) #if defined(HAVE_BTSTACK)
&btstack_hid, &btstack_hid,
#endif #endif
#if defined(__APPLE__) && defined(HAVE_IOHIDMANAGER) #if defined(__APPLE__) && defined(HAVE_IOHIDMANAGER)

View File

@ -553,6 +553,7 @@
"-DHAVE_MEMMAP", "-DHAVE_MEMMAP",
"-D_LZMA_UINT32_IS_ULONG", "-D_LZMA_UINT32_IS_ULONG",
"-DHAVE_MFI", "-DHAVE_MFI",
"-DHAVE_BTSTACK",
"-DHAVE_AVFOUNDATION", "-DHAVE_AVFOUNDATION",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.libretro.RetroArch9; PRODUCT_BUNDLE_IDENTIFIER = com.libretro.RetroArch9;
@ -627,6 +628,7 @@
"-DHAVE_MEMMAP", "-DHAVE_MEMMAP",
"-D_LZMA_UINT32_IS_ULONG", "-D_LZMA_UINT32_IS_ULONG",
"-DHAVE_MFI", "-DHAVE_MFI",
"-DHAVE_BTSTACK",
"-DHAVE_AVFOUNDATION", "-DHAVE_AVFOUNDATION",
); );
"OTHER_CFLAGS[arch=*]" = ( "OTHER_CFLAGS[arch=*]" = (
@ -671,6 +673,7 @@
"-DHAVE_MEMMAP", "-DHAVE_MEMMAP",
"-D_LZMA_UINT32_IS_ULONG", "-D_LZMA_UINT32_IS_ULONG",
"-DHAVE_MFI", "-DHAVE_MFI",
"-DHAVE_BTSTACK",
"-DHAVE_AVFOUNDATION", "-DHAVE_AVFOUNDATION",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.libretro.RetroArch9; PRODUCT_BUNDLE_IDENTIFIER = com.libretro.RetroArch9;
@ -1055,6 +1058,7 @@
"-DHAVE_MEMMAP", "-DHAVE_MEMMAP",
"-D_LZMA_UINT32_IS_ULONG", "-D_LZMA_UINT32_IS_ULONG",
"-DHAVE_MFI", "-DHAVE_MFI",
"-DHAVE_BTSTACK",
"-DHAVE_AVFOUNDATION", "-DHAVE_AVFOUNDATION",
); );
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
@ -1128,6 +1132,7 @@
"-DHAVE_MEMMAP", "-DHAVE_MEMMAP",
"-D_LZMA_UINT32_IS_ULONG", "-D_LZMA_UINT32_IS_ULONG",
"-DHAVE_MFI", "-DHAVE_MFI",
"-DHAVE_BTSTACK",
"-DHAVE_AVFOUNDATION", "-DHAVE_AVFOUNDATION",
); );
"OTHER_CFLAGS[arch=*]" = ( "OTHER_CFLAGS[arch=*]" = (
@ -1172,6 +1177,7 @@
"-DHAVE_MEMMAP", "-DHAVE_MEMMAP",
"-D_LZMA_UINT32_IS_ULONG", "-D_LZMA_UINT32_IS_ULONG",
"-DHAVE_MFI", "-DHAVE_MFI",
"-DHAVE_BTSTACK",
"-DHAVE_AVFOUNDATION", "-DHAVE_AVFOUNDATION",
); );
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";

View File

@ -28,10 +28,13 @@
#include "../../menu/menu_setting.h" #include "../../menu/menu_setting.h"
#include "../../retroarch.h" #include "../../retroarch.h"
#include "../../input/drivers_hid/btstack_hid.h"
#include "../../frontend/frontend.h" #include "../../frontend/frontend.h"
#include "../../runloop_data.h" #include "../../runloop_data.h"
#ifdef HAVE_BTSTACK
#include "../../input/drivers_hid/btstack_hid.h"
#endif
static char msg_old[PATH_MAX_LENGTH]; static char msg_old[PATH_MAX_LENGTH];
static id apple_platform; static id apple_platform;
static CFRunLoopObserverRef iterate_observer; static CFRunLoopObserverRef iterate_observer;
@ -280,7 +283,9 @@ enum
self.mainmenu.last_menu = self.mainmenu; self.mainmenu.last_menu = self.mainmenu;
[self pushViewController:self.mainmenu animated:NO]; [self pushViewController:self.mainmenu animated:NO];
#ifdef HAVE_BTSTACK
btpad_set_inquiry_state(false); btpad_set_inquiry_state(false);
#endif
[self refreshSystemConfig]; [self refreshSystemConfig];
[self showGameView]; [self showGameView];
@ -385,8 +390,6 @@ enum
- (void)refreshSystemConfig - (void)refreshSystemConfig
{ {
bool is_btstack;
/* Get enabled orientations */ /* Get enabled orientations */
apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskAll; apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskAll;
@ -395,10 +398,11 @@ enum
else if (!strcmp(apple_frontend_settings.orientations, "portrait")) else if (!strcmp(apple_frontend_settings.orientations, "portrait"))
apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
#ifdef HAVE_BTSTACK
/* Set bluetooth mode */ /* Set bluetooth mode */
is_btstack = !(strcmp(apple_frontend_settings.bluetooth_mode, "btstack")); if (!(strcmp(apple_frontend_settings.bluetooth_mode, "btstack")))
btstack_set_poweron(is_btstack);
btstack_set_poweron(is_btstack); #endif
} }
- (void)mainMenuRefresh - (void)mainMenuRefresh
@ -457,7 +461,9 @@ void apple_rarch_exited(void)
if (!ap) if (!ap)
return; return;
[ap showPauseMenu:ap]; [ap showPauseMenu:ap];
#ifdef HAVE_BTSTACK
btpad_set_inquiry_state(true); btpad_set_inquiry_state(true);
#endif
} }
typedef struct ui_companion_cocoatouch typedef struct ui_companion_cocoatouch