libretro / fceu-next

Port of FCEUmm / FCEUX to Libretro.
14 stars 9 forks source link

FCEUmm - Strange input behavior #5

Closed clobber closed 12 years ago

clobber commented 12 years ago

I'm testing various games and noticing something weird going on with the input:

For example, in Contra the A and B buttons will both shoot instead of shoot or jump. I put it in 2 player mode and then it'd work correctly but one of the buttons was making Player 2 fire.

However, buttons A and B seem to be working correctly in other games like Super Mario Bro.

Any idea on what's going on? I cannot figure this out. I have all the button mapping setup correctly and have set snes_set_controller_port_device(SNES_PORT_1, SNES_DEVICE_JOYPAD); snes_set_controller_port_device(SNES_PORT_2, SNES_DEVICE_JOYPAD);

clobber commented 12 years ago

Guerilla War is another example.

In a one player game, I'll press A and all the sudden the second player shows up and shoots.

inactive123 commented 12 years ago

The problem most likely is implementation-related.

You can try changing the code in the function update_input (libsnes.c).

I'll look at it later tomorrow and see if this problem is also affecting the 360/PS3/PC ports. This issue (that controller 1 was simultaneously controlling both player 1 and player 2) was supposed to have been fixed a few revisions ago.

clobber commented 12 years ago

Not sure if that bug was fixed then because I removed my code that looks for any Player 2 button presses (port == SNES_PORT_2 & device == SNES_DEVICE_JOYPAD) and that fixed my issue.

Let me know later if you find anything. Thanks

Themaister commented 12 years ago

snes_set_controller_port_device() in FCEUmm is implemented as a no-op atm, so shouldn't be that.

To be honest the input API in FCEU is a tad confusing. I have a feeling it's not implemented correctly to begin with in libsnes. I've pushed a commit that seems more correct to me from looking at the source. Need to look at it later.

clobber commented 12 years ago

Commit 7131fd32f0f590317b9fd29e43c4b2bd06632702 fixed it.

Thanks!