Can a programmer possible explain what this means. It is beyond my ability to decipher:
It is related to my problem of the joystick not working while the button do work with my Mayflash F300
What steps will reproduce the problem? 1. Use hori fighting stick mini 3. 2. Try using the stick. 3. Does not work,
What is the expected output? What do you see instead? Stick working.
What version of the product are you using? On what operating system? Rasbian, mame4all compiled from change set: ea85746014e2c2a85665f2a4d4a4b87e819a5287.
Please provide any additional information below. I made a patch that works for me.
Attachments
patch.txt 1.23KB
[diff --git a/src/rpi/input.cpp b/src/rpi/input.cpp
index 10dc318..14eb69f 100644
--- a/src/rpi/input.cpp
+++ b/src/rpi/input.cpp
@@ -672,14 +672,38 @@ extern SDL_Joystick* myjoy[4];
int is_joy_axis_pressed (int axis, int dir, int joynum)
{
if (!myjoy[joynum]) return 0;
if (joynum > 3 || !myjoy[joynum]) return 0;
int hats = SDL_JoystickNumHats(myjoy[joynum]);
if (hats * 2 > axis) {
// Each hat has two axis
Uint8 hat = SDL_JoystickGetHat(myjoy[joynum], axis / 2);
int sub_axis = axis & 1;
/* Normal controls */
if (dir == 1) {
if (sub_axis == 0)
return (hat & SDL_HAT_LEFT) != 0;
return (hat & SDL_HAT_UP) != 0;
} else if (dir == 2) { //right down
if (sub_axis == 0)
return (hat & SDL_HAT_RIGHT) != 0;
return (hat & SDL_HAT_DOWN) != 0;
}
return 0;
}
/* Ajust for hat axis */
axis -= hats * 2;
/* Normal controls */
if(dir == 1) { //left up
if(SDL_JoystickGetAxis(myjoy[joynum], axis) < -12000) return true;
if(SDL_JoystickGetAxis(myjoy[joynum], axis) < -12000) return true;
}
if(dir == 2) { //right down
if(SDL_JoystickGetAxis(myjoy[joynum], axis) > 12000) return true;
if(SDL_JoystickGetAxis(myjoy[joynum], axis) > 12000) return true;
}
return 0;]
Comment #1
Posted on May 27, 2015 by Happy Monkey
Thanks so much for this! It worked great for my same stick.
How I used this patch:
--from the console on the pi mkdir mame4all cd mame4all git init git pull git://git.code.sf.net/p/mame4allpi/code/ --download patch and copy into mame4all directory (I used WinSCP and had renamed mine sticks.patch) git apply sticks.patch make --after quite a while it should finish and you'll have a file "mame" right there in your mame4all directory, cp it to where ever your mame launches from, I am using retropie so I: cd /opt/retropie/emulators/mame4all and then: sudo cp /home/pi/mame4all/mame mame