Detect play&charge kit and give an error message when its used
This commit is contained in:
parent
d4318c0f05
commit
908cd03a7f
4 changed files with 19 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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" },
|
||||
|
|
Loading…
Add table
Reference in a new issue