[RELEASE] ezgba v0.1.0a - an EZ4 compatible ROM patcher

Discussion in 'GBA - Hardware, Devices and Utilities' started by foobar_, Aug 21, 2015.

  1. foobar_
    OP

    foobar_ Member

    Newcomer
    20
    26
    Apr 2, 2014
    United States
    I'd like to share a tool I made: ezgba v0.2.0a-2

    The official EZ-Flash 4 client is a piece of crap, so I wrote another one.
    The EZ Flash 4 requires a special header patch to save properly, which my app will apply. In addition, all the standard patches, like SRAM, trimming, IPS, etc. are supported.

    It features a CLI/GUI interface, and is cross platform. Windows, Mac OS X, and Linux users can all enjoy.
    Source code is included; I'm releasing it under the WTFPL-2.

    [​IMG]

    The SRAM patches are 1:1 with gbata, with the exception of ROM padding. gbata likes to ensure the ROM padding is either all 0xff or all 0x00, but I don't know how it determines which value to use. This shouldn't affect anything.

    See the included README.md for more information.

    Extra thanks go to:
    TrolleyDave/FAST6191 - for the SRAM patching thread
    Martin Korth - GBATek, the most useful document in the world




    Download here (v0.2.0a-2)
    Windows users can just run the *.exe.
    On OS X, use homebrew to install the boost and wxmac packages before using.
    If you use Linux, you probably already have boost and wxWidgets.

    New in v0.2.0a:
    • batch processing
    • dummy save creation
    • no installing extra dependencies on Windows

    Download old version (v0.1.0a-3)
    Version 0.1.0a-3 requires the GTK+ runtime: Windows Mac OS X (install the gtk+3 package)

    Batch processing with CLI: Windows OSX/*NIX
    Automatically creating dummy save files with CLI: Windows




    [​IMG] [​IMG][​IMG][​IMG]
     
    Last edited by foobar_, Jan 21, 2016


  2. Adhrast

    Adhrast Member

    Newcomer
    20
    0
    Nov 29, 2006
    Italy
    I think I'm in love with you.
    I've just bought a GBM and a new EZFlash IV MicroSD, and the proprietary client was driving me nuts.
    Also, being a Mac OS user was giving me even more headaches :/
    This is just perfect, keep up the good work!

    EDIT: I was trying on my break at work on Windows, I installed the Gtk runtime and it runs.
    The problem is: I select a rom, I leave everything checked as it is, click the "Write patched file" button, give the rom a name and try to save it on the Desktop. The wheel just keeps spinning and nothing happens :/ what am I doing wrong? I already tried to run it as admin
     
    Last edited by Adhrast, Aug 21, 2015
  3. TecXero

    TecXero Technovert

    Member
    2,814
    906
    Apr 13, 2014
    United States
    Mainframe
    I might have to check this out. It's a bit annoying having to run VirtualBox to just patch a ROM.
     
  4. Adhrast

    Adhrast Member

    Newcomer
    20
    0
    Nov 29, 2006
    Italy
    Wow, this is all far more difficult than I thought.
    I tried to look things up but couldn't get anything to work, when I double click the .app it tells me it can't open it.
    Any tips? This would be wonderful if only I could get it to work...
     
  5. foobar_
    OP

    foobar_ Member

    Newcomer
    20
    26
    Apr 2, 2014
    United States
    I'll need some more information here; what OS version is your Windows/Mac machine? 32-bit or 64-bit?
    Did you have antivirus on your Windows machine? Sometimes they like to deny write permissions for unknown programs.
    Where did you try to save on your PC, local or network drive?
    Did you install GTK runtime on your Mac as well?

    For Windows, try the debug build and post the console output: http://www.datafilehost.com/d/1e46128f
    Give me a screenshot from your Mac too, and I'll have a look.
     
  6. Adhrast

    Adhrast Member

    Newcomer
    20
    0
    Nov 29, 2006
    Italy
    Ok, that was a fast reply :D
    My computer at work is a Windows 7 laptop, 64bit, and yes it has antivirus. I tried to save both on local and on network.

    I tried to install GTK via Homebrew on my Macbook Air 11" (mid 2011), but maybe i didn't install the right "formula"?
    When I try to start "ezgba.app" the screenshot is the answer I get.
    It's Italian, you probably don't even need a translation, but anyway it says "Can't open the application "ezgba.app"."
     

    Attached Files:

    Last edited by Adhrast, Aug 22, 2015
  7. foobar_
    OP

    foobar_ Member

    Newcomer
    20
    26
    Apr 2, 2014
    United States
    I updated the download link on the first post - it's the same thing, except with file permissions fixed. That should fix Mac OS X.
    If it still doesn't open, you need the right gtk runtime - try running brew install gtk+3

    Give it a whirl and tell me if it's fixed :D
     
  8. Adhrast

    Adhrast Member

    Newcomer
    20
    0
    Nov 29, 2006
    Italy
    Whoah man, now everything works perfectly!
    I still have to try it on the flashcard as it's still on its way here, but the patcher now boots up, loads the rom and saves it where I tell it to :D
    So it should be alright!
    Thanks a lot foobar_, what you're doing is EXTREMELY appreciated!
     
  9. Plstic

    Plstic Guru Meditation Error

    Member
    635
    250
    Apr 21, 2010
    United States
    Milwaukee WI
    The patcher seems to hang when trying to patch a game for me. The wheel just keeps on circulating. I'm on windows 10. I don't think it should take too long for it to patch lol.

    EDIT: The debug version you posted earlier works fine.
     
    Last edited by Plstic, Aug 23, 2015
  10. foobar_
    OP

    foobar_ Member

    Newcomer
    20
    26
    Apr 2, 2014
    United States
    Hmm.. I was able to reproduce the neverending spinner issue, but I'll have to investigate sometime later, it's too late for today.

    EDIT:
    Took a quick look, implemented quick fix. Download link in first post updated.
     
    Last edited by foobar_, Aug 23, 2015
  11. JimmyZ

    JimmyZ Sarcastic Troll

    Member
    570
    319
    Apr 2, 2009
    Zimbabwe
    nice work!

    does it include the software reset patch?

    and the ability to create blank save files would be nice, since I'm stuck on firmware 1.74, later versions doesn't work.
     
    Ammako likes this.
  12. foobar_
    OP

    foobar_ Member

    Newcomer
    20
    26
    Apr 2, 2014
    United States
    Reset patch isn't supported, since I don't use it at all. There's a bunch of games that don't play nice with reset patch too.
    If you really wanted reset patch, I think there's already a separate tool for it.

    There's nothing special about creating blank saves.
    Just stick anything in your "sd:/saver" directory - it could be a JPEG of your cat, your favorite mp3, a blank txt file, etc.
    Then rename it to match your ROM file, and the EZ4 will just overwrite it on save.
     
  13. JimmyZ

    JimmyZ Sarcastic Troll

    Member
    570
    319
    Apr 2, 2009
    Zimbabwe
    about reset, yeah I know sometimes it doesn't work but when it works, it's really nice.

    for the blank save, usually users prefer the GUI won't like to do these things.

    no offense.
     
  14. foobar_
    OP

    foobar_ Member

    Newcomer
    20
    26
    Apr 2, 2014
    United States
    I don't think you understand what I was saying..
    I have no incentive to spend too much effort on work I can't benefit from.
    No apologies :evil:
     
  15. suloku

    suloku GBAtemp Advanced Fan

    Member
    862
    491
    Apr 28, 2008
    This is great! Thank you very much! I only have one doubt, ezclient needed a database for correct patching, does your patcher autodetect or this makes it so we don't need the database?

    Also, I like it being command line, there are tons of ways to run it, a simple batch file to drag and drop files on it and get them patched right away.
    And since it is command line anyone can write a GUI for it.

    On a side note, I tried running the gui version after installing gtk3-runtime_3.8.1_64-bit just to find out that it won't run under the 64bit runtime.
     
  16. s3phir0th115

    s3phir0th115 GBAtemp Advanced Fan

    Member
    714
    6
    Dec 31, 2008
    United States
    Thanks for making this! I'm patching my collection for it now, and not needing to boot into Windows or use wine/vm is very helpful.

    Something I might suggest is a batch mode functionality. Doing them one by one is a bit of a pain.

    Fortunately having a command line version made implementing this fairly trivial:

    Code:
    #!/bin/bash
    for a in *.gba; do
      ezgba-cli --in-place -i "$a"
    done
     
    Gyron likes this.
  17. suloku

    suloku GBAtemp Advanced Fan

    Member
    862
    491
    Apr 28, 2008
    I was just about to post the batch file for that (overwrites the gba files, so keep originals):
    Code:
    for /r %%v in (*.gba) do ezgba-cli.exe -i "%%v" --in-place
    
    This one will create new romname-patch.gba
    Code:
    for /r %%v in (*.gba) do ezgba-cli.exe -i "%%v" -o "%%~nv-patch.gba"
    
    EDIT: ok, the database seems to be for creating the save files, I thought it only needed to be a file, but the size does also have to be that of the save file of the game. Too bad I couldn't get the 1.77 kernel working (that is not a gba game message appears when trying to boot).

    Does that really work? I tried with 0 byte files and got my sd corrupted, ezIV client creates them with the supposed filesize of the save.

    Was it because they were 0 byte files? I don't really feel like trying to corrupt my card again for trying (I'm going on a trip in an hour).

    Also, does the patching process depend on the size of the savegame too? I'm asking because if your program detects the save size and type before patching, adding an option to create the correct sized .sav file would be great and very easy to implement. If it needs a database with save sizes it's another story though.
     
    Last edited by suloku, Aug 30, 2015
    Gyron likes this.
  18. foobar_
    OP

    foobar_ Member

    Newcomer
    20
    26
    Apr 2, 2014
    United States
    Zero byte files worked fine when I tested it (was on 1.72 at the time, IIRC).
    Never gotten an error message on 1.77, but I've gotten black screen before. I think we might be on different hardware.
    I've got a Sandisk 2gb mini sd with the more recent but non-microsd EZ4 model, on original AGB-001. What are you using?

    SRAM patch depends solely on save type.

    Can you try a dummy file size of 1024 kB?
    EEPROM has two save sizes, which can't be reliably detected outside of an emulator. I've never investigated, but the official client probably uses the larger size as a one-size-fits-all. If I'm correct about their EEPROM handling, 1024 kB dummy files might work.
     
  19. suloku

    suloku GBAtemp Advanced Fan

    Member
    862
    491
    Apr 28, 2008
    Mine is the ezIV lite deluxe, currently on the 1.72 reset version due to being unable to boot any roms under 1.77, with a 4gB kingston sdhc card (the non sdhc card I've been ysing since I bought it will only be detected if it is fat16 and only when updating the kernel, by the way the 4gB sdhc was unable to updatr thr kernel (black screen).

    I'll test tomorrow again with 0 byte and a 1024 byte files, see what happens, I already though about using the largrst save size as dummy, since that might prevent corruption due to the eziv never writting outside of the file (theorically).

    I've also seen the sources of some tools and seems like detecting eeprom size can't be done, and whilst the others can, and even the 128kB per save even on a 128mB sd card isn't that much...

    Ps: just for personal curiosity, I compared a file patched with your program with the same one patched with eziv client and they are very different, how come? I didn't think they would be the same patches, but neither thought them to be that different
     
  20. foobar_
    OP

    foobar_ Member

    Newcomer
    20
    26
    Apr 2, 2014
    United States
    There are some games (eg. Top Gun, Breath of Fire) that require specialized patches, but ezgba doesn't detect/apply them. gbata and the official client will handle (some of (?)) them, but ezgba relies on user to apply the appropriate IPS patch. Could be you have one of these - there's a list of these games in README.md.
    I used gbata's SRAM patches as base, since there was already a thread on it. When I was experimenting with the official EZ client, it had the same SRAM patches as gbata, but in different locations (ie. the first occurrence of the pattern would be patched instead of the last, etc). I'd be surprised if they were completely different though. What ROM did you test with?