libretro / snes9x2010

Snes9x 2010. Port of Snes9x 1.52+ to Libretro (previously called SNES9x Next). Rewritten in C and several optimizations and speedhacks.
Other
99 stars 71 forks source link

Two Player support #13

Closed halsafar closed 12 years ago

halsafar commented 12 years ago

Is two player support broken or am I setting it up wrong? Turtles in Time and Bomberman 2 (so multitap) appear to not work at all for more than one player. It seems all controllers, even if they S9xReportButton to a different PAD ID always modify player 1. This is a Wii version, I think it has to do with the following piece of code in control.c:

#if GEKKO
    case S9xButtonJoypad:
        {
            uint16 r = cmd.commandunion.button.joypad;

            if (data1)
                joypad[data2] |= r;
            else
                joypad[data2] &= ~r;
        }
        return;
#endif

It seems input doesn't work at all without that snippet. If I enable that snippet then input works fine but I can't get multiplayer support to work.

halsafar commented 12 years ago

Based on reviewing the PS3 port I see you directly set joypad[i].

inactive123 commented 12 years ago

Yes, control hookup is now very much like SNES9x 1.43, where the joypad array was also being used directly.

You can find working examples for multiplayer in both libsnes.c and emu-ps3.c.

halsafar commented 12 years ago

Definitely faster and more reliable than using S9X built ins. I got it working. Thanks!