by Thaxll · 4y ago · 0 comments
I remember that impressive opti on Mario64 and it's using C / GCC: https://www.youtube.com/watch?v=t_rzYnXEQlE
But this engine was desperate to squeeze absolute maximum performance (including hacky hacks to get extra registers), and you can't get that from C.
GBA has some quirks, like the CPU with SRAM that isn't a cache, but an explicitly addressable small bit of memory. If you want functions "cached", you have to do it yourself. It's doable in C with some hacks, but it's an area where code size matters. Getting C code to be small and maximally fast is a https://en.wikipedia.org/wiki/Full-employment_theorem
There's been a resurgence of homebrew commercial releases for the console, and I believe the vast majority of them use SGDK. They seem to perform quite well.
https://github.com/Stephane-D/sgdk
I'm not sure if this is a matter of GCC itself being smart enough in general to generate performant 68000 code. There may be a lot of custom work within SGDK itself to ensure that the generated code is performance competitive.
You can totally write GBA games in just C though. In fact I learned C writing GBA homebrew in my teens.
Plain old C/C++ is really well supported for hobbyist development though: https://github.com/gbadev-org/awesome-gbadev