Claim set · data/claims/gyromite.yaml

Gyromite (World) mechanics read in the ROM

Game: Gyromite.

The main loop increments a global frame counter on every active frame, and its low two bits divide world updates across a strict four-frame round-robin schedule. On phase 0, Smick enemies advance their walk or climb by one pixel for an effective speed of 0.25 pixels per frame (while unsupported falling runs every frame at 1 pixel per frame). On phase 1, the dynamite routine checks bomb defusal; on phase 2, red gates update; and on phase 3, blue gates update. gyromite/four-frame-round-robin-entity-schedule

Value: 4 frames

CodeGyromite (World) · 0x007D-0x0088 — $806D-$8078: main loop increments frame counter $002E once per NMI frameGyromite (World) · 0x20A2-0x20E9 — $A092-$A0D9 (sub_00_A07E): unsupported Smicks fall 1 px every frame ($A092-$A0A4), while walking and climbing are gated by ($002E & $03) == 0 ($A0BE-$A0C3)Gyromite (World) · 0x10A6-0x10AD — $9096-$909D (sub_00_9096): bomb defusal loop executes only when ($002E & $03) == 1Gyromite (World) · 0x07CA-0x0800 — $87BA-$87F0 (sub_00_87BA): checks ($002E & $02) != 0, then routes ($002E & $01) == 0 (phase 2) to Red gates ($004D) and == 1 (phase 3) to Blue gates ($004E)Checked by claude, 2026-11-26 — disassembled $806D-$8078, $87BA-$87F0, $9096-$909D, and $A092-$A0D9 directly from the World ROM

The timer routine decrements a sub-divider from 10 through 0 and reloads 10 on underflow for an 11-frame cycle: two fast timer slots decrement on every call while two slow timer slots decrement only on underflow. Each phase loads 999 into a three-digit binary-coded decimal clock that subtracts 1 whenever the first slow timer reaches zero and reloads that timer to 2, ticking once every 22 frames. After all six bombs are defused, the end-of-phase tally runs on even frames, draining 10 clock units per pass (for 10 points each, averaging 5 units per frame) while at least 10 remain and 1 unit per even frame below 10. gyromite/eleven-frame-timer-divider-and-bcd-phase-clock

Value: 22 frames

CodeGyromite (World) · 0x303A-0x305A — $B02A-$B04A (sub_00_B02A): decrements $0029 (10..0); scans X = 1..0 ($002A-$002B) normally, and on underflow reloads #$0A and scans X = 3..0 ($002A-$002D)Gyromite (World) · 0x0446-0x044D — $8436-$843D (sub_00_83D1): initializes phase timer BCD bytes $005D = #$99 and $005E = #$09 (999)Gyromite (World) · 0x0D5E-0x0D96 — $8D4E-$8D86 (sub_00_8D4E / sub_00_8D52): when slow timer $002C == 0, subtracts 1 in BCD from $005D/$005E via $B19D and reloads $002C = 2 (2 x 11 = 22 frames)Gyromite (World) · 0x0F31-0x0F7B — $8F21-$8F6B (sub_00_8F21 / sub_00_8F5D): on even frames ($002E & 1 == 0), loops 10 times subtracting 1 timer unit and adding 10 points while timer >= 10, or once per even frame when < 10Checked by claude, 2026-11-26 — disassembled $8436-$843D, $8D4E-$8D86, $8F21-$8F6B, and $B02A-$B04A directly from the World ROM

On every fourth frame, the bomb routine scans all six dynamite slots and tests both vertical and horizontal distance to Professor Hector against a threshold of 9 pixels, decrementing the remaining-bomb count from 6 toward 0 and clearing the phase once it reaches 0. The shared distance check subtracts the player coordinate from the bomb coordinate and, on borrow, applies a bitwise one's complement without adding 1. Because one's complement understates negative differences by 1 pixel, the box accepts signed offsets from -9 through +8 pixels on each axis, granting one extra pixel of reach when approaching from below or to the right. gyromite/asymmetric-ones-complement-bomb-hitbox

Value: 9 pixels

