..:: PCSX2 Forums ::..

Full Version: XInput Wrapper for DS3 and Play.com USB Dual DS2 Controller
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510
Nice! That looks simple enough. Laugh

Though when I was thinking about an API, I was thinking in an alternative to XInput completely. Then having XInput for X360 controllers and your API for Sony controllers.

Now to put this in Pokopom...

#EDIT: Under what license is that source?
@KrossX: turned out it was just the simplest way to expose the functionality, since all the infrastructure was there to support it.

You are free to use any of the source as you see fit.
I made a quick attempt, if someone can test it (included nice padtest.elf) that would be nice. Cuz me haz no compatible devices for this filter.

I haven't checked the source properly, and I'm afraid I'm too sleepy to do so at the moment. I've assumed it still uses the XInput macros for return values and... my question: How does it deal with present X360 controllers? The main reason I was thinking of another API was to easily know what it's being used like calling XInput functions for index 0 and Scarlet functions for index 0 and know I'm dealing with the first X360 and DS3 controller respectively. And with that, also having a max of 8 pads as opposed to just 4 with XInput.

My that ended up rather long.... sorry. =S
Tested on PCSX2 r5350 - looking good.

[attachment=39978]

A few issues

1. DPAD Up & Down pressures seem to be swapped.

[attachment=39976] [attachment=39977]

2. PCSX2 crashes if I enable Analog on PAD2.
3. Scroll Lock on my keyboard flashes.

[Using the padtest.elf with LilyPad-SCP doesn't have these issues]

If no DS3/Speedlink Strike FX/DS2 is found it runs in passthrough mode by loading the real XInput1_3.dll in Windows\System32.
Yeah, it was totally backwards. Fixed it and added the mask.

As for the analog, it would indeed seem to be stuck in digital mode from your screenshots but I cannot reproduce it. And why it would crash, no idea either. =S

I tried pluggin/unpluggin, changing port settings and all, and I couldn't get controller 2 to be digital. And since it gets set to analog and locked, the analog key is useless on my testing. >_<

-. So, if I have 1 X360 and 1 DS3, the DS3 takes index 1 or 0 ? If the latter, is the X360 redirected to index 1 ? So as to have both controllers available from XInput that is.
Tested again this afternoon and I no longer get a crash.

[attachment=39992]

If you have 1 DS3 and 1 X360 plugged in, DS3 would appear on Index 0 - X360 would not be usable.

If you unplug the DS3 and restart the application, the X360 would appear on Index 0.

DS3 or X360, not both.

I could look into always loading the passthrough, and enumerating X360s first (since I don't have control of the Led indicators) then looking for DS3s. Then you could have both.
Suggestion then!

How about with priority on the DS controllers, to use the remaining ports if any left for X360 controllers starting at index 0 (no matter the lights).

That way, you can have 4 player coop with 2 DS3 and 2 X360 controllers. Index 0 and 1 for DS3 and index 2 and 3 for X360 controllers. When the application calls for index 2 and 3, you simply redirect to the real XInput as index 0 and 1.
if this is anything like x360ce, the order is determined by the order in which you install the devices drivers rather than the order in which you plug them in(after they are installed)
New version posted, see first post.

@KrossX: Added X360 support as suggested, screenshot Pad 1 DS3, Pad 2 X360

[attachment=40005]

Played Onimusha 2 with this config, Rumble for Pad 1 was being sent to Pad 2.
Restarted with Pad 2 (X360) disconnected and Rumble goes correctly to Pad 1.

@Squall: Device enumeration is different from x360ce since I'm using HID Enumeration. Algorithm is -
Enumerate HID devices with Vid/Pid DS3 (vid_054c&pid_0268)
Enumerate HID devices with Vid/Pid SLS FX (vid_0e8f&pid_3075)
Enumerate HID devices with Vid/Pid DS2 (vid_0b43&pid_0003)
Enumerate XInput devices.

So I get to choose the order of class of device. Within each class of device I cant specify the order of devices presented. However they don't appear to be in order they were installed, looks more like USB bus/port order.

There is also some peculiar behaviour with the Speedlink Strike FX. Depending on the USB port I connect it to, it either gets detected as a Speedlink Strike FX or as a native DS3 (and behaves exactly like a DS3).

@Bositman: Is there an issue with adding attachments? They dont get listed in the order I added them. (see first post)
if only i could easily use some of the things found here to improve x360ce (since its a funny beast and rumble is barely working properly.....)
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510