Choosing tools for Game Boy development
gbdev.io
gbdev.io
If you're just getting started with assembly and want to look at a short program, my maze generator [1] is available on GitHub with annotated source code.
Edit: It appears to be Z80. Have you done any NES ASM?
I can recommend The Ultimate Gameboy Talk for details on it (and much more).
https://m.youtube.com/watch?v=HyzD8pNlpwI
EDIT: I had the SoC and the core names the wrong way around. Thanks svendahlstrand.
https://itch.io/search?q=gameboy
Then while bored in a meeting at work I started looking into coding a hello world for it and quickly found my way to some Assembly tutorials which Ive never had an excuse to touch.
https://m.youtube.com/watch?v=RZUDEaLa5Nw
It seems like a really awesome entry point for C or Assembly. Wondering if anyone has any GB development beginners advice in addition to this post?
Also is there a GameBoy dev zeitgeist or is it just coincidence that I feel like Im seeing a lot of developer stuff pop up for it lately?
https://github.com/Stephane-D/SGDK
a Saturn homebrew showcase - https://www.youtube.com/watch?v=NqKKExcTaKo
I got started as a developer / programmer at about 10/11 with mostly Assembly due to the burgeoning Sonic ROM hacking community. I’m 32 now and I’ve been a professional developer for 12+ years. I owe this scene a lot!
It’s not just you.
- Retro development is “in”, a ton of the kids from the 1990s and 2000s are seasoned programmers with some free time now, or enthusiastic hobbyists.
- The tools have gotten a lot better. RGBDS, GB Studio, emulators with debugging capabilities, etc.
- Game Boy development in particular is an excellent entry point. The system design is simply excellent, and it feels like you’re working with a highly polished “2.0” of something. C works well enough on Game Boy, and assembly is approachable. You’re not writing code for multiple different architectures at the same time.
- Game Boy hardware is still reasonably priced.
- develop games for popular retro platforms. So far Nox Archaist for Apple ][ is the most successful example.
- develop a new hardware as platform. So far I have seen a lot of projects such as Arduboy but none of them is successful enough AFAIK.
We've also seen "new" retro systems like the Playdate.
The lockout circuit on the NES, for example, can be bypassed by sending it a negative voltage spike. You can put the circutry on your cartridge.
Just a few polished examples of that: https://tangramgames.itch.io/tobu-tobu-girl-deluxe
https://user0x7f.itch.io/black-castle
https://binji.itch.io/porklikegb
https://pocketpixel.design/super-jetpak-dx-game-boy-rom.html
https://aiguanachein.itch.io/powa
https://thegreatgallus.itch.io/cavern-mvm-9
https://user0x7f.itch.io/gunship
ASM will tend to be more efficient, especially if written by someone with experience and skill, but that isn't enough to prevent other tools from being used successfully. It's described in much more detail in the linked article.
In order to filter out "Game Boy-like" material on itch.io, you can also use the tag "gamboy-rom". Then it should only show you entries that will run on actual hardware (such as a flash cart or in an emulator):
https://itch.io/games/tag-gameboy-rom
As for advice on starting: a great thing to do is figure out a simple, small project to start with, and dive in. That will help give you concrete tasks to focus your learning of the hardware and dev tools around, and keeping the scope modest will prevent it from being overwhelming. There are a handful of tutorials if you want to try that route, and plenty of support (forums & discord).
Agreed too, Game Boy development has been exploding in the last couple years. GBStudio's arrival really brought making GB games within reach of a much larger pool of people. The ability to make them was no longer limited only those able to write software (or those working with them). This brought in a TON of graphics, music, storytelling and creative talent.
It's kind of amazing that even 20y+ later, a lot of the resources, tools and even websites are the same as back then. The community is just great.
Reading the OP, I think you won't need much more actually - it's not very complicated, which is part of the attraction compared to modern SE... Just start playing around and see where it takes you. Look at code from other people for inspiration.
I can´t recall what were the main sites for classic GB but gbadev.org was a gold mine and seems to still be around and kicking.
I had a fantastic time in high school, grade 11 or so (2005?) - playing with the homebrew development kit at the time…
The joy of GBA is a much broader palette - well - any colours whatsoever, if you’re just talking straight GB (no GBC) - and access to some fun hardware tricks like scaling, extra background layers; honestly - it’s like an SNES pro or something. I love it.
Also a shout out for DS homebrew. Hella fun.
That said, the audio capabilities on the SNES are difficult to use.
Since The 1980s, when LISPers decried Microsoft BASIC’s hegemony we were told that recursive functions are a superior answer. They are for some things, but as soon as you start coding in assembly (pure assembly, not a few lines of Assembly to optimize a C program) you start to see stack calling conventions as a problem as much as a solution.
Some lisp-adjacent languages like clojure use a special syntax for tail-recursive functions[0], so that you document and know at compile time that you don't have a general recursive function.
A number of my Arduino projects break down into definitive layers such as something that spools several threads of graphical data out of the program memory, processes it to make a line for a persistence of vision display, then either flushes pixel data via SPI to a lightstrip or sends the data via the serial line to my PC for testing.
If I recoded it in AVR8 assembly I would have no stack or reenterant or recursive subroutines. Everything would be allocated statically or would go in a register, depending on the graphic data you need a variable number of cursors allocated (like the way dimensions of arrays were set in the configuration of a FORTRAN program long ago.)
I haven't recoded it in assembly because I'm still thinking I might need to switch to a more capable board with a different CPU and the portability makes up for C being a very annoying language (e.g. the stack, calling conventions, and all of that is a problem instead of a solution for the programs I write)
(I think maybe... If performance isn't good enough I'll run a soft AVR8 inside an FPGA and offload the hard parts to the FPGA but that is going from the frying pan to the fire.)
Another alternative to the stack is the approach used by asyncio in Python and many similar frameworks where you maintain flat contexts of execution that can be managed at arms length by some kind of dispatcher but that are executed intimiately by coroutines.
thnx for the alert! does this include mgba?
In any case, mGBA has nothing to do with VBA, so there's no reason why that statement would include it.
Personally, I've been using BGB for 10 years or so, and it's been great.
GB Studio seems to have some of that. Maybe just a little more magic to get it there?
Source: https://github.com/daid/rgbds-live
There was also a precursor to GB Studio which seemed headed in that direction. It was written by the same person who did GBStudio: https://www.chrismaltby.com/projects/gbdkjs