mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-04 22:59:49 +00:00
Remove newlines from log messages
This commit is contained in:
committed by
Sam Lantinga
parent
17625e20df
commit
718034f5fa
@@ -566,7 +566,7 @@ static bool HIDAPI_DriverPS3_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Unknown PS3 packet: 0x%.2x\n", data[0]);
|
||||
SDL_Log("Unknown PS3 packet: 0x%.2x", data[0]);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1004,7 +1004,7 @@ static bool HIDAPI_DriverPS3ThirdParty_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
HIDAPI_DriverPS3ThirdParty_HandleStatePacket18(joystick, ctx, data, size);
|
||||
} else {
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Unknown PS3 packet, size %d\n", size);
|
||||
SDL_Log("Unknown PS3 packet, size %d", size);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1357,7 +1357,7 @@ static bool HIDAPI_DriverPS3SonySixaxis_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Unknown PS3 packet: 0x%.2x\n", data[0]);
|
||||
SDL_Log("Unknown PS3 packet: 0x%.2x", data[0]);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ static bool HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device)
|
||||
if (size > 0) {
|
||||
HIDAPI_DumpPacket("PS4 first packet: size = %d", data, size);
|
||||
} else {
|
||||
SDL_Log("PS4 first packet: size = %d\n", size);
|
||||
SDL_Log("PS4 first packet: size = %d", size);
|
||||
}
|
||||
#endif
|
||||
if (size > 0 &&
|
||||
@@ -468,7 +468,7 @@ static bool HIDAPI_DriverPS4_LoadOfficialCalibrationData(SDL_HIDAPI_Device *devi
|
||||
|
||||
if (!ctx->official_controller) {
|
||||
#ifdef DEBUG_PS4_CALIBRATION
|
||||
SDL_Log("Not an official controller, ignoring calibration\n");
|
||||
SDL_Log("Not an official controller, ignoring calibration");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -478,7 +478,7 @@ static bool HIDAPI_DriverPS4_LoadOfficialCalibrationData(SDL_HIDAPI_Device *devi
|
||||
size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdGyroCalibration_USB, data, sizeof(data));
|
||||
if (size < 35) {
|
||||
#ifdef DEBUG_PS4_CALIBRATION
|
||||
SDL_Log("Short read of calibration data: %d, ignoring calibration\n", size);
|
||||
SDL_Log("Short read of calibration data: %d, ignoring calibration", size);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -487,7 +487,7 @@ static bool HIDAPI_DriverPS4_LoadOfficialCalibrationData(SDL_HIDAPI_Device *devi
|
||||
size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdGyroCalibration_BT, data, sizeof(data));
|
||||
if (size < 35) {
|
||||
#ifdef DEBUG_PS4_CALIBRATION
|
||||
SDL_Log("Short read of calibration data: %d, ignoring calibration\n", size);
|
||||
SDL_Log("Short read of calibration data: %d, ignoring calibration", size);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -590,19 +590,19 @@ static bool HIDAPI_DriverPS4_LoadOfficialCalibrationData(SDL_HIDAPI_Device *devi
|
||||
ctx->hardware_calibration = true;
|
||||
for (i = 0; i < 6; ++i) {
|
||||
#ifdef DEBUG_PS4_CALIBRATION
|
||||
SDL_Log("calibration[%d] bias = %d, sensitivity = %f\n", i, ctx->calibration[i].bias, ctx->calibration[i].scale);
|
||||
SDL_Log("calibration[%d] bias = %d, sensitivity = %f", i, ctx->calibration[i].bias, ctx->calibration[i].scale);
|
||||
#endif
|
||||
// Some controllers have a bad calibration
|
||||
if (SDL_abs(ctx->calibration[i].bias) > 1024 || SDL_fabsf(1.0f - ctx->calibration[i].scale) > 0.5f) {
|
||||
#ifdef DEBUG_PS4_CALIBRATION
|
||||
SDL_Log("invalid calibration, ignoring\n");
|
||||
SDL_Log("invalid calibration, ignoring");
|
||||
#endif
|
||||
ctx->hardware_calibration = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#ifdef DEBUG_PS4_CALIBRATION
|
||||
SDL_Log("Calibration data not available\n");
|
||||
SDL_Log("Calibration data not available");
|
||||
#endif
|
||||
}
|
||||
return ctx->hardware_calibration;
|
||||
@@ -1291,7 +1291,7 @@ static bool HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Unknown PS4 packet: 0x%.2x\n", data[0]);
|
||||
SDL_Log("Unknown PS4 packet: 0x%.2x", data[0]);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ static bool HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device)
|
||||
if (size > 0) {
|
||||
HIDAPI_DumpPacket("PS5 first packet: size = %d", data, size);
|
||||
} else {
|
||||
SDL_Log("PS5 first packet: size = %d\n", size);
|
||||
SDL_Log("PS5 first packet: size = %d", size);
|
||||
}
|
||||
#endif
|
||||
if (size == 64) {
|
||||
@@ -561,7 +561,7 @@ static void HIDAPI_DriverPS5_LoadCalibrationData(SDL_HIDAPI_Device *device)
|
||||
size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCalibration, data, sizeof(data));
|
||||
if (size < 35) {
|
||||
#ifdef DEBUG_PS5_CALIBRATION
|
||||
SDL_Log("Short read of calibration data: %d, ignoring calibration\n", size);
|
||||
SDL_Log("Short read of calibration data: %d, ignoring calibration", size);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -631,12 +631,12 @@ static void HIDAPI_DriverPS5_LoadCalibrationData(SDL_HIDAPI_Device *device)
|
||||
for (i = 0; i < 6; ++i) {
|
||||
float divisor = (i < 3 ? 64.0f : 1.0f);
|
||||
#ifdef DEBUG_PS5_CALIBRATION
|
||||
SDL_Log("calibration[%d] bias = %d, sensitivity = %f\n", i, ctx->calibration[i].bias, ctx->calibration[i].sensitivity);
|
||||
SDL_Log("calibration[%d] bias = %d, sensitivity = %f", i, ctx->calibration[i].bias, ctx->calibration[i].sensitivity);
|
||||
#endif
|
||||
// Some controllers have a bad calibration
|
||||
if ((SDL_abs(ctx->calibration[i].bias) > 1024) || (SDL_fabsf(1.0f - ctx->calibration[i].sensitivity / divisor) > 0.5f)) {
|
||||
#ifdef DEBUG_PS5_CALIBRATION
|
||||
SDL_Log("invalid calibration, ignoring\n");
|
||||
SDL_Log("invalid calibration, ignoring");
|
||||
#endif
|
||||
ctx->hardware_calibration = false;
|
||||
}
|
||||
@@ -1531,7 +1531,7 @@ static bool HIDAPI_DriverPS5_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Unknown PS5 packet: 0x%.2x\n", data[0]);
|
||||
SDL_Log("Unknown PS5 packet: 0x%.2x", data[0]);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ static void HIDAPI_DriverSteamHori_HandleStatePacket(SDL_Joystick *joystick, SDL
|
||||
|
||||
SDL_SendJoystickSensor(timestamp, joystick, SDL_SENSOR_GYRO, sensor_timestamp, imu_data, 3);
|
||||
|
||||
// SDL_Log("%u %f, %f, %f \n", data[0], imu_data[0], imu_data[1], imu_data[2] );
|
||||
// SDL_Log("%u %f, %f, %f ", data[0], imu_data[0], imu_data[1], imu_data[2] );
|
||||
imu_data[2] = LOAD16(data[18], data[19]) * accelScale;
|
||||
imu_data[1] = -1 * LOAD16(data[20], data[21]) * accelScale;
|
||||
imu_data[0] = LOAD16(data[22], data[23]) * accelScale;
|
||||
|
||||
@@ -521,11 +521,11 @@ static bool WriteProprietary(SDL_DriverSwitch_Context *ctx, ESwitchProprietaryCo
|
||||
}
|
||||
|
||||
if (!waitForReply || ReadProprietaryReply(ctx, ucCommand)) {
|
||||
// SDL_Log("Succeeded%s after %d tries\n", ctx->m_bSyncWrite ? " (sync)" : "", nTries);
|
||||
// SDL_Log("Succeeded%s after %d tries", ctx->m_bSyncWrite ? " (sync)" : "", nTries);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// SDL_Log("Failed%s after %d tries\n", ctx->m_bSyncWrite ? " (sync)" : "", nTries);
|
||||
// SDL_Log("Failed%s after %d tries", ctx->m_bSyncWrite ? " (sync)" : "", nTries);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -579,7 +579,7 @@ static void EncodeRumble(SwitchRumbleData_t *pRumble, Uint16 usHighFreq, Uint8 u
|
||||
pRumble->rgucData[3] = usLowFreqAmp & 0xFF;
|
||||
|
||||
#ifdef DEBUG_RUMBLE
|
||||
SDL_Log("Freq: %.2X %.2X %.2X, Amp: %.2X %.2X %.2X\n",
|
||||
SDL_Log("Freq: %.2X %.2X %.2X, Amp: %.2X %.2X %.2X",
|
||||
usHighFreq & 0xFF, ((usHighFreq >> 8) & 0x01), ucLowFreq,
|
||||
ucHighFreqAmp, ((usLowFreqAmp >> 8) & 0x80), usLowFreqAmp & 0xFF);
|
||||
#endif
|
||||
@@ -1647,7 +1647,7 @@ static bool HIDAPI_DriverSwitch_SendPendingRumble(SDL_DriverSwitch_Context *ctx)
|
||||
Uint16 high_frequency_rumble = (Uint16)ctx->m_unRumblePending;
|
||||
|
||||
#ifdef DEBUG_RUMBLE
|
||||
SDL_Log("Sent pending rumble %d/%d, %d ms after previous rumble\n", low_frequency_rumble, high_frequency_rumble, SDL_GetTicks() - ctx->m_ulRumbleSent);
|
||||
SDL_Log("Sent pending rumble %d/%d, %d ms after previous rumble", low_frequency_rumble, high_frequency_rumble, SDL_GetTicks() - ctx->m_ulRumbleSent);
|
||||
#endif
|
||||
ctx->m_bRumblePending = false;
|
||||
ctx->m_unRumblePending = 0;
|
||||
@@ -1659,7 +1659,7 @@ static bool HIDAPI_DriverSwitch_SendPendingRumble(SDL_DriverSwitch_Context *ctx)
|
||||
ctx->m_bRumbleZeroPending = false;
|
||||
|
||||
#ifdef DEBUG_RUMBLE
|
||||
SDL_Log("Sent pending zero rumble, %d ms after previous rumble\n", SDL_GetTicks() - ctx->m_ulRumbleSent);
|
||||
SDL_Log("Sent pending zero rumble, %d ms after previous rumble", SDL_GetTicks() - ctx->m_ulRumbleSent);
|
||||
#endif
|
||||
return HIDAPI_DriverSwitch_ActuallyRumbleJoystick(ctx, 0, 0);
|
||||
}
|
||||
@@ -1709,7 +1709,7 @@ static bool HIDAPI_DriverSwitch_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Jo
|
||||
}
|
||||
|
||||
#ifdef DEBUG_RUMBLE
|
||||
SDL_Log("Sent rumble %d/%d\n", low_frequency_rumble, high_frequency_rumble);
|
||||
SDL_Log("Sent rumble %d/%d", low_frequency_rumble, high_frequency_rumble);
|
||||
#endif
|
||||
|
||||
return HIDAPI_DriverSwitch_ActuallyRumbleJoystick(ctx, low_frequency_rumble, high_frequency_rumble);
|
||||
@@ -2719,7 +2719,7 @@ static bool HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
} else if (ctx->m_bRumbleActive &&
|
||||
now >= (ctx->m_ulRumbleSent + RUMBLE_REFRESH_FREQUENCY_MS)) {
|
||||
#ifdef DEBUG_RUMBLE
|
||||
SDL_Log("Sent continuing rumble, %d ms after previous rumble\n", now - ctx->m_ulRumbleSent);
|
||||
SDL_Log("Sent continuing rumble, %d ms after previous rumble", now - ctx->m_ulRumbleSent);
|
||||
#endif
|
||||
WriteRumble(ctx);
|
||||
}
|
||||
|
||||
@@ -1364,7 +1364,7 @@ static void HandleStatus(SDL_DriverWii_Context *ctx, SDL_Joystick *joystick)
|
||||
// The report data format has been reset, need to update it
|
||||
ResetButtonPacketType(ctx);
|
||||
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Status update, extension %s\n", hasExtension ? "CONNECTED" : "DISCONNECTED");
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Status update, extension %s", hasExtension ? "CONNECTED" : "DISCONNECTED");
|
||||
|
||||
/* When Motion Plus is active, we get extension connect/disconnect status
|
||||
* through the Motion Plus packets. Otherwise we can use the status here.
|
||||
@@ -1404,7 +1404,7 @@ static void HandleResponse(SDL_DriverWii_Context *ctx, SDL_Joystick *joystick)
|
||||
if (ParseExtensionIdentifyResponse(ctx, &extension)) {
|
||||
if ((extension & WII_EXTENSION_MOTIONPLUS_MASK) == WII_EXTENSION_MOTIONPLUS_ID) {
|
||||
// Motion Plus is currently active
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Motion Plus CONNECTED (stage %d)\n", ctx->m_eCommState == k_eWiiCommunicationState_CheckMotionPlusStage1 ? 1 : 2);
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Motion Plus CONNECTED (stage %d)", ctx->m_eCommState == k_eWiiCommunicationState_CheckMotionPlusStage1 ? 1 : 2);
|
||||
|
||||
if (!ctx->m_bMotionPlusPresent) {
|
||||
// Reinitialize to get new sensor availability
|
||||
@@ -1420,7 +1420,7 @@ static void HandleResponse(SDL_DriverWii_Context *ctx, SDL_Joystick *joystick)
|
||||
|
||||
} else {
|
||||
// Motion Plus is not present
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Motion Plus DISCONNECTED (stage %d)\n", ctx->m_eCommState == k_eWiiCommunicationState_CheckMotionPlusStage1 ? 1 : 2);
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Motion Plus DISCONNECTED (stage %d)", ctx->m_eCommState == k_eWiiCommunicationState_CheckMotionPlusStage1 ? 1 : 2);
|
||||
|
||||
if (ctx->m_bMotionPlusPresent) {
|
||||
// Reinitialize to get new sensor availability
|
||||
@@ -1443,7 +1443,7 @@ static void HandleButtonPacket(SDL_DriverWii_Context *ctx, SDL_Joystick *joystic
|
||||
|
||||
// FIXME: This should see if the data format is compatible rather than equal
|
||||
if (eExpectedReport != ctx->m_rgucReadBuffer[0]) {
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Resetting report mode to %d\n", eExpectedReport);
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Resetting report mode to %d", eExpectedReport);
|
||||
RequestButtonPacketType(ctx, eExpectedReport);
|
||||
}
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ static bool HIDAPI_DriverXbox360W_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
if (size == 2 && data[0] == 0x08) {
|
||||
bool connected = (data[1] & 0x80) ? true : false;
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Connected = %s\n", connected ? "TRUE" : "FALSE");
|
||||
SDL_Log("Connected = %s", connected ? "TRUE" : "FALSE");
|
||||
#endif
|
||||
if (connected != ctx->connected) {
|
||||
ctx->connected = connected;
|
||||
@@ -323,14 +323,14 @@ static bool HIDAPI_DriverXbox360W_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
} else if (size == 29 && data[0] == 0x00 && data[1] == 0x0f && data[2] == 0x00 && data[3] == 0xf0) {
|
||||
// Serial number is data[7-13]
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Battery status (initial): %d\n", data[17]);
|
||||
SDL_Log("Battery status (initial): %d", data[17]);
|
||||
#endif
|
||||
if (joystick) {
|
||||
UpdatePowerLevel(joystick, data[17]);
|
||||
}
|
||||
} else if (size == 29 && data[0] == 0x00 && data[1] == 0x00 && data[2] == 0x00 && data[3] == 0x13) {
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Battery status: %d\n", data[4]);
|
||||
SDL_Log("Battery status: %d", data[4]);
|
||||
#endif
|
||||
if (joystick) {
|
||||
UpdatePowerLevel(joystick, data[4]);
|
||||
|
||||
@@ -213,7 +213,7 @@ static void SDLCALL SDL_HomeLEDHintChanged(void *userdata, const char *name, con
|
||||
static void SetInitState(SDL_DriverXboxOne_Context *ctx, SDL_XboxOneInitState state)
|
||||
{
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Setting init state %d\n", state);
|
||||
SDL_Log("Setting init state %d", state);
|
||||
#endif
|
||||
ctx->init_state = state;
|
||||
}
|
||||
@@ -391,7 +391,7 @@ static bool HIDAPI_DriverXboxOne_InitDevice(SDL_HIDAPI_Device *device)
|
||||
}
|
||||
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Controller version: %d (0x%.4x)\n", device->version, device->version);
|
||||
SDL_Log("Controller version: %d (0x%.4x)", device->version, device->version);
|
||||
#endif
|
||||
|
||||
device->type = SDL_GAMEPAD_TYPE_XBOXONE;
|
||||
@@ -620,7 +620,7 @@ static void HIDAPI_DriverXboxOne_HandleUnmappedStatePacket(SDL_Joystick *joystic
|
||||
return;
|
||||
}
|
||||
#ifdef DEBUG_XBOX_PROTOCOL
|
||||
SDL_Log(">>> Paddles: %d,%d,%d,%d mapped = %s\n",
|
||||
SDL_Log(">>> Paddles: %d,%d,%d,%d mapped = %s",
|
||||
(data[paddle_index] & button1_bit) ? 1 : 0,
|
||||
(data[paddle_index] & button2_bit) ? 1 : 0,
|
||||
(data[paddle_index] & button3_bit) ? 1 : 0,
|
||||
@@ -654,7 +654,7 @@ static void HIDAPI_DriverXboxOne_HandleStatePacket(SDL_Joystick *joystick, SDL_D
|
||||
Uint8 packet[] = { 0x4d, 0x00, 0x00, 0x02, 0x07, 0x00 };
|
||||
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Enabling paddles on XBox Elite 2\n");
|
||||
SDL_Log("Enabling paddles on XBox Elite 2");
|
||||
#endif
|
||||
SDL_HIDAPI_SendRumble(ctx->device, packet, sizeof(packet));
|
||||
}
|
||||
@@ -787,7 +787,7 @@ static void HIDAPI_DriverXboxOne_HandleStatePacket(SDL_Joystick *joystick, SDL_D
|
||||
paddles_mapped = (data[20] != 0);
|
||||
}
|
||||
#ifdef DEBUG_XBOX_PROTOCOL
|
||||
SDL_Log(">>> Paddles: %d,%d,%d,%d mapped = %s\n",
|
||||
SDL_Log(">>> Paddles: %d,%d,%d,%d mapped = %s",
|
||||
(data[paddle_index] & button1_bit) ? 1 : 0,
|
||||
(data[paddle_index] & button2_bit) ? 1 : 0,
|
||||
(data[paddle_index] & button3_bit) ? 1 : 0,
|
||||
@@ -954,7 +954,7 @@ static void HIDAPI_DriverXboxOneBluetooth_HandleButtons(Uint64 timestamp, SDL_Jo
|
||||
}
|
||||
|
||||
#ifdef DEBUG_XBOX_PROTOCOL
|
||||
SDL_Log(">>> Paddles: %d,%d,%d,%d mapped = %s\n",
|
||||
SDL_Log(">>> Paddles: %d,%d,%d,%d mapped = %s",
|
||||
(data[paddle_index] & button1_bit) ? 1 : 0,
|
||||
(data[paddle_index] & button2_bit) ? 1 : 0,
|
||||
(data[paddle_index] & button3_bit) ? 1 : 0,
|
||||
@@ -990,7 +990,7 @@ static void HIDAPI_DriverXboxOneBluetooth_HandleStatePacket(SDL_Joystick *joysti
|
||||
HIDAPI_DriverXboxOneBluetooth_HandleButtons(timestamp, joystick, ctx, data, size);
|
||||
} else {
|
||||
#ifdef DEBUG_XBOX_PROTOCOL
|
||||
SDL_Log("Unknown Bluetooth state packet format\n");
|
||||
SDL_Log("Unknown Bluetooth state packet format");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1104,7 +1104,7 @@ static void HIDAPI_DriverXboxOne_HandleSerialIDPacket(SDL_DriverXboxOne_Context
|
||||
serial[i * 2] = '\0';
|
||||
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Setting serial number to %s\n", serial);
|
||||
SDL_Log("Setting serial number to %s", serial);
|
||||
#endif
|
||||
HIDAPI_SetDeviceSerial(ctx->device, serial);
|
||||
}
|
||||
@@ -1129,7 +1129,7 @@ static bool HIDAPI_DriverXboxOne_UpdateInitState(SDL_DriverXboxOne_Context *ctx)
|
||||
if (SDL_GetTicks() >= (ctx->send_time + CONTROLLER_IDENTIFY_TIMEOUT_MS)) {
|
||||
// We haven't heard anything, let's move on
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Identification request timed out after %llu ms\n", (SDL_GetTicks() - ctx->send_time));
|
||||
SDL_Log("Identification request timed out after %llu ms", (SDL_GetTicks() - ctx->send_time));
|
||||
#endif
|
||||
SetInitState(ctx, XBOX_ONE_INIT_STATE_STARTUP);
|
||||
}
|
||||
@@ -1146,7 +1146,7 @@ static bool HIDAPI_DriverXboxOne_UpdateInitState(SDL_DriverXboxOne_Context *ctx)
|
||||
case XBOX_ONE_INIT_STATE_PREPARE_INPUT:
|
||||
if (SDL_GetTicks() >= (ctx->send_time + CONTROLLER_PREPARE_INPUT_TIMEOUT_MS)) {
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Prepare input complete after %llu ms\n", (SDL_GetTicks() - ctx->send_time));
|
||||
SDL_Log("Prepare input complete after %llu ms", (SDL_GetTicks() - ctx->send_time));
|
||||
#endif
|
||||
SetInitState(ctx, XBOX_ONE_INIT_STATE_COMPLETE);
|
||||
}
|
||||
@@ -1397,7 +1397,7 @@ static bool HIDAPI_GIP_DispatchPacket(SDL_Joystick *joystick, SDL_DriverXboxOne_
|
||||
then 8 bytes of unknown data
|
||||
*/
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Controller announce after %llu ms\n", (SDL_GetTicks() - ctx->start_time));
|
||||
SDL_Log("Controller announce after %llu ms", (SDL_GetTicks() - ctx->start_time));
|
||||
#endif
|
||||
SetInitState(ctx, XBOX_ONE_INIT_STATE_ANNOUNCED);
|
||||
break;
|
||||
@@ -1407,7 +1407,7 @@ static bool HIDAPI_GIP_DispatchPacket(SDL_Joystick *joystick, SDL_DriverXboxOne_
|
||||
break;
|
||||
case GIP_CMD_IDENTIFY:
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Identification request completed after %llu ms\n", (SDL_GetTicks() - ctx->send_time));
|
||||
SDL_Log("Identification request completed after %llu ms", (SDL_GetTicks() - ctx->send_time));
|
||||
#endif
|
||||
#ifdef DEBUG_XBOX_PROTOCOL
|
||||
HIDAPI_DumpPacket("Xbox One identification data: size = %d", data, size);
|
||||
@@ -1440,7 +1440,7 @@ static bool HIDAPI_GIP_DispatchPacket(SDL_Joystick *joystick, SDL_DriverXboxOne_
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Unknown Xbox One packet: 0x%.2x\n", hdr->command);
|
||||
SDL_Log("Unknown Xbox One packet: 0x%.2x", hdr->command);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1452,7 +1452,7 @@ static bool HIDAPI_GIP_DispatchPacket(SDL_Joystick *joystick, SDL_DriverXboxOne_
|
||||
|
||||
// Ignore the first input, it may be spurious
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Controller ignoring spurious input\n");
|
||||
SDL_Log("Controller ignoring spurious input");
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1469,7 +1469,7 @@ static bool HIDAPI_GIP_DispatchPacket(SDL_Joystick *joystick, SDL_DriverXboxOne_
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Unknown Xbox One packet: 0x%.2x\n", hdr->command);
|
||||
SDL_Log("Unknown Xbox One packet: 0x%.2x", hdr->command);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1596,7 +1596,7 @@ static bool HIDAPI_DriverXboxOne_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
HIDAPI_DriverXboxOneBluetooth_HandleStatePacket(joystick, ctx, data, size);
|
||||
} else {
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Unknown Xbox One Bluetooth packet size: %d\n", size);
|
||||
SDL_Log("Unknown Xbox One Bluetooth packet size: %d", size);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
@@ -1614,7 +1614,7 @@ static bool HIDAPI_DriverXboxOne_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG_JOYSTICK
|
||||
SDL_Log("Unknown Xbox One packet: 0x%.2x\n", data[0]);
|
||||
SDL_Log("Unknown Xbox One packet: 0x%.2x", data[0]);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -955,7 +955,7 @@ static SDL_HIDAPI_Device *HIDAPI_AddDevice(const struct SDL_hid_device_info *inf
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "Added HIDAPI device '%s' VID 0x%.4x, PID 0x%.4x, bluetooth %d, version %d, serial %s, interface %d, interface_class %d, interface_subclass %d, interface_protocol %d, usage page 0x%.4x, usage 0x%.4x, path = %s, driver = %s (%s)\n", device->name, device->vendor_id, device->product_id, device->is_bluetooth, device->version,
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "Added HIDAPI device '%s' VID 0x%.4x, PID 0x%.4x, bluetooth %d, version %d, serial %s, interface %d, interface_class %d, interface_subclass %d, interface_protocol %d, usage page 0x%.4x, usage 0x%.4x, path = %s, driver = %s (%s)", device->name, device->vendor_id, device->product_id, device->is_bluetooth, device->version,
|
||||
device->serial ? device->serial : "NONE", device->interface_number, device->interface_class, device->interface_subclass, device->interface_protocol, device->usage_page, device->usage,
|
||||
device->path, device->driver ? device->driver->name : "NONE", device->driver && device->driver->enabled ? "ENABLED" : "DISABLED");
|
||||
|
||||
@@ -969,7 +969,7 @@ static void HIDAPI_DelDevice(SDL_HIDAPI_Device *device)
|
||||
|
||||
SDL_AssertJoysticksLocked();
|
||||
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "Removing HIDAPI device '%s' VID 0x%.4x, PID 0x%.4x, bluetooth %d, version %d, serial %s, interface %d, interface_class %d, interface_subclass %d, interface_protocol %d, usage page 0x%.4x, usage 0x%.4x, path = %s, driver = %s (%s)\n", device->name, device->vendor_id, device->product_id, device->is_bluetooth, device->version,
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "Removing HIDAPI device '%s' VID 0x%.4x, PID 0x%.4x, bluetooth %d, version %d, serial %s, interface %d, interface_class %d, interface_subclass %d, interface_protocol %d, usage page 0x%.4x, usage 0x%.4x, path = %s, driver = %s (%s)", device->name, device->vendor_id, device->product_id, device->is_bluetooth, device->version,
|
||||
device->serial ? device->serial : "NONE", device->interface_number, device->interface_class, device->interface_subclass, device->interface_protocol, device->usage_page, device->usage,
|
||||
device->path, device->driver ? device->driver->name : "NONE", device->driver && device->driver->enabled ? "ENABLED" : "DISABLED");
|
||||
|
||||
@@ -1229,7 +1229,7 @@ bool HIDAPI_IsDeviceTypePresent(SDL_GamepadType type)
|
||||
SDL_UnlockJoysticks();
|
||||
|
||||
#ifdef DEBUG_HIDAPI
|
||||
SDL_Log("HIDAPI_IsDeviceTypePresent() returning %s for %d\n", result ? "true" : "false", type);
|
||||
SDL_Log("HIDAPI_IsDeviceTypePresent() returning %s for %d", result ? "true" : "false", type);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
@@ -1280,7 +1280,7 @@ bool HIDAPI_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version,
|
||||
SDL_UnlockJoysticks();
|
||||
|
||||
#ifdef DEBUG_HIDAPI
|
||||
SDL_Log("HIDAPI_IsDevicePresent() returning %s for 0x%.4x / 0x%.4x\n", result ? "true" : "false", vendor_id, product_id);
|
||||
SDL_Log("HIDAPI_IsDevicePresent() returning %s for 0x%.4x / 0x%.4x", result ? "true" : "false", vendor_id, product_id);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user