Browse Source

PS3 Some controllers don't have the full correctly spelled names

main
Kurt Eckhardt 5 years ago
parent
commit
5b85e608b7
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      joystick.cpp
  2. +2
    -2
      keyboard.cpp

+ 2
- 2
joystick.cpp View File

@@ -698,7 +698,7 @@ bool JoystickController::claim_bluetooth(BluetoothController *driver, uint32_t b
btdevice = (Device_t*)driver; // remember this way
return true;
}
if (remoteName && (strncmp((const char *)remoteName, "PLAYSTATION(R)3 Controller", 26) == 0)) {
if (remoteName && (strncmp((const char *)remoteName, "PLAYSTATION(R)3", 15) == 0)) {
DBGPrintf("JoystickController::claim_bluetooth TRUE PS3 hack...\n");
btdriver_ = driver;
btdevice = (Device_t*)driver; // remember this way
@@ -799,7 +799,7 @@ bool JoystickController::remoteNameComplete(const uint8_t *remoteName)
DBGPrintf(" JoystickController::remoteNameComplete %s - set to PS4\n", remoteName);
special_process_required = SP_NEED_CONNECT; // We need to force this.
joystickType = PS4;
} else if (strncmp((const char *)remoteName, "PLAYSTATION(R)3 Controller", 26) == 0) {
} else if (strncmp((const char *)remoteName, "PLAYSTATION(R)3", 15) == 0) {
DBGPrintf(" JoystickController::remoteNameComplete %s - set to PS3\n", remoteName);
special_process_required = SP_PS3_IDS; // PS3 maybe needs different IDS.
joystickType = PS3;

+ 2
- 2
keyboard.cpp View File

@@ -497,7 +497,7 @@ bool KeyboardController::claim_bluetooth(BluetoothController *driver, uint32_t b
{
USBHDBGSerial.printf("Keyboard Controller::claim_bluetooth - Class %x\n", bluetooth_class);
if ((((bluetooth_class & 0xff00) == 0x2500) || (((bluetooth_class & 0xff00) == 0x500))) && (bluetooth_class & 0x40)) {
if (remoteName && (strncmp((const char *)remoteName, "PLAYSTATION(R)3 Controller", 26) == 0)) {
if (remoteName && (strncmp((const char *)remoteName, "PLAYSTATION(R)3", 15) == 0)) {
USBHDBGSerial.printf("KeyboardController::claim_bluetooth Reject PS3 hack\n");
return false;
}
@@ -511,7 +511,7 @@ bool KeyboardController::claim_bluetooth(BluetoothController *driver, uint32_t b
bool KeyboardController::remoteNameComplete(const uint8_t *remoteName)
{
// Real Hack some PS3 controllers bluetoot class is keyboard...
if (strncmp((const char *)remoteName, "PLAYSTATION(R)3 Controller", 26) == 0) {
if (strncmp((const char *)remoteName, "PLAYSTATION(R)3", 15) == 0) {
USBHDBGSerial.printf(" KeyboardController::remoteNameComplete %s - Oops PS3 unclaim\n", remoteName);
return false;
}

Loading…
Cancel
Save