CodeGyromite (World) · 0x0D4E-0x0D5D — $8D3E-$8D4D (sub_00_8D3E): computes $00 - $01; on borrow (BCC) runs EOR #$FF without +1, then returns 0 if result < $02, accepting $00 - $01 in [-$02, +$02 - 1]Gyromite (World) · 0x10A6-0x1118 — $9096-$9108 (sub_00_9096): scans 6 bomb slots ($0660 down to $0610), calling $8D3E on Y and X with threshold #$09 and decrementing $005F on overlapGyromite (World) · 0x0DBF-0x0DC9 — $8DAF-$8DB9 (sub_00_8D87): when bombs remaining $005F reaches 0, transitions to phase-clear state via $B230Checked by claude, 2026-11-26 — disassembled $8D3E-$8D4D, $8DAF-$8DB9, and $9096-$9108 directly from the World ROM

Walking horizontally across a rope writes 10 into a fast frame timer when crossing the rope's center pixel (tile offset 7 walking right, or 9 walking left) and still takes that frame's step; because timers decrement before gameplay updates on each frame, horizontal movement stalls for 9 frames (counts 9 down to 1). In the player movement dispatcher, horizontal walking handlers run before vertical rope-climbing handlers on the same frame whenever horizontal position falls within tile offsets 4 through 12, so holding a diagonal can invoke both the vertical tile-center snap (from horizontal movement) and the horizontal rope-center snap (from vertical climbing) in a single frame. gyromite/rope-crossing-stall-and-tile-boundary-snaps

Value: 9 frames

CodeGyromite (World) · 0x0073-0x0078 — $8063-$8068: main loop calls timer update sub_00_B02A ($B02A) before gameplay dispatcher sub_00_80DD ($80DD)Gyromite (World) · 0x303A-0x305A — $B02A-$B04A (sub_00_B02A): decrements fast timer $002A (X = 0) on every frame callGyromite (World) · 0x2AEB-0x2B31 — $AADB-$AB21 (sub_00_AADB / sub_00_AAF0): rightward walk on a rope loads #$0A into fast timer $002A at (worldX & $0F) == 7, branches to $AB3B to complete that frame's step, and exits early on the following 9 frames ($002A = 9..1)Gyromite (World) · 0x2B4B-0x2B56 — $AB3B-$AB46: rightward movement step invokes vertical tile-center snap sub_00_AD54 ($AD54)Gyromite (World) · 0x2BB0-0x2BF7 — $ABA0-$ABE7 (sub_00_ABA0): leftward walk on a rope loads #$0A into fast timer $002A at (worldX & $0F) == 9, branches to $ABF7 to complete that frame's step, and exits early on the following 9 frames ($002A = 9..1)Gyromite (World) · 0x2C07-0x2C12 — $ABF7-$AC02: leftward movement step invokes vertical tile-center snap sub_00_AD54 ($AD54)Gyromite (World) · 0x2983-0x299E — $A973-$A98E (sub_00_A940): calls right/left handlers ($AA22, $AA4E) before checking (worldX & $0F) in [4, 12] and calling down/up rope-climb handlers ($AA7B, $AAC1) in the same frameGyromite (World) · 0x2C4F-0x2C5A — $AC3F-$AC4A (sub_00_AC3F): climb-up step invokes horizontal rope-center snap sub_00_ACFC ($ACFC)Gyromite (World) · 0x2C87-0x2C92 — $AC77-$AC82 (sub_00_AC77): climb-down step invokes horizontal rope-center snap sub_00_ACFC ($ACFC)Gyromite (World) · 0x2D0C-0x2D63 — $ACFC-$AD53 (sub_00_ACFC): snaps horizontal coordinate $06E9 to the 16-pixel rope center relative to scroll $000A during vertical climbing and fallingGyromite (World) · 0x2D64-0x2D79 — $AD54-$AD69 (sub_00_AD54): snaps vertical coordinate $06E8 to ($06E8 & $F0) | $08 (floor tile center) whenever ($06E8 & $F0) >= 8 during horizontal movementChecked by claude, 2026-11-26 — disassembled $8063-$8068, $A973-$A98E, $AADB-$AB21, $AB3B-$AB46, $ABA0-$ABE7, $ABF7-$AC02, $AC3F-$AC4A, $AC77-$AC82, $ACFC-$AD69, and $B02A-$B04A directly from the World ROM

Red and blue gates respond to controller 2's A and B buttons read as level-sensitive held inputs, cycling between idle-up, lowering while held, and committed raising back to stage 0 once released. While a button remains held, the shared gate stepper keeps incrementing the gate's stage counter up to 7 (clamping only at 8), even though the tile renderer stops updating short gates at stage 5 (fully lowered at stage 4) and tall gates at stage 7 (fully lowered at stage 6). Holding past full extension therefore builds up invisible overshoot stages that must count back down before the gate visibly begins to rise. gyromite/pillar-stage-counter-overshoot

