b-em icon indicating copy to clipboard operation
b-em copied to clipboard

master compact joystick controls reversed

Open LoveBug2084 opened this issue 2 years ago • 2 comments

B-em v-09cfa9 in https://github.com/stardot/b-em/blob/master/src/compact_joystick.c the tests are reversed which ends up with up going down, left going right etc etc.

LoveBug2084 avatar Jul 09 '22 21:07 LoveBug2084

I have pushed a fix to this, though the fix is not in the code for the compact. Make sure you copy the joymap changes from the b-em.cfg in the repository to your active b-em.cfg file.

Can you test and let me know, and sorry it has taken me so long to get to this.

SteveFosdick avatar Jul 29 '22 23:07 SteveFosdick

hmmm I replaced my b-em.cfg with the updated one and verified it but still the joystick is reversed ! weird

you could just switch the bits around in this

posn = joyaxes[0];
    if (posn > 0.5)
        temp &= ~0x10;
    else if (posn < -0.5)
        temp &= ~0x02;
    posn = joyaxes[1];
    if (posn > 0.5)
        temp &= ~0x04;
    else if (posn < -0.5)
        temp &= ~0x08;
    if (joybutton[0])
        temp &= ~0x01;

to

posn = joyaxes[0];
    if (posn > 0.5)
        temp &= ~0x02;
    else if (posn < -0.5)
        temp &= ~0x10;
    posn = joyaxes[1];
    if (posn > 0.5)
        temp &= ~0x08;
    else if (posn < -0.5)
        temp &= ~0x04;
    if (joybutton[0])
        temp &= ~0x01;

sorry im terrible and make hacky fixes :face_with_spiral_eyes:

LoveBug2084 avatar Aug 14 '22 11:08 LoveBug2084