SDL: Added support for the Backbone One controller on iOS

From 8986efd64399df4a55c0e588f123acaa1da01d52 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 22 Apr 2022 14:21:46 -0700
Subject: [PATCH] Added support for the Backbone One controller on iOS

---
 src/joystick/iphoneos/SDL_mfijoystick.m | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/joystick/iphoneos/SDL_mfijoystick.m b/src/joystick/iphoneos/SDL_mfijoystick.m
index c75fbbae2c5..38ab3fe605d 100644
--- a/src/joystick/iphoneos/SDL_mfijoystick.m
+++ b/src/joystick/iphoneos/SDL_mfijoystick.m
@@ -330,6 +330,19 @@ @interface GCMicroGamepad (SDL)
             subtype = 1;
         }
 
+        if (SDL_strcmp(name, "Backbone One") == 0) {
+            /* The Backbone app uses the guide and share buttons */
+            if ((device->button_mask & (1 << SDL_CONTROLLER_BUTTON_GUIDE)) != 0) {
+                device->button_mask &= ~(1 << SDL_CONTROLLER_BUTTON_GUIDE);
+                --nbuttons;
+            }
+            if ((device->button_mask & (1 << SDL_CONTROLLER_BUTTON_MISC1)) != 0) {
+                device->button_mask &= ~(1 << SDL_CONTROLLER_BUTTON_MISC1);
+                --nbuttons;
+                device->has_xbox_share_button = SDL_FALSE;
+            }
+        }
+
         device->naxes = 6; /* 2 thumbsticks and 2 triggers */
         device->nhats = 1; /* d-pad */
         device->nbuttons = nbuttons;