stardot / b-em

An opensource BBC Micro emulator for Win32 and Linux
http://stardot.org.uk/forums/viewtopic.php?f=4&t=10823
GNU General Public License v2.0
117 stars 58 forks source link

master compact joystick controls reversed #171

Open LoveBug2084 opened 2 years ago

LoveBug2084 commented 2 years ago

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.

SteveFosdick commented 2 years ago

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.

LoveBug2084 commented 2 years ago

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: