diff --git a/src/xboxdrv.cpp b/src/xboxdrv.cpp index b9e1eeb..8a729f4 100644 --- a/src/xboxdrv.cpp +++ b/src/xboxdrv.cpp @@ -498,6 +498,13 @@ Xboxdrv::run_main(const CommandLineOptions& opts) switch (dev_type.type) { + case GAMEPAD_XBOX360_PLAY_N_CHARGE: + throw std::runtime_error("The Xbox360 Play&Charge cable is for recharging only, it does not transmit data, " + "thus xboxdrv can't support it. You have to get a wireless receiver:\n" + "\n" + " * http://www.xbox.com/en-ca/hardware/x/xbox360wirelessgamingreceiver/"); + break; + case GAMEPAD_XBOX: case GAMEPAD_XBOX_MAT: controller = std::auto_ptr<XboxGenericController>(new XboxController(dev, opts.detach_kernel_driver)); @@ -809,9 +816,10 @@ Xboxdrv::main(int argc, char** argv) break; } } - catch(std::exception& err) + catch(const std::exception& err) { - std::cout << "Error: " << err.what() << std::endl; + std::cout << "\n-- [ ERROR ] ------------------------------------------------------\n" + << err.what() << std::endl; } return 0; diff --git a/src/xboxmsg.cpp b/src/xboxmsg.cpp index 92fde89..02bc76b 100644 --- a/src/xboxmsg.cpp +++ b/src/xboxmsg.cpp @@ -35,6 +35,9 @@ std::string gamepadtype_to_string(const GamepadType& type) case GAMEPAD_XBOX360_WIRELESS: return "xbox360-wireless"; + case GAMEPAD_XBOX360_PLAY_N_CHARGE: + return "xbox360-playncharge"; + case GAMEPAD_XBOX: return "xbox"; @@ -65,6 +68,7 @@ std::string gamepadtype_to_macro_string(const GamepadType& type) { case GAMEPAD_XBOX360: return "GAMEPAD_XBOX360"; case GAMEPAD_XBOX360_WIRELESS: return "GAMEPAD_XBOX360_WIRELESS"; + case GAMEPAD_XBOX360_PLAY_N_CHARGE: return "GAMEPAD_XBOX360_PLAY_N_CHARGE"; case GAMEPAD_XBOX: return "GAMEPAD_XBOX"; case GAMEPAD_XBOX_MAT: return "GAMEPAD_XBOX_MAT"; case GAMEPAD_XBOX360_GUITAR: return "GAMEPAD_XBOX360_GUITAR"; @@ -86,6 +90,9 @@ std::ostream& operator<<(std::ostream& out, const GamepadType& type) case GAMEPAD_XBOX360_WIRELESS: return out << "Xbox360 (wireless)"; + case GAMEPAD_XBOX360_PLAY_N_CHARGE: + return out << "Xbox360 Play&Charge"; + case GAMEPAD_XBOX: return out << "Xbox Classic"; diff --git a/src/xboxmsg.hpp b/src/xboxmsg.hpp index 1a6156b..3b0d925 100644 --- a/src/xboxmsg.hpp +++ b/src/xboxmsg.hpp @@ -27,6 +27,7 @@ enum GamepadType { GAMEPAD_XBOX_MAT, GAMEPAD_XBOX360, GAMEPAD_XBOX360_WIRELESS, + GAMEPAD_XBOX360_PLAY_N_CHARGE, GAMEPAD_XBOX360_GUITAR, GAMEPAD_FIRESTORM, GAMEPAD_FIRESTORM_VSB, diff --git a/src/xpad_device.cpp b/src/xpad_device.cpp index 448013e..822ca79 100644 --- a/src/xpad_device.cpp +++ b/src/xpad_device.cpp @@ -56,6 +56,7 @@ XPadDevice xpad_devices[] = { { GAMEPAD_XBOX, 0x044f, 0x0f07, "Thrustmaster, Inc. Controller" }, { GAMEPAD_XBOX, 0x0e8f, 0x3008, "Generic xbox control (dealextreme)" }, { GAMEPAD_XBOX360, 0x045e, 0x028e, "Microsoft Xbox 360 Controller" }, + { GAMEPAD_XBOX360_PLAY_N_CHARGE, 0x045e, 0x028f, "Microsoft Xbox 360 Play&Charge Kit" }, { GAMEPAD_XBOX360, 0x0738, 0x4716, "Mad Catz Xbox 360 Controller" }, { GAMEPAD_XBOX360, 0x0738, 0x4726, "Mad Catz Xbox 360 Controller" }, { GAMEPAD_XBOX360, 0x0738, 0x4740, "Mad Catz Beat Pad" },