Hacker News new | past | comments | ask | show | jobs | submit login
Butano: Modern C++ high level GameBoy Advance engine (github.com/gvaliente)
86 points by ingve on Nov 14, 2020 | hide | past | favorite | 17 comments



I remember trying to make a C compiler for SNES almost 15 years ago. The expert on the SNES architecure who I was working with was 14 years old.


I'm sure you're just throwing in a personal anecdote of interest and already know this, but for readers unfamiliar with these pieces of hardware:

The SNES (early 90s) and the GBA (early 2000s), despite roughly similar graphical capabilities, are vastly different machines. The SNES uses a 65816-based architecture running at ~3MHz that's extremely hard to compile C down to while still getting acceptable performance/code size - almost all games for it were coded in assembly language.

By comparison, the GBA uses an ARM7-based architecture running at ~33MHz. GCC was available for it literally before it came out. Even though I'd experimented a bit with QBASIC when I was younger, plugging away on the GBA when I was around 14 was how I learned C, how computers really work at a low-level, and roughly speaking, how to "really" code.

So this isn't a GBA C++ compiler - that's existed for ages. This is a "just" game engine. It's super cool that people are still working on stuff like this - the GBA is a very fun platform to develop a game on, at a nice sweet spot between straightforward enough to get started on, powerful enough to make something cool, not so powerful that you need a team of dozens to make something impressive (for the platform).


The GBAs ARM7TDMI runs at ~16MHz.


Ah, my bad. I misremembered. Was probably muddling it with either the DS, as the other commenter mentioned, or the MIPS CPU in the Playstation.


(The Nintendo DS featured a 33 MHz ARM7TDMI.)


Any idea what became of them?


Sorry, was confused by "them". Yeah, he is basically the creatpr of all the big programming tutorials on snes programming. But to be such a giant he was mighty uninterested. He wanted to get into making music instead.


snesc by lordtech?


Worth also mentioning smaller game engines for devices like the GameBoy (Color): https://github.com/Zal0/ZGB


There are also higher-level tools to create GameBoy games, such as GB Studio: https://www.gbstudio.dev/


Beautiful! Is sprite rendering the only way to draw pixels to the screen? And is the Audio API of real time synth?


No, you can directly rasterize to the screen buffer:

https://www.coranac.com/tonc/text/bitmaps.htm

However, you’re limited to the CPU’s (relatively) mediocre processing power. This is exactly how some of the raycasted game engines were built, though:

https://m.youtube.com/watch?v=eD1RRESSF6Y

And, if you look at open source raycaster engines, they’ll use either Mode 3 or Mode 4, usually with a background enabled:

https://github.com/jduranmaster/GBA-caster/blob/dd62073a4371...


Looks like it supports raster effects, but from what I'm seeing this engine does not e.g. support writing directly to the framebuffer.


There is no framebuffer on the GBA, just sprites and tiled backgrounds. Although if it's like on the DS, I don't recall exactly, you can setup a background in such a way that it emulates a framebuffer. Handy for software 3D.


There are bitmap modes on the Advance:

https://www.coranac.com/tonc/text/bitmaps.htm


I'm a little confused. So is this better than an emulator?


Game engine, not emulator. It's for creating games that run on the GBA (.. or on a GBA emulator)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: