5 ms·
I have long thought that the GBA would be an excellent teaching platform for low-level programming if only Nintendo would allow it. It has the feature that 100
by corysama 11y ago
I have long thought that the GBA would be an excellent teaching platform for low-level programming if only Nintendo would allow it.
It has the feature that 100% of it's functionality is controlled through memory-mapped structs. You can define the whole hardware API in a single c header of struct/address pairs. To do anything, you write to those addresses and stuff happens. No magic, black-box libraries required (I guess there is the BIOS...)
It's also incredibly underpowered. You get a low number of clock cycles per frame to do everything. The lack of power, lack of cache and simple instruction set makes it an actually really good target for self-modifying code.
And, not least of all: it's literally a device built for having fun!
- Torgo 11y agoHacking on the GBA gave me the motivation to learn embedded programming in C. You need to know how to handle memory-mapped registers, create C structs with proper alignment to interface with the hardware sprite/tile acceleration, direct memory access, and how to manipulate GCC to do things like override functions with BIOS functions or build freestanding binaries with custom chunks of boot assembler. This sounds intimidating as hell, but it is a fantastic motivator to learn these things to see your own little animation on actual game hardware.
- patzerhacker 11y ago>if only Nintendo would allow it You could easily teach a course on it. Have the students purchase a GBA flash linker and GBA and then teach the course. The students can flash their GBA games into the flash linkers, and you make the term project a completed game.
- wingerlang 11y agoI went to a university where my direction was programming/game development. We had a course in, I can't remember for sure, C perhaps, and it included making a game for the GBA. It was some time ago but I remember it was quite interesting.
- kruhft 11y agoThere's plenty of emulators out there.
- corysama 11y agoYep! The fact that the GBA has many quality, free emulators is a big bonus. It allows people with no access to hardware to participate. At least one (no$gba ?) even has a built-in debugging interface and can be debugged with gdb! I did my tiny experiments in homebrew dev on an emulator. A year later, I bought a flash cart, booted up my old program on a real device and it worked! :D
- kruhft 11y agono$ is awesome. I used (and paid for) it for all my professional development when I was writing GB/GBA games.
- pornel 11y agoI wholeheartedly agree! The graphics modes are fun to program for too. You can start with a simple mode 4 that is a bunch of pixels, and eventually advance to "mode 7" with pseudo 3d made with tricks in hblank, and a custom vram tile allocator to support larger-than-vram scenes.
- fcanas 11y agoAround 2006-2007, I TAed a course at Cornell (CS212 I think?) that did exactly this. Three other TAs and I basically got to fork the course. We did a bunch of R&D into tooling and taught a small group of interested and motivated students how to build a non-trivial piece of software from start to finish. I think it worked out very well.
- bane 11y agoMany years ago, I spent a little bit of time trying to apply my undergrad coursework to making a game for my TI-89 calculator. There was a simple IDE somebody had made and I was able to test in an emulator and then on real hardware. I got so far as having some sprites moving around the screen and shooting and had to put it all to rest before I got around to implementing collision detection but I learned an incredible amount from it. The most interesting thing is that the solutions I came up with (and thought were very clever) I found out later were often the "way" things were actually done in the commercial world. Like screen buffering, how to define a sprite as data, sprite composition, the game loop, etc. I probably had to tackle and figure out a couple dozen challenges and most of them turned out to be reasonable solutions to the problem. The hardware target being very simple also forced me to think about optimization and compute cost in ways I hadn't thought of before. I wish it had been a formal course in Uni. Everbody had a TI calculator of some sort anyways, and a semester of building a simple game would have been tremendously educational.