PiSNES, second player with joystick
  • Hi All,
    How I can configure the second joystick for second player with PiSNES?
    thanks
    Giorgio
  • I have already checked, downloaded and compiled..
    But can't manage to configure my second joystick (axis 3 and 2 of my xin-mo usb interface)
  • I think that I know how to fix it, give me a sec...
  • wow, yeah, thank you!
  • ok, you are going to have to re-download and compile, I think that this should work. I don't have usb joysticks to test it though, so fingers crossed.
    https://holgatemark1-pisnes-2-player.googlecode.com/archive/adfda172ba3fa7e20e2c55e696084dfca05414f5.zip
  • ok, let me try
  • make failed with:

    unix/unix.cpp: In function ‘uint32 S9xReadJoypad(int)’:
    unix/unix.cpp:1133:66: error: ‘joyaxis_UD_1’ was not declared in this scope
    unix/unix.cpp:1134:68: error: ‘joyaxis_UD_1’ was not declared in this scope
    unix/unix.cpp:1135:68: error: ‘joyaxis_LR_1’ was not declared in this scope
    unix/unix.cpp:1136:69: error: ‘joyaxis_LR_1’ was not declared in this scope
    unix/unix.cpp:1146:66: error: ‘joyaxis_UD_2’ was not declared in this scope
    unix/unix.cpp:1147:68: error: ‘joyaxis_UD_2’ was not declared in this scope
    unix/unix.cpp:1148:68: error: ‘joyaxis_LR_2’ was not declared in this scope
    unix/unix.cpp:1149:69: error: ‘joyaxis_LR_2’ was not declared in this scope
    make: *** [unix/unix.o] Error 1
  • I think that I have it fixed. compiling it now, I'll let you know
  • ...making...
  • after compiling, what rows I need to use to configure joystick#2 in snes9x.cfg?
  • uhm.. seem to not work:

    I've configured:
    A_2=4
    B_2=5
    X_2=6
    Y_2=7
    L_2=14
    R_2=15
    START_2=11
    SELECT_2=10
    JA_LR_2=3
    JA_UD_2=2

    but nothing seem to work, directional joystick or button
    (I'm trying with SuperMario Kart)

    Any Ideas?

    (After successfully compiling, I've moved and chmod +x only the snes9x.gui and snes9x.cfg in the main "old" pisnes folder)
  • hmm... can you post your whole snes9x.cfg file?
  • and where I can configure up,down on axis 2 and left right on axis 3?
    In any case also the button seem to not work..
    thanks :)
  • can you post your whole snes9x.cfg file?
  • Yes!

    [Keyboard]
    # Get codes from /usr/include/SDL/SDL_keysym.h
    A_1=13
    B_1=32
    X_1=305
    Y_1=303
    L_1=122
    R_1=120
    START_1=49
    SELECT_1=50
    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=3
    X_1=1
    Y_1=2
    L_1=17
    R_1=16
    START_1=11
    SELECT_1=10
    QUIT=99
    ACCEL=99
    QLOAD=99
    QSAVE=99
    #Joystick axis

    JA_LR=1
    JA_UD=0

    # player 2 button
    A_2=4
    B_2=5
    X_2=6
    Y_2=7
    L_2=14
    R_2=15
    START_2=12
    SELECT_2=22
    #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
  • hmm... I'll have to mess around with it some more. Without a xin-mo of my own, it's really hard to troubleshoot this.
  • is your joystick 1 working also with xin-mo?\
  • also, can you set the axis numbers that your xin-mo uses? what happens if you set the two of them to the same (left/right 1, up/down 0)
  • Hi, Good Morning.

    Yes, the joystick#1 work well, axis and button.
    But the setting for joystick#2 not work, both axis or buttons.

    If I Set:
    JA_LR_2=1
    JA_UD_2=0

    nothing change, nothing happen. Not work.

    Seems that PisNES want to use a different joystick than JS0.
    ( I also have the same problem with PiFBA, but Mame4ALL work well!)
  • ok, I have tried one last idea. If this doesn't work, then I'm not sure what to do.

    https://holgatemark1-pisnes-2-player.googlecode.com/archive/master.zip
  • Ok, let my try.
    Thanks!
  • Done compiled. Nothing seem changed.
    But:
    We are sure about this syntax in cfg file?

    [Joystick]
    A_2=4
    B_2=5
    X_2=6

    Or maybe
    [Joystick_2] ?

    and for axis #2?
    JA_LR_2=2
    JA_UD_2=3

    or maybe

    JB_LR=1
    JB_UD=0

    or

    [Joystick_2]
    JA_LR=2
    JA_UD=3


    What you think about?
    thanks again
  • On http://www.raspberrypi.org/forum/viewtopic.php?f=78&t=42152&start=50 I can read:

    by pudding » Sun Aug 25, 2013 11:39 am
    Nope, second joystick can't be configured differently than the first.

    What it means?
  • yeah, I dunno. It's too hard for me to troubleshoot this without having usb joysticks myself. Sorry.
  • Yes, I can imagine.
    Can you please check for the syntax in the cfg file?
  • Well with this last build, in theory everything under joystick should be labeled with either a '_1' or '_2' suffix.

    ex.
    [Joystick]
    A_1=0
    B_1=3
    X_1=1
    Y_1=2
    L_1=17
    R_1=16
    START_1=11
    SELECT_1=10
    QUIT=99
    ACCEL=99
    QLOAD=99
    QSAVE=99
    JA_LR_1=1
    JA_UD_1=0

    # player 2 button
    A_2=4
    B_2=5
    X_2=6
    Y_2=7
    L_2=14
    R_2=15
    START_2=12
    SELECT_2=22
    JA_LR_2=2
    JA_UD_2=3

    But that doesn't work, unfortunately.
  • Hi mholgatem
    Please check your last build, seem that LR and UD are inverted , both in game and in GUI.
    Can you please check?
    Thanks
    Giorgio
  • ( I'm trying to use player#1 on joystick, and player#2 on keyboard
    (maybe using a python script to emulate keyboard with joystick#2)
  • you can set your LR and UD in the config, make sure that you have attached the '_1' suffix to the end of your original config settings (ie - JA_LR_1,JA_UD_1)

    since the edits to get the joystick #2 didn't work, I would just download the original 2 player keyboard fix and stick with that, so that there are no surprises down the road.

    https://holgatemark1-pisnes-2-player.googlecode.com/archive/67bbc0d57cc6032d73ce4dc1be258bf0c721ca23.zip
  • Uhm I think that I have something wrong, because also using "_1" I cannot swap UD with LR, assigning axis 0 or 1.

    I try to compile again, and also recreate CFG file.
    Can you please confirm that this last build:
    https://holgatemark1-pisnes-2-player.googlecode.com/archive/415317508dfa259daabf85550801222f7a3b7a37.zip

    Works well and also can use two player on same keyboard?
    thank you!




  • Ok, thank you!
    Now I need to find a script, or something help to help me to emulate keyboard with second joystick (the second player of xin-mo interface).
    I've tried joy2key but is impossible to use.
    If I solve this (joystick buttons to keyboard) I can solve both PISNES and PIFBA second player problem.
  • mholgatem,

    Just wanted to let you know that your changes work great with my two gamepads (old Logitech Dual Action and newer Logitech F310). The controllers use different button mappings, but your changes now allow that.

    So thanks! :)

  • which version did you download?
  • I did a "git clone" of your latest source from here: https://code.google.com/r/holgatemark1-pisnes-2-player/
    and then built it.
  • (sorry, dupe comment posted by accident)
  • it's all good, I'm all caught up now. Great! I'm glad that it's working for you. giorgiofox was having problems getting the xin-mo interface working with 2 controllers and I wasn't ever able to figure that one out unfortunately. So this is a definite boost to my confidence!
  • I've definitely abandoned Xin-Mo interface: too many problems.
    I'm now very happy using 19 GPIO, thank to mholgatem all now work!
  • Glad its working. I had no problem with xin mo myself.
    Marked as solved

Howdy, Stranger!

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