The cartridge

16 KB in page 1 (0x4000-0x7FFF), with no bank switching. The "AB" header declares only INIT (0x4077).

What INIT does

INIT sets interrupt mode 1, writes a jp into the H.KEYI hook (0xFD9A) pointing at 0x402C, puts the stack at 0xE400, clears the work RAM 0xE000-0xE3FF, and then falls into a jr to itself at 0x40A4. From that point on the main program does nothing: the interrupt, once per frame, runs the whole game.

The screen

SCREEN 2. The cartridge does not store whole screens: it stores scripts. The name table is filled by the interpreter at 0x405E, and the pattern and colour tables by the run-length decompressor at 0x440D.

The RAM map

Everything the game touches lives from 0xE000 up, under the stack at 0xE400: