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

    (GUIDE) How to add Ocarina of Time PC Port to Retropie (Pi5 64bit)

    Scheduled Pinned Locked Moved Ideas and Development
    zeldapi5ocarina
    15 Posts 6 Posters 4.4k 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.
    • retropieuser555R
      retropieuser555
      last edited by retropieuser555

      This guide will show you how to add Ship of Harkinian (https://www.shipofharkinian.com) to RetroPie. I've tested this on Raspberry Pi OS using a Pi 5. I can't confirm if it will work on a Pi 4 (either 32bit or 64bit build)

      To avoid running out of memory, increase the memory swap (it's likely this is not needed on a 8GB Pi 5):-

      sudo dphys-swapfile swapoff
      
      sudo nano /etc/dphys-swapfile
      

      Edit the below line, I used CONF_SWAPSIZE=1024

      CONF_SWAPSIZE=100
      

      Finally restart the swapfile so programs recognise the change

      sudo dphys-swapfile setup
      sudo dphys-swapfile swapon
      

      Note:- for peace of mine I would reverse this process after building as it will damage your SD card in the long run

      Step Two:-

      Now you can follow the steps in the Shipwright GitHub:-

      git clone https://github.com/HarbourMasters/Shipwright.git
      cd Shipwright
      
      git submodule update --init
      
      

      Copy your Ocarina .z64 (vanilla or master quest or both) roms into ORTExporter folder. There's certain roms it needs, Google is your friend, Ship of Harkinian's website also has a web app that checks if your rom is valid.

      Install the dependancies:-

      sudo apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev
      

      Now we can start building:-

      cmake -H. -Bbuild-cmake -GNinja
      
      cmake --build build-cmake --target ExtractAssets
      
      cmake --build build-cmake
      

      You should end up with some file inside Shipwright/build-cmake/soh:-

      soh.elf
      soh.otr
      oot.otr

      Copy these over to /opt/retropie/ports/soh

      Inside /opt/retropie/ports/soh create a file soh.sh (make it executable as well)

      #!/bin/bash
      
      # Change directory
      cd /opt/retropie/ports/soh || exit
      
      # Run the soh.elf file
      ./soh.elf
      

      Create a folder soh inside /opt/retropie/configs/ports and add emulators.cfg:-

      soh = "/opt/retropie/ports/soh/soh.sh"
      default = "soh"
      

      Finally create another .sh file inside your roms/ports folder and make that executable:-

      #!/bin/bash
      "/opt/retropie/supplementary/runcommand/runcommand.sh" 0 _PORT_ "soh" ""
      
      

      Edit: added @roslof 's step here to change ownership from root to pi group:-

      sudo chown -R pi:pi /opt/retropie/ports/soh
      

      To use Mods, inside /opt/retropie/ports/soh create a folder called mods and put the mod .otr files inside there

      Pi 5 4GB

      Retroflag GPI with raspberry pi zero 2 w/ wifi

      Retroachievements:- lovelessrapture

      roslofR 1 Reply Last reply Reply Quote 4
      • retropieuser555R retropieuser555 referenced this topic on
      • roslofR
        roslof @retropieuser555
        last edited by roslof

        Enjoying this very much. Similar to the Mario 64 PC project. Thanks for providing the detailed steps!

        @retropieuser555 said in (GUIDE) How to add Ocarina of Time PC Port to Retropie (Pi5 64bit):

        Edit the below line, I used CONF_SWAPSIZE=1024

        FWIW with this value, I still ran out of memory. With a large enough drive, would recommend boosting to 2048 to be safe.

        Would also remove the -- -j4 at the end of each command-line for Bookworm.

        Lastly, for things to work with the .sh files provided, note that the /opt/retropie/ports/soh folder should be pi:pi

        sudo chown -R pi:pi /opt/retropie/ports/soh
        

        Hope this helps.
        -ros

        1 Reply Last reply Reply Quote 1
        • D
          Deityfierezy
          last edited by

          So, I followed everything as said in here, the port opens and works just fine on raspbian, but when i try to run it trough retropie it just sends me back to the ports menu.

          retropieuser555R 1 Reply Last reply Reply Quote 0
          • retropieuser555R
            retropieuser555 @Deityfierezy
            last edited by

            @Deityfierezy So there might be some kind of error in the master branch, I re-tried it now with an earlier branch it worked out for me.

            Maybe try this and see if it works for you:-

            git clone https://github.com/HarbourMasters/Shipwright.git
            cd Shipwright
            
            git checkout 8.0.4 
            
            git submodule update --init
             
            

            Pi 5 4GB

            Retroflag GPI with raspberry pi zero 2 w/ wifi

            Retroachievements:- lovelessrapture

            1 Reply Last reply Reply Quote 1
            • retropieuser555R
              retropieuser555
              last edited by retropieuser555

              Also I have been testing out their Majora's mask Port and it also works. Same steps and dependencies as for Ocarina but after those then run this:-

              git clone https://github.com/HarbourMasters/2ship2harkinian
              cd 2ship2harkinian
              git submodule update --init
              

              Copy your Majora's mask .z64 rom into ORTExporter directory then run these:-

              cmake -H. -Bbuild-cmake -GNinja
              cmake --build build-cmake --target ExtractAssets
              cmake --build build-cmake
              
              

              As before copy the 2s2h.elf, 2ship.o2r & mm.o2r into /opt/retropie/ports/2s2h and create an .sh file that points towards it and the similar steps as before.

              Only done a quick run around as the deku doing the first cycle but it seems to play pretty well

              Majora's mask

              Pi 5 4GB

              Retroflag GPI with raspberry pi zero 2 w/ wifi

              Retroachievements:- lovelessrapture

              1 Reply Last reply Reply Quote 1
              • N
                nioh8
                last edited by

                hey thanks for this, got it up and running on my pi5 with pi os, runs well. a bit off topic but this is the only relevant post i can find, is it possible to build the perfect dark PC port for the raspberry pi 5? i don't have the best knowledge with this stuff, was wondering if anyone has done it, thanks.

                ExarKunIvE 1 Reply Last reply Reply Quote 0
                • ExarKunIvE
                  ExarKunIv @nioh8
                  last edited by

                  @nioh8 maybe
                  there is a Perfect Dark Decompilation on github, so there is a possibility that it could work.

                  RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                  RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                  Maintainer of RetroPie-Extra .

                  N 1 Reply Last reply Reply Quote 0
                  • N
                    nioh8 @ExarKunIv
                    last edited by

                    @ExarKunIv yea there’s a full fledged pc port here

                    https://github.com/fgsfdsfgs/perfect_dark

                    But I’m not well versed in compiling so was looking for some direction in how to build it

                    ExarKunIvE 1 Reply Last reply Reply Quote 0
                    • ExarKunIvE
                      ExarKunIv @nioh8
                      last edited by

                      @nioh8 im someone can figure it out.
                      if i have time i can maybe mess with it. im trying to get the script for Ocarina of Time to work.
                      being a real bugger

                      RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                      RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                      Maintainer of RetroPie-Extra .

                      1 Reply Last reply Reply Quote 0
                      • ExarKunIvE
                        ExarKunIv
                        last edited by

                        @mitu i hate to tag you. but im out of ideas.

                        @retropieuser555 and I are trying to get a script working for the port above. and im seeing something i have not seen before.

                        here is the script
                        from what i can tell it is good and for the most part it works fine, but the thing is. it takes like 6 hours if it finishes

                        but if you run the command above it will take like 30 min. (i timed it)

                        what could be causing this issue. is there something in the background that RetroPie doing that would slow this down.
                        im very lost here

                        RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                        RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                        Maintainer of RetroPie-Extra .

                        mituM 1 Reply Last reply Reply Quote 0
                        • mituM
                          mitu Global Moderator @ExarKunIv
                          last edited by mitu

                          @ExarKunIv said in (GUIDE) How to add Ocarina of Time PC Port to Retropie (Pi5 64bit):

                          here is the script
                          from what i can tell it is good and for the most part it works fine, but the thing is. it takes like 6 hours if it finishes

                          but if you run the command above it will take like 30 min. (i timed it)

                          Pure guesswork, but running it from the script sets MAKEFLAGS to increase parallelism during build, which requires a great amount of RAM due to multiple threads compiling at the same time. The RAM requirement is so great, that it hits the SWAP, which is going to massively slowdown the compilation.

                          Running the commands by hand will use a single thread/CPU for compiling, lowering the RAM requirements and thus finishing sooner.

                          Btw, RetroPie already has a swap adding/removing function in helpers, there no need to invent another one.

                          EDIT: forgot to add. Modify the build function and unset MAKEFLAGS or set it to -j1, before the cmake commands are executed. See if that changes anything.

                          ExarKunIvE 2 Replies Last reply Reply Quote 0
                          • ExarKunIvE
                            ExarKunIv @mitu
                            last edited by

                            @mitu as always thank you for that insight. i will make the changes and see what happens

                            RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                            RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                            Maintainer of RetroPie-Extra .

                            1 Reply Last reply Reply Quote 0
                            • ExarKunIvE
                              ExarKunIv @mitu
                              last edited by

                              @mitu so adding the -j1 did the trick
                              j1 was slow so i changed the number, but its working

                              i just need a little help with the function rpSwap() i dont know how to set that up correctly

                              or is there a current script that already uses this that i can look at

                              RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                              RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                              Maintainer of RetroPie-Extra .

                              mituM 1 Reply Last reply Reply Quote 0
                              • mituM
                                mitu Global Moderator @ExarKunIv
                                last edited by

                                @ExarKunIv said in (GUIDE) How to add Ocarina of Time PC Port to Retropie (Pi5 64bit):

                                i just need a little help with the function rpSwap() i dont know how to set that up correctly

                                openmsx and mame use that function. The only parameter is the amount of Mb you need, which the function allocates taking into account the existing RAM.

                                ExarKunIvE 1 Reply Last reply Reply Quote 1
                                • ExarKunIvE
                                  ExarKunIv @mitu
                                  last edited by

                                  @mitu thank you. thats a big help

                                  RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                                  RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                                  Maintainer of RetroPie-Extra .

                                  1 Reply Last reply Reply Quote 0
                                  • 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.