Yeah I updated a day or 2 before posting after seeing the 2 player info on the main page. The trouble i'm having is that there is no "tab" menu when in pisnes, the snes9x.cfg has the button configs but no matter what I do all the inputs works as player 1.
I have two identical SNES USB pads of the Tomee variety and all I did was duplicate the config setting for joystick after adjusting some of the buttons and it worked. I really just did it was a one off "let's see" attempt and was pleasantly surprised.
I'm releasing a new version tonight with Xin-Mo support built into the kernel. I don't have a Xin-Mo encoder yet, but I would love someone to test it and report back.
I have the most current version of PiMame (PiPlay) but still don't have 2 player support in PiSNES. Please add this soon. I know mholgatem has successfully uploaded and rebuilt the emulator to support it but I haven't seen this update to the main image.
Thanks for the new update! However, it does not add 2 player support for Snes. At least not with the xin mo joystick... The kernel patch seems to be ok thou.
i could not use my second joystick either. when i press p2's button i get load and save state (weird since I "#") and the axis are off. this is my code. have a look, please.
But we need to modify the sources to fit to Xin-mo specifications under linux (first you need to check that the xin-mo module is running correctly with jstest /dev/input/js0 : detection of 22 buttons and 4 axes) : only 1 joystick and all buttons linked to this joy (same for axes).
So in the S9xReadJoypad in unix/unix.cpp file you need to replace in the "else" part of the test the variable "which1" by "0", to force the reading on the first joystick :
} else { if (keyssnes[sfc_key[L_2]] == SDL_PRESSED || joy_buttons[0][sfc_joy[L_2]]) val |= SNES_TL_MASK; if (keyssnes[sfc_key[R_2]] == SDL_PRESSED || joy_buttons[0][sfc_joy[R_2]]) val |= SNES_TR_MASK; if (keyssnes[sfc_key[X_2]] == SDL_PRESSED || joy_buttons[0][sfc_joy[X_2]]) val |= SNES_X_MASK; if (keyssnes[sfc_key[Y_2]] == SDL_PRESSED || joy_buttons[0][sfc_joy[Y_2]]) val |= SNES_Y_MASK; if (keyssnes[sfc_key[B_2]] == SDL_PRESSED || joy_buttons[0][sfc_joy[B_2]]) val |= SNES_B_MASK; if (keyssnes[sfc_key[A_2]] == SDL_PRESSED || joy_buttons[0][sfc_joy[A_2]]) val |= SNES_A_MASK; if (keyssnes[sfc_key[START_2]] == SDL_PRESSED || joy_buttons[0][sfc_joy[START_2]]) val |= SNES_START_MASK; if (keyssnes[sfc_key[SELECT_2]] == SDL_PRESSED || joy_buttons[0][sfc_joy[SELECT_2]]) val |= SNES_SELECT_MASK; if (keyssnes[sfc_key[UP_2]] == SDL_PRESSED || joy_axes[0][joyaxis_UD_2] == UP) val |= SNES_UP_MASK; if (keyssnes[sfc_key[DOWN_2]] == SDL_PRESSED || joy_axes[0][joyaxis_UD_2] == DOWN) val |= SNES_DOWN_MASK; if (keyssnes[sfc_key[LEFT_2]] == SDL_PRESSED || joy_axes[0][joyaxis_LR_2] == LEFT) val |= SNES_LEFT_MASK; if (keyssnes[sfc_key[RIGHT_2]] == SDL_PRESSED || joy_axes[0][joyaxis_LR_2] == RIGHT) val |= SNES_RIGHT_MASK; }
After compiling it it should work with the xin-mo module... it worked for me! If you don't want to "git clone" and compile, you can download the my raspberry pi arm executable from http://www.morere.eu/storage/pisnes-xinmo-modified-arm.zip
Here is my pisnes config file :
[Keyboard] # Get codes from /usr/include/SDL/SDL_keysym.h A_1=100 B_1=99 X_1=115 Y_1=120 L_1=97 R_1=102 START_1=13 SELECT_1=9 LEFT_1=276 RIGHT_1=275 UP_1=273 DOWN_1=274 QUIT=27 ACCEL=8
This is great! Good going @ian57! This has plagued the xin-mo users for way too long. I never had one of them, so I could never test! If you don't mind, I'm sure Shea would love to include this in the next build.
Glad to hear that someone is happy with my poor code modification ;-). This patch is very rough!!! Only usable with Xin-Mo module, so I'm not sur that it should be integrated as is!
Perhaps we should place a #define XINMO Variable somewhere, manage by Makefile (if it is possible) and change the code #ifndef XINMO original code #else modified xinmo code #endif
i tried copying the two files over but it stops it from opening. the screen just flashes when i click enter on it. I'm using 0.7.10 still. any idea where I'm going wrong?
I did the same with mame4all-pi to allow the 22 buttons of the xin-mo modules to be recognized, by default only 16 are recognized. I submitted the patch to Squid, the mame4all-pi developper, but no news from him.
thats awesome ian57, ive been looking for it for a while. im going to try this asap! on this link i only saw instructions for fba. whats the fix for mame4all?
ive tried to contact squid too, but he doesnt answer either.
Perhaps you'll need to change g++ and gcc compiler variables in the makefile... because i use Distcc to compile. If you compile on the pi i think you'll need to replace gcc by arm-linux-gnueabihf-gcc and g++ by arm-linux-gnueabihf-g++ in CC, CPP and LD variables.
@adamsrobots and lsalcedo : If you get a black screen, test the debug build. I had this problem. I build the executable with the debug Makefile and stripped it : il worked.
make -f Makefile.debug strip mame (or pisnes)
I'm going to build the stripped debug version of pisnes for you adamsrobots and put it on my website. I'll tell you when it's done.
im running pimame and could not find these files for fba fix; /rpi/fba_player.cpp /rpi/gp2xsdk.cpp /rpi/gp2xsdk.h (maybe its not required, only for the default values)
ive used your pisnes files and now im getting "segmentention fault"
Pimame is perhaps not based on the same linux version (and libs version). This could explain the segfault. In this case you'll need to git clone and build it on your distribution. And same for pisnes I'm afraid.
Don't be afraid that's easy (but it takes time, because pi is slow). Just need to install the dev packages of the used libs and just type : make and that's it!
First you need to install "build essentials", git to get sources, and make: sudo apt-get install build-essential automake make autoconf git git-core
next the dev package :
here is dev packages installed on my "devel" rapbian : used to compile software. I think you don't need all of them, but with this list, emulators will compile :