KrossX / Pokopom

Input Plugin for Emulators
MIT License
42 stars 7 forks source link

EPSXE Afterplug Rumble Broken #8

Closed shinra358 closed 8 years ago

shinra358 commented 8 years ago

Afterplug rumble is broken. When turning the controller on after the emu starts, there is no rumble UNTIL you hotplug (turn off controller midgame and re-enable it).

Esc > continue also breaks rumble.

KrossX commented 8 years ago

Alright, so the game configures rumble on boot and when a controller is plugged. When ePSXe stops it makes a savestate, shutdowns the plugins and thus Pokopom deletes devices. When ePSXe continues, it inits the plugins again and loads the savestate but the game rumble configuration is lost. Since a savestate is used the game doesn't know a device was "replugged" so it doesn't reconfigure.

This wouldn't be an issue if the emulator supported input plugin data on savestates (PCSX2 supports it). I made a build that makes Pokopom not create/delete devices on shutdown/init which might help the Esc/Continue escenario but won't help a situation when a savestate is loaded after the emulator is closed/reopened.

Test build: TEST

shinra358 commented 8 years ago

Thing about that is, rumble on afterplug works on 1.9.0 and below. With both afterplug and esc > continue. It only stopped working in the builds after that. This build is a no go. No change on Esc > Continue, Afterplug, or Hotplug after an Afterplug as already occured.

KrossX commented 8 years ago

Input plugins where not supported in the older versions, the hack probably did things differently (ie, not do a shutdown/init on esc/continue).

Can you please recheck? I am currently testing FF9 on ePSXe v2.0.5 and rumble with Esc/Continue is working with the test5 build.

I made a savestate right at the beginning when you're able to play and access the game settings. From there I can test the vibration ON/OFF. I make sure it's working (savestate load issue) then do a Esc/Continue and vibration test still works while it didn't on previous builds.

shinra358 commented 8 years ago

controller on > emu on > hotplug = rumble works controller on > emu on > esc/continue = rumble works controller on > emu on > esc/continue > hotplug = rumble works

emu on > controller on > hotplug = rumble not working emu on > controller on > esc/continue = rumble not working emu on > controller on > esc/continue > hotplug = rumble not working

KrossX commented 8 years ago

I cannot reproduce. I can start the emulator and even load a savestate right to the config menu, then plug the controller and the rumble test will still work.

shinra358 commented 8 years ago

don't use savestate and then try it with a game in which you can quickly start playing. Like Chocobo Racing or something (I didn't use savestate when trying out those 6 ways).

KrossX commented 8 years ago

I tried without a savesate with FF9 too. Started the emulator, run the game until the start screen and then plugged the controller. Started a new game and checked the config settings, vibration test worked.

I don't have Chocobo Racing at hand, so it will take some time to test that.

shinra358 commented 8 years ago

I just tried FF8 and same thing with afterplug. I'm using epsxe 205 with your test5 pokopom. Perhaps I should make a video to show you as proof? I also tried with a wired controller and wireless as well.

shinra358 commented 8 years ago

Just put in FF9. It does work like you said. But I swear to you that it is not working for FF8 or Chocobo Racing. What is this sorcery!? lol.

Edit: SFA3 is also not workng on afterplug. But Ape Escape is. Is this something I should test all my games for to help you? If so, I can do that after I come back from taking my daughter to this play that's about to start.

KrossX commented 8 years ago

Tested Chocobo Racing and it does indeed happen as you say, but it seems to be normal game behavior. On boot, the game will check for a DualShock controller and auto-enable analog mode, beyond that is up to the user to press the controller's analog toggle.

During that test, my big X button wasn't toggling analog so that's a bummer. Pressing the alternative keyboard number did work though, analog mode was on and I could enable vibration on the game settings.

shinra358 commented 8 years ago

Tested the game on the real console again and it isn't having any issue with rumble after an afterplug.

