Post #1944160
2026-03-02 21:15 UTC
@jcoglan @nicuveo All arguments are passed on the stack. No registers are ever used to pass arguments. The stack routines take dozens of instruction before calling a function, and dozens again in the function epilogue. A trivial function becomes a pile of mess.
Plus, simply doing "complex" maths (e.g "x = 64 / 10") will generate a ton of instructions to divide by a non-power-of-two value. When writing assembly code, this is visible, and worked around. Not in C.
Replies (1)
-
@pmorinerie@mastodon.xyz 2026-03-02 21:19
@jcoglan @nicuveo and all of this bloat matters! This isn’t even about hot loops; more about general bloat. The Game Boy has a very limited number of cycles available each frame – around 10 000 instructions. That’s it. So bloating the code by a factor 10 for no reasons will make you hit the frame budget _very_ quickly.