Read the settings from the registry
| 224 | |
| 225 | // Read the settings from the registry |
| 226 | void Xbox360Peripheral::readSettings(void) |
| 227 | { |
| 228 | OSBoolean *value = NULL; |
| 229 | OSNumber *number = NULL; |
| 230 | OSDictionary *dataDictionary = OSDynamicCast(OSDictionary, getProperty(kDriverSettingKey)); |
| 231 | |
| 232 | if (dataDictionary == NULL) return; |
| 233 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("InvertLeftX")); |
| 234 | if (value != NULL) invertLeftX = value->getValue(); |
| 235 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("InvertLeftY")); |
| 236 | if (value != NULL) invertLeftY = value->getValue(); |
| 237 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("InvertRightX")); |
| 238 | if (value != NULL) invertRightX = value->getValue(); |
| 239 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("InvertRightY")); |
| 240 | if (value != NULL) invertRightY = value->getValue(); |
| 241 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("DeadzoneLeft")); |
| 242 | if (number != NULL) deadzoneLeft = number->unsigned32BitValue(); |
| 243 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("DeadzoneRight")); |
| 244 | if (number != NULL) deadzoneRight = number->unsigned32BitValue(); |
| 245 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("RelativeLeft")); |
| 246 | if (value != NULL) relativeLeft = value->getValue(); |
| 247 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("RelativeRight")); |
| 248 | if (value != NULL) relativeRight=value->getValue(); |
| 249 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("DeadOffLeft")); |
| 250 | if (value != NULL) deadOffLeft = value->getValue(); |
| 251 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("DeadOffRight")); |
| 252 | if (value != NULL) deadOffRight = value->getValue(); |
| 253 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("RumbleType")); |
| 254 | if (number != NULL) rumbleType = number->unsigned8BitValue(); |
| 255 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingUp")); |
| 256 | if (number != NULL) mapping[0] = number->unsigned32BitValue(); |
| 257 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingDown")); |
| 258 | if (number != NULL) mapping[1] = number->unsigned32BitValue(); |
| 259 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingLeft")); |
| 260 | if (number != NULL) mapping[2] = number->unsigned32BitValue(); |
| 261 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingRight")); |
| 262 | if (number != NULL) mapping[3] = number->unsigned32BitValue(); |
| 263 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingStart")); |
| 264 | if (number != NULL) mapping[4] = number->unsigned32BitValue(); |
| 265 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingBack")); |
| 266 | if (number != NULL) mapping[5] = number->unsigned32BitValue(); |
| 267 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingLSC")); |
| 268 | if (number != NULL) mapping[6] = number->unsigned32BitValue(); |
| 269 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingRSC")); |
| 270 | if (number != NULL) mapping[7] = number->unsigned32BitValue(); |
| 271 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingLB")); |
| 272 | if (number != NULL) mapping[8] = number->unsigned32BitValue(); |
| 273 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingRB")); |
| 274 | if (number != NULL) mapping[9] = number->unsigned32BitValue(); |
| 275 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingGuide")); |
| 276 | if (number != NULL) mapping[10] = number->unsigned32BitValue(); |
| 277 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingA")); |
| 278 | if (number != NULL) mapping[11] = number->unsigned32BitValue(); |
| 279 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingB")); |
| 280 | if (number != NULL) mapping[12] = number->unsigned32BitValue(); |
| 281 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingX")); |
| 282 | if (number != NULL) mapping[13] = number->unsigned32BitValue(); |
| 283 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingY")); |
nothing calls this directly
no outgoing calls
no test coverage detected