When I was learning C, I figured out that, because Libretro also uses C, I could simply target Libretro instead of the Game Boy Advance. Not only would this route free me of the restrictions of the Game Boy Advance but also gives me far more flexibility with what libraries and other functionality I could include (say, movies). Plus, the whole point was that I wanted to actually take advantage of the unique features Libretro has.
However, I found out that there are some good reasons why I would target the Game Boy Advance… at least at the current time.
- Drawing graphics in the Game Boy Advance actually appears to be more straightforward compared to from scratch (even in Libretro), especially since…
- …I only have to deal with one screen resolution (240 * 160 pixels) and refresh rate (~60 fps), whereas writing a game from scratch would have to account all of the screen resolutions and refresh rates of any device that might play my game.
- Trying to work within the restrictions of the Game Boy Advance would lead me to write more concise, more efficient code.
- The whole point of Libretro is that I would write a program that targets Libretro, then the program would run in any platform that runs RetroArch or similar forntends. The problem is that, in practice, I would still have to consider the different platforms when compiling. A couple examples are that, while a Libretro program would be a .dll file in Windows, the same file would be a .so file in Lignux. There is also the fact that compiling to a game platform would require a difficult-to-set-up toolchain. Keeping track of all these platforms is complex and invites significant error and confusion. In contrast, while targeting the Game Boy Advance, itself a game platform, requires a difficult-to-set-up toolchain, I have to compile to only one platform: the Game Boy Advance itself. The resulting .gba file can be played in any platform that can play Game Boy Advance games.
- Speaking of platforms, the list of platforms that have a Game Boy Advance emulator overtakes the platforms that support Libretro. More specifically, I can also play Game Boy Advance games through native BSD, BeOS, Dingoo (along with a lot of similar devices), Microsoft DOS, Nintendo DS, Windows Mobile Pocket PC, Windows Phone 8, Windows Phone 10, and any platforms that supports the Java Virtual Machine. Then there is the obvious: I can put my game in a linker that plays the games in an actual, real-life Game Boy Advance.
- Documentation on the Game Boy Advance, including hardware to writing homebrew, is plentiful. Documentation on Libretro development is far less so. In fact, the “go-to” tutorial of targeting Libretro is literally incomplete, unexplained in many areas, and apparently abandoned since years ago.
- The documentation on the Game Boy Advance actually helped me understand programming using Libretro. The “pitch” (in graphics programming) and makefiles (in program compilation) were nebulous concepts until I read the documentation on homebrew of the Game Boy Advance.
There is also the fact that there is that simple appeal of playing in my actual Game Boy Advance a game that I have made myself.
I am still going to support Libretro directly later (maybe make a Game Boy Advance “Lite” version and a Libretro “Deluxe” version). Right now, though, I believe that targeting the Game Boy Advance would be a better next step when moving from the pico-8.