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

    Show Control Panel Layout before game starts in RetroPie, just like Arcade1UP does.

    Scheduled Pinned Locked Moved Projects and Themes
    arcade1upcontrolruncommandjoy2key
    92 Posts 20 Posters 24.9k 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.
    • B
      BJRetro @CargoRunner
      last edited by

      I stumbled upon a post of someone else trying to do something like this so linking here since there was a different tool mentioned for automating the control images thought those considering this project might want to look at: https://retropie.org.uk/forum/topic/20030/controller-info-overlay-in-the-game

      johnodonJ 1 Reply Last reply Reply Quote 0
      • T
        Texacate
        last edited by Texacate

        @BJRetro Thank you for the link. CPWizard looks like an interesting tool! However I spent a good chunk of time today figuring out how ImageMagic works, and finally got something to show for it.

        I have a prototype image building script that uses ImageMagic, and the scripting that @cyperghost posted above. The script and the underlying button images have been added to my github project. Here's an example I built with the script:

        asteroid.png

        I could use some help converting the controls.dat / control.c data into the simplified keylayout.txt format.

        UPDATE: For now, all the data in my project is in .csv format (comma separated values). The keylayout.txt file has been removed from the project repository.

        A cyperghostC 2 Replies Last reply Reply Quote 1
        • A
          Arnulf @cyperghost
          last edited by

          @cyperghost

          no no... the port is not my idea. I am only using the IO extension, because it is easier to handle all of my 32 LEDs :)

          But for another project it could be one solution to use a second pi (pi zero or any cheap alternative) to handle a second monitor or display

          1 Reply Last reply Reply Quote 0
          • A
            Arnulf @Texacate
            last edited by

            @Texacate
            thumbs up!

            nice work

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

              @Texacate Wow... thank you for the take off ;)
              I think you've done the first steps for an impressive usecase.
              I think that not only a "lauching screen" can be used for this but also the button controlls can be burned into overlay ;)

              I could use some help converting the controls.dat / control.c data into the simplified keylayout.txt format

              I'm not sure of the keylayout.txt should be used. I think it's better to have an database in whatover format (XML, SQL, JSON) where the buttons are assigned and use a engine to export one request to a keylayout.txt. This file can be processes by the script with imagemagik

              @Arnulf

              no no... the port is not my idea. I am only using the IO extension, because it is easier to handle all of my 32 LEDs :)

              Ah understood. But then the script is also usefull. You need a simple logic... instead of adding "green" buttons in a picture you send command to light up the controller LED.

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

                @cyperghost Thank you. Agreed, both the button-map-artwork-generator, and the display-server could be used for a lot of things. A dynamic marquee display comes to mind too.

                I would be happy to integrate an XML reader into the scripts, if someone can point me to an free, easy-to-use XML reader, with some good examples I can follow. The ones I've seen are Windows based. I need a simple Linux one. For all I know, there could be one built right into every Raspian disto, and I'm just not aware of it. I'm just not a very experienced database-querying guy. I'm more of a simple MS Excel kind of database guy.

                Meanwhile, it's time for me put some more work into the WIKI documentation...

                T mituM 2 Replies Last reply Reply Quote 0
                • T
                  Texacate @Texacate
                  last edited by Texacate

                  Wow the wiki I'm writing is getting out of control. I'm up to 15 pages or more. I'm thinking of splitting the project in half. IE: Separate all the stuff that generates the library of button-map images, from the all the stuff that selects and displays those images. Two independent GitHub projects.

                  1 Reply Last reply Reply Quote 0
                  • mituM
                    mitu Global Moderator @Texacate
                    last edited by

                    @Texacate said in Show Control Panel Layout before game starts in RetroPie, just like Arcade1UP does.:

                    I would be happy to integrate an XML reader into the scripts, if someone can point me to an free, easy-to-use XML reader, with some good examples I can follow

                    One XML manipulation program that's available (and installed by the RetroPie-setup script) is xmlstarlet - it can be used to read and manipulate XML documents. Unfortunately it fails at the good examples category.
                    But if you have the file structure and you can tell me what information you'll need extracted, we can lend a hand.

                    T R 2 Replies Last reply Reply Quote 1
                    • GreenGriffonG
                      GreenGriffon @CargoRunner
                      last edited by

                      @CargoRunner I think your attempt looks great! I can definitely see that being a time-consuming endeavor as well.
                      In my case, I wanted to keep mine simple and straightforward, without inundating the user with too much info (although it's nice to have). My launching images are set to 6 seconds - just enough time to see the controls and the original arcade flyer, and the user would be all set to play the game.
                      Even with simple requirements, yes, still a time consuming project. For me, most of the time is being spent on finding a high quality copy of the arcade flyer for each game. The rest is a Photoshop template where I just display the layer for each button with the function, and that's it. I'm slowly making progress.
                      My controls are obviously customized for the retrocade I built, but the 6-button layout itself is pretty standard. Someone else might find them useful.

                      1 Reply Last reply Reply Quote 0
                      • GreenGriffonG
                        GreenGriffon
                        last edited by

                        I'm very happy to see that you guys are developing a hopefully automated solution to creating these images. Very inspiring stuff!

                        1 Reply Last reply Reply Quote 0
                        • T
                          Texacate @mitu
                          last edited by Texacate

                          @mitu Thanks for the pointer to xmlstarlet. There was just enough examples for me to dump all the button names inside controls.xml file into some plain text. Then, with a whole bunch of grep commands, followed by a series of search-and-replace in my favorite text editor ( nedit ), I was able to wrangle the data into comma sepearated lines. I like .csv because it is easy to maintain in Microsoft Excel. Now I'm off and running. I will post the simplified button_dat.csv file to my GitHub area later today. This doesn't cover the clones, but for now, that's good enough. I can go build my library of images now.

                          markwkiddM 1 Reply Last reply Reply Quote 0
                          • T
                            TheRealSmilebit
                            last edited by

                            Just came back to this and gotta say...WOW...some of this is over my head and wish I could contribute more to help out...but will keep plugging away at what I can do.

                            1 Reply Last reply Reply Quote 0
                            • markwkiddM
                              markwkidd @Texacate
                              last edited by

                              @Texacate said in Show Control Panel Layout before game starts in RetroPie, just like Arcade1UP does.:

                              Thanks for the pointer to xmlstarlet. There was just enough examples for me to dump all the button names inside controls.xml file into some plain text. Then, with a whole bunch of grep commands, followed by a series of search-and-replace in my favorite text editor ( nedit ), I was able to wrangle the data into comma sepearated lines. I like .csv because it is easy to maintain in Microsoft Excel. Now I'm off and running. I will post the simplified button_dat.csv file to my GitHub area later today. This doesn't cover the clones, but for now, that's good enough.

                              Do let me know if you want to work together on generating this from the control names that are actually in the MAME 2003-Plus source. Plain text, XML, etc is all possible.

                              1 Reply Last reply Reply Quote 0
                              • GreenGriffonG
                                GreenGriffon @chicuelo
                                last edited by

                                @chicuelo Hi, the arcade joystick icon that I'm using in my launching image above...did you create that? I found it somewhere online, but can't seem to track down the original source.
                                If so, not sure when I'll be done with this batch of launching images, but would you be okay with me releasing them for others to use?

                                T 1 Reply Last reply Reply Quote 0
                                • T
                                  Texacate @GreenGriffon
                                  last edited by Texacate

                                  @markwkidd At some point I will take you up on the offer to pull the data directly from XML, or JSON or whatever. But right now I'm happy with CSV.

                                  @GreenGriffon I'm in the same boat. I wan't to make sure I'm using public-domain button and joystick artwork, and give proper credit to original source. I may end up just drawing my own button and joystick icons...

                                  BTW everyone, I have put the CSV button database in my github area. It's it in the MAME generic order: P1_BUTTON1, P1_BUTTON2, P1_BUTTON3, etc .

                                  Also the works:

                                  • A copy of the exact same data, but with "less wordy" labels. Some of the text is 20 or more characters per button, and the label runs off the screen, or collides with an adjacent label.
                                  • Auto-scaling down the font size when a label has a lot of characters, for the same reason.
                                  • Functions that map MAME->RetroPad, and then RetroPad->ControlPanel. Hopefully that will make the scripts easier to customize according to one's specific button layout.
                                  markwkiddM 1 Reply Last reply Reply Quote 1
                                  • markwkiddM
                                    markwkidd @Texacate
                                    last edited by markwkidd

                                    @Texacate said in Show Control Panel Layout before game starts in RetroPie, just like Arcade1UP does.:

                                    @markwkidd At some point I will take you up on the offer to pull the data directly from XML, or JSON or whatever. But right now I'm happy with CSV.

                                    It is not a problem to generate a CSV either. The idea is about sharing and making improvements to a common list of controls rather than the file format.

                                    Pretty much any text-based format is possible if and when it is decided that collaborating on fixes to incorrect and missing button labels is part of the intention of the project in this thread.

                                    If maintaining the control name list and fixing those problems is part of your intentions then it does seem to me like having one common database is worth some coding time on my part.

                                    T 2 Replies Last reply Reply Quote 1
                                    • T
                                      Texacate @markwkidd
                                      last edited by Texacate

                                      @markwkidd You raise a very good point. It would be wonderful if there was an active project who's main goal was to collect and maintain the database of controls descriptions. I would be happy to contribute to, and pull from such a centralized database (if-and-when that becomes a thing).

                                      However, the intent my little project is limited displaying just a "few button's worth" of the data. I hope others find it useful, so I put it out there on github to copy/modify/contribute. We'll see where it goes! It's been a fun project so far! But for now I'm okay with my unmaintained/unofficial version of the data. I'll let you know if that changes.

                                      But for sure, my project isn't the only one being discussed in this thread. There are at at least two other folks that have approached the problem from a different angle. I like what they have done too. Very inspiring stuff. The flyer art is genius!

                                      markwkiddM 1 Reply Last reply Reply Quote 0
                                      • markwkiddM
                                        markwkidd @Texacate
                                        last edited by

                                        @Texacate said in Show Control Panel Layout before game starts in RetroPie, just like Arcade1UP does.:

                                        It would be wonderful if there was an active project who's main goal was to collect and maintain the database of controls descriptions. I would be happy to contribute to, and pull from such a centralized database (if-and-when that becomes a thing).

                                        Alright I think we are getting close to working through this miscommunication.

                                        At the moment we do already have a centralized database -- so to speak -- for controls descriptions that is already getting additions and corrections from myself and others.

                                        At the moment, only MAME 2003-Plus benefits from this database and there are only a handful of people updating the old "controls.dat" database , but if you do want to participate then I just need to know what format you would like to have access to the database in, such as CSV.

                                        This database is a real thing that already exists is what I'm saying. :D

                                        T 1 Reply Last reply Reply Quote 0
                                        • T
                                          Texacate @markwkidd
                                          last edited by

                                          @markwkidd Oh, that 's awesome. I didn't realize that. I grepped out the game list from the control.c file you pointed me to, and I found roughly 1000 games. Approximately the same number as in my copy of controls.xml_0.141.1 file. And both files seemed to have parents, but not clones. So I (mistakenly) concluded there wasn't that much of a difference. Good to be wrong! Still let's hold off integrating XML into my project until it's more polished, and more folks are actually playing with it. Right now it has whopping 2 whole downloads! LOL.

                                          B 1 Reply Last reply Reply Quote 0
                                          • B
                                            BJRetro @Texacate
                                            last edited by

                                            @Texacate hi I wouldn’t interpret the lack of downloads for lack of interest! While I feel pretty good navigating pi menus and doing what I am told and stuff, I still have no idea how to pull scripts off of github and use/test them. If you work is now where I can use it to try to generate the images for my games I am happy to try and test it. But - what do I need to do? I would be generating the images to try to use them as launching images on my personal setup.

                                            1-It sounds like after I downloaded the script (this I don’t know how to do) I would run it from command line (assuming I would say sudo (path to script? Where would it go after download?)

                                            2- and it looks like from your documentation I would add at the end the rom name then the image would be generated in my arcade Roms folder for use. Right?

                                            3- I don’t know if there is some way it would just read for .zip files in my arcade folder otherwise and then create the images for whatever games it can or if it has to be done on a game by game basis.

                                            4-Also, I saw it will pull game logos into the image but is that art pulled from within a “wheel” folder that is inside the arcade Roms folder? Sorry for all the questions.

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