How to add new emulator and make it default?

Home Forums RetroPie Project Everything else related to the RetroPie Project How to add new emulator and make it default?

RetroPie has a new website and forum. Please visit https://retropie.org.uk/ for the new site. The new forum is located at https://retropie.org.uk/forum/. This forum is left here as a read-only archive.

This topic contains 13 replies, has 4 voices, and was last updated by Profile photo of herbfargus herbfargus 1 year, 10 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #100293
    Profile photo of retrofan
    retrofan
    Participant

    Hello everyone,

    I use for some time Retropie v3.0 beta 3 and I would like to add new emulator for zx spectrum and make it default.
    Retropie comes with two built-in emulators fbzx and fuse (default), but for me the best emulator “Unreal Speccy Portable” is not present.
    I downloaded an emulator here https://bitbucket.org/djdron/unrealspeccyp/downloads/unreal-speccy-portable_0.0.64_rpi.zip

    unpacked and put together with the others in /opt/retropie/emulators/usp
    Then edited the emulator.cfg file in /opt/retropie/configs/zxspectrum adding a line usp=”/opt/retropie/emulator/usp/unreal_speccy_portable %ROM%” and set default =”usp”
    Unfortunately, the emulator is not working when I started a game, just came back in emulationstation menu.
    I also tried to make a script +Start USP.sh that will start the emulator manually from es menu (as uae4all for example) but this also failed, because obviously I’m not well-configured parameters.
    The only way to start the emulator is to press F4 and go to the terminal, then manually change the emulator directory and start it with ./unreal_speccy_portable

    Also, maybe I should set the es_systems.cfg file but did not know what.

    Can someone help me set this emulator as the default, or at least that it can start from emulationstation menu and be able to use it comfortably as other emulators.
    I exhausted my modest knowledge of retropie package and linux and I would like to solve this problem.
    Sorry for my bad english, best regards.

    Pi Model: 2B
    RetroPie Version Used: 3.0 Beta 3
    Built From: SD Image
    USB Devices connected: joypad, wireless keyboard
    Controller used: ps3 dualshock clone

    #100312
    Profile photo of herbfargus
    herbfargus
    Moderator

    I’m having the same problem here too- it seems to be an issue with emulationstation as it runs just fine from the command line. This is the runcommand error log I’m getting (i get the same error log if I don’t use runcommand as well):

    unreal_speccy_portable: ../../devices/memory.cpp:84: void eRom::LoadRom(int, const char*): Assertion f failed.
    /opt/retropie/supplementary/runcommand/runcommand.sh: line 684: 29913 Aborted                 /opt/retropie/emulators/usp/unreal_speccy_portable "/home/pi/RetroPie/roms/zxspectrum/Lunar Jetman (1983)(Ultimate).z80"

    And just in case you’re interested, this is the script I pieced together (its not very good but it at least installs it. I placed it in /home/pi/RetroPie-Setup/scriptmodules/emulators and just ran it from the experimental menu in the setup script)

    #!/usr/bin/env bash
    
    # This file is part of RetroPie.
    # 
    # (c) Copyright 2012-2015  Florian Müller (contact@petrockblock.com)
    # 
    # 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="usp"
    rp_module_desc="zxspectrum emulator unreal speccy portable"
    rp_module_menus="4+"
    
    function sources_usp() {
        wget https://bitbucket.org/djdron/unrealspeccyp/downloads/unreal-speccy-portable_0.0.64_rpi.zip    
        unzip unreal-speccy-portable_0.0.64_rpi.zip
        rm unreal-speccy-portable_0.0.64_rpi.zip
    }
    
    function build_usp() {
        make clean
        md_ret_require="$md_build"
    }
    
    function install_usp() {
        md_ret_files=(
        'usp_0.0.64/unreal_speccy_portable'
        'usp_0.0.64/res'
        'usp_0.0.64/readme.txt'
        )
    }
    
    function configure_usp() {
        mkRomDir "zxspectrum"
    
        addSystem 0 "$md_id" "zxspectrum" "$md_inst/unreal_speccy_portable %ROM%"
    }
    #100315
    Profile photo of herbfargus
    herbfargus
    Moderator

    in the meantime if you want a script that sets up a script that will open up into unreal_speccy_portable then this does work (might cause some framebuffer issues potentially- make backups first) You’ll install it in place of the aforementioned script through the experimental menu of the setup script.

    #!/usr/bin/env bash
    
    # This file is part of RetroPie.
    # 
    # (c) Copyright 2012-2015  Florian Müller (contact@petrockblock.com)
    # 
    # 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="usp"
    rp_module_desc="zxspectrum emulator unreal speccy portable"
    rp_module_menus="4+"
    
    function sources_usp() {
        wget https://bitbucket.org/djdron/unrealspeccyp/downloads/unreal-speccy-portable_0.0.64_rpi.zip    
        unzip unreal-speccy-portable_0.0.64_rpi.zip
        rm unreal-speccy-portable_0.0.64_rpi.zip
    }
    
    function build_usp() {
        make clean
        md_ret_require="$md_build"
    }
    
    function install_usp() {
        md_ret_files=(
        'usp_0.0.64/unreal_speccy_portable'
        'usp_0.0.64/res'
        'usp_0.0.64/readme.txt'
        )
    }
    
    function configure_usp() {
        mkRomoDir "zxspectrum"
    
     cat > "$romdir/zxspectrum/+Start.sh" << _EOF_
    #!/bin/bash
    pushd "/opt/retropie/emulators/usp"
    ./unreal_speccy_portable "usp"
    popd
    _EOF_
    
        chmod a+x "$romdir/zxspectrum/+Start.sh"
        chown $user:$user "$romdir/zxspectrum/+Start.sh"
    
        addSystem 0 "$md_id" "zxspectrum" "$romdir/zxspectrum/+Start.sh" "zxspectrum" ".sh"
    }
    • This reply was modified 1 year, 10 months ago by Profile photo of herbfargus herbfargus.
    #100348
    Profile photo of retrofan
    retrofan
    Participant

    Thank you very much for your quick reply.
    Unfortunatelly, it doesnt work for me. 🙁
    I follow your instructions, make usp.sh script, put in /home/pi/RetroPie-Setup/scriptmodules/emulators and run from experimental menu in the setup script.
    I only can see briefly on the bottom page, log start, log end message and whole process takes 4 seconds.
    There is nothing new in zxspectrum menu page, fuse is still default emulator, no new entries there, except my spectrum roms.
    Then, I switch to terminal and try to start this script from command line.
    I typed sh (or bash) usp.sh and he gives me these errors message:
    usp.sh: line 2: $’\r’: command not found
    usp.sh: line 10: $’\r’: command not found
    usp.sh: line 14: $’\r’: command not found
    usp.sh: line 15: $’\r’: syntax error
    ‘sp.sh: line 15: $’\r’: function sources_usp(){

    Tried both scripts with same results.
    I have no idea what I did wrong??

    #100360
    Profile photo of herbfargus
    herbfargus
    Moderator

    So I deleted everything I had installed and steo by step this is what I did:

    I created the second script and called it usp.sh and I added it here:
    /home/pi/RetroPie-Setup/scriptmodules/emulators

    I then went into the setup script an installed usp from the experimental menu

    I refreshed emulationstation by pressing F4

    the +Start.sh file showed up in the zxspectrum menu.

    upon selecting +Start.sh I pressed “m” and changed the default emulator to usp

    #100362
    Profile photo of windale
    windale
    Participant

    I’d also like to get this working. I made a usp.sh from your second script and put it in scriptmodules/emulators (same as Retrofan), but when running it from the experimental menu it doesn’t even download the progrram.

    #100363
    Profile photo of herbfargus
    herbfargus
    Moderator

    try running

    sudo chmod +x /home/pi/RetroPie-Setup/scriptmodules/emulators/usp.sh

    #100364
    Profile photo of retrofan
    retrofan
    Participant

    So I deleted everything I had installed and steo by step this is what I did:

    I created the second script and called it usp.sh and I added it here:
    /home/pi/RetroPie-Setup/scriptmodules/emulators

    I then went into the setup script an installed usp from the experimental menu

    I refreshed emulationstation by pressing F4

    the +Start.sh file showed up in the zxspectrum menu.

    upon selecting +Start.sh I pressed a key and changed the default emulator to usp

    I think I do everything the same, but script doesnt have installed anything, +Start.sh file doesnt appear in zxspectrum menu.
    Which version of retropie you use, I tried with 3.0 beta 3 and 3.0 beta 4, with the same result.
    I prepared a script in Windows 7 Notepad text editor, I hope it did not cause a problem.
    I check my internet connection and its good and active.

    I’d also like to get this working. I made a usp.sh from your second script and put it in scriptmodules/emulators (same as Retrofan), but when running it from the experimental menu it doesn’t even download the progrram.

    Same thing with me, after I run script there is no downloading or anything else, whole process finished instantly with two log message and retrurn to the script menu.

    #100365
    Profile photo of windale
    windale
    Participant

    try running

    sudo chmod +x /home/pi/RetroPie-Setup/scriptmodules/emulators/usp.sh

    I typed this into the console, then tried the experimental setup script again but nothing, it flashed at the bottom of the screen ‘started’ but immediately disappeared again, didn’t even download it.

    I also tried setting all permissions 777 and no luck.

    • This reply was modified 1 year, 10 months ago by Profile photo of windale windale.
    #100368
    Profile photo of herbfargus
    herbfargus
    Moderator

    That’s really weird. I’m using retropie 3 Beta 4. If you install it manually from the .zip file without my scripts are you able to open it through the command line? Cause if so I’ll try and install it manually and see if I can at least get a start script to work from emulationstation until I can come up with a better install script (I’m not as good as buzz with the whole scripting thing.)

    Just out of curiosity- what are the benefits of this emulator over the 3 we already have?

    Also just for reference, I created my script while logged in as root in winscp.

    #100413
    Profile photo of retrofan
    retrofan
    Participant

    USP allows perfect smooth scrolling and full synchronization with 50hz screen modes.
    Just change /boot/config.txt
    hdmi_group=1
    hdmi_mode=19 (for 720p) or 31 (for 1080p)

    Also usp use GPU hardware accelerated features, software streching, work in real full screen…

    btw, I finally make a working script, edit fbzx.sh script and make necessary changes according your second script, but keeping file format structure untouched.
    When I make a script from scratch in Notepad, it doesnt work, dont know why.

    Only one thing remains for full integration in emulationstation, how to automatically load the game after the usp starts?
    I tried earlier to add line usp=”/opt/retropie/emulators/usp/usp %ROM%” in emulators.cfg file, but this obviously not working.
    Author claims that usp can start a game from the command line, but I dont know how to acheive this in emulation station.

    Just one thing, can you explain to me this lines in your script

    ./unreal_speccy_portable “usp” (what “usp” means?)

    addSystem 0 “$md_id” “zxspectrum” “$romdir/zxspectrum/+Start.sh” “zxspectrum” “.sh” (whats “zxspectrum” “.sh” part do exactly?)

    • This reply was modified 1 year, 10 months ago by Profile photo of retrofan retrofan.
    #100438
    Profile photo of herbfargus
    herbfargus
    Moderator

    The “zxspectrum” “sh” adds the necessary parts to es_systems.cfg (namely .sh file extensions so the start up script shows up) as for the “usp” thing I’m not sure to be honest, I just did a find and replace from a different script and pieced it together until it seemed like it worked. Its obviously not the most efficient of scripts (I’m not very skilled when it comes to coding) I’ll open a ticket to have it added, and maybe someone with more skills than I could come up with something a little more effective.

    #100489
    Profile photo of baconfury
    baconfury
    Participant

    I’d personally love to install Stella back into my retropie, as the new lr-stella is making me crazy, and doesn’t dang work. See my other post for more on that joy. But, even when I exit emulation station, it boots back into emulation station. So…no option to use the get command.

    Anyone know a solution?

    #100737
    Profile photo of herbfargus
    herbfargus
    Moderator

    I had a thought- the reason that it isn’t working with notepad is that it doesn’t seem to handle certain text characters very well- try installing notepad++ and see if that makes a difference in creating scripts.

    As far as stella goes, you can type stella into the terminal and it will open stella or you can change your default emulator by pressing x or m as a rom loads and change it from libretro to stella. If you are are trying to exit emulationstation, if you press a button after you exit emulationstation it will allow you to go into the terminal. if you don’t press anything it will just reboot back into emulationstation.

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

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

Skip to toolbar