YuanHao
Member
This is specially important for emus and anyone using Puck's USB Joystick lib!!
(Note: I'm sorry if this problem has already been issued and fixed, but I can't seem to find too much about it in the forum)
PROBLEM:
We just got the USB cradle, and we used the NES emu to test it. The USB joystick libs sets both LEFT and RIGHT (or UP and DOWN, but let's stick to LEFT and RIGHT) if you press them at the "same" (or quickly enough) time.
For example: Suppose you are running on megaman 3 to the left, and suddenly decide to go right. Both left and right will be registered, which will freeze megaman. It gets worse for example on Ninja Gaiden, where Ryu starts to ice-skate through the stage (similar to mario 1 glitch with the pipe).
SOLUTION (untested but probably works):
In the joy_update() method:
Change:
CODE
if (events.number == 1) {
if (events.value == 0) joy->stateaxes[JOYLEFT] = joy->stateaxes[JOYRIGHT] = 0;
else if (events.value < 0) joy->stateaxes[JOYLEFT] = 1;
else joy->stateaxes[JOYRIGHT] = 1;
joy->axevals[1] = events.value; }
To:
CODE
if (events.number == 0) {
// Reset both directions...
joy->stateaxes[JOYLEFT] = joy->stateaxes[JOYRIGHT] = 0;
if (events.value < 0)
joy->stateaxes[JOYLEFT] = 1;
else if (events.value > 0)
joy->stateaxes[JOYRIGHT] = 1;
joy->axevals[0] = events.value;
}
The same must be done with UP and DOWN. What will happen? LEFT and RIGHT will never be pressed simultaneously (which I don't feel is needed in any game that has been made as of now).
I'm busy at the moment and not familiar to modifying emulators or such, so I hope someone else can do it . I know it's no great discovery, but it's a real pain when you're trying to play with usb controllers. This little code will save many cradles and a lot of frustration
BTW thanks Puck for this great library, and woogal who suggested the solution Too much entertainment for today, back to Wind and Water! (I'll be testing this tomorrow and see if I can get USB controller support for Wind and Water )
(Note: I'm sorry if this problem has already been issued and fixed, but I can't seem to find too much about it in the forum)
PROBLEM:
We just got the USB cradle, and we used the NES emu to test it. The USB joystick libs sets both LEFT and RIGHT (or UP and DOWN, but let's stick to LEFT and RIGHT) if you press them at the "same" (or quickly enough) time.
For example: Suppose you are running on megaman 3 to the left, and suddenly decide to go right. Both left and right will be registered, which will freeze megaman. It gets worse for example on Ninja Gaiden, where Ryu starts to ice-skate through the stage (similar to mario 1 glitch with the pipe).
SOLUTION (untested but probably works):
In the joy_update() method:
Change:
CODE
if (events.number == 1) {
if (events.value == 0) joy->stateaxes[JOYLEFT] = joy->stateaxes[JOYRIGHT] = 0;
else if (events.value < 0) joy->stateaxes[JOYLEFT] = 1;
else joy->stateaxes[JOYRIGHT] = 1;
joy->axevals[1] = events.value; }
To:
CODE
if (events.number == 0) {
// Reset both directions...
joy->stateaxes[JOYLEFT] = joy->stateaxes[JOYRIGHT] = 0;
if (events.value < 0)
joy->stateaxes[JOYLEFT] = 1;
else if (events.value > 0)
joy->stateaxes[JOYRIGHT] = 1;
joy->axevals[0] = events.value;
}
The same must be done with UP and DOWN. What will happen? LEFT and RIGHT will never be pressed simultaneously (which I don't feel is needed in any game that has been made as of now).
I'm busy at the moment and not familiar to modifying emulators or such, so I hope someone else can do it . I know it's no great discovery, but it's a real pain when you're trying to play with usb controllers. This little code will save many cradles and a lot of frustration
BTW thanks Puck for this great library, and woogal who suggested the solution Too much entertainment for today, back to Wind and Water! (I'll be testing this tomorrow and see if I can get USB controller support for Wind and Water )