SNESDev-RPi & PiTFT GPIO pins

Home Forums RetroPie Project Everything else related to the RetroPie Project SNESDev-RPi & PiTFT GPIO pins

This topic contains 6 replies, has 2 voices, and was last updated by Profile photo of gonzo gonzo 2 years, 10 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29807
    Profile photo of gonzo
    gonzo
    Participant

    I am planning to use SNESDev-RPi with a PiTFT display, but they both want to use pins 19 and 23 – am I right to assume that I can just change the below section of code from SNESDev.c to use another two pins? And will any of the remaining pins work just as well? There is nothing special about pins 19 and 23 for SNESDev-RPi? Thanks!

    
    if (get_rpi_revision()==1)
    {
    gpads[0].pin_clock = RPI_GPIO_P1_19;
    gpads[0].pin_strobe = RPI_GPIO_P1_23;
    gpads[0].pin_data = RPI_GPIO_P1_05;
    gpads[1].pin_clock = RPI_GPIO_P1_19;
    gpads[1].pin_strobe = RPI_GPIO_P1_23;
    gpads[1].pin_data = RPI_GPIO_P1_07;	
    } else {
    gpads[0].pin_clock = RPI_V2_GPIO_P1_19;
    gpads[0].pin_strobe = RPI_V2_GPIO_P1_23;
    gpads[0].pin_data = RPI_V2_GPIO_P1_05;
    gpads[0].type = GPAD_TYPE_SNES;
    gpads[1].pin_clock = RPI_V2_GPIO_P1_19;
    gpads[1].pin_strobe = RPI_V2_GPIO_P1_23;
    gpads[1].pin_data = RPI_V2_GPIO_P1_07;	
    }
    

    #29808
    Profile photo of petrockblog
    petrockblog
    Keymaster

    As long as you do not want to use the RetroPie GPIO Adapter you can simply adapt the SNESDev sources to your pin out and things should be fine.

    #29817
    Profile photo of gonzo
    gonzo
    Participant

    Thanks! Could you let me know where in the source I can find the settings for which keyboard keys are sent?

    #29819
    Profile photo of petrockblog
    petrockblog
    Keymaster

    In SNESDev.c: ESC press is simulated, e.g., at https://github.com/petrockblog/SNESDev-RPi/blob/master/src/SNESDev.c#L297.

    #29827
    Profile photo of gonzo
    gonzo
    Participant

    What about the ‘virtual keys’ that are being sent for Up, Down, Left, Right, A, B, etc?

    #29828
    Profile photo of petrockblog
    petrockblog
    Keymaster
    #29846
    Profile photo of gonzo
    gonzo
    Participant

    Ah! Forgive me for being slow on the uptake – I was assuming everything was acting as one ‘virtual keyboard’ but I can see now that there are actually two ‘virtual gamepads’ plus a ‘virtual keyboard’! Could you help with an example of how I could go about sending all of the gamepad button presses as ‘virutal keyboard’ key presses instead?

Viewing 7 posts - 1 through 7 (of 7 total)

Forums are currently read only - please visit the new RetroPie forums at https://retropie.org.uk/forums/

Skip to toolbar