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

    Development of module-script generator for lr-mess and mame standalone

    Ideas and Development
    development lr-mess mame modules script
    17
    1152
    30971
    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.
    • Folly
      Folly @DTEAM last edited by Folly

      @dteam

      I think we overlooked another issue.
      With the mame basename option for, for example tigerh, it adds the systemname tigerh to the runcommand which doesn't work obviously.
      It looked like this (not OK) :
      mame-basename = "/opt/retropie/emulators/mame/mame -v -c tigerh %BASENAME%"

      I have fixed this now over here. (not on github yet as I have to do more)
      So systems with media get the system-name before the %BASENAME% and systems that don't have "media" the system name isn't added.

      Examples for tigerh and apfm1000 as they should be (see the difference) :
      tigerh:
      mame-basename = "/opt/retropie/emulators/mame/mame -v -c %BASENAME%"
      apfm1000:
      mame-basename = "/opt/retropie/emulators/mame/mame -v -c apfm1000 %BASENAME%"

      With the last line I tried apfm1000 again, adding the rompath to the mame.ini.
      Now it works ;-)

      I asked myself the question why didn't it work with the line described in post 748.
      Well, I think, when we add a rompath in the runcommand line the rompaths in the mame.ini are overruled so then it uses only the rompath that is added to the runcommand line.
      Adding more rompaths to a runcommand line isn't possible I think.
      So for lr-mess getting a solution for the same problem will be more difficult.

      So now I have to figure out how I can append the rompaths in the mame.ini automatically.

      To be continued ......

      DTEAM 1 Reply Last reply Reply Quote 0
      • DTEAM
        DTEAM @Folly last edited by DTEAM

        @folly
        I agree , on my side, i'm using something like that for Handheld

        mame-autoframeskip = "/opt/retropie/emulators/mame/mame -autoframeskip %BASENAME%"
        

        For "real" system

        mame-basename = "/opt/retropie/emulators/mame/mame -v -c jaguar %BASENAME%"
        

        I didn't mention that before. Good call!!! We already talked about that a long time ago ;-)
        https://retropie.org.uk/forum/topic/28462/tutorial-handheld-and-plug-play-systems-with-mame/22
        https://retropie.org.uk/forum/topic/29682/development-of-module-script-generator-for-lr-mess-and-mame-standalone/15?_=1638892175522

        Folly 3 Replies Last reply Reply Quote 0
        • Folly
          Folly @DTEAM last edited by

          @dteam

          Indeed we somewhat talked about that, seems we didn't realize back then.

          Of-course, If I add a line with framekip or autoframeskip, the idea is the same.

          1 Reply Last reply Reply Quote 0
          • Folly
            Folly @DTEAM last edited by Folly

            @dteam

            Seems I just found a way to add multiple rompaths to a command, by backslash escaping \;( good to know) .
            Works :

            /opt/retropie/emulators/mame/mame -v -c  -rompath /home/pi/RetroPie/roms/apfm1000\;/home/pi/RetroPie/BIOS/mame apfm1000 "spacedst"
            

            Doesn't work :

            /opt/retropie/emulators/mame/mame -v -c  -rompath /home/pi/RetroPie/roms/apfm1000;/home/pi/RetroPie/BIOS/mame apfm1000 "spacedst"
            

            Doesn't work (altough /home/pi/RetroPie/BIOS/mame apfm1000 is in mame.ini) :

            /opt/retropie/emulators/mame/mame -v -c  -rompath /home/pi/RetroPie/roms/apfm1000 "spacedst"
            
            1 Reply Last reply Reply Quote 1
            • Folly
              Folly @DTEAM last edited by Folly

              @dteam

              I did some investigation on how the rompaths are added in the module-script for mame.
              It's added in a plain way, so I can't use that method, because we have to append.

              I think it's simpler to just add both rompaths in the runcommand line.
              Benefit will be that the mame.ini doesn't get overflowed with rompaths.
              Also, when we de-install a module-script the emulator.cfg will be wiped.
              But if we add rompaths to the mame.ini they aren't removed with a de-install.

              I have added the rompaths to the runcommand lines.
              I have removed the mame-cmd lines as the are no longer needed.
              (The name isn't good either because they will not load .cmd files)
              Instead I will replace them with equal basename lines.

              Edit :
              It's working I will put it on github soon !

              https://github.com/FollyMaddy/RetroPie-Share/commit/d7fe855ca321a5a007d963a87d213f37cae1d7d6

              0 FollyMaddy committed to FollyMaddy/RetroPie-Share
              Front-end 0237 improved
              
              - add fmtmarty to systems with extras
              - remove mame-cmd runcommand lines
              - replace all mame-cmd lines with equal mame basename lines
              - add multiple rompaths solution to the mame-basename lines
              - auto detect systems with media or no media for changing the mame-basename lines
              
              https://retropie.org.uk/forum/topic/29682/development-of-module-script-generator-for-lr-mess-and-mame-standalone/903
              DTEAM 1 Reply Last reply Reply Quote 1
              • DTEAM
                DTEAM @Folly last edited by

                @folly said in Development of module-script generator for lr-mess and mame standalone:

                I have added the rompaths to the runcommand lines.

                This is a good idea!

                Folly 1 Reply Last reply Reply Quote 1
                • Folly
                  Folly @DTEAM last edited by Folly

                  @dteam

                  I think you know how to get rid of the old lines in the emulators.cfg.

                  Can you test for me if cheats are working with these lines ?
                  If that works then I think it's a very good improvement.

                  Then we can probably take it to the next step and make more retropie names adding for example :

                  • pinball
                  • shooter
                  • calculator
                  • climbing
                    etc

                  For that I want to be able to get these matching arrays in the generator-script part from the database .

                  At the moment I am busy with a script that will automatically build the new data-base from the new files from progettosnaps.net.
                  Seems I can get all data now from progettosnaps.net also the categories.
                  So probably no need to use adb.arcadeitalia.net.
                  Hopefully I can get it to work, that way it will save a lot of time each time a new mame version comes.

                  DTEAM 1 Reply Last reply Reply Quote 0
                  • DTEAM
                    DTEAM @Folly last edited by DTEAM

                    @folly

                    These lines work to load a game without Rompath in mame.ini but doesn't work for Cheat codes and I can't explain why.

                    Basename_link = /opt/retropie/emulators/mame/mame -v -c  -rompath /home/pi/RetroPie/roms/coleco\;/home/pi/RetroPie/BIOS/mame coleco "spacedst"
                    Basename_link2 = /opt/retropie/emulators/mame/mame -v -c  -rompath /home/pi/RetroPie/roms/coleco\;/home/pi/RetroPie/BIOS/mame coleco %BASENAME%"
                    

                    For cheat codes we need for now (for coleco) :
                    in mame.ini

                    rompath /home/pi/RetroPie/roms/coleco
                    

                    in emulator.cfg

                    mame-coleco-cheat= "/opt/retropie/emulators/mame/mame -c -autoframeskip coleco %BASENAME%"
                    
                    Folly 1 Reply Last reply Reply Quote 1
                    • Folly
                      Folly @DTEAM last edited by

                      @dteam

                      Seems we don't always are that lucky with this.

                      Reading your post I presume all systems aren't working with cheats, am I right ?
                      Or is it only coleco ?

                      When I can will have second look at this problem

                      DTEAM 1 Reply Last reply Reply Quote 0
                      • DTEAM
                        DTEAM @Folly last edited by

                        @folly
                        I did a test with Coleco. I presume it's the same things for the others.

                        Folly 1 Reply Last reply Reply Quote 0
                        • Folly
                          Folly @DTEAM last edited by Folly

                          @dteam

                          The cheat issue should be fixed now.
                          It should also work with the new basename options too. (I tested myself)

                          There was a mismatch between where the cheats were downloaded and the cheatpath in mame.ini.

                          Can you test it again.
                          Before testing, you have to download the cheats again in the script.

                          https://github.com/FollyMaddy/RetroPie-Share/commit/5e094182dc9b6d5e7c537175bd7a18ccc0687aa0

                          0 FollyMaddy committed to FollyMaddy/RetroPie-Share
                          Front-end 0237 improved
                          
                          - fix downloading the cheats to the correct cheatpath
                          DTEAM 2 Replies Last reply Reply Quote 1
                          • DTEAM
                            DTEAM @Folly last edited by DTEAM

                            @folly

                            For help menu. where you want my text?
                            English is not my mother tongue, so feel free to modify if you see mistakes.

                            BTW, seach tool in your script works very well!

                            1 Reply Last reply Reply Quote 0
                            • DTEAM
                              DTEAM @Folly last edited by

                              @folly said in Development of module-script generator for lr-mess and mame standalone:

                              Can you test it again.
                              Before testing, you have to download the cheats again in the script.
                              https://github.com/FollyMaddy/RetroPie-Share/commit/5e094182dc9b6d5e7c537175bd7a18ccc0687aa0

                              You have hit the bullseye !!! It works

                              Folly 2 Replies Last reply Reply Quote 1
                              • Folly
                                Folly @DTEAM last edited by Folly

                                @dteam

                                Indeed, at last a good solution for the mame basename part, nice, isn't it ;-)
                                Though we have to take into account that the roms have to be in the root directory structure of : /roms/<system>/<basename_rom_file> .
                                The solution will not work with this directory structure :/roms/<system>/<subdirectory>/<basename_rom_file>.
                                (perhaps I can find a solution for this in the future, but honestly I have no clue now)

                                Making a solution for lr-mess basename still has to be done, but that's for the future..... (no clue either)

                                The help can be attached to almost every line that can be executed.
                                This is the comma separate line of selecting the submenu of the handhelds (help part is bold :
                                ",Handheld / plug&play and downloads > Submenu,,subgui_add-mamedev-systems_forum,,,,,dialog_message "install handheld / plug&play and the required downloads","

                                So we can add more in above line.

                                We can also add help text to, for example :
                                ",Konami Handheld,,run_generator_script kbilly,,,,,dialog_message "HELP","

                                The dialog_message part is executed when we press the help_button.

                                1 Reply Last reply Reply Quote 1
                                • Folly
                                  Folly @DTEAM last edited by Folly

                                  @dteam

                                  I changed post 1 adding the improvements.

                                  I looks like I found why the cheats were in a different path, it's because of lr-mess :
                                  https://retropie.org.uk/forum/topic/29682/development-of-module-script-generator-for-lr-mess-and-mame-standalone/22

                                  Basically I have to change the script again so the cheats are downloaded in 2 different paths, one for mame and one for lr-mess :

                                  • /home/pi/RetroPie/roms/mame/cheat/cheat.7z (mame)
                                  • /home/pi/RetroPie/BIOS/mame/cheat/cheat.7z (lr-mess)

                                  https://github.com/FollyMaddy/RetroPie-Share/commit/dbcf27261621484b4d5e5e077b1f1eb665805973

                                  0 FollyMaddy committed to FollyMaddy/RetroPie-Share
                                  Front-end 0237 improved 
                                  
                                  Make sure the cheat file is saved to both cheatpaths for mame and for lr-mess :
                                  
                                  - /home/pi/RetroPie/roms/mame/cheat/cheat.7z (mame)
                                  - /home/pi/RetroPie/BIOS/mame/cheat/cheat.7z (lr-mess)
                                  DTEAM 1 Reply Last reply Reply Quote 0
                                  • Referenced by  Folly Folly 
                                  • DTEAM
                                    DTEAM @Folly last edited by

                                    @folly
                                    Is there a way to skip a line in your script (like press enter in Word) for a help message. I would like to do a multi line message and i'm not able to do that.

                                    Folly 2 Replies Last reply Reply Quote 0
                                    • Folly
                                      Folly @DTEAM last edited by Folly

                                      @dteam

                                      Yes, you can.
                                      You have to that with the newline code\n.
                                      Adding more newlines will skip 1 or more lines.
                                      Remember you can't directly use comma's because you are in a CSV.

                                      ",Konami Handheld,,run_generator_script kbilly,,,,,dialog_message "line 1\n\nline 2","

                                      1 Reply Last reply Reply Quote 1
                                      • Folly
                                        Folly @DTEAM last edited by Folly

                                        @dteam

                                        Some new stuff :

                                        • finished the script for generating new database versions.
                                        • added the new 0238 database with more categories
                                        • added the new add-mamedev-systems-0238.sh
                                        • improved add-mamedev-systems-0238.sh
                                          add system-name to the basename runcommand description lines in version 0238.
                                          For example, coleco and adam are both installed as coleco.
                                          With adding the system-name, more systems can benefit from the basename line, when installed under the same RetroPie-name.
                                          If a system uses "no media" then no system-name is added to the description, like for example with konamih commit
                                        • updated post 1 with solutions and an issue
                                          issue added : When using the the last basename options we still have one issue to solve.
                                          The problem is that the games have to be in the root of the systems rompath in order to work with the basename options.
                                          If using more systems we are not be able to separate the specific files from each other when placing them in different subdirectories.
                                          A solution could be to add %DIRNAME% to the runcommand-line but that solution doesn't exist.
                                        1 Reply Last reply Reply Quote 1
                                        • Folly
                                          Folly last edited by Folly

                                          @BuZz

                                          (Solved : see my question in the next post)

                                          Can you help me with something ?

                                          I want to add the directory path of a rom inside the runcommand loader option.
                                          So just like %ROM% and %BASENAME I wanted to add %DIRNAME%.
                                          So I am trying to add a new replace tokens option %DIRNAME% to the runcommand.sh.

                                          I added the next lines (the green ones) :

                                                      IS_SYS=1
                                                      SYSTEM="$3"
                                                      ROM="$4"
                                                      ROM_BN_EXT="${ROM##*/}"
                                                      ROM_BN="${ROM_BN_EXT%.*}"
                                          +            ROM_DN="${ROM%/*}"
                                          .
                                          .
                                              # replace tokens
                                              COMMAND="${COMMAND//\%ROM\%/\"$ROM\"}"
                                              COMMAND="${COMMAND//\%BASENAME\%/\"$ROM_BN\"}"
                                          +    COMMAND="${COMMAND//\%DIRNAME\%/\"$ROM_DN\"}"
                                          

                                          I tested the commands in the terminal and they work.
                                          But when I load a game it doesn't work. %DIRNAME% isn't replaced somehow.

                                          I use this emulators.cfg testline in coleco to test it.

                                          mame-adam-basename-test = "/opt/retropie/emulators/mame/mame -v -c -rompath /home/pi/RetroPie/BIOS/mame\;%DIRNAME%  adam %BASENAME%"
                                          
                                          1 Reply Last reply Reply Quote 0
                                          • Folly
                                            Folly last edited by Folly

                                            @BuZz

                                            I solved the problem.
                                            I was editing the repository file : /home/pi/RetroPie-Setup/scriptmodules/supplementary/runcommand/runcommand.sh .
                                            But I should edit the executable in : /opt/retropie/supplementary/runcommand/runcommand.sh or reinstall the runcommand.sh after editing the repository file.**

                                            I would like this %DIRNAME% solution to be added in the Retropie-Setup source.
                                            Are you willing to add it for me ?
                                            Or are you open for a PR ?
                                            It would be a major improvement.

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