Cite as
zladx/LADX-Disassembly
Original
https://github.com/zladx/LADX-Disassembly
Pinned
zladx/LADX-Disassembly @ 2a5c2c0d6df93a54df81ae9e1fe28b5c2fd60d03
Accessed
2026-10-21
Licence
none stated (no LICENSE file)
Credit
The zladx community, begun by kemenaran; see https://github.com/zladx/LADX-Disassembly/graphs/contributors (the pinned commit is by daid). The labels and comments quoted in ladx claims ("If using the Blue Tunic, take half damages") are theirs.
Notes
rgbds source for Link's Awakening DX, the 1998 Game Boy Color release; it builds ten Japanese, English, German, and French revisions, and its default target is the English v1.0 (azle). The `;; bank:address $bytes` comments give azle's addresses. It doesn't build the 1993 Game Boy game; claims about that release cite its ROM.

Cited on

Claims (15)

The inventory bar along the bottom of the screen is the window layer. Setting it up stores window Y $80 (line 128), which leaves the bar the bottom 16 lines, and window X 7 in DX (6 in the 1993 release, one pixel further left); each gameplay frame copies the stored Y to the window register.src/code/bank1.asm L825–830src/code/home/render_loop.asm L238–242Code
A monster's touch costs Link the damage its health group lists, in eighths of a heart, mostly 4 or 8. In Link's Awakening DX the Blue Tunic halves it; the Guardian Acorn halves it too, and cancels a half-heart touch outright.src/code/entities/bank3.asm L5313–5341src/data/entities/damages.asm L4–9src/code/bank2.asm L5305–5319Code
A monster's touch does nothing while Link's invincibility counter is above 0; a hit sets it to $50, and the main loop counts it down every frame, so the protection lasts 80 frames.src/code/entities/bank3.asm L5300–5307src/code/entities/bank3.asm L5347–5348src/code/bank0.asm L1500–1505Code
A monster's touch starts a 16-frame countdown and picks a speed of $14 ($18 for Moldorm), in both releases. In DX the speed goes along the line from the monster to Link, and while the countdown runs a routine at the top of Link's movement moves him by that speed and skips the rest, so the player can't steer.src/code/entities/bank3.asm L5376–5398src/code/entities/bank3.asm L6809–6814src/code/bank2.asm L588–614Code
Link's Awakening keeps A Link to the Past's four Pieces of Heart per container. The fourth piece clears the count, adds a heart to Link's maximum, and queues $40 of health, eight hearts' worth.src/code/entities/bank3.asm L2922–2937Code
A heart container left by a boss adds a heart to Link's maximum and queues $FF of health, a full refill.src/code/entities/bank3.asm L2766–2772Code
The 1993 Game Boy release has the same hit code as DX without the tunic check. It reads the damage from its health-group table, applies the Guardian Acorn's rule, and stores the same $50 in the invincibility counter.src/code/entities/bank3.asm L5323–5325Code
In both US releases Link's health counts in quarter hearts, the annotators' reading in a comment that calls the starting $0c "3 hearts". The fourth Piece of Heart resets the count to 0 and gives Link a Heart Container with a parameter of 4, one heart. Link's Awakening DX also takes four pieces, but there the fourth adds a heart to a maximum kept in whole hearts and queues $40 of health in eighths, eight hearts' worth.src/code/entities/bank3.asm L2922–2937Code
In both US releases a Heart Container adds its parameter to Link's maximum health, 4 quarters (one heart) for every Heart Container treasure object the data defines and for the one the fourth Piece of Heart gives. It always brings a heart refill of $40, which is sixteen hearts (computed, in the quarter hearts a comment gives), capped at the maximum. Link's Awakening DX's boss container adds a heart and queues $FF of health instead.src/code/entities/bank3.asm L2768–2772Code
In both US releases what a touch does to Link comes from a collision table indexed by the enemy's collision mode. A standard enemy (Octorok's collision mode) uses the plain damage effect, which sets Link's invincibility counter to $22, so he can't be hit for 34 frames, counted one per object update. The low- and high-knockback effects set 25 and 42. Link's Awakening DX sets $50, 80 frames, on every hit.src/code/entities/bank3.asm L5347–5348Code
In both US releases the plain damage effect sets Link's knockback counter to 15 (7 and 21 for the low- and high-knockback effects), and the Steadfast Ring halves it. The counter drops by one per object update on the ground, which is a frame if the objects update once a frame (not read). While it runs Link moves at SPEED_140, 1.25 pixels a frame along one axis (computed from the speed table's comment that SPEED_100 is one pixel a frame on one axis, not diagonally), and his top-down normal state skips the d-pad. The angle is taken from the enemy toward a position for Link; that it points away from the enemy is the atlas's reading of objectGetRelativeAngleWithTempVars's header comment, and the position passed for Link wasn't traced. Link's Awakening DX's knockback countdown runs 16 frames.src/code/entities/bank3.asm L5378–5379src/code/bank2.asm L588–614Code
In both US releases a hit copies the enemy's damage value to Link as a negative number, and Link's one active ring changes it: Power Rings L1–L3 add 2, 4, and 8 units, Armor Rings L1–L3 take 1, 2, and 3 off, the Blue Ring halves it with an arithmetic shift that rounds toward more damage (3 units become 2), the Green Ring takes three quarters (rounded toward less damage), and the Cursed Ring doubles it. A hit always costs at least one unit, and the Protection Ring makes every hit 8. Health then drops a quarter heart per 2 units, so a unit is an eighth of a heart (computed, from the quarter hearts a comment gives). Link's Awakening DX's health is in eighths by its annotators' comment ($08 = 1 heart), and its Blue Tunic also halves damage.src/code/entities/bank3.asm L5322–5325src/constants/memory/wram.asm L3382–3384Code
The Minish Cap counts Link's health in eighths of a heart, as A Link to the Past does and as the zladx annotators' comment on Link's Awakening's health byte says ("$08 = 1 heart"); a new file starts him at 24, three hearts. When Link holds up a Piece of Heart, the code refills his health to its maximum and adds 1 to the piece count. The fourth piece resets the count to 0 and then does what a Heart Container does: it adds 8 to the maximum, capped at 160 (20 hearts, A Link to the Past's cap), and refills his health again. Both earlier games also make a container from every fourth piece.src/code/entities/bank3.asm L2922–2937src/constants/memory/wram.asm L3382–3384Code
The Minish Cap takes a touch's effects from a collision matrix: the entry at the toucher's hit type × 34 + the touched one's hurt type. For an Octorok or a Leever (hit type 25) touching Link in his normal state (hurt type 0), the US ROM's entry gives Link 30 invincibility frames, a knockback duration of 8, and 2 damage, a quarter heart. The collision loop skips a pair while either has a nonzero iframe count, unless either has bit 7 of its collision flags set, and Link's count steps one toward 0 each frame his update runs, so the protection lasts 30 frames. Link's Awakening sets its count to 80 and A Link to the Past to 58.src/code/entities/bank3.asm L5347–5348Code
While Link's knockback duration is nonzero, a routine that his normal state calls each frame counts it one step toward 0 and, if it's still nonzero, moves him 0x280 along the knockback direction; the code's walking speed kWalkSpeed is Q_8_8(1.25), 0x140, so the atlas reads the push as twice walking speed, though the move routine wasn't read. His normal state skips the code that reads the d-pad while the duration is nonzero, so the player can't steer. The collision loop stores the direction for both parties, Link's the reverse of the toucher's. Among the cancels: a jump, a dash, a roll, a fall, swimming (a swim state above 1), a held object (states 1–4), and climbing unless the push is south. After an Octorok's touch (duration 8) that's 7 moves (computed). Link's Awakening's push runs a 16-frame countdown.src/code/entities/bank3.asm L5376–5398src/code/bank2.asm L588–614Code