I wrote a Game Boy Advance game in Zig
Zig on GBA & Tooling
- Readers find the write-up interesting but some wish it went deeper than a short post‑mortem.
- There’s curiosity about how to correctly express GBA-specific inline assembly patterns and multi-register BIOS calls in Zig; some ask for examples that are “impossible” or awkward right now.
- Zig’s reliance on LLVM is discussed; Zig is moving away from LLVM libraries but will still support LLVM bitcode output.
- Build issues are reported (on macOS with recent Zig versions) when trying to compile the author’s tooling.
Retro / GBA Development Resources & Hardware Quirks
- People share GBA resources in C: tutorials, libraries, and the gbadev.net community.
- Nim-based tooling (Natu, Xatu) and a commercial GBA game are mentioned as parallel efforts.
- GBA hardware oddities are emphasized: VRAM requires 16‑bit writes; 8‑bit writes “work” but corrupt graphics, and this is easily missed without reading specific docs.
- Similar quirks affect other retro hardware; some note GBA BIOS decompression vs better third‑party compressors like APLIB.
Memory Model, volatile, memcpy, and Packed Structs
- A key pain point: LLVM (and GCC) can optimize loops into
memcpycalls even for bare‑metal targets, which can break MMIO if it changes access width. - Multiple commenters argue the idiomatic fix is to use
volatilefor MMIO; LLVM docs say volatile accesses must not be merged/split or turned intomemcpy. - Some wish for a way to annotate address ranges with special access rules, but others argue this is hard since compilers don’t generally know address ranges at compile time.
- C bitfields and
__attribute__((packed))/#pragma packare discussed as traditional ways to define packed register/struct layouts, with caveats around alignment and ABI.
Emulation vs Real Hardware
- At least one person reports code that wrote 8‑bit to VRAM worked in an emulator but failed on real hardware, underscoring the risk of relying on incomplete emulation.
DS / “Modern” Graphics Discussion
- There’s debate over classifying the Nintendo DS as “non‑modern graphics”; DS has both a 2D tile-based engine and a 3D engine, with many games using tiled 2D.
Programming Environments: Windows vs Linux & Historical Paths
- A long subthread compares learning programming on Windows vs Linux over the years.
- Some describe Windows as historically unfriendly to beginners: lack of obvious built-in compilers/interpreters, confusing tooling, and modern annoyances like the “python” Store stub.
- Others counter that Python and other tools were and are easy to install on Windows, and that difficulties often came from C extensions needing the right Visual C++ toolchain.
- Several people say WSL2 exists largely to make Linux-first tooling usable on Windows; others argue Windows itself is fine but many tools are Linux-centric.
- There’s reflection that in the 80s/early 90s many home computers booted straight into BASIC, making programming more discoverable than on later consumer Windows.
Socioeconomic & Access Differences
- Some push back on the idea that “if you wanted to code, you’d just find the tools,” pointing out constraints: poverty, rural isolation, limited libraries, slow/expensive dial‑up, and language barriers.
- Piracy, floppy sharing, and local magazines are remembered as key channels for compilers and documentation, but access varied widely by country and era.
Alternative On‑Ramps to Programming
- QBasic, GW‑BASIC, Turbo Pascal/C, Delphi, Microsoft Access, and Windows Script Host (VBScript/JScript) are recalled as important gateways.
- Web browsers and HTML/JS are cited as the most ubiquitous but often under‑acknowledged programming environment.
Site / Presentation Nitpicks
- Several note that code blocks on the article’s site overflow rather than scroll on mobile browsers; this is later reported as fixed.