Value: 7 stages

CodeGyromite (World) · 0x2F5A-0x2FA3 — $AF4A-$AF93 (sub_00_AF4A): reads controllers 2 and 1, storing level-sensitive P2 A/B bits ($80/$40) in $07F5 and combining held D-pad with rising-edge A/B for P1 in $0016Gyromite (World) · 0x07CA-0x0834 — $87BA-$8824 (sub_00_87BA): transitions gate state $004D/$004E from $00 to $11 while P2 A/B is held and commits to $01 (raising) when releasedGyromite (World) · 0x0A6B-0x0A9B — $8A5B-$8A8B (sub_00_8A5B / sub_00_8A72 / sub_00_8A81): while lowering ($52 & $10), increments stage counter $54 up to 7 (clamping at CMP #$08; DEC $54); while raising, decrements $54 down to 0Gyromite (World) · 0x0869-0x08E8 — $8859-$88D8 (sub_00_8859): returns early without drawing once stage $54 >= 5 for short gates ($8865: CMP #$05) or >= 7 for tall gates ($88A0: CMP #$07)Checked by claude, 2026-11-26 — disassembled $87BA-$8824, $8859-$88D8, $8A5B-$8A8B, and $AF4A-$AF93 directly from the World ROM

While waiting for the next vertical blank, the idle loop repeatedly invokes a four-byte generator that adds 15 to the first byte and 17 to the second byte with carry, XORs the two bytes, shifts the high bit into carry, and rotates it through the third and fourth bytes. In enemy AI, only bit 0 of the first generator byte is tested, inside the Smick tile-center decision routine when an enemy reaches a rope top, rope bottom, or wall-bounded double-rope junction and chooses between two valid directions; outside Smick AI, the same byte is sampled with wider masks by an audio sound-effect routine (low two bits) and Game B's sleepwalking Z-sprite routine (low four bits for horizontal jitter and full byte thresholded at 64 for spawn delay). gyromite/idle-loop-prng-and-smick-junction-turns

Value: 4 bytes

CodeGyromite (World) · 0x007F-0x0088 — $806F-$8078: busy-wait loop polls vblank flag $0020 and calls sub_00_B1DA every pass until NMI firesGyromite (World) · 0x31EA-0x3207 — $B1DA-$B1F7 (sub_00_B1DA): ADC #$0F to $07F0, ADC #$11 to $07F1, EOR $07F0, ASL A, then ROR $07F2 and ROR $07F3Gyromite (World) · 0x127C-0x1297 — $926C-$9287: Smick update checks tile-center alignment ((Y & $0F) == 8 and ((X + scroll) & $0F) == 8) before calling sub_00_936A ($936A)Gyromite (World) · 0x238F-0x241E — $A37F-$A40E (sub_00_A37F): builds the 8-bit surrounding-tile bitmask stored into $06E2 (bits 0..3 encoding walkable/climbable down, right, left, and up exits)Gyromite (World) · 0x137A-0x1400 — $936A-$93F0 (sub_00_936A): masks $07F0 with #$01 at three junction branches ($939B, $93AE, $93C5) to index direction tables $93EF ($01/$02) and $93ED ($08/$04)Gyromite (World) · 0x7554-0x755B — $F544-$F54B (sub_00_F4C0): audio SFX handler masks $07F0 with #$03 and stores it in $05E9Gyromite (World) · 0x2621-0x2629 — $A611-$A619: checks Game B mode ($004A == 3) and dispatches to the sleepwalking Z-sprite routine at $AEAEGyromite (World) · 0x2EBE-0x2F25 — $AEAE-$AF15: Game B sleepwalking Z-sprite decrements spawn-delay countdown $0071, sets OAM tile/Y, masks $07F0 with #$0F for X jitter ($AEDF-$AEE3), compares $07F0 against #$40 (adding #$30 if below) for delay ($AEFA-$AF02), and uses tile/offset tables at $AF0C-$AF15Checked by claude, 2026-11-26 — disassembled $806F-$8078, $926C-$9287, $936A-$93F0, $A37F-$A40E, $A611-$A619, $AEAE-$AF15, $B1DA-$B1F7, and $F544-$F54B directly from the World ROM