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

LowRes NX: Retroarch core installation instructions

Scheduled Pinned Locked Moved Ideas and Development
lowresnx
12 Posts 3 Posters 1.5k 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.
  • D
    dmmarti
    last edited by dmmarti 16 Jul 2021, 16:20

    LowRes NX is a virtual system (much like PICO-8) that Retroarch has a core for, but only for Windows PC.

    Here’s instructions on how to download and compile the core for use on RetroPie (Pi 4 image).

    UPDATE: New installer script method to replace older manual method

    1 - create new file for installation

    /home/pi/RetroPie-Setup/scriptmodules/libretrocores

    create a new file in that directory called:

    lr-lowresnx.sh

    Here are the contents of the file:

    #!/usr/bin/env bash
    
    # This file is part of The RetroPie Project
    #
    # The RetroPie Project is the legal property of its developers, whose names are
    # too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
    #
    # See the LICENSE.md file at the top-level directory of this distribution and
    # at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
    #
    
    rp_module_id="lr-lowresnx"
    rp_module_desc="LowRes NX emulator - port for libretro"
    rp_module_help="ROM Extensions: .nx .zip\n\nCopy your roms to $romdir/lowresnx\n\n"
    rp_module_repo="git https://github.com/timoinutilis/lowres-nx.git master"
    rp_module_section="exp"
    
    function sources_lr-lowresnx() {
        gitPullOrClone
    }
    
    function build_lr-lowresnx() {
        cd platform/LibRetro
        make
        md_ret_require="$md_build/platform/LibRetro/lowresnx_libretro.so"
    }
    
    function install_lr-lowresnx() {
        md_ret_files=(
            'platform/LibRetro/lowresnx_libretro.so'
        )
    }
    
    function configure_lr-lowresnx() {
        mkRomDir "lowresnx"
        ensureSystemretroconfig "lowresnx"
    
        addEmulator 1 "$md_id" "lowresnx" "$md_inst/lowresnx_libretro.so"
        addSystem "lowresnx" "LowRes NX" ".nx .zip "
    }
    

    2 - Install from source

    Once the script is there, in Emulation Station, run the RetroPie Setup script and navigate to the emulator installation menu and go into the Experimental section.

    You should see the new lr-lowresnx as an emulator to install.

    Click on it and then choose Install from source.

    That should then compile the core and create all of the needed backend changes (es_systems.cfg and roms directory are also updated and created).

    3 - Copy over some games

    Now copy some *.nx or *.zip games into the rom folder, reboot Emulation Station, and the system should be shown on the main menu to be able to launch and play.

    Copy them into the /home/pi/RetroPie/roms/lowresnx folder.

    This new method replaces the older manual way listed below.



    ======================================================
    ========OLD MANUAL METHOD - DO NOT USE ANYMORE=======
    ======================================================

    Due to how the Github repo is structured, I don’t know how to make an installer shell script for it so here are the manual steps I did to install the core.

    All commands were issued on the terminal screen on the Pi.

    Once all setup, the games are free to download from the main LowRes NX website.

    There are no BIOS files needed to use this core.


    1 - download Github repo and create new Libretro core file

    git clone https://github.com/timoinutilis/lowres-nx.git
    cd lowres-nx/platform/LibRetro
    make
    

    This will create the new Retroarch core file named: lowresnx_libretro.so

    2 - move new core file into proper location

    sudo mkdir /opt/retropie/libretrocores/lr-lowresnx
    sudo cp lowresnx_libretro.so /opt/retropie/libretrocores/lr-lowresnx/
    

    3 - create new emulator config folder

    mkdir /opt/retropie/configs/lowresnx
    

    4 - create new emulator.cfg and retroarch.cfg files

    Create new emulators.cfg file with these contents:

    nano /opt/retropie/configs/lowresnx/emulators.cfg
    
    lr-lowresnx = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-lowresnx/lowresnx_libretro.so --config /opt/retropie/configs/lowresnx/retroarch.cfg %ROM%"
    default = "lr-lowresnx"
    

    CTRL-S (to save the file)
    CTRL-X (save exit nano editor)

    Create new retroarch.cfg file with these contents:

    nano /opt/retropie/configs/lowresnx/retroarch.cfg
    
    # Settings made here will only override settings in the global retroarch.cfg if placed above the #include line
    
    input_remapping_directory = "/opt/retropie/configs/lowresnx/"
    
    #include "/opt/retropie/configs/all/retroarch.cfg"
    

    CTRL-S (to save the file)
    CTRL-X (save exit nano editor)

    5 - add new system to es_systems.cfg

    Depending on if you use a custom es_systems.cfg file or the default one in /etc/emulationstation ... add this new system into the file.

    new system to be added into the file

    <system>
      <name>lowresnx</name>
      <fullname>LowRes NX</fullname>
      <path>/home/pi/RetroPie/roms/lowresnx</path>
      <extension>.nx .NX .zip .ZIP</extension>
      <command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ lowresnx %ROM%</command>
      <platform>lowresnx</platform>
      <theme>lowresnx</theme>
    </system>
    

    6 - create new rom folder

    mkdir /home/pi/RetroPie/roms/lowresnx
    

    Now copy some *.nx or *.zip games into the rom folder, reboot Emulation Station, and the system should be shown on the main menu to be able to launch and play.

    Sorry for the long drawn out manual steps to install it. As I mentioned, I wasn't able to make an installer script for it due to the Github repo's structuring.

    Hopefully, someone like @Folly or @DTEAM may be able to make one?

    Hope you enjoy this unique system!

    F 2 Replies Last reply 17 Jul 2021, 07:13 Reply Quote 1
    • F
      Folly @dmmarti
      last edited by 17 Jul 2021, 07:13

      @dmmarti

      Next week we can take a look at it.
      I can take you through the necessary steps of making a module-script by yourself.

      1 Reply Last reply Reply Quote 0
      • F
        Folly @dmmarti
        last edited by Folly 19 Jul 2021, 13:22

        @dmmarti

        I will begin explaining how we can make a module-script
        Perhaps you know most things already.
        But I think it best to explain all.

        Before we begin, you have to know something about :
        1)- bash scripts
        2)- bash functions
        3)- variables
        4)- user rights
        5)- using the retropie_packages.sh script of Retropie-Setup

        1)- bash scripts

        When you do a command in the cli or the terminal you already are doing some bash without knowing.
        A bash script is just a text file containing one or multiple commands.
        This way we can do more without typing all the commands one by one in the cli.
        If we have made a script we can simply run it with :
        bash filename.sh

        By adding next on the first line of the script :
        #!/usr/bin/env bash
        or this :
        #!/bin/bash
        And by making the script executable with this :
        chmod +x filename.sh
        Then the computer knows it's a bash script and we just run the script like a regular executable, with :
        ./filename.sh

        For making a module-script for Retropie-Setup it's not needed to know how you execute a script as this is done by the scripts of Retropie-Setup.
        And a module-script doesn't do anything if executed as a standalone script, it depends on the RetroPie-Setup.

        2)- bash functions

        Perhaps you already looked into a module-script before.
        Well, I know from experience, at the beginning it doesn't look understandable.
        You have to know what "bash functions" are.
        On this page it's explained very well :
        https://www.digitalocean.com/community/tutorials/an-introduction-to-useful-bash-aliases-and-functions
        So now we know a "bash function" is specific library function that runs within a script when it is called upon.

        Retropie-Setup basically has functions of it's own and collects more functions from the module-scripts and this way we can use the functions in our module-script like gitPullOrClone to get the source of an emulator.
        In itself a module-script has also functions for :

        • getting dependencies with depends function
        • getting sources with sources function
        • building the emulator with build function
        • installing the emulator in the appropriate location with install function
        • adding the emulator to the configs with the configure function

        3)- variables

        Variables can be used in bash.
        Here is a basic example:

        pi@raspberrypi:~ $ var=ok
        pi@raspberrypi:~ $ echo $var
        ok
        

        It will print the value of the variable.

        In Retropie-Setup there are also variables like for the :

        • build directory $md_build
        • install directory $md_id
        • normal user $user
        • etc

        Variables are also used for adding additional info when running a function or a script.
        For example if you run a script with an option like this :
        ./filename.sh hello
        hello becomes variable $1.
        Now we can use this variable in our script.
        For example we could add this line in the script :
        echo $1
        The script would then output :
        hello
        Options can also be used with functions, that way we can pass information from one function to another.

        4)- user rights

        Difficult topic if you have never used it.
        But it's much simpler once you understand.

        We are running the Retropie-Setup scripts always with sudo.
        There is a reason for that as we have to put some files in administrator/root locations.
        If we didn't use sudo then we are the "user pi" and we could not save in particular "user root" directories.
        Using root has also a dissadvantage.
        If we want to do make or move a config file as a command in the module-script. This means that "user root" is the owner of the file.
        When we run a game as "user pi" we want to write to this config file.
        So we have to make sure that the config file has "user pi" ownership.
        An example of making pi the owner is ( $user=pi is already set in Retroie-Setup ) :
        chown $user:$user "$romdir/mame/mame.ini"

        5)- using the retropie_packages.sh script of Retropie-Setup

        If we are making a module-script we want to test or execute the functions seperately so we can make the functions one by one.
        For example we want to get the sources of the module-script lr-81.
        With retropie_packages.sh we can do that like this :
        cd RetroPie-Setup
        sudo ./retropie_packages.sh lr-81 sources

        Now you will see that the files from github will be downloaded to :
        /home/pi/RetroPie-Setup/tmp/build

        When making a new module-script you can basically begin with a similar module-script.
        Copy this one to a new name and begin to edit.
        For example if you use the lr-81 then change lr-81 into, for example, lowres-nx.
        Add the github link into the variable rp_module_repo.
        Then the sources function for your lowres-nx could look like this :

        function sources_lowres-nx() {
            gitPullOrClone
        }
        

        Etc.

        end

        I hope you understand the basics with this explanation.
        We can discuss it on the way.

        D 1 Reply Last reply 29 Jul 2021, 12:32 Reply Quote 0
        • D
          dmmarti @Folly
          last edited by 29 Jul 2021, 12:32

          @folly Thanks.

          The part that was throwing me off in making the installer script, was the make file wasn't in the root folder of the Github repo.

          Looking at a few other existing scripts, I finally figured out what I needed to do in the function:

          function build_lr-lowresnx()

          I had to add in the proper "cd" command to where the make file existed.

          All good now!

          I've updated the first post with the new RetroPie installer script method.

          F 2 Replies Last reply 29 Jul 2021, 14:25 Reply Quote 0
          • F
            Folly @dmmarti
            last edited by Folly 29 Jul 2021, 14:25

            @dmmarti

            Aha, nice to know you have found a way to make it.
            Great job !

            When I have some time for it then I will test the module-script.

            There seem to be a lot of open source games.
            Perhaps we can even share them here.

            Btw.
            Was my explanation understandable and did it help ?

            1 Reply Last reply Reply Quote 0
            • F
              Folly @dmmarti
              last edited by 29 Jul 2021, 15:33

              @dmmarti

              Installed your script.
              It's working !

              I will add in the repository. link

              SPACE ZAP :
              2021-07-29-172756_800x600_scrot-resized.png 2021-07-29-172853_800x600_scrot-resized.png

              D 1 Reply Last reply 29 Jul 2021, 15:39 Reply Quote 0
              • D
                dmmarti @Folly
                last edited by 29 Jul 2021, 15:39

                @folly Awesome! thanks

                Here's the PICO-8 one if you wanna test it and possibly add it too.

                https://retropie.org.uk/forum/topic/30965/pico-8-retroarch-lr-retro8-core-installation-script

                F BuZzB 2 Replies Last reply 30 Jul 2021, 20:08 Reply Quote 0
                • F
                  Folly @dmmarti
                  last edited by 30 Jul 2021, 20:08

                  @dmmarti

                  Just did one for lowres-nx.
                  Do you like it ?

                  2021-07-30-220400_1600x900_scrot-resized.png

                  1 Reply Last reply Reply Quote 0
                  • BuZzB
                    BuZz administrators @dmmarti
                    last edited by BuZz 8 Apr 2021, 02:11 4 Aug 2021, 01:10

                    @dmmarti Scriptmodule looks good. I'd like to include this in RetroPie along with a pico-8 module. I've not checked yours but happy for you to submit a PR, but also happy to incorporate myself.

                    I would probably prefer the module name to be lr-lowres-nx but looks good.

                    To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                    D F 2 Replies Last reply 4 Aug 2021, 11:09 Reply Quote 2
                    • D
                      dmmarti @BuZz
                      last edited by 4 Aug 2021, 11:09

                      @buzz ....awesome!

                      I think I'd prefer you to do it. In this case, I hard-coded the information within the script modules that are normally within the "platforms.cfg" file.

                      I think it would be best if you do it since you would probably update the platforms file and make the proper adjustments within the script modules along with the names you'd prefer to use for lowres-nx and pico-8 systems.

                      F 1 Reply Last reply 4 Aug 2021, 12:48 Reply Quote 1
                      • F
                        Folly @BuZz
                        last edited by Folly 8 Apr 2021, 13:50 4 Aug 2021, 12:47

                        @buzz

                        Great to hear that you want to add these ;-)

                        Can you let me know when you add these ?
                        Then I will remove them from my repository, as they are no longer needed there.

                        1 Reply Last reply Reply Quote 0
                        • F
                          Folly @dmmarti
                          last edited by 4 Aug 2021, 12:48

                          @dmmarti

                          I found that some games require touch or mouse.
                          I have experimented, but I didn't find a solution.
                          Can you have a look ?

                          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.

                            [[user:consent.lead]]
                            [[user:consent.not_received]]