I tried to do the steps exactly as you did them. I pressed the PS button to turn analog back on. Then I went to the options and saw that rumble was already set to on. So I toggled it off and then back one. And I did a race and ran into the wall to trigger vibration and it just didn't happen :( Pokopom is set to analog in the settings just in case that would make a difference.

Edit: Same thing happens with pcsx-r this time (im using an old version though). No rumble after an afterplug, but there, the graphics get corrupted if you do an afterplug. But I'm not worried about pcsx-r because I don't use it :P

Edit2: Also, this issue doesn't happen with the Epsxe Input Core 2.0 plugin.

KrossX commented 8 years ago

I tested Chocobo Racing again. I made sure that rumble was working and analog mode was on, then raced for a bit to test rumble. Once confirmed working, I unplugged the controller and plugged back in and rumble still worked.

Can you please do a test with the real hardware? I would like to know if there's any memory to the analog mode. This might be better tested in a game prior to the DualShock launch as games that support it might trigger the auto-config. Make sure the game works and analog is off then turn analog on (the game shouldn't like it). After that, unplug the controller and plug it back in. Is the analog light still on after that?

shinra358 commented 8 years ago

"I tested Chocobo Racing again. I made sure that rumble was working and analog mode was on, then raced for a bit to test rumble. Once confirmed working, I unplugged the controller and plugged back in and rumble still worked."

Afterplugging is the name of the game here. You just tested hotplugging in which we already said was working. You were supposed to start with the controller off/unplugged, turn emu/game on, and then turn controller on. However, hotplug rumble is not working after an afterplug has already occurred. Rumble in general is not working all after an afterplug now.

"Can you please do a test with the real hardware? "

I just did that in the post before yours as stated. Works fine on real console after an afterplug. With a supported game like chocobo racing, the analog light starts as off. Then when the game boots, it auto turns on. When the game is still on, unplugging the controller and replugging (hotplugging) makes the light go off. But during this, rumble still works regardless.

