Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • doakey3
    Participant
    Post count: 6

    I am using a mayflash n64 adapter with retropie 3.0 beta 4 for raspberry pi 2:

    I have edited
    /opt/retropie/configs/n64/retroarch.cfg
    in order to create specific controls for the mupen64plus emulator (including hotlinks)

    When I start Ocarina of Time in mupen64plus, all of my controls work, but when I push the joystick through it’s full range, link walks instead running. I have seen other threads where advice is given to edit
    /opt/retropie/configs/n64/InputAutoCfg.ini

    however, this file already contains a controller called [Linux: USB GamePad] and changing the AnalogPeak and AnalogDeadzone for my controller has no effect on the game (I don’t think the file is being used…). I don’t want auto controls anyway, I want to use the controls I have outlined in /opt/retropie/configs/n64/retroarch.cfg

    I’ve also tried editing the ‘AnalogPeak’ value in /opt/retropie/configs/n64/mupen64plus.cfg but that hasn’t changed anything either.

    Is there a way to adjust the joystick range for my mayflash n64 adapter? How can I make link run?

    As a side note, I had this same problem with project64 on my pc, but in the controls window, there is an option to uncheck “Real N64 Range” and that fixed the problem entirely.

    I have been at this for hours. Any help would be greatly appreciated.

    doakey3
    Participant
    Post count: 6

    I fixed this issue by typing

    jstest /dev/input/js0 I observed the values of the joypads as I pushed them. I pressed ctrl+c to exit that and typed:

    jscal -c /dev/input/js0

    This allowed me to recalibrate the controller’s joypads. I ran

    jstest /dev/input/js0

    again and saw that the values had changed. I went to /opt/retropie/configs/all/retroarch.cfg
    and edited the line:
    input_autodetect_enable = true
    and I changed it to false
    For good measure I deleted my joypad’s auto config file by going to
    /opt/retropie/configs/all/retroarch-joypads
    and removed all files there.

    I then went to
    /opt/retropie/configs/n64
    and edited the retroarch.cfg file there.

    #include "/opt/retropie/configs/all/retroarch.cfg"
    fast_forward_ratio = "2.0"
    
    input_joypad_driver = "linuxraw"
    input_device_p1 = "0"
    input_player1_joypad_index = 1
    input_player1_b_btn = 2
    input_player1_a_btn = 1
    input_player1_up_btn = 12
    input_player1_down_btn = 14
    input_player1_right_btn = 13
    input_player1_left_btn = 15
    input_player1_start_btn = 9
    input_player1_select_btn = 8
    input_player1_l2_btn = 8
    input_player1_r2_btn = 7
    input_player1_l_btn = 6
    input_player1_r_y_plus_axis = +2
    input_player1_r_y_minus_axis = -2
    input_player1_r_x_plus_axis = +3
    input_player1_r_x_minus_axis = -3
    input_player1_l_y_plus_axis = +1
    input_player1_l_y_minus_axis = -1
    input_player1_l_x_plus_axis = +0
    input_player1_l_x_minus_axis = -0 
    
    input_enable_hotkey_btn = 14
    input_exit_emulator_btn = 9
    input_load_state_btn = 7
    input_save_state_btn = 6

    The important part about this file is to specify that you want the joypad driver to be “linuxraw”.

    After doing this, link was able to run and I had no problems with the controls. Unfortunately, the joystick calibration will be undone at reboot.

    You can use jscal -p to read the calibration settings.

    Then call the function

    jscal -s 1,6,128…..(a bunch of numbers) /dev/input/js0

    ideally, you would have a script run at startup that would call this function for you, but I haven’t made it that far yet.

    doakey3
    Participant
    Post count: 6

    ok, with your controller plugged in type

    lsusb

    (That’s a lower cased ‘L’ by the way) This should give you the device info for your controller. for me there was a line that said,

    Bus 001 Device 005: ID 0e8f:3013 GreenAsia Inc.

    make a file by doing
    sudo nano /etc/udev/rules.d/60-n64.rules

    in that file put:

    ATTRS{idVendor}==”0e8f”, ATTRS{idProduct}==”3013″, RUN+=”/opt/retropie/configs/n64/n64-config.sh”

    replace the 0e8f and the 3013 for your device

    now do

    sudo nano /opt/retropie/configs/n64/n64-config.sh

    and put:

    #!/bin/bash
    sleep 1
    jscal -s 6,1,0,128,128,6882750,6627834,1,0,127,127,6882750,6795627,1,0,128,128,5592235,5592235,1,0,128,128,5592235,5592235,1,0,0,0,2147483647,2147483647,1,0,0,0,2147483647,2147483647 /dev/input/js0
    jscal -s 6,1,0,128,128,6882750,6627834,1,0,127,127,6882750,6795627,1,0,128,128,5592235,5592235,1,0,128,128,5592235,5592235,1,0,0,0,2147483647,2147483647,1,0,0,0,2147483647,2147483647 /dev/input/js1

    Now make that file an executable by doing:

    sudo chmod 755 /opt/retropie/configs/n64/n64-config.sh

    Now every time you plug in the controller, that script will be run and your joysticks will be recalibrated.

    One gotcha is that the files need to be in unix format. I was writing the files on my windows pc and copying them over and ran into problems. To solve this I downloaded dos2unix for windows and converted them that way.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Controller Configuration in RetroPie’ is closed to new topics and replies.