demul icon indicating copy to clipboard operation
demul copied to clipboard

Dualshock 4 and Demul: unable to configure buttons

Open SegaArcade opened this issue 6 years ago • 75 comments

Hello

There is an issue when using Dualshock 4 controller on Demul: it's impossible to configure buttons, the emulator recognize the "joy0_anl3_key" eternally pressed (it should be the "sixasis").

It there was a way to make demul ignore the joy0_anl3_key, we could configure Dualshock 4 controlelrs without issues.

Thanks

SegaArcade avatar Mar 11 '18 22:03 SegaArcade

This is relatively easy to fix. You should never detect by vale, only change. If an analog moves more then say X points, an analog was moved, map it. Relying on the rest position will never be the same.

Guessing this is an old post but Demul is one of the best emulators for DC. So lets make it great.

ulao avatar Apr 30 '18 11:04 ulao

Hi, just want to report same issue with Blissbox adapter and an original Dreamcast controller. Beyond controls mapping screen, where the trick is to get the button you want to map need to be pressed before starting the mapping process, this affects gameplay. My test is with Crazy Taxi on Dreamcast. With L and R triggers properly configured using this trick, you cannot properly play with the gear box to get the start boost (for the ones that know the game).

ghost avatar Apr 30 '18 11:04 ghost

I can confirm that I have the same problem but for the Naomi version of Crazy Taxi using Dualshock 4. The "start boost" doesn't work.

SegaArcade avatar May 03 '18 10:05 SegaArcade

try this plugin https://yadi.sk/d/hJkqI0sy3VGDeV and let us know if it solves the problem.

p1pkin avatar May 05 '18 09:05 p1pkin

Thank you. Same issue with this plugin. Analogic trigger always pressed in controls window. Messing it up in crazy taxi as reported before.

ghost avatar May 05 '18 10:05 ghost

which one is reported pressed ? JOY0_ANL3_KEY or other one ?

p1pkin avatar May 05 '18 10:05 p1pkin

PS: updated plugin is mainly addressed to fix Dualshock issues, it have been verified to solve DS3 troubles. will be good to know if it helps in case of DS4.

but that "Blissbox adapter" might have another kind of weirdness instead.

p1pkin avatar May 05 '18 10:05 p1pkin

JOY0_ANL2_KEY in my case.

below, my ini file for 1st dreamcast controller.

[JOY0_0] UP = 16777226 DOWN = 16777227 LEFT = 16777228 RIGHT = 16777229 A = 16777217 B = 16777219 C = 0 D = 0 X = 16777216 Y = 16777218 Z = 0 LTRIG = 33554693 RTRIG = 33554690 START = 16777221 S1UP = 33554689 S1DOWN = 33554433 S1LEFT = 33554688 S1RIGHT = 33554432 S2UP = 0 S2DOWN = 0 S2LEFT = 0 S2RIGHT = 0 UP2 = 0 DOWN2 = 0 LEFT2 = 0 RIGHT2 = 0

@ulao : Maybe this is where you can step in.

ghost avatar May 05 '18 10:05 ghost

can you please provide screenshot similar to attached ? calibrate

press Win+R - enter there "joy.cpl", select gamepad and press "calibrate", then take screenshot(s) of available analog axis(es) and data read from them.

p1pkin avatar May 05 '18 11:05 p1pkin

Hi p1pkin, I'm the author to Bliss-Box. If you have any direct questions about the adapter I can answer on a technical level for you.

There are 8 analogs. (All have an 8 bit value and reset at 0 or 128 but DX adds a few bits, 8 I think, bring it to 16 total. )

Main stick X rests at 128 (DC main stick x) Main stick Y rests at 128 (DC main stick y) X rotation rests at 0 (DC pad right trigger) Y rotation rests at 128 (not used by DC pad) Z rotation rests at 128 (not used by DC pad) Z axis rests at 0 (DC pad Left trigger) Dial rests at 128 (not used by DC pad) Slider rests at 128 (not used by DC pad) This adapter has 3 rows of buttons (all normal not pressed) and one HAT(pov) that rests at -1 (no value)

dc dc2 dc4

Also FYI, not a sales pitch and I'm happy to send you a developers kit to test. This adapter supports LCD writes and soon memory pack writes and possible native communication. This is all done via usb Feature get/set reports.

ulao avatar May 05 '18 12:05 ulao

thanks for reply, I suspect this might be incorrect:

Y rotation rests at 128 (not used by DC pad) Z rotation rests at 128 (not used by DC pad) Dial rests at 128 (not used by DC pad) Slider rests at 128 (not used by DC pad)

at least Direct Input docs said "If the joystick does not have this axis, the value is 0." https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.dijoystate(v=vs.85).aspx

I'm far not a pro in Input devices, but afaik missing Axis-es also should not generate Enumeration callbacks (at software level, don't know how it will be in hardware). but your device somehow reports it have all that stuff, and we see at 1st screen bunch of redundant Axis-es displayed (Y rotation, Z rotation, etc)...

p1pkin avatar May 05 '18 12:05 p1pkin

