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

    [dev] Little favorite launcher (third attempt - ready for testers!) v.055! - last release I am finished

    Scheduled Pinned Locked Moved Ideas and Development
    favoritesfavouriteslaunch menu
    20 Posts 5 Posters 5.6k 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.
    • cyperghostC
      cyperghost
      last edited by cyperghost

      It is easily possible to implent this to gameslist.xml
      It took me nearly 2 hours to write this small code ... My editor is nano and it's a pain to code via SSH shell. This binary was compiled on a raspberry 3 but with arm6 build of basic. It may run also on rapsberry 1/0.

      Future plans:

      • Not to call FAV files via bash :) That's just quick'n'dirty coding but it's enough for a how-to release
      • Delete created FAV
      • Make filename look more beautifull with system - ROMname
      • Remove ucase function - AWFUL look

      Please give me feedback

      1 Reply Last reply Reply Quote 0
      • cyperghostC
        cyperghost
        last edited by cyperghost

        ' Favourite creater 0.55
        ' 06/13/17 cyperghost
        ' greetings to vika, meleu, cott, buzz, seklth
        ' this is just a small test
        ' wait for more
        ' 
        ' Added:
        ' Nicer looking favnames (SYSTEM - romname)
        ' launch abilitiy close to runcommand.sh
        ' Favnames or now lowercase
        ' FAVs can called by bash if there is no description available (rename .sh files from ports to .fav and copy them to Favouirite folder)
        
        dim as string path_fav,rom_fav, system_fav, rom_name, rom_favname, runcommand, sysbash
        dim as integer idx, z
        
        'print "ROOT DIR: ";command(0)
        'print "FAV PATH: ";command(1)
        'print "ROM PATH: ";command(2)
        'print "ROM SYST: ";command(3)
        'print "SYS CALL: ";command(4)
        
        
        select case ucase(right(command(1),4))
        case ".FAV" 'Act as launcher for FAV files
        rom_favname=command(1)
        
        open rom_favname for input as #1
        line input #1,rom_name
        line input #1,system_fav
        line input #1,sysbash
        close #1
        
        
        for z=1 to len(rom_favname)
        if mid(rom_favname,z,1)="/" then idx=z
        next z
        path_fav=left(rom_favname,idx)
        
        open path_fav+"runcommand_systems.txt" for input as #1
        do
        line input #1,runcommand
        loop until eof(1) or InStr(runcommand,system_fav)<>0
        close #1
        
        If InStr(runcommand,system_fav)=0 and sysbash<>"" then shell chr(34)+sysbash+chr$(34):end
        If InStr(runcommand,system_fav)=0 then shell "bash "+chr(34)+rom_favname+chr(34):end
        
        
        sysbash=mid(runcommand,1,InStr(runcommand, "%ROM%")-1)+chr(34)+rom_name+chr(34)+Mid(runcommand,InStr(runcommand, "%ROM%")+Len("%ROM%"),Len(runcommand))
        shell sysbash
        
        case else 'create fav-files
        path_fav=command(1)
        rom_fav=command(2)
        system_fav=command(3)
        sysbash=command(4)
        
        for z=1 to len(rom_fav)
        if mid(rom_fav,z,1)="/" then idx=z
        next z
        
        rom_name=mid(rom_fav,idx+1,len(rom_fav))
        
        for z=1 to len(rom_name)
        if mid(rom_name,z,1)="." then idx=z
        next z
        
        rom_favname=ucase(system_fav)+" - "+left(rom_name,idx-1)+".fav"
        
        ' Build FAV file
        open path_fav+rom_favname for output as #1
        print #1, rom_fav
        print #1, system_fav
        print #1, sysbash
        close #1
        
        end select
        
        1 Reply Last reply Reply Quote 0
        • A
          ainmosni
          last edited by ainmosni

          Good idea, I might try it out if I have some time. Just some random comments:

          • Why not just create a repo on github or gitlab or better yet, fork the RetroPie repo.
          • Nano is a horrible code editor, vim is better but has a huge learning wall. (Worth it) Maybe try something like sublime or vs code? Both have bash support and will make writing scripts like this much easier. Vim and emacs are the only decent code editors that will run in a terminal though but both are not particular beginner-friendly.

          For the rest, great work and happy to look where this is going.

          cyperghostC 1 Reply Last reply Reply Quote 1
          • cyperghostC
            cyperghost @ainmosni
            last edited by cyperghost

            @ainmosni I hope that a more talented forum member will take this as a push to include a favourite system into ES. I think the idea to "launch" description files is much more versatile than using the gamelists

            Repro? Fork? No...

            S 1 Reply Last reply Reply Quote 0
            • S
              Syhles @cyperghost
              last edited by

              @cyperghost
              I would try and get ahold of @jdrassa @pjft or @Zigurana

              See if they could help with this.

              1 Reply Last reply Reply Quote 1
              • pjftP
                pjft
                last edited by

                Hey.

                Yes, "Favorites" is certainly something that @Zigurana is/was working on, so I'm leaving it with him. He already implemented it on his Kids fork, so it's just a matter of bringing it over.

                I am currently working on systems that contain games from several ones - namely a system to show all games in a single list, the games you last played, and - yes - your favorite games in a single list. You've probably seen my not-so-subtle requests on the Comic Book theme thread for themes for those systems. :)

                That last one, however, depends on favorites being a thing, so we'll wait. But it is - and it has been - on our horizon, certainly. :)

                By all means, do keep going though. As long as you're having fun and learning, you should not be dissuaded from doing these things, and you can definitely benefit from the experience with working on something new with the community.

                Better to have something working now, than a promise of something working in 3-6 months :)

                cyperghostC 1 Reply Last reply Reply Quote 3
                • cyperghostC
                  cyperghost @pjft
                  last edited by cyperghost

                  @pjft I will further develop this piece of software. In the next days I will made a "tribute to runcommand" version which uses the same launch parameters as runcommand uses. Just to give compatibality!

                  I think at least the version you @pjft and @Zigurana are working should be developed and forked to to final version to ES. I also hope that this version will give some entrypoints for other developers that are not "Knee-Deep" in coding (like me). Maybe a program call via button pressing are whatever. That's a kind of thing in miss in RECALBOX and I really appreciate on the runcommand.sh by @BuZz . He offers lots of accesspoints to system near functions and standarizised the call of roms via "SYS emusystem"-call. That really helps a lot

                  1 Reply Last reply Reply Quote 1
                  • cyperghostC
                    cyperghost
                    last edited by cyperghost

                    pushed code to v0.55 now - my work is done!
                    Source code ist in posting #3, feel free to use'n'compile

                    Changes

                    • FAV files are called via runcommand now (better for individual rom settings or individual launching screens)
                    • Filename for favs look more beautifull with 'SYSTEM' - ROMname naming
                    • Take use of runcommand_systems.txt these are the same runcommands as found in es_system.cfg (read point 1)
                    • lvl-create acts as FAV creater and as FAV launcher the function will be declared via command(1)
                    • if system is not available in list (nes, megadrive...) then try to launch the commandlineparameter that runcommand usually uses for that rom
                    • if that is also a failure than try to lauch fav file via bash call
                    • for interested people... basic is a very good language for manipulating file strings take this as example
                    • I can't delete FAV files that easy. I could make a flip flop if I can create it like "If fav file can be found then delete it else create fav file" - That's stupid!

                    Config es_systems.cfg

                    Add new system like done in the code box and use lfl-createas launcher for ROM files:

                      <system>
                        <name>favorites</name>
                        <fullname>Favorites</fullname>
                        <path>/home/pi/RetroPie/roms/fav123456789012345</path>
                        <extension>.fav .FAV</extension>
                        <command>/opt/retropie/supplementary/runcommand/lfl-create %ROM%</command>
                        <platform>all</platform>
                        <theme>favorites</theme>
                      </system>
                    

                    Please contribute if you use this software
                    it is tended as free but please respect the work of others

                    IDE was nano :D
                    So the code looks a bit messy :D

                    Content of created FAV file GAMEGEAR - Addams Family, The (U) [!].fav

                    /home/pi/RetroPie/roms/gamegear/Addams Family, The (U) [!].gg
                    gamegear
                    /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-genesis-plus-gx/genesis_plus_gx_libretro.so --config /opt/retropie/configs/gamegear/retroarch.cfg "/home/pi/RetroPie/roms/gamegear/Addams Family, The (U) [!].gg"
                    

                    Content of runcommand_systems.txt that has to be located into FAV-folder

                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ amstradcpc %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ arcade %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ atari2600 %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ atari7800 %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ atarilynx %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ fba %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ fds %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ gamegear %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ gb %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ gba %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ gbc %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ mame-libretro %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ mame-mame4all %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ mastersystem %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ megadrive %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ msx %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ n64 %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ neogeo %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ nes %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ ngp %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ ngpc %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ pcengine %ROM%
                    bash %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ psp %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ psx %ROM%
                    sudo /home/pi/RetroPie-Setup/retropie_packages.sh retropiemenu launch %ROM% &lt;/dev/tty &gt;/dev/tty
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ sega32x %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ segacd %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ sg-1000 %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ snes %ROM%
                    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ vectrex %ROM%
                    bash %ROM%
                    
                    pjftP 1 Reply Last reply Reply Quote 2
                    • pjftP
                      pjft @cyperghost
                      last edited by

                      @cyperghost My, you really like to suffer, editing all this in nano :) I'm sure you'd even have emacs, if you do want to do everything on the Pi!

                      You might be better off coding on your computer and copying the files to the pi for compilation, though.

                      cyperghostC 1 Reply Last reply Reply Quote 0
                      • cyperghostC
                        cyperghost @pjft
                        last edited by

                        @pjft Most of the work was done in nano.
                        Of course I made some file testing like this sysbash=mid(runcommand,1,InStr(runcommand, "%ROM%")-1)+chr(34)+rom_name+chr(34)+Mid(runcommand,InStr(runcommand, "%ROM%")+Len("%ROM%"),Len(runcommand)) on a windows mashine but inserting was done via nano!

                        So the code locks messy but it is structered via case select for

                        1. Acting as creator for FAV files
                        2. Acting as lauchner for FAV files

                        Is there a need for the binary?

                        1 Reply Last reply Reply Quote 0
                        • meleuM
                          meleu
                          last edited by

                          @cyperghost hello mate! I was bothering BuZz to implement a feature in runcommand that I think would help you here. Such feature is now part of RetroPie-Setup.

                          I think you can use your method described in the OP without messing the "official" runcommand, just place your script at /opt/retropie/configs/all/runcommand-menu/.

                          See the conversation here to get details. I'll try to update the runcommand wiki accordingly soon.

                          • Useful topics
                          • joystick-selection tool
                          • rpie-art tool
                          • achievements I made
                          pjftP cyperghostC 2 Replies Last reply Reply Quote 3
                          • pjftP
                            pjft @meleu
                            last edited by

                            @meleu Well done good sir. Thanks for helping move the community's initiatives forward!

                            1 Reply Last reply Reply Quote 1
                            • cyperghostC
                              cyperghost @meleu
                              last edited by cyperghost

                              @meleu Sorry my friend that does not work!
                              I can't create a FAV on every time I run a ROM.
                              I need an exact entrypoint if I want to change some settings and this entry point can only be the runcommand.sh in it's selection mode. I developed this software a bit more on to version 0.65, it now deltetes created fav by toggle check fileexistance....

                              I fully understand buzz because the runcommand is his baby - and I just implanted an alien egg in. I think it's okay for personal purpose and for a few freaks but I have the deep hope that someone creates sometimes a better system.

                              Personally this laucher is very cool, because you can edit FAV files and can easily change emumashine call. I created yesterday CPS1 und CPS2 systems. Almost all CPS1 run in mame-libretro almost all CPS2 run in FBA.

                              But one or two romes of CPS1 do only run in FBA... But I have no further game selection out of ES because the CPS1 system is marked as mame-libretro. So you pick out that little coconut via FAV menu and just toggle from mame to fba by editing FAV file second line :)

                              meleuM 1 Reply Last reply Reply Quote 0
                              • meleuM
                                meleu @cyperghost
                                last edited by

                                @cyperghost said in [dev] Little favorite launcher (third attempt - ready for testers!) v.055! - last release I am finished:

                                @meleu Sorry my friend that does not work!
                                I can't create a FAV on every time I run a ROM.
                                I need an exact entrypoint if I want to change some settings and this entry point can only be the runcommand.sh in it's selection mode.

                                I think you misunderstood what that PR really is. It's a way to launch a user script during runcommand only if user invoke runcommand menu and choose the option to launch the script. IMHO your method to create those .fav files fits perfectly in this feature.

                                Sorry if I'm not being very clear, I'll try to describe it better when I update the the wiki. ;-)

                                • Useful topics
                                • joystick-selection tool
                                • rpie-art tool
                                • achievements I made
                                cyperghostC 1 Reply Last reply Reply Quote 1
                                • cyperghostC
                                  cyperghost
                                  last edited by

                                  Ah understand....
                                  Yes that should work....
                                  Am I able to select specific binaries/bash schript? Or does they run all if they are called?

                                  cyperghostC 1 Reply Last reply Reply Quote 0
                                  • cyperghostC
                                    cyperghost @cyperghost
                                    last edited by

                                    @meleu Wonderfull! That's really a hit! Works like a charm. Now I can add two options....
                                    Add Favourites and Delete Favourites!

                                    1 Reply Last reply Reply Quote 1
                                    • cyperghostC
                                      cyperghost @meleu
                                      last edited by

                                      @meleu even the EXIT codes work as they should... nice work!

                                      meleuM 1 Reply Last reply Reply Quote 0
                                      • meleuM
                                        meleu @cyperghost
                                        last edited by

                                        @cyperghost BuZz is a genius! :-)

                                        • Useful topics
                                        • joystick-selection tool
                                        • rpie-art tool
                                        • achievements I made
                                        1 Reply Last reply Reply Quote 1
                                        • cyperghostC
                                          cyperghost
                                          last edited by

                                          @meleu I've bumped the fav-launcher to v0.85 now
                                          Maybe you can give it a chance. With the User Menu it is now possible to add more than one FAV-system

                                          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.