| Each room initializes the four-digit LIFE meter to 1000 (displayed as 10000) with a default drain step of 1 and selects one of three per-room drain rates (adding 45, 34, or 25 per tick into an eight-bit fractional accumulator). Four hourglass pickups in the item table alter LIFE directly: resetting it to 1000, overwriting it to 500, doubling it while setting the drain step to 2, or multiplying both LIFE and the drain step by 5. On room clear, the bonus tally subtracts 8 LIFE units per NMI-synchronized frame into the score while LIFE is at least 8, then executes one final borrow pass to clear the meter and add the remainder (including 0 when LIFE is divisible by 8), spending floor(LIFE / 8) + 1 frames before advancing. | 0x19CF-0x19D10x1827-0x18480x216F-0x21C40x44E3-0x451C0x4638-0x46A70x0F92-0x0F940x0FC0-0x102D0x4413-0x443E0x43F0-0x43F60x1175-0x11880x003B-0x00430x0BD1-0x0BDD | Code |
| Every room's 16-by-12 playable stone layout unpacks into a 224-byte grid buffer in RAM bounded by unbreakable top and bottom border rows, with interior cells first cleared to an empty-space value. In ROM, each room occupies 48 bytes arranged as two consecutive 24-byte (192-bit) bitplanes: the unpacker expands the first 24 bytes into breakable brown stone cells and the second 24 bytes into unbreakable white stone cells across the 192 interior tiles. | 0x1A02-0x1A5A0x1A5B-0x1A7C | Code |
| Picking up a room's key writes an open-door tile into the playfield grid, and entering that open door normally advances the zero-based room index by 1. Collecting a warp item sets a room-status flag that causes the room-advance routine to add 5 before the normal increment, jumping forward by 6 rooms instead of 1. Clearing Room 48 (index 47) while holding fewer than 8 special seal collectibles triggers an extra increment that skips Room 49 directly to Room 50; when exiting a hidden room (where a saved return-room index is nonzero), the routine skips both the normal room increment and the Room 48 seal check. | 0x44E3-0x451C0x454D-0x45530x4563-0x456B0x4573-0x45960x4597-0x45DC0x103A-0x10540x10BC-0x10CE | Code |
| Dana's fireball stock is packed across two bytes as a queue of up to eight two-bit slots (four slots per byte), bounded by a separate capacity counter that caps at 8 when jar upgrades are collected. Picking up a normal fireball writes bit-pair 01 and a super fireball writes bit-pair 10 into the first empty slot within current capacity. Casting a fireball pops the front slot by shifting both packed bytes left two bits through carry into the low two bits of the accumulator. The upgrade routine tests only bit 0 of each two-bit pair to promote a normal slot (01) to super (10) by XORing both bits, and loads its initial bitmask once before the outer loop, so the mask shifts to zero after the first byte's four slots. | 0x46A8-0x46C40x46E5-0x47120x1B5C-0x1B690x25BE-0x25EC | Code |
| Before building OAM sprite entries each frame, the sprite renderer copies the vertical coordinate of all 20 object slots into a 20-byte key array paired with an index array. It sorts all 20 entries into ascending vertical order using a gap-decreasing Shell-style insertion sort whose gap steps down by 1 on each pass from 10 through 1, swapping out-of-order pairs and backtracking by the current gap. It then groups adjacent sorted entries separated by fewer than 16 vertical pixels into horizontal bands (splitting to a new band whenever separation is at least 16 pixels), updates per-band rotation offsets to cycle draw order within crowded bands across frames, and emits two hardware sprites per active object into OAM. | 0x04DE-0x05560x0557-0x061B0x061D-0x064B | Code |
| The controller reader strobes both ports and ORs bits 0 and 1 on each serial read to accept Famicom expansion controllers alongside standard pads, storing raw button bytes for both ports. When the active-gameplay flag bit is clear, the input filter copies only the Select and Start bits from the freshly read raw byte while preserving the other six button bits from the previous filtered state, locking out movement and action changes outside active room gameplay. | 0x038D-0x03D1 | Code |