GBA injection

Discussion in 'Wii U - Hacking & Backup Loaders' started by ajd4096, Dec 9, 2015.

?

Will I answer dumb questions?

  1. No!

    18 vote(s)
    34.0%
  2. Hell, no!

    35 vote(s)
    66.0%
  1. ajd4096
    OP

    ajd4096 GBAtemp Regular

    Member
    176
    187
    Feb 17, 2009
    If you have to ask for a guide, you probably shouldn't be doing it.

    Script is here:
    https://github.com/ajd4096/inject_gba

    Of 2810 roms, 2810 can be injected.

    On an N54L, that took about 2.5 hours and used about 118G
    (find|xargs is your friend)
    -----
    To install (needs python3)
    python setup.py install
    -----
    inject_gba -h

    inject_gba --inpsb=/path/to/alldata.psb.m --inrom=/path/to/new.gba --outpsb=/path/to/new/alldata.psb.m

    Options:
    --allow-overwrite
    --create-backup
    Do what it says on the tin.

    --prefix=PREFIX
    Prefix the new ROM with goomba or pocketnes.
    (I don't include these, get them from dwedit's site.)

    --pad00 --padFF
    Pad to original length with 00s or FFs.
    I haven't found any games which need this, YMMV.

    The gui automatically assumes --create-backup and --allow-overwrite.
    There is a wizard sequence for setting the prefix/padding options.
    -----
    Batch processing:
    inject_gba_batch -h

    inject_gba_batch --base=BASEDIR *.gba

    This will create a sub-dir for each ROM file, copy BASEDIR into it, and inject the ROM into the copy.
    (BASEDIR defaults to 'base' in the current directory)

    This also supports @optionfile, so you can set --prefix=goomba.gba etc.

    For the drag-n-droolers, you can create a desktop shortcut as a drop target.
    -----
    GUI
    inject_gba_gui -h
    -----
    When in doubt, RTFS.
     
    Last edited by ajd4096, Jun 1, 2016
    Baphomet, Pachee, josamilu and 14 others like this.
  2. pedro702

    pedro702 GBAtemp Guru

    Member
    6,734
    2,163
    Mar 3, 2014
    Portugal
    well i will wait for an idiot proof tutorial by someone lol.
     
  3. daxtsu

    daxtsu GBAtemp Guru

    Member
    5,546
    3,955
    Jun 9, 2007
    Antarctica
    As long as your game compresses down to 8 megabytes or less (you can test by zipping your ROM to get a general idea, but obviously, don't feed this script the zip file, give it the raw gba file), here's how I did it:
    • Open command prompt/terminal window
    • Code:
      python inject_gba.py -z alldata.bin your-rom-file.gba
      

    • Put your-rom-file.adb that you get from the Python script onto your SD card where appropriate (/wiiu/games/your-gba-game/content) and rename it to alldata.bin
    • Run game through Loadiine
    If you've used Python, before it's no different than running any other scripts, really. Just use -z if you have The Minish Cap as your base game, or -m if you have Mario.

    Edit: As a side-note, FireRed works great, but you can't save. C'mon Nintendo, support more save formats! :P
     
    Last edited by daxtsu, Dec 9, 2015
  4. asper

    asper GBAtemp Advanced Fan

    Member
    651
    330
    May 14, 2010
    United States
    Maybe we should try to use a game with native supported savestate and use the emu (rpx) inside it to inject. Any candidate title ?
     
  5. daxtsu

    daxtsu GBAtemp Guru

    Member
    5,546
    3,955
    Jun 9, 2007
    Antarctica
    You mean for FireRed/LeafGreen? I doubt any of the current GBA VC emulators support the save type it uses.
     
    asper likes this.
  6. hippy dave

    hippy dave Butts Butts Megabutts

    Member
    2,592
    1,805
    Apr 30, 2012
    Aren't there save patches for the dang pokemong games?
     
  7. daxtsu

    daxtsu GBAtemp Guru

    Member
    5,546
    3,955
    Jun 9, 2007
    Antarctica
    Not for FireRed/LeafGreen as far as I can tell, but I didn't Google for that long (went in maybe 3 pages deep), to be honest.
     
  8. EclipseSin

    EclipseSin FullMental Trollemist

    Member
    1,813
    1,287
    Apr 1, 2015
    United States
    Vegeta's Hyrule
  9. Markus95

    Markus95 Advanced Member

    Newcomer
    90
    194
    Aug 20, 2015
    France
    Thanks ^^

    Works perfectly, tested with Mario Kart super circuit rom in Zelda VC...

     
    ajd4096 likes this.
  10. pedro702

    pedro702 GBAtemp Guru

    Member
    6,734
    2,163
    Mar 3, 2014
    Portugal
    fire red saves work if you used the patched save versions like

    Pokemon - Fire Red Version (U) (V1.0) [f1].gba xD
     
    paulloeduardo and ajd4096 like this.
  11. EclipseSin

    EclipseSin FullMental Trollemist

    Member
    1,813
    1,287
    Apr 1, 2015
    United States
    Vegeta's Hyrule
    Cool, thanks for the info pedro.

    @ajd4096 Quick question about the keys. Does it apply to the entire bin file, or just the rom mdf section (cause of know string in original file)? I was looking through the RPX for configuration settings of any kind, such as sound bitrate, screen width, patches, etc, but it looks like just the functions in there, not the actual config file. Unless I missed it or it is hardcoded.

    Anyone else with info?
     
  12. ajd4096
    OP

    ajd4096 GBAtemp Regular

    Member
    176
    187
    Feb 17, 2009
    These keys match just the rom section.

    @FIX94 I believe you made some progress on the alldata.psb.m? Can you shoot me your notes?
    I've tried poking at the seed/hash/mt19937 approach (from exm2lib) but haven't had much luck yet.
     
    eco95, paulloeduardo and EclipseSin like this.
  13. pedro702

    pedro702 GBAtemp Guru

    Member
    6,734
    2,163
    Mar 3, 2014
    Portugal
    i see you did several new commits did anything new works now like the nes/gb/gbc gba files?
     
    paulloeduardo likes this.
  14. ajd4096
    OP

    ajd4096 GBAtemp Regular

    Member
    176
    187
    Feb 17, 2009
    Did you read the commit messages?
     
    eco95 and EclipseSin like this.
  15. EclipseSin

    EclipseSin FullMental Trollemist

    Member
    1,813
    1,287
    Apr 1, 2015
    United States
    Vegeta's Hyrule
    Thanks for the new stuffs. :3
     
  16. pedro702

    pedro702 GBAtemp Guru

    Member
    6,734
    2,163
    Mar 3, 2014
    Portugal
    yeah i see you added more games support but i dont know if you actualy changed anything besides that.
     
  17. ajd4096
    OP

    ajd4096 GBAtemp Regular

    Member
    176
    187
    Feb 17, 2009
    Note that injecting homebrew roms this way does not work at all.
    This includes goomba, pocketnes, anything I compile myself, and any other homebrew games in my collection.

    For now, to use homebrew roms you need to use RAM injection or vWii + mGBA or similar.
     
    eco95 likes this.
  18. ajd4096
    OP

    ajd4096 GBAtemp Regular

    Member
    176
    187
    Feb 17, 2009
    Injecting homebrew is all fixed - it turns out you need to pad the rom with FFs before compressing.
    I have confirmed goomba, goomba color, and pocketnes all work.

    After doing a dozenty crash/restart cycles, I have even more respect for the loadiine developers.
     
  19. pedro702

    pedro702 GBAtemp Guru

    Member
    6,734
    2,163
    Mar 3, 2014
    Portugal
    thanks for the fix xD
     
    paulloeduardo likes this.
  20. eco95

    eco95 Advanced Member

    Newcomer
    69
    38
    Dec 3, 2014
    Taiwan
    Thank you so much for this wonderful tool!!

    I will give it a try~!
     
    Last edited by eco95, Feb 4, 2016