This is a multi controller adapter. All analogs report all the time. Otherwise a separate descriptor would be needed on the fly and the by USB definition, this is not possible. Most all software sees 0 as or 128 as a resting point in the way of controllers. I have not looked at other emulators out there to see how they do it but I suspect they do it the way I state on my first post. Myself, In game I just ignore all analogs I didn't map. For the ones I mapped, I record a resting position. Upon my mapping screen I capture all values and mark as their respective resting points.

"thanks for reply, I suspect this might be incorrect" These will always report 0 when a DC is plugged in. Other controller will use these values like psx controllers.

ulao avatar May 05 '18 13:05 ulao

can you check with this one plugin ? https://yadi.sk/d/hJkqI0sy3VGDeV

p1pkin avatar May 05 '18 13:05 p1pkin

Looks like "JOY1_ANL2_KEY-" is always pressed. I'm going out on a limb here but my guess is ANL2 is either X rotation rests at 0 (DC pad right trigger) or Z axis rests at 0 (DC pad Left trigger) and anything less then 128 is a negative in DX(-32768 to +32768)? If it helps Bliss-Box usb IDs are 16d0:0Dxx, helpfull if you want to know when a Bliss-Box is attached.

ulao avatar May 05 '18 14:05 ulao

https://yadi.sk/d/hJkqI0sy3VGDeV pls, get update, retest and return stdout.txt to me

WindDemulTeam avatar May 05 '18 14:05 WindDemulTeam

Cant test again on my side before Monday. Will report back then.

ghost avatar May 05 '18 14:05 ghost

Steps

  1. downloaded file and overwrote old file. (confirmed the file size difference)
  2. ran demul ->controlers->joy1->ltrig (clicked it once), shows "JOY1_ANL2_KEY-"
  3. I ran a search for "stdout" no results.

ulao avatar May 05 '18 16:05 ulao

driver Bliss-Box not support with EnumObjects?

WindDemulTeam avatar May 05 '18 16:05 WindDemulTeam

That's a bit vag?

  1. Bliss-Box uses HID (no drivers are required) and the most common/reliable driver for everything controller related.
  2. Enum's are part of C, what do you mean by that? This? https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.enumobjects(v=vs.85).aspx Yes HID gamepad drivers should support that. I didn't write the HID drivers m$ did, I would assume they made that work with DX as long as you build against dx 6-9. After that they dropped HID in favor of xinput (and support HID virtually (limited))

ulao avatar May 05 '18 16:05 ulao

EnumObjects from dinput api. Bliss-Box driver is very bad support with directx input or xinput?

WindDemulTeam avatar May 05 '18 16:05 WindDemulTeam

See my edits. Happy to work with you on the plug-in source over email or discord. https://discord.gg/h5WWNC

ulao avatar May 05 '18 16:05 ulao

its about https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.enumobjects(v=vs.85).aspx it is the way software enumerate DInput device properties. i.e. retrieve information which axis-es, etc exists in some device

if there was no stdout.txt file created in emulator folder - there was no any enum callback calls, which quite odd and unexpected.

p1pkin avatar May 05 '18 16:05 p1pkin

right but see

DIDFT_ALIAS Controls identified by a Human Interface Device (HID) usage alias. This flag applies only to HID-compliant USB devices.

This is exactly what the Bliss-Box is a HID. So if they mention it, yes it should be supported.

ulao avatar May 05 '18 17:05 ulao

Honestly guys the HID driver is not related to Bliss-Box and Bliss-Box has no drivers that are required. Saying Bliss-Box has bad support for XYZ is like saying Microsoft has bad support for XYZ. In this case XYZ is directX and that's like saying Microsoft has bad support for Microsoft.

Maybe I'm miss reading what you mean?

The drivers that operate the Bliss-Box are done via the windows HID system like all of these gamepad adapters you see on the net including and not limited to .

Raphnet Mayflash Nintendont RetroUSb and so many more.

The HID system as been around since win95 and support a number of devices. AKA plug n play USB. Flash driver, Mice, Keyboards, etc... I'm positive they support the enum objects, and I'm not sure what leads you to believe they do not?

ulao avatar May 05 '18 17:05 ulao

pls, retest: https://yadi.sk/d/TunnVHkM3VPTha have stdout?

WindDemulTeam avatar May 05 '18 17:05 WindDemulTeam

No, would windows be trying to put it in some dumb users folder or something? I checked the root and the plugin folder. Or do I need to use a debug version?

ulao avatar May 05 '18 17:05 ulao

I did a drive search, and have that file for a few emulators stella, mupen64, snes89x, boycott but I see nothing for demul

ulao avatar May 05 '18 17:05 ulao

Not good. Dinput not support with Bliss-Box. Current version use EnumObjects DIDFT_ALL-mode Raw usb-hid not used in padPlugin.

WindDemulTeam avatar May 05 '18 17:05 WindDemulTeam

What version of Dinput are you implementing?

ulao avatar May 05 '18 17:05 ulao

Used dinput8 (last version).

WindDemulTeam avatar May 05 '18 17:05 WindDemulTeam