Hacker News new | ask | show | jobs
by t8y 1602 days ago
IMO C for GameBoy dev is a non starter. It's so different from other platforms that you really just want to control the instructions directly. Say you type "a * 5" that would just be one instruction on a regular cpu but it must be some more expensive function on a GameBoy. Even bit shifting can only shift one bit at a time, 1<<8 is 8 instructions. When programming in ASM it's usually that more instructions is slower so for a bit shift it might make sense to have a lut or something, C would hide it behind a single operator.
1 comments

Plenty of games are being written in C for the Game Boy on a regular basis.

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

https://www.infinitygbc.com/

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.