[Francis Stokes] has a genuine love for the original Game Boy, suggesting that owning that machine pushed him down a particular path that many of us would recognize. Developing Game Boy games is not particularly difficult from a hardware point of view, as you can easily buy special cartridges that have an SD card slot, which allows custom code. [Francis] had the idea of easy software development by producing a typed hardware abstraction library, TEGA (or TypeScript Embedded Game Boy Macro Assembler). This provides a safe environment to play with the code, which can then be run inside an emulator such as BGBbefore it is deployed on actual hardware.
The video embedded below – which we warn you now is long – goes into extensive reasoning and technical explanation of how [Francis] leverages typescript to create many nice features to produce secure code, while handling many of the Game Boy’s architectural restrictions, as well as the quirks of the Sharp SM83 processor that powers it. We especially liked the built-in support for on-the-fly asset compression, since every byte counts in the meager 32Kb system, it’s nice not to have to think about it all the time! After discussing TEGA, the Game Boy hardware, the ins and outs of a demo game Block jumpand how to debug with BGB, we’re pretty sure many of you will be in a strong position to stop a Game Boy application in the future!
As an aside, we also stumbled upon one new hardware guide provided by Finnish programmer and Game Boy superfan [Joonas Javanainen] which will help to frame some of the topics [Francis] talked about.
You may remember a little while back, the same author purposefully RISC-V uses code written in typescript. After all, once you’re comfortable with a tool, you can shape it into practically anything.
Continue reading “TEGA: Typescript Embedded Game Boy (Macro) Assembler”