For a non-analog supported game (rpg maker or final fantasy tactics - as not stated as supported on the crystal case), Analog starts off. Turning it on, nothing happens but the red analog light coming on. Hotplugging after that, the light is off (cant test rumble after that because the game doesn't have rumble). Same behavior after an afterplug.

KrossX commented 8 years ago

Ooooooh, no wonder then. I did a quick test again with Chocobo Racing, I started the game and plugged the controller at the Start Game screen. Did a quick race and indeed there's no rumble as the pad is in digital mode, toggling the analog mode enables rumble and sticks as expected. So the only thing odd from "afterplugging" with this game is the auto-analog mode on boot.

The default analog mode should've helped there, but I think it's currently not working after the recent hackfixes/workarounds...

I know FF9 does the auto-analog all the time, does this game do auto-analog when afterplugging on the real hardware?

Also, thank you very much for that analog-mode test. I always wondered if the pad itself had some permanent state or it always resetted.

shinra358 commented 8 years ago

" I did a quick test again with Chocobo Racing, I started the game and plugged the controller at the Start Game screen. Did a quick race and indeed there's no rumble as the pad is in digital mode, toggling the analog mode enables rumble"

Not true for me. Rumble never reactivates when analog mode is turned back on after an afterplug on the emu (which is the problem I'm asking of).

Also, when you plug controller in on chocobo racing on the real hardware, the analog light stays off and the sticks don't work until you turn analog back on, but it still rumbles regardless if analog if on or not. EDIT: However, in this game at least, turning analog off makes the sticks still work.

"I know FF9 does the auto-analog all the time, does this game do auto-analog when afterplugging on the real hardware?" Yes.

Edit2: maybe you didn't notice my edits in my previous posts. But I reiterated in this one.

KrossX commented 8 years ago

Test build: TEST It has a hackfix for the "default analog" to reset the analog mode to the selected default on replug, but only the analog mode so as to not mess up the hackfix for ePSXe's esc/continue... =_="

"Also, when you plug controller in on chocobo racing on the real hardware, the analog light stays off and the sticks don't work until you turn analog back on, but it still rumbles regardless if analog if on or not."

If the light stays off then this game doesn't do auto analog after boot. The rumble thing is weird though for when I toggle the analog mode off on this game I get no rumble at all. I'll check the protocol of this game in case it's doing someting weird.

EDIT: I hate this game. It is indeed sending rumble data on digital mode....

shinra358 commented 8 years ago

"It has a hackfix for the "default analog" to reset the analog mode to the selected default on replug, but only the analog mode so as to not mess up the hackfix for ePSXe's esc/continue... =_=" " works exactly as you said it.

Yeah, apparently on the real console, rumble isn't tied to analog. Only in-game rumble setting. Analog sticks also stay working in your plugin when analog is off but on the real console, the sticks don't work when analog is off.

Yes, on afterplug for chocobo racing, the light stays off. If it's off in-game and you hotplug, it stays off. And if it's on in-game and you hotplug, it stays off.

Okay, it seems like rumble is working correctly now in this test build. If I turn analog off, rumble still works. And if I turn it on rumble still works. Excellent. This is for afterplug. Yay. But as you said, analog has to be set in pokopom and not digital.

Edit: when I start the emu with the controller already on, I press F5 and it says analog on. So for some reason, analog is starting off but sticks still work regardless. Tested this on FF9 and CR.

""Also, when you plug controller in on chocobo racing on the real hardware, the analog light stays off and the sticks don't work until you turn analog back on,"

This is after an afterplug and a hotplug of course. If controller is already plugged in when the game starts, the light is on (real hardware).

KrossX commented 8 years ago

New build: TEST It should have rumble working while on digital mode.

I knew rumble while on digital was possible as Quake2 did that, but I thought it was still working. I must have messed that up when I added support for weird the rumble configs some games did.

This game does a proper handshake/setup on boot, but it's messed up afterwards and so it remains on digital mode even though it did all the things including enabling the motors.

F5/F6 and the popups have nothing to do with Pokopom. With Pokopom, the analog toggle is the guide button or the numbers 1 to 4. The only visual information is the scroll lock light if your keyboard has one and only makes sense when using one controller.

shinra358 commented 8 years ago

oh ok. gotcha. okay so when analog is on, my keyboard scroll light flickers instead of being a solid color. Rumble works though (this is if controller is started already). Analog sticks still work regardless of being on or off.

Also, on afterplug, I don't know which is supposed to be of or on because it starts with a flickering scroll light and when I press the PS button, it turns into a solid light. Rumble still works regardless now though.

KrossX commented 8 years ago

Flickering might be because port1 and port2 might be in different modes. It gets really funky with multitap, when it worked that is.

The sticks are usable on any mode. It's been a feature of Pokopom since forever since my old dualshock-ish controller did that. When in digital mode, the sticks simply work as d-pad and face buttons too. That way you can still use the sticks even on digital only games.

shinra358 commented 8 years ago

oh okay. What do you mean by different port modes? I guess issue is solved now then unless you want to add something else : P Thanks!

KrossX commented 8 years ago

I meant devices actually, like : port1 -> Controller1 -> Analog Mode port2 -> Controller2 -> Digital Mode

The light will flicker as each "cycle" it will show both states. And no, dun wanna add more stuff.

shinra358 commented 8 years ago

Btw, it starts flickering with both controller port modes being analog mode and only 1 controller activated/on. Afterwards, if I keep pressing the PS button, it'll randomly go to either no light or a solid light. It's not consistent. So you're saying that's normal because it doesn't seem like it.?

starts flickering > PS button > random chance of no light starts flickering > PS button > random chance of solid light

KrossX commented 8 years ago

That would be a new issue.

shinra358 commented 8 years ago

lol. ill make a new one.