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

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

Scheduled Pinned Locked Moved Ideas and Development
developmentlr-messmamelr-mamescripts
2.2k Posts 35 Posters 6.0m 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
    DTEAM @Folly
    last edited by 9 Dec 2021, 16:11

    @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

    F 2 Replies Last reply 9 Dec 2021, 16:51 Reply Quote 1
    • F
      Folly @DTEAM
      last edited by Folly 12 Sept 2021, 17:25 9 Dec 2021, 16:51

      @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
      • F
        Folly @DTEAM
        last edited by Folly 12 Sept 2021, 18:26 9 Dec 2021, 18:16

        @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

        D 1 Reply Last reply 9 Dec 2021, 20:18 Reply Quote 0
        • F Folly referenced this topic on 9 Dec 2021, 18:16
        • D
          DTEAM @Folly
          last edited by 9 Dec 2021, 20:18

          @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.

          F 2 Replies Last reply 10 Dec 2021, 07:18 Reply Quote 0
          • F
            Folly @DTEAM
            last edited by Folly 12 Oct 2021, 07:20 10 Dec 2021, 07:18

            @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
            • F
              Folly @DTEAM
              last edited by Folly 12 Dec 2021, 20:30 12 Dec 2021, 19:55

              @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
              • F
                Folly
                last edited by Folly 13 Dec 2021, 08:03

                @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
                • F
                  Folly
                  last edited by Folly 13 Dec 2021, 09:31

                  @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
                  • D
                    DTEAM @Folly
                    last edited by 13 Dec 2021, 20:51

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

                    @DTEAM
                    Are you able to make some help texts for the handheld/p&p ?

                    Done! See "Pull Requests" on GitHub.

                    F 2 Replies Last reply 14 Dec 2021, 08:11 Reply Quote 1
                    • F
                      Folly @DTEAM
                      last edited by 14 Dec 2021, 08:11

                      @dteam

                      This is magic, PR is merged !

                      Well done 👍

                      1 Reply Last reply Reply Quote 1
                      • F
                        Folly @DTEAM
                        last edited by Folly 16 Dec 2021, 09:56

                        @dteam

                        I added some category names.
                        This is a nice example on how it's working.
                        https://retropie.org.uk/forum/topic/31820/how-to-convert-twin-qix-to-the-japanese-version/4

                        Later I can just add the category installs just like we did with the handheld.
                        The handheld names are now matched from the database and not anymore from adding system-names to the array in the script.

                        This is the last commit :
                        https://github.com/FollyMaddy/RetroPie-Share/commit/050706076c04461e595bee5cb2166539c4af9b70

                        1 Reply Last reply Reply Quote 1
                        • D DTEAM referenced this topic on 17 Dec 2021, 13:13
                        • D DTEAM referenced this topic on 17 Dec 2021, 13:13
                        • D DTEAM referenced this topic on 17 Dec 2021, 13:15
                        • D DTEAM referenced this topic on 17 Dec 2021, 13:15
                        • F
                          Folly
                          last edited by Folly 21 Dec 2021, 19:59

                          @BuZz @mitu

                          With our project we now inject the default rompaths in the mame basename loaders.
                          This way, we don't need to add all the rompaths to the mame.ini anymore.
                          But still we want it to be more flexible .
                          So I have made a solution that will add the %DIRNAME% to the runcommand.sh.
                          The advantage is that if we use this in the mame basename loaders, the rompath of the game-rom can be injected.
                          This make it far more flexible in to where we are putting the game-roms, because we then can also use sub-directories.

                          And I think more loader commands can benefit from this improvement.

                          I would like to know what you both think of it.
                          Is there some interest in doing a PR for this solution ?
                          Thanks for replying.

                          Here is the change :

                                      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\"}"
                          
                          M 1 Reply Last reply 21 Dec 2021, 20:43 Reply Quote 0
                          • M
                            mitu Global Moderator @Folly
                            last edited by 21 Dec 2021, 20:43

                            @folly Do you have an example when this is strictly needed and can't be accomplished otherwise ?

                            F 1 Reply Last reply 21 Dec 2021, 21:15 Reply Quote 0
                            • F
                              Folly @mitu
                              last edited by Folly 21 Dec 2021, 21:15

                              @mitu

                              Take for instance the system Coleco Adam (adam).
                              Just like the normal colecovision it's using the coleco roms directory.

                              We have the next collections of adam and coleco :
                              adam_cart.zip
                              adam_cass.zip
                              adam_flop.zip
                              coleco.zip

                              Normally we would use ~/retropie/roms/coleco as rompath in the basename loader command.
                              Using this means we can't run games from sub-directories.

                              Unzipping all in the root of coleco roms directory we get all files mixed there.
                              The problem now is that the games of coleco and adam are mixed and also that cartridge, cassette and floppy games are mixed in the root.
                              The mame adam basename loader is different as that of coleco.
                              So we need to know what rom with what mame basename loader has to be loaded.

                              The dirname solution would make it possible to sort the games in directories and still use the basename loader.

                              I don't think there is another good solution for this problem, I can't think of any.
                              First I was thinking of adding more rompaths to the mame.ini, but in time you get so much rompaths in there and also you have to put all those rompaths in there manually or automatic.
                              The %DIRNAME% solution would take care of all.

                              I hope I explained it better for you to understand.

                              M 1 Reply Last reply 22 Dec 2021, 05:57 Reply Quote 1
                              • M
                                mitu Global Moderator @Folly
                                last edited by mitu 22 Dec 2021, 05:57

                                OK, I see the challenge here, the adam system is split in sub-folders under coleco.
                                One solution is to configure an $HOME/.mame/adam.ini file instead of setting the ROM path on the command line:

                                rompath                   /home/pi/RetroPie/BIOS/mame/adam;/home/pi/RetroPie/roms/coleco;/home/pi/RetroPie/roms/coleco/adam_flop;/home/pi/RetroPie/roms/coleco/adam_cass;etc.
                                

                                This works for any system/driver when you don't want to stuff the main mame.ini with all the ROM paths. Set the BIOS path to mame/<system> and add all the ROM folders needed to <system>.ini.

                                Now, leaving aside the configuration through config files, I can see %DIRNAME% being useful in this context, not sure if this kind of configuration is an exception (since you didn't run into this issue so far) or other similar systems in Mame may benefit from it. I think %BASENAME% has a similar origin, to support Mame's calling convention.

                                F 1 Reply Last reply 22 Dec 2021, 09:17 Reply Quote 1
                                • F
                                  Folly @mitu
                                  last edited by 22 Dec 2021, 09:17

                                  @mitu

                                  Thanks for bringing up the solution of $HOME/.mame/adam.ini.

                                  If it was for coleco/adam only it was convenient enough.
                                  Downside is still, it has to be created somehow.
                                  I can't directly give you examples on more similar system than with adam and coleco but there are definitely much more.

                                  As you know the advantage of the basename loader is that the files are hooked to the mame database, so the loading procedure is more precise, adding sometimes extra hardware, also cheats can be used if available and if we have multiple disks the are also loaded in a better way.

                                  So that's why we wanted the mame basename loaders to work.
                                  But basically we struggled with the mame basename loaders, running the mess systems, for quite a while.
                                  All the time the basename loaders didn't correctly work we just use the predefined media loader lines in order to run the games.

                                  I found that in order to run I had to add the systemname and basename to the basename loarder in order to run correctly.
                                  Of-course with the added rompaths to the mame.ini it will work.
                                  Considering we have about 4000 mess systems, so we don't want to add all these rompaths to a mame.ini, it's better to add it in the loader command.
                                  Basically the adam/coleco issue is no exception.
                                  Also, many systems are re-grouped under another name.
                                  Take for instance all msx 20-30 msx types they will all be installed under msx.

                                  Well I didn't want to add so much rompaths in a mame.ini.
                                  Here is where the trouble started, when adding 1 rompath to the loader command, it will not load the rompaths from the mame.ini anymore.
                                  So it took me quite some time to figure out, how, and that I to add multiple rompaths to the loader command.
                                  Well, It had to be escaped so it could be added like this :

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

                                  So now we had some properly working line.
                                  But only running the game-roms if they are in the root of the specific rom directory.

                                  Making it like the next one will improve the loading flexibility much more.

                                  mame-adam-basename = "/opt/retropie/emulators/mame/mame -v -c -rompath /home/pi/RetroPie/BIOS/mame\;%DIRNAME%  adam %BASENAME%"
                                  

                                  I am sure it would be an improvement in the runcommand.sh.

                                  Are you convinced ?

                                  M 1 Reply Last reply 22 Dec 2021, 11:39 Reply Quote 0
                                  • M
                                    mitu Global Moderator @Folly
                                    last edited by 22 Dec 2021, 11:39

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

                                    But basically we struggled with the mame basename loaders, running the mess systems, for quite a while.

                                    Doesn't mame load a ROM/game with arbitrary names, as long as you give it the full path and specify the system ? Or is it just a lr-mess feature ?

                                    Are you convinced ?

                                    I already said in my previous reply that I think it would be a useful addition.

                                    F 2 Replies Last reply 22 Dec 2021, 16:35 Reply Quote 1
                                    • F
                                      Folly @mitu
                                      last edited by 22 Dec 2021, 16:35

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

                                      Are you convinced ?

                                      I already said in my previous reply that I think it would be a useful addition.

                                      Nice to hear, if I have some time to do so then I will look at making a PR with a proper description.

                                      1 Reply Last reply Reply Quote 0
                                      • F
                                        Folly @mitu
                                        last edited by 22 Dec 2021, 16:49

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

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

                                        But basically we struggled with the mame basename loaders, running the mess systems, for quite a while.

                                        Doesn't mame load a ROM/game with arbitrary names, as long as you give it the full path and specify the system ? Or is it just a lr-mess feature ?

                                        Not sure what you exactly mean.
                                        Some examples would help, if we want to discuss it further.

                                        M 1 Reply Last reply 22 Dec 2021, 16:51 Reply Quote 0
                                        • M
                                          mitu Global Moderator @Folly
                                          last edited by mitu 22 Dec 2021, 16:51

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

                                          Not sure what you exactly mean.

                                          I'm referring to Mame's documentation:

                                          The basic usage, from command line, is

                                          mame.exe <system> <media> <software> <options>

                                          where

                                          • <system> is the short name of the system you want to emulate (e.g. nes, c64, etc.)
                                          • <media> is the switch for the media you want to load (if it's a cartridge, try -cart or -cart1; if it's a floppy disk, try -flop or -flop1; if it's a CD-ROM, try -cdrom)
                                          • <software> is the program / game you want to load (and it can be given either as the fullpath to the file to load, or as the shortname of the file in our software lists)
                                          • <options> is any additional command line option for controllers, video, sound, etc.
                                          F 1 Reply Last reply 22 Dec 2021, 16:56 Reply Quote 1
                                          934 out of 2234
                                          • First post
                                            934/2234
                                            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.

                                            This community forum collects and processes your personal information.
                                            consent.not_received