• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login

Pi in a Super Famicom Build

Scheduled Pinned Locked Moved Projects and Themes
super famicomsuper nintendobuildconsoleproject
187 Posts 23 Posters 144.8k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O
    obsidianspider
    last edited by obsidianspider 24 Mar 2017, 03:15

    Today I decided to work on moving my scripts to my USB drive for stability, and to clean things up since I was initially just cobbling things together to get them to work. One challenge I faced was that the USB drive isn't immediately mounted when the system boots. It takes a few seconds. To get around that I put the tftstart.sh script in the /home/pi/ folder and added a bit to tell it to wait until the USB folder is available before trying to execute the scripts that are located on it.

    #!/bin/bash
    # Wait for USB disk detection
    # Disk drive mount we're waiting on
    usbdrive="/media/usb0/retropie-mount"
    # Max time to wait (in seconds)
    maxwait=60
    for (( i = 0; i <= $maxwait; i++ ))
    do
      [ -d $usbdrive ] && break
      sleep 1
    done
    
    #load image
    sudo python /home/pi/RetroPie/tft/imageparam.py "/home/pi/RetroPie/tft/images/RetroPie Splashscreen Blue.jpg"
    
    #turn on backlight and enable Reset button toggle
    sudo python /home/pi/RetroPie/tft/switch.py
    

    I also updated my runcommand-onstart.sh script to reference images located in the ROMs folder (I'm moving images to the ROMs folder) and to also handle file names with square braces[ ], which were breaking the script.

    # /opt/retropie/configs/all/runcommand-onstart.sh
    
    # get the full path filename of the ROM
    rom=$3
    
    # get the system name
    system=$1
    
    # get rom filename without folder
    rom_bn=$(basename "$rom")
    
    #get rom filename without extension
    rom_bn="${rom_bn%.*}"
    
    # escape square brackets in rom filename
    rom_bn="${rom_bn//\[/\\[}"
    rom_bn="${rom_bn//\]/\\]}"
    
    # Set a TFT-specific image if there is one
    img="$(find "/home/pi/RetroPie/tft/images/roms/${system}" -type f -name "${rom_bn}-image.*" -print -quit)"
    
    # If a TFT-specific image was not found, look in the images folder in the ROMs directory for that system
    if [[ -z "${img}" ]];
    then
       img="$(find "/home/pi/RetroPie/roms/${system}/images" -type f -name "${rom_bn}-image.*" -print -quit)"
    fi
    
    # If an image was not found in the ROMs directory for that system, check to see if there are any in the default emulationstation location
    if [[ -z "${img}" ]];
    then
       img="$(find "/opt/retropie/configs/all/emulationstation/downloaded_images/${system}" -type f -name "${rom_bn}-image.*" -print -quit)"
    fi	
    
    # If no game images are found, display one for the system being emulated
    if [[ -z "${img}" ]];
    then
       img="$(find "/home/pi/RetroPie/tft/images/systems" -type f -name "${system}.*" -print -quit)"
    fi
    
    # If no system image is found, default back to the Raspberry Pi logo
    if [[ -z "${img}" ]];
    then
       img="/home/pi/RetroPie/tft/images/Raspberry_Pi_Logo.svg.png"
    fi
    
    # run the python script to display the image
    sudo python /home/pi/RetroPie/tft/imageparam2.py "$img"
    

    I'm sure there is a lot that could still be improved or optimized, but things are working well.

    📷 @obsidianspider

    1 Reply Last reply Reply Quote 3
    • C
      Cybermen
      last edited by 27 Jan 2018, 10:00

      @obsidianspider Very good work. I am also rebuilding and have a question. How did you connect the original reset button? On the bottom are 4 connection possibilities?

      O 1 Reply Last reply 27 Jan 2018, 11:19 Reply Quote 0
      • O
        obsidianspider @Cybermen
        last edited by 27 Jan 2018, 11:19

        @cybermen the reset button is discussed in this post earlier in this same thread. That said, there are multiple motherboard variants, so use your meter to test.

        📷 @obsidianspider

        1 Reply Last reply Reply Quote 0
        • C
          Cybermen
          last edited by 27 Jan 2018, 12:22

          Super, Thank You.

          1 Reply Last reply Reply Quote 0
          • O
            obsidianspider
            last edited by 7 Feb 2018, 17:24

            Update

            I learned the hard way not to use rpi-update

            It apparently updated you to the bleeding edge firmware, and not only did the update fail halfway through, but once it completed successfully, Linux kept crashing. Now to see if I can fix this mess. Fun?

            📷 @obsidianspider

            1 Reply Last reply Reply Quote 0
            • O
              obsidianspider
              last edited by 7 Feb 2018, 22:35

              Well that was less than fun. Lesson learned, kids. If you have a heavily customized install, make sure you create an image of your SD card in case you blow it up like I did.

              Also, take better notes. ;)

              Things are working now, but it was a lot of head scratching to get all of my scripts in the right places.

              📷 @obsidianspider

              D 1 Reply Last reply 8 Feb 2018, 03:58 Reply Quote 0
              • D
                Darksavior @obsidianspider
                last edited by 8 Feb 2018, 03:58

                @obsidianspider I updated to the latest stretch build and that didn't go well. The gamecon driver wouldn't build. I reverted to stable stretch and fixed some dependencies to get ES to compile. I made a backup just in case, but it looks like I won't need to use it.

                O 1 Reply Last reply 8 Feb 2018, 12:06 Reply Quote 0
                • O
                  obsidianspider @Darksavior
                  last edited by 8 Feb 2018, 12:06

                  @darksavior I haven't tried Stretch. I heard it wasn't supported yet.

                  📷 @obsidianspider

                  D 1 Reply Last reply 8 Feb 2018, 14:51 Reply Quote 0
                  • D
                    Darksavior @obsidianspider
                    last edited by 8 Feb 2018, 14:51

                    @obsidianspider Try at your own risk, but once I sorted my dependencies, ES and the emulators I use work fine https://retropie.org.uk/forum/topic/16145/retropie-upgrading-raspbian-jessie-to-stretch

                    1 Reply Last reply Reply Quote 0
                    • B
                      BillyH
                      last edited by 9 Feb 2018, 09:09

                      @obsidianspider it's probably in the thread here somewhere but I can't seem to find it: have you linked the original power switch to a system shutdown, and if so, how?

                      Now that I have a Pi, I'm thinking about either murdering my old SNES or finding one to murder, and using it as a case for the Pi. If/When I do so, I may look closer to threads like these for inspiration.

                      • First Pi: Pi 3 in a PSone case
                      • Second Pi: Pi 0 in a Retroflag GPi Case
                      • Third Pi: Pi 4 as a desktop computer
                      • Some time in 2020: Picade
                      O 1 Reply Last reply 9 Feb 2018, 12:34 Reply Quote 0
                      • O
                        obsidianspider @BillyH
                        last edited by 9 Feb 2018, 12:34

                        @billyh Please don't break a known working SNES just for a Pi project. There are millions of ones that are inoperable.

                        I used a Mausberry tied to the stock SNES power switch.

                        📷 @obsidianspider

                        1 Reply Last reply Reply Quote 0
                        • O obsidianspider referenced this topic on 9 Sept 2022, 20:46
                        • First post
                          Last post

                        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.

                          This community forum collects and processes your personal information.
                          consent.not_received