Elektrine lite

← Feed

@pmorinerie@mastodon.xyz

Post #1944158

2026-03-02 21:09 UTC

@jcoglan @nicuveo yes, but… A while ago, I investigated using the SDCC compiler to write code for the Game Boy Color. I usually read and write Game Boy code in assembly (that’s how all the GB games were written back then). So I know how to do basic things, how to write an idiomatic array enumeration, a handful of clever (and not really mandatory) assembly tricks, etc. That said, how nice would it be to write C – instead of spending hours at "how to multiply those numbers"? Well: it is awful.

Replies (1)

  • @pmorinerie@mastodon.xyz 2026-03-02 21:12

    @jcoglan @nicuveo for a start, the very-close-to-the-metal constructs don’t map really well to the C language. The C SDK is full of "Use this macro to do magic side effects", some areas of memory become locked or unlocked at specific points… But the main thing is that the generated code is awfully bloated. Easily 10x the assembly version.

    Open ##1944159