Xin-Mo and pisnes
  • Hi,

    Does anyone know how to get xin-mo working as players1 and 2 in pisnes?
  • If someone could tell me how to get player 2 working that would be great.
  • are you using the latest verison of pimame? older versions only had the 1 player version of pisnes
  • 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 did give that a go but the buttons did nothing and the play 1 joystick axis changed to the other joystick
  • I have the same problem with my Xin-mo and pisnes. Is there solution to this?
  • Xin-mo and pisnes don't seem to play together nicely. I have spoken to several users that have had problems with that combo for some reason.
  • 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.
  • Looking forward to the new release then! I'll let you know how it works for me. Fantastic job with the project to all of you involved!
  • ive been trying to make xin mo to work on pimame 0.8 for the last days but i still have no luck :(

    iven been following this guide;
    http://ithink.ch/blog/2013/09/08/patching_the_linux_kernel_to_install_the_xin-mo_dual_arcade_driver_on_a_raspberry_pi.html
  • The new version is available to download that has Xin-Mo support built in.
  • 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.
  • Maybe this could help: http://hetgrotebos.org/wiki/uinput-mapper

    With this tool you can divide the joystick into two inputs. I'll have a look at it later this week and report back.
  • hey human could u config all inputs on mame4ll and fba?
  • 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.

    [Joystick]
    # Get codes from "jstest /dev/input/js0"
    # from package "joystick"
    A_1=3
    B_1=2
    X_1=2
    Y_1=0
    L_1=1
    R_1=5
    START_1=6
    SELECT_1=7
    #QUIT=99
    #ACCEL=7
    #QLOAD=10
    #QSAVE=11
    #Joystick axis
    JA_LR=0
    JA_UD=1
    #player2
    A_2=13
    B_2=12
    X_2=11
    Y_2=10
    L_2=12
    R_2=15
    START_2=16
    SELECT_2=17
    #JOY AXIS
    JA_LR_2=2
    JA_UD_2=3
  • i think pisnes it ignoring my snes9x.cfg.
  • I found a solution yesterday ;-)

    I use the modified 2 players version of pisnes found here : https://code.google.com/r/holgatemark1-pisnes-2-player/source/checkout.

    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

    #player 2 keyboard controls
    A_2=114
    B_2=116
    X_2=121
    Y_2=117
    L_2=999
    R_2=999
    START_2=50
    SELECT_2=49
    LEFT_2=97
    RIGHT_2=100
    UP_2=119
    DOWN_2=115

    [Joystick]
    # Get codes from "jstest /dev/input/js0"
    # from package "joystick"
    A_1=0
    B_1=1
    X_1=2
    Y_1=3
    L_1=4
    R_1=5
    START_1=0
    SELECT_1=1
    QUIT=7
    ACCEL=4
    QLOAD=6
    QSAVE=16
    #Joystick axis
    JA_LR_1=0
    JA_UD_1=1

    # player 2 button
    A_2=10
    B_2=11
    X_2=12
    Y_2=13
    L_2=14
    R_2=15
    START_2=10
    SELECT_2=11
    #Joystick 2 axis
    JA_LR_2=2
    JA_UD_2=3

    [Graphics]
    DisplaySmoothStretch=1
    # Display Effect: 0 none, 1 scanlines, 2 phospher
    # NOTE Phospher does not run at full speed
    DisplayEffect=0
    MaintainAspectRatio=1
    DisplayBorder=0
    AutoFrameskip=1
    Frameskip=200
    Transparency=1
    CPUCycles=100

    [Sound]
    APUEnabled=1
    # Sound rates below as index, i.e. 7=44100 (some of these produce static)
    # 0, 8192, 11025, 16000, 22050, 29300, 32000, 44100
    SoundPlaybackRate=7
    InterpolatedSound=0

    Hope this helps ;-)
  • Fantastic!!! This worked for me!
    Thank you so much!
  • 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 can probably mod it in the pisnes source to check for xin-mo. Now that I know what works, it should be easy.
  • Awesome!!! Yes I want to include this. Once it works for both those using a Xin-Mo and those without :D

    Great work!
  • Ok, modifiy your sources, it's better, and i can check if it works for both... Tell us when it's done, i have gamepads and xin-mo.

    Ads ;-) : check my raspicade distribution https://sourceforge.net/projects/raspicade/

  • @ian57
    Brilliant work! This is truly awesome!!
    Plus we can use parts of this code for PiFBA too. PiFBA lacks proper xin-mo support too.
    Thanks heaps!
  • @Conno123009 : I modified pifba as written in https://github.com/petrockblog/RetroPie-Setup/wiki/Troubles-with-the-Xin-Mo-Controller It worked for me for the xin-mo. see http://youtu.be/p8KqMrq_UW4 (sorry in french)
  • Thanks! Very useful :D
  • im a bit stuck with this can someone run me thru the process
  • Ok, you can download my binaries ( raspian based compiled). Make a backup of the original ones and extract the zip file. That's all
  • Can anyone explain how to get this update please. Is it installed through the command line?
  • 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?
  • great work ian57 :)
    maybe you could do a fix for xin mo and FBA. enabling it to play with 2 players.
  • @ adamrobots : I compiled them on moebius linux (a minimal raspian without X etc.) perhaps it comes from the linked libs.

    I'm not using pimame, sorry.
  • @ lsalcedo : this fix is already done and integrated in my raspicade project ;-). I just followed https://github.com/petrockblog/RetroPie-Setup/wiki/Troubles-with-the-Xin-Mo-Controller and it worked.

    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.
  • @lsalcedo you can download my mame patch at http://morere.eu/storage/mame4all-pi-xinmo.patch.zip. I made it on my own ;-)

    get a fresh mame4all-pi from git clone. Apply the patch and compile

    pi@raspberrypi ~/temp/mame4all-pi $ patch -p1 -i mame4all-pi-xinmo.patch
    patching file Makefile
    patching file Makefile.debug
    patching file src/inptport.cpp
    patching file src/inptport.h
    patching file src/input.h
    patching file src/rpi/input.cpp
    patching file src/rpi/minimal.h
    pi@raspberrypi ~/temp/mame4all-pi $ make

    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.

    here is the proof https://sourceforge.net/p/raspicade/wiki/HowTo/attachment/mame-xinmo.jpg
  • @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.
  • Thanks for all your help ian
  • 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.
  • damm i think im not that good. tkz for your answer ian57
  • 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!
  • alright! :) please tell me, how do i install these dev packges?
  • 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 :

    sudo apt-get install autotools-dev dpkg-dev libapt-pkg-dev:armhf libasound2-dev:armhf libatk1.0-dev libavahi-client-dev libavahi-common-dev libc-dev-bin libc6-dev:armhf libcacadev libcairo2-dev libdbus-1-dev libdirectfb-dev libexpat1-dev libfontconfig1-dev libfreetype6-dev libgdk-pixbuf2.0-dev libgl1-mesa-dev libglib2.0-dev libglu1-mesa-dev libgtk-3-dev libgtk2.0-dev libgudev-1.0-0:armhf libice-dev:armhf libjpeg8-dev:armhf libncurses5-dev libpango1.0-dev libpcre3-dev libpixman-1dev libpng12-dev libpopt-dev:armhf libpthread-stubs0-dev:armhf libpulse-dev:armhf libraspberrypi-dev libsdl1.2-dev libslang2-dev:armhf libsmdev:armhf libssl-dev libstdc++6-4.6-dev libtinfo-dev:armhf libts-dev:armhf libudev0:armhf libx11-dev:armhf libxau-dev:armhf libxcb-render0-dev:armhf libxcb-shm0-dev:armhf libxcb1-dev:armhf libxcomposite-dev libxcursor-dev:armhf libxdamage-dev libxdmcp-dev:armhf libxext-dev:armhf libxfixes-dev libxft-dev libxi-dev libxinerama-dev:armhf libxrandr-dev libxrender-dev:armhf linux-libc-dev:armhf mesa-common-dev python-dev python2.7-dev udev x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-render-dev x11proto-xext-dev x11protoxinerama-dev xtrans-dev zlib1g-dev:armhf

    after that, you need to get the sources :

    git clone https://code.google.com/p/mame4all-pi/

    apply my patch and run make ;-)

    you can download my mame patch at http://morere.eu/storage/mame4all-pi-xinmo.patch.zip. I made it on my own ;-)

    get a fresh mame4all-pi from git clone. Apply the patch and compile

    pi@raspberrypi ~/temp/mame4all-pi $ patch -p1 -i mame4all-pi-xinmo.patch
    patching file Makefile
    patching file Makefile.debug
    patching file src/inptport.cpp
    patching file src/inptport.h
    patching file src/input.h
    patching file src/rpi/input.cpp
    patching file src/rpi/minimal.h
    pi@raspberrypi ~/temp/mame4all-pi $ make

  • OK, so I put the patch by @ian57 on Github:
    https://github.com/Conno123009/PiSNES-Xin-Mo
    Just to make it easier :D Enjoy!

    And thanks heaps for your work, @ian57
    Full credit goes to you!

    --
    Conno123009
  • thanks Conno.
    What fixes are in this patch? PiNES, FBA and Mame4all or just PiNES?
  • Just PiSNES for now. I'll upload FBA and Mame4all patches ASAP!
    Thanks!
  • You can compile the PiSNES patch like this:
    cd /home/pi
    git clone https://github.com/Conno123009/PiSNES-Xin-Mo
    cd PiSNES-Xin-Mo
    make
    cp snes9x /home/pi/pimame/emulators/pisnes
    chmod +x /home/pi/pimame/emulators/pisnes/snes9x

    Backup your original pisnes folder first though :)
    You then have to edit the snes9x.cfg file to use the second player joystick as Ian57 wrote here: http://pimame.org/forum/discussion/532/xin-mo-and-pisnes#Item_19

    Good luck!

    --
    Conno123009
  • Very happy it helps ;). All my patches for raspicade are located here http://www.morere.eu/spip.php?article176...

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!