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

    autopatch - a commandline tool for automated patching of roms (Linux, Python 3, snes)

    Scheduled Pinned Locked Moved General Discussion and Gaming
    linuxpatchpythonromhackssnes
    15 Posts 3 Posters 2.2k 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.
    • thelostsoulT
      thelostsoul
      last edited by thelostsoul

      autopatch.png
      Autopatch 2.0 - a commandline tool with a gui for automated patching of roms

      Autopatch download: https://drive.google.com/file/d/12vb7DuEvT6jgzvT7j6V6N6Mg9UZtqoSj/view?usp=sharing
      Flips download: https://www.smwcentral.net/?p=section&a=details&id=11474

      screen-autopatch.png

      Works only on Linux and with Python 3.6+ (with an internal check). The GUI requires Python3-tk. Tested on Ubuntu 18.04. Requires flips-linux executable. Patching roms is actually very easy with Flips (Floating IPS). autopatch is a Python 3 script to automate this process through the commandline or a gui with addiional features. This tool is mainly designed to patch SNES roms. I did not test otherwise.

      Basic usage: autopatch.py -i INPUT_ROM -p PATCH_FILE

      Some features:

      • can download and install flips-linux (required application as its core) automatically
      • supports .smc, .sfc, .bps, .ips and .zip files
      • weblinks are also supported, but some sites do not allow for direct downloads
      • paths are often relative to current dir and support globbing, such as "*" and "?"
      • default roms folder as a base
      • output directory supported
      • commandline supported (higher priority than config file)
      • configuration file supported (same options as commandline)
      • if no config file in current working dir is found, then it will be searched in apps dir
      • created files will be automatically renamed as "romname_patchname.smc"
      • multiple patch files are supported, but not in the gui
      • running the app without arguments (in example double click in file explorer) will start the gui. But using any arguments will disable gui, unless using -g option
      • gui will additionally run each created game automatically (will ask)
      • quick save of user entry fields in the gui
      • gui can use link or path to patch_file directly from clipboard, no need to delete and replace enter field

      My personal usage:

      • put original Super Mario World (U) [!].smc in autopatchs roms folder, so you can easily find it later
      • create a link to the autopatch.py app and put it in Downloads folder
      • run it from this place by double clicking it, will open the gui
      • select the Mario rom
      • go to https://www.smwcentral.net/
      • open a smw romhack page and copy its Download link to clipboard, in example https://dl.smwcentral.net/23762/legend_quest.zip
      • click on button Run PATCH file from clipboard

      If everything was fine, the .zip file will be downloaded. It searches for patch files and will use them to create romhacks. Each successful created game will be asked to run. Now use the terminal commandline to run the app with autopatch.py --help, to see all available options. You can create settings files too.

      ./autopatch.py --help
      usage: Autopatch [-h] [-v] [-c FILE] [-n] [-f FILE] [-i FILE]
                       [-p FILE [FILE ...]] [-r DIR] [-o DIR] [-g] [-G] [-w]
                       [--showlicense]
      
      Automation of the process to patch roms using the flips-linux application as
      its backend, with added functionalities. Basic usage: autopatch.py -i
      input_rom.smc -p patch.ips
      
      optional arguments:
        -h, --help            show this help message and exit
        -v, --version         show program's version number and exit
        -c FILE, --config FILE
                              Path to an optional configuration file. Defaults to
                              programs own name with replaced extension to .ini. It
                              searches in current working directory first and then
                              in programs original folder.
        -n, --noconfig        Ignores the settings in configuration file. Use
                              default values and commandline arguments only.
        -f FILE, --flips FILE
                              Path to the required flips-linux application.
        -i FILE, --input FILE
                              Original input rom file to patch. This can be a direct
                              file path or a search term. Globbing is supported and
                              the term will be enclosed automatically by '*'. The
                              search term will be used to match a rom in roms
                              folder. To determine if this is treated as a search
                              term, following character must not appear: '/'
        -p FILE [FILE ...], --patch FILE [FILE ...]
                              New patch file to apply. .bps, .ips and .zip are
                              supported. It can be a direct file path or url to
                              download. Multiple files can be specified, until next
                              option starts with a "-". In example: -p file1 file2.
                              Multiple files do not workwith the gui, but globbing
                              works, in example "*.bps".
        -r DIR, --roms DIR    Base directory to search for input roms, when --input
                              is a search term. Defaults to "roms" in programs
                              folder.
        -o DIR, --output DIR  Output folder for all new created romhacks. This can
                              be a full path to a directory or a relative single
                              folder name. If the target does not exist, it will be
                              created. Defaults to current working directory.
        -g, --gui             Use the graphical user interface. Default is on, if no
                              other arguments are specified. All created romhacks
                              will be run with the files associated application.
                              Multiple files do not workwith the gui, but globbing
                              works, in example "*.bps"
        -G, --nogui           Disables the gui, no matter what other option was
                              used. Higher priority than -g.
        -w, --writesettings   Simulate process. Print current active settings on
                              screen and exit. Do not copy files.
        --showlicense         Print license text of program on screen and exit. Do
                              not copy files.
      
      .bps and .ips files are supported and is mainly used to patch SNES roms. Often
      used original roms should be collected in the roms folder. When using the gui,
      newly created romhacks will run automatically. A settings file with default
      options can be created with same name as programs filename, but .ini file
      ending. Use -w option to see how the file is structured. Example usage:
      autopatch.py -i Mario -p *Mush*.zip
      

      πŸ“œ RE/SET: 100 SNES Games for your RetroPie, 🎁 Share your hidden gems and insider tips

      1 Reply Last reply Reply Quote 1
      • ClydeC
        Clyde
        last edited by

        Thanks. I seldom patch any roms, and I found most Linux command line patching tools not that difficult to use, but a bit more automation and flexibility is nonetheless appreciated. 😊

        thelostsoulT 1 Reply Last reply Reply Quote 0
        • thelostsoulT
          thelostsoul @Clyde
          last edited by thelostsoul

          deleted

          πŸ“œ RE/SET: 100 SNES Games for your RetroPie, 🎁 Share your hidden gems and insider tips

          1 Reply Last reply Reply Quote 1
          • ClydeC
            Clyde
            last edited by

            Thanks again. This thread already made it into my RetroPie How-Tos & Tools link collection. 😁

            1 Reply Last reply Reply Quote 1
            • thelostsoulT
              thelostsoul
              last edited by thelostsoul

              deleted

              πŸ“œ RE/SET: 100 SNES Games for your RetroPie, 🎁 Share your hidden gems and insider tips

              1 Reply Last reply Reply Quote 2
              • ClydeC
                Clyde
                last edited by

                What just happened here?

                thelostsoulT 1 Reply Last reply Reply Quote 0
                • thelostsoulT
                  thelostsoul @Clyde
                  last edited by

                  @Clyde Ah damn, I hoped nobody would notice.^^ I've deleted the content manually, nothing bad happened. I am just not happy with the quality of the code, so I thought why sharing something I am not really liking? I also have a version 2 now, which new from ground up. But there are little problems I can just not solve.

                  πŸ“œ RE/SET: 100 SNES Games for your RetroPie, 🎁 Share your hidden gems and insider tips

                  mituM ClydeC 2 Replies Last reply Reply Quote 0
                  • mituM
                    mitu Global Moderator @thelostsoul
                    last edited by mitu

                    @thelostsoul Don't delete the posts. Just update the top post and say what's going on - if you deleted the patcher temporarily to improve it, that's fine. It's really weird to see replies without a context in topics :).

                    thelostsoulT 1 Reply Last reply Reply Quote 1
                    • thelostsoulT
                      thelostsoul @mitu
                      last edited by

                      @mitu I'm sorry, I realized how messed I up with this now. You are right. Some time later I'll do update and add again.

                      πŸ“œ RE/SET: 100 SNES Games for your RetroPie, 🎁 Share your hidden gems and insider tips

                      1 Reply Last reply Reply Quote 0
                      • ClydeC
                        Clyde @thelostsoul
                        last edited by

                        @thelostsoul said in autopatch - a commandline tool for automated patching of roms (Linux, Python 3, snes):

                        @Clyde Ah damn, I hoped nobody would notice.^^ I've deleted the content manually, nothing bad happened.

                        Good to hear, I feared that your account got hacked or that you were upset about something. I even checked your profile to see if any other posts got deleted. 😌

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

                          @Clyde said in autopatch - a commandline tool for automated patching of roms (Linux, Python 3, snes):

                          I feared that your account got hacked

                          What is this, Twitter ?

                          ClydeC 1 Reply Last reply Reply Quote 0
                          • ClydeC
                            Clyde @mitu
                            last edited by

                            @mitu I'm confused. Do you mean that only Twitter can get hacked, or that we should not have this kind of conversations, or …?

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

                              @Clyde I was mocking yesterday's Twitter hack-a-thon.

                              ClydeC 1 Reply Last reply Reply Quote 1
                              • ClydeC
                                Clyde @mitu
                                last edited by

                                @mitu Ah, I bow my head in shame for my ignorance. 😳

                                1 Reply Last reply Reply Quote 1
                                • thelostsoulT
                                  thelostsoul
                                  last edited by

                                  After my genius idea to delete all stuff in this discussion, which only cause trouble and chaos, I figured out to do another attempt and post again. This is version 2 of the little app. The gui and commandline are streamlined into one app. The commandline options are flexible now and it supports a configuration file. Unfortunately in GUI mode only one patch file at a time is supported (but I think this is not a real issue and is a limitation in GUI only). And it can create output folders too. Updated the first post with all relevant information.

                                  It started out so simple.

                                  πŸ“œ RE/SET: 100 SNES Games for your RetroPie, 🎁 Share your hidden gems and insider tips

                                  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.