gbiloader (automatic Game Boy Interface loader with .cli config file support)

Release threads for homebrew & utilities only
Post Reply
User avatar
Guspaz
Posts: 8
Joined: Wed Oct 21, 2015 11:16 pm
Location: Montreal, Canada

gbiloader (automatic Game Boy Interface loader with .cli config file support)

Post by Guspaz » Fri Jun 30, 2017 1:42 am

gbiloader is a GameCube bootloader targeting Game Boy Interface. It allows you to automatically start GBI with a custom configuration (via *.cli files) when you turn your GameCube on, and to use an optional menu (hold down "Y" when gbiloader is starting) to change which version of GBI should be loaded by default (GBI/GBI-LL/GBI-ULL/Swiss). This is useful because Swiss only supports *.cli files when you manually load a DOL, it does not support *.cli files for boot.dol.

The latest release of gbiloader is available on GitHub: https://github.com/Guspaz/gbiloader/releases

Instructions on how to set it up and use it can be found in the README.md file in the release zip, and also on the front page of the github repository here: https://github.com/Guspaz/gbiloader

Here's the changelog, which I'll keep up to date:

r2
  • Update included GBI to 20170624
  • Switch build from dollz3 to dolxz (smaller gbiloader DOL file)
  • Updated included Swiss to an unofficial custom build of r414 that has auto-load disabled for boot.dol
r1
  • Initial release. Includes GBI 20170410 and Swiss r387
novenary
Posts: 1756
Joined: Mon Dec 30, 2013 7:50 am

Re: gbiloader (automatic Game Boy Interface loader with .cli config file support)

Post by novenary » Fri Jun 30, 2017 2:38 pm

Guspaz wrote:This is useful because Swiss only supports *.cli files when you manually load a DOL, it does not support *.cli files for boot.dol.
Why not make a pull request to Swiss instead of writing an entirely new program then?

Also, be careful with dolxz, it can cause a few issues, like not being able to load from Qoob flash. You should keep releasing both.

For the infinite boot loop, you should just use a different file name than Swiss. iplboot uses ipl.dol for example.
User avatar
Guspaz
Posts: 8
Joined: Wed Oct 21, 2015 11:16 pm
Location: Montreal, Canada

Re: gbiloader (automatic Game Boy Interface loader with .cli config file support)

Post by Guspaz » Fri Jun 30, 2017 11:57 pm

Streetwalker wrote:Why not make a pull request to Swiss instead of writing an entirely new program then?
The largest reason is that I'm not comfortable working in C (as a software developer, it's a language I haven't worked with in 15 years), so having a separate application allows for more amateur code to be used than I'd feel comfortably proposing for a more polished project like Swiss. It's not entirely new, though, this is a fork of brosexecconf, though extensively modified at this point. Other reasons, however, include specialization. I'd imagine it wouldn't be that hard to get Swiss loading a boot.cli file, but Swiss wouldn't have an easy way to swap between different versions of GBI as gbiloader's menu provides, Swiss is slower to load since it's a bunch larger (Extrems tells me I could get it smaller if I switched away from posix file operations, but it's not exactly bloated at 94KB), Swiss doesn't seem to allow configuration changes if its loaded from a read-only medium (gbiloader always looks for its config on SD even if its DOL is on a DVD or elsewhere), and I've got some other GBI-specific ideas that wouldn't make sense for Swiss (GBI config profiles changeable via the boot menu for example). Basically, I wanted something more tailored and specialized, so I looked for existing code to use as a base, and made this. I fully realize that Extrems will probably make gbiloader largely pointless in the future as he adds better configuration support to GBI, but that'd be great.
Streetwalker wrote:Also, be careful with dolxz, it can cause a few issues, like not being able to load from Qoob flash. You should keep releasing both.
I've included both DOL/GCI files compressed with dolxz (94/97 KB) as well as an uncompressed DOL (187KB) in the release package, so people have the choice to use other compression types if they want, or none at all. I only included a dolxz copy of Swiss for the custom build, but since gbiloader only loads DOLs (and other files) from SD cards, you would never be using gbiloader to load Swiss from Qoob flash. The goal was to let you boot gbiloader itself however you want (burned DVD, SDML disc, Swiss boot disc, modchip flash, memory card exploit), but then have everything it loads be from an SD card, since SDGecko type products are super cheap.
Streetwalker wrote:For the infinite boot loop, you should just use a different file name than Swiss. iplboot uses ipl.dol for example.
I think you've misunderstood the problem. If you use Swiss to autoboot gbiloader (say for example a Swiss boot disc), then you must name gbiloader "boot.dol" on the SD card. If you then use gbiloader to start Swiss, then Swiss will turn around and load boot.dol, which is gbiloader, which will then in turn remember your preference to autoboot Swiss, and so on. You can easily escape this infinte loop (hold down "Y" and gbiloader will give you the menu to pick what it starts), but it basically means that gbiloader cannot load Swiss if it was itself loaded from Swiss.

This is only a problem if you load gbiloader from Swiss. If you use any other method to load gbiloader, then you're going to have named gbiloader something else, or gbiloader itself won't be on the SD card, and you won't have an issue. My solution to this problem has been to include a custom build of Swiss that has autoboot disabled (so two copies of Swiss are involved), but I'm open to other solutions. This was just the easiest way I could think of to solve the problem.
novenary
Posts: 1756
Joined: Mon Dec 30, 2013 7:50 am

Re: gbiloader (automatic Game Boy Interface loader with .cli config file support)

Post by novenary » Sat Jul 01, 2017 12:31 pm

- Swiss isn't exactly the cleanest code base I've seen, though it's improving, the recent refactor of the device handling system is a good example of that.
- Loading a boot.cli file is trivial, and so is adding a hotkey to cancel loading boot.dol during startup. I'll add both. I sort of get that you want to be able to switch configs for the same variant of GBI, I suppose the easiest way to do that is to have multiple copies of GBI on the same SD card.
- iplboot uses FatFs instead of the libfat bundled with libogc, this is a much greater improvement than switching from stdio to the POSIX file API. It was necessary in my case to allow fitting in 64KB or less for Qoob SX support.
- Swiss now supports loading config files from an arbitrary device, no matter where it's booted from.
- I must have misunderstood what you did with compression, I didn't look at the repo in too much detail.
- Bootloops would be a non-issue with Swiss fixed to do what you want. Another option would be to use your loader as the boot DVD. I'm going to add an extra way to chainload Swiss on bootup for more specific use-cases.

In case you're interested, I've implemented this stuff here, and it'll be in the next build.
pargordius
Posts: 13
Joined: Sat Sep 02, 2017 5:12 am

Re: gbiloader (automatic Game Boy Interface loader with .cli config file support)

Post by pargordius » Sat Sep 02, 2017 5:15 am

I have a very specific use case for this:

I want two copies of gbi-ll on a disc, one with configs optimized for GBA and the other with configs for GB/GBC. I've forked your repo and edited the main.c file, but for life of me I can get the thing to compile.

Any tips?
Post Reply