RAM map
Every byte of work RAM the code reads or writes, found from the instruction operands. Each entry says what the address
holds and how it is used, then lists every instruction that touches it (expand the list; R reads, W writes,
RW modifies in place). $00xx is the direct page, $0100 and up is normal RAM, and
$7E: and $7F: are the extended areas. 1320 addresses, 809 with a written description.
Descriptions were drafted from the code. Where the code only shows how a byte is used and not why , the
text says so.
View: by address
by section
$00xx $01xx $02xx $03xx $04xx $05xx $06xx $07xx $08xx $09xx $0Axx $0Bxx $0Dxx $0Exx $0Fxx $13xx $14xx $15xx $16xx $17xx $18xx $19xx $1Bxx $1Cxx $1Dxx $1Exx $1Fxx $7Exx $7Fxx
$0000 Scratch byte $00 scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
1487 uses in 427 routines (651 read, 663 write, 173 read-modify-write) R $00:808D LDA [$00],Y ; Fetch the first data byte of the block R $00:80B6 LDA [$00],Y ; A = block length R $00:80BB LDA [$00],Y ; A = block destination address in SPC700 RAM W $00:85D7 STA $00 ; [$00] = pointer low byte W $00:85FF STA $00 ; [$00] = $FC: tile number used as the fill byte W $00:861E STA $00 ; [$00] = $38: fill byte for the high bytes (palette 6, priority) W $00:86E2 STY $00 ; [$00] = low byte of the pushed return address (table address - 1) W $00:86F1 STA $00 ; [$00]-[$01] = table entry (16-bit target address) W $00:8710 STA $00 ; [$00] = low byte of the target R $00:8726 LDA [$00],Y ; Next record: first byte = VRAM address high R $00:8730 LDA [$00],Y ; Second byte = VRAM address low R $00:8735 LDA [$00],Y ; Third byte: bit 7 = vertical, bit 6 = RLE, low 6 bits = count high R $00:8741 LDA [$00],Y ; Re-read the third byte W $00:8A53 STZ $00,X ; Clear the word at $0000+X W $00:8ACF STA $00 ; [$00] = [$39]: scale for the matrix C and D entries W $00:8AD8 STA $00 ; [$00] = [$38]: scale for the matrix A and B entries W $00:8FE2 STA $00 ; [$00] = count - 1: slot X shows a coin while [$00] is not negative W $00:9098 STA $00 ; [$00] = palette bits for this item (DATA_008E01) W $00:90A9 STA $00 ; Star: palette bits cycle through DATA_008DFE every 2 frames ([$13] >> 1 AND 3) RW $00:957B INC $00 ; (second INC of the 16-bit pointer) W $00:98EF STA $00 ; [$00] = bytes per update W $00:9978 STY $00 ; [$00] = Y (row spacing) R $00:9990 SBC $00 ; VRAM address -= [$00] W $00:9CFD STA $00 ; Counter [$00] = $8F W $00:9D57 STA $00 ; [$00] = $84: buffer offset of file 2's exits count (the last entry) R $00:9D7A LDX $00 ; X = buffer offset of this file's entry W $00:9E94 STX $00 ; [$00] = cursor bit mask RW $00:9EBC LSR $00 ; Shift the mask; carry = this entry has the cursor W $00:A41C STZ $00 ; CGRAM address = $64 and offset [$00] = 0: animated palette color W $00:A492 STZ $00 ; [$00] = 0: pointer [$00] = bank:0000, so [$00],Y reads bank:Y R $00:A4A0 LDA [$00],Y ; A = length of the next record (bytes of colors) R $00:A4B0 LDA [$00],Y ; A = CGRAM start address of the record R $00:A848 LDA [$00] ; A = bitplanes 0 and 1 of one tile row R $00:A889 LDA [$00] ; A = bitplanes 0 and 1 of one tile row R $00:A9B2 LDA [$00],Y ; A = next word of the decompressed data R $00:AACF LDA [$00] ; A = bitplanes 0 and 1 of this row R $00:AAD5 ORA [$00] ; [$1BB2+X] = plane 0 | plane 1 of this row (both bytes) R $00:AB0F LDA [$00] ; A = bitplanes 0 and 1 of this row R $00:AB15 ORA [$00] ; [$1BB2+X] = plane 0 | plane 1 of this row (both bytes) W $00:AC44 STA $00 ; [$00] = $B190: base of the FG palette sets R $00:AC54 ADC $00 ; [$00] += DATA_00ABD3[[$192D] & $F] (selected FG palette set) W $00:AC6D STA $00 ; [$00] = $B318: base of the sprite palette sets R $00:AC7D ADC $00 ; [$00] += DATA_00ABD3[[$192E] & $F] (selected sprite palette set) W $00:AC96 STA $00 ; [$00] = $B0B0: base of the BG palette sets R $00:ACA6 ADC $00 ; [$00] += DATA_00ABD3[[$1930] & $F] (selected BG palette set) R $00:AD03 LDA ($00) ; A = next color (BGR555) from the source at [$00] RW $00:AD0A INC $00 ; [$00] += 2: next source color W $00:AD32 STY $00 ; [$00] = base address of the palette sets W $00:AD4A STA $00 ; [$00] += A: source = start of the chosen set W $00:AF51 STA $00 ; [$00] = 7 colors per palette (colors 7 down to 1) W $00:B051 STA $00 ; [$00] = [$0D82]: pointer to the player's palette W $00:B06B STA $00 ; [$00] = 7 colors per palette W $00:B926 STA [$00],Y ; Store the value in the output W $00:B933 STA [$00],Y ; Store it in the output W $00:B944 STA [$00],Y ; Store the value in the output W $00:B956 STA [$00],Y ; Store it in the output W $00:B95D STA [$00],Y ; Store it in the output W $00:B974 STA [$00],Y ; Append it to the output R $00:BEE6 LDA $00 ; Vertical layer: swap the X and Y high bytes W $00:C0FD STA $00 ; $00 = [$5B] (vertical level flags) RW $00:C104 LSR $00 ; Layer 2 ([$1933] != 0): use bit 1 (layer 2 vertical flag) R $00:C106 LDA $00 ; A = vertical-level flag of the current layer W $00:C1E1 STA $00 ; $00 = [$5B] (vertical level flags) RW $00:C1E8 LSR $00 ; Layer 2: use bit 1 R $00:C1EA LDA $00 ; A = vertical-level flag of the current layer R $00:C34C ADC $00 ; X = ([$9C] - $19) * 3: index into the 3-byte cage pointer table W $00:C3A2 STA $00 ; $00 = 5: six tile words per row W $00:CA79 STA $00 ; [$00] = Mario screen X + 8: iris center X W $00:E9E2 STA $00 ; [$00] = scroll speed W $00:F481 STA $00 ; $00 = Y position rounded down to a block row (high nibble) R $00:F48F ORA $00 ; Row | column: offset within the screen R $00:F4D3 LDA [$00] ; A = low byte of the map16 number R $00:F4DB LDA [$00] ; A = high byte of the map16 number W $00:F4FC STA $00 ; $00 = Y position rounded down to a block row R $00:F948 CMP $00 ; Compare with [$00] (result used by CODE_00E9C8) R $00:FF43 SBC $00 ; $22 = $30 - $00: BG3 X scroll follows the sprite R $00:FF5A SBC $00 ; $24 = $100 - $00: BG3 Y scroll follows the sprite W $01:805D STA $00 ; [$00] = $04: X offset of the smoke puff R $01:807A ADC $00 ; Smoke X position ($17C8,Y) = sprite X + [$00] R $01:8A58 SBC $00 ; Speed -= friction (towards zero) RW $01:906E ROR $00 ; $00 = speed / 2 again W $01:945F STA $00 ; [$00] = clip Y rounded down to 16 W $01:9489 STA $00 ; [$00] |= block column R $01:949B ADC $00 ; [$05] = pointer low + [$00] W $01:94C9 STA $00 ; [$00] = clip Y rounded down to 16 W $01:94FC STA $00 ; [$00] |= block column R $01:950E ADC $00 ; [$05] = pointer low + [$00] W $01:9E3E STA $00 ; [$00] = sprite X position low W $01:A09B STA $00 ; Same sign: copy Mario X speed to [$00], shift sign into carry RW $01:A3AF ROL $00 ; Shift the comparison carry into $00 RW $01:A3B7 LSR $00 ; Recover comparison carry into carry W $01:AAE1 STA $00 ; [$00] = standing height R $01:AAE6 SBC $00 ; Mario Y = sprite Y - [$00] (low byte) R $01:AC7C LDA $00 ; A = signed distance beyond the margin RW $01:ACD8 ROL $00 ; Compare screen Y low + offset (SpriteOffScreen1) with sprite Y low W $01:ACF1 STA $00 ; Flip sign for the other edge R $01:ACF3 LDA $00 ; A = signed distance beyond the margin W $01:AE63 STA $00 ; $00 = hit bounce offset DATA_01AE7F[Y] R $01:AE6C SBC $00 ; Block tile Y position -= bounce offset R $01:B117 ORA $00 ; Sprite properties bit 0 = $00 (selects the tile page) R $01:B59D CMP $00 ; Y speed negative and past the limit: stop accelerating W $01:B5B9 STA $00 ; $00 = Mario's Y speed before the interaction R $01:B5D1 CMP $00 ; Sprite Y speed >= limit: skip R $01:B60C ADC $00 ; Y speed += [$00]: platform dips as Mario jumps off R $01:B637 SBC $00 ; Sprite Y low -= [$00] R $01:B75F SBC $00 ; Tile 2 X = center X - [$00] R $01:B76D ADC $00 ; Tile 0 X = center X + [$00] W $01:B7C4 STA $00 ; $00 = sprite Y position low W $01:B88F STA $00 ; $00 = standing offset W $01:B8DA STA $00 ; $00 = [$0E] + $10: horizontal push distance W $01:B8EC STA $00 ; Yes: negate $00, push Mario to the left W $01:B9DF STA $00 ; $00 = palette bit 0 R $01:B9E7 ORA $00 ; Palette bit 0 replaced by [$00] W $01:BB40 STA $00 ; $00 = sprite X on screen W $01:BFA3 STA $00 ; $0B = 0 (accumulator), $00 = 0 (scaled speed) RW $01:BFB2 INC $00 ; subtract it and $00++ (so $00 = speed * small / large) W $01:C031 STZ $00 ; Byte counter $00 = 0 W $01:C802 STY $00 ; [$00] = 1 if the platform is above the pivot R $01:C880 LDA $00 ; [$00] = 0: platform is below the pivot W $01:CB3C STA $00 ; [$00] = angle + $80 (quarter turn: cosine) W $01:D470 STA $00 ; [$00] = X low + $20 R $01:D47B LDA $00 ; [$00]/[$01] = X + $20 relative to the level R $01:D4AF LDA $00 ; Sprite screen X ([$00]) W $01:D61A STZ $00 ; [$00] = 0 (Y high sign) RW $01:D625 DEC $00 ; Negative: [$00] = $FF R $01:D94D LDA $00 ; Read Map16 tile at ($02,$00): [$1693] = tile number, Z = flag W $01:DAAB STY $00 ; $00 = horizontal offset R $01:DAB1 SBC $00 ; Sprite X low -= offset (move to the left edge for drawing) W $01:DAFD STY $00 ; $00 = horizontal offset R $01:DB03 SBC $00 ; Sprite X low -= offset W $01:DF21 STA $00 ; $00 = bounce height W $01:DFDB STA $00 ; $00 = line counter, 7 down to 0 W $01:E0E8 STA $00 ; $00 = Y position low - spawn Y low (depth below the spawn point) RW $01:E0F1 ROR $00 ; Depth / 2 (16 bit) R $01:E66F SBC $00 ; Mario Y position (low) = sprite Y - offset W $01:E8A7 STA $00 ; $00 = wobble offset R $01:E8B8 SBC $00 ; Lakitu Y (low) = cloud Y - wobble offset W $01:EE92 STA $00 ; $00 = tile number the head was drawn with (Yoshi GFX buffer tile) W $01:F181 STA $00 ; $00 = YoshiAbilityIndex[Y] * 4 W $01:F283 STA $00 ; Fireball counter $00 = 2 R $01:F2BD LDX $00 ; X = fireball number RW $01:F2D6 DEC $00 ; Next fireball number W $01:F382 STY $00 ; $00 = caught sprite slot R $01:F3B5 LDY $00 ; (unused) Y = caught sprite slot R $01:F3BB LDY $00 ; Y = caught sprite slot W $01:F431 STA $00 ; $00 = on-screen X of the next tongue tile R $01:F46A LDA $00 ; A = X position of this tile W $01:F472 STA $00 ; $00 = X of the next tile W $01:F4E9 STA $00 ; $00 = Y offset $FC (default) W $01:F543 STA $00 ; $00 = tongue tip X low R $01:F70A CMP $00 ; Compare with the side R $01:F861 ORA $00 ; Insert the saved color W $01:FA61 STA $00 ; [$00] = X-flip bit from direction W $01:FC8A STA $00 ; [$00] = [$14B8] - 8 (kid hitbox X) W $02:82D8 STX $00 ; $00 = X: entries left to draw R $02:8368 LDX $00 ; X = $00 (entries left) W $02:839E STZ $00 ; $00 = 0: flicker counter R $02:83A0 LDX $00 ; X = flicker counter W $02:843E STZ $00 ; $00 = 0: segment offset R $02:8450 SBC $00 ; A = Y position - screen Y - layer 1 Y displacement - segment offset W $02:8486 STA $00 ; $00 += $10: next 16-pixel segment W $02:8532 STA $00 ; $00 = 4: spawn five particles W $02:85AB STA $00 ; $00 = (random AND mask) + base + Mario Y: random point on Mario's body W $02:8664 STA $00 ; $00 = A: parameter copied to each piece's [$1850] RW $02:8BBE INC $00 ; Side = 1: fall through for right puff W $02:8D66 STZ $00 ; $00 = 0: X wobble offset W $02:8D89 STA $00 ; $00 = X wobble offset R $02:9149 SBC $00 ; Mario Y position = block Y - [$00] (stand on the block) W $02:927B STA $00 ; $00 = (bounce Y low - 3) rounded to a tile row (high nibble) W $02:92A2 STA $00 ; $00 = YYYYXXXX: tile row | tile column within the screen W $02:92D2 STA $00 ; $00 = (bounce Y low - 3) rounded to a tile row (horizontal level) W $02:92F5 STA $00 ; $00 = YYYYXXXX: tile row | tile column within the screen W $02:9586 STA $00 ; $00 = YYYYXXXX: tile row | tile column within the screen W $02:95E8 STA $00 ; $00 = YYYYXXXX: tile row | tile column within the screen W $02:966F STA $00 ; $00 = bounce block X low + offset W $02:969C STA $00 ; $00 = cape X low - 2 R $02:990D ADC $00 ; A = X + DATA_0298C2[X] W $02:9A33 STA $00 ; [$00] = X on screen W $02:9B5A STA $00 ; [$00] = X on screen = ExSprite X low - [$1A] W $02:9BEE STZ $00 ; [$00] = 0: first (right) trail RW $02:9BF3 INC $00 ; [$00] = 1: second (left) trail R $02:A194 EOR $00 ; OAM properties = DATA_02A167 EOR [$00] W $02:A622 STA $00 ; $00 = Y rounded down to 16 R $02:A64E ORA $00 ; $00 = Y row | X column (Map16 index within a screen) R $02:A661 ADC $00 ; $05 = low pointer + index W $02:A683 STA $00 ; $00 = Y rounded down to 16 R $02:A6B4 ORA $00 ; $00 = Y row | X column (Map16 index within a screen) R $02:A6C7 ADC $00 ; $05 = low pointer + index R $02:A852 CMP $00 ; Skip if not at the target column ($00) W $02:ABFC STA $00 ; [$00] = $FF: no sprite is being carried yet W $02:AC11 STX $00 ; Remember the slot with status $0B in [$00] R $02:AF59 LDA $00 ; X position low from $00 R $02:AFC5 LDA $00 ; A = X position low from $00 R $02:B283 CPX $00 ; Reached the stop slot? W $02:B41A STA $00 ; [$00] = direction (for the arm below) W $02:B716 STA $00 ; [$00] = segments below the gap, unchanged R $02:B71D ORA $00 ; Merge with the unchanged lower segments R $02:B760 LDA $00 ; A = sprite X on screen RW $02:B862 ROR $00 ; [$00] = hitting sprite X speed / 2 (sign kept) W $02:BB2C STA $00 ; [$00] = sprite X low W $02:BF08 STA $00 ; Restore [$00] and [$01] R $02:C8D9 ADC $00 ; OAM X = sprite X + offset R $02:CB0A ADC $00 ; Tile 1 X = sprite X + ((direction * 8) EOR 8) R $02:CB11 ADC $00 ; Tile 2 X = sprite X + direction * 8 W $02:CE4F STA $00 ; [$00] = -[$151C]: negative amplitude R $02:CF13 ADC $00 ; A = screen X + X offset RW $02:D05C ROL $00 ; Rotate carry into [$00] W $02:D06C STA $00 ; [$00] = signed distance RW $02:D0A8 ROL $00 ; Rotate carry into [$00] W $02:D0B9 STA $00 ; [$00] = signed distance W $02:D153 STA $00 ; [$00] = (sprite Y + 8) rounded down to a 16 pixel boundary W $02:D188 STA $00 ; [$00] = Map16 index within a screen: Y bits 4-7, X bits 4-7 R $02:D199 ADC $00 ; [$05] = pointer low W $02:D26F STY $00 ; [$00] = target Y speed R $02:D273 CMP $00 ; Compare Y speed with the target W $02:D2C7 STA $00 ; Unused: [$00] = speed (A); Y = sprite to aim from RW $02:D343 INC $00 ; Else remainder -= long distance, result++ W $02:D362 STA $00 ; [$00] = Y speed toward Mario RW $02:D3BB ROL $00 ; Save the borrow in [$00] RW $02:D3C3 LSR $00 ; Restore the borrow W $02:D4B1 STA $00 ; [$00] = sprite X low R $02:D5EA LDA $00 ; A = sprite X on screen W $02:D6E0 STZ $00 ; [$00] = 0: high byte of X offset RW $02:D6E6 DEC $00 ; [$00] = $FF: sign extend R $02:D765 LDA $00 ; A = ball screen X ([$00] from the draw routine) R $02:D7AF LDA $00 ; A = link X on screen R $02:D7C3 LDA $00 ; A = link X on screen RW $02:D7CE ROR $00 ; [$00] = distance / 2 (arithmetic shift) W $02:D7D8 STA $00 ; [$00] = pivot X + half distance - screen X (second link) R $02:D819 LDA $00 ; A = sprite X on screen W $02:DF2E STA $00 ; $00 = sprite X (low) W $02:E083 STA $00 ; Loop counter $00 = 3 (spawn four fire balls) R $02:E0B1 LDX $00 ; X = fire ball number W $02:E1C0 STA $00 ; Fire ball X speed = $F0 (to the left) W $02:EA2B STA $00 ; [$00] = tile number the earlier draw code picked (baby Yoshi frame) W $02:EB93 STZ $00 ; [$00] = 0: not accelerating yet RW $02:EBA9 INC $00 ; [$00]++: marks that acceleration happened W $02:ED91 STA $00 ; [$00] = 2: three skulls to spawn W $02:EE34 STA $00 ; [$00] = its contact flags W $02:F052 STA $00 ; Save the palette bits W $02:F204 STA $00 ; [$00] = sprite X low W $02:F226 STA $00 ; [$00] = 4: segment counter for contact check W $02:F5E2 STA $00 ; [$00] = tile X - scroll X (low) W $02:F69A STA $00 ; [$00] = vertical offset of the tile block (0-$30 pixels, bigger = higher) W $02:F783 STA $00 ; [$00] = $B8 - [RAM_ScreenBndryXLo]: block X on screen W $02:F8A3 STA $00 ; [$00] = slot * 4 + [RAM_FrameCounterB] (staggers the slots) RW $02:FAB1 DEC $00 ; [$00] = sign extension of the signed speed W $02:FAFD STA $00 ; [$00] = ring angle low + Boo angle offset low ([DATA_02FA84+X]) RW $02:FB85 DEC $00 ; [$00] = sign extension of the X offset RW $02:FD34 DEC $00 ; Bob direction from bit 6 of (slot * 8 + frame): Y = +1, or -1 with [$00] = $FF W $02:FD66 STA $00 ; [$00] = animation frame, toggles every 8 frames W $02:FDA1 STA $00 ; [$00] = bat wing frame, toggles every 4 frames W $02:FF00 STA $00 ; A = bound - sprite X (high byte); bit 7 set = beyond the bound W $02:FF08 STA $00 ; Invert the sign test for the left bound W $02:FF40 STA $00 ; A = bound - sprite Y (high byte); bit 7 set = beyond the bound W $02:FF48 STA $00 ; Invert the sign test for the other bound W $03:824F STZ $00 ; [$00] = 0: byte counter R $03:89C4 LDY $00 ; Y = |X speed| (stick to slope) W $03:8CB2 STA $00 ; $00 = height of Mario above the surface R $03:8CBC SBC $00 ; Mario Y low = surface Y - $00 (stand on the slope) W $03:900B STA $00 ; $00 = palette and flip bits R $03:901A ORA $00 ; OAM properties = (old properties AND $31) | $00 (keep priority and tile page) RW $03:9841 INC $00 ; ...$0B -= $0D and $00++ W $03:99AA STZ $00 ; $00 = 0: high byte for sign extension RW $03:99B0 DEC $00 ; Negative: $00 = $FF (sign extend) R $03:9B99 LDA $00 ; A = sprite X on screen R $03:9C03 LDA $00 ; A = sprite X on screen R $03:9E76 ADC $00 ; OAM X = [$00] + DinoRhinoTileDispX[X] R $03:9EE2 ADC $00 ; OAM X = [$00] + X offset W $03:AC9C STA $00 ; [$00] = Peach screen X position W $03:AF06 STA $00 ; [$00] = v | v<<5 | v<<10 (grey color value v) R $03:AFB9 ADC $00 ; Add [$00] plus $15 with direction-based offset W $03:B047 STA $00 ; [$00] = Bowser X low RW $03:B7A3 ROL $00 ; Keep the carry in $00 RW $03:B88E ROL $00 ; Save the carry out in [$00] bit 0 RW $03:B895 LSR $00 ; Restore the carry from the limit addition W $03:B89E STA $00 ; [$00] = that high byte W $03:B8A6 STA $00 ; Odd frame (left edge): flip the sign RW $03:B8DA ROL $00 ; Save the carry out in [$00] bit 0 RW $03:B8E2 LSR $00 ; Restore the carry from the limit addition W $03:B8EB STA $00 ; [$00] = that high byte W $03:B8F3 STA $00 ; Top edge check: flip the sign W $03:C0CD STZ $00 ; [$00] = 0: X position of the first tile R $03:C0D5 LDA $00 ; A = tile X position W $03:C0DD STA $00 ; Next tile X position += $10 W $03:CBDC STA $00 ; $00 = spawner X high W $03:D798 STX $00 ; $00 = tilemap page offset (0 or 4) W $03:DE34 STA $00 ; [$00] += $18: next 3bpp tile (24 bytes) R $03:DE3D LDA [$00],Y ; A = next bitplane byte of the row W $03:DE96 STA $00 ; [$00] = $0A1C: VRAM address of the block minus one tilemap row ($80) W $03:DF44 STY $00 ; $00 = row width - 1 R $03:DF5E ADC $00 ; If [$1BA2] bit 7 is set (flipped): start at the end of the row R $03:DF85 ADC $00 ; A = saved table offset + row width: next row W $03:E040 STA $00 ; Byte counter = $0E (colors 1-7) R $04:80C3 LDA [$00],Y ; Load a word of bitplanes 0/1 (one row) R $04:80D0 LDA [$00],Y ; Load a byte (one row of bitplane 2) W $04:80EB STA $00 ; Copy it to [$00] (carry source for the rotate) W $04:814B STA $00 ; [$00] = pointer to the current frame of this tile W $04:8180 STA $00 ; [$00] = last row (wraps to the top) W $04:818F STA $00 ; Carry this row to the next R $04:851D EOR $00 ; A = warp X tile EOR (submap << 8) W $04:85EA STA $00 ; [$00] = $18: X of the first backdrop tile W $04:861C STA $00 ; [$00] = $18: X back to the left edge R $04:8974 ADC $00 ; Y = pose offset + animation frame * 8 (frame advances every 8 frames) R $04:8CFC ADC $00 ; Y = pose offset + 0 or $10 (2 frames, switching every 8 frames) W $04:8E68 STA $00 ; [$00] = player's tile column ([$1F1F]) W $04:8E86 STA $00 ; [$00] = level name data for that translevel (LevelNames) W $04:9011 STA $00 ; [$00] = tile column W $04:9310 STA $00 ; [$00] = level number W $04:9387 STA $00 ; [$00] = tile number R $04:9394 CMP $00 ; Compare with the destination tile W $04:93A7 STA $00 ; [$00] = first offset R $04:9400 ORA $00 ; Add the facing direction R $04:94FA BIT $00,X ; Test the sign of the distance on this axis R $04:951B LDA $00,X ; A = remaining distance on the major axis W $04:9530 STA $00 ; [$00] = player tile X ([$1F1F+X]) W $04:9728 STA $00 ; [$00] = movement offset ([$00] = dx, [$01] = dy) W $04:9847 STA $00 ; [$00] = player X position R $04:9E89 SBC $00 ; Player's map Y position [$1F19+X] -= fly speed (moves up) W $04:D820 STY $00 ; [$00] = 1: first level number to hand out R $04:D83C LDA $00 ; A = next level number R $04:DADD LDA [$00],Y ; Fetch the byte to repeat W $04:DC4D STA $00 ; Next tile definition: [$00] += 8 W $04:DC8F STA $00 ; [$00] = $C02B: source $04:C02B (layer 2 properties) W $04:DCC7 STX $00 ; [$00] = 0: tile counter R $04:DCE8 LDX $00 ; X = map index (page * 256 + counter) R $04:E7A7 LDY $00 ; Y = offset into the source tilemap W $04:E7FA STA $00 ; [$00] = source offset W $04:E809 STA $00 ; [$00] = source offset R $04:E867 LDY $00 ; Y = offset into the source tilemap W $04:E8BA STA $00 ; [$00] = source offset W $04:E8C9 STA $00 ; [$00] = source offset R $04:EA46 LDY $00 ; Y = [$00] (source index) R $04:EDE6 LDA $00 ; A = VRAM address (first tile row) W $04:EECC STA $00 ; [$00] = DATA_04E587[X]: VRAM address of the first block row W $04:F2AB STA $00 ; [$00] = 7: eight particles per batch R $04:F2D9 LDY $00 ; Y = [$00]: direction index 0-7 W $04:F3DD STA.W $0000,Y ; Store in [$00,$02,$04] by Y W $04:F7B9 STX $00 ; [$00] = X: outer loop counter W $04:F882 STA $00 ; [$00] = hide mask (the lightning code enters here with its own mask) W $04:FD01 STA $00 ; [$00] -= 8: next tile to the left W $04:FDB7 STA $00 ; [$00] = counter; masks the acceleration steps below R $04:FDD9 AND $00 ; AND the phase counter [$00] W $04:FE8A STA.W $0000,Y ; Store screen-relative position in [$00,Y] W $04:FF98 STA $00,X ; Store speed in [$00,X] ($00 X, $02 Y, $04 Z) W $05:80E6 STA $00 ; [$00] = 7: loop counter (8 tiles, $133-$13A) W $05:81A0 STA $00 ; [$00] = $9100: base for the default Map16 pointer table W $05:81B0 STA $00 ; Each tile's data is 8 bytes W $05:821F STA $00 ; [$00] = pointer to this tileset's Map16 data (TilesetMAP16Loc[X]) W $05:8298 STA $00 ; [$00] = $8A70: data for these tiles R $05:82B5 LDA $00 ; A = [$00] (continues after $1C7's data) W $05:85E6 STA $00 ; [$00] = low nibble of [$0A] W $05:8678 STA $00 ; [$00] = low byte of the screen address table for this level mode W $05:87B5 STA $00 ; [$00] = 7: loop counter (8 entries) RW $05:87C4 DEC $00 ; Count down the 8 entries R $05:8A23 ADC $00 ; Y = screen number * 3, screen = ([$45+X] & $01F0) >> 4 R $05:8ADE ORA $00 ; $1BE4 = VRAM address high byte: $20 (or $28 if bit 4 of [$45+X]) | ([$45+X] >> 2) & 3 R $05:8AFF ADC $00 ; Y = screen number * 3, screen = ([$45+X] & $01F0) >> 4 R $05:8BF1 ADC $00 ; Y = screen number * 3, screen = ([$49+X] & $01F0) >> 4 R $05:8CC3 ORA $00 ; $1CE6 = VRAM address high byte: $30 (or $38 if bit 4 of [$49+X]) | ([$49+X] >> 2) & 3 R $05:8CE4 ADC $00 ; Y = screen number * 3, screen = ([$49+X] & $01F0) >> 4 W $05:B1E3 STA $00 ; [$00] = text offset W $05:B228 STY $00 ; Save the text offset for the next row W $05:B2F2 STZ $00 ; [$00] = 0: offset into the position table W $05:B330 STA $00 ; [$00] = number of coins to add R $05:B33F SBC $00 ; A = [$0DC0] - coins added R $05:BB43 ADC $00 ; Y = frame * 3 (first of the three animation slots) R $05:BB90 ORA $00 ; Add the frame offset: A = byte offset in AnimatedTileData W $05:C07F STA $00 ; [$00] = layer X position R $05:C09D SBC $00 ; [$00] = target X - layer X position (signed distance) R $05:C167 BIT $00,X ; Test the sign of this axis' distance [$00+X] R $05:C489 ADC $00 ; BG3 X [$22] += [$00]: BG3 also follows layer 1 W $05:CE22 STA $00 ; Keep the subtraction result as the new value W $05:CE56 STA $00 ; [$00] = hundreds value W $05:CE65 STA $00 ; [$00] += tens value W $05:CE70 STA $00 ; [$00] = timer value (0..999) W $05:CF6B STZ $00 ; [$00] = 0: high word of the value W $05:CF83 STA $00 ; [$00] = buffer start + 8: stop blanking before the last digit W $05:D7ED STA $00 ; [$00] = secondary exit start position byte ($05FA00[Y]) R $05:D86E ORA $00 ; [$00] |= (tile X & $10) << 4: bit 4 of X becomes bit 8 R $05:D87F ORA $00 ; X = index into the overworld level map: Y bit 4 becomes bit 9 R $05:DAAF ADC $00 ; Y = X * 3 (3-byte pointer entries) W $0C:94A6 STA $00 ; [$00] = $9100: address of the first Map16 definition in bank $0D W $0C:94B6 STA $00 ; Next definition: address += 8 (four 8x8 tile words) W $0C:94E4 STX $00 ; [$00] = [$1928] * 256: running Map16 counter (256 per background) RW $0C:953D INC $00 ; Next Map16: [$00]++ W $0C:9EFF STA $00 ; [$00] = byte count - 1 W $0C:9F76 STA $00,X ; Work copy [$00] = BG2 H-scroll [$1E] W $0C:9FE4 STA $00,X ; Position [$00,X] += pixels W $0C:A11F STA $00 ; X += $10: next column W $0C:A127 STA $00 ; X back to the left edge W $0C:A176 STA $00 ; $00 = $02 = $0080 - [$04] - $0040: X position of the second banner half W $0C:A1B3 STA $00 ; X position += $0010: next tile column W $0C:A21C STA $00 ; $00 = Yoshi sprite X (low byte) W $0C:A235 STA $00 ; $00 = actor 0 X position + $10 W $0C:A296 STA $00 ; $00 = actor 0 X position + $10 W $0C:A363 STA $00 ; $00 = $18: X position of the left character W $0C:A37F STA $00 ; $00 = $D4: X position of the right character W $0C:A3A3 STA $00 ; $00 = $50: X position of the centre character W $0C:A481 STA $00 ; $00 = $18: X position of the left character W $0C:A49B STA $00 ; $00 = $D4: X position of the right character W $0C:A4B8 STA $00 ; $00 = $18: X position of the left character W $0C:A4D0 STA $00 ; $00 = $CC: X position of the right character W $0C:A4F6 STA $00 ; $00 = $50: X position of the centre character W $0C:A512 STA $00 ; $00 = Yoshi sprite X (low byte) W $0C:A8EE STA $00 ; $00 = slot X position R $0C:A9AE ADC $00 ; OAM X (tile 1) = X offset [DATA_0CA96A+Y] + [$00] R $0C:A9B7 ADC $00 ; OAM X (tile 2) = X offset [DATA_0CA96B+Y] + [$00] R $0C:ABF1 ADC $00 ; $00 = $B0B0 + [DATA_0CAB9C+[DATA_0CABAB+Y]]: source palette block W $0C:AE1B STA.W $0000 ; [$00] = pointer low W $0C:B5CA STY $00 ; [$00] = priority bits to merge into each sprite's properties W $0C:C964 STA $00 ; [$00] = (cutscene number - 1) * 8 W $0C:C972 STA $00 ; [$00] += text line index = [$1443] bits 7-5 W $0C:CB8A STX $00 ; [$00] = X of the next sprite in the row W $0C:CBBA STA $00 ; Next sprite X = X + $10 W $0C:CC2E STA $00 ; [$00] += 8: next column W $0C:CC37 STA $00 ; ...[$00] = left X again W $0C:CCC8 STY $00 ; $00 = X position of the current tile W $0C:CD09 STA $00 ; [$00] += $10 (next tile to the right) W $0C:CD15 STA $00 ; X position = row start [$04] W $0C:CE31 STA $00 ; X position of the 2x2 sprite = $A8 W $0C:CE97 STA $00 ; [$00] += $10: next tile to the right W $0C:D072 STA $00 ; $00, $02 = Mario X + $10 W $0C:D0A1 STA $00 ; [$00] += 8: next piece to the right R $0C:D262 ADC $00 ; Y = ([$1446] - $38) / 4 + [$00]: select which tile-word pair to patch in W $0C:D4B5 STA $00 ; [$00] = 2: three sprites R $0C:D536 ADC $00 ; OAM Y = Mario Y + object 2 Y + [$00] R $0C:D5A8 ADC $00 ; OAM Y = object 3 Y + Mario Y + [$00] W $0C:D70E STA $00 ; [$00] = X offset base DATA_0CD6C4[Y] W $0C:D76A STA $00 ; [$00] = Y of this sprite W $0D:A57F STA $00 ; [$00] = tile table index (also used for item memory checks) W $0D:A71F STA $00 ; $00 = 8: width - 1 (9 columns) W $0D:A8C9 STA $00 ; $00 = $02 = [$59] AND $0F: width - 1 W $0D:AABA STA $00 ; $00 = $01 = [$59] AND $0F: pipe length W $0D:AB7F STA $00 ; $00 = ([$59] >> 4) + 1: rows in the slope RW $0D:AC2B INC $00 ; [$00] = (size >> 4) + 1 = number of rows RW $0D:AC5C DEC $00 ; Next row: [$02]++, rows left [$00]-- W $0D:AC98 STA $00 ; [$02] = [$00] = 3 (tiles in the first row) RW $0D:ACA5 INC $00 ; [$00] = (size >> 4) + 1 = number of rows W $0D:AD4A STX $00 ; [$02] = [$00] = 1 (slope tiles in first row) RW $0D:AD57 INC $00 ; [$00] = (size >> 4) + 1 = number of rows RW $0D:AD9B DEC $00 ; [$02] += 2, X = [$02], next row W $0D:ADA9 STX $00 ; [$02] = [$00] = 0 (slope tiles in first row) RW $0D:ADB6 INC $00 ; [$00] = (size >> 4) + 1 = number of rows RW $0D:ADFC INC $00 ; [$00] = (size >> 4) + 1 = number of rows RW $0D:AE65 DEC $00 ; Decrement rows left W $0D:AE75 STA $00 ; [$00] = size >> 4 = height W $0D:AF04 STA $00 ; [$00] = size >> 4 = height W $0D:B07D STA $00 ; [$00] = size >> 4 (height) W $0D:B433 STA $00 ; Width (the height bits are obviously unused) W $0D:B747 STA $00 ; $00 = size = high nibble of [$59] (number of extra rows) W $0D:B926 STA $00 ; $00 = width = low nibble of [$59] W $0D:B973 STA $00 ; $00 = height = high nibble of [$59] W $0D:B9C8 STA $00 ; $00 = height = high nibble of [$59] (width bits are unused) W $0D:BA59 STA $00 ; $00 = height = high nibble of [$59] W $0D:BAED STA $00 ; $00 = 15: sixteen tiles per row (one screen wide) W $0D:C2EF STA $00 ; $00 = 8: 8 tiles drawn with the blank check, plus 1 without W $0D:C324 STA $00 ; $00 = 1: two tiles per row (count - 1) RW $0D:C36E INC $00 ; $00 = number of rows = high nibble of [$59] + 1 RW $0D:C3EE INC $00 ; $00 = number of rows = high nibble of [$59] + 1 W $0D:C434 STA $00 ; $00 = width-1 = low nibble of [$59] W $0D:C457 STA $00 ; $00 = height-1 = high nibble of [$59] W $0D:C47E STA $00 ; $00 = low nibble of [$59] (tiles per row) W $0D:C4CF STA $00 ; $00 = width-1 = low nibble of [$59] W $0D:C4FC STA $00 ; $00 = height-1 = high nibble of [$59] W $0D:C590 STA $00 ; $00 = width-1 = low nibble of [$59] W $0D:C5E0 STA $00 ; $00 = height-1 = high nibble of [$59] W $0D:CEF8 STA $00 ; $00 = width-1 = low nibble of [$59] W $0D:CF18 STA $00 ; $00 = width-1 = low nibble of [$59] W $0D:CF40 STA $00 ; $00 = height-1 = high nibble of [$59] W $0D:DF49 STA $00 ; [$00] = $0F: row width - 1 R $0D:DF4F LDX $00 ; X = row width counter W $0D:DF7A STA $00 ; Canvass index [$00] = 0 RW $0D:E009 INC $00 ; Next canvass index W $0D:E02B STA $00 ; [$00] = $01B0: bytes in one screen W $0D:E040 STA $00 ; [$00] = $01B0: bytes in one screen W $0D:E973 STA $00 ; [$00] = 3: fill four 256-tile pages R $0D:E9B7 ADC $00 ; X = ([$59] - $61) * 9: offset of this 3x3 piece (clock, beam TL-BR, beam TR-BL) W $0D:E9BC STA $00 ; [$00] = [$01] = 2: width and height - 1 RW $0D:E9CE DEC $00 ; Next tile; repeat for the row W $0D:E9F9 STA $00 ; [$00] = [$01] = 1: width and height - 1 RW $0D:EA0B DEC $00 ; Next tile; repeat for the row W $0D:EA4C STA $00 ; [$00] = [$01] = 3: width and height - 1 RW $0D:EA5E DEC $00 ; Next tile; repeat for the row RW $0D:EAD2 DEC $00 ; Next tile; repeat for 6 tiles RW $0D:EB7D DEC $00 ; Next tile; repeat for 9 tiles W $0D:EC39 STA $00 ; [$00] = 15: tiles to write before the last one of a row RW $0D:EC46 DEC $00 ; X++; repeat for 15 tiles W $0D:ECD4 STA $00 ; [$00] = [$02] = width, low nibble of [$59] $0001 Scratch byte $01 scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
633 uses in 273 routines (278 read, 277 write, 78 read-modify-write) W $00:85DC STA $01 ; [$01] = pointer high byte W $00:86EC STA $01 ; [$01]-[$02] = high and bank bytes of the table address - 1 W $00:8715 STA $01 ; [$01]-[$02] = high and bank bytes of the target W $00:8B34 STA $01 ; [$01] = [$00] if the table entry is $0100, else 0 (high byte of the product) W $00:8E9C STZ $01 ; [$00]-[$01] = high byte of the score, as a 16-bit value W $00:908E STY $01 ; [$01] = OAM offset of the item box sprite W $00:91CC STZ $01 ; [$00]-[$01] = X position of the current column (16-bit) RW $00:9204 DEC $01 ; [$00]-[$01] -= 8 (16-bit): next column is 8 pixels to the left W $00:944C STA $01 ; Circle centre: [$00] = $80 (X), [$01] = $70 (Y) RW $00:9796 ROL $01 ; [$01] = carry (high byte) W $00:A881 STA $01 ; [$01] = $7EB3, so [$00] = $7E:B3F0 (offset $06F0 in the decompressed buffer) W $00:CA86 STA $01 ; [$01] = Mario screen Y + A: iris center Y W $00:D6CB STA $01 ; [$01] = held direction bit W $00:D6EC STA $01 ; [$01] = held direction bit R $00:D73F ORA $01 ; Y = dash state << 1 | slope [$13E1] | direction [$01]: max speed index W $00:F4CD STA $01 ; [$01] = high byte of the map16 pointer W $00:FA31 STA $01 ; [$01] = A * 16 (low byte) W $01:8061 STA $01 ; [$01] = $0A: Y offset of the smoke puff R $01:8081 ADC $01 ; Smoke Y position ($17C4,Y) = sprite Y + [$01] W $01:9474 STA $01 ; [$01] = copy of clip X low W $01:94E5 STA $01 ; [$01] = copy of clip X low R $01:9D00 ADC $01 ; Add the Y offset to the Y position W $01:9E47 STA $01 ; [$01] = sprite Y position low R $01:A33A ADC $01 ; Item X = baby Yoshi X + offset (16-bit) R $01:A7A5 LDY $01 ; Shell X low = X low + DATA_01A778[facing] R $01:A7B2 LDY $01 ; Shell X high = X high + DATA_01A77A[facing] W $01:AC59 STA $01 ; [$01] = Y = [$03] | (frame counter & 1): index into the offset tables RW $01:AC74 LSR $01 ; Test bit 0 of [$01]: left or right side W $01:B2E5 STA $01 ; $01 = animation frame [$1602] (0 short, 1 long) R $01:B378 LDY $01 ; A = 4 (5 tiles) for the long platform R $01:B48D SBC $01 ; Mario Y low = sprite Y low - [$01] R $01:B766 SBC $01 ; Tile 3 X = center X - [$01] R $01:B774 ADC $01 ; Tile 1 X = center X + [$01] W $01:B7CE STA $01 ; $01 = sprite Y position high W $01:BB47 STA $01 ; $01 = sprite Y on screen R $01:BB8E LDA $01 ; A = sprite Y on screen W $01:BD06 STA $01 ; Screen Y -= 4 (center the 8x8 tiles) W $01:BF6A STA $01 ; Aim at Mario. Parameters: A = speed. Returns: $00 = Y speed, $01 = X speed R $01:BFA5 LDX $01 ; X = speed (loop count) W $01:BFC4 STA $01 ; Yes: swap $00 and $01 W $01:C82F STY $01 ; [$01] = 1 if the platform is left of the pivot R $01:C8A3 LDA $01 ; [$01] = 0: platform is right of the pivot W $01:C916 STA $01 ; [$00] = pivot Y (16-bit) - 8 R $01:D4C5 LDA $01 ; Sprite screen Y ([$01]) W $01:D735 STA $01 ; [$01] = $F2 (spark Y offset, above sprite) R $01:D964 LDX $01 ; X = Y position high byte R $01:D985 ADC $01 ; $06 = high byte of the Map16 address (horizontal level) W $01:DA58 STA $01 ; $01 = sprite Y high W $01:DFDF STX $01 ; X = $01 = cell counter, 2 down to 0 R $01:DFE7 ADC $01 ; Y = line * 3 + cell W $01:F418 STA $01 ; $01 = on-screen Y of the tongue R $01:F47E LDA $01 ; A = on-screen Y of the tongue W $01:F4FD STZ $01 ; $01 = Y high offset = 0 RW $01:F507 DEC $01 ; Negative: Y high offset = $FF R $01:F512 ADC $01 ; Add the Y high offset W $01:F555 STA $01 ; $01 = tongue tip Y low R $01:F6F1 CMP $01 ; Compare [$05]+$0D with Yoshi's tongue Y [$01] W $01:FBB0 STA $01 ; [$01] = mirrored tilt step (used when tilt high byte is set) R $01:FBC9 LDY $01 ; Y = mirrored tilt step R $01:FBE7 LDY $01 ; Y = mirrored tilt step W $01:FC92 STA $01 ; [$01] = [$14BA] + $60 (kid hitbox Y) W $02:84AA STA $01 ; $01 = 2: spawn three splashes W $02:859B STX $01 ; $01 = vertical base offset W $02:9685 STA $01 ; $01 = bounce block Y low + offset R $02:9916 ADC $01 ; A = Y + DATA_0298C6[X] W $02:9A3B STA $01 ; [$01] = Y on screen W $02:9B69 STA $01 ; [$01] = Y on screen = ExSprite Y low - [$1C] W $02:A077 STA $01 ; [$01] = behind layers flag W $02:A1E0 STA $01 ; [$01] = behind layers flag W $02:A637 STA $01 ; X + 4: [$01] and block X low W $02:A69D STA $01 ; X + 4: [$01] and block X low W $02:A828 STA $01 ; $01 = screen to spawn sprites from R $02:AF5D LDA $01 ; X position high from $01 R $02:AFCD LDA $01 ; A = X position high from $01 R $02:B76B LDA $01 ; A = this segment's Y W $02:BB35 STA $01 ; [$01] = sprite Y low R $02:CB76 ADC $01 ; Store tile Y = sprite Y + offset R $02:CF26 ADC $01 ; A = screen Y + Y offset RW $02:D06E LSR $01 ; Test bit 0 of [$01] W $02:D09F STA $01 ; [$01] = [$13] bit 1 W $02:D2FB STA $01 ; [$01] = speed (travelled along the longer axis) R $02:D336 LDX $01 ; X = speed: loop counter W $02:D36F STA $01 ; [$01] = X speed toward Mario W $02:D4B6 STA $01 ; [$01] = sprite X high R $02:D5F3 LDA $01 ; A = sprite Y on screen RW $02:D6A3 LSR $01 ; Angle bit 8 into carry (second half of the circle) W $02:D703 STZ $01 ; [$01] = 0: high byte of Y offset RW $02:D709 DEC $01 ; [$01] = $FF: sign extend R $02:D778 LDA $01 ; A = ball screen Y ([$01] from the draw routine) R $02:D7B4 LDA $01 ; A = link Y on screen R $02:D7DA LDA $01 ; A = link Y on screen RW $02:D7E5 ROR $01 ; [$01] = distance / 2 (arithmetic shift) R $02:D822 LDA $01 ; A = sprite Y on screen W $02:DF33 STA $01 ; $01 = sprite X (high) W $02:EA2D STZ $01 ; [$01] = 0 (16-bit index) W $02:EB91 STA $01 ; [$01] = [$13] AND $00 = 0 (so acceleration happens every frame) W $02:EEE2 STA $01 ; [$00] = sprite Y position (16 bit) W $02:F209 STA $01 ; [$01] = sprite X high W $02:F78A STA $01 ; [$01] = $60 - [RAM_ScreenBndryYLo]: block Y on screen W $02:F86D STA $01 ; [$00] = [$1E66,X] (X offset), [$01] = [$1E52,X] (Y offset): set A W $02:F87E STA $01 ; Phase bit 0 clear: [$00] = [$1E8E,X], [$01] = [$1E7A,X] (set B) W $02:FACC STA $01 ; [$00] = ring center X (16-bit from [$0FB2,Y]/[$0FB4,Y]) W $02:FB07 STA $01 ; [$01] = (ring angle high + offset high) & 1 RW $02:FB9C DEC $01 ; [$01] = sign extension of the Y offset W $02:FC95 STA $01 ; [$00] = X position (16-bit) W $02:FE83 STA $01 ; [$00] = sprite X position (16-bit) W $03:8A0F STA $01 ; Smoke offset: X +4, Y +$0A W $03:97F9 STA $01 ; Aim at Mario. A: speed. Save to $01 RW $03:9978 LSR $01 ; $01 >>= 1: carry = ring half (bit 8 of the angle) W $03:99CF STZ $01 ; $01 = 0: high byte for sign extension RW $03:99D5 DEC $01 ; Negative: $01 = $FF R $03:9BA3 LDA $01 ; A = sprite Y on screen R $03:9C0E LDA $01 ; A = sprite Y on screen R $03:9E84 ADC $01 ; OAM Y = [$01] + DinoRhinoTileDispY[X] + carry (frames 1+ sit 1 pixel lower) R $03:9EEB ADC $01 ; OAM Y = [$01] + DinoTorchTileDispY[X] W $03:ACA3 STA $01 ; [$01] = Peach screen Y position W $03:B04C STA $01 ; [$01] = Bowser X high W $03:B885 STA $01 ; [$01] = (frame counter & 1) | [$03]: picks right edge or left edge, per margin set RW $03:B8A0 LSR $01 ; Carry = 1 on odd frames (left edge check) W $03:B8D1 STA $01 ; [$01] = frame counter bit 1: picks bottom edge or top edge W $03:CBD7 STA $01 ; $01 = spawner X low W $03:D784 STA $01 ; $01 = block X / 8 (tile column) W $03:D98A STA $01 ; [$00] = $0810: VRAM address of the platform (tilemap row 16, column 16) RW $03:D9D2 INC $01 ; [$00]/[$01] += $0080: next Mode 7 tilemap row W $04:830E STA $01,X ; Store the speed of the shorter axis in [$01,X] W $04:831C STA $01,X ; Store the speed in [$01,X] W $04:85EE STA $01 ; [$01] = $07: Y of the first backdrop tile W $04:DCCD STA $01 ; [$01] = [$1DE8] - 1: map page W $04:DCE6 STA $01 ; Other submap: page += 4 R $04:F351 ORA $01 ; A = high byte of screen Y | high byte of [$02]: non-zero means off screen W $04:F7BB STX $01 ; [$01] = X: inner loop counter RW $04:F8F4 INC $01 ; [$00]/[$01] += DATA_04F8A6[X] (16-bit, accumulates) RW $04:FA19 INC $01 ; [$00] += A (16-bit) RW $04:FCAF INC $01 ; [$00]/[$01] += DATA_04FC26[X] (puff wobbles) RW $04:FE29 INC $01 ; Carry: [$01]++ (X high byte) RW $04:FE40 INC $01 ; Carry: [$01]++ (X high byte) R $04:FF91 BIT $01,X ; Test sign of delta (high byte at [$01,X]) W $05:85EC STA $01 ; [$01] = low nibble of [$0B] W $05:D81F STA $01 ; [$01] = secondary exit X position byte ($05FC00[Y]) W $0C:9F01 STZ $01 ; [$01] = 0: length high byte W $0C:A021 STZ $01 ; [$00]/[$01] = $0051: X position of the extra pieces W $0C:A0EB STA $01 ; [$01] = $2F: Y of the first row R $0C:A183 LDA $01 ; Draw loop entry: X position high byte W $0C:A22D STZ $01 ; X position high byte = 0 W $0C:A23C STA $01 ; $01 = actor 0 X position high byte (+ carry) W $0C:A28E STZ $01 ; X position high byte = 0 W $0C:A2CB STA $01 ; $00 = actor 7 X position (16-bit with high byte $0B75) W $0C:A6E9 STZ $01 ; $01 = 0: X high byte W $0C:A8F3 STA $01 ; $01 = slot Y position W $0C:AE21 STA.W $0001 ; [$01] = pointer high W $0C:B5D6 STY $01 ; [$01] = $7F: next OAM high-table slot (counts down from 127) RW $0C:B62F DEC $01 ; Previous high-table slot W $0C:CB8E STA $01 ; [$01] = Y of the row = $67 W $0C:CC04 STA $01 ; [$01] = $5F: top Y of the block W $0C:CC3E STA $01 ; ...[$01] += 8: next row W $0C:CE3B STA $01 ; Y position of the 2x2 sprite = $5F - screen offset W $0C:D07B STA $01 ; $01 = Mario Y + $10 W $0C:D0B1 STA $01 ; [$01] += 8: next row W $0C:D231 STA $01 ; [$01] = current stripe image buffer index [$7F837B] R $0C:D265 LDX $01 ; X = start of the entry just written W $0C:D591 STY $01 ; [$00] = Y offset, [$01] = X offset R $0C:D59C ADC $01 ; OAM X = object 3 X + Mario X + [$01] W $0C:D713 STA $01 ; [$01] = Y offset base DATA_0CD6CA[Y] W $0D:A723 STA $01 ; $01 = 4: height - 1 (5 rows) W $0D:AAFE STA $01 ; $01 = $00: reload the length W $0D:AE7E STA $01 ; [$01] = 0: first-line flag RW $0D:AEC4 INC $01 ; Clear the first-line flag W $0D:AF0D STA $01 ; [$01] = 0: first-line flag RW $0D:AF57 INC $01 ; Clear the first-line flag W $0D:AF71 STA $01 ; [$01] = 0: first-line flag RW $0D:AFA5 INC $01 ; Clear the first-line flag W $0D:AFF8 STA $01 ; [$01] = 0: first-line flag RW $0D:B02F INC $01 ; Clear the first-line flag W $0D:B234 STA $01 ; [$00] = [$01] = height (high nibble of [$59]) W $0D:B2BF STA $01 ; [$01] = height again W $0D:B345 STA $01 ; Y = position, X = width, [$00] = width, [$01] = height W $0D:B61B STA $01 ; Number of tiles in left area RW $0D:B628 DEC $01 ; Check for end of the left area W $0D:B66C STA $01 ; Number of tiles in left area RW $0D:B679 DEC $01 ; Check if we need more left tiles W $0D:B74B STA $01 ; $01 = 1: first row has 2 tiles (count - 1) RW $0D:B76D INC $01 ; Next row is two tiles wider RW $0D:B777 DEC $01 ; Widest rows are 5 tiles, not 6 W $0D:B7BE STX $01 ; X = $01 = 1: width of the top row RW $0D:B805 INC $01 ; Next row is two tiles wider W $0D:B877 STX $01 ; X = $01 = 1: width of the first row RW $0D:B8BF INC $01 ; Rows get two tiles wider W $0D:B8C8 STX $01 ; Next (lower) rows are one tile narrower: $01 = X - 1 W $0D:B92E STA $01 ; $01 = height = high nibble of [$59] W $0D:BA19 STA $01 ; $01 = height = high nibble of [$59] W $0D:C328 STA $01 ; $01 = tiles left in this row W $0D:C486 STA $01 ; $01 = row count-1 = high nibble of [$59] W $0D:C598 STA $01 ; $01 = height-1 = high nibble of [$59] W $0D:D27A STA $01 ; Reload the width counter RW $0D:DCE5 DEC $01 ; X = width; next row; loop while rows remain (rows below the top use $1FF) R $0D:DDAA LDX $01 ; X = [$01]: tiles remaining in this column RW $0D:DE32 DEC $01 ; [$01] -= 2: next column is two tiles shorter R $0D:DE4D LDX $01 ; X = [$01]: tiles remaining in this column RW $0D:DED2 DEC $01 ; [$01] -= 2: next column is two tiles shorter W $0D:DF4D STA $01 ; [$01] = 4: five rows of this tile W $0D:DF82 STA $01 ; [$01] = 2: three middle rows RW $0D:DFD2 DEC $01 ; Middle rows: 3 tiles (page 0) from DATA_0DDEDC+4, 3 rows W $0D:E0C0 STA $01 ; [$01] = 2: three middle rows in this loop RW $0D:E0F4 DEC $01 ; Restore the pointer, move down a row; repeat for 3 middle rows W $0D:ECA4 STA $01 ; [$00] = [$01] = 1: width and height minus one $0002 Scratch byte $02 scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
679 uses in 233 routines (280 read, 333 write, 66 read-modify-write) W $00:85E1 STA $02 ; [$02] = pointer bank W $00:86FD STY $02 ; [$02] = low byte of the pushed return address (table address - 1) W $00:8ED5 STA $02 ; 32-bit value: [$00]-[$01] = high word, [$02]-[$03] = low word = Mario's score W $00:8F03 STA $02 ; Same setup with Luigi's score ([$0F37]-[$0F39]) W $00:8F92 STA $02 ; [$02] = this player's bonus stars W $00:98F4 STA $02 ; [$02] = source address $C680 (bank $7E) W $00:9EA2 STA $02 ; [$8A] = [$02] = entry counter W $00:AF56 STA $02 ; [$02] = working color from the DMA list W $00:AF77 STA $02 ; [$02] = working color W $00:AF8B STA $02 ; [$02] = working backdrop color [$0701] R $00:AFFA ADC $02 ; A = working color + step (A = 0 if no step) W $00:B015 STA $02 ; [$02] = working color [$0907+X] W $00:B04A STA $02 ; [$02] = 0: bank of the pointer in [$00] W $00:B070 STA $02 ; [$02] = working color from the second list W $00:C35B STA $02 ; [$02] = address of the cage tile words W $00:CC58 STA $02 ; [$02] = half-width from the table at [$04] RW $00:F4D8 INC $02 ; [$02] = $7F: the high-byte table W $00:F81D STZ $02 ; [$02] = 0 (no scroll) R $00:F8C6 EOR $02 ; Same sign as the distance [$02]? R $00:F8CD EOR $02 ; Same sign as [$02]? W $00:F8D9 STA $02 ; Store the adjusted distance W $01:88BD STA $02 ; [$02] = $44: box width R $01:8E0B ADC $02 ; A += [$02] (frame * 2) W $01:9DDF STA $02 ; [$02] = sprite direction W $01:9E35 STY $02 ; [$02] = wing frame (0 or 1) R $01:9E51 ADC $02 ; X = sprite direction * 2 + wing frame (table index) W $01:9F15 STA $02 ; [$02] = sprite direction R $01:A11B ADC $02 ; Sprite Y low = Mario Y + A RW $01:A700 INC $02 ; $02 = 1 if X is right of Y R $01:A70C CMP $02 ; Return unless X faces toward Y W $01:B3DB STA $02 ; $02 = [$01] - 1: tiles with a counter below this get X flipped R $01:B40A CPX $02 ; Compare loop counter [$01] with [$02], keeping X R $01:B739 SBC $02 ; Tile 2 Y = center Y - [$02] R $01:B747 ADC $02 ; Tile 0 Y = center Y + [$02] R $01:B7A4 LDA $02 ; Save [$00] and [$02] (probably clobbered by the OAM write) W $01:B7D2 STA $02 ; $02 = sprite X position low W $01:B867 STA $02 ; $02 = sprite Y on screen W $01:B8B7 STA $02 ; $02 = sprite Y on screen + [$0D]: bottom of the solid box W $01:BB4D STA $02 ; $02 = timer / 2: animation step W $01:BC27 STA $02 ; $02 = $03 = $10: 16x16 box W $01:BCFF STA $02 ; $02 = ([$03] + $0C) & $0F: Y phase, a quarter turn behind X W $01:BD2C STA $02 ; [$02] = ([$02] + 5) & $0F: next tile is 5 of 16 steps further round the circle W $01:BD52 STA $02 ; [$02] = ([$02] + 5) & $0F W $01:BF71 STY $02 ; [$02] = 1 if Mario is above W $01:C815 STA $02 ; [$02] = Y step per link (8.8 fixed point), low byte W $01:C8D5 STX $02 ; [$02] = tile counter W $01:D3DA STA $02 ; Fireball hitbox is 8x8: [$02] = [$03] = 8 W $01:D494 STA $02 ; [$02] = direction * 2 W $01:D71E STA $02 ; [$02] = staggered counter W $01:DFF1 STA $02 ; $02 = Y position of that position (DATA_01DD9A) R $01:E907 ADC $02 ; X = puff counter + frame offset: table index W $01:EEA1 STA $02 ; $02 = tile number the body was drawn with R $01:EEC1 LDA $02 ; (note: A = head tile number) W $01:F05E STA $02 ; $02 = offset table index W $01:F560 STA $02 ; $02 = tongue hitbox width W $01:FC96 STA $02 ; [$02] = $0F (hitbox width) W $02:80CB STA $02 ; $02 = ([$1540] >> 1) AND 3: number of offset steps for this frame W $02:82F0 STA $02 ; $02 = OAM X (kept for the wrap-around test) W $02:84B5 STA $02 ; $02 += $03: shift the X offset for the next splash W $02:84C4 STZ $02 ; $02 = 0: X offset of the first splash W $02:85B8 STA $02 ; $02 = (random AND $0F) - 2 + Mario X W $02:9204 STA $02 ; $02 = camera Y low of that layer W $02:9A11 STA $02 ; [$02] = layer Y position low R $02:9A39 SBC $02 ; A = coin Y - layer Y W $02:A68A STA $02 ; $02 = Y high byte, block Y high W $02:A85B STX $02 ; $02 = sprite number in the level R $02:A936 LDX $02 ; Gave up: X = this sprite's index in the level data W $02:AB78 STX $02 ; [$02] = index of the sprite in the level R $02:AF7D LDA $02 ; A = level sprite index from caller R $02:AFEC LDA $02 ; A = level sprite index from caller W $02:B732 STA $02 ; [$02] = [$07] = segment bitmask RW $02:B76D LSR $02 ; Segment present? (bit into carry) W $02:BB23 STA $02 ; [$02] = A (wing frame 0 or 1) RW $02:BC26 ASL $02 ; Carry = sign of the X speed (set: moving left) W $02:BF7D STA $02 ; [$02] = animation frame W $02:C1AD STA $02 ; $02 = Chuck direction W $02:CBB9 STA $02 ; [$02] = shovel index W $02:CCCE STY $02 ; [$02] = OAM index of the current column R $02:CCD0 LDY $02 ; Y = OAM index of the current column W $02:CD8D STA $02 ; [$02] = palette bits R $02:CDB0 ORA $02 ; Yes: add the switch color palette bits W $02:CEE5 STA $02 ; [$02] = 4: piece counter, 5 pieces R $02:CF02 ADC $02 ; X = |[$C2]| * 5 + piece number R $02:CFED LDY $02 ; Y = [$02] (piece number) W $02:D302 STY $02 ; [$02] = vertical sign (1 = Mario above the sprite) W $02:D9E4 STA $02 ; $02 = [DATA_02D9D2+Y]: offset into the tile position tables R $02:D9FB ADC $02 ; X = tile index + animation offset W $02:DB03 STA $02 ; $02 = sprite direction flag ($00 or $40) R $02:DC60 ORA $02 ; X = tile counter | animation set offset W $02:DE4B STA $02 ; Store the flip flag R $02:DE86 ADC $02 ; OAM properties = $34 + flip flag + carry W $02:E3B9 STA $02 ; $02 = wobble X offset R $02:EEF0 CMP $02 ; Compare Y with $0110 W $02:F124 STA $02 ; [$02] = segment facing history W $02:F5DA STZ $02 ; [$02] = 0: X high-bit flag RW $02:F5EB INC $02 ; No: set the OAM X high bit flag W $02:F78C STX $02 ; [$02] = tile number within the frame W $02:FB15 STA $02 ; [$02] = ([$00] + $80) & $1FF: angle + 90 degrees W $02:FD48 STA $02 ; [$02] = palette bits ORed into the OAM property byte R $02:FD83 ORA $02 ; Flip X ($40) unless X speed is negative; property = $31 | [$02] R $02:FE90 CMP $02 ; Mario X - sprite X + $0A must be below the width W $03:83D2 STA $02 ; [$02] = frame * 20: index of this frame's first tile in the tables R $03:83E1 LDX $02 ; X = [$02]: table index of this tile RW $03:8426 INC $02 ; Tile index [$02]++ W $03:85AF STA $02 ; [$02] = sprite direction W $03:86B6 STA $02 ; [$02] = 0 or 5: wing frame from [$14] bit 3 W $03:8845 STA $02 ; [$02] = graphics direction W $03:8CF3 STA $02 ; Hitbox width and height ($02, $03) = 8 W $03:8D2E STX $02 ; X = $02 = 2 (three tiles) RW $03:8D59 DEC $02 ; X--, $02--; loop for 3 tiles W $03:8E24 STA $02 ; Store the number tile in $02 R $03:8E47 LDA $02 ; OAM tile = TimedPlatTiles[X], or the number tile in $02 for X = 2 R $03:8F36 ORA $02 ; X = loop counter | $02 (index into X offsets) W $03:94D2 STZ $02 ; $02 = 0: table offset for first spike type R $03:94E4 ADC $02 ; X = tile counter + [$02]: table index R $03:97C8 ORA $02 ; X = tile counter | direction offset W $03:9800 STY $02 ; $02 = vertical side W $03:9B89 STA $02 ; $02 = direction * 4: index into the facing-dependent X offsets R $03:9B96 ORA $02 ; Add the direction offset to the tile index W $03:9C00 STA $02 ; $02 = platform Y offset R $03:9C11 SBC $02 ; Minus the bounce offset R $03:A3FC ORA $02 ; X = phase row | particle W $03:AF67 STA $02 ; [$02] = ([$14] >> 2) AND 7: rotation phase RW $03:B01E INC $02 ; [$02] = 1: spawn the right one R $03:B04F LDX $02 ; X = [$02]: which side R $03:B3AF ADC $02 ; X = tile index + direction offset W $03:B674 STA $02 ; $02 = hitbox width $0C W $03:C0D3 STX $02 ; [$02] = tile counter R $03:C407 ADC $02 ; X = direction * 3 + tile index W $03:D492 STA $02 ; $02 = [$1602] * 6: offset of this animation frame (6 tiles per frame) W $03:D996 STY $02 ; $02 = index of the first block of this row R $03:D9A6 LDY $02 ; Y = first block of this row W $03:DDAE STZ $02 ; [$00] = $00:xxxx: pointer to the boss palette in bank 0 W $03:DF55 STX $02 ; $02 = number of passes left W $04:8E6D STA $02 ; [$02] = player's tile row ([$1F21]) W $04:935A STY $02 ; [$02] = pressed direction (Y) W $04:93AC STA $02 ; [$02] = second offset W $04:9535 STA $02 ; [$02] = player tile Y ([$1F21+X]) W $04:984C STA $02 ; [$02] = player Y position W $04:9A38 STA $02 ; [$02] = $1A: index of the last entry in the tile table (DATA_0499F0) R $04:9A6F LDY $02 ; Y = [$02]: index into the tile table W $04:DC7A STA $02 ; [$02] = $04: source is $04:A533 (layer 2 tile numbers) W $04:DCEE STA $02 ; [$02] = tile number from $7E:C800 W $04:DD09 STA $02 ; [$02] = column byte offset R $04:DD77 LDA [$02],Y ; Fetch the byte to repeat W $04:E71E STA $02 ; [$02] = VRAM address W $04:E7F1 STA $02 ; [$02] = VRAM address of the next row W $04:E81A STA $02 ; [$02] = VRAM address W $04:E8B1 STA $02 ; [$02] = VRAM address of the next row W $04:E8DA STA $02 ; [$02] = VRAM address W $04:EAED STA $02 ; [$02] = X position of this tile R $04:F34A ADC $02 ; [$02] += height: screen Y adjusted for how high the particle is R $04:FE4E LDA $02 ; A = screen Y low [$02] W $05:8224 STA $02 ; [$02] = $8000: start of the shared Map16 data W $05:824E STA $02 ; [$02] += 8 (each Map16 tile is 8 bytes) W $05:B202 STA $02 ; [$02] = 18 tiles per row W $05:C084 STA $02 ; [$02] = layer Y position R $05:C0C2 SBC $02 ; [$02] = target Y - layer Y position (signed distance) W $05:C534 STX $02 ; [$04] = larger, [$02] = smaller of the two values W $05:C5D0 STX $02 ; [$04] = larger, [$02] = smaller of the two values W $05:CE85 STA $02 ; [$02] = low byte of low byte * 50 W $05:CEF0 STA $02 ; [$0F40] -= step; [$02] = new remaining bonus W $07:F1CF STZ $02 ; $02 = 0: X shift of tens digit W $07:F1F8 STA $02 ; $02 = $20: units digit is drawn 32 pixels to the right W $0C:94F1 STA $02 ; [$02] = Map16 number, low byte W $0C:9EFA STA $02 ; [$02] = starting column W $0C:A029 STA $02 ; [$02] = $85 + offset table [X]: Y position of the extra pieces W $0C:A03D STA $02 ; [$02] = $10: OAM offset for the objects W $0C:A0E7 STA $02 ; [$00] = [$02] = $10: left edge X of the grid W $0C:A163 STA $02 ; $00 = $02 = [$00] + $0080: X position of the first banner half (left edge) W $0C:A220 STA $02 ; $02 = $9F: Y position W $0C:A240 STA $02 ; $02 = $9F: Y position W $0C:A2A1 STA $02 ; $02 = $9F: Y position W $0C:A307 STA $02 ; $02 = $88: OAM index for the line sprites W $0C:A36A STA $02 ; $02 = actor 1 Y position W $0C:A386 STA $02 ; $02 = actor 1 Y position W $0C:A3A8 STA $02 ; $02 = actor 1 Y position W $0C:A487 STA $02 ; $02 = $9F: Y position W $0C:A4A1 STA $02 ; $02 = $9F: Y position W $0C:A4BE STA $02 ; $02 = $A7: Y position W $0C:A4D6 STA $02 ; $02 = $A7: Y position W $0C:A4FA STA $02 ; $02 = $9F: Y position W $0C:A516 STA $02 ; $02 = $9F: Y position W $0C:A67C STA $02 ; Picture column X positions $00, $02, $04 = object X position W $0C:A6FC STA $02 ; $02 = $9F: Y position R $0C:A8F5 LDX $02 ; X = OAM offset [$02] RW $0C:A930 INC $02 ; OAM offset [$02] += 4 R $0C:A9C0 ADC $02 ; OAM Y (tile 1) = Y offset [DATA_0CA982+Y] + [$02] R $0C:A9C9 ADC $02 ; OAM Y (tile 2) = Y offset [DATA_0CA983+Y] + [$02] W $0C:ABF5 STZ $02 ; $02 = 0: source bank 0 W $0C:AE26 STA.W $0002 ; [$02] = bank $0D: [$00] points at an extra screen image in bank $0D W $0C:CC00 STA $02 ; [$00] = [$02] = $A8: left X of the block W $0C:CCCE STA $02 ; $02 = Y position of the current row = $57 W $0C:CD1C STA $02 ; Y position [$02] += $10 (next row down) R $0C:D4D1 ADC $02 ; OAM Y = Mario Y + Y offset + [$02] W $0D:A72C STA $02 ; $02 = columns left in this row RW $0D:A739 DEC $02 ; Columns left in the row: $02-- W $0D:A771 STA $02 ; $02 = columns left in this row RW $0D:A77E DEC $02 ; Columns left: $02-- W $0D:A7CA STA $02 ; $02 = 3: tiles per row - 1 (4 columns) RW $0D:A7D4 DEC $02 ; X++, columns left: $02-- RW $0D:A943 DEC $02 ; Columns left in the row: $02-- W $0D:A951 STA $02 ; $02 = $00: reset the width counter W $0D:AB72 STA $02 ; $02 = $00 = 1: tiles on the top R $0D:AB83 LDX $02 ; X = [$02]: tiles to draw in this row RW $0D:ABBD INC $02 ; $02 += 2: the next row has two more tiles W $0D:AC2F STA $02 ; [$02] = 0 (tiles of ground to add) R $0D:AC34 LDX $02 ; X = number of ground tiles in this row R $0D:ACA7 LDX $02 ; X = number of tiles in this row W $0D:AD08 STA $02 ; [$02] += 4 (each lower row is 4 tiles longer) W $0D:ADEF STX $02 ; [$02] = 3 (slope tiles in first row) R $0D:AE63 LDX $02 ; [$02] += 4, X = [$02] (next row is 4 tiles longer) RW $0D:AE7A DEC $02 ; [$02] = 2*height - 1 (width of the first row) R $0D:AE80 LDX $02 ; X = number of tiles in the row R $0D:AE88 LDX $02 ; X = tiles remaining in row W $0D:AED1 STA $02 ; [$02] -= 2 (each lower row is 2 tiles shorter) RW $0D:AF09 INC $02 ; [$02] = 2*height + 1 (width of the first row) W $0D:AF54 STA $02 ; [$02] -= 2 (next row is 2 tiles shorter) RW $0D:AF6D DEC $02 ; [$00] = size >> 4; [$02] = size - 1 (row length) R $0D:AF73 LDX $02 ; X = tiles remaining in row R $0D:AF7B LDX $02 ; X = tiles remaining in row W $0D:AFB4 STA $02 ; [$02]-- (row is one tile shorter) W $0D:AFF4 STA $02 ; [$00] = [$02] = size >> 4 (height) W $0D:B02D STX $02 ; [$02] = X - 1 (row is one tile shorter) W $0D:B1E1 STA $02 ; [$02] = height (high nibble) W $0D:B22A STA $02 ; [$02] = type (0 = midway gate, nonzero = goal gate) W $0D:B754 STA $02 ; $02 = tiles left in this row W $0D:B77B STA $02 ; $02 = tiles left in this row (widest rows) W $0D:B7B2 STA $02 ; $00 = $02 = height = low nibble of [$59] W $0D:B86B STA $02 ; $00 = $02 = width = low nibble of [$59] W $0D:B932 STA $02 ; $02 = tiles left in this row W $0D:BAF4 STA $02 ; $02 = tiles left in this row W $0D:C35C STA $02 ; $02 = 0: first row has 1 conveyor tile (count - 1) RW $0D:C39E INC $02 ; Next row is one tile wider W $0D:C3DC STA $02 ; $02 = 0: width of the first row RW $0D:C421 INC $02 ; Next row is one tile wider W $0D:C48F STA $02 ; $02 = tiles left in this row W $0D:DB0A STA $02 ; First line width = 1; [$02] = [$00] = 1 R $0D:DB1B LDX $02 ; X = line width counter RW $0D:DB55 INC $02 ; Line width += 2 (each line grows by one tile each side) W $0D:DB93 STA $02 ; First line width = 0; [$02] = [$00] = 0 R $0D:DBA4 LDX $02 ; X = line width counter R $0D:DBF9 LDX $02 ; X = line width so far W $0D:DC06 STX $02 ; First line width = 1; [$02] = [$00] = 1 R $0D:DC57 LDX $02 ; Reload the line width W $0D:DC65 STX $02 ; First line width = 0; [$02] = [$00] = 0 R $0D:DCA2 LDX $02 ; Reload the line width W $0D:DF99 STA $02 ; Top row width - 1 = 3 RW $0D:DFA8 DEC $02 ; Write top row: 4 tiles (page 1) from DATA_0DDEDC W $0D:DFDB STA $02 ; Bottom row width - 1 = 3 RW $0D:DFE8 DEC $02 ; Write the 4 bottom row tiles (page 1) W $0D:DFF1 STA $02 ; Last row width - 1 = 2 RW $0D:E001 DEC $02 ; Write the last row: 3 tiles of $076 (page 0) W $0D:E030 STA $02 ; [$02] = $C800: source = screen 0 R $0D:E035 LDX $02 ; A = count, X = source, Y = destination W $0D:E045 STA $02 ; [$02] = $C800: source = screen 0 R $0D:E04A LDX $02 ; A = count, X = source, Y = destination W $0D:E0C4 STA $02 ; Top row width - 1 = 3 RW $0D:E0D1 DEC $02 ; Write the 4 top row tiles (page 1) from DATA_0DE05E,X W $0D:E0DD STA $02 ; Middle row width - 1 = 2 RW $0D:E0EA DEC $02 ; Write 3 middle row tiles (page 0), advancing X W $0D:E0FA STA $02 ; Fourth middle row width - 1 = 2 RW $0D:E107 DEC $02 ; Write 3 tiles of the fourth middle row (page 0) W $0D:E117 STA $02 ; Last row width - 1 = 2 RW $0D:E127 DEC $02 ; Write the 3 last row tiles (page 0) W $0D:E14C STA $02 ; [$02] = width: middle tiles in the row W $0D:ECA8 STA $02 ; [$02] = row width counter RW $0D:ECB5 DEC $02 ; X++; repeat for 2 tiles per row R $0D:ECF6 LDA $02 ; [$02]--; repeat for width + 1 tiles W $0D:ED02 STA $02 ; Reload the row width counter W $0D:EFBD STA $02 ; [$02] = width counter W $0D:F003 STA $02 ; [$02] = width counter $0003 Scratch byte $03 scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
303 uses in 130 routines (130 read, 152 write, 21 read-modify-write) W $00:86DF STY $03 ; Save Y in [$03] (the stack holds the return address) W $00:870B STA $03 ; [$03]-[$04] = high and bank bytes of the table address - 1 W $00:8732 STA $03 ; [$03] = VRAM address low W $00:8F8D STZ $03 ; [$00], [$01], [$03] = 0: clear the high bytes of the 32-bit input R $00:A4C3 ADC $03 ; Y += length: next record W $00:CC44 STA $03 ; [$03] = high byte of the product (half-width from table at [$06]) W $01:88CB STA $03 ; [$03] = $10: box height W $01:8E07 STX $03 ; X = 1 (wing number), [$03] = wing number; loop start R $01:9D49 ORA $03 ; Properties = GeneralSprGfxProp[X] | [$03] W $01:AC23 STA $03 ; Entry 3: [$03] = 6 (selects the wide horizontal margin), skip to common code W $01:B3E3 STA $03 ; $03 = sprite palette bits R $01:B405 ORA $03 ; A = priority bits [$64] | palette [$03] R $01:B740 SBC $03 ; Tile 3 Y = center Y - [$03] R $01:B74E ADC $03 ; Tile 1 Y = center Y + [$03] W $01:B7DC STA $03 ; $03 = sprite X position high W $01:BCF8 STA $03 ; $03 = ([FrameCounterB] / 2) & $0F: phase index for the X offset W $01:BD3F STA $03 ; [$03] = ([$03] + 5) & $0F W $01:BD65 STA $03 ; [$03] = ([$03] + 5) & $0F W $01:BF81 STY $03 ; [$03] = 1 if Mario is to the left W $01:C81C STA $03 ; [$03] = Y step, high byte W $01:C925 STA $03 ; [$02] = pivot X (16-bit) - 8 W $01:CA1E STA $03 ; [$03] = platform screen Y W $01:D48E STA $03 ; [$03] = frame * 2 (tile index) R $01:D8C3 LDA $03 ; Sprite position = probe point ($00-$03) R $01:D971 ADC $03 ; $06 = high byte of the Map16 address (vertical level) R $01:D978 LDX $03 ; X = X position high byte (screen number) W $01:DC7E STA $03 ; $03 = number of tiles W $01:DFF6 STA $03 ; $03 = X position of that position (DATA_01DD91) W $01:E8FF STA $03 ; $03 = 3: puff counter W $01:F564 STA $03 ; $03 = tongue hitbox height W $01:FC9A STA $03 ; [$03] = $0C (hitbox height) W $01:FED9 STA $03 ; [$03] = animation frame [$1602] * 4 (index of its first tile) R $01:FEE1 ADC $03 ; X = tile counter + [$03]: index into the frame tables W $02:82AB STY $03 ; $03 = $0164: next spare OAM slot ($66 loaded into A is never used) R $02:8335 LDX $03 ; X = $03: OAM offset of the spare slot W $02:8361 STA $03 ; $03 += 4: next spare slot W $02:84A6 STA $03 ; $03 = A: X spacing between splashes W $02:9286 STA $03 ; $03 = screen number W $02:92EB STA $03 ; $03 = screen number W $02:9A16 STA $03 ; [$03] = layer X position low R $02:9A2D SBC $03 ; A = coin X - layer X (8-bit) W $02:A8C7 STY $03 ; $03 = data index of the sprite's first byte W $02:A8E2 STY $03 ; [$03] = data index of the sprite's first byte R $02:A93C LDY $03 ; Y = data index of the sprite's first byte R $02:AA54 LDY $03 ; Y = data index of the sprite R $02:AB46 LDY $03 ; Y = data index of the sprite W $02:AB7B STY $03 ; [$03] = data index of the sprite's first byte R $02:AB9E LDY $03 ; Y = data index of the sprite R $02:AF33 LDY $03 ; Y = index of this sprite in the level sprite data R $02:AF9D LDY $03 ; Y = index of this sprite in the level sprite data W $02:BF82 STA $03 ; [$03] = [$1558] (eye timer) W $02:CEF0 STA $03 ; [$03] = [$C2] (compression, signed) W $02:D021 STA $03 ; [$03] = entry point value R $02:D051 ORA $03 ; [$01] = [$13] bit 0 | [$03]: alternates the limit used each frame W $02:D312 STY $03 ; [$03] = horizontal sign (1 = Mario left of the sprite) R $02:D366 LDY $03 ; Y = horizontal sign RW $02:D6C6 LSR $03 ; Sign bit of (angle + $80) into carry W $02:D9F4 STA $03 ; $03 = bubble state [$1534] W $02:E3BE STA $03 ; $03 = wobble Y offset W $02:ECF2 STA $03 ; [$03] = frame * 4: first tile index of this frame W $02:F116 STA $03 ; [$03] = animation counter [$1570] W $02:F77A STA $03 ; [$03] = animation frame (0-3) = [DATA_02F749+Y] W $02:FE79 STZ $03 ; [$02] = width, [$03] = 0 W $02:FEA2 STA $03 ; [$02] = sprite Y + 3 (16-bit) W $03:85AA STA $03 ; [$03] = [$14] & 4: animation frame offset (0 or 4), changes every 4 frames W $03:8854 STA $03 ; [$03] = 0 or 4: animation frame (changes every 4 frames, per sprite) W $03:8B48 STA $03 ; [$03] = ([$04] EOR 1) - 1: loop end index R $03:8F44 ORA $03 ; X = loop counter | $03 (index into tiles and properties) W $03:919A STZ $03 ; $03 = 0: no extra flip W $03:91AE STA $03 ; $03 = DATA_039178[X] (hook flip bits) R $03:96A5 ORA $03 ; A = frame start + tile counter (index of this tile) R $03:97DE ORA $03 ; X = tile counter | frame offset W $03:9810 STY $03 ; $03 = horizontal side R $03:9864 LDY $03 ; Y = horizontal side RW $03:999B LSR $03 ; $03 >>= 1: carry = ring half W $03:9B82 STA $03 ; $03 = frame [$1602,X] * 4: index of the frame's first tile W $03:9EAC STA $03 ; $03 = lowest flame segment to draw R $03:9F20 CPX $03 ; Compare with lowest segment [$03] W $03:ACCB STY $03 ; [$03] = frame number R $03:B3C8 ADC $03 ; X = tile index + frame offset W $03:B68C STA $03 ; $03 = hitbox height from table W $03:B726 STA $03 ; $03 = hitbox height W $03:B859 STA $03 ; Store the margin set number W $03:B85D STZ $03 ; [$03] = 0: margin set 0 (default) W $03:C278 STA $03 ; [$03] = blade segment Y spacing R $03:C429 ADC $03 ; X = frame * 3 + tile index W $03:D99A STA $03 ; $03 = 0: first of the two tile rows of this block row W $03:DDCE STA $03 ; $03 = $80: number of 3bpp tiles to convert W $04:8088 STZ $03 ; [$03] = 0: index into DATA_048000 W $04:DADA STA $03 ; [$03] = repeat count - 1 W $04:DCF6 STA $03 ; [$03] = tile high bit from $7F:C800 R $04:E781 LDA $03 ; A = VRAM address low byte (column) R $04:E839 LDA $03 ; A = VRAM address low byte (column) W $04:EAE9 STA $03 ; [$03] = column counter W $04:EC30 STA $03 ; [$03] = 3: four sprites W $04:F7CA STA $03 ; [$02] = Y position of that slot (low, high) W $04:F902 STA $03 ; [$02]/[$03] = [$04]/[$05] + DATA_04F8AE[X] RW $04:FA25 INC $03 ; [$02] += DATA_04F9B4[Y] (16-bit) RW $04:FAC7 DEC $03 ; [$02]/[$03] = ground Y - 8: splash position RW $04:FCA3 DEC $03 ; [$02]/[$03] += [$07] + DATA_04FC36[X] (puff rises) W $04:FD8C STX $03 ; Neither set: [$03] = X (non-zero) hides the sprite R $05:813A LDY $03 ; Y = source offset [$03] W $05:865E STA $03 ; [$03] = pointer (bank 0) R $05:8C3E ORA $03 ; Word 0 (top-left 8x8 tile) | [$03] to left column buffer $1CE8 R $05:8C47 ORA $03 ; Word 1 (bottom-left) | [$03] to $1CEA R $05:8C50 ORA $03 ; Word 2 (top-right) | [$03] to right column buffer $1D68 R $05:8C59 ORA $03 ; Word 3 (bottom-right) | [$03] to $1D6A R $05:8D35 ORA $03 ; Word 0 (top-left 8x8 tile) | [$03] to top row buffer $1CE8 R $05:8D3E ORA $03 ; Word 1 (bottom-left) | [$03] to bottom row buffer $1D68 R $05:8D49 ORA $03 ; Word 2 (top-right) | [$03] to $1CE8 R $05:8D52 ORA $03 ; Word 3 (bottom-right) | [$03] to $1D68 W $05:B204 STZ $03 ; [$03] = 0: previous character did not end the line W $05:B212 STA.W $0003 ; Remember it (bit 7 = last character of the line) W $05:CE8A STA $03 ; [$03] = high byte of low byte * 50 W $05:CEA0 STA $03 ; [$03] += low byte of (high byte * 50): [$02] = timer * 50 W $0C:9462 STY $03 ; Advance the source index W $0C:9471 STY $03 ; Advance the source index R $0C:9480 LDY $03 ; Y = source index (literal run) W $0C:9485 STY $03 ; Advance the source index W $0C:94F5 STA $03 ; [$03] = Map16 number, high byte R $0C:A1C2 LDA $03 ; Row end: $00/$01 = start X ($02/$03) again W $0C:A682 STZ $03 ; Clear their high bytes ($01, $03, $05) W $0C:B5E8 STY $03 ; [$03] = X scroll used for this sprite (16-bit) R $0C:B5F3 SBC $03 ; A = X - scroll (low byte) W $0D:B249 STA $03 ; [$03] = top tile of column X (midway table; goal table if type != 0) W $0D:B273 STA $03 ; [$03] = middle tile of column X (midway or goal table) W $0D:B29D STA $03 ; [$03] = bottom tile of column X (midway or goal table) W $0D:B7BA STA $03 ; $03 = width = high nibble of [$59] W $0D:B873 STA $03 ; $03 = height = high nibble of [$59] W $0D:C372 STA $03 ; $03 = tiles left in this row (excluding the conveyor tile) W $0D:C3CF STA $03 ; Reload the row width W $0D:C425 STA $03 ; $03 = tiles left in this row W $0D:DF7E STA $03 ; [$03] = 7: draw 8 canvasses $0004 Scratch byte $04 scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
394 uses in 123 routines (191 read, 176 write, 27 read-modify-write) W $00:872D STA $04 ; [$04] = VRAM address high W $00:9026 STA $04 ; [$04] = [$00] - high word of 10^n - borrow (SBC DATA_008FFA,Y) W $00:9D5B STX $04 ; File counter [$04] = 2 (files 2, 1, 0) W $00:A9EA STA $04,X ; [$04+X] = file number (first list entry ends up in [$07]) R $00:A9FF LDY $04,X ; Y = file number for this slot R $00:AA04 CMP $04,X ; File already in this slot ([$0101+X]): skip the upload W $00:AA2B STA $04,X ; [$04+X] = file number (first list entry ends up in [$07]) R $00:AA40 LDY $04,X ; Y = file number for this slot R $00:AA45 CMP $04,X ; File already in this slot ([$0105+X]): skip the upload RW $00:AB75 ROL $04 ; Shift in 1 bit from byte 1: pixel 2 complete R $00:ACF0 LDA $04 ; A = color value [$04] R $00:ACFF LDX $04 ; X = [$04]: byte offset into the palette buffer $0703 (color number * 2) W $00:AFDA STZ $04 ; [$04] = 0: result color RW $00:AFFF TSB $04 ; Merge it into the result [$04] W $00:BF0B STA $04 ; $04 = low byte of the screen table address for this mode W $00:BF6E STA $04 ; $04 = column offset R $00:C028 ORA $04 ; $04 |= (block X & $80) / 128: left or right half of the screen R $00:C047 ADC $04 ; $04 += word from DATA_00BFFF W $00:C17F STA $04 ; [$04] = pointer to the tile's 8 bytes of tile words (table at $0FBE) R $00:C18C LDA [$04],Y ; Record 2, first tile = word 1 R $00:C194 LDA [$04],Y ; Record 1, second tile = word 2 R $00:C19C LDA [$04],Y ; Record 2, second tile = word 3 W $00:C261 STA $04 ; [$04] = pointer to the tile's tile words (table at $0FBE) W $00:C4D9 STA $04 ; [$04] = $CB93: address of the circle window shape data W $00:CA66 STA $04 ; [$04] = [$06] = $CB12 (circle shape table) W $00:E38D STA $04 ; [$04] = $C8 (tile size bits: 16x16, 16x16, 8x8, 8x8, 16x16...); $E8 for image $43 RW $00:E4A4 ASL $04 ; Carry = next size bit of [$04] W $00:F199 STA $04 ; [$04] = bounce sprite graphic (DATA_00F05C) W $00:F7FA STA $04 ; [$04] = bottom limit of the screen Y (A) W $01:8DFF STA $04 ; [$04] = sprite direction W $01:9D1C STA $04 ; [$04] = tile counter, 3 down to 0 R $01:9D43 ADC $04 ; X = [$05] * 4 + tile counter W $01:9E43 STA $04 ; [$04] = sprite X position high W $01:9F09 STA $04 ; [$04] = extra OAM property bits from A (for example $80 = Y flip) W $01:9F0D STZ $04 ; [$04] = 0 (no extra property bits) W $01:B801 STA $04 ; $04 = tile X in the level = offset + sprite X low W $01:B90C STA $04 ; $04 = sprite X low - [$00] W $01:C842 STA $04 ; [$04] = X step per link, low byte W $01:CAA2 STA $04 ; [$04] = platform X - $18 (16-bit, high byte to [$0A]) R $01:CB6A LDA $04 ; Low word of the product W $01:CB9B STA $04 ; [$04] = +/- radius Y * sine (low word) W $01:CC03 STA $04 ; [$04] = +/- radius X * sine (low word) W $01:CC38 STA $04 ; [$04] = low word of [$00] * [$02] R $01:D7BF LDA ($04),Y ; Table byte for this step R $01:D7C5 LDA ($04),Y ; Table byte again R $01:D828 CMP $04 ; Different tile row from the sprite: test this probe W $01:E010 STA $04,X ; $04+X = symbol [$1570] of the block at this position W $01:ED11 STA $04 ; Hitbox X low = Yoshi X + 4 W $01:FCA5 STA $04 ; [$04] = Mario X [$7E] + 2 (Mario hitbox) W $01:FD1C STA $04 ; [$04] = fireball X - screen X RW $02:8365 INC $04 ; Carry into the high byte of $03 R $02:8752 LDA $04 ; Entry: Spawn bounce sprite. [$04] = bounce type W $02:920E STA $04 ; $04 = camera Y high W $02:9A1B STA $04 ; [$04] = layer Y position high W $02:A8DF STA $04 ; [$04] = initial sprite status W $02:AB7D STA $04 ; [$04] = sprite number W $02:B739 STA $04 ; [$04] = [$151C] (bitmask before the last hit) RW $02:B771 LSR $04 ; Shift the previous-state bit W $02:BA02 STA $04 ; Unreachable vertical-level version: row bits of Y low into [$04] R $02:BA1E ORA $04 ; [$04] = column (X low >> 4) | row (Y low & $F0) R $02:BA31 ADC $04 ; [$05] = low byte of the map16 address R $02:BA6B ORA $04 ; [$04] = column (X low >> 4) | row (Y low & $F0) W $02:BB31 STA $04 ; [$04] = sprite X high W $02:C891 STY $04 ; Y = pose [$1602], copy to [$04] W $02:D6AA STA $04 ; [$04] = X offset from the pivot W $02:ECF5 STZ $04 ; [$04] = 0: tile counter W $02:F9C2 STA $04 ; [$04] = flame X low + 2 (hitbox X) W $02:FB22 STA $04 ; [$04] = CircleCoords[angle & $FF] (sine, $0100 = full scale) W $02:FB54 STA $04 ; [$04] = X offset from the ring center R $02:FEBB CMP $04 ; Mario Y - sprite Y + $1C must be below the height W $03:83D7 STA $04 ; [$04] = sprite direction [$157C] W $03:8B43 STA $04 ; [$04] = graphics frame W $03:9186 STA $04 ; $04 = animation frame [$1602] W $03:994D STA $04 ; $04 = sine value for $00 R $03:995E LDA $04 ; A = low byte of the sine value W $03:997F STA $04 ; $04 = X offset from the ring centre W $03:9DCA STA $04 ; $04 = X position low + flame X offset R $03:AAD4 ADC $04 ; X = counter + [$04]: table index W $03:AF5F STA $04 ; [$04] = Bowser direction R $03:B3BE ORA $04 ; Properties | palette | priority bits [$64] R $03:B731 SBC $04,X ; Low byte of distance between hitbox origins (B - A); save it W $03:C27D STA $04 ; [$04] = blade tile properties W $03:C400 STA $04 ; [$04] = loop end marker for this frame R $03:C441 CPX $04 ; Next tile; loop until the end marker W $03:CA0D STX $04 ; $04 = particle index W $03:CADC STX $04 ; $04 = particle index W $03:D9AA STA $04 ; $04 = 16 blocks per row W $03:DF67 STA $04 ; $04 = row width - 1: tile counter W $04:82C6 STA $04 ; [$04] = |delta X| / 2 R $04:89B2 ADC $04 ; OAM tile and property = [DATA_0487CB+Y] + [$04] (Luigi palette) R $04:8D60 ADC $04 ; Add the player's palette offset [$04] (Luigi) R $04:9025 LDX $04 ; X = [$04] (tile offset) R $04:921E LDX $04 ; X = [$04] (tile offset) R $04:9297 LDX $04 ; X = [$04] (tile offset of the level) R $04:92E0 LDX $04 ; X = [$04]; negative: no tile there W $04:9484 STA $04,X ; [$04+X] = |distance| on this axis ([$04] = X, [$06] = Y) R $04:9497 CMP $04 ; Compare |dY| with |dX| R $04:949D LDA $04 ; Otherwise swap: [$0A] = |dY| (major), [$0C] = |dX| (minor) W $04:96E5 STA $04 ; [$04] = 1: reverse flag for the table lookup below W $04:9723 STA $04 ; [$04] = DATA_049F49[X]: reverse flags (byte [$04] up/left, [$05] down/right) R $04:9755 LDA $04,X ; A = reverse flag [$04+X] R $04:D832 LDA [$04],Y ; A = layer 1 tile number at map position Y W $04:DA6A STA $04 ; [$04]/[$05] = $C800, pointer to layer 1 map at $7E:C800 W $04:DA93 STA [$04],Y ; Store it in the layer 1 map W $04:DA9B STA [$04],Y ; Store the same tile in the next map position W $04:DD4B STA $04 ; [$04] = $0C: source is $0C:8D00 W $04:E4A7 STA $04 ; [$04] = destination offset in $7F:4000 R $04:E4D5 LDX $04 ; X = destination offset W $04:E50A STA $04 ; Next row: [$04] += $40 W $04:E519 STA $04 ; Next page: [$04] += $1000 R $04:E525 LDX $04 ; X = destination offset W $04:E55A STA $04 ; Next row: [$04] += $40 W $04:E569 STA $04 ; Next page: [$04] += $1000 W $04:E7A5 STA $04 ; [$04] = 1: two columns R $04:E7BB LDA $04 ; Last column already? W $04:E865 STA $04 ; [$04] = 5: six columns R $04:E87B LDA $04 ; Last column already? W $04:EA3B STA $04 ; [$04] = destination R $04:EA52 LDX $04 ; X = destination offset W $04:FC7E STA $04 ; [$04] = 3: number of puffs W $04:FCE6 STA $04 ; [$04] = 4: number of tiles in Bowser's sign RW $04:FE00 ROR $04 ; Carry from caller into bit 7 of [$04]: 1 = 16x16 size R $04:FE11 BIT $04 ; Test bit 7 of [$04] (size flag) R $05:C08E CMP $04 ; Same X tile as the current node? W $05:C092 STZ $04 ; No X movement: [$04] = 0 W $05:C0A9 STA $04 ; [$04] = X distance in pixels R $05:C0E6 CMP $04 ; Y distance < X distance? W $05:C1E5 STA $04 ; [$04] = position (the larger) R $05:C1F3 CMP $04 ; Not equal (limit not reached): skip the turn-around R $05:C540 CMP $04 ; Smaller < larger: not at the turnaround yet, go to $05C585 R $05:C5DC CMP $04 ; Smaller < larger: not at the turnaround yet, go to $05C621 W $05:CE17 STA $04 ; [$04] = high word [$00] - place value (high word), with borrow R $07:F21C LDX $04 ; X = bonus display timer [$04] W $0C:94DB STY $04 ; [$04] = $00F0: source index of the first Map16 number RW $0C:953F INC $04 ; Next source entry: [$04]++ W $0C:9554 STA $04 ; [$04] = $02A0: source index of the second half W $0C:9F92 STA $04 ; Work copy [$02] and [$04] = BG3 V-scroll [$24] W $0C:A153 STZ $04 ; $00 = $02 = $04 = 0: X work values cleared W $0C:A83A STA $04 ; $04 = 1: draw two rows W $0C:A9A8 STA $04 ; $04 = 2: three pairs of tiles to draw W $0C:ABFA STA $04 ; $04 = 0: buffer offset W $0C:B5FE STA $04 ; [$04] = OAM X bit 8: borrow from the 16-bit subtraction R $0C:B608 ORA $04 ; A = X bit 8 | size bit (prop bit 4 moved to bit 1) W $0C:CCCA STY $04 ; $04 = X position of the start of a row W $0D:A9DF STA $04 ; Update the saved pointer low byte [$04] W $0D:A9F8 STA $04 ; Update the saved pointer low byte [$04] W $0D:DF74 STA $04 ; Pointer low bytes [$6B], [$04], [$6E] = 0 (the canvass table supplies the rest) W $0D:E020 STA $04 ; [$04] = this screen's low-byte buffer ($7E:xxxx) from DATA_0DDEFA $0005 Scratch byte $05 scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
201 uses in 83 routines (92 read, 99 write, 10 read-modify-write) W $00:8748 STA $05 ; [$05] = $08 if RLE (bit 6) else 0: DMA 'fixed source' flag W $00:9B79 STA $05 ; Pass the marked bits to the tilemap code in [$05] W $00:9D3A STZ $05 ; No files treated as empty W $00:BF10 STA $05 ; $05 = high byte of the screen table address W $00:BF5E STA $05 ; $05 = row offset low part W $00:E3A2 STA $05 ; [$05] = DATA_00DD32[Y] (tile layout offset) W $00:E43B STA $05 ; [$05] = DATA_00E21A[Y] (cape layout offset) R $00:E46B LDX $05 ; X = [$05] (position table offset) RW $00:E4B4 INC $05 ; [$05] += 2: next position entry W $00:F1D0 STA $05 ; [$05] = contents for the bounce sprite spawner W $00:F23C STZ $05 ; [$05] = 0 (no contents) W $01:8DF7 STA $05 ; [$05] = wing frame = A + [$1602,X] R $01:8E29 LDX $05 ; X = wing frame [$05] R $01:9531 LDA [$05] ; A = map16 high byte (page) W $01:9CF5 STA $05 ; [$05] = property row W $01:AE3B STA $05 ; $05 = contents ID for the spawn routine W $01:B806 STA $05 ; $05 = tile X in the level, high byte = sign + sprite X high W $01:B922 STA $05 ; $05 = sprite Y low - [$02] W $01:C849 STA $05 ; [$05] = X step, high byte W $01:C950 STA $05 ; [$04] = world X of this tile = delta + pivot world X (16-bit) W $01:CC3D STA $05 ; [$05] = high byte of that product (starts the 32-bit sum) W $01:CC52 STA $05 ; [$05] += low byte of [$00] * [$03] W $01:CC6E STA $05 ; [$05] += low byte of [$01] * [$02] R $01:D836 CMP $05 ; Probe is in the sprite's own tile: ignore it, next probe R $01:D990 LDA [$05] ; A = Map16 tile number (low byte) R $01:D997 LDA [$05] ; A = byte at $7F:xxxx W $01:ED1F STA $05 ; Hitbox Y low = Yoshi Y + $13 W $01:F462 STA $05 ; $05 = X spacing between tongue tiles R $01:F470 ADC $05 ; Advance X by the spacing R $01:F474 LDA $05 ; A = spacing (sign test) W $01:FCAC STA $05 ; [$05] = Mario Y [$80] + $10 W $01:FD26 STA $05 ; [$05] = fireball Y - screen Y W $02:8285 STA $05 ; $05 = -[screen X low]: full-speed scroll offset R $02:887D LDA $05 ; Sprite to spawn from the block [$05] R $02:88DC LDY $05 ; Y = sprite index [$05] W $02:9213 STA $05 ; $05 = camera X high W $02:92B5 STA $05 ; $05 = Map16 pointer low: DATA_00BA80 (layer 1) or DATA_00BA8E (layer 2) + [$00] W $02:9308 STA $05 ; $05 = Map16 pointer low: DATA_00BA60 (layer 1) or DATA_00BA70 (layer 2) + [$00] W $02:9599 STA $05 ; $05 = Map16 pointer low (DATA_00BA80 / DATA_00BA8E + [$00]) W $02:95FB STA $05 ; $05 = Map16 pointer low (DATA_00BA60 / DATA_00BA70 + [$00]) R $02:9618 LDA [$05] ; A = tile number high byte R $02:A6E9 LDA [$05] ; A = Map16 high byte W $02:A863 STA $05 ; $05 = sprite number W $02:B743 STZ $05 ; [$05] = 0: current squish offset W $02:B778 STA $05 ; Segment moved: [$05] = squish offset [$03] W $02:BA0A STA $05 ; [$05] = Y high byte (screen) W $02:BA80 STA $05 ; [$05] = low byte of the map16 address of the tile W $02:BF78 STZ $05 ; [$05] = 0: tile counter RW $02:BFB8 INC $05 ; [$05]++ (next tile) W $02:C8C5 STA $05 ; [$05] = sprite OAM index R $02:CA3D ADC $05 ; Y = OAM slot for the body = OAM index + offset by pose R $02:CAB6 LDY $05 ; Y = OAM index of the first slot R $02:CAFC LDY $05 ; Y = OAM index of the first slot W $02:CEEC STA $05 ; [$05] = sprite number - $6B (bit 0 = which wall: mirrors the X offsets) R $02:D1B4 LDA [$05] ; A = Map16 tile number low byte R $02:D1BB LDA [$05] ; A = tile number high byte R $02:D691 LDY $05 ; Y = sine high byte ($01 only when the sine is exactly 1.0) W $02:DC4E STA $05 ; $05 = dip amount [DATA_02DC37+Y] R $02:DC85 SBC $05 ; OAM Y -= dip amount [$05] W $02:DE59 STA $05 ; $05 = 3: four tiles W $02:ECEB STA $05 ; [$05] = sprite palette bits ($0E mask) R $02:ED50 ORA $05 ; Properties = table | sprite palette bits W $02:F12E STX $05 ; [$05] = segment counter W $02:F9D9 STA $05 ; [$05] = flame Y low + [DATA_02F9AA+Y] (hitbox Y) W $03:83DC STA $05 ; [$05] = sprite properties [$15F6] W $03:8B4D STA $05 ; [$05] = sprite palette R $03:9965 LDY $05 ; Y = high byte of the value ($01 only if value is $100) W $03:9DDF STA $05 ; $05 = Y position low + flame Y offset W $03:9EC4 STA $05 ; $05 = flicker flip bits R $03:9F11 EOR $05 ; Flame segments: apply flicker flip [$05] W $03:C3E6 STA $05 ; [$05] = turn timer [$15AC] R $03:D9AC LDA [$05],Y ; A = block number from the layout W $03:DDEA STA $05 ; $05 = 8 rows per tile W $03:DE18 STY $05 ; $05 = 8 pixels per row W $04:808A STZ $05 ; [$05] = 0: offset into the tile buffer at $0AF6 R $04:809B LDX $05 ; X = destination offset in the $0AF6 buffer W $04:82B1 STA $05 ; [$05] = |delta Y| / 2 R $04:82CA CMP $05 ; X = 1 if X distance >= Y distance (A = larger distance) R $04:82CF LDA $05 ; Else X = 0, A = Y distance W $04:DD75 STA $05 ; [$05] = repeat count - 1 W $04:FCEA STA $05 ; [$05] = $6F: tile number of the rightmost tile W $04:FE1A STY $05 ; [$05] = tile number R $04:FE49 LDA $05 ; A = tile number [$05] W $04:FF3D STZ $05 ; [$05] = 0: Z delta positive (so Z speed ends up negative) W $05:812E STY $05 ; Y = 0; [$03] = 0 (source offset), [$05] = 0 (destination offset) R $05:8158 LDY $05 ; Y = destination offset [$05] W $05:8165 STY $05 ; [$05] = Y (destination offset) R $05:8177 LDY $05 ; Y = destination offset W $0C:9453 STY $05 ; [$03] (source index) = [$05] (destination index) = 0 R $0C:9473 LDY $05 ; Y = destination index W $0C:947C STY $05 ; Save the destination index R $0C:9487 LDY $05 ; Y = destination index W $0C:948C STY $05 ; Advance the destination index W $0D:A6B7 STA $05 ; Save the level buffer pointer [$6B] in [$04] W $0D:A98F STA $05 ; Also update the saved pointer high byte [$05] W $0D:A9E9 STA $05 ; Update the saved pointer high byte [$05] W $0D:AA02 STA $05 ; Update the saved pointer high byte [$05] W $0D:AFE7 STA $05 ; Update all three pointer copies W $0D:DF93 STA $05 ; X = canvass index; position [$57]/Y and pointer high bytes [$6C],[$05],[$6F] from the tables $0006 Scratch byte $06 scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
217 uses in 75 routines (85 read, 126 write, 6 read-modify-write) W $00:874A STZ $06 ; [$06] = 0 (so [$05] is a clean 16-bit flag) W $00:901F STA $06 ; [$06] = [$02] - low word of 10^n (SBC DATA_008FFC,Y) W $00:905E STA $06 ; [$06] = [$02] - low word of 10^n W $00:977C STZ.W $0006,X ; Clear [$0006+X] R $00:AD01 LDY $06 ; Y = [$06]: colors per row - 1 W $00:BF65 STA $06 ; $06 = VRAM address high byte of the tile W $00:C178 STA $06 ; [$06] = $0D (VRAM address in [$06] is no longer needed) W $00:E3B4 STA $06 ; [$06] = TileExpansion?[Y] (8x8 tile set index) W $00:E404 STA $06 ; Cape tile set [$06] = $2C W $00:E453 STA $06 ; [$06] = [$0E]: third tile set R $00:E461 LDX $06 ; X = [$06] (index into Mario8x8Tiles) RW $00:E4B6 INC $06 ; [$06]++: next tile W $00:F18D STY $06 ; [$06] = side that was hit RW $00:FA35 INC $06 ; Carry: [$06]++ (pointer high byte) W $01:94AE STA $06 ; [$06] = pointer high + [$0B] W $01:9521 STA $06 ; [$06] = pointer high + [$0D] W $01:B7C9 STA $06 ; $06 = sprite Y on screen = Y low - screen Y R $01:B81F SBC $06 ; A = tile Y - [$06]: offset from the sprite's top edge W $01:B91B STA $06 ; $06 = [$00] * 2 + $10: box width W $01:BB53 STA $06 ; $06 = door frame (0-2) for this step W $01:C817 STA $06 ; [$06] = running Y offset, low byte (starts at one step) W $01:C92D STA $06 ; [$06] = screen Y of tile 1 (pivot), reference point R $01:CB74 LDA $06 ; High word of the product W $01:CBA5 STA $06 ; [$06] = +/- radius Y * sine (high word) W $01:CC0D STA $06 ; [$06] = +/- radius X * sine (high word) W $01:CC59 STA $06 ; [$06] = high byte of it + carry W $01:CC75 STA $06 ; [$06] += high byte + carry W $01:CC8A STA $06 ; [$06] += low byte of [$01] * [$03] W $01:D41B STA $06 ; Hitbox width [$06] = $10 W $01:D951 STA $06 ; $06 = Y & $F0: tile row in the high nibble R $01:D95A ORA $06 ; Combine into the tile index within the screen: A = column | row W $01:ED2C STA $06 ; Hitbox width and height = 8 W $01:F466 STA $06 ; $06 = tile counter (5 tiles, 4 down to 0) R $01:F483 LDA $06 ; Remaining tiles counter W $01:FCB0 STA $06 ; [$06] = $0C (Mario width) W $02:8294 STA $06 ; $06 = -(screen X >> 1): half-speed scroll offset R $02:8850 LDX $06 ; X = direction [$06] (0 up, 1 right, 2 left, 3 down) W $02:8CE8 STA $06 ; $06 = $07 = 8 (hitbox width and height) W $02:92C5 STA $06 ; $06 = pointer high: DATA_00BABC / DATA_00BACA + carry W $02:9318 STA $06 ; $06 = pointer high: DATA_00BA9C / DATA_00BAAC + carry W $02:95A9 STA $06 ; $06 = Map16 pointer high W $02:960B STA $06 ; $06 = Map16 pointer high W $02:A673 STA $06 ; $06 = high pointer byte W $02:A6D9 STA $06 ; $06 = high pointer byte W $02:A8ED STA $06 ; [$06] = lowest slot to search, from SpriteSlotStart[Y] W $02:A914 STA $06 ; [$06] = $FF: search all the way down to slot 0 W $02:B74B STX $06 ; Segment loop: [$06] = segment number W $02:BA43 STA $06 ; [$06] = high byte of the map16 address W $02:BA90 STA $06 ; [$06] = high byte of the map16 address (plus Y screen) W $02:CA27 STZ $06 ; [$06] = 0 (no extra X flip) W $02:CA34 STX $06 ; [$06] = $40 (X-flip the body) R $02:CA70 ORA $06 ; A = palette | flip, saved for tile 2 W $02:D1AB STA $06 ; [$06] = pointer high W $02:D6CD STA $06 ; [$06] = Y offset from the pivot W $02:DC5D STX $06 ; X = 3: four tiles, [$06] = tile counter W $02:F9CD STA $06 ; [$06] = $0C (hitbox width) W $02:FB2F STA $06 ; [$06] = CircleCoords[([$02]) & $FF] (cosine) W $02:FB77 STA $06 ; [$06] = Y offset from the ring center W $03:83C8 STA $06 ; [$06] = graphics frame [$1602] W $03:86BB STX $06 ; Loop counter [$06] = 4 (five tiles) W $03:910D STA $06 ; Hook hitbox width and height ($06, $07) = 4 W $03:995A STA $06 ; $06 = value for angle $02 (a quarter turn later) R $03:9981 LDA $06 ; A = low byte of the second sine value W $03:99A2 STA $06 ; $06 = Y offset from the ring centre W $03:9EC8 STX $06 ; $06 = current segment index R $03:B74A ADC $06,X ; $0F = A - B + size of A (0 if A's far edge touches B's origin) W $03:C9F1 STA $06 ; $06 = [$1570]: burst radius scale W $03:DEFB STZ $06 ; $06 = 0: write index into the tilemap buffer $7E:C680 W $03:DF29 STA $06 ; $06 = 8: the rows below start after the 8-tile top strip R $03:DF63 LDX $06 ; X = write index into the tilemap buffer W $03:DF7F STX $06 ; Save the buffer write index W $04:869E STA $06 ; [$06] and [$8A] = X of the first tile W $04:8710 STA $06 ; [$06] and [$8A] = second player's sprite X R $04:9493 LDA $06 ; [$0A] = |dX| (major), [$0C] = |dY| (minor) W $04:DA7F STA $06 ; [$06] = $7E: bank of the map pointer W $04:E4B8 STA $06 ; [$06] = $0000: pointer to $7F:0000 (attributes) W $04:E76F STA $06 ; [$06] = 1: two rows W $04:E827 STA $06 ; [$06] = 5: six rows W $04:F8E8 STX $06 ; [$06] = X: tile loop index W $04:FC82 STA $06 ; [$06] = [$13]: counter for the size flicker W $04:FE1D STY $06 ; [$06] = table index (kept for the second tile) R $04:FE34 LDY $06 ; Y = saved table index [$06] R $04:FF76 LDA $06,X ; Dividend high byte = this axis distance [$06,X] R $04:FF7B LDA.W $0006,Y ; A = longest distance W $05:8664 STA $06 ; [$06] = pointer (bank 0) R $05:C0B5 CMP $06 ; Same Y tile as the current node? W $05:C0B9 STZ $06 ; No Y movement: [$06] = 0 W $05:C0CE STA $06 ; [$06] = Y distance in pixels R $05:C0E2 LDA $06 ; [$0A] = X distance (long axis), [$0C] = Y distance (short axis) W $05:CE10 STA $06 ; [$06] = low word [$02] - place value (low word) W $0D:E026 STA $06 ; [$06] = this screen's high-byte buffer ($7F:xxxx) from DATA_0DDF1A $0007 Scratch byte $07 scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
116 uses in 47 routines (39 read, 61 write, 16 read-modify-write) RW $00:873A ROL $07 ; [$07] = bit 7 of the third byte (1 = step down a column) W $00:BF16 STA $07 ; $07 = block X high byte (screen number) W $00:BF76 STA $07 ; $07 = VRAM address low byte of the tile R $00:C36D LDA $07 ; Record header: VRAM address = [$06]/[$07] R $00:C412 LDA $07 ; Record header: VRAM address = [$06]/[$07] W $00:F193 STA $07 ; [$07] = block the tile turns into (DATA_00F0C8) W $00:F1D8 STA $07 ; Contents 5: block becomes $16 ([$07]) W $00:F222 STA $07 ; [$07] = $17: block the tile turns into W $01:9525 STA $07 ; [$07] = $7E: bank of the low map16 bytes RW $01:952F INC $07 ; [$07] = $7F: bank of the high map16 bytes W $01:B7D7 STA $07 ; $07 = sprite X on screen = X low - screen X R $01:B7F9 SBC $07 ; A -= [$07]: tile offset from the sprite's left edge W $01:B931 STA $07 ; $07 = [$02] * 2 + $10: box height W $01:BBB3 STA $07 ; $07 = 8: nine tiles W $01:C81E STA $07 ; [$07] = running Y offset, high byte W $01:C8A1 STA $07 ; Running Y offset += Y step (16-bit) W $01:C932 STA $07 ; [$07] = screen X of tile 1 (pivot), reference point W $01:CC91 STA $07 ; [$07] = high byte + carry (result in [$04]-[$07]) W $01:D41F STA $07 ; Hitbox height [$07] = $10 W $01:D98B STA $07 ; $07 = $7E: pointer is [$05] -> $7E:xxxx RW $01:D995 INC $07 ; $07 = $7F: same offset in the next table W $01:E012 STY $07,X ; $07+X = slot of that block R $01:E026 LDY $07 ; A = $70: flash timer W $01:FCB4 STA $07 ; [$07] = $0E (Mario height) W $01:FD2E STA $07 ; [$06] = [$07] = 8 (fireball hitbox) RW $02:82F8 ROR $07 ; $07 = [RAM_Layer1DispYLo] >> 1 (sign kept) R $02:87E5 LDA $07 ; Save the spawn parameters [$04]-[$07] W $02:931C STA $07 ; $07 = $7E: pointer is now 24-bit $7E:[$06][$05] (Map16 low bytes) RW $02:9326 INC $07 ; $07 = $7F: Map16 high bytes W $02:A544 STA $07 ; $07 = hitbox height W $02:A6DD STA $07 ; $07 = $7E (Map16 low byte page) RW $02:A6E7 INC $07 ; Switch to bank $7F (high byte page) W $02:BA63 STA $07 ; [$07] = X high (screen) W $02:BA97 STA $07 ; [$07] = $7E: pointer [$05] points at the map16 low bytes RW $02:BA9E INC $07 ; [$07] = $7F: same address in the high-byte map W $02:C88C STZ $07 ; [$07] = 0 (no vertical shift) W $02:D1AF STA $07 ; [$07] = $7E: Map16 low byte bank RW $02:D1B9 INC $07 ; [$07] = $7F: Map16 high byte bank R $02:D6B4 LDY $07 ; Y = cosine high byte W $02:DC44 STA $07 ; $07 = platform state (which end dips) R $02:DC7D CPX $07 ; X = tile counter + 1, compared with the state in [$07] W $02:F11B STA $07 ; [$07] = sprite palette W $02:F9DD STA $07 ; [$07] = $14 (hitbox height) R $03:9988 LDY $07 ; Y = high byte of the value W $03:B6E0 STA $07 ; $07 = hitbox height W $03:C9F6 STA $07 ; $07 = [$1602]: animation frame W $03:D982 STA $07 ; [$05] = $03D7EC: pointer to the platform block layout (IggyPlatform) W $04:80BF STA $07 ; [$07] = [$09] = 8 (row counters) W $04:86A4 STA $07 ; [$07] and [$8B] = Y of the first tile W $04:8716 STA $07 ; [$07] and [$8B] = second player's sprite Y W $04:FC84 STZ $07 ; [$07] = 0: accumulated Y offset W $04:FCC0 STA $07 ; Wrapped: [$07] -= $0C (later puffs sit higher) W $05:813E STA $07 ; [$07] = next control byte from [$68] W $05:814F STA $07 ; [$07] = run length - 1 (control byte & $7F) W $0C:945F STA $07 ; [$07] = control byte W $0C:946C STA $07 ; [$07] = control byte & $7F (count - 1) $0008 Scratch byte $08 scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
176 uses in 64 routines (70 read, 97 write, 9 read-modify-write) W $00:AC17 STA $08 ; Colors 8-15 of BG palettes 0-1 from $00:B170 (layer 3 palettes) W $00:AC2E STA $08 ; Colors 2-7 of palettes 4-D from $00:B250 (shared BG and sprite colors) W $00:AC65 STA $08 ; Colors 2-7 of BG palettes 2-3 from [$00] W $00:AC8E STA $08 ; Colors 2-7 of sprite palettes 6-7 (E-F) from [$00] W $00:ACB7 STA $08 ; Colors 2-7 of BG palettes 0-1 from [$00] W $00:ACCE STA $08 ; Colors 9-F of BG palettes 2-4 from $00:B674 W $00:ACE5 STA $08 ; Colors 9-F of sprite palettes 1-3 from $00:B674 W $00:AE39 STZ $08 ; Source $B5F4, [$04] = $18, [$06] = 3, [$08] = 0: palette 0, colors C-F W $00:BFB2 STX $08 ; $08 = reference X position W $01:B7BD STA $08 ; $08 = number of tiles - 1 (loop counter; A on entry) RW $01:B83C DEC $08 ; Count down the tiles W $01:C844 STA $08 ; [$08] = running X offset, low byte W $01:C907 STA $08 ; [$08] = 9: loop over all 10 OAM tiles of this sprite W $01:CB72 STA $08 ; [$08] = +/- radius X * cosine (low word) W $01:CBDA STA $08 ; [$08] = +/- radius Y * cosine (low word) W $01:F549 STA $08 ; $08 = tongue tip X high R $02:885F ORA $08 ; Direction | layer flag W $02:928A STA $08 ; $08 = bit 4 of the screen number (not read here) W $02:9677 STA $08 ; $08 = bounce block X high + offset W $02:96A3 STA $08 ; $08 = cape X high - borrow W $02:AF3A STA $08 ; $08 = Y position low W $02:AFA4 STA $08 ; $08 = Y position low R $02:CCD2 LDX $08 ; X = column number (3..0) W $03:C9FA STA $08 ; $08 = burst center X low W $04:8640 STA $08 ; Store the screen X in [$00] and [$08] W $04:8D49 STY $08 ; Save the tile word index in [$08] R $04:8D5A LDY $08 ; Restore the tile word index W $04:9218 STA $08 ; [$08] = shift count W $04:92CD STA $08 ; [$08] = current tile offset (saved, [$04] will change) R $04:9307 LDX $08 ; X = [$08] (the level's tile offset) W $04:94A4 STY $08 ; [$08] = -1 (X major) or 1 (Y major) W $04:9565 STA $08 ; [$08] = 8: direction candidate counter W $04:990E STA $08 ; [$08] = shift count R $04:E78C SBC $08 ; A = 32 - column: tiles left in this screen row W $04:E78E STA $08 ; [$08] = tiles to the screen edge R $04:E7DA LDA $08 ; A = tiles to the screen edge W $04:E846 STA $08 ; [$08] = tiles to the screen edge R $04:E84D LDA $08 ; A = tiles to the edge R $04:E857 SBC $08 ; A = 6 - tiles to the edge W $04:E859 STA $08 ; [$08] = tiles left for the second record R $04:E89A LDA $08 ; A = tiles left for this record R $04:FF41 CMP $08 ; height / 2 >= |dy| / 2? W $05:8674 STA $08 ; [$05] = [$08] = 0 (bank bytes) R $05:8A55 LDY $08 ; Y = [$08]: index of this block in the screen data R $05:8B35 LDY $08 ; Y = [$08]: index of this block in the screen data R $05:8C23 LDY $08 ; Y = [$08]: index of this block in the screen data R $05:8D1A LDY $08 ; Y = [$08]: index of this block in the screen data R $05:8DD9 LDY $08 ; Y = [$08]: index of this block in the screen data W $05:C094 STX $08 ; [$08] = direction code W $05:C0AB STX $08 ; [$08] = X direction code R $05:C0D5 LDX $08 ; Horizontal level: X = X direction code W $05:C0DC STA $08 ; [$08] = $FFFF: flag, X axis is the long one (for now) W $05:C0F3 STA $08 ; [$08] = 1: flag, Y axis is the long one R $05:C15D LDA $08 ; A = [$08]: sign says which axis is the long one W $0C:94E9 STX $08 ; [$08] = $7F: Map16 tiles left in this pass - 1 W $0C:9548 STA $08 ; Reset the pass counter [$08] = $7F W $0C:A14B STA $08 ; $08 = $0A = $003F: Y position of the first banner row W $0C:A1CB STA $08 ; Y position += $10: next banner row W $0C:A688 STA $08 ; Picture Y positions $08 and $0A = $3F W $0C:ABFF STA $08 ; $08 = 1: two blocks W $0C:CCBE STA $08 ; $08 = tile table index W $0D:A5FE STA $08 ; [$08] = low byte of item memory pointer, $19F8 + table offset W $0D:B2EA STA $08 ; [$08] = low byte of item memory table pointer ($19F8 + [$13BE] offset) W $0D:B358 STA $08 ; [$08] = low byte of item memory table pointer ($19F8 + [$13BE] offset) W $0D:E010 STA $08 ; First screen to copy to = 1 RW $0D:E058 INC $08 ; Next screen number $0009 Scratch byte $09 scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
64 uses in 35 routines (24 read, 37 write, 3 read-modify-write) W $00:BECD STA $09 ; $09 = vertical level flags ($5B) W $01:B827 STA $09 ; $09 = tile Y in the level = offset + sprite Y low W $01:B86C STA $09 ; $09 = sprite Y on screen - [$0D] (top of the solid box) R $01:B873 CMP $09 ; Mario's feet ([$80] + $18) vs. the top of the box W $01:C84B STA $09 ; [$09] = running X offset, high byte W $01:C8C4 STA $09 ; Running X offset += X step (16-bit) W $01:C9D1 STA $09 ; Carry set if the 16-bit Y in [$09] is off-screen vertically (Y + $10 - screen Y >= $100) W $01:D18E STA $09 ; [$07]-[$0A] = right limit [$160E] W $01:F55C STA $09 ; $09 = tongue tip Y high W $01:FC9E STZ $09 ; [$08] and [$09] = 0 (high bytes) W $02:968D STA $09 ; $09 = bounce block Y high + offset W $02:AF3F STA $09 ; $09 = Y position high W $02:AFA9 STA $09 ; $09 = Y position high W $02:F14D STY $09 ; Save the history offset in [$09] R $03:CA92 ADC $09 ; OAM Y = center Y + scaled Y offset R $03:CB61 ADC $09 ; OAM Y = center Y + scaled Y offset W $04:E4BD STA $09 ; [$09] = $8000: pointer to $0C:8000 (tile numbers) RW $05:8266 INC $09 ; [$09]++ (tile counter, apparently unused) W $0D:A606 STA $09 ; [$09] = high byte of item memory pointer W $0D:B2F2 STA $09 ; [$09] = high byte of item memory table pointer W $0D:B360 STA $09 ; [$09] = high byte of item memory table pointer W $0D:E014 STA $09 ; High byte of the screen number = 0 $000A Scratch byte $0A scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
163 uses in 52 routines (89 read, 74 write) W $00:AA99 STA $0A ; [$0A] = 0: plane 3 mask empty (plain 3bpp to 4bpp) W $00:AABA STA $0A ; [$0A] = $FF00: plane 3 = OR of planes 0-2 W $00:AACB STA $0A ; [$0A] = 0: plane 3 empty W $00:AB05 STA $0A ; [$0A] = $FF00: plane 3 = OR of planes 0-2 for every tile W $00:AFC0 STA $0A ; [$0A] = original color W $00:AFD8 STA $0A ; [$0A] = blue * 4 (bits 10-14 of the color) W $00:BFB4 STY $0A ; $0A = reference Y position W $00:E3B9 STA $0A ; [$0A] = DATA_00E00C[Y] (upper body graphic tile) W $01:B82C STA $0A ; $0A = tile Y in the level, high byte W $01:B913 STA $0A ; $0A = sprite X high - borrow W $01:C61D STZ $0A ; [$0A] = 0: palette XOR W $01:C6B0 STA $0A ; [$0A] = palette XOR for the star W $01:C973 STA $0A ; [$09] = world Y of this tile = delta + pivot world Y (16-bit) W $01:CB7C STA $0A ; [$0A] = +/- radius X * cosine (high word) W $01:CBE4 STA $0A ; [$0A] = +/- radius Y * cosine (high word) W $02:D79A STA $0A ; [$0A] = pivot X low W $02:F9C9 STA $0A ; [$0A] = X high + carry W $03:9DD2 STA $0A ; $0A = X position high + offset high R $03:B736 SBC $0A,X ; High byte of that distance -> $0C W $03:CA06 STA $0A ; $0A = [$1534]: firework type W $04:8652 STA $0A ; Store the screen Y in [$02] and [$0A] W $04:94EB STA $0A ; [$0A] = major axis speed W $04:D827 STA [$0A],Y ; Clear byte Y of the per-level byte table ($7E:D800) W $04:D845 STA [$0A],Y ; Per-level byte table[Y] = A W $04:E699 STA $0A ; [$0A] = $7EC800 (OW layer 1 map) R $04:E6A5 LDA [$0A],Y ; A = tile currently at that map position W $04:E6C0 STA [$0A],Y ; Write it at the map position W $04:E6D0 STA [$0A],Y ; Write the tile (replaces the old one) W $04:E73F STA $0A ; [$0A] = mask applied to each tile word W $04:EDD9 STA $0A ; [$0A] = $04ECD3: table of 4 tile words per tile type R $04:EE07 LDA [$0A],Y ; Record 2 data: bottom-left tile and attributes (word 1 of the entry) R $04:EE0F LDA [$0A],Y ; Record 1 data: top-right tile and attributes (word 2 of the entry) R $04:EE17 LDA [$0A],Y ; Record 2 data: bottom-right tile and attributes (word 3 of the entry) W $04:EEBE STA $0A ; [$0A] = $04EE7A: table of 2x2 tile blocks R $04:EF0B LDA [$0A],Y ; Record 2 data: bottom-left tile R $04:EF13 LDA [$0A],Y ; Record 1 data: top-right tile R $04:EF1B LDA [$0A],Y ; Record 2 data: bottom-right tile W $05:85F4 STA $0A ; [$0A] = high nibble of [$0A] | [$01] W $05:8A69 STA $0A ; [$0A] = address of this block's Map16 definition, from the RAM table $0FBE R $05:8A75 LDA [$0A],Y ; Word 1 (bottom-left) to $1BE8 R $05:8A7C LDA [$0A],Y ; Word 2 (top-right) to right column buffer $1C66 R $05:8A83 LDA [$0A],Y ; Word 3 (bottom-right) to $1C68 W $05:8B49 STA $0A ; [$0A] = address of this block's Map16 definition, from the RAM table $0FBE R $05:8B55 LDA [$0A],Y ; Word 1 (bottom-left) to bottom row buffer $1C66 R $05:8B5E LDA [$0A],Y ; Word 2 (top-right) to $1BE6 R $05:8B65 LDA [$0A],Y ; Word 3 (bottom-right) to $1C66 W $05:8C37 STA $0A ; [$0A] = address of this block's Map16 definition, from the RAM table $0FBE W $05:8D2E STA $0A ; [$0A] = address of this block's Map16 definition, from the RAM table $0FBE W $05:8DA4 STA $0A ; [$0A] = $9100: Map16 definitions at $0D:9100, read directly (8 bytes each) R $05:8DF3 LDA [$0A],Y ; Word 1 (bottom-left) to $1CEA R $05:8DFA LDA [$0A],Y ; Word 2 (top-right) to right column buffer $1D68 R $05:8E01 LDA [$0A],Y ; Word 3 (bottom-right) to $1D6A W $05:C0EA STA $0A ; No: [$0A] = Y distance (long axis) W $05:C123 STA $0A ; [$0A] = number of steps R $05:C13B SBC $0A ; Software divide: [$0E] = ([$0C] * 16) / steps R $05:C161 LDA $0A ; Long axis is Y: speed along the long axis W $05:CF57 STA $0A ; [$0A] = new buffer write index (past the template) W $0C:A17F STA $0A ; $08 = $0A = $003F: Y position reset for the second half W $0C:A842 STA $0A ; $0A = 2: large size, X bit 8 clear $000B Scratch byte $0B scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
75 uses in 35 routines (30 read, 44 write, 1 read-modify-write) W $00:E3BE STA $0B ; [$0B] = DATA_00E0CC[Y] (lower body graphic tile) W $01:947F STA $0B ; [$0B] = clip point X high R $01:94FE LDX $0B ; X = screen number ([$0B]) W $01:B7BB STY $0B ; $0B = OAM size/X-high bits for the tiles (Y on entry: $00 = 8x8, $02 = 16x16) W $01:B929 STA $0B ; $0B = sprite Y high - borrow W $01:CABC STA $0B ; [$05] = platform Y - $0C (16-bit, high byte to [$0B]) W $01:D183 STA $0B ; [$05],[$06],[$0B],[$0C] = left limit [$1534] W $01:D436 STA $0B ; Hitbox Y high [$0B] R $01:D945 LDA $0B ; Restore the sprite position saved in $08-$0B W $01:FCB8 STZ $0B ; [$0A] and [$0B] = 0 (high bytes) W $02:CF79 STA $0B ; [$0B] = Mario screen Y + offset W $02:D332 STA $0B ; [$0B] = 0 (remainder) W $02:D345 STA $0B ; Store the remainder W $02:D79E STA $0B ; [$0B] = pivot Y low R $02:D7ED ADC $0B ; [$01] = pivot Y + half distance - screen Y (second link) W $02:F9E4 STA $0B ; [$0B] = Y high + carry W $03:9DE7 STA $0B ; $0B = Y position high + offset high W $04:812A STZ $0B ; [$0B] = 0: pointer table offset (16 bytes per tile) R $04:8145 ADC $0B ; X = [$0B] + frame offset: index into DATA_048006 W $05:822F STZ $0B ; [$04] = [$09] = [$0B] = 0 ([$0B] = bit counter) RW $05:8268 INC $0B ; Bit counter [$0B]++ W $05:85FC STA $0B ; [$0B] = high nibble of [$0B] | [$00] (X/Y nibbles swapped) W $0D:B124 STX $0B ; [$0B] = X (save object type) R $0D:B159 LDX $0B ; Restore X (object type) W $0D:B1A8 STX $0B ; [$0B] = X (save object type) R $0D:B1C5 LDX $0B ; Restore X (object type) $000C Scratch byte $0C scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
111 uses in 39 routines (46 read, 60 write, 5 read-modify-write) R $00:AAF2 ORA $0C ; Write plane 2 (low) and plane 3 = (plane 2 | [$1BB2+X]) & [$0A] (high) to VRAM R $00:AB32 ORA $0C ; Write plane 2 (low) and plane 3 = (plane 2 | [$1BB2+X]) & [$0A] (high) to VRAM W $00:AFB3 STA $0C ; [$0C] = 2 if step bit 5 is set (second word of each dither entry), else 0 R $00:BEEA LDY $0C ; Y = X position (the coordinate across a vertical level) R $00:C114 CMP $0C ; Compare with [$0C] (block X position, set by the caller) R $00:C1F8 CMP $0C ; Compare with [$0C] (block X) W $00:E41A STA $0C ; [$0C] = DATA_00E1D5[X] R $00:E425 ORA $0C ; Y = [$13DF] (cape image) * 4 | [$0C] W $00:E42B STA $0C ; [$0C] = DATA_00E23A[Y] R $01:BF92 CMP $0C ; dx| >= |dy|: keep order W $01:BF9D STA $0C ; Swap $0C and $0D so $0D is the larger distance W $01:D912 STA $0C ; $0C = sprite Y low before the trial step W $01:E8D4 STA $0C ; $0C = $F8: OAM index of puff 3 R $01:E904 LDY $0C,X ; Y = OAM index for this puff ($0C + X) W $02:82BE STX $0C ; $0C = 0 (table offset for set 0) W $02:83D4 STA $0C ; $0C = [$153D] - $1E: X position of column 0 W $02:A5C4 STA $0C ; [$0C] = Map16 tile found R $02:D323 CMP $0C ; Horizontal >= vertical? W $02:D32E STA $0C ; Swap [$0C] and [$0D] so that [$0D] is the longer R $02:D33B ADC $0C ; remainder += short distance W $03:980B STA $0C ; $0C = |vertical distance| R $03:9821 CMP $0C ; Compare with |vertical| W $04:8666 STA $0C ; Store the screen X in [$04] and [$0C] R $04:94B5 LDA $0C ; A = minor axis distance W $04:E4DA STA $0C ; [$0C] = 1: 2 tiles per row W $04:E52A STA $0C ; [$0C] = 5: 6 tiles per row W $04:E692 STA $0C ; [$0C] = $7E (bank of the pointer) W $04:E73A STA $0C ; [$0C] = $7F4000 (layer 2 tilemap in RAM) R $04:E7A9 LDA [$0C],Y ; A = tile word from the layer 2 map R $04:E869 LDA [$0C],Y ; A = tile word from the layer 2 map W $04:EDD2 STA $0C ; [$0C] = 4: bank of the pointer at [$0A] W $04:EEB2 STA $0C ; [$0C] = 4: bank of the pointer at [$0A] W $04:FF67 STY $0C ; [$0C] = index of the longest axis R $04:FF6B CPX $0C ; This the longest axis? W $05:823B STA $0C ; [$0C] = bitmask byte RW $05:823D ASL $0C ; Shift next bit into carry (1 = tile data comes from the shared set) W $05:8DCA STY $0C ; [$0C] = $0D: bank of the Map16 definitions W $05:C0EE STA $0C ; [$0C] = X distance (short axis) W $0D:A5C3 STA $0C ; [$0C] = tile to write W $0D:A646 STA $0C ; Replace with tile $32 on page 1 (brown used block) W $0D:A932 STA $0C ; $0C = Map16 tile for object ID X [DATA_0DA8B4+X] W $0D:ABFD STA $0C ; Tile number in A; [$0C] = A W $0D:AC18 STA $0C ; [$0C] += DATA_0DABFA[X] (tile number offset for blank-pixel tiles) R $0D:AC1C LDA $0C ; Restore X, A = adjusted tile number W $0D:B126 STA $0C ; [$0C] = A (tile to place) RW $0D:B14B INC $0C ; ...use the next tile number W $0D:B1AA STA $0C ; [$0C] = A (tile to place) W $0D:B397 STA $0C ; [$0C] = tile to place ($2C, coin) $000D Scratch byte $0D scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
85 uses in 30 routines (44 read, 40 write, 1 read-modify-write) W $00:E410 STA $0D ; [$0D] = DATA_00E1D7[X] R $01:9431 LDA $0D ; Block position [$98]-[$9B] = clipping point [$0A]-[$0D] W $01:946A STA $0D ; [$0D] = clip point Y high R $01:948B LDX $0D ; X = screen number ([$0D]) W $01:B905 STA $0D ; $0D = [$02] (half height margin) R $01:BFAC CMP $0D ; $0B += small distance; if >= large distance: W $01:D916 STA $0D ; $0D = sprite X low before the trial step W $01:E8D8 STA $0D ; $0D = $FC: OAM index of puff 2 W $01:F427 STA $0D ; $0D = tongue X offset from Yoshi R $01:F42F ADC $0D ; A = on-screen X of the tongue base = Yoshi X - screen X + [$0D] R $01:F4B9 LDA $0D ; A = tongue base X offset [$0D] R $01:F4CA ADC $0D ; Left: A = X offset - tongue length R $01:F527 LDA $0D ; A = tongue base X offset [$0D] R $01:F538 ADC $0D ; Left: A = X offset - tongue length R $01:F5F0 AND $0D ; Keep the segments below the break [$0D] W $01:FEC1 STA $0D ; [$0D] = palette/props for this state R $01:FF27 LDA $0D ; A = state palette [$0D] W $01:FF61 STA $0D ; [$0D] = palette bits R $01:FF88 ORA $0D ; OAM properties = $30 (priority 3) | DATA_01FF57[X] (flip) | [$0D] (palette) W $02:83DC STA $0D ; $0D = [$1617] + $10: X position of column 1 W $02:A5FA STA $0D ; [$0D] = Map16 tile found on layer 2 W $02:B0ED STA $0D ; $0D = first table index RW $02:B0F3 DEC $0D ; $0D-- (next table entry) R $02:B12A LDX $0D ; X = table index from $0D W $02:B810 STA $0D ; [$0D] = mask of segments to throw off R $02:B871 AND $0D ; Piece segments = Pokey's segments & [$0D] R $02:D321 LDA $0D ; A = horizontal distance R $02:D33D CMP $0D ; Below the long distance? W $03:981B STA $0D ; $0D = |horizontal distance| R $03:983B CMP $0D ; $0B += $0C; if >= $0D... W $04:8128 STA $0D ; [$0D] = $60: destination offset of tile 3 in the $0AF6 buffer R $04:8155 LDX $0D ; X = destination offset W $04:D829 STA [$0D],Y ; Clear byte Y of the level number map ($7E:D000) W $04:D83E STA [$0D],Y ; Level number map[Y] = level number W $04:EC81 STA $0D ; [$0D] = $7EC800 (OW layer 1 map) R $04:EC95 LDA [$0D],Y ; A = tile currently on the map R $04:EDA0 LDA [$0D],Y ; A = layer 1 tile currently at this map position W $04:EEB9 STA $0D ; [$0D] = $C800 (layer 1 map $7E:C800) W $05:806D STX $0D ; [$0D] = $B900: destination of the background data ([$0F] = $7E is set by the callee) W $05:817B STA [$0D],Y ; Store the byte at [$0D],Y W $05:8229 STA $0D ; [$0D] = $81BB: bitmask table (bank [$0F] = 5) R $05:8239 LDA [$0D],Y ; A = bitmask byte Y (one bit per Map16 tile) W $05:867C STA $0D ; [$0D] = low byte of the high-byte table address W $0C:941E STX $0D ; [$0D] = $B900: destination $7E:B900 (bank in [$0F] is set by CODE_0C944C) W $0C:9475 STA [$0D],Y ; Store the byte at [$0D]+Y W $0C:9489 STA [$0D],Y ; Store the byte at [$0D]+Y $000E Scratch byte $0E scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
132 uses in 57 routines (61 read, 61 write, 10 read-modify-write) W $00:A9A1 STA $0E ; [$0E] = $28: first GFX file number W $00:AFBD STA $0E ; [$0E] = one-hot mask: the dither bit that applies this step R $00:AFEA AND $0E ; Test this step's bit R $00:BED6 LDY $0E ; Y = Y position (horizontal level: position across the level) R $00:C12E CMP $0E ; Compare with [$0E] (block Y position, set by the caller) R $00:C212 CMP $0E ; Compare with [$0E] (block Y) W $00:E415 STA $0E ; [$0E] = DATA_00E1D8[X] (third cape tile set) W $01:AD49 STA $0E ; [$0E] = low byte of vertical distance W $01:B901 STA $0E ; $0E = [$00] (half width margin) W $01:CA23 STA $0E ; [$0E] = platform screen Y - 8 (top of the platform) W $01:E8E2 STA $0E ; $0E = OAM index of puff 1 R $01:EE8D LDY $0E ; Y = OAM index of the head tile W $01:EF69 STA $0E ; $0E = OAM index of the head R $01:EFAD LDY $0E ; Y = OAM index of the head W $01:F02D STA $0E ; Restore head OAM index W $02:93AC STZ $0E ; $0E = 0: bounce block mode (not cape) W $02:94EB STA $0E ; $0E = $35: ground pound mode W $02:94FA STA $0E ; $0E = [$13E8]: not a bounce block W $02:A570 STZ $0E ; [$0E] = 0 (result bits) RW $02:A5BF ROL $0E ; Shift the carry (solid) into [$0E] RW $02:A5F5 ROL $0E ; Shift the carry into [$0E] W $02:A9E4 STZ $0E ; [$0E] = 0: no slots left free W $02:AB24 STA $0E ; [$0E] = 9: ten entries per group, index counted down W $02:D513 STA $0E ; [$0E] = difference (low) W $02:D889 STA $0E ; $0E = quotient low byte RW $02:D897 ASL $0E ; A:$0E = quotient * 16 (shift left 4 times) R $03:9802 LDA $0E ; A = vertical distance W $04:8678 STA $0E ; Store the screen Y in [$06] and [$0E] W $04:94DC STA $0E ; [$0E] = minor axis speed R $04:94F8 LDA $0E ; X is major: the Y axis gets the minor speed W $04:95F2 STA $0E ; [$0E] = tile property (used for the walking animation) W $04:DC81 STY $0E ; [$0E] = $4000: stop here W $04:E6FE STA $0E ; [$0E] = $7F (bank for the [$0C] pointer) W $04:EDAD STX $0E ; [$0E] = X: index of the tile found (event tile type) W $04:EE34 STA $0E ; [$0E] = $7F: bank of the pointer at [$0C]/[$0A] W $05:C132 STA $0E ; [$0E] = 0 (quotient), A = 0 (remainder) R $05:C165 LDA $0E ; Speed along the short axis W $05:D7C3 STA $0E ; [$0E] = level number (low byte) R $05:D7E0 LDY $0E ; Y = secondary exit number [$0E]/[$0F], index into the $05F800-$05FE00 tables W $05:D7E5 STA $0E ; [$0E] = [$17BB] = secondary exit target level number ($05F800[Y]) W $05:D8AC STA $0E ; [$0E] = level number (low byte) R $05:D8BD ADC $0E ; Y = [$0E] * 3 (layer pointer table entries are 3 bytes) R $05:D90B LDY $0E ; Y = [$0E]/[$0F]: level number, index into the header tables $05F000-$05F600 W $0C:A036 STA $0E ; [$0E] = $A0: Y line where an object lands W $0C:A228 STA $0E ; $0E = 1: use Yoshi-side tile table W $0C:A300 STA $0E ; $0E = $AF: floor Y position for the bouncing actors W $0C:A3AE STA $0E ; $0E = 0: first sprite table W $0C:A500 STA $0E ; $0E = 0: first sprite table W $0C:A51C STA $0E ; $0E = 1: Yoshi-side tile table W $0C:A6E4 STA $0E ; $0E = 1: property set 1 for the tall sprite R $0C:A8B5 CMP $0E ; If Y position >= floor [$0E]: bounce W $0C:A8E2 STA $0E ; $0E = hatched-egg bit mask [$145A] W $0D:A60D STA $0E ; [$0E] = current screen number * 4 W $0D:A619 STA $0E ; If the object is in the lower half (Y bit 4 of [$0A]), [$0E] |= 2 W $0D:A624 STA $0E ; If the X column is >= 8, [$0E] |= 1 W $0D:B2F9 STA $0E ; [$0E] = [$1BA1] * 4 (screen number part of item memory index) W $0D:B305 STA $0E ; If [$0A] bit 4 set, [$0E] |= 2 (high Y bit) W $0D:B312 STA $0E ; If Y bit 3 set, [$0E] |= 1 (high X bit) W $0D:B367 STA $0E ; [$0E] = [$1BA1] * 4 (screen number part of index) W $0D:B373 STA $0E ; If [$0A] bit 4 set, [$0E] |= 2 (high Y bit) W $0D:B37E STA $0E ; If Y bit 3 set, [$0E] |= 1 (high X bit) $000F Scratch byte $0F scratch byte (direct page) Direct-page scratch variable with no fixed meaning. Any routine may use it as a temporary for arithmetic, hitbox coordinates, loop counters or return values, and its contents do not survive a call to another routine. The call sites below show what each routine keeps in it; there is nothing shared between them. Adjacent scratch bytes are often paired as a 16-bit value or, with $0000 -$0002 , as a 24-bit pointer used by indirect long addressing (for example the data pointer passed to the SPC700 upload routine).
212 uses in 91 routines (107 read, 78 write, 27 read-modify-write) W $00:A99D STA $0F ; [$0F] = 3: four files W $00:A9F2 STA $0F ; [$0F] = 3: slot counter R $00:A9F4 LDX $0F ; X = [$0F]: slot number W $00:AA33 STA $0F ; [$0F] = 3: slot counter R $00:AA35 LDX $0F ; X = [$0F]: slot number W $00:AB52 STA $0F ; [$0F] = next source byte RW $00:AB6A ROL $0F ; [$04] = last 2 bits of byte 0 (pixel 2 takes 1 more bit from byte 1) RW $00:AB8E ROL $0F ; [$04] = last bit of byte 1 (pixel 5 takes 2 more bits from byte 2) RW $00:AB9B ROL $0F ; Shift in 2 bits from byte 2: pixel 5 complete RW $00:ABCE ROL $0F ; [$04] = top 3 bits of [$0F], shifted out of it R $01:9435 LDY $0F ; Y = clipping point (0 right, 1 left, 2 down, 3 up) W $01:9441 STY $0F ; [$0F] = clipping point 0-3 R $01:944A ADC $0F ; Y = ([$1656] & $0F) * 4 + [$0F]: index into the clipping tables R $01:94B4 LDY $0F ; Y = clipping point (restore) R $01:9CFC LDY $0F ; Get on-screen X in [$00], Y in [$01] and OAM index R $01:A9AD ORA $0F ; Merge the saved palette back in W $01:AD37 STA $0F ; [$0F] = low byte of horizontal distance W $01:CA45 STA $0F ; [$0F] = Mario standing height R $01:E2E3 LDA $0F ; $0F = horizontal distance to Mario W $01:E8E9 STA $0F ; $0F = $0E + 4: OAM index of puff 0 W $01:EF24 STA $0F ; Head tile = YoshiHeadTiles[frame]; kept in $0F (bit 7 = hide head) W $02:80C2 STY $0F ; $0F = 4: puff counter (five puffs, 4..0) W $02:83E0 STX $0F ; X = $0F = 1: handle column 1, then column 0 W $02:8494 STA $0F ; $0F = Mario X low - sprite X low (horizontal distance) W $02:926A STY $0F ; $0F = [$16C9] (bit 7: layer 2) R $02:9A42 LDY $0F ; Y = OAM index (redundant reload) W $02:9D13 STY $0F ; Y = [$0F] = OAM index for this extended sprite slot R $02:9DBA ADC $0F ; [$02] = frame * 3 (three tiles per frame) W $02:A56E STZ $0F ; [$0F] = 0 (check layer 1 first) RW $02:A5CA INC $0F ; [$0F] = 1 (checking layer 2) W $02:A916 STX $0F ; [$0F] = first slot searched (kept for the goal tape fallback) R $02:A928 LDX $0F ; Goal tape: restart at the first slot searched W $02:A9F5 STA $0F ; [$0F] = lowest slot to search W $02:AB20 STY $0F ; [$0F] = 1 for sprite $E2, $FF for $E3 (probably direction) W $02:B9FA STZ $0F ; [$0F] = 0: use the horizontal level map16 layout W $02:CF92 STA $0F ; [$0F] = hitbox height R $02:CF9D CMP $0F ; Vertical distance between the piece and Mario, must be < [$0F] W $02:CFAF STA $0F ; [$0F] = feet offset W $02:D0E6 STZ $0F ; [$0F] = 0 (layer 1) W $02:D501 STA $0F ; [$0F] = difference (low) R $03:9812 LDA $0F ; A = horizontal distance R $03:9E8D ADC $0F ; X = frame * 4 + tile counter R $03:9F62 LDA $0F ; A = horizontal distance W $03:B4B4 STA $0F ; $0F = Bowser fight stage [$190D] W $03:B6A8 STZ $0F ; $0F = 0 (X displacement high byte) RW $03:B6B0 DEC $0F ; Negative: $0F = $FF (sign extend) R $03:B6BB ADC $0F ; $0A = sprite X high byte + sign extension W $03:B6C5 STZ $0F ; $0F = 0 (Y displacement high byte) RW $03:B6CD DEC $0F ; Negative: $0F = $FF (sign extend) R $03:B6D8 ADC $0F ; $0B = sprite Y high byte + sign extension W $03:B6EE STZ $0F ; $0F = 0 (X displacement high byte) RW $03:B6F6 DEC $0F ; Negative: $0F = $FF (sign extend) R $03:B701 ADC $0F ; $08 = sprite X high byte + sign extension W $03:B70B STZ $0F ; $0F = 0 (Y displacement high byte) RW $03:B713 DEC $0F ; Negative: $0F = $FF (sign extend) R $03:B71E ADC $0F ; $09 = sprite Y high byte + sign extension R $03:B753 CMP $0F ; Compare against distance W $03:B81E STA $0F ; [$0F] = Mario X position low - sprite X position low W $03:B830 STA $0F ; [$0F] = Mario Y position low - sprite Y position low W $03:C5B0 STA $0F ; [$0F] = state (0 = light off) W $04:895C STZ $0F ; [$0E] = Yoshi color (16-bit) W $04:D84F STZ $0F ; [$0F] = 0 (first level) W $04:E9EF STA $0F ; [$0F] = event number W $04:ED85 STA $0F ; $0F = $7E: bank of the pointer at [$0D] (layer 1 map $7E:C800) W $04:EEAE STA $0F ; $0F = $7E: bank of the pointer at [$0D] W $04:F31A STA $0F ; [$0F] = OAM offset [RAM_KeyHolePos2]: where the first sprite goes R $04:F355 LDY $0F ; Y = [$0F]: OAM offset W $05:8134 STA $0F ; [$0F] = $7E: destination bank W $05:8204 STA $0F ; [$0F] = $05: bank of the Map16 data W $05:868B STA $0F ; [$02] = [$0F] = 0 (bank bytes) W $05:89F7 STA $0F ; [$0C] = [$0F] = 0: bank of both lists W $05:8AC4 STA $0F ; [$0C] = [$0F] = 0: bank of both lists W $05:8BC5 STA $0F ; [$0C] = [$0F] = 0: bank of both lists W $05:8CA9 STA $0F ; [$0C] = [$0F] = 0: bank of both lists W $0C:9459 STA $0F ; [$0F] = $7E: destination bank W $0D:A633 STA $0F ; [$0F] = item memory byte ([$08]),Y masked with bit X W $0D:A78D STA $0F ; $0F = tile to write RW $0D:A7A8 INC $0F ; Otherwise add 2 (variant of the tile that blends with the bush underneath) RW $0D:A7AA INC $0F ; $0F += 1 (or 2 if it came through A7A8) W $0D:B38C STA $0F ; [$0F] = item memory bit for this coin (nonzero = already collected) W $0D:B84E STA $0F ; Tile to add (A) = $0F RW $0D:B85A INC $0F ; Anything else: requested tile + 1 ... RW $0D:B85C INC $0F ; ... + 1 again (+2 in total) W $0D:B93E STA $0F ; Page 0; $0F = unpressed tile (DATA_0DB91A+X) W $0D:B94C STA $0F ; Yes: page 1 and $0F = pressed tile (DATA_0DB91C+X) RW $0D:B9A9 INC $0F ; ... use that tile + 1 ($0B2 / $0B7) W $0D:B9B9 STA $0F ; Page 1 and tile $10D instead W $0D:BADE STA $0F ; $0F = number of screens = [$59] $0010 Frame-ready flag flag byte Handshake between the main loop and the NMI. The main loop clears it with STZ and spins until it is non-zero; the NMI handler increments it when it finishes the frame's PPU work (also on the lag/Mode 7 tail path). Reset code does INC once at boot so the first pass skips the wait.
Values: 0 = waiting for the next frame; non-zero = frame handled.
7 uses in 3 routines (3 read, 1 write, 3 read-modify-write) RW $00:8069 INC $10 ; [$10] = 1: skip the NMI wait on the first pass RW $00:81E7 INC $10 ; Mark the frame handled: [$10]++ RW $00:82C8 INC $10 ; Mark the frame handled: [$10]++ $0011 IRQ split stage state Which IRQ of the frame's screen split comes next. The NMI tail clears it to 0; the IRQ handler bumps it to 1 after the first split, so the second IRQ sets up the BG3 scroll/screen mode or the Mode 7 boss-room splits.
Values: 0 = first IRQ pending; 1 = second IRQ stage.
3 uses in 2 routines (1 read, 1 write, 1 read-modify-write) W $00:829D STZ $11 ; IRQ stage [$11] = 0 RW $00:83D0 INC $11 ; IRQ stage [$11] = 1 $0012 Stripe image number byte (index) Number of the stripe image queued for upload to VRAM; the upload routine uses it times 3 as an offset into ImagePointers. Set by game modes and cutscenes to draw title screen, file select, overworld border, credits backgrounds and so on, and consumed by the Upload stripe image routine.
Values: $03 = title screen; $06 = overworld border; $D2 = credits background; 0 = none queued (probably).
15 uses in 10 routines (2 read, 13 write) R $00:85D2 LDY $12 ; Y = [$12]: byte offset into ImagePointers (image number * 3) W $00:85F7 STZ $12 ; [$12] = 0: do not reload the same image next frame W $00:949B STA $12 ; Stripe image $D2 (credits background) W $00:94BA STA $12 ; Upload this cutscene's border stripe image from $009460[X] W $00:94C1 STA $12 ; Upload stripe image $CF as well W $00:967A STA $12 ; Stripe image $D5 (THE END) W $00:9A99 STA $12 ; Stripe image $03 (title screen) W $00:9D29 STY $12 ; Stripe image [$12] = Y W $00:A155 STA $12 ; Stripe image $06: overworld border W $04:83BF STY $12 ; Request the arrows stripe image W $04:F43B STY $12 ; State 7: [$12] = $1E, stripe image CONTINUE AND SAVE W $05:B19E STA $12 ; [$12] = 9: stripe image that blanks the text (DATA_05B0FF) W $0C:AE06 STA $12 ; [$12] = scene * 3 + $D8: ImagePointers entry 72 + scene (the enemy name screen image) W $0C:C97B STA $12 ; [$12] = [$00] * 3 + $21: ImagePointers entry 11 + [$00] (next text line) $0013 Frame counter RAM_FrameCounter counter Free-running frame counter, incremented every frame by the main loop, including while the game is paused or locked. Sprites and animations read low bits to pace things: 'every 32 frames' is [$13 ] & $1F == 0, Boo/bat wobble, firework sparks, overworld water animation. Compare $0014 , which stops when the game is frozen.
Values: wraps 00-FF.
190 uses in 143 routines (189 read, 1 read-modify-write) RW $00:8070 INC $13 ; Count a frame: [$13]++ R $00:E2E3 LDA RAM_FrameCounter ; A = frame counter R $00:E308 LDA RAM_FrameCounter ; A = frame counter R $00:F232 AND RAM_FrameCounter ; A = (A xor 3) AND frame counter: probably a timing check R $01:8899 EOR RAM_FrameCounter ; Only run when ([X] EOR [$13]) AND 3 = 0, i.e. once every 4 frames R $01:927E LDA RAM_FrameCounter ; A = frame counter R $01:B612 AND RAM_FrameCounter ; Odd frame: skip damping and offset check R $01:BC7A ADC RAM_FrameCounter ; Mix in RAM_RandomByte2, Mario X speed and frame counter R $01:D50E LDA RAM_FrameCounter ; Frame counter R $01:D51F LDA RAM_FrameCounter ; Frame counter R $01:D694 EOR RAM_FrameCounter ; XOR frame counter R $01:D73A LDA RAM_FrameCounter ; Frame counter R $01:D77F LDA RAM_FrameCounter ; Frame counter R $01:D7A3 LDA RAM_FrameCounter ; Frame counter R $01:E155 ADC RAM_FrameCounter ; A = slot * 4 + frame counter R $01:E581 LDA RAM_FrameCounter ; A = frame counter R $01:EA05 LDA RAM_FrameCounter ; A = frame counter R $02:8AE4 LDA RAM_FrameCounter ; Frame counter R $02:8C2A EOR RAM_FrameCounter ; EOR frame counter R $02:9CA2 LDA RAM_FrameCounter ; A = [RAM_FrameCounter] R $02:AE40 LDA RAM_FrameCounter ; A = frame counter R $02:B39B LDA RAM_FrameCounter ; A = frame counter R $02:C4C4 ADC RAM_FrameCounter ; A = (X * 8 + [$13]) & $7F R $02:C713 LDA RAM_FrameCounter ; A = frame counter R $03:908B ADC RAM_FrameCounter ; A = ((sprite index * 16 + [$13]) AND $3F) R $03:970D ADC RAM_FrameCounter ; + frame counter R $03:99F5 LDA RAM_FrameCounter ; A = frame counter R $03:A00A LDA RAM_FrameCounter ; A = frame counter R $03:A2E9 LDA RAM_FrameCounter ; A = frame counter R $03:A2F2 LDA RAM_FrameCounter ; A = frame counter R $03:A4D4 LDA RAM_FrameCounter ; Frame counter AND $E0: only animate during the first 32 of every 256 frames R $03:A4ED LDA RAM_FrameCounter ; Frame counter AND $1F: every 32 frames R $03:A6AC LDA RAM_FrameCounter ; Frame counter R $03:A7E3 LDA RAM_FrameCounter ; Every 32 frames only R $03:A858 LDA RAM_FrameCounter ; Frame counter AND 3 R $03:AB2A LDA RAM_FrameCounter ; Frame counter AND 0: always zero, so this runs every frame R $03:C9EA EOR RAM_FrameCounter ; $05 = sprite slot XOR frame counter (seed that varies tile and palette) R $04:FE5B LDA RAM_FrameCounter ; A = frame counter [$13] R $0C:CDA1 LDA RAM_FrameCounter ; Cutscene state: screen drops with growing speed and shakes R $0C:CEE9 LDA RAM_FrameCounter ; Falling: toggle [$1440] every other frame R $0C:D16F LDA RAM_FrameCounter ; Scene state: shake layer 2 Y position by +/- 1 every other frame $0014 Frame counter B RAM_FrameCounterB counter Second frame counter used for most sprite and Mario animation timing. It counts every frame the game is running; sprite routines mask it (for example & $30) to time Chuck states, Lakitu's cloud, Yoshi's tongue and the Boo stream. Level preparation clears bits 0-2 and 5-7 of it (TRB) to keep only bits 3-4.
Values: wraps 00-FF. See $0013 for the always-running counter.
139 uses in 109 routines (133 read, 1 write, 5 read-modify-write) RW $00:95B3 INC RAM_FrameCounterB ; Frame counter B [$14]++ RW $00:A1C1 INC RAM_FrameCounterB ; Frame counter B [$14]++ RW $00:A5FB TRB RAM_FrameCounterB ; Clear bits 0-2 and 5-7 of the frame counter [$14] (keep bits 3-4) RW $00:A604 INC RAM_FrameCounterB ; [$14]++ R $00:A606 LDA RAM_FrameCounterB ; A = [$14] RW $00:C504 INC RAM_FrameCounterB ; Count a frame: [$14]++ R $00:FD13 AND RAM_FrameCounterB ; A = mask & [$14] (frame counter B) R $01:D4B8 LDA RAM_FrameCounterB ; Frame counter R $01:D71C EOR RAM_FrameCounterB ; XOR frame counter R $01:E7B0 LDA RAM_FrameCounterB ; A = frame counter B R $02:C388 LDA RAM_FrameCounterB ; [$14] & $30 R $03:DFF0 LDA RAM_FrameCounterB ; A = [RAM_FrameCounterB] $0015 Controller 1 held (byetUDLR) RAM_ControllerA bit flags Buttons held by the active player this frame: pad byte 1 ($0DA2 ) with the A and X bits of byte 2 merged into bits 7 and 6, so jump (B or A) and run/fire (Y or X) each need one test. Read by Mario physics, swimming, cape flight, carrying and menus; game mode 14 clears the Down bit while Mario is busy.
Bits: 7 = B or A; 6 = Y or X; 5 = Select; 4 = Start; 3 = Up; 2 = Down; 1 = Left; 0 = Right.
60 uses in 36 routines (51 read, 8 write, 1 read-modify-write) W $00:86B0 STA RAM_ControllerA ; [$15] = byte 1 held (B/Y/Sel/Start/D-pad) with A merged into bit 7 and X into bit 6 W $00:9C91 STA RAM_ControllerA ; Controller 1 held buttons [$15] = A R $00:9CC4 LDA RAM_ControllerA ; A = controller 1 byte 1 ([$15], B Y Select Start D-pad) RW $00:A209 TRB RAM_ControllerA ; Mario is busy: ignore Down held ([$15] bit 2) W $00:C77D STY RAM_ControllerA ; Held buttons [$15] = command byte W $00:C8B1 STA RAM_ControllerA ; [$15] = held buttons = byte with bit 5 cleared (bit 5 is not a controller input, used as flag) W $00:C97E STA RAM_ControllerA ; Hold right on the controller W $00:C9C7 STA RAM_ControllerA ; Hold right R $00:CDFA ORA RAM_ControllerA ; Any button besides L/R pressed? W $00:D22F STA RAM_ControllerA ; Fake controller input: X/Y held R $00:EEF2 LDA RAM_ControllerA ; A = held buttons [RAM_ControllerA] R $00:FD0A LDA RAM_ControllerA ; A = controller 1 held R $01:A00D BIT RAM_ControllerA ; Test Y/X button bit ($40) of controller A R $01:AA39 BIT RAM_ControllerA ; Test controller A (B/A button state) R $01:AA58 LDA RAM_ControllerA ; A = controller A R $01:E69A LDA RAM_ControllerA ; A = [RAM_ControllerA] ($15, bit 7 = B button) R $01:E6CE BIT RAM_ControllerA ; Test controller: V = bit 6 (X/Y button, grab) R $05:B16E LDA RAM_ControllerA ; A = controller 1 buttons held (byetUDLR) $0016 Controller 1 newly pressed (byetUDLR) bit flags Buttons that went down this frame (current AND NOT previous) for pad byte 1, with a new X press merged into bit 6 (A is not merged, see $0018 ). Used for one-shot actions: jump start, menu cursor, fireball and spin input. Game mode 14 clears bit 6 here and in $0018 while Mario is busy.
Bits: 7 = B; 6 = Y or X; 5 = Select; 4 = Start; 3 = Up; 2 = Down; 1 = Left; 0 = Right.
33 uses in 27 routines (28 read, 4 write, 1 read-modify-write) W $00:86BF STA $16 ; [$16] = byte 1 newly pressed, with X press merged into bit 6 R $00:9AF3 ORA $16 ; Combine with the D-pad bits R $00:9B24 LDA $16 ; A = buttons just pressed on controller 1 ([$16]) W $00:9C9A STA $16 ; Controller 1 just pressed [$16] = A R $00:9DFA LDA $16 ; A = buttons just pressed on controller 1 RW $00:A20D TRB $16 ; Also ignore Y just pressed ([$16] bit 6) and X just pressed ([$18] bit 6) W $00:C782 STA $16 ; Newly pressed buttons [$16] = command without bit 6 (Y button) R $00:DB98 BIT $16 ; N = bit 7 of [$16] (B newly pressed), V = bit 6 (A newly pressed) R $01:DA2F BIT $16 ; Test the newly pressed buttons ([$16]) bit 7: B R $01:E886 LDA $16 ; A = [$16] (buttons newly pressed) R $04:9132 LDA $16 ; A = [$16] (buttons newly pressed) R $04:925F LDA $16 ; A = [$16] (buttons newly pressed) R $0C:CFE6 LDA $16 ; Check controller 1: B, Y (byetUDLR) or A, X (axlr) pressed $0017 Controller 1 held (axlr----) RAM_ControllerB bit flags Second joypad byte for the active player: A, X, L and R held. Written by the Read joypads routine, read by Mario animation (spin jump, run), Yoshi poses, L/R scrolling and the title screen/demo code.
Bits: 7 = A; 6 = X; 5 = L; 4 = R; 3-0 unused.
11 uses in 10 routines (9 read, 2 write) W $00:86B5 STA RAM_ControllerB ; [$17] = A/X/L/R held R $00:9CBE LDA RAM_ControllerB ; A = controller 1 byte 2 ([$17], A X L R) W $00:F631 STZ RAM_ControllerB ; Clear the controller mirrors [$15]-[$18] R $01:E68F LDA RAM_ControllerB ; A = [RAM_ControllerB] ($17, bit 7 = A button) $0018 Controller 1 newly pressed (axlr----) bit flags Edge-detected version of $0017: A, X, L, R pressed this frame. Combined with $0016 (ORA) to catch a new B or A press for jumping or swimming up, and used by the menu cursor and file menus (which OR in controller 2).
Bits: 7 = A; 6 = X; 5 = L; 4 = R.
17 uses in 14 routines (13 read, 3 write, 1 read-modify-write) W $00:86C4 STA $18 ; [$18] = A/X/L/R newly pressed R $00:9ADF LDA $18 ; A = [$18] (new A press) R $00:9B26 ORA $18 ; Or in controller 2's ([$18]) R $00:9DFC ORA $18 ; Or in controller 2's R $00:C891 ORA $18 ; A = [$16] | [$18] (newly pressed buttons) W $00:C8BA STY $18 ; Fake a new A-button press ([$18] = $80), i.e. jump R $00:D61A ORA $18 ; B or A newly pressed: start a jump at $00D630 R $00:D9A0 ORA $18 ; B or A newly pressed: paddle up R $00:D9ED ORA $18 ; B or A newly pressed? If not, skip $0019 Mario power-up RAM_MarioPowerUp byte Mario's current power-up state. Written when he is hit, collects a mushroom, flower, feather or star... and when a level starts; read by collision, drawing, the cape-flight tables, sprite interactions and platform code.
Values: 0 = small; 1 = big; 2 = cape; 3 = fire flower.
67 uses in 46 routines (54 read, 11 write, 2 read-modify-write) W $00:9E35 STZ RAM_MarioPowerUp ; Mario's powerup = small R $00:A0CA LDA RAM_MarioPowerUp ; A = Mario powerup W $00:C581 STA RAM_MarioPowerUp ; Store Mario's power-up R $00:CF35 LDA RAM_MarioPowerUp ; A = power-up status W $00:D0B6 STZ RAM_MarioPowerUp ; Power-up = 0 (small) RW $00:D156 INC RAM_MarioPowerUp ; Power-up += 1 R $00:E3A4 LDY RAM_MarioPowerUp ; Y = powerup R $00:EB2C LDA RAM_MarioPowerUp ; A = [RAM_MarioPowerUp] R $00:EB5D LDY RAM_MarioPowerUp ; Y = power-up R $00:EB79 LDA RAM_MarioPowerUp ; A = power-up R $00:EE67 LDX RAM_MarioPowerUp ; X = power-up R $00:EFA3 LDA RAM_MarioPowerUp ; A = power-up W $00:F2E6 STA RAM_MarioPowerUp ; Small Mario becomes big W $00:F600 STZ RAM_MarioPowerUp ; Mario power-up = 0 (small) R $00:FB00 LDX RAM_MarioPowerUp ; X = Mario powerup R $00:FD3D LDA RAM_MarioPowerUp ; A = Mario power-up R $00:FDB7 LDA RAM_MarioPowerUp ; A = Mario power-up R $00:FE00 LDA RAM_MarioPowerUp ; A = Mario power-up W $01:C59A STA RAM_MarioPowerUp ; Mario power-up = 2 (cape) W $01:C5F9 STA RAM_MarioPowerUp ; Mario power-up = 3 (fire) R $02:D49E LDY RAM_MarioPowerUp ; Y = Mario power-up RW $03:E400 DEC RAM_MarioPowerUp ; Unreferenced as code: the start of the ending music block header (see UploadMusicBank3) W $04:91C7 STA RAM_MarioPowerUp ; Mario power-up = this player's power-up W $04:9DE9 STA RAM_MarioPowerUp ; Mario power-up [$19] = this player's power-up W $0C:9FFA STA RAM_MarioPowerUp ; Mario power-up = 1 (Super Mario) W $0C:A263 STA RAM_MarioPowerUp ; Mario power-up = Super (1) so the big sprite is drawn $001A Layer 1 X position (low) RAM_ScreenBndryXLo word (little endian, low/high pair) Horizontal scroll of layer 1 (BG1) in pixels, also called the screen boundary X. $001B is the high byte. The NMI copies it to the BG1 H-scroll register. Scroll code sets it from $1462 each frame; sprites, blocks and particles subtract it to get on-screen X and delete themselves when off the screen. Cutscenes and the overworld write it directly.
193 uses in 119 routines (160 read, 31 write, 2 read-modify-write) W $00:9818 STZ RAM_ScreenBndryXLo ; Layer 1 X position = 0 W $00:992E STZ RAM_ScreenBndryXLo ; Layer 1 X position = 0 R $00:9FFC LDA RAM_ScreenBndryXLo ; A = layer 1 X position W $00:A1AD STZ RAM_ScreenBndryXLo,X ; Clear [$1A+X] R $00:BF9B LDX RAM_ScreenBndryXLo ; Vertical layer 1: X = screen boundary X W $00:F6F4 STA RAM_ScreenBndryXLo ; Layer 1 X = [$1462] (previous frame position, so scrolling starts from it) R $00:F71D SBC RAM_ScreenBndryXLo ; [$00] = A = Mario X on screen ([94] - [$1A]) W $00:F746 STA RAM_ScreenBndryXLo ; Clamp: do not scroll past the left edge (X = 0) R $00:F770 SBC RAM_ScreenBndryXLo ; [$00] = A = Mario X on screen W $00:F79B STA RAM_ScreenBndryXLo ; Layer 1 X = A R $00:F7A2 LDA RAM_ScreenBndryXLo ; A = layer 1 X R $00:FF3B SBC RAM_ScreenBndryXLo ; $00 = sprite X - screen X (position on screen) R $01:9E65 SBC RAM_ScreenBndryXLo ; OAM X = sprite X + wing X offset - screen X boundary R $01:A15E EOR RAM_ScreenBndryXLo ; Odd timer: screen X boundary XOR 1 (1-pixel shake) W $01:A167 STA RAM_ScreenBndryXLo ; Restore screen X boundary R $01:A3D3 SBC RAM_ScreenBndryXLo ; $00 = sprite X position relative to the screen R $01:B173 CMP RAM_ScreenBndryXLo ; Compare low byte with the screen X boundary R $01:B305 SBC RAM_ScreenBndryXLo ; First tile X position = sprite X - screen X R $01:B756 SBC RAM_ScreenBndryXLo ; Center tile (4) X = sprite X - screen X R $01:BEDF SBC RAM_ScreenBndryXLo ; Wand X on screen = sprite X + DATA_01BE6C[dir] - screen X R $01:DF29 SBC RAM_ScreenBndryXLo ; A = block X on screen R $01:F068 SBC RAM_ScreenBndryXLo ; $00 = Yoshi screen X R $02:827D LDA RAM_ScreenBndryXLo ; A = screen X low R $02:8C75 SBC RAM_ScreenBndryXLo ; [$00] = X low - screen X low R $02:8D06 SBC RAM_ScreenBndryXLo ; $00 = X position on screen (low byte) R $02:8D95 SBC RAM_ScreenBndryXLo ; Convert to screen X R $02:8EA8 SBC RAM_ScreenBndryXLo ; Screen X; $F8 or more is off-screen R $02:8EE8 SBC RAM_ScreenBndryXLo ; Screen X; $F0 or more is off-screen R $02:8F54 SBC RAM_ScreenBndryXLo ; OAM X = screen X R $02:8FE4 SBC RAM_ScreenBndryXLo ; $01 = X position on screen (low byte) R $02:9708 SBC RAM_ScreenBndryXLo ; A = smoke X on screen = [$17C8,X] - [$1A] R $02:9751 SBC RAM_ScreenBndryXLo ; A = smoke X on screen = [$17C8,X] - [$1A] R $02:97B8 SBC RAM_ScreenBndryXLo ; A = X on screen = [$17C8,X] - [$1A] R $02:983E SBC RAM_ScreenBndryXLo ; A = X on screen = [$17C8,X] - [$1A] R $02:9973 SBC RAM_ScreenBndryXLo ; A = X on screen = [$17C8,X] - [$1A] R $02:99A6 SBC RAM_ScreenBndryXLo ; A = X on screen = [$17C8,X] - [$1A] R $02:9D19 SBC RAM_ScreenBndryXLo ; [$00] = X position on screen R $02:9DCF SBC RAM_ScreenBndryXLo ; [$00] = X position + X offset - screen X R $02:9EA4 SBC RAM_ScreenBndryXLo ; [$00] = X position on screen R $02:A1B5 SBC RAM_ScreenBndryXLo ; [$01] = X position on screen R $02:A275 SBC RAM_ScreenBndryXLo ; $00 = X position on screen (low byte) W $02:ACAE STA RAM_ScreenBndryXLo ; Screen X -= $60, low W $02:ACC5 STA RAM_ScreenBndryXLo ; Screen X += $10, low R $02:AE68 LDA.W RAM_ScreenBndryXLo,Y ; A = screen X ($1A or $1E) R $02:B06A LDA RAM_ScreenBndryXLo ; A = screen X low R $02:B0B5 LDA RAM_ScreenBndryXLo ; A = screen X low R $02:B130 ADC RAM_ScreenBndryXLo ; + screen X low R $02:B197 ADC RAM_ScreenBndryXLo ; + screen X low R $02:B1F2 LDA RAM_ScreenBndryXLo ; A = screen X low R $02:B239 LDA RAM_ScreenBndryXLo ; A = screen X low R $02:B2B7 LDA RAM_ScreenBndryXLo ; A = screen X low R $02:B30D ADC RAM_ScreenBndryXLo ; + screen X low R $02:B368 ADC RAM_ScreenBndryXLo ; + screen X low R $02:CCC0 SBC RAM_ScreenBndryXLo ; [$00] = sprite X position on screen R $02:D380 CMP RAM_ScreenBndryXLo ; Compare with screen X low (carry) R $02:D3DB SBC RAM_ScreenBndryXLo ; [$00] = sprite X on screen R $02:D768 ADC RAM_ScreenBndryXLo ; + screen X: ball world X low R $02:D774 SBC RAM_ScreenBndryXLo ; [$00] = pivot X + A - screen X (first chain link, X on screen) R $02:F153 SBC RAM_ScreenBndryXLo ; Tile X = history X - screen X R $02:F404 SBC RAM_ScreenBndryXLo ; Screen X R $02:F493 SBC RAM_ScreenBndryXLo ; A = screen X R $03:AA74 SBC RAM_ScreenBndryXLo ; $00 = Bowser X + 4 - [layer 1 X low] (screen X) R $03:B7C3 SBC RAM_ScreenBndryXLo ; $00 = sprite X - screen X R $03:B888 LDA RAM_ScreenBndryXLo ; A = screen boundary X low R $04:82B9 SBC RAM_ScreenBndryXLo ; [$00] = saved X scroll [$1DF0] - current X scroll W $04:82DA STA RAM_ScreenBndryXLo ; Screen X = saved X scroll (and BG2 mirror [$1E]) W $04:8344 STA RAM_ScreenBndryXLo,X ; Screen X/Y position low += pixels + carry (and BG2 mirror) W $04:83E7 STA RAM_ScreenBndryXLo ; Toggle bit 0 of screen X (and BG2 mirror) R $04:8418 LDA RAM_ScreenBndryXLo,X ; A = current screen position [$1A,X] W $04:842A STA RAM_ScreenBndryXLo,X ; Within the limit: store the scroll position (and BG2 mirror) R $04:85AD ADC RAM_ScreenBndryXLo ; Mario X = screen X + $1E (fixed spot in the border) R $04:8637 SBC RAM_ScreenBndryXLo ; A = map X - screen X W $04:9878 STA RAM_ScreenBndryXLo,X ; BG1 scroll ([$1A] X, [$1C] Y) = A W $04:9AB7 STA RAM_ScreenBndryXLo ; BG1/BG2 X scroll [$1A], [$1E] = DATA_049A0C[Y] R $04:FE87 SBC.W RAM_ScreenBndryXLo,Y ; - screen scroll ([$1A] for Y = 0, [$1C] for Y = 2) R $05:8789 LDA RAM_ScreenBndryXLo ; A = screen X position of layer 1 W $05:BEBC STZ RAM_ScreenBndryXLo ; Layer 1 X position low = 0 W $05:BF9C STZ RAM_ScreenBndryXLo ; Layer 1 X position low = 0 W $05:D849 STZ RAM_ScreenBndryXLo ; Layer 1 X position = 0 W $0C:AE77 STZ RAM_ScreenBndryXLo ; Layer 1 X = 0 (the Bowser scene does not slide) W $0C:AE8B STA RAM_ScreenBndryXLo ; Layer 1 X = $FF00 (starts $100 pixels to the left) R $0C:B5DC LDY RAM_ScreenBndryXLo ; Y = [$1A]: Layer 1 X scroll W $0C:CD2B STZ RAM_ScreenBndryXLo ; Yes: stop the shake, layer 1 X scroll = 0 W $0C:D02E STZ RAM_ScreenBndryXLo ; Layer 1 X scroll = 0 R $0C:D048 LDA RAM_ScreenBndryXLo ; Compensate the shake: layer 1 X scroll shifts the sprite the opposite way RW $0C:D28C INC RAM_ScreenBndryXLo ; Odd frame: layer 1 X scroll += 1 RW $0C:D290 DEC RAM_ScreenBndryXLo ; Even frame: layer 1 X scroll -= 1 (screen shakes +/-1 pixel) $001B Layer 1 X position (high) RAM_ScreenBndryXHi byte (high half of word) High byte of layer 1's horizontal scroll position ($001A is the low byte). Identifies the 256-pixel screen page; sprites compare an object's X high byte against it to see if it is on the current page.
59 uses in 51 routines (52 read, 7 write) R $00:824B LDA RAM_ScreenBndryXHi ; BG1 H-scroll = [$1A]/[$1B] (screen boundary X) R $00:8425 LDA RAM_ScreenBndryXHi ; BG1 H-scroll = [$1A]/[$1B] R $01:9E6B SBC RAM_ScreenBndryXHi ; Skip if the wing is off screen horizontally (high byte differs) R $01:B176 SBC RAM_ScreenBndryXHi ; High byte - screen X high - borrow R $02:8287 LDA RAM_ScreenBndryXHi ; A = screen X high R $02:8C7C SBC RAM_ScreenBndryXHi ; Off-screen horizontally: free slot R $02:8D0D SBC RAM_ScreenBndryXHi ; Different screen page horizontally: do not draw R $02:8D57 SBC RAM_ScreenBndryXHi ; Sprite is off its screen page: delete R $02:8F37 SBC RAM_ScreenBndryXHi ; Not on the screen's page horizontally: delete R $02:8FEB SBC RAM_ScreenBndryXHi ; Different screen page horizontally: delete R $02:9D0C SBC RAM_ScreenBndryXHi ; Return if offscreen horizontally R $02:9EAB SBC RAM_ScreenBndryXHi ; Delete if offscreen horizontally R $02:A1BC SBC RAM_ScreenBndryXHi ; Delete if offscreen horizontally R $02:A27C SBC RAM_ScreenBndryXHi ; Horizontal screen high byte difference: zero means on screen, go draw it R $02:A821 LDA RAM_ScreenBndryXHi ; A = screen X high byte W $02:ACB5 STA RAM_ScreenBndryXHi ; Screen X -= $60, high (saved first) W $02:ACCB STA RAM_ScreenBndryXHi ; Screen X high carry R $02:B071 LDA RAM_ScreenBndryXHi ; A = screen X high R $02:B0BD LDA RAM_ScreenBndryXHi ; A = screen X high R $02:B135 LDA RAM_ScreenBndryXHi ; A = screen X high R $02:B19B LDA RAM_ScreenBndryXHi ; A = screen X high R $02:B1FA LDA RAM_ScreenBndryXHi ; A = screen X high R $02:B241 LDA RAM_ScreenBndryXHi ; A = screen X high R $02:B2BF LDA RAM_ScreenBndryXHi ; A = screen X high R $02:B311 LDA RAM_ScreenBndryXHi ; A = screen X high R $02:B37B LDA RAM_ScreenBndryXHi ; A = screen X high R $02:B3D4 SBC RAM_ScreenBndryXHi ; Return if the shooter is not on the screen's X page R $02:B484 SBC RAM_ScreenBndryXHi ; Return if the shooter is off the screen horizontally R $02:D061 LDA RAM_ScreenBndryXHi ; A = screen X high R $02:D385 SBC RAM_ScreenBndryXHi ; Minus screen X high with borrow R $03:B76D SBC RAM_ScreenBndryXHi ; Sprite X - screen X (16-bit): offscreen horizontally? R $03:B893 LDA RAM_ScreenBndryXHi ; A = screen boundary X high W $04:834B STA RAM_ScreenBndryXHi,X ; Screen position high byte += sign extension + carry (and mirror) $001C Layer 1 Y position (low) RAM_ScreenBndryYLo word (little endian, low/high pair) Vertical scroll of layer 1 (BG1) in pixels; $001D is the high byte. Set by the scroll routine from $1464 , shifted by the layer-shake and cutscene code, and shipped to the BG1 V-scroll by the NMI. Sprites subtract it to get screen Y; the overworld and credits code write it directly.
186 uses in 117 routines (153 read, 33 write) R $00:9532 LDA RAM_ScreenBndryYLo ; Save layer 1 position on the stack W $00:9820 STA RAM_ScreenBndryYLo ; Layer 1 Y position = $FF90 W $00:9933 STZ RAM_ScreenBndryYLo ; Layer 1 Y position = 0 R $00:A2C7 ADC RAM_ScreenBndryYLo ; Layer 1 Y scroll low += displacement low R $00:A7A7 LDA RAM_ScreenBndryYLo ; A = [$1C] R $00:BF88 LDY RAM_ScreenBndryYLo ; Y = layer 1 screen boundary Y R $00:C710 SBC RAM_ScreenBndryYLo ; A = Mario Y; Y speed = $D0 (-$30) R $00:E360 SBC RAM_ScreenBndryYLo ; A -= screen Y W $00:F6F9 STA RAM_ScreenBndryYLo ; Layer 1 Y = [$1464] R $00:F7AF LDA RAM_ScreenBndryYLo ; A = layer 1 Y R $00:F801 SBC RAM_ScreenBndryYLo ; [$00] = A = Mario Y on screen W $00:F89D STA RAM_ScreenBndryYLo ; Layer 1 Y = A R $00:F8A1 CMP RAM_ScreenBndryYLo ; Past the bottom limit [$04]? W $00:F8A5 STA RAM_ScreenBndryYLo ; Clamp layer 1 Y to the limit R $00:FF52 SBC RAM_ScreenBndryYLo ; $00 = sprite Y - screen Y R $01:A3AD CMP RAM_ScreenBndryYLo ; Compare with screen boundary Y low R $01:A3DA SBC RAM_ScreenBndryYLo ; $01 = sprite Y position relative to the screen R $01:B45F SBC RAM_ScreenBndryYLo ; $00 = sprite Y position on screen R $01:B730 SBC RAM_ScreenBndryYLo ; Center tile (4) Y = sprite Y - screen Y R $01:DF55 SBC RAM_ScreenBndryYLo ; A = block Y - bounce height - screen Y R $01:F06F SBC RAM_ScreenBndryYLo ; $01 = Yoshi screen Y R $01:F416 SBC RAM_ScreenBndryYLo ; A = tongue Y offset + Yoshi Y - screen Y (on-screen Y) R $02:8C84 SBC RAM_ScreenBndryYLo ; [$01] = Y low - screen Y low R $02:8D1A SBC RAM_ScreenBndryYLo ; Y on screen; $F0 or more is off-screen R $02:8DA2 SBC RAM_ScreenBndryYLo ; Y on screen; $E8 or more is off-screen R $02:8E9B SBC RAM_ScreenBndryYLo ; Screen Y; $F0 or more is off-screen R $02:8EF5 SBC RAM_ScreenBndryYLo ; Screen Y; $F0 or more is off-screen R $02:8F61 SBC RAM_ScreenBndryYLo ; OAM Y = screen Y R $02:8FCE SBC RAM_ScreenBndryYLo ; $00 = Y position on screen (low byte) R $02:9715 SBC RAM_ScreenBndryYLo ; A = smoke Y on screen = [$17C4,X] - [$1C] R $02:975E SBC RAM_ScreenBndryYLo ; A = smoke Y on screen = [$17C4,X] - [$1C] R $02:97D1 SBC RAM_ScreenBndryYLo ; A = Y on screen = [$17C4,X] - [$1C] R $02:9857 SBC RAM_ScreenBndryYLo ; A = Y on screen = [$17C4,X] - [$1C] R $02:997C SBC RAM_ScreenBndryYLo ; A = Y on screen = [$17C4,X] - [$1C] R $02:99AF SBC RAM_ScreenBndryYLo ; A = Y on screen = [$17C4,X] - [$1C] R $02:9DDB SBC RAM_ScreenBndryYLo ; [$01] = Y position + Y offset - screen Y R $02:A1C4 SBC RAM_ScreenBndryYLo ; [$02] = Y position on screen R $02:A293 SBC RAM_ScreenBndryYLo ; $01 = Y position on screen (low byte) W $02:AC6E STA RAM_ScreenBndryYLo ; Screen Y -= $60 (vertical level), low W $02:AC85 STA RAM_ScreenBndryYLo ; Screen Y += $10, low R $02:AE63 LDA.W RAM_ScreenBndryYLo,Y ; A = screen Y of that layer ($1C or $20); stored as $02 R $02:B05D ADC RAM_ScreenBndryYLo ; + screen Y R $02:B0A4 ADC RAM_ScreenBndryYLo ; + screen Y R $02:B140 ADC RAM_ScreenBndryYLo ; + screen Y low R $02:B1DF ADC RAM_ScreenBndryYLo ; + screen Y low R $02:B22A ADC RAM_ScreenBndryYLo ; + screen Y low R $02:B29D ADC RAM_ScreenBndryYLo ; + screen Y low R $02:B2F8 ADC RAM_ScreenBndryYLo ; + screen Y low R $02:CCC7 SBC RAM_ScreenBndryYLo ; [$01] = sprite Y position on screen R $02:D3B9 CMP RAM_ScreenBndryYLo ; Compare with screen Y low R $02:D3E2 SBC RAM_ScreenBndryYLo ; [$01] = sprite Y on screen R $02:D77B ADC RAM_ScreenBndryYLo ; + screen Y: ball world Y low R $02:D787 SBC RAM_ScreenBndryYLo ; [$01] = pivot Y + A - screen Y (first chain link, Y on screen) W $02:E25D STA RAM_ScreenBndryYLo ; Restore screen Y low R $02:F160 SBC RAM_ScreenBndryYLo ; A = history Y - screen Y R $02:F40C SBC RAM_ScreenBndryYLo ; Screen Y R $03:A459 SBC RAM_ScreenBndryYLo ; Bowser Y position on screen = [Y low] - [layer 1 Y low]; compare with $10 R $03:AA81 SBC RAM_ScreenBndryYLo ; $01 = Bowser Y + $20 - [$02] - [layer 1 Y low] (screen Y) R $03:B7A1 CMP RAM_ScreenBndryYLo ; Compare with screen Y R $03:B7CA SBC RAM_ScreenBndryYLo ; $01 = sprite Y - screen Y R $03:B8D4 LDA RAM_ScreenBndryYLo ; A = screen boundary Y low W $03:C237 STA RAM_ScreenBndryYLo ; Shift the screen so the switch appears to move W $03:C258 STA RAM_ScreenBndryYLo ; Restore screen Y low R $03:C7E2 ADC RAM_ScreenBndryYLo ; Y low = screen Y + $A8 (below the screen bottom) R $03:C9FF SBC RAM_ScreenBndryYLo ; $09 = burst center Y relative to the screen R $04:82A4 SBC RAM_ScreenBndryYLo ; [$01] = saved Y scroll [$1DF2] - current Y scroll W $04:82E1 STA RAM_ScreenBndryYLo ; Screen Y = saved Y scroll (and BG2 mirror [$20]) W $04:83EF STA RAM_ScreenBndryYLo ; Toggle bit 0 of screen Y (and BG2 mirror) R $04:85B5 ADC RAM_ScreenBndryYLo ; Mario Y = screen Y + 6 W $04:9ABE STA RAM_ScreenBndryYLo ; BG1/BG2 Y scroll [$1C], [$20] = DATA_049A0E[Y] R $04:9E8F SBC RAM_ScreenBndryYLo ; Position - screen top [$1C]; negative: flew off the screen W $04:D6EB STZ RAM_ScreenBndryYLo ; Layer 1 Y position = 0 W $04:D712 STA RAM_ScreenBndryYLo ; Layer 1 Y position = $0200 (submap tiles start at row $200) W $04:D72F STA RAM_ScreenBndryYLo ; Layer 1 Y position = [$20] (restore it) R $05:87CD LDA RAM_ScreenBndryYLo ; A = screen Y position of layer 1 R $05:BE9E LDA RAM_ScreenBndryYLo ; A = layer 1 Y position [RAM_ScreenBndryYLo] W $05:D80B STA RAM_ScreenBndryYLo ; Layer 1 Y position low = DATA_05D708[X] W $05:D99A STA RAM_ScreenBndryYLo ; Layer 1 Y position low = DATA_05D708[X] W $05:DA77 STA RAM_ScreenBndryYLo ; Layer 1 and layer 2 Y position low = $C0 W $0C:CD4E STA RAM_ScreenBndryYLo ; Screen Y scroll (low) = actor 0 Y (low) R $0C:CDBB LDA RAM_ScreenBndryYLo ; Actor 0 Y position = screen Y scroll R $0C:D0DB LDA RAM_ScreenBndryYLo ; Actor 0 Y position = screen Y scroll W $0C:D100 STA RAM_ScreenBndryYLo ; Screen Y scroll = actor 0 Y position R $0C:D135 LDA RAM_ScreenBndryYLo ; Actor 0 position = screen scroll $001D Layer 1 Y position (high) RAM_ScreenBndryYHi byte (high half of word) High byte of layer 1's vertical scroll ($001C is the low byte). Saved and restored around code that borrows the scroll position (Game mode 14 scroll shake, Directional Coins) and set in cutscenes.
66 uses in 45 routines (49 read, 17 write) R $00:A2AC LDA RAM_ScreenBndryYHi ; Save the layer 1 Y scroll position on the stack W $00:A2D3 STA RAM_ScreenBndryYHi ; Layer 1 Y scroll high += displacement high (+ carry) R $01:A3B9 SBC RAM_ScreenBndryYHi ; Subtract screen boundary Y high (with borrow) R $02:8C8B SBC RAM_ScreenBndryYHi ; Off-screen vertically: free slot R $02:8FD5 SBC RAM_ScreenBndryYHi ; Same screen page vertically: go draw R $02:9B6E SBC RAM_ScreenBndryYHi ; A = Y screen difference (high bytes) R $02:9F32 SBC RAM_ScreenBndryYHi ; Delete if above the top of the screen R $02:9FBB SBC RAM_ScreenBndryYHi ; Continue if above/within screen vertically (screen Y hi = 0) R $02:A1CB SBC RAM_ScreenBndryYHi ; Delete if offscreen vertically R $02:A29A SBC RAM_ScreenBndryYHi ; Vertically off screen: delete the sprite W $02:AC75 STA RAM_ScreenBndryYHi ; Screen Y -= $60, high (saved first) W $02:AC8B STA RAM_ScreenBndryYHi ; Screen Y high carry R $02:B063 LDA RAM_ScreenBndryYHi ; A = screen Y high R $02:B0AA LDA RAM_ScreenBndryYHi ; A = screen Y high R $02:B145 LDA RAM_ScreenBndryYHi ; A = screen Y high R $02:B1E3 LDA RAM_ScreenBndryYHi ; A = screen Y high R $02:B22E LDA RAM_ScreenBndryYHi ; A = screen Y high R $02:B2A1 LDA RAM_ScreenBndryYHi ; A = screen Y high R $02:B2FC LDA RAM_ScreenBndryYHi ; A = screen Y high R $02:B3C8 SBC RAM_ScreenBndryYHi ; Return if the shooter is not on the screen's Y page R $02:B478 SBC RAM_ScreenBndryYHi ; Return if the shooter is off the screen vertically R $02:D0AD LDA.W RAM_ScreenBndryYHi ; A = screen Y high R $02:D3C5 SBC RAM_ScreenBndryYHi ; Minus screen Y high W $02:E25A STA RAM_ScreenBndryYHi ; Restore screen Y high R $03:B7AD SBC RAM_ScreenBndryYHi ; Minus screen Y high byte and borrow R $03:B8DF LDA.W RAM_ScreenBndryYHi ; A = screen boundary Y high W $03:C23E STA RAM_ScreenBndryYHi ; Add the carry W $03:C255 STA RAM_ScreenBndryYHi ; Restore screen Y high W $05:D934 STZ RAM_ScreenBndryYHi ; Layer 1 Y position high = 0 W $0C:CD49 STA RAM_ScreenBndryYHi ; Screen Y scroll (high) = actor 0 Y (high) $001E Layer 2 X position (low) word (little endian, low/high pair) Horizontal scroll of layer 2 (BG2, the background/second layer); $001F is the high byte. Written by the scroll routine from $1466 , zeroed by layer 2 scroll sprites and the ending scene, and used when generating Map16 tiles on layer 2. The NMI sends it to the BG2 H-scroll.
29 uses in 18 routines (11 read, 17 write, 1 read-modify-write) W $00:A139 STA $1E ; Layer 1 X [$1A] = layer 2 X [$1E] = A R $00:BF8F LDX $1E ; Layer 2: X = layer 2 scroll X W $00:F6FE STA $1E ; Layer 2 X = [$1466] W $04:987A STA $1E,X ; BG2 scroll ([$1E] X, [$20] Y) = A R $04:EC6B SBC $1E ; Minus layer 1 X scroll [$1E] R $05:87EB LDA $1E ; A = layer 2 X position ($1E) W $05:BEC1 STZ $1E ; Layer 2 X position = 0 ($1E) W $05:BFA1 STZ $1E ; Layer 2 X position = 0 ($1E) W $05:BFBF STZ $1E ; Layer 2 X position = 0 ($1E) W $05:C714 STA $1E ; Layer 2 X [$1466] = BG2 X scroll [$1E] = A W $05:D84B STZ $1E ; Layer 2 X position = 0 W $0C:9F7D STA $1E,X ; BG2 H-scroll = updated position No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) R $00:8266 LDA $1F ; BG2 H-scroll = [$1E]/[$1F] $0020 Layer 2 Y position (low) word (little endian, low/high pair) Vertical scroll of layer 2 (BG2); $0021 is the high byte. Written by the scroll routine from $1468 and set at level load from a per-level table; read by Map16 generation and the NMI (BG2 V-scroll).
32 uses in 19 routines (16 read, 16 write) R $00:9539 LDA $20 ; Layer 1 position = layer 2 position (for Mario/castle update) W $00:A140 STA $20 ; Layer 1 Y [$1C] = layer 2 Y [$20] = A R $00:BFB0 LDY $20 ; Y = layer 2 scroll Y W $00:F703 STA $20 ; Layer 2 Y = [$1468] R $04:EC73 SBC $20 ; Minus layer 1 Y scroll [$20] and 1 R $05:8804 LDA $20 ; A = layer 2 Y position ($20) W $05:BF92 STA $20 ; [$20] = A (layer 2 Y position) W $05:BFC7 STA $20 ; [$20] = A (layer 2 Y position) W $05:D81A STA $20 ; Layer 2 Y position low [$20] = DATA_05D70C[X] W $05:D98D STA $20 ; Layer 2 Y position low [$20] = DATA_05D70C[X] W $0C:AE6A STA $20 ; [$20] = Layer 2 Y position R $0C:D177 LDA $20 ; Layer 2 Y position -= 1 R $0C:D185 LDA $20 ; Layer 2 Y position += 1 W $0C:D194 STZ $20 ; Timer expired: layer 2 Y position = 0 $0021 Layer 2 Y position (high) byte (high half of word) High byte of layer 2's vertical scroll ($0020 is the low byte). Cleared at level load and by cutscenes; the NMI writes $0020 /$0021 to the BG2 V-scroll register.
4 uses in 3 routines (1 read, 3 write) R $00:8270 LDA $21 ; BG2 V-scroll = [$20]/[$21] W $05:D936 STZ $21 ; Layer 2 Y position high [$21] = 0 $0022 Layer 3 X position (low) word (little endian, low/high pair) Horizontal scroll of layer 3 (BG3: status bar, message boxes, level layer 3 effects); $0023 is the high byte. Set at level start to layer 1 X / 2, advanced by Layer 3 scroll handlers, cleared by message boxes and the ending. The IRQ writes it to the BG3 H-scroll register.
17 uses in 8 routines (5 read, 12 write) W $00:9FFF STA $22 ; BG3 horizontal scroll [$22] = layer 1 X / 2 W $00:FF76 STA $22 ; BG3 X scroll [$22] = A R $05:C472 ADC $22 ; BG3 X [$22] += pixels moved W $05:CC8F STZ $22 ; BG3 X scroll [$22] = 0 W $0C:AED8 STA $22 ; Layer 1 X += 2; Layer 3 X = Layer 1 X $0023 Layer 3 X position (high) byte (high half of word) High byte of the BG3 horizontal scroll ($0022 is the low byte). Cleared by the message box code and set to 1 by a Layer 3 scroll handler; the IRQ writes $0022 /$0023 to BG3.
3 uses in 3 routines (1 read, 2 write) R $00:8399 LDA $23 ; BG3 H-scroll = [$22]/[$23] W $05:C4F6 STA $23 ; BG3 X high byte [$23] = 1 $0024 Layer 3 Y position (low) word (little endian, low/high pair) Vertical scroll of layer 3 (BG3); $0025 is the high byte. Set at level setup, copied from layer 1 Y by a scroll handler, moved by the credits scroll, and set from the fireball routine. The IRQ writes it to BG3.
18 uses in 10 routines (8 read, 10 write) W $00:9FE0 STA $24 ; BG3 vertical scroll low [$24] = A W $00:A017 STA $24 ; BG3 vertical scroll low [$24] = A W $00:FF8E STA $24 ; BG3 Y scroll [$24] = A W $05:B24C STZ $24 ; BG3 scroll mirrors [$22]-[$25] = 0 (the text is on BG3) R $05:BC67 LDA $24 ; A = layer 3 Y ([$24]) W $05:BEA0 STA $24 ; [$24] = A (layer 3/2 Y position, hedged) W $05:C48F STA $24 ; BG3 Y [$24] = layer 1 Y [$1C] R $05:C4E8 ADC $24 ; BG3 Y [$24] += [$145A] / 16 (sign-extended) + carry from the line above W $05:CC91 STZ $24 ; BG3 Y scroll [$24] = 0 W $0C:9F9D STA $24 ; BG3 V-scroll = new position $0025 Layer 3 Y position (high) byte (high half of word) High byte of the BG3 vertical scroll ($0024 is the low byte). Cleared during layer 3 setup and by the message box code; the IRQ writes $0024 /$0025 to BG3.
4 uses in 4 routines (1 read, 3 write) R $00:83A3 LDA $25 ; BG3 V-scroll = [$24]/[$25] W $00:9FE2 STZ $25 ; High byte [$25] = 0 W $00:A019 STZ $25 ; High byte [$25] = 0 $0026 Layer 2 offset from layer 1, X (low) word (little endian, low/high pair) Layer 2 X position minus layer 1 X position (computed in the scroll routine; with layer 3 interaction it is $0022 minus $1462 ). $0027 is the high byte. Interactions with a moving layer 2 add or subtract it: block-hit hitboxes, sprites spawned from blocks, Mario level collision and sprite-block checks.
12 uses in 9 routines (10 read, 2 write) R $02:8714 SBC $26 ; Hitbox X low = block X low - [$26] (layer 2 offset) R $02:898C SBC $26 ; Sprite X low = block X low - [$26] R $02:9AF4 SBC $26 ; Layer 1: X -= [$26] R $02:A5D1 ADC $26 ; Sprite X low += [$26], old value saved $0027 Layer 2 offset from layer 1, X (high) byte (high half of word) High byte of the layer 2 minus layer 1 X offset ($0026 is the low byte). Added to or borrowed from a sprite's or block's X high byte when positions are converted between layers.
6 uses in 5 routines (6 read) R $01:9169 ADC $27 ; Sprite X += [$26]/[$27] (layer 2 offset) R $01:918A SBC $27 ; Sprite X -= [$26]/[$27] (restore) R $02:871B SBC $27 ; Hitbox X high = block X high - [$27] - borrow R $02:8992 SBC $27 ; Sprite X high = block X high - [$27] - borrow R $02:A5DA ADC $27 ; Sprite X high += [$27], old value saved $0028 Layer 2 offset from layer 1, Y (low) word (little endian, low/high pair) Layer 2 Y position minus layer 1 Y position; $0029 is the high byte. Same role as $0026 but vertical, used by block-hit hitboxes, sprite spawns from blocks, sprite-block interaction and Mario collision.
11 uses in 9 routines (10 read, 1 write) R $02:8723 SBC $28 ; Hitbox Y low = block Y low - [$28] R $02:899A SBC $28 ; Sprite Y low = block Y low - [$28] R $02:9AFF SBC $28 ; Layer 1: Y -= [$28] R $02:A5E4 ADC $28 ; Sprite Y low += [$28], old value saved $0029 Layer 2 offset from layer 1, Y (high) byte (high half of word) High byte of the layer 2 minus layer 1 Y offset ($0028 is the low byte). Added to or borrowed from Y high bytes when converting positions between layers.
6 uses in 5 routines (6 read) R $01:9178 ADC $29 ; Sprite Y += [$28]/[$29] (layer 2 offset) R $01:9199 SBC $29 ; Sprite Y -= [$28]/[$29] (restore) R $02:872A SBC $29 ; Hitbox Y high = block Y high - [$29] - borrow R $02:89A0 SBC $29 ; Sprite Y high = block Y high - [$29] - borrow R $02:A5ED ADC $29 ; Sprite Y high += [$29], old value saved $002A Mode 7 center X (low) word (little endian, low/high pair) Mode 7 rotation center X; $002B is the high byte. The NMI adds $0080 and writes it to the Mode 7 center register $211F. Boss rooms set it to $0080 . The Reznor code reuses it as the circle center X of the Reznor ring.
7 uses in 7 routines (3 read, 4 write) W $00:9828 STA $2A ; Mode 7 center X [$2A] = $0080 W $00:993B STA $2A ; Mode 7 center X [$2A] = $0080 R $03:99B3 ADC $2A ; Add centre X low byte [$2A] W $03:A29B STA $2A ; Mode 7 center X = $90 $002B Mode 7 center X (high) byte (high half of word) High byte of the Mode 7 / Reznor ring center X ($002A is the low byte). Zeroed along with $002A .
3 uses in 3 routines (2 read, 1 write) W $03:98A7 STZ $2B ; Circle centre X: [$2A]/[$2B] = $0080 (also the Mode 7 center X) R $03:99BB LDA $2B ; Centre X high byte [$2B] $002C Mode 7 center Y (low) word (little endian, low/high pair) Mode 7 rotation center Y ($002D is the high byte). Sent to $2120 after adding $0080 by the NMI. Set to $0050 at Mario Start, $00A0 in boss rooms and $00C8 by the Bowser fight; Reznor code uses it as ring center Y.
7 uses in 7 routines (3 read, 4 write) W $00:982D STA $2C ; Mode 7 center Y [$2C] = $0050 W $00:9940 STA $2C ; Mode 7 center Y [$2C] = $00A0 R $03:99D8 ADC $2C ; Add centre Y low byte [$2C] W $03:A29F STA $2C ; Mode 7 center Y = $C8 W $03:DD8F STA $2C ; Mode 7 center Y low byte [$2C] = $48 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 read) R $03:99DF LDA $2D ; Centre Y high byte [$2D] $002E Mode 7 matrix A word (little endian, low/high pair) Mode 7 matrix parameter A, calculated as cos(angle) * scale by the Calculate Mode 7 rotation matrix routine from $0036 and $0038 . $0034 gets a copy as matrix D. The NMI writes it to $211B.
3 uses in 2 routines (2 read, 1 write) W $00:8B26 STA $2E ; [$2E] = cos(angle) * scale (matrix A) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $00:831F LDA $2F ; Mode 7 matrix A = [$2E]/[$2F] $0030 Mode 7 matrix B word (little endian, low/high pair) Mode 7 matrix parameter B, sin(angle) * scale from the matrix routine. $0032 (matrix C) is its negation. The NMI writes it to $211C.
3 uses in 2 routines (2 read, 1 write) W $00:8B0A STA $30 ; [$30] = sin(angle) * scale (matrix B) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $00:8329 LDA $31 ; Mode 7 matrix B = [$30]/[$31] No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:8AE6 STA $32 ; [$32] (matrix C) = -[$30] = -sin * [$39]; then fall into the second pass No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $00:8333 LDA $33 ; Mode 7 matrix C = [$32]/[$33] No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:8ADE STA $34 ; [$34] (matrix D) = [$2E] = cos * [$39] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $00:833D LDA $35 ; Mode 7 matrix D = [$34]/[$35] $0036 Mode 7 rotation angle word (little endian, low/high pair) Angle of the rotating/tilting Mode 7 picture, 9 bits ($0000 -$01FF, high byte $0037 ). Input to the rotation matrix routine. Koopaling and Bowser fights change it: the tilting platform, Ludwig's and Koopa Kid's rooms, and Bowser's bounce. Mario's platform/ceiling collision reads it as the tilt.
Values: 0 = not rotated.
42 uses in 15 routines (22 read, 20 write) R $00:8AE8 LDA $36 ; A = [$36]: rotation angle ($0200 = full turn) R $00:F983 LDA $36 ; A = [$36] (platform tilt) W $01:CB18 STA $36 ; [$36] = angle low byte W $01:FD7B STA $36 ; [$36] = -[$36] & $1FF (negate platform angle) W $01:FD90 STA $36 ; [$36] = -[$36] & $1FF (restore angle) W $03:A5F6 STZ $36 ; Yes: [$36] = 0 and [$37] = 1 (tilt $0100) W $03:A69D STA $36 ; [$36] = shake low (signed) W $03:ABCF STA $36 ; [$36]/[$37] += $0A (16-bit) W $03:AC34 STA $36 ; [$36]/[$37] += $05 (16-bit) R $03:C145 LDA $36 ; A = [$36], platform tilt (low byte) $0037 Mode 7 rotation angle (high) byte (high half of word) High byte (bit 0 only is used) of the Mode 7 rotation angle ($0036 is the low byte). Non-zero together with $0036 means the room is rotated; Koopaling code ORs the two to decide whether to keep turning.
28 uses in 12 routines (14 read, 12 write, 2 read-modify-write) W $01:CB1D STA $37 ; [$37] = angle high byte W $01:CE7A STZ $37 ; Room rotation angle [$36]/[$37] = 0 R $01:CF4B ORA $37 ; Room angle zero: skip rotation R $01:D273 ORA $37 ; If rotation angle [$36]/[$37] is non-zero, keep it turning W $01:D2A5 STZ $37 ; Rotation angle [$36]/[$37] = 0 R $01:FBD9 LDA $37 ; Stunned: tilt high byte [$37] set? R $03:9926 LDA $37 ; $01/$00 = ([$36] + start angle [Y]) & $01FF: this Reznor's position on the ring RW $03:A6A3 INC $37 ; Negative: [$37] = 1 R $03:C14F LDA $37 ; A = [$37], platform tilt high byte W $03:C157 STA $37 ; [$37] = bit 0 only (which way the platform leans) $0038 Mode 7 scale word (little endian, low/high pair) Scale for the Mode 7 picture's matrix A/B ($0039 does C/D). Boss fights change it: Bowser increments it, Ludwig's code decrements it as a room parameter. The matrix routine multiplies by it.
20 uses in 11 routines (8 read, 7 write, 5 read-modify-write) W $00:97C9 STA $38 ; Mode 7 scaling [$38] = $20 W $01:CD65 STA $38 ; Mode 7 room parameters [$38] = [$39] = $20 RW $01:CFF8 DEC $38 ; Room parameter [$38]-- RW $01:D00B INC $38 ; Room parameter [$38]++ W $01:D37B STA $38 ; Platform tilt target [$38] = $18 $0039 Mode 7 scale (second) byte (counter in Bowser/Koopa Kid code) Second Mode 7 scale value, used for matrix parameters C and D; Mario Start sets it to $20. Boss code reuses it as a stepping value (Ludwig decrement, Koopa Kid tilt step * 2, Bowser's bounce increment).
17 uses in 10 routines (5 read, 7 write, 5 read-modify-write) W $00:97CB STA $39 ; Mode 7 scaling [$39] = $20 RW $01:CFF1 DEC $39 ; Room parameter [$39]-- RW $01:D00D INC $39 ; Room parameter [$39]++ R $01:D37E LDA $39 ; [$39]: current tilt step * 2 W $01:D384 STA $39 ; [$39] = $28 (new tilt) W $03:A783 STA $39 ; Also store in [$39] W $03:DD95 STA $39 ; Mode 7 matrix values [$38] = [$39] = $14 (probably the zoom) $003A Mode 7 scroll X word (little endian, low/high pair) Mode 7 scroll X, written to the Mode 7 H-offset ($210D). Boss rooms set it to $0080 ; Position Mode 7 picture writes [$3A +X] as -A + a table value + the layer 1 screen boundary (X = 0: horizontal, X = 2: vertical).
3 uses in 3 routines (1 read, 2 write) W $00:9832 STA $3A ; Mode 7 scroll X [$3A] = $0080 W $03:DFBE STA $3A,X ; Scroll [$3A+X] = -A + DATA_03DEBB[X] + screen boundary ([$1A] or [$1C]) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $00:8405 LDA $3B ; BG1 H-scroll = [$3A]/[$3B] (Mode 7 scroll) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:9837 STA $3C ; Mode 7 scroll Y [$3C] = $0010 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $00:840F LDA $3D ; BG1 V-scroll = [$3C]/[$3D] (Mode 7 scroll) $003E BGMODE mirror byte Shadow of the BG mode / character size register ($2105), written by the NMI. Normally $09: Mode 1 with BG3 on top; level end ORs $08 for BG3 priority.
Values: $09 = Mode 1, BG3 priority.
5 uses in 5 routines (1 read, 3 write, 1 read-modify-write) W $00:9627 STA $3E ; BGMODE mirror [$3E] = $09 W $00:AF2F STA $3E ; [$3E] = $09 (BGMODE mirror): Mode 1, BG3 on top RW $05:CC8B TSB $3E ; [$3E] |= $08 (BGMODE: BG3 priority) $003F OAM address (priority index) byte (index) Value written to the OAM address register ($2102) after the OAM DMA, setting which sprite has priority. The upload routine clears it to 0; Mario Start sets $C8 and the overworld loader $F0.
4 uses in 4 routines (1 read, 3 write) W $00:8640 STZ $3F ; [$3F] = 0 (OAM priority index) W $00:97F8 STA $3F ; [$3F] = $C8 (OAM priority index) W $00:A16B STA $3F ; OAM priority index [$3F] = $F0 $0040 Color math mirror (CGADSUB) bit flags Shadow of the color math add/subtract control ($2131). Boss fades, spotlight effects and the Mario Start screen set it; the NMI writes it (with bit 2 masked) to $2131.
Values: $24 = color math on BG3 and backdrop; $34 = also on sprites.
13 uses in 11 routines (2 read, 9 write, 2 read-modify-write) W $00:9400 STA $40 ; CGADSUB ($2131) and its mirror [$40] = A W $00:9D33 STY $40 ; CGADSUB mirror [$40] = Y RW $00:A01D TRB $40 ; CGADSUB: BG3 not in color math ([$40] bit 2 cleared) RW $00:AF2B TRB $40 ; Clear bit 2 of [$40] (CGADSUB mirror): BG3 out of color math W $01:BE01 STY $40 ; [$40] (color math layers) = $24: normal W $01:BE84 STY $40 ; [$40] = $34: color math also on sprites (fade effect, probably) W $01:C01A STY $40 ; [$40] = $24: color math back to normal W $03:823B STY $40 ; [$40] (CGADSUB mirror) = $24: color math on BG3 and backdrop W $03:8247 STY $40 ; [$40] = $34: color math also on sprites (transparent boss) W $03:C505 STA $40 ; [$40] (CGADSUB mirror) = $FF: subtract all layers, half (darken) W $05:8517 STA $40 ; [$40] = color math settings from LevCGADSUBtable $0041 Window mask mirror, BG1/BG2 bit flags Shadow of $2123: window masks for BG1 and BG2. Cleared on screen reset; set for the iris-out and keyhole effects, Mario Start and the controller detect screen. The NMI writes it to $2123.
Values: $22 or $33 are used for keyhole/iris windows; 0 = no window.
12 uses in 12 routines (1 read, 11 write) W $00:8A98 STZ $41 ; [$41] = 0: BG1/BG2 window mask mirror W $00:9850 STA $41 ; Window mask mirror [$41] = $02 W $00:9AAF STA $41 ; Window mask mirror [$41] = $33 W $00:C4C5 STA $41 ; [$41] = $22: window mask BG1/BG2 W $04:DB91 STA $41 ; Window 1 enabled on BG1 and BG2 [$41] = $33 W $04:F492 STA $41 ; [$41] = $22: window mask W12SEL (BG1/BG2 window 1) W $05:B285 STA $41 ; W12SEL mirror [$41] = $22: window 1 on BG1 and BG2 W $0C:AB24 STA $41 ; $41 = $33: window mask for BG1/BG2 (window 1 enabled, inverted) $0042 Window mask mirror, BG3/BG4 bit flags Shadow of $2124: window masks for BG3 and BG4. Cleared on screen reset and by the lives exchange; keyhole and iris-out effects set it. The NMI writes it to $2124.
7 uses in 7 routines (1 read, 6 write) W $00:8A9A STZ $42 ; [$42] = 0: BG3/BG4 window mask mirror W $00:9AB3 STA $42 ; Window mask mirror [$42] = $00 W $00:C4C9 STA $42 ; [$42] = $02: window mask BG3/BG4 W $04:F409 STZ $42 ; Clear window mask mirrors [$41]/[$42]/[$43] $0043 Window mask mirror, OBJ/color bit flags Shadow of $2125: window masks for sprites and the color window. Set by Mario Start, the overworld loader, keyhole/iris effects and the dark-room spotlight ($20: color window uses window 1); the NMI writes it to $2125.
13 uses in 13 routines (1 read, 12 write) W $00:8A9C STZ $43 ; [$43] = 0: OBJ/color window mask mirror W $00:9854 STA $43 ; Window mask mirror [$43] = $32 W $00:9AB7 STA $43 ; Window mask mirror [$43] = $23 W $00:A111 STA $43 ; Window mask settings [$43] = $30 W $00:C4CE STA $43 ; [$43] = DATA_00C478[X]: window mask OBJ/color W $00:CA56 STA $43 ; [$41] = [$43] = $33: window 1 on BG1, BG2, OBJ, color W $03:C50D STA $43 ; [$43] (WOBJSEL mirror) = $20: color window uses window 1 W $04:DB95 STA $43 ; Window mask for OBJ and color [$43] = $33 W $04:F40B STZ $43 ; [$43] = 0 (color window) W $05:B127 STZ $43 ; Clear window masks [$41], [$42], [$43] W $05:B28E STA $43 ; WOBJSEL mirror [$43] W $0C:AB3B STA $43 ; Window mask for sprites/color [$43] $0044 Color math select mirror (CGWSEL) bit flags Shadow of $2130: color window control and subscreen select. Reset to $02 on screen reset; effects set it (spotlight $20 = color math only outside the window). The NMI writes it to $2130.
12 uses in 11 routines (1 read, 11 write) W $00:8AAC STA $44 ; [$44] = $02: color math mirror (CGWSEL), probably adds the subscreen W $00:9858 STA $44 ; Color math mirror [$44] = $20 W $00:9ABB STA $44 ; Color math mirror [$44] = $12 W $00:A0E8 STA $44 ; Color window settings [$44] = $03 W $00:A115 STA $44 ; Color math window [$44] = $20 W $00:C4D2 STA $44 ; [$44] = $12: color window control W $00:CA5E STA $44 ; [$44] = $22: color window = window 1 inside W $03:C509 STA $44 ; [$44] (CGWSEL mirror) = $20: color math only outside the window W $05:B12E STA $44 ; [$44] = 2: color math control back to normal W $05:B292 STA $44 ; CGWSEL mirror [$44] = $22 W $0C:AB94 STA $44 ; [$44] = $22 (color math window control mirror, probably) $0045 Layer 1 tile column range, left word (little endian, low/high pair) Left edge of the range of Map16 columns to update on layer 1, computed as screen X / 16 - 8. Pairs with $0047 (right edge). Indexed by $0055 in the Layer 2 update table builders, so $0045 ,X is the left edge for layer [X]. Scroll sprites also set [$45 +L] = $FFF8.
14 uses in 4 routines (11 read, 3 write) W $05:8794 STA $45 ; [$45] = left edge of the tile range (column - 8) R $05:87A2 LDA $45,X ; A = [$45+X] (low byte of the column being loaded) W $05:87D8 STA $45 ; [$45] = top edge of the tile range (row - 8) W $05:C393 STA.W $0045,X ; [$0045+L] = $FFF8 (probably scroll or object limit) $0047 Layer 1 tile column range, right word (little endian, low/high pair) Right edge of the Map16 column range to update on layer 1, screen X / 16 + $17 ($0045 is the left edge). At level load it starts as a copy of $0045 and is incremented while columns are built. The overworld setup uses it for a row counter that starts at $20.
9 uses in 4 routines (1 read, 6 write, 2 read-modify-write) W $04:D70D STA $47 ; [$47] = $20 (starting value of the row counter for the submap) RW $04:D71E INC $47 ; Row counter [$47]++ W $04:D731 STZ $47 ; Row counter [$47] = 0 W $05:80B2 STA $47 ; [$47] = [$45] (start at the left/first edge) RW $05:80CD INC $47 ; Next column/row position: [$47]++ W $05:879B STA $47 ; [$47] = right edge of the tile range (column + $17) W $05:87DF STA $47 ; [$47] = bottom edge of the tile range (row + $17) W $05:C399 STA.W $0047,X ; [$0047+L] = $0017 (probably scroll or object limit) $0049 Layer 2 tile column range, left word (little endian, low/high pair) Left edge of the Map16 column range for layer 2 (partner of $0045 for layer 1), computed in the tile range setup and read by the Layer 2 update table and stripe builders, indexed by X.
12 uses in 3 routines (10 read, 2 write) W $05:87F6 STA $49 ; [$49] = left edge of the layer 2 tile range W $05:880F STA $49 ; [$49] = top edge of the layer 2 tile range $004B Layer 2 tile range right edge word (little endian, low/high pair) One of the 16-bit tile-range bounds used while building the level layers. At level load it is set equal to $0049 (the first edge), and the Map16 pointer setup writes the right edge of the layer 2 tile range into it. $0055 selects which of the $0045 -$004B words the layer scroll tile loader uses.
4 uses in 2 routines (3 write, 1 read-modify-write) W $05:80B6 STA $4B ; [$4B] = [$49] (start at the top/first edge) W $05:87FD STA $4B ; [$4B] = right edge of the layer 2 tile range W $05:8816 STA $4B ; [$4B] = bottom edge of the layer 2 tile range $004D Last loaded column, layer 1 word table (index X: 0 or 2 from the scroll direction) Remembers the last 16-pixel column or row that was streamed into the layer 1 tilemap, so the scroll tile loader only draws when the camera moves into a new one ([$4D ,X] is compared with the current position). Level load and the overworld setup set it to $FFFF, which probably means nothing has been drawn yet.
Values: $FFFF = no column cached.
8 uses in 3 routines (2 read, 6 write) W $04:D6F0 STA $4D ; [$4D] = [$4F] = $FFFF (probably invalidates the cached layer 1 update positions) W $04:D73B STA $4D ; [$4D] = [$4F] = $FFFF (probably invalidates the cached update positions) R $05:870C CMP $4D,X ; Same 16-pixel column as last loaded ([$4D,X])? R $05:8720 CMP $4D,X ; Same 16-pixel row as last loaded ([$4D,X])? W $05:8724 STA $4D,X ; Remember this boundary as the last loaded position [$4D,X] W $05:872E STA $4D,X ; Invalidate the other slot: [$4D,X] = $FFFF (forces a reload if the scroll reverses) $004F Last loaded column, layer 1 (second) word (little endian, low/high pair) Second word of the cached-column markers that start at $004D . Only ever written: level load and the overworld setup store $FFFF here along with $004D -$0050, probably as 'nothing drawn yet'.
Values: $FFFF = reset.
4 uses in 2 routines (4 write) W $05:80AB STA $4F ; [$4D]-[$50] = $FFFF (probably 'nothing drawn yet' markers) $0051 Last loaded column, layer 2 word table (index X: 0 or 2 from the scroll direction) Layer 2 counterpart of $004D . The scroll tile loader compares the current 16-pixel column against [$51 ,X] and skips drawing if it is the same as last time. Level load resets $004D -$0054 to $FFFF.
Values: $FFFF = nothing drawn yet.
5 uses in 2 routines (2 read, 3 write) W $05:8120 STA $51 ; [$4D]-[$54] = $FFFF (reset the drawn-column markers) R $05:874C CMP $51,X ; Same 16-pixel column as last loaded ([$51,X])? R $05:8760 CMP $51,X ; Same 16-pixel row as last loaded ([$51,X])? W $05:8764 STA $51,X ; Remember this boundary as the last loaded position [$51,X] W $05:876E STA $51,X ; Invalidate the other slot: [$51,X] = $FFFF No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $0055 Screen scroll direction (layer 1) byte, 0 or 2 (indexes word tables) Direction the screen is scrolling, used as a word-table index. The 'Scroll screen to follow Mario' routine sets it (together with $0056 ) from where Mario is in the static camera region. The layer scroll tile loader, the layer 2 stripe builders, sprite spawn on scroll and scroll sprites read it. Level load and the overworld setup set it to 2 (so the $0047 /$004B positions are used).
Values: 0 = left/up side, 2 = right/down side.
19 uses in 10 routines (8 read, 11 write) R $02:A802 LDY $55 ; Y = screen scroll direction [$55] W $02:AC66 STA $55 ; [$55] = 1 (purpose unclear) W $02:AC9E STA $55 ; Restore screen Y high, screen Y low and [$55] W $02:ACDE STA $55 ; Restore screen X high, screen X low and [$55] W $04:D6F7 STA $55 ; [$55]-[$56] = $0202 (purpose unclear) W $05:80BB STA $55 ; [$55] = $0202: index 2 into [$45]-[$4B] (use the [$47]/[$4B] positions) W $05:C0D7 STX $55 ; [$55] = scroll direction W $05:C3BE STA.W $0055,Y ; [$0055+Y] = scroll direction code W $05:C789 STA $55 ; [$55] = [$56] = 2 (probably scroll-direction flags) $0056 Screen scroll direction (layer 2) byte, 0 or 2 (indexes word tables) Layer 2 copy of the scroll direction $0055 . The scroll-follow routine writes it with the same value as $0055 ; scroll sprite 0B (layer 2 on/off switch) sets it to 2 and the layer 3 handler clears it. Read by the layer scroll tile loader and layer 2 stripe builders.
Values: 0 or 2.
9 uses in 5 routines (4 read, 5 write) W $00:F72A STY $56 ; Scroll direction [$55] = [$56] = Y W $00:F80E STY $56 ; Scroll direction [$55] = [$56] = Y (0 up, 2 down, 4 misc) $0057 Object position in Map16 buffer byte (level buffer index) Position of the level object being drawn, as an index into the current screen of the Map16 buffer (low nibble = column, high nibble = row). 'Load one level object' derives it from the object's Y and X bytes; every object draw routine then loads it into Y and writes tiles through the $006B pointer. Mostly read: this is the start index each routine advances from while drawing slopes, ledges and pipes.
188 uses in 79 routines (159 read, 29 write) W $05:8646 STA $57 ; [$57] high nibble = Y position ([$0A] & $0F) W $05:864E STA $57 ; [$57] |= X position ([$0B] & $0F): [$57] = YX within the screen R $0D:A5B1 LDY $57 ; Y = tile position [$57] R $0D:A656 LDY $57 ; Y = tile position [$57] R $0D:A673 LDY $57 ; Y = tile position [$57] R $0D:A6D1 LDY $57 ; Y = tile position [$57] R $0D:A71B LDY $57 ; Y = [$57]: position of the object (low nibble X, high nibble Y in the screen) R $0D:A7C1 LDY $57 ; Y = [$57] position of the object R $0D:A7E7 LDY $57 ; Y = [$57] position of the object R $0D:A80D LDY $57 ; Y = [$57] position of the object R $0D:A846 LDY $57 ; Y = [$57] position of the object R $0D:A87D LDY $57 ; Y = [$57] position of the object R $0D:A8C3 LDY $57 ; Y = [$57] position of the object W $0D:A9B1 STY $57 ; Save the new position: [$57] = Y W $0D:A9D3 STY $57 ; Save the new position: [$57] = Y R $0D:AA26 LDY $57 ; Y = [$57] position of the object R $0D:AAB4 LDY $57 ; Y = [$57] position of the object R $0D:AB0D LDY $57 ; Y = [$57] position of the object R $0D:AB6E LDY $57 ; Y = [$57] position of the object W $0D:ABE7 STY $57 ; Save the new position: [$57] = Y R $0D:AC21 LDY $57 ; Y = start position [$57] R $0D:AC92 LDY $57 ; Y = start position [$57] R $0D:AD44 LDY $57 ; Y = start position [$57] R $0D:ADA3 LDY $57 ; Y = start position [$57] R $0D:ADEB LDY $57 ; Y = start position [$57] R $0D:AE6D LDY $57 ; Y = start position [$57] R $0D:AEFC LDY $57 ; Y = start position [$57] R $0D:AF61 LDY $57 ; Y = start position [$57] R $0D:AFEA LDY $57 ; Y = start position [$57] R $0D:B075 LDY $57 ; Y = start position [$57] R $0D:B1E6 LDY $57 ; Y = start position [$57] R $0D:B224 LDY $57 ; Y = [$57] (level position index) W $0D:B2BB STY $57 ; [$57] = new column position R $0D:B322 LDY $57 ; Y = [$57] (position) R $0D:B571 LDY $57 ; Y = [$57] (position) R $0D:B73F LDY $57 ; Y = object position index [$57] R $0D:B7AA LDY $57 ; Y = object position index [$57] R $0D:B863 LDY $57 ; Y = object position index [$57] R $0D:B920 LDY $57 ; Y = object position index [$57] R $0D:B966 LDY $57 ; Y = object position index [$57] R $0D:B9C0 LDY $57 ; Y = object position index [$57] R $0D:BA0A LDY $57 ; Y = object position index [$57] R $0D:BA4C LDY $57 ; Y = object position index [$57] R $0D:BB2C LDY $57 ; Y = object position index [$57] R $0D:C259 LDY $57 ; Y = position index [$57] R $0D:C2E9 LDY $57 ; Y = position index [$57] R $0D:C31E LDY $57 ; Y = position index [$57] R $0D:C358 LDY $57 ; Y = position index [$57] R $0D:C3D8 LDY $57 ; Y = position index [$57] R $0D:C42E LDY $57 ; Y = object start index in Map16 buffer R $0D:C44F LDY $57 ; Y = object start index in Map16 buffer R $0D:C478 LDY $57 ; Y = object start index in Map16 buffer R $0D:C4C9 LDY $57 ; Y = object start index in Map16 buffer R $0D:C4EF LDY $57 ; Y = object start index in Map16 buffer R $0D:C58A LDY $57 ; Y = object start index in Map16 buffer R $0D:C5D8 LDY $57 ; Y = object start index in Map16 buffer R $0D:CE67 LDY $57 ; Y = object start index in Map16 buffer R $0D:CE94 LDY $57 ; Y = object start index in Map16 buffer R $0D:CEA6 LDY $57 ; Y = object start index in Map16 buffer R $0D:CEC0 LDY $57 ; Y = object start index in Map16 buffer R $0D:CEDA LDY $57 ; Y = object start index in Map16 buffer R $0D:CEF2 LDY $57 ; Y = object start index in Map16 buffer R $0D:CF12 LDY $57 ; Y = object start index in Map16 buffer R $0D:CF33 LDY $57 ; Y = object start index in Map16 buffer R $0D:CF6E LDY $57 ; Y = object start index in Map16 buffer R $0D:CFBB LDY $57 ; Y = object start index in Map16 buffer R $0D:CFF0 LDY $57 ; Y = object start index in Map16 buffer R $0D:D03E LDY $57 ; Y = object start index in Map16 buffer W $0D:D06A STY $57 ; Move index one column right, advancing a screen if it wraps R $0D:D080 LDY $57 ; Y = [$57]: object position in the Map16 buffer W $0D:D0BD STY $57 ; Save the new position in [$57] R $0D:D0C3 LDY $57 ; Y = [$57]: object position in the Map16 buffer W $0D:D0FD STY $57 ; Save the new position in [$57] R $0D:D103 LDY $57 ; Y = [$57]: object position R $0D:D145 LDY $57 ; Y = [$57]: object position R $0D:D182 LDY $57 ; Y = [$57]: object position R $0D:D1A5 LDY $57 ; Y = [$57]: object position R $0D:D1D9 LDY $57 ; Y = [$57]: object position R $0D:D24E LDY $57 ; Y = [$57]: object position R $0D:DA57 LDY $57 ; Y = [$57]: object position R $0D:DA68 LDY $57 ; Y = [$57]: object position R $0D:DA80 LDY $57 ; Y = [$57]: object position R $0D:DAA2 LDY $57 ; Y = [$57]: object position R $0D:DAC8 LDY $57 ; Y = [$57]: object position R $0D:DB06 LDY $57 ; Y = [$57]: object position W $0D:DB7F STY $57 ; Save the new start position in [$57] R $0D:DB8F LDY $57 ; Y = [$57]: object position W $0D:DBF4 STY $57 ; Save the new start position in [$57] R $0D:DC02 LDY $57 ; Y = [$57]: object position R $0D:DC61 LDY $57 ; Y = [$57]: object position R $0D:DCA9 LDY $57 ; Y = [$57]: object position R $0D:DCEA LDY $57 ; Y = [$57]: object position R $0D:DD2E LDY $57 ; Y = [$57] (object position in the Map16 buffer) R $0D:DD5C LDY $57 ; Y = [$57] (object position) R $0D:DD99 LDY $57 ; Y = [$57] (object position) R $0D:DE3C LDY $57 ; Y = [$57] (object position) W $0D:DF45 STY $57 ; Position [$57] = $50 (row 5 of screen 0) R $0D:E0AE LDY $57 ; Y = [$57] (object position) R $0D:E135 LDY $57 ; Y = [$57] (object position) R $0D:E95F LDY $57 ; Y = [$57] (object position) R $0D:E9AA LDY $57 ; Y = [$57] (object position) R $0D:E9F5 LDY $57 ; Y = [$57] (object position); the window routine enters here with X = 8 R $0D:EA3E LDY $57 ; Y = [$57] (object position) R $0D:EABF LDY $57 ; Y = [$57] (object position) R $0D:EB6A LDY $57 ; Y = [$57] (object position) R $0D:EC33 LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:EC5C LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:EC68 LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:EC8E LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:ECCE LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:ED12 LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:ED43 LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:ED6B LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:ED9E LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:EDB9 LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:EDDB LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:EE17 LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:EE52 LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:EE89 LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:EEC0 LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:EF45 LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:EF67 LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:EFA8 LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:F02B LDY $57 ; Y = position in the Map16 screen buffer ([$57]) R $0D:F06C LDY $57 ; Y = position in the Map16 screen buffer ([$57]) $0059 Object size/extension byte byte Third byte of the level object being loaded. The loader copies it here and the object draw routines read it as the width, length or variant setting (e.g. how many tiles a ledge, slope or pipe spans). Written only while a level object is loaded; read by most of the bank $0D object routines.
171 uses in 63 routines (168 read, 2 write, 1 read-modify-write) R $0D:A108 LDA $59 ; A = extended object number R $0D:B573 LDA $59 ; A = [$59] (object number $68-$6F) R $0D:CEC2 LDA $59 ; Dummy load of the object byte (unused) R $0D:CEDC LDA $59 ; Dummy load of the object byte (unused) $005A Level object number byte Number of the level object being processed, built by the loader from the object's bytes ([$0B ] >> 4 with bits of [$0A ]). The tileset object dispatchers use it as the jump table index X. Screen exit and jump objects reuse it to hold the destination screen.
12 uses in 9 routines (9 read, 3 write) W $05:8624 STA $5A ; [$5A] = object number: [$0B] >> 4 | ([$0A] & $60) >> 1 R $0D:A44D LDX $5A ; X = standard object number [$5A] W $0D:A516 STA $5A ; [$5A] = destination screen R $0D:C192 LDX $5A ; X = standard object number [$5A] R $0D:CD92 LDX $5A ; X = object number [$5A] $005B Level orientation flags RAM_IsVerticalLvl bit flags Set from the level header (via VerticalTable) at load time. Tells scrolling, collision and sprite code whether each layer is a horizontal or a vertical level; tested all over (collision, sprites, scrolling).
Bits: Bit 0: layer 1 is vertical. Bit 1: layer 2 is vertical. Bit 7 is also set by the layer 3 setup.
Values: 0 = horizontal level.
42 uses in 31 routines (35 read, 6 write, 1 read-modify-write) R $00:87B7 LDA RAM_IsVerticalLvl ; A = [$5B] level orientation flags R $00:88EA LDA RAM_IsVerticalLvl ; A = [$5B] level orientation flags RW $00:A068 TSB RAM_IsVerticalLvl ; Set bit 7 of [RAM_IsVerticalLvl] R $01:9451 AND RAM_IsVerticalLvl ; ([$185E] + 1) & [$5B]: zero = horizontal layer ($0194BF) R $02:9548 AND RAM_IsVerticalLvl ; Is the current layer ($0F + 1) vertical? R $02:A614 AND RAM_IsVerticalLvl ; Layer being checked is horizontal: go to CODE_02A679 W $04:D736 STZ RAM_IsVerticalLvl ; Not a vertical level W $04:DC28 STA RAM_IsVerticalLvl ; Level mode flag = 3 W $05:8524 STA RAM_IsVerticalLvl ; Vertical flags [$5B] from VerticalTable R $05:862F LDA RAM_IsVerticalLvl ; A = vertical flags [$5B] W $05:C716 STY RAM_IsVerticalLvl ; [$5B] (RAM_IsVerticalLvl) = Y W $05:DAA1 STZ RAM_IsVerticalLvl ; Horizontal level $005D Screens in level RAM_ScreensInLvl byte Number of screens (pages) in the level, from the level header: (byte 1 & $1F) + 1. Collision and tile lookups compare a position's screen number to it and treat anything beyond as no tile. Mode 7 boss setup sets it to $FF so the whole range is valid.
17 uses in 9 routines (15 read, 2 write) R $00:F485 CPX RAM_ScreensInLvl ; X = screen number; outside the level: no tile R $00:F4AE CPX RAM_ScreensInLvl ; Y screen >= screens in level: outside R $02:A629 CMP RAM_ScreensInLvl ; Y high byte (screen) beyond the level: no collision R $02:A6A6 CMP RAM_ScreensInLvl ; X high byte beyond the level: no collision R $02:BA06 CMP RAM_ScreensInLvl ; Y high byte [$09] must be < number of screens, else return R $02:BA5F CMP RAM_ScreensInLvl ; X high [$08] must be < number of screens, else return W $03:DD99 STA RAM_ScreensInLvl ; [$5D] (screens in level) = $FF W $05:84EB STA RAM_ScreensInLvl ; Screens in level [$5D] = (byte1 & $1F) + 1 R $05:8527 LDA RAM_ScreensInLvl ; A = screens in level $005E Horizontal screen count byte Number of screens in a horizontal level, as parsed from the level header; Mario's scroll limit uses it (the camera is stopped at the last screen, $005E - 1). Game mode 11 sets it to $20; mode 7 boss setup clears it.
8 uses in 7 routines (5 read, 3 write) W $05:8530 STA $5E ; [$5E] = horizontal screen count $005F Vertical screen count byte Number of screens in a vertical level (last screen), from the level header. 'Scroll screen to follow Mario' reads it to stop vertical scrolling at the end of the level. Counterpart of $005E .
3 uses in 3 routines (1 read, 2 write) W $05:8532 STX $5F ; [$5F] = vertical screen count W $05:D9B1 STA $5F ; [$5F] = that + 1 (probably the screen count) $0064 Sprite priority bits RAM_SpriteProp byte (OAM property bits, bits 4-5) OAM priority/property bits ORed into the tiles a sprite or effect draws, so Mario and sprites appear in front of or behind the layers. Many routines set it to $10 to draw behind the layers (sprites emerging from a block, vines growing, Piranha Plants, Yoshi in a pipe, Monty Mole popping up) and restore it afterwards.
Values: $10 = draw behind layer 1; other values = normal.
144 uses in 99 routines (108 read, 36 write) W $00:94E9 STA $64 ; [$64] = $20: sprite priority bits for the scene R $00:E3C0 LDA $64 ; A = [$64] (Mario OAM priority property) W $01:8E85 STA $64 ; Priority [$64] = $10 (draw behind objects) W $01:8E98 STA $64 ; Restore priority [$64] W $01:9B56 STA $64 ; ... for the draw routine W $01:9B78 STA $64 ; ... for the draw routine R $01:9D13 ORA $64 ; [$03] = palette | layer priority R $01:9F46 ORA $64 ; OAM property = A OR [$04] OR [$64] W $01:9F96 STA RAM_SpriteProp ; Restore sprite property bits R $01:AF79 ORA $64 ; Tile properties = ThwompGfxProp[X] | sprite priority [$64] R $01:B78E LDA $64 ; A = sprite priority bits [$64] R $01:BA62 LDA $64 ; A = sprite priority/property bits [$64] W $01:BA72 STA $64 ; Behind: [$64] = $10 (draw behind the layer) R $01:BD77 ORA $64 ; Tile properties = sprite palette | sprite priority bits [$64] W $01:C18F STA $64 ; Timer >= $20: priority = $10 (drawn behind layers while growing out of block) R $01:C208 LDA $64 ; Unreferenced: save level priority [$64] W $01:C20D STA $64 ; [$64] = $10 (draw behind layers) W $01:C39E STA $64 ; [$64] = $10: draw behind layers while emerging from a block W $01:C4A3 STA $64 ; [$64] = $10: draw behind layers W $01:C4A9 STA $64 ; Restore [$64] saved at $01C371 R $01:DBFC ORA $64 ; Properties = table value | sprite properties [$64] W $01:E3F9 STA $64 ; Emerging: priority $10 (draw behind the layer) W $01:E3FF STA $64 ; Restore the priority W $01:EBAB STA $64 ; [$64] = $10: Yoshi drawn behind the foreground (in pipe) R $01:F499 ORA $64 ; Add the sprite priority bits [$64] R $02:8EBD ORA $64 ; Prop = X/Y flip from timer bits 6-7 (spinning) | palette 1 | [$64] R $02:901B ORA $64 ; Prop = palette | flips from DATA_028B8C[X] | [$64] R $02:972D ORA $64 ; Add the sprite priority bits [$64] R $02:9776 ORA $64 ; Add the sprite priority bits [$64] R $02:97EC ORA $64 ; Add the sprite priority bits [$64] R $02:9872 ORA $64 ; Add the sprite priority bits [$64] R $02:9981 LDA $64 ; A = sprite priority bits [$64] R $02:99B4 LDA $64 ; A = sprite priority bits [$64] R $02:9A55 ORA $64 ; Add the sprite priority bits [$64] R $02:9B86 ORA $64 ; Add the sprite priority bits [$64] R $02:9D36 ORA $64 ; Properties = $0B (palette 5, priority 2) | [$64] (sprite priority bits) R $02:A08C ORA $64 ; OAM properties = DATA_02A15F EOR [$00] ORA [$64] R $02:A1F4 ORA $64 ; OAM properties = DATA_02A15F EOR [$00] ORA [$64] R $02:A334 ORA $64 ; OAM properties = table ^ X flip ^ $40 | priority [$64] R $02:A39C ORA $64 ; OAM properties = flip table ^ priority [$64] (puff rotates) R $02:A3E4 ORA $64 ; OAM properties = flip table ^ priority [$64] R $02:B796 ORA $64 ; Palette/properties = 5 | [$64] R $02:B906 ORA $64 ; [$02] = sprite palette | draw priority [$64] R $02:BC78 ORA $64 ; Properties = sprite palette | priority [$64] R $02:C8BE ORA $64 ; [$08] = palette | priority [$64] R $02:CB2D ORA $64 ; Tile 1 properties = by direction | priority R $02:CB82 ORA $64 ; Properties = $09 | priority R $02:CBDA ORA $64 ; Properties = by direction | priority R $02:D8D2 ORA $64 ; OAM properties = [BubbleSprGfxProp1+type] | [$64] R $02:DA1A ORA $64 ; OAM properties = [BubbleGfxProp+X] | [$64] R $02:DA29 ORA $64 ; Popping: tile properties = 2 | [$64] W $02:E0D6 STA $64 ; [$64] = $10: sprite is in front of layers W $02:E229 STA $64 ; Else [$64] = $10 (draw in front) R $02:E5A3 ORA $64 ; Left tile properties = sprite palette | priority [$64] W $02:E7C7 STA $64 ; Timer running (rock is breaking): [$64] = $10 (draw behind layers) R $02:E926 ORA $64 ; Left properties = palette | [$64] R $02:ED52 ORA $64 ; Add priority bits [$64] R $02:F17E ORA $64 ; Properties = [$07] OR priority [$64] R $03:8889 ORA $64 ; Add level priority [$64] R $03:8D4F ORA $64 ; OAM properties = DiagPlatGfxProp[X] | [$64] (priority) R $03:8E4F ORA $64 ; OAM properties = TimedPlatGfxProp[X] | [$64] R $03:8ED4 ORA $64 ; OAM properties = $03 | [$64] (palette 9, second graphics page) R $03:91C0 ORA $64 ; Apply hook flip bits and priority [$64] R $03:96CE ORA $64 ; OAM properties = RexGfxProp[dir] | [$64] (level priority) R $03:97D7 ORA $64 ; OAM properties = FishboneGfxProp[X] | [$64] R $03:9F16 ORA $64 ; OR priority bits [$64] W $03:A2D7 STA $64 ; Sprite priority [$64] = $30 W $03:A2DF STZ $64 ; Below $20: priority = 0 W $03:A5FA STZ $64 ; [$64] = 0 (sprite priority) R $03:B247 ORA $64 ; Properties from table | sprite priority bits [$64] R $03:B425 ORA $64 ; Properties | priority bits [$64] R $03:B4DB ORA $64 ; Properties $0D | priority bits [$64] R $03:B519 ORA $64 ; Properties $0D | priority bits [$64] R $03:B553 ORA $64 ; Properties $0D | priority bits [$64] R $03:C421 ORA $64 ; OAM properties = flip bits for the direction | sprite palette/priority [$64] W $05:8503 STA $64 ; [$64] = sprite OAM property XOR mask from LevXYPPCCCTtbl $0065 Level data pointer (low word) pointer (24-bit with $0067), used with [$65],Y General 24-bit pointer, $0065 -$0067 , used as a long pointer into level data. 'Load level' points it at the layer 1 object data (and the header bytes) and the object loader reads 3 bytes at a time through it. Layer 2 data uses $0068 -$006A . 'Generate Map16 tile' loads it from the block pointer table, and the credits code reuses it as a VRAM address ($5840) for the text rows.
Values: low 16 bits of the address.
48 uses in 15 routines (34 read, 14 write) W $00:BEFA STA $65 ; $65 = low byte of pointer from LoadBlkPtrs[layer] R $05:84E5 LDA [$65],Y ; A = header byte 1 R $05:84F7 LDA [$65],Y ; A = header byte 2 R $05:8534 LDA [$65],Y ; Reload header byte 2 R $05:853F LDA [$65],Y ; A = header byte 3 R $05:8573 LDA [$65],Y ; A = header byte 4 R $05:85A2 LDA [$65],Y ; A = header byte 5 R $05:8608 LDA [$65],Y ; Read 3 object bytes at [$65] into [$0A], [$0B], [$59] W $05:8616 STA $65 ; [$65]-[$67] += 3 (bytes consumed) W $05:DB4F STA $65 ; Layer 1 pointer low word [$65] = ChocIsld2Layer1[X] (bank byte unchanged) W $0C:9436 STA $65 ; [$65] = $5840: VRAM address of the first credits text row (BG3) W $0C:9F4D STA $65 ; [$65] += $20: VRAM address of the next tilemap row W $0C:9F59 STA $65 ; Wrap to the next screen of the 64x64 BG3 map ($5C00 -> $5000, $5400 -> $5800) W $0C:ADAA STA $65 ; $65/$66 = layer 1 pointer [DATA_0CAD58+Y] R $0D:A514 LDA [$65],Y ; A = destination screen byte from the level data $0066 Level data pointer (high byte of word) byte (middle byte of the pointer at $0065) Middle byte of the 24-bit pointer at $0065 (so $0065 -$0066 is the 16-bit offset, $0067 the bank). Advanced with carry when an object routine steps through level data. In the credits it is the high byte of the text row VRAM address.
12 uses in 7 routines (5 read, 7 write) W $00:BF00 STA $66 ; $66 = high byte of that pointer W $0D:A523 STA $66 ; Advance the level data pointer [$65] by one byte $0067 Level data pointer bank byte (bank of the pointer at $0065) Bank byte of the pointer at $0065 . Set to the bank of the level data, or 0 / $0C for other users (Map16 block generation, credits layer data). In the credits text code it counts the next text row instead.
9 uses in 7 routines (1 read, 7 write, 1 read-modify-write) W $04:DCC2 STA $67 ; [$67] = $05 (placeholder bank) W $0C:943A STZ $67 ; [$67] = 0: index of the next credits text row RW $0C:9EEE INC $67 ; Next text row: [$67]++ W $0C:ADA1 STA $67 ; $67 = $0C: layer 1 data bank $0068 Layer 2 data pointer (low word) pointer (24-bit with $006A) Low word of the 24-bit pointer $0068 -$006A to the layer 2 object or background data. 'Load level' fills it, 'Switch to layer 2 objects' then copies it (plus 5 for the header) into $0065 -$0067 . The credits scene setup loads it from a table; Level load reads it as a source pointer.
23 uses in 6 routines (17 read, 6 write) W $05:DB5B STA $68 ; Layer 2 pointer low word [$68] = ChocIsld2Layer2[X] R $0C:945D LDA [$68],Y ; Read the control byte: bit 7 = repeat run, low 7 bits = count - 1 R $0C:946E LDA [$68],Y ; Read the byte to repeat R $0C:9482 LDA [$68],Y ; Read the next literal byte W $0C:9500 STA $68 ; [$68] = address of this Map16's four tile words W $0C:ADAF STA $68 ; $68/$69 = layer 2 pointer [DATA_0CAD72+Y] $0069 Layer 2 data pointer (middle byte) byte (middle byte of the pointer at $0068) High byte of the 16-bit offset of the layer 2 data pointer at $0068 . Set by 'Load level' and read when switching to layer 2 objects, where the 5-byte layer header is skipped.
3 uses in 2 routines (1 read, 2 write) R $05:8402 LDA $69 ; [$65]-[$67] = [$68]-[$6A] + 5 (layer 2 data, skipping its 5-byte header) $006A Layer 2 data pointer bank byte (bank of the pointer at $0068) Bank of the layer 2 data. Set to $0C for prebuilt backgrounds (all of them live in bank $0C), and for the credits compressed data. Read when the loader switches to layer 2 objects.
8 uses in 5 routines (2 read, 6 write) W $05:8062 STA $6A ; Layer 2 bank = $0C (all prebuilt backgrounds live in bank $0C) W $0C:9419 STA $6A ; [$6A] = $0C: bank of the compressed data W $0C:94D6 STA $6A ; [$6A] = $0D: bank of the Map16 definitions W $0C:ADA3 STX $6A ; $6A = layer 2 data bank $006B Map16 low-byte pointer pointer (24-bit, $006B-$006D), used with [$6B],Y Long pointer to the Map16 tile low bytes of the current screen of the level buffer (bank $7E). Level object routines store tiles through it (STA [$6B ],Y) at the position in $0057 , and read it back to merge with existing tiles. The matching high-byte (tile page) pointer is $006E . Set up by 'Load one level object' and 'Generate Map16 tile'.
158 uses in 61 routines (24 read, 134 write) W $00:BF1F STA $6B ; $6B/$6E = low byte of this screen's Map16 address W $00:C09E STA [$6B],Y ; Store the Map16 tile for this block at [$6B],Y W $00:C0EF STA [$6B],Y ; Map16 low byte = TileToGeneratePg1[X] W $00:C1C8 STA [$6B],Y ; Map16 tile of this block = $25 (empty) W $00:C1D6 STA [$6B],Y ; Map16 tile of the block below = $25 (empty) W $00:C3EF STA [$6B],Y ; Map16 tile of the block = $25 (empty) W $00:C3F4 STA [$6B],Y ; Map16 tile = $25 (empty) W $00:C402 STA [$6B],Y ; Map16 tile = $25 (empty), lower right block W $00:C407 STA [$6B],Y ; Map16 tile = $25 (empty), lower left block W $05:86A3 STA $6B ; [$6B] = low byte of this screen's start in the Map16 low-byte buffer (table [$00]) W $05:8A28 STA $6B ; [$6B] = low word of this screen's Map16 low-byte data pointer W $05:8B04 STA $6B ; [$6B] = low word of this screen's Map16 low-byte data pointer W $05:8BF6 STA $6B ; [$6B] = low word of this screen's Map16 low-byte data pointer W $05:8CE9 STA $6B ; [$6B] = low word of this screen's Map16 low-byte data pointer W $05:8D9A STA $6B ; [$6B] = $B900: low word of the Map16 low-byte data at $7E:B900 W $0C:94C7 STX $6B ; [$6B] = $B900: pointer to the decompressed Map16 low bytes W $0D:A64A STA [$6B],Y ; Write it to the level buffer at [$6B],Y W $0D:A66B STA [$6B],Y ; Write the right tile W $0D:A67E STA [$6B],Y ; Write the top tile W $0D:A688 STA [$6B],Y ; Write bottom tile $EB W $0D:A6DF STA [$6B],Y ; Write the top tile W $0D:A6EB STA [$6B],Y ; Write the bottom tile R $0D:A79E LDA [$6B],Y ; Look at the tile already in the map at this position W $0D:A95B STA [$6B],Y ; Store tile [A] at the current Map16 position R $0D:AC03 LDA [$6B],Y ; A = Map16 low byte already at the draw position W $0D:B095 STA [$6B],Y ; Write top tile (adjusted when over other tiles) W $0D:B0B7 STA [$6B],Y ; Write tile below the top (adjusted when over other tiles) W $0D:B0D9 STA [$6B],Y ; Write middle tile (adjusted when over other tiles) W $0D:B0ED STA [$6B],Y ; Write bottom tile (page 1) R $0D:B12A LDA [$6B],Y ; A = tile currently at the position R $0D:B1AE LDA [$6B],Y ; A = tile currently at the position W $0D:B27A STA [$6B],Y ; Write middle tile W $0D:B2A4 STA [$6B],Y ; Write bottom tile W $0D:B329 STA [$6B],Y ; Write top tile ($2D, Yoshi coin top) W $0D:B333 STA [$6B],Y ; Write bottom tile ($2E, Yoshi coin bottom) R $0D:B4DB LDA [$6B],Y ; Load tile we're on R $0D:B500 LDA [$6B],Y ; Load tile we're on W $0D:B7A7 STA [$6B],Y ; Map16 page 1, bottom tile $1EB R $0D:B850 LDA [$6B],Y ; Tile already on the map at this position W $0D:B98D STA [$6B],Y ; Page 0; lower tile (DATA_0DB964+X) written directly R $0D:B99D LDA [$6B],Y ; Tile already on the map here R $0D:B9AE LDA [$6B],Y ; Tile already on the map here W $0D:B9E9 STA [$6B],Y ; Page 0 tile $0BC R $0D:B9F6 LDA [$6B],Y ; Tile already on the map here W $0D:BA62 STA [$6B],Y ; Top tile: page 1, tile DATA_0DBA44+X W $0D:BA72 STA [$6B],Y ; Lower tile: DATA_0DBA48+X W $0D:BB45 STA [$6B],Y ; Top right tile: page 1 tile $162 W $0D:BB57 STA [$6B],Y ; Middle right tile: page 1 tile $164 W $0D:C268 STA [$6B],Y ; Page 0; write the conveyor end tile (DATA_0DC257+X) W $0D:C2FC STA [$6B],Y ; Page 0; tile [DATA_0DC26B+X]: skipped if it is the blank tile $25 W $0D:C30D STA [$6B],Y ; Page 0; ninth tile of the row is always written W $0D:C465 STA [$6B],Y ; Select page 1, write Map16 $15B/$15C/$153 [X] W $0D:C4B3 STA [$6B],Y ; Right tile Map16 $15F/$162/$165 [X] W $0D:C5F2 STA [$6B],Y ; Top right tile Map16 $134 W $0D:C604 STA [$6B],Y ; Middle right tile Map16 $09E W $0D:C61D STA [$6B],Y ; Bottom right tile Map16 $134 W $0D:CEA3 STA [$6B],Y ; Place Map16 $076-$079 [X] (page 0) W $0D:CEBB STA [$6B],Y ; Bottom tile Map16 $085 W $0D:CECD STA [$6B],Y ; Place Map16 [$096+X] (page 0) W $0D:CF49 STA [$6B],Y ; Place Map16 $090/$091/$0A2 [X] (page 0) W $0D:CF87 STA [$6B],Y ; Right tile Map16 $08D W $0D:CFC9 STA [$6B],Y ; Place tile [$00] (page 0) W $0D:D009 STA [$6B],Y ; Right tile Map16 $08F W $0D:D04C STA [$6B],Y ; Place tile [$00] (page 0) W $0D:DA5E STA [$6B],Y ; Low byte $FE: Map16 tile $1FE W $0D:DAE8 STA [$6B],Y ; Store the tile low byte W $0D:EC63 STA [$6B],Y ; Write Map16 tile $110 at the position W $0D:ED8B STA [$6B],Y ; Store the tile (vertical object: no advance right) W $0D:EDAF STA [$6B],Y ; Store tile [DATA_0DED95+X] $006C Map16 low-byte pointer (middle) byte (middle byte of $006B) Middle byte of the Map16 low-byte pointer at $006B . Object routines add $10 to the low byte to move down one row and carry into $006C , or increment it to go to the next screen page. Mirrored in $006F .
44 uses in 12 routines (20 read, 23 write, 1 read-modify-write) W $00:BF26 STA $6C ; $6C/$6F = high byte of this screen's Map16 address W $05:86AC STA $6C ; [$6C] = middle byte of the low-byte buffer address R $0D:AFDF LDA $6C ; A = high pointer byte W $0D:AFE3 STA $6C ; [$6C] = [$6F] = [$05] = new page W $0D:DDBE STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte) W $0D:DDD4 STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte) W $0D:DDEA STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte) W $0D:DE05 STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte) W $0D:DE61 STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte) W $0D:DE77 STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte) W $0D:DE8D STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte) W $0D:DEA8 STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte) W $0D:E986 STA $6C ; Next page: [$6C] and [$6F] += 1 W $0D:EF1D STA $6C ; Move pointer down one row (carry into the next screen page) $006D Map16 low-byte pointer bank byte (bank of $006B) Bank of the Map16 low-byte pointer; expected to be $7E. Written when a level object address is found, by Layer 2 builders and by Generate Map16 tile ($7E), and by the credits background loader.
8 uses in 4 routines (8 write) W $00:BF2C STA $6D ; $6D = $7E: $6B-$6D points at the Map16 low byte W $05:86B5 STA $6D ; [$6D] = bank of the low-byte buffer address (expected $7E) W $05:8A34 STA $6D ; [$6D] = bank of the low-byte data W $05:8B10 STA $6D ; [$6D] = bank of the low-byte data W $05:8C02 STA $6D ; [$6D] = bank of the low-byte data W $05:8CF5 STA $6D ; [$6D] = bank of the low-byte data W $05:8DC2 STA $6D ; [$6D] = $7E: bank of the low-byte data $006E Map16 high-byte pointer pointer (24-bit, $006E-$0070), used with [$6E],Y Long pointer to the Map16 high-byte (tile page) buffer for the current screen, bank $7F. Parallel to the low-byte pointer at $006B ; object routines mirror their pointer into it, and a high byte of 1 selects tile page $1xx. 'Generate Map16 tile' also reads page tables with it.
28 uses in 11 routines (9 read, 19 write) W $05:86A7 STA $6E ; [$6E] = same for the Map16 high-byte buffer (table [$0D]) W $05:8A2C STA $6E ; [$6E] = low word of this screen's Map16 high-byte data pointer R $05:8A5E LDA [$6E],Y ; [$00] = Map16 tile number: low byte from [$6B] data, high byte from [$6E] data W $05:8B08 STA $6E ; [$6E] = low word of this screen's Map16 high-byte data pointer R $05:8B3E LDA [$6E],Y ; [$00] = Map16 tile number: low byte from [$6B] data, high byte from [$6E] data W $05:8BFA STA $6E ; [$6E] = low word of this screen's Map16 high-byte data pointer R $05:8C2C LDA [$6E],Y ; [$00] = Map16 tile number: low byte from [$6B] data, high byte from [$6E] data W $05:8CED STA $6E ; [$6E] = low word of this screen's Map16 high-byte data pointer R $05:8D23 LDA [$6E],Y ; [$00] = Map16 tile number: low byte from [$6B] data, high byte from [$6E] data W $05:8D9F STA $6E ; [$6E] = $BD00: low word of the Map16 high-byte data at $7E:BD00 R $05:8DE2 LDA [$6E],Y ; [$00] = Map16 tile number: low byte from [$6B] data, high byte from [$6E] data W $0C:94D2 STX $6E ; [$6E] = $BD00: pointer to the Map16 high bytes ($7E:BD00) W $0D:AA0A STA [$6E],Y ; Set the Map16 high byte at this position to 1 (tile page $1xx) W $0D:AA0F STA [$6E],Y ; Set the Map16 high byte at this position to [A] (0 via StzTo6ePointer0080E7) $006F Map16 high-byte pointer (middle) byte (middle byte of $006E) Middle byte of the pointer at $006E . Always updated together with $006C when an object routine moves down a row or to the next page. Only written, never read directly.
24 uses in 12 routines (23 write, 1 read-modify-write) W $05:86B0 STA $6F ; [$6F] = middle byte of the high-byte buffer address RW $05:86C3 INC $6F ; Yes: [$6C]++ and [$6F]++ (second half of the screen buffer: lower half of horizontal levels, right half of ver W $0D:A6C4 STA $6F ; Restore [$6B]/[$6E] from the saved pointer in [$04] W $0D:A83B STA $6F ; Mirror the new high byte into [$6F] W $0D:B25F STA $6F ; Y += $10: move down one row (carry into the high pointer byte) W $0D:B289 STA $6F ; Y += $10: move down one row W $0D:BB25 STA $6F ; Pointer += $1B0: next screen (carry into the high byte is needed) $0070 Map16 high-byte pointer bank byte (bank of $006E) Bank of the Map16 high-byte pointer; expected to be $7F (the credits code sets $7E). Set when the object address is found; also cleared by one level-start loop that indexes by X.
9 uses in 5 routines (9 write) W $00:BF2F STA $70 ; $70 = $7F: $6E-$70 points at the Map16 high byte (page) table W $05:86B9 STA $70 ; [$70] = bank of the high-byte buffer address (expected $7F) W $05:8A38 STA $70 ; [$70] = bank of the high-byte data W $05:8B14 STA $70 ; [$70] = bank of the high-byte data W $05:8C06 STA $70 ; [$70] = bank of the high-byte data W $05:8CF9 STA $70 ; [$70] = bank of the high-byte data W $05:8DC6 STA $70 ; [$70] = $7E: bank of the high-byte data W $0C:94CD STA $70 ; [$6D] = [$70] = $7E: bank of both arrays $0071 Mario animation state RAM_MarioAnimation state (animation number) Selects what Mario is doing instead of normal control: each value dispatches a special per-frame routine (power-ups, pipes, hurt, death, door entry, scripted walks). 0 = normal handling. Written by whatever starts the event, and cleared back to 0 when it ends.
Values: 0 normal, 1 shrinking (power down), 2 growing (mushroom), 3 cape power up, 5 horizontal pipe, 6 vertical pipe, 8 Yoshi wings exit, 9 dying, $0A scripted walk (level end), $0C castle entrance / cutscene, $0D entering a door.
30 uses in 26 routines (13 read, 17 write) W $00:954F STA RAM_MarioAnimation ; Mario animation [$71] = $0C (castle entrance) W $00:A1FE STA RAM_MarioAnimation ; Mario animation = $0D (probably an unintended, glitchy animation value) W $00:A6C7 STX RAM_MarioAnimation ; Mario animation [$71] = X W $00:A70B STA RAM_MarioAnimation ; Mario animation [$71] = 8 (rise off screen, Yoshi Wings bonus) R $00:C593 LDA RAM_MarioAnimation ; A = [$71]: Mario animation number W $00:C838 STZ RAM_MarioAnimation ; Mario animation = 0 (normal control) W $00:D15A STA RAM_MarioAnimation ; Mario animation [RAM_MarioAnimation] = 0 (none) W $00:EC1A STA RAM_MarioAnimation ; Mario animation = $0D (entering door) W $00:F434 STY RAM_MarioAnimation ; Mario animation = Y W $00:F5FE STA RAM_MarioAnimation ; Mario animation = 1 (power down) W $00:F616 STA RAM_MarioAnimation ; Mario animation = 9 (dying) W $01:C563 STA RAM_MarioAnimation ; Mario animation = 2 (growing) W $01:C563 STA RAM_MarioAnimation ; Mario animation = 2 (growing) W $01:C5B6 STA RAM_MarioAnimation ; Mario animation = 3 (cape transformation) W $01:C5F5 STA RAM_MarioAnimation ; Mario animation = 4 (power-up, flashing) W $01:F3EA STA RAM_MarioAnimation ; Mario animation [$71] = 8 W $01:F6C6 STA RAM_MarioAnimation ; Mario animation [$71] = 8 W $03:AC0F STA RAM_MarioAnimation ; Mario animation [$71] = $0B (disappear/freeze, ending pose) $0072 Mario in-air state RAM_IsFlying state (flag/phase byte) Nonzero while Mario is off the ground, 0 when he is standing. The value is the phase: swimming and jump code set $0B while he rises and $24 while he falls. Climbing a net or vine clears it. Read by pose selection, scrolling, water splashes, Yoshi and many sprite routines.
Values: 0 = on the ground, $0B = rising, $24 = falling.
72 uses in 34 routines (46 read, 26 write) W $00:94F0 STZ RAM_IsFlying ; Mario is not flying W $00:A6B6 STZ RAM_IsFlying ; Mario not in the air: [$72] = 0 W $00:A6E4 STA RAM_IsFlying ; [$72] = $24 (Mario starts in the air, probably falling in) W $00:C739 STZ RAM_IsFlying ; Not flying W $00:C802 STA RAM_IsFlying ; Flying state [$72] = $0B W $00:C8D6 STA RAM_IsFlying ; Mario is in the air state $24 (pretend jumping) while walking in W $00:C8F3 STZ RAM_IsFlying ; Mario is no longer in the air W $00:D263 STZ RAM_IsFlying ; Not flying W $00:D291 STA RAM_IsFlying ; [RAM_IsFlying] = $0C (airborne) W $00:D67D STA RAM_IsFlying ; [RAM_IsFlying] = A: Mario is in the air R $00:D77F ORA RAM_IsFlying ; Level ending or in the air: use the normal deceleration table W $00:D818 STA RAM_IsFlying ; [RAM_IsFlying] = $0B: rising W $00:D9A6 STA RAM_IsFlying ; [RAM_IsFlying] = $0B: Mario is rising W $00:D9FF STA RAM_IsFlying ; [RAM_IsFlying] = $0B: Mario is rising W $00:DB17 STZ RAM_IsFlying ; Entry (from CODE_00CD76): Mario is climbing a net or vine. Not flying W $00:DB9E STA RAM_IsFlying ; [RAM_IsFlying] = $0B: air flag set (jumping off) W $00:EA9D STA RAM_IsFlying ; [RAM_IsFlying] = $0B (in the air) W $00:EB6D STA RAM_IsFlying ; In-air flag [RAM_IsFlying] = $24 (falling) R $00:ED18 LDY RAM_IsFlying ; Y = in-air flag R $00:ED28 LDY RAM_IsFlying ; Y = in-air flag W $00:EE37 STA RAM_IsFlying ; In-air flag [RAM_IsFlying] = $24 (falling) W $00:EF6B STZ RAM_IsFlying ; Not in the air R $00:F85A LDX RAM_IsFlying ; Swimming: allow scroll up unless in the air ([$72]) then go to $00F869 R $00:F962 LDA RAM_IsFlying ; Mario in the air? R $00:FDA5 LDA RAM_IsFlying ; A = [$72] (Mario in air) R $00:FDF8 LDY RAM_IsFlying ; Y = Mario in air R $01:A8C5 LDA RAM_IsFlying ; On ground: A = Mario flying/cape flag W $01:AAD3 STZ RAM_IsFlying ; Mario flying flag = 0 R $01:D290 LDA RAM_IsFlying ; Mario flying/in air? R $01:D2D4 LDA RAM_IsFlying ; Mario in the air? ([$72]) W $01:E67A STZ RAM_IsFlying ; Mario not flying W $01:E6A0 STA RAM_IsFlying ; Jump pressed: Mario flying state [$72] = $0B W $01:E87E STZ RAM_IsFlying ; Mario not flying W $02:CFC7 STZ RAM_IsFlying ; Mario not flying R $02:D4D3 LDA RAM_IsFlying ; A = Mario in-air flag W $02:EE75 STZ RAM_IsFlying ; Mario not flying $0073 Mario ducking flag RAM_IsDucking flag byte Nonzero while Mario is ducking. Reset to 0 every frame he is on the ground, swimming or doing cape flight, then set when Down is held. Read by collision (hitbox), Yoshi checks and the bubble/smoke spawn routines.
Values: 0 = not ducking.
21 uses in 15 routines (15 read, 5 write, 1 read-modify-write) W $00:CF1E STZ RAM_IsDucking ; Not ducking W $00:D5F9 STZ RAM_IsDucking ; Not ducking (reset every frame on the ground) W $00:D606 STA RAM_IsDucking ; Down held: [RAM_IsDucking] = 4 (non-zero, ducking) W $00:D814 STZ RAM_IsDucking ; Not ducking W $00:D98B STZ RAM_IsDucking ; Not ducking RW $00:DA3C INC RAM_IsDucking ; Ducking = 1 (water) R $00:EAFC ORA RAM_IsDucking ; A = [RAM_IsFlying] | [$148F] | [RAM_IsDucking] | [RAM_OnYoshi] R $00:EB7D LDA RAM_IsDucking ; A = ducking flag R $00:F043 ORA RAM_IsDucking ; A = [$148F] | [RAM_IsDucking] R $00:FD43 LDY RAM_IsDucking ; Y = ducking flag R $02:D4A2 LDY RAM_IsDucking ; Y = ducking flag $0074 Mario climbing flag RAM_IsClimbing flag byte Nonzero while Mario is climbing a net or vine. Set by copying $008B when he grabs the climbable tile, cleared by block collision. Read by the scrolling and the carried-sprite pose code.
11 uses in 7 routines (8 read, 3 write) W $00:CD74 STA RAM_IsClimbing ; Start climbing: [$74] = [$8B] R $00:DBAE LDA RAM_IsClimbing ; A = [RAM_IsClimbing] W $00:DC00 STZ RAM_IsClimbing ; Mario is not climbing R $00:DC0B LDA RAM_IsClimbing ; A = [RAM_IsClimbing] W $00:EF6D STZ RAM_IsClimbing ; Not climbing R $00:F83A ORA RAM_IsClimbing ; OR climbing flag R $01:A0D0 ORA RAM_IsClimbing ; Turning or climbing: Y = 5 (centered) $0075 Mario swimming flag RAM_IsSwimming flag byte Set to 1 by level collision when Mario is in water, so the physics code uses swimming speeds. Read by the climbing tables, cape update and the screen scroll routine.
Values: 0 = not in water, 1 = swimming.
10 uses in 6 routines (8 read, 2 write) R $00:CF0E LDY RAM_IsSwimming ; A = timer R $00:DB96 LDY RAM_IsSwimming ; Y = [RAM_IsSwimming] (swimming flag) R $00:DBEA ORA RAM_IsSwimming ; X = direction * 2 | swimming flag W $00:EA60 STA RAM_IsSwimming ; [RAM_IsSwimming] = 1 W $00:EAA3 STZ RAM_IsSwimming ; [RAM_IsSwimming] = 0 $0076 Mario facing direction RAM_MarioDirection byte (0 or 1) Which way Mario faces. Set when he turns on the ground, by cutscenes and by Yoshi code; read for his acceleration, drawing and fireball direction. Used as a table index (X = facing).
Values: 0 = left, 1 = right.
56 uses in 36 routines (31 read, 25 write) W $00:94EE STZ RAM_MarioDirection ; Mario faces right W $00:A6B8 STY RAM_MarioDirection ; Mario faces right: [$76] = 1 W $00:A6E0 STY RAM_MarioDirection ; Mario faces right: [$76] = 1 W $00:A71C STY RAM_MarioDirection ; Mario faces right: [$76] = 1 W $00:A74E STA RAM_MarioDirection ; Mario direction [$76] = A W $00:C97C STA RAM_MarioDirection ; Mario faces right W $00:CF3D STA RAM_MarioDirection ; Mario direction = DATA_00CEA1[X] (spin makes Mario face left/right in turn) W $00:D022 STA RAM_MarioDirection ; Mario direction = [RAM_WallWalkStatus] & 1 W $00:D0A8 STY RAM_MarioDirection ; Mario direction = Y (fireballs alternate left and right) W $00:D11A STA RAM_MarioDirection ; Mario direction = bit 2 of frame counter (flips every 4 frames) R $00:D212 LDY RAM_MarioDirection ; Y = Mario direction R $00:D6C3 LDX RAM_MarioDirection ; X = facing direction R $00:D6D5 LDY RAM_MarioDirection ; Y = facing direction W $00:D6EA STA RAM_MarioDirection ; Face the held direction R $00:D9E7 LDA RAM_MarioDirection ; A = facing direction W $00:DA4C STA RAM_MarioDirection ; Facing direction = right bit W $00:DB76 STA RAM_MarioDirection ; Mario direction = A W $00:DBC3 STA RAM_MarioDirection ; Mario direction = A (facing depends on net column) R $00:E3CD LDX RAM_MarioDirection ; X = direction R $00:E435 ORA RAM_MarioDirection ; A |= direction R $00:EC4E LDA RAM_MarioDirection ; A = Mario facing direction [RAM_MarioDirection] R $00:F00F CMP RAM_MarioDirection ; Same as Mario's facing direction? W $00:F417 STA RAM_MarioDirection ; Mario faces right if the pressed button was Right R $00:FD2B LDY RAM_MarioDirection ; Y = Mario direction R $00:FEC9 LDY RAM_MarioDirection ; Y = Mario direction R $01:A047 LDY RAM_MarioDirection ; Y = Mario direction (0 left, 1 right) W $01:B145 STY RAM_MarioDirection ; Mario direction = Y W $01:EB95 STA RAM_MarioDirection ; Mario direction = opposite of Yoshi's sprite direction (EOR 1) W $01:EE76 STA RAM_MarioDirection ; Mario direction = Yoshi direction (before the flip) W $03:ADC9 STA RAM_MarioDirection ; Mario faces Peach W $03:AE0D STA RAM_MarioDirection ; Peach and Mario face direction Y W $03:AE1B STA RAM_MarioDirection ; Peach and Mario face each other W $0C:A086 STZ RAM_MarioDirection ; Mario faces right W $0C:A3D1 STZ RAM_MarioDirection ; Mario direction = 0 (facing left) $0077 Mario blocked status RAM_MarioObjStatus bit flags Which sides of Mario are against solid tiles or the screen edge, rebuilt each frame by block collision (set with TSB) and by sprites that carry him (platforms, rafts). Read by walking, pose and platform code.
Bits: Bit 0: blocked right. Bit 1: blocked left. Bit 2: blocked below (on ground). Bit 3: blocked above.
Bit 7: touching the left/right screen edge.
21 uses in 8 routines (14 read, 2 write, 5 read-modify-write) RW $00:E9D5 TSB RAM_MarioObjStatus ; [$77] |= $80: Mario is touching the edge of the screen RW $00:E9F9 TSB RAM_MarioObjStatus ; [$77] |= [DATA_00E90A+Y]: blocked on the right ($01) or left ($02) W $00:EAA9 STZ RAM_MarioObjStatus ; Blocked status [$77] = 0 RW $00:EC7E TSB RAM_MarioObjStatus ; Set the blocked bits in [RAM_MarioObjStatus] RW $00:ED39 TSB RAM_MarioObjStatus ; Set bit 3 (blocked above) in [RAM_MarioObjStatus] RW $00:EF77 TSB RAM_MarioObjStatus ; Set bit 2 (on ground) in [RAM_MarioObjStatus] $0078 Mario tile hide mask byte (bit mask) Mask applied to Mario's drawn tiles. 0 draws everything. Pipe and power-up animations set it to $7F (or a computed value) to hide Mario, and the OAM drawing sets individual bits when it builds his tiles. Platform and chain code store $FF in it, probably to cancel a remaining jump/bonk state (unclear).
10 uses in 7 routines (2 read, 6 write, 2 read-modify-write) W $00:D161 STA $78 ; [$78] = $7F: hide Mario (smoke puff) W $00:D1F0 STA $78 ; [$78] = A (hide Mario for the pipe) W $00:D249 STA $78 ; [$78] = $7F: hide Mario RW $00:E441 TSB $78 ; Set bits in tile mask [$78] W $01:CA77 STA $78 ; B not pressed: [$78] = $FF (probably cancels Mario's remaining jump/bonk state) $007A Mario X speed fraction byte (sub-pixel part of the X speed) Fractional part of Mario's horizontal speed; with $007B it forms the 16-bit speed used by 'Mario X speed on ground' (acceleration is added to the 16-bit value). Cleared to 0 when climbing.
8 uses in 2 routines (3 read, 5 write) R $00:D760 ADC $7A ; Mario X speed (16-bit [$7A]) += acceleration R $00:D790 ADC $7A ; Mario X speed ([$7A]) += deceleration W $00:D7A0 STA $7A ; Store the new X speed W $00:DB40 STZ $7A ; X speed fraction ([$7A]) = 0 R $00:DB5E ADC $7A ; A += [$7A] (X speed with fraction) W $00:DB60 STA $7A ; Store back to [$7A]/[$7B] W $00:DB7F STZ $7A ; X speed fraction = 0 $007B Mario X speed RAM_MarioSpeedX byte (signed, pixels per frame in 1/16) Mario's horizontal speed, signed (negative = left). Written by walking physics, collision (stop at walls), pipes, scripted animations, springboards and bosses; added to his X position each frame. Also set to the scroll speed when he is carried along with the screen, and by Yoshi kick-off ($10/-$10).
87 uses in 53 routines (40 read, 47 write) W $00:C72E STY RAM_MarioSpeedX ; Mario X speed = Y W $00:C7D8 STA RAM_MarioSpeedX ; Mario X speed = $D8 R $00:C81F ADC RAM_MarioSpeedX ; X speed += A: decay toward 0 W $00:C825 STZ RAM_MarioSpeedX ; Unreachable: X speed = 0 W $00:C982 STA RAM_MarioSpeedX ; Mario X speed = 5 W $00:CCD8 STZ RAM_MarioSpeedX ; Mario X speed = 0 W $00:D10C STZ RAM_MarioSpeedX ; Mario X speed = 0 W $00:D25C STA RAM_MarioSpeedX ; Mario X speed = PipeSpeedX[Y] W $00:D2B4 STA RAM_MarioSpeedX ; Mario X speed = $40 R $00:D8BB LDA RAM_MarioSpeedX ; X = facing, A = X speed W $00:DB3E STA RAM_MarioSpeedX ; Mario X speed = A W $00:DB7D STZ RAM_MarioSpeedX ; Not punching: X speed = 0 W $00:DBF0 STA RAM_MarioSpeedX ; X speed = DATA_00DAB7[X] ($10,$08,$F0,$F8) W $00:DC0F STZ RAM_MarioSpeedX ; Vine: X speed = 0 R $00:DC16 ORA RAM_MarioSpeedX ; A = Y speed | X speed (also true when no key pressed) R $00:DC37 LDA RAM_MarioSpeedX ; A = Mario X speed R $00:DC4F LDA RAM_MarioSpeedX,X ; A = speed byte ([$7B] or [$7D]) R $00:DC5F LDA RAM_MarioSpeedX,X ; A = speed (16-bit read) W $00:E9EE STA RAM_MarioSpeedX ; Mario X speed = scroll speed (carried along with the screen) W $00:EA32 STZ RAM_MarioSpeedX ; Mario X speed = 0 W $00:EB4B STA RAM_MarioSpeedX ; Mario X speed = A W $00:ED24 STZ RAM_MarioSpeedX ; Mario X speed = 0 R $00:EEEB LDX RAM_MarioSpeedX ; X = Mario X speed R $00:EF0F LDA RAM_MarioSpeedX ; A = Mario X speed R $00:EF18 EOR RAM_MarioSpeedX ; Direction EOR X speed R $00:F035 LDA RAM_MarioSpeedX ; A = Mario X speed W $00:FDFC STZ RAM_MarioSpeedX ; Mario X speed = 0 (airborne entry stops horizontal motion) R $01:A060 ADC RAM_MarioSpeedX ; Sprite X speed = Mario X speed +/- 4 R $01:A095 EOR RAM_MarioSpeedX ; Compare sign of kick speed and Mario X speed W $01:A95A STA RAM_MarioSpeedX ; Mario X speed = pushed away from the sprite W $01:AB31 STZ RAM_MarioSpeedX ; Mario X speed = 0 W $01:B532 STZ RAM_MarioSpeedX ; Mario X speed = 0 W $01:B8FC STZ RAM_MarioSpeedX ; Mario X speed = 0 W $01:CE3E STZ RAM_MarioSpeedX ; Mario X speed = 0 W $01:D316 STY RAM_MarioSpeedX ; Mario X speed = push W $01:D34A STY RAM_MarioSpeedX ; Mario X speed = Y W $01:E67C STZ RAM_MarioSpeedX ; Mario X speed = 0 W $01:EDBD STA RAM_MarioSpeedX ; Mario X speed = DATA_01EBC0[Y] (+$10 or -$10 kick-off) W $01:F72D STZ RAM_MarioSpeedX ; Mario X speed = 0 W $02:9109 STA RAM_MarioSpeedX ; Mario X speed = table value W $02:A494 STZ RAM_MarioSpeedX ; Mario X speed = 0 W $02:C80D STA RAM_MarioSpeedX ; Push Mario away: X speed = $20 or $E0 W $02:CC68 STY RAM_MarioSpeedX ; Mario X speed = 0 W $02:CC7D STY RAM_MarioSpeedX ; Mario X speed = 0 W $02:CFEB STZ RAM_MarioSpeedX ; Mario X speed = 0 W $02:D281 STA RAM_MarioSpeedX ; Mario X speed = sprite X speed W $02:D4ED STA RAM_MarioSpeedX ; Mario X speed = +/-8 W $02:D969 STZ RAM_MarioSpeedX ; Mario touched the bubble: clear Mario's Y and X speed W $02:EAE0 STZ RAM_MarioSpeedX ; Mario X speed = 0 W $03:94AE STZ RAM_MarioSpeedX ; Mario X speed = 0 W $03:9A73 STA RAM_MarioSpeedX ; Mario X speed = ReboundSpeedX[Y]: push him away from the platform W $03:AD1A STZ RAM_MarioSpeedX ; Mario X speed = 0 (Mario cannot walk away) W $03:AE07 STA RAM_MarioSpeedX ; Mario X speed = -(Peach X speed) W $03:B0B6 STA RAM_MarioSpeedX ; Mario X speed = shove R $03:C336 LDY RAM_MarioSpeedX ; Y = Mario X speed W $04:85BD STA.W RAM_MarioSpeedX ; Mario X speed = 8 (probably sets the walk animation rate) W $0C:9FFE STA.W RAM_MarioSpeedX ; Mario X speed = 8 (walking right) W $0C:A267 STA.W RAM_MarioSpeedX ; Mario X speed = 8 (animates the walk cycle) $007D Mario Y speed RAM_MarioSpeedY byte (signed, pixels per frame in 1/16) Mario's vertical speed, signed (negative = up). Set to jump and bounce values (e.g. $B0/$80 springboard, $D0 balloon bounce, $90 at level start), zeroed on landing, in water entry and climbing, and pressed to $10 while standing on a sprite. Gravity is added each frame in the Mario Y speed routine.
128 uses in 55 routines (59 read, 69 write) W $00:986A STZ RAM_MarioSpeedY ; Mario Y speed = 0 W $00:A713 STA RAM_MarioSpeedY ; Mario Y speed = $90 (upward) W $00:A76A STY RAM_MarioSpeedY ; Mario Y speed [$7D] = Y W $00:C730 STX RAM_MarioSpeedY ; Mario Y speed = X W $00:CD2E STZ RAM_MarioSpeedY ; Yes: Y speed = 0 W $00:D261 STA RAM_MarioSpeedY ; Mario Y speed = PipeSpeedY[Y] W $00:D2B8 STA RAM_MarioSpeedY ; Mario Y speed = $C0 (up) W $00:D666 STA RAM_MarioSpeedY ; Mario Y speed = jump height table [X]: faster = higher jump R $00:D993 LDY RAM_MarioSpeedY ; Y = Mario Y speed W $00:D9DD STA RAM_MarioSpeedY ; Store Mario Y speed W $00:DA2D STA RAM_MarioSpeedY ; Store Mario Y speed W $00:DB19 STZ RAM_MarioSpeedY ; Y speed = 0 W $00:DBA3 STA RAM_MarioSpeedY ; Mario Y speed = DATA_00DABB[Y] (jump: $B0 land, $F0 water) W $00:DC14 STA RAM_MarioSpeedY ; Mario Y speed = DATA_00DAB7[Y] W $00:DC3E STA RAM_MarioSpeedY ; Wall run: Mario Y speed = +/- X speed W $00:DC4C STA RAM_MarioSpeedY ; Restore Mario Y speed W $00:EA5C STZ RAM_MarioSpeedY ; Mario Y speed = 0 on entering the water W $00:EA73 STA RAM_MarioSpeedY ; Mario Y speed = max([Y speed], -4): limit upward speed at the surface W $00:EAA1 STA RAM_MarioSpeedY ; Mario Y speed = $AA (-86): jump out of the water W $00:EB71 STA RAM_MarioSpeedY ; Mario Y speed = $E0 (small hop off the wall) R $00:EC94 LDY RAM_MarioSpeedY ; Y = Mario Y speed R $00:ED3B LDA RAM_MarioSpeedY ; A = Mario Y speed W $00:ED3F STZ RAM_MarioSpeedY ; Y speed = 0 (bonk the ceiling) R $00:EDF7 LDA RAM_MarioSpeedY ; A = Mario Y speed R $00:EE22 LDA RAM_MarioSpeedY ; A = Mario Y speed R $00:EF31 LDA RAM_MarioSpeedY ; A = Mario Y speed W $00:EF60 STA RAM_MarioSpeedY ; Mario Y speed = A W $00:F02B STA RAM_MarioSpeedY ; Mario Y speed = $80 W $00:F608 STA RAM_MarioSpeedY ; Mario Y speed = $90 (jump up) R $00:F903 LDY RAM_MarioSpeedY ; Y = Mario Y speed W $00:F917 STZ RAM_MarioSpeedY ; Mario Y speed = 0 R $00:F950 LDA RAM_MarioSpeedY ; A = Mario Y speed R $00:FDF2 LDA RAM_MarioSpeedY ; A = Mario Y speed W $00:FDF6 STZ RAM_MarioSpeedY ; Mario Y speed = 0 R $01:A8B0 LDA RAM_MarioSpeedY ; A = Mario Y speed W $01:A92A STA RAM_MarioSpeedY ; Mario Y speed = -8 W $01:AA3F STA RAM_MarioSpeedY ; Mario Y speed = bounce speed R $01:AA4A LDA RAM_MarioSpeedY ; A = Mario Y speed W $01:AACA STA RAM_MarioSpeedY ; Mario Y speed = 16 (bump head) R $01:AACD LDA RAM_MarioSpeedY ; A = Mario Y speed W $01:AAD1 STZ RAM_MarioSpeedY ; Mario Y speed = 0 W $01:B478 STA RAM_MarioSpeedY ; Mario Y speed = $10: keep him pressed onto the sprite W $01:B4DA STA RAM_MarioSpeedY ; Mario Y speed = $10: bumped back down R $01:B877 LDA RAM_MarioSpeedY ; Mario Y speed W $01:B87B STZ RAM_MarioSpeedY ; Mario Y speed = 0: standing on the sprite R $01:B8CC LDA RAM_MarioSpeedY ; Mario Y speed W $01:B8D2 STA RAM_MarioSpeedY ; Moving up into the underside: bounce down, Y speed = $10 W $01:C2BE STA RAM_MarioSpeedY ; Mario Y speed = $D0 (bounce off it) W $01:CA32 STZ RAM_MarioSpeedY ; Mario Y speed = 0 R $01:D2F2 LDA RAM_MarioSpeedY ; Mario Y speed W $01:D2FB STA RAM_MarioSpeedY ; Mario Y speed = $D0 (bounce up) R $01:D323 LDA RAM_MarioSpeedY ; Mario Y speed W $01:D329 STA RAM_MarioSpeedY ; Moving up: bonk Mario down, Y speed = $10 W $01:D331 STA RAM_MarioSpeedY ; Mario Y speed = $D0 (bounce up) R $01:D339 LDA RAM_MarioSpeedY ; Mario Y speed W $01:D33F STA RAM_MarioSpeedY ; Moving up: Mario Y speed = $20 (pushed down) W $01:D34E STA RAM_MarioSpeedY ; Mario Y speed = $B0 (bounce up) W $01:DA35 STA RAM_MarioSpeedY ; B pressed: Mario Y speed = $B0 (jump off the rope) W $01:DE75 STA RAM_MarioSpeedY ; Mario Y speed = $10: bounce him back down R $01:E5D7 LDA RAM_MarioSpeedY ; A = Mario Y speed W $01:E6A7 STY RAM_MarioSpeedY ; Mario Y speed = Y ($B0 or $80) R $01:E6C6 LDA RAM_MarioSpeedY ; Mario below the board: A = Mario Y speed W $01:E6CA STZ RAM_MarioSpeedY ; Moving up: Y speed = 0 (bump head) R $01:E6E7 LDA RAM_MarioSpeedY ; A = Mario Y speed R $01:E80E LDA RAM_MarioSpeedY ; A = Mario Y speed W $01:E88E STA RAM_MarioSpeedY ; Mario Y speed = $C0: jump off the cloud W $01:ED4F STZ RAM_MarioSpeedY ; Mario speed = 0 W $01:EDC1 STA RAM_MarioSpeedY ; Mario Y speed = A (jump away) W $01:F72B STA RAM_MarioSpeedY ; Mario Y speed = $C0 (jump up) W $02:8775 STA RAM_MarioSpeedY ; Mario Y speed = $D0 (upward): bounces off the broken block W $02:9100 STA RAM_MarioSpeedY ; Mario Y speed = table value W $02:915C STZ RAM_MarioSpeedY ; Mario Y speed = 0 W $02:916E STA RAM_MarioSpeedY ; Mario Y speed = $A0 (launched upward) W $02:A492 STA RAM_MarioSpeedY ; Mario Y speed = $C0 (jumps up) W $02:CC8F STY RAM_MarioSpeedY ; Hit the ceiling: Mario Y speed = 0 W $02:CCA4 STY RAM_MarioSpeedY ; Mario Y speed = 0 W $02:CDEA STA RAM_MarioSpeedY ; Mario Y speed = bounce speed (extra high jump) W $02:CFE8 STA RAM_MarioSpeedY ; Mario Y speed = bounce speed W $02:D285 STA RAM_MarioSpeedY ; Mario Y speed = sprite Y speed W $02:D4DC STZ RAM_MarioSpeedY ; Mario Y speed = 0 W $02:D4E2 STA RAM_MarioSpeedY ; Mario Y speed = sprite Y speed (pushed down) W $03:87F4 STZ RAM_MarioSpeedY ; Mario Y speed = 0 W $03:8CCA STZ RAM_MarioSpeedY ; Mario Y speed = 0 R $03:9A54 LDA RAM_MarioSpeedY ; A = Mario Y speed W $03:9A64 STA RAM_MarioSpeedY ; Mario Y speed = $10: knocked down off the platform W $03:B0A1 STZ RAM_MarioSpeedY ; Mario Y speed = 0 $007E Mario X on screen byte Mario's X position relative to the screen (his X position minus the layer 1 scroll), computed in the Mario drawing routine. Sprites and screen-collision code compare against it (e.g. Peach, Wiggler, Layer 3 smash). The high byte-like flag is $007F .
13 uses in 11 routines (12 read, 1 write) W $00:E344 STA $7E ; [$7E] = Mario X position - screen X (X on screen) R $00:E487 LDA $7E ; A = [$7E] (Mario X screen position) R $01:B8E3 CMP $7E ; Sprite X on screen >= [$7E] (Mario's X on screen)? R $02:D4BA LDA $7E ; A = Mario X position on screen [$7E] $007F Mario off-screen flag (horizontal) byte (nonzero = off screen) High byte of Mario's X on-screen position ($007E is the low byte); nonzero when he is off the screen horizontally. ORed with $0081 by the bubble/smoke spawners, cape and misc sprite handlers to refuse spawning effects when Mario is off screen. Read only (written by the Mario OAM drawing code).
5 uses in 5 routines (5 read) R $01:C5B0 ORA $7F ; Mario X or Y position high byte non-zero? R $02:8AF5 ORA $7F ; OR Mario offscreen flag [$7F] $0080 Mario Y on screen byte Mario's Y position relative to the screen, computed in the Mario drawing routine. Read by sprite contact checks (standing on a sprite, Wiggler, Layer 3 smash, bonus block) and by the Mode 7 boss platform code. Partner of $007E ; the high byte is $0081 .
19 uses in 16 routines (18 read, 1 write) R $00:C82F LDA $80 ; A = [$80] (Mario Y relative to the screen) W $00:E369 STA $80 ; [$80] = Mario Y on screen R $00:E46F LDA $80 ; A = [$80] (Mario Y screen position) R $01:B4CE ADC $80 ; Compare Mario's head ([$80] + A) with the sprite top ([$00]) R $01:DE6F CMP $80 ; Compare block Y (on screen) + offset with Mario's screen Y [$80] R $02:8AFB LDA $80 ; Mario screen Y [$80] R $02:D4AB CMP $80 ; Compared with Mario's Y position on screen [$80] $0081 Mario off-screen flag (vertical) byte (nonzero = off screen) High byte of Mario's Y on-screen position ($0080 is the low byte); nonzero when he is vertically off screen. Tested together with $007F before spawning bubbles and smoke, giving Mario a cape, and similar effects. Mostly read; the disassembly shows data-table false hits for this address in sprite pointer tables.
7 uses in 7 routines (7 read) $0082 Slope shape table pointer pointer (24-bit, $0082-$0084), used with [$82],Y Long pointer to the Map16 slope-shape table. The Map16 pointer setup stores $E55E in it (bank in $0084 is 0, so it points at $00:E55E). The Mario block collision reads [$82 ],Y to get the slope shape of a tile.
5 uses in 3 routines (3 read, 2 write) R $00:ED9A LDA [$82],Y ; A = slope shape from the table at [$82] R $00:FA29 LDA [$82],Y ; A = [[$82] + Y] W $05:8219 STA $82 ; [$82] = $E55E (pointer into bank $05 data, purpose unclear) W $05:828E STA $82 ; [$82] = $E5C8 (alternate pointer for tilesets 0 and 7) $0084 Slope shape table pointer bank byte (bank of pointer at $0082) Bank byte of the pointer at $0082 . Set to 0 by the Map16 pointer setup. The 26 'reads' in bank $01 are misdecoded pointer table data, not real accesses.
1 use in 1 routine (1 write) W $05:8208 STA $84 ; [$84] = 0 (purpose unclear) $0085 Water level flag RAM_IsWaterLevel flag byte Nonzero when the current level is a water level. Set once at level start; read by the Mario collision (which turns on swimming), the physics code (BIT tests it) and sprites that behave differently in water. Most of the 104 listed uses are misdecoded pointer-table data, not real reads.
Values: 0 = not water, 1 = water level.
5 uses in 5 routines (4 read, 1 write) W $00:A734 STY RAM_IsWaterLevel ; Water level flag [$85] = 1 $0086 Slippery level flag flag byte Nonzero on a slippery (ice) level, 0 otherwise. Mario's ground physics and walk animation take a different path when it is set, and skid smoke is only spawned when it is 0. Bit 7 is set at level start by ROR when tileset-related value $192A is 5. Read by the Mario ground speed, jump start and shelless Koopa routines.
Values: 0 = normal ground; nonzero = slippery.
8 uses in 6 routines (7 read, 1 read-modify-write) RW $00:A6DE ROR $86 ; Carry is set here, so bit 7 of [$86] is set (probably the slippery/ice flag) R $01:8057 ORA $86 ; Return unless [frame counter] & 3 = 0 and [$86] (slippery level flag) = 0 $0088 Mario animation timer timer / scratch byte Per-animation countdown or index for Mario's scripted animations. Pipe entry/exit (animations 5, 6, 7) set it to the pipe timer and count it down by one per frame; the scripted walk (A) uses it as the offset into the input script; the cutscene movement (C) uses it as the frames left for the current command. Level start sets it to the Mario Start! timer. Set by the pipe-entry collision code ($F40A) and read by the Mario animation routines. Also hit by pointer tables.
16 uses in 7 routines (7 read, 6 write, 3 read-modify-write) W $00:A6C9 STY $88 ; Animation timer [$88] = Y R $00:C749 LDA $88 ; A = [$88]: frames left for the current command W $00:C756 STA $88 ; [$88] = duration of the next command RW $00:C7F6 DEC $88 ; Frames left for this command - 1 R $00:C88D LDX $88 ; X = [$88]: current offset into the input script W $00:C8A1 STX $88 ; Next script step: [$88] += 2 RW $00:D241 DEC $88 ; Pipe timer [$88] -= 1 W $00:F40A STA $88 ; [$88] = pipe entry timer $0089 Mario animation scratch byte, scratch Second per-animation byte next to $0088 . Pipe entry stores the pipe direction index here and the pipe animations read it; the scripted walk (animation A) counts the frames remaining in the current script step down in it; level start sets it to 1.
8 uses in 5 routines (3 read, 4 write, 1 read-modify-write) RW $00:C89B DEC $89 ; Frames remaining in this script step: [$89]-- W $00:C8A6 STA $89 ; [$89] = frame count of the new step W $00:F419 STX $89 ; [$89] = pipe direction index $008A General scratch / pointer low scratch (word with $008B, 24-bit pointer with $008C) Reused by many unrelated routines. As a 24-bit source pointer $008A /$008B /$008C it is the stream read by the GFX decompression and ending palette code (byte read through it, bank in $008C ). Also a menu checksum sum, file select value, a pass counter for overworld tile edits, and the saved Mario Y speed while climbing. In Mario collision it is the water contact bits (cleared at the start); bit 0 is set for touching certain tiles.
37 uses in 15 routines (14 read, 17 write, 6 read-modify-write) R $00:9B0A LDA $8A ; Negative: wrap to the last entry, [$8A] - 1 R $00:9B0D CMP $8A ; New position < [$8A] (number of entries)? W $00:9BDC STY $8A ; Checksum sum [$8A] = 0 R $00:9BE6 ADC $8A ; [$8A] += A (16-bit running sum) R $00:9BFB SBC $8A ; A = $5A5A - sum: the checksum word R $00:9DD6 ADC $8A ; [$8A] += A (16-bit, carry below) R $00:9DE6 LDA $8A ; A = checksum + sum of data W $00:B8DA STA $8A ; $8A = $8000: next stream is at $08:8000 (bank in $8C unchanged) R $00:B983 LDA [$8A] ; A = byte at the 24-bit source pointer [$8A] W $00:B98F STX $8A ; Store the advanced pointer W $00:DC2F STA $8A ; Save Mario Y speed in [$8A] W $00:EAB1 STZ $8A ; [$8A] = 0 (water contact bits) RW $00:EBC5 TSB $8A ; Set bit 0 of [$8A] (tile contact flags, probably 'touching a wall-run slope') RW $00:F2C6 TSB $8A ; Tiles $00-$05: set bit 0 of [$8A] W $04:89D0 STA $8A ; [$8A] = [$06]: back to the left edge R $04:8D27 ADC $8A ; OAM X = [DATA_048B5E+Y] + [$8A] W $04:EB46 STY $8A ; [$8A] = pass counter $008B General scratch / tile flags scratch / bit flags Reused scratch. As the middle byte of the pointer $008A /$008B /$008C it is the high byte of the GFX decompression source. In Mario's climbing code it holds the climbable-tile contact flags: Mario animation 0 sets it to $1F when touching all climbable tiles, the climb routine reads it, and level collision clears it. The overworld border icon drawer uses it as a Y offset (walking poses are drawn 5 pixels higher).
23 uses in 10 routines (11 read, 8 write, 4 read-modify-write) RW $00:9BEC INC $8B ; Add the carry into [$8B] RW $00:9DDC INC $8B ; Add the carry into [$8B] W $00:CD48 STA $8B ; Yes: [$8B] = $1F (touching all climbable tiles) R $00:DBD8 LDA $8B ; A = [$8B] (climb tile flags) RW $00:F302 TSB $8B ; Set the flag bits in [$8B] (probably the climbing / tile-contact flags) W $04:86C1 STA $8B ; Walking poses are drawn 5 pixels higher: [$8B] and [$07] -= 5 W $04:8735 STA $8B ; Walking poses are drawn 5 pixels higher: [$8B] and [$07] -= 5 R $04:8D30 ADC $8B ; OAM Y = [DATA_048C1E+Y] + [$8B] $008C General scratch / bank byte scratch Reused scratch. As the third byte of the pointer $008A /$008B /$008C it is the bank byte of the GFX decompression source, incremented when the pointer wraps past $FFFF. The overworld sprite drawers use it as a tile counter (3 for a 2x2 sprite, 7 for the 8 tiles of Mario riding Yoshi). Block interaction copies Mario's $0093 into it.
12 uses in 8 routines (3 read, 6 write, 3 read-modify-write) RW $00:B98D INC $8C ; Pointer wrapped past $FFFF: restart at $8000 of the next bank W $04:869A STA $8C ; [$8C] = 3: tile counter for a 2x2 sprite W $04:86FB STA $8C ; [$8C] = 3: tile counter for a 2x2 sprite W $04:8CE8 STA $8C ; [$8C] = 7: tile counter for 8 tiles (rider + Yoshi) $008D General scratch / loop counter scratch Reused scratch. The ending palette and GFX decompression code counts it down by 2 per step as a loop counter; level collision stores a saved copy of the tile-contact flag ([$13EF ]) in it, which the block and slope collision then reads.
17 uses in 3 routines (5 read, 6 write, 6 read-modify-write) W $00:B8C9 STA [$8D] ; Store it at [$8D] RW $00:B97A DEC $8D ; $8D-- (count, 16-bit) W $00:E93B STA $8D ; [$8D] = [$13EF] (saved copy of the tile-contact flag) RW $00:E987 ASL $8D ; [$8D] <<= 1 (same shift for the saved copy) $008E Scratch: layer 2 orientation bits scratch Reused scratch. Mario level collision stores [$5B ] & $82 here (the level orientation bits for layer 2); the block and slope collision clears it to 0; the pipe-entry lookup and the Mode 7 boss room platform check also use it.
6 uses in 4 routines (2 read, 4 write) W $00:E94A STA $8E ; [$8E] = [$5B] & $82 (level orientation bits for layer 2) W $00:E97F STA $8E ; [$8E] = [$5B] & $41 (level orientation bits for layer 1) $008F Scratch: was-in-air flag scratch Reused scratch. Level collision backs up the in-air flag RAM_IsFlying here before it is changed, so the block and slope collision and the cape ground pound on landing can tell whether Mario was in the air. The ending decompression stores the current command byte here, and the cutscene movement code uses it as the script position (+2 per command).
14 uses in 6 routines (9 read, 3 write, 2 read-modify-write) W $00:B8ED STA $8F ; Remember the command byte in [$8F] RW $00:C74F INC $8F ; Script position += 2 W $00:E942 STA $8F ; [$8F] = [RAM_IsFlying] (backup of the in-air flag) R $00:EE63 LDX $8F ; X = [$8F] (air flag) R $00:EF83 LDA $8F ; A = [$8F] (was in the air) R $00:EFAE LDA $8F ; A = [$8F] (was in the air) $0090 Mario Y offset in block byte (0-15) Y offset of Mario's collision point inside its 16x16 block; the block and slope collision uses it as an index when looking up slope heights. Written and read in Mario's block and slope collision.
10 uses in 1 routine (6 read, 4 write) R $00:EB0A LDX $90 ; X = [$90] (Mario Y offset inside the block) R $00:EBA5 LDA $90 ; A = [$90] (Mario Y offset inside the block) R $00:EDAE LDA $90 ; A = [$90] (Mario Y offset inside the block) R $00:EEDD SBC $90 ; Mario Y position high -= [$90] (with borrow) $0091 Collision point Y offset byte (0-15) Y offset of the collision point inside its block, computed by the block and slope collision as ($90 + table offset) & $0F. Used right afterwards to compare against the slope height.
7 uses in 1 routine (3 read, 4 write) W $00:EBAD STA $91 ; [$91] = Y offset of the collision point inside its block R $00:ED10 ADC $91 ; Add [$91] (head penetration) W $00:EDC2 STA $91 ; [$91] = distance to push Mario up W $00:EE19 STA $91 ; [$91] = Y offset (penetration into the floor) R $00:EED7 SBC $91 ; Mario Y position low -= [$91] $0092 Slope column X offset byte (0-15) Column inside the block used for slope height lookups: (X offset + 8) & $0F, set in Mario's block and slope collision. Also read by the cape ground pound on landing and by the pipe-entry map16 lookup.
5 uses in 3 routines (4 read, 1 write) W $00:EB97 STA $92 ; [$92] = (X offset + 8) & $0F: column used for slope height lookups R $00:ECEC ORA $92 ; Add the X column [$92] R $00:EDA8 ORA $92 ; Add the X column [$92] $0093 Block half flag flag byte 0 when Mario's collision point is in the left half of the 16x16 block, 1 for the right half (set by INC in the block and slope collision). Block interaction reads it and copies it into $008C .
5 uses in 2 routines (3 read, 1 write, 1 read-modify-write) W $00:EB99 STZ $93 ; [$93] = 0: Mario is in the left half of the block RW $00:EBA3 INC $93 ; [$93] = 1: Mario is in the right half of the block R $00:EC50 CMP $93 ; Same as the block side [$93]? R $00:EC64 LDY $93 ; Y = block side [$93] $0094 Mario X position, low byte RAM_MarioXPos word low byte (high is $0095) Mario's X position in pixels within the level; $0094 is the low byte and $0095 the high byte (screen number). It is read by nearly every routine that needs Mario's location and written whenever Mario is moved: layer 2 displacement, platforms and sprites carrying him, pipes, the keyhole, the level start position and wall pushes. Read as a 16-bit word together with $0095 .
135 uses in 69 routines (91 read, 41 write, 3 read-modify-write) W $00:9811 STA RAM_MarioXPos ; Mario X position = $0050 W $00:992C STA RAM_MarioXPos ; Mario X position = $0020 RW $00:A728 TSB RAM_MarioXPos ; Mario X position low |= 8 RW $00:A758 TSB RAM_MarioXPos ; Mario X position low |= 8 RW $00:C7CA TRB RAM_MarioXPos ; Round Mario's X position down to a multiple of 8 W $00:CCF6 STA RAM_MarioXPos ; Mario X position = keyhole X [$1436] W $00:D226 STA RAM_MarioXPos ; Mario X += PipeCntringSpeed[X] R $00:DBBA LDA RAM_MarioXPos ; A = Mario X position low W $00:DC73 STA RAM_MarioXPos,X ; Position [$94,X] += A + carry W $00:E958 STA RAM_MarioXPos ; Mario X += [$26] (layer 2 X displacement) W $00:E96D STA RAM_MarioXPos ; Mario X -= [$26] (undo the displacement) R $00:E9B8 CMP RAM_MarioXPos ; Compare right border ([$1462] + $E8) with Mario X (16-bit) W $00:EA1E STA RAM_MarioXPos ; Mario X += [DATA_00E90D+Y]: push out of the wall by 1 pixel (-1 or +1) R $00:EB52 LDA RAM_MarioXPos ; A = Mario X position W $00:EB58 STA RAM_MarioXPos ; Store Mario X position R $00:EB8D LDA RAM_MarioXPos ; A = Mario X position R $00:EC66 LDA RAM_MarioXPos ; A = Mario X R $00:EF56 ADC RAM_MarioXPos ; Add Mario X position W $00:EF58 STA RAM_MarioXPos ; Store Mario X position (cancel the layer's movement) R $00:EFD5 LDA RAM_MarioXPos ; A = Mario X position W $00:EFDB STA RAM_MarioXPos ; Store Mario X position R $00:F3D1 LDA RAM_MarioXPos ; A = Mario X position R $00:F933 CMP RAM_MarioXPos ; Compare with Mario X R $00:F942 LDA RAM_MarioXPos ; A = Mario X + $0F W $00:F9E4 STA RAM_MarioXPos ; Mario X = result R $00:FF16 ADC RAM_MarioXPos ; Mario X += signed [$17BD] (layer 1 X movement) R $01:AB3B LDA RAM_MarioXPos ; A = Mario X position W $01:AB41 STA RAM_MarioXPos ; Mario X position = pushed out by 1 pixel R $01:B4A7 ADC RAM_MarioXPos ; Mario X low += A W $01:B8AA STA RAM_MarioXPos ; Mario X low += sprite movement (carried along) W $01:B8F4 STA RAM_MarioXPos ; Mario X low = sprite X low + push R $01:DA98 ADC RAM_MarioXPos ; Mario X low += A R $02:86CF LDA RAM_MarioXPos ; Mario X low R $02:8BE5 LDA RAM_MarioXPos ; Mario X low W $02:CC64 STA RAM_MarioXPos ; Push Mario to the left wall R $02:D4FC LDA RAM_MarioXPos ; A = Mario X low W $02:EAE7 STA RAM_MarioXPos ; Mario X position = sprite X + $0A (low byte) R $03:8CDA ADC RAM_MarioXPos ; Mario X low += sprite movement W $05:D82B STA RAM_MarioXPos ; Mario X position low = DATA_05D750[X] W $05:D96F STA RAM_MarioXPos ; Mario X position low = DATA_05D750[X] W $05:DA71 STA RAM_MarioXPos ; Mario X position low = $30 W $0C:9FEF STA RAM_MarioXPos ; Mario X position = $0038 W $0C:A25A STA RAM_MarioXPos ; Mario X position = actor 0 X position R $0C:D4C5 ADC RAM_MarioXPos ; OAM X = Mario X + offset R $0C:D52A ADC RAM_MarioXPos ; OAM X = Mario X + 4 R $0C:D6B5 ADC RAM_MarioXPos ; OAM X = Mario X +/- offset R $0C:D732 ADC RAM_MarioXPos ; OAM X = Mario X + offset R $0C:D776 LDA RAM_MarioXPos ; OAM X = Mario X W $0C:D7C2 STA RAM_MarioXPos ; Mario X += 1 $0095 Mario X position, high byte RAM_MarioXPosHi word high byte (low is $0094) High byte of Mario's X position ($0094 is the low byte): the screen number he is on. Platforms, carry sprites and Mega Moles add sign extension and carry here when carrying Mario; the level loader sets it from the start position table. Sprite spawners copy it as the X high of effects such as bubbles, splashes and smoke.
52 uses in 35 routines (32 read, 20 write) R $00:FCA5 LDA RAM_MarioXPosHi ; Yoshi X = Mario X R $01:A0E7 LDA.W RAM_MarioXPosHi,Y ; [$00]/[$01] = Mario X position (low/high) R $01:B4AC ADC RAM_MarioXPosHi ; Mario X high += sign extension + carry W $01:B8AF STA RAM_MarioXPosHi ; Mario X high += sign extension W $01:B8FA STA RAM_MarioXPosHi ; Mario X high = sprite X high + sign extension W $01:CA6C STA RAM_MarioXPosHi ; Mario X += platform X movement (carries Mario along) R $01:DA9D ADC RAM_MarioXPosHi ; Mario X high += carry / sign R $02:86D4 LDA RAM_MarioXPosHi ; Mario X high R $02:8BE9 LDA RAM_MarioXPosHi ; Mario X high R $02:D503 LDA RAM_MarioXPosHi ; A = Mario X high W $02:EAEE STA RAM_MarioXPosHi ; Mario X position high byte with carry W $02:EEA6 STA RAM_MarioXPosHi ; Mario X += platform movement (16 bit) W $03:881B STA RAM_MarioXPosHi ; Mario X += [$1491] (+1 or -1, platform movement) R $03:8CDF ADC RAM_MarioXPosHi ; Mario X high += sign extension and carry W $05:C39C STZ.W RAM_MarioXPosHi ; Mario X position high byte = 0 R $05:D7B3 LDX RAM_MarioXPosHi ; X = Mario X screen number W $05:D831 STA RAM_MarioXPosHi ; Mario X position high = DATA_05D758[X] W $05:D975 STA RAM_MarioXPosHi ; Mario X position high = DATA_05D758[X] W $05:D9FC STA RAM_MarioXPosHi ; Horizontal level: Mario X screen = [$01] W $05:DA73 STZ RAM_MarioXPosHi ; Mario X position high = 0 R $05:DBB5 LDX RAM_MarioXPosHi ; X = Mario X screen number $0096 Mario Y position, low byte RAM_MarioYPos word low byte (high is $0097) Mario's Y position in pixels in the level; $0096 is the low byte and $0097 the high byte. Written by the level loader, pipes, layer 2 displacement, platforms carrying him and cutscene movement; read by collision, sprite contact and effect spawners. Level start sets it to $A0 for the intro.
115 uses in 68 routines (67 read, 44 write, 4 read-modify-write) W $00:9816 STA RAM_MarioYPos ; Mario Y position = $FFD0 W $00:9A17 STA RAM_MarioYPos ; Mario Y position = A R $00:A2F9 LDA RAM_MarioYPos ; [$D1] = Mario X position, [$D3] = Mario Y position (previous-frame copies) W $00:A70F STA RAM_MarioYPos ; Mario Y position low = $A0 RW $00:A72C TSB RAM_MarioYPos ; Mario Y position low |= 2 W $00:C73D STA RAM_MarioYPos ; Mario Y = A (snap to the ground) W $00:C8F1 STA RAM_MarioYPos ; Land: Mario Y position = ground Y + 1 W $00:CCFB STA RAM_MarioYPos ; Mario Y position = keyhole Y [$1438] W $00:D1C0 STA RAM_MarioYPos ; Mario Y = ((Y - 8) & $FFF0) | $0E (center on the pipe) RW $00:D1E9 INC RAM_MarioYPos ; Mario Y += 2 R $00:D27C LDA RAM_MarioYPos ; Unused code: [$88] += Mario Y - [$D3] R $00:E34D ADC RAM_MarioYPos ; A = [$188B] + Mario Y position W $00:E95F STA RAM_MarioYPos ; Mario Y += [$28] (layer 2 Y displacement) W $00:E974 STA RAM_MarioYPos ; Mario Y -= [$28] (undo the displacement) R $00:EB65 ADC RAM_MarioYPos ; Add Mario Y position W $00:EB67 STA RAM_MarioYPos ; Mario Y position += 8 (small) or $10 (big) R $00:ED2F ADC RAM_MarioYPos ; Mario Y position += -A - 1 (push Mario down out of the ceiling) R $00:EFDD LDA RAM_MarioYPos ; A = Mario Y position W $00:EFE3 STA RAM_MarioYPos ; Store Mario Y position: Mario is carried 1 pixel W $00:F5A1 STA RAM_MarioYPos ; Clamp: Mario Y = top of screen - $80 R $00:F909 LDA RAM_MarioYPos ; A = Mario Y W $00:F9F0 STA RAM_MarioYPos ; Mario Y = result R $00:FD4A ADC RAM_MarioYPos ; Bubble Y = Mario Y + offset R $00:FDC3 LDA RAM_MarioYPos ; A = Mario Y low R $00:FF2B ADC RAM_MarioYPos ; Mario Y += -[$17BC] (follows layer 1 Y movement) W $01:B896 STA RAM_MarioYPos ; Mario Y low = sprite Y low - offset W $01:CA4D STA RAM_MarioYPos ; Mario Y = platform Y - height (low byte) R $01:D2E3 LDA RAM_MarioYPos ; Mario Y position R $01:DA48 ADC RAM_MarioYPos ; Mario Y low += Y movement RW $01:DA66 INC RAM_MarioYPos ; Mario above the sprite: pull him down 1 pixel (unreferenced) W $02:D1E8 STA RAM_MarioYPos ; Mario Y position = (Mario Y + 8) rounded down to a 16 pixel boundary R $02:D50E LDA RAM_MarioYPos ; A = Mario Y low W $02:EE87 STA RAM_MarioYPos ; Mario Y low = sprite Y - height R $03:8C99 ADC RAM_MarioYPos ; $00 = Mario Y + A (Y of Mario's feet) R $03:8D01 ADC RAM_MarioYPos ; $01 = Mario Y + A (hitbox at Mario's feet) W $05:D7F6 STA RAM_MarioYPos ; Mario Y position low = DATA_05D730[X] W $05:D95B STA RAM_MarioYPos ; Mario Y position low = DATA_05D730[X] W $05:DA69 STA RAM_MarioYPos ; Mario Y position low = DATA_05D790[X] W $0C:9FF4 STA RAM_MarioYPos ; Mario Y position = $008F W $0C:A1F8 STA RAM_MarioYPos ; Mario Y position = $0160 R $0C:D73E ADC RAM_MarioYPos ; OAM Y = Mario Y + [$01] + DATA_0CD6D3[X] $0097 Mario Y position, high byte RAM_MarioYPosHi word high byte (low is $0096) High byte of Mario's Y position ($0096 is the low byte). Set by the level loader from the start position table; bumped by INC when Mario crosses into the next screen in the block collision; copied into spawned score sprites, bubbles, splashes and fireballs. Set to 0 in the Mode 7 boss room.
53 uses in 37 routines (26 read, 26 write, 1 read-modify-write) W $00:9925 STZ RAM_MarioYPosHi ; Mode 7 boss room: Mario Y high byte = 0 RW $00:ED35 INC RAM_MarioYPosHi ; Y position high byte++ R $00:F3A2 LDA RAM_MarioYPosHi ; Score sprite position = Mario's position W $00:FCB7 STA RAM_MarioYPosHi ; Yoshi Y = Mario Y - $10 and Mario Y -= $10 as well R $01:A0F1 LDA.W RAM_MarioYPosHi,Y ; [$02]/[$03] = Mario Y position (low/high) W $01:B89D STA RAM_MarioYPosHi ; Mario Y high = sprite Y high - borrow R $01:C0E3 SBC RAM_MarioYPosHi ; Compare anchor Y with Mario Y (16 bit) W $01:CA54 STA RAM_MarioYPosHi ; Mario Y high byte R $01:DA4D ADC RAM_MarioYPosHi ; Mario Y high += carry / sign W $01:EDDD STA RAM_MarioYPosHi ; Mario Y high = Yoshi Y high - borrow W $02:CFC5 STA RAM_MarioYPosHi ; Mario Y position = piece screen Y - feet offset + screen Y (stand on the coil) R $02:D2D2 LDA RAM_MarioYPosHi ; Save Mario's 16-bit X and Y position R $02:D515 LDA RAM_MarioYPosHi ; A = Mario Y high W $02:EE8E STA RAM_MarioYPosHi ; Mario Y high W $03:8809 STA RAM_MarioYPosHi ; Mario Y = sprite Y + A (16-bit) W $05:D7FC STA RAM_MarioYPosHi ; Mario Y position high = DATA_05D740[X] W $05:D961 STA RAM_MarioYPosHi ; Mario Y position high = DATA_05D740[X] W $05:DA03 STA RAM_MarioYPosHi ; Vertical level: Mario Y screen and layer 1 Y screen = [$01] W $05:DA6D STA RAM_MarioYPosHi ; Mario Y position high = 1 $0098 Block Y position, low RAM_BlockYLo word low byte (high is $0099) Y position of the block being acted on: the 16x16 block hit by Mario, a sprite, the cape or a bounce sprite. Used to generate or change a Map16 tile ($009C ), spawn a bounce sprite or smoke, or look up a tile. Low byte; $0099 is the high. Block interaction snaps it to the grid by clearing its low nibble.
66 uses in 39 routines (33 read, 32 write, 1 read-modify-write) R $00:BEC2 LDA RAM_BlockYLo ; A = block Y position R $02:8702 LDA RAM_BlockYLo ; Block Y low R $02:8A55 LDA RAM_BlockYLo ; Block Y low W $02:91D5 STA RAM_BlockYLo ; Set block Y low W $02:9557 STA RAM_BlockYLo ; $00 = BlockYLo = cape Y + offset, rounded to a tile row W $02:95B9 STA RAM_BlockYLo ; $00 = BlockYLo = cape Y + offset, rounded to a tile row W $02:B9B1 STA RAM_BlockYLo ; Block Y position = sprite Y position (lo) R $02:C2B6 LDA RAM_BlockYLo ; Save block X/Y position W $02:CD72 STA RAM_BlockYLo ; Block Y position = sprite Y position - $10 W $02:DEE4 STA RAM_BlockYLo ; Block Y = sprite Y (low) W $02:E481 STA RAM_BlockYLo ; Block Y low W $03:9398 STA RAM_BlockYLo ; Block Y position low = sprite Y low R $03:D787 ORA RAM_BlockYLo ; A = block row ([$98]) | block column (X / 16): Map16 index within a screen $0099 Block Y position, high RAM_BlockYHi word high byte (low is $0098) High byte of the block Y position ($0098 is the low byte), i.e. the screen number for the block. Written by sprite and extended sprite routines before a Map16 tile is generated or a bounce sprite is spawned.
47 uses in 32 routines (19 read, 28 write) R $00:BF44 LDA RAM_BlockYHi ; A = block Y high byte W $01:E339 STA RAM_BlockYHi ; Block Y = sprite Y (for block creation) R $02:8707 LDA RAM_BlockYHi ; Block Y high R $02:87B9 LDA RAM_BlockYHi ; Save block position [$98]-[$9B] on the stack R $02:8844 LDA RAM_BlockYHi ; Bounce sprite Y = block Y W $02:9564 STA RAM_BlockYHi ; $03 = BlockYHi = screen number W $02:95C6 STA RAM_BlockYHi ; $02 = BlockYHi W $02:A62F STA RAM_BlockYHi ; $03 = screen number W $02:B9B6 STA RAM_BlockYHi ; Block Y position (hi) = sprite Y position (hi) W $02:BAE4 STA RAM_BlockYHi ; Sprite Y and block Y position = [$01]/[$09] W $02:E486 STA RAM_BlockYHi ; Block Y high W $03:8224 STA RAM_BlockYHi ; Block position [$9A],[$9B],[$98],[$99] = that sprite's position W $03:939D STA RAM_BlockYHi ; Block Y position high = sprite Y high W $03:C01C STA RAM_BlockYHi ; Block Y position = sprite Y position + 8 (16-bit) W $03:D731 STZ RAM_BlockYHi ; Block Y = $00B0: row of the bridge $009A Block X position, low RAM_BlockXLo word low byte (high is $009B) X position of the block being acted on, low byte ($009B is the high byte). Set from Mario, a sprite, the cape or an extended sprite before calling the Map16 tile generation, bounce sprite spawn or smoke routines; block interaction snaps it to the 16x16 grid. The bridge breaker mirrors it about the bridge center.
68 uses in 40 routines (35 read, 32 write, 1 read-modify-write) R $00:BEBE LDA RAM_BlockXLo ; A = block X position W $00:EEA6 STA RAM_BlockXLo ; [RAM_BlockXLo] -= $10 (use the left block of the switch) RW $00:F1DD TRB RAM_BlockXLo ; Snap the block position to the 16x16 grid (clear low nibbles) W $00:F25A STA RAM_BlockXLo ; [BlockXLo] = X position of block X (DATA_00F0F8) R $02:86F8 LDA RAM_BlockXLo ; Block X low R $02:88E2 LDA RAM_BlockXLo ; Block X low R $02:8A5A LDA RAM_BlockXLo ; Block X low R $02:8A84 LDA RAM_BlockXLo ; Block X low W $02:91C4 STA RAM_BlockXLo ; Set block X low W $02:956F STA RAM_BlockXLo ; $01 = BlockXLo = cape X + offset W $02:95D1 STA RAM_BlockXLo ; $01 = BlockXLo = cape X + offset W $02:B9A8 STA RAM_BlockXLo ; Block X position = sprite X position (lo) W $02:DEE0 STA RAM_BlockXLo ; Block X = sprite X (low) W $02:E478 STA RAM_BlockXLo ; Block X low = sprite X low W $03:938F STA RAM_BlockXLo ; Block X position low = sprite X low W $03:D761 STA RAM_BlockXLo ; Block X = $0170 - Block X: mirror about the bridge center (X = $00B8) $009B Block X position, high RAM_BlockXHi word high byte (low is $009A) High byte of the block X position ($009A is the low byte), i.e. the screen number. Set alongside $009A by the same routines; also used as a Flat Palace Switch X high when the switch sprite is spawned.
50 uses in 31 routines (22 read, 28 write) R $00:FA5D LDA RAM_BlockXHi ; Sprite X high = block X high [$9B] W $01:E330 STA RAM_BlockXHi ; Block X = sprite X (for block creation) R $02:86FD LDA RAM_BlockXHi ; Block X high R $02:883A LDA RAM_BlockXHi ; Bounce sprite X = block X R $02:8A89 LDA RAM_BlockXHi ; Block X high W $02:957C STA RAM_BlockXHi ; $02 = BlockXHi W $02:95DE STA RAM_BlockXHi ; $03 = BlockXHi = screen number W $02:A646 STA RAM_BlockXHi ; $02 = X screen W $02:A6AC STA RAM_BlockXHi ; $03 = X screen, block X high W $02:B9AD STA RAM_BlockXHi ; Block X position (hi) = sprite X position (hi) W $02:BAD6 STA RAM_BlockXHi ; Sprite X and block X position = [$00]/[$08] (the berry tile) W $02:CD6B STA RAM_BlockXHi ; Block X position = sprite X position W $02:D1FB STA RAM_BlockXHi ; Block position = saved Yoshi mouth tile position ([$18B0]-[$18B3]) W $02:E47D STA RAM_BlockXHi ; Block X high W $03:9394 STA RAM_BlockXHi ; Block X position high = sprite X high W $03:C00E STA RAM_BlockXHi ; Block X position = sprite X position - 8 (16-bit) W $03:D72B STZ RAM_BlockXHi ; Block X = DATA_03D700[X]: X position of this bridge segment (left side) $009C Block to generate RAM_BlockBlock byte (Map16 tile id) Number of the block to generate at the position in $0098 -$009B (the generate-tile handlers map it to a Map16 tile). Set by the code that needs a block changed: $0D = used block, $02 = empty, $08 = Monty Mole hole, a growing pipe's tile. Read by the Map16 tile generation routine.
27 uses in 20 routines (5 read, 22 write) W $00:F254 STA RAM_BlockBlock ; Block to generate = $0D (used block) W $00:F283 STA RAM_BlockBlock ; Block to generate = $02 (empty): the turn block disappears W $00:F2CF STA RAM_BlockBlock ; Block to generate = $02: remove the tile W $00:F36D STY RAM_BlockBlock ; [BlockBlock] = Y W $01:BCB3 STA RAM_BlockBlock ; Block to generate = $02 (probably blank/empty) W $01:E33D STA RAM_BlockBlock ; Block to generate = $08 (mole hole) W $02:8782 STA RAM_BlockBlock ; Block to generate = $02 (empty tile) W $02:87DA STA RAM_BlockBlock ; Block to generate = tile the old sprite was going to become W $02:91BA STA RAM_BlockBlock ; Set the block number to generate W $02:B9A4 STA RAM_BlockBlock ; A = block to generate: [$9C] = tile number W $02:BB04 STA RAM_BlockBlock ; Block to generate = $04 (tree behind the berry) W $02:C2BF STA RAM_BlockBlock ; Block to generate = $02 (empty) W $02:C2DC STA RAM_BlockBlock ; Block to generate = $02 (empty) W $02:CD62 STA RAM_BlockBlock ; Block to generate = $1B W $02:D209 STA RAM_BlockBlock ; Block to generate = $04 (tree behind berry) W $02:E2D7 STA RAM_BlockBlock ; Block to generate = coin ($06) W $02:E536 STA RAM_BlockBlock ; Block to generate = that tile W $02:E8C9 STA RAM_BlockBlock ; Block to generate = left tile W $02:E8E4 STA RAM_BlockBlock ; Block to generate = right tile W $03:938B STA RAM_BlockBlock ; Block to generate = A W $03:C000 STA RAM_BlockBlock ; [$9C] = block number to generate $009D Sprites locked flag RAM_SpritesLocked flag byte Freezes the sprites when nonzero: sprite main routines, many timers and extended sprites skip their update while it is set. Set during power-up growth, Yoshi growing, pipe and other Mario animations; cleared (0) when the effect ends. Read by almost every sprite routine.
Values: 0 = sprites run; nonzero = sprites frozen.
215 uses in 187 routines (195 read, 17 write, 3 read-modify-write) W $00:A6E6 STZ RAM_SpritesLocked ; Unlock sprites: [$9D] = 0 W $00:C494 STY RAM_SpritesLocked ; Lock sprites too W $00:C94A STY RAM_SpritesLocked ; Lock sprites ([$9D] = 1) W $00:CDE8 STA RAM_SpritesLocked ; Sprites locked = [$13FD] W $00:D15C STZ RAM_SpritesLocked ; Unlock sprites W $00:D2B0 STZ RAM_SpritesLocked ; Behind-scenery flag = 0, Yoshi-in-pipe = 0, sprites unlocked W $00:F413 STA RAM_SpritesLocked ; Lock sprites W $00:F620 STA RAM_SpritesLocked ; Sprites locked for the same time R $00:FD15 ORA RAM_SpritesLocked ; A |= [$9D] (sprites locked) R $00:FE54 ORA RAM_SpritesLocked ; Return unless: frame counter & 3 = 0, on ground, not off-screen, sprites not locked R $01:80EA LDA RAM_SpritesLocked ; A = [RAM_SpritesLocked] R $01:876E ORA RAM_SpritesLocked ; Sparkle effect when ([$13] AND $1F) = 0, only if on-screen and not locked (CODE_01B152) R $01:8904 LDA RAM_SpritesLocked ; A = sprites locked flag R $01:890F LDA RAM_SpritesLocked ; Sprites locked? R $01:8AFC LDA RAM_SpritesLocked ; Sprites locked? R $01:8D31 LDA RAM_SpritesLocked ; Sprites locked? R $01:B155 ORA RAM_SpritesLocked ; Only every 4th frame, while on-screen vertically and sprites not locked R $01:B6C2 ORA RAM_SpritesLocked ; Pause timer [$1540] running or sprites locked: do not move R $01:B6F4 ORA RAM_SpritesLocked ; Pause timer [$1540] running or sprites locked: do not move R $01:B98E LDY RAM_SpritesLocked ; Timer = $40 exactly. Skip if sprites are locked R $01:BC38 LDA RAM_SpritesLocked ; Sprites locked? R $01:BDFB LDA RAM_SpritesLocked ; Branch if sprites locked R $01:C09B LDA RAM_SpritesLocked ; Branch if sprites locked R $01:C1A9 LDA RAM_SpritesLocked ; Branch if sprites locked W $01:C56A STA RAM_SpritesLocked ; Growth animation timer = $2F, and lock sprites for the same time W $01:C56A STA RAM_SpritesLocked ; Growth animation timer = $2F, and lock sprites for the same time RW $01:C5AB INC RAM_SpritesLocked ; Lock sprites one more frame W $01:C5F1 STA RAM_SpritesLocked ; Lock sprites for the same time RW $01:CE2E INC RAM_SpritesLocked ; Lock sprites ([$9D]++) R $01:D44E LDA RAM_SpritesLocked ; Sprites locked? R $01:D722 ORA RAM_SpritesLocked ; OR sprites locked R $01:D741 ORA RAM_SpritesLocked ; OR sprites locked R $01:D755 LDA RAM_SpritesLocked ; Sprites locked R $01:DB44 LDA RAM_SpritesLocked ; State 2: sprite fell off the end of a line RW $01:E21D INC RAM_SpritesLocked ; Lock sprites R $01:E4C0 LDA RAM_SpritesLocked ; Walking state: A = sprites locked flag R $01:E623 LDA RAM_SpritesLocked ; A = sprites locked flag R $01:E7A4 LDA RAM_SpritesLocked ; A = sprites locked flag R $01:E98D LDA RAM_SpritesLocked ; A = sprites locked flag W $01:EC1B STA RAM_SpritesLocked ; Lock sprites while growing W $01:EC24 STZ RAM_SpritesLocked ; Unlock sprites W $01:EC74 STZ RAM_SpritesLocked ; Unlock sprites W $01:EC7E STY RAM_SpritesLocked ; Lock sprites during swallow W $02:842E STZ RAM_SpritesLocked ; Unlock sprites ([RAM_SpritesLocked] = 0) R $02:8D6E ORA RAM_SpritesLocked ; Sink only on even timer values and when sprites are not locked R $02:979C LDY RAM_SpritesLocked ; Y = [RAM_SpritesLocked] R $02:98CF LDY RAM_SpritesLocked ; Y = [RAM_SpritesLocked] R $02:9941 LDY RAM_SpritesLocked ; Y = [RAM_SpritesLocked] R $02:99F1 LDA RAM_SpritesLocked ; Spinning coin from block: sprites locked? R $02:9C67 LDA RAM_SpritesLocked ; Sprites locked? R $02:9CB5 LDA RAM_SpritesLocked ; Skip physics while sprites are locked R $02:9E86 LDA RAM_SpritesLocked ; Skip physics while sprites are locked R $02:A254 LDA RAM_SpritesLocked ; Skip movement and animation while sprites are locked R $02:A2EF LDA RAM_SpritesLocked ; Skip movement while sprites are locked R $02:ADC9 LDA RAM_SpritesLocked ; A = [$9D] (sprites locked) R $02:B003 LDY RAM_SpritesLocked ; Y = sprites locked flag R $02:B387 LDA RAM_SpritesLocked ; Sprites locked flag R $02:B6B3 LDA RAM_SpritesLocked ; Sprites locked? R $02:BFD1 LDA RAM_SpritesLocked ; Sprites locked? R $02:C256 LDA RAM_SpritesLocked ; Sprites locked? R $02:D3EE LDA RAM_SpritesLocked ; A = sprites-locked flag R $02:D591 LDA RAM_SpritesLocked ; A = sprites-locked flag R $02:D62D LDA RAM_SpritesLocked ; A = sprites-locked flag R $02:D904 LDA RAM_SpritesLocked ; Sprites locked? R $02:DA6E LDA RAM_SpritesLocked ; Sprites locked? R $02:DB9E LDA RAM_SpritesLocked ; Sprites locked? R $02:DCBA LDA RAM_SpritesLocked ; Sprites locked? R $02:E559 LDY RAM_SpritesLocked ; Y = [RAM_SpritesLocked] R $03:92B4 ORA RAM_SpritesLocked ; Every 4th frame while sprites unlocked: play sound R $03:92C0 LDA RAM_SpritesLocked ; Sprites locked? R $03:9426 LDA RAM_SpritesLocked ; Sprites locked? R $03:9521 LDA RAM_SpritesLocked ; Sprites locked? R $03:96F9 LDA RAM_SpritesLocked ; Sprites locked? R $03:9893 LDA RAM_SpritesLocked ; Sprites locked? R $03:9C4A LDA RAM_SpritesLocked ; A = sprites locked flag R $03:9F3B LDA RAM_SpritesLocked ; A = sprites locked flag R $03:A2CE LDA RAM_SpritesLocked ; A = sprites locked flag $009E Sprite number RAM_SpriteNum byte table, one per sprite slot (index X) The sprite number (type) of each of the 12 sprite slots; it selects which main routine runs for the slot. Set when a sprite spawns (e.g. from a block or the level) and rewritten when a sprite changes form (a Koopa becomes its shell). Read by contact, interaction and physics routines to tell sprite types apart. Slot N is at $009E +N.
252 uses in 166 routines (178 read, 74 write) R $00:FAA3 LDA.W RAM_SpriteNum,Y ; A = sprite number R $00:FB10 LDA.W RAM_SpriteNum,Y ; A = carried sprite number W $00:FB55 STA.W RAM_SpriteNum,Y ; Sprite number = A R $00:FC2C LDA.W RAM_SpriteNum,Y ; A = sprite number of slot Y W $00:FC9F STA RAM_SpriteNum,X ; Sprite number = $35 (Yoshi) R $01:8177 LDA RAM_SpriteNum,X ; A = sprite number R $01:8479 LDA.W RAM_SpriteNum,Y ; A = sprite number in slot Y W $01:84A6 STA.W RAM_SpriteNum,Y ; New sprite number = $87 (Lakitu's cloud) R $01:85C6 LDA RAM_SpriteNum,X ; A = sprite number [$9E,X] R $01:8931 LDA RAM_SpriteNum,X ; A = sprite number R $01:895E LDA RAM_SpriteNum,X ; A = sprite number R $01:8AB1 LDA.W RAM_SpriteNum,Y ; Its sprite number R $01:8B0F LDY RAM_SpriteNum,X ; Y = sprite number R $01:8B57 LDY RAM_SpriteNum,X ; Y = sprite number R $01:8B84 LDY RAM_SpriteNum,X ; Y = sprite number R $01:8BDE LDY RAM_SpriteNum,X ; Y = sprite number R $01:8C0A LDA RAM_SpriteNum,X ; Sprite number W $01:8C32 STA RAM_SpriteNum,X ; Sprite = Spiny ($13) R $01:8C71 LDA RAM_SpriteNum,X ; Sprite number W $01:977D STA.W RAM_SpriteNum,Y ; Coin sprite number = $21 (Moving Coin) R $01:A18E LDA RAM_SpriteNum,X ; A = sprite number W $01:A2BD STA.W RAM_SpriteNum,X ; Sprite = $35 (Yoshi) R $01:A77C LDA RAM_SpriteNum,X ; A = sprite number of X R $01:A911 LDA RAM_SpriteNum,X ; A = sprite number R $01:A960 LDY RAM_SpriteNum,X ; Y = sprite number W $01:A99B STA RAM_SpriteNum,X ; Sprite number = replacement R $01:A9B4 LDA RAM_SpriteNum,X ; A = new sprite number R $01:A9BE LDA RAM_SpriteNum,X ; A = sprite number R $01:AAF1 LDA RAM_SpriteNum,X ; A = sprite number W $01:BC90 STY RAM_SpriteNum,X ; Sprite number = Y R $01:BDC4 LDA.W RAM_SpriteNum,Y ; Sprite number of slot Y W $01:BF34 STA.W RAM_SpriteNum,Y ; New sprite number = $20 (Magikoopa's magic) W $01:C333 STA RAM_SpriteNum,X ; Sprite number = ChangingItemSprite[Y] W $01:C33E STA RAM_SpriteNum,X ; Sprite number = $81 (changing item) again W $01:D070 STA.W RAM_SpriteNum,Y ; New sprite number = $34 (boss fireball) R $01:D671 LDA RAM_SpriteNum,X ; Sprite number W $01:D67A STA RAM_SpriteNum,X ; Store sprite number R $01:D9A7 LDA RAM_SpriteNum,X ; A = sprite number W $01:DDBE STA.W RAM_SpriteNum,X ; Sprite number = $82 (bonus game sprite) R $01:E4FC LDA RAM_SpriteNum,X ; A = sprite number R $01:E54D LDA RAM_SpriteNum,X ; A = sprite number R $01:E566 LDA RAM_SpriteNum,X ; A = sprite number R $01:E57B LDA RAM_SpriteNum,X ; A = sprite number R $01:E5DB LDA RAM_SpriteNum,X ; A = sprite number R $01:E71F LDA RAM_SpriteNum,X ; A = sprite number R $01:E7E4 LDA.W RAM_SpriteNum,Y ; A = sprite number of slot Y W $01:EA37 STA.W RAM_SpriteNum,Y ; Set sprite number W $01:EC92 STA.W RAM_SpriteNum,Y ; New sprite number = $2C (Yoshi egg/spit item; probably) R $01:F2EC LDX.W RAM_SpriteNum,Y ; X = sprite number W $01:F2F4 STA.W RAM_SpriteNum,Y ; Sprite number = the new sprite W $01:F36C STA.W RAM_SpriteNum,Y ; Koopa becomes its shell form W $01:F394 STA.W RAM_SpriteNum,Y ; (unused) Sprite becomes a Mushroom W $01:F3B7 STA.W RAM_SpriteNum,Y ; (unused) Sprite number = the item W $01:F5CE STA.W RAM_SpriteNum,Y ; New sprite = Pokey ($70) R $01:F647 LDA.W RAM_SpriteNum,Y ; Load sprite number (unused result) R $01:F679 LDA.W RAM_SpriteNum,Y ; Other sprite number R $01:F6A3 LDA.W RAM_SpriteNum,Y ; Other sprite number R $01:F6B4 LDA.W RAM_SpriteNum,Y ; Other sprite number W $01:F840 STA RAM_SpriteNum,X ; Become that sprite R $01:F89E LDA RAM_SpriteNum,X ; Sprite number R $01:F93B LDY RAM_SpriteNum,X ; Y = sprite number W $01:FDBE STA.W RAM_SpriteNum,Y ; New sprite number = $A7 (Iggy's ball) W $02:864F STA RAM_SpriteNum,X ; Sprite number = $53 (Throw Block) W $02:893D STA RAM_SpriteNum,X ; Set sprite number R $02:8956 LDA RAM_SpriteNum,X ; Sprite number R $02:89A5 LDA RAM_SpriteNum,X ; Sprite number W $02:89BD STA RAM_SpriteNum,X ; Sprite number from table (key, flying red coin or balloon) R $02:89E8 LDA.W RAM_SpriteNum,Y ; Sprite number W $02:8B44 STA RAM_SpriteNum,X ; Sprite = sprite to respawn W $02:949C STA RAM_SpriteNum,X ; Sprite number = that form W $02:A12B STA RAM_SpriteNum,X ; Sprite number = $21 (moving coin) W $02:A996 STA RAM_SpriteNum,X ; Store the sprite number W $02:A9B2 STA RAM_SpriteNum,X ; Otherwise it becomes sprite $21 (moving coin) W $02:AC24 STA RAM_SpriteNum ; Copy sprite number to slot 0 W $02:AF53 STA RAM_SpriteNum,X ; Set sprite number W $02:AFBD STA RAM_SpriteNum,X ; Set sprite number W $02:B04F STA RAM_SpriteNum,X ; Sprite = Bowser statue fire ($B3) W $02:B095 STA RAM_SpriteNum,X ; Sprite = Bullet Bill ($1C) W $02:B4B3 STA.W RAM_SpriteNum,Y ; Sprite number = $1C (Bullet Bill) W $02:B11D STA.W RAM_SpriteNum,Y ; Sprite = Bullet Bill ($1C) W $02:B16F STA RAM_SpriteNum,X ; Sprite = Flying fish ($17) W $02:B1D0 STA RAM_SpriteNum,X ; Sprite = Super Koopa ($71) W $02:B21B STA RAM_SpriteNum,X ; Sprite = Bubble ($9D) W $02:B28F STA RAM_SpriteNum,X ; Sprite = Dolphin ($41) W $02:B2EA STA RAM_SpriteNum,X ; Sprite = Eerie ($38) W $02:B34B STA RAM_SpriteNum,X ; Set sprite number W $02:B3F2 STA.W RAM_SpriteNum,Y ; Sprite number = $44 (Torpedo Ted) W $02:B83B STA.W RAM_SpriteNum,Y ; Sprite number = $70 (Pokey) W $02:B9DB STA.W RAM_SpriteNum,Y ; Sprite number = $21 (moving coin) W $02:BAC7 STA.W RAM_SpriteNum,Y ; Sprite number = $74 (mushroom, used as the berry) W $02:C1A7 STA.W RAM_SpriteNum,Y ; Sprite number = $48 (rock) W $02:C5C9 STA.W RAM_SpriteNum,Y ; Clone sprite number = $91 (Chargin' Chuck) W $02:C783 STA RAM_SpriteNum,X ; Yes: it becomes a Chargin' Chuck ($91) R $02:D61A LDA RAM_SpriteNum,X ; A = sprite number R $02:D718 LDA RAM_SpriteNum,X ; A = sprite number R $02:D7A0 LDA RAM_SpriteNum,X ; A = sprite number W $02:D97D STA RAM_SpriteNum,X ; Turn the bubble into that sprite R $02:D990 LDA RAM_SpriteNum,X ; A = sprite number W $02:DD97 STA.W RAM_SpriteNum,Y ; Sprite number = $2B (lightning) R $02:E1A4 LDY RAM_SpriteNum,X ; Y = sprite number W $02:E465 STA RAM_SpriteNum,X ; Sprite number = stored value in sprite state W $02:EAFF STA.W RAM_SpriteNum,Y ; Sprite number = $77 (Feather) W $02:EDA0 STA.W RAM_SpriteNum,Y ; Sprite number = $61 (floating skull) W $02:EF82 STA.W RAM_SpriteNum,Y ; Sprite number = $78 (1-Up) W $02:F555 STA.W RAM_SpriteNum,Y ; Sprite number = $8B (Yoshi's House smoke) W $03:8978 STA RAM_SpriteNum,X ; Sprite number = $02 (shell-less blue Koopa) W $03:8AE6 STA.W RAM_SpriteNum,Y ; New sprite number = $B3 (Bowser statue fireball) W $03:9AD3 STA.W RAM_SpriteNum,Y ; Sprite number $A9 (dead Reznor) R $03:9CB4 LDA RAM_SpriteNum,X ; A = sprite number R $03:9CE1 LDA RAM_SpriteNum,X ; A = sprite number R $03:9D7A LDA RAM_SpriteNum,X ; A = sprite number R $03:9E56 LDA RAM_SpriteNum,X ; A = sprite number R $03:A11B LDA RAM_SpriteNum,X ; A = sprite number R $03:A1E7 LDA RAM_SpriteNum,X ; A = sprite number R $03:A6CF LDA.W RAM_SpriteNum,Y ; Sprite number W $03:B032 STA.W RAM_SpriteNum,Y ; Sprite number $A2: Mecha-Koopa R $03:C041 LDA.W RAM_SpriteNum,Y ; A = caught sprite number W $03:C064 STA.W RAM_SpriteNum,X ; Sprite number = $35 (Yoshi): Baby Yoshi grows up R $03:C218 LDA.W RAM_SpriteNum,Y ; A = sprite number W $03:C2ED STA RAM_SpriteNum,X ; Sprite number = $78 (1-Up mushroom) W $03:C31A STA RAM_SpriteNum,X ; Sprite number = $74 (mushroom) W $03:C7D7 STA.W RAM_SpriteNum,Y ; Sprite number = $7A (firework) W $03:CBBB STA.W RAM_SpriteNum,Y ; Sprite number = $1B (Football) W $03:CCEF STA.W RAM_SpriteNum,Y ; Sprite number = $29 (Koopa Kid) R $07:F78D LDA RAM_SpriteNum,X ; A = sprite number R $07:F7A3 LDX RAM_SpriteNum,Y ; X = sprite number of slot Y W $0C:A77F STA RAM_SpriteNum ; Sprite number = $35 (Yoshi) $00A5 Sprite number, slot 7 byte (entry of sprite number table $009E) Entry for sprite slot 7 of the sprite number table at $009E . Extended sprite smoke, burst and fireball code loads it and compares with $A9; the exact purpose is unclear (probably a special-sprite check).
3 uses in 3 routines (3 read) $00A6 Sprite number, slot 8 byte (entry of sprite number table $009E) Entry for sprite slot 8 of the sprite number table at $009E . The Bowser fight writes it to create a sprite in that slot: $A1 (Mechakoopa) and $7C (Princess Peach) are set here.
2 uses in 2 routines (2 write) W $03:AC6A STA $A6 ; Slot 8 sprite number [$A6] = $7C: Princess Peach $00AA Sprite Y speed RAM_SpriteSpeedY byte table, one per sprite slot (index X) Vertical speed of each sprite slot, signed (negative is up, positive is down), applied each frame by the sprite position routines. Sprites set it to launch a jump ($D8 for Ludwig, $E3 for Blargg, $F8 rise for balloons), apply gravity by incrementing it, or cap it at a terminal speed (e.g. $40 for Thwimp). Slot N is at $00AA +N.
430 uses in 188 routines (108 read, 284 write, 38 read-modify-write) W $00:FB70 STA.W RAM_SpriteSpeedY,Y ; Sprite Y speed = $D0 (up) W $00:FBD3 STA RAM_SpriteSpeedY,X ; Timer just hit 1: sprite Y speed = $D0 (kick the coin upward) RW $00:FBF9 INC RAM_SpriteSpeedY,X ; Sprite Y speed += 2 (gravity) R $00:FBFB LDA RAM_SpriteSpeedY,X ; A = sprite Y speed RW $01:8162 DEC RAM_SpriteSpeedY,X ; Y speed -= 2 (cancels part of gravity) W $01:8358 STA RAM_SpriteSpeedY,X ; Y speed = $F0 (moving up) W $01:842F STA RAM_SpriteSpeedY,X ; Y speed = A (then falls into InitRipVanFish) W $01:852A STA RAM_SpriteSpeedY,X ; Y speed = $28 (moving down) W $01:88E6 STA RAM_SpriteSpeedY,X ; Sprite Y speed = $C0 (jump) W $01:892C STZ RAM_SpriteSpeedY,X ; Sprite Y speed = 0 W $01:8966 STA RAM_SpriteSpeedY,X ; Not blue: Y speed = $E0 (small hop) W $01:89B1 STA.W RAM_SpriteSpeedY,Y ; Unused here: kicked sprite Y speed = $E0 R $01:8AAC LDA.W RAM_SpriteSpeedY,Y ; Its Y speed W $01:8B41 STZ RAM_SpriteSpeedY,X ; Ceiling: Y speed = 0 RW $01:8C29 DEC RAM_SpriteSpeedY,X ; Reduce the gravity just added by 1 W $01:8C85 STY RAM_SpriteSpeedY,X ; Store Y speed RW $01:8C8F DEC RAM_SpriteSpeedY,X ; Reduce gravity by 1 W $01:8C99 STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $01:8CAC STA RAM_SpriteSpeedY,X ; Y speed = bounce speed W $01:8CF5 STY RAM_SpriteSpeedY,X ; Store the bob speed RW $01:8D3F DEC RAM_SpriteSpeedY,X ; Reduce gravity by 1 W $01:8D67 STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $01:8DA3 STY RAM_SpriteSpeedY,X ; Y speed = hop speed W $01:8EC2 STA RAM_SpriteSpeedY,X ; Store Y speed RW $01:8F1A DEC RAM_SpriteSpeedY,X ; Reduce gravity by 1 W $01:8F58 STA RAM_SpriteSpeedY,X ; Y speed = $D0 | (random & $0F): jump W $01:9006 STA RAM_SpriteSpeedY,X ; Y speed = BulletSpeedY[direction] R $01:903D LDA RAM_SpriteSpeedY,X ; Y speed W $01:9047 STA RAM_SpriteSpeedY,X ; No: limit upward speed to $E8 W $01:904F STA RAM_SpriteSpeedY,X ; Y speed += gravity (3 air, 1 water) W $01:905B STA RAM_SpriteSpeedY,X ; Otherwise Y speed = terminal speed W $01:9560 STZ RAM_SpriteSpeedY,X ; P-balloon: Y speed = 0 W $01:9592 STA RAM_SpriteSpeedY,X ; Y speed = $F0 (bounce up) W $01:959F STA RAM_SpriteSpeedY,X ; Y speed = $10 (bounce down off the ceiling) W $01:972F STA.W RAM_SpriteSpeedY,Y ; New sprite Y speed = $D0 (hop upward) W $01:979F STA.W RAM_SpriteSpeedY,Y ; Coin Y speed = $D0 (tossed upward) W $01:9803 STA RAM_SpriteSpeedY,X ; Y speed = bounce speed W $01:98F4 STA RAM_SpriteSpeedY,X ; Y speed = $10 (keep pushing down) W $01:98FB STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $01:9965 STA RAM_SpriteSpeedY,X ; Left a slope: Y speed = $F8 (small upward hop) W $01:9973 STA RAM_SpriteSpeedY,X ; Y speed = $10 W $01:9982 STA RAM_SpriteSpeedY,X ; Yes: Y speed = $B8 (launched upward) W $01:9A12 STA RAM_SpriteSpeedY,X ; Y speed = A W $01:9A82 STA RAM_SpriteSpeedY,X ; Y speed = 4 (sink slowly) W $01:A026 STY RAM_SpriteSpeedY,X ; Sprite Y speed = Y W $01:A064 STZ RAM_SpriteSpeedY,X ; Sprite Y speed = 0 W $01:A06E STA RAM_SpriteSpeedY,X ; Sprite Y speed = -112 (toss up) W $01:A14B STA RAM_SpriteSpeedY,X ; Sprite Y speed = -40 (hop just before it wakes up) W $01:A26B STA RAM_SpriteSpeedY,X ; Sprite Y speed = -16 (hop) W $01:A5D1 STZ RAM_SpriteSpeedY,X ; B Y speed = 0 W $01:A5FD STA.W RAM_SpriteSpeedY,Y ; A Y speed = $D0 (jumps up as it dies) W $01:A636 STA.W RAM_SpriteSpeedY,Y ; A Y speed = 0 W $01:A682 STA RAM_SpriteSpeedY,X ; B Y speed = $D0 W $01:A696 STA RAM_SpriteSpeedY,X ; B Y speed = $D0 W $01:A6B3 STA.W RAM_SpriteSpeedY,Y ; A Y speed = $D0 W $01:A74D STA.W RAM_SpriteSpeedY,Y ; Y Y speed = $E0 (toss the shell up) W $01:A75F STA RAM_SpriteSpeedY,X ; X Y speed = $E0 (hop up) W $01:A872 STA RAM_SpriteSpeedY,X ; Y speed = $D0 W $01:A9B2 STZ RAM_SpriteSpeedY,X ; Sprite Y speed = 0 W $01:A9DF STZ RAM_SpriteSpeedY,X ; Sprite X and Y speed = 0 W $01:A9F0 STZ RAM_SpriteSpeedY,X ; Sprite X and Y speed = 0 W $01:AA90 STA RAM_SpriteSpeedY,X ; Unused: sprite Y speed = -16 R $01:ABD8 LDA RAM_SpriteSpeedY,X ; A = sprite speed (Y, or X when entered with X + 12) R $01:ABEB LDA RAM_SpriteSpeedY,X ; A = speed W $01:AEF7 STA RAM_SpriteSpeedY,X ; Y speed = 0 W $01:AF05 STA RAM_SpriteSpeedY,X ; No: Y speed += 4 (gravity) W $01:AF3A STA RAM_SpriteSpeedY,X ; Y speed = $F0 (rise slowly) W $01:AFCA STA RAM_SpriteSpeedY,X ; Y speed = $40 (terminal speed) W $01:AFD3 STA RAM_SpriteSpeedY,X ; Yes: Y speed = $10 (bounce off) W $01:AFDF STZ RAM_SpriteSpeedY,X ; X and Y speed = 0 W $01:AFEB STA RAM_SpriteSpeedY,X ; Y speed = $A0 (big hop) W $01:B0DE STA RAM_SpriteSpeedY,X ; Y speed = DATA_01B01F[Y] W $01:B13E STA RAM_SpriteSpeedY,X ; Y speed = $E0 (knocked up) W $01:B1AE STA RAM_SpriteSpeedY,X ; Store Y speed RW $01:B1DE DEC RAM_SpriteSpeedY,X ; Y speed -= 1 (keeps rising) RW $01:B1E6 DEC RAM_SpriteSpeedY,X ; ...Y speed -= 1 again W $01:B204 STA RAM_SpriteSpeedY,X ; Y speed = $D0 (jump again) W $01:B28C STA RAM_SpriteSpeedY,X ; X speed and Y speed += DATA_01B268[Y] W $01:B94E STA RAM_SpriteSpeedY,X ; Y speed = $F8 (climbing up) RW $01:B966 ASL RAM_SpriteSpeedY,X ; ...and double Y speed R $01:BA17 LDY RAM_SpriteSpeedY,X ; Y = Y speed W $01:BA84 STA RAM_SpriteSpeedY,X ; Y speed = -Y speed W $01:BC4D STA RAM_SpriteSpeedY,X ; Y speed = $FF while checking block contact W $01:BC53 STA RAM_SpriteSpeedY,X ; Restore Y speed W $01:BE3C STZ RAM_SpriteSpeedY,X ; Sprite Y speed = 0 W $01:BF61 STA.W RAM_SpriteSpeedY,Y ; New sprite Y speed = [$00] W $01:C0BD STA RAM_SpriteSpeedY,X ; Sprite Y speed = DATA_01C0A5[Y] W $01:C1AF STA RAM_SpriteSpeedY,X ; Y speed = $F0 (up) W $01:C217 STA RAM_SpriteSpeedY,X ; Y speed = $F8 (rise) W $01:C22F STA RAM_SpriteSpeedY,X ; Y speed += DATA_01C1EE[Y] (acceleration up or down) W $01:C247 STA RAM_SpriteSpeedY,X ; Temporarily Y speed -= 2 for the position update W $01:C24D STA RAM_SpriteSpeedY,X ; Restore the real Y speed W $01:C2C0 STZ RAM_SpriteSpeedY,X ; Sprite Y speed = 0 W $01:C2F9 STA RAM_SpriteSpeedY,X ; Balloon Y speed = Mario Y speed W $01:C382 STA RAM_SpriteSpeedY,X ; Y speed = $10 (falls) W $01:C3A6 STA RAM_SpriteSpeedY,X ; Y speed = $FC (rise out of the block) RW $01:C428 INC RAM_SpriteSpeedY,X ; Y speed += 3 (gravity) RW $01:C435 DEC RAM_SpriteSpeedY,X ; Y speed -= 1 W $01:C441 STA RAM_SpriteSpeedY,X ; Y speed = 0 W $01:C468 STA RAM_SpriteSpeedY,X ; Y speed = bounce speed W $01:C47C STA RAM_SpriteSpeedY,X ; Y speed = $C8 (star bounces high, changing item also jumps) RW $01:C710 INC RAM_SpriteSpeedY,X ; Y speed += 1 W $01:C736 STA RAM_SpriteSpeedY,X ; Y speed = DATA_01C6EA[Y] + 6 (falls at varying speed) W $01:CED9 STA RAM_SpriteSpeedY,X ; Y speed = $D8 (jump up) W $01:CF27 STZ RAM_SpriteSpeedY,X ; Speed X = 0, speed Y = 0 RW $01:CF42 INC RAM_SpriteSpeedY,X ; Y speed += 1 R $01:CF69 LDY RAM_SpriteSpeedY,X ; A = $06 (rising frame); Y speed negative: use it RW $01:CF80 INC RAM_SpriteSpeedY,X ; Y speed += 1 W $01:D0D9 STZ RAM_SpriteSpeedY,X ; Sprite Y speed = 0 W $01:D1EF STA RAM_SpriteSpeedY,X ; Y speed = DATA_01D12E[Y] R $01:D266 LDA RAM_SpriteSpeedY,X ; Sprite Y speed W $01:D39F STZ RAM_SpriteSpeedY,X ; Sprite X and Y speed = 0 W $01:D661 STZ RAM_SpriteSpeedY,X ; Last frame: Y speed = 0 RW $01:D68F INC RAM_SpriteSpeedY,X ; Gravity: Y speed++ W $01:D886 STA RAM_SpriteSpeedY,X ; Sprite Y speed = table value x2 (x4 if negative) R $01:DB50 LDA RAM_SpriteSpeedY,X ; A = Y speed W $01:DB8B STZ RAM_SpriteSpeedY,X ; On ground: Y speed = 0 W $01:DEA7 STA RAM_SpriteSpeedY,X ; Y speed = DATA_01DE15[direction] R $01:E0BC LDY RAM_SpriteSpeedY,X ; Y = Y speed W $01:E103 STA RAM_SpriteSpeedY,X ; Y speed = launch speed W $01:E128 STA RAM_SpriteSpeedY,X ; Store Y speed W $01:E13C STZ RAM_SpriteSpeedY,X ; On the ground: Y speed = 0 W $01:E315 STA RAM_SpriteSpeedY,X ; Y speed = $B0: jump out of the ground W $01:E3E6 STA RAM_SpriteSpeedY,X ; Y speed = $D8: hop W $01:E4F4 STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $01:E64E STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $01:E834 STA RAM_SpriteSpeedY,X ; Cloud Y speed = $10 W $01:EA58 STA RAM_SpriteSpeedY,X ; Y speed = $D8 (shoot upward) W $01:ECD2 STA RAM_SpriteSpeedY,X ; Y speed = $F0 (toss upward) W $01:ECFF STA RAM_SpriteSpeedY,X ; Y speed = $F0 W $01:EDC6 STZ RAM_SpriteSpeedY,X ; Yoshi Y speed = 0 W $01:F24B STA.W RAM_SpriteSpeedY,Y ; Item Y speed = 0 W $01:F519 STA.W RAM_SpriteSpeedY,Y ; Eaten sprite Y speed = 0 R $01:F8A9 LDA RAM_SpriteSpeedY,X ; Y speed W $01:F8AF STA RAM_SpriteSpeedY,X ; Store Y speed W $01:F96D STA RAM_SpriteSpeedY,X ; Y speed moves one step toward 0 W $01:F9C6 STA RAM_SpriteSpeedY,X ; Y speed += DATA_01EBB4[Y]: accelerate toward Mario W $01:FA98 STA RAM_SpriteSpeedY,X ; Y speed += 4 (gravity) W $01:FAA1 STA RAM_SpriteSpeedY,X ; Hit platform: bounce, Y speed = $F0 RW $01:FB54 INC RAM_SpriteSpeedY,X ; Y speed += 2 (gravity) W $01:FB99 STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $02:816F STA.W RAM_SpriteSpeedY,Y ; Target Y speed = $C0 (pops upward) W $02:8A18 STA RAM_SpriteSpeedY,X ; Sprite Y speed = $D0 (up) W $02:9417 STA RAM_SpriteSpeedY,X ; Y speed = $C0 (up) W $02:94B0 STA RAM_SpriteSpeedY,X ; Sprite Y speed = A (launched upward) W $02:A112 STA RAM_SpriteSpeedY,X ; Death Y speed = $D0 W $02:A138 STA RAM_SpriteSpeedY,X ; Upward speed = $D0 W $02:AFE1 STA RAM_SpriteSpeedY,X ; Set Y speed W $02:B1B5 STA RAM_SpriteSpeedY,X ; Sprite Y speed = $B8 (jump upward) W $02:B1EC STA RAM_SpriteSpeedY,X ; Sprite Y speed = $28 (downward) W $02:B2B2 STA RAM_SpriteSpeedY,X ; Sprite Y speed RW $02:B6A1 INC RAM_SpriteSpeedY,X ; Y speed += 2 (fall) W $02:B6F3 STZ RAM_SpriteSpeedY,X ; Yes: Y speed = 0 W $02:B86B STA.W RAM_SpriteSpeedY,Y ; Detached piece Y speed = $E0 (up) W $02:B8AE STA RAM_SpriteSpeedY,X ; Launch: Y speed = 8 W $02:B8B5 STA RAM_SpriteSpeedY,X ; Y speed = $10 (after the launch move) R $02:B8D8 LDA RAM_SpriteSpeedY,X ; Y speed = 0? RW $02:B8E2 DEC RAM_SpriteSpeedY,X ; Y speed-- (levels out) W $02:B9F5 STA.W RAM_SpriteSpeedY,X ; Y speed = $D8 (pops upward) RW $02:BBB5 INC RAM_SpriteSpeedY,X ; Gravity: Y speed++ W $02:BBD1 STA RAM_SpriteSpeedY,X ; In water and falling: Y speed -= 8 (buoyancy) W $02:BBD5 STZ RAM_SpriteSpeedY,X ; Clamp at 0 W $02:BBF9 STA RAM_SpriteSpeedY,X ; Y speed = $C0: jump out of the water W $02:BD9D STA RAM_SpriteSpeedY,X ; Y speed = -Y speed W $02:BDBD STA RAM_SpriteSpeedY,X ; Y speed = probe speed (+/-1) W $02:BE34 STA RAM_SpriteSpeedY,X ; Y speed from table (+/-8 or 0) RW $02:BE43 ASL RAM_SpriteSpeedY,X ; Y speed *= 2 R $02:BFDF LDA RAM_SpriteSpeedY,X ; Save X and Y speed W $02:C001 STA RAM_SpriteSpeedY,X ; Restore the real Y speed W $02:C019 STZ RAM_SpriteSpeedY,X ; Yes: Y speed = 0 W $02:C022 STA RAM_SpriteSpeedY,X ; Out of water: Y speed = $10 (sink) W $02:C04B STZ RAM_SpriteSpeedY,X ; Yes: Y speed = 0 R $02:C0AE LDA RAM_SpriteSpeedY,X ; Y speed W $02:C0B9 STA RAM_SpriteSpeedY,X ; Store Y speed W $02:C1EA STA.W RAM_SpriteSpeedY,Y ; Y speed = $C0 (thrown up) R $02:C244 LDA RAM_SpriteSpeedY,X ; Y speed W $02:C272 STA RAM_SpriteSpeedY,X ; Y speed = $10 (bump down) W $02:C2ED STA RAM_SpriteSpeedY,X ; Jump over it: Y speed = $C0 R $02:C30B LDA RAM_SpriteSpeedY,X ; Y speed W $02:C334 STA RAM_SpriteSpeedY,X ; Store Y speed W $02:C3DD STA RAM_SpriteSpeedY,X ; Mario above: jump, Y speed = $C8 W $02:C448 STZ RAM_SpriteSpeedY,X ; Hover: Y speed = 0 R $02:C4E8 LDY RAM_SpriteSpeedY,X ; Y = Y speed W $02:C522 STA RAM_SpriteSpeedY,X ; Y speed = $F0 (small hop) W $02:C531 STA RAM_SpriteSpeedY,X ; Mario above: high jump, Y speed = $C0 W $02:C57B STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $02:C59E STA RAM_SpriteSpeedY,X ; Y speed = $B0 (jump up) W $02:C5F4 STA.W RAM_SpriteSpeedY,Y ; Clone Y speed = $C8 (hops up) W $02:C625 STA RAM_SpriteSpeedY,X ; ...hop: Y speed = $E0 W $02:C7AF STA RAM_SpriteSpeedY,X ; Death Y speed = $D0 (pops up) W $02:C7F2 STZ RAM_SpriteSpeedY,X ; Y speed = 0 RW $02:D27B INC RAM_SpriteSpeedY,X ; Below target: Y speed += 2... RW $02:D27D DEC RAM_SpriteSpeedY,X ; ...then Y speed -= 1 (net +1 or -1 toward the target) W $02:D442 STZ RAM_SpriteSpeedY,X ; Sprite Y speed = 0 W $02:D44C STA RAM_SpriteSpeedY,X ; Sprite Y speed = 4 (slow descent) R $02:D458 LDA RAM_SpriteSpeedY,X ; A = Y speed W $02:D48B STA RAM_SpriteSpeedY,X ; Y speed = $E0 (rise) R $02:D4DE LDA RAM_SpriteSpeedY,X ; A = sprite Y speed W $02:D94E STA RAM_SpriteSpeedY,X ; Store the new Y speed W $02:DC04 STA.W RAM_SpriteSpeedY,Y ; Hammer Bro Y speed = $C0 (knocked upward) W $02:DCD7 STZ RAM_SpriteSpeedY,X ; Landed: Y speed = 0 W $02:DEB7 STA RAM_SpriteSpeedY,X ; Falling speed Y = $30 RW $02:DFAD INC RAM_SpriteSpeedY,X ; Y speed++ W $02:DFBA STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $02:E13C STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $02:E151 STA RAM_SpriteSpeedY,X ; Y speed = $C0 (jump upward) W $02:E18F STA RAM_SpriteSpeedY,X ; Y speed++ W $02:E292 STA RAM_SpriteSpeedY,X ; Y speed from DATA_02E1FD W $02:E33B STA RAM_SpriteSpeedY,X ; Store Y speed W $02:E46D STA RAM_SpriteSpeedY,X ; Y speed = $D0 (up) W $02:E562 STA RAM_SpriteSpeedY,X ; Y speed = saved value W $02:E785 STA RAM_SpriteSpeedY,X ; Y speed = $A0 (-$60, upward) W $02:E806 STA RAM_SpriteSpeedY,X ; Hit ceiling: Y speed = $10 (downward) W $02:E819 STA RAM_SpriteSpeedY,X ; Y speed = bounce W $02:E8A5 STA RAM_SpriteSpeedY,X ; Y speed from the phase table W $02:E99C STA RAM_SpriteSpeedY,X ; Y speed = A W $02:EB24 STA RAM_SpriteSpeedY,X ; Y speed = $D0 (shoots upward) W $02:EB7A STA RAM_SpriteSpeedY,X ; Y speed -= 1 (levels out the swoop) W $02:EBCE STA RAM_SpriteSpeedY,X ; Y speed = $D0 (up) W $02:EBD6 STA RAM_SpriteSpeedY,X ; Y speed += 2 W $02:EBF6 STA RAM_SpriteSpeedY,X ; Y speed -= 1 W $02:EE46 STA RAM_SpriteSpeedY,X ; Limit Y speed to $20 W $02:EE55 STA RAM_SpriteSpeedY,X ; Y speed = $10 (keeps the skull pushed down slightly) W $02:EF10 STA RAM_SpriteSpeedY,X ; Y speed += acceleration W $02:EFA3 STA RAM_SpriteSpeedY,X ; Y speed = $E0 (up) RW $02:F095 INC RAM_SpriteSpeedY,X ; Y speed++ (gravity) W $02:F2A4 STA RAM_SpriteSpeedY,X ; Y speed = $D0 (fly up) W $02:F32F STA RAM_SpriteSpeedY,X ; Y speed += 3 (gravity) W $02:F35D STA RAM_SpriteSpeedY,X ; Y speed = $F0 (hop) W $02:F446 STA RAM_SpriteSpeedY,X ; Y speed = $FC (rise) W $02:FFDF STA RAM_SpriteSpeedY,X ; Sprite Y speed = A W $03:8046 STZ RAM_SpriteSpeedY,X ; Touching a ceiling: Y speed = 0 W $03:8066 STA RAM_SpriteSpeedY,X ; Y speed = DATA_03800E[random & 3] (bounce up by a random amount) W $03:8178 STA RAM_SpriteSpeedY,X ; Y speed += DATA_038100[[$1528] & 1] W $03:81DC STA RAM_SpriteSpeedY,X ; Y speed = $D0 (up) W $03:8470 STA RAM_SpriteSpeedY,X ; Y speed += 2 W $03:8482 STA RAM_SpriteSpeedY,X ; Y speed = 3: start falling W $03:850D STA RAM_SpriteSpeedY,X ; Y speed += BlurpAccelY[Y] W $03:8580 STY RAM_SpriteSpeedY,X ; Store Y speed W $03:8627 STA RAM_SpriteSpeedY,X ; Y speed = FlyingBlockSpeedY[Y] R $03:8629 LDA RAM_SpriteSpeedY,X ; A = Y speed W $03:8634 STA RAM_SpriteSpeedY,X ; Else Y speed = -[Y speed] W $03:863B STA RAM_SpriteSpeedY,X ; Restore the saved Y speed W $03:872C STA RAM_SpriteSpeedY,X ; Y speed = 6 (sink) W $03:879E STZ RAM_SpriteSpeedY,X ; On ground: Y speed = 0 W $03:87B0 STZ RAM_SpriteSpeedY,X ; Keep Y speed 0 (hover briefly off ledges) W $03:88FD STA RAM_SpriteSpeedY,X ; Initial Y speed = $20 (down) RW $03:890F DEC RAM_SpriteSpeedY,X ; Y speed decays toward 0 W $03:8948 STA RAM_SpriteSpeedY,X ; Y speed += BlurpAccelY[Y] W $03:89CC STY RAM_SpriteSpeedY,X ; Set Y speed W $03:8A66 STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $03:8AA2 STA RAM_SpriteSpeedY,X ; Landed: Y speed = $10 W $03:8AB0 STA RAM_SpriteSpeedY,X ; Jump Y speed = $C0 W $03:8C5A STA RAM_SpriteSpeedY,X ; Sprite Y speed = A W $03:924C STZ RAM_SpriteSpeedY,X ; Sprite Y speed = 0 (hangs in place) W $03:926C STZ RAM_SpriteSpeedY,X ; Sprite Y speed = 0 while waiting W $03:92CC STA RAM_SpriteSpeedY,X ; Speed Y = CrtEatBlkSpeedY[direction] W $03:947D STA RAM_SpriteSpeedY,X ; Sprite Y speed = A W $03:9559 STA RAM_SpriteSpeedY,X ; Sprite Y speed = $10 (stay on the ground) W $03:95F9 STA RAM_SpriteSpeedY,X ; Sprite Y speed = $D0 (jump up) W $03:9AF4 STA RAM_SpriteSpeedY,X ; New sprite Y speed = $C0: bounces upward R $03:9C74 LDA RAM_SpriteSpeedY,X ; A = Y speed W $03:9CDC STA RAM_SpriteSpeedY,X ; Y speed = $10 (keeps it on the ground) W $03:9CFA STA RAM_SpriteSpeedY,X ; Touching a wall: Y speed = $C0 (jump) W $03:9F6D STA RAM_SpriteSpeedY,X ; Y speed = $E3 (rise out of the lava) R $03:9F8B LDA RAM_SpriteSpeedY,X ; A = Y speed W $03:9F98 STZ RAM_SpriteSpeedY,X ; Y speed = 0 RW $03:9FA1 INC RAM_SpriteSpeedY,X ; Y speed += 2 (slow the rise) W $03:9FCF STA RAM_SpriteSpeedY,X ; Y speed = $20 (sink) W $03:9FE5 STA RAM_SpriteSpeedY,X ; Y speed = $E2 (leap up) RW $03:A010 INC RAM_SpriteSpeedY,X ; Y speed++ (gravity every frame) R $03:A012 LDA RAM_SpriteSpeedY,X ; A = Y speed R $03:A038 LDA RAM_SpriteSpeedY,X ; A = Y speed W $03:A465 STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $03:A713 STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $03:A84B STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $03:A879 STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $03:A8A6 STZ RAM_SpriteSpeedY,X ; Y speed = 0 R $03:AB54 LDA RAM_SpriteSpeedY,X ; Y speed W $03:AB5F STA RAM_SpriteSpeedY,X ; Y speed W $03:AB77 STA RAM_SpriteSpeedY,X ; Bowser Y speed += 3 (gravity) W $03:AB8A STA RAM_SpriteSpeedY,X ; Y speed = $A0 (bounce up) W $03:ABBB STA RAM_SpriteSpeedY,X ; Y speed = -8 (fly upward) W $03:ABC3 STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $03:AC2D STA RAM_SpriteSpeedY,X ; Y speed = $FC (fly up) W $03:AD49 STA RAM_SpriteSpeedY,X ; Y speed++ (gravity) W $03:AD5A STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $03:B070 STA RAM_SpriteSpeedY,X ; Y speed = $C0 (toss upward) W $03:B152 STA.W RAM_SpriteSpeedY,Y ; Y speed = $10 or $D0 W $03:B188 STA RAM_SpriteSpeedY,X ; Clamp Y speed to $40 (terminal velocity) W $03:B2CA STZ RAM_SpriteSpeedY,X ; Y speed = 0 R $03:B7F8 LDA RAM_SpriteSpeedY,X ; Save current Y speed W $03:B7FB STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $03:B814 STA RAM_SpriteSpeedY,X ; Y speed = bounce speed W $03:C1E8 STA RAM_SpriteSpeedY,X ; Sprite Y speed = $18 (push it down onto the slope) W $03:C340 STA RAM_SpriteSpeedY,X ; Sprite Y speed = $C0 (pops upward) W $03:C36D STZ RAM_SpriteSpeedY,X ; Landed: Y speed = 0 W $03:C383 STA RAM_SpriteSpeedY,X ; Y speed = NinjiSpeedY[Y] (jump up) RW $03:C867 INC RAM_SpriteSpeedY,X ; ...slow the rise: Y speed++ W $03:C8E2 STZ RAM_SpriteSpeedY,X ; Y speed = 0 RW $03:C947 INC RAM_SpriteSpeedY,X ; ...Y speed++ (falling faster) W $03:CBFF STA.W RAM_SpriteSpeedY,Y ; New Y speed = $E0 (thrown upward) W $03:CD30 STA RAM_SpriteSpeedY,X ; Y speed = $F8 (rise out of the pipe) W $03:CE07 STA RAM_SpriteSpeedY,X ; Y speed = $10 (sink into the pipe) W $03:CE22 STZ RAM_SpriteSpeedY,X ; Y speed = 0 W $03:CEA0 STA RAM_SpriteSpeedY,X ; Y speed = 4 W $07:F759 STZ RAM_SpriteSpeedY,X ; Sprite Y speed = 0 $00B5 Sprite Y speed, slot 11 byte (entry of sprite Y speed table $00AA) Entry for sprite slot 11 of the table at $00AA . The only direct write is STA $B5,X in the extended sprite smoke puff routine, where X is an extended sprite index, so the meaning there is something else (a value from a table indexed by direction). Other hits are pointer table bytes.
1 use in 1 routine (1 write) $00B6 Sprite X speed RAM_SpriteSpeedX byte table, one per sprite slot (index X) Horizontal speed of each sprite slot, signed (negative is left, positive is right), applied each frame by the sprite position routines. Sprites set it to walk or jump (Ludwig jump speed, Koopa kicked speed), reverse it (Urchin, wall hits), step it toward 0 (Boo, shelled Koopa sliding) or accelerate it. Slot N is at $00B6 +N.
322 uses in 156 routines (91 read, 199 write, 32 read-modify-write) W $00:FB75 STA.W RAM_SpriteSpeedX,Y ; Sprite X speed = 5 W $00:FC6F STA.W RAM_SpriteSpeedX,Y ; Yoshi X speed = $10 W $01:8354 STA RAM_SpriteSpeedX,X ; X speed = DiagBounceInitSpeed[Y] W $01:842A STA RAM_SpriteSpeedX,X ; X speed = A W $01:8925 STZ RAM_SpriteSpeedX,X ; Sprite X speed = 0 W $01:8995 STA.W RAM_SpriteSpeedX,Y ; Kicked sprite X speed = A W $01:89BE STZ RAM_SpriteSpeedX,X ; Sprite X speed = 0 R $01:89D0 LDA RAM_SpriteSpeedX,X ; A = sprite X speed W $01:89E1 STA RAM_SpriteSpeedX,X ; Store as sprite X speed W $01:8A33 STA.W RAM_SpriteSpeedX,Y ; Wall hit: X speed of the kicked sprite and of the Koopa = 0 R $01:8A48 LDA.W RAM_SpriteSpeedX,Y ; A = kicked sprite X speed W $01:8A5A STA.W RAM_SpriteSpeedX,Y ; Kicked sprite X speed = A W $01:8A5D STA RAM_SpriteSpeedX,X ; Koopa X speed = A (slides with it) W $01:8A6B STA RAM_SpriteSpeedX,X ; Both sprites X speed = 0 W $01:8B2C STA RAM_SpriteSpeedX,X ; Sprite X speed = A W $01:8B3A STZ RAM_SpriteSpeedX,X ; Touching: X speed = 0 W $01:8C64 STA RAM_SpriteSpeedX,X ; Store X speed W $01:8C6F STZ RAM_SpriteSpeedX,X ; Yes: X speed = 0 W $01:8D18 STA RAM_SpriteSpeedX,X ; ... stored as both X and Y speed W $01:8DC4 STA RAM_SpriteSpeedX,X ; X speed = +/-8 RW $01:8F1F ASL RAM_SpriteSpeedX,X ; X speed *= 2 (+/-16) W $01:8F26 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $01:9001 STA RAM_SpriteSpeedX,X ; Store X speed RW $01:9066 ROR RAM_SpriteSpeedX,X ; Water: X speed halved (arithmetic shift) W $01:9074 STA RAM_SpriteSpeedX,X ; X speed = speed/2 + speed/4 (3/4 of the original) W $01:907A STA RAM_SpriteSpeedX,X ; Restore the original X speed W $01:90A7 STA RAM_SpriteSpeedX,X ; X speed = -X speed W $01:9742 STA.W RAM_SpriteSpeedX,Y ; New sprite X speed = Spr0to13SpeedX[direction] (walk speed) W $01:97E4 STA RAM_SpriteSpeedX,X ; Store the halved X speed RW $01:98CC INC RAM_SpriteSpeedX,X ; X speed += 2 RW $01:98D6 DEC RAM_SpriteSpeedX,X ; X speed -= 2 R $01:9A17 LDY RAM_SpriteSpeedX,X ; A = 0; X speed 0: leave direction unchanged RW $01:9A90 INC RAM_SpriteSpeedX,X ; X speed negative: += 1 W $01:9A9B STZ RAM_SpriteSpeedX,X ; X speed = 0 W $01:9AFC STZ RAM_SpriteSpeedX,X ; X speed = 0 W $01:A093 STA RAM_SpriteSpeedX,X ; Sprite X speed = ShellSpeedX[Y] R $01:A5EF LDA RAM_SpriteSpeedX,X ; A = B X speed W $01:A5F8 STA.W RAM_SpriteSpeedX,Y ; A speed X = $10 / $F0 (away) R $01:A674 LDA.W RAM_SpriteSpeedX,Y ; A = A X speed W $01:A67E STA RAM_SpriteSpeedX,X ; B X speed = $10 / $F0 (away from A) R $01:A6C5 LDA RAM_SpriteSpeedX,X ; A = B X speed W $01:A6CE STA RAM_SpriteSpeedX,X ; B X speed = $10 / $F0 (reverse) W $01:A6D3 STA.W RAM_SpriteSpeedX,Y ; A X speed = opposite of B (bounce apart) W $01:A87A STA RAM_SpriteSpeedX,X ; X speed = knocked away from Mario W $01:AAAF STA RAM_SpriteSpeedX,X ; Sprite X speed = kick speed, away from Mario W $01:ADEA STA RAM_SpriteSpeedX,X ; Sprite $83: X speed = $F4 (flies left) W $01:AFF8 STA RAM_SpriteSpeedX,X ; X speed = A W $01:B01A STA RAM_SpriteSpeedX,X ; X speed = DATA_01B012[Y] (swims toward Mario) W $01:B06E STA RAM_SpriteSpeedX,X ; X speed = DATA_01B029[Y] W $01:B0D9 STA RAM_SpriteSpeedX,X ; X speed = DATA_01B01D[Y] W $01:B13A STA RAM_SpriteSpeedX,X ; X speed = DATA_01B023[Y] (knocked away from Mario) W $01:B227 STA RAM_SpriteSpeedX,X ; X speed = DATA_01B212[Y] W $01:B556 STA RAM_SpriteSpeedX,X ; Unused: sprite X speed = 8 (platform runs away once stepped on) W $01:B944 STA RAM_SpriteSpeedX,X ; X speed = speed toward Mario RW $01:B94A INC RAM_SpriteSpeedX,X ; X speed = 1 (0 + 1) RW $01:B964 ASL RAM_SpriteSpeedX,X ; Palette bit 1 clear: double X speed W $01:BE40 STA RAM_SpriteSpeedX,X ; Sprite X speed = 1 (for the object interaction check) W $01:BF66 STA.W RAM_SpriteSpeedX,Y ; New sprite X speed = [$01] W $01:C23B STA RAM_SpriteSpeedX,X ; X speed = $0C (drifts right) W $01:C2FD STA RAM_SpriteSpeedX,X ; Balloon X speed = Mario X speed W $01:C3D0 STZ RAM_SpriteSpeedX,X ; X speed = 0 RW $01:C3DF ASL RAM_SpriteSpeedX,X ; X speed *= 2 W $01:C402 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $01:C721 STA RAM_SpriteSpeedX,X ; X speed += DATA_01C6E6[Y] (+2 or -2) W $01:CF08 STA RAM_SpriteSpeedX,X ; Timer ran out: X speed = jump speed [$160E] RW $01:CF17 INC RAM_SpriteSpeedX,X ; X speed += 2 RW $01:CF19 DEC RAM_SpriteSpeedX,X ; X speed -= 1 (so it moves 1 step towards zero) W $01:D1EA STA RAM_SpriteSpeedX,X ; X speed = DATA_01D122[Y] R $01:D53A LDA RAM_SpriteSpeedX,X ; Sprite X speed R $01:D54C ADC RAM_SpriteSpeedX,X ; Add to X speed W $01:D54E STA RAM_SpriteSpeedX,X ; Store X speed W $01:D554 STA RAM_SpriteSpeedX,X ; Store it W $01:D88D STA RAM_SpriteSpeedX,X ; Sprite X speed = table value x2 W $01:DB81 STA RAM_SpriteSpeedX,X ; Sprite X speed = A W $01:DEA2 STA RAM_SpriteSpeedX,X ; X speed = DATA_01DE11[direction] W $01:E15F STY RAM_SpriteSpeedX,X ; X speed = Y W $01:E3B7 STA RAM_SpriteSpeedX,X ; Store R $01:E3BC EOR RAM_SpriteSpeedX,X ; A = direction sign XOR X speed W $01:E3D8 STA RAM_SpriteSpeedX,X ; X speed = hop speed for that direction W $01:E4BD STZ RAM_SpriteSpeedX,X ; On ground: X speed = Y speed = 0 (the pile does not slide) W $01:E4DD STA RAM_SpriteSpeedX,X ; Store as X speed W $01:E4ED STZ RAM_SpriteSpeedX,X ; X speed = 0 W $01:E83B STA RAM_SpriteSpeedX,X ; Cloud X speed = Mario X speed R $01:E9C3 LDA RAM_SpriteSpeedX,X ; A = X speed R $01:E9E6 LDA RAM_SpriteSpeedX,X ; A = X speed R $01:E9F5 ADC RAM_SpriteSpeedX,X ; X speed += [$17BD] * 8 (compensate for screen scrolling) W $01:EA60 STA RAM_SpriteSpeedX,X ; X speed = +$10 or -$10 toward Mario W $01:ECCE STA RAM_SpriteSpeedX,X ; X speed = -$10 or +$10 by direction W $01:ECFB STZ RAM_SpriteSpeedX,X ; X speed = 0 W $01:EDAF STA RAM_SpriteSpeedX,X ; Yoshi X speed = Mario X speed W $01:F246 STA.W RAM_SpriteSpeedX,Y ; Item X speed = DATA_01F301[X] W $01:F51C STA.W RAM_SpriteSpeedX,Y ; Eaten sprite X speed = 0 R $01:F703 LDA RAM_SpriteSpeedX,X ; Kicked sprite's X speed W $01:F735 STA RAM_SpriteSpeedX,X ; Yoshi X speed W $01:F882 STA RAM_SpriteSpeedX,X ; Store X speed W $01:F962 STA RAM_SpriteSpeedX,X ; X speed moves one step toward 0 W $01:F9A0 STA RAM_SpriteSpeedX,X ; X speed += DATA_01EBB4[Y] (+1 / -1): accelerate toward Mario W $01:FA87 STA RAM_SpriteSpeedX,X ; X speed = DATA_01FA56[direction] W $01:FB9B STZ RAM_SpriteSpeedX,X ; X speed = 0 W $01:FBEE STA RAM_SpriteSpeedX,X ; X speed = A W $02:8174 STA.W RAM_SpriteSpeedX,Y ; Target X speed = 0 W $02:94B8 STA RAM_SpriteSpeedX,X ; X speed = DATA_029392[Y]: pushed away from Mario W $02:A11A STA RAM_SpriteSpeedX,X ; Death X speed from FireKillSpeedX (away from Mario) W $02:AFF7 STA RAM_SpriteSpeedX,X ; Set X speed W $02:B1B1 STA RAM_SpriteSpeedX,X ; Sprite X speed W $02:B2CA STA RAM_SpriteSpeedX,X ; Sprite X speed = $E8 (gen 5) or $18 (gen 6) W $02:B31C STA RAM_SpriteSpeedX,X ; Sprite X speed = $10 or $F0 (toward the screen) W $02:B379 STA RAM_SpriteSpeedX,X ; Set X speed W $02:B6D5 STA RAM_SpriteSpeedX,X ; X speed = PokeySpeed[direction] W $02:B866 STA.W RAM_SpriteSpeedX,Y ; Detached piece X speed = half of it R $02:B8C5 LDA RAM_SpriteSpeedX,X ; A = X speed W $02:BBEE STA RAM_SpriteSpeedX,X ; X speed += acceleration from DATA_02BB88 W $02:BD96 STA RAM_SpriteSpeedX,X ; X speed = -X speed W $02:BDC2 STA RAM_SpriteSpeedX,X ; X speed = probe speed (+/-1) W $02:BE39 STA RAM_SpriteSpeedX,X ; X speed from table (+/-8 or 0) RW $02:BE41 ASL RAM_SpriteSpeedX,X ; X speed *= 2 W $02:C004 STA RAM_SpriteSpeedX,X ; Restore the real X speed W $02:C010 STZ RAM_SpriteSpeedX,X ; Yes: X speed = 0 R $02:C038 LDA RAM_SpriteSpeedX,X ; X speed RW $02:C03E INC RAM_SpriteSpeedX,X ; Negative: X speed++ RW $02:C042 DEC RAM_SpriteSpeedX,X ; X speed-- R $02:C09E LDA RAM_SpriteSpeedX,X ; X speed W $02:C0A9 STA RAM_SpriteSpeedX,X ; Store X speed W $02:C1D4 STA.W RAM_SpriteSpeedX,Y ; Store X speed W $02:C579 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $02:C59A STA RAM_SpriteSpeedX,X ; Store as sprite X speed W $02:C5EE STA.W RAM_SpriteSpeedX,Y ; Clone X speed = $10 or $F0 (flies apart) W $02:C711 STA RAM_SpriteSpeedX,X ; X speed = table by direction/charge W $02:C7B1 STZ RAM_SpriteSpeedX,X ; X speed = 0 R $02:D21A LDA RAM_SpriteSpeedX,X ; A = sprite X speed RW $02:D222 INC RAM_SpriteSpeedX,X ; Negative: X speed += 2... RW $02:D224 DEC RAM_SpriteSpeedX,X ; ...then X speed -= 1 (net +1 or -1 toward zero) W $02:D245 STA RAM_SpriteSpeedX,X ; Store the new X speed W $02:D59A STA RAM_SpriteSpeedX,X ; X speed = $E8 (-24, moves left) W $02:D93A STA RAM_SpriteSpeedX,X ; Sprite X speed = [BubbleSprGfxProp2+dir] (+8 or -8) W $02:DCD9 STZ RAM_SpriteSpeedX,X ; Landed: X speed = 0 W $02:DD19 STA RAM_SpriteSpeedX,X ; X speed = [DATA_02DD0C+Y] W $02:E28D STA RAM_SpriteSpeedX,X ; X speed from DATA_02E1F9 W $02:E325 STA RAM_SpriteSpeedX,X ; Store X speed W $02:E444 STY RAM_SpriteSpeedX,X ; Store as X speed (shaking) W $02:E5D2 STA RAM_SpriteSpeedX,X ; X speed = Y W $02:E754 STA RAM_SpriteSpeedX,X ; Store X speed W $02:E791 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $02:E826 STA RAM_SpriteSpeedX,X ; X speed = +/- 8 along the slope W $02:EB66 STA RAM_SpriteSpeedX,X ; X speed = +-$18 by direction W $02:EBA7 STA RAM_SpriteSpeedX,X ; Store the new X speed W $02:EBED STA RAM_SpriteSpeedX,X ; X speed = ±$18 by direction W $02:EE3C STA RAM_SpriteSpeedX,X ; X speed = shared raft speed [$18BC] W $02:EF17 STA RAM_SpriteSpeedX,X ; X speed = 8 W $02:F093 STA RAM_SpriteSpeedX,X ; X speed = WigglerSpeed[Y]: +8, -8 or +$10, -$10 W $02:F348 STA RAM_SpriteSpeedX,X ; X speed = DATA_02F340[direction] W $02:F391 STZ RAM_SpriteSpeedX,X ; Speed X and Y = 0 W $02:F442 STY RAM_SpriteSpeedX,X ; X speed = Y W $03:803D STA RAM_SpriteSpeedX,X ; X speed = -[X speed] (bounce off the wall) R $03:8072 ADC RAM_SpriteSpeedX,X ; A = [X speed] + DATA_038007[[$15B8] + 3] (slope pushes the ball) W $03:8084 STA RAM_SpriteSpeedX,X ; Store new X speed W $03:815C STA RAM_SpriteSpeedX,X ; X speed += DATA_0380FA[[$151C] & 1] W $03:81D8 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $03:851C STA RAM_SpriteSpeedX,X ; X speed = BlurpSpeedX[direction] W $03:855C STA RAM_SpriteSpeedX,X ; X speed += PorcuPuffAccel[direction] W $03:856A STA RAM_SpriteSpeedX,X ; Temporary X speed += [$17BD] * 8 (probably compensates screen scroll) W $03:8571 STA RAM_SpriteSpeedX,X ; Restore the saved X speed W $03:8640 STA RAM_SpriteSpeedX,X ; X speed = [$1B9A] ($08 once the scroll has started, else 0) W $03:8783 STA RAM_SpriteSpeedX,X ; X speed = MegaMoleSpeed[direction] R $03:891E LDA RAM_SpriteSpeedX,X ; A = X speed W $03:8929 STA RAM_SpriteSpeedX,X ; X speed += DATA_0388E2[direction] RW $03:89E9 DEC RAM_SpriteSpeedX,X ; Move X speed one step toward 0 W $03:89FC STA RAM_SpriteSpeedX,X ; X speed += acceleration W $03:8A8F STA RAM_SpriteSpeedX,X ; X speed = -X speed W $03:8AA4 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $03:8ABC STA RAM_SpriteSpeedX,X ; Face Mario and set X speed from BwsrStatueSpeed W $03:8C4D STA RAM_SpriteSpeedX,X ; Sprite X speed = A R $03:8C4F LDA RAM_SpriteSpeedX,X ; A = sprite X speed W $03:8DEB STA RAM_SpriteSpeedX,X ; Mario is on it: X speed = state = $10 (start moving) R $03:90D8 ADC RAM_SpriteSpeedX,X ; X speed += [$17BD] * 8 (compensates for screen scrolling, probably) W $03:90E1 STA RAM_SpriteSpeedX,X ; Restore the unadjusted X speed W $03:92C7 STA RAM_SpriteSpeedX,X ; Speed X = CrtEatBlkSpeedX[direction] W $03:9333 STA RAM_SpriteSpeedX,X ; Speed X = Speed Y = 1 (probe down and right) W $03:9341 STA RAM_SpriteSpeedX,X ; Speed X = Speed Y = $FF (probe up and left) W $03:9567 STA RAM_SpriteSpeedX,X ; Sprite X speed = A W $03:9601 STA RAM_SpriteSpeedX,X ; Sprite X speed = RexKilledSpeed[Y] (away from Mario) R $03:9748 LDA RAM_SpriteSpeedX,X ; A = X speed R $03:976A LDA RAM_SpriteSpeedX,X ; A = X speed RW $03:9770 INC RAM_SpriteSpeedX,X ; Negative: speed++ (towards 0) RW $03:9773 DEC RAM_SpriteSpeedX,X ; Positive: speed-- (towards 0) W $03:9CEC STA RAM_SpriteSpeedX,X ; X speed W $03:9D41 STZ RAM_SpriteSpeedX,X ; X speed = 0: stand still while breathing W $03:9FE1 STA RAM_SpriteSpeedX,X ; Sprite X speed W $03:A454 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $03:A467 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $03:A6C5 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $03:A711 STZ RAM_SpriteSpeedX,X ; X speed = 0 R $03:A852 LDA RAM_SpriteSpeedX,X ; X speed RW $03:A856 DEC RAM_SpriteSpeedX,X ; Slow down: X speed-- W $03:A877 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $03:A8A4 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $03:A92A STY RAM_SpriteSpeedX,X ; X speed R $03:AB3E LDA RAM_SpriteSpeedX,X ; X speed W $03:AB49 STA RAM_SpriteSpeedX,X ; X speed W $03:AB97 STA RAM_SpriteSpeedX,X ; X speed = $10 or $F0 (away from or toward Mario) W $03:ABC1 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $03:AC29 STA RAM_SpriteSpeedX,X ; X speed = $FA (fly left) W $03:AD18 STZ RAM_SpriteSpeedX,X ; X speed = 0 W $03:AE02 STA RAM_SpriteSpeedX,X ; Peach X speed = DATA_03ADD9[Y] W $03:B06C STA RAM_SpriteSpeedX,X ; X speed = DATA_03B017[Y] W $03:B144 STA.W RAM_SpriteSpeedX,Y ; Thrown sprite X speed = 0 W $03:B1C3 STA RAM_SpriteSpeedX,X ; Start rolling toward Mario (X speed from BowserBallSpeed) W $03:B2D2 STA RAM_SpriteSpeedX,X ; X speed = walk speed for the direction RW $03:C85F INC RAM_SpriteSpeedX,X ; X speed [$B6] used as a frame counter W $03:CBFA STA.W RAM_SpriteSpeedX,Y ; New X speed = $18 / $E8 by direction W $07:F754 STZ RAM_SpriteSpeedX,X ; Sprite X speed = 0 $00C1 Slot minus one of sprite state byte (used as $C1,X once) Only real use: Yoshi runs away after Mario is hit by a smoke puff ($02:A488 `STA $C1,X`, value 2). X is [$18DF ] (Yoshi slot plus one), so this probably lands on Yoshi's own $00C2 state entry. All other hits are the byte $C1 inside pointer tables (growing vine, Chuck states, scroll routines).
Values: 2 = Yoshi state 'runs away'.
1 use in 1 routine (1 write) W $02:A488 STA $C1,X ; Yoshi state = 2 (runs away) $00C2 Sprite state RAM_SpriteState byte table, one per sprite slot (index X) General-purpose state number of each sprite slot, the 'which phase am I in' variable of the sprite's main routine. Most sprites dispatch through a pointer table on it and advance it with INC (State++) or reset it with STZ. Meaning is per sprite type: Urchin and Big Boo phases, Wall springboard compression (signed), Turn block bridge
0 = extending / 1 = retracting, Flying question block (wings fall off), Power-up 'clear when free'. Slot 0 is $00C2 , slot 1 is $00C3, ... slot 11 is $00CD.
Values: 0 = initial / idle state; higher values = later phases (sprite specific).
350 uses in 189 routines (163 read, 95 write, 92 read-modify-write) RW $00:FCD8 INC RAM_SpriteState,X ; Sprite state++: Yoshi is mounted W $01:831A STY RAM_SpriteState,X ; Sprite state = Y W $01:8375 STA RAM_SpriteState,X ; Sprite state = 3 W $01:83B0 STA RAM_SpriteState,X ; Sprite state = ExplodingBlkSpr[Y] RW $01:843B INC RAM_SpriteState,X ; Sprite state += 1 W $01:84E1 STA RAM_SpriteState,X ; Sprite state = Y (direction) W $01:851A STA RAM_SpriteState,X ; Sprite state = chuck type (chucks share most of their code) W $01:8554 STA RAM_SpriteState,X ; Sprite state = segment bit mask W $01:8567 STY RAM_SpriteState,X ; Sprite state = Y RW $01:858B INC RAM_SpriteState,X ; Sprite state += 1 W $01:89A0 STA.W RAM_SpriteState,Y ; Kicked sprite [$C2] = its [$1540] R $01:8A88 LDA RAM_SpriteState,X ; [$C2,X] kick pose timer RW $01:8A8C DEC RAM_SpriteState,X ; [$C2,X]-- RW $01:8D02 INC RAM_SpriteState,X ; Count a frame in [RAM_SpriteState,X] RW $01:8D4E INC RAM_SpriteState,X ; Count a frame in [RAM_SpriteState,X] RW $01:8EEC INC RAM_SpriteState,X ; Next state R $01:8FF0 LDY RAM_SpriteState,X ; Y = flight direction [$C2,X] (0-7) W $01:A080 STA RAM_SpriteState,X ; Sprite state [$C2] = [$1540] (probably a timer carried over) W $01:A757 STA RAM_SpriteState,X ; Koopa X state [$C2] = $20 W $01:A97F STA RAM_SpriteState,X ; Sprite state = 2 R $01:AA0B LDA RAM_SpriteState,X ; A = sprite state W $01:AA9D STA RAM_SpriteState,X ; Restore it into the sprite state RW $01:AE0F INC RAM_SpriteState,X ; State [$C2]++ (wings fall off) W $01:AE59 STA.W RAM_SpriteState,Y ; Yes: its state [$C2] = $FF R $01:AEB7 LDA RAM_SpriteState,X ; A = state [$C2] RW $01:AEF3 INC RAM_SpriteState,X ; State [$C2] = 1: fall RW $01:AF21 INC RAM_SpriteState,X ; State [$C2] = 2: rise W $01:AF35 STA RAM_SpriteState,X ; Yes: state [$C2] = 0, wait again RW $01:AFED INC RAM_SpriteState,X ; State [$C2]++ (alternates hop direction) RW $01:B0C8 INC RAM_SpriteState,X ; State [$C2]++ (reverses direction) RW $01:B1CC INC RAM_SpriteState,X ; State [$C2]++ W $01:B200 STZ RAM_SpriteState,X ; State [$C2] = 0 RW $01:B233 INC RAM_SpriteState,X ; Else state [$C2] = 1 RW $01:B278 INC RAM_SpriteState,X ; State [$C2]++ (frame counter) RW $01:B4EB INC RAM_SpriteState,X ; Sprite state = 1 (hit) RW $01:B6D7 INC RAM_SpriteState,X ; State++: reverse direction (bit 1 toggles every second step, switching axis) R $01:B6E7 LDY RAM_SpriteState,X ; Y = state (0 = extending, 1 = retracting) RW $01:B948 INC RAM_SpriteState,X ; State = 1 (moves vertically) R $01:B9B1 LDA RAM_SpriteState,X ; A = state (0 horizontal, 1 vertical) R $01:BA02 LDY RAM_SpriteState,X ; Y = state (0 horizontal, 1 vertical) R $01:BA41 LDA RAM_SpriteState,X ; A = state W $01:BDE0 STZ RAM_SpriteState,X ; Yes: reset to state 0 (hidden) RW $01:BE4F INC RAM_SpriteState,X ; Next state (fade in) RW $01:BE80 INC RAM_SpriteState,X ; Timer ran out: next state (fade out) RW $01:BFF7 INC RAM_SpriteState,X ; Next state (wraps to 0: hidden) RW $01:C020 INC RAM_SpriteState,X ; Yes: next state (visible) W $01:C3EF STZ RAM_SpriteState,X ; Clear the state once it is free W $01:C6FD STZ RAM_SpriteState,X ; Clear the state W $01:C7CC STA RAM_SpriteState,X ; Remember the current X in [$C2,X] for next frame R $01:D524 LDA RAM_SpriteState,X ; Sprite state (sway phase) RW $01:D538 INC RAM_SpriteState,X ; Yes: state++ (reverses direction and swing side) R $01:D540 LDA RAM_SpriteState,X ; Sprite state R $01:D75C LDA RAM_SpriteState,X ; Sprite state W $01:D78F STZ RAM_SpriteState,X ; State 0: pick next segment W $01:D7AD STZ RAM_SpriteState,X ; State 0: pick next segment W $01:D86F STA RAM_SpriteState,X ; No line found: sprite state = 2 (fall off the end) W $01:D935 STA RAM_SpriteState,X ; Sprite state = 1: follow the segment RW $01:DE7C INC RAM_SpriteState,X ; Block state = 1 (hit; its symbol is now frozen) R $01:E10D ORA RAM_SpriteState,X ; Every 8th frame, state 0 only ... RW $01:E2F1 INC RAM_SpriteState,X ; State = 1 RW $01:E311 INC RAM_SpriteState,X ; State = 2 RW $01:E38C INC RAM_SpriteState,X ; Landed: state = 3 W $01:E553 STZ RAM_SpriteState,X ; $32: [state] = 0 (may turn around at a ledge again) R $01:E56C LDA RAM_SpriteState,X ; [state] = 0? RW $01:E570 INC RAM_SpriteState,X ; [state] = 1: only turn around once per ledge R $01:E7F5 LDA RAM_SpriteState,X ; No Lakitu: A = [state] (0 empty, 1 Mario riding) RW $01:E812 INC RAM_SpriteState,X ; [state] = 1: Mario boards the cloud W $01:E895 STZ RAM_SpriteState,X ; [state] = 0: cloud is empty again R $01:E8DC LDY RAM_SpriteState,X ; Y = [state] W $01:ED58 STA RAM_SpriteState,X ; Yoshi state = 1 (ridden) W $01:EDA3 STZ RAM_SpriteState,X ; Yoshi state = 0 (free) R $01:EFB8 LDA RAM_SpriteState,X ; Yoshi state [$C2,X] R $01:F0A2 LDA RAM_SpriteState,X ; Yoshi state [$C2,X] R $01:F38B LDA.W RAM_SpriteState,Y ; (unused) Bubble contents state ... W $01:F3C7 STZ RAM_SpriteState,X ; Its state = 0 R $01:F3DF LDA.W RAM_SpriteState,Y ; Sprite state of the $7E sprite (0 = not active yet) R $01:F5EE LDA RAM_SpriteState,X ; Old Pokey segment bits W $01:F5F2 STA.W RAM_SpriteState,Y ; New Pokey keeps those segments R $01:F6BB LDA.W RAM_SpriteState,Y ; Its state R $01:F6E5 LDA.W RAM_SpriteState,Y ; Sprite state W $01:F724 STA RAM_SpriteState,X ; Yoshi state = 2 (running away, Mario thrown off) R $01:F8A4 LDA RAM_SpriteState,X ; Sprite state RW $01:F8B6 INC RAM_SpriteState,X ; Yes: flip direction W $01:F90C STZ RAM_SpriteState,X ; State = 0 (chase) by default RW $01:F912 INC RAM_SpriteState,X ; Yes: state = 1 (Boo is shy and hides its face) R $01:FAC1 LDA RAM_SpriteState,X ; A = Koopaling sprite state R $01:FEBC LDY RAM_SpriteState,X ; Y = Koopaling state R $01:FF5C LDY RAM_SpriteState,X ; Y = sprite state ([RAM_SpriteState]) RW $02:8A03 INC RAM_SpriteState,X ; Flying red coin: state += 2 RW $02:8A05 INC RAM_SpriteState,X ; State += 2 (second INC) W $02:9413 STZ RAM_SpriteState,X ; Reset its state to 0 W $02:AFE6 STA RAM_SpriteState,X ; Set sprite state W $02:B0C6 STA RAM_SpriteState,X ; Sprite state = side (sets its direction) W $02:B14F STA.W RAM_SpriteState,Y ; Sprite state = direction/side W $02:B257 STA RAM_SpriteState,X ; Sprite state = contents of the bubble (probably) R $02:B63C LDA RAM_SpriteState,X ; A = segment bitmask (bit set = segment present) R $02:B709 LDA RAM_SpriteState,X ; A = segment bitmask R $02:B710 LDA RAM_SpriteState,X ; A = segment bitmask W $02:B71F STA RAM_SpriteState,X ; Store the compacted bitmask RW $02:BBF5 INC RAM_SpriteState,X ; State++ (reverses direction) R $02:BCF4 LDY RAM_SpriteState,X ; Y = state (orientation) RW $02:BD72 INC RAM_SpriteState,X ; State++ RW $02:BDA4 INC RAM_SpriteState,X ; State++ R $02:BDB8 LDY RAM_SpriteState,X ; Y = state RW $02:BDFC INC RAM_SpriteState,X ; State++ (turn the next way around) W $02:BE04 STZ RAM_SpriteState,X ; State = 0 W $02:BE0C STA RAM_SpriteState,X ; State = 4 R $02:BE0E LDY RAM_SpriteState,X ; Y = state RW $02:BE1D DEC RAM_SpriteState,X ; State-- (turn back the other way) W $02:BE2D STA RAM_SpriteState,X ; State = A R $02:BE2F LDY RAM_SpriteState,X ; Y = state R $02:C024 LDA RAM_SpriteState,X ; A = state RW $02:C072 INC RAM_SpriteState,X ; Wake up: state = 1 W $02:C0CA STZ RAM_SpriteState,X ; Chase over: state = 0 R $02:C248 LDA RAM_SpriteState,X ; State R $02:C32B LDY RAM_SpriteState,X ; State R $02:C336 LDA RAM_SpriteState,X ; A = state W $02:C36E STA RAM_SpriteState,X ; State = $0C RW $02:C553 INC RAM_SpriteState,X ; Next state W $02:C577 STA RAM_SpriteState,X ; Done waiting: state = 5 W $02:C5A2 STA RAM_SpriteState,X ; State = 6 (in the air, landing handler) W $02:C5A7 STZ RAM_SpriteState,X ; State = 0 (look around) W $02:C65E STA RAM_SpriteState,X ; Store state W $02:C6DC STZ RAM_SpriteState,X ; State = 0 (look around) W $02:C735 STA RAM_SpriteState,X ; State = 1 (walk/charge) W $02:C78C STA RAM_SpriteState,X ; State = 2 (pause, then charge) W $02:C796 STA RAM_SpriteState,X ; Whistlin' Chuck: state = $C W $02:C7FD STA RAM_SpriteState,X ; State = 3 (hurt) R $02:CE20 LDA RAM_SpriteState,X ; A = [$C2] (compression, signed) W $02:CE2C STA RAM_SpriteState,X ; [$C2] += 1 W $02:CE32 STA RAM_SpriteState,X ; [$C2] = [$151C]: fully compressed W $02:CE5D STA RAM_SpriteState,X ; [$C2] += 4 (moving toward positive amplitude) W $02:CE6A STA RAM_SpriteState,X ; [$C2] = [$151C] W $02:CE75 STA RAM_SpriteState,X ; [$C2] -= 4 (moving toward negative amplitude) W $02:CE80 STA RAM_SpriteState,X ; [$C2] = -[$151C] W $02:CE86 STZ RAM_SpriteState,X ; [$C2] = 0: spring is straight again R $02:CFE3 LDY RAM_SpriteState,X ; Y = [$C2] (current compression) R $02:D409 LDA RAM_SpriteState,X ; A = sprite state RW $02:D427 INC RAM_SpriteState,X ; Next state RW $02:D452 INC RAM_SpriteState,X ; Next state RW $02:D47E INC RAM_SpriteState,X ; Next state RW $02:D486 INC RAM_SpriteState,X ; Next state W $02:D494 STZ RAM_SpriteState,X ; State = 0 R $02:D8C9 LDA RAM_SpriteState,X ; A = contained sprite type [RAM_SpriteState] (0-3) R $02:D978 LDY RAM_SpriteState,X ; Y = contained sprite type W $02:DBEB STA RAM_SpriteState,X ; Platform state = 1 (left side dips) RW $02:DBF6 INC RAM_SpriteState,X ; Mario on the right half: state = 2 R $02:DCDB LDA RAM_SpriteState,X ; A = Sumo Bro state [RAM_SpriteState] RW $02:DCFC INC RAM_SpriteState,X ; Next state W $02:DD42 STZ RAM_SpriteState,X ; State = 0 R $02:DFBC LDA RAM_SpriteState,X ; A = sprite state RW $02:DFD3 INC RAM_SpriteState,X ; State++ W $02:DFF9 STZ RAM_SpriteState,X ; State = 0 (loops back to idle) R $02:E130 LDA RAM_SpriteState,X ; A = sprite state RW $02:E153 INC RAM_SpriteState,X ; State++ RW $02:E174 INC RAM_SpriteState,X ; State++ W $02:E19C STZ RAM_SpriteState,X ; State = 0 R $02:E288 LDY RAM_SpriteState,X ; Y = state (direction) R $02:E2A8 CMP RAM_SpriteState,X ; Ignore the request if it is the reverse of the current direction W $02:E2C1 STA RAM_SpriteState,X ; Take the stored direction as the new state RW $02:E342 INC RAM_SpriteState,X ; Flip direction of acceleration (state++) RW $02:E77C INC RAM_SpriteState,X ; State++ (jump) RW $02:E7AA INC RAM_SpriteState,X ; State++ (back to swimming) RW $02:E89E INC RAM_SpriteState,X ; Next phase RW $02:E983 INC RAM_SpriteState,X ; State++ W $02:E9DF STZ RAM_SpriteState,X ; State = 0 R $02:EB7D LDA RAM_SpriteState,X ; Feather Super Koopa: run the routine for [state] RW $02:EBCA INC RAM_SpriteState,X ; Next state RW $02:EBDC INC RAM_SpriteState,X ; Reached $14: next state RW $02:ED8D INC RAM_SpriteState,X ; Sprite state++ W $02:F0D6 STA RAM_SpriteState,X ; State = ([state] << 1) OR direction (per-segment facing history) R $02:F331 LDA RAM_SpriteState,X ; A = bird state RW $02:F371 INC RAM_SpriteState,X ; Go to the pecking state W $02:F3B7 STZ RAM_SpriteState,X ; State = 0 (hopping) RW $02:F514 INC RAM_SpriteState,X ; ...change the flame frame R $03:80AA LDA RAM_SpriteState,X ; A = boss state [$C2] RW $03:80D2 INC RAM_SpriteState,X ; State = 1 (fade in) RW $03:80F2 INC RAM_SpriteState,X ; Fully visible: state = 2 (normal) W $03:810B STZ RAM_SpriteState,X ; Timer done: state = 0 RW $03:8190 INC RAM_SpriteState,X ; State = 4 (fade out) W $03:81A7 STA RAM_SpriteState,X ; State = 6 (defeated) RW $03:81CB INC RAM_SpriteState,X ; Fully faded out: state = 5 W $03:8208 STA RAM_SpriteState,X ; State = 3 (hit) RW $03:8514 INC RAM_SpriteState,X ; Max reached: state++ (reverse direction) RW $03:88F5 INC RAM_SpriteState,X ; State = 1 (swooping down) RW $03:8913 INC RAM_SpriteState,X ; Y speed reached 0: state = 2 (flying horizontally) RW $03:8C3E INC RAM_SpriteState,X ; Next movement phase: [sprite state]++ W $03:8D85 STZ RAM_SpriteState,X ; Clear sprite state RW $03:8E85 INC RAM_SpriteState,X ; Next phase: state++ RW $03:90C7 INC RAM_SpriteState,X ; State++: reverse the bobbing direction R $03:9242 LDA RAM_SpriteState,X ; A = sprite state RW $03:925A INC RAM_SpriteState,X ; Next state: state 1 R $03:9430 LDA RAM_SpriteState,X ; A = state RW $03:9468 INC RAM_SpriteState,X ; Next state R $03:953F LDY RAM_SpriteState,X ; Y = state (number of stomps) R $03:955E LDA RAM_SpriteState,X ; A = state RW $03:95B3 INC RAM_SpriteState,X ; Stomp count++ R $03:95B5 LDA RAM_SpriteState,X ; A = stomp count R $03:9720 LDA RAM_SpriteState,X ; A = state W $03:9878 STA RAM_SpriteState,X ; State = 4 (only slot 7) R $03:9C60 LDA RAM_SpriteState,X ; A = sprite state [$C2,X] W $03:9C78 STZ RAM_SpriteState,X ; Falling: state = 0 (walk) W $03:9CC6 STA RAM_SpriteState,X ; State = 1 or 2: pick the flame direction W $03:9CFE STA RAM_SpriteState,X ; State = 3 (jumping) W $03:9D48 STZ RAM_SpriteState,X ; Timer ran out: state = 0 (walk) R $03:9D5D LDY RAM_SpriteState,X ; Y = state R $03:9F46 LDA RAM_SpriteState,X ; A = Blargg state RW $03:9F88 INC RAM_SpriteState,X ; State 1 RW $03:9F96 INC RAM_SpriteState,X ; State 2 RW $03:9FA9 INC RAM_SpriteState,X ; Timer expired: state 3 RW $03:9FEA INC RAM_SpriteState,X ; State 4 W $03:A01B STZ RAM_SpriteState,X ; State 0: hide again R $03:A065 LDA RAM_SpriteState,X ; A = state W $03:A111 STA RAM_SpriteState,X ; State = 3 RW $03:A825 INC RAM_SpriteState,X ; Sprite state [$00C2]++ R $03:AD21 LDA RAM_SpriteState,X ; A = Peach state [$C2] RW $03:AD61 INC RAM_SpriteState,X ; Peach state++ RW $03:ADB8 INC RAM_SpriteState,X ; Peach state++ RW $03:AE1D INC RAM_SpriteState,X ; Peach state++ RW $03:AE2A INC RAM_SpriteState,X ; Peach state++ RW $03:AE37 INC RAM_SpriteState,X ; Peach state++ RW $03:AEC8 INC RAM_SpriteState,X ; Peach state++ RW $03:AED0 INC RAM_SpriteState,X ; Peach state++ W $03:C207 STZ RAM_SpriteState,X ; Sprite state = 0 R $03:C21F LDA.W RAM_SpriteState,Y ; A = its sprite state W $03:C224 STA.W RAM_SpriteState,Y ; Store it RW $03:C379 INC RAM_SpriteState,X ; Hop counter [$C2]++ R $03:C4B3 LDA RAM_SpriteState,X ; A = state (lit flag) R $03:C816 LDA RAM_SpriteState,X ; A = state RW $03:C83A INC RAM_SpriteState,X ; State++ RW $03:C86F INC RAM_SpriteState,X ; State++ (burst) RW $03:C8E0 INC RAM_SpriteState,X ; State++ (fade out) W $03:CD01 STA.W RAM_SpriteState,Y ; Copy [$C2] (state value used for Y position) from the main sprite W $07:F728 STZ RAM_SpriteState,X ; Sprite state = 0 W $0C:A78F STA RAM_SpriteState ; Sprite state = 2 $00CB Bonus game flag byte Set to 1 by the Init bonus game sprite ($01:DE08 `LDA #$01 : STA $CB`). No sample reads it back directly, so it is probably a leftover flag. As sprite slot 9 state it is also the $00C2 table element (see $00C2 ). Other hits are the byte $CB inside pointers (level data, cutscene state tables).
Values: 1 = set by bonus game init.
1 use in 1 routine (1 write) $00CE Sprite data pointer, low byte pointer (24-bit with $00CF, $00D0) Low byte of the long pointer to the current level's sprite list. Load Level copies the pointer from Ptrs05EC00 into $00CE /$00CF and forces the bank byte $00D0 to $07; it then reads the list header with `LDA [$CE ]`. Spawn-sprite-from-level-data and the Sprite list loop walk it with `LDA [$CE ],Y` (format YYYYEEsy per entry in horizontal levels). Chocolate Island 2 also rewrites it from its own sprite table. Other hits are the byte $CE inside pointer words.
23 uses in 11 routines (20 read, 3 write) R $02:A82E LDA [$CE],Y ; A = byte YYYYEEsy R $02:A95B LDA [$CE],Y ; Horizontal level: first byte is YYYYEEsy R $02:A97A LDA [$CE],Y ; A = sprite number from the level data R $02:AB48 LDA [$CE],Y ; First byte of the sprite's level data R $02:ABAD LDA [$CE],Y ; Vertical level: first byte of the level data R $02:ABC7 LDA [$CE],Y ; First byte of the level data R $02:AF35 LDA [$CE],Y ; A = first byte: YYYY---H (Y position, Y screen bit) R $02:AF9F LDA [$CE],Y ; A = first byte: YYYY---H R $05:D8F9 LDA [$CE] ; A = first byte of the level's sprite data (sprite header) W $05:DB55 STA $CE ; Sprite pointer low word [$CE] = ChocIsld2Sprites[X] $00CF Sprite data pointer, high byte pointer (middle byte of $00CE/$00CF/$00D0) High byte of the 16-bit address within bank $07 of the level's sprite list. Set with `STA $CF` in Load level ($05:D8F3) from the second byte of the pointer table entry; read together with $00CE through `[$CE ]`. Other hits are the byte $CF inside pointer words (cutscene states, Koopa Kid states, level tally).
2 uses in 1 routine (2 write) $00D0 Sprite data pointer, bank byte pointer (bank byte of $00CE) Bank byte of the sprite list pointer. Load level sets it to $07 because all level sprite data lives in bank $07. Hits at $05:C6A8 are misdisassembled data (a TRB that is really other code), not a real use.
Values: $07 = sprite data bank.
3 uses in 2 routines (2 write, 1 read-modify-write) RW $05:C6A8 TRB $D0 ; Unused, misdisassembled. Real code: [$55] = [$56] = 2; A 16-bit; [$1440] != 0: go to $05C6CD; else A = [$1446] W $05:D8F7 STA $D0 ; [$D0] = $07: all sprite data is in bank $07 $00D1 Mario X position copy, low word low byte (with $00D2) Copy of Mario's X position, low byte ([$94 ] is the original). Game mode 14 (in level, $00:A2F7) copies $0094 into $00D1 each frame, in 16-bit mode, so $00D2 receives the high byte. Sprite routines use it as Mario's position (Mario horizontal position relative to sprite, Release carried sprite, Lakitu's cloud). Lakitu's cloud copies it into the cloud's X low. Other hits are the byte $D1 inside pointer words.
5 uses in 4 routines (4 read, 1 write) R $01:AD32 LDA $D1 ; A = Mario X low [$D1] $00D2 Mario X position copy, high word high byte (with $00D1) High byte of the copy of Mario's X position ([$95 ] is the original), filled together with $00D1 from game mode 14. Read by Mario horizontal position relative to sprite, Release carried sprite and Lakitu's cloud logic. Other hits are the byte $D2 inside pointer words (cutscene states, Mario animation routines).
4 uses in 3 routines (4 read) R $01:AD39 LDA $D2 ; A = Mario X high [$D2] $00D3 Mario Y position copy, low word low byte (with $00D4) Copy of Mario's Y position, low byte ([$96 ] is the original), written each frame from game mode 14 ($00:A2FB). Used by sprites as Mario's Y: sprite-minus-Mario distance for stomp/bounce, Lakitu's cloud (cloud Y = Mario Y + offset), pipe animation. Boo main routine temporarily subtracts [$18B6 ] from it to aim above Mario's feet, then restores it.
12 uses in 9 routines (8 read, 4 write) R $01:AABD SBC $D3 ; [A] = sprite Y - Mario Y R $01:AD44 LDA $D3 ; A = Mario Y low [$D3] R $01:E81E ADC $D3 ; Cloud Y (low) = Mario Y + offset W $01:EDD6 STA $D3 ; Mario Y position (and copy in $D3) W $01:F9B9 STA $D3 ; Restore Mario Y position $00D4 Mario Y position copy, high word high byte (with $00D3) High byte of the copy of Mario's Y position ([$97 ] is the original), filled with $00D3 from game mode 14. Read by the stomp/hurt contact check, position-relative routines and Lakitu; Boo main routine also writes it while aiming. Put Mario on Yoshi copies a value into it. Other hits are the byte $D4 inside pointer words.
8 uses in 5 routines (5 read, 3 write) R $01:AD4B LDA $D4 ; A = Mario Y high [$D4] W $01:F9B0 STA $D4 ; Temporarily Mario Y [$D3] -= [$18B6] (aim above Mario's feet) $00D5 Wiggler buffer pointer, low pointer (24-bit with $00D6, $00D7) Low byte of a temporary long pointer to a Wiggler's position history buffer ([$D5 ],Y). Wiggler init and main routine store the sprite's X/Y low into the buffer through it; Wiggler draw reads each segment's history back. Set from sprite slot n AND 3 plus $7B at $02:F011. Other hits are the byte $D5 inside level data pointers.
9 uses in 3 routines (4 read, 5 write) W $02:EFFC STA [$D5],Y ; Buffer X = sprite X low W $02:F001 STA [$D5],Y ; Buffer Y = sprite Y low W $02:F01B STA $D5 ; [$D5] = $7B + low offset W $02:F0FB STA [$D5],Y ; Buffer[0] = sprite X position W $02:F100 STA [$D5],Y ; Buffer[1] = sprite Y position R $02:F14F LDA [$D5],Y ; A = history X for this segment R $02:F15C LDA [$D5],Y ; A = history Y for this segment $00D6 Wiggler buffer pointer, middle pointer (middle byte of $00D5) High byte of the Wiggler buffer address: $9A plus a per-slot offset (DATA_02EFEE). Set at $02:F022 by Wiggler init. With $00D7 = $7F the buffer is at $7F:9A7B + n * $80 (n = slot AND 3). Other hits are the byte $D6 inside pointer tables (sprite init/main routines, level data).
1 use in 1 routine (1 write) W $02:F022 STA $D6 ; [$D6] = $9A + high offset with carry $00D7 Wiggler buffer pointer, bank pointer (bank byte of $00D5) Bank byte of the Wiggler buffer pointer; Wiggler init sets it to $7F. Other hits are the byte $D7 inside pointer tables (line-guide platform routines, Chocolate Island 2 sprite table, level data).
Values: $7F = Wiggler history buffer bank.
1 use in 1 routine (1 write) W $02:F026 STA $D7 ; [$D7] = $7F: buffer at $7F:9A7B + n * $80 (n = slot AND 3) $00D8 Sprite Y position low RAM_SpriteYLo byte table, one per sprite slot (index X) Low byte of each sprite's Y position in the level (RAM_SpriteYLo); [$14D4 ] is the high byte. Everything that moves a sprite adds speed to it; collision, drawing and block interaction read it. Slot 0 is $00D8 , slot 1 is $00D9, ... slot 11 is $00E3.
408 uses in 216 routines (254 read, 148 write, 6 read-modify-write) R $00:FB92 LDA.W RAM_SpriteYLo,Y ; A = sprite Y low W $00:FC5B STA.W RAM_SpriteYLo,Y ; Yoshi Y = Mario Y W $00:FD00 STA RAM_SpriteYLo,X ; Sprite Y low = 0 RW $01:8311 INC RAM_SpriteYLo,X ; Y position += 2 RW $01:8404 INC RAM_SpriteYLo,X ; Y position low += 1 (sprite hugs the wall) W $01:84BB STA.W RAM_SpriteYLo,Y ; Cloud Y position low = Lakitu's RW $01:85B7 DEC RAM_SpriteYLo,X ; Sprite Y position low -= 1 R $01:85B9 LDA RAM_SpriteYLo,X ; A = new Y low RW $01:8890 DEC RAM_SpriteYLo,X ; Sprite Y position low -= 1 W $01:8C08 STA RAM_SpriteYLo,X ; Restore Y position low R $01:9E95 LDA RAM_SpriteYLo,X ; Draw both Koopa wings: save sprite Y low W $01:9F06 STA RAM_SpriteYLo,X ; Restore sprite Y low R $01:A3A6 LDA RAM_SpriteYLo,X ; A = sprite Y low R $01:AABA LDA RAM_SpriteYLo,X ; A = sprite Y low R $01:AB8D LDA RAM_SpriteYLo,X ; Smoke X/Y = sprite position (low bytes) W $01:ABFC STA RAM_SpriteYLo,X ; Position low byte += displacement + carry R $01:AD47 SBC RAM_SpriteYLo,X ; Minus sprite Y low W $01:B64C STA RAM_SpriteYLo,X ; Restore sprite Y low W $01:B9BC STA RAM_SpriteYLo,X ; Sprite Y low -= $0C (shift the turn graphics up) W $01:B9F8 STA RAM_SpriteYLo,X ; Restore Y position low W $01:BA92 STA RAM_SpriteYLo,X ; Sprite Y += 7 (carry from the add above is clear) W $01:BCAF STA RAM_SpriteYLo,X ; Sprite Y low = block Y low rounded to 16 W $01:BE15 STA RAM_SpriteYLo,X ; Sprite Y = (random + screen Y) & $F0: random row on screen W $01:BF47 STA.W RAM_SpriteYLo,Y ; New Y = this sprite's Y + $0A (at the wand) R $01:C1DC LDA RAM_SpriteYLo,X ; $98 = Sprite Y position W $01:C411 STA RAM_SpriteYLo,X ; Snap Y to a 16-pixel boundary W $01:CD41 STA RAM_SpriteYLo,X ; Sprite Y low = $40 W $01:CD50 STY RAM_SpriteYLo,X ; Sprite Y low = $90 W $01:D034 STA RAM_SpriteYLo,X ; Sprite Y low = $D0 W $01:D0D7 STA RAM_SpriteYLo,X ; Sprite Y = floor Y R $01:D1C6 LDA RAM_SpriteYLo,X ; Y = wall number, A = sprite Y low W $01:D36F STA RAM_SpriteYLo,X ; Store Y low R $01:D391 ADC RAM_SpriteYLo,X ; Add the floor height change to the boss Y W $01:D393 STA RAM_SpriteYLo,X ; Store Y low R $01:D42D ADC RAM_SpriteYLo,X ; + boss Y low RW $01:D513 INC RAM_SpriteYLo,X ; Odd frames: Y position++ (slow descent) R $01:D5C9 LDA RAM_SpriteYLo,X ; Sprite Y low W $01:D5CF STA RAM_SpriteYLo,X ; Move sprite up to the canopy position R $01:D628 ADC RAM_SpriteYLo,X ; Add to Y low W $01:D62A STA RAM_SpriteYLo,X ; Store Y low W $01:D66A STA RAM_SpriteYLo,X ; Restore Y low W $01:D6C1 STA RAM_SpriteYLo,X ; Store Y low R $01:D7CE LDA RAM_SpriteYLo,X ; Sprite Y low W $01:D7D5 STA RAM_SpriteYLo,X ; Store Y R $01:D8F5 LDA RAM_SpriteYLo,X ; A = sprite Y low W $01:DAD7 STA RAM_SpriteYLo,X ; Restore Y low W $01:DB36 STA RAM_SpriteYLo,X ; Restore Y low W $01:DDCE STA RAM_SpriteYLo,X ; Sprite Y low = start position table W $01:DEBF STA.W RAM_SpriteYLo,Y ; Snap block Y to the 8-pixel grid: Y = ([Y] + 4) & $F8 W $01:E060 STA RAM_SpriteYLo,X ; Y position += $10 ... R $01:E5CE CMP RAM_SpriteYLo,X ; If Mario's Y + $14 >= sprite Y (Mario not above it): hurt Mario W $01:EA47 STA.W RAM_SpriteYLo,Y ; New sprite Y low = spawner's Y low W $01:EB69 STA RAM_SpriteYLo,X ; Yoshi Y low = Mario Y low + $10 W $01:ECB8 STA.W RAM_SpriteYLo,Y ; Y low = Yoshi Y low + 8 W $01:EF2D STA RAM_SpriteYLo,X ; Y position += YoshiPositionY[frame] (body bob) W $01:EF9C STA RAM_SpriteYLo,X ; Y position += $10 (body is below the head) W $01:EFAB STA RAM_SpriteYLo,X ; Restore Y position lo W $01:F215 STA.W RAM_SpriteYLo,Y ; Item Y lo = Yoshi Y lo R $01:F50A ADC RAM_SpriteYLo,X ; A = Yoshi Y low + offset W $01:F50C STA.W RAM_SpriteYLo,Y ; Eaten sprite Y low R $01:F553 ADC RAM_SpriteYLo,X ; A = tongue Y offset + 2 + Yoshi Y low W $01:F5DD STA.W RAM_SpriteYLo,Y ; New Pokey Y low R $01:F6AD SBC.W RAM_SpriteYLo,Y ; A = Mario Y - sprite Y R $01:F7D1 LDA RAM_SpriteYLo,X ; Egg Y low W $01:FC7F STA RAM_SpriteYLo,X ; ...and [$14BA] W $01:FCEB STA RAM_SpriteYLo,X ; Sprite Y = [$14BA] - $10 W $01:FCF5 STA RAM_SpriteYLo,X ; Restore sprite Y W $02:863D STA RAM_SpriteYLo,X ; Sprite Y low = Mario Y low W $02:897D STA RAM_SpriteYLo,X ; Sprite Y low = block Y low W $02:8B59 STA RAM_SpriteYLo,X ; Sprite Y low = [$18C3] W $02:A952 STA RAM_SpriteYLo,X ; Y position = adjusted screen boundary [$00]/[$01] W $02:A960 STA RAM_SpriteYLo,X ; Y position low = high nibble of the first byte W $02:AC32 STA RAM_SpriteYLo ; Copy Y position low W $02:AF64 STA RAM_SpriteYLo,X ; Set Y low W $02:AFD7 STA RAM_SpriteYLo,X ; Set Y low W $02:B061 STA RAM_SpriteYLo,X ; Sprite Y low W $02:B0A8 STA RAM_SpriteYLo,X ; Sprite Y low W $02:B142 STA.W RAM_SpriteYLo,Y ; Sprite Y low W $02:B1E1 STA RAM_SpriteYLo,X ; Sprite Y low W $02:B22C STA RAM_SpriteYLo,X ; Sprite Y low W $02:B29F STA RAM_SpriteYLo,X ; Sprite Y low W $02:B2FA STA RAM_SpriteYLo,X ; Sprite Y low W $02:B356 STA RAM_SpriteYLo,X ; Set Y low W $02:C5D9 STA.W RAM_SpriteYLo,Y ; Clone Y position low = this Chuck's R $02:CC36 ADC RAM_SpriteYLo,X ; Sprite Y low += [$17BC] R $02:D0AA CMP RAM_SpriteYLo,X ; Compare with sprite Y low R $02:D0EA LDA RAM_SpriteYLo,X ; Unused. Layer 2 version of the tile lookup R $02:D3B2 LDA RAM_SpriteYLo,X ; A = sprite Y low R $02:D3DF LDA RAM_SpriteYLo,X ; A = sprite Y low W $02:D43D STZ RAM_SpriteYLo,X ; Sprite Y low = 0 R $02:D465 LDA RAM_SpriteYLo,X ; A = sprite Y low W $02:D46D STA RAM_SpriteYLo,X ; Store Y R $02:D490 LDA RAM_SpriteYLo,X ; A = sprite Y low R $02:D4A9 ADC RAM_SpriteYLo,X ; A += sprite Y low (bottom of the smasher) R $02:D511 SBC RAM_SpriteYLo,X ; A = Mario Y low - sprite Y low R $02:D70C ADC RAM_SpriteYLo,X ; Sprite Y low += Y offset R $02:D77E SBC RAM_SpriteYLo,X ; minus pivot Y low: signed Y distance to the ball R $02:D79C LDA RAM_SpriteYLo,X ; A = pivot Y low W $02:DDB0 STA.W RAM_SpriteYLo,Y ; Lightning Y position = Sumo Bro Y position W $02:E11D STA RAM_SpriteYLo,X ; Restore Y low W $02:E4C2 STA RAM_SpriteYLo,X ; Y position lo = [$1534] (partner platform Y lo) W $02:E4D8 STA RAM_SpriteYLo,X ; Restore Y position lo W $02:E866 STA RAM_SpriteYLo,X ; Restore Y lo W $02:EB0F STA.W RAM_SpriteYLo,Y ; New sprite Y low = this sprite's Y low W $02:EDA5 STA.W RAM_SpriteYLo,Y ; Y low = this sprite's W $02:EF92 STA.W RAM_SpriteYLo,Y ; Copy Y low W $02:F359 STA RAM_SpriteYLo,X ; Snap Y to the ground (multiple of 8) W $02:F573 STA RAM_SpriteYLo,X ; Y low = $E0 W $02:F957 STA RAM_SpriteYLo ; Sprite 0 Y low = cluster Y low R $03:9356 LDA RAM_SpriteYLo,X ; A = Y low W $03:9370 STA RAM_SpriteYLo,X ; Store Y low W $03:99DD STA RAM_SpriteYLo,X ; Sprite Y position low R $03:9B20 LDA RAM_SpriteYLo,X ; A = Reznor Y low W $03:9B26 STA RAM_SpriteYLo,X ; Temporarily move Reznor Y W $03:9B41 STA RAM_SpriteYLo,X ; Restore Reznor Y low R $03:9F80 LDA RAM_SpriteYLo,X ; Remember home Y low R $03:A045 LDA RAM_SpriteYLo,X ; A = Y low W $03:A04B STA RAM_SpriteYLo,X ; Y low -= $0C (splash just above the sprite) W $03:A0FA STA RAM_SpriteYLo,X ; Y low = $80 R $03:AB4D LDA RAM_SpriteYLo,X ; Bowser Y low W $03:AB86 STA RAM_SpriteYLo,X ; Bowser Y = $64 (land on the floor) W $03:AD58 STA RAM_SpriteYLo,X ; Peach Y = $A0 (ground) W $03:B03A STA.W RAM_SpriteYLo,Y ; Y position = Bowser Y + $10 W $03:B19B STA RAM_SpriteYLo,X ; Land on the floor: Y position = $B0 R $03:B6D0 ADC.W RAM_SpriteYLo,Y ; $05 = sprite Y + displacement (low byte) R $03:B716 ADC.W RAM_SpriteYLo,Y ; $01 = sprite Y + displacement (low byte) R $03:B8DC CMP RAM_SpriteYLo,X ; Compare with sprite Y low W $03:CBCC STA.W RAM_SpriteYLo,Y ; New sprite Y low = spawner Y low W $03:CCB8 STA RAM_SpriteYLo,X ; Set Y position W $03:CD17 STA.W RAM_SpriteYLo,Y ; Copy Y low R $03:DEF1 LDA RAM_SpriteYLo,X ; A = sprite Y position (16 bit) W $0C:A00D STA RAM_SpriteYLo ; Sprite slot 0 Y low = $8F W $0C:A27F STA RAM_SpriteYLo ; Yoshi Y position = $0160 $00E0 Sprite Y position low, slot 8 byte (element 8 of the $00D8 table) Y low of sprite slot 8. Bowser's Mechakoopa drop and ball throw (and phase 9 bounce) write it directly to place a newly spawned sprite below Bowser: Bowser Y low + $40 (or +$47), then InitSpriteTables with X = 8. Other hits are the byte $E0 inside pointers (Fireball init/main, level data).
2 uses in 2 routines (2 write) $00E4 Sprite X position low RAM_SpriteXLo byte table, one per sprite slot (index X) Low byte of each sprite's X position in the level (RAM_SpriteXLo); [$14E0 ] is the high byte. Moved by speed, read by collision, drawing and block interaction, and by Mario-relative checks. Slot 0 is $00E4 , slot 1 is $00E5, ... slot 11 is $00EF.
371 uses in 208 routines (245 read, 126 write) R $00:FB98 LDA.W RAM_SpriteXLo,Y ; A = sprite X low W $00:FCF7 STA RAM_SpriteXLo,X ; Sprite X low = $A0 R $01:841B LDA RAM_SpriteXLo,X ; A = X position low W $01:84B0 STA.W RAM_SpriteXLo,Y ; Cloud X position low = Lakitu's R $01:9EA6 LDA RAM_SpriteXLo,X ; Save sprite X low W $01:9EFF STA RAM_SpriteXLo,X ; Restore sprite X low R $01:A6FB SBC.W RAM_SpriteXLo,Y ; A = X low difference X - Y; sign selects side R $01:AC64 CMP RAM_SpriteXLo,X ; Compare screen X low + offset with sprite X low, remember result R $01:AD35 SBC RAM_SpriteXLo,X ; Minus sprite X low R $01:AD59 LDA RAM_SpriteXLo,X ; A = sprite X low R $01:B168 ADC RAM_SpriteXLo,X ; $02 = random offset + sprite X low R $01:B526 ADC RAM_SpriteXLo,X ; Mario X low = sprite X low + offset table [Y] R $01:B950 LDA RAM_SpriteXLo,X ; A = sprite X low W $01:BA8C STA RAM_SpriteXLo,X ; Sprite X += 8 W $01:BCA4 STA RAM_SpriteXLo,X ; Sprite X low = block X low rounded to 16 W $01:BE27 STA RAM_SpriteXLo,X ; Sprite X = (random + screen X) & $F0: random column on screen W $01:BF39 STA.W RAM_SpriteXLo,Y ; New X low = this sprite's X low R $01:C1D3 LDA RAM_SpriteXLo,X ; $9A = Sprite X position W $01:CD3D STA RAM_SpriteXLo,X ; Sprite X = $78 W $01:CD7F STA RAM_SpriteXLo,X ; Ludwig: sprite X low = $70 W $01:D097 STA.W RAM_SpriteXLo,Y ; New sprite X low W $01:D1C1 STA RAM_SpriteXLo,X ; Sprite X = limit for this wall R $01:D30B LDA RAM_SpriteXLo,X ; Boss X position R $01:D344 LDA RAM_SpriteXLo,X ; Boss X low R $01:D351 LDA RAM_SpriteXLo,X ; Save the boss position, shift it, show contact gfx, restore W $01:D376 STA RAM_SpriteXLo,X ; Store X low R $01:D40B LDA RAM_SpriteXLo,X ; Boss X low R $01:D46B LDA RAM_SpriteXLo,X ; Sprite X low R $01:D607 LDA RAM_SpriteXLo,X ; Sprite X low W $01:D60E STA RAM_SpriteXLo,X ; Store X low W $01:D6BA STA RAM_SpriteXLo,X ; Store X low R $01:D6D2 LDA RAM_SpriteXLo,X ; Sprite X low R $01:D6F0 LDA RAM_SpriteXLo,X ; Sprite X low R $01:D6F6 LDA RAM_SpriteXLo,X ; Sprite X low R $01:D70A LDA RAM_SpriteXLo,X ; Sprite X low W $01:D70F STA RAM_SpriteXLo,X ; Store X low R $01:D7D7 LDA RAM_SpriteXLo,X ; Sprite X low W $01:D7DE STA RAM_SpriteXLo,X ; Store X R $01:D8FF LDA RAM_SpriteXLo,X ; A = sprite X low W $01:DADE STA RAM_SpriteXLo,X ; Restore X low W $01:DB3D STA RAM_SpriteXLo,X ; Restore X low W $01:DDC4 STA RAM_SpriteXLo,X ; Sprite X low = start position table W $01:DECA STA.W RAM_SpriteXLo,Y ; Snap block X to the 8-pixel grid: X = ([X] + 4) & $F8 W $01:E1BD STA RAM_SpriteXLo,X ; Sprite X position += 8 (center the keyhole) W $01:E82B STA RAM_SpriteXLo,X ; Cloud X (low) = Mario X W $01:E868 STA RAM_SpriteXLo,X ; Cloud X (low) = Mario X W $01:E8AC STA.W RAM_SpriteXLo,Y ; Lakitu X (low) = cloud X W $01:EA3C STA.W RAM_SpriteXLo,Y ; New sprite X low = spawner's X low W $01:EB57 STA RAM_SpriteXLo,X ; Yoshi X low = Mario X low + YoshiPositionX[dir] W $01:ECA3 STA.W RAM_SpriteXLo,Y ; Store in new sprite W $01:EF49 STA RAM_SpriteXLo,X ; X position += YoshiHeadDispX[index] (head offset) W $01:EF8C STA RAM_SpriteXLo,X ; Restore X position lo W $01:F203 STA.W RAM_SpriteXLo,Y ; Item X lo = Yoshi X lo + DATA_01F305[dir] R $01:F4D4 ADC RAM_SpriteXLo,X ; A = Yoshi X low + offset W $01:F4D9 STA.W RAM_SpriteXLo,Y ; Eaten sprite X low = tongue tip X R $01:F541 ADC RAM_SpriteXLo,X ; A = Yoshi X low + offset (tongue tip X) W $01:F5D3 STA.W RAM_SpriteXLo,Y ; New Pokey X low R $01:F7CD LDA RAM_SpriteXLo,X ; Egg X low W $01:FC7A STA RAM_SpriteXLo,X ; Kid walked off the edge: use screen position [$14B8] W $01:FCE3 STA RAM_SpriteXLo,X ; Sprite X = [$14B8] - 8 W $01:FCF8 STA RAM_SpriteXLo,X ; Restore sprite X W $01:FDD9 STA.W RAM_SpriteXLo,Y ; Ball X low = [$14B8] - 8 + BallPositionDispX[dir] W $02:8646 STA RAM_SpriteXLo,X ; Sprite X low = Mario X low W $02:8974 STA RAM_SpriteXLo,X ; Sprite X low = block X low R $02:89AB LDA RAM_SpriteXLo,X ; Sprite X low W $02:A948 STA RAM_SpriteXLo,X ; Vertical level: X position low = high nibble of the first byte W $02:AC28 STA RAM_SpriteXLo ; Copy X position low W $02:AF5B STA RAM_SpriteXLo,X ; Set X low W $02:AFCB STA RAM_SpriteXLo,X ; Set X low W $02:B06F STA RAM_SpriteXLo,X ; Sprite X low W $02:B0BB STA RAM_SpriteXLo,X ; Sprite X low W $02:B132 STA.W RAM_SpriteXLo,Y ; Sprite X low W $02:B199 STA RAM_SpriteXLo,X ; Sprite X low W $02:B1F8 STA RAM_SpriteXLo,X ; Sprite X low W $02:B23F STA RAM_SpriteXLo,X ; Sprite X low W $02:B2BD STA RAM_SpriteXLo,X ; Sprite X low W $02:B30F STA RAM_SpriteXLo,X ; Sprite X low W $02:B36A STA RAM_SpriteXLo,X ; Sprite X low W $02:C5CE STA.W RAM_SpriteXLo,Y ; Clone X position low = this Chuck's W $02:CC14 STA RAM_SpriteXLo,X ; Store X low R $02:D05E CMP RAM_SpriteXLo,X ; Compare with sprite X low R $02:D37E LDA RAM_SpriteXLo,X ; A = sprite X low R $02:D390 LDA RAM_SpriteXLo,X ; A = sprite X low (16-bit sprite X) R $02:D3D8 LDA RAM_SpriteXLo,X ; A = sprite X low W $02:D436 STA RAM_SpriteXLo,X ; Sprite X low = A R $02:D4AF LDA RAM_SpriteXLo,X ; A = sprite X low R $02:D4FF SBC RAM_SpriteXLo,X ; A = Mario X low - sprite X low R $02:D631 LDA RAM_SpriteXLo,X ; A = sprite X low R $02:D6E9 ADC RAM_SpriteXLo,X ; Sprite X low += X offset R $02:D76B SBC RAM_SpriteXLo,X ; minus pivot X low: signed X distance to the ball R $02:D798 LDA RAM_SpriteXLo,X ; A = pivot X low W $02:DB7F STA.W RAM_SpriteXLo,Y ; Hammer Bro X position = platform X position W $02:E4C6 STA RAM_SpriteXLo,X ; X position lo = [state] (partner platform X lo) W $02:E4DF STA RAM_SpriteXLo,X ; Restore X position lo W $02:EB04 STA.W RAM_SpriteXLo,Y ; New sprite X low = this sprite's X low W $02:EDB9 STA.W RAM_SpriteXLo,Y ; New X low = this X + offset W $02:EF87 STA.W RAM_SpriteXLo,Y ; Copy X low W $02:F565 STA RAM_SpriteXLo,X ; X low = $BB W $02:F94C STA RAM_SpriteXLo ; Sprite 0 X low = cluster X low (temporary position for GetDrawInfo2) W $03:9377 STA RAM_SpriteXLo,X ; Store X low R $03:99A7 LDA RAM_SpriteXLo,X ; A = old X position low W $03:99B9 STA RAM_SpriteXLo,X ; Sprite X position low R $03:9B0D LDA RAM_SpriteXLo,X ; A = Reznor X position low W $03:9B16 STA RAM_SpriteXLo,X ; Temporarily move the Reznor X too (aim origin) W $03:9B44 STA RAM_SpriteXLo,X ; Restore Reznor X low R $03:9C92 LDA RAM_SpriteXLo,X ; A = X position low W $03:9C98 STA RAM_SpriteXLo,X ; X position low R $03:9F75 LDA RAM_SpriteXLo,X ; Remember home X low W $03:A103 STA RAM_SpriteXLo,X ; X low = $D0 W $03:A809 STA.W RAM_SpriteXLo,Y ; Sprite X low R $03:A921 LDA RAM_SpriteXLo,X ; Mushroom X low W $03:B057 STA.W RAM_SpriteXLo,Y ; X low = Bowser X + DATA_03B013[X] R $03:B6B3 ADC.W RAM_SpriteXLo,Y ; $04 = sprite X + displacement (low byte) R $03:B6F9 ADC.W RAM_SpriteXLo,Y ; $00 = sprite X + displacement (low byte) R $03:B890 CMP RAM_SpriteXLo,X ; Compare with sprite X low W $03:C1DB STA RAM_SpriteXLo,X ; Store it W $03:C808 STA.W RAM_SpriteXLo,Y ; New sprite X low = DATA_03C776[X] W $03:CCAB STA RAM_SpriteXLo,X ; X position = DATA_03CC38[pipe number] W $03:CD0C STA.W RAM_SpriteXLo,Y ; Copy X low R $03:DEE6 LDA RAM_SpriteXLo,X ; A = sprite X position (16 bit) W $0C:A006 STA RAM_SpriteXLo ; Sprite slot 0 X low = $52 $00EC Sprite X position low, slot 8 byte (element 8 of the $00E4 table) X low of sprite slot 8. Bowser's Mechakoopa drop/ball throw and phase 9 bounce write it directly: Bowser X low + 8, to place the new sprite, then InitSpriteTables with X = 8. Other hits are the byte $EC inside pointer tables (Chocolate Island 2 layer 1 data, overworld event states).
2 uses in 2 routines (2 write) $0100 Game mode RAM_GameMode byte, state Master state of the game: the main loop runs one routine per frame chosen by this value (via $009322). Modes step forward with INC $0100 as each stage (fade, load, wait) finishes; some routines set it directly.
Values: $00 = load Nintendo Presents, $01 = Nintendo Presents, $02 = fade to title, $07 = title/demo,
$08 = file select, $09 = erase file, $0B = fade out to overworld, $0C = load overworld, $0F/$10 = Mario Start,
$11 = Mario Start text and level music, $14 = in level, $18 = reload cutscene, $25/$26 = ending, fade to THE END.
34 uses in 27 routines (3 read, 15 write, 16 read-modify-write) W $00:8055 STZ $0100 ; Game mode = 0 (load Nintendo Presents) R $00:9322 LDA.W RAM_GameMode ; A = game mode [$0100] RW $00:93F4 INC.W RAM_GameMode ; Game mode = 1 (Nintendo Presents screen); falls into Mode04Finish RW $00:9417 INC.W RAM_GameMode ; Game mode += 1 (also used as a common exit by other modes) RW $00:9428 INC.W RAM_GameMode ; Game mode += 1 W $00:9525 STA.W RAM_GameMode ; Unused. Game mode = $18 (reload the cutscene) RW $00:958D DEC.W RAM_GameMode ; Game mode--, so GM04Load's mode increment is undone RW $00:9598 DEC.W RAM_GameMode ; Game mode-- again RW $00:9746 INC.W RAM_GameMode ; Advance the game mode RW $00:9B2F DEC.W RAM_GameMode ; Game mode -= 2 (back to file select; CODE_009CB0 increments once) W $00:9C8B STY.W RAM_GameMode ; Game mode = 2 (fade to title screen again, demo restarts) RW $00:9CE0 INC.W RAM_GameMode ; Game mode++ (09, erase file, unless a file is picked) RW $00:9D26 INC.W RAM_GameMode ; Y = $12 (stripe image: 1 PLAYER GAME / 2 PLAYER GAME); game mode++ (0A) RW $00:9E02 DEC.W RAM_GameMode ; Game mode-- (to 09) RW $00:9F5B INC.W RAM_GameMode ; Fade finished: game mode++ W $00:A0AA STA.W RAM_GameMode ; Game mode = $10 (skip the map, straight to Mario Start) W $00:A286 STA.W RAM_GameMode ; Game mode = $0B (fade out, back to the overworld) W $00:C530 STY.W RAM_GameMode ; Game mode = $0B (bonus game over: fade to overworld) W $00:C900 STA.W RAM_GameMode ; Game mode = $0F W $00:CA25 STY.W RAM_GameMode ; Game mode = Y W $00:D104 STY.W RAM_GameMode ; Game mode = Y W $00:D278 STA.W RAM_GameMode ; [$141A] += 1 and game mode = $0F (load level) W $04:9195 STA.W RAM_GameMode ; Game mode = $0B: fade to overworld (loads the other submap) RW $04:91E5 INC.W RAM_GameMode ; Game mode++: fade to level W $05:B16A STA.W RAM_GameMode ; Game mode = $0B (probably: leave the level for the overworld) W $0C:93B7 STA.W RAM_GameMode ; Game mode = $23 (ending: load the enemy parade) RW $0C:AEFD INC.W RAM_GameMode ; Next game mode (normally $25 to $26: fade to THE END) W $0C:AF09 STA.W RAM_GameMode ; Any other scene: game mode $22 (fade to the next enemy) $0101 Loaded sprite GFX files byte table, 4 entries (index X = 0-3; $0101-$0104) Remembers which sprite graphics file is currently loaded in each of the 4 sprite GFX slots in VRAM. The upload routine compares the wanted file to this entry and skips the upload when it is already loaded, then stores the new file number. Set to $FF at game start so the first level uploads everything.
Values: $FF = nothing loaded.
3 uses in 3 routines (1 read, 2 write) W $00:96B8 STA.W $0101,X ; Set [$0101]-[$0108] = $FF $0105 Loaded FG/BG GFX files byte table, indexed by slot (X; $0105-$0108) Same caching idea as $0101 , but for the foreground/background graphics file slots. The FG/BG upload routine skips a file that is already loaded and stores the new file number after uploading. A routine also fills the table with $80, which marks the slot as needing a fresh upload.
Values: $80 = slot not valid/forces reload.
3 uses in 3 routines (1 read, 2 write) W $00:AA64 STA.W $0105,X ; [$0105+X] = $80 $0109 Intro level override byte Non-zero makes the game load a level directly instead of using the overworld. Set to $E9 when the title screen demo starts the intro level; $E9 - $24 = $C5 is the level number used. The Mario Start mode picks intro level music when it is $E9, the overworld loader skips the map when it is non-zero, and the message box and level loader test it to behave differently in the intro. Cleared at reset, by the message box close routine and by file select, which means normal overworld play.
Values: 0 = normal, $E9 = intro level.
14 uses in 11 routines (9 read, 5 write) W $00:8058 STZ $0109 ; Clear [$0109] (level number / intro level flag) R $00:8139 LDA $0109 ; A = [$0109] (level-load flag) W $00:96CF STA.W $0109 ; [$0109] = A (level load override) W $00:9CB2 STA.W $0109 ; [$0109] = $E9 (intro level flag; $E9 - $24 = $C5) W $00:9CF8 STZ.W $0109 ; [$0109] = 0: no intro level W $05:B160 STZ.W $0109 ; Clear [$0109] (intro level flag) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) R $00:9BCC LDX.W $010A ; X = save file number ([$010A]) W $00:9CEF STX.W $010A ; Save file number [$010A] = chosen file $0200 OAM entry 0 X position byte, shadow OAM (sprite 0; indexed by OAM offset X or Y) Shadow copy of the X position of hardware sprite 0. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader. Slot 0 is also used by the item box drawing.
Values: screen X in pixels, $00-$FF (the high X bit lives in the $0400 table).
58 uses in 53 routines (1 read, 57 write) W $00:90AF STA.W OAM_ExtendedDispX,Y ; Sprite X = $78 W $00:93A1 STA.W OAM_ExtendedDispX,Y ; Sprite X = NintendoPos[X] W $01:F46C STA.W OAM_ExtendedDispX,Y ; Store tile X in OAM W $02:845F STA.W OAM_ExtendedDispX,Y ; OAM X = $0C+X (column X position) W $02:8C91 STA.W OAM_ExtendedDispX,Y ; OAM X W $02:8D13 STA.W OAM_ExtendedDispX,Y ; OAM X = screen X W $02:8D9B STA.W OAM_ExtendedDispX,Y ; OAM X = screen X W $02:8E31 STA.W OAM_ExtendedDispX,Y ; OAM X = screen X W $02:8EAE STA.W OAM_ExtendedDispX,Y ; OAM X = screen X W $02:8EEE STA.W OAM_ExtendedDispX,Y ; OAM X = screen X W $02:8FF1 STA.W OAM_ExtendedDispX,Y ; OAM X = screen X W $02:9243 STA.W OAM_ExtendedDispX,Y ; OAM X = $00 = bounce sprite X - camera X W $02:9757 STA.W OAM_ExtendedDispX,Y ; OAM X W $02:97BE STA.W OAM_ExtendedDispX,Y ; Left tiles X (sprites 1 and 3 of the four) W $02:9975 STA.W OAM_ExtendedDispX,Y ; OAM X W $02:9A46 STA.W OAM_ExtendedDispX,Y ; OAM X W $02:9A7A STA.W OAM_ExtendedDispX,Y ; OAM X of the top half W $02:9B78 STA.W OAM_ExtendedDispX,Y ; OAM X W $02:9D1D STA.W OAM_ExtendedDispX,Y ; OAM X position W $02:9DF3 STA.W OAM_ExtendedDispX,Y ; OAM X position W $02:9EB1 STA.W OAM_ExtendedDispX,Y ; OAM X position W $02:A1DA STA.W OAM_ExtendedDispX,Y ; OAM X position W $02:A28C STA.W OAM_ExtendedDispX,Y ; OAM X = $00 W $02:A376 STA.W OAM_ExtendedDispX,Y ; OAM X W $02:AEB7 STA.W OAM_ExtendedDispX,Y ; First tile X W $02:AF07 STA.W OAM_ExtendedDispX,Y ; Store coin X W $02:BB56 STA.W OAM_ExtendedDispX,Y ; OAM X = wing X - screen X (low byte) W $02:F406 STA.W OAM_ExtendedDispX,Y ; Write X W $02:F6C2 STA.W OAM_ExtendedDispX,Y ; OAM X = $B8 + [DATA_02F6A0+X] (3 columns) W $02:F7D6 STA.W OAM_ExtendedDispX,Y ; Extended OAM X = [$00] + [DATA_02F6F1+X] W $02:FE51 STA.W OAM_ExtendedDispX,Y ; OAM X = sprite X - screen X W $03:AFE9 STA.W OAM_ExtendedDispX,Y ; Copy OAM X to extended OAM area W $03:B464 STA.W OAM_ExtendedDispX,Y ; OAM X = corner X W $03:B500 STA.W OAM_ExtendedDispX,Y ; Store OAM X W $03:D688 STA.W OAM_ExtendedDispX,Y ; OAM Y and X of this letter (one 16-bit write: X, Y from the table) W $04:85F5 STA.W OAM_ExtendedDispX,X ; OAM X = [$00] W $05:B304 STA.W OAM_ExtendedDispX,Y ; OAM X,Y position W $07:F20C STA.W OAM_ExtendedDispX,Y ; OAM X = offset + $64 + digit X shift [$02] W $0C:A62C STA.W OAM_ExtendedDispX,X ; OAM X = fragment X position W $0C:A8F9 STA.W OAM_ExtendedDispX,X ; OAM X = slot X position W $0C:AA29 STA.W OAM_ExtendedDispX,X ; Both tiles X = [$00] W $0C:AAE8 STA.W OAM_ExtendedDispX,X ; OAM X = record X W $0C:B5F5 STA.W OAM_ExtendedDispX,Y ; OAM X = screen X W $0C:CB6E STA.W OAM_ExtendedDispX ; OAM slot 0 X = $50 W $0C:CEAF STA.W OAM_ExtendedDispX,X ; OAM X position = $B0 W $0C:CF55 STA.W OAM_ExtendedDispX,X ; OAM X position = [$0B52] W $0C:CFB3 STA.W OAM_ExtendedDispX,X ; OAM X position = $AC W $0C:D07F STA.W OAM_ExtendedDispX,X ; OAM X position W $0C:D435 STA.W OAM_ExtendedDispX,X ; OAM X = debris X position $0201 OAM entry 0 Y position byte, shadow OAM (sprite 0; indexed by OAM offset X or Y) Shadow copy of the Y position of hardware sprite 0. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader. The item box sprite here is hidden with $F0 when the box is empty.
Values: screen Y in pixels; $F0 hides the sprite (off-screen).
59 uses in 51 routines (1 read, 58 write) W $00:908B STA.W OAM_ExtendedDispY,Y ; Hide the sprite in slot 0 (Y = $F0), it is only shown when the box holds an item W $00:90B4 STA.W OAM_ExtendedDispY,Y ; Sprite Y = $0F W $00:93A6 STA.W OAM_ExtendedDispY,Y ; Sprite Y = $70 W $01:F480 STA.W OAM_ExtendedDispY,Y ; Store tile Y in OAM W $02:8442 STA.W OAM_ExtendedDispY,Y ; OAM Y of this segment = $F0 (hidden) W $02:845A STA.W OAM_ExtendedDispY,Y ; Only visible if Y < $A4: store OAM Y W $02:8C96 STA.W OAM_ExtendedDispY,Y ; OAM Y W $02:8D20 STA.W OAM_ExtendedDispY,Y ; OAM Y = screen Y W $02:8DA8 STA.W OAM_ExtendedDispY,Y ; OAM Y = screen Y W $02:8E3E STA.W OAM_ExtendedDispY,Y ; OAM Y = screen Y W $02:8EA1 STA.W OAM_ExtendedDispY,Y ; OAM Y = screen Y W $02:8EFB STA.W OAM_ExtendedDispY,Y ; OAM Y = screen Y W $02:8FFA STA.W OAM_ExtendedDispY,Y ; OAM Y = screen Y W $02:9238 STA.W OAM_ExtendedDispY,Y ; OAM Y = $01 = bounce sprite Y - camera Y W $02:9764 STA.W OAM_ExtendedDispY,Y ; OAM Y W $02:97D3 STA.W OAM_ExtendedDispY,Y ; Top tiles Y (sprite 1) W $02:997E STA.W OAM_ExtendedDispY,Y ; OAM Y W $02:9A4B STA.W OAM_ExtendedDispY,Y ; OAM Y W $02:9B81 STA.W OAM_ExtendedDispY,Y ; OAM Y W $02:9D47 STA.W OAM_ExtendedDispY,Y ; OAM Y position W $02:9DE6 STA.W OAM_ExtendedDispY,Y ; OAM Y position W $02:9EBE STA.W OAM_ExtendedDispY,Y ; OAM Y position W $02:A1D5 STA.W OAM_ExtendedDispY,Y ; OAM Y position W $02:A2A0 STA.W OAM_ExtendedDispY,Y ; OAM Y = $01 W $02:A383 STA.W OAM_ExtendedDispY,Y ; OAM Y W $02:AEAB STA.W OAM_ExtendedDispY,Y ; First tile Y W $02:AF10 STA.W OAM_ExtendedDispY,Y ; Store coin Y W $02:BB68 STA.W OAM_ExtendedDispY,Y ; OAM Y = sprite Y - screen Y + wing Y offset W $02:F40E STA.W OAM_ExtendedDispY,Y ; Write Y W $02:F6D1 STA.W OAM_ExtendedDispY,Y ; OAM Y = $50 - [RAM_ScreenBndryYLo] - [$00] + [DATA_02F6AC+X] W $02:F7E7 STA.W OAM_ExtendedDispY,Y ; Extended OAM Y = [$01] + [DATA_02F711+X] W $02:FE5A STA.W OAM_ExtendedDispY,Y ; OAM Y = sprite Y - screen Y W $03:AFEF STA.W OAM_ExtendedDispY,Y ; Copy OAM Y W $03:B46A STA.W OAM_ExtendedDispY,Y ; OAM Y = corner Y W $03:B509 STA.W OAM_ExtendedDispY,Y ; Store OAM Y W $04:85FF STA.W OAM_ExtendedDispY,X ; OAM Y = [$01] W $05:B31F STA.W OAM_ExtendedDispY,Y ; Hide this sprite W $07:F216 STA.W OAM_ExtendedDispY,Y ; OAM Y = offset + $40 W $0C:A632 STA.W OAM_ExtendedDispY,X ; OAM Y = fragment Y position W $0C:A857 STA.W OAM_ExtendedDispY,X ; Both tiles Y = [$02] W $0C:A8FE STA.W OAM_ExtendedDispY,X ; OAM Y = slot Y position W $0C:AA31 STA.W OAM_ExtendedDispY,X ; Top tile Y = [$02] W $0C:AAEE STA.W OAM_ExtendedDispY,X ; OAM Y = record Y W $0C:B614 STA.W OAM_ExtendedDispY,Y ; OAM Y W $0C:CB73 STA.W OAM_ExtendedDispY ; OAM slot 0 Y = $67 W $0C:CEB5 STA.W OAM_ExtendedDispY,X ; OAM Y position = [$0B43] W $0C:CF5B STA.W OAM_ExtendedDispY,X ; OAM Y position = [$0B43] W $0C:CFB8 STA.W OAM_ExtendedDispY,X ; OAM Y position = $63 W $0C:D084 STA.W OAM_ExtendedDispY,X ; OAM Y position W $0C:D43B STA.W OAM_ExtendedDispY,X ; OAM Y = debris Y position $0202 OAM entry 0 tile number byte, shadow OAM (sprite 0; indexed by OAM offset X or Y) Shadow copy of the tile number of hardware sprite 0. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: tile number in the sprite GFX page.
69 uses in 59 routines (1 read, 68 write) W $00:90C4 STA.W OAM_ExtendedTile,Y ; Tile = DATA_008DF9[item] W $00:93AC STA.W OAM_ExtendedTile,Y ; Sprite tile = NintendoTile[X] W $01:F48D STA.W OAM_ExtendedTile,Y ; Store tile number in OAM W $02:846A STA.W OAM_ExtendedTile,Y ; OAM tile = $E6 for the top segment, $08 for the others W $02:8CA3 STA.W OAM_ExtendedTile,Y ; OAM tile from table W $02:8D26 STA.W OAM_ExtendedTile,Y ; OAM tile = BooStreamTiles[slot] W $02:8DBC STA.W OAM_ExtendedTile,Y ; OAM tile = A W $02:8E66 STA.W OAM_ExtendedTile,Y ; OAM tile = A W $02:8EB3 STA.W OAM_ExtendedTile,Y ; OAM tile = $6F W $02:8F14 STA.W OAM_ExtendedTile,Y ; OAM tile = StarSparkleTiles[X] W $02:8F70 STA.W OAM_ExtendedTile,Y ; OAM tile = LavaSplashTiles[X] W $02:900E STA.W OAM_ExtendedTile,Y ; OAM tile = BrokenBlock2[X] ($3C/$3D: brick piece) W $02:9255 STA.W OAM_ExtendedTile,Y ; OAM tile = BounceSpriteTiles[type] W $02:9786 STA.W OAM_ExtendedTile,Y ; OAM tile number W $02:9805 STA.W OAM_ExtendedTile,Y ; Sprite 1 tile = $7C W $02:9817 STA.W OAM_ExtendedTile,Y ; Sprite 1 tile = $7D W $02:9992 STA.W OAM_ExtendedTile,Y ; OAM tile number W $02:9A50 STA.W OAM_ExtendedTile,Y ; OAM tile number W $02:9A8C STA.W OAM_ExtendedTile,Y ; Top half tile W $02:9B99 STA.W OAM_ExtendedTile,Y ; OAM tile number W $02:9C5A STA.W OAM_ExtendedTile,Y ; OAM tile number W $02:9C95 STA.W OAM_ExtendedTile,Y ; OAM tile number W $02:9D31 STA.W OAM_ExtendedTile,Y ; Flower tile $98 W $02:9D4C STA.W OAM_ExtendedTile,Y ; Coin tile $C2 W $02:9E05 STA.W OAM_ExtendedTile,Y ; OAM tile number W $02:9E6B STA.W OAM_ExtendedTile,Y ; OAM tile number W $02:9F5D STA.W OAM_ExtendedTile,Y ; Tile $1C (bubble) W $02:A18E STA.W OAM_ExtendedTile,Y ; OAM tile from ReznorFireTiles W $02:A2A5 STA.W OAM_ExtendedTile,Y ; OAM tile = $AD (baseball) W $02:A32A STA.W OAM_ExtendedTile,Y ; OAM tile = HammerTiles[frame] W $02:A38F STA.W OAM_ExtendedTile,Y ; OAM tile = DustCloudTiles[frame] W $02:AEC8 STA.W OAM_ExtendedTile,Y ; Store first tile number W $02:AF15 STA.W OAM_ExtendedTile,Y ; Store tile W $02:BB6F STA.W OAM_ExtendedTile,Y ; OAM tile = wing tile W $02:F419 STA.W OAM_ExtendedTile,Y ; Write tile from BirdsTilemap W $02:F6D6 STA.W OAM_ExtendedTile,Y ; Tile = $A5 W $02:F7DC STA.W OAM_ExtendedTile,Y ; Extended tile = [DATA_02F721+X] W $02:FE5F STA.W OAM_ExtendedTile,Y ; OAM tile = $24 (1-UP mushroom) W $03:AFF5 STA.W OAM_ExtendedTile,Y ; Copy tile W $03:B46F STA.W OAM_ExtendedTile,Y ; OAM tile = $43 (item box corner) W $03:B514 STA.W OAM_ExtendedTile,Y ; Store OAM tile W $03:CAAB STA.W OAM_ExtendedTile,Y ; Tile = DATA_03C9B9[X] (sparkle animation) W $03:D68E STA.W OAM_ExtendedTile,Y ; OAM tile and properties of this letter (16-bit write) W $04:8604 STA.W OAM_ExtendedTile,X ; OAM tile = $7E W $05:B2FB STA.W OAM_ExtendedTile,Y ; OAM tile/properties of this sprite W $07:F22A STA.W OAM_ExtendedTile,Y ; Set tile number W $0C:A63E STA.W OAM_ExtendedTile,X ; OAM tile = [DATA_0CA5D2+Y] ($C8, $C8, $D8, $D8) W $0C:A866 STA.W OAM_ExtendedTile,X ; First tile number = [DATA_0CA7BA+Y] W $0C:A9D1 STA.W OAM_ExtendedTile,X ; Tile 1 number = [DATA_0CA93A+Y] W $0C:AA3D STA.W OAM_ExtendedTile,X ; Top tile number = [DATA_0CAA0B+Y] W $0C:AAF4 STA.W OAM_ExtendedTile,X ; OAM tile = record tile W $0C:B61A STA.W OAM_ExtendedTile,Y ; OAM tile W $0C:CB64 STY.W OAM_ExtendedTile ; OAM slot 0 tile W $0C:CEC1 STA.W OAM_ExtendedTile,X ; OAM tile = $C6 or $C8 W $0C:CF61 STA.W OAM_ExtendedTile,X ; OAM tile W $0C:CFA9 STA.W OAM_ExtendedTile,X ; OAM tile W $0C:D08A STA.W OAM_ExtendedTile,X ; OAM tile W $0C:D448 STA.W OAM_ExtendedTile,X ; OAM tile = DATA_0CD423[Y] (alternates $3C/$3D) W $0C:D4D8 STA.W OAM_ExtendedTile,X ; OAM tile = $B6 W $0C:D547 STA.W OAM_ExtendedTile,X ; OAM tile = DATA_0CD4F4[Y] $0203 OAM entry 0 tile properties byte, shadow OAM (sprite 0; indexed by OAM offset X or Y) Shadow copy of the tile properties of hardware sprite 0. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Bits: YXPPCCCT: Y flip, X flip, priority (bits 4-5), palette (bits 1-3), tile page (bit 0).
67 uses in 56 routines (4 read, 63 write) W $00:90BB STA.W OAM_ExtendedProp,Y ; Properties = $30 (priority 3) | palette bits [$00] W $00:93B1 STA.W OAM_ExtendedProp,Y ; Properties = $30 (priority 3, palette 0) W $01:F49B STA.W OAM_ExtendedProp,Y ; Store tile properties in OAM W $02:846F STA.W OAM_ExtendedProp,Y ; OAM attributes = $0D (palette 6) W $02:924B STA.W OAM_ExtendedProp,Y ; OAM properties = [$1901] (YXPPCCCT) OR priority bits [$64] W $02:9778 STA.W OAM_ExtendedProp,Y ; OAM properties W $02:97EE STA.W OAM_ExtendedProp,Y ; Properties of sprite 1 W $02:9983 STA.W OAM_ExtendedProp,Y ; OAM properties W $02:9A57 STA.W OAM_ExtendedProp,Y ; OAM properties W $02:9B88 STA.W OAM_ExtendedProp,Y ; OAM properties W $02:9C54 STA.W OAM_ExtendedProp,Y ; OAM properties W $02:9C90 STA.W OAM_ExtendedProp,Y ; OAM properties W $02:9DFD STA.W OAM_ExtendedProp,Y ; OAM properties from UnusedExSprGfxProp W $02:A2B2 STA.W OAM_ExtendedProp,Y ; OAM properties = flip bits | $39 (priority 3, palette 4, tile page 1) W $02:AEE2 STA.W OAM_ExtendedProp,Y ; First tile properties W $02:AF1C STA.W OAM_ExtendedProp,Y ; Store properties W $02:BB78 STA.W OAM_ExtendedProp,Y ; OAM properties = [$64] (sprite priority) | wing properties W $02:F41F STA.W OAM_ExtendedProp,Y ; Write properties W $02:F6DB STA.W OAM_ExtendedProp,Y ; Property = $21 (priority 2, palette 0, second tile page) W $02:F7F5 STA.W OAM_ExtendedProp,Y ; Extended property = [DATA_02F719+X], X-flipped when the frame is 3 or more W $02:FE64 STA.W OAM_ExtendedProp,Y ; OAM property = $3A W $03:AFFB STA.W OAM_ExtendedProp,Y ; Copy property W $03:B475 STA.W OAM_ExtendedProp,Y ; OAM properties from table W $03:B51B STA.W OAM_ExtendedProp,Y ; Store OAM properties W $04:8609 STA.W OAM_ExtendedProp,X ; OAM property = $36 (priority 3, palette 3) W $07:F235 STA.W OAM_ExtendedProp,Y ; Property = $30 | frame counter / 2 & $0E (cycling palette) W $0C:A644 STA.W OAM_ExtendedProp,X ; OAM property = [DATA_0CA5D6+Y]: palette 3, X-flip on odd fragments W $0C:A872 STA.W OAM_ExtendedProp,X ; First tile property = [DATA_0CA7EE+Y] W $0C:A9DD STA.W OAM_ExtendedProp,X ; Tile 1 property = [DATA_0CA952+Y] W $0C:AA1D STA.W OAM_ExtendedProp,X ; Top tile property = [DATA_0CAA11+Y] W $0C:AAFA STA.W OAM_ExtendedProp,X ; OAM property = record property W $0C:B624 STA.W OAM_ExtendedProp,Y ; OAM properties = list properties with bits 4-5 replaced by [$00] W $0C:CB69 STA.W OAM_ExtendedProp ; OAM slot 0 properties $39 W $0C:CEC7 STA.W OAM_ExtendedProp,X ; OAM prop: $25 or $65 (X flip), so the object spins W $0C:CF67 STA.W OAM_ExtendedProp,X ; OAM prop W $0C:CFAE STA.W OAM_ExtendedProp,X ; OAM prop = tile number (looks like a bug) W $0C:D090 STA.W OAM_ExtendedProp,X ; OAM prop W $0C:D44E STA.W OAM_ExtendedProp,X ; OAM properties = $22 W $0C:D4DD STA.W OAM_ExtendedProp,X ; OAM properties = $31 W $0C:D54C STA.W OAM_ExtendedProp,X ; OAM properties = $33 W $0C:D5BB STA.W OAM_ExtendedProp,X ; OAM properties = $33 $0204 OAM entry 1 X position byte, shadow OAM (sprite 1; indexed by OAM offset X or Y) Shadow copy of the X position of hardware sprite 1. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen X in pixels, $00-$FF (the high X bit lives in the $0400 table).
8 uses in 8 routines (8 write) W $02:97C7 STA.W $0204,Y ; Right tiles X (sprite 2) W $02:9A7D STA.W $0204,Y ; OAM X of the bottom half W $02:AEBD STA.W $0204,Y ; Store second tile X W $0C:A846 STA.W $0204,X ; Second tile X = [$00] W $0C:CCEF STA.W $0204,X ; OAM X position = [$00] W $0C:CE73 STA.W $0204,X ; OAM X position $0205 OAM entry 1 Y position byte, shadow OAM (sprite 1; indexed by OAM offset X or Y) Shadow copy of the Y position of hardware sprite 1. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen Y in pixels; $F0 hides the sprite (off-screen).
9 uses in 9 routines (9 write) W $02:97D6 STA.W $0205,Y ; Top tiles Y (sprite 2) W $02:9A85 STA.W $0205,Y ; OAM Y of the bottom half W $02:AEAE STA.W $0205,Y ; Second tile Y W $0C:CCF4 STA.W $0205,X ; OAM Y position = [$02] W $0C:CE79 STA.W $0205,X ; OAM Y position = [$0B42] $0206 OAM entry 1 tile number byte, shadow OAM (sprite 1; indexed by OAM offset X or Y) Shadow copy of the tile number of hardware sprite 1. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: tile number in the sprite GFX page.
9 uses in 8 routines (9 write) W $02:980D STA.W $0206,Y ; Sprite 2 tile = $7D W $02:981F STA.W $0206,Y ; Sprite 2 tile = $7C W $02:9A8F STA.W $0206,Y ; Bottom half tile W $02:AECE STA.W $0206,Y ; Store second tile number W $0C:A860 STA.W $0206,X ; Second tile number = [DATA_0CA7B9+Y] W $0C:A9D7 STA.W $0206,X ; Tile 2 number = [DATA_0CA93B+Y] W $0C:AA43 STA.W $0206,X ; Bottom tile number = [DATA_0CAA0C+Y] $0207 OAM entry 1 tile properties byte, shadow OAM (sprite 1; indexed by OAM offset X or Y) Shadow copy of the tile properties of hardware sprite 1. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Bits: YXPPCCCT: Y flip, X flip, priority (bits 4-5), palette (bits 1-3), tile page (bit 0).
8 uses in 8 routines (8 write) W $02:97F1 STA.W $0207,Y ; Properties of sprite 2 W $02:9A97 STA.W $0207,Y ; ...with the Y-flip bit added W $02:AEE5 STA.W $0207,Y ; Second tile properties W $0C:A86C STA.W $0207,X ; Second tile property = [DATA_0CA7ED+Y] W $0C:A9E3 STA.W $0207,X ; Tile 2 property = [DATA_0CA953+Y] W $0C:AA23 STA.W $0207,X ; Bottom tile property = [DATA_0CAA12+Y] No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $02:97C1 STA.W $0208,Y ; Left tiles X (sprite 3) $0209 OAM entry 2 Y position byte, shadow OAM (sprite 2; indexed by OAM offset X or Y) Shadow copy of the Y position of hardware sprite 2. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader. Used by Lakitu's cloud and score sprites, which hide unused entries with $F0.
Values: screen Y in pixels; $F0 hides the sprite (off-screen).
3 uses in 3 routines (3 write) W $02:97DC STA.W $0209,Y ; Bottom tiles Y (sprite 3) W $02:ADB5 STA.W $0209 ; Hide OAM entries 1 and 2 (Y = $F0, off-screen) $020A OAM entry 2 tile number byte, shadow OAM (sprite 2; indexed by OAM offset X or Y) Shadow copy of the tile number of hardware sprite 2. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: tile number in the sprite GFX page.
3 uses in 2 routines (3 write) W $01:E977 STA.W $020A ; OAM tile 2 number = $4D W $02:9810 STA.W $020A,Y ; Sprite 3 tile = $7D W $02:9822 STA.W $020A,Y ; Sprite 3 tile = $7C No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $01:E97C STA.W $020B ; OAM tile 2 properties = $39 W $02:97F6 STA.W $020B,Y ; Properties of sprite 3 $020C OAM entry 3 X position byte, shadow OAM (sprite 3; indexed by OAM offset X or Y) Shadow copy of the X position of hardware sprite 3. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader. Also used by the parallax background sprites.
Values: screen X in pixels, $00-$FF (the high X bit lives in the $0400 table).
4 uses in 2 routines (1 read, 3 write) W $02:82ED STA.W $020C,Y ; OAM X = DATA_028178[index] + $06 (half-speed parallax) W $02:97CA STA.W $020C,Y ; Right tiles X (sprite 4) $020D OAM entry 3 Y position byte, shadow OAM (sprite 3; indexed by OAM offset X or Y) Shadow copy of the Y position of hardware sprite 3. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen Y in pixels; $F0 hides the sprite (off-screen).
5 uses in 2 routines (1 read, 4 write) W $02:82AF STA.W $020D,Y ; OAM Y of the spare slot = $F0 (hidden) W $02:8302 STA.W $020D,Y ; OAM Y = DATA_0281CF[index] - 1 - $07 W $02:97DF STA.W $020D,Y ; Bottom tiles Y (sprite 4) $020E OAM entry 3 tile number byte, shadow OAM (sprite 3; indexed by OAM offset X or Y) Shadow copy of the tile number of hardware sprite 3. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: tile number in the sprite GFX page.
7 uses in 2 routines (2 read, 5 write) W $02:8310 STA.W $020E,Y ; OAM tile = DATA_028226[index] W $02:83B4 STA.W $020E,Y ; Toggle bit 1 of the tile number (swap animation frame) W $02:9808 STA.W $020E,Y ; Sprite 4 tile = $7C W $02:981A STA.W $020E,Y ; Sprite 4 tile = $7D $020F OAM entry 3 tile properties byte, shadow OAM (sprite 3; indexed by OAM offset X or Y) Shadow copy of the tile properties of hardware sprite 3. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Bits: YXPPCCCT: Y flip, X flip, priority (bits 4-5), palette (bits 1-3), tile page (bit 0).
5 uses in 2 routines (1 read, 4 write) W $02:8315 STA.W $020F,Y ; OAM attributes = $0D (palette 6) W $02:834C STA.W $020F,X ; Copy the four OAM bytes (X, Y, tile, attributes) to the spare slot W $02:83B9 STA.W $020F,Y ; OAM attributes = $09 (palette 4) W $02:97F9 STA.W $020F,Y ; Properties of sprite 4 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:FB17 STA.W $0240,Y ; OAM X position = [$00] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:FB21 STA.W $0241,Y ; OAM Y position = [$02] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:FB0A STA.W $0242,Y ; OAM tile low: tile number = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:FB0E STA.W $0243,Y ; OAM tile high: properties = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:EC4E STA.W $0283,Y ; OAM properties $029C OAM entry 39 X position byte, shadow OAM (sprite 39; indexed by OAM offset X or Y) Shadow copy of the X position of hardware sprite 39. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader. Also used for the overworld player sprite and lives exchange (OAM sprite 39 at X=$48).
Values: screen X in pixels, $00-$FF (the high X bit lives in the $0400 table).
3 uses in 3 routines (3 write) W $04:89AB STA.W $029C,X ; OAM X and Y of this tile = [$8A] and [$8B] W $04:F571 STA.W $029C ; OAM sprite 39: X = $48, Y = $78 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $029E OAM entry 39 tile number byte, shadow OAM (sprite 39; indexed by OAM offset X or Y) Shadow copy of the tile number of hardware sprite 39. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader. Also used for the overworld player sprite and lives exchange (tile $0A, props $34).
Values: tile number in the sprite GFX page.
3 uses in 3 routines (3 write) W $04:8D64 STA.W $029E,X ; Store tile and property in OAM W $04:F57D STA.W $029E ; OAM sprite 39: tile $0A, properties $34 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $04:F577 STA.W $02A0 ; OAM sprite 40: X = $90, Y = $78 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $03:AAA0 STA.W $02A1 ; OAM $02A1 and $02A5 Y = [$01] - $18 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $04:F583 STA.W $02A2 ; OAM sprite 40: tile $0A, properties $36 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $03:AAB8 STA.W $02A3 ; OAM $02A3 properties No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $03:AABB STA.W $02A7 ; OAM $02A7 properties No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:879F STA.W $02B4,X ; Marker 1 X = [$8A] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:87AD STA.W $02B5,X ; Both markers: Y = [$8B] - 7 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:87B5 STA.W $02B6,X ; Both markers: tile $7C No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:87BD STA.W $02B7,X ; Marker 1 property = $20 (priority 2, palette 0) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:87C2 STA.W $02BB,X ; Marker 2 property = $60 (same, X-flipped) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $02:8393 STA.W $02D3 ; OAM attributes of six sprites ($02BF..$02D3) = $CD (X/Y flip, palette 6) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $01:DCBB STA.W $02FE,Y ; Last tile = $DE (rope end) W $0C:D68B STA.W $02FE,Y ; OAM tile = entry with bit 0 cleared No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $00:E3E1 STA.W $02FF,Y ; Set OAM properties of six of Mario's slots $0300 OAM entry 64 X position byte, shadow OAM (sprite 64; indexed by OAM offset Y) Shadow copy of the X position of hardware sprite 64. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen X in pixels, $00-$FF (the high X bit lives in the $0400 table).
139 uses in 115 routines (11 read, 128 write) W $00:E49A STA.W OAM_DispX,Y ; OAM X position = A W $01:9DAB STA.W OAM_DispX,Y ; Both tiles X = [$00] W $01:9F2F STA.W OAM_DispX,Y ; OAM X = [$00] W $01:A3F4 STA.W OAM_DispX,X ; Tile 1 X = $80 (with X bit 8 set: off screen) W $01:B3F6 STA.W OAM_DispX,Y ; Tile X = A R $01:B7F5 LDA.W OAM_DispX,Y ; A = tile's X on screen (set by the caller relative to the sprite) W $01:BB5B STA.W OAM_DispX,Y ; Tile 0 X = sprite X + offset W $01:BD22 STA.W OAM_DispX,Y ; Tile 1 X = screen X + MagiKoopasMagicDisp[[$03]] W $01:C13A STA.W OAM_DispX,Y ; Tile 1 X = screen X - 8 W $01:C64A STA.W OAM_DispX,Y ; OAM X = sprite screen X W $01:C6B4 STA.W OAM_DispX,Y ; OAM X = sprite screen X W $01:C7E6 STA.W OAM_DispX,Y ; Tile 0 screen X = [$14B8] - screen X - 8 W $01:C86D STA.W OAM_DispX,Y ; [$0B] = tile 1 screen X = pivot X - screen X - 8 W $01:C8AC STA.W OAM_DispX,Y ; Link X = pivot X + running X offset W $01:C8B6 STA.W OAM_DispX,Y ; Link X = pivot X - running X offset W $01:C8F1 STA.W OAM_DispX,Y ; Platform tile screen X = [$14B8] - screen X + offset ($E0,$F0,$00,$10) W $01:D4B5 STA.W OAM_DispX,Y ; OAM X position W $01:DC87 STA.W OAM_DispX,Y ; Tile X = $00 W $01:DF2E STA.W OAM_DispX,Y ; Symbol tile 1 X W $01:E23F STA.W OAM_DispX,Y ; Top tile X R $01:E471 LDA.W OAM_DispX,Y ; A = first tile X position W $01:E70A STA.W OAM_DispX,Y ; First tile X = sprite X W $01:F07D STA.W OAM_DispX ; OAM slot 0 X = screen X + DATA_03C176[index] W $01:FEF8 STA.W OAM_DispX,Y ; OAM tile X position W $02:810B STA.W OAM_DispX,Y ; OAM X = $00 W $02:9844 STA.W OAM_DispX,Y ; Sprite 1 X W $02:A3BE STA.W OAM_DispX,Y ; OAM X (page 2) W $02:BC2B STA.W OAM_DispX,Y ; Moving left: tile 1 at X W $02:BC3F STA.W OAM_DispX,Y ; Moving right: tile 1 at X + $18 W $02:BECF STA.W OAM_DispX,Y ; OAM X = [$00] + tile X offset W $02:BF29 STA.W OAM_DispX,Y ; OAM X = [$00] + eye X offset W $02:BF8C STA.W OAM_DispX,Y ; OAM X = [$00] + tile X offset W $02:CA46 STA.W OAM_DispX,Y ; Store tile 1 X W $02:CABE STA.W OAM_DispX,Y ; Store tile 1 X W $02:CB6B STA.W OAM_DispX,Y ; Store tile X W $02:CBD0 STA.W OAM_DispX,Y ; Store tile X W $02:CCDA STA.W OAM_DispX,Y ; Upper tile X position W $02:CD97 STA.W OAM_DispX,Y ; Tile X position W $02:CF15 STA.W OAM_DispX,Y ; Piece X position W $02:DB0E STA.W OAM_DispX,Y ; Store OAM X W $02:DC69 STA.W OAM_DispX,Y ; Store OAM X W $02:DE6B STA.W OAM_DispX,Y ; Store OAM X W $02:E3DE STA.W OAM_DispX,Y ; Store tile X W $02:E643 STA.W OAM_DispX,Y ; Store tile X W $02:E6F7 STA.W OAM_DispX,Y ; Line tile X = [$185E] W $02:E907 STA.W OAM_DispX,Y ; Left tile X = X W $02:E9F1 STA.W OAM_DispX,Y ; Top tile X = sprite screen X W $02:ED68 STA.W OAM_DispX,Y ; OAM X = screen X + X offset W $02:F155 STA.W OAM_DispX,Y ; Write tile X W $02:F1B4 STA.W OAM_DispX,Y ; Write eye X W $02:F1D7 STA.W OAM_DispX,Y ; Write flower X W $02:F499 STA.W OAM_DispX,Y ; Left puff X = screen X - spread W $02:F643 STA.W OAM_DispX,Y ; OAM X = $C0 + [DATA_02F619+X] (fixed screen position) W $02:F7A3 STA.W OAM_DispX,Y ; OAM X = [$00] + [DATA_02F6F1+X] W $02:F96A STA.W OAM_DispX,Y ; OAM X = [$00] W $02:FA34 STA.W OAM_DispX,Y ; OAM X = flame X low - [$1E] (layer 2 X scroll) W $02:FD53 STA.W OAM_DispX,Y ; OAM X = sprite X - screen X W $03:8408 STA.W OAM_DispX,Y ; OAM X = A + [$00] (sprite screen X) W $03:849E STA.W OAM_DispX,Y ; OAM X = [$00] + FallingPlatDispX[X] W $03:85CC STA.W OAM_DispX,Y ; OAM X = [$00] + PocruPufferDispX[X] W $03:86C8 STA.W OAM_DispX,Y ; OAM X = sprite X + ForestPlatDispX[X] W $03:8742 STA.W OAM_DispX,Y ; OAM X = current X W $03:8868 STA.W OAM_DispX,Y ; OAM X = sprite X + MegaMoleTileDispX[X] W $03:8B65 STA.W OAM_DispX,Y ; OAM X = sprite X + BwsrStatueDispX[X] W $03:9234 STA.W OAM_DispX,Y ; OAM X += A W $03:94E9 STA.W OAM_DispX,Y ; OAM X = sprite X W $03:9B9F STA.W OAM_DispX,Y ; OAM X position W $03:9C0B STA.W OAM_DispX,Y ; Left half X position W $03:ACEF STA.W OAM_DispX,Y ; OAM X = Mario screen X [$7E] W $03:AF81 STA.W OAM_DispX,Y ; OAM X = [$00] + sparkle X offset W $03:AFBE STA.W OAM_DispX,Y ; OAM X = result W $03:B232 STA.W OAM_DispX,Y ; Store OAM X W $03:B3B8 STA.W OAM_DispX,Y ; Store OAM X W $03:B417 STA.W OAM_DispX,Y ; Store OAM X W $03:B4CC STA.W OAM_DispX,Y ; Store OAM X W $03:B53A STA.W OAM_DispX,Y ; Store OAM X W $03:C0D7 STA.W OAM_DispX,Y ; OAM X position W $03:C28B STA.W OAM_DispX,Y ; OAM X of the motor tile W $03:C4AA STA.W OAM_DispX,Y ; OAM X = $78 W $03:C97B STA.W OAM_DispX,Y ; OAM X of slots 0 and 1 = sprite X W $03:D4AF STA.W OAM_DispX,Y ; OAM X = sprite screen X + X offset of this tile (DATA_03CEF2) W $03:D4F4 STA.W OAM_DispX,Y ; OAM X = sprite screen X + X offset of this tile (DATA_03CF7C) W $0C:A103 STA.W OAM_DispX,X ; OAM X = [$00] W $0C:A194 STA.W OAM_DispX,X ; OAM X = [$00] $0301 OAM entry 64 Y position byte, shadow OAM (sprite 64; indexed by OAM offset Y) Shadow copy of the Y position of hardware sprite 64. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen Y in pixels; $F0 hides the sprite (off-screen).
157 uses in 119 routines (17 read, 138 write, 2 read-modify-write) W $00:E482 STA.W OAM_DispY,Y ; OAM Y position = A W $01:9879 STA.W OAM_DispY,Y ; Both feet Y = body Y + [$00] W $01:9DA0 STA.W OAM_DispY,Y ; Top tile Y = [$01] W $01:9E04 STA.W OAM_DispY,Y ; First slot Y position = [$01] W $01:9F34 STA.W OAM_DispY,Y ; OAM Y = [$01] W $01:B3AA STA.W OAM_DispY,Y ; Tile 0 Y = A (top row) W $01:B835 STA.W OAM_DispY,Y ; Off-screen vertically: Y = $F0 hides the tile (also marks the OAM slot as free) W $01:BD17 STA.W OAM_DispY,Y ; Tile 1 Y = screen Y + MagiKoopasMagicDisp[[$02]] RW $01:BEC0 INC.W OAM_DispY,X ; Frame 3: tile 1 Y += 1 (bobbing) W $01:C14E STA.W OAM_DispY,Y ; Tile 1 Y = screen Y + 8 W $01:C64F STA.W OAM_DispY,Y ; OAM Y = sprite screen Y W $01:C6BA STA.W OAM_DispY,Y ; OAM Y = sprite screen Y - 1 W $01:C7DA STA.W OAM_DispY,Y ; Tile 0 (chain link at the platform end): screen Y = [$14BA] - screen Y - 8 W $01:C85F STA.W OAM_DispY,Y ; [$0A] = tile 1 screen Y = pivot Y - screen Y - 8 W $01:C889 STA.W OAM_DispY,Y ; Link Y = pivot Y + running Y offset W $01:C893 STA.W OAM_DispY,Y ; Link Y = pivot Y - running Y offset W $01:C8E4 STA.W OAM_DispY,Y ; Platform tile screen Y = [$14BA] - screen Y - $10 W $01:C97C STA.W OAM_DispY,Y ; Off-screen vertically: hide the tile (Y = $F0) W $01:D4C9 STA.W OAM_DispY,Y ; OAM Y position W $01:DC8C STA.W OAM_DispY,Y ; Tile Y = $01 W $01:DF5D STA.W OAM_DispY,Y ; Symbol tile 1 Y W $01:E247 STA.W OAM_DispY,Y ; Top tile Y W $01:E718 STA.W OAM_DispY,Y ; Both tiles Y = sprite Y + 8 (squashed, lower) W $01:EF7C STA.W OAM_DispY,Y ; OAM Y += YoshiHeadDispY[frame] W $01:EFB5 STA.W OAM_DispY,Y ; Head tile table bit 7 set: hide the head (OAM Y = $F0) W $01:F087 STA.W OAM_DispY ; OAM slot 0 Y = screen Y + DATA_03C19E[index] W $01:FF06 STA.W OAM_DispY,Y ; OAM tile Y position W $02:8110 STA.W OAM_DispY,Y ; OAM Y = $01 W $02:9859 STA.W OAM_DispY,Y ; Sprite 1 Y W $02:993B STA.W OAM_DispY,Y ; Hide the sprite W $02:A3CB STA.W OAM_DispY,Y ; OAM Y (page 2) W $02:B77E STA.W OAM_DispY,Y ; Store tile Y W $02:B8FC STA.W OAM_DispY,Y ; Both tiles' Y = [$01] W $02:BED8 STA.W OAM_DispY,Y ; OAM Y = [$01] + tile Y offset W $02:BF32 STA.W OAM_DispY,Y ; OAM Y = [$01] + eye Y offset W $02:BF95 STA.W OAM_DispY,Y ; OAM Y = [$01] + tile Y offset W $02:CA5A STA.W OAM_DispY,Y ; Store tile 1 Y W $02:CAD0 STA.W OAM_DispY,Y ; Store tile 1 Y W $02:CBE7 STA.W OAM_DispY,Y ; Store tile Y W $02:CCE6 STA.W OAM_DispY,Y ; Upper tile Y position W $02:CDA0 STA.W OAM_DispY,Y ; Tile Y position W $02:CF28 STA.W OAM_DispY,Y ; Piece Y position W $02:D859 STA.W OAM_DispY,Y ; OAM Y = screen Y W $02:DA0D STA.W OAM_DispY,Y ; Store OAM Y W $02:DB17 STA.W OAM_DispY,Y ; Store OAM Y W $02:DC72 STA.W OAM_DispY,Y ; Store OAM Y W $02:DE75 STA.W OAM_DispY,Y ; Store OAM Y W $02:E3F9 STA.W OAM_DispY,Y ; Store tile Y W $02:E648 STA.W OAM_DispY,Y ; Tile Y = sprite Y W $02:E6FD STA.W OAM_DispY,Y ; Line tile Y = [$18B6] W $02:E9F9 STA.W OAM_DispY,Y ; Top tile Y = sprite screen Y W $02:ED03 STA.W OAM_DispY,Y ; OAM Y = screen Y + Y offset W $02:EE16 STA.W OAM_DispY,Y ; Move the skull down 3 pixels RW $02:EE6A INC.W OAM_DispY,X ; OAM Y + 1: skull sinks slightly W $02:F168 STA.W OAM_DispY,Y ; Write tile Y W $02:F1BA STA.W OAM_DispY,Y ; Eye Y = head Y W $02:F1E0 STA.W OAM_DispY,Y ; Write flower Y W $02:F4A8 STA.W OAM_DispY,Y ; Left puff Y = screen Y W $02:F4FC STA.W OAM_DispY,Y ; Top tile Y = $B0 W $02:F64C STA.W OAM_DispY,Y ; OAM Y = $70 + [DATA_02F621+X] W $02:F7B4 STA.W OAM_DispY,Y ; OAM Y = [$01] + [DATA_02F711+X] W $02:F97A STA.W OAM_DispY,Y ; OAM Y = [$01] + offset W $02:FA3D STA.W OAM_DispY,Y ; OAM Y = flame Y low - [$20] (layer 2 Y scroll) W $02:FCDE STA.W OAM_DispY,Y ; Hide the sprite: OAM Y = $F0 (off-screen) W $02:FD5C STA.W OAM_DispY,Y ; OAM Y = sprite Y - screen Y W $03:841E STA.W OAM_DispY,Y ; OAM Y = [$01] + BigBooDispY[X] R $03:843F LDA.W OAM_DispY,Y ; Unused: A = OAM Y of the first tile W $03:8445 STA.W OAM_DispY,Y ; Unused: move the first tile down 5 pixels W $03:84A3 STA.W OAM_DispY,Y ; OAM Y = [$01] W $03:85BA STA.W OAM_DispY,Y ; OAM Y = [$01] + PocruPufferDispY[X] W $03:86D1 STA.W OAM_DispY,Y ; OAM Y = sprite Y + ForestPlatDispY[X] W $03:874C STA.W OAM_DispY,Y ; OAM Y = sprite Y W $03:8872 STA.W OAM_DispY,Y ; OAM Y = sprite Y + MegaMoleTileDispY[X] W $03:8B79 STA.W OAM_DispY,Y ; OAM Y = sprite Y + BwsrStatueDispY[X] W $03:8F31 STA.W OAM_DispY,Y ; OAM Y = sprite Y W $03:9BA9 STA.W OAM_DispY,Y ; OAM Y position W $03:9C13 STA.W OAM_DispY,Y ; Left half Y position W $03:ACF8 STA.W OAM_DispY,Y ; OAM Y = Mario screen Y [$80] + heart Y offset W $03:AF8A STA.W OAM_DispY,Y ; OAM Y = [$01] + sparkle Y offset W $03:AFC8 STA.W OAM_DispY,Y ; Store OAM Y W $03:B23B STA.W OAM_DispY,Y ; Store OAM Y W $03:B3D7 STA.W OAM_DispY,Y ; Store OAM Y W $03:B41F STA.W OAM_DispY,Y ; Store OAM Y W $03:B4C4 STA.W OAM_DispY,Y ; Store OAM Y W $03:B543 STA.W OAM_DispY,Y ; Store OAM Y W $03:C0E1 STA.W OAM_DispY,Y ; OAM Y position = $C4 (bottom of the screen) W $03:C299 STA.W OAM_DispY,Y ; OAM Y of the motor tile W $03:C4AF STA.W OAM_DispY,Y ; OAM Y = $28 W $03:C983 STA.W OAM_DispY,Y ; OAM Y of slot 0 = sprite Y W $03:D4B8 STA.W OAM_DispY,Y ; OAM Y = sprite screen Y + Y offset of this tile (DATA_03D006) W $03:D4FD STA.W OAM_DispY,Y ; OAM Y = sprite screen Y + Y offset of this tile (DATA_03D090) W $0C:A108 STA.W OAM_DispY,X ; OAM Y = [$01] W $0C:A199 STA.W OAM_DispY,X ; OAM Y = [$08] $0302 OAM entry 64 tile number byte, shadow OAM (sprite 64; indexed by OAM offset Y) Shadow copy of the tile number of hardware sprite 64. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: tile number in the sprite GFX page.
178 uses in 140 routines (8 read, 170 write) W $00:E468 STA.W OAM_Tile,Y ; OAM tile = A W $00:FBEB STA.W OAM_Tile,Y ; Override the drawn tile with the smoke tile W $01:89F9 STA.W OAM_Tile,Y ; Set the tile number of its first OAM entry W $01:8E2E STA.W OAM_Tile,Y ; OAM tile = wing tile for this frame W $01:988C STA.W OAM_Tile,Y ; Both feet use this tile (A = tile, Y = OAM index) W $01:9A6B STA.W OAM_Tile,Y ; Replace the tile W $01:9E7E STA.W OAM_Tile,Y ; OAM tile = KoopaWingTiles[X] W $01:9F27 STA.W OAM_Tile,Y ; OAM tile = SprTilemap[X] W $01:A225 STA.W OAM_Tile,Y ; Y = OAM index, set OAM tile = A W $01:AE7B STA.W OAM_Tile,Y ; Set the block tile number W $01:AF8F STA.W OAM_Tile,Y ; Set the tile number W $01:B32F STA.W OAM_Tile,Y ; Long left end tile $EA W $01:B346 STA.W OAM_Tile,Y ; Short left end tile $60 W $01:B400 STA.W OAM_Tile,Y ; Tile number = table[X] W $01:B687 STA.W OAM_Tile,Y ; Tile number W $01:B78B STA.W OAM_Tile,Y ; Tile 0 = $40 W $01:BBC0 STA.W OAM_Tile,Y ; Store the tile W $01:BD84 STA.W OAM_Tile,Y ; Tile 1 = $88 W $01:C159 STA.W OAM_Tile,Y ; Tile 1 = $D4 W $01:C1A3 STA.W OAM_Tile,Y ; Store tile W $01:C360 STA.W OAM_Tile,Y ; Tile = $80 (berry) W $01:C654 STA.W OAM_Tile,Y ; OAM tile = $E8 (full coin) W $01:C689 STA.W OAM_Tile,Y ; Tile = MovingCoinTiles[phase - 1] W $01:C6DA STA.W OAM_Tile,Y ; OAM tile = PowerUpTiles[X] W $01:C7EB STA.W OAM_Tile,Y ; Tile 0 = $A2 (chain link) W $01:C872 STA.W OAM_Tile,Y ; Tile 1 = $A2 (chain link) W $01:C8C8 STA.W OAM_Tile,Y ; Link tile = $A2 W $01:C8F7 STA.W OAM_Tile,Y ; Tile = $60,$61,$61,$62 (left end, middle, middle, right end) W $01:DBF6 STA.W OAM_Tile,Y ; Tile = $C8 W $01:DCA2 STA.W OAM_Tile,Y ; Store the tile number W $01:E183 STA.W OAM_Tile,Y ; Tile = flame tile from BowserFlameTiles W $01:E252 STA.W OAM_Tile,Y ; Top tile = $EB W $01:E462 STA.W OAM_Tile,Y ; First tile = A W $01:E923 STA.W OAM_Tile,Y ; Tile = $60 (cloud puff) W $01:E932 STA.W OAM_Tile,Y ; Tile = CloudTiles[X]: shrinking puff as the cloud vanishes W $01:EE98 STA.W OAM_Tile,Y ; Head OAM tile = $06 (fixed VRAM slot for the dynamic head graphics) W $01:EEA7 STA.W OAM_Tile,Y ; Body OAM tile = $08 (fixed VRAM slot for the dynamic body graphics) W $01:EFF0 STA.W OAM_Tile,Y ; Head tile = $2A W $01:EFFA STA.W OAM_Tile,Y ; Head tile = $0C (mouth winding up) W $01:F03E STA.W OAM_Tile,Y ; Head OAM tile = A W $01:F08C STA.W OAM_Tile ; OAM slot 0 tile = $3F (small tile that travels along the neck, probably the swallowed item) W $01:F795 STA.W OAM_Tile,Y ; Tile 0 (draw the egg as tile $00) W $01:F7BE STA.W OAM_Tile,Y ; Store tile in OAM W $01:FA27 STA.W OAM_Tile,Y ; OAM tile = BooBlockTiles[frame] W $01:FA71 STA.W OAM_Tile,Y ; OAM tile = IggyBallTiles[frame] W $01:FF0C STA.W OAM_Tile,Y ; OAM tile = DATA_01FE83[X] W $01:FF1F STA.W OAM_Tile,Y ; Iggy only: OAM tile = DATA_01FEB3[X] W $01:FF80 STA.W OAM_Tile,Y ; Store OAM tile number W $02:8115 STA.W OAM_Tile,Y ; OAM tile = $BC (explosion puff) W $02:973D STA.W OAM_Tile,Y ; OAM tile number W $02:988B STA.W OAM_Tile,Y ; Sprite 1 tile = $7C W $02:989D STA.W OAM_Tile,Y ; Sprite 1 tile = $7D W $02:99C5 STA.W OAM_Tile,Y ; OAM tile number W $02:A084 STA.W OAM_Tile,Y ; OAM tile from FireballTiles W $02:A3D7 STA.W OAM_Tile,Y ; OAM tile = DustCloudTiles[frame] W $02:B692 STA.W OAM_Tile,Y ; Store the tile W $02:B791 STA.W OAM_Tile,Y ; Store the tile W $02:B92E STA.W OAM_Tile,Y ; Tile 1 = $80 W $02:BE6C STA.W OAM_Tile,Y ; OAM tile = $C8 W $02:BE7B STA.W OAM_Tile,Y ; OAM tile = $0A W $02:BEE3 STA.W OAM_Tile,Y ; OAM tile = Hothead body tile W $02:BF37 STA.W OAM_Tile,Y ; OAM tile = eye tile W $02:BFB1 STA.W OAM_Tile,Y ; OAM tile = A W $02:C8F9 STA.W OAM_Tile,Y ; OAM tile = head tile by head pose W $02:CA65 STA.W OAM_Tile,Y ; Tile 1 = body tile 1 by pose W $02:CAD9 STA.W OAM_Tile,Y ; Tile 1 = raised hand tile W $02:CB18 STA.W OAM_Tile,Y ; Tile 1 = $1C W $02:CB7D STA.W OAM_Tile,Y ; Tile = $AD W $02:CBED STA.W OAM_Tile,Y ; Tile = shovel tile W $02:CD01 STA.W OAM_Tile,Y ; Upper tile number W $02:CDA6 STA.W OAM_Tile,Y ; Tile number W $02:CF2D STA.W OAM_Tile,Y ; Tile = $3D (spring coil) W $02:D85F STA.W OAM_Tile,Y ; OAM tile = [WoodPlatformTiles+X] W $02:D8E4 STA.W OAM_Tile,Y ; Store the contained sprite's tile W $02:DA14 STA.W OAM_Tile,Y ; Store OAM tile W $02:DA34 STA.W OAM_Tile,Y ; Store OAM tile W $02:DB2D STA.W OAM_Tile,Y ; Store OAM tile W $02:DC8E STA.W OAM_Tile,Y ; OAM tile = [HmrBroPlatTiles+X] W $02:DE7B STA.W OAM_Tile,Y ; Store OAM tile W $02:E013 STA.W OAM_Tile,Y ; Tile 1 and 2 = $CE (lotus body) W $02:E24E STA.W OAM_Tile,Y ; Tile = $2E (P-switch silver coin tile) W $02:E3FF STA.W OAM_Tile,Y ; Tile number W $02:E59A STA.W OAM_Tile,Y ; Left tile number W $02:E64E STA.W OAM_Tile,Y ; Tile number from MovingHoleTiles[X] W $02:E6A9 STA.W OAM_Tile,Y ; Pole tile = $AA W $02:E708 STA.W OAM_Tile,Y ; Tile = $89 (fishing line) W $02:E91B STA.W OAM_Tile,Y ; Left tile = $A4 (pipe opening) W $02:EA0A STA.W OAM_Tile,Y ; Store top tile W $02:EA31 STA.W OAM_Tile,Y ; OAM tile = $06 (the real graphics are DMAed in dynamically, probably) W $02:ED09 STA.W OAM_Tile,Y ; OAM tile from SuperKoopaTiles W $02:EE09 STA.W OAM_Tile,Y ; Store tile W $02:F178 STA.W OAM_Tile,Y ; Write tile W $02:F1BF STA.W OAM_Tile,Y ; Eye tile = $88 W $02:F1E5 STA.W OAM_Tile,Y ; Flower tile = $98 W $02:F4B0 STA.W OAM_Tile,Y ; Left puff tile = $C5 W $02:F51F STA.W OAM_Tile,Y ; Top tile from table W $02:F5FB STA.W OAM_Tile,Y ; Write tile W $02:F652 STA.W OAM_Tile,Y ; Tile = [DATA_02F629+X] W $02:F7A9 STA.W OAM_Tile,Y ; Tile = [DATA_02F721+X] W $02:F980 STA.W OAM_Tile,Y ; Tile = [SumoBroFlameTiles+X] W $02:FA4B STA.W OAM_Tile,Y ; Tile = [CastleFlameTiles+X] W $03:83E6 STA.W OAM_Tile,Y ; OAM tile = BigBooTiles[X] W $03:84A9 STA.W OAM_Tile,Y ; OAM tile = FallingPlatTiles[X] W $03:84E2 STA.W OAM_Tile,Y ; Store the tile number W $03:85DF STA.W OAM_Tile,Y ; OAM tile = PocruPufferTiles[X] W $03:86D7 STA.W OAM_Tile,Y ; OAM tile number from ForestPlatTiles W $03:8752 STA.W OAM_Tile,Y ; OAM tile number from LavaPlatTiles W $03:887E STA.W OAM_Tile,Y ; OAM tile number from MegaMoleTiles W $03:8989 STA.W OAM_Tile,Y ; Store OAM tile W $03:8B87 STA.W OAM_Tile,Y ; OAM tile from BwsrStatueTiles W $03:8D49 STA.W OAM_Tile,Y ; OAM tile = DiagPlatTiles[X] W $03:8DB1 STA.W OAM_Tile,Y ; Force OAM tile to $C0 W $03:8ECF STA.W OAM_Tile,Y ; OAM tile = GreyMoveBlkTiles[X] W $03:8F4A STA.W OAM_Tile,Y ; OAM tile = StatueFireTiles[X] W $03:8FA0 STA.W OAM_Tile,Y ; OAM tile = BooStreamFrntTiles[X] W $03:9012 STA.W OAM_Tile,Y ; OAM tile = $AC W $03:91B4 STA.W OAM_Tile,Y ; OAM tile = A W $03:921D STA.W OAM_Tile,Y ; OAM tile = $E0 W $03:9294 STA.W OAM_Tile,Y ; OAM tile = $2E W $03:94F8 STA.W OAM_Tile,Y ; OAM tile = WoodSpikeTiles[X] W $03:96C6 STA.W OAM_Tile,Y ; OAM tile = RexTiles[X] W $03:979E STA.W OAM_Tile,Y ; OAM tile = A W $03:97E4 STA.W OAM_Tile,Y ; OAM tile = FishboneTailTiles[X] W $03:9BB4 STA.W OAM_Tile,Y ; OAM tile number W $03:9C1B STA.W OAM_Tile,Y ; Both tiles = $4E (platform) W $03:9E93 STA.W OAM_Tile,Y ; OAM tile = DinoRhinoTiles[X] W $03:9F00 STA.W OAM_Tile,Y ; Store OAM tile W $03:A076 STA.W OAM_Tile,Y ; Tile = $A0 (eyes) W $03:ACFE STA.W OAM_Tile,Y ; OAM tile = heart tile W $03:AF8F STA.W OAM_Tile,Y ; Tile $59 (star) W $03:AFCD STA.W OAM_Tile,Y ; Tile $49 (smoke puff) W $03:B241 STA.W OAM_Tile,Y ; Store OAM tile W $03:B3CE STA.W OAM_Tile,Y ; Store OAM tile W $03:B42F STA.W OAM_Tile,Y ; Store OAM tile W $03:B54E STA.W OAM_Tile,Y ; Store OAM tile W $03:C0FD STA.W OAM_Tile,Y ; OAM tile number W $03:C249 STA.W OAM_Tile,Y ; OAM tile = $2A W $03:C2B6 STA.W OAM_Tile,Y ; OAM tile of the motor W $03:C438 STA.W OAM_Tile,Y ; OAM tile = DryBonesTiles[X] W $03:C4C4 STA.W OAM_Tile,Y ; OAM tile = DiscoBallTiles[X] W $03:C995 STA.W OAM_Tile,Y ; OAM tile = DATA_03C969[X] + A W $03:CB7A STA.W OAM_Tile,Y ; Tile = DATA_03C9B9[X] (sparkle animation) W $03:D4BE STA.W OAM_Tile,Y ; OAM tile = DATA_03D11A[X] W $03:D503 STA.W OAM_Tile,Y ; OAM tile = DATA_03D1A4[X] W $0C:A0F8 STA.W OAM_Tile,X ; OAM tile = tile table [Y] W $0C:A18A STA.W OAM_Tile,X ; OAM tile = DATA_0CA136[Y] $0303 OAM entry 64 tile properties byte, shadow OAM (sprite 64; indexed by OAM offset Y) Shadow copy of the tile properties of hardware sprite 64. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Bits: YXPPCCCT: Y flip, X flip, priority (bits 4-5), palette (bits 1-3), tile page (bit 0).
159 uses in 127 routines (16 read, 143 write) W $01:8E4B STA.W OAM_Prop,Y ; OAM property = wing property | priority [$64] W $01:9894 STA.W OAM_Prop,Y ; Feet properties = layer priority [$64] W $01:9DC0 STA.W OAM_Prop,Y ; Properties = A | layer priority [$64] for both tiles W $01:B411 STA.W OAM_Prop,Y ; Store tile properties W $01:B68D STA.W OAM_Prop,Y ; Tile properties from table W $01:B79E STA.W OAM_Prop,Y ; Tile 0 properties = [$64] | $60 (X flip and a priority bit) W $01:BBE8 STA.W OAM_Prop,Y ; Store the OAM properties W $01:C165 STA.W OAM_Prop,Y ; Properties $32 for all three tiles W $01:C36C STA.W OAM_Prop,Y ; OAM prop = EatenBerryGfxProp[[$18D6]] | [$64] (berry type picks the palette) W $01:C65C STA.W OAM_Prop,Y ; OAM prop = palette | priority [$64] W $01:C6CE STA.W OAM_Prop,Y ; OAM prop = flip | [$64] | [$15F6,X] ^ [$0A] W $01:C7F0 STA.W OAM_Prop,Y ; Tile 0 properties = $31 (palette 8, priority 3) W $01:C877 STA.W OAM_Prop,Y ; Tile 1 properties = $31 W $01:C8CD STA.W OAM_Prop,Y ; Link properties = $31 W $01:C8FC STA.W OAM_Prop,Y ; Properties = $31 W $01:D4C2 STA.W OAM_Prop,Y ; OAM properties W $01:DBC6 STA.W OAM_Prop,Y ; Tile properties (flips) from the table W $01:DC2F STA.W OAM_Prop,Y ; Tile properties (flips) from the table W $01:DCAD STA.W OAM_Prop,Y ; Store the properties W $01:DF97 STA.W OAM_Prop,Y ; Symbol tile 1 properties W $01:E18B STA.W OAM_Prop,Y ; Properties = DATA_01E194 | level priority [$64] W $01:E25C STA.W OAM_Prop,Y ; Properties = $30 (top priority) W $01:E937 STA.W OAM_Prop,Y ; Puff properties = [$64] W $01:F098 STA.W OAM_Prop ; OAM slot 0 properties = Yoshi's, palette bit 0 set W $01:F7BA STA.W OAM_Prop,Y ; OAM properties = ([prop] & $FE) | [$00] W $01:FA32 STA.W OAM_Prop,Y ; OAM props = (props & $F1) | BooBlockGfxProp[frame] (palette) W $01:FA79 STA.W OAM_Prop,Y ; OAM props = DATA_01FA52[frame] EOR X-flip W $01:FF2F STA.W OAM_Prop,Y ; OAM props = A | X-flip bit W $02:8122 STA.W OAM_Prop,Y ; OAM attributes = 2 * (([$13] >> 2) AND 3) + 1, OR [$64]: palette cycles 0-3 W $02:972F STA.W OAM_Prop,Y ; OAM properties W $02:9874 STA.W OAM_Prop,Y ; Properties of sprite 1 W $02:99B6 STA.W OAM_Prop,Y ; OAM properties W $02:B925 STA.W OAM_Prop,Y ; Both tiles' properties = DATA_02B8F5[direction] | [$02] W $02:BE74 STA.W OAM_Prop,Y ; OAM properties = table | priority [$64] W $02:BE89 STA.W OAM_Prop,Y ; Toggle X/Y flip in the OAM properties W $02:BEEB STA.W OAM_Prop,Y ; OAM properties = table | priority [$64] W $02:BF3E STA.W OAM_Prop,Y ; OAM properties = 5 | priority [$64] W $02:BF9B STA.W OAM_Prop,Y ; OAM properties from table W $02:C8F3 STA.W OAM_Prop,Y ; Store OAM properties W $02:CA76 STA.W OAM_Prop,Y ; Tile 1 properties = A EOR flip bits (may read past the table) W $02:CAE1 STA.W OAM_Prop,Y ; Tile 1 properties = [$08] W $02:CD0F STA.W OAM_Prop,Y ; Upper tile properties W $02:CDB2 STA.W OAM_Prop,Y ; Tile properties W $02:CF34 STA.W OAM_Prop,Y ; Properties = [$64] (priority) with palette 5 W $02:D605 STA.W OAM_Prop,Y ; OAM properties W $02:D7C0 STA.W OAM_Prop,Y ; OAM properties W $02:D834 STA.W OAM_Prop,Y ; OAM properties W $02:D864 STA.W OAM_Prop,Y ; OAM properties = $33 (palette 1, priority 3) W $02:DA1C STA.W OAM_Prop,Y ; Store OAM properties W $02:DB20 STA.W OAM_Prop,Y ; OAM properties = direction flag | $37 W $02:DC94 STA.W OAM_Prop,Y ; OAM properties = [DATA_02DC27+X] W $02:E020 STA.W OAM_Prop,Y ; Store properties for tile 1 W $02:E405 STA.W OAM_Prop,Y ; Tile properties W $02:E654 STA.W OAM_Prop,Y ; Tile properties from DATA_02E66E[X] W $02:E6B3 STA.W OAM_Prop,Y ; Pole properties W $02:E70D STA.W OAM_Prop,Y ; Properties = $35 W $02:EA1C STA.W OAM_Prop,Y ; Store properties for top tile W $02:ED5F STA.W OAM_Prop,Y ; Store OAM properties W $02:EF3B STA.W OAM_Prop,Y ; Properties: flip bits cycle with the frame counter, priority $30 W $02:EF5C STA.W OAM_Prop,Y ; Properties $39 W $02:F186 STA.W OAM_Prop,Y ; Write properties W $02:F1EF STA.W OAM_Prop,Y ; Write properties W $02:F4B8 STA.W OAM_Prop,Y ; Left puff property = $05 W $02:F52A STA.W OAM_Prop,Y ; Properties = $35 W $02:F601 STA.W OAM_Prop,Y ; Write properties W $02:F658 STA.W OAM_Prop,Y ; Property = [DATA_02F631+X] W $02:F7C2 STA.W OAM_Prop,Y ; Property = [DATA_02F719+X], X-flipped when the frame is 3 or more W $02:F990 STA.W OAM_Prop,Y ; Property = X-flip every 4 frames | [$64] (priority) | $05 (palette 2, page 1) W $02:FA51 STA.W OAM_Prop,Y ; Property = [CastleFlameGfxProp+X] W $02:FD85 STA.W OAM_Prop,Y ; OAM property (palette, priority 3) W $02:FDB3 STA.W OAM_Prop,Y ; OAM property = $37 (bat palette, priority 3) W $03:83F7 STA.W OAM_Prop,Y ; Add the level's sprite priority [$64] and store as OAM properties W $03:84B0 STA.W OAM_Prop,Y ; OAM properties = $03 | [$64]: palette 9, second sprite GFX page W $03:84F1 STA.W OAM_Prop,Y ; Dead: flip the sprite vertically W $03:85D4 STA.W OAM_Prop,Y ; OAM properties = PocruPufferGfxProp[X] | [$64] W $03:86DD STA.W OAM_Prop,Y ; OAM properties from ForestPlatGfxProp W $03:875A STA.W OAM_Prop,Y ; OAM properties = table | level priority [$64] W $03:888B STA.W OAM_Prop,Y ; Store OAM properties W $03:8B6F STA.W OAM_Prop,Y ; Properties from table, palette and level priority W $03:8F58 STA.W OAM_Prop,Y ; OAM properties = A | [$64] W $03:91C6 STA.W OAM_Prop,Y ; OAM properties = A W $03:94FE STA.W OAM_Prop,Y ; OAM properties = WoodSpikeGfxProp[X] W $03:9BC4 STA.W OAM_Prop,Y ; OAM properties W $03:9C23 STA.W OAM_Prop,Y ; Left tile properties $33 (palette 1, priority 3) W $03:9F18 STA.W OAM_Prop,Y ; Store OAM property W $03:A0DC STA.W OAM_Prop,Y ; Store OAM property W $03:A423 STA.W OAM_Prop,Y ; OAM property = DATA_03A3D1[X] W $03:AAFC STA.W OAM_Prop,Y ; OAM properties W $03:AD0C STA.W OAM_Prop,Y ; OAM property = $31, flip X if Mario faces right W $03:AF97 STA.W OAM_Prop,Y ; Property from DATA_03AF44 ORed with [$64] (priority) W $03:AFD4 STA.W OAM_Prop,Y ; Property $07 ORed with [$64] W $03:B249 STA.W OAM_Prop,Y ; Store OAM properties W $03:B3C2 STA.W OAM_Prop,Y ; Store OAM properties W $03:B427 STA.W OAM_Prop,Y ; Store OAM properties W $03:B4DD STA.W OAM_Prop,Y ; Store OAM properties W $03:B555 STA.W OAM_Prop,Y ; Store OAM properties W $03:C0E8 STA.W OAM_Prop,Y ; OAM properties = [$64] (priority bits) | $09 (palette 4, second tile page) W $03:C251 STA.W OAM_Prop,Y ; Clear the X flip bit of the properties W $03:C2C6 STA.W OAM_Prop,Y ; Motor properties = $37 W $03:C4CA STA.W OAM_Prop,Y ; OAM properties = DATA_03C49C[X] W $03:D4C6 STA.W OAM_Prop,Y ; OAM properties = LemmyGfxProp[X] | $10 (sprite priority bits = 1) W $03:D50B STA.W OAM_Prop,Y ; OAM properties = WendyGfxProp[X] | $10 (sprite priority bits = 1) W $0C:A0FE STA.W OAM_Prop,X ; OAM properties = property table [Y] W $0C:A18F STA.W OAM_Prop,X ; OAM property = $35 (palette 2, priority 3) $0304 OAM entry 65 X position byte, shadow OAM (sprite 65; indexed by OAM offset Y) Shadow copy of the X position of hardware sprite 65. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen X in pixels, $00-$FF (the high X bit lives in the $0400 table).
39 uses in 32 routines (7 read, 32 write) W $01:A406 STA.W OAM_Tile2DispX,X ; Tile 2 X = $80 (off screen) W $01:BB5E STA.W OAM_Tile2DispX,Y ; Tile 1 X W $01:BD48 STA.W OAM_Tile2DispX,Y ; Tile 2 X = screen X + MagiKoopasMagicDisp[[$03]] W $01:C140 STA.W OAM_Tile2DispX,Y ; Tile 2 X = tile 1 X + 8 W $01:C67A STA.W OAM_Tile2DispX,Y ; Both tiles use that X W $01:DF37 STA.W OAM_Tile2DispX,Y ; Symbol tile 2 X W $01:E242 STA.W OAM_Tile2DispX,Y ; Bottom tile X W $01:E479 STA.W OAM_Tile2DispX,Y ; Store second tile X W $02:984D STA.W OAM_Tile2DispX,Y ; Sprite 2 X W $02:BC31 STA.W OAM_Tile2DispX,Y ; Tile 2 at X + $10 W $02:BC45 STA.W OAM_Tile2DispX,Y ; Tile 2 at X + 8 W $02:CA4F STA.W OAM_Tile2DispX,Y ; Store tile 2 X W $02:CAC7 STA.W OAM_Tile2DispX,Y ; Store tile 2 X W $02:CCDD STA.W OAM_Tile2DispX,Y ; Lower tile X position (same as the upper tile) W $02:E693 STA.W OAM_Tile2DispX,Y ; Bait X W $02:E9F4 STA.W OAM_Tile2DispX,Y ; Bottom tile X = same R $02:F1AC LDA.W OAM_Tile2DispX,Y ; A = X of segment 0 (head) R $02:F1CF LDA.W OAM_Tile2DispX,Y ; A = X of segment 0 (head) W $02:F4A0 STA.W OAM_Tile2DispX,Y ; Right puff X = screen X + spread W $02:F4F7 STA.W OAM_Tile2DispX,Y ; Both tiles at X = $B8 W $03:9C05 STA.W OAM_Tile2DispX,Y ; Right half X position W $03:B275 STA.W OAM_Tile2DispX,Y ; Store OAM X W $03:C28E STA.W OAM_Tile2DispX,Y ; OAM X of the first blade tile $0305 OAM entry 65 Y position byte, shadow OAM (sprite 65; indexed by OAM offset Y) Shadow copy of the Y position of hardware sprite 65. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen Y in pixels; $F0 hides the sprite (off-screen).
40 uses in 34 routines (7 read, 33 write) W $01:8FB5 STA.W OAM_Tile2DispY,Y ; Tile 2 Y -= 3 (raise the second tile while throwing) W $01:B2EF STA.W OAM_Tile2DispY,Y ; All tile Y positions = sprite Y - screen Y (first three tiles) W $01:B3C0 STA.W OAM_Tile2DispY,Y ; Tile 1 Y = A (bottom row) W $01:BB9C STA.W OAM_Tile2DispY,Y ; Tile 1 Y W $01:BD35 STA.W OAM_Tile2DispY,Y ; Tile 2 Y = screen Y + MagiKoopasMagicDisp[[$02]] W $01:C682 STA.W OAM_Tile2DispY,Y ; Store tile 2 Y W $01:C9A9 STA.W OAM_Tile2DispY,Y ; Tile 1 (pivot) is only a reference: hide it (Y = $F0) W $01:DF60 STA.W OAM_Tile2DispY,Y ; Symbol tile 2 Y W $01:E24D STA.W OAM_Tile2DispY,Y ; Bottom tile Y W $01:E47F STA.W OAM_Tile2DispY,Y ; Second tile Y = first tile Y W $02:985C STA.W OAM_Tile2DispY,Y ; Sprite 2 Y W $02:CA5F STA.W OAM_Tile2DispY,Y ; Tile 2 Y = sprite Y W $02:CAD3 STA.W OAM_Tile2DispY,Y ; Tile 2 Y = same W $02:CB27 STA.W OAM_Tile2DispY,Y ; Tile 2 Y = same W $02:CCEC STA.W OAM_Tile2DispY,Y ; Lower tile Y position W $02:E595 STA.W OAM_Tile2DispY,Y ; Right tile Y = same W $02:E916 STA.W OAM_Tile2DispY,Y ; Right tile Y = same W $02:E9FF STA.W OAM_Tile2DispY,Y ; Bottom tile Y = screen Y + $10 W $02:F4AB STA.W OAM_Tile2DispY,Y ; Right puff Y = screen Y W $02:F501 STA.W OAM_Tile2DispY,Y ; Bottom tile Y = $B8 W $03:8448 STA.W OAM_Tile2DispY,Y ; Unused: move the second tile down as well W $03:9C16 STA.W OAM_Tile2DispY,Y ; Right half Y position W $03:B27F STA.W OAM_Tile2DispY,Y ; Store OAM Y W $03:C2A2 STA.W OAM_Tile2DispY,Y ; OAM Y of the first blade tile $0306 OAM entry 65 tile number byte, shadow OAM (sprite 65; indexed by OAM offset Y) Shadow copy of the tile number of hardware sprite 65. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: tile number in the sprite GFX page.
30 uses in 28 routines (30 write) W $01:9D98 STA.W OAM_Tile2,Y ; Bottom tile W $01:B77F STA.W OAM_Tile2,Y ; Tile 1 = $40 W $01:BD89 STA.W OAM_Tile2,Y ; Tile 2 = $89 W $01:C15D STA.W OAM_Tile2,Y ; Tile 2 = $D5 W $01:C68C STA.W OAM_Tile2,Y ; Tile 2 uses the same tile W $01:E257 STA.W OAM_Tile2,Y ; Bottom tile = $FB W $01:E73D STA.W OAM_Tile2,Y ; Both tiles use the same tile number W $02:9893 STA.W OAM_Tile2,Y ; Sprite 2 tile = $7D W $02:98A5 STA.W OAM_Tile2,Y ; Sprite 2 tile = $7C W $02:B944 STA.W OAM_Tile2,Y ; Store tile 2 W $02:CA6B STA.W OAM_Tile2,Y ; Tile 2 = body tile 2 by pose W $02:CADC STA.W OAM_Tile2,Y ; Tile 2 = same tile W $02:CB1C STA.W OAM_Tile2,Y ; Tile 2 = $1D W $02:CD0A STA.W OAM_Tile2,Y ; Lower tile number W $02:E59D STA.W OAM_Tile2,Y ; Right tile number (flipped below) W $02:E6AE STA.W OAM_Tile2,Y ; Bait tile = $24 W $02:E920 STA.W OAM_Tile2,Y ; Right tile = $A6 (pipe opening) W $02:EA10 STA.W OAM_Tile2,Y ; Store bottom tile W $02:F4B3 STA.W OAM_Tile2,Y ; Right puff tile = $C5 W $02:F525 STA.W OAM_Tile2,Y ; Bottom tile from table W $03:C2BC STA.W OAM_Tile2,Y ; First blade tile = $AE $0307 OAM entry 65 tile properties byte, shadow OAM (sprite 65; indexed by OAM offset Y) Shadow copy of the tile properties of hardware sprite 65. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Bits: YXPPCCCT: Y flip, X flip, priority (bits 4-5), palette (bits 1-3), tile page (bit 0).
32 uses in 30 routines (3 read, 29 write) W $01:B793 STA.W OAM_Tile2Prop,Y ; Tile 1 properties W $01:C694 STA.W OAM_Tile2Prop,Y ; Tile 2 prop = tile 1 prop with vertical flip W $01:DF9A STA.W OAM_Tile2Prop,Y ; Symbol tile 2 properties W $01:E25F STA.W OAM_Tile2Prop,Y ; Bottom tile properties W $01:E485 STA.W OAM_Tile2Prop,Y ; Second tile properties = first tile properties W $01:E74B STA.W OAM_Tile2Prop,Y ; Second tile = same, flipped horizontally W $02:9877 STA.W OAM_Tile2Prop,Y ; Properties of sprite 2 W $02:BC82 STA.W OAM_Tile2Prop,Y ; Same properties for all three tiles W $02:CAE6 STA.W OAM_Tile2Prop,Y ; Tile 2 properties = [$08] X-flipped W $02:CB32 STA.W OAM_Tile2Prop,Y ; Tile 2 properties = same W $02:CD12 STA.W OAM_Tile2Prop,Y ; Lower tile properties W $02:E025 STA.W OAM_Tile2Prop,Y ; Tile 2 = same with X flip W $02:E5AA STA.W OAM_Tile2Prop,Y ; Right tile properties = same | X flip W $02:E6B8 STA.W OAM_Tile2Prop,Y ; Bait properties W $02:E92B STA.W OAM_Tile2Prop,Y ; Right properties = same W $02:EA1F STA.W OAM_Tile2Prop,Y ; Same properties for bottom tile R $02:F1C2 LDA.W OAM_Tile2Prop,Y ; A = head's property byte R $02:F1E8 LDA.W OAM_Tile2Prop,Y ; A = head's property byte W $02:F4BD STA.W OAM_Tile2Prop,Y ; Right puff property = $45 (X-flipped) W $02:F52D STA.W OAM_Tile2Prop,Y ; Same for bottom tile W $03:9C28 STA.W OAM_Tile2Prop,Y ; Right tile properties: X flipped W $03:C2CB STA.W OAM_Tile2Prop,Y ; First blade tile properties = [$04] $0308 OAM entry 66 X position byte, shadow OAM (sprite 66; indexed by OAM offset Y) Shadow copy of the X position of hardware sprite 66. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen X in pixels, $00-$FF (the high X bit lives in the $0400 table).
18 uses in 14 routines (3 read, 15 write) R $01:9843 LDA.W OAM_Tile3DispX,Y ; A = timer / 2: carry = timer bit 0 W $01:BB61 STA.W OAM_Tile3DispX,Y ; Tile 2 X (left door column) W $01:BD6E STA.W OAM_Tile3DispX,Y ; Tile 3 X = screen X + MagiKoopasMagicDisp[[$03]] W $01:BEE4 STA.W OAM_Tile3DispX,Y ; Store as tile 3 X W $01:C146 STA.W OAM_Tile3DispX,Y ; Tile 3 X = tile 2 X + 8 W $01:DF31 STA.W OAM_Tile3DispX,Y ; Symbol tile 3 X W $02:9847 STA.W OAM_Tile3DispX,Y ; Sprite 3 X W $02:BC37 STA.W OAM_Tile3DispX,Y ; Tile 3 at X + $18 W $02:BC4B STA.W OAM_Tile3DispX,Y ; Tile 3 at X W $03:B290 STA.W OAM_Tile3DispX,Y ; Store OAM X W $03:C291 STA.W OAM_Tile3DispX,Y ; OAM X of the second blade tile $0309 OAM entry 66 Y position byte, shadow OAM (sprite 66; indexed by OAM offset Y) Shadow copy of the Y position of hardware sprite 66. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen Y in pixels; $F0 hides the sprite (off-screen).
16 uses in 15 routines (2 read, 14 write) W $00:9226 STA.W OAM_Tile3DispY,Y ; Upper sprite Y = $68 W $01:B3AD STA.W OAM_Tile3DispY,Y ; Tile 2 Y = A (top row) W $01:BBA8 STA.W OAM_Tile3DispY,Y ; Tile 2 Y W $01:BD5B STA.W OAM_Tile3DispY,Y ; Tile 3 Y = screen Y + MagiKoopasMagicDisp[[$02]] W $01:BEEF STA.W OAM_Tile3DispY,Y ; Store as tile 3 Y W $01:C154 STA.W OAM_Tile3DispY,Y ; Same Y for tiles 2 and 3 W $01:DF66 STA.W OAM_Tile3DispY,Y ; Symbol tile 3 Y W $02:9862 STA.W OAM_Tile3DispY,Y ; Sprite 3 Y W $02:BC56 STA.W OAM_Tile3DispY,Y ; All three tiles at the same Y W $02:E03A STA.W OAM_Tile3DispY,Y ; Tile 3 Y = tile 1 Y W $03:B29A STA.W OAM_Tile3DispY,Y ; Store OAM Y W $03:C2A8 STA.W OAM_Tile3DispY,Y ; OAM Y of the second blade tile $030A OAM entry 66 tile number byte, shadow OAM (sprite 66; indexed by OAM offset Y) Shadow copy of the tile number of hardware sprite 66. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: tile number in the sprite GFX page.
14 uses in 11 routines (14 write) W $00:921B STA.W OAM_Tile3,Y ; Upper sprite tile W $01:B337 STA.W OAM_Tile3,Y ; Middle tiles $EB W $01:B34E STA.W OAM_Tile3,Y ; Middle tiles $61 W $01:B373 STA.W OAM_Tile3,Y ; Short platform: third tile = $62 (right end) W $01:B788 STA.W OAM_Tile3,Y ; Tile 2 = $40 W $01:BD8E STA.W OAM_Tile3,Y ; Tile 3 = $98 W $01:BF06 STA.W OAM_Tile3,Y ; Wand tile = $99 W $01:C160 STA.W OAM_Tile3,Y ; Tile 3 = $D5 W $02:9896 STA.W OAM_Tile3,Y ; Sprite 3 tile = $7D W $02:98A8 STA.W OAM_Tile3,Y ; Sprite 3 tile = $7C W $02:E048 STA.W OAM_Tile3,Y ; Store as tile 3 W $03:C2C1 STA.W OAM_Tile3,Y ; Second blade tile = $8E $030B OAM entry 66 tile properties byte, shadow OAM (sprite 66; indexed by OAM offset Y) Shadow copy of the tile properties of hardware sprite 66. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Bits: YXPPCCCT: Y flip, X flip, priority (bits 4-5), palette (bits 1-3), tile page (bit 0).
16 uses in 14 routines (2 read, 14 write) W $00:91EC STA.W OAM_Tile3Prop,Y ; Upper sprite properties = DATA_009139[X] W $00:E3EC STA.W OAM_Tile3Prop,Y ; Store the property of slot 3 R $01:9A47 EOR.W OAM_Tile3Prop,Y ; Toggle X flip of the third OAM slot W $01:B796 STA.W OAM_Tile3Prop,Y ; Tile 2 properties W $01:BD7F STA.W OAM_Tile3Prop,Y ; Same properties for all three tiles W $01:BF01 STA.W OAM_Tile3Prop,Y ; Properties = flip | priority [$64] | palette W $01:DF9D STA.W OAM_Tile3Prop,Y ; Symbol tile 3 properties W $02:987C STA.W OAM_Tile3Prop,Y ; Properties of sprite 3 W $03:C2CE STA.W OAM_Tile3Prop,Y ; Second blade tile properties = [$04] $030C OAM entry 67 X position byte, shadow OAM (sprite 67; indexed by OAM offset Y) Shadow copy of the X position of hardware sprite 67. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen X in pixels, $00-$FF (the high X bit lives in the $0400 table).
7 uses in 7 routines (7 write) W $00:91FA STA.W OAM_Tile4DispX,Y ; X position of both sprites = [$00] W $01:BB73 STA.W OAM_Tile4DispX,Y ; Tile 3 X W $01:DF3A STA.W OAM_Tile4DispX,Y ; Symbol tile 4 X W $02:9850 STA.W OAM_Tile4DispX,Y ; Sprite 4 X $030D OAM entry 67 Y position byte, shadow OAM (sprite 67; indexed by OAM offset Y) Shadow copy of the Y position of hardware sprite 67. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen Y in pixels; $F0 hides the sprite (off-screen).
8 uses in 8 routines (8 write) W $00:922B STA.W OAM_Tile4DispY,Y ; Lower sprite Y = $70 W $01:B3C3 STA.W OAM_Tile4DispY,Y ; Tile 3 Y = A (bottom row) W $01:BB93 STA.W OAM_Tile4DispY,Y ; Tile 3 Y W $01:DF69 STA.W OAM_Tile4DispY,Y ; Symbol tile 4 Y W $02:9865 STA.W OAM_Tile4DispY,Y ; Sprite 4 Y W $02:E03D STA.W OAM_Tile4DispY,Y ; Tile 4 Y = tile 1 Y $030E OAM entry 67 tile number byte, shadow OAM (sprite 67; indexed by OAM offset Y) Shadow copy of the tile number of hardware sprite 67. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: tile number in the sprite GFX page.
10 uses in 7 routines (10 write) W $00:9221 STA.W OAM_Tile4,Y ; Lower sprite tile = DATA_009105[X] W $01:B435 STA.W OAM_Tile4,Y ; Unused: tile 3 = $88 W $01:B441 STA.W OAM_Tile4,Y ; Tile 3 = $E4 (end cap) W $01:B782 STA.W OAM_Tile4,Y ; Tile 3 = $40 W $02:988E STA.W OAM_Tile4,Y ; Sprite 4 tile = $7C W $02:98A0 STA.W OAM_Tile4,Y ; Sprite 4 tile = $7D W $02:E04C STA.W OAM_Tile4,Y ; Tile 4 = tile 3 + 1 $030F OAM entry 67 tile properties byte, shadow OAM (sprite 67; indexed by OAM offset Y) Shadow copy of the tile properties of hardware sprite 67. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Bits: YXPPCCCT: Y flip, X flip, priority (bits 4-5), palette (bits 1-3), tile page (bit 0).
7 uses in 7 routines (7 write) W $00:91F2 STA.W OAM_Tile4Prop,Y ; Lower sprite properties = DATA_00916A[X] W $01:B367 STA.W OAM_Tile4Prop,Y ; Same properties for the other tiles W $01:B790 STA.W OAM_Tile4Prop,Y ; Tile 3 properties W $01:DFA0 STA.W OAM_Tile4Prop,Y ; Symbol tile 4 properties W $02:987F STA.W OAM_Tile4Prop,Y ; Properties of sprite 4 W $02:E05E STA.W OAM_Tile4Prop,Y ; Set properties for tiles 3 and 4 $0310 OAM entry 68 X position byte, shadow OAM (sprite 68; indexed by OAM offset Y) Shadow copy of the X position of hardware sprite 68. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen X in pixels, $00-$FF (the high X bit lives in the $0400 table).
4 uses in 4 routines (4 write) W $01:DF2B STA.W $0310,Y ; Base tile (OAM slot 5) X $0311 OAM entry 68 Y position byte, shadow OAM (sprite 68; indexed by OAM offset Y) Shadow copy of the Y position of hardware sprite 68. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: screen Y in pixels; $F0 hides the sprite (off-screen).
5 uses in 5 routines (5 write) W $01:B2FC STA.W $0311,Y ; Long platform: tiles 4 and 5 Y position too W $01:B3B0 STA.W $0311,Y ; Tile 4 Y = A (top row) W $01:DF57 STA.W $0311,Y ; Base tile (OAM slot 5) Y $0312 OAM entry 68 tile number byte, shadow OAM (sprite 68; indexed by OAM offset Y) Shadow copy of the tile number of hardware sprite 68. Shadow OAM ($0200 -$041F) is DMA'd to the PPU every frame. Each sprite is 4 bytes: X, Y, tile, properties. Game code picks a free slot and writes all four. Drawing routines (sprites, smoke, score, cutscenes) write it; the NMI DMA is the only reader.
Values: tile number in the sprite GFX page.
6 uses in 4 routines (6 write) W $01:B33F STA.W $0312,Y ; Right end tile $EC W $01:B356 STA.W $0312,Y ; Right end tile $62 W $01:B430 STA.W $0312,Y ; Unused: tile 4 = $85 W $01:B43C STA.W $0312,Y ; Short orange platform: tile 4 = $CB (end cap) W $01:B785 STA.W $0312,Y ; Tile 4 (center) = $40 W $01:DF8E STA.W $0312,Y ; Base tile (OAM slot 5) = $E4, the 16x16 block graphic $0313 OAM properties, tile 68 byte, OAM buffer (indexed by Y) Properties byte (YXPPCCCT: flips, priority, palette, name table bit) of OAM entry 68, the fifth entry of the $0300 page. Draw routines index it with Y: checkerboard platform, turn block bridge, bonus game block, Mario's cape/draw tables each store the tile's properties here; the Fishin' Boo graphics flips it with EOR.
6 uses in 5 routines (1 read, 5 write) W $01:B799 STA.W $0313,Y ; Tile 4 (center) properties W $01:DFA5 STA.W $0313,Y ; Base tile properties = same + 1 (second page) R $03:91F9 EOR.W $0313,Y ; OAM properties of tile slot 4 (offset +$10) ^= DATA_03917C[X] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $01:B3CA STA.W $0315,Y ; Tile 5 Y = A (long platform only) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $03:9204 STA.W $0317,Y ; A ^= $C0; tile slot 5 (+$14) gets it No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $01:B3B7 STA.W $0319,Y ; Tile 6 Y = A (long platform only) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $01:B3CD STA.W $031D,Y ; Tile 7 Y = A (long platform only) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $01:B3BA STA.W $0321,Y ; Tile 8 Y = A (long platform only) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $03:9207 STA.W $0323,Y ; Same value for tile slot 8 (+$20) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $03:91FF STA.W $0327,Y ; Same value for tile slot 9 (+$24) $0340 OAM X position, entry 80 byte, OAM buffer (indexed by Y) Byte 0 (the X position) of OAM entry 80, the first entry of the $0340 block in the shadow OAM buffer. Written with STA,Y by the three-tile rope column sprite and the switch palace ! block particles: screen X low byte. Copied to the PPU by the NMI OAM DMA.
3 uses in 2 routines (3 write) W $04:F35D STA.W $0340,Y ; OAM X = screen X low byte $0341 OAM Y position, entry 80 byte, OAM buffer (indexed by Y) Byte 1 (the Y position) of OAM entry 80, the first entry of the $0340 block in the shadow OAM buffer. Written with STA,Y by the three-tile rope column sprite and the switch palace ! block particles: screen Y low byte. Copied to the PPU by the NMI OAM DMA.
3 uses in 2 routines (3 write) W $04:F358 STA.W $0341,Y ; OAM Y = screen Y low byte $0342 OAM tile number, entry 80 byte, OAM buffer (indexed by Y) Byte 2 (the tile number) of OAM entry 80, the first entry of the $0340 block in the shadow OAM buffer. Written with STA,Y by the three-tile rope column sprite and the switch palace ! block particles: tile; the rope column uses DATA_0CD6D6[X], the switch palace ! particles use $E6. Copied to the PPU by the NMI OAM DMA.
3 uses in 2 routines (3 write) W $04:F362 STA.W $0342,Y ; OAM tile = $E6 (! block) W $0C:D746 STA.W $0342,Y ; OAM tile = DATA_0CD6D6[X] W $0C:D76E STA.W $0342,Y ; OAM tile = $AC (top; later $AE) $0343 OAM properties, entry 80 byte, OAM buffer (indexed by Y) Byte 3 (the properties) of OAM entry 80, the first entry of the $0340 block in the shadow OAM buffer. Written with STA,Y by the three-tile rope column sprite and the switch palace ! block particles: properties (flip, priority, palette); the rope column uses [$02 ]. Copied to the PPU by the NMI OAM DMA.
3 uses in 2 routines (3 write) W $0C:D74B STA.W $0343,Y ; OAM properties = [$02] W $0C:D773 STA.W $0343,Y ; OAM properties = $21 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:EB13 STA.W $0350,Y ; OAM X of the tile ($0350+Y) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:EAF1 STA.W $0351,Y ; OAM Y of the tile ($0351+Y) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:EAF8 STA.W $0352,Y ; OAM tile number No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:EB0E STA.W $0353,Y ; OAM properties $0380 OAM X position, entry 96 byte, OAM buffer (indexed by X) Byte 0 (the X position) of OAM entry 96, the first entry of the $0380 block in the shadow OAM buffer. Written by the cutscene sprite row / 2x2 block drawing, the ending cutscene state sprites, and the carried item / Mario exit walk sprite (tile $E4 or $E6, properties $21 or $3F in the samples). Copied to the PPU by the NMI OAM DMA.
5 uses in 3 routines (5 write) W $0C:CAFF STA.W $0380,X ; OAM X = [$00] W $0C:CBD8 STA.W $0380,X ; OAM X of the moving sprite (slot at $0380 + $28) W $0C:CC0A STA.W $0380,X ; OAM X = [$00] W $0C:D85E STA.W $0380 ; OAM X = [$144C] $0381 OAM Y position, entry 96 byte, OAM buffer (indexed by X) Byte 1 (the Y position) of OAM entry 96, the first entry of the $0380 block in the shadow OAM buffer. Written by the cutscene sprite row / 2x2 block drawing, the ending cutscene state sprites, and the carried item / Mario exit walk sprite (tile $E4 or $E6, properties $21 or $3F in the samples). Copied to the PPU by the NMI OAM DMA.
5 uses in 3 routines (5 write) W $0C:CB05 STA.W $0381,X ; OAM Y = [$0B51] W $0C:CB9D STA.W $0381,X ; OAM Y = [$01] W $0C:CC0F STA.W $0381,X ; OAM Y = [$01] $0382 OAM tile number, entry 96 byte, OAM buffer (indexed by X) Byte 2 (the tile number) of OAM entry 96, the first entry of the $0380 block in the shadow OAM buffer. Written by the cutscene sprite row / 2x2 block drawing, the ending cutscene state sprites, and the carried item / Mario exit walk sprite (tile $E4 or $E6, properties $21 or $3F in the samples). Copied to the PPU by the NMI OAM DMA.
5 uses in 3 routines (5 write) W $0C:CB0A STA.W $0382,X ; OAM tile = $E6 W $0C:CBA2 STA.W $0382,X ; OAM tile = $E4 W $0C:CC15 STA.W $0382,X ; OAM tile = DATA_0CCB7C[Y] $0383 OAM properties, entry 96 byte, OAM buffer (indexed by X) Byte 3 (the properties) of OAM entry 96, the first entry of the $0380 block in the shadow OAM buffer. Written by the cutscene sprite row / 2x2 block drawing, the ending cutscene state sprites, and the carried item / Mario exit walk sprite (tile $E4 or $E6, properties $21 or $3F in the samples). Copied to the PPU by the NMI OAM DMA.
5 uses in 3 routines (5 write) W $0C:CB0F STA.W $0383,X ; OAM properties = $21 W $0C:CBA7 STA.W $0383,X ; OAM properties = $3F W $0C:CBEF STA.W $0383,X ; OAM properties = $35 W $0C:CC1A STA.W $0383,X ; OAM properties = $2D W $0C:D866 STA.W $0383 ; OAM properties = $21 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:CA9A STA.W $03E0,X ; OAM X (slot at $03E0+X) = table X No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:CAA0 STA.W $03E1,X ; OAM Y = table Y No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:CAA6 STA.W $03E2,X ; OAM tile = table tile No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:CAB0 STA.W $03E3,X ; OAM properties = table byte with bits 4-5 replaced by $20 (priority 2) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $02:FA7B STA.W $03EF ; Copy the tile to OAM slot $03EC-$03EF (a duplicate for the screen wrap) $0400 OAM high table, sprites 0-3 byte, packed OAM size bits First byte of the packed OAM high table: 2 bits per sprite (X bit 8 and size) for sprites 0-3. Built each frame from the one-byte-per-sprite entries at $0420 -$049F by the 'Pack OAM size bits' routine, which ORs $0420 ,$0421 ,$0422 ,$0423 together shifted two bits apart. Game mode 00 and the switch icon code write it directly (e.g. $AA = all four sprites 16x16).
Bits: 0-1 sprite 0, 2-3 sprite 1, 4-5 sprite 2, 6-7 sprite 3 (each: bit 0 = X bit 8, bit 1 = large size).
3 uses in 3 routines (3 write) W $00:84AB STA.W $0400,Y ; Store in OAM high table byte [$0400+Y] W $00:93BD STA.W $0400 ; OAM size bits of sprites 0-3 = $AA: all four are 16x16 W $05:B314 STZ.W $0400 ; Clear the OAM high table byte of sprites 0-3 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:84C0 STA.W $0401,Y ; Store in OAM high table byte [$0401+Y] $0420 OAM size bits, sprite 0 byte, one per OAM sprite (indexed by X or Y) Per-sprite size/X-high entry for OAM sprite 0 (OAM entry at $0200 ); the NMI-bound packed table is $0400 -$041F. Draw routines store a value here after writing the tile; the packer folds four of these into one $0400 byte. Heavily used (about 60 sites): extended, minor extended, score, smoke and bounce sprites all write it.
Values: 0 = 8x8 on-screen, 2 = 16x16, 3 = 16x16 with X bit 8 set (sprite on the next page).
62 uses in 56 routines (1 read, 61 write) W $00:86CF STA.W $0420,X ; Size/X-high bytes of two sprites at $0420+X W $00:90CD STA.W $0420,Y ; OAM size table [$0420 + OAM offset / 4] = 2: 16x16 sprite, X bit 8 clear W $01:F4A5 STA.W $0420,Y ; Store in the OAM size table at $0420 W $02:8478 STA.W $0420,X ; OAM size bit [$0420 + offset/4] = 2 (16x16) W $02:8CB4 STA.W $0420,Y ; Size bits = 0 (8x8, X high 0) W $02:8D3E STA.W $0420,Y ; OAM size bit = 2 (16x16) W $02:8DCC STA.W $0420,Y ; OAM size bit = 2 (16x16) W $02:8E6F STA.W $0420,Y ; OAM size bit = 0 (8x8) W $02:8EC8 STA.W $0420,Y ; OAM size bit = 0 (8x8) W $02:8F27 STA.W $0420,Y ; OAM size bit = 0 (8x8) W $02:8F83 STA.W $0420,Y ; OAM size bit = 0 (8x8) W $02:9029 STA.W $0420,Y ; OAM size bit = 0 (8x8) W $02:925E STA.W $0420,Y ; Size bit = 2: 16x16 sprite W $02:978F STA.W $0420,Y ; Write OAM size/X high bits W $02:982B STA.W $0420,Y ; Size of sprite 1 W $02:999B STA.W $0420,Y ; Write OAM size/X high bits W $02:9A60 STA.W $0420,Y ; Write OAM size/X high bits W $02:9AA0 STA.W $0420,Y ; Size of the top half W $02:9BA2 STA.W $0420,Y ; Write OAM size/X high bits W $02:9C63 STA.W $0420,Y ; Write OAM size/X high bits W $02:9D56 STA.W $0420,Y ; Size = 16x16 (overrides the 8x8 just set) W $02:A2BB STA.W $0420,Y ; Size = 0 (8x8) W $02:A3A7 STA.W $0420,Y ; Size = 2 (16x16) W $02:AEEE STA.W $0420,Y ; First tile size bits W $02:AF25 STA.W $0420,Y ; Store size bits W $02:BB83 STA.W $0420,Y ; OAM size bits = wing size ($0420 table) W $02:F428 STA.W $0420,Y ; Tile size = 8x8 W $02:F6E5 STA.W $0420,Y ; OAM size bits = 02 (16x16 tile) W $02:F7FE STA.W $0420,Y ; OAM size bits = 02 (16x16 tile) W $02:FE6D STA.W $0420,Y ; OAM size entry = 2 (16x16) W $03:B006 STA.W $0420,Y ; Copy tile size to the $0420 table W $03:B47F STA.W $0420,Y ; Size = 16x16 (written to $0420 table) W $03:D69A STA.W $0420,Y ; OAM size entry ($0420 table) = 0: 8x8 sprite, X < 256 W $04:8610 STA.W $0420,X ; Size/X-high entry [$0420+tile counter] = 0 (8x8, X < 256) W $07:F23F STA.W $0420,Y ; OAM size table: small tile, X bit 8 = 0 W $0C:A64D STZ.W $0420,X ; High OAM table entry = 0: small tile, X bit 8 clear W $0C:A88C STA.W $0420,X ; First tile: high bits = [$0A] W $0C:A9F7 STA.W $0420,X ; Write size to both tiles' high OAM entries W $0C:AA4C STA.W $0420,X ; Both tiles: large size W $0C:AB04 STA.W $0420,X ; High OAM entry = 2 (large tile) W $0C:B60D STA.W $0420,Y ; Store in the OAM high table entry [$0420 + [$01]] W $0C:CB78 STA.W $0420 ; OAM slot 0 size = 16x16 W $0C:CED0 STA.W $0420,X ; Size bit = 2 (16x16) W $0C:CF6E STZ.W $0420,X ; Size bit = 0 (8x8) W $0C:CFC1 STA.W $0420,X ; Size bit = 2 (16x16) W $0C:D456 STZ.W $0420,X ; OAM high table entry for this sprite = 0 (8x8, X bit 8 clear) W $0C:D4E5 STZ.W $0420,X ; OAM high table entry = 0 $0421 OAM size bits, sprite 1 byte, one per OAM sprite Per-sprite size/X-high entry for OAM sprite 1 (OAM entry at $0204 ); the NMI-bound packed table is $0400 -$041F. Draw routines store a value here after writing the tile; the packer folds four of these into one $0400 byte.
Values: 0 = 8x8 on-screen, 2 = 16x16, 3 = 16x16 with X bit 8 set (sprite on the next page).
9 uses in 9 routines (1 read, 8 write) W $02:982E STA.W $0421,Y ; Size of sprite 2 W $02:9AA3 STA.W $0421,Y ; Size of the bottom half W $02:AEF1 STA.W $0421,Y ; Second tile size bits W $0C:A887 STA.W $0421,X ; Second tile: large size $0422 OAM size bits, sprite 2 byte, one per OAM sprite Per-sprite size/X-high entry for OAM sprite 2 (OAM entry at $0208 ); the NMI-bound packed table is $0400 -$041F. Draw routines store a value here after writing the tile; the packer folds four of these into one $0400 byte.
Values: 0 = 8x8 on-screen, 2 = 16x16, 3 = 16x16 with X bit 8 set (sprite on the next page).
3 uses in 3 routines (1 read, 2 write) W $01:E981 STA.W $0422 ; OAM tile 2 size = 8x8 W $02:9831 STA.W $0422,Y ; Size of sprite 3 $0423 OAM size bits, sprite 3 byte, one per OAM sprite Per-sprite size/X-high entry for OAM sprite 3 (OAM entry at $020C ); the NMI-bound packed table is $0400 -$041F. Draw routines store a value here after writing the tile; the packer folds four of these into one $0400 byte.
Values: 0 = 8x8 on-screen, 2 = 16x16, 3 = 16x16 with X bit 8 set (sprite on the next page).
4 uses in 3 routines (1 read, 3 write) W $02:8323 STA.W $0423,Y ; OAM size bit = 2 (16x16): [$0420 + Y/4] W $02:8359 STA.W $0423,Y ; Spare sprite size = 3: 16x16 with X high bit set, so it also shows at the left edge W $02:9834 STA.W $0423,Y ; Size of sprite 4 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:FB2E STA.W $0430,Y ; [$0430+Y] = carry << 1: size bit (16x16 if carry was set), X bit 8 clear No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:EC5A STZ.W $0440 ; OAM size bit [$0440] = 0 (small) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $04:F58A STA.W $0447 ; OAM size bit for sprite 39: large $0448 OAM size bits, sprite 40 byte, one per OAM sprite Per-sprite size/X-high entry for OAM sprite 40 (OAM entry at $02A0 ); the NMI-bound packed table is
$0400 -$041F. Draw routines store a value here after writing the tile; the packer folds four of these into one $0400 byte. Written without an index by Bowser overlay (Peach), the border icon/map sprites and the lives exchange (large).
Values: 0 = 8x8 on-screen, 2 = 16x16, 3 = 16x16 with X bit 8 set (sprite on the next page).
3 uses in 3 routines (3 write) W $04:F58D STA.W $0448 ; OAM size bit for sprite 40: large No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:86F3 STZ.W $044D ; Size/X-high entries of OAM slots 39-46 = 0 (8x8, X < 256) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:8780 STZ.W $0455 ; Size/X-high entries of OAM slots 47-54 = 0 (8x8, X < 256) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:D6C0 STA.W $045F,Y ; OAM high table entry = 2 (16x16) $0460 OAM size bits, sprite 64 byte, one per OAM sprite (indexed by X or Y) Per-sprite size/X-high entry for OAM sprite 64 (OAM entry at $0300 ); the NMI-bound packed table is
$0400 -$041F. Draw routines store a value here after writing the tile; the packer folds four of these into one $0400 byte. Heavily used (about 60 sites): Wiggler, Boo/bat clusters, Bowser scene floor/roof, chained platform, etc.
Values: 0 = 8x8 on-screen, 2 = 16x16, 3 = 16x16 with X bit 8 set (sprite on the next page).
66 uses in 56 routines (3 read, 63 write) W $00:E4AB STA.W OAM_TileSize,X ; OAM size/X high table [X] = A W $01:8E39 STA.W OAM_TileSize,Y ; OAM size bit = size for this frame W $01:98A0 STA.W OAM_TileSize,Y ; Feet are 8x8 tiles W $01:9DCF STA.W OAM_TileSize,Y ; Both tiles 16x16, X bit 8 from the offscreen flag W $01:9E90 STA.W OAM_TileSize,Y ; OAM size bits = KoopaWingTileSize[X] (high table) W $01:A3EB STA.W OAM_TileSize,Y ; OAM high bit for tile 1 = 1 (X bit 8, pushes it off screen) W $01:B7EB STA.W OAM_TileSize,X ; Unused: keep only the size bit of the old entry, drop X bit 8 W $01:B7F0 STA.W OAM_TileSize,X ; OAM size entry = [$0B] (size bit, X bit 8 = 0) W $01:B816 STA.W OAM_TileSize,X ; Set bit 0 (X bit 8) of the size entry so the tile is not shown wrapped W $01:C93A STA.W OAM_TileSize,X ; Size = 2: 16x16 tile, X high bit clear W $01:C95D STA.W OAM_TileSize,X ; Size = 3: tile gets the X high bit (X position wraps past the screen edge) W $01:DFAF STA.W OAM_TileSize,Y ; Symbol tile 1 size W $01:F09D STA.W OAM_TileSize ; OAM slot 0 size = small W $01:FF3E STA.W OAM_TileSize,Y ; OAM size bits = DATA_01FEB6[slot] W $01:FF93 STA.W OAM_TileSize,Y ; Store OAM size/X-high entry W $02:812B STA.W OAM_TileSize,Y ; OAM size bit = 0 (8x8 tile) W $02:9746 STA.W OAM_TileSize,Y ; Write OAM size/X high bits W $02:98B1 STA.W OAM_TileSize,Y ; Size of sprite 1 W $02:99CE STA.W OAM_TileSize,Y ; Write OAM size/X high bits W $02:A3F2 STA.W OAM_TileSize,Y ; Size = 2 (16x16) W $02:C902 STA.W OAM_TileSize,Y ; Tile size = 2 (16x16) W $02:CA87 STA.W OAM_TileSize,Y ; Tile 1 size by pose W $02:CAF0 STA.W OAM_TileSize,Y ; Tile 1 size by pose W $02:CB39 STZ.W OAM_TileSize,X ; Tile 1 size = 8x8 W $02:CB8B STZ.W OAM_TileSize,X ; Tile size = 8x8 W $02:CBF7 STA.W OAM_TileSize,Y ; Tile size by index W $02:CD1B STA.W OAM_TileSize,Y ; Upper tile size = 8x8 W $02:DA3F STA.W OAM_TileSize,Y ; Store OAM size bit W $02:DB39 STA.W OAM_TileSize,Y ; Store OAM size bit W $02:DC9F STA.W OAM_TileSize,Y ; Store OAM size bit W $02:DE93 STA.W OAM_TileSize,Y ; Store OAM size bit W $02:ED14 STA.W OAM_TileSize,Y ; OAM size bit from the table W $02:F190 STA.W OAM_TileSize,Y ; Tile size = 16x16 W $02:F1F8 STA.W OAM_TileSize,Y ; Tile size = 8x8 W $02:F4C6 STA.W OAM_TileSize,Y ; Left puff size = 16x16 W $02:F536 STA.W OAM_TileSize,Y ; Top tile size = 8x8 W $02:F60D STA.W OAM_TileSize,Y ; Size = 16x16, plus the X high bit W $02:F662 STA.W OAM_TileSize,Y ; OAM size bits = 02 (16x16 tile) W $02:F7CB STA.W OAM_TileSize,Y ; OAM size bits = 02 (16x16 tile) W $02:FA5B STA.W OAM_TileSize,Y ; OAM size bits = 02 (16x16 tile) W $02:FCD5 STA.W OAM_TileSize,Y ; Sprite is on the next page: OAM size entry = 3 (16x16, X bit 8 set) W $02:FD8E STA.W OAM_TileSize,Y ; OAM size entry = 2 (16x16) W $03:86E8 STA.W OAM_TileSize,Y ; OAM size bits from ForestPlatTileSize W $03:8B93 STA.W OAM_TileSize,Y ; OAM size from BwsrStatueTileSize W $03:96E1 STA.W OAM_TileSize,X ; Store in OAM size table W $03:AB07 STA.W OAM_TileSize,Y ; OAM size table W $03:AD15 STA.W OAM_TileSize,Y ; OAM size = 16x16 for this tile W $03:B254 STA.W OAM_TileSize,Y ; Store OAM size/high X bit W $03:B3A8 STA.W OAM_TileSize,Y ; Store OAM size W $03:B4E7 STA.W OAM_TileSize,Y ; Size = 16x16 W $03:B55F STA.W OAM_TileSize,Y ; Size = 16x16 W $03:C106 STA.W OAM_TileSize,X ; Tile size = 16x16 (X high bit 0) W $03:C4D3 STA.W OAM_TileSize,Y ; Tile size = 16x16 W $03:C9B5 STA.W OAM_TileSize,Y ; Tile size = 8x8 W $03:D4D1 STA.W OAM_TileSize,Y ; OAM size bits = DATA_03D342[X] (2 = 16x16, 0 = 8x8) W $03:D516 STA.W OAM_TileSize,Y ; OAM size bits = DATA_03D3CC[X] (2 = 16x16, 0 = 8x8) W $0C:A112 STA.W OAM_TileSize,X ; OAM size = large (16x16), X bit 8 = 0 $0461 OAM size bits, sprite 65 byte, one per OAM sprite Per-sprite size/X-high entry for OAM sprite 65 (OAM entry at $0304 ); the NMI-bound packed table is
$0400 -$041F. Draw routines store a value here after writing the tile; the packer folds four of these into one $0400 byte.
Values: 0 = 8x8 on-screen, 2 = 16x16, 3 = 16x16 with X bit 8 set (sprite on the next page).
12 uses in 12 routines (12 write) W $01:A3FD STA.W $0461,Y ; OAM high bit for tile 2 = 1 (X bit 8) W $01:DFB2 STA.W $0461,Y ; Symbol tile 2 size W $01:E757 STA.W $0461,Y ; Both tiles are 8x8 W $02:98B4 STA.W $0461,Y ; Size of sprite 2 W $02:CA8C STA.W $0461,Y ; Tile 2 size = 2 (16x16) W $02:CAF3 STA.W $0461,Y ; Tile 2 size = same W $02:CB3C STZ.W $0461,X ; Tile 2 size = 8x8 W $02:CD1E STA.W $0461,Y ; Lower tile size = 8x8 W $02:F4C9 STA.W $0461,Y ; Right puff size = 16x16 W $02:F539 STA.W $0461,Y ; Bottom tile size = 8x8 $0462 OAM size bits, sprite 66 byte, one per OAM sprite Per-sprite size/X-high entry for OAM sprite 66 (OAM entry at $0308 ); the NMI-bound packed table is
$0400 -$041F. Draw routines store a value here after writing the tile; the packer folds four of these into one $0400 byte.
Values: 0 = 8x8 on-screen, 2 = 16x16, 3 = 16x16 with X bit 8 set (sprite on the next page).
4 uses in 4 routines (4 write) W $01:BF12 STA.W $0462,Y ; Tile 3 size = 8x8 plus off-screen-horizontal flag in $0460 table W $01:DFB5 STA.W $0462,Y ; Symbol tile 3 size W $02:98B7 STA.W $0462,Y ; Size of sprite 3 $0463 OAM size bits, sprite 67 byte, one per OAM sprite Per-sprite size/X-high entry for OAM sprite 67 (OAM entry at $030C ); the NMI-bound packed table is
$0400 -$041F. Draw routines store a value here after writing the tile; the packer folds four of these into one $0400 byte.
Values: 0 = 8x8 on-screen, 2 = 16x16, 3 = 16x16 with X bit 8 set (sprite on the next page).
4 uses in 4 routines (4 write) W $00:9212 STA.W $0463,Y ; X bit 8 ([$01] bit 0) into the OAM size table for both sprites ($0462 and $0463 + Y) W $01:BC08 STA.W $0463,Y ; Frame 2 (open): W $01:DFB8 STA.W $0463,Y ; Symbol tile 4 size W $02:98BA STA.W $0463,Y ; Size of sprite 4 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $01:BC0B STA.W $0464,Y ; Hide tile 4 (X bit 8 set) W $01:DFBD STA.W $0464,Y ; Base tile size = 2 (16x16) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $01:BC13 STA.W $0466,Y ; Frames 1 and 2: hide tile 6 (X bit 8 and size set) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $04:F375 STA.W $0470,Y ; OAM size bit: 16x16 sprite No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:EB32 STZ.W $0474,X ; OAM size bits [$0474+X] = 0 (small) $0480 OAM size bits, sprite 96 byte, one per OAM sprite Per-sprite size/X-high entry for OAM sprite 96 (OAM entry at $0380 ); the NMI-bound packed table is
$0400 -$041F. Draw routines store a value here after writing the tile; the packer folds four of these into one $0400 byte. Written with value 2 (16x16) by the cutscene sprite row, ending sprites and the carried item sprite.
Values: 0 = 8x8 on-screen, 2 = 16x16, 3 = 16x16 with X bit 8 set (sprite on the next page).
5 uses in 3 routines (5 write) W $0C:CB18 STA.W $0480,X ; OAM high table: size = 16x16 W $0C:CBB1 STA.W $0480,X ; OAM high table: size = 16x16 W $0C:CBF6 STZ.W $0480,X ; OAM high table: size = 8x8 W $0C:CC24 STA.W $0480,X ; OAM high table: size = 16x16 W $0C:D86B STA.W $0480 ; OAM high table entry = 2 (16x16) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:CAC0 STA.W $0498,X ; OAM high table ($0498+slot) = size bit (properties bit 4 moved to bit 1) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $02:FA80 STA.W $049B ; Size bits of the copy = 3: 16x16 with X bit 8, so it shows at X - 256 $04A0 Window HDMA table, left edge byte table, 2 bytes per scanline (left, right) Window left edge per scanline for the HDMA windowing effect on channel 7 (to $2126). The table has 224 lines of 2 bytes: $04A0 + 2*line is the left edge and $04A1 + 2*line is the right edge (WH0/WH1); lines 0-111 are here and lines 112-223 continue at $0580. An empty window is left $FF / right $00 (or left 1). Written by iris-out/peace pose, dark room spotlight, screen wipes, overworld load and the lives exchange.
11 uses in 6 routines (11 write) W $00:9291 STZ.W $04A0,X ; Left edge of this line = $00 W $00:A185 STZ.W $04A0,X ; Clear [$04A0+X] (probably resets a sprite table) W $00:CA9F STA.W $04A0,X ; Outside the circle: window left = $FF, right = $00 (empty) W $00:CAD3 STA.W $04A0,X ; Top line window left edge W $00:CAFB STA.W $04A0,Y ; Mirrored line window left edge W $03:C609 STA.W $04A0,X ; Window left = 1 (empty window: no light on this line) W $03:C612 STA.W $04A0,X ; Window left = [$147A] W $0C:AB7C STA.W $04A0,X ; Top half scanline entry at $04A0+X $04A1 Window HDMA table, right edge byte table, 2 bytes per scanline (left, right) Window right edge per scanline, interleaved with $04A0 (left edge) in the channel 7 HDMA window table. Right $FF with left $00 covers the whole line; left $FF with right $00 is empty. Cleared and filled by the HDMA window init at $00:9263 and by the iris/spotlight routines (peace pose, dark room, overworld load).
10 uses in 5 routines (10 write) W $00:9296 STA.W $04A1,X ; Right edge = $FF: the line is fully covered by the window W $00:A188 STA.W $04A1,X ; [$04A1+X] = $FF W $00:CAAE STA.W $04A1,Y ; Same empty window on the mirrored line (left $FF, right $00) W $00:CAC7 STA.W $04A1,X ; Top line window right edge W $00:CAE1 STA.W $04A1,Y ; Left = 0, right = 0 on the mirrored line, then A = $FF W $00:CAEF STA.W $04A1,Y ; Mirrored line window right edge W $03:C618 STA.W $04A1,X ; Store window right No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:AE4D STA.W $04A3 ; Window HDMA table 1 ($04A0): scanline count of entry 2 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:92FB STA.W $04A4,X ; Segments 1 and 2 scroll = [$1A+Y] (BG1 [$1A], BG2 [$1E], BG3 [$22] horizontal scroll) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:AE5C STA.W $04A6 ; Window HDMA table 1: scanline count of entry 3 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:9301 STA.W $04A7,X ; Segment 3 scroll = [$1462+Y] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:AE50 STA.W $04AD ; Window HDMA table 2 ($04AA): scanline count of entry 2 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:AE5F STA.W $04B0 ; Window HDMA table 2: scanline count of entry 3 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:92BA STA.W $04B4 ; First byte of the tables at $04A0, $04AA and $04B4 = $58 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:AE53 STA.W $04B7 ; Window HDMA table 3 ($04B4): scanline count of entry 2 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:AE62 STA.W $04BA ; Window HDMA table 3: scanline count of entry 3 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:92C3 STZ.W $04BD ; Last byte of each 10-byte table = 0 (end of HDMA table) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $05:B275 STA.W $04EC,Y ; Window HDMA table, upper half (filled from the center up) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F45E STA.W $04F0,X ; Left edge = $FF (empty window) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F461 STZ.W $04F1,X ; Right edge = 0 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $05:B278 STA.W $053C,X ; Window HDMA table, lower half (filled from the center down) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F47F STA.W $0548,Y ; Store window edge in the lower half of the table No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:AB7F STA.W $057E,Y ; Bottom half scanline entry at $057E+Y (mirrored) $0590 Window table, line 112 area byte table (ROM bytes mixed in), shares $04A0 HDMA table In RAM, part of the second half of the windowing HDMA table at $0580 (lines 112-223, left/right pairs). The lives exchange iris effect stores the window edge here ($0590 ,X) and at $0548 ,Y for the upper half. The 9 read hits are not RAM: the layer 3 image table in bank 05 contains bytes that look like $0590 .
1 use in 1 routine (1 write) W $04:F482 STA.W $0590,X ; Store window edge in the upper half of the table No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:DB84 STA.W $0598,X ; Write edges to the bottom table ($04EE+Y) and the top table ($0598+X) $0680 Palette upload select byte (0, 3 or 6); doubles as ROM pointer bytes Requests a CGRAM palette upload in NMI and selects which buffer: 0 = none/queue at $0682 , 3 = list at $0905 ,
6 = list at $0703 . The upload routine ('MoreDMA') clears it to 0 once the records are sent; the level-end dithered fade and the overworld submap/event code set 3 or 6; the finish pose code checks for 3. Most of the 284 hits are not RAM: the level layer 1 data pointer table in bank 05 holds $06:8000-style addresses.
7 uses in 5 routines (3 read, 4 write) R $00:A488 LDY.W $0680 ; Y = [$0680]: which palette buffer to upload (0, 3 or 6) W $00:A4DF STZ.W $0680 ; [$0680] = 0: nothing more to upload W $00:AF9F STA.W $0680 ; [$0680] = 3: upload the list at $0905 to CGRAM in NMI (MoreDMA) W $04:EAA0 STA.W $0680 ; [$0680] = 3: request palette upload (probably) $0681 Palette queue write index byte, index into $0682 buffer Offset of the end of the queued CGRAM record list at $0682 (the first free byte). Magikoopa, Big Boo, Peach ending fade, Bowser room lightning and overworld sprites read it, append a record at $0682 +index and advance it. Cleared with the RAM clear and when the upload (option 0) completes.
14 uses in 7 routines (7 read, 7 write) W $00:8A6D STZ.W $0681 ; [$0681] = 0: probably empties the queued palette upload W $00:A4D9 STZ.W $0681 ; Buffer 0: clear [$0681] (probably the write index) R $01:C033 LDY.W $0681 ; Y = [$0681] (end of the CGRAM upload buffer) W $01:C05B STA.W $0681 ; [$0681] += $12: next free spot in the buffer R $03:8251 LDY.W $0681 ; Y = [$0681]: index into the CGRAM upload queue W $03:8279 STA.W $0681 ; [$0681] += $12: advance the queue by one record R $03:AF0C LDY.W $0681 ; Y = palette write buffer index [$0681] W $03:AF2C STA.W $0681 ; Buffer index += 4 R $03:DFCD LDX.W $0681 ; X = palette buffer write index [$0681] W $03:E057 STX.W $0681 ; Store the new palette buffer index R $04:F74B LDX.W $0681 ; X = [$0681]: write index of the special palette upload buffer W $04:F76B STA.W $0681 ; [$0681] += 4: advance the buffer index $0682 Palette queue first byte count byte (also base of queue records) First byte of the queued palette upload list: each record is [byte count][CGRAM start index][color data], with a count of 0 ending the list. Written (count $10 = 8 colors, 2 = one color) by Magikoopa, Big Boo, Peach and Bowser room code, indexed by X/Y from $0681 ; cleared by the uploader when empty. Some hits are ROM pointer bytes in the bank 05 level layer 1 data table.
7 uses in 7 routines (7 write) W $00:A4DC STZ.W $0682 ; Clear [$0682], the first record length (empty list) W $01:C04C STA.W $0682,X ; Record byte count = $10 W $03:826A STA.W $0682,X ; Record byte count = $10 W $03:AF11 STA.W $0682,Y ; Palette buffer: size 2 W $03:DFD2 STA.W $0682,X ; Record header: byte count = $10 (8 colors) W $04:F750 STA.W $0682,X ; Record byte count = 2 (one color) $0683 Palette queue CGRAM index byte, record header Second byte of a queued palette record: the CGRAM color index where the colors go. $F0 = last sprite palette,
$F1 = a single color, 0 = backdrop, $47 and $02 are other overworld/cutscene targets. Written by Magikoopa, Big Boo, Peach fade, Bowser room, overworld sprites and the cutscene phase palette loader.
6 uses in 6 routines (6 write) W $01:C051 STA.W $0683,X ; Record CGRAM color index = $F0 (sprite palette F) W $03:826F STA.W $0683,X ; Record CGRAM address = $F0 (last sprite palette) W $03:AF16 STA.W $0683,Y ; Palette buffer: CGRAM color $F1 W $03:DFD5 STZ.W $0683,X ; CGRAM start address = 0 (backdrop color) W $04:F755 STA.W $0683,X ; CGRAM color index = $47 $0684 Palette queue color data (low) byte, record data First data byte of a queued palette record (color low byte of the first color; the record continues at $0685 , $0686 ...). Written by Bowser room lightning, scene phase palette, Magikoopa, Big Boo, Peach and overworld sprites through X/Y index from $0681 .
8 uses in 6 routines (8 write) W $01:C03A STA.W $0684,Y ; Write it to the buffer at $0684+Y W $03:8258 STA.W $0684,Y ; Store at $0684 + Y (data part of the new queue record) W $03:AF1B STA.W $0684,Y ; Color low byte W $03:E031 STA.W $0684,Y ; Color 0 (backdrop) in the buffer = A W $04:F75B STA.W $0684,X ; Color low byte = [$0753+Y] W $0C:AC08 STA.W $0684,X ; Copy a color word [[$00]] into $0684+X W $0C:AC23 STA.W $0684,X ; Terminate the upload table with 0 $0685 Palette queue color high byte byte, record data (also ROM bytes) Second data byte of a queued palette record: the high byte of the first color (with $0684 as the low byte). Bowser room lightning zeroes it as the default color 0 before replacing it. Some read hits are ROM pointer bytes in the bank 05 level layer 1 data table.
3 uses in 3 routines (3 write) W $03:AF20 STA.W $0685,Y ; Color high byte W $03:DFDB STZ.W $0685,X ; Default color 0 = $0000 (replaced below) W $04:F761 STA.W $0685,X ; Color high byte = [$0754+Y] $0686 Palette queue data / end marker byte, record data (also ROM bytes) Third data byte of a queued palette record (color 1 low byte); Bowser room lightning writes colors 1-7 here. Peach and overworld sprites write 0 at this position (+X) as the end-of-list terminator. Most of the 33 hits are not RAM: bank 05 level layer 1/2 data pointer tables hold these bytes.
4 uses in 3 routines (4 write) W $03:AF25 STA.W $0686,Y ; Terminator $00 W $03:E046 STA.W $0686,Y ; ...into the buffer (colors 1-7 of the record) W $03:E050 STZ.W $0686,X ; Write terminator 0 after the record W $04:F764 STZ.W $0686,X ; End of the record list No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $0691 Palette queue second record CGRAM index byte, record header In the cutscene scene phase palette load, the second queued palette record is placed at $0690: count $0C at $0690 and CGRAM index $12 at $0691 . In RAM it is just the second byte of whichever record starts at $0690 . One hit is a ROM pointer byte in the bank 05 level layer 1 data table (level $015).
1 use in 1 routine (1 write) W $0C:ABC3 STA.W $0691 ; Palette upload entry 2: length $0C, CGRAM address $12 $0694 Palette queue terminator byte, end of record list A zero here ends the queued CGRAM record list after one record (record size 2 + $10 data bytes from $0682 + X). Magikoopa and the Big Boo boss store 0 here with STZ,X to terminate the queue. One hit is a ROM pointer byte in the bank 05 level layer 1 data table (level $0E3).
2 uses in 2 routines (2 write) W $01:C054 STZ.W $0694,X ; Terminate the buffer with 0 W $03:8272 STZ.W $0694,X ; Terminate the queue after the record $0701 Backdrop color (CGRAM mirror) word (little endian, low/high pair), palette color 0 Low byte of CGRAM color 0, the backdrop color, in the palette buffer that is DMAed to the PPU each frame. $0702 is its high byte. The buffer starts here, so $0701 + 2*n is palette color n (see $0703 ). Set by level, overworld, title and cutscene loaders; the level-end fade, Bowser lightning flash, dark room spotlight and fireworks effects rewrite it; the fixed color routine reads it as the BGR555 backdrop.
Values: BGR555 color, e.g. $0000 = black, $7FFF = white.
19 uses in 16 routines (4 read, 15 write) W $00:9D30 STA.W $0701 ; BG color (CGRAM mirror $0701) = A W $00:A10A STA.W $0701 ; BG color = $318C (darker background) R $00:A5E8 LDX.W $0701 ; X = [$0701] (backdrop color) W $00:ADE1 STA.W $0701 ; Backdrop color [$0701] = $0017 (very dark red) W $00:AE27 STA.W $0701 ; Backdrop color [$0701] = $0017 (very dark red) R $00:AE4B LDA.W $0701 ; A = backdrop color [$0701] (BGR555) W $00:AF95 STA.W $0701 ; [$0701] = new backdrop color W $03:AC14 STZ.W $0701 ; Clear $0701 (background color low) W $03:C51C STA.W $0701 ; Backdrop color low = DATA_03C4D8[Y] W $03:C7B0 STA.W $0701 ; Backdrop color low = DATA_03C78A[Y] R $03:DFEB LDA.W $0701 ; A = [$0701] (current backdrop color) W $04:962D STZ.W $0701 ; [$0701] = 0 (backdrop color) W $0C:ABDB STA.W $0701 ; Palette buffer color word [$0701] W $0C:CC5B STA.W $0701 ; Backdrop color mirror $0701 = $7393 or $7FFF (white), swapped every 2 frames W $0C:CC77 STA.W $0701 ; Restore the backdrop color from the Palettes? table ($00B0A0) $0702 Backdrop color, high byte byte (high half of $0701) High byte of the backdrop color word at $0701 (palette buffer color 0). Only written as a single byte by the title load, Bowser phase 9 (cleared), the dark room spotlight and the Peach fireworks, which write the low and high bytes separately from data tables.
4 uses in 4 routines (4 write) W $00:93DD STZ.W $0702 ; Backdrop color mirror [$0701] = $0000 (black) W $03:AC17 STZ.W $0702 ; Clear $0702 (background color high) W $03:C522 STA.W $0702 ; Backdrop color high = DATA_03C4DA[Y] W $03:C7B6 STA.W $0702 ; Backdrop color high = DATA_03C78E[Y] $0703 Palette buffer, color 1 onward byte table (palette buffer, 2 bytes per color, index X) The CGRAM mirror continues past the backdrop color: $0703 is the low byte of palette color 1, and the buffer runs on for the whole 256-color palette. Level palette loaders store rows of colors with STA,X; the level-end dithered fade and the overworld event tile fade read colors back from it. The title and overworld iris code also store single bytes here, e.g. $FE.
6 uses in 6 routines (2 read, 4 write) W $00:ACF2 STA.W $0703,X ; Store in the palette buffer at $0703+X W $00:AD05 STA.W $0703,X ; Store it in the palette buffer R $00:AF58 LDA.W $0703,X ; A = original color from the palette buffer (picks the dither pattern) R $04:EA6A LDA.W $0703,X ; A = palette mirror byte [$0703+X] No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $00:9232 STZ.W $0704 ; Palette mirror word [$0703] = $0000 (black) W $04:DBB9 STA.W $0704 ; [$0704] = $01 (probably background color mirror $01FE) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:A00C STA.W $071B,X ; Store in the CGRAM mirror $071B+X No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $00:AF79 LDA.W $071D,X ; A = original color No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) $0783 Palette buffer, color 129 onward byte table (palette buffer, index X) Part of the same palette buffer as $0701 /$0703 (offset $82 into it, the sprite-palette half). Read with LDA,X as the source color by the dithered fade used when a level ends (to choose the dither pattern) and by the overworld event palette fade.
3 uses in 2 routines (3 read) R $00:B017 LDA.W $0783,X ; A = source color [$0783+X] (picks the dither pattern) R $04:EA7A LDA.W $0783,X ; A = palette byte [$0783+X] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:9606 STA.W $0807,X ; Copy BowserEndPalette to palette buffer $0807 (scene $0C only) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $00:B072 LDA.W $0823,X ; A = original color from the palette buffer No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:960C STA.W $0827,X ; Copy DATA_00B3CC to palette buffer $0827 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:9663 STA.W $08A7,X ; Copy TheEndPalettes to palette buffer $08A7 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:9669 STA.W $08C7,X ; Copy DATA_00B71A to palette buffer $08C7 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:966F STA.W $08E7,X ; Copy DATA_00B726 to palette buffer $08E7 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:A5EB STX.W $0903 ; Store it at [$0903] (backdrop color of the copy) R $00:AF8D LDA.W $0903 ; A = original backdrop color (copy at [$0903]) $0905 Palette upload record header word (size) plus data, DMA upload record Start of a record in the VRAM/CGRAM upload buffer: a 16-bit size word, then data at $0907 and later. The level-end fade stores $01FE here (size $FE bytes of colors starting at color 1); the overworld event fade stores $0070 . It is also read back and rewritten with ,X as the fade progresses.
4 uses in 2 routines (1 read, 3 write) W $00:AF48 STA.W $0905 ; DMA list header at $0905: $FE bytes of colors starting at color 1 W $00:AF60 STA.W $0905,X ; Store the new color in the DMA list W $04:EA90 STA.W $0905 ; [$0905] = $0070 (upload record: size) $0907 Palette upload data byte table (upload buffer data, index X) Data bytes of the upload record whose header is at $0905: the new colors that will be copied to CGRAM. Written with STA,X by the level-end pose/fade code and the overworld event fade, one color byte at a time, after computing each new color from the palette buffer at $0703 /$0783 .
4 uses in 2 routines (1 read, 3 write) W $00:B021 STA.W $0907,X ; Store the new color at [$0907+X] W $04:EA6D STA.W $0907,X ; Copy it to the upload buffer [$0907+X] W $04:EA7D STA.W $0907,X ; Copy it to [$0907+X] (overwrites with the second palette half) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $00:AF81 STA.W $091F,X ; Store the new color in the DMA list No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:EA96 STA.W $0977 ; [$0977] = $C070 (upload record: CGRAM address / flags) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $00:B02A STA.W $0979,X ; [$0979+X] = source color - new color W $04:EA70 STZ.W $0979,X ; Clear [$0979+X] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:EA9B STZ.W $09E9 ; [$09E9] = 0 (end of upload records) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $00:AF9A STZ.W $0A05 ; End of the DMA list: [$0A05] = 0 W $00:B062 STA.W $0A05 ; Second list header at $0A05: $EE bytes of colors from color $81 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:B058 STA.W $0A11,Y ; Copy a word of the player's palette into the second DMA list No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $00:B07A STA.W $0A25,X ; Store the new color in the second list No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:B08D STZ.W $0AF5 ; End of the second list: [$0AF5] = 0 $0AF6 Object gravity / grid buffer byte table (index X or Y) A multi-use table shared by different modes, so the meaning depends on the caller. Credits and ending scenes: per-object gravity added to the Y speed ($0B05 ) each frame (set to 1). Overworld: a buffer of animated tile bytes copied by the water tile animation, which also rotates it with ROL/ROR. Mode 7 boss rooms: a copy of the tile layout grid kept at $0AF6 +Y, read by the rotated tile check.
14 uses in 7 routines (5 read, 7 write, 2 read-modify-write) R $01:CCBF LDA.W $0AF6,Y ; Tile number from the grid at $0AF6 W $03:D9AE STA.W $0AF6,Y ; Keep a copy of the layout at $0AF6 + Y W $04:80C5 STA.W $0AF6,X ; Store it in the buffer at $0AF6 W $04:80D5 STA.W $0AF6,X ; Store as a word (planes 2/3) R $04:80E8 LDA.W $0AF6,X ; Read one byte of the tile RW $04:80F4 ROL.W $0AF6,X ; Rotate the byte left by one bit RW $04:80FB ROR.W $0AF6,X ; Rotate the byte right by one bit W $04:818A STA.W $0AF6,X ; Row = previous row (shifted down by one) W $0C:A07D STA.W $0AF6,X ; $0AF6[X] = 1 (probably gravity added to the speed each frame) W $0C:A42B STA.W $0AF6,X ; Actor gravity = 1 R $0C:A8A9 ADC.W $0AF6,X ; Y speed [$0B05+X] += gravity [$0AF6+X] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:A560 STA.W $0AFD,X ; Gravity of actor 7+X = 4 $0B05 Credits object Y speed byte table, one per credits object (index X) Vertical speed of each credits/ending actor, as a signed value in 4.4 fixed point ($F0 = -1 pixel per frame). Set by the cutscene and credits setup (e.g. $F6 = -10 for a bounce, from DATA_0CA3C2), incremented by the gravity value in $0AF6 each frame, and added to Y position ($0B41 ) and subpixel ($0B23 ) by the movers. Slots are $0F apart: $0B06 is slot 1.
25 uses in 10 routines (10 read, 15 write) W $0C:A078 STA.W $0B05,X ; $0B05[X] = initial vertical speed from DATA_0CA3C2 ($F6 = -10) W $0C:A31D STA.W $0B05,X ; Actor 1 Y speed += 1 (gravity) W $0C:A32C STA.W $0B05,X ; Landed: Y speed = $F0 (bounce up) W $0C:A426 STA.W $0B05,X ; Actor Y speed = DATA_0CA3C2[Y] W $0C:A8BE STA.W $0B05,X ; Bounce speed = $F6 (upward) W $0C:CD3B STA.W $0B05,X ; Actor 0 Y speed = $F0 (-1 pixel per frame, 4.4 fixed point) R $0C:CD77 LDA.W $0B05,X ; A = actor 1 Y speed R $0C:CE06 LDA.W $0B05,X ; A = actor 1 Y speed W $0C:D3C8 STA.W $0B05,X ; Y speed = DATA_0CD386[X] (initial upward speed) W $0C:D506 STA.W $0B05,X ; Object 2 Y speed = $FD (-3, moving up) W $0C:D56D STA.W $0B05,X ; Object 3 Y speed = 1 $0B06 Credits object 1 Y speed byte (slot 1 of $0B05) Y speed of object/actor 1, i.e. slot 1 of the table at $0B05 . Set by the cutscene steps (e.g. 8 or $F8 = -8) and by the credits scene actor setup ($F0 for the hopping character), and read by the hopping character update.
5 uses in 4 routines (1 read, 4 write) R $0C:A336 LDA.W $0B06 ; Actor 1 Y speed W $0C:A3FB STA.W $0B06 ; Actor 1 Y speed = $F0 (hopping) W $0C:CD72 STA.W $0B06 ; Actor 1 Y speed = 8 W $0C:CDEC STA.W $0B06 ; At or above $20: actor 1 Y speed = 8 W $0C:D326 STA.W $0B06 ; Object 1 Y speed = $F8 (-8, moving up) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:D301 STA.W $0B07 ; Object 2 Y speed = 8 (moving down) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:A53F STA.W $0B09 ; Y speeds of actors 3 and 4 = $98 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:A547 STA.W $0B0B ; Y speeds of actors 5 and 6 = $D4 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:A55B STA.W $0B0C,X ; Y speed of actor 7+X = $C0 (launch upward) $0B14 Credits object X speed byte table, one per credits object (index X) Horizontal speed of each credits/ending actor, signed (e.g. $F8 = walk left half a pixel per frame). Set by cutscene scene steps, eggshell fragment spawning (from DATA_0CA5DA) and falling debris (DATA_0CD396), and used by the movers to update X position ($0B50 ). $0B15 is slot 1.
11 uses in 7 routines (1 read, 10 write) W $0C:A251 STA.W $0B14,X ; Actor 0 X speed = $F8 (walk left, 1/2 pixel per frame) W $0C:A2F1 STA.W $0B14,X ; Actor X speed = $F8 (move left) W $0C:A5FA STA.W $0B14,X ; X speed of fragment = [DATA_0CA5DA+Y] ($E8, $18, $F4, $0C) W $0C:CAED STA.W $0B14,X ; [$0B15] = $F0 (cutscene object 1 field set to off-screen value) W $0C:CB3D STA.W $0B14,X ; [$0B14] = $30 or $18 W $0C:D3CE STA.W $0B14,X ; X speed = DATA_0CD396[X] W $0C:D568 STA.W $0B14,X ; Object 3 X speed = 6 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $0C:A5BE STZ.W $0B16 ; X speed of actor 2 = 0 W $0C:D306 STA.W $0B16 ; Object 2 X speed = $FF (-1, moving left) $0B23 Credits object Y subpixel byte table, one per credits object (index X) Fractional part of each object's Y position: the movers add the Y speed's fractional bits to it with ADC and carry the overflow into the whole-pixel Y position ($0B41 ). Cleared (STZ) when objects are initialized.
7 uses in 4 routines (2 read, 5 write) R $0C:A729 ADC.W $0B23,X ; Y subpixel [$0B23+X] += fraction; carry kept for the position add W $0C:A8B9 STZ.W $0B23,X ; Clear Y subpixel R $0C:D342 ADC.W $0B23,X ; Y subpixel += A; carry saved for the high part No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $0B32 Credits object X subpixel byte table, one per credits object (index X) Fractional part of each object's X position, counterpart of $0B23 . Only written here, cleared with STZ when credits jumping objects, scene actors and cutscene objects are initialized.
3 uses in 3 routines (3 write) W $0C:A059 STZ.W $0B32,X ; Clear the object tables $0B23 and $0B32 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (2 write) W $0C:D37F STZ.W $0B34 ; Clear the subpixel bytes of objects 0-2 (note: $0B34 cleared twice, $0B25 never) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) R $04:8114 LDA.W $0B36,X ; Read one byte of tile 2 RW $04:8118 ROL.W $0B36,X ; Rotate the byte left by one bit No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:A3E6 STZ.W $0B39 ; X fractions of actors 0, 1 and 7 = 0 $0B41 Credits object Y position, low byte table, one per credits object (index X or Y) Low byte of each credits/cutscene object's Y position on screen. Cleared or set when objects are created, advanced by the Y speed ($0B05 ) plus carry from $0B23 , and copied from the screen scroll in the castle cutscenes. $0B5F is the high byte. Read by the draw routines (eggs, Yoshis, falling debris). Slots are $0F apart: $0B42 is slot 1, $0B43 slot 2, $0B44 slot 3.
33 uses in 12 routines (22 read, 11 write) W $0C:A066 STA.W $0B41,X ; $0B41[X] = Y position W $0C:A331 STA.W $0B41,X ; Y position = $9F W $0C:A417 STA.W $0B41,X ; Actor X Y position = DATA_0CA3BB[Y] W $0C:A744 STA.W $0B41,X ; Y position low [$0B41+X] += integer part + carry W $0C:A8C8 STA.W $0B41,X ; Y position = floor W $0C:CD31 STA.W $0B41,X ; Actor 0 Y position (low) = screen Y scroll (low) R $0C:CD7C LDA.W $0B41,X ; Moving up: keep moving until its Y position < $68 R $0C:CD85 LDA.W $0B41,X ; Moving down: A = actor 1 Y position R $0C:CE0B LDA.W $0B41,X ; Moving up: stop once Y position < $68 R $0C:CE14 LDA.W $0B41,X ; Moving down: stop once Y position >= $78 R $0C:D15A LDA.W $0B41,X ; Screen scroll = actor 0 position W $0C:D35D STA.W $0B41,X ; Y position += pixel movement + carry $0B42 Credits object 1 Y position, low byte (slot 1 of $0B41) Y position (low byte) of object/actor 1. Set to $9F for the hopping character, or $77 in cutscene steps, and read by the hopping character, landing pose and cutscene draw routines.
8 uses in 6 routines (6 read, 2 write) W $0C:A400 STA.W $0B42 ; Actor 1 Y position = $9F R $0C:A6DB LDA.W $0B42 ; $00 = Yoshi sprite X low, $02 = [$0B42] (probably the tall sprite Y) W $0C:D31C STA.W $0B42 ; Object 1 Y position = $77 $0B43 Credits object 2 Y position, low byte (slot 2 of $0B41) Y position (low byte) of object 2. Set to $77 by the cutscene steps, cleared when a rising sprite is inactive, and read by the cutscene sprite drawing routines.
9 uses in 6 routines (5 read, 4 write) W $0C:CE24 STA.W $0B43 ; [$0B43] = $77 - actor 0 Y: object Y relative to the scrolled screen R $0C:CEFF LDA.W $0B43 ; A = Y position of the object W $0C:D2C4 STA.W $0B43 ; Object 2 Y position = $77 W $0C:D2F1 STA.W $0B43 ; Object 2 Y position = $0F W $0C:D4FD STZ.W $0B43 ; Inactive: clear its Y position $0B44 Credits object 3 Y position, low byte (slot 3 of $0B41) Y position (low byte) of object 3. Cleared by the rising and sideways sprite code when inactive, set by substate 2 of the ending when the seven actors are released, and read by the eggshell/Yoshi code.
4 uses in 3 routines (2 read, 2 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:A569 STA.W $0B45 ; Y positions of actors 3 and 4 = Y position of actor 7+X No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:A572 STA.W $0B47 ; Y positions of actors 5 and 6 = that Y position + 8 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) $0B50 Credits object X position, low byte table, one per credits object (index X or Y) Low byte of each credits/cutscene object's X position. $0B6E is the high byte. Set at scene setup (e.g. $0100 for Mario just off the right edge, $5F/$60 for cutscene objects), changed by the X speed ($0B14 ), and read by the egg, Yoshi and falling debris draw routines. Also the start X of the cutscene sprite row. Slots are $0F apart: $0B51 is slot 1, $0B52 slot 2, $0B53 slot 3.
21 uses in 12 routines (14 read, 7 write) W $0C:A06F STA.W $0B50,X ; $0B50[X] = X position R $0C:A200 LDA.W $0B50,X ; Actor 0 X position, low byte W $0C:A3D8 STA.W $0B50 ; Actor 0 (Mario) X position = $0100 (just off the right edge) W $0C:A420 STA.W $0B50,X ; Actor X position = DATA_0CA3B4[Y] W $0C:CB23 STA.W $0B50 ; Yes (first call): row start X [$0B50] = $60 R $0C:CB87 LDX.W $0B50 ; X = start X of the row: $60, or [$0B50] when [$143E] is non-zero W $0C:D321 STA.W $0B50 ; Object 0 X position = $5F $0B51 Credits object 1 X position, low byte (slot 1 of $0B50) X position (low byte) of object 1. Set by the cutscene 3 and 7 state code (e.g. $98 start value) and read by the object drawing.
4 uses in 2 routines (2 read, 2 write) W $0C:CAD8 STA.W $0B51 ; Object Y [$0B51] = $98 (start height) $0B52 Credits object 2 X position, low byte (slot 2 of $0B50) X position (low byte) of object 2. Set to $80 when the seven ending actors are released, or $90 by the cutscene steps, and read by the object drawing.
3 uses in 3 routines (1 read, 2 write) W $0C:A5BB STA.W $0B52 ; X position of actor 2 = $80 W $0C:D2F9 STA.W $0B52 ; Object 2 X position = $90 $0B53 Credits object 3 X position, low byte (slot 3 of $0B50) X position (low byte) of object 3. Set by substate 2 of the ending, cleared by the rising and sideways sprite code when inactive.
4 uses in 2 routines (2 read, 2 write) W $0C:D55F STZ.W $0B53 ; Inactive: clear object 3 X and Y positions No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:A587 STA.W $0B55 ; X positions of actors 3 and 5 = X position of actor 7+X No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:A590 STA.W $0B56 ; X positions of actors 4 and 6 = that X position + 8 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 read) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) $0B5F Credits object Y position, high byte table, one per credits object (index X) High byte of each object's Y position ($0B41 is the low byte). Copied from the Y scroll high byte in the castle cutscenes, cleared at initialization, and updated with the sign extension and carry when the movers add the Y speed.
15 uses in 6 routines (7 read, 8 write) W $0C:A41A STZ.W $0B5F,X ; Actor Y position high byte = 0 R $0C:A748 ADC.W $0B5F,X ; Y position high [$0B5F+X] += sign byte + carry W $0C:CD36 STA.W $0B5F,X ; Actor 0 Y position (high) = screen Y scroll (high) R $0C:CDDA LDA.W $0B5F,X ; Screen Y scroll = actor 0 Y position R $0C:D361 ADC.W $0B5F,X ; Y position high byte += sign extension + carry No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:D2F4 STZ.W $0B61 ; Object 2 Y high byte = 0 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:A57E STZ.W $0B65 ; Clear Y high bytes of actors 3-6 $0B6E Credits object X position, high byte table, one per credits object (index X or Y) High byte of each object's X position ($0B50 is the low byte). Set to 1 for actors starting off the right edge, cleared at initialization, and read by the eggshell, Yoshi and scene substate code.
12 uses in 6 routines (8 read, 4 write) W $0C:A42E STA.W $0B6E,X ; Actor X position high byte = 1 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $0C:A5B6 STZ.W $0B70 ; X high byte of actor 2 = 0 W $0C:D2FC STZ.W $0B70 ; Object 2 X high byte = 0 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:A59C STZ.W $0B74 ; Clear X high bytes of actors 3-6 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $0C:D3C2 STA.W $0B7D,X ; Gravity [$0B7D,X] = 4 R $0C:D405 ADC.W $0B7D,X ; Y speed += gravity [$0B7D,X] $0B8C Falling debris active flag flag byte table, one per debris slot (index X or Y) Per-slot active flag for the falling debris effect in a cutscene. Set when a slot is spawned, tested while moving it, cleared with STZ when it finishes, and read by the draw routine to skip unused slots.
Values: 0 = slot unused; non-zero = in use.
5 uses in 2 routines (3 read, 2 write) R $0C:D3B6 LDA.W $0B8C,X ; [$0B8C,X] = slot active flag W $0C:D3BD STA.W $0B8C,X ; Mark the slot active R $0C:D3F6 LDA.W $0B8C,X ; Slot active flag W $0C:D418 STZ.W $0B8C,X ; Fell off the bottom: free the slot R $0C:D429 LDA.W $0B8C,Y ; Slot active flag No description written yet. The instructions below show how it is used.
2 uses in 1 routine (2 write) W $00:A88B STA.W $0BF6,X ; Store to buffer at $0BF6+X W $00:A89F STA.W $0BF6,X ; Store to buffer at $0BF6+X $0D76 Mario tile DMA source word table (little endian, steps of 2) First entry of a table of 16-bit source addresses for the per-frame Mario graphics DMA. The routine at
$00:A3DF reads it as the source of a $80 or $40 byte VRAM copy ($0D78 , $0D7A ... $0D80 are the next entries). Written by the animated tile routine in bank $05 (STA $0D76 ,X, X counting down by 2).
4 uses in 2 routines (3 read, 1 write) R $00:A3DF LDA.W $0D76 ; Source = [$0D76] R $00:A3F0 LDA.W $0D76 ; Special case: source = [$0D76] W $05:BB99 STA.W $0D76,X ; Source address for the NMI tile DMA ([$0D76] + X) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $00:A3C3 LDA.W $0D78 ; Source = [$0D78] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $00:A3AC LDA.W $0D7A ; Source = [$0D7A] No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $05:BB62 STA.W $0D7C ; [$0D7C] = VRAM destination of tile 1 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $05:BB5C STA.W $0D7E ; [$0D7E] = VRAM destination of tile 2 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $05:BB56 STA.W $0D80 ; [$0D80] = VRAM destination of tile 3 $0D82 Mario palette pointer word (little endian, low/high pair) Address (in bank $00) of the 20-byte ($14) palette that MarioGFXDMA copies to CG-RAM colour $86 each frame. Set by the Mario draw routine (from DATA_00E2A2 indexed by Y, picks the colour set for the power-up/pose); also read by the finish-pose code at $00:B04E.
3 uses in 3 routines (2 read, 1 write) W $00:E321 STA.W $0D82 ; Palette pointer [$0D82] = DATA_00E2A2[Y] $0D84 Mario GFX DMA list size byte Size of the Mario graphics DMA list: how many tile pieces MarioGFXDMA copies this frame. 0 = skip the palette transfer. The routine repeats the last segment while X < [$0D84 ]. Set to $0A by the controller-clear/Mario GFX setup code, to 6 in the overworld border icon drawing (probably), and cleared by the enemy parade cutscene (game mode 25).
6 uses in 4 routines (3 read, 3 write) W $00:962C STZ.W $0D84 ; Game mode 25 (enemy parade): [$0D84] = 0 W $00:F69B STA.W $0D84 ; [$0D84] = $0A: size of the DMA list processed by MarioGFXDMA W $04:85D5 STA.W $0D84 ; [$0D84] = 6: Mario GFX DMA segment count (probably) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:F64C STA.W $0D85 ; [$0D85] = DMA source for Mario graphics part 1 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:F66A STA.W $0D87 ; [$0D87] = DMA source for Mario graphics part 2 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:F67F STA.W $0D89 ; [$0D89] = DMA source for Mario graphics part 3 $0D8B Dynamic gfx source, top, slot 3 word (little endian), entry of the $0D85 table Source address of the top row of tiles for a dynamically drawn sprite graphic, copied to VRAM by the Mario/ dynamic graphics DMA (it is entry +6 of the table starting at $0D85 , read at $00:A355). Written by the flame/Podoboo draw ($8500 + offset), Yoshi head/wings draw and the Pipe Lakitu / Baby Yoshi helpers. Its partner for the bottom row is $0D95 (= $0D8B + $0200 ).
3 uses in 3 routines (3 write) W $01:E1AB STA.W $0D8B ; Dynamic graphics source (top half): $0D8B = $8600 W $02:EA41 STA.W $0D8B ; Dynamic graphics source, first row = A (probably used by NMI DMA) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $01:EECC STA.W $0D8D ; $0D8D = $8500 + body tile * 32: source of the body's top row No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $0D95 Dynamic gfx source, bottom, slot 3 word (little endian), entry of the $0D8F table Source address of the bottom row of tiles for a dynamically drawn sprite graphic (entry +6 of the table starting at $0D8F , read at $00:A375). Always set to the top-row address in $0D8B plus $0200 , 16 tiles later. Written by the same routines as $0D8B: flames/Podoboo, Yoshi, Pipe Lakitu and Baby Yoshi.
3 uses in 3 routines (3 write) W $01:E1B2 STA.W $0D95 ; Dynamic graphics source (bottom half): $0D95 = $8800 W $01:EEBE STA.W $0D95 ; $0D95 = $0D8B + $0200: head's bottom row (16 tiles later) W $02:EA48 STA.W $0D95 ; Dynamic graphics source, second row = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $01:EED3 STA.W $0D97 ; $0D97 = $0D8D + $0200: body's bottom row No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:F694 STA.W $0D99 ; [$0D99] = DMA source for Mario graphics part 4 $0D9B Special level mode bit flags Selects the special screen mode of the current level or screen. Normal levels use 0. The NMI and IRQ handlers test it to pick the normal path or the Mode 7 / battle path, and sprite code uses it to adapt to Mode 7 rooms. Loaded per level from SpecialLevTable ($05:85xx); set to 1 by title/credits-style game modes and to 2 by game mode 0C setup. Read heavily by the NMI, status bar, Mode 7 boss sprites and OAM routines.
Bit 7: Mode 7 / battle style screen (BPL tests in NMI and IRQ).
Bit 6: Mode 7 boss room (tested with BIT, V flag); $C1 is the value checked for boss rooms.
Values: 0 = normal level, 1 and 2 = special mini-modes used by cutscene/overworld code.
51 uses in 33 routines (47 read, 4 write) R $00:8387 LDY.W $0D9B ; Y = [$0D9B] (special level mode) R $00:907B BIT.W $0D9B ; V = [$0D9B] bit 6 (Mode 7 boss room) W $00:93EC STA.W $0D9B ; [$0D9B] = 1: special level mode (bit 0 = no status bar) R $00:972F LDY.W $0D9B ; Y = [$0D9B] (special level mode) R $00:97DC BIT.W $0D9B ; Test [$0D9B] bits 7 and 6 R $00:9880 BIT.W $0D9B ; Test [$0D9B] bit 6 R $00:9A52 LDA.W $0D9B ; Mode 7 boss room frame code: A = [$0D9B] W $00:9AAA STA.W $0D9B ; Special level mode [$0D9B] = 1 W $00:A17B STA.W $0D9B ; [$0D9B] = 2 (special level mode: overworld) R $00:F8F5 BIT.W $0D9B ; Test [$0D9B] (V = bit 6) R $01:A817 BIT.W $0D9B ; Boss room mode 7 ([$0D9B] bit 6): skip the layer test R $02:96FA LDA.W $0D9B ; A = [$0D9B] (special level mode) R $02:97A3 BIT.W $0D9B ; Test [$0D9B] bit 6 (boss room) R $02:992C BIT.W $0D9B ; Test [$0D9B] bit 6 (boss room) R $02:ADA4 BIT.W $0D9B ; Bit 6 of [$0D9B]: Mode 7 boss room R $02:AE9E BIT.W $0D9B ; Mode 7 boss room flag [$0D9B] bit 6? W $05:851D STA.W $0D9B ; [$0D9B] = special level type from SpecialLevTable (80/C0/C1 = boss rooms) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $05:8509 STA.W $0D9D ; TM mirror [$0D9D] = main screen layers from LevMainScrnTbl No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $05:8510 STA.W $0D9E ; TS mirror [$0D9E] = subscreen layers from LevSubScrnTbl $0D9F HDMA enable mirror byte (bit per HDMA channel) RAM mirror of $420C. The NMI handler copies it to the HDMA channel enable register every frame, so setting a bit turns that HDMA channel on from the next frame. Many routines write 0 to disable all HDMA (title screen, message box, level end); the window effect setup writes $80 to enable channel 7 only.
Values: 0 = no HDMA. Bit n = channel n enabled.
15 uses in 12 routines (3 read, 12 write) W $00:9260 STZ.W $0D9F ; Disable all HDMA channels ([$0D9F] = 0) W $00:92A2 STA.W $0D9F ; Enable HDMA channel 7 only ([$0D9F] = $80) W $00:92EA STA.W $0D9F ; Enable HDMA channels 5, 6 and 7 ([$0D9F] = $E0) W $00:9CAD STZ.W $0D9F ; Disable all HDMA W $00:CB0C STA.W $0D9F ; Enable HDMA channel 7 ([$0D9F] = $80) for the window W $03:C511 STA.W $0D9F ; Enable HDMA channel 7 (window 1 left/right edges per scanline) W $04:DB99 STA.W $0D9F ; Enable HDMA channel 7 (window table) W $04:F40D STZ.W $0D9F ; HDMA enable mirror = 0 W $05:B129 STZ.W $0D9F ; HDMA channel enable = 0 (stop the window HDMA) W $05:B296 STA.W $0D9F ; Enable HDMA channel 7 (window table) W $0C:AB98 STA.W $0D9F ; Enable HDMA channel 7 (window table) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) R $00:86A0 LDX.W $0DA0 ; X = [$0DA0]: controller to use (0 = joypad 1, 1 = joypad 2) W $00:9A87 STA.W $0DA0 ; [$0DA0] = index (negative = current player) $0DA2 Joypad 1 held, high byte bit flags Joypad 1 buttons currently held, high byte of $4218, stored each frame by the controller read routine.
Bits: 7 B, 6 Y, 5 Select, 4 Start, 3 Up, 2 Down, 1 Left, 0 Right. Indexed by player ([$0DA2 ,X]) when the controller routine picks which pad feeds Mario ($0DA0 or $0DB3 ).
3 uses in 1 routine (2 read, 1 write) W $00:8668 STA.W $0DA2 ; [$0DA2] = joypad 1 B/Y/Sel/Start/D-pad held $0DA3 Joypad 2 held, high byte bit flags Joypad 2 buttons currently held, high byte of $421A/$421B read. Same bit layout as $0DA2 (B Y Select Start D-pad). Written by the controller read routine; also tested in game mode 14 (in level) for player 2 input.
Bits: 7 B, 6 Y, 5 Select, 4 Start, 3 Up, 2 Down, 1 Left, 0 Right.
3 uses in 2 routines (2 read, 1 write) W $00:8690 STA.W $0DA3 ; [$0DA3] = joypad 2 byte 1 held $0DA4 Joypad 1 held, A/X/L/R bit flags Joypad 1 buttons currently held, low byte of $4218 masked with $F0. Written by the controller read routine, then merged into $15/$17 (Mario's controller bytes). Hits from $0D:A4xx are table bytes, not real reads.
Bits: 7 A, 6 X, 5 L, 4 R.
4 uses in 1 routine (3 read, 1 write) W $00:8655 STA.W $0DA4 ; [$0DA4] = joypad 1 A/X/L/R held R $00:86B2 LDA.W $0DA4,X ; A = AXLR held $0DA5 Joypad 2 held, A/X/L/R bit flags Joypad 2 buttons currently held, low byte masked with $F0. Written once per frame by the controller read routine. Almost all the other listed uses are pointer table bytes in bank $0D, not accesses to this byte.
Bits: 7 A, 6 X, 5 L, 4 R.
2 uses in 1 routine (1 read, 1 write) W $00:867D STA.W $0DA5 ; [$0DA5] = joypad 2 A/X/L/R held $0DA6 Joypad 1 newly pressed, high byte RAM_OWControllerA bit flags Buttons of joypad 1 (high byte) that went down this frame: (old EOR new) AND new. Used by menus, the lives exchange and the overworld, which read it via [$0DA6 ,X] for the current player. Hits in bank $0D are table bytes.
Bits: 7 B, 6 Y, 5 Select, 4 Start, 3 Up, 2 Down, 1 Left, 0 Right.
5 uses in 3 routines (4 read, 1 write) W $00:8672 STA.W RAM_OWControllerA ; [$0DA6] (RAM_OWControllerA) = joypad 1 byte 1 newly pressed R $04:8246 LDA.W RAM_OWControllerA,X ; Read the player's overworld controller R $04:F52B LDA.W RAM_OWControllerA ; A = controller 1 buttons $0DA7 Joypad 2 newly pressed, high byte bit flags Buttons of joypad 2 (high byte) newly pressed this frame, computed in the controller read routine. The lives exchange tests Start on either pad by ORing this with $0DA6 . Bits as $0DA6 .
4 uses in 3 routines (3 read, 1 write) W $00:869A STA.W $0DA7 ; [$0DA7] = joypad 2 byte 1 newly pressed R $04:F516 ORA.W $0DA7 ; Start pressed on either controller? R $04:F532 LDA.W $0DA7 ; A = controller 2 buttons $0DA8 Joypad 1 newly pressed, A/X/L/R bit flags Joypad 1 A/X/L/R buttons newly pressed this frame ((old EOR new) AND new). Read by overworld mode 0E and similar code; the $0D:A2xx hits are pointer table bytes. The partner for joypad 2 is $0DA9 .
Bits: 7 A, 6 X, 5 L, 4 R.
4 uses in 2 routines (3 read, 1 write) W $00:865F STA.W $0DA8 ; [$0DA8] = joypad 1 A/X/L/R newly pressed this frame ((old EOR new) AND new) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:8687 STA.W $0DA9 ; [$0DA9] = joypad 2 A/X/L/R newly pressed $0DAA Joypad 1 previous high byte bit flags Joypad 1 high byte as it was last frame. Written at the end of the controller routine (STY) and used next frame to find newly pressed buttons for $0DA6 . Hits from $0D:Axxx are table bytes.
2 uses in 1 routine (1 read, 1 write) W $00:8675 STY.W $0DAA ; [$0DAA] = held bits, remembered for next frame $0DAB Joypad 2 previous high byte bit flags Joypad 2 high byte remembered from last frame, used next frame to compute the newly pressed bits in $0DA7 . Hits from $0D:Axxx and $0D:C1xx are pointer table bytes.
2 uses in 1 routine (1 read, 1 write) W $00:869D STY.W $0DAB ; [$0DAB] = held bits, remembered for next frame $0DAC Joypad 1 previous A/X/L/R bit flags Joypad 1 A/X/L/R held bits remembered from last frame, so the next frame can compute $0DA8 .
2 uses in 1 routine (1 read, 1 write) W $00:8662 STY.W $0DAC ; [$0DAC] = held bits, remembered for next frame $0DAD Joypad 2 previous A/X/L/R bit flags Joypad 2 A/X/L/R held bits remembered from last frame, so the next frame can compute $0DA9 .
2 uses in 1 routine (1 read, 1 write) W $00:868A STY.W $0DAD ; [$0DAD] = held bits, remembered for next frame $0DAE Screen brightness mirror byte RAM mirror of the screen brightness register $2100. The NMI copies it to $2100 each frame. Fades add to or subtract from it; game modes set it to 0 (black) at start and $0F when showing the screen.
Values: $00 = black, $0F = full brightness (bit 7 would force blank).
11 uses in 6 routines (5 read, 6 write) W $00:93CC STA.W $0DAE ; Brightness [$0DAE] = $0F (full) W $00:9740 STZ.W $0DAE ; Brightness mirror [$0DAE] = 0 (black) W $00:97BE STA.W $0DAE ; Brightness mirror [$0DAE] = $0F (full) R $00:9F4C LDA.W $0DAE ; A = brightness [$0DAE] W $00:C9F8 STZ.W $0DAE ; Screen brightness [$0DAE] = 0 $0DAF Mosaic fade direction byte Direction of the mosaic fade used by game modes 0F/13 and the overworld level name code. Set to 1 when the screen is loaded for Nintendo Presents, cleared when Mario Start begins, XORed with 1 when the fade finishes so the next fade runs the other way. Used as an index into the fade step tables.
Values: 0 = fade in, 1 = fade out (probably, as seen from the level name code).
10 uses in 6 routines (5 read, 5 write) W $00:93D1 STA.W $0DAF ; [$0DAF] = 1: mosaic fade direction (probably fading in) W $00:9743 STZ.W $0DAF ; Mosaic mirror [$0DAF] = 0 R $00:9F3F LDY.W $0DAF ; Y = fade direction [$0DAF] (0 = in, 1 = out) R $00:9F77 LDY.W $0DAF ; Y = fade direction [$0DAF] R $04:9E2C LDX.W $0DAF ; X = [$0DAF]: fade direction (0 = in, 1 = out) $0DB0 Mosaic size byte Mosaic size for the fade effect, high nibble. Combined as $03 | [$0DB0 ] and written to $2106 so BG1 and BG2 are mosaicked. Starts at $F0 when a fade begins and steps by $10 per frame; 0 = no mosaic.
6 uses in 5 routines (2 read, 4 write) W $00:97C1 STZ.W $0DB0 ; Mosaic size [$0DB0] = 0 R $00:9F42 LDA.W $0DB0 ; A = mosaic size [$0DB0] R $00:9F68 ORA.W $0DB0 ; A = $03 | mosaic size: mosaic on BG1 and BG2 W $00:A0A5 STA.W $0DB0 ; [$0DB0] = $F0 (mosaic size: start of fade) $0DB1 Fade delay counter timer Frame countdown shared by the fade routines. KeepModeActive sets it to 1, other code sets it to 2 or 8; the fade code decrements it each frame and acts when it goes negative, so the fade runs a step every few frames. Also used the same way by the overworld level name text and the overworld save code.
14 uses in 8 routines (8 write, 6 read-modify-write) W $00:9F2B STA.W $0DB1 ; Fade delay counter [$0DB1] = A RW $00:9F37 DEC.W $0DB1 ; Fade delay counter [$0DB1]-- RW $00:9F6F DEC.W $0DB1 ; Fade delay counter [$0DB1]-- RW $00:9F7C DEC.W $0DB1 ; Fade delay counter [$0DB1]-- W $04:8EF3 STA.W $0DB1 ; [$0DB1] = 8 (OW mode timer, probably keeps the mode running) RW $04:8FE3 DEC.W $0DB1 ; [$0DB1]-- (delay counter) W $04:91DD STA.W $0DB1 ; [$0DB1] = 2 (fade speed) W $04:9DC3 STA.W $0DB1 ; Timer [$0DB1] = 2 W $04:9E16 STA.W $0DB1 ; Timer [$0DB1] = 2 W $04:9E29 STA.W $0DB1 ; Timer [$0DB1] = 2 (step every 3 frames) W $04:E62E STA.W $0DB1 ; [$0DB1] = $0F (probably keeps the OW game mode active) $0DB2 Two player game flag byte Number of players minus 1, set on the player select screen. 0 = one player (Mario only), 1 = two players (Mario and Luigi). Read by the overworld and lives code to decide whether to swap players.
Values: 0 = 1 player, 1 = 2 players.
6 uses in 5 routines (5 read, 1 write) W $00:9E0D STX.W $0DB2 ; [$0DB2] = X: number of players - 1 R $00:9E21 LDX.W $0DB2 ; X = number of players - 1 R $04:9D9A LDA.W $0DB2 ; A = [$0DB2] (2 player game flag) $0DB3 Current player byte (0 = Mario, 1 = Luigi) Which player is currently playing. Used as an index into the per-player tables from $0DB4 up (lives, coins, power-up, Yoshi color, item) and times 3 as the score offset. Flipped with EOR #$01 when the players swap.
Values: 0 = Mario, 1 = Luigi.
38 uses in 27 routines (36 read, 2 write) R $00:86A5 LDX.W $0DB3 ; Negative: use the current player [$0DB3] (0 Mario, 1 Luigi) R $00:8F5B LDX.W $0DB3 ; X = current player [$0DB3] R $00:8F86 LDX.W $0DB3 ; X = current player [$0DB3] W $00:9E5F STZ.W $0DB3 ; Current player = Mario R $00:A0BC LDX.W $0DB3 ; X = current player (0 Mario, 1 Luigi) R $00:A12A LDX.W $0DB3 ; X = current player R $02:875C ADC.W $0DB3 ; X = [$0DB3] * 3: score offset of the current player R $02:AE16 ADC.W $0DB3 ; X = [$0DB3] * 3: offset of the current player score R $02:DA79 LDY.W $0DB3 ; Y = current player's offset R $03:92F8 LDY.W $0DB3 ; Y = current player's submap index [$0DB3] R $04:8375 LDX.W $0DB3 ; X = current player R $04:8792 LDA.W $0DB3,X ; Read the player's lives byte ([$0DB4]/[$0DB5]) into the high byte R $04:897D LDA.W $0DB3,X ; Read the player's lives byte into the high byte R $04:91B5 LDX.W $0DB3 ; X = [$0DB3] (current player) R $04:EB3A LDX.W $0DB3 ; X = [$0DB3] (current player) R $04:F51D LDX.W $0DB3 ; X = [$0DB3]: current player R $04:FD79 LDY.W $0DB3 ; Y = [$0DB3] (player index) R $05:CC68 LDX.W $0DB3 ; X = [$0DB3] (current player) $0DB4 Player lives RAM_PlayerLives byte table, one per player (index X) Lives of each player, stored as lives minus 1, so 0 means one life left and $FF (negative) means none left. $0DB4 is Mario, $0DB5 is Luigi. A new game sets both to 4 (5 lives shown). Saved from the status bar on overworld load, loaded back at Mario Start; the lives exchange screen reads and swaps them.
15 uses in 8 routines (11 read, 3 write, 1 read-modify-write) W $00:9E26 STA.W RAM_PlayerLives,X ; Player X's lives = 4 W $00:A0C7 STA.W RAM_PlayerLives,X ; Save lives for the current player R $04:F552 LDA.W RAM_PlayerLives,X ; A = lives of the chosen player R $04:F559 LDA.W RAM_PlayerLives,Y ; A = lives of the other player W $04:F561 STA.W RAM_PlayerLives,Y ; Store RW $04:F564 DEC.W RAM_PlayerLives,X ; Chosen player lives - 1 R $04:F5AF LDY.W RAM_PlayerLives ; Y = Mario lives R $04:F600 LDA.W RAM_PlayerLives ; A = Mario lives R $05:DC0A LDA.W RAM_PlayerLives,X ; A = lives of the current player $0DB5 Luigi lives byte Luigi's lives, the second entry of the [$0DB4 ,X] table (also stored as lives minus 1). A new game writes $FF here for a one-player game; the Mario Start code ORs both players' lives to detect a double game over. The lives exchange compares it with Mario's lives. $0D:A2xx hits are table bytes.
5 uses in 4 routines (4 read, 1 write) R $00:9772 ORA.W $0DB5 ; Lives of Mario and Luigi both negative? R $04:F41A CMP.W $0DB5 ; Compare Mario lives with Luigi lives R $04:F5BF LDY.W $0DB5 ; Y = Luigi lives R $04:F60B LDA.W $0DB5 ; A = Luigi lives $0DB6 Player coins RAM_PlayerCoins byte table, one per player (index X) Each player's coin count (word access at start clears both). $0DB6 is Mario, $0DB7 is Luigi. Saved from the status bar coins ($0DBF ) when the overworld loads and copied back when a level is entered.
4 uses in 4 routines (2 read, 2 write) W $00:9E3F STZ.W RAM_PlayerCoins ; Both players' coins = 0 W $00:A0D2 STA.W RAM_PlayerCoins,X ; Save for the current player $0DB8 Player power-up RAM_PlayerPowerUp byte table, one per player (index X) Each player's saved power-up state ($0DB8 Mario, $0DB9 Luigi). Cleared to 0 (small) at new game, stored from $0019 when the overworld loads and restored when a level is entered.
Values: 0 = small, 1 = big, 2 = cape, 3 = fire.
4 uses in 4 routines (2 read, 2 write) W $00:9E42 STZ.W RAM_PlayerPowerUp ; Both players' powerups = small W $00:A0CC STA.W RAM_PlayerPowerUp,X ; Save for the current player $0DBA Player Yoshi color RAM_PlyrYoshiColor byte table, one per player (index X) Yoshi color each player carries, 0 = no Yoshi. $0DBA is Mario, $0DBB Luigi. Saved on overworld load, copied into $0DC1 , $13C7 and $187A when a level starts. Also used to pick the Yoshi map sprite color.
7 uses in 6 routines (4 read, 3 write) W $00:9E45 STZ.W RAM_PlyrYoshiColor ; Both players' Yoshi colors = 0 W $00:A0DD STA.W RAM_PlyrYoshiColor,X ; Save Yoshi color for the current player $0DBC Player reserve item byte table, one per player (index X) Reserve (item box) item of each player ($0DBC Mario, $0DBD Luigi). Saved when the overworld loads, and copied to $0DC2 on entering a level or switching players.
3 uses in 3 routines (2 read, 1 write) W $00:A0E3 STA.W $0DBC,X ; Save for the current player $0DBE Status bar lives RAM_StatusLives byte Lives of the current player as shown on the status bar, stored as lives minus 1 (display adds 1). Clamped to $62 (99 shown), decremented when Mario dies, set to 4 for a new game. Copied to and from [$0DB4 ,X] when the player or screen changes. Negative means game over.
11 uses in 9 routines (4 read, 5 write, 2 read-modify-write) W $00:8F46 STA.W RAM_StatusLives ; Clamp lives to $62 (shown as 99) W $00:9E2C STA.W RAM_StatusLives ; Status bar lives = 4 R $00:A0BF LDA.W RAM_StatusLives ; A = lives on the status bar RW $00:D0D8 DEC.W RAM_StatusLives ; Lives -= 1 RW $02:8AD2 INC.W RAM_StatusLives ; Lives + 1 W $04:91C1 STA.W RAM_StatusLives ; Status bar lives = this player's lives W $04:9DE3 STA.W RAM_StatusLives ; Status bar lives = this player's lives W $04:F523 STA.W RAM_StatusLives ; Status bar lives = current player lives $0DBF Status bar coins RAM_StatusCoins byte Coin counter of the current player. Incremented per coin by the status bar update; cleared on new game. Saved to [$0DB6 ,X] on overworld load and loaded back from it when a player's level or turn starts.
9 uses in 5 routines (4 read, 4 write, 1 read-modify-write) RW $00:8F25 INC.W RAM_StatusCoins ; Status bar coin counter += 1 W $00:8F38 STA.W RAM_StatusCoins ; Coins -= 100 W $00:9E2F STZ.W RAM_StatusCoins ; Coins on the status bar = 0 R $00:A0CF LDA.W RAM_StatusCoins ; A = coins W $04:91BB STA.W RAM_StatusCoins ; Status bar coins = this player's coins W $04:9DDD STA.W RAM_StatusCoins ; Status bar coins = this player's coins $0DC0 Coins to collect byte Down counter, set to $1E (30) at level start when [$141A ] is 0. The coin counter in bank $05 subtracts coins collected from it, flooring at 0. Block code tests it for the special ? block: if it is 0 a different sprite is spawned. Purpose beyond that is unclear; probably coins left before a reward.
7 uses in 4 routines (4 read, 2 write, 1 read-modify-write) W $00:91AD STA.W $0DC0 ; [$0DC0] = $1E (purpose unclear) W $05:B345 STA.W $0DC0 ; Store [$0DC0] (probably coins left until some reward) $0DC1 Overworld Yoshi color RAM_OWHasYoshi byte Yoshi color for the player on the overworld, 0 = no Yoshi. Copied from [$0DBA ,X] when a level starts, set by the level-end coin and Yoshi routines when Yoshi stays with Mario, and cleared on death/new game.
Values: 0 = no Yoshi, nonzero = Yoshi color.
18 uses in 16 routines (4 read, 13 write, 1 read-modify-write) W $00:976C STZ.W RAM_OWHasYoshi ; Remove Yoshi from the overworld W $00:9E32 STZ.W RAM_OWHasYoshi ; Mario has no Yoshi on the overworld R $00:A0D5 LDA.W RAM_OWHasYoshi ; A = player has Yoshi on the map? RW $00:C907 INC.W RAM_OWHasYoshi ; Yes: [$0DC1]++ (RAM_OWHasYoshi) W $00:D0D5 STZ.W RAM_OWHasYoshi ; Clear [RAM_OWHasYoshi] (Yoshi is lost on death) W $00:FC35 STA.W RAM_OWHasYoshi ; [$0DC1] = 1: Yoshi is on the overworld W $00:FC76 STZ.W RAM_OWHasYoshi ; No Yoshi sprite found: [$0DC1] = 0 W $01:EB87 STA.W RAM_OWHasYoshi ; Overworld: Mario has Yoshi W $01:EBE3 STZ.W RAM_OWHasYoshi ; Mario has no Yoshi on return to overworld W $01:EC00 STZ.W RAM_OWHasYoshi ; Overworld: Mario has no Yoshi W $01:EDAA STZ.W RAM_OWHasYoshi ; Overworld: no Yoshi W $01:F740 STZ.W RAM_OWHasYoshi ; Overworld has-Yoshi flag = 0 W $02:A48D STZ.W RAM_OWHasYoshi ; Overworld Yoshi flag cleared $0DC2 Reserve item (item box) RAM_ReservedItem byte (item type) The power-up stored in Mario's item box for the current player: the reserve item that drops when Select is pressed or Mario is hit. Copied to and from each player's own slot ($0DBC ,X) when the overworld is entered or left. Written when a power-up is collected with the box empty, cleared on file select and the Bowser scene; read by the status bar and the item drop.
Values: 0 = empty; otherwise the power-up number stored by the collect routine (item box contents).
13 uses in 9 routines (6 read, 7 write) W $00:9E37 STZ.W $0DC2 ; Reserve item = none W $00:9E48 STZ.W $0DC2 ; Both players' reserve items = none R $00:A0E0 LDA.W $0DC2 ; A = reserve item R $00:FB36 LDX.W $0DC2 ; X = [$0DC2] (item box) W $01:C545 STA.W $0DC2 ; Store it in the item box ([$0DC2]) R $02:8009 LDA.W RAM_ReservedItem ; A = [RAM_ReservedItem] W $02:800E STZ.W RAM_ReservedItem ; Item box = empty W $03:B454 STZ.W $0DC2 ; Stage non-zero: hide the item box ($0DC2 = 0) W $04:91D8 STA.W $0DC2 ; Reserve item [$0DC2] = this player's reserve item [$0DBC,X] W $04:9DFA STA.W $0DC2 ; Reserve item [$0DC2] = this player's reserve item [$0DBC] $0DC7 Overworld walk target position word table, indexed by axis (X = 0: X, X = 2: Y) Where the player's overworld sprite is walking to. When a path step starts, the current map position ([$1F17 ,X] for X, [$1F19 ] for Y) plus the step offset is stored here. OW process 4 compares it with the current position to find the remaining distance on each axis.
5 uses in 2 routines (2 read, 3 write) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) $0DCF Overworld walk speed per axis word table, indexed by axis (X = 0: X, X = 2: Y) Signed speed at which the player's overworld sprite moves along the X axis (X = 0) and Y axis (X = 2) during OW process 4 (walking along the path). Written each frame from the distance left, then added to the position. Also matches labels CODE_0DCF.. in bank $0D (guide line objects), which are code, not RAM.
2 uses in 1 routine (1 read, 1 write) W $04:9502 STA.W $0DCF,X ; [$0DCF+X] = signed speed on this axis (X = 0: X speed, X = 2: Y speed) $0DD3 Overworld walking direction byte (even direction code) Direction the player is currently walking on the overworld map. Set when a walk starts from a level tile and read while following the path to pick the movement offsets.
Values: 0 = up; 2 = down; 4 = left; 6 = right.
3 uses in 2 routines (1 read, 2 write) W $04:92BD STA.W $0DD3 ; [$0DD3] = direction R $04:9567 LDY.W $0DD3 ; Y = [$0DD3]: current direction (0 up, 2 down, 4 left, 6 right) W $04:97F4 STY.W $0DD3 ; Current direction [$0DD3] = Y No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) $0DD5 Level exit type / overworld event byte How the last level was left, so the overworld knows which path to unlock and where to walk. Set by the level (goal, Select exit, death) and cleared when a level starts or the overworld finishes handling it. Read by the overworld state routines to decide on auto-walk or events; the event routine also stores event values such as $E0 here.
Values: 0 = none; 1 = normal exit; 2 = secret exit; $80 = left the level with no exit event (death).
23 uses in 14 routines (10 read, 12 write, 1 read-modify-write) W $00:9E5C STZ.W $0DD5 ; [$0DD5] = 0 (level exit type) W $00:A27E STA.W $0DD5 ; [$0DD5] = exit type (level ends via Select) W $00:C9FE STA.W $0DD5 ; [$0DD5] = A: exit type (1 = normal, 2 = secret) RW $00:CA0F INC.W $0DD5 ; Yes: [$0DD5]++ W $00:D0CD STA.W $0DD5 ; [$0DD5] = $80: leave the level with no exit event R $04:8FDC LDA.W $0DD5 ; A = [$0DD5] (exit type) R $04:9128 LDA.W $0DD5 ; A = [$0DD5] (exit type / auto-walk) W $04:9190 STZ.W $0DD5 ; Exit type [$0DD5] = 0 W $04:925C STZ.W $0DD5 ; Exit type [$0DD5] = 0 W $04:937C STZ.W $0DD5 ; No path found: exit type [$0DD5] = 0 R $04:9903 LDX.W $0DD5 ; X = [$0DD5] (auto-walk / event direction) W $05:B165 STA.W $0DD5 ; [$0DD5] = 0 (no level exit type) $0DD6 Current player position slot (player * 4) byte (index) Index of the current player's entries in the overworld position tables ($1F17 , $1F19 etc.): 0 for Mario, 4 for Luigi. Used as X or Y in most overworld code; divide by 4 for the player index. Set when a player is selected.
55 uses in 23 routines (54 read, 1 write) R $00:A545 LDA.W $0DD6 ; A = [$0DD6] / 4 = player index (probably) R $04:8515 LDX.W $0DD6 ; X = current character * 4 (player position slot) R $04:8540 LDX.W $0DD6 ; X = current character * 4 R $04:8DF2 LDX.W $0DD6 ; X = [$0DD6]: current player index R $04:8EBA LDY.W $0DD6 ; Y = [$0DD6]: current player index R $04:8F15 LDX.W $0DD6 ; X = [$0DD6]: current player index R $04:8FA1 LDX.W $0DD6 ; X = [$0DD6] (current player * 4) R $04:9007 LDX.W $0DD6 ; X = [$0DD6] (current player * 4) R $04:91EB LDX.W $0DD6 ; X = [$0DD6] (current player * 4) R $04:93D6 ADC.W $0DD6 ; X = X + [$0DD6]: index into this player's X/Y position R $04:952A LDX.W $0DD6 ; X = [$0DD6]: current player * 4 R $04:9E82 LDX.W $0DD6 ; X = [$0DD6]: player * 4 R $04:F2B0 LDY.W $0DD6 ; Y = [$0DD6]: index of the current player on the overworld R $04:FEFC LDY.W $0DD6 ; Y = [$0DD6] (player index) R $04:FF1C LDY.W $0DD6 ; Y = [$0DD6] (player index) R $05:D84D LDX.W $0DD6 ; X = overworld position index of the current player $0DD8 Overworld input/transition flag flag byte Overworld flag: while non-zero the overworld input check is skipped (game mode 0E) and path walking treats the state as pending. Cleared by the hardcoded path routine; incremented by the level name builder (probably counts player switches). Exact purpose is not clear from the code.
4 uses in 4 routines (2 read, 1 write, 1 read-modify-write) R $04:8361 LDA.W $0DD8 ; [$0DD8] != 0: ignore input R $04:945D LDA.W $0DD8 ; [$0DD8] (probably a submap/transition pending flag) non-zero? RW $04:9E1E INC.W $0DD8 ; [$0DD8]++ (probably counts player switches) $0DDA Music state byte (music number plus bit 7 flag) Mirror of the level music in effect. Game mode 11 stores the intro music number here ($13 for the intro level); bit 7 is set by power-up and tape events and cleared by the Mario draw routine (restore level music). Set to $FF by Kill Mario, goal tape and some collision code so the level music reloads afterwards.
Values: 0 = no music request pending; $FF = force the level music to restart; bit 7 = music state flag.
26 uses in 14 routines (10 read, 12 write, 4 read-modify-write) W $00:9725 STA.W $0DDA ; Music number [$0DDA] = $13 (intro level) R $00:9728 LDA.W $0DDA ; A = [$0DDA] (level music number) W $00:973D STA.W $0DDA ; Remove bit 6 from the music number and store it in [$0DDA] W $00:A0B9 STZ.W $0DDA ; [$0DDA] = 0: no music request pending R $00:C53E LDA.W $0DDA ; A = [$0DDA] (level music to resume) W $00:E2F4 STA.W $0DDA ; [$0DDA] bit 7 cleared (restore level music) W $00:EEC9 STA.W $0DDA ; [$0DDA] = $FF (force the level music to reload afterwards) W $00:F611 STA.W $0DDA ; [$0DDA] = $FF (probably forces the music to restart) R $01:AB02 LDA.W $0DDA ; A = music flag [$0DDA] W $01:C0F6 STA.W $0DDA ; [$0DDA] = $FF (music flag) RW $01:C58E ROR.W $0DDA ; Set bit 7 of [$0DDA] (music state mirror) RW $01:C58E ROR.W $0DDA ; Set bit 7 of [$0DDA] (music state mirror) R $05:8555 LDX.W $0DDA ; X = [$0DDA] (previous music value, sets N flag) R $05:855C CMP.W $0DDA ; Same track as [$0DDA]? W $05:8563 STA.W $0DDA ; [$0DDA] = new music value (with flags) $0DDE Current overworld sprite slot byte (index) Slot number of the overworld sprite being processed. Stored by the process-all-sprites loop and reloaded by each sprite routine as X. On the erase file menu (game mode 09) it is reused as a bit mask of files marked for erasing.
Values: 0 = no file marked (erase menu).
15 uses in 8 routines (9 read, 5 write, 1 read-modify-write) RW $00:9B43 LSR.W $0DDE ; Shift marked-for-erase bits [$0DDE]; carry = this file is marked W $00:9B76 STA.W $0DDE ; [$0DDE] |= file bit (file is marked for erasing) W $00:9CE7 STZ.W $0DDE ; No files marked for erasing yet ([$0DDE] = 0) W $04:F6BF STX.W $0DDE ; Current slot [$0DDE] = X W $04:F811 STX.W $0DDE ; [$0DDE] = X: current sprite slot W $04:F81E STX.W $0DDE ; [$0DDE] = X: current sprite slot R $04:F912 LDX.W $0DDE ; X = [$0DDE]: current sprite slot R $04:F98B LDX.W $0DDE ; X = [$0DDE]: current sprite slot R $04:FC8F LDX.W $0DDE ; X = [$0DDE]: current sprite slot R $04:FCDD LDX.W $0DDE ; X = [$0DDE]: current sprite slot R $04:FD6C LDX.W $0DDE ; X = sprite slot [$0DDE] R $04:FE6C LDX.W $0DDE ; X = sprite slot [$0DDE] R $04:FEA8 LDX.W $0DDE ; X = sprite slot: fall into the X-axis update R $04:FF9E LDX.W $0DDE ; X = sprite slot [$0DDE] $0DDF Overworld sprite draw list / OAM offset byte table (draw order) / byte Dual use. Indexed by X it is the sprite-slot list sorted by Y position (positions 1-4 of the 5 entry list that starts at $0DE0 ), used to draw overworld sprites back to front. Read unindexed ($0DDF ) it is the next free dynamic OAM offset; reset to $30 at the start of each frame and advanced by the sprite tile drawing.
5 uses in 2 routines (2 read, 3 write) R $04:F7CE LDY.W $0DDF,X ; Y = slot at list position [$01] - 1 W $04:F7F7 STA.W $0DDF ; [$0DDF] = $30: first free OAM offset (from $0240) for dynamically placed tiles R $04:FB7B LDY.W $0DDF ; Y = [$0DDF]: next free dynamic OAM offset W $04:FB81 STY.W $0DDF ; [$0DDF] = Y: move on to the next slot $0DE0 Overworld sprite sort order byte table, 5 entries List of overworld sprite slots 0-4 (the foreground sprites), initialised to 0,1,2,3,4 and bubble-sorted each frame by Y position ($0E45 ,$0E75 ) so they are processed in depth order. Shares storage with the $0DDF list (offset by one).
5 uses in 1 routine (3 read, 2 write) R $04:F7BF LDY.W $0DE0,X ; Y = slot at list position [$00] W $04:F7EA STA.W $0DE0,Y ; Swap the list entries at positions [$01] - 1 and [$00] $0DE5 Overworld sprite type byte table, one per overworld sprite slot Type of each of the 16 overworld sprites; 0 = slot free. It selects the routine from the OW sprite pointer table. Written when a sprite is created and cleared when it goes off screen, which frees the slot.
Values: 0 = unused (free slot); 1-10 = index into the overworld sprite pointer table (e.g. 5 = cloud, 6 = walks in on tiles $49-$4B).
6 uses in 5 routines (3 read, 3 write) W $04:8EDE STZ.W $0DE5,X ; Clear [$0DE5+X] W $04:F777 STA.W $0DE5,X ; Spawn sprite type 5 (cloud) in this slot W $04:FB61 STZ.W $0DE5,X ; Off screen: free the slot ([$0DE5+X] = 0) $0DE8 Overworld sprite type, slot 3 byte (element of the $0DE5 table) This is slot 3 of the overworld sprite type table at $0DE5 , written when overworld sprites are initialised. Also matches labels CODE_0DE8.. in bank $0D (tileset object handlers), which are code, not RAM.
1 use in 1 routine (1 write) W $04:F67F STA.W $0DE8,X ; Sprite type [$0DE8+X] $0DF5 Overworld sprite state / direction byte table, one per overworld sprite slot General per-slot byte of the overworld sprites; meaning depends on the sprite type. Examples: active flag and properties ($12 plus a random X flip, sprites 3-5); state 2 (sprite 6, walk-in); animation phase wrapped at 12 (sprites 7-8); X-axis direction index (sprites 9-10); random threshold index (sprite 1). Cleared at overworld setup.
18 uses in 6 routines (10 read, 7 write, 1 read-modify-write) W $04:8EAB STZ.W $0DF5,X ; Clear [$0DF5+X] R $04:F948 LDY.W $0DF5,X ; Y = [$0DF5+X]: random threshold index (even) W $04:F97C STA.W $0DF5,X ; [$0DF5+X] = random AND 6: new threshold index W $04:FA70 STA.W $0DF5,X ; [$0DF5+X] = $12, plus X flip ($40) at random: active flag and properties W $04:FA9B STZ.W $0DF5,X ; Height and splash timer both 0: deactivate ([$0DF5+X] = 0) R $04:FAA1 LDA.W $0DF5,X ; A = state/properties [$0DF5+X] RW $04:FBF3 DEC.W $0DF5,X ; State--: next phase W $04:FC79 STA.W $0DF5,X ; [$0DF5+X] = ([$0DF5+X] + 1) wrapped at 12: animation phase R $04:FD52 LDY.W $0DF5,X ; Y = X-axis direction index [$0DF5,X]; falls into the X-axis step W $04:FD69 STA.W $0DF5,X ; Save direction index in [$0DF5,X] R $04:FDD2 ORA.W $0DF5,X ; A |= direction index [$0DF5,X] No description written yet. The instructions below show how it is used.
2 uses in 1 routine (2 read) $0E05 Overworld sprite counter / Y direction byte table, one per overworld sprite slot Per-slot byte: bit 0 is the direction bit flipped by the hovering creature (sprite 1), an animation counter for sprite 6 (incremented each frame), and the Y-axis direction index for the drifting sprites 9-10.
9 uses in 3 routines (6 read, 2 write, 1 read-modify-write) W $04:F942 STA.W $0E05,X ; Yes: flip the direction bit [$0E05+X] bit 0 W $04:F974 STA.W $0E05,X ; [$0E05+X] ^= A: reverse that axis' direction flag RW $04:FBE0 INC.W $0E05,X ; Animation counter [$0E05+X]++ R $04:FD45 LDA.W $0E05,X ; A = Y-axis direction index [$0E05,X] $0E15 Overworld sprite animation counter byte table, one per overworld sprite slot Animation counter incremented by the drifting sprites (9-10) and read by the hovering creature; cleared when a sprite arrives at its home position.
4 uses in 3 routines (2 read, 1 write, 1 read-modify-write) RW $04:FD3C INC.W $0E15,X ; Animation counter [$0E15,X]++ W $04:FF55 STZ.W $0E15,X ; Arrived: clear animation counter [$0E15,X] $0E25 Overworld sprite timer byte table, one per overworld sprite slot Per-slot countdown. The process-all-sprites loop decrements it each frame while non-zero (for slots below $0D). Meaning varies: splash timer set to $0F by sprites 3-5, wait timer for sprite 6, phase counter for sprites 9-10.
11 uses in 5 routines (5 read, 4 write, 2 read-modify-write) W $04:F6B1 STZ.W $0E25,X ; Clear [$0E25+X] RW $04:F80A DEC.W $0E25,X ; If the timer [$0E25+X] is non-zero, decrement it W $04:FA7F STA.W $0E25,X ; Splash timer [$0E25+X] = $0F (also called when the sprite lands) W $04:FBD5 STZ.W $0E25,X ; Wait timer [$0E25+X] = 0 W $04:FBFD STA.W $0E25,X ; Wait timer [$0E25+X] = $60 frames R $04:FDB4 LDA.W $0E25,X ; A = phase counter [$0E25,X] RW $04:FDB9 INC.W $0E25,X ; Phase counter++ $0E35 Overworld sprite X position, low byte table, one per overworld sprite slot Low byte of the sprite's X position on the overworld map ([$0E65 ,X] is the high byte). Set at spawn from per-type data tables and used by the draw/move helpers.
11 uses in 5 routines (5 read, 6 write) W $04:FA51 STA.W $0E35,X ; X position low = DATA_04FA2E[Y] W $04:FBB6 STA.W $0E35,X ; X position low = DATA_04FB88[Y] W $04:FC54 STA.W $0E35,X ; X position low = DATA_04FC1E[Y] R $04:FE81 LDA.W $0E35,X ; A = position low byte [$0E35,X] R $04:FE98 LDA.W $0E35,X ; A = Z position low [$0E55,X] W $04:FE9D STZ.W $0E35,X ; Below ground: Z position = 0 R $04:FEC9 ADC.W $0E35,X ; Position low += pixels + carry R $04:FEF3 LDA.W $0E35,X ; A = X position low byte [$0E35,X] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F692 STA.W $0E38,X ; Entry byte 1: [$0E38+X] (X position low) $0E45 Overworld sprite Y position, low byte table, one per overworld sprite slot Low byte of the sprite's Y position ([$0E75 ,X] is the high byte). Read as a 16-bit value with $0E75 to sort the sprites by depth; sprite 2 copies Mario's Y into it.
8 uses in 6 routines (3 read, 5 write) R $04:F7D5 LDA.W $0E45,Y ; A = Y position of that slot (16-bit) W $04:F9DD STA.W $0E45,X ; Sprite Y position low = Mario's Y position low ([$1F19+player*4]) W $04:FA5D STA.W $0E45,X ; Y position low W $04:FBC2 STA.W $0E45,X ; Y position low W $04:FC60 STA.W $0E45,X ; Y position low R $04:FF13 LDA.W $0E45,X ; A = Y position low byte [$0E45,X] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F69E STA.W $0E48,X ; Entry byte 3: [$0E48+X] (Y position low) $0E55 Overworld sprite height (Z) byte table, one per overworld sprite slot Height of the sprite above the ground, used by the draw helper to offset the sprite's Y. Cloud sprites set it from a table at spawn.
7 uses in 3 routines (5 read, 2 write) W $04:F783 STA.W $0E55,X ; Cloud height [$0E55+X] = DATA_04F6D0[Y] R $04:FE08 LDA.W $0E55,X ; A = Z height [$0E55,X] R $04:FE51 ADC.W $0E55,X ; + Z height [$0E55,X] R $04:FE72 SBC.W $0E55,X ; - Z height [$0E55,X] R $04:FF37 LDA.W $0E55,X ; A = Z height [$0E55,X] W $04:FF63 STA.W $0E55,X ; Z height = $40 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F68C STA.W $0E58,X ; Sprite timer [$0E58+X] = $40 $0E65 Overworld sprite X position, high byte table, one per overworld sprite slot High byte of the sprite's X position ([$0E35 ,X] is the low byte).
8 uses in 5 routines (3 read, 5 write) W $04:F797 STA.W $0E65,X ; Cloud X position low/high = A W $04:FA57 STA.W $0E65,X ; X position high W $04:FBBC STA.W $0E65,X ; X position high W $04:FC5A STA.W $0E65,X ; X position high R $04:FE7D LDA.W $0E65,X ; A = position high byte [$0E65,X] R $04:FED0 ADC.W $0E65,X ; Position high += high byte + carry R $04:FEEF LDA.W $0E65,X ; A = X position high byte [$0E65,X] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F698 STA.W $0E68,X ; Entry byte 2: [$0E68+X] $0E75 Overworld sprite Y position, high byte table, one per overworld sprite slot High byte of the sprite's Y position ([$0E45 ,X] is the low byte). Sprite 2 sets it to Mario's Y high byte.
8 uses in 6 routines (3 read, 5 write) W $04:F7A8 STA.W $0E75,X ; Cloud Y position low/high = A W $04:F9E3 STA.W $0E75,X ; Sprite Y position high = Mario's Y position high W $04:FA63 STA.W $0E75,X ; Y position high W $04:FBC8 STA.W $0E75,X ; Y position high W $04:FC66 STA.W $0E75,X ; Y position high R $04:FF0F LDA.W $0E75,X ; A = Y position high byte [$0E75,X] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F6A4 STA.W $0E78,X ; Entry byte 4: [$0E78+X] $0E95 Overworld sprite X speed byte table (signed), one per overworld sprite slot Signed X speed in 1/16 pixel per frame. Sprite 2 accelerates toward Mario and clamps to +/-$10; sprite 6 uses $F0 (walks left), sprites 3-5 use 2 (drift right).
17 uses in 6 routines (9 read, 8 write) W $04:F9A4 STA.W $0E95,X ; Speed [$0E95+X] += step, unless it is at the limit (DATA_04F8C8) W $04:F9D4 STA.W $0E95,X ; X speed += DATA_04F8C6[Y] (accelerate toward Mario), limited to +/-$10 W $04:FB39 STA.W $0E95,X ; X speed [$0E95+X] = 2 (drifts right) W $04:FBD2 STA.W $0E95,X ; X speed = $F0 (walks left) W $04:FBF8 STA.W $0E95,X ; X speed = 4 (slow) R $04:FD2F LDY.W $0E95,X ; Y = X speed (sets N flag) R $04:FD55 LDA.W $0E95,X ; A = speed [$0E95,X] W $04:FD5C STA.W $0E95,X ; Store new speed R $04:FDA7 LDY.W $0E95,X ; Y = X speed (sets N flag) R $04:FEAB LDA.W $0E95,X ; A = speed [$0E95,X] (1/16 pixel per frame) W $04:FFA3 STA.W $0E95,X ; Store [$0E95,X] $0EA5 Overworld sprite Y speed byte table (signed), one per overworld sprite slot Signed Y speed in 1/16 pixel per frame. Set to $FF by sprites 3-5 (drifts up slowly), cleared to 0 by the helper when a sprite arrives.
3 uses in 2 routines (3 write) W $04:FB3E STA.W $0EA5,X ; Y speed [$0EA5+X] = $FF (drifts up slowly) W $04:FFA8 STA.W $0EA5,X ; Store [$0EA5,X] $0EB5 Overworld sprite Z speed byte table (signed), one per overworld sprite slot Vertical (height) speed applied to $0E55 . Set to $24 when launched upward (sprites 3-5), changed by +1 or -1 for the hovering creature, cleared on arrival.
9 uses in 4 routines (3 read, 5 write, 1 read-modify-write) W $04:F935 STA.W $0EB5,X ; Z speed [$0EB5+X] += DATA_04F8C6[Y] (+1 or -1) W $04:FA75 STA.W $0EB5,X ; Z speed [$0EB5+X] = $24 (launched upward) W $04:FFAD STA.W $0EB5,X ; Store [$0EB5,X] No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $04:FEB3 ADC.W $0EC5,X ; Add to sub-pixel fraction [$0EC5,X] W $04:FEB6 STA.W $0EC5,X ; Store; carry = one extra pixel $0EF5 Overworld walking sprites spawned bit flags Which of the three sprite-6 walkers have already appeared. Level exit setup ORs in a bit from a table; sprite 6 reads it so it only spawns when its bit is clear.
Bits: 7, 6 and 5 ($80, $40, $20): one per walker.
3 uses in 2 routines (2 read, 1 write) R $04:8ED1 ORA.W $0EF5 ; [$0EF5] |= DATA_04FB85[X] ($80, $40 or $20) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $04:FBA8 STA.W $0EF6 ; [$0EF6] = which of the three (probably read by the touch handling) $0EF7 Overworld sprite touching player byte (slot, bit 7 = hit) Slot number of the overworld sprite the player is touching, or'd with $80 when sprite 6 marks a hit. Cleared to 0 each frame; read by the level-exit and hardcoded-path code.
Values: 0 = nothing touching.
5 uses in 5 routines (2 read, 3 write) W $04:F7FA STZ.W $0EF7 ; [$0EF7] = 0: no sprite touching Mario yet W $04:FC1A STA.W $0EF7 ; Touching: [$0EF7] = slot OR $80 (marks it as hit) W $04:FEEB STA.W $0EF7 ; [$0EF7] = slot of the sprite the player is touching No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) RW $01:EC38 INC.W $0EF8 ; Mark message shown [$0EF8]++ No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $00:8D82 STA.W $0EF9,X ; Status bar tile mirror $0EF9+X (line 1 at $0EF9, line 2 at $0F15) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:8FEF STA.W $0EFF,X ; Store the tile in the row 1 buffer [$0EFF+X] No description written yet. The instructions below show how it is used.
2 uses in 1 routine (2 write) W $00:8FA7 STA.W $0F03,X ; Tens digit 0: blank both halves, [$0F1E] and [$0F03] = $FC No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:8F81 STX.W $0F13 ; Status bar coins: ones [$0F14], tens [$0F13] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $0F15 Status bar digit tiles byte table (digit tiles) Buffer of decimal digit tiles for the number being converted. The hex-to-decimal routines clear each digit and count up by subtraction; the status bar update then replaces leading zeros with a blank tile ($FC).
5 uses in 3 routines (3 write, 2 read-modify-write) W $00:8E8C STA.W $0F15,X ; Leading zero: replace the tile with a blank ($FC) W $00:9014 STZ.W $0F15,X ; Digit tile [$0F15+X] = 0 RW $00:9034 INC.W $0F15,X ; Digit tile [$0F15+X]++ (counts the successful subtractions) W $00:9053 STZ.W $0F15,X ; Digit tile [$0F15+X] = 0 RW $00:9068 INC.W $0F15,X ; Digit tile [$0F15+X]++ No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:8F58 STA.W $0F17 ; Status bar lives: tens [$0F16], ones [$0F17] $0F1E Status bar digit tiles (counters) byte table (digit tiles) Second digit-tile buffer for the status bar counters (such as bonus stars). The status bar update reads it, drops absent tens digits and converts 8x8 digit tiles into 8x16 big digits.
4 uses in 1 routine (2 read, 2 write) R $00:8F9D LDA.W $0F1E,X ; Digit tile [$0F1E+X] W $00:8FBD STA.W $0F1E,X ; Big digit: top [$0F03+X] and bottom [$0F1E+X] tiles from the table at DATA_008E06 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:8E7E STA.W $0F27 ; Copy the time digits [$0F31]-[$0F33] to the status bar tiles [$0F25]-[$0F27] $0F29 Score digit tiles byte table, one tile per digit (index X) Tile numbers for the score digits shown on the status bar. The status bar routine converts the score into digits here, then blanks leading zeros and copies the tiles to the status bar tilemap.
4 uses in 1 routine (2 read, 2 write) R $00:8EE0 LDA.W $0F29,X ; Score digit tile [$0F29+X] W $00:8EE7 STA.W $0F29,X ; Leading zero: blank tile ($FC) R $00:8F0E LDA.W $0F29,X ; Score digit tile [$0F29+X] W $00:8F15 STA.W $0F29,X ; Leading zero: blank tile ($FC) $0F30 Level timer frame countdown counter Frames until the next tick of the level timer. Reloaded with $28 (about 40 frames) by the status bar routine each time it ticks the clock down, and set to $28 when the initial status bar is uploaded.
Values: 0 = decrement the timer digits and reload $28.
3 uses in 2 routines (2 write, 1 read-modify-write) W $00:8D8C STA.W $0F30 ; [$0F30] = $28: frame countdown for the level timer W $00:8E2F STA.W $0F30 ; [$0F30] = $28: next clock tick in about 40 frames $0F31 Level timer hundreds digit byte (0-9) Hundreds digit of the level timer. $0F32 is the tens digit and $0F33 the ones digit. Set from the level header, cleared in bonus rooms and at Time Up, decremented by the status bar routine and carried into by Yoshi's tongue code (the Yoshi berry time bonus). Read for the status bar, the time bonus tally ($05:CE4E) and the death/Time Up check.
15 uses in 9 routines (9 read, 4 write, 2 read-modify-write) R $00:8E85 LDA.W $0F31,Y ; Time digit [$0F31+Y] W $00:9A91 STZ.W $0F31 ; Level timer [$0F31] = 0 RW $01:F10E INC.W $0F31 ; ... carrying into the tens digit [$0F31] W $05:8587 STA.W $0F31 ; [$0F31] = hundreds digit $0F32 Level timer tens digit byte (0-9) Tens digit of the level timer ($0F31 is hundreds, $0F33 ones). Zeroed by the level header parse when the header timer is 0 or by bonus game setup, counted down by the status bar routine, and read by the Time Up check and the level end tally.
13 uses in 8 routines (10 read, 3 write) W $01:F111 STA.W $0F32 ; Store the ones digit W $05:858A STZ.W $0F32 ; [$0F32] = 0 (tens) $0F33 Level timer ones digit byte (0-9) Ones digit of the level timer ($0F31 hundreds, $0F32 tens). Cleared for bonus games (time = 000) and by the level header parse; counted down by the status bar routine; read by the Time Up check and the end of level time bonus.
10 uses in 7 routines (8 read, 2 write) W $00:91C3 STZ.W $0F33 ; Bonus game: time = 000 W $05:858D STZ.W $0F33 ; [$0F33] = 0 (ones) $0F34 Player score, low byte byte table, 3 bytes per player (index X = 0 or 3) Low byte of a player's 24-bit score, in units of 10 points. $0F35 is the middle and $0F36 the high byte. Added to by score sprites, breaking turn blocks and the end of level bonus tally; cleared when a new game starts; the status bar routine clamps it to $0F423F (999,999 after x10) and draws it.
10 uses in 5 routines (5 read, 5 write) W $00:8EBC STA.W $0F34,X ; Clamp the score to $0F423F (999,999) W $00:9E4E STZ.W $0F34 ; Player 1 score low word = 0 R $02:AE1A LDA.W $0F34,X ; Score (24-bit, in units of 10 points) low byte W $02:AE21 STA.W $0F34,X ; Score low += PointMultiplierLo[num] $0F35 Player score, middle byte byte table, 3 bytes per player (index X) Middle byte of the 24-bit score in units of 10 points ($0F34 is the low byte, $0F36 the high byte). Incremented as a carry by turn block breaking and the bonus tally; read by score sprites and the status bar.
5 uses in 3 routines (2 read, 2 write, 1 read-modify-write) RW $02:876B INC.W $0F35,X ; Carry into the middle score byte $0F36 Player score, high byte byte table, 3 bytes per player (index X) High byte of the 24-bit score in units of 10 points ($0F34 low, $0F35 middle). Receives the carry from the middle byte in score sprites, turn block breaking and the bonus tally; cleared at new game; read by the status bar to show the score.
9 uses in 5 routines (4 read, 4 write, 1 read-modify-write) W $00:9E56 STZ.W $0F36 ; Player 1 score high byte = 0 RW $02:8770 INC.W $0F36,X ; Carry into the high score byte W $05:CF02 STA.W $0F36,X ; Score (24-bit at $0F34,X) += 1 or 10 (carry into the third byte) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:9E51 STZ.W $0F37 ; Player 2 score low word = 0 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:9E59 STZ.W $0F39 ; Player 2 score high byte = 0 $0F40 Remaining time bonus byte Working copy of the time bonus counter in the end of level tally. Set from a scratch value when the tally starts and counted down by the course clear state that adds the bonus to the score (rewarding 1 or 10 at a time).
5 uses in 2 routines (3 read, 2 write) W $05:CD04 STA.W $0F40 ; [$0F40] = [$02] R $05:CEDD LDA.W $0F40 ; Remaining time bonus [$0F40] R $05:CF66 LDA.W $0F40 ; Remaining time bonus [$0F40] = 0? $0F48 Bonus stars per player byte table indexed by player (X = 0 or 1) Bonus star count for each player. Cleared on game start, incremented by the course clear tally when the player earns stars, read by the status bar for the bonus star display and by the level end tally to trigger the bonus game.
8 uses in 4 routines (5 read, 3 write) R $00:8F5E LDA.W $0F48,X ; A = this player's bonus stars [$0F48+X] W $00:8F70 STA.W $0F48,X ; Bonus stars -= 100 W $00:9E4B STZ.W $0F48 ; Clear [$0F48] (probably bonus star counters) W $05:CF1B STA.W $0F48,X ; Player's bonus stars [$0F48 + player] += 1 $0F4A Cluster / flame misc table byte table, one per cluster or extended sprite slot General per-slot byte used by several cluster-type effects, meaning depends on the effect. Examples: Sumo Bro lightning flame timer (starts at $7F), castle candle flame animation counter, Boo/bat ceiling sway direction, and a copy of X position low or an X*4 phase offset for newly spawned cluster sprites.
13 uses in 9 routines (5 read, 5 write, 3 read-modify-write) W $02:AA4A STA.W $0F4A,X ; Cluster X position low = random + screen X (also copied to $0F4A) W $02:AA86 STA.W $0F4A,X ; [$0F4A,X] = X * 4 (per-entry phase/offset, probably) W $02:AAEC STA.W $0F4A,X ; Cluster X position low = random + screen X (also copied to $0F4A) W $02:AB3F STA.W $0F4A,X ; [$0F4A,X] = [$0F] W $02:DF76 STA.W $0F4A,Y ; [$0F4A,Y] = $7F (flame animation/timer start) R $02:F91C LDA.W $0F4A,X ; A = [$0F4A,X] (flame timer) RW $02:F925 DEC.W $0F4A,X ; Timer -= 1 unless sprites are locked RW $02:FA28 INC.W $0F4A,X ; Flame animation counter [$0F4A,X]++ RW $02:FD0D INC.W $0F4A,X ; Reverse the sway direction $0F72 Cluster sprite group index byte table, one per cluster sprite slot Index of a cluster sprite within its spawn group (loaded from $000E when spawned). The ring of Boos and the Boo/bat ceiling routines use it to offset each member's position and timing.
4 uses in 3 routines (2 read, 2 write) W $02:AB3A STA.W $0F72,X ; [$0F72,X] = index within the group ([$0E]) $0F86 Cluster sprite state / ring number byte table, one per cluster sprite slot Cleared when cluster sprites spawn. For ceiling Boos/bats it is incremented to 1 to wake the slot; for a ring of Boos it holds the ring number of that Boo (used to index the ring tables $0FAE -$0FBA ). Also read by Banzai Bill code.
12 uses in 6 routines (7 read, 4 write, 1 read-modify-write) W $02:AA38 STZ.W $0F86,X ; Clear two cluster tables ($1E66 and $0F86) W $02:AADA STZ.W $0F86,X ; Clear two cluster tables ($1E66 and $0F86) W $02:AB35 STA.W $0F86,X ; [$0F86,X] = group number [$18BA] R $02:D6DD LDY.W $0F86,X ; Y = [$0F86+X] (value not used here) R $02:FA98 LDY.W $0F86,X ; Y = [$0F86,X]: ring number of this Boo R $02:FB7C LDY.W $0F86,X ; Y = ring number RW $02:FBE8 INC.W $0F86,X ; Wake this slot: state [$0F86] = 1 W $02:FC87 STZ.W $0F86,X ; Back on the ceiling: state [$0F86] = 0 $0F9A Cluster sprite delay timer byte table, one per cluster sprite slot Delay before a ceiling Boo/bat swoops down. Set to $20 frames when the slot is woken by the Boo/bat ceiling code.
6 uses in 1 routine (3 read, 2 write, 1 read-modify-write) W $02:FBED STA.W $0F9A,X ; Delay timer [$0F9A] = $20 frames before it swoops RW $02:FC4A DEC.W $0F9A,X ; Count down timer [$0F9A] if non-zero W $02:FD17 STA.W $0F9A,X ; Pause timer [$0F9A] = random, at least $3F frames $0FAE Ring of Boos angle, low byte byte table indexed by ring number Low byte of the 9-bit rotation angle of each ring of Boos. Increased by the ring's speed each frame; $0FB0 holds the ninth bit.
3 uses in 1 routine (2 read, 1 write) W $02:FAB7 STA.W $0FAE,Y ; Ring angle low [$0FAE,Y] += speed $0FB0 Ring of Boos angle, high bit byte table indexed by ring number Bit 0 is the ninth bit of the ring angle ($0FAE is the low byte); updated with the carry from the speed add.
3 uses in 1 routine (2 read, 1 write) W $02:FAC1 STA.W $0FB0,Y ; Ring angle high bit [$0FB0,Y] = (high + carry) & 1 (9-bit angle) $0FB2 Ring of Boos screen boundary low byte table indexed by ring number Low byte of the adjusted screen boundary used by each ring of Boos, stored at load by the cluster loader and read by the ring routine ($0FB4 is the high byte).
3 uses in 2 routines (2 read, 1 write) W $02:AB5B STA.W $0FB2,Y ; [$0FB2,Y] = adjusted screen boundary low $0FB4 Ring of Boos screen boundary high byte table indexed by ring number High byte of the adjusted screen boundary for each ring of Boos ($0FB2 is the low byte). Stored at cluster load, read by the ring routine.
3 uses in 2 routines (2 read, 1 write) W $02:AB60 STA.W $0FB4,Y ; [$0FB4,Y] = adjusted screen boundary high No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $02:AB50 STA.W $0FB6,Y ; [$0FB6,Y] = Y position low (high nibble) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $02:AB56 STA.W $0FB8,Y ; [$0FB8,Y] = Y position high bit $0FBA Ring of Boos despawned flag flag byte table indexed by ring number Cleared to 0 when a ring is loaded. The ring of Boos routine reads it to tell whether that ring has been despawned.
3 uses in 2 routines (1 read, 2 write) W $02:AB65 STA.W $0FBA,Y ; [$0FBA,Y] = 0 R $02:FA9B LDA.W $0FBA,Y ; A = [$0FBA,Y] (ring despawned flag) W $02:FAE2 STA.W $0FBA,Y ; [$0FBA,Y] = 1: mark the ring as despawned No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $02:AB6A STA.W $0FBC,Y ; [$0FBC,Y] = index of the sprite in the level R $02:FAE6 LDX.W $0FBC,Y ; X = [$0FBC,Y] (level sprite index that created the ring) $0FBE Map16 tile definition pointers word table (pointer low/high pairs) Table of 16-bit addresses of tile definitions. Filled by level load and Map16 pointer setup, read when building Map16 tiles, layer 2 updates, credits backgrounds, and the overworld layers, where it points at each tile definition.
16 uses in 7 routines (7 read, 9 write) W $04:DC44 STA.W $0FBE,X ; Pointer to tile definition at $0FBE+X W $05:80EC STA.W $0FBE,Y ; Map16 tile pointer = A W $05:81A7 STA.W $0FBE,X ; Pointer of Map16 tile X/2 = [$00] W $05:8245 STA.W $0FBE,X ; Tile pointer at $0FBE+X = [$02] (shared data) W $05:8257 STA.W $0FBE,X ; Tile pointer at $0FBE+X = [$00] W $05:829F STA.W $0FBE,Y ; Tile pointer = A W $05:82B7 STA.W $0FBE,Y ; Tile pointer = A W $05:87BB STA.W $0FBE,Y ; Store pointer in the table at $0FBE+Y W $0C:94AD STA.W $0FBE,X ; Table $0FBE+X = address of this definition $13BE Item memory setting byte (0-3) Which item memory table the level uses, taken from the top two bits of level header byte 5. Used when drawing coins, midway/goal gates and other objects to find the item memory bytes for this level.
6 uses in 5 routines (5 read, 1 write) W $05:85B3 STA.W $13BE ; Item memory setting [$13BE] = byte5 >> 6 R $0D:A5F4 LDX.W $13BE ; X = [$13BE] (index of the item memory table for this level) R $0D:A8E0 LDX.W $13BE ; X = [$13BE]: item memory setting (selects which item memory table) $13BF Translevel number byte Number of the level currently loaded (the translevel number, not the overworld tile). Set during level load and read by many routines to special-case certain levels: tile interaction, Dry Bones, cutscene check, message box, overworld return.
21 uses in 11 routines (20 read, 1 write) R $00:CA08 LDA.W $13BF ; A = current level number [$13BF] R $01:E526 LDA.W $13BF ; A = [$13BF] (translevel number) R $01:E5A0 LDA.W $13BF ; A = [$13BF] (translevel number) R $04:E65C LDA.W $13BF ; A = [$13BF] (level number just beaten) W $05:D89F STA.W $13BF ; [$13BF] = translevel number R $05:D9C9 LDY.W $13BF ; Y = [$13BF] (translevel number) R $05:D9D4 LDX.W $13BF ; X = [$13BF] (translevel number) R $05:DA19 LDA.W $13BF ; A = translevel number [$13BF] $13C1 Overworld tile under player byte Overworld tile number Mario is standing on (the current map tile). Set by the overworld setup, read by the walking, level entry, pipe, star warp and event code and by overworld sprites.
17 uses in 12 routines (13 read, 4 write) R $04:8F8C LDA.W $13C1 ; A = [$13C1]: tile number the player stands on W $04:902E STA.W $13C1 ; [$13C1] = tile number under the player R $04:9138 LDA.W $13C1 ; Unreachable debug: A = [$13C1] (tile under player) R $04:9265 LDX.W $13C1 ; X = [$13C1] (tile under player) W $04:9384 STA.W $13C1 ; [$13C1] = tile number we walk onto R $04:955C LDA.W $13C1 ; Not arrived at a tile yet: A = current OW tile [$13C1] W $04:95DE STA.W $13C1 ; Set "Current OW tile" R $04:E61F CMP.W $13C1 ; Compare with [$13C1] (probably OW tile Mario stands on) $13C3 Current player submap byte Submap (overworld map number) of the active player. Stored by overworld setup code from $1F11 +X and OR'd back into $1F11 when switching maps in submap transitions.
6 uses in 3 routines (2 read, 4 write) R $04:9AA2 ORA.W $13C3 ; [$1F11+X] low byte (submap) = [$13C3] W $04:9E0E STA.W $13C3 ; [$13C3] = new player's submap [$1F11+X] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read-modify-write) RW $00:F31B INC.W $13C5 ; [$13C5]++: moon collected $13C6 Cutscene / level end state byte Counter/flag set by bosses and the goal to start the end of level sequence, and cutscene number for the castle scenes and credits (1-7 castle scenes, 8 = credits). Incremented when a boss dies or goal is hit, decremented by Reznor ring to stop Mario walking. Read by NMI, the Mario animation code, Yoshi and overworld load.
26 uses in 18 routines (16 read, 3 write, 7 read-modify-write) R $00:9471 LDX.W $13C6 ; X = cutscene number [$13C6] (1-7 castle scenes, 8 = credits) W $00:9520 STA.W $13C6 ; Unused. Store the new cutscene number RW $00:9583 INC.W $13C6 ; Game mode 1D: [$13C6]++ (next ending step) R $00:C73F LDX.W $13C6 ; X = [$13C6] (cutscene number) W $00:CA20 STX.W $13C6 ; [$13C6] = X: cutscene number RW $01:D048 INC.W $13C6 ; Cutscene/level end flag [$13C6]++ RW $01:FB25 INC.W $13C6 ; Timer ran out: [$13C6]++ (advance level end / cutscene) RW $03:8094 INC.W $13C6 ; Sprite gone: [$13C6]++ (cutscene flag, Mario stops walking at level end) RW $03:98DE DEC.W $13C6 ; [$13C6]--: stop Mario from walking at level end (cutscene state) RW $03:C79E INC.W $13C6 ; Next cutscene state [$13C6]++ RW $03:CE91 INC.W $13C6 ; [$13C6]++ (boss defeated/level goal flag) $13C7 Yoshi color RAM_YoshiColor byte Color of the Yoshi Mario owns or is riding (the palette selection). Set when Mario gets on Yoshi and copied to and from the player's saved Yoshi color when entering or leaving levels.
5 uses in 5 routines (2 read, 3 write) R $00:A0DA LDA.W RAM_YoshiColor ; Yes: A = Yoshi color W $01:EB8D STA.W RAM_YoshiColor ; [RAM_YoshiColor] = Yoshi's palette W $04:91CF STA.W RAM_YoshiColor ; Yoshi color for the map and the level = this player's Yoshi color W $04:9DF1 STA.W RAM_YoshiColor ; Yoshi color -> overworld has-Yoshi flag, Yoshi color and on-Yoshi flag $13C9 Continue/End menu flag flag byte Non-zero while the CONTINUE/END menu is active after Game Over. Incremented when both players are out of lives and to enter the menu state, cleared when a game starts, and read when loading the overworld to skip ahead unless returning from it.
5 uses in 5 routines (2 read, 1 write, 2 read-modify-write) RW $00:9785 INC.W $13C9 ; [$13C9]++ (both players out of lives, probably) RW $00:9B96 INC.W $13C9 ; [$13C9]++: next state, the menu itself W $00:9E3A STZ.W $13C9 ; [$13C9] = 0: not in the CONTINUE/END menu R $00:A0EE LDY.W $13C9 ; Y = [$13C9] (CONTINUE/END flag) $13CA Save pending flag flag byte Incremented by the overworld after-level routine to flag that the game should be saved, tested later in overworld processing.
4 uses in 1 routine (1 read, 1 write, 2 read-modify-write) RW $04:8FE9 INC.W $13CA ; Flag a save as pending ([$13CA]++) RW $04:8FFB INC.W $13CA ; Flag a save as pending ([$13CA]++) R $04:903C LDA.W $13CA ; A = [$13CA] (save pending flag) W $04:904C STZ.W $13CA ; Clear the save pending flag [$13CA] $13CB Give Mario star flag bit flags Bit 7 gives Mario a star when tested by the per-frame Mario state code, which then clears it. Incremented when a level-end sprite is converted to a bonus powerup and shifted left at level start; the purpose of the shift is unclear.
4 uses in 3 routines (1 read, 1 write, 2 read-modify-write) RW $00:A683 ASL.W $13CB ; [$13CB] <<= 1 (purpose unclear) R $00:C480 LDA.W $13CB ; A = [$13CB] (bit 7 = give Mario a star) $13CC Coins to add counter Pending coins to add to the coin counter. Switch icon and coin counter code add to it, and the status bar routine takes one coin off per frame (decrementing it) and adds it to the displayed total.
5 uses in 2 routines (2 read, 1 write, 2 read-modify-write) RW $00:8F22 DEC.W $13CC ; [$13CC]-- (one coin is added per frame) R $05:B333 ADC.W $13CC ; Coin counter [$13CC] += A RW $05:B34A INC.W $13CC ; Coin counter [$13CC] += 1 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) $13CE Midway point reached flag flag byte Set to 1 when Mario passes the midway gate or finishes a level cleared by the message box; cleared when a level loads. Tested by midway point drawing and overworld level exit code. Probably the midway/level cleared flag.
6 uses in 6 routines (2 read, 4 write) W $00:A27B STA.W $13CE ; Unused debug: [$13CE] = A (probably the midway flag) W $05:B155 STA.W $13CE ; [$13CE] = 1 (level cleared flag, probably) $13CF Midway entry flag flag byte Cleared when a level loads and may be set when entering from a midway point. Read by level start setup to choose the start position.
5 uses in 2 routines (3 read, 2 write) W $05:D79B STZ.W $13CF ; [$13CF] = 0 (midway point entry flag, may be set below) W $05:D9DE STA.W $13CF ; [$13CF] = $40: entering from the midway point $13D0 Overworld event tile kind byte Kind of tile an overworld event draws (stored by the event state machine) and read by the code that writes the event tile blocks into the stripe image.
3 uses in 2 routines (2 read, 1 write) W $04:E6B4 STA.W $13D0 ; [$13D0] = tile kind No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $04:E68A STX.W $13D1 ; [$13D1] = list index of this event $13D2 Switch palace event flag flag byte Set to 1 when Mario presses a switch, used with $13C6 to choose the scripted walk, and as a Switch Palace message flag by the message box (X + 1). Cleared to 0 when the ! block particle effect finishes.
11 uses in 6 routines (8 read, 3 write) R $00:C929 ORA.W $13D2 ; A = [$13C6] | [$13D2] (cutscene number | switch palace flag, probably) R $00:C935 LDA.W $13D2 ; [$13D2] non-zero (probably switch palace): go to CODE_00C948 W $00:EEB7 STA.W $13D2 ; [$13D2] = 1 (a switch was pressed) W $04:F297 STZ.W $13D2 ; Effect finished: [$13D2] = 0 R $05:B135 ORA.W $13D2 ; A = [$0109] | [$13D2]: intro level or Switch Palace message W $05:B1CA STX.W $13D2 ; [$13D2] = X + 1 (switch palace message flag) $13D3 Pause delay timer timer Frames before the game may be paused again. Set to $3C on pause and counted down each frame in the level; the byte is also the start of the area cleared on overworld load.
4 uses in 2 routines (1 read, 2 write, 1 read-modify-write) W $00:A1B5 STZ.W $13D3,X ; Clear $13D3+X W $00:A22E STA.W $13D3 ; Pause delay [$13D3] = $3C frames $13D4 Pause flag flag byte In levels, non-zero while the game is paused. On the overworld, set while looking around the map with the L/R buttons and cleared with 0 when leaving that mode.
8 uses in 2 routines (5 read, 2 write, 1 read-modify-write) W $04:82E7 STZ.W $13D4 ; [$13D4] = 0: leave look-around mode RW $04:8383 INC.W $13D4 ; [$13D4]++: toggle look-around mode $13D5 Layer 3 / scroll-sprite stop flag flag byte Non-zero while layer 3 effects such as the message box or end of level tally are active; the scroll routines read it to stop scroll sprites. Cleared at level start, incremented when there is no animated layer 3, set to 1 by the message box and tally.
7 uses in 6 routines (2 read, 4 write, 1 read-modify-write) RW $00:A012 INC.W $13D5 ; [$13D5]++ (no animated layer 3 flag) W $05:B245 STA.W $13D5 ; [$13D5] = 1 (probably: message box is using layer 3) W $05:CC86 STA.W $13D5 ; [$13D5] = 1: level end tally active (stops the scroll sprites) $13D6 Level start / tally delay timer timer Countdown set to $50 at level start and $30 between course clear states. Decremented by the bonus star line state.
3 uses in 3 routines (2 write, 1 read-modify-write) RW $05:CDD5 DEC.W $13D6 ; Count down the [$13D6] timer W $05:CF42 STX.W $13D6 ; [$13D6] = $30: delay before the next state No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $04:98CC ADC.W $13D7 ; Sub-pixel accumulator [$13D7] += $80 $13D9 Overworld process byte (state) Overworld state machine number. 0 = stop overworld processing, 3 = normal control, 4/5 = after-level save, 8 = Mario walks along the path, $0B = star warp, $0C = special event. Read by NMI, palette upload, overworld sprites and drawing.
39 uses in 26 routines (12 read, 16 write, 11 read-modify-write) W $00:96EC STZ.W $13D9 ; [$13D9] = 0: stop overworld processing W $00:A173 STZ.W $13D9 ; [$13D9] = 0 (overworld process: normal) R $04:8576 LDA.W $13D9 ; A = [$13D9]: overworld process number W $04:8F0D STA.W $13D9 ; OW process [$13D9] = $0C (a special event at this spot) W $04:8F5A STA.W $13D9 ; OW process [$13D9] = 5 (player does nothing) RW $04:8F77 INC.W $13D9 ; OW process [$13D9] += 1 (next: path reveal and events) W $04:8FF6 STA.W $13D9 ; [$13D9] = 4 (INC at $049033 makes it 5) RW $04:9033 INC.W $13D9 ; Next overworld state: [$13D9]++ W $04:9177 STA.W $13D9 ; [$13D9] = $0B: start the star warp W $04:9232 STA.W $13D9 ; [$13D9] = 5: next overworld event RW $04:940B INC.W $13D9 ; Next overworld state: [$13D9]++ (player moves) W $04:9464 STA.W $13D9 ; OW process [$13D9] = 8 RW $04:9553 INC.W $13D9 ; OW process [$13D9]++ (next: level name display) W $04:9640 STA.W $13D9 ; OW process [$13D9] = $0A (submap transition) W $04:98F3 STZ.W $13D9 ; OW process [$13D9] = 0 W $04:9DB1 STA.W $13D9 ; Overworld process [$13D9] = 3 (probably normal overworld control) RW $04:9DC9 INC.W $13D9 ; Next overworld process (fade out) W $04:9E1B STA.W $13D9 ; Overworld process [$13D9] = $0A RW $04:9E40 INC.W $13D9 ; Fade done: next overworld process W $04:9E4E STA.W $13D9 ; Overworld process [$13D9] = 3 (probably normal overworld control) W $04:DBD4 STA.W $13D9 ; Overworld process [$13D9] = 4 (normal) RW $04:E624 INC.W $13D9 ; Match: advance the OW process [$13D9]++ W $04:E637 STA.W $13D9 ; [$13D9] = 5: back to normal OW processing (Mario idle) RW $04:EA04 INC.W $13D9 ; Advance the OW process [$13D9]++ R $05:CC07 LDA.W $13D9 ; A = [$13D9] (tally state) RW $05:CD28 INC.W $13D9 ; [$13D9]++ (next tally state) RW $05:CDE0 INC.W $13D9 ; Next state: [$13D9]++ RW $05:CF45 INC.W $13D9 ; Next state: [$13D9]++ $13DA X speed fraction byte Fractional bits of Mario's X speed, kept for sub-pixel movement. Cleared when climbing and written by collision code; used by the Mario movement code with ADC to carry the fraction.
4 uses in 2 routines (1 read, 3 write) W $00:DB42 STZ.W $13DA ; X position fraction [$13DA] = 0 R $00:DC56 ADC.W $13DA,X ; A += position fraction [$13DA,X]; carry = overflow W $00:DC59 STA.W $13DA,X ; Store the new fraction W $00:E9F3 STA.W $13DA ; [$13DA] = [$144E] (probably the fractional part of the carried speed) $13DB Mario walk frame byte Mario's walking animation frame number. Set when finishing the pose and read by the walk animation counter, the OAM drawer and cape/accessory drawing, which index tables by it.
7 uses in 6 routines (6 read, 1 write) R $00:CFE3 LDA.W $13DB ; A = [$13DB] (walk frame number) W $00:D003 STA.W $13DB ; Walk frame [$13DB] = A R $00:E35D CPY.W $13DB ; Image >= $0A: skip compare, else compare Y with [$13DB] R $0C:D666 LDX.W $13DB ; X = [$13DB] (pose index) $13DD Mario turning direction RAM_ChangingDir flag byte Non-zero while Mario is turning around on the ground; set to $0D to show the turn-around pose, cleared by normal animation. Read by pose choice, carried item and kick code.
5 uses in 5 routines (3 read, 2 write) W $00:CD39 STZ.W RAM_ChangingDir ; [$13DD] = 0: not changing direction W $00:D708 STA.W RAM_ChangingDir ; Show the turn-around pose ([RAM_ChangingDir] = $0D) $13DE Mario pose offset byte Offset added to the walking pose frame (walking, running, ...) by the pose finish code. Cleared by scripted animations, pipes and normal animation when there is no cape interaction.
8 uses in 7 routines (1 read, 7 write) W $00:CCCD STZ.W $13DE ; [$13E8] = [$13DE] = 0 (no cape interaction) R $00:D007 ADC.W $13DE ; A += [$13DE] (pose offset: walking, running...) W $00:D19A STZ.W $13DE ; Pose offset [$13DE] = 0 $13DF Cape image byte Index of the cape animation frame. Updated by the cape image routines and pose choice from a table, cleared for pipes and climbing, and read by the Mario OAM drawing.
7 uses in 7 routines (2 read, 5 write) R $00:CEB6 LDX.W $13DF ; X = cape image [$13DF] W $00:CF0A STX.W $13DF ; [$13DF] = cape image W $00:CF32 STA.W $13DF ; Cape image [$13DF] = DATA_00CEA9[Y] W $00:D206 STZ.W $13DF ; Cape image [$13DF] = 0 W $00:DB1B STZ.W $13DF ; Cape image [$13DF] = 0 $13E0 Mario pose byte Mario's current image (pose) number. Written by the animation routines (pipe $0F, death $3E, peace sign $26, flower power-up 0, etc.) and read by the OAM drawing and cape tables to choose tiles.
22 uses in 17 routines (3 read, 19 write) W $00:C7ED STA.W MarioFrame ; Mario pose [$13E0] = table at $00C5E1[nibble - 7] W $00:CA3A STA.W MarioFrame ; Store as Mario's pose W $00:CCDC STA.W MarioFrame ; Mario frame = $0F (entering pipe pose) W $00:CDA5 STA.W MarioFrame ; Set Mario's pose W $00:CDC6 STA.W MarioFrame ; Set Mario's pose W $00:D030 STA.W MarioFrame ; Mario pose [MarioFrame] = A W $00:D0BA STA.W MarioFrame ; Mario pose = $3E (death pose) W $00:D134 STA.W MarioFrame ; Mario pose = GrowingAniImgs[Y] W $00:D184 STZ.W MarioFrame ; Mario pose = 0 W $00:D1AF STA.W MarioFrame ; On Yoshi: pose $29 (entering horizontal pipe) W $00:D22A STA.W MarioFrame ; Mario pose = A W $00:DAA5 STA.W MarioFrame ; Store Mario pose W $00:DB92 STA.W MarioFrame ; Mario image = A W $00:DBCD STA.W MarioFrame ; Mario image = ClimbingImgs[X] (front or behind net) R $00:E326 LDX.W MarioFrame ; X = Mario image [MarioFrame] R $00:E406 LDX.W MarioFrame ; X = Mario image W $0C:A20C STA.W MarioFrame ; Mario pose = $0F (facing the screen / entering pipe frame) W $0C:A6C6 STA.W MarioFrame ; Mario's image = peace sign ($26) W $0C:D67D STA.W MarioFrame ; Mario frame = table at $0CD5D6 + X (DATA_0CD5D9: frames $35-$37) $13E1 Cape flight slope value byte Slope value used by cape flight. Set from the walking-speed code to a per-direction value, copied from X (slope angle for Mario's pose) by the block collision code, and cleared by the level collision routine. Read by the Mario pose chooser. Meaning is only partly clear from the code.
9 uses in 4 routines (6 read, 3 write) W $00:D6C8 STY.W $13E1 ; [$13E1] = cape flight slope value for this direction R $00:D6CF ORA.W $13E1 ; X = direction << 2 | [$13E1]: acceleration table index R $00:D6F0 ORA.W $13E1 ; X = direction << 2 | [$13E1]: acceleration table index R $00:D76B LDA.W $13E1 ; A = slope index [$13E1] W $00:EF08 STX.W $13E1 ; [$13E1] = X (slope angle for Mario's pose) $13E2 Cape/fireball input timer counter Counter bumped by the cape hit point and fireball input routine, which tests it to decide when to shoot fireballs and in which direction. Cleared by the scripted walk (castle entry) and set when a ground jump starts.
5 uses in 3 routines (2 read, 2 write, 1 read-modify-write) $13E3 Wall-run status RAM_WallWalkStatus byte Mario's wall-running state (cape). 0 = not wall-running. Set by the cape ground pound landing code when wall-running starts; read by collision, pose/OAM drawing, climbing tables, hurt Mario and the scroll routine.
Values: 0 = none, 2 = running on a wall to the left, 3 = running on a wall to the right.
13 uses in 7 routines (9 read, 3 write, 1 read-modify-write) R $00:E330 LDA.W RAM_WallWalkStatus ; A = wall run status R $00:EAE1 LDA.W RAM_WallWalkStatus ; A = wall-run status [$13E3] R $00:EB03 LDA.W RAM_WallWalkStatus ; A = wall-run status W $00:EB16 STA.W RAM_WallWalkStatus ; Store the new wall-run status RW $00:EB3E TRB.W RAM_WallWalkStatus ; Clear bit 1 of the wall-run status: wall contact lost R $00:EB42 LDA.W RAM_WallWalkStatus ; A = wall-run status (entry from CODE_00EFE8 when Mario hits a solid block) W $00:EB73 STZ.W RAM_WallWalkStatus ; Clear the wall-run status [$13E3] W $00:F049 STX.W RAM_WallWalkStatus ; Start wall-running: [$13E3] = 2 (left) or 3 (right) $13E4 P-meter (dash timer) timer Mario's run-speed meter. Filled while he runs at full speed and counts down otherwise; a full meter allows the run jump and cape take-off. Normal Mario handling sets it to $70 (full); the cape flight code stores it. Read by the ground X speed routine.
Values: $70 = full P-meter.
4 uses in 3 routines (2 read, 2 write) W $00:CCB5 STA.W $13E4 ; P-meter [$13E4] = $70 W $00:D97C STA.W $13E4 ; Store the dash timer ([$13E4], the P-meter) $13E5 Run animation speed class byte Upper bits of the index into the player's flashing/animation timing table (written to $1496 by the walk animation counter). Set to $68 when Left/Right is held, ORed with X/8 to pick the entry. Also set to 3 by the level and block collision code when Mario pushes against a wall (probably a side-contact timer); cleared when leaving the water-border check.
6 uses in 3 routines (1 read, 5 write) W $00:CFE0 STA.W $13E5 ; [$13E5] = $68: animation speed class used in slippery levels W $00:EA28 STA.W $13E5 ; [$13E5] = 3 (probably the wall-push animation timer) W $00:EAA6 STZ.W $13E5 ; [$13E5] = 0 (wall-push animation timer) W $00:EC61 STA.W $13E5 ; [$13E5] = 3 (probably a side-contact flag) W $00:EF1C STX.W $13E5 ; [$13E5] = X (running uphill) $13E8 Cape interaction flag flag byte Non-zero while the cape is active as a hitbox against sprites (during a cape spin). Set to 1 by the cape hit point routine; cleared when the ground speed code cancels it and when swimming starts. Read by the cape/ground-pound sprite interaction loop in bank 02.
Values: 0 = off, 1 = cape interacts with sprites.
5 uses in 5 routines (1 read, 4 write) W $00:D046 STY.W $13E8 ; Cape interaction flag [$13E8] = 1 W $00:D608 STZ.W $13E8 ; Cancel the cape interaction with sprites W $00:DA39 STZ.W $13E8 ; Cancel cape sprite interaction $13E9 Cape hitbox X, low word (little endian, low byte) Low byte of the cape's interaction X position: Mario X plus an offset from DATA_00D034 by cape pose. High byte is $13EA . Read by the bank 02 cape routines that hit blocks, bounce sprites and extended sprites.
6 uses in 4 routines (4 read, 2 write) W $00:D053 STA.W $13E9 ; Cape interaction X [$13E9] = Mario X + DATA_00D034[Y] W $02:951C STA.W $13E9 ; Cape X low += [$26] $13EA Cape hitbox X, high word (little endian, high byte) High byte of the cape's interaction X position ([$13E9 ] is the low byte). The bank 02 routine adds Mario's [$27 ] carry into it. Read by the cape hit routines.
5 uses in 3 routines (4 read, 1 write) W $02:9524 STA.W $13EA ; Cape X high += [$27] $13EB Cape hitbox Y, low word (little endian, low byte) Low byte of the cape's interaction Y position: Mario Y plus an offset from DATA_00D03C. High byte is $13EC . Read by the cape hit routines for blocks, extended sprites and bounce sprites.
6 uses in 4 routines (4 read, 2 write) W $00:D05C STA.W $13EB ; Cape interaction Y [$13EB] = Mario Y + DATA_00D03C[Y] W $02:952D STA.W $13EB ; Cape Y low += [$28] $13EC Cape hitbox Y, high word (little endian, high byte) High byte of the cape's interaction Y position ([$13EB ] is the low byte). Read by the cape hit routines.
5 uses in 3 routines (4 read, 1 write) W $02:9535 STA.W $13EC ; Cape Y high += [$29] $13ED Mario sliding flag / slide timer byte Non-zero while Mario is sliding down a slope. Set by the block/slope collision code, which reads it as a slide timer; cleared whenever sliding ends (ground speed code, swimming, cape flight, scripted walks, power-ups). Read by the pose chooser (slide pose) and by sprite contact, which treats a sliding Mario as a kicking hit.
Bit 7 is cleared by the flower power-up animation.
Values: 0 = not sliding.
21 uses in 9 routines (10 read, 10 write, 1 read-modify-write) W $00:C5B8 STZ.W $13ED ; Clear [$13DE] and [$13ED] (Mario state flags) W $00:C91E STZ.W $13ED ; [$13ED] = 0 (no slope sliding) W $00:D181 STA.W $13ED ; Clear bit 7 of [$13ED] W $00:D67F STZ.W $13ED ; Not sliding any more W $00:D6B1 STZ.W $13ED ; Not sliding any more W $00:D7FF STZ.W $13ED ; Clear the sliding flag W $00:D988 STZ.W $13ED ; No slope sliding R $00:EEE6 LDX.W $13ED ; X = [$13ED] (slide timer) R $00:EEFB ORA.W $13ED ; A = [$148F] | [$13ED] RW $00:EFAA ROR.W $13ED ; Rotate carry into bit 7 of [$13ED] R $01:A8E6 LDA.W $13ED ; Side contact: A = Mario sliding flag [$13ED] $13EE Slope direction byte Direction of the slope Mario is standing on, written by the block and slope collision code and cleared by the level collision routine. Read by the ground X speed routine to adjust acceleration on slopes.
3 uses in 3 routines (1 read, 2 write) W $00:EEEF STA.W $13EE ; [$13EE] = slope direction $13EF Below-surface counter counter Counter incremented by the block and slope collision code while Mario is below the surface of a tile (probably water or a slope edge), and shifted left once; cleared at the start of the level collision routine each frame.
6 uses in 2 routines (1 read, 1 write, 4 read-modify-write) RW $00:E978 ASL.W $13EF ; [$13EF] <<= 1 (probably moves the layer 2 result to bit 1) RW $00:EDB6 INC.W $13EF ; [$13EF]++ (Mario is below the surface) RW $00:EED1 INC.W $13EF ; [$13EF]++ (Mario was pushed out of the floor) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $00:DB68 ORA.W $13F0 ; Y |= [$13F0] (side/facing bit) W $00:DBB7 STX.W $13F0 ; [$13F0] = X (side Mario was on) $13F1 Vertical scroll enable (air) byte Vertical scroll helper used by the scroll routine: set from the vertical scroll flag when the air flag is set, and cleared to disable vertical scrolling. Also incremented once during level start setup.
5 uses in 2 routines (2 read, 2 write, 1 read-modify-write) W $00:F8A7 STZ.W $13F1 ; Clear [$13F1] (and [$13F2], A is 16-bit) $13F3 Mario balloon pose / P-balloon byte, also indexed by Y as a bit table Non-zero while Mario is holding a P-balloon; also doubles as a balloon pose value that makes his pose flash. Set to 9 by the balloon sprite, cleared when the balloon expires, is dropped, or the level ends. Block interaction also ORs bit masks into [$13F3 + Y] (X = previous value) when Mario touches tiles. Read by the scroll routine (adds a camera offset) and by Put Mario on Yoshi.
Values: 0 = no balloon, 9 = balloon mode.
14 uses in 9 routines (7 read, 7 write) W $00:CDA0 STY.W $13F3 ; Store the counter R $00:F212 LDX.W $13F3,Y ; [$13F3 + Y] |= bit mask for X (DATA_00F0EC); X = previous value R $00:F24B LDA.W $13F3,Y ; A = hit flags [$13F3 + Y] R $00:F83C ORA.W $13F3 ; OR P-balloon [$13F3] W $00:FA80 STZ.W $13F3 ; [$13F3] = 0 (P-balloon off) W $01:9FBB STY.W $13F3 ; [$13F3] = Y (balloon pose, makes Mario flash his pose) W $01:9FC4 STZ.W $13F3 ; Clear balloon pose [$13F3] W $01:C301 STA.W $13F3 ; [$13F3] = 9: Mario is in balloon mode W $02:803F STZ.W $13F3 ; P-balloon was being carried: [$13F3] = 0 (probably Mario's balloon pose) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $00:A66C ORA.W $13F8 ; A = [$13F4] | [$13F5] | [$13F6] | [$13F7] | [$13F8]; all zero: go to A674 $13F9 Mario behind scenery flag RAM_IsBehindScenery flag byte Layer priority of Mario's sprite. Tells the OAM drawing and climbing routines whether he is in front of or behind scenery (climbing nets, pipes). Set to 2 in pipe animations, 3 in Mario Start, bosses and the border map. Toggled by the climbing net door. Cleared by level collision when he leaves a scenery tile ($8B = 0). Read by sprite contact tests, fireballs, bounce blocks and smoke puffs.
Values: 0 = in front, 1 = behind scenery, 2 and 3 = special priority (pipe, cutscene).
19 uses in 14 routines (9 read, 10 write) W $00:97F3 STA.W RAM_IsBehindScenery ; [$13F9] (behind scenery flag) = 3 W $00:D233 STA.W RAM_IsBehindScenery ; Behind-scenery flag = 2 W $00:D28C STA.W RAM_IsBehindScenery ; Behind-scenery flag = 2 R $00:DB81 LDX.W RAM_IsBehindScenery ; X = [$13F9] (Mario is behind scenery: 0 front, 1 behind) R $00:E448 LDX.W RAM_IsBehindScenery ; X = [$13F9] W $00:EA3F STZ.W RAM_IsBehindScenery ; If [RAM_IsBehindScenery] = 1 and [$8B] = 0 (probably no longer on a scenery tile), clear it R $01:A81C LDA.W RAM_IsBehindScenery ; A = Mario behind scenery flag W $01:BB30 STA.W RAM_IsBehindScenery ; Toggle Mario's behind-scenery flag [$13F9] W $03:AC1C STA.W RAM_IsBehindScenery ; Mario is behind scenery [$13F9] = 3 W $04:85CC STA.W RAM_IsBehindScenery ; [$13F9] = 3: Mario sprite priority flags (probably so he draws over the border) W $0C:A764 STZ.W RAM_IsBehindScenery ; Clear behind-scenery flag $13FA Water surface flag flag byte Set to 1 when Mario reaches the surface of water (after the swim speed is clamped); cleared each frame by the level collision routine. The swimming code tests it to see whether he can jump out of the water.
4 uses in 2 routines (2 read, 1 write, 1 read-modify-write) W $00:EA42 STZ.W $13FA ; [$13FA] = 0 (probably the at-water-surface flag, set again below) RW $00:EA75 INC.W $13FA ; [$13FA]++ (probably the at-water-surface flag) $13FB Mario frozen / Yoshi busy counter Non-zero freezes Mario and in-level control. Set by the keyhole routine, bosses, Yoshi (busy while swallowing) and cutscenes, cleared by the falling columns, Yoshi and Koopa Kid code. Incremented by the keyhole exit, Yoshi mount and Yoshi draw routines. ORed in by Mario's OAM drawing and the boss fireball to test for it.
Values: 0 = free.
13 uses in 9 routines (3 read, 7 write, 3 read-modify-write) W $00:C491 STY.W $13FB ; [$13FB] = Y: freeze Mario while the keyhole animation runs R $00:C4F8 LDA.W $13FB ; A = [$13FB] (Mario frozen) R $01:D450 ORA.W $13FB ; OR cutscene/boss-defeated flag [$13FB] RW $01:E21A INC.W $13FB ; [$13FB]++ (freeze Mario for the keyhole exit) W $01:EBCA STZ.W $13FB ; Clear [$13FB] (Yoshi busy flag) W $01:EC1D STA.W $13FB ; Yoshi busy flag [$13FB] = timer W $01:EC26 STZ.W $13FB ; Clear busy flag RW $01:EC78 INC.W $13FB ; [$13FB]++ (Yoshi busy) RW $01:F02F INC.W $13FB ; Increment [$13FB] (probably a count of eaten items) W $02:8430 STZ.W $13FB ; Unlock Mario ([$13FB] = 0) $13FC Boss number byte Identifies which Mode 7 boss room is loaded. Set by the Mode 7 boss graphics setup and read by the NMI, the boss room tile animation, frame code and Mario's platform/ceiling collision in the boss room.
7 uses in 6 routines (6 read, 1 write) R $00:97E4 LDY.W $13FC ; Y = [$13FC] (boss number) R $00:9A60 LDA.W $13FC ; A = [$13FC] (boss number) W $03:DD83 STY.W $13FC ; [$13FC] = boss number (the sprite state) R $03:DD9E LDY.W $13FC ; Y = boss number $13FD L/R scroll freeze flag flag byte Non-zero while the screen is scrolling because of L/R camera scrolling; sprites are frozen then. Incremented by the L/R scroll routine, tested by the scroll code and the Yoshi pose routine.
Values: 0 = not scrolling.
4 uses in 3 routines (2 read, 1 write, 1 read-modify-write) RW $00:CE27 INC.W $13FD ; [$13FD]++: freeze sprites while the screen scrolls W $00:CE6D STX.W $13FD ; Unfreeze sprites ([$13FD] = 0) $13FE L/R scroll direction byte Direction of the current L/R screen scroll, set by the L/R scroll routine and read by the Yoshi pose code.
4 uses in 2 routines (1 read, 3 write) R $00:CDE2 LDY.W $13FE ; Y = [$13FE] (scroll direction) W $00:CE45 STA.W $13FE ; [$13FE] = scroll direction W $00:CE6A STX.W $13FE ; Yes: stop scrolling $13FF Mario facing direction (scroll) byte Mario's facing direction as used by scrolling. The L/R scroll routine uses it times 2 as an index, and the scroll routine reads it for the look-ahead offset.
3 uses in 2 routines (2 read, 1 write) R $00:CE62 LDY.W $13FF ; Y = Mario direction * 2 R $00:F8B2 LDX.W $13FF ; X = Mario facing direction [$13FF] $1400 Scroll look-ahead memo byte Remembers the look-ahead adjustment chosen by the scroll routine (stored from Y). Cleared by the L/R scroll routine, read by the Yoshi pose routine.
3 uses in 3 routines (1 read, 2 write) W $00:F8DB STY.W $1400 ; [$1400] = Y (remember the look-ahead adjustment) $1401 L/R scroll hold timer timer Counts up each frame while L or R is held to scroll the screen; the scroll starts once it reaches a limit. Cleared when the scroll stops.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) RW $00:CE0B INC.W $1401 ; Hold timer [$1401]++ W $00:CE49 STZ.W $1401 ; Hold timer [$1401] = 0 $1402 Riding bounce block flag flag byte Set to 1 by the bounce block sprite (purpose unclear, probably that Mario is on a bouncing block). Cleared by the per-frame Mario state; read by block collision.
3 uses in 3 routines (1 read, 2 write) W $02:9159 STA.W $1402 ; [$1402] = 1 (flag set while riding the block, purpose unclear) $1403 Layer 3 effect mode byte Layer 3 (BG3) motion mode set at level start: 1 or 2. Read by the layer 3 scroll code and by the swimming routine (layer 3 tide check).
Values: 0 = none, 1 and 2 = layer 3 effect.
5 uses in 4 routines (4 read, 1 write) W $00:9FD1 STA.W $1403 ; [$1403] = layer 3 effect value (1 or 2) R $05:C40C LDA.W $1403 ; A = [$1403] (layer 3 motion mode) $1404 Free vertical scroll flag flag byte Layer 1 vertical scroll state. Incremented at game mode 11 and by the scroll routine; cleared to wait until Mario is on a higher platform before scrolling up. Read by the vertical scroll code.
4 uses in 2 routines (1 read, 1 write, 2 read-modify-write) RW $00:970F INC.W $1404 ; [$1404]++ (layer 1 vertical scroll flag) W $00:F825 STX.W $1404 ; Clear free vertical scroll [$1404] RW $00:F87E INC.W $1404 ; Enable free vertical scroll [$1404] No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 read-modify-write) RW $00:D24B INC.W $1405 ; [$1405] += 1 (probably marks the pipe entry as done) $1406 Springboard / high-jump flag flag byte Set to $80 by the portable springboard and the cape ground pound landing; cleared by block collision. The scroll routine ORs it in, probably to raise the camera for the higher jump.
4 uses in 4 routines (1 read, 3 write) R $00:F842 ORA.W $1406 ; OR springboard/trampoline flag [$1406] W $01:E6A4 STY.W $1406 ; [$1406] = $80 (springboard high-jump flag, probably) $1407 Cape flight phase byte Mario's cape flight state. Set by the flower power-up and cleared on swimming and death; read by the pose chooser, collision, hurt Mario and Koopa contact.
Values: 0 = no cape flight; other values are flight phases.
15 uses in 9 routines (10 read, 5 write) R $00:CFA6 LDY.W $1407 ; Y = [$1407] (cape flight phase) W $00:D179 STZ.W $1407 ; Cape flight phase [$1407] = 0 R $00:EF79 LDY.W $1407 ; Y = [$1407] (cape flight state) W $00:EF9C STZ.W $1407 ; [$1407] = 0 (end cape flight state) W $00:F622 STZ.W $1407 ; Cape status [$1407] = 0 R $01:A9C7 LDA.W $1407 ; Koopa: A = cape flag [$1407] $1408 Cape pitch input byte Remembers the pitch input (cape state for the next phase) stored by the cape flight code.
3 uses in 1 routine (2 read, 1 write) W $00:D87E STX.W $1408 ; Remember the pitch input in [$1408] $1409 Cape upward boost byte Cleared to 0 by the cape flight code on most frames; the next call sets it when an upward boost is wanted.
7 uses in 1 routine (4 read, 3 write) W $00:D81A STZ.W $1409 ; [$1409] = 0: upward boost, set by the next call W $00:D8B6 STZ.W $1409 ; Use the boost as Y speed and clear it No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $140D Spin jump flag RAM_IsSpinJump flag byte Non-zero while Mario spin jumps. Set to 1 when a spin jump starts, on springboards and water exits, and when hurt out of cape soaring; cleared in animations, swimming, climbing and death. Checked by sprite contact (spin kills), block collision and the cape flight code (no flight while spin jumping).
Values: 0 = no, 1 = spin jumping.
18 uses in 15 routines (9 read, 9 write) W $00:C8F5 STZ.W RAM_IsSpinJump ; Not spin jumping W $00:D646 STA.W RAM_IsSpinJump ; [RAM_IsSpinJump] = 1: start a spin jump R $00:D7F3 ORA.W RAM_IsSpinJump ; Carrying, on Yoshi or spin jumping: no cape flight W $00:D990 STZ.W RAM_IsSpinJump ; No spin jump W $00:DB1E STZ.W RAM_IsSpinJump ; Not spin jumping W $00:EA8A STA.W RAM_IsSpinJump ; [RAM_IsSpinJump] = 1: spin jump out of the water R $00:EE6B LDX.W RAM_IsSpinJump ; X = spin jump flag W $00:EF72 STZ.W RAM_IsSpinJump ; Not spin jumping W $00:F5E9 STA.W RAM_IsSpinJump ; [RAM_IsSpinJump] = 1 W $00:F618 STZ.W RAM_IsSpinJump ; Spin jump flag = 0 R $01:A8D0 LDA.W RAM_IsSpinJump ; A = spin jump flag R $01:A91C LDA.W RAM_IsSpinJump ; A = spin jump flag R $01:AA42 LDA.W RAM_IsSpinJump ; A = spin jump flag W $01:E695 STA.W RAM_IsSpinJump ; A pressed: spin jump flag = 1 $140E Collision tile counter counter Incremented once by the block and slope collision code and cleared at the start of the level collision routine. Read by layer 2 scroll sprite 0E (sink or rise).
3 uses in 3 routines (1 read, 1 write, 1 read-modify-write) $140F Reznor frame counter counter Counts frames in the Reznor room (incremented by the Reznor main routine). Read by the smoke, extended sprite and star palette code to avoid overwriting the platform's OAM in the Reznor fight.
6 uses in 5 routines (5 read, 1 read-modify-write) RW $03:9890 INC.W $140F ; Reznor frame counter [$140F]++ $1410 Yoshi has wings (B) RAM_YoshiHasWingsB flag byte Winged Yoshi flag, set by the Yoshi main routine and read by the Yoshi draw and scroll routines.
Values: 0 = no wings; non-zero = winged.
4 uses in 3 routines (3 read, 1 write) W $01:EBD0 STA.W RAM_YoshiHasWingsB ; [RAM_YoshiHasWingsB] = winged Yoshi flag $1411 Layer 1 horizontal scroll flag flag byte Layer 1 horizontal scrolling enable. Cleared by scripted scenes, boss rooms and scroll sprites to disable normal scrolling; set to 1 when a level loads (and by the header). Read by the scroll and collision routines.
Values: 0 = off, 1 = on.
15 uses in 10 routines (4 read, 11 write) W $00:9955 STZ.W $1411 ; [$1411] = 0 (layer 1 horizontal scroll flag, probably) W $00:C98F STZ.W $1411 ; [$1411] = 0 (no horizontal scrolling) W $05:BD36 STZ.W $1411 ; [$1411] = 0: horizontal scroll disabled for layer 1 W $05:BEA6 STZ.W $1411 ; [$1411] = 0: horizontal scroll disabled for layer 1 W $05:BF97 STZ.W $1411 ; Layer 2 Falls: [$1411] = 0 W $05:BFBA STZ.W $1411 ; Unused. [$1411] = 0 W $05:C005 STZ.W $1411 ; Layer 1 horizontal scroll setting [$1411] = 0 (probably: no normal scrolling) $1412 Layer 1 vertical scroll setting byte Vertical scroll setting from the level header (vertical level flag). Set while loading a level, read by the scroll routine to allow vertical scrolling.
5 uses in 3 routines (2 read, 3 write) W $05:85C7 STA.W $1412 ; [$1412] = scroll setting W $05:D9B5 STA.W $1412 ; [$1412] = 1 (probably the vertical level flag) $1413 Layer 2 horizontal scroll mode byte Horizontal scroll setting for layer 2, loaded from DATA_05D720 at level load; cleared by scroll sprites. Read by the scroll routine (0 = scrolls with the screen).
4 uses in 3 routines (1 read, 3 write) W $05:C022 STZ.W $1413 ; Layer 1 vertical scroll setting [$1413] = 0 (probably: no normal scrolling) W $05:D919 STA.W $1413 ; [$1413] = DATA_05D720[X] (probably horizontal scroll setting) $1414 Layer 2 vertical scroll mode byte Vertical scroll setting for layer 2, loaded from DATA_05D710 at level load; cleared by scroll sprites. Read by level start setup and the scroll routine (0 = scrolls with the screen).
6 uses in 4 routines (3 read, 3 write) R $00:A798 LDY.W $1414 ; Y = [$1414] (probably layer 2 vertical scroll mode) W $05:D920 STA.W $1414 ; [$1414] = DATA_05D710[X] (probably vertical scroll setting) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:A7B6 STA.W $1417 ; [$1417] = A (initial layer 2 Y offset, probably) R $00:F7BD ADC.W $1417 ; Add the layer 2 Y offset [$1417] $1419 Yoshi / pipe entry flag RAM_YoshiInPipe flag byte Marks Mario entering a pipe while Yoshi is involved. Set to 1 (horizontal) or 2 (vertical) on pipe entry, cleared in level start and the pipe animations. Read by the Yoshi routines, carried sprites and kicks.
Values: 0 = none, 1 = horizontal pipe, 2 = vertical pipe.
18 uses in 12 routines (12 read, 6 write) W $00:A68F STZ.W RAM_YoshiInPipe ; Clear Yoshi-in-pipe flag [$1419] W $00:A723 STA.W RAM_YoshiInPipe ; Yoshi-in-pipe [$1419] = $FF W $00:D26D STZ.W RAM_YoshiInPipe ; Clear behind-scenery and Yoshi-in-pipe flags W $00:F431 STX.W RAM_YoshiInPipe ; [$1419] = 1 (horizontal) or 2 (vertical): entering a pipe $141A Level entered via screen exit counter Non-zero when the level was entered through a screen exit rather than from the overworld. Incremented by the forced screen exit and the vertical pipe animation; read by level load, level header parse, Mario Start and the music upload (skips it if non-zero).
12 uses in 9 routines (10 read, 2 read-modify-write) R $05:D7AB LDA.W $141A ; A = [$141A] (non-zero: level is entered through a screen exit, not from the overworld) RW $05:DBC5 INC.W $141A ; [$141A]++ (level entered through a screen exit) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:A671 STA.W $141B ; [$141B] = that non-zero value (probably a persistent level effect flag) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) $141D Level start skip flag flag byte Non-zero skips the Mario Start text and (with $141A and $0109 ) the music upload. Incremented by the scripted walk animation when it finishes (probably). Read by level setup and level load.
6 uses in 6 routines (5 read, 1 read-modify-write) R $00:8143 ORA $141D ; Skip the upload if [$0109], [$141A] or [$141D] is non-zero (probably music already loaded) R $00:9699 ORA.W $141D ; A = [$141A] | [$141D] | [$0109] RW $00:C8FB INC.W $141D ; [$141D]++ (probably flags that the walk-in finished) $141E Yoshi has wings RAM_YoshiHasWings flag byte Non-zero when Yoshi has wings. Set to 2 by the tongue and contact code, cleared when wings are lost, the baby Yoshi swallows, or the level ends. Read by the pose, cape flight and scroll routines.
Values: 0 = no wings, 2 = wings.
11 uses in 9 routines (4 read, 7 write) W $00:FC38 STZ.W RAM_YoshiHasWings ; No Yoshi wings W $01:A2B8 STZ.W RAM_YoshiHasWings ; No Yoshi wings W $01:EBD3 STZ.W RAM_YoshiHasWings ; Clear real winged flag (set again by the wing tile) W $01:F152 STA.W RAM_YoshiHasWings ; Yoshi has wings ([$141E] = 2) W $01:F198 STA.W RAM_YoshiHasWings ; [$141E] = bit 1 of A: Yoshi has wings W $01:F6D4 STA.W RAM_YoshiHasWings ; Yoshi has wings = 2 W $03:C05F STZ.W RAM_YoshiHasWings ; Yoshi has no wings $141F Level start skip flag 2 flag byte Set while loading a level and tested with $141D and $141A in level start setup to skip the Mario Start screen.
3 uses in 2 routines (2 read, 1 write) R $00:A6A7 ORA.W $141F ; [$141D] | [$141A] | [$141F] non-zero: go to A6CC No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) R $00:F377 LDA.W $1420 ; A = [$1420]: Yoshi coins collected in a row $1421 Tile sequence counter counter Counts through a run of four consecutive block types ($6F-$72) in block interaction; compared with the touched tile to ignore repeats, and wraps when it reaches 4.
4 uses in 1 routine (3 read, 1 write) R $00:F29A CMP.W $1421 ; Touched the one before the counter: ignore W $00:F2A9 STA.W $1421 ; Store [$1421], the checkpoint progress counter $1422 Yoshi coins collected counter (byte) Number of Yoshi (dragon) coins Mario has collected in the current level. Incremented by the block/coin interaction code when a Yoshi coin is touched and read by the status bar to draw the coin count, and by the end-of-level code.
Values: 0 = none collected.
4 uses in 3 routines (3 read, 1 read-modify-write) R $00:F346 LDA.W $1422 ; [$1422]++ : Yoshi coins collected in this level $1423 Switch palace color byte (switch palace block/color index) Which switch palace colour is involved. Cleared to 0 on pipe entry; set by the P-switch/coin tile routine to (tile - $EC + 1) when a switch palace tile is processed, and read by Mario block collision to pick the block side.
Values: 0 = none; 1.. = colour of the switch palace block.
3 uses in 3 routines (1 read, 2 write) R $00:EE8F LDX.W $1423 ; X = [$1423] (switch palace block side) W $00:F467 STZ.W $1423 ; [$1423] = 0: switch palace color flag W $00:F567 STA.W $1423 ; [$1423] = tile - $EC + 1 (switch palace color) $1424 Course clear delay timer timer (byte) Delay used by the level-end tally. The tally state machine loads it with $28 before moving to the next state, and course clear state 1 (bonus star line) counts it down. State 2 also reads it to test the saved star count (0 = no stars to count up). Both uses are inside the course clear sequence.
4 uses in 3 routines (1 read, 2 write, 1 read-modify-write) W $05:CD2D STA.W $1424 ; Delay [$1424] = $28 before the next state RW $05:CD7B DEC.W $1424 ; Count down the delay timer [$1424] W $05:CDDD STA.W $1424 ; [$1424] = bonus star count (restarts the delay) R $05:CFA4 LDA.W $1424 ; [$1424] (star count saved in state 1) = 0? $1425 Bonus game flag flag byte Probably the 'play the bonus game after this level' flag. The status bar code sets it to $FF when enough bonus stars have been collected, and the cutscene level list also sets it to $FF. Level loading, game mode 14 and the Mario Start routines read it to decide whether the level ends in the bonus game.
Values: 0 = no bonus game; $FF = go to the bonus game.
11 uses in 9 routines (9 read, 2 write) R $00:8134 LDA $1425 ; Entry from the Mario Start game mode: [$1425] (probably bonus game flag) W $00:8F67 STA.W $1425 ; [$1425] = $FF: play the bonus game when the level ends R $00:9691 LDA.W $1425 ; A = [$1425] (bonus game flag, probably) W $00:C9E8 STX.W $1425 ; Yes: [$1425] = $FF $1426 Message box trigger byte (message number) Which message box is showing. Mario's scripted walk and the message-trigger sprites ($19/$3E) increment it to start a box, Yoshi sets it to 3 for his message, and the message box routine clears it to 0 when the box closes.
Values: 0 = no message box; 1 = message 1; 2 = message 2; 3 = Yoshi message.
8 uses in 7 routines (3 read, 3 write, 2 read-modify-write) RW $00:C967 INC.W $1426 ; [$1426]++ (show the message box) RW $01:E76B INC.W $1426 ; [$1426]++ (trigger the message box) W $01:EC3D STA.W $1426 ; Show a message box: [$1426] = 3 (Yoshi message) W $05:B11D STZ.W $1426 ; Box closed: no message box active ([$1426] = 0) $1427 Bowser animation mode byte Bowser's drawing/animation mode, used by the Mode 7 tilemap routine that positions his picture. Cleared to 0 by the main Bowser logic, set by the hurt reaction, and set to 3 while he bounces on the floor (phase 9).
5 uses in 4 routines (1 read, 3 write, 1 read-modify-write) RW $03:A317 INC.W $1427 ; [$1427] = 1 while the timer runs W $03:AB66 STA.W $1427 ; Bowser animation/drawing mode [$1427] = 3 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $03:A282 STA.W $1429 ; [$1429] = DATA_03A265[Y] (Bowser animation frame, probably) R $03:E036 LDX.W $1429 ; X = [$1429] (probably Bowser's phase / palette row) $142A Static camera region centre word (little endian, low/high pair) Horizontal centre of the region in which Mario can move without scrolling the screen. Initialised to $0080 at level start; L/R scrolling moves it. Scroll code derives the left and right scroll lines [$142C ] and [$142E ] from it. Bit 0 is cleared when L/R scrolling is active (TRB).
Values: $0080 = default centre.
9 uses in 3 routines (6 read, 2 write, 1 read-modify-write) W $00:A7BC STA.W $142A ; [$142A] = $0080: initial position of the static camera region RW $00:CE24 TRB.W $142A ; Clear bit 0 of [$142A] W $00:CE70 STA.W $142A ; Store the camera region position $142C Left scroll line word (little endian, low/high pair) Mario's left scroll line, computed each frame as [$142A ] - $0C. [$142E ] is the right line ([$142A ] + $0C). Scroll code indexes it with Y (0 = left, 2 = right) to get Mario's distance from the line; zero = no scroll.
3 uses in 1 routine (2 read, 1 write) R $00:F72D SBC.W $142C,Y ; A = distance of Mario from the left or right scroll line; zero: no scroll R $00:F77C SBC.W $142C,Y ; [$02] = distance of Mario from the scroll line No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $1430 Sprite tile range, lower bound byte Set to $C4 by the level buffer setup. Together with $1431 it gives the Map16 tile range that the sprite vertical-check and map16 lookup treat specially (probably the slope/solid range sprites react to). Read by the sprite check as a lower bound (CMP).
3 uses in 2 routines (1 read, 2 write) W $05:820C STA.W $1430 ; [$1430] = $C4: lower bound of the Map16 tile range sprites react to (probably) $1431 Sprite tile range, upper bound byte Set to $CA by the level buffer setup. Upper bound (exclusive) of the Map16 tile range tested with $1430 ; the sprite map16 lookup applies the check only if [$1430 ] <= tile < [$1431 ].
3 uses in 2 routines (1 read, 2 write) R $01:92F4 CMP.W $1431 ; Else only if [$1430] <= tile < [$1431] W $05:8211 STA.W $1431 ; [$1431] = $CA: upper bound of that range (probably) W $05:8286 STA.W $1431 ; [$1430] = [$1431] = $FF (empties the sprite-reactive tile range) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) R $02:895C LDA.W $1432 ; Directional coins already active [$1432] RW $02:896C INC.W $1432 ; [$1432] = 1 (directional coins active) $1433 Iris / keyhole circle size byte Radius of the circular iris wipe window. The peace pose / iris-out effect sets it to $F0 and shrinks it; the screen layer setup stores new sizes; the iris half-width lookup and the keyhole code in the per-frame Mario state read it.
13 uses in 5 routines (9 read, 4 write) W $00:9440 STA.W $1433 ; Store the new circle size in [$1433] R $00:C499 LDA.W $1433 ; A = [$1433] (keyhole circle size) W $00:CA40 STA.W $1433 ; Iris-out radius [$1433] = $F0 W $00:CA71 STA.W $1433 ; [$1433] += A (iris radius) R $00:CA98 CMP.W $1433 ; [$01] = vertical distance to center; inside the circle? $1434 Keyhole timer timer (byte) Keyhole animation timer. The keyhole sprite sets it to $30 for the exit animation; the per-frame Mario state code stores into it and counts it, and level start tests it (with $13CF ) before choosing the setup path.
5 uses in 3 routines (3 read, 2 write) R $00:A739 ORA.W $1434 ; [$13CF] | [$1434] non-zero: go to A6E0 W $00:C4B7 STY.W $1434 ; Store Y in [$1434] W $01:E212 STA.W $1434 ; [$1434] = $30: keyhole exit animation timer No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) R $00:C496 LDX.W $1435 ; X = [$1435] (keyhole animation phase) RW $00:C4A4 INC.W $1435 ; Next phase: [$1435]++ $1436 Keyhole X position, low byte RAM_KeyHolePos1 byte Low byte of the keyhole X position (RAM_KeyHolePos1), written by the keyhole sprite ($01:E227) and by Mario animation 0 (together with $14B4 ). High byte is $1437 . Reused as the next free particle slot by the switch palace ! block particles routine, and written by the Mode 7 boss room platform code.
9 uses in 6 routines (4 read, 5 write) W $00:CD06 STA.W RAM_KeyHolePos1 ; Store the new X back in [$1436] and [$14B4] W $00:F971 STA.W RAM_KeyHolePos1 ; KeyHolePos1 ([$1436]) = A W $01:E227 STA.W RAM_KeyHolePos1 ; Keyhole X low -> [RAM_KeyHolePos1] R $04:F2AD LDX.W RAM_KeyHolePos1 ; X = [RAM_KeyHolePos1]: next free particle slot (reused as spawn counter) W $04:F309 STX.W RAM_KeyHolePos1 ; Save [RAM_KeyHolePos1] = slot counter R $04:F386 CPX.W RAM_KeyHolePos1 ; Compare with slot counter $1437 Keyhole X position, high byte byte High byte of the keyhole X position ([$1436 ] is the low byte), set by the keyhole sprite. Also reused as a spawn timer by the switch palace ! block particle routine.
4 uses in 2 routines (1 read, 2 write, 1 read-modify-write) W $01:E222 STA.W $1437 ; Keyhole X high -> [$1437] R $04:F29B LDA.W $1437 ; A = [$1437] (spawn timer) W $04:F30E STA.W $1437 ; Spawn timer [$1437] = $10 frames until next batch $1438 Keyhole Y position, low byte RAM_KeyHolePos2 byte Low byte of the keyhole Y position (RAM_KeyHolePos2), written by the keyhole sprite and Mario animation 0 (with $14B6 ). High byte is $1439 . The switch palace ! block particle routine reuses it to save the OAM offset.
9 uses in 6 routines (4 read, 5 write) W $00:CD11 STA.W RAM_KeyHolePos2 ; Store Y (low 4 bits cleared) in [$1438] and [$14B6] W $00:F97D STA.W RAM_KeyHolePos2 ; KeyHolePos2 ([$1438]) = A W $01:E232 STA.W RAM_KeyHolePos2 ; Keyhole Y low -> [RAM_KeyHolePos2] W $04:F304 STA.W RAM_KeyHolePos2 ; Save the OAM offset $1439 Keyhole Y position, high byte byte High byte of the keyhole Y position ([$1438 ] is the low byte), set by the keyhole sprite. Also reused as the effect phase by the switch palace ! block particle routine.
4 uses in 2 routines (2 read, 1 write, 1 read-modify-write) W $01:E22D STA.W $1439 ; Keyhole Y high -> [$1439] R $04:F290 LDY.W $1439 ; Y = [$1439]: switch palace block effect phase RW $04:F311 INC.W $1439 ; Phase [$1439]++ $143A Mario Start graphics upload flag flag byte Set to 1 by level start setup when the Mario Start! graphics are waiting to be sent by DMA; cleared to 0 in game mode 12. The NMI handler and NMI tail read it to decide whether to do that upload.
Values: 0 = nothing to upload; 1 = upload pending.
4 uses in 4 routines (2 read, 2 write) W $00:A5A2 STZ.W $143A ; [$143A] = 0: no Mario Start! graphics to upload W $00:A8BC STA.W $143A ; [$143A] = 1: Mario Start! graphics wait for DMA No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) R $00:9798 LDX.W $143B ; X = [$143B] (tile index) W $00:D0F5 STX.W $143B ; Death message [$143B] = X $143C Message animation position byte Animation position of the Mario Start / death message. The death routine sets it to $C0; game mode 11 reads it and updates it (value must be divisible by 4 per the source comment).
4 uses in 2 routines (2 read, 2 write) R $00:975D LDA.W $143C ; A = [$143C] (animation position) W $00:D0FA STA.W $143C ; Death message animation [$143C] = $C0 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 write, 1 read-modify-write) RW $00:9762 DEC.W $143D ; [$143D]-- (wait timer) W $00:D0FF STA.W $143D ; Death message timer [$143D] = $FF $143E Scroll sprite / cutscene number RAM_ScrollSprNum byte Shared byte. In levels it is the number of the active layer 2 scroll routine (RAM_ScrollSprNum), cleared at level load and set by 'start a scroll command sprite'. In the cutscene/ending code it is the sub-scene number, stepped to the next scene by the scripted cutscene movement.
28 uses in 10 routines (13 read, 12 write, 3 read-modify-write) RW $00:C725 INC.W RAM_ScrollSprNum ; Next cutscene step: [$143E]++ RW $00:C79D INC.W RAM_ScrollSprNum ; Next cutscene step: [$143E]++ RW $00:C7DA INC.W RAM_ScrollSprNum ; Next cutscene step: [$143E]++ W $02:AC55 STZ.W RAM_ScrollSprNum ; Scroll sprite number = 0 R $05:BCE9 LDA.W RAM_ScrollSprNum ; A = scroll routine number [$143E] W $05:BD43 STA.W RAM_ScrollSprNum ; [RAM_ScrollSprNum] = A (hedged: advance to next scroll command) W $05:BD85 STA.W RAM_ScrollSprNum ; [RAM_ScrollSprNum] = A W $05:BDE7 STA.W RAM_ScrollSprNum ; [RAM_ScrollSprNum] = A W $05:BE44 STA.W RAM_ScrollSprNum ; [RAM_ScrollSprNum] = A W $05:BEB3 STA.W RAM_ScrollSprNum ; [RAM_ScrollSprNum] = A W $05:BF17 STA.W RAM_ScrollSprNum ; [RAM_ScrollSprNum] = A W $05:BFA9 STA.W RAM_ScrollSprNum ; [RAM_ScrollSprNum] = A W $05:BFD8 STA.W RAM_ScrollSprNum ; [RAM_ScrollSprNum] = A (scroll sprite number, command in high byte) R $0C:D003 LDA.W RAM_ScrollSprNum ; Scene state driven by [$143E] (sub-scene number) W $0C:D02B STZ.W RAM_ScrollSprNum ; Timer expired: sub-scene = 0 R $0C:D0BC LDA.W RAM_ScrollSprNum ; Scene state: if sub-scene = 1, advance R $0C:D0C9 LDA.W RAM_ScrollSprNum ; Scene state: if a sub-scene is running... R $0C:D0D2 LDA.W RAM_ScrollSprNum ; Scene state (sub-scene 1 only): scroll screen down at speed 8 R $0C:D108 LDA.W RAM_ScrollSprNum ; Scene state (sub-scene 2 only): screen drifts and puff effect R $0C:D19C LDA.W RAM_ScrollSprNum ; Scene state: if sub-scene = 3, advance $143F Scroll command / cutscene timer timer (byte) Shared byte. In level scroll code, non-zero means a scroll command is already active (a new one is skipped). In cutscene code it is a frame countdown (animation timer, frame duration, scene wait) decremented per frame and acted on at zero. Cleared at level load.
31 uses in 14 routines (5 read, 16 write, 10 read-modify-write) R $02:A86D ORA.W $143F ; A scroll command is already active: skip this one W $0C:CB28 STA.W $143F ; [$143F] = 1: animation timer W $0C:CB4A STA.W $143F ; Reload the timer with 1 W $0C:CC94 STA.W $143F ; [$143F] = DATA_0CCC49[frame]: its duration RW $0C:CE48 DEC.W $143F ; Every 6 frames (timer $143F)... RW $0C:CF0F DEC.W $143F ; Count down the frame timer W $0C:CF25 STA.W $143F ; [$143F] = timer RW $0C:CF72 DEC.W $143F ; Scene state: wait 4 animation frames. Count down timer RW $0C:CFD3 DEC.W $143F ; Yes: count down the timer R $0C:D019 LDA.W $143F ; Sub-scene 2: while the timer is >= 8, draw the puff effect RW $0C:D03E DEC.W $143F ; Sub-scene 3: count down the timer RW $0C:D18F DEC.W $143F ; Count down the timer W $0C:D2A6 STA.W $143F ; [$143F] = 1 (countdown) W $0C:D2D2 STA.W $143F ; [$143F] = 3 (countdown) RW $0C:D2E6 DEC.W $143F ; Count down [$143F] $1440 Auto-scroll command / cutscene frame byte (shared meaning) Shared byte. In level scroll sprite code it is the current auto-scroll command for layer 1 ([$1441 ] is the layer 2 command); the path scroll sets [$1440 ]/[$1441 ] from a table. Also indexed as [$1440 +X] for the layer 2 ON/OFF switch stage index. In cutscene code it is an animation frame or timer ($FF = hidden/first frame).
59 uses in 15 routines (36 read, 21 write, 2 read-modify-write) R $05:BD39 LDA.W $1440 ; A = [$1440] (current auto-scroll command) W $05:BD49 STA.W $1440 ; Store new command number into [$1440]/[$1441] R $05:BD63 LDY.W $1440 ; Y = [$1440] (command for layer 1) R $05:BD7B LDA.W $1440 ; Unused. A = [$1440] R $05:BD90 LDY.W $1440 ; Y = [$1440] (layer 1 command) R $05:BDDD LDA.W $1440 ; Unused. A = [$1440] R $05:BDF2 LDY.W $1440 ; Y = [$1440] (layer 1 command) R $05:BE3A LDA.W $1440 ; Unused. A = [$1440] R $05:BE4F LDY.W $1440 ; Y = [$1440] (layer 1 command) R $05:BEC8 LDY.W $1440 ; Y = [$1440] (layer 1 command) R $05:BF22 LDY.W $1440 ; Y = [$1440] (layer 1 command) R $05:BF6A LDY.W $1440 ; Y = [$1440] (Layer 2 Smash phase) W $05:C012 STA.W $1440 ; [$1440]/[$1441] = word from table (path set for layer 1, layer 2 = 0) R $05:C036 LDY.W $1440 ; Y = [$1440] (path set number) RW $05:C6BF INC.W $1440 ; [$1440]++ (next stage) R $05:C793 LDY.W $1440,X ; Y = [$1440+X] (stage index) R $05:C955 LDX.W $1440 ; X = [$1440] (offset of the first range entry) W $0C:CB2B STZ.W $1440 ; Animation frame [$1440] = 0 W $0C:CB52 STA.W $1440 ; Toggle animation frame [$1440] between 0 and 1 W $0C:CC8D STA.W $1440 ; [$1440] = ([$1440] + 1) AND 3: next animation frame R $0C:CCB6 LDA.W $1440 ; A = [$1440] (animation frame; $FF = first frame) R $0C:CEE2 LDA.W $1440 ; Cutscene state: object falls and bounces, then plays a frame sequence W $0C:CF1F STA.W $1440 ; [$1440] = frame R $0C:CF49 LDY.W $1440 ; Y = [$1440] (frame, $FF = hidden) RW $0C:CF7C INC.W $1440 ; ...and advance animation frame W $0C:D29C STA.W $1440 ; [$1440] = $FF (timer) $1441 Layer 2 scroll command / timer byte (shared meaning) In scroll sprite code: the layer 2 command (companion of $1440 ), the shake timer for layer 3 handlers, the number of entries for the layer 2 smash. In cutscenes: a countdown ($30 loaded, decremented by the colour flash state).
19 uses in 6 routines (13 read, 4 write, 2 read-modify-write) R $05:BD6B LDY.W $1441 ; Layer 2: Y = [$1441] (command for layer 2) R $05:BD9B LDY.W $1441 ; Layer 2: Y = [$1441] R $05:BDFD LDY.W $1441 ; Layer 2: Y = [$1441] R $05:BE5A LDY.W $1441 ; Layer 2: Y = [$1441] R $05:BED3 LDY.W $1441 ; Layer 2: Y = [$1441] R $05:BF2D LDY.W $1441 ; Layer 2: Y = [$1441] R $05:C659 LDA.W $1441 ; A = [$1441] (shake timer) R $05:C958 LDY.W $1441 ; Y = [$1441] (number of entries) $1442 Scroll step / cutscene state byte table (index = layer offset) or byte Scroll sprites index it per layer (X = 0 layer 1, 4 layer 2) as the current path node or stage, incremented as each segment finishes. In cutscene and credits code it is the scene state/substate, incremented to advance the scene. Cleared at the start of a scene.
66 uses in 27 routines (28 read, 15 write, 23 read-modify-write) W $05:BD71 STA.W $1442,X ; [$1442+layer] = A W $05:BDAA STA.W $1442,X ; [$1442+layer] = A W $05:BE0C STA.W $1442,X ; [$1442+layer] = A W $05:BE69 STA.W $1442,X ; [$1442+layer] = A W $05:BEE2 STA.W $1442,X ; [$1442+layer] = A W $05:BF3C STA.W $1442,X ; [$1442+layer] = A RW $05:C118 INC.W $1442,X ; Segment too short: next path node, [$1442+n]++ R $05:C3A8 LDA.W $1442,X ; A = direction [$1442+n] W $05:C85A STA.W $1442 ; [$1442] |= [$140E]; zero: nothing triggered, return (go to $05C87D) W $0C:A3D3 STZ.W $1442 ; Scene substate [$1442] = 0 RW $0C:A475 INC.W $1442 ; Advance scene substate to 2 RW $0C:A5C6 INC.W $1442 ; Advance scene substate to 3 RW $0C:A670 INC.W $1442 ; [$1442] += 1: advance to the next scene stage R $0C:C9B9 LDA.W $1442 ; A = cutscene state [$1442] R $0C:C9CF LDA.W $1442 ; A = cutscene state [$1442] R $0C:C9E9 LDA.W $1442 ; A = cutscene state [$1442] R $0C:CA07 LDA.W $1442 ; A = cutscene state [$1442] R $0C:CA18 LDA.W $1442 ; A = cutscene state [$1442] R $0C:CA42 LDA.W $1442 ; A = cutscene state [$1442] R $0C:CA67 LDA.W $1442 ; A = cutscene state [$1442] R $0C:CA72 LDA.W $1442 ; A = cutscene state [$1442] R $0C:CACE LDA.W $1442 ; A = cutscene state [$1442] RW $0C:CBD3 INC.W $1442 ; Past the end: next cutscene state ([$1442]++) RW $0C:CC7C INC.W $1442 ; Next cutscene state RW $0C:CD8C INC.W $1442 ; Yes: advance to the next scene state RW $0C:CDFD INC.W $1442 ; Advance to the next scene state RW $0C:CF86 INC.W $1442 ; ...advance to the next scene state RW $0C:CFD8 INC.W $1442 ; Timer expired: advance to the next scene state W $0C:CFEE STZ.W $1442 ; Reset the scene state RW $0C:D043 INC.W $1442 ; Timer expired: advance to the next scene state RW $0C:D0C3 INC.W $1442 ; Advance to the next scene state RW $0C:D0F6 INC.W $1442 ; Moved far enough: advance to the next scene state RW $0C:D12F INC.W $1442 ; Advance to the next scene state RW $0C:D198 INC.W $1442 ; Advance to the next scene state RW $0C:D2A9 INC.W $1442 ; Next scene step ([$1442]++) RW $0C:D2DD INC.W $1442 ; Next scene step RW $0C:D314 INC.W $1442 ; Next scene step RW $0C:D331 INC.W $1442 ; Next scene step RW $0C:D580 INC.W $1442 ; Next scene step RW $0C:D5C6 INC.W $1442 ; Next scene step $1443 Text timer / scroll state byte (shared meaning) In the cutscene main entry it is the text timer (counts down; bits 7-5 select the text line). In the layer 2 smash scroll sprite it is added to [$1442 ] as a step index into the smash tables, and the ON/OFF switch stores its new state here. Also set to $FF by the rising/sideways sprites near Mario.
12 uses in 5 routines (8 read, 3 write, 1 read-modify-write) W $05:C738 STX.W $1443 ; Timer expired: [$1443] = new state R $05:C98F ADC.W $1443 ; Y = [$1442] + [$1443]: step index into the smash tables W $05:C9CD STA.W $1443 ; [$1443] = new phase offset R $0C:C94E LDA.W $1443 ; A = [$1443]: text timer (counts down; bits 7-5 select the text line) RW $0C:C953 DEC.W $1443 ; Count the timer down R $0C:CFDE LDA.W $1443 ; Final state: wait for [$1443] and [$144D] to be zero R $0C:CFF7 LDA.W $1443 ; Scene state: advance once [$1443] is set, then fall into the exit check $1444 Path segments left / flag byte table (index = layer offset) or flag Scroll sprites: number of path segments left for layer 1 (and [$1445 ] for layer 2), also an offset to the first table entry. Pause timer for the smash sprite. Overworld: non-zero when a tile step has started. Cutscenes: an object-active flag (1 = spawn the falling object).
23 uses in 10 routines (8 read, 12 write, 3 read-modify-write) R $04:9522 LDA.W $1444 ; [$1444] (a tile step has been started) non-zero? W $04:968A STA.W $1444 ; [$1444] = 1: a tile step is in progress W $05:BD77 STA.W $1444,X ; [$1444+layer] = A W $05:BDD9 STA.W $1444,X ; [$1444+layer] = $FF W $05:C03C STA.W $1444 ; [$1444] = segments left, layer 1 R $05:C053 LDA.W $1444,X ; Segments left on the path for this layer RW $05:C11D DEC.W $1444,X ; One segment fewer left, [$1444+n]-- R $05:C1B4 LDA.W $1444,X ; A = timer [$1444+n] W $05:C203 STA.W $1444,X ; Timer [$1444+n] = $30 R $05:C827 LDX.W $1444 ; X = [$1444] (offset of the first entry) W $05:C978 STZ.W $1444 ; Pause timer [$1444] = 0 RW $05:C987 DEC.W $1444 ; Pause timer [$1444] running: count it down and return W $05:C9B4 STA.W $1444 ; Pause timer [$1444] = [$05C934+X] W $0C:CAD3 STZ.W $1444 ; State 0: clear the object flag [$1444] W $0C:CD56 STA.W $1444 ; Yes: [$1444] = 1 (flag: spawn the falling object sprite) W $0C:D27F STA.W $1444 ; [$1444] = 1: flag that the final patch was queued $1445 Path segments left / step counter byte (shared meaning) Scroll sprites: segments left for layer 2, number of range entries, wait timer for the ON/OFF switch. Cutscenes and Mario cutscene animation: a step counter, incremented by script command $21 or counted down as an animation tick.
14 uses in 10 routines (6 read, 4 write, 4 read-modify-write) RW $00:C7A4 INC.W $1445 ; Command $21: [$1445]++ W $05:C042 STA.W $1445 ; [$1445] = segments left, layer 2 RW $05:C733 DEC.W $1445 ; Switch flipped: wait timer [$1445]-- W $05:C74C STA.W $1445 ; Wait timer [$1445] = $10 R $05:C820 LDY.W $1445 ; [$00] = [$1445] (number of range entries) W $0C:CA0E STY.W $1445 ; State 0: [$1445] = 4 R $0C:CFC5 LDA.W $1445 ; Scene state: A = [$1445] RW $0C:D66B DEC.W $1445 ; [$1445] -= 1 (animation tick) R $0C:D795 LDX.W $1445 ; X = step [$1445] RW $0C:D7C9 INC.W $1445 ; Next step [$1445]++ $1446 Layer scroll speed X / active flag byte table (index = layer offset, X = 0 or 4) Horizontal scroll speed word for layers 1/2 used by the scroll sprites, whose sub-pixel accumulator is [$144E ]; cleared when a path ends. Credits scroll stores speeds here. In cutscenes it is a non-zero flag for the rope column and the rising sprite being active.
37 uses in 10 routines (16 read, 20 write, 1 read-modify-write) W $00:C7C5 STA.W $1446 ; Command $24: [$1446] = $38 W $05:BDC9 STZ.W $1446,X ; [$1446+X] = 0 (shared entry) W $05:C05B STZ.W $1446,X ; Path finished: stop horizontal scroll speed [$1446+L] R $05:C17A CMP.W $1446,X ; Compare with the current speed [$1446+L+axis] R $05:C3EA CMP.W $1446,X ; Compare with the current X speed [$1446+L] R $05:C500 ADC.W $1446,X ; [$144E+X] = ([$144E+X] & $FF) + speed [$1446+X]: sub-pixel accumulator W $05:C6C2 STZ.W $1446 ; [$1446] = 0 (stop) W $0C:9F71 STA.W $1446,X ; Speed 0 = $FF80 (-0.5 pixel/frame, 8.8 fixed point) W $0C:9F8B STA.W $1446,X ; Speed 1 = $0040 (+0.25 pixel/frame) R $0C:D4F8 LDA.W $1446 ; Is the rising sprite active? ([$1446]) R $0C:D557 LDA.W $1446 ; Is the sideways sprite active? ([$1446]) W $0C:D57D STZ.W $1446 ; Finished: [$1446] = 0 R $0C:D6FC LDA.W $1446 ; Rope-column active? ([$1446] != 0) $1447 Cutscene fall speed / timer byte Cutscene object timer and Y speed: the castle scene increases the fall speed by 2, the effects state decrements it, and the frame sequence steps it to the next table entry on expiry. Cleared by the scene step routine.
13 uses in 4 routines (6 read, 6 write, 1 read-modify-write) R $0C:CDA7 LDA.W $1447 ; ...increase fall speed [$1447] by 2... R $0C:CDC5 LDA.W $1447 ; Actor 0 Y speed = [$1447] R $0C:CF14 LDA.W $1447 ; Timer expired: step [$1447] to the next entry of the sequence RW $0C:D10F DEC.W $1447 ; [$1447] -= 1 (acts as timer and Y speed) R $0C:D149 LDA.W $1447 ; Actor 0 Y speed = [$1447] $1448 Layer Y scroll speed byte table (index = layer offset, X = 0 or 4) Vertical scroll speed for layer 1 (X = 0) and layer 2 (X = 4) set by the scroll sprite code; cleared on init. Sub-pixel accumulator is [$1450 ]. Layer 3 handlers copy the layer 1 speed here.
19 uses in 3 routines (6 read, 13 write) W $05:BDCC STZ.W $1448,X ; [$1448+X] = 0 W $05:BE31 STZ.W $1448,X ; Clear $1446, $1448 and $1450 + X W $05:BE81 STZ.W $1448,X ; Clear $1446, $1448 and $144E + X W $05:BF61 STZ.W $1448,X ; [$1448+X] = 0 W $05:BF64 STZ.W $1448,X ; [$1448+X] = 0 (redundant duplicate) W $05:C20B STZ.W $1448,X ; Y speed [$1448+L] = 0 R $05:C26D CMP.W $1448,X ; Compare with the current speed [$1448+L] R $05:C30A CMP.W $1448,X ; Compare with the current Y speed [$1448+L] W $05:C6DE STA.W $1448 ; Layer 1 Y speed [$1448] = the same W $05:C6E9 STZ.W $1448 ; Layer 1 Y speed = 0 $1449 Rope column pause timer timer (byte) Pause timer for the three-tile sprite and rope column in the cutscene code; counted down each frame, and the routine returns while it is non-zero.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) RW $0C:D7A5 DEC.W $1449 ; Pause timer [$1449]: count down and return W $0C:D7E7 STA.W $1449 ; Pause timer [$1449] = $10 $144A Scroll / cutscene object index byte Cleared by the scroll sprite init routines. Read by the layer 2 ON/OFF switch, and by cutscene code as an index X for the carried item sprite and the accessory/rope column draw. Exact purpose differs per user (probably a sprite or object index).
9 uses in 7 routines (5 read, 3 write, 1 read-modify-write) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) RW $0C:D84C INC.W $144B ; [$144B]++ (bobbing frame) $144C Layer 2 Y speed byte Layer 2 vertical scroll speed (layer 1 uses [$1448 ]). Cleared by scroll sprites (ON/OFF switch, sink or rise, init, and path scroll). The carried item / Mario exit walk also writes it.
17 uses in 6 routines (5 read, 12 write) W $05:C6E6 STZ.W $144C ; Layer 2 Y speed = 0 W $05:C846 STZ.W $144C ; Layer 2 Y speed = 0 W $05:C875 STA.W $144C ; Store layer 2 Y speed [$144C] $144D Cutscene delay timer timer (byte) Delay counted down every 4th frame by the cutscene main entry while non-zero. The rising/sideways sprite code sets it to $D0; the final scene state waits for it and [$1443 ] to be zero (text and fade finished). Also cleared by the layer 2 ON/OFF switch scroll sprite.
5 uses in 4 routines (2 read, 2 write, 1 read-modify-write) W $05:C746 STZ.W $144D ; Layer 2 Y speed [$144C] = 0 RW $0C:C997 DEC.W $144D ; Every 4th frame: count down the delay timer [$144D] if it is not 0 R $0C:CFE1 ORA.W $144D ; (text and fade finished) $144E Scroll sub-pixel / limit, idle timer byte table (X/Y = layer offset) or timer Scroll sprites: sub-pixel accumulator for horizontal scroll (low byte plus speed [$1446 ]) and, indexed by Y, a position limit compared against [$1462 +Y]. Credits scroll uses it as an accumulator. Overworld walk: idle timer. Ending scene: walk animation timer (6). Overworld load sets it to $0F (purpose unclear).
28 uses in 9 routines (10 read, 16 write, 2 read-modify-write) W $04:8D99 STA.W $144E ; [$144E] = $0F (purpose unclear) RW $04:926E DEC.W $144E ; Idle timer [$144E]-- W $04:9408 STA.W $144E ; [$144E] = $0F (idle timer) W $05:BD57 STZ.W $144E,X ; Clear this layer's scroll speed/subpixel words ($1446, $1448, $144E, $1450 + X) W $05:BDC3 STA.W $144E,X ; [$144E+X] = A (hedged: layer position/speed) W $05:BE2B STA.W $144E,X ; [$144E+X] = A (hedged: layer Y target) W $05:BF04 STZ.W $144E,X ; [$144E+X] = 0 W $05:BF5B STA.W $144E,X ; [$144E+X] = A (hedged: layer Y target) R $05:C1E0 CMP.W $144E,Y ; Compare with the limit R $05:C247 ADC.W $144E,X ; Move the limit: [$144E+L] += [$00] R $05:C5C9 CMP.W $144E,Y ; A = position [$1464+Y]; compare with [$144E+Y] R $05:C61B ADC.W $144E,X ; Turnaround point [$144E+X] += [$00] W $0C:9FD5 STA.W $144E,X ; Accumulator = low byte + speed RW $0C:A2A3 DEC.W $144E ; Count down the walk-animation timer W $0C:A2AA STA.W $144E ; Reload timer = 6 frames W $0C:A3EB STA.W $144E ; Walk animation timer = 6 $144F Walk frame toggle byte Credits scene walk frame: toggled between 0 and 1 by the substate 0 routine, reset to 0 when the actors are initialised.
4 uses in 2 routines (2 read, 2 write) W $0C:A2B2 STA.W $144F ; Toggle walk frame [$144F] between 0 and 1 $1450 Layer Y scroll sub-pixel / limit byte table (X/Y = layer offset) Scroll sprite data cleared on init: layer sub-pixel accumulator for vertical scroll, and a limit compared against the position [$1464 +Y]. Layer 3 handler compares [$1462 +Y] with it.
13 uses in 3 routines (4 read, 9 write) W $05:BDC6 STZ.W $1450,X ; [$1450+X] = 0 W $05:BE7B STA.W $1450,X ; [$1450+X] = A W $05:BF01 STA.W $1450,X ; [$1450+X] = A (hedged: layer X target) W $05:BF5E STZ.W $1450,X ; [$1450+X] = 0 W $05:C20E STZ.W $1450,X ; [$1450+L] = 0 R $05:C52D CMP.W $1450,Y ; A = position [$1462+Y]; compare with [$1450+Y] R $05:C57F ADC.W $1450,X ; Turnaround point [$1450+X] += [$00] No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $05:BFED STZ.W $1452 ; Clear all scroll speed/accumulator words $1446-$1454 W $05:C02D STZ.W $1452 ; Clear the remaining per-layer scroll sprite words $144A, $144C, $1452, $1454 $1454 Layer 2 Y sub-pixel byte Layer 2 vertical sub-pixel position. Only ever cleared (0) by the scroll sprite init, path scroll and the sink or rise sprite.
4 uses in 3 routines (4 write) W $05:C849 STZ.W $1454 ; Layer 2 Y sub-pixel = 0 $1456 Scroll layer offset byte (0 or 4) Which layer the scroll routines are currently processing, used as an X/Y offset into the per-layer tables. Set to 0 for the layer 1 phase and 4 for the layer 2 phase by the scroll run routine.
Values: 0 = layer 1; 4 = layer 2.
67 uses in 8 routines (62 read, 5 write) W $05:BC76 STZ.W $1456 ; [$1456] = 0: layer 1 phase W $05:BCA7 STA.W $1456 ; [$1456] = 4: layer 2 phase R $05:BD4C LDX.W $1456 ; X = [$1456]: layer offset (0 = layer 1, 4 = layer 2) R $05:BD66 LDA.W $1456 ; A = [$1456]: which layer? R $05:BDB9 LDX.W $1456 ; X = [$1456]: layer offset (0 or 4) R $05:BE1A LDX.W $1456 ; X = [$1456]: layer offset R $05:BE6D LDX.W $1456 ; X = [$1456]: layer offset R $05:BEF7 LDX.W $1456 ; X = [$1456]: layer offset R $05:BF51 LDX.W $1456 ; X = [$1456]: layer offset R $05:C058 LDX.W $1456 ; X = [$1456]: layer offset (0 or 4) R $05:C173 ADC.W $1456 ; X = [$1456] + axis: index of this axis' variables R $05:C521 LDY.W $1456 ; Y = [$1456] (0 = layer 1 slot, 4 = layer 2 slot) R $05:C5BD LDY.W $1456 ; Y = [$1456] (0 = layer 1 slot, 4 = layer 2 slot) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) R $0C:A358 LDA.W $1457 ; Characters drawing enabled? W $0C:A3CE STA.W $1457 ; [$1457] = 1: characters drawing enabled $1458 Pose / layer X speed byte (shared meaning) Credits scene: the pose number of the actors, set from actor speeds and counted down by the ending. Layer 3 scroll handler: X speed added to the sub-pixel accumulator [$145C ]. Cleared at level load and credits init.
27 uses in 6 routines (18 read, 7 write, 2 read-modify-write) R $05:C462 ADC.W $1458 ; [$145C] = ([$145C] & $FF) + [$1458]: sub-pixel accumulator W $0C:A355 STY.W $1458 ; Pose [$1458] = [Y]: chosen from the vertical speed of actor 1 W $0C:A454 STA.W $1458 ; Landed on pose 0: start the landing animation (pose 8) W $0C:A472 STA.W $1458 ; Pose = $0A (hold the last pose) RW $0C:A69D DEC.W $1458 ; [$1458] -= 1: scene animation phase $1459 Pose timer timer (byte) Pose timer for the credits scene, set to 6 when initialised and reloaded to 6 by the eggshell routine; decremented by the landing pose animation.
5 uses in 3 routines (3 write, 2 read-modify-write) W $0C:A3F6 STA.W $1459 ; Pose timer [$1459] = 6 W $0C:A463 STA.W $1459 ; Reload pose timer = 6 W $0C:A69A STA.W $1459 ; Reload [$1459] = 6 $145A Layer 3 Y speed / visible mask byte (shared meaning) Layer 3 scroll handler: speed value (multiplied by 16 into the accumulator [$145C ]). Credits: bit mask of which of the seven actors are visible, set by 'release the seven actors' and used by the egg drawing. Cleared on init.
7 uses in 4 routines (4 read, 2 write, 1 read-modify-write) RW $0C:A5A2 TSB.W $145A ; Set this actor's bit in the visible mask [$145A] $145B Ending wait timer word (little endian, low/high pair) Ending timer. The enemy scene sets it to $00FF as a hold time once the layers meet; the mode entry code counts it down and the release routine uses it as the number of actors released so far.
10 uses in 4 routines (4 read, 2 write, 4 read-modify-write) RW $0C:93B0 DEC.W $145B ; Count down the wait timer [$145B] R $0C:A54A LDY.W $145B ; Y = number of actors released so far W $0C:AEA6 STA.W $145B ; [$145B] = $00FF: hold time in frames once the layers have met RW $0C:AEB6 DEC.W $145B ; Bowser: only count down the hold timer RW $0C:AECA DEC.W $145B ; Layers met: count down the hold timer $145C Layer 3 sub-pixel accumulator word (little endian, low/high pair) Sub-pixel accumulator for layer 3 scroll: ([$145C ] & $FF) + [$1458 ], and [$145A ] * 16 added, carry kept. Also tested by the ending as 'release in progress'. Cleared at level load.
9 uses in 4 routines (4 read, 5 write) R $05:C4D5 ADC.W $145C ; [$145C] += [$145A] * 16 (sub-pixel accumulator, carry kept) R $0C:A532 LDA.W $145C ; [$145C]: release in progress? W $0C:A556 STA.W $145C ; [$145C] = X + 1: release in progress $145D Ending stage delay timer (byte) Delay timer before the next stage of the ending eggshell/Yoshi scene; loaded with $F0.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) W $0C:A675 STA.W $145D ; [$145D] = $F0: delay timer before the next stage R $0C:A713 LDA.W $145D ; [$145D] -= 1: stage timer; when it hits 0 go to the next game mode $1460 Layer 3 direction byte Direction value for the layer 3 scroll handler, loaded into Y as an index. Cleared/set at scroll sprite init and updated by the layer 3 handler.
4 uses in 2 routines (2 read, 2 write) R $05:C49C LDY.W $1460 ; Y = [$1460] (direction) $1462 Layer 1 X position mirror word (little endian, low/high pair); also byte table at $1462+X Copy of layer 1 (main level) X scroll position kept for the scroll sprites and scroll deltas. Level start copies the layer positions $001A -$0021 to $1462 -$1469 (previous positions); the scroll code subtracts it to get frame deltas ($17BD ) and layer 2's position relative to layer 1 ([$26 ] = [$1466 ] - [$1462 ]). Scroll sprites index $1462 +X as the X position of the layer they move; Mario's left level border check uses it. The ending enemy scene and boss rooms set it to 0. High byte is $1463 .
32 uses in 12 routines (20 read, 12 write) W $00:96FC STA.W $1462,X ; Copy layer positions [$1A]-[$21] to $1462-$1469 (previous positions) W $00:981A STZ.W $1462 ; Mirror of layer 1 X = 0 W $00:9930 STZ.W $1462 ; Mirror of layer 1 X = 0 R $00:E9C5 CMP.W $1462 ; Compare Mario X - 8 with [$1462] (left border) R $00:F7C7 SBC.W $1462 ; [$17BD] = layer 1 X scroll delta this frame W $00:F7EC STA.W $1462,X ; Copy the 8 scroll position bytes [$1A]-[$21] to [$1462]-[$1469] (previous frame) R $05:BC55 SBC.W $1462 ; [$26] = [$1466] - [$1462]: layer 2 X relative to layer 1 R $05:BC62 SBC.W $1462 ; [$26] = [$22] - [$1462]: layer 3 X relative to layer 1 R $05:BEFB ADC.W $1462,X ; A += [$1462+X] (layer X position) R $05:C07C LDA.W $1462,X ; A = [$1462+L]: layer X position W $05:C1A0 STA.W $1462 ; Layer 1 X position [$1462] = layer 2 X position [$1466] R $05:C38A ADC.W $1462,X ; Layer X position [$1462+L] += A R $05:C510 ADC.W $1462,X ; Position [$1462+X] += pixels moved R $05:C700 LDA.W $1462 ; A = [$1462] (low byte; B kept) W $0C:AE7D STZ.W $1462 ; Opposite-direction scroll X $1462 (used by sprites with prop bit 5) = 0 W $0C:AE92 STA.W $1462 ; Mirror X $1462 = $0100 (starts $100 pixels to the right, moves the other way) R $0C:AEC0 CMP.W $1462 ; Has Layer 1 X reached the opposite-moving X (layers met at 0)? R $0C:B5E5 LDY.W $1462 ; Yes: scroll with [$1462] (the opposite-moving group) instead No description written yet. The instructions below show how it is used.
2 uses in 1 routine (2 read) R $05:C6BA CPY.W $1463 ; Layer 1 X screen [$1463] = last screen ([$5E] - 1)? Else go to $05C6EC $1464 Layer 1 Y position mirror word (little endian, low/high pair); also byte table at $1464+X Copy of layer 1 (main level) Y scroll position used by the scroll sprites and scroll-delta code. The scroll code subtracts it to get the layer 1 Y delta ($17BC ) and layer 2's Y relative to layer 1 ([$28 ]). Scroll sprites index $1464 +X as the Y position of the layer they move. Set to $FF90 at Mario Start and to 0 for boss room Mode 7 setup. High byte is $1465.
18 uses in 7 routines (14 read, 4 write) W $00:9822 STA.W $1464 ; Mirror of layer 1 Y = $FF90 W $00:9935 STZ.W $1464 ; Mirror of layer 1 Y = 0 R $00:F7D0 SBC.W $1464 ; [$17BC] = layer 1 Y scroll delta this frame R $05:BC6A SBC.W $1464 ; [$28] = A - [$1464]: Y relative to layer 1 R $05:BDBD ADC.W $1464,X ; A += [$1464+X] (layer Y position) R $05:BE28 ADC.W $1464,X ; A += [$1464+X] (layer Y position) R $05:BF55 ADC.W $1464,X ; A += [$1464+X] (layer Y position) R $05:C081 LDA.W $1464,X ; A = [$1464+L]: layer Y position R $05:C1DD LDA.W $1464,Y ; A = layer Y position R $05:C2DF ADC.W $1464,X ; Layer Y position [$1464+L] += A $1466 Layer 2 X position mirror word (little endian, low/high pair) Layer 2 (background) X scroll position as tracked by the layer 2 scroll sprites ($1462 is the layer 1 version). Zeroed by scroll sprite init and the ending scene. The ON/OFF switch scroll sprite adds layer 1's X movement ($17BD ) to it; the scroll code derives the layer 2 X delta ($17BF ) and [$26 ] from it. Read by the layer 2 sink/rise and smash scroll sprites. High byte is $1467.
16 uses in 9 routines (8 read, 7 write, 1 read-modify-write) R $00:F7D9 SBC.W $1466 ; [$17BF] = layer 2 X scroll delta (positive = scrolled left) R $05:C7E7 ADC.W $1466 ; Layer 2 X [$1466] += [$17BD] (layer 1 X movement, sign-extended) W $0C:AE80 STZ.W $1466 ; Layer 2 mirror X $1466 = 0 W $0C:AEA0 STA.W $1466 ; Layer 2 mirror X $1466 = $0080 RW $0C:AEE9 DEC.W $1466 ; Layer 2 mirror X $1466 -= 1 $1468 Layer 2 Y position mirror word (little endian, low/high pair) Layer 2 (background) Y scroll position as tracked by the layer 2 scroll sprites ($1464 is the layer 1 version). The smash scroll sprite starts it at $00C1 ; the sink/rise sprite starts it from a start-height table. Read by the scroll code to derive the layer 2 Y delta ($17BE ) and by the ON/OFF switch and layer 3 handlers. High byte is $1469.
16 uses in 7 routines (11 read, 5 write) R $00:F7E2 SBC.W $1468 ; [$17BE] = layer 2 Y scroll delta R $05:BC5A LDA.W $1468 ; A = layer 2 Y ([$1468]) R $05:BF8F LDA.W $1468 ; A = [$1468] (layer 2 Y position) W $05:C843 STA.W $1468 ; Layer 2 Y [$1468] = start height (DATA_05C80E) W $05:C975 STA.W $1468 ; Layer 2 Y [$1468] = $00C1 (start position) W $05:C9AC STA.W $1468 ; Snap layer 2 Y [$1468] to the target $146A Ending scene layer mirror word (little endian, low/high pair) Only seen written (set to 0) by the ending enemy scene setup, together with $1462 and $1466 . It sits in the layer position mirror block $1462 -$1469 area, but no reader was found; its purpose is probably just clearing a layer 3 position mirror (uncertain).
3 uses in 1 routine (3 write) W $0C:AE83 STZ.W $146A ; Mirror X $146A = 0 W $0C:AE95 STA.W $146A ; Mirror X $146A = $0100 W $0C:AEE4 STA.W $146A ; Mirror X $1462 -= 2; $146A = $1462 (moves the opposite way) $1470 Carrying sprite this frame flag byte Set when Mario is carrying a sprite (or picks one up). Set to 1 by the kick/carry pose start and incremented when Mario grabs a sprite by bouncing/pressing on it ($01AA6B, which also sets the sprite's status to carried). Each frame, before sprites run, it is loaded from $148F (last frame's carry flag). Read together with Yoshi riding to stop some pickups (line guide, springboard, Yoshi code).
Values: 0 = not carrying; non-zero = carrying.
7 uses in 6 routines (4 read, 2 write, 1 read-modify-write) W $01:8092 STA.W $1470 ; [$1470] = [$148F]: remember whether Mario carried a sprite last frame W $01:A12B STA.W $1470 ; [$1470] = 1 (carrying enemy flag) RW $01:AA6B INC.W $1470 ; Set carrying flag [$1470] $1471 Mario standing on sprite state byte Non-zero when Mario is standing on a sprite platform this frame (platforms, springboards, Lakitu cloud, bounce blocks, skull raft, chained platform...). Cleared to 0 at the start of the sprite run each frame; the platform's code sets it again when it carries Mario. Read by Mario's ground speed and block/slope collision so he is treated as on the ground and not pushed by tiles.
Values: 0 = not on a sprite; 1 = on a sprite or platform; 2 = on a springboard; 3 = on a moving platform (chained platform, Banzai Bill platform, solid sprite).
19 uses in 18 routines (4 read, 13 write, 2 read-modify-write) R $00:EE1D LDA.W $1471 ; A = [$1471] (standing on a sprite/platform) W $01:8098 STZ.W $1471 ; [$1471] = 0: Mario is not on a sprite platform (platforms set it again) RW $01:AAD5 INC.W $1471 ; [$1471]++: Mario is standing on a sprite W $01:B47C STA.W $1471 ; [$1471] = 1: Mario is standing on a sprite W $01:B87F STA.W $1471 ; [$1471] = 1: Mario is standing on a solid sprite W $01:CA36 STA.W $1471 ; [$1471] = 3: Mario is standing on a solid sprite W $01:E680 STA.W $1471 ; [$1471] = 2: Mario stands on a platform sprite W $01:E68A STZ.W $1471 ; Launch time: [$1471] = 0 (Mario leaves the board) RW $01:E880 INC.W $1471 ; [$1471]++: Mario stands on a platform sprite W $02:9156 STA.W $1471 ; [$1471] = 1: Mario is standing on a platform W $02:CCA8 STY.W $1471 ; [$1471] = 1 (Mario standing on a sprite) W $02:CFCB STA.W $1471 ; [$1471] = 2: Mario is standing on a sprite W $02:D729 STA.W $1471 ; [$1471] = 3 (standing on a moving platform) W $02:EE72 STA.W $1471 ; [$1471] = 1: Mario is standing on a platform W $03:87EC STA.W $1471 ; [$1471] = 1: Mario is standing on a sprite W $03:8CCE STA.W $1471 ; [$1471] = 1: Mario is riding a platform sprite No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $03:C53A STA.W $1472 ; Beam start left X [$1472] = $78 No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $03:C53F STA.W $1474 ; Beam start right X [$1474] = $87 $1476 Spotlight left beam end byte Dark room spotlight effect: X of the left end of the beam. Set to 0 at the start of the effect and then stepped each frame by a table indexed by the sweep direction ($1483 ), reversing when it hits a limit. Used with $1478 (right end) to compute the window edges ($147A , $147C ).
4 uses in 1 routine (2 read, 2 write) W $03:C530 STA.W $1476 ; Beam end left X [$1476] = 0 R $03:C581 SBC.W $1476 ; A = [$1472] - [$1476]; carry set if the edge moves left or stays $1478 Spotlight right beam end byte Dark room spotlight effect: X of the right end of the beam. Set to $90 at the start of the effect and then stepped each frame like $1476 (left end). Used to compute the spotlight window edges.
4 uses in 1 routine (2 read, 2 write) W $03:C535 STA.W $1478 ; Beam end right X [$1478] = $90 R $03:C59C SBC.W $1478 ; A = [$1474] - [$1478] $147A Spotlight left edge byte, working value Dark room spotlight: the current left window edge while the routine builds the per-scanline HDMA window table. Starts at $1472 each frame, then is stepped one pixel per line (a DDA with $147E as the accumulator) and stored to the table at $04A0 ,X.
5 uses in 1 routine (1 read, 1 write, 3 read-modify-write) W $03:C57D STA.W $147A ; [$147A] = left edge, starts at [$1472] RW $03:C5D2 INC.W $147A ; Left edge [$147A] += 1 RW $03:C5DD DEC.W $147A ; Edge moves left: net -1 $147C Spotlight right edge byte, working value Dark room spotlight: the current right window edge while building the per-scanline window table. Starts at $1474 each frame, then is stepped per line using $147F as the accumulator.
5 uses in 1 routine (1 read, 1 write, 3 read-modify-write) W $03:C598 STA.W $147C ; [$147C] = right edge, starts at [$1474] RW $03:C5F5 INC.W $147C ; Right edge [$147C] += 1 RW $03:C600 DEC.W $147C ; Edge moves left: net -1 R $03:C615 LDA.W $147C ; Window right = [$147C] $147E Spotlight left DDA accumulator byte, scratch Dark room spotlight: line-drawing (DDA) accumulator for the left edge ($147A ). Zeroed at the start of each frame's table build and updated while the left edge is stepped.
4 uses in 1 routine (1 read, 3 write) W $03:C590 STZ.W $147E ; [$147E] = 0 (left DDA accumulator) W $03:C5CF STA.W $147E ; Overflow: subtract $CF $147F Spotlight right DDA accumulator byte, scratch Dark room spotlight: line-drawing (DDA) accumulator for the right edge ($147C ). Zeroed at the start of each frame's table build and updated while the right edge is stepped.
4 uses in 1 routine (1 read, 3 write) W $03:C5AB STZ.W $147F ; [$147F] = 0 (right DDA accumulator) W $03:C5F2 STA.W $147F ; Overflow: subtract $CF No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $03:C58A STA.W $1480 ; [$1480] = |left edge change| (DDA step) R $03:C5C1 ADC.W $1480 ; Left DDA: [$147E] += [$1480] No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $03:C5A5 STA.W $1481 ; [$1481] = |right edge change| (DDA step) R $03:C5E4 ADC.W $1481 ; Right DDA: [$147F] += [$1481] No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) $1483 Spotlight sweep direction index (0 or 1) Dark room spotlight: which way the beam ends sweep. Zero at the start of the effect; it flips (0/1) when the beam end reaches a limit from a table. Used as the index into the step tables for $1476 /$1478 .
4 uses in 1 routine (2 read, 2 write) W $03:C547 STZ.W $1483 ; Sweep direction [$1483] = 0 R $03:C54D LDY.W $1483 ; Y = sweep direction No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $03:C58D STY.W $1484 ; [$1484] = left edge sign (0 = moves left, 1 = moves right) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $03:C5A8 STY.W $1485 ; [$1485] = right edge sign No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $03:C544 STA.W $1486 ; [$1486] = 1 (probably unused) $148B Random number state 1 byte First of two seed bytes of the random number generator ($01AD07). Each call does [$148B ] = [$148B ] * 5 + 1 (carry included), and it is mixed with $148C (EOR) to produce $148D /$148E . Not meant to be read by game code.
4 uses in 1 routine (3 read, 1 write) R $01:AD0D ADC.W $148B ; [$148B] = [$148B] * 5 + 1 R $01:AD29 EOR.W $148B ; XOR with [$148B] $148C Random number state 2 byte Second seed byte of the random number generator. Each call shifts it left and applies a bit-5 feedback tweak (incrementing it in some cases). EORed with $148B to give the random outputs $148D and $148E .
4 uses in 1 routine (2 read, 2 read-modify-write) R $01:AD18 BIT.W $148C ; Test bit 5 of [$148C] RW $01:AD23 INC.W $148C ; Set bit 0 of [$148C] (feedback) $148D Random byte 1 RAM_RandomByte1 byte Random number produced by the generator at $01AD07 (called once per frame and again for a second output). Read by sprites that need a random choice: Cheep Cheep, hopping flame, splashes and sparkles, para-enemies, Boo/bat ceiling cluster sprite. $148E is the second random byte.
8 uses in 6 routines (7 read, 1 write) W $01:AD2C STA.W RAM_RandomByte1,Y ; Store in random byte [$148D+Y] R $02:B35F LDA.W RAM_RandomByte1 ; A = random byte 1 $148E Random byte 2 RAM_RandomByte2 byte Second random number from the generator at $01AD07 ($148D is the first). Read by Cheep Cheep, Magikoopa magic, jumping fish and Eerie generators, cluster sprite loading, splashes/sparkles and Peach's scene.
10 uses in 7 routines (10 read) R $02:B303 LDA.W RAM_RandomByte2 ; A = random byte 2 $148F Mario carrying flag flag byte Non-zero while Mario is holding a sprite. Cleared to 0 every frame in the sprite run ($018095) after its value is copied to $1470 ; a carried sprite's code sets it again that frame ($01A128 sets 1). Read by Mario's pose selection (carry poses), walking and swimming, collision, pipe entry and the cape, which all behave differently when he holds something.
Values: 0 = nothing carried; non-zero = carrying a sprite.
24 uses in 18 routines (17 read, 5 write, 2 read-modify-write) RW $00:94D4 INC.W $148F ; [$148F]++ (Mario carrying flag; purpose here unclear) R $00:CD4E LDA.W $148F If mario isn't holding something or riding yoshiW $01:8095 STZ.W $148F ; [$148F] = 0: Mario carries nothing (a carried sprite sets it again this frame) W $01:A128 STA.W $148F ; [$148F] = 1 (probably also a carrying flag) W $02:865F STA.W $148F ; [RAM_PickUpImgTimer] = [$148F] = 8: Mario carrying pose $1490 Star power timer timer Frames of Mario star invincibility remaining. Set to $FF by the Star power-up ($01C582); cleared at level start and by the goal tape. Read by Mario's drawing (palette cycle), hurt checks, block interaction, and by sprites that need star contact (star kill, Chuck, Wiggler, Sumo Bro flame, Yoshi contact).
Values: 0 = no star.
21 uses in 18 routines (16 read, 4 write, 1 read-modify-write) W $00:A65D STZ.W $1490 ; Cancel star power timer R $00:E2CF LDY.W $1490 ; Y = [$1490] (star timer) R $00:FB02 LDA.W $1490 ; Star timer [$1490]? W $01:C0FE STZ.W $1490 ; Zero out star timer W $01:C582 STA.W $1490 ; Star timer [$1490] = $FF W $01:C582 STA.W $1490 ; Star timer [$1490] = $FF R $02:BFE2 LDY.W $1490 ; [$1490] = Mario star timer R $03:958B LDA.W $1490 ; A = Mario star timer [$1490] R $03:9D94 LDA.W $1490 ; A = star power timer $1491 Sprite movement this frame byte, signed pixels Amount in pixels the current sprite moved this frame, used to carry Mario with platforms. Set to 0 at the start of each sprite's main routine and written by the sprite position update routines (X and Y variants) and chained platforms (platform X minus previous X). Read by Mario-carrying code: orange and floating platforms, skull raft, Mega Mole, carrot top lift, timed lift, scale platforms. Value is a signed 8-bit pixel delta.
16 uses in 15 routines (10 read, 6 write) W $01:85C3 STZ.W $1491 ; [$1491] = 0 (clear horizontal movement this frame) W $01:AC09 STA.W $1491 ; [$1491] = pixels moved (signed), used to carry Mario with platforms W $01:B2B3 STZ.W $1491 ; No horizontal carry for Mario: [$1491] = 0 R $01:B8A1 LDA.W $1491 ; A = [$1491] (sprite's X movement this frame) W $01:C7C8 STA.W $1491 ; [$1491] = platform X - its previous X ([$C2,X]): this frame's X movement W $02:D2C3 STA.W $1491 ; [$1491] = amount the sprite moved vertically this frame R $03:8CD3 LDA.W $1491 ; Y = 0, A = [$1491] (sprite X movement this frame, probably) $1492 Level end walk pause timer timer Set to $40 when the scripted level-end walk starts ($00C99A) and counted down in Mario's physics jump routine. When it reaches zero the end music/sequence continues (pause before the end music).
Values: 0 = not running.
3 uses in 2 routines (1 read, 1 write, 1 read-modify-write) W $00:C99A STA.W $1492 ; [$1492] = $40: pause before the end music $1493 End of level timer timer Counts down once the level has been won: set to $FF by the goal tape, goal sphere, Big Boo, Ludwig and Iggy/Larry boss deaths, or to 8 by block collision. While non-zero, level end handling runs (dithered palette fade, scripted walk, status bar and IRQ changes) and Mario cannot be hurt. Decremented by the scripted walk and boss routines. Game mode 14 skips the level-end work when it and the Mario animation are both 0.
Values: 0 = level not ending.
24 uses in 20 routines (12 read, 10 write, 2 read-modify-write) R $00:A202 ORA.W $1493 ; A = [Mario animation] | [$1493]; if both 0 (nothing special going on) skip R $00:AF17 LDY.W $1493 ; Y = [$1493] (level end timer) W $00:AF22 STY.W $1493 ; Y--, stored back unless it would hit 0 (timer stops at 1) RW $00:C951 DEC.W $1493 ; [$1493]--: level end timer W $00:EECE STA.W $1493 ; [$1493] = 8 (end level timer) R $00:F5C1 ORA.W $1493 ; Return if flashing ([$1497]), star ([$1490]) or level ending ([$1493]) W $01:877D STA.W $1493 ; [$1493] = [$0DDA] = $FF: end-of-level timer started W $01:C0FB STA.W $1493 ; [$1493] = $FF: end-of-level timer RW $01:D04B DEC.W $1493 ; Decrement [$1493] (end-of-level timer) W $01:FB2A STA.W $1493 ; [$1493] = $FF (end-of-level timer) W $03:8099 STA.W $1493 ; [$1493] = $FF: end-of-level timer W $03:98E3 STA.W $1493 ; End of level timer [$1493] = $FF (time before returning to the overworld) W $03:C7A3 STA.W $1493 ; End-of-level timer [$1493] = $FF W $03:CE96 STA.W $1493 ; [$1493] = $FF (end-of-level timer) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) $1495 Event or fade step timer byte (also start of the timer table $1495+X) Dual use. In the level end dithered palette fade it holds the fade step (set to step + 2); the IRQ code compares it with $40. In the overworld event routine it is the event timer. Cleared at level start and by the scripted walk. Per-frame Mario state also counts the bytes $1496 -$14A8 down with $1495 ,X (X=$13..1), so $1495 itself is not decremented there.
11 uses in 6 routines (6 read, 4 write, 1 read-modify-write) W $00:AFA6 STA.W $1495 ; [$1495] = step + 2 W $04:EA62 STZ.W $1495 ; [$1495] = 0 (event timer) R $04:EB48 LDA.W $1495 ; A = timer [$1495] $1496 Mario animation timer timer Timer for Mario's current animation, counted down by the animation code. Set by the walk animation frame counter, power up ($01C567 and cape $18), kill/hurt ($00F61D); death decrements it every 4th frame. Power down, mushroom, cape and flower power ups run until it reaches zero. Also read by swimming, climbing, overworld border icons and the ending.
Values: 0 = timer expired. Also counted down by the per-frame loop over $1496 -$14A8 .
22 uses in 12 routines (10 read, 7 write, 5 read-modify-write) W $00:CFFF STA.W $1496 ; Animation timer [$1496] = A RW $00:D0C3 DEC.W $1496 ; Every 4th frame: [$1496] -= 1 (death timer) RW $00:D163 DEC.W $1496 ; Timer [$1496] -= 1 W $00:F61D STA.W $1496 ; [$1496] = hurt timer (A) W $01:C5BA STA.W $1496 ; Animation timer [$1496] = $18 $1497 Mario invincibility timer timer Frames Mario is flashing and cannot be hurt. Set to $7F by power down (about 2 seconds), $30 by cape soaring ending, Yoshi contact and smoke puffs, and $FF at the start of normal animation 0 in some cases. Read by the Mario drawing routine (flash), by Hurt Mario, and by enemy contact routines (Rex, Dry Bones, stomp/kick/hurt) to skip damage.
Values: 0 = vulnerable.
11 uses in 10 routines (6 read, 5 write) W $00:CC8B STA.W $1497 ; [$1497] = $FF: Mario invincible W $00:D142 STA.W $1497 ; Invincibility flash timer [$1497] = $7F (about 2 seconds) W $00:F5EE STA.W $1497 ; Flashing timer [$1497] = $30 R $01:E608 LDA.W $1497 ; A = [$1497] (Mario invincibility timer) W $01:F745 STA.W $1497 ; Mario invincibility timer = $30 W $02:A4A9 STA.W $1497 ; Mario invincibility flash timer [$1497] = $30 $1498 Pick-up pose timer RAM_PickUpImgTimer timer Frames Mario shows the pick-up pose. Set to 8 when he grabs a sprite by bouncing/pressing on it ($01AA70) and set by the splash/Throw Block spawner. Cleared at level start. Read by Mario's pose selection and carried-sprite positioning, and by cutscene command $20.
Values: 0 = not showing the pick-up pose.
9 uses in 7 routines (4 read, 5 write) W $00:A689 STZ.W RAM_PickUpImgTimer ; Clear pick-up image timer R $00:C793 LDA.W RAM_PickUpImgTimer ; Command $20: [$1498] (pick-up image timer) set? W $00:C7E1 STA.W RAM_PickUpImgTimer ; Command $26: [$1498] (pick-up image timer) = $20 W $01:AA70 STA.W RAM_PickUpImgTimer ; Pick-up pose timer = 8 frames R $0C:D808 LDA.W RAM_PickUpImgTimer ; Pick-up image timer W $0C:D837 STA.W RAM_PickUpImgTimer ; Pick-up image timer = $10 $1499 Face camera timer RAM_FaceCamImgTimer timer Frames Mario faces the camera. Set to 8 when he turns while carrying a sprite, and when entering a pipe. Counted down (not below 0) in the horizontal pipe animation. Read by the pose chooser and the carried-sprite routine, which positions the sprite in front of Mario when he faces the camera.
Values: 0 = not facing the camera.
8 uses in 6 routines (4 read, 2 write, 2 read-modify-write) RW $00:D1D8 INC.W RAM_FaceCamImgTimer ; Face-camera timer -= 1, but not below 0 W $00:D6E7 STY.W RAM_FaceCamImgTimer ; Carrying: face the camera for 8 frames while turning W $00:F42D STA.W RAM_FaceCamImgTimer ; Face-the-camera timer = 8 R $01:9F7E LDA.W RAM_FaceCamImgTimer ; If turning, in a pipe or Mario faces the camera: $149A Kick pose timer RAM_KickImgTimer timer Frames Mario shows the kick pose. Set to 12 when he kicks a sprite ($01A0AD) and to $10 by the Cheep Cheep routine. Read by the Mario pose chooser. Cleared at level start.
Values: 0 = not kicking.
4 uses in 4 routines (1 read, 3 write) W $00:A686 STZ.W RAM_KickImgTimer ; Clear kick image timer W $01:A0AD STA.W RAM_KickImgTimer ; Show kick pose for 12 frames ([$149A]) W $01:B12C STA.W RAM_KickImgTimer ; Kick image timer = $10 $149B Flashing palette timer RAM_FlashingPalTimer timer Frames Mario's palette flashes during the flower power up. Set to $20 when he gets fire power ($01C5EE) and decremented by the flower animation. Read by the Mario drawing routine to pick the flashing palette.
Values: 0 = not flashing.
3 uses in 3 routines (1 read, 1 write, 1 read-modify-write) RW $00:D187 DEC.W RAM_FlashingPalTimer ; Flashing palette timer -= 1 R $00:E2CA LDY.W RAM_FlashingPalTimer ; Y = [RAM_FlashingPalTimer] W $01:C5EE STA.W RAM_FlashingPalTimer ; Flashing palette timer = $20 $149C Fireball pose timer RAM_FireballImgTimer timer Frames Mario shows the fireball shoot pose. Set to $0A when he shoots a fireball ($00FEBC). Read by the pose chooser and the swimming code.
Values: 0 = not shooting.
3 uses in 3 routines (2 read, 1 write) W $00:FEBC STA.W RAM_FireballImgTimer ; Fireball shoot pose timer [$149C] = $0A No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) R $00:DB21 LDY.W $149D ; Y = [$149D] (net door punch/spin timer) W $01:BAE7 STA.W $149D ; [$149D] = $1F (probably a Mario-side timer for passing through) $149E Net punch timer timer Timer for Mario's punch on a climbing net. Read by the climbing code and the climbing net door; the per-frame timer loop counts it down. The set code was not seen in the samples (probably set on punch).
3 uses in 2 routines (2 read, 1 write) R $00:DB84 LDA.W $149E ; A = [$149E] (net punch timer) W $00:DBC7 STA.W $149E ; Net punch timer [$149E] = 8 $149F Cape takeoff timer timer Cape flight timer. Set to $70 in normal animation (when the run meter fills) and to $50 when a ground jump allows takeoff; incremented in the cape flight code, which checks for >= 2 to leave it alone. Also ORed in the screen scroll routine so the screen can scroll vertically while flying.
Values: 0 = not taking off or flying.
7 uses in 4 routines (4 read, 2 write, 1 read-modify-write) W $00:CCB8 STA.W $149F ; Take-off timer [$149F] = $70 W $00:D678 STA.W $149F ; [$149F] = $50: allow cape takeoff (vertical scrolling) R $00:D8F5 CPY.W $149F ; Takeoff timer [$149F] >= 2: leave it R $00:F837 ORA.W $149F ; OR fly timer [$149F] No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:D72D STA.W $14A0 ; On the ground: running animation timer [$14A0] = $10 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:EDCF STA.W $14A1 ; [$14A1] = 8 (probably a landing/slide timer) $14A2 Cape image timer timer Timer for the cape's animation image. Set by the cape image update (value doubled in water) and read by the air cape image code. The horizontal pipe animation decrements it. Also read by the overworld border icon and ending sprites.
Values: 0 = timer expired.
8 uses in 5 routines (4 read, 1 write, 3 read-modify-write) W $00:CF13 STA.W $14A2 ; [$14A2] = timer RW $00:D1F9 DEC.W $14A2 ; Decrement [$14A2] if non-zero $14A3 Yoshi tongue timer timer Timer for Yoshi's tongue animation. Set to $12 when the tongue starts ($01F30B) and cleared when Yoshi eats a berry. Read by Yoshi drawing (mouth/tongue state, compared to $10) and by Yoshi's pose code.
Values: 0 = tongue not out.
4 uses in 4 routines (2 read, 2 write) W $01:F30B STA.W $14A3 ; Tongue animation timer [$14A3] = $12 No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $00:D87B STA.W $14A4 ; Set the phase timer [$14A4] $14A5 Cape float timer timer Floating timer of the cape: set to $10 when a float (glide) starts in the cape flight code, and while it is running the code adjusts Mario's Y speed. Also shifted left once by the layer 3 scroll handler.
Values: 0 = not floating.
3 uses in 2 routines (1 read, 1 write, 1 read-modify-write) W $00:D90A STA.W $14A5 ; Start float: [$14A5] = $10 $14A6 Cape spin timer timer Frames of Mario's cape spin. Set to $12 when the spin starts ($00D078). The pose chooser ORs it with the spin jump flag to show the spin pose; swimming also reads it.
Values: 0 = not spinning with the cape.
3 uses in 3 routines (2 read, 1 write) R $00:CF19 ORA.W $14A6 ; Spin jump or cape spin active ([RAM_IsSpinJump] | [$14A6])? W $00:D078 STA.W $14A6 ; Cape spin timer [$14A6] = $12 (start cape spin) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $03:D74F STA.W $14A7 ; Segment timer [$14A7] = $40 No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $01:F6CF STA.W $14AA ; $14AA = $40 (timer for the wings effect) $14AB Bonus game end timer timer Probably a bonus game timer. Set to $58 when there is no match in the bonus game and when the bonus 1-up cluster sprite runs out. Game mode 14 treats 0 as the end of the bonus game; Mario state code compares it to $44 every 4th frame while bonus mode ($1425 ) is on.
Values: 0 = bonus game finished.
4 uses in 4 routines (2 read, 2 write) R $00:C51E LDA.W $14AB ; A = [$14AB] (probably the bonus game timer) W $01:E048 STA.W $14AB ; No match: [$14AB] = $58 (probably a delay before the game ends) W $02:FE45 STA.W $14AB ; None left: [$14AB] = $58 (probably bonus game end timer) $14AD Blue P-switch timer RAM_BluePowTimer timer Frames left of the active blue P-switch. Set to $B0 (176) when Mario hits a blue switch ($14AD +Y with Y selecting blue or silver, see $14AE ). Cleared at level start. Read by block interaction, Mario drawing, animated tiles, Directional Coins, pipe code and the P-switch tile swaps (which restore tiles at 0).
Values: 0 = blue switch not active.
13 uses in 10 routines (11 read, 2 write) W $00:A654 STZ.W RAM_BluePowTimer ; Cancel blue POW timer R $00:EBF0 LDA.W RAM_BluePowTimer ; A = blue P-switch timer W $01:AB1C STA.W RAM_BluePowTimer,Y ; Switch timer [$14AD+Y] = $B0 (176 frames) $14AE Silver P-switch timer RAM_SilverPowTimer timer Frames left of the active silver P-switch (partner of $14AD ). Cleared at level start. Read by the P-switch tile swaps, Mario drawing, spawn routines and Directional Coins, which return while a P-switch is active.
9 uses in 7 routines (8 read, 1 write) W $00:A657 STZ.W RAM_SilverPowTimer ; Cancel silver POW timer R $02:E27A ORA.W RAM_SilverPowTimer ; Return if a P-switch is still active $14AF ON/OFF switch state RAM_OnOffStatus flag byte State of the ON/OFF switch: read by the line guide, bounce blocks (to choose the ON/OFF blocks) and cleared by the layer 2 ON/OFF scroll sprite at level start (set to ON).
Values: 0 = ON; non-zero = OFF.
6 uses in 3 routines (4 read, 2 write) W $05:C76B STX.W RAM_OnOffStatus ; Clear the ON/OFF status (set ON) $14B0 Pivot X or Bowser phase timer word (little endian, low/high pair) or timer Shared scratch. For chained platforms and the Mode 7 rotated tile check it is the pivot X (platform X minus radius, or Mode 7 center X [$2A ]); $14B1 is the high byte. Lakitu's cloud draw stores the cloud screen X here. In the Bowser fight it is the phase timer: Bowser states and the attack scheduler wait for it to hit 0. Meaning differs by routine.
20 uses in 11 routines (10 read, 9 write, 1 read-modify-write) R $01:C826 SBC.W $14B0 ; A = platform X - pivot X W $01:CCCB STA.W $14B0 ; Pivot X [$14B0] = [$2A] (Mode 7 center X) W $01:E8ED STA.W $14B0 ; [$14B0] = cloud screen X R $01:E90E ADC.W $14B0 ; Puff X = cloud X + DATA_01E76F[X] R $03:A4FD LDA.W $14B0 ; Phase timer [$14B0] non-zero: no attack yet W $03:A619 STA.W $14B0 ; Phase timer [$14B0] R $03:A7BC LDA.W $14B0 ; Phase timer [$14B0] $14B1 Pivot X high or Mecha drop timer byte (word high of $14B0) or timer High byte of the platform pivot X ($14B0 ). In the Bowser fight it is the Mechakoopa drop timer: set by the attack scheduler, read by the drop and throw routine, and cleared ($03A666) when Bowser is hurt.
8 uses in 6 routines (4 read, 3 write, 1 read-modify-write) W $01:CAF4 STA.W $14B1 ; Pivot X [$14B0] = sprite X - radius R $03:A5AD LDA.W $14B1 ; Mechakoopa drop timer [$14B1] W $03:A666 STZ.W $14B1 ; Cancel the Mechakoopa drop $14B2 Pivot Y or Bowser scale stage word (little endian, low/high pair) or index Shared scratch. For chained platforms and the Mode 7 check it is pivot Y (sprite Y minus radius, or Mode 7 center Y [$2C ]); $14B3 is the high byte. Lakitu's cloud draw stores the cloud screen Y here. In the Bowser retreat it is the scale stage (index into a table), cleared to 0 when the retreat starts.
13 uses in 6 routines (8 read, 4 write, 1 read-modify-write) R $01:C7F9 SBC.W $14B2 ; A = platform Y - pivot Y W $01:CCD0 STA.W $14B2 ; Pivot Y [$14B2] = [$2C] (Mode 7 center Y) W $01:E8F2 STA.W $14B2 ; [$14B2] = cloud screen Y R $01:E918 ADC.W $14B2 ; Puff Y = cloud Y + DATA_01E77F[X] W $03:A71B STZ.W $14B2 ; Scale stage [$14B2] = 0 R $03:A76D LDY.W $14B2 ; Y = scale stage [$14B2] RW $03:A78A INC.W $14B2 ; Yes: next stage $14B3 Pivot Y high or Bowser hit timer byte (word high of $14B2) or timer High byte of the platform pivot Y ($14B2 ). In the Bowser fight it counts up as the Bowser-hit effect timer for the hit stars and puffs, and is reset to 0 when Bowser takes a hit ($03B120).
5 uses in 4 routines (2 read, 2 write, 1 read-modify-write) W $01:CB12 STA.W $14B3 ; Pivot Y [$14B2] = sprite Y - radius Y RW $03:AFA5 INC.W $14B3 ; A = [$14B3]; then [$14B3]++ (Bowser-hit effect timer) W $03:B120 STZ.W $14B3 ; Reset effect timer [$14B3] = 0 $14B4 Scratch X low (platform/Bowser) scratch byte (low byte of a 16-bit word with $14B5) Shared scratch word, reused by unrelated bosses. In the rotating/tilting platform code it holds the X position of a point being tested (sprite X low + 8 for the Iggy/Larry platform, tested by the Mode 7 rotated tile check; $14B5 is the high byte). In the Mode 7 boss room it is the contact X for Mario. In the Bowser fight the same address is used as the Bowser phase counter (probably); set to the phase in the Mario/Mecha-Koopa contact code and read by the state/music table.
12 uses in 9 routines (4 read, 8 write) W $01:FD55 STA.W $14B4 ; [$14B4] = sprite X low + 8 R $03:A888 LDY.W $14B4 ; Phase counter [$14B4] (probably) R $03:A89D LDA.W $14B4 ; Next state = [$14B4] + 1 W $03:B126 STA.W $14B4 ; [$14B4] = Bowser phase $14B5 Scratch X high / Bowser hurt timer scratch byte (high byte with $14B4), timer in Bowser fight High byte of the 16-bit point X in the platform geometry code ($14B4 is the low byte). Set to X high plus carry for the Iggy/Larry tilting platform and by extended sprite hitbox setup. In the Bowser fight it is the hurt/hit flash timer: set to $4C when Bowser is hit, read by the hurt reaction and the main logic.
12 uses in 8 routines (6 read, 5 write, 1 read-modify-write) W $01:CAE1 STA.W $14B5 ; [$14B4] = sprite X (16-bit) W $01:FD5D STA.W $14B5 ; [$14B5] = X high + carry R $03:A2A5 LDA.W $14B5 ; A = [$14B5] (Bowser hurt timer, probably) R $03:A661 LDA.W $14B5 ; Hurt timer [$14B5] W $03:B11D STA.W $14B5 ; Bowser hit flash timer [$14B5] = $4C $14B6 Scratch Y low / Bowser ball timer scratch byte (low byte of a 16-bit word with $14B7), timer in Bowser fight Low byte of the 16-bit point Y in the platform geometry code (sprite Y low + $2F for the Iggy/Larry platform; $14B7 is the high byte). Also the contact Y in the Mode 7 boss room Mario test. In the Bowser fight it is the ball throw timer: set by the attack scheduler, tested by the Mechakoopa drop and ball throw routine, and cleared (STZ) when Bowser is hurt to cancel the throw.
15 uses in 11 routines (5 read, 9 write, 1 read-modify-write) W $01:FD65 STA.W $14B6 ; [$14B6] = sprite Y low + $2F R $03:A5D8 LDA.W $14B6 ; Ball throw timer [$14B6] W $03:A669 STZ.W $14B6 ; Cancel the ball throw $14B7 Scratch Y high / falling object X scratch byte (high byte with $14B6) High byte of the 16-bit point Y used by the platform geometry code ($14B6 is the low byte). In Bowser state 1 (retreat off-screen) it holds the X start of the next falling object, a random multiple of $10.
9 uses in 6 routines (3 read, 6 write) W $01:CAFF STA.W $14B7 ; [$14B6] = sprite Y (16-bit) W $01:FD6D STA.W $14B7 ; [$14B7] = Y high + carry W $03:A7A4 STA.W $14B7 ; Falling object X start [$14B7] = random multiple of $10 R $03:A805 LDA.W $14B7 ; Falling object X position [$14B7] $14B8 Platform X low / Bowser ball count scratch byte (low byte of a word with $14B9), counter in Bowser fight Low byte of the world X of a tilting/rotating platform: the brown chained platform, the Iggy/Larry tilting platform (pivot X plus the rotated X offset) and the Mode 7 boss room contact test. Iggy/Larry also keep the kid's X here for drawing the splash and spawning the ball. In the Bowser fight it is the ball counter, incremented by the attack scheduler and read by the Mechakoopa drop and ball throw routine.
22 uses in 10 routines (17 read, 4 write, 1 read-modify-write) R $00:F968 LDA.W $14B8 ; A = [$14B8] & $FF (contact X) R $00:F9DA LDA.W $14B8 ; A = [$14B8] & $FF W $01:CBBA STA.W $14B8 ; Platform X [$14B8] = pivot X + integer part of the rotated X offset W $01:FB70 STA.W $14B8 ; Remember kid X position in [$14B8] RW $03:A509 INC.W $14B8 ; Ball counter [$14B8]++ W $03:A51A STZ.W $14B8 ; Ball counter [$14B8] = 0 $14B9 Platform X high scratch byte (high byte with $14B8) High byte of the world X of the platform being processed ($14B8 is the low byte). Written by the brown chained platform main routine from the tile's 16-bit X, read by the Mario interaction helpers.
3 uses in 2 routines (2 read, 1 write) W $01:C98C STA.W $14B9 ; Platform world X ([$14B8]/[$14B9]) = this tile's 16-bit X $14BA Platform Y low scratch byte (low byte of a word with $14BB) Low byte of the world Y of a tilting/rotating platform (pivot Y minus the rotated Y offset), also the Iggy/Larry kid's Y position and the contact Y for the Mode 7 boss room Mario test (masked with $F0). Read by the brown chained platform, Iggy's ball spawn, the platform Koopaling draw and splash draw.
18 uses in 8 routines (15 read, 3 write) R $00:F974 LDA.W $14BA ; A = [$14BA] & $F0 (contact Y) R $00:F9E6 LDA.W $14BA ; A = [$14BA] & $FF W $01:CC22 STA.W $14BA ; Platform Y [$14BA] = pivot Y - integer part of the rotated Y offset W $01:FB75 STA.W $14BA ; Remember kid Y position in [$14BA] $14BB Platform Y high scratch byte (high byte with $14BA) High byte of the world Y of the platform being processed ($14BA is the low byte). Written by the brown chained platform main routine, read by the Mario interaction helpers.
3 uses in 2 routines (2 read, 1 write) W $01:C996 STA.W $14BB ; Platform world Y ([$14BA]/[$14BB]) = this tile's 16-bit Y $14BC Rotation radius X scratch byte X component of the offset from the pivot to a point on the rotating platform. Set to $50 by the platform Mario interaction helper, or to point X [$14B4 ] minus pivot X by the rotated tile check. Used with the sine/cosine magnitudes $14C2 /$14C5 when rotating the offset by the platform angle.
5 uses in 2 routines (3 read, 2 write) W $01:CACD STA.W $14BC ; Radius X = $50 ([$14BC]) W $01:CCDA STA.W $14BC ; Radius X [$14BC] = point X [$14B4] - pivot X No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $01:CAD3 STZ.W $14BD ; Radius X high byte = 0 $14BF Rotation radius Y scratch byte Y component of the offset from the pivot to a point on the rotating platform. Set to 0 by the platform Mario interaction helper, or to point Y [$14B6 ] minus pivot Y by the rotated tile check. Companion of $14BC .
5 uses in 2 routines (3 read, 2 write) W $01:CAD0 STZ.W $14BF ; Radius Y = 0 ([$14BF]) W $01:CCE4 STA.W $14BF ; Radius Y [$14BF] = point Y [$14B6] - pivot Y No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $01:CAD6 STZ.W $14C0 ; Radius Y high byte = 0 $14C2 Sine magnitude (platform) scratch byte Sine magnitude of the platform angle, looked up from the circle table (CircleCoords[angle & $FF]). Written and read only inside the platform Mario interaction and geometry helpers.
3 uses in 1 routine (2 read, 1 write) W $01:CB33 STA.W $14C2 ; [$14C2] = sine magnitude (CircleCoords[angle & $FF]) $14C5 Cosine magnitude (platform) scratch byte Cosine magnitude of the platform angle, looked up from the same table as $14C2 . Written and read only inside the platform Mario interaction and geometry helpers.
3 uses in 1 routine (2 read, 1 write) W $01:CB47 STA.W $14C5 ; [$14C5] = cosine magnitude $14C8 Sprite status RAM_SpriteAction byte table, one per sprite slot (index X) The state of each sprite slot. Everything that spawns, kills or processes a sprite goes through it; the main sprite loop dispatches on it each frame. Index Y is also used when one sprite acts on another.
Values: 0 = empty slot / erased; 1 = initialise; 2 = killed (falls off screen); 3 = smushed;
4 = spin-jump killed (puff of smoke); 5 = sinking in lava; 8 = normal (run main routine);
9 = carryable (stunned/shell or item); 0A = kicked; 0B = carried by Mario.
277 uses in 185 routines (119 read, 158 write) R $00:FA91 LDA.W $14C8,Y ; A = sprite status W $00:FAC0 STA.W $14C8,Y ; Status 6: level end, turn into coin W $00:FACE STA.W $14C8,Y ; Erase the sprite (status 0) W $00:FB6B STA.W $14C8,Y ; Status $0C: goal tape powerup W $00:FC1B STZ.W $14C8,X ; Erase the sprite (status = 0) R $00:FC25 LDA.W $14C8,Y ; A = sprite status of slot Y W $00:FC9A STA.W $14C8,X ; Sprite status = 8 (normal) W $00:FCEE STZ.W $14C8,X ; Sprite status = 0 (erase) R $01:80E5 LDA.W $14C8,X ; A = sprite status R $01:8127 LDA.W $14C8,X ; A = sprite status W $01:8174 STA.W $14C8,X ; Sprite status = 8 (normal), then run its init routine W $01:83EB STZ.W $14C8,X ; Else erase this sprite (status 0) W $01:8437 STA.W $14C8,X ; Sprite status = 9 (carryable) W $01:8462 STA.W $14C8,X ; Sprite status = 9 (carryable) R $01:8472 LDA.W $14C8,Y ; A = status of slot Y W $01:84AB STA.W $14C8,Y ; New sprite status = 8 (normal) W $01:8778 STZ.W $14C8,X ; Erase the sprite (status 0) R $01:8972 LDA.W $14C8,Y ; Status of that sprite W $01:899A STA.W $14C8,Y ; Kicked sprite status = $0A (kicked) W $01:8A75 STA.W $14C8,Y ; Kicked sprite status = 9 (carryable) W $01:8AF1 STA.W $14C8,X ; Sprite status = 9 (stunned/carryable) W $01:9020 STZ.W $14C8,X ; Off screen: sprite status = 0 (free) W $01:9332 STA.W $14C8,X ; Sprite status = 5 (sinking in lava) W $01:9564 STA.W $14C8,X ; Sprite status = 8 (normal) W $01:96CD STA.W $14C8,X ; Sprite status = 8 (normal) W $01:9642 STA.W $14C8,X ; Sprite status = 8 (normal) W $01:9698 STA.W $14C8,X ; Sprite status = A (8 normal or $0A kicked) W $01:96E9 STA.W $14C8,Y ; New sprite status = 8 (normal) W $01:9778 STA.W $14C8,Y ; Coin sprite status = 8 (normal) W $01:99DC STZ.W $14C8,X ; Free the sprite slot W $01:9ACD STA.W $14C8,X ; Yes: sprite status = 4 (spin jump killed) ... W $01:9AED STZ.W $14C8,X ; Timer ran out: free the sprite slot W $01:9FF0 STA.W RAM_SpriteAction,X ; Mario is animating: sprite status = 9 (stunned, drops from Mario) W $01:A02A STA.W RAM_SpriteAction,X ; Sprite status = 9 (stunned) W $01:A084 STA.W RAM_SpriteAction,X ; Sprite status = $0A (kicked) W $01:A28D STA.W $14C8,Y ; Clear its sprite status (remove it) W $01:A2C2 STA.W $14C8,X ; Sprite status = 8 (normal) R $01:A4BA LDA.W $14C8,Y ; A = status of sprite A R $01:A4CE LDA.W $14C8,X ; A = status of sprite B R $01:A4F2 LDA.W $14C8,X ; A = status of sprite B (A stunned on ground) R $01:A506 LDA.W $14C8,X ; A = status of sprite B (A kicked) R $01:A51A LDA.W $14C8,X ; A = status of sprite B (A carried) R $01:A555 LDA.W $14C8,X ; A = status of sprite B W $01:A5E5 STA.W $14C8,Y ; Sprite A status = 2 (killed, falls off screen) W $01:A66D STA.W $14C8,X ; B status = 2 (killed) W $01:A691 STA.W $14C8,X ; B status = 2 (killed) W $01:A6AE STA.W $14C8,Y ; A status = 2 (killed) W $01:A86D STA.W $14C8,X ; Sprite status = 2 (killed) W $01:A9D5 STA.W $14C8,X ; Sprite status = 3 (smushed) W $01:A9EB STA.W $14C8,X ; Sprite status = 2 (killed, falling off screen) R $01:AA01 LDY.W $14C8,X ; Y = sprite status W $01:AA2F STA.W $14C8,X ; Sprite status = 9 (stunned, can be picked up or kicked) W $01:AA68 STA.W $14C8,X ; Sprite status = $0B (carried) W $01:AAA1 STA.W $14C8,X ; Sprite status = $0A (kicked) W $01:ACA1 STZ.W $14C8,X ; Sprite status = 0: erase sprite W $01:B142 STA.W $14C8,X ; Sprite status = 2 (killed) W $01:B264 STA.W $14C8,X ; Sprite status = 1 (initialization) W $01:BC64 STZ.W $14C8,X ; Kill the magic (status 0) W $01:BC94 STA.W $14C8,X ; Sprite status = 8 (normal) W $01:BCDC STZ.W $14C8,X ; Below the screen: kill the sprite R $01:BDBF LDA.W $14C8,Y ; Sprite status of slot Y W $01:BDCB STZ.W $14C8,X ; Another Magikoopa exists: erase this one (only one at a time) W $01:BDF7 STZ.W $14C8,X ; Yes: erase the sprite R $01:BF1F LDA.W $14C8,Y ; Slot Y status W $01:BF2F STA.W $14C8,Y ; New sprite status = 8 (normal) W $01:C17F STZ.W $14C8,X ; Erase the sprite W $01:C2B9 STA.W $14C8,X ; Sprite status = 9 (carryable) W $01:C2E5 STA.W $14C8,Y ; Make it carryable (status 9): Mario drops it W $01:C2F4 STA.W $14C8,X ; Balloon status = carried, or removed if Mario already has one W $01:C30F STZ.W $14C8,X ; Remove the sprite (status 0) W $01:C4C6 STZ.W $14C8,X ; Remove the sprite (status 0) W $01:D053 STZ.W $14C8,X ; Sprite status = 0 (erase the Koopa Kid) W $01:D06B STA.W $14C8,Y ; New sprite status = 8 (normal) W $01:D43E STZ.W $14C8,X ; Unreachable: erase sprite W $01:D484 STZ.W $14C8,X ; Too far off: erase sprite R $01:D4FB LDA.W $14C8,X ; Sprite status R $01:DA0A LDA.W $14C8,X ; Sprite status R $01:DB5F LDA.W $14C8,X ; Sprite status W $01:DDB1 STZ.W $14C8,X ; Already initialised: remove this duplicate sprite W $01:DDB9 STA.W $14C8,X ; Sprite status = 8 (normal) W $01:E16A STZ.W $14C8,X ; Free the sprite slot (left the screen) W $01:E6DC STA.W $14C8,X ; Sprite status = $0B (carried by Mario) W $01:E768 STZ.W $14C8,X ; Erase the sprite W $01:E7CD STZ.W $14C8,X ; Erase the cloud R $01:E7DD LDA.W $14C8,Y ; A = status of slot Y R $01:E9AD LDA.W $14C8,X ; A = Lakitu status W $01:E9B5 STZ.W $14C8,X ; Erase the cloud too W $01:EA29 STA.W $14C8,Y ; New sprite status = 8 (normal) W $01:EC8D STA.W $14C8,Y ; New sprite status = 9 (carryable) W $01:F1B7 STA.W $14C8,Y ; Held sprite status = 0 (gone) W $01:F234 STA.W $14C8,Y ; Set item status W $01:F27E STZ.W $14C8,X ; Item status = 0: the shell vanishes W $01:F358 STA.W $14C8,Y ; Status 7: stuck in Yoshi's mouth W $01:F375 STA.W $14C8,Y ; Caught sprite status = 0 (swallowed) W $01:F5C9 STA.W $14C8,Y ; New sprite status = 8 (normal) W $01:F6D9 STA.W $14C8,Y ; Remove the item sprite (status 0) R $01:F6F5 LDA.W $14C8,Y ; Other sprite status W $01:F74E STA.W $14C8,X ; Sprite status = 8 (normal) W $01:F84C STA.W $14C8,X ; Sprite status = 9 (carryable) R $01:F890 LDA.W $14C8,X ; Sprite status W $01:FB32 STZ.W $14C8,X ; Erase the sprite (status 0) W $01:FDB9 STA.W $14C8,Y ; New sprite status = 8 (normal) R $02:8019 LDA.W RAM_SpriteAction,X ; A = status of sprite slot X ([RAM_SpriteAction]) W $02:8044 STA.W RAM_SpriteAction,X ; Sprite status = 8 (normal) W $02:80A1 STZ.W $14C8,X ; Timer [$1540] = 0: sprite status = 0 (free the slot) W $02:816A STA.W $14C8,Y ; Target sprite status = 2 (killed, falls off screen) W $02:8638 STA.W $14C8,X ; Sprite status = $0B (being carried) R $02:8907 LDA.W $14C8,X ; Sprite status in slot X W $02:892A STA.W $14C8,X ; Set sprite status W $02:8961 STZ.W $14C8,X ; Yes: kill the new sprite W $02:89B7 STA.W $14C8,X ; Sprite status from table R $02:89E1 LDA.W $14C8,Y ; Sprite status W $02:8B3E STA.W $14C8,X ; Sprite status = 1 (initialise) W $02:945D STA.W $14C8,X ; Sprite status = 2 (killed) W $02:9482 STA.W $14C8,X ; Sprite status = 9 (carryable) W $02:A10D STA.W $14C8,X ; Sprite status = 2 (killed) W $02:A12F STA.W $14C8,X ; Sprite status = 8 (normal) R $02:A918 LDA.W $14C8,X ; Sprite status of slot X W $02:A975 STA.W $14C8,X ; Sprite status = [$04] W $02:A9B6 STA.W $14C8,X ; Status 8 (normal) R $02:A9FE LDA.W $14C8,Y ; Sprite status of slot Y W $02:AC0C STZ.W $14C8,X ; No: erase the sprite (status 0) W $02:AC1A STZ.W $14C8,X ; Free the old slot W $02:AC1F STA.W $14C8 ; Slot 0: status $0B (carried between areas) W $02:AF4E STA.W $14C8,X ; Set sprite status W $02:AFB8 STA.W $14C8,X ; Set sprite status W $02:B04A STA.W $14C8,X ; Sprite status = 8 (normal) W $02:B090 STA.W $14C8,X ; Sprite status = 8 (normal) W $02:B4AE STA.W $14C8,Y ; Sprite status = 1 (initialize) W $02:B122 STA.W $14C8,Y ; Sprite status = 8 (normal) W $02:B16A STA.W $14C8,X ; Sprite status = 8 (normal) W $02:B1CB STA.W $14C8,X ; Sprite status = 8 (normal) W $02:B216 STA.W $14C8,X ; Sprite status = 8 (normal) R $02:B27D LDA.W $14C8,X ; Is this sprite slot empty? W $02:B28A STA.W $14C8,X ; Sprite status = 8 (normal) W $02:B2E5 STA.W $14C8,X ; Sprite status = 8 (normal) W $02:B338 STA.W $14C8,X ; Sprite status = 8 (normal) W $02:B3ED STA.W $14C8,Y ; Sprite status = 8 (normal) W $02:B6AB STZ.W $14C8,X ; Sprite status = 0 (erase) W $02:B836 STA.W $14C8,Y ; Sprite status = 2 (killed) R $02:B9C4 LDA.W $14C8,Y ; Sprite status of slot Y W $02:B9E0 STA.W $14C8,Y ; Sprite status = 8 (normal) W $02:BAC2 STA.W $14C8,Y ; Sprite status = 8 (normal) W $02:BDB0 STZ.W $14C8,X ; Fell off the bottom: erase the sprite W $02:C1A2 STA.W $14C8,Y ; Status = 8 (normal) R $02:C22C LDA.W $14C8,X ; Sprite status W $02:C5C4 STA.W $14C8,Y ; Clone status = 8 (normal) W $02:C7B5 STA.W $14C8,X ; Status = 2 (killed) R $02:D07A LDA.W $14C8,X ; A = sprite status W $02:D08D STZ.W $14C8,X ; Erase the sprite R $02:D58A LDA.W $14C8,X ; A = sprite status R $02:D8F6 LDA.W $14C8,X ; A = sprite status W $02:D8FF STA.W $14C8,X ; Unused: set the sprite status to normal (8) R $02:DA5D LDA.W $14C8,X ; A = sprite status W $02:DBFF STA.W $14C8,Y ; Hammer Bro status = 2 (killed) W $02:DD9C STA.W $14C8,Y ; Sprite status = 8 (normal) W $02:DF02 STZ.W $14C8,X ; Timer was 1: erase the sprite W $02:E274 STZ.W $14C8,X ; Time ran out: erase the sprite W $02:EAFA STA.W $14C8,Y ; Status = 8 (normal) W $02:ED9B STA.W $14C8,Y ; Status = 8 (normal) W $02:EDEF STA.W $14C8,Y ; Erase it too (status 0) W $02:EF7D STA.W $14C8,Y ; Status = 8 (normal) W $02:F29F STA.W $14C8,X ; Sprite status = 2 (killed) W $02:F45F STZ.W $14C8,X ; Yes: remove the sprite W $02:F55A STA.W $14C8,Y ; Status = 8 (normal) W $03:81D5 STA.W $14C8,X ; Status = 2 (killed, falls off screen) W $03:8211 STZ.W $14C8,X ; Remove that sprite (status 0) W $03:8717 STZ.W $14C8,X ; Clear load status so the platform respawns; remove sprite W $03:8AE1 STA.W $14C8,Y ; New sprite status = 8 (normal) W $03:9387 STZ.W $14C8,X ; Sprite status = 0 (erase sprite) R $03:951A LDA.W $14C8,X ; A = sprite status W $03:9530 STZ.W $14C8,X ; Last frame of remains: sprite status = 0 (erase) W $03:95E0 STA.W $14C8,X ; Sprite status = 4 (killed by spin jump) W $03:95F4 STA.W $14C8,X ; Sprite status = 2 (killed by star) R $03:9910 LDA.W $14C8,X ; A = sprite status W $03:9ACE STA.W $14C8,Y ; Status = 2 (killed, falling) R $03:9BD8 LDA.W $14C8,X ; A = sprite status R $03:9C4E LDA.W $14C8,X ; A = sprite status R $03:A51D LDA.W $14C8 ; Sprite slot 0 status R $03:A6CA LDA.W $14C8,Y ; Sprite status W $03:A6E4 STA.W $14C8,Y ; Sprite status = 4 (killed by spin jump) W $03:A7FD STA.W $14C8,Y ; Sprite status = 8 (normal) W $03:A8EA STA.W $14C8,Y ; Sprite status = 8 (normal) W $03:B02D STA.W $14C8,Y ; Status = 8 (normal) W $03:B157 STA.W $14C8,Y ; Status 2: killed R $03:B8AC LDA.W $14C8,X ; A = sprite status W $03:B8BF STZ.W $14C8,X ; Sprite status = 0 (erase sprite) W $03:C034 STA.W $14C8,Y ; Erase the caught sprite (status 0) W $03:C069 STA.W $14C8,X ; Sprite status = 8 (normal) R $03:C211 LDA.W $14C8,Y ; A = sprite status W $03:C2E8 STA.W $14C8,X ; Sprite status = 8 (normal) W $03:C4F6 STZ.W $14C8,X ; Another dark room sprite exists: erase this one W $03:C7D2 STA.W $14C8,Y ; Sprite status = normal W $03:C955 STZ.W $14C8,X ; Yes: erase the sprite W $03:CBC7 STA.W $14C8,Y ; Sprite status = 8 (normal) W $03:CCEA STA.W $14C8,Y ; Sprite status = 8 (normal) W $03:CDF9 STZ.W $14C8,X ; Helper sprite: erase it (status 0) W $03:CE8E STZ.W $14C8,X ; Erase the sprite (status 0) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $03:A522 LDA.W $14C9 ; Sprite slot 1 status No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $03:AC65 STA.W $14D0 ; Slot 8 sprite status [$14D0] = 8 (normal) $14D4 Sprite Y position high RAM_SpriteYHi byte table, one per sprite slot (index X or Y) High byte of each sprite's 16-bit Y position; the low byte is $00D8 (RAM_SpriteYLo). Together they give the sprite's position in the level. Written when sprites spawn, move or follow platforms and read for collision, on-screen tests and drawing. $FE is used to park a sprite far off-screen (Bowser's clown car).
292 uses in 166 routines (160 read, 127 write, 5 read-modify-write) W $00:FD04 STA.W RAM_SpriteYHi,X ; Sprite Y high = 0 RW $01:8408 INC.W RAM_SpriteYHi,X ; Carry into Y position high R $01:8495 LDA.W RAM_SpriteYHi,X ; Save Lakitu's Y position in [$18C3]/[$18C4] W $01:84C1 STA.W RAM_SpriteYHi,Y ; Cloud Y position high = Lakitu's RW $01:85BF DEC.W RAM_SpriteYHi,X ; Borrow: Y position high -= 1 R $01:88C4 LDA.W RAM_SpriteYHi,Y ; [$01]/[$09] = shell Y position (box top, low/high) W $01:8C04 STA.W RAM_SpriteYHi,X ; Restore Y position high R $01:95BA LDA.W RAM_SpriteYHi,X ; Block Y [$98] = sprite Y rounded down to 16 R $01:970D LDA.W RAM_SpriteYHi,X ; New sprite position = old Koopa position R $01:9790 LDA.W RAM_SpriteYHi,X ; Coin Y position = Koopa Y position R $01:99F3 LDA.W RAM_SpriteYHi,X ; Block Y position = sprite Y position R $01:9E9D LDA.W RAM_SpriteYHi,X ; Save sprite Y high W $01:9F02 STA.W RAM_SpriteYHi,X ; Restore sprite Y high R $01:A3B2 LDA.W RAM_SpriteYHi,X ; A = sprite Y high R $01:ABFF ADC.W RAM_SpriteYHi,X ; Position high byte += sign byte + carry R $01:AD4D SBC.W RAM_SpriteYHi,X ; Minus sprite Y high R $01:AE23 LDA.W RAM_SpriteYHi,X ; Block Y position = sprite Y position (16-bit) W $01:B641 STA.W RAM_SpriteYHi,X ; Sprite Y high -= borrow W $01:B648 STA.W RAM_SpriteYHi,X ; Restore sprite Y high W $01:B9C3 STA.W RAM_SpriteYHi,X ; Sprite Y high -= borrow W $01:B9F4 STA.W RAM_SpriteYHi,X ; Restore Y position high W $01:BCA8 STA.W RAM_SpriteYHi,X ; Sprite Y high = block Y high W $01:BE1B STA.W RAM_SpriteYHi,X ; Sprite Y high byte (carry from the add) W $01:BF4F STA.W RAM_SpriteYHi,Y ; New Y high byte W $01:C071 STA.W RAM_SpriteYHi,X ; Unused. Initialize goal tape, then sprite Y -= $4C R $01:C089 LDA.W RAM_SpriteYHi,X ; Save extra bits into $187B,x W $01:C76F STA.W RAM_SpriteYHi,X ; Sprite Y += $0068 (16-bit) W $01:CD45 STA.W RAM_SpriteYHi,X ; Sprite Y high = 1 (Y = $0140) RW $01:CFEE DEC.W RAM_SpriteYHi,X ; Sprite Y high-- R $01:D395 LDA.W RAM_SpriteYHi,X ; Y high W $01:D39A STA.W RAM_SpriteYHi,X ; Store Y high R $01:D431 LDA.W RAM_SpriteYHi,X ; Boss Y high RW $01:D517 INC.W RAM_SpriteYHi,X ; Y high++ R $01:D5D1 LDA.W RAM_SpriteYHi,X ; Y high W $01:D5D7 STA.W RAM_SpriteYHi,X ; Store Y high R $01:D62C LDA.W RAM_SpriteYHi,X ; Y high W $01:D631 STA.W RAM_SpriteYHi,X ; Store Y high W $01:D666 STA.W RAM_SpriteYHi,X ; Restore Y high W $01:D6BD STA.W RAM_SpriteYHi,X ; Store Y high W $01:DAD3 STA.W RAM_SpriteYHi,X ; Restore Y high W $01:DB32 STA.W RAM_SpriteYHi,X ; Restore Y high W $01:DDD6 STA.W RAM_SpriteYHi,X ; Store Y high W $01:E067 STA.W RAM_SpriteYHi,X ; ... (16 bit) W $01:EA4D STA.W RAM_SpriteYHi,Y ; New sprite Y high = spawner's Y high W $01:EB6F STA.W RAM_SpriteYHi,X ; Yoshi Y high = Mario Y high + carry W $01:ECC0 STA.W RAM_SpriteYHi,Y ; Y high = Yoshi Y high + carry W $01:EF35 STA.W RAM_SpriteYHi,X ; ... with carry RW $01:EFA0 INC.W RAM_SpriteYHi,X ; ... carry into Y hi W $01:EFA7 STA.W RAM_SpriteYHi,X ; Restore Y position hi W $01:F21B STA.W RAM_SpriteYHi,Y ; Item Y hi = Yoshi Y hi R $01:F50F LDA.W RAM_SpriteYHi,X ; Yoshi Y high W $01:F514 STA.W RAM_SpriteYHi,Y ; Eaten sprite Y high R $01:F557 LDA.W RAM_SpriteYHi,X ; Yoshi Y high W $01:F5E2 STA.W RAM_SpriteYHi,Y ; New Pokey Y high R $01:F7D5 LDA.W RAM_SpriteYHi,X ; Egg Y high W $01:FDEE STA.W RAM_SpriteYHi,Y ; Ball Y = [$14BA] - $18 (16-bit) W $02:8641 STA.W RAM_SpriteYHi,X ; Sprite Y high = Mario Y high W $02:8981 STA.W RAM_SpriteYHi,X ; Sprite Y high = block Y high W $02:8B5E STA.W RAM_SpriteYHi,X ; Sprite Y high = [$18C4] W $02:A965 STA.W RAM_SpriteYHi,X ; Y position high = bits 0, 2 and 3 (the extra bits) W $02:AC37 STA.W RAM_SpriteYHi ; Copy Y position high W $02:AF68 STA.W RAM_SpriteYHi,X ; Set Y high W $02:AFDB STA.W RAM_SpriteYHi,X ; Set Y high W $02:B067 STA.W RAM_SpriteYHi,X ; Sprite Y high W $02:B0AE STA.W RAM_SpriteYHi,X ; Sprite Y high W $02:B149 STA.W RAM_SpriteYHi,Y ; Sprite Y high W $02:B1E7 STA.W RAM_SpriteYHi,X ; Sprite Y high W $02:B232 STA.W RAM_SpriteYHi,X ; Sprite Y high W $02:B2A5 STA.W RAM_SpriteYHi,X ; Sprite Y high W $02:B300 STA.W RAM_SpriteYHi,X ; Sprite Y high W $02:B35C STA.W RAM_SpriteYHi,X ; Set Y high R $02:B857 LDA.W RAM_SpriteYHi,X ; New sprite Y = hitting sprite Y W $02:C5DF STA.W RAM_SpriteYHi,Y ; Clone Y position high = this Chuck's R $02:CC3B ADC.W RAM_SpriteYHi,X ; Sprite Y high += sign + carry R $02:CC4E LDA.W RAM_SpriteYHi,X ; [$02] = sprite Y (16 bit) R $02:D0B6 SBC.W RAM_SpriteYHi,X ; Subtract sprite Y high R $02:D2B9 ADC.W RAM_SpriteYHi,X ; Sprite Y position (16-bit) += A (sign extended) + carry R $02:D2E4 LDA.W RAM_SpriteYHi,Y ; Mario's position = position of sprite Y R $02:D3BE LDA.W RAM_SpriteYHi,X ; A = sprite Y high W $02:D43F STZ.W RAM_SpriteYHi,X ; Sprite Y high = 0 R $02:D517 SBC.W RAM_SpriteYHi,X ; Minus sprite Y high with borrow R $02:D6D9 LDA.W RAM_SpriteYHi,X ; Save sprite Y (16-bit) R $02:D710 LDA.W RAM_SpriteYHi,X ; A = sprite Y high W $02:D715 STA.W RAM_SpriteYHi,X ; Store sprite Y high W $02:E119 STA.W RAM_SpriteYHi,X ; Restore Y high R $02:E2D0 LDA.W RAM_SpriteYHi,X ; Block Y = sprite Y R $02:E4B5 LDA.W RAM_SpriteYHi,X ; Save this platform's X and Y position (lo/hi) on the stack W $02:E4BC STA.W RAM_SpriteYHi,X ; Y position hi = [$151C] (partner platform Y hi) W $02:E4D4 STA.W RAM_SpriteYHi,X ; Restore Y position hi R $02:E545 LDA.W RAM_SpriteYHi,X ; Block Y position = sprite Y position W $02:E862 STA.W RAM_SpriteYHi,X ; Restore Y hi R $02:E8D8 LDA.W RAM_SpriteYHi,X ; Block Y = sprite Y R $02:E8F8 LDA.W RAM_SpriteYHi,X ; Block Y = sprite Y W $02:EB15 STA.W RAM_SpriteYHi,Y ; New sprite Y high W $02:EDAB STA.W RAM_SpriteYHi,Y ; Y high = this sprite's W $02:EF98 STA.W RAM_SpriteYHi,Y ; Copy Y high W $02:F56E STA.W RAM_SpriteYHi,X ; Y high = 0 W $02:F95C STA.W RAM_SpriteYHi ; Sprite 0 Y high = cluster Y high W $02:FC26 STA.W RAM_SpriteYHi ; Same for Y; [$0F72] = home Y (Y AND $FC), used to detect the return to the ceiling W $03:8B1B STA.W RAM_SpriteYHi,Y ; New sprite Y = statue Y - 2 R $03:904C LDA.W RAM_SpriteYHi,X ; Extended sprite Y position = sprite Y (low, high) R $03:935E LDA.W RAM_SpriteYHi,X ; A = Y high W $03:9364 STA.W RAM_SpriteYHi,X ; Store Y high W $03:936C STA.W RAM_SpriteYHi,X ; Store Y high W $03:98B6 STZ.W RAM_SpriteYHi ; Slot 0 Y position = $00B2 W $03:99E6 STA.W RAM_SpriteYHi,X ; Sprite Y position high W $03:9AE9 STA.W RAM_SpriteYHi,Y ; Copy Y position to the new sprite R $03:9B2B LDA.W RAM_SpriteYHi,X ; A = Reznor Y high W $03:9B34 STA.W RAM_SpriteYHi,X ; Temporarily move Reznor Y high W $03:9B3D STA.W RAM_SpriteYHi,X ; Restore Reznor Y high R $03:9F7A LDA.W RAM_SpriteYHi,X ; Remember home Y high W $03:A02B STA.W RAM_SpriteYHi,X ; Y high R $03:A04D LDA.W RAM_SpriteYHi,X ; A = Y high W $03:A053 STA.W RAM_SpriteYHi,X ; Y high -= borrow W $03:A05B STA.W RAM_SpriteYHi,X ; Y high W $03:A0FE STA.W RAM_SpriteYHi,X ; Y high = $FF (above the screen) W $03:A81C STA.W RAM_SpriteYHi,Y ; Y high = 0 W $03:AC5F STA.W RAM_SpriteYHi,X ; Set X and Y high bytes to $FE: move the clown car far off-screen W $03:B042 STA.W RAM_SpriteYHi,Y ; Y high byte R $03:B834 SBC.W RAM_SpriteYHi,X ; 16-bit borrow: sign of the high byte tells which side Mario is on R $03:B8E8 SBC.W RAM_SpriteYHi,X ; A = (screen Y + limit) - sprite Y, high byte (16-bit subtract) W $03:C07C STA.W RAM_SpriteYHi,X ; Sprite Y position -= $10 (taller sprite) W $03:C2FE STA.W RAM_SpriteYHi,X ; Sprite Y position = Mario Y position W $03:C331 STA.W RAM_SpriteYHi,X ; Sprite Y position -= $0F (16-bit) W $03:CBD2 STA.W RAM_SpriteYHi,Y ; New sprite Y high = spawner Y high W $03:CD1D STA.W RAM_SpriteYHi,Y ; Copy Y high W $0C:A00F STZ.W RAM_SpriteYHi ; Sprite slot 0 Y high = 0 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) $14E0 Sprite X position high RAM_SpriteXHi byte table, one per sprite slot (index X or Y) High byte of each sprite's 16-bit X position; the low byte is $00E4 (RAM_SpriteXLo). Written when sprites spawn and when they are carried by layers or Yoshi, read by the sprite-to-sprite contact, interaction and draw code. New sprites copy the spawner's value.
262 uses in 153 routines (149 read, 113 write) R $00:FBC2 ADC.W RAM_SpriteXHi,X ; Sprite X += signed [$17BD]: coin follows layer 1 scrolling W $00:FCFB STA.W RAM_SpriteXHi,X ; Sprite X high = 0 W $01:84B6 STA.W RAM_SpriteXHi,Y ; Cloud X position high = Lakitu's R $01:91B8 ADC.W RAM_SpriteXHi,X ; Sprite X += that, so it rides a moving layer 2 R $01:9785 LDA.W RAM_SpriteXHi,X ; Coin X position = Koopa X position R $01:99EA LDA.W RAM_SpriteXHi,X ; Block X position = sprite X position R $01:9EAE LDA.W RAM_SpriteXHi,X ; Save sprite X high W $01:9EFB STA.W RAM_SpriteXHi,X ; Restore sprite X high R $01:A44B LDA.W RAM_SpriteXHi,Y ; $00-$01 = X position of B, $02-$03 = X position of A R $01:AC6F SBC.W RAM_SpriteXHi,X ; 16-bit compare with sprite X high: sign of (screen + offset - sprite X) R $01:AD3B SBC.W RAM_SpriteXHi,X ; Minus sprite X high R $01:AE1A LDA.W RAM_SpriteXHi,X ; Block X position = sprite X position (16-bit) R $01:B16D ADC.W RAM_SpriteXHi,X ; A = X high + sprite X high R $01:B52D ADC.W RAM_SpriteXHi,X ; Mario X high = sprite X high + high byte + carry W $01:BC9D STA.W RAM_SpriteXHi,X ; Sprite X high = block X high W $01:BE2D STA.W RAM_SpriteXHi,X ; Sprite X high byte (carry from the add) W $01:BF3F STA.W RAM_SpriteXHi,Y ; New X high = this sprite's X high W $01:C760 STA.W RAM_SpriteXHi,X ; Sprite X += $0078 (16-bit) W $01:CD83 STA.W RAM_SpriteXHi,X ; Sprite X high = 1 R $01:CEBF CMP.W RAM_SpriteXHi,X ; Mario on the side of the sprite's X high byte? No: go to CEDC R $01:D077 LDA.W RAM_SpriteXHi,X ; [$00]/[$01] = Koopa Kid X position R $01:D359 LDA.W RAM_SpriteXHi,X ; X high W $01:D35F STA.W RAM_SpriteXHi,X ; X high -= borrow W $01:D372 STA.W RAM_SpriteXHi,X ; Store X high R $01:D412 LDA.W RAM_SpriteXHi,X ; Boss X high R $01:D472 LDA.W RAM_SpriteXHi,X ; X high R $01:D610 LDA.W RAM_SpriteXHi,X ; X high W $01:D617 STA.W RAM_SpriteXHi,X ; Store X high W $01:D6B6 STA.W RAM_SpriteXHi,X ; Store X high R $01:D6FD LDA.W RAM_SpriteXHi,X ; X high W $01:D702 STA.W RAM_SpriteXHi,X ; X high -= 1 with borrow R $01:D8B1 LDA.W RAM_SpriteXHi,X ; $08-$0B = current sprite Y and X (saved so a bad probe can be undone) W $01:DADA STA.W RAM_SpriteXHi,X ; Restore X high W $01:DB39 STA.W RAM_SpriteXHi,X ; Restore X high W $01:DDC8 STA.W RAM_SpriteXHi,X ; Sprite X high = 0 W $01:E1C4 STA.W RAM_SpriteXHi,X ; Store it W $01:E82F STA.W RAM_SpriteXHi,X ; Cloud X (high) = Mario X high W $01:E86C STA.W RAM_SpriteXHi,X ; Cloud X (high) = Mario X high W $01:E8B2 STA.W RAM_SpriteXHi,Y ; Lakitu X (high) = cloud X high W $01:EA42 STA.W RAM_SpriteXHi,Y ; New sprite X high = spawner's X high W $01:EB5E STA.W RAM_SpriteXHi,X ; Yoshi X high = Mario X high + carry W $01:ECB0 STA.W RAM_SpriteXHi,Y ; Store W $01:EF52 STA.W RAM_SpriteXHi,X ; ... high byte from DATA_01EE2D W $01:EF88 STA.W RAM_SpriteXHi,X ; Restore X position hi W $01:F210 STA.W RAM_SpriteXHi,Y ; Item X hi = Yoshi X hi + DATA_01F307[dir] R $01:F4DE ADC.W RAM_SpriteXHi,X ; Add Yoshi's X high (with carry) W $01:F4E4 STA.W RAM_SpriteXHi,Y ; Eaten sprite X high R $01:F546 ADC.W RAM_SpriteXHi,X ; Add Yoshi's X high W $01:F5D8 STA.W RAM_SpriteXHi,Y ; New Pokey X high W $01:FDDE STA.W RAM_SpriteXHi,Y ; Ball X high = 0 W $02:864A STA.W RAM_SpriteXHi,X ; Sprite X high = [$95+X] (indexed by X, probably a bug: only right for X = 0) W $02:8978 STA.W RAM_SpriteXHi,X ; Sprite X high = block X high W $02:A94D STA.W RAM_SpriteXHi,X ; X position high = bits 0, 2 and 3 of the first byte (extra bits ride along) W $02:A96E STA.W RAM_SpriteXHi,X ; X position = adjusted screen boundary [$00]/[$01] W $02:AC2D STA.W RAM_SpriteXHi ; Copy X position high W $02:AF5F STA.W RAM_SpriteXHi,X ; Set X high W $02:AFD2 STA.W RAM_SpriteXHi,X ; Set X high W $02:B075 STA.W RAM_SpriteXHi,X ; Sprite X high W $02:B0C2 STA.W RAM_SpriteXHi,X ; Sprite X high W $02:B139 STA.W RAM_SpriteXHi,Y ; Sprite X high W $02:B19F STA.W RAM_SpriteXHi,X ; Sprite X high W $02:B1FF STA.W RAM_SpriteXHi,X ; Sprite X high W $02:B246 STA.W RAM_SpriteXHi,X ; Sprite X high W $02:B2C4 STA.W RAM_SpriteXHi,X ; Sprite X high W $02:B316 STA.W RAM_SpriteXHi,X ; Sprite X high W $02:B383 STA.W RAM_SpriteXHi,X ; Sprite X high R $02:B843 LDA.W RAM_SpriteXHi,X ; New sprite X = Pokey X R $02:B96D LDA.W RAM_SpriteXHi,X ; [$00]/[$01] = sprite X (16-bit) R $02:C1B3 LDA.W RAM_SpriteXHi,X ; $00/$01 = Chuck X position R $02:C482 LDA.W RAM_SpriteXHi,X ; $00/$01 = Chuck X position W $02:C5D4 STA.W RAM_SpriteXHi,Y ; Clone X position high = this Chuck's R $02:CC45 LDA.W RAM_SpriteXHi,X ; [$00] = sprite X (16 bit) R $02:D069 SBC.W RAM_SpriteXHi,X ; Subtract sprite X high R $02:D382 LDA.W RAM_SpriteXHi,X ; A = sprite X high R $02:D38C LDA.W RAM_SpriteXHi,X ; A = sprite X high R $02:D403 ADC.W RAM_SpriteXHi,X ; Sprite X position (16-bit) += [$17BD] W $02:D43A STA.W RAM_SpriteXHi,X ; Sprite X high = $FF R $02:D4B3 LDA.W RAM_SpriteXHi,X ; A = sprite X high R $02:D505 SBC.W RAM_SpriteXHi,X ; Minus sprite X high with borrow R $02:D6D2 LDA.W RAM_SpriteXHi,X ; Save sprite X (16-bit) R $02:D6FB LDA.W RAM_SpriteXHi,X ; A = sprite X high W $02:D700 STA.W RAM_SpriteXHi,X ; Store sprite X high R $02:E2C7 LDA.W RAM_SpriteXHi,X ; Block X = sprite X W $02:E4CB STA.W RAM_SpriteXHi,X ; X position hi = [$1602] (partner platform X hi) W $02:E4DB STA.W RAM_SpriteXHi,X ; Restore X position hi R $02:E53C LDA.W RAM_SpriteXHi,X ; Block X position = sprite X position R $02:E8CF LDA.W RAM_SpriteXHi,X ; Block X = sprite X W $02:EB0A STA.W RAM_SpriteXHi,Y ; New sprite X high W $02:EDC1 STA.W RAM_SpriteXHi,Y ; New X high with carry W $02:EF8D STA.W RAM_SpriteXHi,Y ; Copy X high W $02:F569 STA.W RAM_SpriteXHi,X ; X high = 0 W $02:F951 STA.W RAM_SpriteXHi ; Sprite 0 X high = cluster X high W $02:FC0B STA.W RAM_SpriteXHi ; Re-anchor X position to the current screen (probably), copy to sprite 0 position vars W $03:8B05 STA.W RAM_SpriteXHi,Y ; New sprite X = statue X +/- $10 R $03:9041 LDA.W RAM_SpriteXHi,X ; Extended sprite X position = sprite X (low, high) R $03:934D LDA.W RAM_SpriteXHi,X ; A = X high W $03:9353 STA.W RAM_SpriteXHi,X ; Store X high W $03:9373 STA.W RAM_SpriteXHi,X ; Store X high W $03:98AF STZ.W RAM_SpriteXHi ; Slot 0 X position = $00C0 (position of the Reznor sign) W $03:99C2 STA.W RAM_SpriteXHi,X ; Sprite X position high W $03:9ADE STA.W RAM_SpriteXHi,Y ; Copy X position to the new sprite R $03:9B18 LDA.W RAM_SpriteXHi,X ; A = Reznor X high R $03:9C9A LDA.W RAM_SpriteXHi,X ; A = X position high W $03:9CA0 STA.W RAM_SpriteXHi,X ; X position high R $03:9F6F LDA.W RAM_SpriteXHi,X ; Remember home X high W $03:A020 STA.W RAM_SpriteXHi,X ; X high W $03:A107 STA.W RAM_SpriteXHi,X ; X high = 0 R $03:A78D LDA.W RAM_SpriteXHi,X ; Bowser X high byte R $03:AB36 LDA.W RAM_SpriteXHi,X ; Compare Bowser X to Mario X (16-bit) W $03:B05F STA.W RAM_SpriteXHi,Y ; X high = Bowser X high + DATA_03B015[X] (carry) R $03:B822 SBC.W RAM_SpriteXHi,X ; 16-bit borrow: sign of the high byte tells which side Mario is on R $03:B89B SBC.W RAM_SpriteXHi,X ; A = (screen X + limit) - sprite X, high byte (16-bit subtract) W $03:C1E3 STA.W RAM_SpriteXHi,X ; Store it W $03:C2F5 STA.W RAM_SpriteXHi,X ; Sprite X position = Mario X position W $03:C7DC STA.W RAM_SpriteXHi,Y ; X high = 0 W $03:CD12 STA.W RAM_SpriteXHi,Y ; Copy X high W $0C:A008 STZ.W RAM_SpriteXHi ; Sprite slot 0 X high = 0 W $0C:A27A STA.W RAM_SpriteXHi ; Yoshi X high byte No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) $14EC Sprite Y sub-pixel fraction byte table, one per sprite slot (index X) Fractional part of a sprite's Y position, in 1/16 pixel units. The Y update routines add speed * 16 to it each frame and carry into the whole-pixel Y position. Cleared when the sprite tables are reset.
5 uses in 3 routines (2 read, 3 write) R $01:ABE1 ADC.W $14EC,X ; Add to sub-pixel accumulator [$14EC,X] (1/16 pixel units) R $02:D29B ADC.W $14EC,X ; Y fraction [$14EC+X] += speed * 16 (carry kept) W $07:F75B STZ.W $14EC,X ; Sprite Y fraction bits = 0 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $07:F756 STZ.W $14F8,X ; Sprite X fraction bits = 0 $1504 Chained platform swing speed byte table, one per sprite slot (index X) Angular speed of the brown swinging chained platform. Moves one step toward 0 each update (friction), and Mario standing on it adds or subtracts 1 so his weight pumps the swing. Read when advancing the angle. Cleared with the other per-sprite tables.
8 uses in 4 routines (5 read, 3 write) W $01:C792 STA.W $1504,X ; Swing speed [$1504,X] moves one step toward 0 (friction) W $01:CA98 STA.W $1504,X ; Otherwise speed += 1 or -1: Mario's weight pumps the swing No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $01:CCFB STA.W $1510,X ; Angle fraction [$1510,X] += A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $02:A4A1 STZ.W $151B,X ; Clear a Yoshi sprite table entry ($151C) $151C Sprite misc table 1 byte table, one per sprite slot (index X) General-purpose per-sprite byte whose meaning depends on the sprite type. Examples: main state of the Koopa Kids, Ludwig and Bowser; hop counter of the winged Goomba; Yoshi tongue length; burst expansion rate of a firework; angle low of the brown chained platform; damping counter of the wall springboard; angry flag of the Wiggler.
209 uses in 128 routines (104 read, 79 write, 26 read-modify-write) W $01:83BD STA.W $151C,X ; [$151C,X] = Y position high W $01:8421 STA.W $151C,X ; [$151C,X] = direction bit W $01:8522 STA.W $151C,X ; [$151C,X] = DATA_018526[Y] W $01:855A STA.W $151C,X ; [$151C,X] = 4 (falls into InitBomb) W $01:8B54 STZ.W $151C,X ; [$151C,X] = 0 (clear ledge-turn flag) W $01:8BAD STA.W $151C,X ; [$151C,X] = 1 (turned already) RW $01:8D1F INC.W $151C,X ; Reverse the ramp direction R $01:8D50 LDA.W $151C,X ; Hop counter [$151C,X] R $01:8D7A LDA.W $151C,X ; Hop counter zero? RW $01:8D87 INC.W $151C,X ; Hop counter++ W $01:8D93 STZ.W $151C,X ; Reset hop counter RW $01:A9BA INC.W $151C,X ; Sprite $02: [$151C,X]++ R $01:AB17 LDY.W $151C,X ; Y = switch color (0 blue, 1 silver) from [$151C,X] W $01:AD61 STA.W $151C,X ; [$151C,X] = (X >> 4) & 3: staggers the flight phase R $01:AE2D LDY.W $151C,X ; Y = [$151C] (block contents type) W $01:AE98 STA.W $151C,X ; Remember the spawn Y position in [$151C] R $01:AF2E CMP.W $151C,X ; At the original Y position [$151C]? If not, rise RW $01:B00E INC.W $151C,X ; [$151C] = 1 (vertical swimmer) R $01:B0B6 LDY.W $151C,X ; Y = [$151C] (0 horizontal, 1 vertical) W $01:B1BB STA.W $151C,X ; [$151C] = previous in-water flag W $01:B238 STA.W $151C,X ; [$151C] = 3 (tries left) RW $01:B295 INC.W $151C,X ; Reverse direction: [$151C]++ W $01:B5ED STA.W $151C,X ; Compare on-platform flag with last frame's ([$151C]) and save it; same: skip W $01:C081 STA.W $151C,X ; [$151C,X] = X high byte (minus borrow) RW $01:C236 INC.W $151C,X ; Flip bob direction: [$151C,X]++ W $01:C319 STA.W $151C,X ; [$151C,X] = 1 (flag read by PowerUpRt: spawned from a block/box) W $01:C74C STA.W $151C,X ; [$151C,X] = $80 W $01:C7A3 STA.W $151C,X ; Angle low = 0 - [$151C,X] W $01:C7BE STA.W $151C,X ; Restore the real angle low byte W $01:CD13 STA.W $151C,X ; Angle low [$151C,X] += step + carry RW $01:CE30 INC.W $151C,X ; Main state = 1 (drop in) RW $01:CE3A INC.W $151C,X ; Main state = 1 (drop in) RW $01:CE53 INC.W $151C,X ; Main state = 2 (fight) W $01:CFB9 STA.W $151C,X ; Main state [$151C] = 2 (fight again) W $01:CFD7 STA.W $151C,X ; Main state [$151C] = 4 (defeated) RW $01:D03A INC.W $151C,X ; Main state [$151C] = 5 R $01:D2A8 LDA.W $151C,X ; Sprite state [$151C] W $01:D3A8 STA.W $151C,X ; State [$151C] = 3 (stomped, stunned) R $01:D3B1 LDA.W $151C,X ; State [$151C] R $01:D51A LDA.W $151C,X ; [$151C] (set when it touches a wall) W $01:D6A3 STA.W $151C,X ; [$151C] = 1: stop swaying R $01:D7B5 LDA.W $151C,X ; Line table pointer low [$151C] W $01:D8D0 STA.W $151C,X ; [$151C] = low byte of the line table pointer for this segment W $01:E058 STA.W $151C,X ; Remember spawn Y position high: [$151C] R $01:E0ED SBC.W $151C,X ; Same for the high byte W $01:E1E6 STA.W $151C,X ; [$151C] = key slot ($FF if none) R $01:E7F9 LDA.W $151C,X ; A = [$151C] (falling flag) W $01:E836 STA.W $151C,X ; [$151C] = $10: cloud keeps falling R $01:EA09 ORA.W $151C,Y ; Every 128 frames when Lakitu's [$151C] = 0... W $01:ECDC STA.W $151C,X ; New sprite's [$151C] = [$18DA] (what Yoshi swallowed) W $01:F1D3 STZ.W $151C,X ; Tongue length = 0 W $01:F31A STA.W $151C,X ; Tongue length [$151C,X] += 3 W $01:F33F STA.W $151C,X ; Store new length W $01:F344 STZ.W $151C,X ; Tongue fully in: length = 0 R $01:F43E LDA.W $151C,X ; Tongue length [$151C] ... R $01:F4BE ADC.W $151C,X ; Right: A = X offset + tongue length [$151C] R $01:F52C ADC.W $151C,X ; Right: A = X offset + tongue length W $01:F73A STZ.W $151C,X ; Clear tongue length $151C W $01:F78A STA.W $151C,X ; Remember what to spawn in $151C R $01:F83D LDA.W $151C,X ; A = sprite number stored in $151C W $02:89FE STA.W $151C,X ; Store in [$151C] W $02:8A32 STA.W $151C,X ; POW colour: [$151C] 0 blue, 1 silver W $02:AF76 STA.W $151C,X ; [$151C] = angle high (probably) RW $02:B2CC INC.W $151C,X ; [$151C]++ (sprite specific flag, probably marks the dolphin as generated) W $02:B80A STA.W $151C,X ; Remember the new bitmask in [$151C] W $02:C076 STA.W $151C,X ; [$151C] = chase timer W $02:C152 STA.W $151C,X ; Head frame [$151C] = 2 (looking front) W $02:C190 STA.W $151C,X ; Set the head frame W $02:C221 STA.W $151C,X ; Set head frame W $02:C39E STA.W $151C,X ; Set head frame W $02:C560 STA.W $151C,X ; Set head frame W $02:C697 STA.W $151C,X ; Store head pose [$151C] W $02:C6F2 STA.W $151C,X ; Head pose = table by direction W $02:C773 STA.W $151C,X ; Store head pose R $02:CDE4 LDY.W $151C,X ; Y = [$151C] (compression strength) RW $02:CE44 DEC.W $151C,X ; ...[$151C]-- (damp the oscillation) W $02:CFF2 STA.W $151C,X ; [$151C] = target compression R $02:D653 LDA.W $151C,X ; A = angle high RW $02:D955 INC.W $151C,X ; Yes: flip the phase RW $02:DBD4 INC.W $151C,X ; Yes: flip the Y phase W $02:DF9A STZ.W $151C,X ; [$151C] = 0 (pollen/flame animation flag) W $02:DFEB STA.W $151C,X ; Store [$151C] RW $02:E177 INC.W $151C,X ; [$151C]++ (stem animation counter) W $02:E2AD STA.W $151C,X ; Remember the wanted direction in [$151C] R $02:E514 SBC.W $151C,X ; Subtract the Y hi difference (carry from the CMP) R $02:E577 ADC.W $151C,X ; Partner Y hi ([$151C]) += sign extension (partner moves opposite to this platform) W $02:E6E4 STZ.W $151C,X ; [$151C] = 0: bait is gone R $02:EBAE LDA.W $151C,X ; Count frames in [$151C] RW $02:F28F INC.W $151C,X ; Angry flag [$151C] = 1 RW $02:F482 INC.W $151C,X ; ...age [$151C]++ RW $03:8163 INC.W $151C,X ; [$151C]++: reverse the X acceleration W $03:87D4 STA.W $151C,X ; Graphics direction [$151C] = walking direction RW $03:894F INC.W $151C,X ; Reverse vertical direction (bob up and down) W $03:8C62 STA.W $151C,X ; [$151C] = sprite X low before moving (reference for Mario's position on the slope) R $03:92EC LDA.W $151C,X ; [$151C] = mode: 0 creating, non-zero eating R $03:9475 LDY.W $151C,X ; Y = [$151C] (0 = normal, non-zero = reverse direction) R $03:9AAF ORA.W $151C,X ; Return if sprites are locked or this Reznor is already dead RW $03:9AC3 INC.W $151C,X ; [$151C,X]++: mark this Reznor as dead W $03:9D75 STA.W $151C,X ; [$151C,X] = flame size R $03:9EA9 LDA.W $151C,X ; A = [$151C] (flame length index; 0 = longest) R $03:9F25 LDY.W $151C,X ; Y = flame length index W $03:9F72 STA.W $151C,X ; [$151C] = X high R $03:A01D LDA.W $151C,X ; Restore X high from [$151C] R $03:A308 LDA.W $151C,X ; A = Bowser state [$151C] R $03:A325 LDA.W $151C,X ; A = Bowser state W $03:ABB1 STA.W $151C,X ; Bowser phase [$151C] = 5 (hold in place) W $03:ABE7 STA.W $151C,X ; Bowser phase [$151C] = 6 RW $03:ADBF INC.W $151C,X ; Unused. Sets the flag [$151C] when Peach already touches Mario. R $03:C8B8 ADC.W $151C,X ; Burst size [$1570] += expansion rate [$151C] W $03:C8CF STA.W $151C,X ; Rate -= 1 (expansion slows down) RW $03:CCD6 INC.W $151C,X ; State + 1 (rise out of the pipe) W $03:CDD6 STA.W $151C,X ; State = 3 (sink back) W $03:CDFD STZ.W $151C,X ; State = 0 (main sprite picks a new pipe) W $03:CE1F STA.W $151C,X ; Third stomp: state = 5 (fall) W $03:CE76 STA.W $151C,X ; State = 6 (landed) W $03:CEDD STA.W $151C,X ; State = 4 (stomped) $1520 Reznor1Dead RAM_Reznor1DeadNo description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 read) R $03:98F6 ADC.W RAM_Reznor1Dead ; A = number of dead Reznors (sum of the four dead flags); all four dead? $1521 Reznor2Dead RAM_Reznor2DeadNo description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 read) $1522 Reznor3Dead RAM_Reznor3DeadNo description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 read) $1523 Reznor4Dead RAM_Reznor4DeadNo description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 read) R $03:D717 ADC.W RAM_Reznor4Dead ; A = number of dead Reznors (flags [$1520]-[$1523]) $1528 Sprite misc table 2 byte table, one per sprite slot (index X) General-purpose per-sprite byte, meaning depends on the sprite type. Examples: phase counter of Dry Bones, face state of the Thwomp, hit count of a Chuck, angle high of the brown chained platform (also the Mode 7 rotated check), line table pointer high byte for line guides, animation frame of the Urchin. For several platforms it holds the X movement since last frame, which carries Mario along.
89 uses in 57 routines (32 read, 43 write, 14 read-modify-write) R $01:89B4 LDA.W $1528,X ; [$1528,X] flag W $01:8A0F STZ.W $1528,X ; Clear [$1528,X] W $01:8A29 STA.W $1528,Y ; Kicked sprite [$1528] = $0A R $01:8BB0 LDA.W $1528,X ; [$1528,X] (state flag) W $01:9762 STA.W $1528,Y ; New sprite [$1528] = $10 (do not stun it right away) W $01:A796 STZ.W $1528,X ; Clear $1528,X W $01:AD8D STZ.W $1528,X ; [$1528] = 0 (riding carry delta, set again below) W $01:ADF2 STA.W $1528,X ; [$1528] = [$1491] (X movement this frame, carries Mario) W $01:AE4D STA.W $1528,Y ; Spawned sprite [$1528] = 1 W $01:AED4 STZ.W $1528,X ; Face [$1528] = 0 (neutral) W $01:AEE2 STA.W $1528,X ; Face [$1528] = 1 (Mario near: show eyes) W $01:AEF0 STA.W $1528,X ; Face [$1528] = 2 (angry face) W $01:AF29 STZ.W $1528,X ; Face [$1528] = 0 (neutral) W $01:B2B9 STA.W $1528,X ; [$1528] = [$1491] (X movement that carries Mario) W $01:B547 STA.W $1528,X ; Unused: [$1528] = [$1491] (probably carry amount for Mario) W $01:C086 STA.W $1528,X ; [$1528,X] = sprite Y low: anchor Y RW $01:C728 INC.W $1528,X ; Reverse swing: [$1528,X]++ W $01:C751 STA.W $1528,X ; [$1528,X] = 1 W $01:C7AD STA.W $1528,X ; Angle high = (2 - [$1528,X] - borrow) & 1: angle is mirrored (negated mod $200) for drawing W $01:C7BA STA.W $1528,X ; Restore the real angle high byte W $01:CD1A STA.W $1528,X ; Angle high [$1528,X] += sign extension + carry RW $01:CEA5 INC.W $1528,X ; Sub-state [$1528]++ (next: walk) RW $01:CEC4 INC.W $1528,X ; Sub-state [$1528]++ (jump) W $01:CF29 STZ.W $1528,X ; Sub-state [$1528] = 0 (stand) RW $01:D211 INC.W $1528,X ; Yes: sub-state [$1528]++ (drop on Mario) W $01:D248 STZ.W $1528,X ; [$1528] = 0 (reset counter) R $01:D7BA LDA.W $1528,X ; Pointer high [$1528] W $01:D8D6 STA.W $1528,X ; [$1528] = high byte of the line table pointer R $01:DAEA LDY.W $1528,X ; Y = old [$1528] W $01:DB40 STA.W $1528,X ; Restore [$1528] W $01:E052 STA.W $1528,X ; Remember spawn Y position low: [$1528] RW $01:E586 INC.W $1528,X ; Odd frame: [$1528]++ (phase counter) RW $01:E58E INC.W $1528,X ; Wrapped: [$1528] = 1 RW $02:A0FC INC.W $1528,X ; Chuck: hit count [$1528]++ W $02:BBA4 STA.W $1528,X ; [$1528] = A (probably X movement this frame, used to carry Mario) RW $02:BF61 INC.W $1528,X ; [$1528]++ (next animation frame) RW $02:C0E5 DEC.W $1528,X ; Spawn timer [$1528]-- W $02:C0ED STA.W $1528,X ; Reload spawn timer = $28 RW $02:C7E8 INC.W $1528,X ; Stomp count [$1528]++ R $02:CDF1 LDA.W $1528,X ; A = [$1528] (state) RW $02:CE17 INC.W $1528,X ; State = 2 (spring back) W $02:CE88 STZ.W $1528,X ; State = 0 (idle) R $02:CFCE LDA.W $1528,X ; A = [$1528] (state) W $02:CFF7 STA.W $1528,X ; State = 1 (compress) W $02:DBDD STA.W $1528,X ; [$1528] = X movement (probably lets Mario ride along) W $02:E551 STZ.W $1528,X ; Clear [$1528] (Mario-on-sprite carry flag, probably) RW $03:817F INC.W $1528,X ; [$1528]++: reverse the Y acceleration W $03:8646 STA.W $1528,X ; Store A in [$1528] (never read by this sprite) W $03:8DE0 STA.W $1528,X ; [$1528] = A (never used) W $03:8DF7 STA.W $1528,X ; [$1528] = [$1491] (never used) W $03:8EA0 STA.W $1528,X ; [$1528] = A (never used) W $03:92D6 STZ.W $1528,X ; Clear [$1528,X] (so Mario is not carried like on a platform) W $03:9F77 STA.W $1528,X ; [$1528] = X low R $03:A023 LDA.W $1528,X ; Restore X low from [$1528] RW $03:A4B8 INC.W $1528,X ; Yes: reverse the X acceleration direction ([$1528]++) W $03:A715 STZ.W $1528,X ; X accel stage [$1528] = 0 R $03:A731 LDY.W $1528,X ; Y = X accel stage [$1528] RW $03:A74C INC.W $1528,X ; Yes: next stage W $03:CCCC STA.W $1528,X ; [$1528] = table index (0-8) $1534 Sprite misc table 3 RAM_BlinkFallFlag byte table, one per sprite slot (index X) General-purpose per-sprite byte, meaning depends on the sprite type (source label BlinkFallFlag). Examples: bubble life timer, line guide step index, phase of the Diggin Chuck, collapsed flag of Dry Bones, number of rockets launched in the fireworks, bob direction of clouds and the flying question block (INC to reverse), window timer of the wall springboard, time counter of Iggy/Larry.
105 uses in 59 routines (55 read, 25 write, 25 read-modify-write) W $01:8383 STA.W $1534,X ; [$1534,X] = $40 W $01:83B7 STA.W $1534,X ; [$1534,X] = Y position low (remember the start) RW $01:8547 INC.W $1534,X ; [$1534,X] += 1 RW $01:8569 DEC.W $1534,X ; [$1534,X] -= 1 R $01:8A15 LDA.W $1534,X ; [$1534,X]: kicking something? W $01:8A24 STZ.W $1534,X ; Clear [$1534,X] W $01:8A70 STZ.W $1534,X ; Clear [$1534,X] R $01:8AE5 LDA.W $1534,X ; Exploding flag [$1534,X] R $01:8BA3 ORA.W $1534,X ; If any of [$151C,X], [$1558,X], [$1528,X], [$1534,X] is non-zero, skip the turn (flags not explained) W $01:9638 STA.W $1534,X ; [$1534] = 1 (exploding) RW $01:ADDE INC.W $1534,X ; Reverse the direction: [$1534]++ W $01:C094 STA.W $1534,X ; [$1534,X] = Y high byte, anchor W $01:CD89 STA.W $1534,X ; Walk limit [$1534] = $26 (left wall X) RW $01:D176 INC.W $1534,X ; Left walk limit [$1534]++ R $01:D771 LDY.W $1534,X ; Y = step index [$1534] RW $01:D777 INC.W $1534,X ; Step index++ RW $01:D784 INC.W $1534,X ; Fast variants: extra step every other frame W $01:D8E0 STZ.W $1534,X ; [$1534] = 0: step counter starts at the beginning R $01:E43E LDA.W $1534,X ; [$1534] (collapsed flag) = 0: walking, go to $01E4C0 W $01:E44B STZ.W $1534,X ; Timer expired: [$1534] = 0, sprite stands up again RW $01:E5FB INC.W $1534,X ; [$1534]++: sprite collapses into a bone pile RW $01:E9E3 INC.W $1534,X ; [$1534]++: reverse bobbing direction W $01:F5F7 STA.W $1534,Y ; New Pokey flag $1534 = 1 W $01:F878 STA.W $1534,X ; Store direction in $1534 RW $01:FB0B INC.W $1534,X ; Time counter [$1534]++ RW $02:806D INC.W RAM_BlinkFallFlag,X ; [RAM_BlinkFallFlag] = 1: sprite blinks and falls through tiles R $02:B672 LDA.W $1534,X ; [$1534] = 0 (normal Pokey)? W $02:B878 STA.W $1534,Y ; [$1534] = 1: flag as a detached segment W $02:C14A STA.W $1534,X ; Phase [$1534] = 4 RW $02:C69B INC.W $1534,X ; Reverse scan direction: [$1534]++ R $02:CDD5 LDA.W $1534,X ; A = [$1534] (timer: window in which A gives a higher bounce) RW $02:CDDA DEC.W $1534,X ; Count the timer down W $02:CDE1 STZ.W $1534,X ; Clear the timer W $02:CFE0 STA.W $1534,X ; [$1534] = 8: window for the high bounce (A button) R $02:D6F0 SBC.W $1534,X ; [$1528+X] = X movement since last frame (carries Mario) W $02:D6F7 STA.W $1534,X ; [$1534+X] = this frame's X low R $02:D8E8 LDA.W $1534,X ; A = [$1534] (bubble life timer, counts down after the bubble pops) RW $02:D90E DEC.W $1534,X ; Timer [$1534]-- R $02:D911 LDA.W $1534,X ; A = new timer value W $02:D974 STA.W $1534,X ; Start popping: [$1534] = 6 RW $02:DBBE INC.W $1534,X ; Yes: flip the X phase R $02:E50C CMP.W $1534,X ; Compare this platform's Y lo with partner's [$1534] R $02:E570 ADC.W $1534,X ; Partner Y lo ([$1534]) += A R $02:E84E SBC.W $1534,X ; Y = Y - [$1534] RW $03:819B INC.W $1534,X ; Hit counter [$1534]++ R $03:9300 LDY.W $1534,X ; Y = path step index [$1534] RW $03:9303 INC.W $1534,X ; Next step index W $03:9F7D STA.W $1534,X ; [$1534] = Y high R $03:A028 LDA.W $1534,X ; Restore Y high from [$1534] RW $03:A4CE INC.W $1534,X ; Yes: reverse the Y acceleration direction ([$1534]++) W $03:A718 STZ.W $1534,X ; Y accel stage [$1534] = 0 R $03:A74F LDY.W $1534,X ; Y = Y accel stage [$1534] RW $03:A76A INC.W $1534,X ; Yes: next stage RW $03:C4FD INC.W $1534,X ; Mark as initialized RW $03:C80C INC.W $1534,X ; Rockets launched [$1534]++ R $03:C84C LDY.W $1534,X ; Y = rocket number R $03:C8B1 LDY.W $1534,X ; Y = rocket number RW $03:CE13 INC.W $1534,X ; Stomp count [$1534] + 1 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 read) R $00:F939 LDA.W $153D ; A = [$153D] & $FF $1540 Sprite timer 1 byte table, one per sprite slot (index X) General-purpose countdown timer for each sprite slot, the most used of the sprite timers. Sprites set it to a frame count and the main routine counts it down by one per frame (when sprites are not locked) and acts when it reaches zero. Meaning is per sprite type: Dry Bones reassemble time, Bob-omb explosion timer ($40), Chuck charge time ($20), Ludwig timer ($30), Mario-contact stun ($FF).
Values: 0 = timer expired / not running.
347 uses in 157 routines (189 read, 153 write, 5 read-modify-write) W $00:FABB STA.W $1540,Y ; Coin animation timer [$1540,Y] = $10 R $00:FBC8 LDA.W $1540,X ; A = [$1540,X] (smoke puff timer) R $00:FBDF LDA.W $1540,X ; A = [$1540,X] (smoke timer) W $01:8379 STA.W $1540,X ; [$1540,X] = $70 timer W $01:84E5 STA.W $1540,X ; [$1540,X] = $10 timer W $01:850A STA.W $1540,X ; [$1540,X] = $30 timer W $01:855F STA.W $1540,X ; [$1540,X] = $FF timer W $01:8594 STA.W $1540,X ; [$1540,X] = random number & $1F R $01:8A7D LDA.W $1540,X ; Its timer [$1540] W $01:8A84 STA.W $1540,X ; Non-zero: [$1540] = $FF R $01:8AEA LDA.W $1540,X ; Fuse timer [$1540,X] W $01:8AF6 STA.W $1540,X ; Fuse timer [$1540,X] = $40 frames R $01:8CFD LDA.W $1540,X ; Pause timer [$1540,X] W $01:8D24 STA.W $1540,X ; Pause timer [$1540,X] = $30 R $01:8D82 LDA.W $1540,X ; Wait timer [$1540,X] R $01:8EB1 LDA.W $1540,X ; State timer [$1540,X] W $01:8EE9 STA.W $1540,X ; Timer [$1540,X] = time for this state R $01:8F2B LDA.W $1540,X ; Timer [$1540,X] W $01:8F40 STA.W $1540,X ; Timer [$1540,X] = $20 | (random & $1F) R $01:9023 LDA.W $1540,X ; Timer [$1540,X] W $01:963D STA.W $1540,X ; [$1540] = $40: explosion timer W $01:9AD2 STA.W $1540,X ; ... with smoke timer [$1540] = $1F W $01:A983 STA.W $1540,X ; Timer [$1540,X] = $FF W $01:A990 STA.W $1540,X ; Timer [$1540,X] = $80 W $01:A9DA STA.W $1540,X ; Timer [$1540,X] = $20 (time before the smushed sprite disappears) W $01:A9FD STA.W $1540,Y ; Cloud timer [$1540,Y] = $1F (cloud disappears) W $01:AA0F STZ.W $1540,X ; Timer [$1540,X] = 0 W $01:AA2A STA.W $1540,X ; Store stun timer in [$1540,X] R $01:AA9A LDA.W $1540,X ; A = timer [$1540,X] W $01:ADE3 STA.W $1540,X ; Pause the horizontal acceleration for $20 frames W $01:AF1E STA.W $1540,X ; Wait timer [$1540] = $40 frames W $01:B003 STA.W $1540,X ; Wait timer [$1540] = $40 frames W $01:B0C5 STA.W $1540,X ; Turn timer [$1540] = $80 frames W $01:B1D6 STA.W $1540,X ; Timer [$1540] = $10 W $01:B1F7 STA.W $1540,X ; Timer [$1540] = $10 W $01:B2A2 STA.W $1540,X ; Set the pause timer [$1540] W $01:B6D4 STA.W $1540,X ; Pause timer [$1540] = $40 W $01:B706 STA.W $1540,X ; Pause timer [$1540] = $40 R $01:B97F LDA.W $1540,X ; A = turn-around timer [$1540] W $01:BA34 STA.W $1540,X ; Off the net: turn-around timer = $50 W $01:BAE4 STA.W $1540,X ; Door animation timer [$1540] = $1F R $01:BB16 LDA.W $1540,X ; A = door timer R $01:BE03 LDA.W $1540,X ; Cooldown timer [$1540] still running? R $01:BE7B LDA.W $1540,X ; Wait timer [$1540,X] R $01:BFE3 LDA.W $1540,X ; Fade-out step: timer [$1540,X] W $01:BFEA STA.W $1540,X ; Timer = 2 frames per step W $01:BFFB STA.W $1540,X ; Cooldown timer = $10 before it can reappear R $01:C004 LDA.W $1540,X ; Fade-in step: timer [$1540,X] W $01:C00B STA.W $1540,X ; Timer = 4 frames per step W $01:C024 STA.W $1540,X ; Visible timer = $70 R $01:C0A7 LDA.W $1540,X ; Timer [$1540,X] running? R $01:C175 LDA.W $1540,X ; Hit: timer [$1540,X] running? W $01:C2C2 STZ.W $1540,X ; [$1540,X] = 0 W $01:CD4A STA.W $1540,X ; Spawn delay timer [$1540] = $80 W $01:CEAA STA.W $1540,X ; Timer [$1540] = $FF W $01:CECF STA.W $1540,X ; Timer [$1540] = $30 W $01:CFDC STA.W $1540,X ; Timer [$1540] = $13 W $01:D03F STA.W $1540,X ; Timer [$1540] = $30 W $01:D0B9 STA.W $1540,Y ; New sprite timer [$1540] = $30 R $01:D23F LDA.W $1540,X ; Sprite timer [$1540]; non-zero = waiting after landing W $01:D2A0 STA.W $1540,X ; Wait timer [$1540] = $28 before the next move W $01:D3A3 STA.W $1540,X ; Timer [$1540] = $80 R $01:D455 LDA.W $1540,X ; Timer [$1540] (spawn-in delay) R $01:D5B8 LDA.W $1540,X ; Landing timer R $01:D645 LDA.W $1540,X ; Landing timer R $01:D659 LDA.W $1540,X ; Landing timer W $01:D66E STA.W $1540,X ; Timer [$1540] = $80 W $01:D6B2 STA.W $1540,X ; Landing timer = $20 RW $01:D6E0 INC.W $1540,X ; Timer [$1540]++ (marks line start) W $01:D713 STA.W $1540,X ; Timer [$1540] = 2 R $01:D819 LDA.W $1540,X ; Timer [$1540]: just placed or just left a line? W $01:D891 STA.W $1540,X ; [$1540] = $10: do not search for a new line for 16 frames R $01:D8E7 LDA.W $1540,X ; Timer [$1540] still running (just placed)? W $01:DA8C STZ.W $1540,X ; Clear the line search timer W $01:DB2E STZ.W $1540,X ; Mario boarded: clear [$1626] and the line search timer [$1540] R $01:DB4B LDA.W $1540,X ; Search timer [$1540] W $01:DE89 STA.W $1540,X ; [$1540] = $10: block bounce animation timer W $01:E077 STA.W $1540,X ; [$1540] = $20: wait before the first jump W $01:E0DF STA.W $1540,X ; Back in lava and falling: [$1540] = $60 + random (0-$3F), wait before the next jump W $01:E302 STA.W $1540,X ; [$1540] = time to wait before popping out R $01:E446 LDY.W $1540,X ; Y = [$1540] (reassemble timer) R $01:E48F LDA.W $1540,X ; A = [$1540] (reassemble timer) R $01:E502 LDA.W $1540,X ; Beetle: A = [$1540] (spike phase timer) R $01:E52D LDA.W $1540,X ; A = [$1540] (throw timer) W $01:E593 STA.W $1540,X ; Start the spike phase: [$1540] = $A0 W $01:E5B3 STA.W $1540,X ; ...start a bone throw: [$1540] = $3F W $01:E600 STA.W $1540,X ; [$1540] = $FF: stay collapsed for $FF frames R $01:E650 LDA.W $1540,X ; A = [$1540] (bounce timer, set when Mario lands) W $01:E6ED STA.W $1540,X ; Mario landed on top: start the bounce, [$1540] = $11 W $01:E7C2 STA.W $1540,X ; Lifetime over: [$1540] = $1F (vanish timer) R $01:E926 LDA.W $1540,X ; A = [$1540] (vanish timer) W $01:F753 STA.W $1540,X ; Timer $1540 = $20 (hatching delay) R $01:F799 LDA.W $1540,X ; Hatch timer $1540 W $01:F8FC STA.W $1540,X ; Re-check whether Mario faces the Boo every $20 frames W $02:8657 STA.W $1540,X ; [$1540] = $FF W $02:8A0A STA.W $1540,X ; [$1540] = $FF (Koopa stun timer) W $02:8A13 STA.W $1540,X ; [$1540] = $3E (time to rise out of the block) W $02:941B STA.W $1540,X ; [$1540] = $10 (timer) W $02:9445 STA.W $1540,X ; [$1540] = $FF (stun timer) W $02:B41E STA.W $1540,X ; [$1540] = $30: launch time, drawn behind objects W $02:B814 STA.W $1540,X ; Squish timer [$1540] = $0C W $02:BD6F STA.W $1540,X ; [$1540] = $80: moving time W $02:BDA1 STA.W $1540,X ; [$1540] = $40: pause before moving again W $02:BDE4 STA.W $1540,X ; [$1540] = corner timer W $02:C145 STA.W $1540,X ; Pause over: [$1540] = $30 R $02:C156 LDA.W $1540,X ; [$1540] = phase timer W $02:C16A STA.W $1540,X ; Start phase timer W $02:C1EF STA.W $1540,Y ; Timer [$1540] = $2C W $02:C3E1 STA.W $1540,X ; [$1540] = $3E R $02:C43A LDA.W $1540,X ; [$1540] (jump mode) R $02:C516 LDA.W $1540,X ; [$1540] = hop delay W $02:C51D STA.W $1540,X ; Hop delay = $20 R $02:C585 LDA.W $1540,X ; A = state timer [$1540] W $02:C5F9 STA.W $1540,Y ; Clone timer = $50 W $02:C614 STA.W $1540,X ; Yes: start the $40 frame countdown before acting W $02:C6D1 STA.W $1540,X ; Timer = $20 (charge time) W $02:C75D STA.W $1540,X ; Timer = step duration R $02:CD59 LDA.W $1540,X ; A = [$1540] (press animation timer) R $02:CE0F LDA.W $1540,X ; A = [$1540] (hold timer) W $02:CE36 STA.W $1540,X ; Hold timer [$1540] = 8 frames R $02:D422 LDA.W $1540,X ; Wait for the timer W $02:D42B STA.W $1540,X ; Timer = $80 frames W $02:D47B STA.W $1540,X ; Timer = $30 frames of rest W $02:D498 STA.W $1540,X ; Timer = $A0 frames until the next smash RW $02:D996 DEC.W $1540,X ; Bob-omb: [$1540]-- (probably shortens its fuse) R $02:DAA3 ORA.W $1540,X ; ...and no hammer was thrown in the last 3 frames W $02:DAAA STA.W $1540,X ; Set the minimum time between throws: [$1540] = 3 R $02:DCEF LDA.W $1540,X ; A = [$1540] timer R $02:DCFF LDA.W $1540,X ; A = timer [$1540] R $02:DD4D LDY.W $1540,X ; Y = stomp timer [$1540] R $02:DEB0 LDA.W $1540,X ; [$1540] = flame timer; non-zero: lightning has landed, run the flame phase W $02:DED3 STA.W $1540,X ; Flame timer [$1540] = $22 W $02:E171 STA.W $1540,X ; Timer = $50 (hang time at apex) R $02:E788 LDA.W $1540,X ; Timer [$1540] = 0: finished the jump W $02:E980 STA.W $1540,X ; Set timer [$1540] = A W $02:F28C STA.W $1540,X ; [$1540] = $40: flash timer before getting angry W $02:F3B3 STA.W $1540,X ; [$1540] = (random AND $1F) OR $0A: time to peck W $02:F577 STA.W $1540,X ; [$1540] = $20: delay before drifting sideways W $03:80CF STA.W $1540,X ; [$1540] = 8: delay between fade steps W $03:80F6 STA.W $1540,X ; [$1540] = $40 W $03:81C3 STA.W $1540,X :/ ; [$1540] = 8 W $03:81CF STA.W $1540,X ; [$1540] = $C0 W $03:820C STA.W $1540,X ; [$1540] = $40 W $03:8486 STA.W $1540,X ; [$1540] = $18: delay before accelerating W $03:8730 STA.W $1540,X ; Sink timer = $40 frames W $03:87A8 STA.W $1540,X ; [$1540] = $0A W $03:8AC3 STA.W $1540,X ; Wait timer = $30 frames W $03:8C42 STA.W $1540,X ; Phase timer [$1540] = $80 frames W $03:925E STA.W $1540,X ; Shake/stall timer [$1540] = $40 frames R $03:9262 LDA.W $1540,X ; Timer [$1540] still running? R $03:9441 LDA.W $1540,X ; State 2: timer [$1540] running? R $03:944E LDA.W $1540,X ; State 1: timer running? R $03:9458 LDA.W $1540,X ; State 0: timer running? W $03:9465 STA.W $1540,X ; Timer [$1540] = A R $03:946B LDA.W $1540,X ; State 3: timer running? W $03:95E5 STA.W $1540,X ; Timer [$1540] = $1F (spin kill animation) R $03:973C LDA.W $1540,X ; A = timer [$1540] R $03:9CAF LDA.W $1540,X ; A = fire timer [$1540,X] W $03:9CBC STA.W $1540,X ; Fire timer [$1540,X] = $FF R $03:9D43 LDA.W $1540,X ; A = fire timer [$1540,X] W $03:9D4C STA.W $1540,X ; Fire timer [$1540,X] = $40: walk for a while before breathing again R $03:9F5A ORA.W $1540,X ; Return if off-screen or wait timer [$1540] still running W $03:9F93 STA.W $1540,X ; Wait timer [$1540] = $50 R $03:9FA4 LDA.W $1540,X ; A = wait timer W $03:9FAD STA.W $1540,X ; Timer = $0A: sink for 10 frames W $03:A035 STA.W $1540,X ; Timer = $40 before it can rise again R $03:A446 LDA.W $1540,X ; Descent timer [$1540] = 0: still entering W $03:A6E9 STA.W $1540,Y ; Smoke cloud timer = $1F R $03:A6F8 LDA.W $1540,X ; Timer [$1540] R $03:A84D LDA.W $1540,X ; Timer [$1540] W $03:ABB6 STA.W $1540,X ; Phase timer [$1540] = $60 W $03:ABE2 STA.W $1540,X ; Phase timer [$1540] = $60 W $03:AD5E STA.W $1540,X ; Timer [$1540] = $A0 W $03:AE21 STA.W $1540,X ; Timer [$1540] = $60 W $03:AE2E STA.W $1540,X ; Timer [$1540] = $A0 W $03:AEC4 STA.W $1540,X ; Timer = delay for this step W $03:AECC STA.W $1540,X ; Timer [$1540] = $40 W $03:C376 STA.W $1540,X ; Hop timer [$1540] = $60 frames W $03:CC04 STA.W $1540,Y ; New [$1540] = $10 (sprite timer) W $03:CD28 STA.W $1540,X ; Timer expired: [$1540] = $40, state + 1 W $03:CE02 STA.W $1540,X ; Timer = $30 (wait before reappearing) R $07:F1CA LDA.W $1540,X ; A = bonus display timer [$1540,X] W $07:F73F STZ.W $1540,X ; $1540,X = 0 (timer) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $02:9468 STA.W $1549 ; Lakitu: [$1549] = $1F $154C Sprite interaction disable timer RAM_DisableInter byte table, one per sprite slot (index X) Countdown during which the sprite cannot touch Mario. Set after a stomp, bounce or kick (8 or $10 frames) so the same contact is not processed twice, after being hit by a bounce block, and by bosses (Bowser $20, Iggy/Larry stun $18). Non-zero means skip Mario contact; the sprite routines count it down. A few sprites reuse it as a plain wait timer (Bird turn delay, Keyhole, Bonus game flash).
Values: 0 = interaction enabled.
62 uses in 37 routines (25 read, 36 write, 1 read-modify-write) W $00:FB7A STA.W RAM_DisableInter,Y ; Interaction disabled for $20 frames W $01:975F STA.W RAM_DisableInter,Y ; New sprite no-contact timer = $10 W $01:97A9 STA.W RAM_DisableInter,Y ; Coin no-contact timer = $20 W $01:A0A8 STA.W RAM_DisableInter,X ; Disable Mario contact with this sprite for 16 frames W $01:A888 STA.W RAM_DisableInter,X ; [$154C,X] = 8: block repeat contact with this sprite for 8 frames W $01:AAA6 STA.W RAM_DisableInter,X ; Disable contact timer [$154C,X] = $10 W $01:AAB7 STZ.W RAM_DisableInter,X ; Disable contact timer = 0 (key falls through here) R $01:BAD0 LDA.W RAM_DisableInter,X ; A = interaction-disable timer [$154C] R $01:BAF8 ORA.W RAM_DisableInter,X ; OR with the disable timer: both zero means the door is idle W $01:BB13 STA.W RAM_DisableInter,X ; Punched: start the opening delay, [$154C] = 6 R $01:DA1C LDA.W RAM_DisableInter,X ; Interaction disabled timer [$154C] (after a jump off) W $01:DA3C STA.W RAM_DisableInter,X ; Disable interaction for $10 frames so Mario does not re-grab W $01:E028 STA.W RAM_DisableInter,Y ; Flash timer for the first block of the line ([$154C]) W $01:E02D STA.W RAM_DisableInter,Y ; Flash timer for the second block W $01:E032 STA.W RAM_DisableInter,Y ; Flash timer for the third block W $01:E237 STA.W RAM_DisableInter,X ; [$154C] = $30 W $01:E6B5 STZ.W RAM_DisableInter,X ; Re-enable interaction timer [RAM_DisableInter] = 0 R $01:E804 LDA.W RAM_DisableInter,X ; A = [RAM_DisableInter] W $01:E892 STA.W RAM_DisableInter,X ; Disable cloud interaction for $10 frames W $01:E8C7 STA.W RAM_DisableInter,X ; Cloud: interaction disabled for $10 frames W $01:ECD6 STA.W RAM_DisableInter,X ; Disable interaction timer = $10 W $01:FD01 STA.W RAM_DisableInter,X ; Stun timer [$154C] = $18 W $01:FD47 STA.W RAM_DisableInter,X ; Interaction timer [$154C] = $10 (kid is hit) W $02:8A1C STA.W RAM_DisableInter,X ; Disable Mario interaction for $2C frames W $02:9406 STA.W RAM_DisableInter,X ; Disable the sprite's interaction for 8 frames W $02:D98D STA.W RAM_DisableInter,X ; Disable interaction with other sprites for that many frames W $02:EB1F STA.W RAM_DisableInter,X ; Disable-interaction timer = $30 W $02:F25D STA.W RAM_DisableInter,X ; Disable interaction for 8 frames W $02:F38B STA.W RAM_DisableInter,X ; Wait $10 frames before the next turn W $03:87F1 STA.W RAM_DisableInter,X ; Riding flag [$154C] = 6 (no interaction) R $03:9590 LDA.W RAM_DisableInter,X ; A = Rex contact disable timer W $03:9597 STA.W RAM_DisableInter,X ; Contact disable timer = 8 frames R $03:9A37 LDA.W RAM_DisableInter,X ; A = interaction disabled timer [$154C,X] W $03:9A44 STA.W RAM_DisableInter,X ; Disable interaction timer [$154C,X] = $08 (after a hit or a bounce) R $03:A441 LDA.W RAM_DisableInter,X ; Interaction disable timer [$154C] non-zero: go wait for it to expire W $03:ABDD STA.W RAM_DisableInter,X ; Disable sprite interaction for $20 frames W $03:ACB5 STA.W RAM_DisableInter,X ; Blink timer [$154C] = $0C W $03:AE48 STA.W RAM_DisableInter,X ; Blink timer [$154C] = $14 W $03:B0D8 STA.W RAM_DisableInter,X ; Disable interaction for $20 frames W $03:C307 STA.W RAM_DisableInter,X ; Interaction disable timer = $10 W $03:C322 STA.W RAM_DisableInter,X ; Interaction disable timer = $20 W $07:F742 STZ.W RAM_DisableInter,X ; Disable-interaction timer = 0 $1558 Sprite timer 2 byte table, one per sprite slot (index X) General-purpose countdown timer, second of the sprite timers. Meaning is per sprite type: delay before a shelless Koopa turns into a Koopa ($20), message box time, Lakitu throw timer, Podoboo wait on the ground ($80), Monty Mole hop delay, Yoshi tongue pause (8), Ludwig timer ($60). When non-zero in a pair of Koopas a kick or hop into the shell is in progress, so sprite-to-sprite contact is skipped. Cleared (STZ) to cancel.
79 uses in 54 routines (44 read, 34 write, 1 read-modify-write) R $01:8A9B LDA.W $1558,X ; Timer [$1558,X] W $01:8AD1 STA.W $1558,Y ; Other sprite [$1558] = $10 R $01:8F99 LDA.W $1558,X ; Throw timer [$1558,X] W $01:9337 STA.W $1558,X ; Sink timer [$1558] = $40 R $01:965F ORA.W $1558,X ; Sprite state [$C2] = [$1540] | [$1558] W $01:9A2C STA.W $1558,X ; [$1558] = [$C2] (sprite state, for the draw routine) R $01:A550 ORA.W $1558,Y ; Return if either sprite has its $1558 timer running (kick/hop in progress) R $01:A6F1 ORA.W $1558,X ; Return if either $1558 timer is running W $01:A71B STA.W $1558,X ; $1558,X = $20 W $01:A759 STA.W $1558,X ; $1558,X = $20 W $01:A76C STA.W $1558,X ; $1558,X = hop timer W $01:B4EF STA.W $1558,X ; [$1558] = $10 (timer) W $01:CED4 STA.W $1558,X ; Timer [$1558] = $60 W $01:E14C STA.W $1558,X ; [$1558] = $80: time to stay on the ground W $01:E3E1 STA.W $1558,X ; [$1558] = $50: delay before the next hop W $01:EA10 STA.W $1558,Y ; ...set Lakitu's [$1558] = $20 (throw animation timer) W $01:F251 STA.W $1558,X ; [$1558,X] = $10: spit recovery timer W $01:F32A STA.W $1558,X ; Pause [$1558,X] = 8 before retracting W $01:F606 STA.W $1558,X ; Timer $1558 = $0A W $01:F956 STA.W $1558,X ; Counter wrapped: [$1558] = $20 (purpose unclear) W $01:FCC7 STA.W $1558,X ; Contact cooldown [$1558] = 8 W $02:9423 STA.W $1558,X ; [$1558] = $20 (timer) W $02:9448 STZ.W $1558,X ; Clear [$1558] W $02:B818 STA.W $1558,X ; Hit cooldown [$1558] = $18 W $02:BCEB STA.W $1558,X ; 1 in 256 frames: [$1558] = $0C (eye/face timer) W $02:BD3B STA.W $1558,X ; [$1558] = $FF R $02:C13A LDA.W $1558,X ; [$1558] = pause timer W $02:C17A STA.W $1558,X ; [$1558] = $40 W $02:C436 STA.W $1558,X ; Throw cooldown [$1558] = 8 R $02:DBE4 LDA.W $1558,X ; A = [$1558] (Mario on platform timer, probably set by InvisBlkMainRt) R $02:DD0E LDA.W $1558,X ; A = [$1558] (walk pause timer) W $02:DD2C STA.W $1558,X ; Set the walk pause timer [$1558] W $03:89DF STA.W $1558,X ; Stopped: start $20-frame timer to become a Koopa W $03:8D82 STZ.W $1558,X ; Clear the message timer R $03:9525 LDA.W $1558,X ; A = timer [$1558] for showing squashed remains W $03:95BD STA.W $1558,X ; Timer for showing squashed remains [$1558] = $20 R $03:967E LDA.W $1558,X ; A = remains timer [$1558] W $03:971D STA.W $1558,X ; Mouth open timer [$1558] = $0C R $03:9793 LDA.W $1558,X ; A = mouth timer W $03:9A0D STA.W $1558,X ; Firing timer [$1558,X] = $40: show the firing image, fireball at $20 R $03:9A19 ORA.W $1558,X ; OR firing timer W $03:9AC0 STZ.W $1558,X ; Firing timer = 0: no more fireballs W $03:A302 STA.W $1558,X ; [$1558] = $0C (blink/mouth timer, probably) W $03:AE57 STA.W $1558,X ; Start blush timer [$1558] = $80 R $03:C200 LDA.W $1558,X ; A = hit timer [$1558] W $07:F745 STZ.W $1558,X ; $1558,X = 0 (timer) $1564 Sprite timer 3 byte table, one per sprite slot (index X or Y) General-purpose countdown timer, third of the sprite timers. Often an intangibility or contact cooldown: a non-zero value on either sprite stops sprite-to-sprite contact, and kicked sprites get 8 to briefly ignore others. Also used as animation timers: Yoshi swallow timer ($1B), Bowser phase 9 animation ($12), Iggy/Larry shell animation ($7F), Urchin turning (8), firework scene end delay ($70).
Values: 0 = not running.
40 uses in 28 routines (19 read, 20 write, 1 read-modify-write) W $01:83DC STA.W $1564,X ; [$1564,X] = $28: timer that blocks sprite contact W $01:89A5 STA.W $1564,Y ; Kicked sprite [$1564] = 8 (briefly ignore other sprites) W $01:971A STA.W $1564,Y ; New sprite [$1564] timer = $10 R $01:A42C ORA.W $1564,Y ; OR in the intangibility timers $1564 of both sprites W $01:A720 STA.W $1564,X ; $1564,X = $23 W $01:A752 STA.W $1564,Y ; $1564,Y = $20 W $01:B4E4 STA.W $1564,X ; [$1564] = $0F (timer, probably hit animation) W $01:E0FE STA.W $1564,X ; Unreachable: [$1564] = timer R $01:E75B LDA.W $1564,X ; A = [$1564] (timer) R $01:EFFD LDA.W $1564,X ; A = swallow timer [$1564,X] R $01:F00F LDA.W $1564,X ; A = swallow timer W $01:F1C0 STA.W $1564,X ; Swallow timer [$1564,X] = $1B W $01:F1DB STZ.W $1564,X ; Swallow timer = 0 W $01:F37A STA.W $1564,X ; Swallow timer [$1564,X] = $1B W $01:FB17 STA.W $1564,X ; ...[$1564] = $7F: start the shell/throw animation timer W $02:BDD1 STA.W $1564,X ; No surface: [$1564] = 8 (turning animation) W $02:BE1A STA.W $1564,X ; [$1564] = 8 (turning animation) R $02:C79D LDA.W $1564,X ; Contact cooldown [$1564] non-zero: no interaction W $02:C7CF STA.W $1564,X ; Contact cooldown = 5 R $02:D0D4 LDA.W $1564,X ; A = [$1564] (swallow timer) W $02:D1DE STA.W $1564,X ; [$1564] = $22: swallow timer W $03:9A5F STA.W $1564,X ; Platform bounce timer [$1564,X] = $0F R $03:9BF7 LDA.W $1564,X ; A = platform bounce timer [$1564,X] R $03:A2AD LDA.W $1564,X ; A = [$1564,X] W $03:ABFF STA.W $1564,X ; Start the $1564 animation timer at $12 W $03:C812 STA.W $1564,X ; All launched: timer [$1564] = $70 frames before the scene ends W $03:C837 STA.W $1564,X ; Timer [$1564] = $10 W $07:F748 STZ.W $1564,X ; $1564,X = 0 (timer) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $03:C882 STA.W $156D ; Backdrop flash timer [$156D] = 8 $1570 Sprite misc table 4 byte table, one per sprite slot (index X) General-purpose per-sprite counter, meaning depends on the sprite type. Examples: wing flap counter of the winged Goomba, walk counter of Dry Bones, Sumo Bro and Iggy/Larry, parachute sway index, hops left of the bird, spawn count of the coin game cloud, burst size of a firework, segment length of line guides. Usually incremented or decremented each frame by the sprite's main routine.
175 uses in 92 routines (74 read, 45 write, 56 read-modify-write) RW $00:FBF0 INC.W $1570,X ; [$1570,X]++: sprite frame counter (animates the coin) W $01:8331 STA.W $1570,X ; [$1570,X] = Y: initial platform timer value (probably) W $01:8579 STA.W $1570,X ; [$1570,X] = A (falls into FaceMario) W $01:89E6 STZ.W $1570,X ; Animation counter [$1570,X] = 0 W $01:8A62 STZ.W $1570,X ; Animation counter [$1570,X] = 0 R $01:8B61 LDA.W $1570,X ; A = [$1570,X] W $01:8B90 STZ.W $1570,X ; No wings: animation counter [$1570,X] = 0 RW $01:8D5C INC.W $1570,X ; Wing counter += 2 extra (flap faster while rising) RW $01:8D5F INC.W $1570,X ; Wing counter [$1570,X]++ W $01:8D7F STZ.W $1570,X ; Waiting: stop the wings (counter = 0) RW $01:8E5F INC.W $1570,X ; Animation counter [$1570,X]++ R $01:A2F7 LDA.W $1570,X ; Count of non-power-ups eaten: [$1570]++ RW $01:ADF5 INC.W $1570,X ; Wing animation counter [$1570]++ RW $01:B1ED INC.W $1570,X ; Animation counter [$1570] += 2 RW $01:BA3B INC.W $1570,X ; Animation frame counter ++ W $01:BE51 STZ.W $1570,X ; Fade step counter [$1570,X] = 0 RW $01:BFED DEC.W $1570,X ; Step counter [$1570,X]-- RW $01:C00E INC.W $1570,X ; Step counter [$1570,X]++ RW $01:C252 INC.W $1570,X ; [$1570,X]++ (frame counter used for animation) RW $01:C3BF INC.W $1570,X ; [$1570,X]++ (animation frame counter) R $01:D529 LDA.W $1570,X ; Sway index [$1570] W $01:D530 STA.W $1570,X ; Store sway index R $01:D53D LDY.W $1570,X ; Y = sway index R $01:D5E5 LDY.W $1570,X ; Y = sway index R $01:D604 LDY.W $1570,X ; Y = sway index W $01:D6A8 STA.W $1570,X ; Sway index = 7 R $01:D78A CMP.W $1570,X ; Compare with segment length [$1570] R $01:D792 LDY.W $1570,X ; Y = remaining length [$1570] RW $01:D7A8 DEC.W $1570,X ; Extra step every other frame W $01:D8DD STA.W $1570,X ; [$1570] = number of steps in this segment R $01:DF6C LDA.W $1570,X ; A = symbol frame [$1570] R $01:E557 LDA.W $1570,X ; A = [$1570] (walk counter) W $01:E563 STZ.W $1570,X ; In air: walk counter [$1570] = 0 R $01:E5A7 LDA.W $1570,X ; A = [$1570] (walk counter) W $01:EAC3 STA.W $1570,X ; Reload timer from DATA_01EDF5 (faster when Mario is faster) W $01:EADF STZ.W $1570,X ; Walk timer = 0 W $01:F888 STA.W $1570,X ; $1570 = random (wave phase) RW $01:F94C INC.W $1570,X ; Shy counter [$1570]++ R $01:F94F LDA.W $1570,X ; Reload counter W $01:F989 STZ.W $1570,X ; Shy counter [$1570] = 0 RW $01:FBF0 INC.W $1570,X ; Walk animation counter [$1570]++ RW $01:FBF7 INC.W $1570,X ; [$1570]++ again RW $02:8099 INC.W $1570,X ; Animation counter [$1570]++ unless sprites are locked W $02:B36F STA.W $1570,X ; Store in [$1570] (initial animation/wing state, probably) R $02:B6C1 LDA.W $1570,X ; Walk timer [$1570]++, mod $80 RW $02:C006 INC.W $1570,X ; Animation timer [$1570]++ W $02:C14D STZ.W $1570,X ; Animation index [$1570] = 0 W $02:C163 STA.W $1570,X ; [$1570] = animation index R $02:C181 LDY.W $1570,X ; Y = animation index R $02:C74A LDY.W $1570,X ; Y = animation step [$1570] W $02:C804 STZ.W $1570,X ; Hurt animation step [$1570] = 0 RW $02:CC02 INC.W $1570,X ; ...increment the cage frame counter [$1570] RW $02:CE3A INC.W $1570,X ; [$1570]++ (frame counter) RW $02:DD20 INC.W $1570,X ; Walk counter [$1570]++ W $02:DD36 STZ.W $1570,X ; Reset the walk counter RW $02:DF11 INC.W $1570,X ; Next flame offset index [$1570]++ RW $02:E166 INC.W $1570,X ; [$1570]++ (animation counter) RW $02:E347 INC.W $1570,X ; [$1570]++ (animation counter) RW $02:E5C3 INC.W $1570,X ; Frame timer [$1570]++ R $02:E761 LDY.W $1570,X ; Swim leg counter [$1570]++ W $02:E7AC STZ.W $1570,X ; Swim leg counter = 0 R $02:E893 LDA.W $1570,X ; Phase timer [$1570]++ RW $02:EECF INC.W $1570,X ; Spawn count++ RW $02:F06A INC.W $1570,X ; Animation counter [$1570]++ RW $02:F072 INC.W $1570,X ; Angry: animation counter runs twice as fast W $02:F37D STA.W $1570,X ; [$1570] = DATA_02F33C[random] RW $02:F3A8 DEC.W $1570,X ; Pecks left-- W $02:F3D7 STA.W $1570,X ; Hop count [$1570] = 2..5 RW $02:F434 INC.W $1570,X ; Age counter [$1570]++ RW $03:80C3 INC.W $1570,X ; [$1570]++: hidden time counter W $03:810F STA.W $1570,X ; [$1570] = $40 RW $03:8DD4 DEC.W $1570,X ; Count down timer [$1570] RW $03:92F1 DEC.W $1570,X ; Creating: decrement step timer [$1570] RW $03:9537 INC.W $1570,X ; Frame counter [$1570]++ RW $03:972F INC.W $1570,X ; Animation counter [$1570]++ W $03:9882 STA.W $1570,X ; Rotation counter [$1570] = random RW $03:99FE INC.W $1570,X ; [$1570,X]++: firing counter R $03:9A01 LDA.W $1570,X ; A = firing counter W $03:9A08 STZ.W $1570,X ; Reset the firing counter RW $03:9DEF INC.W $1570,X ; [$1570,X]++: animation counter R $03:9DF2 LDA.W $1570,X ; A = animation counter W $03:A478 STA.W $1570,X ; Bowser face frame [$1570] W $03:A4E7 STA.W $1570,X ; Bowser face frame [$1570] W $03:A5C3 STA.W $1570,X ; Bowser face frame [$1570] W $03:A5E8 STA.W $1570,X ; Bowser face frame [$1570] W $03:A6B7 STA.W $1570,X ; Bowser face frame [$1570] W $03:A70E STA.W $1570,X ; Bowser face frame [$1570] W $03:A899 STA.W $1570,X ; Bowser face frame [$1570] RW $03:B1CB DEC.W $1570,X ; Moving right: [$1570] -= 2 ... RW $03:B1CE DEC.W $1570,X ; (second decrement) RW $03:B1D1 INC.W $1570,X ; ... then += 1: net -1 right, +1 left (spin direction follows roll) RW $03:B2F9 INC.W $1570,X ; Walk animation counter [$1570]++ RW $03:C09B INC.W $1570,X ; Count this eaten sprite: [$1570] += 1 R $03:C09E LDA.W $1570,X ; A = eaten sprite count W $03:CCFC STA.W $1570,Y ; [$1570,Y] = DATA_03CCE0[Y]: part offset ($10 or $20) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $01:DE03 STA.W $1579 ; [$1579] = random starting value from DATA_01DE21 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) $157C Sprite facing direction RAM_SpriteDir byte table, one per sprite slot (index X or Y) Which way each sprite faces and walks. Set when sprites spawn, turn at walls or face Mario, and read by the draw routines to flip the graphics and by the movement code to pick the X speed. Yoshi, Koopas, Rex, Wiggler and the Koopa Kids all use it. Briefly modified (XOR) by some draw routines.
Values: 0 = facing right; 1 = facing left.
287 uses in 169 routines (170 read, 103 write, 14 read-modify-write) W $00:FC6A STA.W RAM_SpriteDir,Y ; Yoshi direction = 0 RW $01:8314 INC.W RAM_SpriteDir,X ; Direction = 1 RW $01:83E3 INC.W RAM_SpriteDir,X ; Direction = 1 W $01:8580 STA.W RAM_SpriteDir,X ; Sprite direction = Y (face Mario) R $01:88DC LDA.W RAM_SpriteDir,Y ; A = shell direction R $01:88DF CMP.W RAM_SpriteDir,X ; Same direction as this sprite? R $01:898C LDY.W RAM_SpriteDir,X ; Y = this sprite's direction R $01:8B15 LDY.W RAM_SpriteDir,X ; Y = direction R $01:8B2E LDY.W RAM_SpriteDir,X ; Y = direction R $01:8B68 LDA.W RAM_SpriteDir,X ; A = current direction R $01:8B70 CMP.W RAM_SpriteDir,X ; Changed direction? W $01:8BDB STA.W RAM_SpriteDir,X ; Direction ^= A (temporary, restored later) W $01:8C14 STA.W RAM_SpriteDir,X ; Restore the sprite direction R $01:8C51 LDY.W RAM_SpriteDir,X ; Y = direction R $01:8CD2 CMP.W RAM_SpriteDir,X ; Direction changed? R $01:8DBD LDY.W RAM_SpriteDir,X ; Y = direction W $01:8FE9 STA.W RAM_SpriteDir,X ; Direction = 1 (always) W $01:90AE STA.W RAM_SpriteDir,X ; Toggle the direction W $01:9715 STA.W RAM_SpriteDir,Y ; New sprite direction = 0 W $01:9758 STA.W RAM_SpriteDir,Y ; New sprite direction = [$00] XOR 1 (away from Mario), also kept in [$01] W $01:97A4 STA.W RAM_SpriteDir,Y ; Coin direction = [$01] W $01:9A1E STA.W RAM_SpriteDir,X ; [RAM_SpriteDir] = A R $01:9EC1 LDA.W RAM_SpriteDir,X ; Save sprite direction W $01:9EC5 STZ.W RAM_SpriteDir,X ; Direction = 0 (first wing) RW $01:9EEC INC.W RAM_SpriteDir,X ; Direction = 1 (second wing) W $01:A21A STA.W RAM_SpriteDir,X ; Direction = 1 W $01:A58E STA.W RAM_SpriteDir,Y ; Set A facing = $00, remembering the old direction R $01:A592 CMP.W RAM_SpriteDir,Y ; Did the direction change? W $01:A5B0 STA.W RAM_SpriteDir,X ; Set B facing = $00 EOR 1, remembering the old direction R $01:A5B4 CMP.W RAM_SpriteDir,X ; Did the direction change? R $01:A78A CMP.W RAM_SpriteDir,Y ; Same facing as Y: normal handling W $01:A90E STA.W RAM_SpriteDir,X ; Sprite faces Mario RW $01:AD64 INC.W RAM_SpriteDir,X ; Sprite direction [$157C,X]++ W $01:AED1 STA.W RAM_SpriteDir,X ; Sprite direction = toward Mario R $01:B219 LDY.W RAM_SpriteDir,X ; Y = sprite direction R $01:BA53 LDA.W RAM_SpriteDir,X ; A = direction W $01:BA5F STA.W RAM_SpriteDir,X ; Store the animation direction W $01:BA7B STA.W RAM_SpriteDir,X ; Restore the real direction W $01:BE5B STA.W RAM_SpriteDir,X ; Face Mario W $01:BE78 STA.W RAM_SpriteDir,X ; Face Mario R $01:BED5 LDY.W RAM_SpriteDir,X ; Y = direction W $01:C25D STA.W RAM_SpriteDir,X ; Balloon always faces right (direction = 1) W $01:C350 STA.W RAM_SpriteDir,X ; Flower animation: [$157C,X] = ([$14] >> 3) & 1 (flips every 8 frames) W $01:CD60 STA.W RAM_SpriteDir,X ; Direction = 1 (facing right) W $01:CDFD STA.W RAM_SpriteDir,X ; Sprite direction = direction towards Mario R $01:CE01 CMP.W RAM_SpriteDir,X ; Direction unchanged: go to CE0B R $01:D08C LDA.W RAM_SpriteDir,X ; A = sprite direction W $01:D0AD STA.W RAM_SpriteDir,Y ; New sprite direction = Kid direction W $01:D24F STA.W RAM_SpriteDir,X ; Face Mario R $01:D490 LDA.W RAM_SpriteDir,X ; Direction W $01:D5F1 STA.W RAM_SpriteDir,X ; Store in sprite direction R $01:D63F ADC.W RAM_SpriteDir,X ; Add direction RW $01:D707 INC.W RAM_SpriteDir,X ; Direction++ (move right) R $01:D76C LDA.W RAM_SpriteDir,X ; Direction W $01:D8EC STZ.W RAM_SpriteDir,X ; Direction [$157C] = 0 (forward) RW $01:D90D INC.W RAM_SpriteDir,X ; Entered at the far end: run the segment backward ([$157C] = 1) R $01:DB7B LDY.W RAM_SpriteDir,X ; Y = direction [$157C] W $01:DDE0 STA.W RAM_SpriteDir,X ; Store in [$157C] R $01:DE8C LDY.W RAM_SpriteDir,X ; Y = direction of travel (0 right, 1 down, 2 left, 3 up) W $01:DEDE STA.W RAM_SpriteDir,X ; Store it R $01:E3D2 LDY.W RAM_SpriteDir,X ; Y = direction R $01:E46D LDA.W RAM_SpriteDir,X ; A = sprite direction R $01:E4CA LDY.W RAM_SpriteDir,X ; Y = sprite direction W $01:E998 STA.W RAM_SpriteDir,Y ; Lakitu direction = A: faces Mario R $01:EB4E LDY.W RAM_SpriteDir,X ; Y = Yoshi direction R $01:EC97 LDY.W RAM_SpriteDir,X ; Y = Yoshi direction W $01:EE7A STA.W RAM_SpriteDir,X ; Flip Yoshi's direction R $01:EF39 LDY.W RAM_SpriteDir,X ; Y = Yoshi direction R $01:F1F9 LDY.W RAM_SpriteDir,X ; Y = Yoshi direction W $01:F23B STA.W RAM_SpriteDir,Y ; Item direction = Yoshi direction R $01:F41A LDA.W RAM_SpriteDir,X ; Yoshi's direction (0 = right, 1 = left) R $01:F433 LDA.W RAM_SpriteDir,X ; Yoshi's direction R $01:F454 LDA.W RAM_SpriteDir,X ; Yoshi's direction W $01:FC22 STA.W RAM_SpriteDir,X ; Timer >= 8: draw with the opposite direction W $01:FC4A STA.W RAM_SpriteDir,X ; Restore sprite direction W $01:FDCC STA.W RAM_SpriteDir,Y ; Ball direction = kid direction RW $02:89C9 INC.W RAM_SpriteDir,X ; Sprite direction = 1 W $02:941E STZ.W RAM_SpriteDir,X ; Face right W $02:94BD STA.W RAM_SpriteDir,X ; Direction = Y XOR 1 RW $02:B078 INC.W RAM_SpriteDir,X ; Direction = 1: face left W $02:B203 STA.W RAM_SpriteDir,X ; Direction = side it enters from W $02:B24A STA.W RAM_SpriteDir,X ; Direction = side it enters from W $02:B6CC STA.W RAM_SpriteDir,X ; Store it R $02:B6CF LDY.W RAM_SpriteDir,X ; Y = sprite direction R $02:B8C2 LDY.W RAM_SpriteDir,X ; Y = direction R $02:C18A LDY.W RAM_SpriteDir,X ; Y = direction W $02:C55A STA.W RAM_SpriteDir,X ; Direction = side W $02:C606 STA.W RAM_SpriteDir,X ; Sprite direction = that side R $02:C6CA CMP.W RAM_SpriteDir,X ; Is Chuck already facing Mario? If not, no charge R $02:C6EC LDY.W RAM_SpriteDir,X ; Y = direction R $02:CBC6 ORA.W RAM_SpriteDir,X ; X = shovel index * 2 + direction W $02:CE1C STA.W RAM_SpriteDir,X ; Direction = 1 (start by extending) RW $02:CE6C INC.W RAM_SpriteDir,X ; Direction++ (now going negative) RW $02:CE82 INC.W RAM_SpriteDir,X ; Direction++ (now going positive) R $02:D163 LDY.W RAM_SpriteDir,X ; Y = sprite direction R $02:D934 LDY.W RAM_SpriteDir,X ; Y = sprite direction W $02:D99D STA.W RAM_SpriteDir,X ; Sprite direction = face Mario W $02:DA5A STZ.W RAM_SpriteDir,X ; Direction = 0 (facing right) by default W $02:DA94 STA.W RAM_SpriteDir,X ; Sprite direction = $40 or $00 (turns around periodically) R $02:DD13 LDY.W RAM_SpriteDir,X ; Y = sprite direction R $02:E31F LDY.W RAM_SpriteDir,X ; Y = direction W $02:E473 STA.W RAM_SpriteDir,X ; Facing = direction W $02:E98F STA.W RAM_SpriteDir,X ; Direction = Mario side W $02:E9B0 STA.W RAM_SpriteDir,X ; Direction toggles every $20 frames (looks around) W $02:EABA STZ.W RAM_SpriteDir,X ; Direction = 0 RW $02:EACA INC.W RAM_SpriteDir,X ; Yoshi is to the right of it: direction = 1 R $02:EB95 LDY.W RAM_SpriteDir,X ; Y = direction RW $02:EFA5 INC.W RAM_SpriteDir,X ; Direction = 1 W $02:F00C STA.W RAM_SpriteDir,X ; Direction = Y W $02:F083 STA.W RAM_SpriteDir,X ; Face Mario every 64 frames R $02:F086 LDY.W RAM_SpriteDir,X ; Y = [direction] W $02:F0B8 STA.W RAM_SpriteDir,X ; Flip direction R $02:F1A8 LDA.W RAM_SpriteDir,X ; A = direction R $02:F1CB LDA.W RAM_SpriteDir,X ; A = direction W $02:F3C6 STA.W RAM_SpriteDir,X ; Flip direction W $03:813C STA.W RAM_SpriteDir,X ; Flip direction: [$157C] ^= 1 W $03:8548 STA.W RAM_SpriteDir,X ; Face Mario: [$157C] = 1 if Mario is to the left, else 0 RW $03:861B INC.W RAM_SpriteDir,X ; [$1602] = $FF; [$157C]++: swap the direction W $03:87CA STA.W RAM_SpriteDir,X ; Flip walking direction W $03:88F8 STA.W RAM_SpriteDir,X ; Face Mario R $03:891B LDY.W RAM_SpriteDir,X ; Y = direction W $03:8961 STA.W RAM_SpriteDir,X ; Direction = 1 if X speed > 0, kept if 0, else 0 W $03:897F STA.W RAM_SpriteDir,X ; Restore direction W $03:8A96 STA.W RAM_SpriteDir,X ; Flip direction W $03:8B21 STA.W RAM_SpriteDir,Y ; New sprite direction = statue direction W $03:9083 STA.W RAM_SpriteDir,X ; Face Mario: direction = Y R $03:92BD LDY.W RAM_SpriteDir,X ; Y = sprite direction (0 right, 1 left, 2 down, 3 up) W $03:931C STA.W RAM_SpriteDir,X ; Direction = step byte & 3 W $03:9383 STA.W RAM_SpriteDir,X ; Set sprite direction R $03:955B LDY.W RAM_SpriteDir,X ; Y = direction W $03:95D6 STA.W RAM_SpriteDir,X ; Rex turns towards Mario R $03:9745 LDY.W RAM_SpriteDir,X ; Y = direction R $03:9A21 LDA.W RAM_SpriteDir,X ; A = old sprite direction W $03:9A29 STA.W RAM_SpriteDir,X ; Direction = Y: face Mario R $03:9A2D CMP.W RAM_SpriteDir,X ; Compare with the new direction R $03:9A7E LDA.W RAM_SpriteDir,X ; A = sprite direction W $03:9A8D STA.W RAM_SpriteDir,X ; Turning timer >= 5: flip the direction for drawing W $03:9AAA STA.W RAM_SpriteDir,X ; Sprite direction = saved value R $03:9CDE LDY.W RAM_SpriteDir,X ; Y = direction R $03:9DBD LDA.W RAM_SpriteDir,X ; A = sprite direction R $03:9E4C LDA.W RAM_SpriteDir,X ; A = sprite direction (0 = right) R $03:9FB9 LDA.W RAM_SpriteDir,X ; A = direction W $03:9FC4 STA.W RAM_SpriteDir,X ; Face Mario R $03:9FDB LDY.W RAM_SpriteDir,X ; Y = direction R $03:A0A7 LDA.W RAM_SpriteDir,X ; A = direction R $03:A28B ORA.W RAM_SpriteDir,X ; [$1BA2] = [$1570] + $1E, OR direction (Bowser image index, probably) W $03:A4F9 STA.W RAM_SpriteDir,X ; Sprite direction [$157C] (turn toward Mario) W $03:A91C STZ.W RAM_SpriteDir,X ; Direction = 0 RW $03:A927 INC.W RAM_SpriteDir,X ; Direction = 1 W $03:ADC6 STA.W RAM_SpriteDir,X ; Peach faces Mario R $03:B2CC LDY.W RAM_SpriteDir,X ; Y = facing direction R $03:B40D LDA.W RAM_SpriteDir,X ; A = facing direction W $03:C33B STA.W RAM_SpriteDir,X ; Sprite direction = A (same as Mario's horizontal direction) R $03:C393 LDA.W RAM_SpriteDir,X ; Save sprite direction on the stack W $03:C3A2 STA.W RAM_SpriteDir,X ; Turning: draw with the direction flipped W $03:C3A9 STA.W RAM_SpriteDir,X ; Restore the real sprite direction R $03:C3EC ADC.W RAM_SpriteDir,X ; [$02] = direction * 3 (index into the X offset tables) R $03:CBDF LDA.W RAM_SpriteDir,X ; X = spawner facing direction (0 right, 1 left) W $07:F733 STZ.W RAM_SpriteDir,X ; Sprite direction = 0 W $0C:A793 STA.W RAM_SpriteDir ; Sprite direction = 1 $1588 Sprite blocked-by-object flags RAM_SprObjStatus bit flags table, one per sprite slot (index X) Which sides of the sprite touched solid objects this frame, set by the sprite-block interaction and map16 lookup routines and cleared (STZ) at the start of each check so it reverts to zero when the sprite stops touching. Read by almost every walking or falling sprite to turn at walls, land on the ground or hit the ceiling. Goal tape INCs it to flip direction.
Bits: 0 right wall; 1 left wall; 2 on ground; 3 hit ceiling (higher bits: layer 2 contact, probably).
101 uses in 59 routines (90 read, 10 write, 1 read-modify-write) R $01:804E LDA.W RAM_SprObjStatus,X ; A = sprite's object status (blocked flags) R $01:8B33 AND.W RAM_SprObjStatus,X ; AND object contact flags W $01:9085 STZ.W RAM_SprObjStatus,X ; Ignore objects: clear the object status W $01:9143 STZ.W RAM_SprObjStatus,X ; Clear sprite-object status (blocked bits) R $01:B0B3 LDA.W RAM_SprObjStatus,X ; A = block contact flags R $01:BA04 LDA.W RAM_SprObjStatus,X ; A = blocked-status bits RW $01:C0B1 INC.W RAM_SprObjStatus,X ; Flip direction [$1588,X]++ W $01:C3FF STZ.W RAM_SprObjStatus,X ; Unreferenced (Mode 7 boss room movement): clear contact flags W $01:C418 STA.W RAM_SprObjStatus,X ; Set "on ground" flag (bit 2) R $02:D958 LDA.W RAM_SprObjStatus,X ; A = object contact flags R $03:933B LDA.W RAM_SprObjStatus,X ; A = contact bits from probe R $03:937A ORA.W RAM_SprObjStatus,X ; Combine with second probe bits R $03:9550 LDA.W RAM_SprObjStatus,X ; A = object contact flags R $03:9572 LDA.W RAM_SprObjStatus,X ; A = object contact flags R $03:9C8C LDA.W RAM_SprObjStatus,X ; A = object contact flags R $03:9CF1 LDA.W RAM_SprObjStatus,X ; A = object contact flags W $07:F736 STZ.W RAM_SprObjStatus,X ; Sprite object-contact status = 0 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $02:A49E STZ.W $1593,X ; Clear a Yoshi sprite table entry ($1594) $1594 Sprite misc table 5 byte table, one per sprite slot (index X or Y) General-purpose per-sprite byte, meaning depends on the sprite type. Examples: Yoshi tongue state (1 extending, 2 retracting), Mario-nearby flag of the Piranha Plant, slot of the sprite touched or of the Hammer Bro on a platform, wall number for Morton/Roy, Chuck head scan step, bob direction of the flying question block, hit height of the goal tape.
45 uses in 27 routines (22 read, 20 write, 3 read-modify-write) W $00:FB66 STA.W $1594,Y ; [$1594,Y] = [$0F] R $01:8AA2 LDY.W $1594,X ; Y = [$1594,X] (sprite it touched) R $01:8ACC LDY.W $1594,X ; Y = [$1594,X] R $01:8E76 LDA.W $1594,X ; Mario nearby flag [$1594,X] R $01:8EA4 LDA.W $1594,X ; Mario nearby flag W $01:8EE1 STZ.W $1594,X ; Clear the Mario nearby flag W $01:A770 STA.W $1594,Y ; $1594,Y = X (link the pair) RW $01:ADB4 INC.W $1594,X ; Reverse the bob direction: [$1594]++ W $01:C117 STA.W $1594,X ; [$1594,X] = anchor Y - current Y (hit height) R $01:C601 ADC.W $1594,X ; A = 8 + [$1594,X]: score index (1-up) R $01:D1F7 LDA.W $1594,X ; A = wall number W $01:D221 STA.W $1594,X ; Wall number [$1594] = A & 3 W $01:D255 STA.W $1594,X ; Store orientation index in [$1594] R $01:D2EC LDA.W $1594,X ; Orientation index [$1594] R $01:EFDB LDA.W $1594,X ; Tongue state [$1594,X] W $01:F133 STZ.W $1594,X ; Then back to state 0 (idle) RW $01:F1D0 INC.W $1594,X ; Tongue state = 1 (extending) W $01:F256 STA.W $1594,X ; Tongue state = 3 (recovering) RW $01:F32D INC.W $1594,X ; Tongue state = 2 (retracting) W $01:F347 STZ.W $1594,X ; Tongue state = 0 (idle) W $01:F601 STA.W $1594,X ; Yoshi tongue state $1594 = 2 (retracting) W $02:C68E STA.W $1594,X ; Store the new scan step R $02:C691 LDY.W $1594,X ; Y = scan step W $02:DB61 STA.W $1594,X ; $1594 = $FF: no Hammer Bro on the platform W $02:DB7A STA.W $1594,X ; $1594 = slot of the Hammer Bro on the platform R $02:DBF8 LDY.W $1594,X ; Y = Hammer Bro slot W $03:9F82 STA.W $1594,X ; [$1594] = Y low R $03:A02E LDA.W $1594,X ; Restore Y low from [$1594] R $03:A2B5 LDA.W $1594,X ; A = [$1594,X] W $03:A2D2 STZ.W $1594,X ; Clear [$1594] $15A0 Sprite off-screen horizontal flag RAM_OffscreenHorz flag byte table, one per sprite slot (index X) Set by the get-sprite-draw-info routines (banks 1, 2 and 3) when any part of the sprite is outside the screen horizontally. Read by the sprite main routines to skip actions and by the OAM drawers to set the X high bit. Bosses clear it to make sure they never despawn.
Values: 0 = on screen horizontally; non-zero = off-screen.
47 uses in 42 routines (34 read, 9 write, 4 read-modify-write) R $01:8F07 LDA.W RAM_OffscreenHorz,X ; Sprite off-screen horizontally flag R $01:9F51 ORA.W RAM_OffscreenHorz,X ; OAM size = 16x16 with X high bit from offscreen-horizontal flag W $01:A368 STZ.W RAM_OffscreenHorz,X ; Clear horizontal off-screen flag ($15A0) R $01:A7F0 ORA.W RAM_OffscreenHorz,X ; Only every other frame, and only if on screen horizontally R $01:BC5A LDA.W RAM_OffscreenHorz,X ; Off-screen horizontally? R $01:BE8D ORA.W RAM_OffscreenHorz,X ; Sprites locked or off-screen horizontally? W $01:DE2A STZ.W RAM_OffscreenHorz,X ; Clear this block's off-screen-horizontal flag R $01:E95E LDA.W RAM_OffscreenHorz,X ; A = horizontal offscreen flag W $01:FB1A STZ.W RAM_OffscreenHorz,X ; Clear off-screen flag (never despawn) W $01:FCED STZ.W RAM_OffscreenHorz,X ; Clear off-screen flag R $02:849F LDA.W RAM_OffscreenHorz,X ; A = [RAM_OffscreenHorz+X] RW $02:8953 INC.W RAM_OffscreenHorz,X ; Flag sprite as off-screen horizontally W $02:A9CF STA.W RAM_OffscreenHorz,X ; Offscreen horizontally flag = 1 R $02:D0C9 LDA.W RAM_OffscreenHorz,X ; A = horizontal offscreen flag W $02:D37B STZ.W RAM_OffscreenHorz,X ; Clear horizontal offscreen flag RW $02:D389 INC.W RAM_OffscreenHorz,X ; Else horizontal offscreen flag = 1 R $02:DA9D ORA.W RAM_OffscreenHorz,X ; ...and the sprite is on screen horizontally... R $02:E6C2 LDA.W RAM_OffscreenHorz,X ; Sprite is off-screen horizontally R $02:E87A ORA.W RAM_OffscreenHorz,X ; Sprites locked or off-screen: only do interaction W $03:A0F5 STZ.W RAM_OffscreenHorz,X ; Not off-screen horizontally W $03:B763 STZ.W RAM_OffscreenHorz,X ; Clear horizontal offscreen flag RW $03:B771 INC.W RAM_OffscreenHorz,X ; Set horizontal offscreen flag W $07:F787 STA.W RAM_OffscreenHorz,X ; Offscreen horizontal flag = 1 (treated as off screen until processed) $15AC Sprite turn-around timer byte table, one per sprite slot (index X or Y) Countdown for the turning animation when a sprite changes direction. Set to 8 by the flip-direction routine and walking Koopas, to $10 for Yoshi and the Koopa Kids, and to $1F for Boo and Big Boo. The draw routines read it to show the turn frame, and a non-zero value delays other behaviour.
Values: 0 = not turning.
48 uses in 32 routines (28 read, 19 write, 1 read-modify-write) W $01:8B77 STA.W $15AC,X ; [$15AC,X] = 8 R $01:8BC7 LDY.W $15AC,X ; Y = turn timer [$15AC,X] W $01:8CD9 STA.W $15AC,X ; Turn timer [$15AC,X] = 8 W $01:909F STA.W $15AC,X ; Turn timer [$15AC,X] = 8 R $01:9279 ORA.W $15AC,X ; X speed or turn timer [$15AC] non-zero: normal horizontal check W $01:A59E STA.W $15AC,Y ; $15AC,A = 8 (turning animation) W $01:A5C0 STA.W $15AC,X ; $15AC,B = 8 (turning animation) W $01:CE08 STA.W $15AC,X ; Direction changed: turn timer [$15AC] = $10 W $01:D25A STA.W $15AC,X ; Set turning timer [$15AC] = $0A W $01:ED92 STA.W $15AC,X ; ...set turning timer [$15AC] = $10 R $01:EE65 LDY.W $15AC,X ; Y = turn timer [$15AC,X] W $01:F92A STA.W $15AC,X ; Start turning: turn timer [$15AC] = $1F W $01:FB96 STA.W $15AC,X ; Direction changed: turn timer [$15AC] = $10 W $02:8A26 STA.W $15AC,X ; [$15AC] = $10 (turn timer) R $02:C233 LDA.W $15AC,X ; [$15AC] = head turn / look timer W $02:C62A STA.W $15AC,X ; Turn timer [$15AC] = 8 (pose 5 is shown while non-zero) W $02:F0C0 STA.W $15AC,X ; Turn timer [$15AC] = 8 W $02:F3CB STA.W $15AC,X ; Turn timer [$15AC] = $0A W $03:812F STA.W $15AC,X ; [$15AC] = $1F: start the turn animation R $03:87B2 LDY.W $15AC,X ; Y = turn timer [$15AC] W $03:87C2 STA.W $15AC,X ; Turn timer = $10 frames R $03:908F ORA.W $15AC,X ; A |= turn timer [$15AC] W $03:9096 STA.W $15AC,X ; Turn timer [$15AC] = $20 (look at Mario again) R $03:99F9 ORA.W $15AC,X ; OR turning timer [$15AC,X] R $03:9A1C ORA.W $15AC,X ; OR turning timer W $03:9A34 STA.W $15AC,X ; Turning timer [$15AC,X] = $0A R $03:9A82 LDY.W $15AC,X ; Y = turning timer [$15AC,X] W $03:C87D STA.W $15AC,X ; Burst delay [$15AC] = DATA_03C841[rocket] $15B8 Sprite slope steepness byte table, one per sprite slot (index X) Slope the sprite is standing on, written by the vertical map16 check and cleared when the sprite leaves it. Used as a speed offset so sprites speed up going down a slope and slow going up (EOR with the X speed to test direction), and by the slope movement and gravity routines.
Values: 0 = flat ground; non-zero = signed slope speed offset.
17 uses in 12 routines (15 read, 2 write) R $01:8B1F EOR.W $15B8,X ; EOR slope speed offset [$15B8,X] R $01:8B29 ADC.W $15B8,X ; Add slope offset R $01:8C57 EOR.W $15B8,X ; A ^ [$15B8,X]: sign bit set if the signs differ R $01:8C61 ADC.W $15B8,X ; Add [$15B8,X] to the speed (probably slope adjustment) W $01:9146 STZ.W $15B8,X ; Clear slope steepness [$15B8] W $01:936A STA.W $15B8,X ; [$15B8] = slope steepness R $01:9A0B LDY.W $15B8,X ; Otherwise A = 0 unless on a slope ([$15B8] non-zero) R $01:E4D0 EOR.W $15B8,X ; EOR with slope speed [$15B8] R $01:E4DA ADC.W $15B8,X ; Signs differ: speed += slope speed [$15B8] R $03:C1CF LDA.W $15B8,X ; A = [$15B8] (slope under the sprite) $15C4 Sprite far off-screen flag flag byte table, one per sprite slot (index X) Set to 1 by the get-sprite-draw-info routines when the sprite is far off screen horizontally. Also set for platforms when sprites are locked. When non-zero the OAM finish routine skips Mario interaction and the Banzai Bill/platform code skips work.
Values: 0 = near the screen; 1 = far off-screen.
7 uses in 7 routines (2 read, 5 write) W $01:A390 STA.W $15C4,X ; [$15C4] = 1 if the sprite is far off screen horizontally, else 0 R $01:B852 LDA.W $15C4,X ; $15C4 non-zero (probably sprite is off-screen): no interaction W $01:CA06 STA.W $15C4,X ; [$15C4,X] = off-screen flag (also set when sprites are locked) R $02:D78B LDA.W $15C4,X ; A = offscreen flag [$15C4+X] $15D0 Sprite being eaten flag flag byte table, one per sprite slot (index X or Y) Set to 1 while Yoshi's tongue has a sprite and is swallowing it. Contact and interaction routines OR it in so the sprite is ignored (bounce blocks, fireballs, sprite-to-sprite loop). Cleared when the sprite is spat out. Magikoopa sets it while hidden (probably so Yoshi cannot eat it).
Values: 0 = not eaten; non-zero = on Yoshi's tongue.
21 uses in 20 routines (13 read, 8 write) R $01:8E7E LDA.W $15D0,X ; Eaten flag [$15D0,X] R $01:9670 LDA.W $15D0,Y ; Sprite [$1594]'s eaten flag set (probably the owner): skip R $01:A42F ORA.W $15D0,X ; OR in $15D0 (B is on Yoshi's tongue) W $01:BDD8 STA.W $15D0,X ; [$15D0,X] = 1 (probably: not edible by Yoshi while hidden) W $01:BE6E STZ.W $15D0,X ; State 2: [$15D0,X] = 0 W $01:E093 STZ.W $15D0,X ; Clear [$15D0] (waiting flag) W $01:E09B STA.W $15D0,X ; [$15D0] = timer (marks the sprite as waiting) R $01:E30C ORA.W $15D0,X ; Wait while [$1540] or [$15D0] is non-zero W $01:F520 STA.W $15D0,Y ; Eaten sprite flag $15D0 = 1 (being eaten) W $03:952A STA.W $15D0,X ; Copy timer to [$15D0] W $07:F761 STZ.W $15D0,X ; $15D0,X = 0 (being eaten / on Yoshi's tongue flag) $15DC Sprite contact/ledge flag byte table, one per sprite slot (index X or Y) Little-used per-sprite flag. The Moving ledge (hole) sprite clears it ($0 = no contact) and the gravity update routine reads it. Cleared by the per-sprite table reset. Exact meaning is probably a contact flag; only seen as set/cleared and tested once.
5 uses in 3 routines (2 read, 3 write) W $02:E629 STA.W $15DC,Y ; [$15DC,Y] = 0 (no contact) $15E9 Current sprite slot byte (index) Slot number of the sprite whose routine is running. The main sprite loop stores X here before calling each sprite, and subroutines reload X from it after they have trashed X (draw routines, extended sprite code, the spawn routines). Also compared against other slots to skip a sprite's own slot.
96 uses in 79 routines (82 read, 14 write) W $01:80A9 STX.W $15E9 ; [$15E9] = current sprite slot R $01:846D CPY.W $15E9 ; Skip this sprite's own slot R $01:9527 LDX.W $15E9 ; X = sprite index R $01:9D9B LDX.W $15E9 ; Restore sprite index R $01:9DFF LDX.W $15E9 ; X = sprite index R $01:9F2A LDX.W $15E9 ; X = sprite index R $01:A47B LDY.W $15E9 ; Y = sprite A index again ($15E9) R $01:A4B6 LDX.W $15E9 ; X = sprite A index R $01:A585 LDY.W $15E9 ; Y = sprite A index R $01:A5DA LDX.W $15E9 ; X = sprite A index R $01:A7C5 LDY.W $15E9 ; Y = sprite A index R $01:ABD4 LDX.W $15E9 ; Restore X = sprite index R $01:B2FF LDX.W $15E9 ; X = sprite index R $01:B326 LDX.W $15E9 ; X = sprite index R $01:B3DD LDX.W $15E9 ; X = sprite index R $01:B41E LDX.W $15E9 ; X = sprite index R $01:B840 LDX.W $15E9 ; X = sprite index R $01:BBF5 LDX.W $15E9 ; X = sprite index R $01:BD71 LDX.W $15E9 ; X = Sprite index R $01:BDBA CPY.W $15E9 ; Skip this sprite's own slot R $01:BEC3 LDX.W $15E9 ; X = Sprite index R $01:BF5C LDX.W $15E9 ; X = Magikoopa sprite index again R $01:C05E LDX.W $15E9 ; X = Sprite index R $01:C6DD LDX.W $15E9 ; X = sprite index R $01:C902 LDX.W $15E9 ; X = Sprite index R $01:C9A1 LDX.W $15E9 ; X = Sprite index W $01:C9E8 STX.W $15E9 ; [$15E9] = sprite index R $01:D98D LDX.W $15E9 ; X = sprite index R $01:DCBE LDX.W $15E9 ; X = sprite index R $01:DE0D LDX.W $15E9 ; Restore X = this sprite's index R $01:E039 LDX.W $15E9 ; X = this sprite index R $01:E91E LDX.W $15E9 ; X = sprite index R $01:E942 LDX.W $15E9 ; X = sprite index W $01:EA80 STX.W $15E9 ; [$15E9] = Yoshi slot W $01:EA8B STA.W $15E9 ; Restore [$15E9] R $01:F56B CPY.W $15E9 ; Is this Yoshi himself? R $02:813B CPY.W $15E9 ; Is slot Y the exploding sprite itself ([$15E9])? W $02:93B0 STX.W $15E9 ; [$15E9] = current sprite slot W $02:9633 STX.W $15E9 ; X = 7: loop over extended sprite slots; [$15E9] = X W $02:99D4 STX.W $15E9 ; X = 3: loop over the 4 spinning coin slots; [$15E9] = current slot W $02:9B0C STX.W $15E9 ; X = 9: loop over the 10 extended sprite slots; [$15E9] = current slot R $02:9E14 LDX.W $15E9 ; Restore X = current sprite index R $02:9EE2 LDX.W $15E9 ; Restore X = current sprite index R $02:A0A5 LDX.W $15E9 ; Restore X = current sprite index W $02:A0BA STX.W $15E9 ; [$15E9] = current sprite index W $02:A14D STX.W $15E9 ; Restore [$15E9] = sprite index R $02:A20D LDX.W $15E9 ; Restore X = current sprite index R $02:A250 LDX.W $15E9 ; Restore X = current sprite index R $02:A3AA LDX.W $15E9 ; Restore sprite index X from [$15E9] R $02:A3E9 LDX.W $15E9 ; Restore sprite index X R $02:A5B8 LDX.W $15E9 ; Restore sprite index R $02:A6DF LDX.W $15E9 ; Restore sprite index W $02:ADBA STX.W $15E9 ; [$15E9] = current slot R $02:AE35 LDX.W $15E9 ; X = score sprite slot W $02:B38D STX.W $15E9 ; [$15E9] = current shooter index R $02:B516 LDX.W $15E9 ; X = current sprite index ([$15E9]) R $02:B55C LDX.W $15E9 ; X = current sprite index ([$15E9]) R $02:BA92 LDX.W $15E9 ; X = sprite index R $02:BFC0 LDX.W $15E9 ; X = sprite index R $02:C905 LDX.W $15E9 ; X = sprite index R $02:CA8F LDX.W $15E9 ; X = sprite index R $02:CAF6 LDX.W $15E9 ; X = sprite index R $02:CCEF LDX.W $15E9 ; X = sprite index R $02:CF37 LDX.W $15E9 ; X = sprite index R $02:D1B1 LDX.W $15E9 ; X = sprite index R $02:D290 LDX.W $15E9 ; X = sprite index R $02:D686 LDX.W $15E9 ; X = sprite index R $02:E5E3 CMP.W $15E9 ; Another sprite index owns the contact? If not this sprite, return R $02:E612 CMP.W $15E9 ; Else only retest if it is in contact with this ledge R $02:E61C LDX.W $15E9 ; X = this sprite; get its clipping box R $02:ED24 LDX.W $15E9 ; X = sprite index R $02:EDB3 LDX.W $15E9 ; X = this sprite R $02:EE6D LDX.W $15E9 ; X = sprite index R $02:F19D LDX.W $15E9 ; X = sprite index W $02:F812 STX.W $15E9 ; Remember the current slot in [$15E9] R $02:FB79 LDX.W $15E9 ; X = cluster sprite slot (saved in [$15E9]) R $02:FC3E LDX.W $15E9 ; X = current cluster sprite slot [$15E9] R $03:827C LDX.W $15E9 ; Restore the sprite index from [$15E9] R $03:842D LDX.W $15E9 ; X = sprite index [$15E9] R $03:99A4 LDX.W $15E9 ; X = sprite index R $03:AAF3 LDX.W $15E9 ; X = current sprite index R $07:F24A LDX.W $15E9 ; X = current sprite index [$15E9] R $07:FC58 LDX.W $15E9 ; X = current sprite index W $0C:A77A STX.W $15E9 ; Current sprite slot = 0 $15EA Sprite OAM index RAM_SprOAMIndex byte table, one per sprite slot (index X) Byte offset into the OAM buffer where this sprite's tiles are written. The slot assigner gives each sprite its offset and sprite draw routines load Y from it. Some sprites add 4 per tile to move to the next OAM slot, or set 0 to take the first OAM slots (draw priority).
148 uses in 94 routines (106 read, 42 write) R $00:FBE4 LDY.W RAM_SprOAMIndex,X ; Y = OAM index of this sprite W $01:80E2 STA.W RAM_SprOAMIndex,X ; Store as the sprite's OAM index R $01:89F6 LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the sprite W $01:8DB5 STA.W RAM_SprOAMIndex,X ; Skip the 4 OAM bytes between the wings (body goes there)... OAM index += 4 R $01:8E01 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $01:8E8A LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $01:8FAC LDY.W RAM_SprOAMIndex,X ; Y = OAM index W $01:981B STA.W RAM_SprOAMIndex,X ; Body goes in the later OAM slots; first slots stay for the feet W $01:9822 STA.W RAM_SprOAMIndex,X ; Restore OAM index R $01:9831 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $01:9A5A LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $01:9D17 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $01:9E49 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $01:9EB7 LDA.W RAM_SprOAMIndex,X ; Save OAM index R $01:9F20 LDY.W RAM_SprOAMIndex,X ; Y = OAM index W $01:9F83 STZ.W RAM_SprOAMIndex,X ; OAM index = 0 for the carried sprite W $01:A27E STZ.W RAM_SprOAMIndex,X ; Eating in progress: OAM index = 0 R $01:A3CD LDY.W RAM_SprOAMIndex,X ; Y = OAM index of this sprite ($15EA) W $01:AD73 STZ.W RAM_SprOAMIndex,X ; Hit timer running: OAM index = 0 (first OAM slots, probably for draw priority) W $01:AD7D STA.W RAM_SprOAMIndex,X ; OAM index = 4 when not on Yoshi R $01:AD83 LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the block tile R $01:AE65 LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the block tile R $01:B421 LDY.W RAM_SprOAMIndex,X ; Y = sprite OAM index R $01:B72A LDY.W RAM_SprOAMIndex,X ; Y = sprite OAM index R $01:B7BF LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the sprite's first tile W $01:BB35 STA.W RAM_SprOAMIndex,X ; OAM index = $30 R $01:BEE1 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $01:C194 LDY.W RAM_SprOAMIndex,X ; Y = Index into sprite OAM R $01:C35B LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the sprite W $01:C632 STA.W RAM_SprOAMIndex,X ; Mode 7 boss room: OAM index = $D8 R $01:C7CE LDY.W RAM_SprOAMIndex,X ; Y = Index into sprite OAM R $01:C84D LDY.W RAM_SprOAMIndex,X ; Y = Index into sprite OAM R $01:C927 LDY.W RAM_SprOAMIndex,X ; Y = Index into sprite OAM R $01:C9A4 LDY.W RAM_SprOAMIndex,X ; Y = Index into sprite OAM W $01:D499 STA.W RAM_SprOAMIndex,X ; Store in sprite OAM index R $01:D5FB LDA.W RAM_SprOAMIndex,X ; OAM index W $01:D601 STA.W RAM_SprOAMIndex,X ; Store OAM index R $01:DBD7 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $01:DC80 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $01:DF23 LDY.W RAM_SprOAMIndex,X ; Y = index into sprite OAM R $01:E170 LDY.W RAM_SprOAMIndex,X ; Y = index into sprite OAM R $01:E45F LDY.W RAM_SprOAMIndex,X ; Y = OAM index of this sprite W $01:E947 STA.W RAM_SprOAMIndex,X ; OAM index = $F8 (puffs 3 and 2) W $01:E954 STA.W RAM_SprOAMIndex,X ; OAM index = [$18B6] (puffs 1 and 0) R $01:EE9B LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the body tile R $01:EF6F LDY.W RAM_SprOAMIndex,X ; Y = OAM index W $01:EF84 STA.W RAM_SprOAMIndex,X ; OAM index = saved index + 4 (body uses the next slot) R $01:F090 LDY.W RAM_SprOAMIndex,X ; Y = Yoshi OAM index R $01:F790 LDY.W RAM_SprOAMIndex,X ; Y = Index into sprite OAM R $01:F7AD LDY.W RAM_SprOAMIndex,X ; Y = Index into sprite OAM R $01:FA1F LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the sprite R $01:FA63 LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the sprite R $01:FEC5 LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the sprite R $02:B685 LDY.W RAM_SprOAMIndex,X ; Y = sprite OAM index R $02:B745 LDY.W RAM_SprOAMIndex,X ; Y = sprite OAM index R $02:BE58 LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the sprite W $02:BEBC STA.W RAM_SprOAMIndex,X ; OAM index += 4 (first slot is kept for the eye) W $02:BF1B STA.W RAM_SprOAMIndex,X ; OAM index -= 4 (back to the reserved slot) R $02:CCCB LDY.W RAM_SprOAMIndex,X ; Y = sprite OAM index R $02:CEF9 LDY.W RAM_SprOAMIndex,X ; Y = sprite OAM index R $02:D3D5 LDY.W RAM_SprOAMIndex,X ; Y = OAM index of this sprite R $02:D790 LDA.W RAM_SprOAMIndex,X ; A = OAM index of this sprite R $02:D8CB LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the contained sprite tile R $02:DC50 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $02:DE4D LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $02:DEF0 LDY.W RAM_SprOAMIndex,X ; Y = sprite OAM index R $02:E00E LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $02:E249 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $02:E3C0 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $02:E495 LDA.W RAM_SprOAMIndex,X ; Save sprite's OAM index (the code below shifts it for the second platform) W $02:E4A1 STA.W RAM_SprOAMIndex,X ; Restore OAM index (so the sprite's OAM slot is unchanged for next frame) R $02:E6C7 LDY.W RAM_SprOAMIndex,X ; Y = OAM index W $02:E6EE STA.W RAM_SprOAMIndex,X ; OAM index = $38 R $02:EA25 LDY.W RAM_SprOAMIndex,X ; Baby Yoshi draw tail: Y = OAM index of the sprite R $02:EDFA LDY.W RAM_SprOAMIndex,X ; Y = OAM index W $02:EF23 STA.W RAM_SprOAMIndex,X ; OAM index += 4: next slot R $02:EF2A LDY.W RAM_SprOAMIndex,X ; Y = new OAM index W $02:EF3F STA.W RAM_SprOAMIndex,X ; Restore OAM index R $02:F1A5 LDY.W RAM_SprOAMIndex,X ; Y = OAM index (slot 0) R $02:F1C8 LDY.W RAM_SprOAMIndex,X ; Y = OAM index (slot 0) R $02:F228 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $02:F48D LDY.W RAM_SprOAMIndex,X ; Y = OAM index W $02:F946 STA.W RAM_SprOAMIndex ; [RAM_SprOAMIndex] = OAM index for this slot ([DATA_02FF50+Y]) R $03:843C LDY.W RAM_SprOAMIndex,X ; Unused: Y = OAM index R $03:84CE LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $03:86AB LDY.W RAM_SprOAMIndex,X ; Y = OAM index of this sprite R $03:88A7 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $03:8968 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $03:8DAC LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $03:8F88 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $03:900D LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $03:9218 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $03:9288 LDY.W RAM_SprOAMIndex,X ; Y = index into sprite OAM R $03:9790 LDY.W RAM_SprOAMIndex,X ; Y = OAM index R $03:A071 LDY.W RAM_SprOAMIndex,X ; Y = OAM index W $03:A3F3 STA.W RAM_SprOAMIndex,X ; Use OAM slots starting at $70 W $03:ACCF STA.W RAM_SprOAMIndex,X ; OAM index = $D0 W $03:AF6B STA.W RAM_SprOAMIndex,X ; OAM index = $EC R $03:AFE0 LDY.W RAM_SprOAMIndex,X ; Y = OAM index W $03:B223 STA.W RAM_SprOAMIndex,X ; Store sprite OAM index R $03:B261 LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the sprite R $03:B7BD LDY.W RAM_SprOAMIndex,X ; Y = sprite OAM index R $03:C244 LDY.W RAM_SprOAMIndex,X ; Y = OAM index of this sprite R $03:C4A5 LDY.W RAM_SprOAMIndex,X ; Y = OAM index of this sprite W $0C:A014 STA.W RAM_SprOAMIndex ; Sprite slot 0 OAM index = $A0 W $0C:A288 STA.W RAM_SprOAMIndex ; Yoshi OAM index = $30 $15F6 Sprite palette and properties RAM_SpritePal byte table, one per sprite slot (index X or Y); YXPPCCCT OAM property byte for the sprite: palette, priority and flips. Loaded from the sprite tweaker table when the sprite spawns and ORed into the tile properties by the draw routines.
Bits: 7 Y flip; 6 X flip; 4-5 priority; 1-3 palette; 0 name table. Cheep Cheep and the killed-sprite code shift bit 7 out (clears Y flip); the Bob-omb flashes by EORing in ([$1540 ] * 2) & $0E.
114 uses in 64 routines (56 read, 42 write, 16 read-modify-write) W $00:FBD8 STA.W RAM_SpritePal,X ; Sprite palette = 4 (palette A) W $00:FCC8 STA.W RAM_SpritePal,X ; Sprite palette = Yoshi color [$13C7] W $00:FCD2 STA.W RAM_SpritePal,X ; Non-zero: sprite palette = 6 W $01:8322 STA.W RAM_SpritePal,X ; Sprite palette = 1 W $01:8345 STA.W RAM_SpritePal,X ; Sprite palette = YoshiPal[Y] W $01:8FF5 STA.W RAM_SpritePal,X ; Palette/flip = BulletGfxProp[direction] R $01:9655 EOR.W RAM_SpritePal,X ; Flash: [$15F6] ^= ([$1540] * 2) & $0E RW $01:967F LSR.W RAM_SpritePal,X ; Clear [$15F6] bit 7 (vertical flip) RW $01:96D3 LSR.W RAM_SpritePal,X ; Clear [$15F6] bit 7 (vertical flip) R $01:9F3D ORA.W RAM_SpritePal,X ; A = sprite palette bits R $01:A2D8 LDA.W RAM_SpritePal,X ; Save palette W $01:A2E3 STA.W RAM_SpritePal,X ; Clear palette bit 0 W $01:A748 STA.W RAM_SpritePal,Y ; Shell is upside down: clear the flip bit R $01:A99D LDA.W RAM_SpritePal,X ; A = sprite palette/properties R $01:A9A8 LDA.W RAM_SpritePal,X ; A = sprite palette/properties W $01:A9AF STA.W RAM_SpritePal,X ; Store: the sprite keeps its original palette RW $01:AB14 ASL.W RAM_SpritePal,X ; Clear bit 0 of sprite palette/properties [$15F6,X] RW $01:B0B0 LSR.W RAM_SpritePal,X ; Clear Y flip R $01:B35B ORA.W RAM_SpritePal,X ; Tile properties = priority [$64] | sprite properties (first tile) R $01:B9E1 LDA.W RAM_SpritePal,X ; A = sprite palette W $01:B9E9 STA.W RAM_SpritePal,X ; Store the temporary palette W $01:B9F0 STA.W RAM_SpritePal,X ; Restore the real palette W $01:BCCA STA.W RAM_SpritePal,X ; Cycle the sprite palette W $01:C279 STA.W RAM_SpritePal,X ; Cycle the sprite palette: [$15F6,X] ^= ([$14] >> 1) & $0E R $01:D5DA LDA.W RAM_SpritePal,X ; Sprite palette W $01:D5E2 STA.W RAM_SpritePal,X ; Store palette W $01:D5F8 STA.W RAM_SpritePal,X ; Store palette W $01:E0C8 STA.W RAM_SpritePal,X ; Store the flip bit W $01:E36B STA.W RAM_SpritePal,X ; Store W $01:E37B STA.W RAM_SpritePal,X ; Clear the flip bits again RW $01:E436 ROR.W RAM_SpritePal,X ; Set bit 7 of the palette/flip byte (flip upside down) R $01:E743 ORA.W RAM_SpritePal,X ; First tile properties = [$64] priority | sprite palette W $01:EA6A STA.W RAM_SpritePal,X ; If it is the moving coin, use palette 2 R $01:F84F LDA.W RAM_SpritePal,X ; Sprite palette bits R $01:F85C LDA.W RAM_SpritePal,X ; Sprite palette bits W $01:F863 STA.W RAM_SpritePal,X ; Store (keeps the egg's color) W $02:8A39 STA.W RAM_SpritePal,X ; Set sprite palette RW $02:9489 ROR.W RAM_SpritePal,X ; Set the Y flip bit of the sprite palette byte (upside down) W $02:A9C4 STA.W RAM_SpritePal,X ; Sprite palette = 1 (silver coin colours), other bits kept W $02:AC45 STA.W RAM_SpritePal ; Restore the palette W $02:B9F0 STA.W RAM_SpritePal,X ; Sprite palette: clear bits 1-3, then palette bits = 2 (silver coin colors) W $02:BD1A STA.W RAM_SpritePal,X ; Sprite palette bits: keep low 6, set X/Y flip from table W $02:E10F STA.W RAM_SpritePal,X ; Palette = $0A W $02:F05B STA.W RAM_SpritePal,X ; Sprite palette = ([pal] AND $F1) OR [$00] W $03:8059 STA.W RAM_SpritePal,X ; Flip the sprite horizontally: [$15F6] ^= $40 W $03:81B3 STA.W RAM_SpritePal,X ; Flash: [$15F6] ^= [$1540] & $0E (palette bits) W $03:B357 STA.W RAM_SpritePal,X ; Set sprite palette W $03:C08A STA.W RAM_SpritePal,X ; Restore the palette with the low bit cleared W $07:F797 STA.W RAM_SpritePal,X ; Sprite palette/page = [$166E] & $0F $1602 Sprite animation frame byte table, one per sprite slot (index X) Current graphics frame of the sprite. The main routine picks it (from a frame table or by counting) and the draw routine selects the tiles from it. Examples: Yoshi frame, Chuck frame, Boo face visible (0) or hiding (3), springboard frame, walk frame of Ludwig and Iggy/Larry. The flying grey turnblocks reuse it as a direction switch timer.
236 uses in 135 routines (76 read, 145 write, 15 read-modify-write) W $01:8A96 STA.W $1602,X ; Animation frame [$1602,X] = A W $01:8BCE STA.W $1602,X ; Image [$1602,X] = 2 (turning) R $01:8BEC LDA.W $1602,X ; Carry := bit 0 of the animation frame (affects the SBC below) RW $01:8F11 INC.W $1602,X ; Image [$1602,X]++ W $01:8FA1 STA.W $1602,X ; Image [$1602,X] = Y W $01:8FFB STA.W $1602,X ; Image [$1602,X] = DATA_018FCF[direction] W $01:980F STA.W $1602,X ; [$1602] = animation frame W $01:9B1D STZ.W $1602,X ; Animation frame [$1602] = 0 W $01:9B3F STA.W $1602,X ; Animation frame 1 W $01:9B61 STA.W $1602,X ; Use the shell frame: animation frame 6 W $01:A13D STA.W $1602,X ; Animation frame [$1602] = A AND 1 W $01:A278 STA.W $1602,X ; Animation frame [$1602] = Y W $01:A2E8 STA.W $1602,X ; Frame [$1602] = $0C W $01:A314 STA.W $1602,X ; Frame [$1602] = DATA_01A35A[Y] RW $01:B22B INC.W $1602,X ; Falling platform: use the long platform (animation frame 1) RW $01:B25E INC.W $1602,X ; Checkerboard platform: use the long platform (frame 1) W $01:B9D9 STA.W $1602,X ; $1602 = animation frame W $01:BA68 STA.W $1602,X ; $1602 = animation frame = behind-scenery flag W $01:BE62 STZ.W $1602,X ; Animation frame = 0 W $01:BEA9 STA.W $1602,X ; Animation frame [$1602,X] R $01:BECE LDA.W $1602,X ; Animation frame R $01:C09F LDA.W $1602,X ; Already triggered ([$1602,X])? RW $01:C101 INC.W $1602,X ; Mark as triggered ([$1602,X]++) W $01:CA0E STZ.W $1602,X ; Mario standing flag [$1602,X] = 0 W $01:CA39 STA.W $1602,X ; [$1602,X] = 3: Mario is standing on this platform W $01:CE90 STA.W $1602,X ; Animation frame [$1602] = A W $01:CEF9 STA.W $1602,X ; Animation frame [$1602] = walk frame table[Y] W $01:CF79 STA.W $1602,X ; Animation frame [$1602] = A W $01:CF9A STA.W $1602,X ; Animation frame [$1602] = Y W $01:CFB3 STA.W $1602,X ; Animation frame [$1602] = 7 (getting up) W $01:D15E STA.W $1602,X ; Animation frame [$1602] = A W $01:D260 STA.W $1602,X ; Store frame in [$1602] R $01:D2D8 LDA.W $1602,X ; Boss animation frame R $01:D302 LDA.W $1602,X ; Boss animation frame R $01:D421 LDA.W $1602,X ; Boss animation frame R $01:D48A LDA.W $1602,X ; Animation frame W $01:D5EB STA.W $1602,X ; Store in [$1602] W $01:D642 STA.W $1602,X ; Store [$1602] (enemy pose) W $01:D64A STZ.W $1602,X ; Landed: frame 0 W $01:D6D8 STA.W $1602,X ; Animation frame [$1602] = $10 or 0 R $01:DAA4 LDA.W $1602,X ; Platform type [$1602] RW $01:E0C3 INC.W $1602,X ; Falling: use the frames 2 higher W $01:E355 STA.W $1602,X ; Animation frame = DATA_01E35F[Y] W $01:E370 STA.W $1602,X ; Animation frame 3 W $01:E384 STA.W $1602,X ; Animation frame 2 (in the air) W $01:E3EB STA.W $1602,X ; Animation frame 1 W $01:E519 STA.W $1602,X ; Store animation frame in [$1602] W $01:E53C STA.W $1602,X ; Store frame in [$1602] W $01:E669 STA.W $1602,X ; Springboard frame [$1602] = DATA_01E611[Y] W $01:E6DF STZ.W $1602,X ; Frame [$1602] = 0 R $01:E6F0 LDY.W $1602,X ; Y = frame [$1602] W $01:EB45 STA.W $1602,X ; Store pose in [$1602] W $01:EC48 STA.W $1602,X ; [$1602] = pose from GrowingAniSequence R $01:EE61 LDA.W $1602,X ; Save the Yoshi animation frame [$1602,X] for later W $01:EED9 STA.W $1602,X ; Restore the original animation frame W $01:EF94 STA.W $1602,X ; Body tile = YoshiBodyTiles[frame] W $01:F3D3 STA.W $1602,X ; Yoshi frame = DATA_01F3D9[Y] R $01:F409 LDY.W $1602,X ; Y = Yoshi's current frame index ([$1602]) W $01:F92F STZ.W $1602,X ; Animation frame [$1602] = 0 (face visible) W $01:F938 STA.W $1602,X ; Shy: frame 3 (hands over face) W $01:F986 STA.W $1602,X ; Frame [$1602] = DATA_01F8D1[Y] (turn frames 1,2,2,1) W $01:FA16 STA.W $1602,X ; Animation frame [$1602] = Y W $01:FC05 STA.W $1602,X ; Animation frame [$1602] = DATA_01FAE5[Y] W $01:FC27 STA.W $1602,X ; Frame 6 (turning) W $01:FC37 STA.W $1602,X ; Frame [$1602] = DATA_01FD95[Y] (throw animation) W $01:FC54 STA.W $1602,X ; Frame 3 (hurt) W $02:AF70 STA.W $1602,X ; [$1602] = angle low (probably) W $02:BD0F STA.W $1602,X ; [$1602] = animation frame + base frame for this state W $02:BF72 STA.W $1602,X ; [$1602] = animation frame from the sequence W $02:C086 STA.W $1602,X ; Set the animation frame W $02:C0C6 STA.W $1602,X ; Set the animation frame W $02:C187 STA.W $1602,X ; Set the body frame W $02:C23A STA.W $1602,X ; Body frame = 5 W $02:C250 STA.W $1602,X ; Rising in the air: body frame = 6 (jump) W $02:C391 STA.W $1602,X ; Set body frame W $02:C415 STA.W $1602,X ; Idle: body frame 0 W $02:C450 STA.W $1602,X ; Set body frame W $02:C504 STA.W $1602,X ; Set body frame W $02:C513 STA.W $1602,X ; Landed: body frame 4 W $02:C53E STA.W $1602,X ; Body frame = 6 W $02:C566 STA.W $1602,X ; Body frame = 3 W $02:C5FE STA.W $1602,X ; Pose = 9 (crouching/splitting) W $02:C61A STA.W $1602,X ; Pose = 3 (standing) W $02:C63D STA.W $1602,X ; Pose = 3 (standing) W $02:C728 STA.W $1602,X ; Pose = 3 (standing) W $02:C763 STA.W $1602,X ; Pose = hurt pose by step W $02:D1D9 STA.W $1602,X ; [$1602] = Yoshi pose R $02:D644 ADC.W $1602,X ; Angle low [$1602+X] += step R $02:D658 LDA.W $1602,X ; A = angle low RW $02:DD04 INC.W $1602,X ; Next animation frame W $02:DD47 STA.W $1602,X ; Set the frame W $02:DD7D STA.W $1602,X ; Set the animation frame W $02:DFDB STA.W $1602,X ; Store in [$1602] W $02:E004 STA.W $1602,X ; Store in [$1602] W $02:E0E1 STA.W $1602,X ; Store in [$1602] W $02:E0F9 STA.W $1602,X ; Store in [$1602] W $02:E946 STA.W $1602,X ; Killed: animation frame $1602 = 2 W $02:E953 STZ.W $1602,X ; Animation frame = 0 RW $02:E9D1 INC.W $1602,X ; Timer < $40: animation frame++ (throwing pose) W $02:EB45 STA.W $1602,X ; Animation frame [$1602] = Y W $02:EBC6 STA.W $1602,X ; Store animation frame [$1602] RW $02:EBE3 INC.W $1602,X ; Frame + 1: shifts to frames 7/8 W $02:EC02 STA.W $1602,X ; Store animation frame [$1602] W $02:F0BB STZ.W $1602,X ; Reset the segment state counter [$1602] RW $02:F0C9 INC.W $1602,X ; A = [$1602], then [$1602]++ W $02:F31E STA.W $1602,X ; Frame [$1602] = 4 (turned) RW $02:F39F INC.W $1602,X ; Last 8 frames: frame 1 (peck) W $03:80C0 STA.W $1602,X ; Graphics frame [$1602] = 3 (hiding) W $03:8114 STA.W $1602,X ; Graphics frame [$1602] = 3 (hiding) W $03:8119 STZ.W $1602,X ; Graphics frame [$1602] = 0 (normal) W $03:8147 STA.W $1602,X ; Graphics frame [$1602] = DATA_038102[Y] (turn animation) W $03:81B8 STA.W $1602,X ; Graphics frame [$1602] = 3 (hiding) W $03:83BA STA.W $1602,X ; Store the graphics frame [$1602] RW $03:860C DEC.W $1602,X ; [$1602]--: direction switch timer W $03:865B STA.W $1602,X ; [$1602] = $7F: direction switch timer W $03:8672 STA.W $1602,Y ; [$1602,Y] = $7F: sync the other block's direction timer W $03:8932 STA.W $1602,X ; Graphics frame [$1602] = 1 or 2 (flap animation) W $03:8A73 STZ.W $1602,X ; Graphics frame = 0 RW $03:8A7C INC.W $1602,X ; Graphics frame = 1 (jumping) W $03:9073 STZ.W $1602,X ; [$1602] = 0: normal animation frame RW $03:907B INC.W $1602,X ; [$1602] = 1: turning animation frame R $03:90F7 ADC.W $1602,X ; Y = direction * 2 + animation frame W $03:930E STA.W $1602,X ; Remember step byte in [$1602] ($FF = end of path) R $03:9324 LDA.W $1602,X ; A = step byte W $03:954D STA.W $1602,X ; Store frame in [$1602] W $03:975E STZ.W $1602,X ; Animation frame = 0 W $03:9A7B STZ.W $1602,X ; Frame [$1602,X] = 0: normal image W $03:9A92 STA.W $1602,X ; Frame [$1602,X] = 2: turning image W $03:9AA3 STA.W $1602,X ; Frame [$1602,X] = 1: firing image W $03:9C89 STZ.W $1602,X ; Frame [$1602,X] = 0 W $03:9D6D STA.W $1602,X ; Frame [$1602,X] R $03:9DB6 LDA.W $1602,X ; A = frame [$1602,X] (2 = horizontal flame, 3 = vertical flame) W $03:9DFA STA.W $1602,X ; Frame [$1602,X] = bit 3 of the counter: toggles every 8 frames R $03:9E51 LDA.W $1602,X ; A = animation frame [$1602] R $03:9EAE LDA.W $1602,X ; A = animation frame [$1602] W $03:9FEF STZ.W $1602,X ; Frame = 0 (mouth closed) RW $03:A041 INC.W $1602,X ; Near the top of the leap: frame 1 (mouth open) R $03:A0A2 ADC.W $1602,X ; $03 = frame * 5 (index into BlarggTilemap) R $03:ACB8 LDY.W $1602,X ; Y = Peach pose frame [$1602] W $03:AD1E STA.W $1602,X ; Peach pose frame [$1602] = 4 W $03:AD39 STA.W $1602,X ; Peach pose [$1602] = 6 (falling) W $03:ADE5 STA.W $1602,X ; Every 16 frames toggle pose [$1602] = 8 W $03:AE4D STA.W $1602,X ; Peach pose [$1602] = $0A W $03:B303 STA.W $1602,X ; Store animation frame W $03:B36C STA.W $1602,X ; Stunned frame = Y W $03:C08F STA.W $1602,X ; [$1602] = $0C (animation frame) R $03:C3F2 LDA.W $1602,X ; A = animation frame [$1602] R $03:C3F7 ADC.W $1602,X ; [$03] = frame * 3 (index into the Y offset and tile tables) W $03:C8ED STA.W $1602,X ; Animation frame [$1602] = DATA_03C8F1[Y] W $03:C962 STA.W $1602,X ; Animation frame [$1602] = A W $03:CCDC STA.W $1602,X ; [$1602] = DATA_03CC51[index]: initial animation frame W $03:CDEB STA.W $1602,X ; [$1602] = DATA_03CD37[Y]: animation frame W $03:CE52 STA.W $1602,X ; [$1602] = DATA_03CE56[Y]: recoil animation frame W $07:F73C STZ.W $1602,X ; $1602,X = 0 (animation frame) R $0C:A01A LDX.W $1602 ; X = [$1602] (Yoshi animation frame) W $0C:A78A STA.W $1602 ; Restore [$1602] $160E Sprite misc table 6 byte table, one per sprite slot (index X or Y) General-purpose per-sprite byte, meaning depends on the sprite type. Examples: for Yoshi, slot of the sprite held in his mouth ($FF = none); for a shelless Koopa, slot of the sprite to kick; Mario-on-platform flag for Banzai Bill chained platforms; Lakitu slot for the cloud; Chuck jump flag; Morton/Roy right walk limit; goal tape hit flag; current line guide segment number.
70 uses in 34 routines (38 read, 23 write, 9 read-modify-write) RW $00:FCE1 DEC.W $160E,X ; [$160E,X]-- (probably clears the Yoshi mouth/swallow slot to $FF) RW $01:83E0 DEC.W $160E,X ; [$160E,X] -= 1 (to $FF) R $01:896F LDY.W $160E,X ; Y = slot of the sprite to kick [$160E,X] R $01:8992 LDY.W $160E,X ; Y = slot of the kicked sprite R $01:8A1A LDY.W $160E,X ; Y = slot of the kicked sprite W $01:8AD6 STA.W $160E,Y ; Other sprite [$160E] = Koopa's sprite number R $01:8CA5 LDY.W $160E,X ; Y = [$160E,X] W $01:A25A STA.W $160E,X ; [$160E] = $FF (no sprite in mouth) R $01:A288 LDY.W $160E,X ; Y = slot of the sprite in the mouth ([$160E]) RW $01:A2EB DEC.W $160E,X ; [$160E] = $FF R $01:A32E LDY.W $160E,X ; Y = slot of the sprite in the mouth W $01:A724 STA.W $160E,X ; $160E,X = shell sprite index W $01:A7B8 STA.W $160E,X ; $160E,X = shell index RW $01:C10E INC.W $160E,X ; Mark as hit ([$160E,X]++) R $01:C12D LDA.W $160E,X ; Hit already ([$160E,X])? W $01:C9DF STZ.W $160E,X ; Clear the Mario contact flag W $01:CA15 STA.W $160E,X ; Mario contact flag [$160E,X] = 1 W $01:CD8E STA.W $160E,X ; Walk limit [$160E] = $D8 (right wall X) W $01:CECA STA.W $160E,X ; Jump X speed [$160E] = table by direction to Mario RW $01:D179 DEC.W $160E,X ; Right walk limit [$160E]-- R $01:D871 LDY.W $160E,X ; Y = current segment number [$160E] R $01:D89F LDY.W $160E,X ; Tiles $96-$99: stay on the current segment [$160E] W $01:D8E4 STA.W $160E,X ; [$160E] = current segment number W $01:E7EC STA.W $160E,X ; [$160E] = slot of the Lakitu riding this cloud R $01:E995 LDY.W $160E,X ; Y = Lakitu slot R $01:E9A6 LDA.W $160E,X ; A = Lakitu slot R $01:EA02 LDY.W $160E,X ; Y = Lakitu slot R $01:F15A LDY.W $160E,X ; Y = sprite held in the mouth R $01:F1B2 LDY.W $160E,X ; Y = held sprite W $01:F1BB STA.W $160E,X ; Nothing in mouth: [$160E,X] = $FF W $01:F1D8 STA.W $160E,X ; Nothing caught yet: [$160E,X] = $FF R $01:F1F4 LDY.W $160E,X ; Y = held sprite W $01:F25B STA.W $160E,X ; Mouth empty: [$160E,X] = $FF W $01:F37F STA.W $160E,X ; Mouth empty: [$160E,X] = $FF R $01:F4B2 LDA.W $160E,X ; Index of the sprite held in Yoshi's mouth ([$160E]) R $01:F4D6 LDY.W $160E,X ; Y = eaten sprite index R $01:F4E1 LDY.W $160E,X ; Y = eaten sprite index R $01:F570 LDA.W $160E,X ; Already holding a sprite? W $01:F5FC STA.W $160E,X ; Yoshi's mouth sprite [$160E] = sprite being eaten RW $01:FC81 INC.W $160E,X ; Mark kid as fallen: [$160E]++ RW $02:BAEC INC.W $160E,X ; [$160E]++ (probably flags this mushroom as a berry) R $02:C4EE LDY.W $160E,X ; [$160E] = jump flag W $02:C50E STZ.W $160E,X ; Clear jump flag RW $02:C533 INC.W $160E,X ; Set jump flag R $02:D0D9 LDA.W $160E,X ; A = [$160E] (probably Yoshi tongue/mouth state) W $02:D726 STA.W $160E,X ; [$160E+X] = 3: Mario is on the platform R $02:D73D LDA.W $160E,X ; A = Mario-on-platform flag W $02:D742 STZ.W $160E,X ; Clear the flag W $02:EAB7 STA.W $160E,X ; Sprite in mouth [$160E] = candidate slot R $03:C02F LDY.W $160E,X ; Y = sprite slot of the sprite caught by Baby Yoshi's tongue R $03:C03C LDA.W $160E,Y ; A = [$160E] of the caught sprite RW $03:C092 DEC.W $160E,X ; [$160E] -= 1 (no caught sprite: $00 becomes $FF) W $03:CD07 STA.W $160E,Y ; Copy [$160E] (pipe seed) from the main sprite No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 read) R $00:F92C LDA.W $1617 ; A = [$1617] & $FF + 1 $161A Sprite index in level data RAM_SprIndexInLvl byte table, one per sprite slot (index X) Index of this sprite in the level's sprite list, set when the sprite is spawned from the level data so it is not respawned while on screen and can be marked as spawned again when erased.
Values: $FF = never reload this sprite (erased permanently, or a group spawn that should respawn only through its leader).
10 uses in 10 routines (4 read, 6 write) W $01:8153 STA.W RAM_SprIndexInLvl,X ; Level sprite index = $FF: the sprite will never be reloaded W $01:AE2A STA.W RAM_SprIndexInLvl,X ; Level index = $FF: never respawn this sprite W $02:A99B STA.W RAM_SprIndexInLvl,X ; [$161A,X] = index of this sprite in the level data W $02:AC02 STA.W RAM_SprIndexInLvl,X ; Level index $FF: never reload this sprite W $02:AF7F STA.W RAM_SprIndexInLvl,X ; Remember it so only this platform respawns the group W $02:AFEE STA.W RAM_SprIndexInLvl,X ; Remember it so only this Eerie respawns the group R $03:B8B3 LDY.W RAM_SprIndexInLvl,X ; Y = index of this sprite in the level's sprite list $1626 Sprite misc counter byte table, one per sprite slot (index X or Y) Per-sprite counter. For ordinary sprites it counts consecutive kills made by a kicked shell or stomps (kill chain), added into the points given and cleared when Mario lands. Also Ludwig and Koopa Kid hit counts. Line-guided platforms use it as a waiting-for-Mario flag (probably). Cleared by the table reset.
24 uses in 15 routines (13 read, 7 write, 4 read-modify-write) W $01:A015 STZ.W $1626,X ; Clear [$1626] (consecutive enemies stomped counter, probably) R $01:A604 LDY.W $1626,X ; B consecutive-kill counter $1626++, Y = count W $01:AA04 STZ.W $1626,X ; Clear [$1626,X] (kill chain counter) R $01:AB4B ADC.W $1626,X ; Add the sprite's kill chain count [$1626,X] R $01:CFC9 LDA.W $1626,X ; Hit counter [$1626]++ RW $01:D3F8 INC.W $1626,X ; Fireball hit count [$1626]++ RW $01:D6E9 INC.W $1626,X ; [$1626]++ (probably 'waiting for Mario' flag) R $01:DA84 LDA.W $1626,X ; Rope waiting flag [$1626]? W $01:DA89 STZ.W $1626,X ; Clear the waiting flag W $01:F226 STA.W $1626,Y ; Clear the item's state, [$15D0] (eaten flag) and [$1626] R $03:962D ADC.W $1626,X ; + sprite's own counter [$1626] $1632 Sprite behind-scenery flag RAM_SprBehindScrn flag byte table, one per sprite slot (index X or Y) Which layer the sprite is on: in front of or behind layer 1 scenery. Sprites only interact when both have the same value, so it is EORed in contact checks. Net Koopas toggle it when climbing through a net, and the pipe Lakitu sets it to go behind scenery. Read by the draw routines for priority.
Values: 0 = in front; non-zero = behind scenery.
20 uses in 13 routines (14 read, 6 write) W $01:9A9F STA.W RAM_SprBehindScrn,X ; Sprite goes behind layers W $01:9B3A STA.W RAM_SprBehindScrn,X ; Pipe Lakitu: sprite goes behind scenery R $01:A435 EOR.W RAM_SprBehindScrn,Y ; OR in layer difference: sprites must be in front of/behind the scenery together R $01:A81F EOR.W RAM_SprBehindScrn,X ; EOR the sprite behind-scenery flag W $01:B95A STA.W RAM_SprBehindScrn,X ; Behind-scenery flag = 0 (in front of the net) or 1 (behind), set by X position W $01:B997 STA.W RAM_SprBehindScrn,X ; Toggle the in-front/behind net flag R $01:B9C6 LDA.W RAM_SprBehindScrn,X ; Behind-scenery flag R $01:BA6B LDA.W RAM_SprBehindScrn,X ; A = behind-scenery flag R $02:93CE LDA.W RAM_SprBehindScrn,X ; A = sprite is behind scenery flag W $02:EAB1 STA.W RAM_SprBehindScrn,Y ; Candidate's "behind scenery" flag = $37 W $07:F725 STZ.W RAM_SprBehindScrn,X ; Sprite behind scenery flag = 0 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $02:A479 STA.W $163D,X ; Yoshi timer [$163E] = $10 $163E Sprite timer 4 byte table, one per sprite slot (index X or Y) General-purpose countdown timer, fourth of the sprite timers. Meaning is per sprite type: Pipe Lakitu hold timer, P-switch pressed timer, Iggy/Larry defeat timer ($50), Urchin ($0C), kick animation of a shelless Koopa ($20), draw priority timer of the flying question block ($50).
Values: 0 = not running. Some tests use bit 7 as negative.
41 uses in 25 routines (21 read, 19 write, 1 read-modify-write) W $01:88E8 STZ.W $163E,X ; Clear timer [$163E,X] R $01:8908 LDA.W $163E,X ; Timer [$163E,X] R $01:8952 LDA.W $163E,X ; Timer [$163E,X] W $01:8968 STZ.W $163E,X ; Clear timer [$163E,X] W $01:8A0C STA.W $163E,X ; Timer [$163E,X] = A R $01:993E ORA.W $163E,X ; Sprites locked or [$163E] timer running? W $01:A718 STA.W $163E,X ; $163E,X = $20 (kick animation timer?) R $01:AAB2 LDA.W $163E,X ; P-switch: A = [$163E,X] (pressed timer) W $01:AB0E STA.W $163E,X ; [$163E,X] = $20: squashed animation timer W $01:AE13 STA.W $163E,X ; [$163E] = $50: draw-priority timer W $01:CE9E STA.W $163E,X ; No: return. Yes: fire cooldown [$163E] = $30 R $01:D9FE LDA.W $163E,X ; No contact: is Mario flagged as on the rope? W $01:DA03 STZ.W $163E,X ; Clear the hold timer W $01:DA19 STA.W $163E,X ; [$163E] = 3: Mario is on the rope (grace timer) R $01:E4C2 ORA.W $163E,X ; OR with [$163E] (some timer, nonzero skips movement) W $01:ED6A STA.W $163E,X ; Timer [$163E] = $20 R $01:F690 LDA.W $163E,Y ; Sprites $00, $01, $03: timer $163E (negative = bit 7 set)? W $01:F715 STA.W $163E,X ; Yoshi timer $163E = $10 W $01:FB67 STA.W $163E,X ; Defeat timer [$163E] = $50 W $02:BF66 STA.W $163E,X ; [$163E] = $0C R $02:C207 LDA.W $163E,X ; [$163E] timer W $02:C20E STA.W $163E,X ; [$163E] = $28 W $02:C7DF STZ.W $163E,X ; Clear [$163E] W $02:EAAB STA.W $163E,X ; Hold timer [$163E] = $37 W $02:EACE STZ.W $163E,X ; Clear the hold timer R $03:98D6 LDA.W $163E,X ; A = level end timer [$163E,X] W $03:98FF STA.W $163E,X ; Level end timer [$163E,X] = $90: set when all Reznors are dead W $07:F764 STZ.W $163E,X ; $163E,X = 0 (timer) $164A Sprite in-liquid flags bit flags table, one per sprite slot (index X or Y) Set by the sprite-block interaction each frame when the sprite is inside water or lava, then cleared and recomputed next frame. The gravity routine reads it to use slow-sink physics and sprites inherit it when spawned (shelless Koopa from shell). Rip Van Fish sets it in init.
Bits: 0 water; 7 lava. Morton/Roy, Ludwig and Bowser reuse it as a plain timer or flag.
34 uses in 23 routines (24 read, 7 write, 3 read-modify-write) W $01:83FF STZ.W $164A,X ; [$164A,X] = 0 RW $01:8431 INC.W $164A,X ; [$164A,X]++ (probably the in-water flag) R $01:9037 LDA.W $164A,X ; Water flag [$164A,X] R $01:9060 LDY.W $164A,X ; Y = water flag W $01:9258 STA.W $164A,X ; [$164A] = liquid flags (bit 0 water, bit 7 lava) W $01:9720 STA.W $164A,Y ; New sprite inherits the in-water flag [$164A] R $01:9955 LDY.W $164A,X ; [$00] = old slope; skip if in water ([$164A]) R $01:A761 LDA.W $164A,X ; A = $164A,X (in water flag) W $01:B1D9 STZ.W $164A,X ; Clear in-water flag W $01:CFC2 STA.W $164A,X ; Other kids: timer [$164A] = $20 (arena narrows) RW $01:D170 DEC.W $164A,X ; Timer [$164A]-- R $01:F69E LDA.W $164A,Y ; Sprite flag $164A R $02:C01B LDA.W $164A,X ; [$164A] = in-water flag R $02:C304 LDY.W $164A,X ; [$164A] = in water R $02:C35B LDA.W $164A,X ; [$164A] = in water RW $03:AC57 INC.W $164A,X ; Mark the music as changed $1656 Sprite tweaker byte 1 RAM_Tweaker1656 bit flags table, one per sprite slot (index X or Y); sSjJcccc Per-sprite behaviour flags, copied from the Sprite1656Vals table by sprite number at spawn. Read by the stomp, bounce and kill routines.
Bits: 7 disappear in a puff of smoke when killed; 6 can hop into/kick shells; 5 dies (smushed) when jumped on; 4 can be jumped on; 0-3 object clipping index (which hitbox shape is used). Bob-omb explosion clears the byte so the sprite cannot be stomped.
12 uses in 10 routines (8 read, 4 write) W $01:8539 STA.W RAM_Tweaker1656,X ; Sprite tweaker 1656 = $10 W $02:808A STZ.W RAM_Tweaker1656,X ; [RAM_Tweaker1656] = 0: sprite cannot be stomped W $07:F767 STZ.W RAM_Tweaker1656,X ; Tweaker $1656,X = 0 (overwritten later by LoadTweakerBytes) W $07:F7A9 STA.W RAM_Tweaker1656,Y ; Tweaker $1656,Y = Sprite1656Vals[sprite number] $1662 Sprite tweaker: clipping and death RAM_Tweaker1662 bit flags + 6-bit index, byte table indexed by sprite slot (index X) First sprite property byte. Its low six bits select the sprite's hitbox (clipping) entry, used by Mario contact, sprite-to-sprite contact and Yoshi's tongue. Loaded from a per-sprite-number table at spawn and rewritten by sprites that change size (Rex squash sets 0, Pokey sets it from its segment count, Bob-omb explosion $11).
Values: bits 0-5 = clipping index. Bit 6 = use the shell frame when drawn as a killed sprite ($019B27).
Bit 5 is tested as 'smushed' by the Pokey/Wiggler code and bit 7 by the bounce-block hit code ($02946E).
31 uses in 23 routines (12 read, 14 write, 5 read-modify-write) W $01:853E STA.W RAM_Tweaker1662,X ; Sprite tweaker 1662 = $80 RW $01:D6CD INC.W RAM_Tweaker1662,X ; Tweaker byte [$1662]++ (change sprite properties) RW $01:D6DD INC.W RAM_Tweaker1662,X ; Tweaker byte [$1662]++ (change sprite properties) R $01:F4EB LDA.W RAM_Tweaker1662,Y ; Eaten sprite tweaker $1662 W $01:F9F1 STA.W RAM_Tweaker1662,X ; Tweaker $1662 = $0C (block-sized clipping) W $01:F9FC STA.W RAM_Tweaker1662,X ; Restore tweaker $1662 W $02:808F STA.W RAM_Tweaker1662,X ; [RAM_Tweaker1662] = $11: clipping index of the explosion hitbox W $02:B64E STA.W RAM_Tweaker1662,X ; Clipping index [$1662+X] = PokeyClipIndex[segment count] R $02:D3AA LDA.W RAM_Tweaker1662,X ; A = sprite tweaker [$1662] W $03:95C6 STZ.W RAM_Tweaker1662,X ; Sprite clipping = 0 (smaller hitbox) W $03:9A5A STA.W RAM_Tweaker1662,X ; Tweaker byte [$1662,X] = $29: object clipping, probably so Mario can bump the platform W $03:B095 STA.W RAM_Tweaker1662,X ; Tweaker $24: first body hitbox RW $03:B0BD INC.W RAM_Tweaker1662,X ; Next hitbox: Tweaker++ RW $03:B0C9 INC.W RAM_Tweaker1662,X ; Next hitbox: Tweaker++ W $03:B0FC STA.W RAM_Tweaker1662,X ; Bowser Tweaker $24 RW $03:B109 INC.W RAM_Tweaker1662,X ; Tweaker++ (second hitbox) W $03:CC0C STZ.W RAM_Tweaker1662,X ; Clear sprite tweaker byte [$1662] W $07:F76A STZ.W RAM_Tweaker1662,X ; Tweaker $1662,X = 0 W $07:F7B0 STA.W RAM_Tweaker1662,Y ; Tweaker $1662,Y = Sprite1662Vals[sprite number] $166E Sprite tweaker: interaction and palette RAM_Tweaker166E bit flags, byte table indexed by sprite slot (index X) Second sprite property byte, copied from Sprite166EVals[sprite number] when the sprite is spawned and zeroed when the slot is cleared. Low nibble holds palette/graphics-page bits; the high bits are interaction switches.
Bits: Bit 7 = skip sprite-block interaction (checked at $01926A). Bit 6 = no water/lava splash.
Bit 5 = ignores cape and bounce-block hits. Bit 4 = ignores Mario's fireballs. The shell/kicked code sets bits 4-5 ($30) so a kicked sprite cannot be killed by fireballs or the cape.
9 uses in 7 routines (6 read, 3 write) W $07:F76D STZ.W RAM_Tweaker166E,X ; Tweaker $166E,X = 0 W $07:F7B7 STA.W RAM_Tweaker166E,Y ; Tweaker $166E,Y = Sprite166EVals[sprite number] $167A Sprite tweaker: Mario interaction RAM_Tweaker167A bit flags, byte table indexed by sprite slot (index X) Third sprite property byte, loaded per sprite number at spawn. Controls how the sprite interacts with Mario, attacks and the screen edge. Code changes bits at run time: Boo sets bit 7, bounced/pressed sprites clear it.
Bits: Bit 7 = do not use the default Mario interaction (sprite handles contact itself). Bit 6 = gives a power-up when eaten by Yoshi. Bit 4 = can be kicked like a shell. Bit 2 = keep processing when off-screen.
Bit 1 = invincible to fireballs/cape/explosion kills.
40 uses in 28 routines (25 read, 7 write, 8 read-modify-write) RW $01:894E LSR.W RAM_Tweaker167A,X ; Restore bit 7 of tweaker [$167A,X] to 0 RW $01:AAFA LSR.W RAM_Tweaker167A,X ; Clear bit 7 of tweaker [$167A,X] (stop being interactable once pressed) W $01:C2CA STA.W RAM_Tweaker167A,X ; Clear bit 7 of tweaker [$167A,X]: default interaction with Mario W $01:F39C STA.W RAM_Tweaker167A,Y ; (unused) Set tweaker $167A bit 6: gives power-up when eaten W $01:F9EC STA.W RAM_Tweaker167A,X ; Tweaker $167A |= $80 (do not interact like a normal sprite) W $01:F9F8 STA.W RAM_Tweaker167A,X ; Restore tweaker $167A R $02:A92A LDA.W RAM_Tweaker167A,X ; Tweaker bits of slot X W $02:BAFE STA.W RAM_Tweaker167A,X ; Clear bit 6 of tweaker $167A: no longer gives a powerup when eaten RW $03:8A6C LSR.W RAM_Tweaker167A,X ; Clear bit 7 of tweaker $167A (ASL then LSR) W $07:F770 STZ.W RAM_Tweaker167A,X ; Tweaker $167A,X = 0 W $07:F7BE STA.W RAM_Tweaker167A,Y ; Tweaker $167A,Y = Sprite167AVals[sprite number] $1686 Sprite tweaker: sprite interaction RAM_Tweaker1686 bit flags, byte table indexed by sprite slot (index X or Y) Fourth sprite property byte, loaded from Sprite1686Vals[sprite number] at spawn and cleared when the slot is reset. Mostly settings for how the sprite interacts with other sprites, objects and Yoshi's tongue.
Bits: Bit 3 = no sprite-to-sprite interaction (the interaction loop ORs the byte for both sprites).
Bit 2 = object (block) interaction setting, tested in the sprite map16 lookup. Bit 7 is cleared by Bowser's retreat state. Other bits are tested by the tongue, stomp and level-end code; meaning not traced here.
22 uses in 16 routines (15 read, 5 write, 2 read-modify-write) W $01:8543 STA.W RAM_Tweaker1686,X ; Sprite tweaker 1686 = $10 R $01:A424 ORA.W RAM_Tweaker1686,Y ; A = (tweaker $1686 of B or A) bit 3: no sprite-sprite interaction W $01:C125 STZ.W RAM_Tweaker1686,X ; Clear tweaker byte [$1686,X] RW $03:A827 ASL.W RAM_Tweaker1686,X ; Clear bit 7 of tweaker [$1686] W $07:F773 STZ.W RAM_Tweaker1686,X ; Tweaker $1686,X = 0 W $07:F7C5 STA.W RAM_Tweaker1686,Y ; Tweaker $1686,Y = Sprite1686Vals[sprite number] $1692 Sprite memory setting byte Which sprite-memory (OAM allotment) setting the level uses: the sprite header's low six bits, stored while the level loads. Selects a row of tables that decide how many OAM tiles each sprite slot is given and which slots the spawn routines may use. Read when sprites are drawn, when finding a free slot and when spawning from level data; the line-guide rope/platform init also tests it for non-zero.
Values: 0 = default setting; other values select the alternative layouts.
11 uses in 9 routines (8 read, 3 write) R $01:80D4 LDX.W $1692 ; X = [$1692]: sprite memory setting (selects an OAM allotment row) R $01:D6C8 LDA.W $1692 ; [$1692] (sprite memory setting) R $02:88F2 LDA.W $1692 ; Sprite memory setting [$1692] R $02:A8E4 LDY.W $1692 ; Y = [$1692] (sprite memory setting) R $02:A9EF LDY.W $1692 ; Y = [$1692] (sprite memory setting) W $05:D8FD STA.W $1692 ; [$1692] = sprite header & $3F (sprite memory setting) $1693 Map16 tile number under probe byte (scratch result of a tile lookup) Low byte of the Map16 tile that the last block lookup landed on, as an acts-like tile number. Set by the collision lookups for Mario, sprites, bounce/extended sprites, the cape and Yoshi's berry check, then read straight away to decide the response (solid, slope, coin, pipe, P-switch swap, ...). Only valid right after a lookup; not meaningful between lookups.
45 uses in 14 routines (32 read, 13 write) R $00:EC5B LDY.W $1693 ; Y = current Map16 tile number R $00:EC74 LDA.W $1693 ; A = current tile R $00:EC83 LDA.W $1693 ; A = current Map16 tile number R $00:EC98 LDA.W $1693 ; A = current tile R $00:ED06 LDA.W $1693 ; A = current tile R $00:EE06 LDY.W $1693 ; Y = current tile R $00:EE3A LDY.W $1693 ; Y = current tile R $00:EE5C LDA.W $1693 ; A = current tile R $00:EFBC LDX.W $1693 ; X = current tile R $00:F43F LDY.W $1693 ; Y = [$1693]: the tile number W $00:F4D5 STA.W $1693 ; [$1693] = tile number R $00:F4E1 LDY.W $1693 ; Y = tile number R $00:F548 LDY.W $1693 ; Y = tile number ([$1693]) W $00:F556 STA.W $1693 ; POW active: tile becomes $24 W $00:F573 STA.W $1693 ; Tile = $32 (brown block) R $00:F577 LDY.W $1693 ; Y = tile number W $00:F58F STY.W $1693 ; Tile = $2B (coin) R $01:922C LDA.W $1693 ; A = acts-like tile R $01:92E0 LDA.W $1693 ; A = acts-like tile W $01:94B8 STA.W $1693 ; [$1693] = 0: no tile W $01:952C STA.W $1693 ; [$1693] = map16 low byte R $01:D83F LDA.W $1693 ; A = Map16 tile number under the probe R $01:D856 LDA.W $1693 ; A = Map16 tile number W $01:D992 STA.W $1693 ; Save it in [$1693] W $02:9323 STA.W $1693 ; $1693 = Map16 tile number low byte under the bounce sprite W $02:9613 STA.W $1693 ; $1693 = tile number low byte R $02:9627 LDA.W $1693 ; A = tile number low byte W $02:A6E4 STA.W $1693 ; [$1693] = Map16 tile number (low byte) W $02:BA9B STA.W $1693 ; [$1693] = map16 tile number (low byte) W $02:D1B6 STA.W $1693 ; [$1693] = tile number (low byte) R $02:D1BF LDA.W $1693 ; A = tile number low byte $1694 Slope surface offset byte Height offset along the surface of a slope tile at the probe point, used by sprite and extended-sprite block checks to place the sprite on the slope. Written by the sprite vertical check; cleared to 0 at the start of those checks and by the extended-sprite tile collision, meaning 'no offset'.
Values: 0 = flat / no slope offset.
6 uses in 3 routines (1 read, 5 write) W $01:9140 STZ.W $1694 ; [$1694] = 0: no surface offset W $01:935F STA.W $1694 ; [$1694] = surface offset on the slope R $01:940F ADC.W $1694 ; Sprite Y = (Y rounded down to 16) + [$1694]: snap onto the surface W $02:A574 STZ.W $1694 ; Clear the slope height [$1694] W $02:A71A STA.W $1694 ; [$1694] = slope data (slope height) $1695 Saved slot or loop counter scratch (byte) General scratch byte that holds a sprite slot index or loop counter across a call that reuses X or Y. Examples: sprite B's slot in the sprite-to-sprite loop, the candidate slot while spawning Baby Yoshi or a block item, the probe counter (3..0) of the line-guide engine, Yoshi's tongue loop, extended-sprite slot for the Koopa Kid and the hitting sprite for Pokey. Also stores last frame's liquid flags ($164A ) in the sprite-block code. No single meaning; each routine reloads it right after use.
19 uses in 12 routines (9 read, 10 write) W $01:914F STA.W $1695 ; [$1695] = last frame's liquid flags [$164A]; [$164A] = 0 R $01:91F0 EOR.W $1695 ; Liquid flags changed since last frame? No: return W $01:A43A STX.W $1695 ; $1695 = sprite B index (X gets reused) R $01:A498 LDX.W $1695 ; X = sprite B index again R $01:A5DD LDY.W $1695 ; Y = sprite B index ($1695) R $01:A7C2 LDX.W $1695 ; X = sprite B index W $01:D3BA STY.W $1695 ; Y = $0A: extended sprite slot, loop $0A-$08 ([$1695] = slot) W $01:D7F6 STY.W $1695 ; Probe counter [$1695] = Y (3..0) W $01:F568 STY.W $1695 ; $1695 = loop counter W $01:F62B STY.W $1695 ; $1695 = loop counter R $01:F661 LDY.W $1695 ; Restore the loop counter W $02:8937 STY.W $1695 ; Remember table index in [$1695] W $02:B7E2 STY.W $1695 ; [$1695] = hitting sprite slot R $02:B84F LDX.W $1695 ; X = the hitting sprite W $02:EA60 STY.W $1695 ; Remember the candidate slot in [$1695] $1697 Consecutive stomp counter counter Counts enemies Mario has stomped (or bounced off) since last touching the ground. The count picks the score (100, 200, 400, ... up to 1-UP) and is read when the stomp is rewarded, by Yoshi's stomp shake, Dry Bones and the push-out routine. Incremented on each stomp (Wiggler too) and when Mario mounts Yoshi. Reset to 0 in Mario's block/slope collision when he lands.
Values: 0 = no stomps in the current chain.
13 uses in 8 routines (7 read, 2 write, 4 read-modify-write) W $00:EF95 STZ.W $1697 ; [$1697] = 0 (enemy stomp chain counter) W $00:EF99 STZ.W $1697 ; [$1697] = 0 (enemy stomp chain counter) R $01:AB47 LDA.W $1697 ; A = consecutive stomp counter [$1697] R $01:E5D2 LDA.W $1697 ; A = [$1697] (consecutive enemies stomped counter) RW $01:ED6D INC.W $1697 ; [$1697]++ (reset consecutive-enemies counter) R $02:86BF LDA.W $1697 ; Consecutive enemy stomp counter [$1697] RW $02:F283 INC.W $1697 ; Stomp counter [$1697]++, A = old value R $03:9629 LDA.W $1697 ; A = stomp counter [$1697] RW $03:9630 INC.W $1697 ; Stomp counter++ $1698 Saved misc sprite slot index (scratch) Slot index of the minor extended sprite, bounce sprite or smoke sprite currently being processed. The per-frame handlers store X here ($028B6E) and reload X from it after calling subroutines that clobber it (draw and tile-check helpers). Read only to restore X or Y.
17 uses in 9 routines (15 read, 2 write) W $02:8B6E STX.W $1698 ; Save slot in [$1698] R $02:8DB9 LDX.W $1698 ; A = WaterSplashTiles[X]; restore X = slot index R $02:8E72 LDX.W $1698 ; Restore X = slot index R $02:8F1E LDX.W $1698 ; Restore X = slot index R $02:8F7A LDX.W $1698 ; Restore X = slot index R $02:9020 LDX.W $1698 ; Restore X = slot index W $02:903D STX.W $1698 ; [$1698] = current bounce sprite slot R $02:9261 LDX.W $1698 ; X = current bounce slot again R $02:931E LDX.W $1698 ; X = current bounce slot R $02:93A9 LDY.W $1698 ; Y = current bounce slot R $02:93F7 LDY.W $1698 ; Y = current bounce slot R $02:9400 LDX.W $1698 ; X = current bounce slot R $02:998F LDX.W $1698 ; Restore X = [$1698] (smoke slot) R $02:99C2 LDX.W $1698 ; Restore X = [$1698] (smoke slot) R $02:B522 LDX.W $1698 ; Restore X from [$1698] R $02:B5C4 LDX.W $1698 ; Restore X from [$1698] $1699 Bounce sprite number table RAM_BounceSprNum byte table, one per bounce sprite slot (index X or Y) Type of the bounce sprite in each slot (block hit from below, turn block spin, etc.). Written when a block is hit, read by the bounce sprite loop and drawing code. Zeroed to free the slot when the block lands.
Values: 0 = slot free. 1-6 = bounce block routine, 7 = turn block routine.
9 uses in 6 routines (6 read, 3 write) R $02:8794 LDA.W RAM_BounceSprNum,Y ; Bounce sprite number in slot Y R $02:87A9 LDA.W RAM_BounceSprNum,Y ; Number of the bounce sprite being replaced R $02:886E LDA.W RAM_BounceSprNum,Y ; Bounce sprite number W $02:90CA STZ.W RAM_BounceSprNum,X ; Free the bounce sprite slot W $02:9199 STZ.W RAM_BounceSprNum,X ; Free the bounce sprite slot $169D Bounce sprite init flag RAM_BounceSprInit flag byte table, one per bounce sprite slot (index X) Zeroed when a bounce sprite is created and incremented by its first frame, so the routine can run its one-time set-up (play sound, check things) only once.
Values: 0 = not yet initialized; nonzero = initialized.
5 uses in 3 routines (2 read, 1 write, 2 read-modify-write) W $02:8832 STA.W RAM_BounceSprInit,Y ; Init state = 0 RW $02:907F INC.W RAM_BounceSprInit,X ; Mark initialized RW $02:90EA INC.W RAM_BounceSprInit,X ; Mark initialized $16A1 Bounce sprite Y position low RAM_BounceSprYLo byte table, one per bounce sprite slot (index X or Y) Low byte of the bounce sprite's Y position. Set from the block's position when spawned, moved by its Y speed each frame, and used to place the block when it turns back into a tile. Partner of $16A9 (Y high). Also reused by the shooter smoke helpers to move extended/smoke sprites.
16 uses in 7 routines (11 read, 5 write) W $02:9096 STA.W RAM_BounceSprYLo,X ; Store low byte W $02:933B STA.W RAM_BounceSprYLo,X ; Bounce Y low = (Y low - 3) rounded to a tile row (aligned with the coin) W $02:9352 STA.W RAM_BounceSprYLo,X ; Restore bounce sprite Y low W $02:B549 STA.W RAM_BounceSprYLo,X ; Y position low += whole pixels + carry $16A5 Bounce sprite X position low RAM_BounceSprXLo byte table, one per bounce sprite slot (index X or Y) Low byte of the bounce sprite's X position, copied from the block when spawned. Read for drawing and when the bounce sprite becomes a block tile again. Partner of $16AD (X high).
8 uses in 4 routines (7 read, 1 write) $16A9 Bounce sprite Y position high RAM_BounceSprYHi byte table, one per bounce sprite slot (index X or Y) High byte of the bounce sprite's Y position ([$16A1 ] is the low byte). Adjusted for borrow/carry when the position moves and when the sprite is aligned to a tile row before drawing.
15 uses in 7 routines (10 read, 5 write) W $02:9344 STA.W RAM_BounceSprYHi,X ; Bounce Y high -= borrow W $02:934E STA.W RAM_BounceSprYHi,X ; Restore bounce sprite Y high R $02:B54D ADC.W RAM_BounceSprYHi,X ; Y position high += sign extension + carry $16AD Bounce sprite X position high RAM_BounceSprXHi byte table, one per bounce sprite slot (index X or Y) High byte of the bounce sprite's X position ([$16A5 ] is the low byte). Set when the block is hit, read by the drawing routine and when the block is regenerated.
7 uses in 4 routines (6 read, 1 write) R $02:87C1 LDA.W RAM_BounceSprXHi,Y ; Block X = old bounce sprite X $16B1 Bounce sprite Y speed RAM_BouncBlkSpeedY signed byte table, one per bounce sprite slot (index X or Y) Vertical speed of the bounce sprite. Set at spawn from BlockBounceSpeedY (up for a block hit from below, down for a block hit from above) and changed each frame by gravity-like steps from DATA_029072 in the turn block routine. Applied to the position by the speed helper at $02B526.
7 uses in 4 routines (4 read, 3 write) W $02:8855 STA.W RAM_BouncBlkSpeedY,Y ; Bounce Y speed from table $16B5 Bounce sprite X speed RAM_BouncBlkSpeedX signed byte table, one per bounce sprite slot (index X or Y) Horizontal speed of the bounce sprite, from BlockBounceSpeedX at spawn. Nonzero for blocks hit from the side (+$40 / $C0). Applied by the bounce block routine each frame.
3 uses in 2 routines (1 read, 2 write) W $02:885B STA.W RAM_BouncBlkSpeedX,Y ; Bounce X speed from table No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $02:B531 STA.W $16B9,X ; Add to subpixel accumulator [$16B9+X] $16C1 Bounce sprite resulting tile RAM_BounceSprBlock byte table, one per bounce sprite slot (index X or Y) Map16 tile the bounce sprite turns back into when its timer runs out (the block's used/empty form, or a turned-over block). Stored from $07 at spawn; read by the 'turn bounce sprite into its block' routine. Also read by the 'Find bounce sprite slot' check.
4 uses in 4 routines (3 read, 1 write) W $02:8866 STA.W RAM_BounceSprBlock,Y ; Tile to turn into when it lands = [$07] $16C5 Bounce sprite timer RAM_BounceSprTimer timer byte table, one per bounce sprite slot (index X) Frame countdown for the bounce sprite. Set to 8 frames at spawn and decremented by the loop; when it hits zero the sprite stops and the block is regenerated.
Values: 0 = timer expired.
5 uses in 4 routines (3 read, 1 write, 1 read-modify-write) W $02:886B STA.W RAM_BounceSprTimer,Y ; Bounce timer = 8 frames RW $02:905B DEC.W RAM_BounceSprTimer,X ; Timer -= 1 $16C9 Bounce sprite direction and layer bit flags + index, byte table indexed by bounce sprite slot (index X or Y) Packs which way the block was hit with a layer bit. Bits 0-1 index the speed/direction tables (DATA_0290D6/DA, BlockBounceSpeedX/Y: hit from below, right, left, above). Bit 7 is tested to choose the screen boundary set for drawing and tile placement, probably layer 1 versus layer 2. Written at spawn ([$06 ] ORed with a rotated bit from [$08 ]); read while the sprite moves, is drawn and is regenerated.
10 uses in 5 routines (9 read, 1 write) W $02:8861 STA.W $16C9,Y ; Store in [$16C9+Y] R $02:90AB LDY.W $16C9,X ; Y = direction $16CD Block-hit hitbox status RAM_BouncBlkStatus byte table, one per block-hit hitbox slot (index Y) Which kind of block-hit hitbox occupies each slot: used to make Mario's bumped block, a Yoshi ground stomp or the cape hit adjacent sprites. The value indexes the hitbox size/offset tables when the hitbox is tested.
Values: 0 = slot free. 1 = block hit by Mario. 2 = Yoshi stomp shake.
6 uses in 4 routines (3 read, 3 write) W $02:86CC STA.W RAM_BouncBlkStatus,Y ; Store status in the slot R $02:86EF LDA.W RAM_BouncBlkStatus,Y ; Slot status [$16CD+Y] W $02:8731 STA.W RAM_BouncBlkStatus,Y ; Activate the slot W $02:9394 STZ.W RAM_BouncBlkStatus,X ; Free this bounce sprite slot $16D1 Block-hit hitbox X low byte table, one per block-hit hitbox slot (index Y) Low byte of the hitbox X position of the slot in [$16CD ]. Set from the block position or, for a Yoshi stomp, from Mario's X ($0094 ). Partner of $16D5 (X high). Read when testing sprites against the hitbox.
4 uses in 3 routines (1 read, 3 write) W $02:86D1 STA.W $16D1,Y ; Hitbox X low = Mario X low $16D5 Block-hit hitbox X high byte table, one per block-hit hitbox slot (index Y) High byte of the hitbox X position ([$16D1 ] is the low byte). Written when a block hits; read by the bounce block and cape hitbox test.
3 uses in 2 routines (1 read, 2 write) W $02:86FF STA.W $16D5,Y ; Hitbox X high $16D9 Block-hit hitbox Y low byte table, one per block-hit hitbox slot (index Y) Low byte of the hitbox Y position. For a Yoshi stomp it is Mario's Y ($0096 ) + $20 (his feet); for a block hit it is the block's Y minus the scroll offset. Partner of $16DD (Y high).
4 uses in 3 routines (1 read, 3 write) $16DD Block-hit hitbox Y high byte table, one per block-hit hitbox slot (index Y) High byte of the hitbox Y position ([$16D9 ] is the low byte). The Yoshi stomp routine first writes Mario's X high ($0095 ) here, which looks like a mistake for $16D5 ; it is overwritten afterwards.
5 uses in 3 routines (1 read, 4 write) W $02:86D6 STA.W $16DD,Y ; Stored in the Y-high table ($16DD), probably meant $16D5; overwritten below W $02:8709 STA.W $16DD,Y ; Hitbox Y high $16E1 Score sprite type RAM_ScoreSprNum byte table, one per score sprite slot (index X or Y) Which number a score sprite shows (10, 20, 40, ... 1000, 1-UP etc.). Written by anything that awards points (stomps, coins, block hits, smoke-puff contact), read by the score update to pick the amount to add and the tiles to draw.
Values: 0 = slot free. $0D = 1-UP; other values select an amount in the score table.
13 uses in 8 routines (6 read, 7 write) W $00:F390 STA.W RAM_ScoreSprNum,Y ; Score sprite number W $02:9AAE STA.W RAM_ScoreSprNum,Y ; Set the score sprite type W $02:ACF6 STA.W RAM_ScoreSprNum,Y ; Store the score type R $02:AD36 LDA.W RAM_ScoreSprNum,Y ; Score type of slot Y R $02:ADBD LDA.W RAM_ScoreSprNum,X ; Score type of slot X W $02:ADD5 STZ.W RAM_ScoreSprNum,X ; Speed 0: score has finished, free the slot R $02:ADEB LDY.W RAM_ScoreSprNum,X ; Y = score sprite number R $02:AEC1 LDA.W RAM_ScoreSprNum,X ; A = score sprite number R $02:AED3 LDY.W RAM_ScoreSprNum,X ; Y = score sprite number R $02:AEF4 LDA.W RAM_ScoreSprNum,X ; A = score sprite number W $02:AF29 STZ.W RAM_ScoreSprNum,X ; Unreachable: clear the score sprite W $02:FF72 STA.W RAM_ScoreSprNum,Y ; Score sprite type $0D = 1-UP $16E7 Score sprite Y position low RAM_ScoreSprYLo byte table, one per score sprite slot (index X or Y) Low byte of the score sprite's Y position, spawned 8 pixels above the source sprite. The update routine decrements it each frame so the number rises. Partner of $16F9 (Y high).
12 uses in 6 routines (5 read, 6 write, 1 read-modify-write) W $02:9AB4 STA.W RAM_ScoreSprYLo,Y ; Score sprite Y low W $02:ACFE STA.W RAM_ScoreSprYLo,Y ; Score Y low = sprite Y low - 8 W $02:AD17 STA.W RAM_ScoreSprYLo,Y ; Yes: move the score sprite down by $10 R $02:AE47 LDA.W RAM_ScoreSprYLo,X ; Y = sprite Y low byte (old value) RW $02:AE52 DEC.W RAM_ScoreSprYLo,X ; Sprite Y -= 1 $16ED Score sprite X position low RAM_ScoreSprXLo byte table, one per score sprite slot (index X or Y) Low byte of the score sprite's X position, copied from the source sprite or coin when spawned. Partner of $16F3 (X high). Read while the number is positioned on screen.
9 uses in 6 routines (4 read, 5 write) W $02:9AC0 STA.W RAM_ScoreSprXLo,Y ; Score sprite X low W $02:AD24 STA.W RAM_ScoreSprXLo,Y ; Score X low = sprite X low W $02:FF89 STA.W RAM_ScoreSprXLo,Y ; Score sprite X low = sprite X low $16F3 Score sprite X position high RAM_ScoreSprXHi byte table, one per score sprite slot (index X or Y) High byte of the score sprite's X position ([$16ED ] is the low byte). The update routine computes the
16-bit difference to the screen edge from it to see whether the number is off-screen.
7 uses in 6 routines (2 read, 5 write) W $02:9AC6 STA.W RAM_ScoreSprXHi,Y ; Score sprite X high W $02:AD2A STA.W RAM_ScoreSprXHi,Y ; Score X high = sprite X high R $02:AE88 LDA.W RAM_ScoreSprXHi,X ; Sprite X - screen X (16-bit): negative = off-screen left W $02:FF8F STA.W RAM_ScoreSprXHi,Y ; Score sprite X high = sprite X high $16F9 Score sprite Y position high RAM_ScoreSprYHi byte table, one per score sprite slot (index X or Y) High byte of the score sprite's Y position ([$16E7 ] is the low byte). Borrowed from (decremented) when the low byte wraps while the number rises.
9 uses in 6 routines (2 read, 6 write, 1 read-modify-write) W $02:9ABA STA.W RAM_ScoreSprYHi,Y ; Score sprite Y high W $02:AD07 STA.W RAM_ScoreSprYHi,Y ; Score Y high = sprite Y high (borrow) W $02:AD1F STA.W RAM_ScoreSprYHi,Y ; Score Y high RW $02:AE58 DEC.W RAM_ScoreSprYHi,X ; Y high byte -= 1 R $02:AE94 LDA.W RAM_ScoreSprYHi,X ; Sprite Y - screen Y (16-bit) W $02:FF83 STA.W RAM_ScoreSprYHi,Y ; Score sprite Y = sprite Y - 8 (16-bit) $16FF Score sprite timer and rise speed RAM_ScoreSprSpeedY byte table, one per score sprite slot (index X or Y) Set to $30 when a score sprite is created and counted down once per frame. It doubles as the lifetime and the rise-speed control: when it reaches 0 the number has finished and the slot ($16E1 ) is freed.
Values: $30 = freshly spawned; 0 = finished.
8 uses in 7 routines (2 read, 5 write, 1 read-modify-write) W $00:F3A9 STA.W RAM_ScoreSprSpeedY,Y ; Score sprite Y speed = $30 W $02:9ACB STA.W RAM_ScoreSprSpeedY,Y ; Set the score sprite Y speed W $02:AD2F STA.W RAM_ScoreSprSpeedY,Y ; Score Y speed = $30 (also its lifetime timer) R $02:ADD0 LDA.W RAM_ScoreSprSpeedY,X ; Score sprite Y speed RW $02:ADE4 DEC.W RAM_ScoreSprSpeedY,X ; Score sprite timer -- R $02:AE38 LDA.W RAM_ScoreSprSpeedY,X ; A = timer W $02:FF94 STA.W RAM_ScoreSprSpeedY,Y ; Score sprite rise speed = $30 $1705 Score sprite layer index byte table, one per score sprite slot (index X or Y) Selects which scroll/layer position the number is drawn relative to. The score update multiplies it by 4 and uses it as an index into the screen boundary words ($001A /$001C region), so 0 is layer 1 and the next value is layer 2. Written when the score sprite is spawned (0 by block interaction, from the source sprite's layer elsewhere); a comment in the source guesses it is a timer, but the code treats it as a layer index.
4 uses in 4 routines (1 read, 3 write) W $00:F3AE STA.W $1705,Y ; Score sprite table $1705 = 0 (probably a timer) W $02:9AD1 STA.W $1705,Y ; Score sprite layer $170B Extended sprite number RAM_ExSpriteNum byte table, one per extended sprite slot (index X or Y) Type of the extended sprite in each slot: fireballs, smoke puffs, bubbles, hammers, bones, baseballs, splashes, sparkles, Reznor fireballs, Wiggler flowers and so on. Written by whatever spawns one, read by the extended sprite loop to dispatch to the matching routine and by the cape and fireball hit tests.
Values: 0 = slot free. 1 = smoke puff, 6 = bone, 7 = lava splash, 8 = Torpedo Ted arm, $0A = cloud game coin,
$0B = Piranha fireball, $0C = Volcano Lotus fire, $0E = Wiggler flower.
59 uses in 41 routines (29 read, 30 write) W $00:FAD8 STA.W RAM_ExSpriteNum,Y ; Clear extended sprite number R $00:FD1B LDA.W RAM_ExSpriteNum,X ; A = extended sprite number in slot X W $00:FD28 STA.W RAM_ExSpriteNum,X ; Extended sprite = $12 (water bubble) R $00:FE05 LDA.W RAM_ExSpriteNum,Y ; A = extended sprite number in slot Y W $00:FE18 STA.W RAM_ExSpriteNum,Y ; Extended sprite = $12 (water bubble) R $00:FEAA LDA.W RAM_ExSpriteNum,X ; A = extended sprite number in slot X W $00:FEC1 STA.W RAM_ExSpriteNum,X ; Extended sprite = 5 (Mario fireball) R $01:8EF1 LDA.W RAM_ExSpriteNum,Y ; Slot's extended sprite number W $01:8F8E STA.W RAM_ExSpriteNum,Y ; Extended sprite = hopping flame's flame (3) R $01:D3BD LDA.W RAM_ExSpriteNum,Y ; Extended sprite number W $01:D3EB STA.W RAM_ExSpriteNum,Y ; Turn the fireball into a smoke puff (extended sprite 1) W $01:F29A STA.W RAM_ExSpriteNum,Y ; Extended sprite = Yoshi fireball W $01:FD38 STA.W RAM_ExSpriteNum,Y ; Extended sprite = smoke puff (1) W $02:8541 STA.W RAM_ExSpriteNum,Y ; Extended sprite = 7 (lava splash) W $02:9BDA STZ.W RAM_ExSpriteNum,X ; Clear the extended sprite W $02:9C02 STA.W RAM_ExSpriteNum,Y ; Set the slot's type W $02:9C7F STZ.W RAM_ExSpriteNum,X ; Clear the extended sprite W $02:9D5A STZ.W RAM_ExSpriteNum,X ; Delete extended sprite W $02:9D99 STZ.W RAM_ExSpriteNum,X ; Delete extended sprite W $02:9E39 STZ.W RAM_ExSpriteNum,X ; Delete extended sprite W $02:9EE6 STZ.W RAM_ExSpriteNum,X ; Delete extended sprite W $02:A213 STA.W RAM_ExSpriteNum,X ; Clear extended sprite number W $02:A2BF STZ.W RAM_ExSpriteNum,X ; Delete the extended sprite W $02:A419 STZ.W RAM_ExSpriteNum,X ; Delete the extended sprite R $02:A519 LDY.W RAM_ExSpriteNum,X ; Y = extended sprite number W $02:B42F STA.W RAM_ExSpriteNum,Y ; Extended sprite = $08 (Torpedo Ted arm) R $02:C470 LDA.W RAM_ExSpriteNum,Y ; Extended sprite number W $02:C47B STA.W RAM_ExSpriteNum,Y ; Extended sprite = $0D (baseball) W $02:DAC5 STA.W RAM_ExSpriteNum,Y ; Extended sprite type = $04 (Hammer) W $02:E092 STA.W RAM_ExSpriteNum,Y ; Extended sprite = Volcano Lotus fire ($0C) W $02:E1CF STA.W RAM_ExSpriteNum,Y ; Extended sprite = Piranha fireball ($0B) W $02:EFBE STA.W RAM_ExSpriteNum,Y ; Extended sprite = $0A (cloud game coin) W $02:F2E4 STA.W RAM_ExSpriteNum,Y ; Extended sprite = $0E (Wiggler flower) W $03:9B0A STA.W RAM_ExSpriteNum,Y ; Extended sprite number = 2 (Reznor fireball) W $03:C463 STA.W RAM_ExSpriteNum,Y ; Extended sprite = Bone ($06) R $07:FC49 LDA.W RAM_ExSpriteNum,Y ; Look for a free extended sprite slot W $07:FC54 STA.W RAM_ExSpriteNum,Y ; Create the extended sprite $1715 Extended sprite Y position low RAM_ExSpriteYLo byte table, one per extended sprite slot (index X or Y) Low byte of the extended sprite's Y position ([$1729 ] is the high byte). Set at spawn (e.g. Hopping flame, Yoshi spit, Mario fireball), moved by Y speed ($173D ) each frame, and temporarily saved/restored around tile-collision tests.
51 uses in 31 routines (27 read, 23 write, 1 read-modify-write) W $01:8F81 STA.W RAM_ExSpriteYLo,Y ; Extended sprite Y low = sprite Y + 8 R $01:D3CE LDA.W RAM_ExSpriteYLo,Y ; Fireball Y low W $01:F2AA STA.W RAM_ExSpriteYLo,Y ; Fireball Y lo W $02:9C0A STA.W RAM_ExSpriteYLo,Y ; Extended sprite Y low W $02:A601 STA.W RAM_ExSpriteYLo,X ; Restore Y low W $02:B583 STA.W RAM_ExSpriteYLo,X ; Extended sprite Y low += whole pixels + carry W $02:DAD5 STA.W RAM_ExSpriteYLo,Y ; Hammer Y position = sprite Y position W $02:E0A7 STA.W RAM_ExSpriteYLo,Y ; Y low = sprite Y low W $02:E1E4 STA.W RAM_ExSpriteYLo,Y ; Y low = sprite Y low W $02:EFD3 STA.W RAM_ExSpriteYLo,Y ; Y low = cloud Y W $02:F2F9 STA.W RAM_ExSpriteYLo,Y ; Flower Y low = sprite Y low W $03:9B28 STA.W RAM_ExSpriteYLo,Y ; Fireball Y low W $07:FC60 STA.W RAM_ExSpriteYLo,Y ; Star Y low = sprite Y low + 4 $171F Extended sprite X position low RAM_ExSpriteXLo byte table, one per extended sprite slot (index X or Y) Low byte of the extended sprite's X position ([$1733 ] is the high byte). Set at spawn, moved by X speed ($1747 ) each frame, restored after the hitbox and tile-collision checks.
43 uses in 29 routines (22 read, 21 write) W $01:8F71 STA.W RAM_ExSpriteXLo,Y ; Extended sprite X low = sprite X + 4 R $01:D3C4 LDA.W RAM_ExSpriteXLo,Y ; Fireball X low W $01:F29F STA.W RAM_ExSpriteXLo,Y ; Fireball X lo = Yoshi X lo W $02:9C1C STA.W RAM_ExSpriteXLo,Y ; Extended sprite X low W $02:A609 STA.W RAM_ExSpriteXLo,X ; Restore X low W $02:DACA STA.W RAM_ExSpriteXLo,Y ; Hammer X position = sprite X position W $02:E09A STA.W RAM_ExSpriteXLo,Y ; Store X low W $02:E1D7 STA.W RAM_ExSpriteXLo,Y ; Store X low W $02:EFC6 STA.W RAM_ExSpriteXLo,Y ; Store W $02:F2EE STA.W RAM_ExSpriteXLo,Y ; Flower X low = sprite X low W $03:9B13 STA.W RAM_ExSpriteXLo,Y ; Fireball X low W $03:C478 STA.W RAM_ExSpriteXLo,Y ; Bone X low = sprite X low W $07:FC70 STA.W RAM_ExSpriteXLo,Y ; Star X low = sprite X low + 4 $1729 Extended sprite Y position high RAM_ExSpriteYHi byte table, one per extended sprite slot (index X or Y) High byte of the extended sprite's Y position ([$1715 ] is the low byte). Updated with the carry/borrow when the 16-bit position changes and saved/restored around tile checks.
40 uses in 27 routines (16 read, 22 write, 2 read-modify-write) W $01:8F89 STA.W RAM_ExSpriteYHi,Y ; Extended sprite Y high (carry) R $01:D3D3 LDA.W RAM_ExSpriteYHi,Y ; Fireball Y high W $01:F2B0 STA.W RAM_ExSpriteYHi,Y ; Fireball Y hi W $02:854C STA.W RAM_ExSpriteYHi,Y ; Particle Y position = sprite Y position W $02:9C11 STA.W RAM_ExSpriteYHi,Y ; Extended sprite Y high RW $02:A00B DEC.W RAM_ExSpriteYHi,X ; Borrow from Y position high byte W $02:A5FD STA.W RAM_ExSpriteYHi,X ; Restore Y high R $02:B587 ADC.W RAM_ExSpriteYHi,X ; Extended sprite Y high += sign extension + carry W $02:E0AD STA.W RAM_ExSpriteYHi,Y ; Y high = sprite Y high W $02:E1EA STA.W RAM_ExSpriteYHi,Y ; Y high = sprite Y high W $02:EFD9 STA.W RAM_ExSpriteYHi,Y ; Y high W $02:F2FE STA.W RAM_ExSpriteYHi,Y ; Flower Y high = sprite Y low (original quirk) W $03:9B31 STA.W RAM_ExSpriteYHi,Y ; Fireball Y high W $07:FC68 STA.W RAM_ExSpriteYHi,Y ; Star Y high = sprite Y high + carry $1733 Extended sprite X position high RAM_ExSpriteXHi byte table, one per extended sprite slot (index X or Y) High byte of the extended sprite's X position ([$171F ] is the low byte). Updated with the carry when the X speed is added, and saved/restored around tile checks.
36 uses in 27 routines (15 read, 21 write) W $01:8F79 STA.W RAM_ExSpriteXHi,Y ; Extended sprite X high (carry) R $01:D3C9 LDA.W RAM_ExSpriteXHi,Y ; Fireball X high W $01:F2A5 STA.W RAM_ExSpriteXHi,Y ; Fireball X hi W $02:855C STA.W RAM_ExSpriteXHi,Y ; Particle X position = sprite X position + 4 W $02:9C24 STA.W RAM_ExSpriteXHi,Y ; Extended sprite X high R $02:A023 ADC.W RAM_ExSpriteXHi,X ; X position += X speed (16-bit) W $02:A605 STA.W RAM_ExSpriteXHi,X ; Restore X high W $02:E0A2 STA.W RAM_ExSpriteXHi,Y ; Store X high W $02:E1DF STA.W RAM_ExSpriteXHi,Y ; Store X high W $02:EFCE STA.W RAM_ExSpriteXHi,Y ; X high with carry W $02:F2F4 STA.W RAM_ExSpriteXHi,Y ; Flower X high = sprite X high W $03:9B1D STA.W RAM_ExSpriteXHi,Y ; Fireball X high W $03:C47E STA.W RAM_ExSpriteXHi,Y ; Bone X high = sprite X high W $07:FC78 STA.W RAM_ExSpriteXHi,Y ; Star X high = sprite X high + carry $173D Extended sprite Y speed RAM_ExSprSpeedY signed byte table, one per extended sprite slot (index X or Y) Vertical speed of each extended sprite, in 1/16 pixel per frame (positive = down). Set at spawn (Mario fireball $30 down, thrown hammer / flower / game coin $D0 up) and changed by gravity: the hammer adds 2 per frame up to $40, fireballs bounce using a table. Read by the movement code.
28 uses in 17 routines (9 read, 16 write, 3 read-modify-write) W $00:FEC6 STA.W RAM_ExSprSpeedY,X ; Fireball Y speed = $30 (down) W $01:F2CD STA.W RAM_ExSprSpeedY,Y ; Fireball Y speed = DATA_01F2DC[X] W $02:8578 STA.W RAM_ExSprSpeedY,Y ; Particle Y speed = DATA_028518[X] R $02:9BB8 LDA.W RAM_ExSprSpeedY,X ; A = Y speed RW $02:9BBF INC.W RAM_ExSprSpeedY,X ; Y speed++ (gravity) R $02:9BC2 LDA.W RAM_ExSprSpeedY,X ; A = Y speed W $02:9CEF STA.W RAM_ExSprSpeedY,X ; Bounce: Y speed = $D0 (upward) W $02:9E56 STA.W RAM_ExSprSpeedY,X ; Y speed from DATA_029E36: hand moves down, rests, then moves up W $02:9FFC STA.W RAM_ExSprSpeedY,X ; Bounce: Y speed from DATA_029F99 RW $02:A300 INC.W RAM_ExSprSpeedY,X ; Gravity: Y speed += 2 until it reaches $40 (terminal velocity) W $02:DAE0 STA.W RAM_ExSprSpeedY,Y ; Hammer Y speed = $D0 (thrown upward) W $02:E0BC STA.W RAM_ExSprSpeedY,Y ; Y speed from DATA_02E075 W $02:E1EF STA.W RAM_ExSprSpeedY,Y ; Fireball Y speed = $D0 (upward) W $02:EFDE STA.W RAM_ExSprSpeedY,Y ; Y speed = $D0 (tossed up) W $02:F303 STA.W RAM_ExSprSpeedY,Y ; Flower Y speed = $D0 (up) W $03:9B48 STA.W RAM_ExSprSpeedY,Y ; Fireball Y speed W $07:FC87 STA.W RAM_ExSprSpeedY,Y ; Star Y speed from table by star index $1747 Extended sprite X speed RAM_ExSprSpeedX signed byte table, one per extended sprite slot (index X or Y) Horizontal speed of each extended sprite, in 1/16 pixel per frame (positive = right). Set at spawn from a direction or table. The smoke trail halves it with an arithmetic shift; the baseball/bone code flips it. The unused following-sprite routine misuses it as the index of the sprite to follow.
25 uses in 22 routines (8 read, 16 write, 1 read-modify-write) W $00:FECE STA.W RAM_ExSprSpeedX,X ; Fireball X speed = DATA_00FE94[direction] W $01:F2C7 STA.W RAM_ExSprSpeedX,Y ; Store fireball X speed W $02:856B STA.W RAM_ExSprSpeedX,Y ; Particle X speed = DATA_028510[X] W $02:9BD6 STA.W RAM_ExSprSpeedX,X ; Set the X speed W $02:9C2A STA.W RAM_ExSprSpeedX,Y ; Extended sprite X speed RW $02:9C78 ROR.W RAM_ExSprSpeedX,X ; Timer = 6: halve the X speed (arithmetic shift right) R $02:9DA0 LDY.W RAM_ExSprSpeedX,X ; Y = [ExSprSpeedX]: misused as the index of the sprite it follows W $02:B45F STA.W RAM_ExSprSpeedX,Y ; Arm X speed = DATA_02B464[direction] W $02:C4B0 STA.W RAM_ExSprSpeedX,Y ; Baseball X speed by direction W $02:DAE5 STA.W RAM_ExSprSpeedX,Y ; Hammer X speed = [$00] W $02:E0B6 STA.W RAM_ExSprSpeedX,Y ; X speed from DATA_02E071 W $02:E1F4 STA.W RAM_ExSprSpeedX,Y ; Fireball X speed = [$00] W $02:EFE3 STA.W RAM_ExSprSpeedX,Y ; X speed = 0 W $02:F30B STA.W RAM_ExSprSpeedX,Y ; Flower X speed = - sprite X speed W $03:9B4D STA.W RAM_ExSprSpeedX,Y ; Fireball X speed W $03:C48B STA.W RAM_ExSprSpeedX,Y ; Store the bone X speed W $07:FC80 STA.W RAM_ExSprSpeedX,Y ; Star X speed from table by star index No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $02:B568 ADC.W $1751,X ; Add to subpixel accumulator [$1751+X] $175B Fireball hit counter counter byte table, one per extended sprite slot (index X) Counts how many times a Mario fireball has hit a wall. Incremented on the hit; the fireball dissipates when it reaches its limit, and the counter is reset to 0 when the fireball bounces off the floor ($02A010).
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) RW $02:9FDD INC.W $175B,X ; Hit counter [$175B]++ W $02:A010 STZ.W $175B,X ; No hit: reset hit counter $1765 Extended sprite counter counter byte table, one per extended sprite slot (index X or Y) Per-type counter. Animation frame counter for Mario's fireball, the small flame remnant, the baseball/bone and the hammer/spinner (incremented every frame); bounce counter for Wiggler flowers and cloud-game coins; phase counter for water bubbles. Cleared or preset to 1 by the spawners.
18 uses in 10 routines (8 read, 3 write, 7 read-modify-write) R $02:9CE3 LDA.W $1765,X ; Coin: bounce counter [$1765] RW $02:9CF2 INC.W $1765,X ; Count the bounce RW $02:9FC2 INC.W $1765,X ; Animation counter [$1765]++ RW $02:A21D INC.W $1765,X ; Animation counter [$1765]++ RW $02:A25B INC.W $1765,X ; Animation counter [$1765] += 1 RW $02:A264 INC.W $1765,X ; Extra increment on even frames RW $02:A309 INC.W $1765,X ; Spin animation counter [$1765] += 1 W $02:EFE6 STA.W $1765,Y ; Clear $1765 too $176F Extended sprite timer timer byte table, one per extended sprite slot (index X or Y) General-purpose countdown or lifetime for each extended sprite; meaning per type. Examples: smoke puff $0F frames, Yoshi spit fireball $A0, Hopping flame fire $FF, bubble timer/phase 0 at spawn. The type's routine counts it down and deletes the sprite ($170B = 0) or changes frames when it expires.
Values: 0 = timer expired.
24 uses in 19 routines (12 read, 11 write, 1 read-modify-write) W $00:FD56 STZ.W $176F,X ; [$176F,X] = 0 (bubble timer/phase) W $00:FE44 STA.W $176F,Y ; [$176F,Y] = 0 (bubble timer/phase) W $01:8F93 STA.W $176F,Y ; Extended sprite timer [$176F,Y] = $FF W $01:D3F0 STA.W $176F,Y ; Store in [$176F,Y] W $01:F2D2 STA.W $176F,Y ; Fireball lifetime [$176F,Y] = $A0 W $01:FD3D STA.W $176F,Y ; Puff timer $176F = $0F W $02:8586 STA.W $176F,Y ; [$176F+Y] = DATA_028520[X] R $02:9B1F LDY.W $176F,X ; Y = [$176F,X] (timer / frame counter) W $02:9C2F STA.W $176F,Y ; Set the extended sprite timer R $02:9C44 LDA.W $176F,X ; A = timer [$176F,X] R $02:9C83 LDA.W $176F,X ; A = timer [$176F,X] W $02:A4E0 STA.W $176F,X ; Smoke puff timer [$176F] = 7 W $02:B456 STA.W $176F,Y ; Extended sprite timer [$176F] = $90 (lifetime, probably) W $07:FC8C STA.W $176F,Y ; Star lifetime timer = $17 frames $1779 Extended sprite layer flag flag byte table, one per extended sprite slot (index X or Y) Whether the extended sprite is behind scenery. Mario's fireball copies Mario's behind-scenery flag at spawn; Yoshi's spit sets 0. Collision checks XOR it with the target's flag and skip the contact when they are on different layers (fireball vs. sprite, smoke puff vs. Mario, Reznor fireball).
Values: 0 = in front; nonzero = behind scenery.
6 uses in 6 routines (4 read, 2 write) W $00:FF03 STA.W $1779,X ; [$1779,X] = Mario behind-scenery flag W $01:F2B5 STA.W $1779,Y ; [$1779,Y] = 0 R $02:A0CF EOR.W $1779,Y ; Skip if fire-immune, being eaten, or on a different layer than the fireball R $02:A3F9 EOR.W $1779,X ; Skip if Mario and the sprite are on different layers (one behind scenery) $1783 Shooter type table byte table, one per shooter slot (index X, 8 slots) Type of each active shooter (Bullet Bill shooter, Torpedo Ted launcher, ...), stored by LoadShooter as the level data's shooter sprite number minus $C8 and, per the shooter loop, read as type + 1. The shooter loop runs each non-empty slot every frame. LoadShooter looks for a free slot by scanning for a zero entry.
Values: 0 = slot free.
3 uses in 2 routines (2 read, 1 write) R $02:AB81 LDA.W $1783,X ; Shooter type of slot X W $02:ABA5 STA.W $1783,X ; Shooter type [$1783,X] = sprite number - $C8 R $02:B390 LDA.W $1783,X ; A = shooter type + 1 ($1783 table) $178B Shooter Y position, low RAM_ShooterYLo byte table, one per shooter slot (index X, 8 slots) Low byte of the Y position of each active shooter (Bullet Bill / Torpedo Ted launcher). Set when the level loads or scrolls a shooter in (from the adjusted screen boundary). Read by the launchers to place the sprite they spawn. High byte is $1793 .
8 uses in 5 routines (6 read, 2 write) W $02:ABBD STA.W RAM_ShooterYLo,X ; Shooter Y = adjusted screen boundary W $02:ABCC STA.W RAM_ShooterYLo,X ; Shooter Y low = high nibble $1793 Shooter Y position, high RAM_ShooterYHi byte table, one per shooter slot (index X, 8 slots) High byte (screen/page, bit 0) of each shooter's Y position; $178B is the low byte. Written when the shooter is loaded, read when Bullet Bill or Torpedo Ted is spawned so the new sprite starts at the shooter.
7 uses in 4 routines (5 read, 2 write) W $02:ABD2 STA.W RAM_ShooterYHi,X ; Shooter Y high = bit 0 R $02:B407 LDA.W RAM_ShooterYHi,X ; New sprite position = shooter position $179B Shooter X position, low RAM_ShooterXLo byte table, one per shooter slot (index X, 8 slots) Low byte of each shooter's X position (taken from the high nibble of the level data). High byte is $17A3 . Read by the Bullet Bill and Torpedo Ted shooters to place the spawned sprite and by the shooter smoke code.
12 uses in 5 routines (10 read, 2 write) W $02:ABB2 STA.W RAM_ShooterXLo,X ; Shooter X low = high nibble W $02:ABD7 STA.W RAM_ShooterXLo,X ; Shooter X = adjusted screen boundary $17A3 Shooter X position, high RAM_ShooterXHi byte table, one per shooter slot (index X, 8 slots) High byte (bit 0) of each shooter's X position; $179B is the low byte. Written when the shooter is loaded, read by the launchers when spawning a sprite and by the smoke helper to compare against the screen.
8 uses in 5 routines (6 read, 2 write) W $02:ABB8 STA.W RAM_ShooterXHi,X ; Shooter X high = bit 0 R $02:B4BC LDA.W RAM_ShooterXHi,X ; New sprite X = shooter X $17AB Shooter timer RAM_ShooterTimer timer table, one per shooter slot (index X, 8 slots) Countdown before a shooter fires again. Set to $10 when the shooter is loaded. The shooter loop decrements it every other frame; Bullet Bill / Torpedo Ted shooters act when it runs out and reload it.
Values: 0 = ready to fire.
7 uses in 4 routines (3 read, 3 write, 1 read-modify-write) W $02:ABE6 STA.W RAM_ShooterTimer,X ; Shooter timer = $10 R $02:B395 LDY.W RAM_ShooterTimer,X ; Y = shooter timer RW $02:B3A0 DEC.W RAM_ShooterTimer,X ; Timer-- every other frame R $02:B3B6 LDA.W RAM_ShooterTimer,X ; Shooter timer ([$17AB+X]) still running? W $02:B3BD STA.W RAM_ShooterTimer,X ; Reset the shooter timer to $50 frames R $02:B466 LDA.W RAM_ShooterTimer,X ; Shooter timer ([$17AB+X]) still running? W $02:B46D STA.W RAM_ShooterTimer,X ; Reset the shooter timer to $60 frames No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $02:AB96 LDY.W $17B3,X ; Y = level index of the shooter in that slot W $02:ABE1 STA.W $17B3,X ; [$17B3,X] = index in the level (for reloading) $17BB Level number, low byte (scratch) byte Stored by the level loader as the low byte of the level number (looked up from $19B8 , or from the overworld level number minus $24 when it is $25 or more). Its only reader is a small routine at $00:FF07 that shifts Mario's position by [$17BC ]/[$17BB ]; it looks unused, so treat the purpose as uncertain.
4 uses in 2 routines (1 read, 3 write) W $05:D7C0 STA.W $17BB ; [$17BB] = level number (low byte) W $05:D8A9 STA.W $17BB ; [$17BB] = level number (low byte) $17BC Layer 1 Y scroll delta byte (signed) How far layer 1 scrolled vertically this frame (current $1C minus the previous frame's $1464 ). Written by the scroll-follow code at $00:F7D3, and adjusted by the scroll routines in bank 5. $17BD is the X counterpart.
5 uses in 4 routines (3 read, 2 write) R $05:BC20 ADC.W $17BC ; [$17BC] += [$1464] - [$1C]: layer 1 Y scroll this frame $17BD Layer 1 X scroll delta byte (signed) How far layer 1 scrolled horizontally this frame (current $1A minus the previous frame's $1462 ). Read by anything that must move with the screen: the layer 3 scroll code, Porcu-Puffer, Fishin' Boo, clouds, the level-end coin sprite and the layer 3 smash. $17BC is the Y counterpart.
12 uses in 10 routines (10 read, 2 write) R $00:FBB6 LDA.W $17BD ; A = [$17BD] (layer 1 X movement this frame) R $02:D3F7 LDA.W $17BD ; A = [$17BD] (probably horizontal scroll delta) R $05:BC13 ADC.W $17BD ; [$17BD] += [$1462] - [$1A]: layer 1 X scroll this frame R $05:C4EF ADC.W $17BD ; BG3 X low byte [$22] += [$17BD] + 1 $17BE Layer 2 Y scroll delta byte (signed) How far layer 2 scrolled vertically this frame (previous $20 minus current, so up is positive). Written by the scroll-follow and scroll-delta routines; read by Mario's block/slope collision.
3 uses in 3 routines (1 read, 2 write) R $00:EF45 LDA.W $17BE ; A = [$17BE] (probably layer 2 X movement this frame) W $05:BC3C STA.W $17BE ; [$17BE] = layer 2 Y scroll this frame $17BF Layer 2 X scroll delta byte (signed) How far layer 2 scrolled horizontally this frame (previous $1E minus current, so left is positive). Set to 0 in the scroll routine when $143F is 1. Read by sprite-block interaction to carry sprites on layer 2.
3 uses in 3 routines (1 read, 2 write) W $05:BC33 STA.W $17BF ; [$17BF] = layer 2 X scroll this frame $17C0 Smoke sprite type byte table, one per smoke slot (index X/Y, 4 slots) Type of each 4-slot smoke/effect sprite; 0 means the slot is free. Spawners write it, the smoke main routine dispatches on it. Timer is $17CC , X position $17C8 , Y position $17C4 .
Values: 0 = free; 1 = puff; 2 = contact star/puff; 3 = rising puff; 5 = sparkle spawner; $81 = cape smoke.
36 uses in 19 routines (17 read, 19 write) R $00:FB84 LDA.W $17C0,X ; Slot free ([$17C0,X] = 0)? W $00:FB8F STA.W $17C0,X ; Smoke sprite type 1 (puff of smoke) R $00:FD62 LDA.W $17C0,Y ; A = [$17C0,Y] (smoke type) W $00:FD6D STA.W $17C0,Y ; Smoke type = 5 R $00:FE69 LDA.W $17C0,Y ; A = [$17C0,Y] (smoke type) W $00:FE74 STA.W $17C0,Y ; Smoke type = 3 R $01:806A LDA.W $17C0,Y ; A = smoke type in slot Y ($17C0) W $01:8075 STA.W $17C0,Y ; Smoke slot Y type = 3 (probably the ground skid puff) W $01:AB85 STA.W $17C0,Y ; Smoke slot Y type = 2 (contact star/smoke puff) W $01:ABAC STA.W $17C0,Y ; Smoke slot Y type = 2 (contact puff) R $01:BD9A LDA.W $17C0,Y ; Is smoke slot Y free? W $01:BDA5 STA.W $17C0,Y ; Smoke sprite type = 1 (puff of smoke) W $01:C4FD STA.W $17C0,Y ; Effect [$17C0,Y] = 5 (sparkle) W $01:C5D6 STA.W $17C0,Y ; Effect type $81 (smoke puff) W $01:D01C STA.W $17C0 ; Smoke puff type [$17C0] = 1 R $02:8A47 LDA.W $17C0,X ; Smoke slot type W $02:8A52 STA.W $17C0,X ; Smoke type 1 (puff of smoke) W $02:96DF STZ.W $17C0,X ; Free the smoke sprite slot R $02:96E8 LDA.W $17C0,X ; A = smoke type byte [$17C0,X] W $02:9793 STZ.W $17C0,X ; Free the smoke sprite slot W $02:98BE STZ.W $17C0,X ; Free the smoke sprite slot W $02:9AE7 STA.W $17C0,Y ; Set the slot's type R $02:B4E0 LDA.W $17C0,Y ; Smoke slot Y free? W $02:B4ED STA.W $17C0,Y ; Smoke type [$17C0+Y] = 1 (puff of smoke) W $02:B991 STA.W $17C0,Y ; Smoke type [$17C0+Y] = 1 $17C4 Smoke sprite Y position byte table, one per smoke slot (index X/Y, 4 slots) Y position (low byte) of each smoke sprite. Set by the spawner (sprite Y, Mario Y plus offset, block Y). Type 3 smoke decrements it each update so the puff rises. Slot type is $17C0 .
25 uses in 19 routines (7 read, 17 write, 1 read-modify-write) W $00:FB95 STA.W $17C4,X ; Smoke Y = sprite Y W $01:ABC2 STA.W $17C4,Y ; Smoke Y = Mario Y + offset W $01:BDAF STA.W $17C4,Y ; Smoke Y position = sprite Y W $01:C507 STA.W $17C4,Y ; Effect Y = sprite Y W $01:C5E3 STA.W $17C4,Y ; Effect Y = Mario Y + 8 RW $02:994C DEC.W $17C4,X ; ...the puff rises 1 pixel: Y-- W $02:B4F3 STA.W $17C4,Y ; Smoke Y = shooter Y W $02:B99B STA.W $17C4,Y ; Smoke Y = sprite Y W $03:8A33 STA.W $17C4,Y ; Smoke Y = sprite Y + [$01] $17C8 Smoke sprite X position byte table, one per smoke slot (index X/Y, 4 slots) X position (low byte) of each smoke sprite, set by the spawner (sprite X, Mario X, block X). Read when the smoke is drawn. Slot type is $17C0 .
24 uses in 19 routines (7 read, 17 write) W $00:FB9B STA.W $17C8,X ; Smoke X = sprite X W $01:ABB1 STA.W $17C8,Y ; Smoke X = Mario X position low byte W $01:BDAA STA.W $17C8,Y ; Smoke X position = sprite X W $01:C502 STA.W $17C8,Y ; Effect X = sprite X W $01:C5E8 STA.W $17C8,Y ; Effect X = Mario X W $02:B996 STA.W $17C8,Y ; Smoke X = [$02] W $03:8A2B STA.W $17C8,Y ; Smoke X = sprite X + [$00] $17CC Smoke sprite timer timer table, one per smoke slot (index X/Y, 4 slots) Frame countdown for each smoke sprite. Spawners set it ($1B, $13, $10 or 8 depending on the effect); the smoke routines count it down and free the slot ($17C0 = 0) at zero. For the sparkle spawner it paces spawns.
35 uses in 19 routines (15 read, 16 write, 4 read-modify-write) W $00:FBA0 STA.W $17CC,X ; Smoke timer = $1B W $00:FD99 STA.W $17CC,Y ; Smoke timer = $10 W $00:FE90 STA.W $17CC,Y ; Smoke timer = $13 W $01:8088 STA.W $17CC,Y ; Smoke timer ($17CC,Y) = $13 frames W $01:AB94 STA.W $17CC,Y ; Smoke display timer = 8 frames W $01:ABC7 STA.W $17CC,Y ; Smoke display timer = 8 frames W $01:BDB4 STA.W $17CC,Y ; Smoke timer = $1B frames W $01:C50C STA.W $17CC,Y ; Effect timer = $10 W $01:C5DB STA.W $17CC,Y ; Effect timer = $1B W $01:D02F STA.W $17CC ; Smoke timer [$17CC] = $1B W $02:8A61 STA.W $17CC,X ; Smoke timer = $1B R $02:96E3 LDA.W $17CC,X ; Smoke type 1 (puff): timer [$17CC,X] = 0? R $02:9797 LDA.W $17CC,X ; Smoke type 2 (four-tile burst): timer = 0? R $02:98CA LDA.W $17CC,X ; Smoke type 5 (sparkle spawner): timer = 0? R $02:9927 LDA.W $17CC,X ; Smoke type 3 (rising puff): timer = 0? W $02:9B06 STA.W $17CC,Y ; Set the smoke timer W $02:B4F8 STA.W $17CC,Y ; Smoke timer [$17CC+Y] = $1B W $02:B9A0 STA.W $17CC,Y ; Smoke timer [$17CC+Y] = $0F W $03:8A38 STA.W $17CC,Y ; Smoke lifetime = $13 $17D0 Spinning coin slot flag flag byte table, one per coin slot (index X/Y, 4 slots) Non-zero while a spinning coin from a block occupies the slot. Set when a coin block is hit, tested by the spinning coin loop and cleared when the coin finishes. Position/speed live in $17D4 , $17D8 , $17E0 , $17E4 , $17E8 and $17EC .
Values: 0 = free; 1 = in use.
6 uses in 3 routines (3 read, 2 write, 1 read-modify-write) R $02:8A68 LDA.W $17D0,X ; Coin slot active flag RW $02:8A81 INC.W $17D0,X ; Coin slot active = 1 W $02:9363 STA.W $17D0,Y ; [$17D0,Y] = 1: spinning coin in use W $02:99E5 STA.W $17D0,X ; Clear the slot $17D4 Spinning coin Y position, low byte table, one per coin slot (index X/Y, 4 slots) Low byte of the Y position of each block spinning coin; $17E8 is the high byte. Starts at the block's Y minus $10, then moves by the coin's Y speed ($17D8 ). Also reused by the shooter smoke helper as a position.
8 uses in 5 routines (5 read, 3 write) W $02:9379 STA.W $17D4,Y ; Coin Y low = bounce sprite Y low R $02:9AF9 LDA.W $17D4,X ; A = coin Y low W $02:B5B1 STA.W $17D4,X ; Position low [$17D4+X] += whole pixels + carry $17D8 Spinning coin Y speed byte table, one per coin slot (index X/Y, 4 slots) Signed Y speed of each spinning coin. Starts at $D0 (upward) and gains 3 per frame (gravity).
6 uses in 4 routines (3 read, 3 write) W $02:8AA5 STA.W $17D8,X ; Coin Y speed = $D0 (up) W $02:938E STA.W $17D8,Y ; Coin Y speed = $D0 (up) W $02:99FE STA.W $17D8,X ; Coin Y speed [$17D8,X] += 3 (gravity) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $02:B596 ADC.W $17DC,X ; Add to subpixel accumulator [$17DC+X] $17E0 Spinning coin X position, low byte table, one per coin slot (index X/Y, 4 slots) Low byte of the coin's X position (copied from the block / bounce sprite). High byte is $17EC .
5 uses in 4 routines (3 read, 2 write) W $02:936D STA.W $17E0,Y ; Coin X low = bounce sprite X low R $02:9AEF LDA.W $17E0,X ; A = coin X low $17E4 Spinning coin layer byte table, one per coin slot (index X/Y, 4 slots) Which layer the coin's block belongs to, copied from the bounce sprite ([$16C9 ] bit 7). Used when converting the coin position to screen coordinates.
Values: 0 = layer 1; 1 = layer 2.
5 uses in 4 routines (3 read, 2 write) W $02:9389 STA.W $17E4,Y ; Coin layer = bounce sprite layer ([$16C9] bit 7) R $02:9A08 LDA.W $17E4,X ; A = coin layer [$17E4,X] (0 or 1) R $02:9AEA LDA.W $17E4,X ; A = coin layer $17E8 Spinning coin Y position, high byte table, one per coin slot (index X/Y, 4 slots) High byte of the coin's Y position; $17D4 is the low byte. Also reused by the shooter smoke helper.
6 uses in 5 routines (3 read, 3 write) W $02:937F STA.W $17E8,Y ; Coin Y high = bounce sprite Y high R $02:B5B5 ADC.W $17E8,X ; Position high [$17E8+X] += sign extension + carry $17EC Spinning coin X position, high byte table, one per coin slot (index X/Y, 4 slots) High byte of the coin's X position; $17E0 is the low byte.
3 uses in 3 routines (1 read, 2 write) W $02:9373 STA.W $17EC,Y ; Coin X high = bounce sprite X high $17F0 Minor extended sprite number byte table, one per slot (index X/Y, 12 slots) Type of each minor extended sprite (small effects: brick pieces, splashes, sparkles, floating Z...). 0 means the slot is free; a sprite deletes itself by clearing it. Free slots are found by scanning, with $185D as the round-robin fallback when all 12 are full.
Values: 1 = brick piece; 2/5 = star sparkle; 3 = spinning tile; 4 = bounce block piece; 6/8/9 = floating Z;
7 = water splash; $0A = Boo stream tile.
32 uses in 16 routines (16 read, 16 write) R $00:FDAB LDA.W $17F0,Y ; A = [$17F0,Y] (type) W $00:FDEA STA.W $17F0,Y ; Minor extended sprite type = 7 (water splash) W $01:F7F6 STA.W $17F0,X ; Minor extended sprite type 3 (egg shard) W $02:8507 STA.W $17F0,Y ; Minor extended sprite = 7 (water splash) W $02:85C7 STA.W $17F0,Y ; Minor extended sprite = 5 W $02:85F5 STA.W $17F0,Y ; Minor extended sprite = 4 W $02:8686 STA.W $17F0,X ; Minor extended sprite = 1 (brick piece) R $02:8B69 LDA.W $17F0,X ; Slot type [$17F0+X] W $02:8BCD STA.W $17F0,Y ; Type = $0B (smoke puff) W $02:8C3D STA.W $17F0,Y ; Child type = $0B W $02:8C66 STZ.W $17F0,X ; Free the slot W $02:8D62 STZ.W $17F0,X ; Delete this minor extended sprite W $02:8E76 STZ.W $17F0,X ; Delete this minor extended sprite W $02:8F87 STZ.W $17F0,X ; Delete this minor extended sprite W $02:98F3 STA.W $17F0,Y ; Set the slot's type R $02:C0F2 LDA.W $17F0,Y ; Minor extended sprite number in slot Y W $03:9039 STA.W $17F0,Y ; Extended sprite number = $0A (Boo stream tile) W $03:AD76 STA.W $17F0,Y ; Minor extended sprite slot Y = type 5 (sparkle) $17FC Minor extended sprite Y position, low byte table, one per slot (index X/Y, 12 slots) Low byte of the Y position of each minor extended sprite; $1814 is the high byte. Updated by Y speed ($1820 ) in the motion routines, or by +1/-1 for splashes and floating Z.
28 uses in 19 routines (12 read, 14 write, 2 read-modify-write) W $00:FDCF STA.W $17FC,Y ; Splash Y low = A W $02:84F2 STA.W $17FC,Y ; Splash Y low = sprite Y rounded down to a 16-pixel row + 3 W $02:85D1 STA.W $17FC,Y ; Y position = $00 W $02:861E STA.W $17FC,Y ; Y low = sprite Y low + (random AND 7) + 7 W $02:869F STA.W $17FC,X ; Piece Y low = block Y low + DATA_028742[Y] RW $02:8D72 INC.W $17FC,X ; Y position += 1 (splash sinks) RW $02:8E1D DEC.W $17FC,X ; Y position -= 1 R $02:8FB4 ADC.W $17FC,X ; Y position low += Y speed W $02:9918 STA.W $17FC,Y ; New sprite Y low W $02:B5E8 STA.W $17FC,X ; Y position [$17FC+X] += whole pixels + carry W $03:AD9D STA.W $17FC,Y ; Sparkle Y = Peach Y + random 0..$1F $1808 Minor extended sprite X position, low byte table, one per slot (index X/Y, 12 slots) Low byte of the X position of each minor extended sprite. Moved by X speed ($182C ) each frame. There is no matching high byte; the sprites are clipped to the screen.
26 uses in 18 routines (13 read, 13 write) W $00:FDE0 STA.W $1808,Y ; Splash X low = Mario X low W $02:84FA STA.W $1808,Y ; Splash X low = sprite X low + [$02] W $02:85D6 STA.W $1808,Y ; X position = $02 W $02:8608 STA.W $1808,Y ; X low = sprite X low + (random AND $0F) - 3 W $02:868F STA.W $1808,X ; Piece X low = block X low + DATA_028746[Y] R $02:8F9E ADC.W $1808,X ; X position low += X speed W $02:990F STA.W $1808,Y ; New sprite X low W $03:AD8B STA.W $1808,Y ; Sparkle X = Peach X + random -8..+23 (high byte via [$00]) $1814 Minor extended sprite Y position, high byte table, one per slot (index X/Y, 12 slots) High byte of the Y position; $17FC is the low byte. Updated with carry/sign extension from Y speed.
14 uses in 11 routines (5 read, 9 write) W $00:FDDA STA.W $1814,Y ; Splash Y high = A W $02:8626 STA.W $1814,Y ; Y high = sprite Y high + carry W $02:86A6 STA.W $1814,X ; Piece Y high = block Y high + carry R $02:8FBB ADC.W $1814,X ; Y position high += sign extension $1820 Minor extended sprite Y speed byte table, one per slot (index X/Y, 12 slots) Signed Y speed of each minor extended sprite. Gravity adds 1 per frame (2 for spinning tiles). Initial values come from tables (brick pieces, Yoshi egg shards) or are 0 for splashes and sparkles.
13 uses in 8 routines (3 read, 6 write, 4 read-modify-write) W $01:F813 STA.W $1820,X ; Store shard Y speed W $02:85CC STA.W $1820,Y ; [$1820+Y] = 0 W $02:85FA STA.W $1820,Y ; [$1820+Y] = 0 W $02:86AC STA.W $1820,X ; [$1820+X] = DATA_02874A[Y] W $02:8C40 STA.W $1820,Y ; [$1820+Y] = $0B RW $02:8E91 INC.W $1820,X ; Y speed += 2 (gravity) RW $02:8F4A INC.W $1820,X ; Y speed += 1 (gravity) RW $02:8FC7 INC.W $1820,X ; ...Y speed += 1 (slow gravity) W $03:ADAA STA.W $1820,Y ; Sparkle sprite table $1820 = 0 $182C Minor extended sprite X speed byte table, one per slot (index X/Y, 12 slots) Signed X speed of each minor extended sprite. Set by the spawner (brick pieces, egg shards, Boo stream copies the parent's speed); floating Z decrements it each update.
15 uses in 9 routines (4 read, 8 write, 3 read-modify-write) W $01:F819 STA.W $182C,X ; Store shard X speed W $02:86B2 STA.W $182C,X ; [$182C+X] = DATA_02874E[Y] W $02:8BF3 STA.W $182C,Y ; X speed = $40 / $C0 RW $02:8DF8 DEC.W $182C,X ; X speed -= 1 RW $02:8DFB DEC.W $182C,X ; X speed -= 1 (net -1) W $02:8E13 STA.W $182C,X ; Restore the original X speed W $02:C122 STA.W $182C,Y ; Store Y speed W $03:9059 STA.W $182C,Y ; Extended sprite X speed = sprite X speed No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $02:B5D0 ADC.W $1838,X ; Add to subpixel accumulator [$1838+X] $1850 Minor extended sprite timer timer/counter table, one per slot (index X/Y, 12 slots) Per-slot timer or animation counter, meaning depends on the sprite type. Most types count it down and delete themselves at zero (sparkles, spinning tile, Boo stream); water splash and floating Z count up as an animation frame. Examples: splash spawner sets $17, sparkle $17.
37 uses in 18 routines (18 read, 12 write, 7 read-modify-write) W $00:FDEF STA.W $1850,Y ; [$1850,Y] = 0 (splash timer/frame) W $01:F825 STA.W $1850,X ; Shard timer/properties W $02:850C STA.W $1850,Y ; Splash timer [$1850+Y] = $00 W $02:85DB STA.W $1850,Y ; Timer [$1850+Y] = $17 W $02:862B STA.W $1850,Y ; Timer [$1850+Y] = $17 W $02:86B7 STA.W $1850,X ; [$1850+X] = $00 R $02:8C0F LDA.W $1850,X ; Timer [$1850] W $02:8C5D STA.W $1850,Y ; Child lifetime = $10 frames RW $02:8CFA DEC.W $1850,X ; Count down the lifetime timer RW $02:8DD3 INC.W $1850,X ; Advance the animation timer W $02:991E STA.W $1850,Y ; New sprite timer W $02:C11D STA.W $1850,Y ; Store minor extended sprite timer W $03:9054 STA.W $1850,Y ; Extended sprite timer = $30 W $03:ADAF STA.W $1850,Y ; Sparkle lifetime = $17 $185C Sprite platform contact marker byte (sprite slot + 1) Set by the moving ledge sprite to its own slot number plus 1 while Mario is in contact with it. When non-zero, Mario's level collision takes an alternate path. Cleared each time the ledge runs.
Values: 0 = Mario not standing on a ledge.
4 uses in 2 routines (2 read, 2 write) W $02:E5F2 STX.W $185C ; [$185C] = this sprite index + 1 (claims the contact) $185D Minor extended sprite round-robin index index (counts 11 to 0) Used when all 12 minor extended sprite slots are full: it is decremented and wrapped from 0 back to 11 to choose the slot to overwrite. Shared by block shatter, Yoshi egg, Boo stream, Rip Van Fish and sparkles.
15 uses in 5 routines (5 read, 5 write, 5 read-modify-write) RW $01:F7E7 DEC.W $185D ; All slots full: replace the round-robin slot [$185D] W $02:8679 STA.W $185D ; All slots busy: cycle [$185D] through 11..0 R $02:867C LDX.W $185D ; X = [$185D]: slot to overwrite W $02:98EB STA.W $185D ; Store the wrapped index R $02:98EE LDY.W $185D ; Y = slot to overwrite RW $02:C0FA DEC.W $185D ; No free slot: use round robin slot [$185D]-- W $02:C101 STA.W $185D ; Wrap [$185D] to $0B R $02:C104 LDY.W $185D ; Y = slot to overwrite W $03:9031 STA.W $185D ; No free slot: pick one round-robin from [$185D] (counts 11 to 0) $185E Sprite routine scratch scratch byte General-purpose scratch byte shared by many sprite routines, with no single meaning. Examples: a count of platforms Mario stands on (mushroom scales), Yoshi frame / tongue Y offset, the index of the sprite being eaten, Chuck clone index, GrowingPipeTiles value, and the layer-check index in sprite-block interaction.
49 uses in 20 routines (28 read, 16 write, 5 read-modify-write) W $01:9149 STZ.W $185E ; [$185E] = 0: layer 1 is checked first RW $01:915C INC.W $185E ; [$185E] = 1: now layer 2 R $01:AE48 LDY.W $185E ; Y = index of the sprite just spawned W $01:B5BB STZ.W $185E ; [$185E] = 0: Mario not on the platform RW $01:B5DA INC.W $185E ; [$185E]++: Mario is standing on the platform W $01:D5B3 STZ.W $185E ; [$185E] = 0 (canopy collapse offset) W $01:D5C0 STA.W $185E ; [$185E] = collapse offset R $01:D620 SBC.W $185E ; Minus collapse offset R $01:DA41 LDA.W $185E ; A = Y movement of the sprite W $01:EF1B STY.W $185E ; Y = frame; remember it in $185E W $01:F40F STA.W $185E ; $185E = tongue Y offset (kept for the eaten-sprite code) R $01:F502 ADC.W $185E ; A = Y offset + tongue Y offset ($185E) W $01:F5AE STY.W $185E ; $185E = index of the sprite being eaten W $02:8922 STX.W $185E ; Remember spawned slot in [$185E] W $02:A0B5 STY.W $185E ; [$185E] = extended sprite index R $02:A143 LDY.W $185E ; Y = extended sprite index W $02:C5B3 STZ.W $185E ; Clone index [$185E] = 0 (clone to the right) RW $02:C5B9 INC.W $185E ; Clone index = 1 (clone to the left), fall into spawn code again R $02:C5E8 LDX.W $185E ; X = clone index [$185E] W $02:E4A8 STZ.W $185E ; [$185E] = 0: count of platforms Mario/sprites are standing on RW $02:E4E3 INC.W $185E ; One platform is loaded: [$185E]++ RW $02:E4FB INC.W $185E ; Platform loaded: [$185E]++ W $02:E8BD STA.W $185E ; Left tile = GrowingPipeTiles1[Y], saved in [$185E] W $02:F840 STA.W $185E ; [$185E] = copy of the timer for this frame W $02:F930 STA.W $185E ; [$185E] = animation frame * 2 R $02:F9CF LDY.W $185E ; Y = [$185E] (animation frame * 2) $185F Sprite touched tile (vertical check) byte Acts-like Map16 tile number found at the sprite's position by the vertical block check. Read by Net Koopa, Magikoopa magic and Directional Coins to react to the tile touched.
4 uses in 4 routines (3 read, 1 write) W $01:92DA STA.W $185F ; [$185F] = acts-like tile (flags preserved) R $01:BA14 LDA.W $185F ; A = Map16 tile touched at the sprite's position ($185F) R $01:BC67 LDA.W $185F ; A = Map16 tile touched ($185F) $1860 Sprite touched tile (horizontal check) byte Acts-like tile number found by the sprite horizontal block check. Read by kicked shells, Net Koopa and Directional Coins. See $185F for the vertical check result.
4 uses in 4 routines (3 read, 1 write) W $01:92BD STA.W $1860 ; [$1860] = acts-like tile (horizontal check) R $01:BA27 LDA.W $1860 ; A = second Map16 tile ($1860) $1861 Spawn-from-block slot toggle byte (0 or 1) Used when no free sprite slot exists for an item dropped or spawned from a block: it alternates between 0 and 1 each time, choosing sprite slot $0A or $0B to overwrite.
6 uses in 2 routines (2 read, 2 write, 2 read-modify-write) RW $02:8911 DEC.W $1861 ; No free slot: alternate between slots $0A and $0B with [$1861] $1862 Sprite touched tile page byte High byte (page) of the Map16 tile found by the sprite horizontal block check. Read by Magikoopa magic and Directional Coins as an extra block test; Magikoopa use is probably 'blocked by a special tile'.
3 uses in 3 routines (2 read, 1 write) W $01:9294 STA.W $1862 ; [$1862] = tile high byte (page) R $01:BE4A LDA.W $1862 ; Extra block check [$1862] (probably: blocked by a special tile) $1863 Cape smoke slot index index (counts 3 to 0) Rotating slot index used when Mario gets a cape and all 4 smoke slots ($17C0 ) are full: decremented and wrapped to 3 to pick which smoke slot to overwrite.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) RW $01:C5C7 DEC.W $1863 ; All slots full: [$1863]-- (rotating slot) W $01:C5CE STA.W $1863 ; Wrap [$1863] to 3 $1865 Block coin slot index index (counts 3 to 0) Rotating slot index used when a block spawns a spinning coin and all 4 coin slots ($17D0 ) are in use: decremented and wrapped to 3 to pick the slot to overwrite.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) RW $02:8A70 DEC.W $1865 ; None free: cycle [$1865] $1866 Platform angle sign, sine byte High byte of the platform's rotation angle; bit 0 gives the sign used for the sine term. Written and read by the platform geometry helper (for rotating/line platform interaction with Mario).
3 uses in 1 routine (2 read, 1 write) W $01:CB22 STA.W $1866 ; [$1866] = angle high byte (sine sign: bit 0) $1867 Platform angle sign, cosine byte High byte of the platform angle plus $80; bit 0 gives the sign of the cosine term. Same helper as $1866 .
3 uses in 1 routine (2 read, 1 write) W $01:CB4E STA.W $1867 ; [$1867] = high byte of angle + $80 (cosine sign: bit 0) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $01:92FF STA.W $1868 ; [$1868] = tile hit from below R $01:95CF LDA.W $1868 ; A = tile hit from below ([$1868]) $186B Multi-coin block timer timer Countdown for the multiple-coin block. Set when the block is hit and given its first coin, decremented by the bounce sprite loop, and cleared when the bounce sprite turns back into the block.
Values: 0 = timer not running (block is spent after this hit).
6 uses in 3 routines (3 read, 2 write, 1 read-modify-write) R $02:8893 LDA.W $186B ; Multi coin timer [$186B] W $02:889A STA.W $186B ; Start the multiple coin timer RW $02:9038 DEC.W $186B ; Count the multiple coin block timer down W $02:91B1 STZ.W $186B ; Clear the multiple coin timer $186C Sprite off-screen vertical flags RAM_OffscreenVert byte table indexed by sprite slot Non-zero when a sprite is vertically off the screen. Cleared and recomputed by the 'get sprite draw info' routines in banks 1, 2 and 3; ORed with the horizontal flags ($15A0 ) to test 'off screen'. Read by Thwomp, Cheep Cheep, Chuck, wings, Lakitu cloud and others to skip logic or drawing.
Values: 0 = on screen vertically.
32 uses in 25 routines (26 read, 6 write) R $00:FAAD ORA.W RAM_OffscreenVert,Y ; On screen? (off-screen horizontal | vertical) R $01:80CE ORA.W RAM_OffscreenVert,X ; A = [horizontal off screen flag] OR [vertical off screen flag]: non-zero = off screen W $01:A365 STZ.W RAM_OffscreenVert,X ; Clear vertical off-screen flags of this sprite R $01:A3DF LDA.W RAM_OffscreenVert,X ; A = vertical off-screen flags [$186C] R $01:E8CD LDA.W RAM_OffscreenVert,X ; A = vertical offscreen flag R $02:84A2 ORA.W RAM_OffscreenVert,X ; A |= [RAM_OffscreenVert+X] R $02:C0DF ORA.W RAM_OffscreenVert,X ; Return if off-screen R $02:C27E ORA.W RAM_OffscreenVert,X ; Off-screen? R $02:C469 ORA.W RAM_OffscreenVert,X ; Return if cooldown running or off-screen R $02:D0CC ORA.W RAM_OffscreenVert,X ; OR the vertical offscreen flag W $02:D378 STZ.W RAM_OffscreenVert,X ; Clear vertical offscreen flags R $02:D3C9 LDA.W RAM_OffscreenVert,X ; A = vertical offscreen flags W $02:D3CF STA.W RAM_OffscreenVert,X ; Store back R $02:DAA0 ORA.W RAM_OffscreenVert,X ; ...and vertically... R $02:DD5A ORA.W RAM_OffscreenVert,X ; On screen? R $02:DED9 ORA.W RAM_OffscreenVert,X ; Offscreen: skip the ground effect R $02:E07C ORA.W RAM_OffscreenVert,X ; Return if offscreen R $02:E1B4 ORA.W RAM_OffscreenVert,X ; Skip if offscreen R $03:8FB4 ORA.W RAM_OffscreenVert,X ; Skip unless (sprite index XOR frame counter) AND 7 = 0 and on-screen vertically W $03:B760 STZ.W RAM_OffscreenVert,X ; Clear vertical offscreen flag R $03:B8FE ORA.W RAM_OffscreenVert,X ; A = horizontal off-screen flag | vertical off-screen flag (0 = on screen) R $03:C451 ORA.W RAM_OffscreenVert,X ; Return if the sprite is off-screen horizontally or vertically $1878 Climbing net door offset byte (signed) Signed horizontal offset of Mario from the net door sprite when it starts turning (Mario X minus $10 minus sprite X). Read by Mario's climbing code to compute Mario's spin position around the door.
5 uses in 2 routines (4 read, 1 write) R $00:DB26 LDA.W $1878 ; A = [$1878] (signed net door spin position) R $00:DB36 BIT.W $1878 ; N flag = sign of [$1878] R $00:DB6F BIT.W $1878 ; N flag = sign of [$1878] W $01:BAF2 STA.W $1878 ; [$1878] = Mario X - $10 - sprite X $187A Riding Yoshi flag RAM_OnYoshi flag byte Non-zero while Mario is riding Yoshi. Set by the Yoshi mount routine, cleared when Mario dismounts or Yoshi is lost. Tested in dozens of places: stomp/kick contact, springboards, cape and fireball input, block hits.
Values: 0 = not on Yoshi; non-zero = on Yoshi.
79 uses in 57 routines (71 read, 7 write, 1 read-modify-write) R $00:CD51 ORA.W RAM_OnYoshi jump to the status tests to determine his physical abilities ; Holding an item or riding Yoshi: skip the climb check R $00:EB83 LDA.W RAM_OnYoshi ; A = on Yoshi flag R $00:EF7E LDA.W RAM_OnYoshi ; A = on Yoshi flag R $00:F01F LDA.W RAM_OnYoshi ; A = on Yoshi flag R $00:F272 ORA.W RAM_OnYoshi ; Return if carrying something ([$148F]) or riding Yoshi R $00:FB09 LDA.W RAM_OnYoshi ; On Yoshi? R $00:FC45 LDA.W RAM_OnYoshi ; Mario already on Yoshi? RW $00:FCD5 INC.W RAM_OnYoshi ; Mario is on Yoshi: [$187A]++ R $00:FDBC LDA.W RAM_OnYoshi ; A = [$187A] (on Yoshi) R $00:FE83 LDX.W RAM_OnYoshi ; X = on Yoshi flag R $00:FED1 LDA.W RAM_OnYoshi ; A = on Yoshi R $01:A8D3 ORA.W RAM_OnYoshi ; OR with riding Yoshi flag R $01:A8FE LDA.W RAM_OnYoshi ; A = riding Yoshi flag R $01:A91F ORA.W RAM_OnYoshi ; OR with riding Yoshi flag R $01:A92C LDA.W RAM_OnYoshi ; A = riding Yoshi flag R $01:AA45 ORA.W RAM_OnYoshi ; OR with riding Yoshi flag R $01:AA61 ORA.W RAM_OnYoshi ; Already carrying a sprite or riding Yoshi: kick instead R $01:AADA LDY.W RAM_OnYoshi ; Y = riding Yoshi flag R $01:B887 LDY.W RAM_OnYoshi ; Y = riding Yoshi flag R $01:DA12 ORA.W RAM_OnYoshi ; Carrying an item or riding Yoshi: do not grab, release R $01:E657 LDA.W RAM_OnYoshi ; A = [RAM_OnYoshi] R $01:E6D5 ORA.W RAM_OnYoshi ; A = carrying something or riding Yoshi R $01:E816 LDY.W RAM_OnYoshi ; Y = [RAM_OnYoshi] R $01:E85C LDA.W RAM_OnYoshi ; A = [RAM_OnYoshi] W $01:EB82 STA.W RAM_OnYoshi ; [RAM_OnYoshi] = A R $01:EC50 LDY.W RAM_OnYoshi ; Y = [RAM_OnYoshi] W $01:EDC3 STZ.W RAM_OnYoshi ; Mario is no longer on Yoshi W $01:F726 STZ.W RAM_OnYoshi ; Mario is no longer on Yoshi W $02:A48A STZ.W RAM_OnYoshi ; Mario no longer on Yoshi R $02:C810 LDA.W RAM_OnYoshi ; Mario riding Yoshi? R $02:CFA8 LDX.W RAM_OnYoshi ; X = [RAM_OnYoshi] R $02:D72C LDA.W RAM_OnYoshi ; A = on-Yoshi flag R $03:8CF9 LDY.W RAM_OnYoshi ; A = $20, or $30 if riding Yoshi (set at $038CFE) R $03:95AE ORA.W RAM_OnYoshi ; Mario spin jumping or on Yoshi? R $03:95CD ORA.W RAM_OnYoshi ; Mario invincible after a hit or on Yoshi: skip $187B Sprite extra state byte table indexed by sprite slot General per-sprite extra variable whose meaning depends on the sprite type. Examples: Chuck charge flag ($20 = charging), Bowser hits-left counter, Yoshi egg 'waiting for Mario' flag, circle radius for Banzai Bill / ball and chain, changing item cycle timer, line-guide fast variant, shell timers.
41 uses in 31 routines (24 read, 10 write, 7 read-modify-write) RW $01:8348 INC.W $187B,X ; [$187B,X]++ (probably prevents stomping the egg) W $01:839C STA.W $187B,X ; [$187B,X] = A (probably chain length) RW $01:968B INC.W $187B,X ; [$187B] += 1 R $01:A94A LDA.W $187B,X ; A = per-sprite flag [$187B,X] (probably 'pushes Mario away') R $01:C0E7 LDA.W $187B,X ; $141C = #01 if Goal Tape triggers secret exit RW $01:C321 INC.W $187B,X ; [$187B,X]++ (cycle timer) R $01:D2AF LDA.W $187B,X ; [$187B] (boss variant) RW $01:D6ED INC.W $187B,X ; [$187B]++ (marks a chainsaw/grinder/fuzzy variant) R $01:D77A LDA.W $187B,X ; Fast variant [$187B] R $01:D79E LDA.W $187B,X ; Fast variant [$187B] R $01:F764 LDA.W $187B,X ; Egg waiting for Mario ($187B)? W $01:F77A STZ.W $187B,X ; Egg is no longer waiting R $02:C1F8 LDA.W $187B,X ; Remember [$187B] before the update R $02:C283 LDA.W $187B,X ; [$187B] = charging flag W $02:C640 STZ.W $187B,X ; [$187B] = 0 (not charging) RW $02:C659 INC.W $187B,X ; [$187B]++ (has seen Mario, will charge) W $02:C6D4 STA.W $187B,X ; [$187B] = $20 (charging) RW $02:C78E INC.W $187B,X ; [$187B]++ (angry, will charge) R $02:D68E LDA.W $187B,X ; A = [$187B+X] (radius of the circle) W $03:A10C STA.W $187B,X ; [$187B] = 2 (hit counter, probably) RW $03:A676 DEC.W $187B,X ; Hits-left counter [$187B]-- $1884 Parallax sprite layout select byte Chooses between two layouts in the parallax background sprite drawing routine: if it equals 1, a different tile and offset set is used. It is never written in the disassembly, so it stays 0 in the original game; the use is as a variant switch.
3 uses in 1 routine (3 read) $1887 Ground shake timer RAM_ShakeGrndTimer timer Frames left of the screen-shaking effect. Set by Thwomp landings, Bowser and Koopa Kid stomps, falling columns, Sumo Bro stomps, Yoshi ground stomp, layer 2/3 smashes. Counted down once per frame in the in-level game mode; while nonzero the layer 1 displacement at $1888 /$1889 is made to wobble.
Values: 0 = no shake; typical starts $20 (most bosses), $30 (Sumo Bro, ground pound), $50 (layer 3 smash), 5 (Yoshi).
15 uses in 14 routines (1 read, 13 write, 1 read-modify-write) RW $00:A2BA DEC.W RAM_ShakeGrndTimer ; [$1887]-- W $01:AB21 STA.W RAM_ShakeGrndTimer ; Ground shake timer = $20 W $01:AF14 STA.W RAM_ShakeGrndTimer ; Shake the ground for $18 frames W $01:D28D STA.W RAM_ShakeGrndTimer ; Ground shake timer = $20 W $02:8411 STA.W RAM_ShakeGrndTimer ; Ground shake timer = $30 W $02:94C3 STA.W RAM_ShakeGrndTimer ; Ground shake timer = $30 W $02:9BE6 STA.W RAM_ShakeGrndTimer ; Ground shake timer [RAM_ShakeGrndTimer] = 5 W $02:D471 STA.W RAM_ShakeGrndTimer ; Ground shake timer = $50 W $02:DD61 STA.W RAM_ShakeGrndTimer ; Ground shake timer = $30 W $03:AB9B STA.W RAM_ShakeGrndTimer ; Shake the ground for $20 frames W $03:B1AA STY.W RAM_ShakeGrndTimer ; Shake the ground for $20 frames W $05:C766 STA.W RAM_ShakeGrndTimer ; Ground shake timer = $20 W $05:C9C8 STA.W RAM_ShakeGrndTimer ; Ground shake timer = $20 $1888 Layer 1 Y shake displacement, low RAM_Layer1DispYLo byte (low byte of a 16-bit pair) Low byte of the vertical offset added to layer 1's scroll while the ground shakes ($1889 is the high byte). Computed each frame in game mode 14 from the shake timer $1887 , added to $001C in the NMI scroll setup and to the IRQ split position. Sprites that draw relative to the screen (fireballs, falling columns, parallax) add it too so they shake with the ground. Cleared to 0 at level start.
10 uses in 9 routines (7 read, 3 write) R $00:83D8 SBC.W RAM_Layer1DispYLo ; V-count timer low = $AE - [$1888] (second split near the bottom) R $00:842D ADC.W RAM_Layer1DispYLo ; BG1 V-scroll low = [$1C] + [$1888] W $00:97CD STZ.W RAM_Layer1DispYLo ; Layer 1 Y displacement [$1888] = 0 W $00:A2C3 STA.W RAM_Layer1DispYLo ; [$1888] = displacement low byte R $00:FF8B ADC.W RAM_Layer1DispYLo ; A += layer 1 Y displacement [$1888] R $05:C1A6 ADC.W RAM_Layer1DispYLo ; [$20] += [$1888] (layer 1 Y displacement) $1889 Layer 1 Y shake displacement, high RAM_Layer1DispYHi byte (high byte of a 16-bit pair) High byte of the layer 1 shake offset ($1888 is the low byte). Zeroed in game mode 14 each frame before the offset is recomputed, and added to the BG1 vertical scroll high byte in the NMI scroll setup.
3 uses in 2 routines (1 read, 2 write) R $00:825B ADC RAM_Layer1DispYHi ; BG1 V-scroll = [$1C]/[$1D] + [$1888] (layer 1 Y displacement) W $00:A2B2 STZ.W RAM_Layer1DispYHi ; Layer 1 Y displacement [$1888] = 0 W $00:A2CE STA.W RAM_Layer1DispYHi ; [$1889] = displacement high byte No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $03:AE39 STZ.W $188A ; Clear $188A (probably ending-picture counter) $188B Mario Y offset on Yoshi byte Vertical offset used when drawing Mario while he rides Yoshi. The Yoshi sprite main routine sets it to 6; it is cleared when there is no Yoshi, when an item is spawned from Yoshi's mouth, and in Peach's walk states. Read by Mario's OAM drawing code.
6 uses in 5 routines (1 read, 5 write) W $01:80C6 STZ.W $188B ; No Yoshi: Mario is not on Yoshi (clear RAM_OnYoshi and [$188B]) W $01:EA75 STZ.W $188B ; Clear [$188B] (Mario Y offset on Yoshi) W $01:EB75 STA.W $188B ; [$188B] = Mario Y offset on Yoshi for this pose W $01:EC57 STY.W $188B ; Mario Y offset on Yoshi [$188B] = 6 (Y = 6) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $02:8378 STA.W $188C ; [$188C] = 1: tiles and attributes are only written on the first frame $188D Screen X working copy (parallax) scratch Temporary storage used by the parallax background sprite drawing: the screen X low byte is stored here and shifted with ROR repeatedly to derive scrolled positions. Not meaningful outside that routine.
6 uses in 1 routine (2 read, 2 write, 2 read-modify-write) W $02:827F STA.W $188D ; [$188D] = screen X low (working copy) RW $02:828A ROR.W $188D ; A = high >> 1, [$188D] = (screen X >> 1) low RW $02:8298 ROR.W $188D ; Pull A, [$188D] = (screen X >> 2) low W $02:82A1 STA.W $188D ; [$188D] = -(screen X >> 2): quarter-speed scroll offset $188F Bonus game blocks hit counter Bonus game (sprite 82) counter of blocks hit. Cleared by the bonus game init, incremented each time the bonus game block routine finishes all nine blocks, which marks the game as finished.
3 uses in 2 routines (1 read, 1 write, 1 read-modify-write) RW $01:DED0 INC.W $188F ; All nine blocks hit: [$188F]++ (game finished) $1890 Bonus game match counter counter Counts matching lines in the bonus game: incremented by the match counting routine, decremented by the keyhole main routine, cleared by the bonus game init. Used to decide the outcome of the bonus game.
5 uses in 3 routines (2 read, 1 write, 2 read-modify-write) RW $01:E021 INC.W $1890 ; Matching line: [$1890]++ RW $01:E275 DEC.W $1890 ; ... decrement it $1891 P-balloon timer RAM_BalloonTimer timer Frames of P-balloon flight left. Set to $FF when Mario takes a P-balloon, decremented in the carried-sprite routine; when it reaches zero the balloon deflates. Cleared at level end.
Values: 0 = no balloon active.
4 uses in 3 routines (1 read, 2 write, 1 read-modify-write) RW $01:9FA7 DEC.W RAM_BalloonTimer ; Decrement the P-balloon timer [$1891] W $01:C306 STA.W $1891 ; [$1891] = $FF: P-balloon timer $1892 Cluster sprite type byte table, one per cluster sprite slot (index X) Cluster sprite number for each slot; 0 = slot free. Set by the cluster spawners (types 3, 5 and 8 in the samples: Boo ceiling/bat groups, ring of Boos, bonus 1-ups) and cleared when the sprite goes away or is collected. The cluster loop dispatches on it. Also used as a per-slot timer for Sumo Bro lightning flames (set to 6 to activate) and as the extended sprite number table by the keyhole routine (set to 1), indexed by Y.
19 uses in 12 routines (6 read, 13 write) W $01:E28E STA.W $1892,Y ; Extended sprite number = 1 W $02:AA3D STA.W $1892,X ; Cluster sprite type [$1892,X] = 8 W $02:AA75 STA.W $1892,X ; Cluster sprite type [$1892,X] = 5 W $02:AA94 STA.W $1892,X ; Cluster sprite type [$1892,X] = 7 W $02:AADF STA.W $1892,X ; Cluster sprite type [$1892,X] = 3 W $02:AB2F STA.W $1892,X ; Cluster sprite type [$1892,X] = 4 W $02:DF87 STA.W $1892,Y ; Flame timer [$1892,Y] = 6 (activates the flame) R $02:F815 LDA.W $1892,X ; A = cluster sprite number in this slot ([$1892,X]) W $02:F85E STZ.W $1892,X ; Clear this cluster sprite slot W $02:F93C STZ.W $1892,X ; Clear this cluster sprite slot W $02:F9A6 STZ.W $1892,X ; Clear this cluster sprite slot (Mario has a star) W $02:FAA0 STZ.W $1892,X ; Ring is gone: clear this cluster slot W $02:FE38 STZ.W $1892,X ; Collected: free the cluster slot [$1892] = 0 W $02:FF1A STZ.W $1892,X ; Free the cluster slot [$1892] = 0 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) $18A7 Tile touched by sprite from side byte Map16 tile number a sprite hit when its horizontal block check found a solid tile. Written by the sprite horizontal block check, read by the kicked shell routine and Chuck physics to react to specific tiles.
3 uses in 3 routines (2 read, 1 write) W $01:92AA STA.W $18A7 ; [$18A7] = tile touched from the side R $01:99C6 LDA.W $18A7 ; A = Map16 tile hit ([$18A7]) R $02:C29B LDA.W $18A7 ; [$18A7] = tile number touched $18A8 Falling column state byte table, one per column slot (index X) State of each falling column in the Bowser/Koopa Kid castle style falling-column effect. Indexed by X in the falling columns routine. $01:CE28 also increments the first entry from the wall Koopa Kid states.
4 uses in 2 routines (1 read, 3 read-modify-write) R $02:83E2 LDA.W $18A8,X ; A = state of column X ([$18A8+X]) RW $02:840C ROR.W $18A8,X ; Set bit 7 of [$18A8+X]: column has landed No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) RW $02:8422 INC.W $18A9 ; [$18A9] = 1: first column has landed $18AA Falling column fall speed byte table, one per column slot (index X) Y speed of each falling column; the routine adds (value >> 5) + 1 each frame so the column accelerates. Cleared by the wall Koopa Kid states.
5 uses in 2 routines (3 read, 2 write) R $02:8401 ADC.W $18AA,X ; A = Y + (Y >> 5) + 1, Y = [$18AA+X]: accelerating fall W $02:8435 STA.W $18AA,X ; [$18AA+X] = Y position No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $18AC Yoshi tongue/swallow timer timer Hold timer for what Yoshi has in his mouth, and the tongue state. Set to $FF when the tongue starts, cleared when an item leaves the mouth, when baby Yoshi swallows a caught sprite, and in baby Yoshi stunned logic. Read by Yoshi's draw routine to pick the mouth frame.
Values: 0 = nothing held / tongue idle.
9 uses in 5 routines (4 read, 4 write, 1 read-modify-write) W $01:F1F1 STZ.W $18AC ; Hold timer = 0 (item leaves the mouth) W $01:F35D STA.W $18AC ; Hold timer [$18AC] = $FF W $03:C05C STZ.W $18AC ; Clear [$18AC] (Yoshi swallow/tongue timer) $18AD Yoshi walk frame byte Index of Yoshi's current walk animation frame while Mario is on him. Updated in the Yoshi on-Mario update as ([$18AD ] - 1) mod 3 and used to look up the frame to show.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) W $01:EACD STA.W $18AD ; Walk frame index [$18AD] = ([$18AD] - 1) mod 3 $18AE Yoshi tongue wind-up flag byte Set to 6 by Yoshi's main routine when the tongue timer $14A3 equals $10 and it is not already set, starting the wind-up. Nonzero makes the draw code use tile $0C instead of the normal mouth tile. Cleared by Yoshi contact and smoke puff routines.
7 uses in 4 routines (3 read, 3 write, 1 read-modify-write) W $01:F0C1 STA.W $18AE ; [$18AE] = 6: start the wind-up W $02:A4A4 STZ.W $18AE ; Clear [$18AE] (Yoshi-related flag) $18AF Yoshi mount timer timer Set to $0C when Mario is put on Yoshi (Put Mario on Yoshi), read by the Yoshi on-Mario update to time the mounting animation.
3 uses in 2 routines (1 read, 1 write, 1 read-modify-write) W $01:ED53 STA.W $18AF ; [$18AF] = $0C (mount timer) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $02:D16E STA.W $18B0 ; [$01]/[$18B0] = X position of Yoshi's mouth (low) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $02:D17B STA.W $18B1 ; [$18B1] = X high No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $02:D14E STA.W $18B2 ; [$18B2] = sprite Y + 8 $18B3 Berry tile Y position, high byte High byte of the Y position of the tile Yoshi is eating a berry from. Stored in the eat-berry routine and read back when the berry is replaced with a tree tile; also used by the berry/silver coin block helper.
3 uses in 3 routines (1 read, 2 write) W $02:BA56 STA.W $18B3 ; [$0D] = $18B3 = Y high W $02:D160 STA.W $18B3 ; [$18B3] = Y high $18B5 Mario in winged cage flag flag byte Set to 1 by the (unused) winged cage routine when Mario is in the cage. Cleared by Mario's block and slope collision.
3 uses in 2 routines (1 read, 2 write) W $02:CCAB STY.W $18B5 ; [$18B5] = 1 (Mario in the cage) $18B6 Sprite scratch (step/offset) scratch General-purpose scratch used by several sprite routines: step counter cleared at level load, saved Y position for Lakitu's fishing line and cloud, the Boo aiming Y offset ($10, or $20 for Big Boo), and the growing pipe tile. Meaning depends on the routine that sets it; do not treat as persistent.
17 uses in 6 routines (7 read, 8 write, 2 read-modify-write) R $01:DA6A LDA.W $18B6 ; A = X movement of the sprite W $01:E8E4 STA.W $18B6 ; [$18B6] = same, saved for the second draw W $01:F8E1 STA.W $18B6 ; [$18B6] = $10: Y offset used when aiming at Mario (Big Boo enters here with $20) W $02:AC77 STZ.W $18B6 ; [$18B6] = 0: step counter W $02:ACB7 STZ.W $18B6 ; [$18B6] = 0: step counter W $02:E69E STA.W $18B6 ; Save line start Y in [$18B6] W $02:E8C3 STA.W $18B6 ; Right tile = GrowingPipeTiles2[Y], saved in [$18B6] $18B8 Cluster/special sprites active flag flag byte Set to 1 when cluster sprites are loaded, by the keyhole routine (bonus game, probably) and while Sumo Bro lightning flames burn. Read in the sprite loop setup ($01:80B5), probably to decide whether the extra sprite handlers run.
4 uses in 4 routines (1 read, 3 write) W $01:E27D STA.W $18B8 ; [$18B8] = 1 (probably tells the sprite spawner the bonus game is active) W $02:AAC2 STY.W $18B8 ; [$18B8] = 1: cluster sprites are in use W $02:DF0B STA.W $18B8 ; $18B8 = 1 (flag set while the flames burn) $18B9 Generator number RAM_GeneratorNum byte Which sprite generator is active, 0 = none. Set from the generator sprite number minus $CA (sprites $CB-$D9) at init, or directly (the Whistlin' Chuck sets 9). Dispatched on by the generator routine, e.g. 5/6 = left/right dolphins, 2/3/4 = para-enemies (goomba, bomb, both). Cleared at level end, by Init Lakitu, and by Turn off generator.
10 uses in 9 routines (5 read, 5 write) W $00:FA89 STZ.W RAM_GeneratorNum ; Generator number = 0 W $01:848D STZ.W RAM_GeneratorNum ; Generator number = 0 (no generator) W $02:A8B8 STA.W RAM_GeneratorNum ; [$18B9] = generator type = sprite number - $CA (sprites $CB-$D9) R $02:AFFE LDA.W RAM_GeneratorNum ; A = current generator number W $02:B032 STZ.W RAM_GeneratorNum ; Generator number = 0: no generator R $02:B0E4 LDY.W RAM_GeneratorNum ; Y = generator number R $02:B272 LDY.W RAM_GeneratorNum ; Y = generator number (5 = left dolphins, 6 = right dolphins) R $02:B2B4 LDY.W RAM_GeneratorNum ; Y = generator number R $02:B340 LDY.W RAM_GeneratorNum ; Y = generator number (2 goomba, 3 bomb, 4 both) W $02:C3AC STA.W RAM_GeneratorNum ; Set sprite generator = 9 $18BA Cluster sprite group counter counter Counts cluster sprite groups/phases: incremented per group in Load cluster sprites and when a fading Boo phase advances, decremented by the Ring of Boos routine. Shared among those cluster routines.
9 uses in 3 routines (4 read, 1 write, 4 read-modify-write) RW $02:AB0D INC.W $18BA ; Count another cluster group: [$18BA]++ R $02:AB4A LDY.W $18BA ; Y = group number [$18BA] RW $02:AB74 INC.W $18BA ; Count the group: [$18BA]++ RW $02:F84D INC.W $18BA ; Old timer was 0: next phase, [$18BA]++ W $02:F861 STZ.W $18BA ; Phase counter [$18BA] = 0 RW $02:FAED DEC.W $18BA ; [$18BA]-- (counter shared with CODE_02F83D) $18BC Skull raft speed byte Speed of the floating skull raft. Set to 0 at init and $0C when Mario steps on it, after which it starts to move.
3 uses in 2 routines (1 read, 2 write) W $02:ED8A STZ.W $18BC ; Raft speed [$18BC] = 0 W $02:EE63 STA.W $18BC ; Raft speed [$18BC] = $0C (starts to move when stepped on) $18BD Mario lock timer RAM_LockMarioTimer timer Frames Mario is held in place. The Koopa Kid boss sets it to $28 on landing; Mario's per-frame handling decrements it.
Values: 0 = not locked.
3 uses in 2 routines (1 read, 1 write, 1 read-modify-write) RW $00:CCD5 DEC.W RAM_LockMarioTimer ; Timer-- W $01:D296 STA.W RAM_LockMarioTimer ; Lock Mario in place for $28 frames $18BE Mario on rope flag flag byte Set while Mario hangs on a line guide rope; cleared by the line guide engine each frame before riding is rechecked, read by Mario's normal animation handling.
5 uses in 2 routines (2 read, 3 write) W $01:DA06 STZ.W $18BE ; Clear Mario on rope flag [$18BE] R $01:DA21 LDA.W $18BE ; Already hanging on? ([$18BE]) W $01:DA2C STA.W $18BE ; [$18BE] = 8: Mario is hanging on the rope W $01:DA37 STZ.W $18BE ; Release Mario: clear [$18BE] $18BF Sprite shared state flag byte Used by several unrelated sprites. Cleared by Init Lakitu and Init Magikoopa, which also tests it as a Magikoopa kill flag (probably). Incremented by Stop sprite respawning; read by Lakitu clouds, Fishin' Boo, layer 3 smash, and cluster Boos. Purpose unclear.
11 uses in 9 routines (8 read, 2 write, 1 read-modify-write) W $01:BDD2 STZ.W $18BF ; No other Magikoopa: clear [$18BF] (Magikoopa kill flag) R $01:BDF2 LDA.W $18BF ; State 0: [$18BF] set (Magikoopa kill flag)? R $01:E99F LDA.W $18BF ; A = [$18BF] (Lakitu flee flag, probably) R $02:8B2B ORA.W $18BF ; Only every other frame and while sprites are unlocked RW $02:B02B INC.W $18BF ; [$18BF]++ (read elsewhere, purpose unclear) $18C0 Sprite respawn timer RAM_TimeTillRespawn timer Time until a sprite is respawned. Set to $FF by Lakitu's cloud logic (with $18C1 = $1E, Lakitu) and by Erase sprite off-screen; zeroed to stop respawning. The per-frame misc handler counts it down and respawns the sprite in $18C1 .
Values: 0 = nothing to respawn.
7 uses in 6 routines (1 read, 5 write, 1 read-modify-write) W $00:FA86 STZ.W RAM_TimeTillRespawn ; Respawn timer = 0: do not respawn sprites W $01:8487 STZ.W RAM_TimeTillRespawn ; Respawn timer = 0 W $01:E7D2 STA.W RAM_TimeTillRespawn ; [RAM_TimeTillRespawn] = $FF W $02:B02E STZ.W RAM_TimeTillRespawn ; Time till respawn = 0: stop sprites from respawning $18C1 Sprite to respawn RAM_SpriteToRespawn byte Sprite number to respawn when $18C0 expires. Set to $1E (Lakitu) by Lakitu's cloud logic and by Erase sprite off-screen; read by the per-frame misc sprite handlers.
3 uses in 3 routines (1 read, 2 write) W $01:E7D7 STA.W RAM_SpriteToRespawn ; [RAM_SpriteToRespawn] = $1E: respawn Lakitu $18C2 Mario riding Lakitu cloud flag flag byte Incremented by Lakitu's cloud logic (probably meaning Mario is on the cloud). Cleared each frame in the sprite loop setup and by the scripted walk. Tested by the screen scroll routine and Mario's pose selection.
5 uses in 5 routines (2 read, 2 write, 1 read-modify-write) R $00:CF98 LDX.W $18C2 ; X = [$18C2] (purpose unknown) R $00:F83F ORA.W $18C2 ; OR riding Lakitu cloud [$18C2] W $01:809B STZ.W $18C2 ; [$18C2] = 0: per-frame flag, purpose unclear RW $01:E883 INC.W $18C2 ; [$18C2]++ (Mario is riding the cloud flag, probably) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) $18CD Bounce sprite overwrite index index Index of the bounce sprite slot to overwrite when none is free. Decremented in Find bounce sprite slot and read by Set up bounce sprite and spawn item.
4 uses in 2 routines (2 read, 1 write, 1 read-modify-write) RW $02:879C DEC.W $18CD ; No free slot: rotate the overwrite index [$18CD] W $02:87A3 STA.W $18CD ; Store the wrapped index R $02:87A6 LDY.W $18CD ; Y = slot to overwrite R $02:8804 LDY.W $18CD ; Y = slot being overwritten $18CE Turn block spin timer timer table, indexed by bounce sprite slot Spin timer of a turn block bounce sprite. Set to $FF when spawned, decremented by bounce sprite 07.
3 uses in 2 routines (1 read, 1 write, 1 read-modify-write) W $02:8877 STA.W $18CE,Y ; [$18CE+Y] = $FF (turn block timer) RW $02:90C0 DEC.W $18CE,X ; Spin timer -= 1 $18D2 Star kill counter counter Counts enemies killed in a row by star power or similar, used to pick the score/1-up. Incremented by star kills, Wiggler, and Rex deaths; cleared on a normal Mario-sprite contact.
13 uses in 4 routines (6 read, 4 write, 3 read-modify-write) RW $01:A84B INC.W $18D2 ; Star kill counter $18D2++ W $01:A857 STA.W $18D2 ; Cap counter at 8 RW $02:F2A6 INC.W $18D2 ; Star kill counter [$18D2]++ R $02:F2B9 LDY.W $18D2 ; Y = kill streak RW $03:9603 INC.W $18D2 ; Star kill counter [$18D2]++ W $03:960F STA.W $18D2 ; Counter = 8 (max) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) R $02:8AEB LDA.W $18D3 ; Sparkle timer [$18D3] $18D4 Red berry count counter Red berries Yoshi has eaten; incremented in the tongue state routine and reset to 0 at 10, at which point Yoshi lays a sprite ($74). Pairs with $18D5 and $18D6 .
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) W $01:F0F2 STZ.W $18D4 ; Reset the count $18D5 Pink berry count counter Pink berries eaten; reset to 0 at 2, at which point sprite $6A is created and $18DE is started.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) W $01:F120 STZ.W $18D5 ; Reset the count $18D6 Berry type eaten byte Type of berry Yoshi is eating: 1 = red, 2 = pink, 3 = green (tile minus $44). Set by the berry helpers, consumed (and cleared) by the Yoshi tongue states to update $18D4 /$18D5 or add time.
5 uses in 4 routines (2 read, 3 write) W $02:BAB2 STA.W $18D6 ; [$18D6] = berry type: 1 = red, 2 = pink, 3 = green (tile - $44) W $02:D1CD STA.W $18D6 ; [$18D6] = berry type being eaten No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $01:92D3 STA.W $18D7 ; [$18D7] = tile high byte (page) $18D9 Enter-castle animation timer timer Animation timer for the enter-castle sequence, set by EnterCastleAni ($B0 or $7F) and read by the animation and its drawing routine. Also written in the scripted walk (purpose unclear).
5 uses in 3 routines (2 read, 1 write, 2 read-modify-write) W $00:C8CE STY.W $18D9 ; [$18D9] = Y (purpose unclear) R $02:F66E LDA.W $18D9 ; A = [$18D9] (animation timer set by EnterCastleAni: $B0, or $7F) RW $02:F673 DEC.W $18D9 ; Count the timer down to 0 R $02:F759 LDA.W $18D9 ; A = [$18D9] (animation timer set by EnterCastleAni: $7F) RW $02:F75E DEC.W $18D9 ; Count the timer down to 0 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $01:F125 STA.W $18DA ; [$18DA] = reward sprite number No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $18DC Yoshi ducking flag flag byte Set when Yoshi is ducking/looking down; cleared by the spawn item/on-Mario update. Read by Mario's fireball, Put Mario on Yoshi, the tongue logic and the eat-berry routine.
7 uses in 6 routines (5 read, 1 write, 1 read-modify-write) W $01:EA9A STZ.W $18DC ; [$18DC] = 0 (Yoshi ducking/looking down flag) RW $01:EB1E INC.W $18DC ; [$18DC]++ (flag: Yoshi ducking) $18DD Chained score index counter Index into the score values for chained scoring (e.g. consecutive kills). Read and incremented by power-up behaviour, read by the level-end coin sprite, cleared at level end; set to 2 by the berry helpers (silver P-switch, probably).
7 uses in 4 routines (3 read, 3 write, 1 read-modify-write) R $00:FC05 LDA.W $18DD ; A = [$18DD] (next point value index) RW $01:C4E3 INC.W $18DD ; A = [$18DD], then [$18DD]++ (chained score counter) W $02:B9BF STA.W $18DD ; [$18DD] = 2 (probably the silver P-switch active state) $18DE Yoshi reward timer timer Counts down in Yoshi physics. Set to $20 when Yoshi finishes eating enough berries (with the reward sprite in $18DA ). Read by the Yoshi main routine.
4 uses in 3 routines (2 read, 1 write, 1 read-modify-write) RW $01:EC6D DEC.W $18DE ; Count down [$18DE] W $01:F12A STY.W $18DE ; [$18DE] = $20: reward timer $18DF Yoshi slot plus 1 byte Yoshi's sprite slot + 1, set each frame by the Yoshi sprite main routine (and the level-end coin routine), 0 = no Yoshi this frame. Cleared at the start of the sprite loop; copied to $18E2 as last frame's value.
6 uses in 4 routines (3 read, 3 write) W $00:FCE5 STX.W $18DF ; [$18DF] = slot + 1 (Yoshi slot index + 1) W $01:80A4 STZ.W $18DF ; [$18DF] = 0: no Yoshi yet this frame (the Yoshi sprite sets it again) R $01:80BE LDA.W $18DF ; A = [$18DF]: did a Yoshi sprite run this frame? W $01:EBEB STA.W $18DF ; [$18DF] = Yoshi slot + 1 R $02:A474 LDX.W $18DF ; X = Yoshi's slot + 1 $18E0 Lakitu cloud lifetime timer Lifetime counter for Lakitu's cloud. Cleared at Init Lakitu, set to $FF when Lakitu is killed, read by the cloud logic.
5 uses in 3 routines (2 read, 2 write, 1 read-modify-write) W $01:84CB STZ.W $18E0 ; [$18E0] = 0 (then falls into InitMontyMole) W $01:9AB1 STY.W $18E0 ; Yes: [$18E0] = $FF R $01:E7AB LDY.W $18E0 ; Y = [$18E0] (cloud lifetime counter) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $01:84A1 STY.W $18E1 ; [$18E1] = slot of the cloud R $01:A9F8 LDY.W $18E1 ; Y = slot of Lakitu's cloud [$18E1] $18E2 Yoshi slot plus 1 (last frame) byte Yoshi's sprite slot + 1 as of the previous frame (copied from $18DF at the sprite loop start), 0 = no Yoshi. Tested by sprite-from-block spawning, Yoshi egg and item spawning to see if Yoshi exists. Also reused in the ending scenes.
9 uses in 7 routines (4 read, 5 write) W $00:FCE8 STX.W $18E2 ; [$18E2] = slot + 1 W $01:80A1 STA.W $18E2 ; [$18E2] = [$18DF]: remember last frame's Yoshi slot (+1) R $01:EA70 LDX.W $18E2 ; X = Yoshi slot + 1 ([$18E2]) R $01:F783 LDY.W $18E2 ; Does a Yoshi already exist? R $02:892D LDA.W $18E2 ; Yoshi present flag [$18E2] R $02:89F6 LDY.W $18E2 ; Yoshi being ridden? [$18E2] W $0C:A207 STZ.W $18E2 ; Clear the Mario-in-front-of-scenery flag W $0C:A6C1 STZ.W $18E2 ; [$18E2] = 0: no Yoshi under Mario W $0C:A7B1 STA.W $18E2 ; [$18E2] = 1: Mario is riding Yoshi $18E3 Coin game cloud coin count counter Coins collected from the coin game cloud: reset on the first frame and when Mario is hurt, incremented by the smoke puff contact.
4 uses in 3 routines (1 read, 2 write, 1 read-modify-write) RW $02:A416 INC.W $18E3 ; Coin cloud coin count [$18E3] += 1 W $02:EEBB STZ.W $18E3 ; First frame: state = 1, coin counter [$18E3] = 0 $18E4 Pending 1-Up counter counter Lives waiting to be awarded. Score sprites add to it, the level end tally and status bar increment it, and the per-frame misc handler gives one life at a time, playing the 1-Up sound, waiting $23 frames ($18E5 ) between each.
6 uses in 4 routines (2 read, 1 write, 3 read-modify-write) RW $00:8F2F INC.W $18E4 ; [$18E4]++: give an extra life R $02:8AB4 LDA.W $18E4 ; Pending 1-Up counter [$18E4] RW $02:8AC3 DEC.W $18E4 ; One less pending 1-Up W $02:AE0A STA.W $18E4 ; Lives to add [$18E4] += A, [$18E5] = 0 $18E5 1-Up delay timer timer Delay between awarding queued lives from $18E4: loaded with $23 after each life, counted down by the misc handler. Cleared when a score sprite adds to $18E4 .
4 uses in 2 routines (1 read, 2 write, 1 read-modify-write) RW $02:8ABE DEC.W $18E5 ; Count down delay W $02:8ACA STA.W $18E5 ; Delay between awards = $23 $18E7 Yoshi has stomp ability RAM_YoshiHasStomp flag byte Non-zero while the Yoshi Mario rides can stomp the ground (the colored-shell power: the stomp effect Yoshi gets from a blue shell). Set from bit 0 of A in the Yoshi tongue/spit logic, cleared by the Yoshi sprite main routine, and read by Mario's block and slope collision code.
Values: 0 = no stomp ability, 1 = has stomp ability.
3 uses in 3 routines (1 read, 2 write) R $00:EF87 LDA.W RAM_YoshiHasStomp ; A = Yoshi has stomp ability W $01:EBD6 STZ.W RAM_YoshiHasStomp ; Clear stomp Yoshi flag W $01:F19E STA.W RAM_YoshiHasStomp ; [$18E7] = bit 0 of A: Yoshi has stomp $18E8 Yoshi growing/swallow timer timer Countdown that, while non-zero, freezes the other sprites and counts down once per frame in the Yoshi sprite main routine (it is copied into the sprites-locked flag and $13FB ). Set to $40 when baby Yoshi swallows a caught sprite or is stunned/carried; probably the growing/eating pause. Also tested by the item-spawn and Baby Yoshi helper code so they skip work while it runs.
Values: 0 = not running.
7 uses in 5 routines (4 read, 2 write, 1 read-modify-write) W $01:A2F0 STA.W $18E8 ; [$18E8] = $40 (probably cooldown before it can eat again) RW $01:EC18 DEC.W $18E8 ; Count the growing timer down W $03:C097 STA.W $18E8 ; [$18E8] = $40 (timer that blocks further tongue contact) $18E9 Torpedo Ted puff slot index (round-robin, 3..0) Rotating index into the 4 minor extended sprite slots. When all four slots are busy, the Torpedo Ted trail puff spawner decrements it (wrapping to 3) and overwrites that slot instead of failing.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) RW $02:B95C DEC.W $18E9 ; All used: [$18E9]-- (round-robin slot) W $02:B963 STA.W $18E9 ; Wrap [$18E9] to 3 R $02:B966 LDY.W $18E9 ; Y = round-robin slot $18EA Minor extended sprite X high byte table, one per minor extended sprite slot (index X or Y) High byte of the X position of minor extended sprites (water splashes, smoke puffs, Boo stream, shattered block pieces, bounce sprites). The low byte is in a neighbouring table. Spawners store the parent sprite's or Mario's X high byte (plus carry when the low byte is offset); the movers add a sign extension to it when X speed is applied.
17 uses in 12 routines (8 read, 9 write) W $00:FDE5 STA.W $18EA,Y ; Splash X high = Mario X high W $02:8502 STA.W $18EA,Y ; Splash X high = sprite X high + carry W $02:8610 STA.W $18EA,Y ; X high = sprite X high + carry W $02:8696 STA.W $18EA,X ; Piece X high = block X high + carry R $02:8FA5 ADC.W $18EA,X ; X position high += sign extension $18F7 Score sprite slot index (round-robin, 5..0) Rotating index of the next score sprite slot to use. The score spawner decrements it, wraps it back to 5 and uses it as Y, so the oldest score sprite is replaced when all slots are full.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) R $02:AD48 LDY.W $18F7 ; Wrap round to 5, return it in Y $18F8 Block-hit hitbox timer byte table, indexed by hitbox slot (X or Y) Frames remaining for a block-hit hitbox (bounce block or cape hit sprite). Set to 6 when the slot is claimed; decremented each frame by the bounce block and cape hit routine.
3 uses in 2 routines (1 read, 1 write, 1 read-modify-write) W $02:8736 STA.W $18F8,Y ; [$18F8+Y] = 6 (hitbox timer) $18FC Piranha plant slot index index (round-robin, 7..0) Rotating index (0-7) used by the Piranha plant routine to pick a slot; decremented and wrapped back to 7.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) R $01:8F03 LDY.W $18FC ; Y = round-robin slot (it will be overwritten) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) R $02:C057 LDA.W $18FD ; [$18FD]: set by the Whistlin Chuck code $18FE Diagonal Bullet Bill timer counter Frame counter for the surrounding/diagonal Bullet Bill generator. Incremented each time the generator runs and reset to 0 when it reaches its limit (comment in the source says $A0).
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) W $02:B0DC STZ.W $18FE ; Reset the timer $18FF Shooter slot index index (round-robin, 7..0) Rotating index used when loading a level shooter sprite into the shooter tables; decremented and wrapped back to 7.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) W $02:AB90 STA.W $18FF ; Wrap round to 7 R $02:AB93 LDX.W $18FF ; X = slot to replace $1900 Bonus star counter / score value byte (BCD) Course clear bonus stars remaining, in BCD. The course clear routine tests it for zero and counts it down while tallying the bonus, one point of score per step. Also written by the 'set score value from height' routine (bank 07), which stores a value here for the score handling to read.
13 uses in 3 routines (10 read, 3 write) R $05:CD76 LDA.W $1900 ; Bonus star count [$1900] (BCD) = 0? W $05:CF22 STA.W $1900 ; Bonus star counter [$1900] -= 1 (BCD) W $05:CF31 STA.W $1900 ; ... subtract 6: BCD borrow correction ($xF -> $x9) W $07:F25D STA.W $1900 ; $1900 = that value (read by the score/points handling) $1901 Bounce sprite OAM property byte table, indexed by bounce sprite slot YXPPCCCT property byte for a bounce sprite's tile. Stored when the bounce sprite is set up and ORed with $64 (priority) when the bounce sprite is drawn into OAM.
3 uses in 2 routines (1 read, 2 write) W $02:8813 STA.W $1901,Y ; Store as [$1901+Y] W $02:8827 STA.W $1901,Y ; Store as [$1901+Y] No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) R $03:C136 LDA.W $1905 ; A = [$1905], total number of tilts made so far RW $03:C160 INC.W $1905 ; Count one more tilt: [$1905] += 1 $1906 Iggy/Larry platform hold timer timer Frames the tilting platform in Iggy/Larry's room stays stationary at maximum tilt. While non-zero it counts down and the platform does not move; when it reaches zero the next phase ($1907 ) starts.
4 uses in 1 routine (2 read, 1 write, 1 read-modify-write) RW $03:C12A DEC.W $1906 ; Count the stationary timer down W $03:C165 STA.W $1906 ; [$1906] = $40: hold the platform still for 64 frames $1907 Iggy/Larry platform phase state (0-5) Current phase of the tilting platform in Iggy/Larry's room. Incremented when a tilt finishes and wrapped to 0 after 5.
Values: 0-5 select the direction/rate steps in the tilt sequence.
4 uses in 1 routine (2 read, 1 write, 1 read-modify-write) R $03:C13C LDA.W $1907 ; A = [$1907], current phase (0-5) RW $03:C168 INC.W $1907 ; Next phase: [$1907] += 1 $1909 Creating/eating block frozen flag flag byte Set to $FF when the creating/eating block sprite is initialised; cleared by Mario's block collision code. The block main routine tests it for $FF (probably 'block is frozen/not yet touched').
Values: $FF = set at init, 0 = cleared.
4 uses in 3 routines (2 read, 2 write) R $03:92A9 LDA.W $1909 ; [$1909] = $FF? (probably 'block frozen' flag) R $03:92DD LDA.W $1909 ; [$1909] = $FF? (frozen) $190A Fading Boo timer timer Fade timer for the cluster Boos (ghosts that fade in and out); counts down toward 0 and is read by the cluster sprite routine (value is copied to $185E ). Cleared when cluster type 5 is spawned.
4 uses in 2 routines (1 read, 2 write, 1 read-modify-write) R $02:F83D LDA.W $190A ; A = [$190A] (fade timer, counts $FF down to 0) W $02:F852 STY.W $190A ; Timer = $FF (restart the cycle) $190B Boo fade level byte Fade step 0-8 used for the palette transparency effect on fading Boos. Set by the cluster sprite routine; incremented by the Big Boo boss states and read to choose the palette entry.
5 uses in 3 routines (2 read, 1 write, 2 read-modify-write) W $02:F8EB STA.W $190B ; [$190B] = fade level 0-8, used for the palette transparency effect RW $03:80DF INC.W $190B ; Fade step: [$190B]++ (palette index) R $03:823D LDA.W $190B ; A = [$190B] (fade step) $190C Directional coin timer timer Frame timer started by a directional coin block. While running it counts down in the Directional Coins sprite. Also ORed with the P-switch timers when the level-start setup and Mario OAM code decide palette/blue-POW handling. Cleared by the spawn sprite from block routine.
7 uses in 5 routines (3 read, 3 write, 1 read-modify-write) R $00:A63B ORA.W $190C ; Blue POW, silver POW or [$190C] timer active: go to A64A W $00:A65A STZ.W $190C ; Cancel [$190C] timer W $02:896F STZ.W $190C ; Clear directional coin timer [$190C] $190D Bowser Peach-appears flag flag byte Incremented in Bowser's phase 9 (bounce on the floor); probably flags the Peach-appears event. Read by the Bowser scene item box and floor/roof drawing and by the Bowser room palette/lightning flash code, which change behaviour once set.
4 uses in 4 routines (3 read, 1 read-modify-write) RW $03:AC11 INC.W $190D ; [$190D]++ (probably flags the Peach-appears event) $190E Sprite buoyancy setting bit flags (bits 7-6) Level header sprite buoyancy bits: the first byte of the level's sprite data AND $C0, stored at level load. Non-zero makes sprites float/swim; tested by sprite-block interaction, Cheep Cheep and orange platform init.
Bits: 7-6 = buoyancy setting from the sprite header.
7 uses in 5 routines (4 read, 3 write) $190F Sprite tweaker byte 190F RAM_Tweaker190F byte table, indexed by sprite slot Per-sprite property bits copied from Sprite190FVals when the sprite is spawned. Read by block interaction, Mario-sprite contact (stomp/kick/hurt), draw and off-screen checks, Yoshi swallow, fireball hits and level end processing.
Bit 7 is cleared when a sprite is erased.
15 uses in 12 routines (12 read, 1 write, 2 read-modify-write) RW $01:9A87 LSR.W RAM_Tweaker190F,X ; Clear bit 7 of tweaker [$190F] R $02:8A1F LDA.W RAM_Tweaker190F,X ; Tweaker byte [$190F] W $07:F7CC STA.W RAM_Tweaker190F,Y ; Tweaker $190F,Y = Sprite190FVals[sprite number] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $191C Yoshi tongue holds key flag flag byte Incremented in the Yoshi tongue logic when the sprite on the tongue is number $80 (a key); tested by the keyhole sprite when Mario is on Yoshi. Cleared by the spawn-item-from-sprite routine (probably when the key is gone).
3 uses in 3 routines (1 read, 1 write, 1 read-modify-write) RW $01:F164 INC.W $191C ; Yes: [$191C]++ $191D Sumo Bro flame slot index index (round-robin, 9..0) Rotating index (0-9) into the extended sprite table used when spawning a Sumo Bro flame; decremented and wrapped to 9 when all slots are busy.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) R $02:DF49 LDY.W $191D ; Y = slot to overwrite No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $00:EEBB STX.W $191E ; [$191E] = switch index R $02:CD87 LDX.W $191E ; X = [$191E] (switch color) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 write, 1 read-modify-write) W $01:E041 STA.W $1920 ; [$1920] = [$1890] (number of matching lines) $1921 Ending picture step counter Step number of the Peach ending picture sequence (state 5). Incremented each time the step timer in $1540 expires and used as an index into the timing table; the sequence ends at $54. Also read when drawing the Peach message letters.
3 uses in 2 routines (2 read, 1 read-modify-write) R $03:AEB7 LDY.W $1921 ; Y = ending picture step [$1921] $1925 Level mode byte Level data format/mode: header bits (byte 2 AND $1F) selecting how objects, layers and Map16 are loaded for this level. Set to 7 for the overworld map and 0 on the level names/OW border setup. Used by the level object loader and layer pointer tables, the Map16 generator and layer 2 updates.
15 uses in 12 routines (12 read, 3 write) W $04:D733 STZ.W $1925 ; Level mode [$1925] = 0 W $04:DC23 STA.W $1925 ; [$1925] = 7 (overworld level mode) R $05:83B8 LDA.W $1925 ; A = level mode [$1925] W $05:84FB STA.W $1925 ; Level mode [$1925] = byte2 & $1F R $05:881C LDA.W $1925 ; A = level mode [$1925] R $05:8885 LDA.W $1925 ; A = level mode [$1925] R $05:88EE LDA.W $1925 ; A = level mode [$1925] R $05:8957 LDA.W $1925 ; A = level mode [$1925] $1928 Screen counter / scene phase byte (multi-use) In level load: the current screen number, reset to 0 and incremented when an object starts a new page ($0A bit 7). In credits: scene phase/timer (set to $E2 at actor init) used by the background DMA and screen wipe. Mario animation B sets it to 7 for the message box freeze.
28 uses in 12 routines (15 read, 10 write, 3 read-modify-write) W $05:8036 STZ.W $1928 ; [$1928] = 0 (screen counter used while loading level data) W $05:80A1 STZ.W $1928 ; [$1928] = 0 (column counter) W $05:8695 STA.W $1928 ; New page flag ([$0A] bit 7): [$1928]++ (A = screen number) W $0C:93DF STZ.W $1928 ; [$1928] = 0: start with credits background 0 RW $0C:9428 INC.W $1928 ; Next background: [$1928]++ W $0C:943C STZ.W $1928 ; [$1928] = 0: show background 0 first W $0C:A408 STA.W $1928 ; Second scene timer [$1928] = $E2 R $0C:AB26 LDY.W $1928 ; Y = [$1928]: scene phase RW $0C:AB5C INC.W $1928 ; [$1928] += 1: next scene phase R $0C:ABC8 LDA.W $1928 ; Y = [$1928] phase W $0D:A541 STA.W $1928 ; Current screen number [$1928] = object screen ([$0A] & $1F) $192A Level entrance type byte Written to 0 or from other level-load data in the level pointer setup (probably the level entrance type from the header); read by the Mario Start! level setup.
4 uses in 2 routines (1 read, 3 write) R $00:A6D5 LDA.W $192A ; A = [$192A] (level entrance type, probably from the level header) $192B Sprite graphics set byte Sprite GFX set number for the level (level header byte 3 AND $0F). Set to fixed values for cutscenes ($14) and the overworld ($11). Read by the GFX upload routine and by some sprite graphics.
11 uses in 6 routines (2 read, 8 write, 1 read-modify-write) W $00:947B STA.W $192B ; Sprite GFX set [$192B] = $14 RW $00:94AD INC.W $192B ; Credits use the next tileset [$1931] and sprite GFX set [$192B] W $00:9592 STA.W $192B ; Sprite GFX set [$192B] = $16 W $00:95DB STA.W $192B ; Sprite GFX set [$192B] = $13 W $00:95E6 STA.W $192B ; Sprite GFX set [$192B] = $17 W $00:964B STA.W $192B ; Sprite GFX set [$192B] = $19 W $00:983D STA.W $192B ; [$192B] = A (sprite GFX set) R $00:A9E1 LDA.W $192B ; A = [$192B] (sprite GFX list index) W $04:DC1E STA.W $192B ; Sprite graphics set [$192B] = $11 W $05:8546 STA.W $192B ; Sprite GFX set [$192B] = byte3 & $0F $192D Foreground palette setting byte Foreground color palette set for the level (level header byte 4 AND 7); fixed values for overworld and cutscenes. Read by the level palette loader.
4 uses in 4 routines (1 read, 3 write) W $00:948F STA.W $192D ; FG palette setting [$192D] = 1 (brown/cream) W $00:AE1C STA.W $192D ; Foreground palette set [$192D] = 7 W $05:8594 STA.W $192D ; FG palette [$192D] = byte4 & 7 $192E Sprite palette setting byte Sprite palette set for the level ((header byte 4 AND $38) >> 3); 0 or 2 for title/cutscene/overworld. Read by the level palette loader.
5 uses in 5 routines (1 read, 4 write) W $00:93D4 STZ.W $192E ; Sprite palette setting [$192E] = 0 W $00:948A STZ.W $192E ; Sprite palette setting [$192E] = 0 W $00:AE17 STA.W $192E ; Sprite palette set [$192E] = 2 W $05:859E STA.W $192E ; Sprite palette [$192E] = (byte4 & $38) >> 3 $192F Background color setting byte Level background color setting (level header byte 2 >> 5); 3 in cutscenes. Read by the level palette loader.
4 uses in 3 routines (1 read, 3 write) W $00:9650 STA.W $192F ; Background color setting [$192F] = 3 W $05:853B STA.W $192F ; [$192F] = byte2 >> 5 (BG color) $1930 Background palette setting byte Level background palette set (level header byte 1 >> 5); 3 in cutscenes. Read by the level palette loader.
4 uses in 3 routines (1 read, 3 write) W $00:9655 STA.W $1930 ; FG palette setting [$1930] = 3 W $05:84F3 STA.W $1930 ; [$1930] = byte1 >> 5 (BG palette) $1931 Tileset byte Tileset number of the current level (from the level header; $18 for the cutscene castle, $FF at Mario Start, a fixed value per overworld submap). Indexes block interaction, Map16 pointers, palettes, layer 3 and sprite GFX uploads. Its partner $1932 is reset together with it.
41 uses in 21 routines (32 read, 7 write, 2 read-modify-write) W $00:9476 STA.W $1931 ; Tileset [$1931] = $18 (cutscene castle) W $00:97D5 STA.W $1931 ; Tileset [$1931] = $FF RW $00:97FC DEC.W $1931 ; Tileset [$1931]-- ($FE) R $00:9FBD ADC.W $1931 ; [$00] = tileset [$1931] * 3 R $00:AA19 LDA.W $1931 ; A = tileset [$1931] R $00:AA85 LDX.W $1931 ; X = tileset [$1931] R $00:EBE1 LDA.W $1931 ; A = tileset [$1931] R $00:ED86 LDA.W $1931 ; A = tileset [$1931] R $00:F169 LDX.W $1931 ; X = tileset number ([$1931]) W $04:DBAB STA.W $1931 ; Mario Start tileset for the submap W $04:DC19 STA.W $1931 ; Set the tileset for this submap W $05:8067 STZ.W $1931 ; Tileset [$1931] and [$1932] = 0 R $05:BB81 LDY.W $1931 ; Y = level tileset [$1931] W $05:DAD4 STA.W $1931 ; [$1931] = tileset number DATA_05D760[X] R $0D:A417 LDA.W $1931 ; A = tileset [$1931] No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $05:85A9 STA.W $1932 ; Tileset [$1931] and [$1932] = byte5 & $0F $1933 Current layer byte (flag) Which layer is being processed: 0 = layer 1, 1 = layer 2. The level loader increments it to move to layer 2; block collision, block spawning and sprite routines set it from the layer they hit and later read it.
Values: 0 = layer 1, 1 = layer 2.
23 uses in 16 routines (14 read, 8 write, 1 read-modify-write) W $00:E94E STA.W $1933 ; [$1933] = 1: process layer 2 W $00:E984 STZ.W $1933 ; [$1933] = 0: process layer 1 R $00:FD7E LDA.W $1933 ; A = [$1933] (layer 2 flag) R $02:870C LDA.W $1933 ; Layer 2 flag [$1933] R $02:8849 LDA.W $1933 ; Layer 2 flag [$1933] W $02:9624 STA.W $1933 ; [$1933] = layer W $05:83AF STZ.W $1933 ; Layer number [$1933] = 0 (layer 1) R $05:83F4 LDA.W $1933 ; Layer number [$1933]++ (to layer 2) W $05:8412 STZ.W $1933 ; Layer number [$1933] = 0 $1935 Extra Mario tile upload flag flag byte Set to 1 when Mario's extra tile rows at $0BF6 are queued for DMA to VRAM; the Mario graphics DMA routine tests it and clears it after uploading.
Values: 0 = nothing pending, 1 = upload pending.
3 uses in 2 routines (1 read, 2 write) R $00:A436 LDA.W $1935 ; A = flag [$1935]: upload extra tile rows? W $00:A8BF STA.W $1935 ; [$1935] = 1: tiles at $0BF6 wait for DMA to VRAM $64A0/$65A0 $1938 Level sprite load status RAM_SprLoadStatus byte table, indexed by level sprite entry Per level-data sprite entry: whether it has been spawned. Set (incremented) when the entry is loaded so it is not spawned twice; cleared when the sprite is erased off-screen so it can respawn when scrolled back.
Values: 0 = not loaded, non-zero = loaded.
12 uses in 10 routines (1 read, 10 write, 1 read-modify-write) W $01:AC9E STA.W RAM_SprLoadStatus,Y ; Mark the level sprite as not yet loaded so it can respawn when scrolled back RW $02:A85D INC.W RAM_SprLoadStatus,X ; Mark the sprite as loaded W $02:A8BB STZ.W RAM_SprLoadStatus,X ; Mark this level sprite as not loaded, so it can be loaded again (generator stays active) W $02:A938 STZ.W RAM_SprLoadStatus,X ; Mark it not loaded so it is tried again later W $02:AB9B STA.W RAM_SprLoadStatus,Y ; Allow that shooter to be loaded again later W $02:ABF4 STZ.W RAM_SprLoadStatus,X ; Allow every level sprite to be loaded again W $02:D08A STA.W RAM_SprLoadStatus,Y ; Allow the level loader to respawn it W $02:FAE9 STZ.W RAM_SprLoadStatus,X ; Clear its load status so the level loader can create it again W $02:FF17 STA.W RAM_SprLoadStatus,Y ; Let the level loader respawn the sprite W $03:B8BC STA.W RAM_SprLoadStatus,Y ; Clear its load status so the level loader can respawn it later $19B8 Screen exit table byte table, one per screen Destination level number for each screen exit of the level. Filled by the level exit objects and read by the level loader to find the target level.
3 uses in 3 routines (1 read, 2 write) R $05:D7BD LDA.W $19B8,X ; A = target level number for this screen, from the screen exit table [$19B8+X] W $05:DBC2 STA.W $19B8,X ; Screen exit table [$19B8+X] = DATA_05DBA9[Y] W $0D:A52C STA.W $19B8,X ; Destination screen -> $19B8,X No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0D:A533 STA.W $19D8,X ; Water flag (bit 0 of [$0B]) -> $19D8,X (only used here) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $00:C058 LDA.W $19F8,Y ; A = current bits W $00:C05F STA.W $19F8,Y ; Store the bits back: marks this spot in the $19F8 table (probably "tile was changed") $1B78 On hardcoded OW path flag flag byte Overworld flag: cleared when Mario starts walking from a level tile or when he arrives, meaning he is not on a hardcoded path.
Values: 0 = not on a hardcoded path.
4 uses in 2 routines (1 read, 3 write) W $04:9301 STZ.W $1B78 ; [$1B78] = 0 (not on a hardcoded path) W $04:9369 STA.W $1B78 ; [$1B78] = 1: committed to a hardcoded path W $04:9527 STZ.W $1B78 ; Arrived: [$1B78] = 0 (no longer on the hardcoded path) R $04:95AB LDA.W $1B78 ; Following the hardcoded path ([$1B78] non-zero)? $1B7A Overworld path step byte Current step along the hardcoded overworld path; cleared when walking from a level tile and set to the step index while Mario walks.
4 uses in 2 routines (1 read, 3 write) W $04:9357 STA.W $1B7A ; [$1B7A] = offset - 1 (index of the last tile walked) W $04:95C0 STX.W $1B7A ; [$1B7A] = path step No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $04:832B ADC.W $1B7C,Y ; Add to fraction accumulator [$1B7C+Y], carry = pixel step No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $04:955F STA.W $1B7E ; [$1B7E] = previous OW tile $1B80 Overworld walk speed set index Index selecting the overworld walk speed table (1 on tiles with property $14, otherwise 0); read when Mario walks.
3 uses in 1 routine (2 read, 1 write) R $04:94A8 LDX.W $1B80 ; X = [$1B80]: speed set (1 on tiles with property $14, else 0) W $04:95FF STY.W $1B80 ; [$1B80] = speed set $1B82 Overworld event X position byte X position of the overworld event effect (low nibble of map position * 16); used to place the smoke puff.
4 uses in 2 routines (1 read, 3 write) W $04:E64E STA.W $1B82 ; [$1B82] = effect X position (low nibble of map position * 16) W $04:E732 STA.W $1B82 ; [$1B82] = effect X position (pixels) R $04:EC67 LDA.W $1B82 ; A = effect X [$1B82] W $04:ECC1 STA.W $1B82 ; [$1B82] = effect X $1B83 Overworld event Y position byte Y position of the overworld event effect; used with $1B82 to place the smoke puff.
4 uses in 2 routines (1 read, 3 write) W $04:E654 STA.W $1B83 ; [$1B83] = effect Y position W $04:E729 STA.W $1B83 ; [$1B83] = effect Y position (pixels) R $04:EC6F LDA.W $1B83 ; A = effect Y [$1B83] W $04:ECCA STA.W $1B83 ; [$1B83] = effect Y $1B84 Overworld event timer timer Smoke puff timer for the overworld event, set to $28 when it starts and counted down; also used as a tile source index when applying edits.
7 uses in 3 routines (3 read, 3 write, 1 read-modify-write) W $04:E659 STA.W $1B84 ; [$1B84] = $28 (smoke puff timer) W $04:E70C STA.W $1B84 ; [$1B84] = source index (also selects 2x2 or 6x6 below) R $04:EAD4 LDA.W $1B84 ; A = [$1B84] (tile source index) RW $04:EBEB DEC.W $1B84 ; Timer [$1B84]-- W $04:ECCF STA.W $1B84 ; [$1B84] = $1C (puff timer) $1B86 Overworld event state state State of the overworld event machine (tile changes, smoke puff, fading tiles). Advanced with INC after each stage and cleared when the event is applied to the layer 1 map.
17 uses in 5 routines (4 read, 5 write, 8 read-modify-write) RW $04:E640 INC.W $1B86 ; Go to state 1: [$1B86]++ W $04:E686 STA.W $1B86 ; [$1B86] = 2: no level tile, skip to the event tiles RW $04:E6D3 INC.W $1B86 ; Go to state 3: [$1B86]++ RW $04:E6F2 INC.W $1B86 ; No tiles: skip state 3 RW $04:E768 INC.W $1B86 ; Go to state 4: [$1B86]++ W $04:EA01 STZ.W $1B86 ; [$1B86] = 0: event state machine finished RW $04:EAAB INC.W $1B86 ; Go to state 5: [$1B86]++ W $04:EAC5 STA.W $1B86 ; [$1B86] = 3: lay the next event tile RW $04:EBF0 INC.W $1B86 ; Timer expired: next state [$1B86]++ R $04:EBF7 LDY.W $1B86 ; Y = state [$1B86] W $04:ECA4 STA.W $1B86 ; [$1B86] = 7: no level tile, finish RW $04:ECAF INC.W $1B86 ; Go to state 6: [$1B86]++ $1B87 Overworld sub-state state Shared overworld state counter: lives exchange iris state, save prompt/message box state and the game over message (incremented on negative lives). Set to 1 to start the player switch and 5 after the level (probably the save prompt).
9 uses in 6 routines (2 read, 3 write, 4 read-modify-write) RW $00:9C13 INC.W $1B87 ; [$1B87]++ (overworld message box state: advance) RW $00:A0C4 INC.W $1B87 ; Negative lives: [$1B87]++ to trigger the game over message W $04:8372 STA.W $1B87 ; [$1B87] = 1: start the player switch W $04:9051 STA.W $1B87 ; [$1B87] = 5 (probably tells a later state to show the save prompt) RW $04:F404 INC.W $1B87 ; Lives exchange state [$1B87]++ RW $04:F42F INC.W $1B87 ; Radius reached: state [$1B87]++ W $04:F442 STZ.W $1B87 ; Sequence over: state [$1B87] = 0 $1B88 Box/iris direction flag byte Direction/state for the overworld message box (0 = opening/open, 1 = closing), the lives exchange iris and the credits screen wipe (1 = grow toward $E0, 0 = shrink to 0).
Values: 0 = opening or shrinking, 1 = closing or growing.
12 uses in 7 routines (5 read, 4 write, 3 read-modify-write) RW $00:9C16 INC.W $1B88 ; [$1B88]++ (message box expanding flag) W $00:C5D3 STA.W $1B88 ; [$1B88] = 1: message box is expanding R $04:F423 LDX.W $1B88 ; X = [$1B88]: iris direction W $04:F445 STZ.W $1B88 ; Iris direction [$1B88] = 0 R $05:B10F LDX.W $1B88 ; X = [$1B88]: box state (0 = opening/open, 1 = closing) W $05:B120 STZ.W $1B88 ; [$1B88] = 0 (ready for the next message) RW $05:B18B INC.W $1B88 ; [$1B88] = 1: start closing the box R $05:B250 LDX.W $1B88 ; X = box state: 0 = opening, 1 = closing RW $0C:9FC3 INC.W $1B88 ; [$1B88] = 1: start the background transition R $0C:AB1F LDX.W $1B88 ; X = [$1B88] wipe direction (1 = grow toward $E0, 0 = shrink to 0) W $0C:AB4B STX.W $1B88 ; Opening finished: direction = 0 $1B89 Iris and box size byte Size of a growing/shrinking window effect: the iris radius on the Lives exchange screen, the half-width in pixels (0-$50) of the message box window, and a scene timer/fade progress in the credits. Written by the iris, message box and credits setup code, read by the window HDMA code ($0C wipe update). Credits setup stores $E2 here as the starting position of the transition (probably).
16 uses in 7 routines (11 read, 5 write) R $04:F426 LDA.W $1B89 ; A = [$1B89]: current iris radius W $04:F450 STA.W $1B89 ; Store the new radius [$1B89] R $05:B112 LDA.W $1B89 ; A = [$1B89]: box size (0-$50), half-width of the window in pixels R $05:B253 LDA.W $1B89 ; A = current box size W $0C:A08A STA.W $1B89 ; [$1B89] = $E2: starting window position of the transition (probably) R $0C:A1F0 LDA.W $1B89 ; Scene timer/fade progress W $0C:A405 STA.W $1B89 ; Scene timer [$1B89] = $E2 $1B8A Lives exchange selected player byte Player chosen on the Lives exchange screen (the one with more lives). Stored when the iris effect starts and compared on later frames to detect whether the selection changed.
4 uses in 2 routines (2 read, 2 write) W $04:F420 STX.W $1B8A ; [$1B8A] = selected player (the one with more lives) R $04:F541 CPX.W $1B8A ; Same player as before? W $04:F54B STX.W $1B8A ; [$1B8A] = chosen player $1B8B Lives exchange cursor blink timer timer Cursor blink timer on the Lives exchange screen. Restarted to $18 when the selected player changes.
3 uses in 1 routine (1 read, 1 write, 1 read-modify-write) W $04:F548 STA.W $1B8B ; Restart the cursor blink timer [$1B8B] = $18 RW $04:F5D1 INC.W $1B8B ; Cursor blink timer [$1B8B]++ $1B8C Overworld iris direction byte Direction of the overworld submap-switch iris: 0 = closing, 2 = opening. Cleared when Mario starts walking a path ($04:9628); read as an index by the submap switch states.
Values: 0 = closing, 2 = opening.
3 uses in 2 routines (1 read, 2 write) R $04:DB1A LDX.W $1B8C ; X = [$1B8C]: 0 closing, 2 opening $1B8D Overworld iris width word (little endian, low/high pair) Current width value of the overworld submap-switch iris. Starts at $7000 when Mario walks a path and is increased by a width step each frame of the switch. Partner of $1B8F (height).
4 uses in 2 routines (1 read, 3 write) W $04:9633 STA.W $1B8D ; [$1B8D] = $7000 W $04:DB24 STA.W $1B8D ; [$1B8D] += width step W $04:DB46 STA.W $1B8D ; Clamp [$1B8D] to its limit No description written yet. The instructions below show how it is used.
2 uses in 1 routine (2 read) R $04:DB71 SBC.W $1B8E ; Left edge = $80 - [$1B8E] $1B8F Overworld iris height word (little endian, low/high pair) Current height value of the overworld submap-switch iris. Starts at $5400 when Mario walks a path and is increased by a height step each frame of the switch. Partner of $1B8D (width).
4 uses in 2 routines (1 read, 3 write) W $04:9639 STA.W $1B8F ; [$1B8F] = $5400 W $04:DB37 STA.W $1B8F ; [$1B8F] += height step W $04:DB4C STA.W $1B8F ; Clamp [$1B8F] to its limit No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) $1B91 Menu cursor blink counter counter Frame counter incremented by the menu cursor handler; the blinking menu cursor drawing routine reads it to decide whether the cursor is visible this frame.
3 uses in 2 routines (1 read, 1 write, 1 read-modify-write) RW $00:9AD0 INC.W $1B91 ; [$1B91]++ (cursor blink counter) W $00:9AFE STZ.W $1B91 ; Reset the blink counter R $00:9E89 LDA.W $1B91 ; A = blink counter [$1B91] $1B92 Menu cursor position byte Current cursor position in the title/file select style menus. Cleared at Nintendo Presents, set to the file number in the erase file menu, and used as the index by the cursor handler and the cursor drawing routine.
5 uses in 4 routines (2 read, 3 write) W $00:93E3 STZ.W $1B92 ; [$1B92] = 0: menu cursor position R $00:9AD6 LDX.W $1B92 ; X = [$1B92] (current cursor position) W $00:9B13 STA.W $1B92 ; [$1B92] = new cursor position W $00:9B6D STX.W $1B92 ; Cursor position [$1B92] = file R $00:9E82 LDX.W $1B92 ; X = cursor position [$1B92] $1B93 Secondary exit flag flag byte Flag from the level's exit data marking that a screen exit is a secondary exit. Stored by the screen exit object loader ($0D:A539) and read by the level load code ($05:D7D4, $05:D94C) to choose the entry setup.
3 uses in 2 routines (2 read, 1 write) W $0D:A539 STA.W $1B93 ; Secondary exit flag -> [$1B93] $1B94 Bonus game initialized flag flag byte Set (incremented) after the bonus game sprite (sprite 82) has run its init, so the init is done only once. Also tested by the level-end coin sprite code ($00:FC81).
3 uses in 2 routines (2 read, 1 read-modify-write) R $01:DDAC LDA.W $1B94 ; A = bonus game initialised flag [$1B94] RW $01:DE0A INC.W $1B94 ; Mark the bonus game as initialised: [$1B94]++ $1B95 Yoshi wings level flag flag byte Nonzero while Mario is in the Yoshi wings bonus area (a special level reached with Yoshi wings; probably). Read by level start, P-switch/fall-off, level load, screen exit and Yoshi code. The wings exit animation uses it as a phase: 0 = going out, 2 = coming back.
9 uses in 8 routines (8 read, 1 write) R $00:C82C LDY.W $1B95 ; Y = [$1B95] (phase: 0 = going out, 2 = coming back) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $02:F4D7 STA.W $1B96 ; Side exit flag [$1B96] = 1 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $05:C6C8 STA.W $1B97 ; [$1B97] = $FCF0 No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) RW $00:C995 INC.W $1B99 ; [$1B99]++: next phase $1B9A Layer 2 scroll trigger flag byte Background scroll status for the flying grey turnblocks: set to 8 when the movement starts, 0 while not yet triggered. Also read by scroll sprite 0B (layer 2 ON/OFF switch). Orange platform writes 1 (unused).
Values: 0 = not activated, 8 = activated.
6 uses in 3 routines (4 read, 2 write) W $01:B551 STA.W $1B9A ; Unused: [$1B9A] = 1 (purpose unclear) W $03:8656 STA.W $1B9A ; [$1B9A] = 8: start the movement $1B9B Keep reserve item flag flag byte Set to 1 by the scripted level-end walk. Mario's death routine keeps the reserve item if it is 1. Also read by the extended sprite hitbox code ($02:A768).
3 uses in 3 routines (2 read, 1 write) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 read-modify-write) R $00:A08A LDA.W $1B9C ; A = [$1B9C] (overworld event flag?) RW $04:918D INC.W $1B9C ; [$1B9C]++ (entered a pipe) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 write, 1 read-modify-write) W $05:C4BD STA.W $1B9D ; Pause timer [$1B9D] = $4B $1B9E Overworld flag, purpose unclear flag byte Set to 1 when Mario starts walking along an overworld path; cleared on overworld load, submap switch finish and when a button is pressed on a tile. Purpose unclear from the code.
5 uses in 4 routines (1 read, 4 write) W $04:8D94 STZ.W $1B9E ; [$1B9E] = 0 (purpose unclear) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 read-modify-write) R $03:D71E LDX.W $1B9F ; X = [$1B9F]: number of bridge segments already broken RW $03:D745 INC.W $1B9F ; Next segment: [$1B9F]++ $1BA0 Overworld earthquake timer timer Countdown used by the overworld; set to $FF by an overworld event (earthquake per the original note), decremented by the overworld game mode and read by the path-walking code.
4 uses in 3 routines (2 read, 1 write, 1 read-modify-write) W $04:E665 STA.W $1BA0 ; [$1BA0] = $FF (overworld earthquake timer, per the original note) $1BA1 Current level screen number byte Screen number the level object loader is working on. Set per object, incremented by the rectangle object helpers when an object crosses into the next screen, and restored from $1928 afterwards.
11 uses in 7 routines (5 read, 3 write, 3 read-modify-write) W $05:8698 STA.W $1BA1 ; [$1BA1] = current screen number W $0D:A544 STA.W $1BA1 ; Also [$1BA1] = screen number W $0D:A6C9 STA.W $1BA1 ; Restore current screen [$1BA1] from [$1928] RW $0D:A974 INC.W $1BA1 ; Screen number [$1BA1]++ RW $0D:A9EB DEC.W $1BA1 ; Screen number [$1BA1]-- RW $0D:AA04 INC.W $1BA1 ; Screen number [$1BA1]++ $1BA2 Mode 7 graphics index byte Index into the Mode 7 boss picture data: kid row + frame + flip for Morton/Roy/Ludwig, $2C for the Reznor ring, and set by Bowser. Read by the Mode 7 positioning/tilemap routine.
6 uses in 4 routines (3 read, 3 write) W $01:CDD5 STA.W $1BA2 ; [$1BA2] = graphics index (kid row + frame + flip), used by the Mode 7 drawing code $1BA3 Mode 7 pixel plane buffer byte table (index X) Scratch buffer for Mode 7 boss graphics setup; collects the three bit planes of each pixel into a 3-bit color, rotating them down per byte.
4 uses in 1 routine (2 read, 1 write, 1 read-modify-write) W $03:DE04 STA.W $1BA3,X ; A = 3-bit color of this pixel: rotate the three collected plane bits down $1BB2 3bpp to 4bpp conversion buffer byte table (index X) Scratch buffer for the 3bpp to 4bpp graphics converter: planes 0-1 are stored, planes 2-3 are ORed in before the tile is uploaded to VRAM.
4 uses in 3 routines (2 read, 2 write) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $00:AAA9 STA.W $1BBC ; [$1BBC] = $FFFF for files 1 and $17, else 0 $1BE3 Layer 3 type byte Layer 3 (BG3) type for the level, from DATA_05D78A at level load. Used by the layer 3 setup routines.
Values: 0 = none.
4 uses in 3 routines (2 read, 2 write) R $00:9FC2 LDA.W $1BE3 ; A = layer 3 type [$1BE3] (0 = none) R $00:A01F LDA.W $1BE3 ; A = layer 3 type W $05:DAA7 STA.W $1BE3 ; [$1BE3] = DATA_05D78A[X] $1BE4 Layer 1 update VRAM address high byte High byte of the VRAM address of the pending layer 1 tile update; 0 = no update. Tested by the NMI VRAM uploader; written by the layer 2 stripe builders ($05:8A11) as well. Partner of $1BE5 .
12 uses in 2 routines (9 read, 3 write) R $00:87AF LDA.W $1BE4 ; [$1BE4] = VRAM address high of the pending layer 1 update (0 = none) W $00:88DF STA.W $1BE4 ; [$1BE4] = 0: layer 1 update done $1BE5 Layer 1 update VRAM address low byte Low byte of the pending layer 1 update VRAM address. Read by the NMI VRAM uploaders, written by the stripe builders. See $1BE4 .
10 uses in 2 routines (8 read, 2 write) $1BE6 Layer 1 update buffer, left column byte table (index X) Buffer of tile words for the left column of a layer update; the stripe builder writes word 0 (top-left 8x8 tile) here, uploaded by NMI. Companion buffer at $1C66 .
3 uses in 1 routine (3 write) W $05:8A70 STA.W $1BE6,X ; Word 0 (top-left 8x8 tile) to left column buffer $1BE6 W $05:8B50 STA.W $1BE6,X ; Word 0 (top-left 8x8 tile) to top row buffer $1BE6 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $1C66 Layer 1 update buffer, right column byte table (index X) Second buffer of tile words for a pending layer update, written by the stripe builders at $05:8A7E. See $1BE6 .
3 uses in 1 routine (3 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $1CE6 Layer 2 update VRAM address high byte High byte of the VRAM address of the pending layer 2 tile update; 0 = no update. Tested by the NMI VRAM uploader and written by the layer 2 stripe builders. Partner of $1CE7 .
13 uses in 2 routines (9 read, 4 write) R $00:88E2 LDA.W $1CE6 ; [$1CE6] = VRAM address high of the pending layer 2 update (0 = none) W $00:8A12 STA.W $1CE6 ; [$1CE6] = 0: layer 2 update done $1CE7 Layer 2 update VRAM address low byte Low byte of the pending layer 2 update VRAM address. Read by NMI uploaders, written by the stripe builders. See $1CE6 .
11 uses in 2 routines (8 read, 3 write) $1CE8 Layer 2 update buffer, left column byte table (index X) Buffer of tile words for the left column of a layer 2 update; word 0 (top-left 8x8 tile) goes here. Companion buffer at $1D68 .
4 uses in 1 routine (4 write) W $05:8DEE STA.W $1CE8,X ; Word 0 (top-left 8x8 tile) to left column buffer $1CE8 No description written yet. The instructions below show how it is used.
2 uses in 1 routine (2 write) $1D68 Layer 2 update buffer, right column byte table (index X) Second buffer of tile words for a pending layer 2 update, written by the stripe builders ($05:8C52). See $1CE8 .
4 uses in 1 routine (4 write) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (2 write) $1DE8 Submap switch state state Overworld submap switch state. Incremented to advance to the next step (iris, draw map page), cleared when the switch finishes. Also read by the NMI handler and the overworld sprite code.
8 uses in 6 routines (4 read, 1 write, 3 read-modify-write) RW $04:DB4F INC.W $1DE8 ; Next submap switch state RW $04:DBC4 INC.W $1DE8 ; Next submap switch state W $04:DBCF STZ.W $1DE8 ; Reset submap switch state RW $04:DD3B INC.W $1DE8 ; Next submap switch state $1DE9 Scene / event counter counter Multi-purpose scene counter. In the ending and credits it is the scene number (0 = Lakitu ... 12 = Bowser). On the overworld it flags a pending event (0 = none). Also incremented as a transition counter in level and cutscene code (probably). Meaning depends on game mode.
17 uses in 10 routines (11 read, 2 write, 4 read-modify-write) R $00:95D2 LDA.W $1DE9 ; A = [$1DE9] (ending scene number) RW $00:A281 INC.W $1DE9 ; [$1DE9]++ (general transition counter, probably) R $04:E5F8 LDA.W $1DE9 ; A = [$1DE9] (event pending flag) W $04:EA21 STZ.W $1DE9 ; [$1DE9] = 0: no event pending RW $05:B150 INC.W $1DE9 ; Probably a game-state counter: [$1DE9]++ W $0C:93BC STA.W $1DE9 ; [$1DE9] = $FF (purpose unclear) RW $0C:AD8F INC.W $1DE9 ; Credits scene number [$1DE9] += 1 R $0C:ADF9 LDA.W $1DE9 ; A = [$1DE9]: ending enemy scene (0 = Lakitu ... 12 = Bowser) $1DEA Overworld event number byte Number of the overworld event being run (for example a path or tile reveal after a level is beaten). Read by the event state machine, tile edit, smoke puff and tile replacement routines.
14 uses in 5 routines (12 read, 1 write, 1 read-modify-write) R $04:E5FD LDA.W $1DEA ; A = event number [$1DEA] R $04:E643 LDA.W $1DEA ; A = event number [$1DEA] R $04:E6D6 LDA.W $1DEA ; A = event number R $04:E9EC LDA.W $1DEA ; A = event number [$1DEA] R $04:EA07 LDA.W $1DEA ; A = event number R $04:EA0D LDA.W $1DEA ; A = event number R $04:EC83 LDA.W $1DEA ; A = event number R $04:ECB2 LDA.W $1DEA ; A = event number W $05:D9CF STA.W $1DEA ; [$1DEA] = DATA_05D608[Y] (purpose unclear) $1DEB Overworld event tile index index Index of the current event tile record. Set to the event's first record, incremented per tile, and compared with $1DED to know when the event is finished.
11 uses in 4 routines (7 read, 2 write, 2 read-modify-write) W $04:E474 STA.W $1DEB ; [$1DEB] = first record index for this event W $04:E6E1 STA.W $1DEB ; [$1DEB] = current event tile index R $04:E6EB CMP.W $1DEB ; Same as [$1DEB]? (event has no tiles) R $04:E702 LDA.W $1DEB ; A = current event tile index RW $04:EAB6 INC.W $1DEB ; [$1DEB]++: next event tile $1DED Overworld event end index index Index one past the last tile record of the current event (the next event's first). See $1DEB .
4 uses in 3 routines (2 read, 2 write) W $04:E47B STA.W $1DED ; [$1DED] = end index (next event's first) W $04:E6E8 STA.W $1DED ; [$1DED] = end index $1DF0 Saved overworld X scroll word (little endian, low/high pair) Copy of the overworld X scroll saved by the overworld game mode.
3 uses in 1 routine (2 read, 1 write) W $04:8390 STA.W $1DF0 ; Save current X scroll in [$1DF0] $1DF2 Saved overworld Y scroll word (little endian, low/high pair) Copy of the overworld Y scroll saved by the overworld game mode.
3 uses in 1 routine (2 read, 1 write) W $04:8395 STA.W $1DF2 ; Save current Y scroll in [$1DF2] No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $00:9C6F LDX.W $1DF4 ; X = offset into the demo script [$1DF4] W $00:9C7F STX.W $1DF4 ; Save the script offset $1DF5 General delay timer timer Frame countdown used in several non-level modes: Nintendo Presents screen ($40 frames), title demo time left, overworld load delay ($B0), level-end walk ($A0). Decremented by those modes.
11 uses in 7 routines (1 read, 5 write, 5 read-modify-write) W $00:93C7 STA.W $1DF5 ; [$1DF5] = $40: frames the screen stays up RW $00:940F DEC.W $1DF5 ; [$1DF5]--: Nintendo Presents timer RW $00:942E DEC.W $1DF5 ; [$1DF5]-- (title timer, also the demo controller timer) RW $00:9433 INC.W $1DF5 ; Undo the decrement W $00:9AC2 STA.W $1DF5 ; [$1DF5] = $10 (purpose unclear) RW $00:9C72 DEC.W $1DF5 ; Demo time left [$1DF5]-- W $00:A09D STA.W $1DF5 ; [$1DF5] = $B0 (delay timer) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $04:8535 STY.W $1DF6 ; [$1DF6] = warp index * 2 (negative if none) R $04:8543 LDY.W $1DF6 ; Y = [$1DF6]: warp index * 2 $1DF7 Star warp fly speed byte Speed of the star during the star warp fly-away on the overworld. Cleared when a button is pressed on a tile and increased by the level name/star code. Partner of $1DF8 .
6 uses in 2 routines (3 read, 2 write, 1 read-modify-write) W $04:916A STZ.W $1DF7 ; Star fly-away speed [$1DF7] = 0 R $04:9E52 LDA.W $1DF7 ; A = [$1DF7]: star warp fly speed $1DF8 Star ground timer timer Frames the star stays on the ground before flying away on the overworld. Cleared on tile button press, incremented by the star code. Partner of $1DF7 .
3 uses in 2 routines (1 read, 1 write, 1 read-modify-write) W $04:916D STZ.W $1DF8 ; Star ground timer [$1DF8] = 0 $1DF9 Sound effect port 1 byte (APU I/O mirror) Sound effect request, port 1 ($2142 mirror). Written with a sound number by Mario, sprites and menus. The NMI handler sends it to the APU and clears it. Examples: $0A power-up, $04 pipe, $FF hurry up (music).
Values: 0 = no request.
94 uses in 79 routines (2 read, 92 write) W $00:812A STZ $1DF9,X ; Clear sound mirror $1DF9+X W $00:8E5D STA.W $1DF9 ; Sound request [$1DF9] = $FF: hurry up (music speeds up) W $00:9BBD STA.W $1DF9 ; ... on $1DF9 (save game jingle) W $00:A23F STY.W $1DF9 ; Play the pause/unpause sound ([$1DF9]) W $00:C734 STX.W $1DF9 ; Play sound effect 1 W $00:C761 STA.W $1DF9 ; Play sound effect $1E W $00:C79A STA.W $1DF9 ; Play sound effect 9 W $00:C7AE STA.W $1DF9 ; Command $22: play sound effect $0E W $00:D256 STA.W $1DF9 ; Mario not moving yet: play sound $04 on $1DF9 (pipe) W $00:DAAB STA.W $1DF9 ; Play swim sound ($0E) W $00:DBB4 STA.W $1DF9 ; Play sound effect ($1DF9 = 1): punch the net R $00:ED41 LDA.W $1DF9 ; A = sound effect mirror [$1DF9] W $00:ED47 STA.W $1DF9 ; Play sound effect 1 (hit head) W $00:F2EA STA.W $1DF9 ; Play sound effect $05 W $00:F35A STA.W $1DF9 ; Play sound effect $1C W $00:F43B STA.W $1DF9 ; Play sound effect $04 (pipe) W $00:F5E4 STY.W $1DF9 ; Play sound effect $0F (soaring ends) W $00:F5F5 STY.W $1DF9 ; Play sound effect $04 (power down) W $00:F91B STA.W $1DF9 ; Play sound effect W $01:99A0 STA.W $1DF9 ; Play sound effect 1 (block hit) W $01:A292 STA.W $1DF9 ; Play sound effect $06 W $01:A60E STA.W $1DF9 ; Sound effect $1DF9 = rising pitch kill sound for this count W $01:A72A STA.W $1DF9 ; Sound effect $1DF9 = 3 (kick) W $01:A868 STA.W $1DF9 ; Play sound effect W $01:A8DA STA.W $1DF9 ; Play sound effect W $01:A941 STA.W $1DF9 ; Play sound effect W $01:AAFF STA.W $1DF9 ; Play sound effect W $01:AB5A STA.W $1DF9 ; Play sound effect W $01:AFFE STA.W $1DF9 ; Play sound effect $01 on $1DF9 (landing) W $01:B131 STA.W $1DF9 ; Play sound effect $03 on $1DF9 W $01:B4F4 STA.W $1DF9 ; Sound effect 1 (hit head) via [$1DF9] W $01:BAD9 STA.W $1DF9 ; Play sound effect $0F W $01:BC61 STA.W $1DF9 ; Play sound effect 1 W $01:BF2A STA.W $1DF9 ; Play sound effect $10 (magic) W $01:C30B STA.W $1DF9 ; Sound effect $1E W $01:C57C STA.W $1DF9 ; Sound effect $0A (power-up) W $01:C57C STA.W $1DF9 ; Sound effect $0A (power-up) W $01:C59E STA.W $1DF9 ; Sound effect $0D (cape) W $01:CFD2 STA.W $1DF9 ; Sound effect $1F (defeated) W $01:D2FF STA.W $1DF9 ; Play sound effect $02 W $01:D320 STA.W $1DF9 ; Play sound effect $01 W $01:D336 STA.W $1DF9 ; Play sound effect $01 W $01:D3F5 STA.W $1DF9 ; Play sound effect $01 W $01:DE79 STA.W $1DF9 ; Play hit-block sound (SFX $0B) W $01:E5F4 STA.W $1DF9 ; Play sound effect 7 ($1DF9) W $01:F0D5 STA.W $1DF9 ; Play swallow sound effect W $01:F2E1 STA.W $1DF9 ; Play spit sound effect W $01:F5A3 STA.W $1DF9 ; Play sound effect 1 (SFX port $1DF9) W $01:FD42 STA.W $1DF9 ; Play sound effect 1 W $01:FDB4 STA.W $1DF9 ; Play sound effect $20 W $02:8820 STX.W $1DF9 ; Play it on port $1DF9 W $02:918E STA.W $1DF9 ; Play sound effect $0B (on/off switch) W $02:A047 STA.W $1DF9 ; Play sound effect 1 W $02:A108 STA.W $1DF9 ; Play sound effect 2 W $02:A126 STA.W $1DF9 ; Play sound effect 3 (coin) W $02:C5B0 STA.W $1DF9 ; Play sound effect $10 W $02:C6B7 STA.W $1DF9 ; Unused: play sound effect $24 W $02:C709 STA.W $1DF9 ; ...play footstep sound effect 1 W $02:C7BA STA.W $1DF9 ; Play sound effect 3 W $02:C7D4 STA.W $1DF9 ; Play sound effect 2 (stomp) W $02:F26D STA.W $1DF9 ; Play stomp sound W $02:F2C3 STA.W $1DF9 ; Play the streak sound W $03:80EB STY.W $1DF9 ; [$1DF9] = $10: sound effect W $03:81E0 STA.W $1DF9 ; [$1DF9] = $23: sound effect W $03:95EE STA.W $1DF9 ; Sound effect $08 W $03:9620 STA.W $1DF9 ; Sound effect = table at $03:8000 (rising pitch) W $03:963C STA.W $1DF9 ; Sound effect = table at $03:8000 (rising pitch) W $03:9A68 STA.W $1DF9 ; Sound effect $01 (hit head) W $03:9ABD STA.W $1DF9 ; Sound effect $03 (kick/kill) W $03:9B05 STA.W $1DF9 ; Sound effect $10 (Reznor fireball) W $03:9FFC STA.W $1DF9 ; Play sound effect $25 (probably the roar) W $03:A8B4 STY.W $1DF9 ; Play sound effect $2A on $1DF9 W $03:A8E5 STA.W $1DF9 ; Play sound effect $10 on $1DF9 W $03:B0BA STA.W $1DF9 ; Sound effect: contact W $03:B1B3 STA.W $1DF9 ; Play sound effect 1 (bounce) W $03:C039 STA.W $1DF9 ; Play sound effect $06 W $03:C20B STY.W $1DF9 ; Play sound effect $0B W $03:C852 STA.W $1DF9 ; Sound $1DF9 = FireworkSfx1[Y] W $03:CE26 STA.W $1DF9 ; Play sound effect $23 W $03:CEC3 STA.W $1DF9 ; Play sound effect $02 W $04:83CE STA.W $1DF9 ; Play sound effect $21 W $04:8405 STA.W $1DF9 ; Timer ended: play sound effect $22 W $04:9172 STA.W $1DF9 ; Sound effect [$1DF9] = $0D (Star Road warp) W $04:FA7A STA.W $1DF9 ; Play sound effect $0E ([$1DF9]) W $0C:CD6A STA.W $1DF9 ; Play sound effect W $0C:CF2E STA.W $1DF9 ; Play sound effect W $0C:D2B4 STA.W $1DF9 ; Play sound effect $21 (port $1DF9) W $0C:D7DA STA.W $1DF9 ; Play sound effect $0F $1DFA Sound effect port 2 byte (APU I/O mirror) Sound effect request, port 2 ($2141 mirror). Written by Mario (jump, $01), Yoshi mount ($02), grinders ($04) and others; cleared by the NMI handler after it is sent.
Values: 0 = no request.
13 uses in 11 routines (1 read, 12 write) W $00:81A4 STZ $1DFA ; Clear the three sound effect mirrors W $00:C911 STA.W $1DFA ; Play sound effect 3 on port $1DFA W $00:D660 STA.W $1DFA ; Play the jump sound ($01 to $1DFA) W $00:DBA7 STA.W $1DFA ; Play jump sound effect ($1DFA = 1) W $00:FC7C STA.W $1DFA ; Sound effect request in [$1DFA] W $01:D747 STA.W $1DFA ; Play sound effect $04 (grinder noise) W $01:DB72 STA.W $1DFA ; ...play the grinder sound (sound effect $04 on port $1DFA) W $01:ED5C STA.W $1DFA ; Sound effect: $02 (Yoshi mount) W $01:EDA7 STA.W $1DFA ; Sound effect 3 (Yoshi dismount) W $01:F71A STA.W $1DFA ; Play sound effect 3 (SFX port $1DFA) W $02:A47E STA.W $1DFA ; Play sound $03 on port $1DFA W $03:92BA STA.W $1DFA ; Play it via $1DFA $1DFB Music request byte (APU I/O mirror) Music change request sent to the APU by the NMI handler. Written by level start, power-ups, death, goal and boss code. Examples: $09 death, $0B course clear, $0C level clear, $0D star music, $80 fade out.
Values: 0 = no request.
39 uses in 33 routines (1 read, 38 write) W $00:94B4 STA.W $1DFB ; Music request [$1DFB] = $15 (cutscene music) W $00:96C8 STA.W $1DFB ; Music request [$1DFB] = 1 (title screen music) W $00:9738 STA.W $1DFB ; Music request [$1DFB] = A W $00:9E19 STA.W $1DFB ; Music request [$1DFB] = $80 (fade out the music) W $00:C527 STY.W $1DFB ; Change music to $14 W $00:C54C STA.W $1DFB ; Resume the level music: [$1DFB] = [$0DDA] W $00:C9BE STA.W $1DFB ; Request music $11 (level clear fanfare, probably) W $00:D0DF STA.W $1DFB ; Music request $0A on $1DFB (probably Game Over music) W $00:E305 STX.W $1DFB ; Request music X W $00:EEC4 STA.W $1DFB ; Music request $0C (switch palace jingle) W $00:F60C STA.W $1DFB ; Music request [$1DFB] = $09 (death) W $01:8785 STA.W $1DFB ; Music request [$1DFB] = $0B (course clear) W $01:C0F1 STA.W $1DFB ; Change music: [$1DFB] = $0C (level clear) W $01:C587 STA.W $1DFB ; Music request $0D (star music) W $01:C587 STA.W $1DFB ; Music request $0D (star music) W $01:D050 STA.W $1DFB ; Change music ([$1DFB] = $0B) W $01:E217 STA.W $1DFB ; Change music ([$1DFB] = $10) W $01:FB2F STA.W $1DFB ; Play music $0B (boss defeated) via [$1DFB] W $02:E284 STA.W $1DFB ; Restore level music W $03:809E STA.W $1DFB ; [$1DFB] = $0B: request level end music W $03:98E8 STA.W $1DFB ; Music request [$1DFB] = $0B (probably the boss defeated music) W $03:A703 STY.W $1DFB ; Change music to $17 W $03:A7A9 STA.W $1DFB ; Change music to $1D W $03:ABF5 STY.W $1DFB ; Change music to $1B W $03:AC54 STA.W $1DFB ; Change music to $1C W $03:CE9B STA.W $1DFB ; Change music to $0B W $04:83D3 STA.W $1DFB ; Request music $08 (probably the Bowser's valley reveal) W $04:8E44 STA.W $1DFB ; Request the map music for that submap ([$1DFB]) W $04:91E2 STA.W $1DFB ; [$1DFB] = $80: fade out the music W $04:DBFB STA.W $1DFB ; Request the submap's music W $0C:9448 STA.W $1DFB ; Play the credits music ([$1DFB] = $09) W $0C:A40D STA.W $1DFB ; Change music to $0A (credits music) W $0C:A5C3 STA.W $1DFB ; Change music to $0B $1DFC Sound effect port 3 byte (APU I/O mirror) Sound effect request, port 3 ($2143 mirror), the most used sound port. Written by Mario, sprites, bosses and menus (confirm = 1, door $0F, impact $09). Sent and cleared by the NMI handler.
Values: 0 = no request.
113 uses in 92 routines (1 read, 112 write) W $00:93C2 STA.W $1DFC ; Sound request [$1DFC] = 1 (the logo jingle, probably) W $00:9AE5 STA.W $1DFC ; Sound request [$1DFC] = 1 (confirm) W $00:9AFB STY.W $1DFC ; Sound request [$1DFC] = 6 (cursor move) W $00:9BB8 STZ.W $1DFC ; Clear the sound request port $1DFC W $00:C559 STA.W $1DFC ; Play sound effect $24 (running-out warning) W $00:C722 STA.W $1DFC ; Play sound effect $1B W $00:C7D3 STA.W $1DFC ; Command $25: play sound effect 9 on port $1DFC W $00:CE41 STY.W $1DFC ; Play sound effect $0E (scroll) W $00:D07D STA.W $1DFC ; Play sound effect $04 on $1DFC W $00:D2A7 STA.W $1DFC ; Play sound effect $09 on $1DFC (probably the cannon blast) W $00:D64B STA.W $1DFC ; Play the spin jump sound ($04 to $1DFC) W $00:EA8F STA.W $1DFC ; Play sound effect $04 (spin jump) via [$1DFC] W $00:EC12 STA.W $1DFC ; Sound effect $0F (door) W $00:EF92 STA.W $1DFC ; Sound effect $25 (Yoshi stomp) W $00:EFB8 STA.W $1DFC ; Sound effect $09 ($1DFC: impact) W $00:F026 STA.W $1DFC ; Sound effect $08 W $00:F238 STA.W $1DFC ; Play sound effect $2A W $00:FEB7 STA.W $1DFC ; Sound effect: fireball W $01:8392 STA.W $1DFC ; Play sound effect $09 (Banzai Bill) W $01:8586 STA.W $1DFC ; Play sound effect $17 (Bowser's fire) W $01:9633 STA.W $1DFC ; Sound effect $09 (explosion) W $01:A2C7 STA.W $1DFC ; Play sound effect $1F W $01:AF19 STA.W $1DFC ; Play sound effect $09 (Thwomp slam) on $1DFC W $01:C54A STA.W $1DFC ; Sound effect $0B (item to box) W $01:CF0C STA.W $1DFC ; Sound effect $08 W $01:D05B STA.W $1DFC ; Sound effect $17 W $01:D29B STA.W $1DFC ; Play sound effect $09 (boss landing thud) W $01:D3AD STA.W $1DFC ; Play sound effect $28 W $01:E04C STY.W $1DFC ; Play the sound effect W $01:E0A3 STA.W $1DFC ; Play fireball jump sound (SFX $27) W $01:E6AB STA.W $1DFC ; Play sound effect 8 ($1DFC: springboard) W $01:ED61 STA.W $1DFC ; Sound effect $1F W $01:EF10 STY.W $1DFC ; Play wing flap sound effect W $01:F0FF STA.W $1DFC ; Play sound effect $29 W $01:F291 STA.W $1DFC ; Play fire sound effect W $01:F310 STA.W $1DFC ; Play tongue sound effect W $01:F3EE STA.W $1DFC ; Play sound effect 3 (SFX port $1DFC) W $01:F6CA STA.W $1DFC ; Play sound effect 3 (SFX port $1DFC) W $01:F71F STA.W $1DFC ; Play sound effect $13 (SFX port $1DFC) W $01:F758 STA.W $1DFC ; Play sound effect $0A (egg hatch) W $01:FB62 STA.W $1DFC ; Play sound effect $20 W $01:FCD0 STA.W $1DFC ; Play sound effect $28 (stomp) W $02:8014 STA.W $1DFC ; Sound effect $0C ([$1DFC]): item falls out of the box W $02:8416 STA.W $1DFC ; Sound effect $09 ([$1DFC]) W $02:8681 STA.W $1DFC ; Sound effect $07 ([$1DFC]) W $02:894C STY.W $1DFC ; Play sound effect W $02:8ACF STA.W $1DFC ; Play 1-Up sound W $02:917F STA.W $1DFC ; Play sound effect $08 W $02:9BEB STA.W $1DFC ; Play sound effect $09 via [$1DFC] W $02:A483 STA.W $1DFC ; Play sound $13 on port $1DFC W $02:B045 STA.W $1DFC ; Play sound effect $17 W $02:B08A STA.W $1DFC ; Play sound effect $09 (Bullet Bill shot) W $02:B4A9 STA.W $1DFC ; Play sound effect 9 (Bullet Bill shot) W $02:B0E1 STA.W $1DFC ; Play sound effect $09 W $02:C7F8 STA.W $1DFC ; Play sound effect $28 W $02:CDEE STA.W $1DFC ; Play sound effect $08 (spring) W $02:D476 STA.W $1DFC ; Sound effect $09 (to $1DFC) W $02:D91A STA.W $1DFC ; Play sound effect $19 W $02:DD66 STA.W $1DFC ; Play sound effect $09 (ground stomp) W $02:DECE STA.W $1DFC ; Play sound effect $17 (lightning hits the ground) W $02:F67C STY.W $1DFC ; Timer = $B0 (first frame): play sound effect $0F W $02:F685 STY.W $1DFC ; Timer = 1 (last frame): play sound effect $10 W $02:F767 STY.W $1DFC ; Timer = $76: play sound effect $0F W $02:F770 STY.W $1DFC ; Timer = 8: play sound effect $10 W $03:8235 STA.W $1DFC ; [$1DFC] = $28: sound effect W $03:8901 STA.W $1DFC ; Play swoop sound effect W $03:8ADC STA.W $1DFC ; Play fire sound effect W $03:8D7F STA.W $1DFC ; Play sound effect $22 (port $1DFC) W $03:9D57 STY.W $1DFC ; Sound effect $17 (fire breath) on [$1DFC] W $03:A5D2 STA.W $1DFC ; Play sound effect $08 W $03:A605 STA.W $1DFC ; Play sound effect $09 W $03:A7F8 STA.W $1DFC ; Play sound effect $17 W $03:A83D STA.W $1DFC ; Play it ($1DFC) W $03:AB8E STA.W $1DFC ; Sound effect: ground pound / thump W $03:B12B STA.W $1DFC ; Sound effect: Bowser hit W $03:B1A5 STY.W $1DFC ; Play sound effect $25 (heavy impact) W $03:C06E STA.W $1DFC ; Play sound effect $1F W $03:C344 STA.W $1DFC ; Play sound effect $02 W $03:C832 STA.W $1DFC ; Play rocket launch sound effect W $03:C858 STA.W $1DFC ; Sound $1DFC = FireworkSfx2[Y] W $03:C89F STA.W $1DFC ; Sound $1DFC = FireworkSfx4[rocket] W $03:CE35 STY.W $1DFC ; Play sound effect $29 (once) W $03:CE48 STY.W $1DFC ; Play sound effect $2A (once) W $03:CE80 STA.W $1DFC ; Play sound effect $20 (impact) W $03:CECD STA.W $1DFC ; Play sound effect $28 W $03:D754 STA.W $1DFC ; Play sound effect $07 ([$1DFC]) W $03:E018 STA.W $1DFC ; Play sound effect $18 (thunder) W $04:96A2 STA.W $1DFC ; Play sound effect $23 W $04:E671 STA.W $1DFC ; Play sound effect $16 W $04:E765 STA.W $1DFC ; Play sound effect $15 (laying event tiles) W $04:ECAC STA.W $1DFC ; Play sound effect 1 (level tile appears) W $04:F2A6 STA.W $1DFC ; Play sound effect $1C W $04:F401 STA.W $1DFC ; Play sound effect $22 W $04:F569 STA.W $1DFC ; Play sound effect $23 W $04:F738 STA.W $1DFC ; Play sound effect $18 ([$1DFC]), probably thunder W $05:B32C STA.W $1DFC ; Play the coin sound ([$1DFC] = 1) W $05:B34F STA.W $1DFC ; Play the coin sound ([$1DFC] = 1) W $05:C760 STA.W $1DFC ; Sound effect $09 (thud) W $05:C9C3 STA.W $1DFC ; Cycle finished: sound effect $09 (thud) W $05:CDE5 STA.W $1DFC ; Play sound effect $11 (tally tick) W $05:CF4A STX.W $1DFC ; Play sound effect $12 (tally done) W $0C:A5B1 STA.W $1DFC ; Sound effect $0A on $1DFC W $0C:D12C STA.W $1DFC ; Play sound effect W $0C:D297 STA.W $1DFC ; Play sound effect $1A W $0C:D2BF STA.W $1DFC ; Play sound effect $17 W $0C:D2DA STA.W $1DFC ; Play sound effect $19 W $0C:D3E9 STA.W $1DFC ; Play sound effect $07 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:812D STZ $1DFD,X ; Clear $1DFD+X (mirrors $1DFD-$1E00, includes last music value $1DFF) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $00:8181 CPY $1DFF ; Y = APU port 2; if it differs from last sent music value [$1DFF], skip to SFX W $00:8189 STA $1DFF ; Port 2 = request (or 0 once echoed), remember it in [$1DFF], clear [$1DFB] $1E01 Debug mode byte Debug mode cycled by Mario's per-frame handling: 0 -> 1 -> 2 -> 0 each time it is triggered.
4 uses in 1 routine (2 read, 1 write, 1 read-modify-write) RW $00:CC74 INC.W $1E01 ; Cycle debug mode [$1E01]: 0 -> 1 -> 2 -> 0 W $00:CC7E STZ.W $1E01 ; Wrap to 0 after 2 R $00:CC81 LDA.W $1E01 ; A = debug mode [$1E01] $1E02 Cluster/extended sprite Y low byte table (index X or Y) Low byte of the Y position of a cluster sprite (or other small sprite slot such as the keyhole and Sumo Bro flame). Set at spawn from screen position and data; used by Boo/bat ceiling, 1-up bonus and candle flames. Partner high bytes are in separate tables.
29 uses in 13 routines (17 read, 12 write) W $01:E293 STA.W $1E02,Y ; Extended sprite Y position low = 0 W $02:AA5B STA.W $1E02,X ; Cluster Y position low = high nibble of the level byte W $02:AA80 STA.W $1E02,X ; Y position low = $F0 W $02:AB00 STA.W $1E02,X ; Y position low = ([$148E] & $3F) + 8 + screen Y W $02:DF68 STA.W $1E02,Y ; Store at [$1E02,Y] W $02:F894 STA.W $1E02,X ; Cluster Y low = [$01] + [RAM_ScreenBndryYLo] W $02:F8BC STA.W $1E02,X ; Y position low += [DATA_02F837+Y] (+1 or -1) W $02:FFC6 STA.W $1E02,X ; Position low += speed / 16 + carry $1E16 Cluster/extended sprite X low byte table (index X or Y) Low byte of the X position of a cluster sprite or small sprite slot (Sumo Bro flames, keyhole, Boo ring). Moved by X speed ($1E66 ) each frame. Partner of $1E02 (Y low).
25 uses in 13 routines (16 read, 9 write) W $01:E29D STA.W $1E16,Y ; Extended sprite ($1E16) = $18 W $02:AA7B STA.W $1E16,X ; X position low from DATA_02AA68 W $02:DF57 STA.W $1E16,Y ; Store at [$1E16,Y] W $02:F885 STA.W $1E16,X ; Cluster X low = [$00] + [RAM_ScreenBndryXLo] W $02:FDF2 STA.W $1E16,X ; X position low byte += X speed [$1E66] $1E2A Cluster sprite Y position high byte table, one per cluster sprite slot (index X) High byte of each cluster sprite's 16-bit Y position ($1E02 is the low byte). Set when a cluster sprite is spawned (Boo ring, Boo/bat ceiling, bonus 1-up, Sumo Bro flames), then updated with carry as the sprite moves; compared against the screen boundary when despawning or drawing. The Keyhole and Sumo Bro flame code also store through the same table with a Y index.
21 uses in 11 routines (11 read, 10 write) W $01:E298 STA.W $1E2A,Y ; Extended sprite X position low = 1 W $02:AA61 STA.W $1E2A,X ; Cluster Y position high = bit 0 W $02:AB07 STA.W $1E2A,X ; Y position high W $02:DF71 STA.W $1E2A,Y ; Store at [$1E2A,Y] W $02:F89B STA.W $1E2A,X ; Cluster Y high = [RAM_ScreenBndryYHi] + carry W $02:F8C5 STA.W $1E2A,X ; Y position high += [DATA_02F839+Y] W $02:FBAA STA.W $1E2A,X ; Cluster Y (16-bit) = ring center Y + Y offset W $02:FD43 STA.W $1E2A,X ; Y position += +1 or -1 (16-bit) W $02:FFCD STA.W $1E2A,X ; Position high += sign extension + carry $1E3E Cluster sprite X position high byte table, one per cluster sprite slot (index X) High byte of each cluster sprite's 16-bit X position ($1E16 is the low byte). Set at spawn (spawn of cluster type 8, level load, ring of Boos) as screen X high plus carry, and kept in step as the sprite moves. Read by the Sumo Bro flame and bonus 1-up contact code, and by the despawn check.
15 uses in 11 routines (8 read, 7 write) W $01:E2A2 STA.W $1E3E,Y ; Extended sprite ($1E3E) = 0 W $02:AA51 STA.W $1E3E,X ; Cluster X position high W $02:AAF3 STA.W $1E3E,X ; Cluster X position high W $02:DF5F STA.W $1E3E,Y ; Store at [$1E3E,Y] R $02:DF7E LDA.W $1E3E,Y ; Compare flame X with the left screen edge (16-bit) W $02:F88C STA.W $1E3E,X ; Cluster X high = [RAM_ScreenBndryXHi] + carry W $02:FB93 STA.W $1E3E,X ; Cluster X (16-bit) = ring center X + X offset $1E52 Cluster sprite Y speed byte table, one per cluster sprite slot (index X), signed Vertical speed of each cluster sprite. Boo/bat ceiling sprites set it to an aimed speed plus 9 (a downward bias); the bonus 1-up cluster sprite adds 3 per frame as gravity, up to $40. Added into the Y position ($1E02 with $1E7A as the fraction) by the shared move helper. Cluster type 5 spawns store a shifted table value here. Keyhole uses its copy as a timer ($10).
13 uses in 6 routines (7 read, 5 write, 1 read-modify-write) W $01:E2AC STA.W $1E52,Y ; Extended sprite timer ($1E52) = $10 W $02:AAA5 STA.W $1E52,X ; [$1E52,X] = low nibble of table 1 value, shifted up W $02:FC36 STA.W $1E52,X ; Y speed [$1E52] = aimed Y speed + 9 (downward bias) RW $02:FC75 DEC.W $1E52,X ; Y speed -= 1 each time while it is above about -31 (swoops back up) W $02:FDC9 STA.W $1E52,X ; Gravity: Y speed += 3 until $40 W $02:FDDD STZ.W $1E52,X ; Landed: snap Y to a multiple of 16 and Y speed = 0 $1E66 Cluster sprite X speed byte table, one per cluster sprite slot (index X), signed Horizontal speed of each cluster sprite. Boo/bat ceiling sprites set it to an aimed speed; the bonus
1-up cluster sprite negates it to bounce off walls. Cluster type 5 spawns store the high nibble of a table value; type 8 spawns and level load clear it. Applied to the X position ($1E16 with $1E8E as the fraction) by the cluster move helper.
14 uses in 7 routines (6 read, 8 write) W $01:E2A7 STA.W $1E66,Y ; Extended sprite ($1E66) = 1 W $02:AA9D STA.W $1E66,X ; [$1E66,X] = high nibble of table 1 value W $02:FC3B STA.W $1E66,X ; X speed [$1E66] = aimed X speed W $02:FD05 STA.W $1E66,X ; X speed [$1E66] += +1 or -1 (DATA_02FBBB) W $02:FE0D STA.W $1E66,X ; Reverse X speed $1E7A Cluster sprite Y fraction byte table, one per cluster sprite slot (index X) Sub-pixel fraction of a cluster sprite's Y position. Each frame the cluster despawn/move helper adds the Y speed ($1E52 ) times 16 (low nibble) into it and carries into the Y position ($1E02 ). Cluster type 5 spawns initialise it from the low nibble of a table value, shifted up.
4 uses in 3 routines (2 read, 2 write) W $02:AAB6 STA.W $1E7A,X ; [$1E7A,X] = low nibble of table 2 value, shifted up W $02:FFAE STA.W $1E7A,X ; Y fraction [$1E7A] += speed * 16 (low nibble) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 write) W $02:AAAE STA.W $1E8E,X ; [$1E8E,X] = high nibble of table 2 value $1EA2 Overworld level flags bit flags table, one per translevel number (index X/Y) Per-level progress flags, indexed by translevel number ($13BF ). It is the live copy of the saved level data; save data is copied here on file load and copied back after each level. Set when a level is cleared or its midway point is passed, and read by the overworld path code to decide which exits are open and whether Mario may leave a level.
Bits: Bit 7: level beaten (clear = Mario cannot exit it, the game returns).
Bit 6: midway point reached. Bits 0-3: exit open on that side of the level tile (bits from DATA_04941E).
14 uses in 9 routines (9 read, 5 write) W $00:A19D STA.W $1EA2,X ; Copy to the live table $1EA2+X R $00:A264 LDA.W $1EA2,Y ; Y = translevel [$13BF]; [$1EA2+Y] bit 7 clear (level not beaten yet): can't exit, return W $04:8F53 STA.W $1EA2,X ; Set bit 6 (midway point reached) in the level flags R $04:96CB ORA.W $1EA2,X ; Set the exit bit of the entry side in [$1EA2+X] (bits from DATA_04941E) R $04:995B ORA.W $1EA2,X ; Set the exit bit in [$1EA2+X] (bits from DATA_04941E) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $00:AD2A LDA.W $1EEA ; A = [$1EEA] (16-bit load, so N = bit 7 of [$1EEB]) $1EEB Special Zone cleared flag flag byte Bit 7 is probably set once the Special Zone is cleared. Tested by the level sprite spawner, Net Koopa and bounce sprite code to pick the alternate (post-Special World) palette/graphics, by the GFX upload routine to load the post-special graphics file, and by the ending enemy scene.
Values: bit 7 clear = normal game; bit 7 set = Special World cleared (changed enemy colours).
5 uses in 5 routines (5 read) R $02:A985 LDY.W $1EEB ; Y = [$1EEB] (bit 7 probably set once the Special Zone is cleared) $1F02 Overworld events passed flags bit flags array (one bit per overworld event) Bit array of overworld events already triggered (path openings, switch palace tile changes). Event number / 8 selects the byte, event number AND 7 selects the bit (mask table DATA_04E44B). Tested when drawing or applying completed events to the layer 1 and layer 2 maps, and copied into the save buffer after a level. An unused routine in bank 5 also tests it as a level-cleared flag.
7 uses in 6 routines (6 read, 1 write) R $04:E611 LDA.W $1F02,Y ; A = event-passed flags [$1F02+Y] R $04:EA14 LDA.W $1F02,Y ; A = event-passed flags [$1F02+Y] W $04:EA1B STA.W $1F02,Y ; Save: event is now done R $05:B36C LDA.W $1F02,X ; A = byte of the overworld level-cleared flags No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) R $04:FD85 LDA.W $1F07 ; A = [$1F07] (probably level-beaten flags) $1F11 Player's current submap byte table, one per player (index X/Y: Mario, Luigi) Which overworld submap each player is on. $1F11 is Mario, $1F12 Luigi; read through the active-player index. Written when the overworld loads (0 = main Yoshi's Island map), on submap warps, and by the message trigger sprite. Read by level loading to pick the level for the OW tile, by the overworld drawing and DMA code to pick map pages, and by Monty Mole, Yoshi, Hammer Bro and block code that behave per world.
Values: 0 = Yoshi's Island map; other values = other submaps (1 = Yoshi's Island in the cutscene list).
37 uses in 29 routines (32 read, 5 write) W $00:96D2 STY.W $1F11 ; [$1F11] = Y (current submap) W $00:A0A0 STZ.W $1F11 ; Mario's submap [$1F11] = 0 R $00:A12D LDA.W $1F11,X ; A = submap of the current player R $00:A54B LDA.W $1F11,X ; A = [$1F11+X]: submap the player is on W $00:C9DB STA.W $1F11 ; Set the submap to Yoshi's Island R $01:E2F6 LDA.W $1F11,Y ; A = current submap of the player ([$1F11] indexed by player) R $02:DA7C LDA.W $1F11,Y ; A = submap number of the player [$1F11] R $03:92FB LDA.W $1F11,Y ; A = overworld submap [$1F11] R $04:850C LDA.W $1F11,Y ; [$01] = player's submap (high byte of the compare value) R $04:86FD LDA.W $1F11 ; A = Mario's submap [$1F11] R $04:8E3D LDA.W $1F11,X ; X = current player's submap ([$1F11] + player) R $04:D760 LDA.W $1F11,X ; A = submap the player is on R $04:EB3D LDA.W $1F11,X ; A = OW submap [$1F11+X] R $04:FD7C LDA.W $1F11,Y ; A = [$1F11,Y] (probably the player's current submap) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) $1F13 Player overworld animation byte table, one per player (X=0 Mario, 4 Luigi) Mario's/Luigi's overworld pose/animation: facing and walking direction frame used when drawing the map sprite. Written while walking along a path and reset to 0 (standing) when the OW is prepared. Read by the 2x2 player draw routine, the Yoshi-riding draw routine and the walk start/enter-level code to decide which way the player faces.
19 uses in 8 routines (11 read, 8 write) R $04:8D9E LDA.W $1F13 ; A = Mario's map pose [$1F13] W $04:8DAB STX.W $1F13 ; Mario's pose = X R $04:91A8 LDA.W $1F13,X ; A = [$1F13,X] (player animation) W $04:91B2 STA.W $1F13,X ; Store the animation in [$1F13,X] R $04:927D LDA.W $1F13,X ; A = animation of this player W $04:9284 STA.W $1F13,X ; Store: character faces down R $04:93FA LDA.W $1F13,X ; A = player animation W $04:9402 STA.W $1F13,X ; Player now faces the way he walks W $04:979A STA.W $1F13,X ; Player animation [$1F13+X] = [$04] W $04:98C6 STZ.W $1F13 ; [$1F13] = 0 (Mario animation: standing) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $04:8DB0 LDA.W $1F15 ; A = Luigi's map pose [$1F15] W $04:8DBD STX.W $1F15 ; Luigi's pose = X $1F17 Player overworld X position word (little endian), one per player (index 0 Mario, 4 Luigi) Player's X position on the overworld map in pixels (low byte; $1F18 is the high byte). Set from the exit tables when leaving a level, at submap warps and when walking starts. Mario's walk code compares it with the destination ($0DC7 ) to know the signed distance left. Also read by the border icon, level-start and the overworld sprite helpers that home in on the player.
22 uses in 12 routines (18 read, 4 write) W $04:854D STA.W $1F17,X ; Player X position = destination X (low 9 bits) R $04:8633 LDA.W $1F17,X ; A = current player's map X ([$1F17], X = [$0DD6]: 0 Mario, 4 Luigi) W $04:8EC0 STA.W $1F17,Y ; Player map X = DATA_048E49[X] R $04:91EE LDA.W $1F17,X ; A = player X position R $04:932C LDA.W $1F17,X ; A = player X position R $04:93DD ADC.W $1F17,X ; Target position (first axis) = position + [$00]; stored in [$0DC7,X] R $04:93EB ADC.W $1F17,X ; Target position (second axis) = position + [$02] R $04:9479 SBC.W $1F17,Y ; [$00+X] = destination [$0DC7+Y] - current position [$1F17+Y] (signed distance left) R $04:9825 ADC.W $1F17,X ; Player position [$1F17+X] += whole pixels W $04:9A63 STA.W $1F17,X ; Player X position = destination X (DATA_0499AC) R $04:FF00 SBC.W $1F17,Y ; - player map X [$1F17,Y] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) $1F19 Player overworld Y position word (little endian), one per player (index 0 Mario, 4 Luigi) Player's Y position on the overworld map in pixels (low byte; $1F1A is the high byte). Set from the exit tables when leaving a level, at submap warps and when walking starts, and updated as Mario walks. Read by the overworld draw, level name, tile exit, and overworld sprite code (switch palace particles, chasing sprites). The intro code also writes $8E to it once (purpose unclear).
24 uses in 16 routines (18 read, 6 write) W $04:855A STA.W $1F19,X ; Player Y position = destination Y W $04:8EC6 STA.W $1F19,Y ; Player map Y = DATA_048E4F[X] R $04:91FA LDA.W $1F19,X ; A = player Y position R $04:9324 LDA.W $1F19,X ; A = player Y position W $04:98E2 STA.W $1F19 ; Mario Y position low [$1F19] += -1 + carry W $04:9A5D STA.W $1F19,X ; Player Y position = destination Y (DATA_0499AA) R $04:FF20 SBC.W $1F19,Y ; - player map Y [$1F19,Y] W $05:B15D STA.W $1F19 ; [$1F19] = $8E (probably a save/progress flag set when the intro ends) $1F1A Player overworld Y position high byte (high byte of the word at $1F19) High byte of Mario's overworld Y position ($1F19 is the low byte). The tile position routine adds $FF plus carry each other frame so Mario moves up one pixel every second frame during the intro walk. Read by the switch palace ! block particles and the overworld sprite that chases Mario.
4 uses in 3 routines (3 read, 1 write) R $04:98E6 ADC.W $1F1A ; Mario Y position high [$1F1A] += $FF + carry (so Mario moves up 1 pixel every second frame) $1F1F Player overworld tile X byte table, one per player (index X: 0 Mario, 4 Luigi) Column of the overworld tile (map16 position) the player is standing on. Written when Mario finishes a step along the path, when entering a level and when a tile's exit flag is set. Read with $1F21 (tile Y) to look up the level number table at $7ED000 and the tile data, and compared to find a warp tile.
11 uses in 7 routines (6 read, 5 write) W $04:91F7 STA.W $1F1F,X ; [$00] and [$1F1F,X] = tile column W $04:9607 STA.W $1F1F,X ; Player tile X = new tile X W $04:9920 STA.W $1F1F,X ; [$1F1F+X] = tile X $1F21 Player overworld tile Y byte table, one per player (index X: 0 Mario, 4 Luigi) Row of the overworld tile the player is standing on; partner of $1F1F (tile column). Written when the player steps onto a new tile, enters a level, warps submap, or a tile's exit flag is set. Used to index the OW tile and level-number tables and to find warp tiles.
11 uses in 7 routines (6 read, 5 write) W $04:9203 STA.W $1F21,X ; [$02] and [$1F21,X] = tile row R $04:958A LDA.W $1F21,X ; [$00] = player tile X, [$02] = player tile Y W $04:960C STA.W $1F21,X ; Player tile Y = new tile Y W $04:992C STA.W $1F21,X ; [$1F21+X] = tile Y $1F27 Switch palace pressed flags flag byte table, one per colour (index X) One byte for each colour switch (green, yellow, blue, red); non-zero once that switch has been hit. Mario's block collision sets it to 1 when a switch block's ! switch is pressed (and does nothing if it is already set). Level object code for the outline/solid switch blocks reads it to decide whether to draw the dotted outline (0) or the solid block.
Values: 0 = not pressed yet; 1 = pressed.
3 uses in 2 routines (2 read, 1 write) R $00:EEAE LDA.W $1F27,X ; A = switch active flag [$1F27 + X] W $00:EEB4 STA.W $1F27,X ; Activate the switch block R $0D:B58F LDA.W $1F27,X ; [$1F27+X] = switch pressed flag (0 = not yet) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 read) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (1 read, 1 read-modify-write) R $00:A0F6 LDA.W $1F2E ; A = number of exits cleared RW $04:EA1E INC.W $1F2E ; [$1F2E]++ (count of events triggered, probably) $1F2F Five Yoshi coins collected bits bit flags array, one bit per level Bit array of levels in which all 5 Yoshi coins were collected. Byte = translevel / 8 (index Y), bit = translevel AND 7 (mask table DATA_0DA8A6). Set by block interaction when the fifth Yoshi coin is taken; tested by the level object code to show the coin as already taken. Cleared at game start (mode 11).
4 uses in 3 routines (2 read, 2 write) W $00:9779 STZ.W $1F2F,X ; Clear [$1F2F+X] (overworld progress data, probably) W $00:F354 STA.W $1F2F,Y ; 5 Yoshi coins: set the level's flag in the bit array at [$1F2F + Y] $1F3C Invisible 1-up collected bits bit flags array, one bit per level Bit array of levels where the hidden 1-up block has been collected. Byte = translevel / 8 (index Y), bit = translevel AND 7. Set by block interaction when the 1-up is taken; tested when drawing single-tile extended level objects so a collected one does not reappear.
3 uses in 2 routines (2 read, 1 write) W $00:F2BB STA.W $1F3C,Y ; Set the level's flag in the bit array at [$1F3C + Y] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:9F08 STZ.W $1F48,X ; Clear a byte of $1F49-$1FD5 $1F49 Save data buffer byte array (working copy of the save file) Start of the working save data: a copy of the overworld/progress state, indexed by offset. Loaded from SRAM on file select, initialised for a new file, shown by the Continue/End menu, written back after a level, and copied to the live overworld state ($1EA2 onward) when the game starts. Each routine just copies the byte at offset X/Y.
5 uses in 5 routines (2 read, 3 write) R $00:9BDE LDA.W $1F49,Y ; A = byte of the save data at $1F49+Y W $00:9D18 STA.W $1F49,Y ; Copy to the working save data $1F49+Y W $00:9F16 STA.W $1F49,Y ; Save data[Y] = value R $00:A19A LDA.W $1F49,X ; A = save data byte at $1F49+X No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $1FB8 Save copy of player 1 submap byte table (save copy of $1F11-$1F26) Save buffer copy of the overworld player state starting at $1F11 (submaps, animations, positions). Initialised when a new file is created and, after a level, the current player's byte is copied to the other player's. Also written by the message trigger sprite (set to 1).
4 uses in 3 routines (1 read, 3 write) W $00:9F22 STA.W $1FB8,X ; Store at $1FB8+X (save data copy of $1F11-$1F26) W $04:8FD9 STA.W $1FB8,Y ; Save buffer: copy submap ($1FB8) to the other player No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $04:8FCB STA.W $1FBA,Y ; Save buffer: copy animation/facing ($1FBA) to the other player No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $04:8FAC STA.W $1FBE,Y ; Save buffer: copy player X position ($1FBE) to the other player No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $04:8FB2 STA.W $1FC0,Y ; Save buffer: copy player Y position ($1FC0) to the other player No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $04:8FB8 STA.W $1FC6,Y ; Save buffer: copy tile X position ($1FC6) to the other player No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $04:8FBE STA.W $1FC8,Y ; Save buffer: copy tile Y position ($1FC8) to the other player No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $1FE2 Sprite timer 7 byte table, one per sprite slot (index X) Extra countdown timer per sprite slot, counted down by the main sprite routine. Meaning depends on the sprite type; a non-zero value disables something for a few frames. Examples: kicked shell sets 5 (no cape contact), stunned sprites 8; Yoshi mount sets 2 (no-grab); Rex half-squash timer ($0C); Sumo Bro lightning $10 (skip ground check); Koopa Kid/Chuck contact or sound cooldown. Also tested by sprite-block interaction and the off-screen check. Cleared on spawn.
Values: 0 = timer expired / not running.
19 uses in 16 routines (8 read, 10 write, 1 read-modify-write) W $00:FCC2 STA.W $1FE2,X ; [$1FE2,X] = 4 (probably a Yoshi timer) R $01:91FB ORA.W $1FE2,X ; Return if [$166E] bit 6 (probably 'no splash') or timer [$1FE2] set W $01:95D8 STA.W $1FE2,X ; [$1FE2] = 8 (short timer) W $01:99CF STA.W $1FE2,X ; [$1FE2] = 5: disable cape contact for 5 frames R $01:D2CA LDA.W $1FE2,X ; Contact cooldown [$1FE2] W $01:D2D1 STA.W $1FE2,X ; Contact cooldown = 8 frames W $01:EDA0 STA.W $1FE2,X ; [$1FE2,X] = 2: no-grab timer W $02:A9D4 STA.W $1FE2,X ; [$1FE2,X] = 4 (purpose unclear) R $02:C4F3 LDA.W $1FE2,X ; [$1FE2] = sound cooldown W $02:C4FF STA.W $1FE2,X ; Cooldown [$1FE2] = $20 W $02:DDC1 STA.W $1FE2,X ; [$1FE2] = $10: probably frames before it may interact with the ground R $02:DEBC LDA.W $1FE2,X ; [$1FE2] = non-zero: skip the ground check R $03:9569 LDA.W $1FE2,X ; A = half-squash timer [$1FE2] W $03:95C3 STA.W $1FE2,X ; Half-squash timer [$1FE2] = $0C R $03:9688 LDA.W $1FE2,X ; A = half-squash timer [$1FE2] $1FEB Fireworks launch delay byte timer Used by the ending (Peach scene). Rocket spawning sets it to a delay value from a table before the next firework can launch, and the controller does nothing while it is non-zero. The ending picture routine also sets it to $80 (probably starts the credits).
3 uses in 2 routines (1 read, 2 write) W $03:AED4 STA.W $1FEB ; [$1FEB] = $80 (probably starts the credits) W $03:C802 STA.W $1FEB ; [$1FEB] = launch delay for this rocket $1FEE 3-up moon collected bits bit flags array, one bit per level Bit array of levels where the 3-up moon has been collected. Byte = translevel / 8 (index Y), bit = translevel AND 7. Set by block interaction when the moon is taken; tested when drawing the moon so it does not reappear. Cleared at game start (mode 11).
4 uses in 3 routines (2 read, 2 write) W $00:977F STZ.W $1FEE,X ; Clear [$1FEE+X] W $00:F325 STA.W $1FEE,Y ; Set the level's flag in the bit array at [$1FEE + Y] (moon collected) $1FFB Lightning flash step count counter Remaining steps of the lightning flash. The Bowser room palette routine reads it as the current step (0 = no flash running); the overworld sprite loop sets it from DATA_04F700 to start a flash. Part of the lightning flash state with $1FFC (delay) and $1FFD (frames per step).
6 uses in 2 routines (2 read, 2 write, 2 read-modify-write) R $03:DFDF LDX.W $1FFB ; X = [$1FFB] (lightning flash step, 0 = no flash running) W $03:E00D STA.W $1FFB ; [$1FFB] = DATA_04F700[X] (flash length in steps) RW $03:E020 DEC.W $1FFB ; Next step: [$1FFB]-- W $04:F72E STY.W $1FFB ; [$1FFB] = DATA_04F700[X]: number of flash steps RW $04:F740 DEC.W $1FFB ; [$1FFB]--: next flash step $1FFC Lightning flash delay timer Frames until the next lightning flash. Loaded from DATA_04F6F8[X] by the Bowser room palette routine and by the overworld sprite loop. See $1FFB (steps) and $1FFD (frames per step).
4 uses in 2 routines (2 write, 2 read-modify-write) W $03:E006 STA.W $1FFC ; [$1FFC] = DATA_04F6F8[X] (frames until the next flash) W $04:F728 STA.W $1FFC ; [$1FFC] = DATA_04F6F8[X]: delay until the next flash $1FFD Lightning flash step timer timer Frames left in the current lightning flash step. Set to 8 for the first step by the Bowser room palette routine and the overworld sprite loop; counted down by the same routines. See $1FFB (step) and $1FFC (delay to the next flash).
6 uses in 2 routines (4 write, 2 read-modify-write) W $03:E013 STA.W $1FFD ; [$1FFD] = 8 (frames for the first step) RW $03:E01B DEC.W $1FFD ; Step timer [$1FFD]-- W $03:E025 STA.W $1FFD ; [$1FFD] = 4 (frames per later step) W $04:F733 STA.W $1FFD ; [$1FFD] = 8: frames for the first step W $04:F745 STA.W $1FFD ; [$1FFD] = 4: frames per later step $1FFE Credits palette/background reload request flag byte During the credits, non-zero asks the NMI handler to reload the palette when switching backgrounds. The screen wipe update increments it to request the reload; the NMI tests it (only in the ending cutscene), and the credits background DMA routine clears it once the reload is done.
Values: 0 = nothing requested.
3 uses in 3 routines (1 read, 1 write, 1 read-modify-write) W $0C:95C2 STZ.W $1FFE ; [$1FFE] = 0: background reload request done RW $0C:AB59 INC.W $1FFE ; [$1FFE] += 1: request a palette reload No description written yet. The instructions below show how it is used.
2 uses in 1 routine (2 read) R $00:B8C5 LDA.L $7E2000,X ; A = bitplane 0/1 word of one row $7E:B900 Overworld sprite X high / particles byte table (index X) Probably the high byte of the X position of overworld sprites; the switch palace ! block particles store the player's overworld X high ($1F18 ) here. Also written by level load buffer init (cleared). Shares memory with the level buffers, so the meaning depends on game mode.
4 uses in 2 routines (1 read, 3 write) W $04:F2BD STA.L $7EB900,X ; Particle X position high ([$1F18+Y]) W $04:F3CD STA.L $7EB900,X ; Position high += delta high byte (+ carry) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F2CB STA.L $7EB928,X ; Particle Y position high ([$1F1A+Y]) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $04:F2D5 STA.L $7EB950,X ; Particle height (high) = 0 $7E:B978 Overworld sprite X low / particles byte table (index X) Low byte of an overworld particle's X position. The switch palace ! block particles set it to the player's overworld X ($1F17 ) when they are spawned.
3 uses in 1 routine (1 read, 2 write) W $04:F2B6 STA.L $7EB978,X ; Particle X position low = player X on the overworld ([$1F17+Y]) W $04:F3C3 STA.L $7EB978,X ; Position low += delta (+ carry from fraction) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F2C4 STA.L $7EB9A0,X ; Particle Y position low ([$1F19+Y]) No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $04:F2D1 STA.L $7EB9C8,X ; Particle height (low) = 0 $7E:B9F0 Overworld particle X speed byte table (index X), signed Horizontal speed of an overworld particle. The switch palace ! block particles set it from DATA_04F280[Y] so each particle flies in its own direction.
3 uses in 1 routine (2 read, 1 write) W $04:F2DE STA.L $7EB9F0,X ; Particle X speed = DATA_04F280[Y] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F2E5 STA.L $7EBA18,X ; Particle Y speed = DATA_04F288[Y] $7E:BA40 Overworld particle height speed byte table (index X), signed Vertical (height) speed of an overworld particle. The switch palace ! block particles set it to $D0, launching them upward, before gravity pulls them down.
3 uses in 1 routine (1 read, 2 write) W $04:F2EB STA.L $7EBA40,X ; Particle height speed = $D0 (launched upward) W $04:F33A STA.L $7EBA40,X ; Store the height speed No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) R $04:F3A6 ADC.L $7EBA68,X ; Add to the fractional position ($7EBA68+X) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $05:802C STA.L $7EBB00,X ; Fill $7EB900-$7EBCFF (layer 2 background tile low bytes) with $25 (blank tile) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $05:8052 STA.L $7EBD00,X ; Store Y (Map16 page) as every background tile's high byte No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $03:DF76 STA.L $7EC680,X ; Store the tile in the tilemap buffer No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $03:DF12 STA.L $7EC681 ; Top strip tiles 1-2 = DATA_03DEBF[X] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $03:DF1A STA.L $7EC683 ; Top strip tiles 3-4 = DATA_03DEC7[X] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $03:DF22 STA.L $7EC685 ; Top strip tiles 5-6 = DATA_03DECF[X] $7E:C800 Overworld layer 1 tile map byte array (tile number per map tile, index X) Overworld layer 1 map: one byte per 16x16 map tile, written by events and read for drawing and walking. Filled at load, edited by overworld events (path reveals, switch palace changes), read for walking. In levels the same RAM is the Map16 low byte buffer (written by Map16 setup, bridge breaking and boss room tile animation, which stores the empty tile $25).
11 uses in 10 routines (5 read, 6 write) W $00:9A23 STA.L $7EC800,X ; Tile at $7EC800+X W $00:9A41 STA.L $7EC800,X ; Tile at $7EC800+X W $03:D7A1 STA.L $7EC800,X ; Map16 tile low byte = $25 (empty tile) R $04:9027 LDA.L $7EC800,X ; A = overworld tile number at $7E:C800 + offset W $04:EA56 STA.L $7EC800,X ; Write it into the OW layer 1 map ($7E:C800) W $04:EDCC STA.L $7EC800,X ; Write the new tile into the layer 1 map at $7E:C800 + offset No description written yet. The instructions below show how it is used.
2 uses in 1 routine (2 write) W $00:9A27 STA.L $7EC9B0,X ; Same tile $01B0 further on W $00:9A45 STA.L $7EC9B0,X ; Same tile $01B0 further on No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $7E:D000 Overworld level number table byte array (index X, one per map tile) Level (translevel) number for each overworld map tile. Read by the level load, walking and exit code at the player's tile position to find which level is entered. Initialised by the Map16 and level buffer fill code (also the Map16 high byte buffer in levels).
12 uses in 8 routines (11 read, 1 write) R $05:D89B LDA.L $7ED000,X ; A = level number at the player's overworld position (table at $7E:D000) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $7E:D800 Overworld tile path flags byte array (index X, one per map tile) Per-tile byte tested bitwise by direction (shifted right by [$08 ]) when the player starts walking from a tile and when setting a level's exit flag. Probably marks which directions are open. Initialised by the level buffer fill routine. Written only at setup, read-only otherwise.
3 uses in 3 routines (2 read, 1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $05:82FC STA.L $7EE200,X ; Store A at X within each of the 28 pages $7EC800-$7EFFFF (stride $200) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:A050 STA.L $7EE300,X ; Clear a word at $7E:E300+X No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $04:DD15 STA.L $7EE400,X ; Top left 8x8 tile No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:DD25 STA.L $7EE402,X ; Top right tile (+2) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:DD1D STA.L $7EE440,X ; Bottom left tile (next tile row, +$40) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:DD2D STA.L $7EE442,X ; Bottom right tile (+$42) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $7F:0000 Overworld map attribute buffer byte array (index X) Attribute (palette/flip) byte for each overworld map tile. Filled by the layer 1 map page drawing (literal bytes) and read by the overworld event code when applying edits and fading tiles.
4 uses in 2 routines (2 read, 2 write) W $04:DD64 STA.L $7F0000,X ; Copy a literal byte W $04:DD79 STA.L $7F0000,X ; Store it at $7F:0000+X R $04:EAFB LDA.L $7F0000,X ; A = attribute byte from $7F:0000[X] R $04:EB03 LDA.L $7F0000,X ; A = attribute byte $7F:4000 Layer 2 tilemap buffer byte array (tile data, index X) Tilemap buffer for overworld layer 2 (and the credits backgrounds). Written by the interleaved map decompressor, by completed events on the layer 2 map, and by the credits code (top-left tile word, masked by [$65 ]). Write-only in these routines; DMA uploads it to VRAM.
7 uses in 3 routines (7 write) W $04:DAC9 STA.L $7F4000,X ; Copy literal byte to $7F:4000+X W $04:DADF STA.L $7F4000,X ; Store it at $7F:4000+X W $04:E4E0 STA.L $7F4000,X ; Copy tile number to the layer 2 tilemap W $04:E4E7 STA.L $7F4000,X ; Copy tile attributes W $04:E530 STA.L $7F4000,X ; Copy tile number to the layer 2 tilemap W $04:E537 STA.L $7F4000,X ; Copy tile attributes W $0C:951B STA.L $7F4000,X ; Tile word 0 (top-left), masked by [$65], to $7F:4000+X No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:952F STA.L $7F4002,X ; Tile word 2 (top-right) to $7F:4002+X No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:9525 STA.L $7F4040,X ; Tile word 1 (bottom-left) to $7F:4040+X (next tilemap row) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $0C:9539 STA.L $7F4042,X ; Tile word 3 (bottom-right) to $7F:4042+X No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:802A STA $7F8000 ; Start of RAM routine $7F8000: LDA #$F0 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:8037 STA $7F8002,X ; Write the STA opcode (the extra 00 is overwritten next) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:803C STA $7F8003,X ; Write the STA operand: address of this sprite's Y byte No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:804E STA $7F8182 ; End the RAM routine with RTL at $7F8182 $7F:837B Stripe image buffer write index word (little endian), index Offset of the end of the VRAM stripe image buffer at $7F837D: where the next record will be written. Every routine that queues text or tiles for VRAM (level name, message box, lives counter, tallies, credits text, events, bridge break, cage block) reads it, writes records at that offset, and saves the new end back. Cleared to 0 when the buffer is empty (it is flushed on NMI by the stripe uploader).
62 uses in 21 routines (37 read, 25 write) W $00:85EA STA.L $7F837B ; RAM buffer write index low ($7F:837B) = 0 W $00:8A69 STA.L $7F837B ; $7F:837B = 0: stripe image buffer write index R $00:9E96 LDA.L $7F837B ; A = stripe buffer write index W $00:9ED5 STA.L $7F837B ; Save it as the new buffer index ($7F:837B) W $00:C44E STA.L $7F837B ; Write index = X (past the new records) W $03:D7E5 STA.L $7F837B ; Stripe buffer index += $0C (two 6-byte records) R $04:9D07 LDA.L $7F837B ; A = stripe image buffer write index [$7F:837B] W $04:E75A STA.L $7F837B ; Save the new write index in $7F:837B R $04:E771 LDA.L $7F837B ; A = current write index into the stripe buffer R $04:E829 LDA.L $7F837B ; A = current write index into the stripe buffer W $04:EE73 STA.L $7F837B ; Update the stripe write index [$7F:837B] R $04:F598 ADC.L $7F837B ; Stripe write index += $51; X = new end W $05:B23D STA.L $7F837B ; Save the new write index of the stripe buffer R $05:CC98 ADC.L $7F837B ; X = Y + stripe buffer index [$7F:837B] R $05:CCCE ADC.L $7F837B ; X = stripe buffer index + 4 R $05:CD84 ADC.L $7F837B ; X = [$7F:837B] + $22: end offset of the 35-byte stripe template W $05:CDD1 STA.L $7F837B ; Advance the buffer write index [$7F:837B] by $22 + 1 = 35 bytes W $05:CE04 STA.L $7F837B,X ; Clear the tile number of this digit, keep the attribute byte W $05:CE29 STA.L $7F837B,X ; Digit tile number += 1 W $05:CFE2 STA.L $7F837B ; Stripe buffer write index [$7F:837B] = [$0A] W $05:DC32 STA.L $7F837B ; Stripe buffer write index [$7F:837B] = 8 (just before the end marker) W $0C:9EDD STA.L $7F837B ; Buffer index = X - 1 (on the $FF so the next record overwrites it) W $0C:9F3F STA.L $7F837B ; Save the new buffer write index R $0C:AE2B LDA.L $7F837B ; A = current length of the screen image buffer W $0C:AE42 STA.L $7F837B ; Store the new buffer length R $0C:D1D4 ADC.L $7F837B ; X = Y + [$7F837B] (current end of the upload buffer) W $0C:D1EB STA.L $7F837B ; Buffer index += $28 (the $FF terminator is overwritten next time) R $0C:D24A ADC.L $7F837B ; Advance the stripe image index by 12 bytes No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:85EE STA.L $7F837C ; RAM buffer write index high ($7F:837C) = 0 $7F:837D Stripe image buffer: VRAM address high byte, first byte of the stripe buffer (index X) Start of the VRAM stripe image buffer at $7F837D. Each record is: VRAM address high, VRAM address low, flags/length (word), then tile data; $FF as the first byte ends the buffer. Callers write the VRAM address high byte at [$7F837D+X], and $FF after the last record as the end marker. $FF at the first byte means the buffer is empty.
46 uses in 22 routines (46 write) W $00:85F3 STA.L $7F837D ; First byte of the RAM buffer = $FF (buffer empty) W $00:8A74 STA.L $7F837D ; $7F:837D = $FF: stripe image buffer starts with the end marker W $00:9980 STA.L $7F837D,X ; Stripe record 1 header at $7F:837D+X W $00:9A0A STA.L $7F837D,X ; Stripe image end marker in the buffer W $00:9D47 STA.L $7F837D,X ; Store in the RAM stripe buffer $7F:837D W $00:9EA8 STA.L $7F837D,X ; Write the VRAM address into the buffer W $00:9EDB STA.L $7F837D,X ; Terminate the stripe image W $00:C147 STA.L $7F837D,X ; Records 1 and 2: VRAM address high = [$06] W $00:C22B STA.L $7F837D,X ; Records 1 and 2: VRAM address high = [$06] W $00:C3C0 STA.L $7F837D,X ; End marker $FF after the last record W $00:C447 STA.L $7F837D,X ; End marker $FF after the last record W $03:D7B8 STA.L $7F837D,X ; Stripe record 1: VRAM address $5AC0 + [$01] (tile column), +$0400 if page 2 W $04:9D24 STA.L $7F837D,X ; Record VRAM address = $508B (BG3 tilemap, level name line) W $04:E755 STA.L $7F837D,X ; Terminate the stripe image with $FF W $04:E778 STA.L $7F837D,X ; Stripe record: VRAM address W $04:E79C STA.L $7F837D,X ; Store the record length W $04:E7AD STA.L $7F837D,X ; Store the tile in the stripe image W $04:E7D4 STA.L $7F837D,X ; Store the second stripe record: VRAM address W $04:E7DF STA.L $7F837D,X ; Store its length W $04:E830 STA.L $7F837D,X ; Stripe record: VRAM address W $04:E85C STA.L $7F837D,X ; Store the record length W $04:E86D STA.L $7F837D,X ; Store the tile in the stripe image W $04:E894 STA.L $7F837D,X ; Store the second stripe record: VRAM address W $04:E89F STA.L $7F837D,X ; Store its length W $04:EDE8 STA.L $7F837D,X ; Stripe record 1: VRAM address W $04:EE6E STA.L $7F837D,X ; Stripe end marker $FF after the new records W $04:EEE4 STA.L $7F837D,X ; Stripe record 1: VRAM address W $05:B1F2 STA.L $7F837D,X ; Stripe header: VRAM address W $05:B238 STA.L $7F837D,X ; Terminate the stripe image with $FF W $05:CCA0 STA.L $7F837D,X ; Copy a word of the image to the stripe buffer $7F:837D+X W $05:CD8C STA.L $7F837D,X ; ... into the stripe buffer at $7F:837D + X W $05:CF5C STA.L $7F837D,X ; ... into the stripe buffer W $0C:9EBF STA.L $7F837D,X ; Record VRAM address high = [$66] W $0C:9ECE STA.L $7F837D,X ; Copy the 5 byte blank row body (RLE fill with tile $FC, then $FF) W $0C:9F07 STA.L $7F837D,X ; Record VRAM address high = [$66] W $0C:9F18 STA.L $7F837D,X ; Length word high byte = 0 W $0C:9F29 STA.L $7F837D,X ; Copy one tile word (tile, attributes) to the stripe buffer W $0C:9F3A STA.L $7F837D,X ; Write the $FF end marker W $0C:D1DC STA.L $7F837D,X ; Copy to the stripe buffer at $7F837D W $0C:D26C STA.L $7F837D,X ; Patch first tile word in the entry from DATA_0CD1FD[Y] $7F:837E Stripe record VRAM address low byte, stripe record field (index X) Second byte of a stripe image record: low byte of the VRAM address the tile data is uploaded to. The previous byte, $7F837D+X, is the high byte.
7 uses in 3 routines (7 write) W $0C:9EC5 STA.L $7F837E,X ; Record VRAM address low = [$65] W $0C:9F10 STA.L $7F837E,X ; Record VRAM address low = [$65] + column W $0C:9F1E STA.L $7F837E,X ; Length word low byte = count - 1 $7F:837F Stripe record flags / length high byte, stripe record field (index X) Third byte of a stripe record: the high byte of the length word, together with flags (bit 6 = RLE, bit 7 = vertical). 0 means horizontal, no RLE. Callers also use it as the first data byte of the record ($7F8380 follows with the low length).
12 uses in 10 routines (12 write) W $00:999A STA.L $7F837F,X ; Record 1 size W $00:9D86 STA.L $7F837F,X ; Store the tens tile W $00:9EB5 STA.L $7F837F,X ; Write it into the buffer W $00:C15E STA.L $7F837F,X ; Records 1 and 2: flags = 0 (horizontal, no RLE) W $00:C240 STA.L $7F837F,X ; Records 1 and 2: flags = $80 (vertical increment) W $00:C375 STA.L $7F837F,X ; Flags = 0 (horizontal, no RLE) W $00:C41A STA.L $7F837F,X ; Flags = $40 (RLE) W $04:9D1D STA.L $7F837F,X ; Record length word = $0025: $26 bytes of tile data W $04:EDF7 STA.L $7F837F,X ; Record 1: length word W $04:EEFB STA.L $7F837F,X ; Record 1: length word W $05:B1F9 STA.L $7F837F,X ; Stripe header: length $24 bytes (18 tiles), no RLE $7F:8380 Stripe record length low byte, stripe record field (index X) Fourth byte of a stripe record: the low byte of the data length minus 1 (e.g. $03 = 4 bytes, 2 tiles;
$0B = 12 bytes, 6 tiles). Written with the rest of the record header before the tile data.
5 uses in 3 routines (5 write) W $00:C168 STA.L $7F8380,X ; Records 1 and 2: length $03 = 4 bytes (2 tiles) each W $00:C24A STA.L $7F8380,X ; Records 1 and 2: length $07 = 8 bytes (4 tiles) each W $00:C37B STA.L $7F8380,X ; Length $0B = 12 bytes (6 tiles) W $00:C420 STA.L $7F8380,X ; Length 6 = 7 bytes (probably an off-by-one: 3.5 tiles) $7F:8381 Stripe record tile data byte, first data byte of a stripe record (index X) First data byte of record 1: the tile number of the first tile ($7F8382 holds its attributes). Written by almost every stripe user for the first tile, and for the end marker $FF after the last record (level name, tally digits replaced by a blank tile $38FC).
17 uses in 13 routines (1 read, 16 write) W $00:99AC STA.L $7F8381,X ; Record 1 tile 0 W $00:9D7C STA.L $7F8381,X ; Store the ones tile W $00:9EC3 STA.L $7F8381,X ; Write the tile into the buffer W $00:C186 STA.L $7F8381,X ; Record 1, first tile = word 0 W $00:C268 STA.L $7F8381,X ; Record 1, tiles 1 and 3 = word 0 W $00:C3A6 STA.L $7F8381,X ; Copy one tile word into the record W $00:C429 STA.L $7F8381,X ; RLE data: tile $F8 with properties $18 (palette 6) W $04:9D78 STA.L $7F8381,X ; Stripe image end marker $FF after the name W $04:9D89 STA.L $7F8381,X ; Store the tile number (end bit cleared) W $04:EE01 STA.L $7F8381,X ; Record 1 data: top-left tile and attributes (word 0 of the entry) W $04:EF05 STA.L $7F8381,X ; Record 1 data: top-left tile W $05:B218 STA.L $7F8381,X ; Stripe data: tile number W $05:CF96 STA.L $7F8381,X ; Replace the zero digit with a blank tile ($38FC) $7F:8382 Stripe record first tile attributes byte, stripe record data (index X) Attribute byte (YXPCCCTT) of the first tile of a record, following the tile number at $7F8381. Commonly $39: palette 6, high priority, tile page 1 (level name, message box, lives counter, file select digits).
4 uses in 4 routines (4 write) W $00:9D90 STA.L $7F8382,X ; Set the properties of both digit tiles W $04:9D8F STA.L $7F8382,X ; Store the tile attributes $39 (palette 6, high priority) W $05:B21E STA.L $7F8382,X ; Stripe data: attributes $39 (palette 6, priority, tile page 1) W $05:DC2C STA.L $7F8382 ; First tile attributes = $39 $7F:8383 Stripe record second tile number byte, stripe record data (index X) Next data byte in a record after the first tile word: tile number of the second tile. Written by Map16 tile generation, boss room tile animation, bridge breaking, lives counter, events and cutscene code. File select overwrites the rest of the word with an empty tile.
9 uses in 8 routines (9 write) W $00:99B1 STA.L $7F8383,X ; Record 1 tile 1 W $00:9D9B STA.L $7F8383,X ; Overwrite the rest of the word EMPTY W $00:C280 STA.L $7F8383,X ; Record 1, tiles 2 and 4 = word 2 W $03:D7BF STA.L $7F8383,X ; Stripe record 2: VRAM address = record 1 + $20 (next tilemap row) W $0C:D273 STA.L $7F8383,X ; Patch second tile word (entry + 6) from DATA_0CD1FF[Y] No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $05:DC1E STA.L $7F8384 ; Second tile attributes = $39 $7F:8385 Stripe record 2 header / data byte, stripe record field (index X) Byte at offset 8 from the buffer start: start of a second stripe record when two records are queued (VRAM address of the second row). Used by the bridge break code (header $0240 = RLE, count 2), event tile drawing, and Map16 tile generation.
5 uses in 4 routines (5 write) W $03:D7CA STA.L $7F8385,X ; Both records: header $0240 = RLE, count - 1 = 2 (three tiles) W $04:EDF0 STA.L $7F8385,X ; Stripe record 2: VRAM address of the second row W $04:EEEC STA.L $7F8385,X ; Stripe record 2: VRAM address of the second row No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $7F:8387 Stripe image record 2 data (tile) byte/word in the stripe image buffer, indexed by buffer offset (X) Part of the VRAM stripe image buffer that starts at $7F837D ($7F837B holds the current write index). X is the buffer index of the record being built, so this is a fixed offset ($0A) into it, not a variable. Break bridge stores $38FC here (blank tile $FC, attributes $38) as the data of its second record. The Map16 page 1 / wings and event-tile routines write the second record's length word at this offset.
5 uses in 4 routines (5 write) W $03:D7D5 STA.L $7F8387,X ; Both records: data = tile $FC (blank), attributes $38 W $04:EDFB STA.L $7F8387,X ; Record 2: length word W $04:EEFF STA.L $7F8387,X ; Record 2: length word No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $7F:8389 Stripe image end marker (record 2) byte/word in the stripe image buffer, indexed by buffer offset (X) Offset in the stripe image buffer ($7F837D+X) where the two-record writers place the terminator. Break bridge stores $00FF, i.e. end-of-stripe marker $FF, right after the second record. The Map16 page 1 / wings routine and the event-tile routines write their own record data or marker at this same offset. The NMI stripe uploader stops when it reads $FF as a record header.
5 uses in 4 routines (5 write) W $03:D7DC STA.L $7F8389,X ; End of stripe image marker $FF No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $7F:838B Stripe image record 3 data byte/word in the stripe image buffer, indexed by buffer offset (X) Offset $0E into the stripe image buffer ($7F837D+X). Written by the event-tile and Map16 page 1 / wings routines as part of the record they build; never read back, the NMI stripe uploader consumes it. Exact contents depend on the routine's record layout.
4 uses in 3 routines (4 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) $7F:838D Stripe image end marker (late) byte in the stripe image buffer, indexed by buffer offset (X) Stripe image terminator. The Map16 page 1 / wings routine and the event-tile 2x2 draw routine store $FF here after their two records so the NMI stripe uploader knows where the batch ends. Written only; X is the buffer index taken from $7F837B.
3 uses in 2 routines (3 write) W $00:C172 STA.L $7F838D,X ; End marker $FF after the second record W $00:C274 STA.L $7F838D,X ; Record 2, tiles 1 and 3 = word 1 W $04:EE20 STA.L $7F838D,X ; Stripe end marker $FF after the two records No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $00:C28C STA.L $7F838F,X ; Record 2, tiles 2 and 4 = word 3 W $05:CFD1 STA.L $7F838F,X ; Tens digit, top tile No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $05:CFB8 STA.L $7F8391,X ; Ones digit, top tile No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $05:CDBE STA.L $7F8393,X ; Tens digit, bottom tile -> buffer + $16 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $00:C254 STA.L $7F8395,X ; End marker $FF after the second record W $05:CDA3 STA.L $7F8395,X ; Ones digit, bottom tile -> buffer + $18 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $05:CFD8 STA.L $7F8397,X ; Tens digit, bottom tile No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $05:CFBF STA.L $7F8399,X ; Ones digit, bottom tile No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $05:CDC5 STA.L $7F839B,X ; Tens digit, top tile -> buffer + $1E No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $05:CDAA STA.L $7F839D,X ; Ones digit, top tile -> buffer + $20 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F620 STA.L $7F839F,X ; Write tens digit No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F61B STA.L $7F83A1,X ; Write ones digit $7F:83AF Level end tally time digits byte table in the stripe image buffer, indexed by offset (X) Tile slots of the third text row of the level end tally, in the stripe image buffer ($7F837B index + $34). The tally routine copies the time digits [$0F31 +Y] into it, two bytes apart (tile, then attribute), then replaces leading zero digits with blank tile $FC so the time is not zero-padded. Read back once per digit for that leading-zero test.
3 uses in 1 routine (1 read, 2 write) W $05:CCD6 STA.L $7F83AF,X ; Copy time digit [$0F31+Y] into a tile slot of the third row W $05:CCEE STA.L $7F83AF,X ; Replace leading zero with blank tile $FC No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F5E5 STA.L $7F83B1,X ; Write into the stripe (left arrow top) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F5EC STA.L $7F83B3,X ; Write into the stripe No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F5F3 STA.L $7F83B9,X ; Write into the stripe No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F5FA STA.L $7F83BB,X ; Write into the stripe No description written yet. The instructions below show how it is used.
2 uses in 1 routine (1 read, 1 write) W $05:CD1C STA.L $7F83BD,X ; Replace leading zero with blank tile $38FC No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $00:99B8 STA.L $7F83C1,X ; Record 1 tile 2 (second row) W $04:F5B7 STA.L $7F83C1,X ; Erase Mario marker tile 1 No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $00:99BD STA.L $7F83C3,X ; Record 1 tile 3 W $04:F5BB STA.L $7F83C3,X ; Erase Mario marker tile 2 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F5C7 STA.L $7F83C9,X ; Erase Luigi marker tile 1 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:F5CB STA.L $7F83CB,X ; Erase Luigi marker tile 2 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:998A STA.L $7F8401,X ; Stripe record 2 header at $7F:8401+X No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:999E STA.L $7F8403,X ; Record 2 size No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:99C4 STA.L $7F8405,X ; Record 2 tile 0 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:99C9 STA.L $7F8407,X ; Record 2 tile 1 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:99CE STA.L $7F8445,X ; Record 2 tile 2 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:99D3 STA.L $7F8447,X ; Record 2 tile 3 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:9993 STA.L $7F8485,X ; Stripe record 3 header at $7F:8485+X No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:99A2 STA.L $7F8487,X ; Record 3 size No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:99DA STA.L $7F8489,X ; Record 3 tile 0 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:99DF STA.L $7F848B,X ; Record 3 tile 1 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:99E6 STA.L $7F84C9,X ; Record 3 tile 2 No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $00:99EB STA.L $7F84CB,X ; Record 3 tile 3 No description written yet. The instructions below show how it is used.
2 uses in 1 routine (2 write) W $00:A84A STA.L $7F977B,X ; Store to buffer at $7F:977B+X W $00:A85F STA.L $7F977B,X ; Store to buffer at $7F:977B+X $7F:C800 Map16 tile high byte table byte table (X = Map16 tile/block offset); high-byte companion of $7EC800 Second half of the level or overworld tile map: the high byte of each entry, with the low byte at $7EC800+X. Used for Map16 tile numbers and for the overworld tile layout. Cleared or initialised by the level buffer fill routine (Map16 tile pointers), set to 0 for a broken bridge tile, written by the boss room tile and overworld setup routines, and read by the layer 1 map page draw routine when it builds the tilemap buffer.
Values: 0 = high byte zero for the tile.
5 uses in 5 routines (1 read, 4 write) W $00:9A2B STA.L $7FC800,X ; Same tile in the high table $7FC800+X W $03:D7A7 STA.L $7FC800,X ; Map16 tile high byte = 0 W $04:D770 STA.L $7FC800,X ; Table 0: [$7F:C800 + X] = A No description written yet. The instructions below show how it is used.
2 uses in 2 routines (2 write) W $00:9A2F STA.L $7FC9B0,X ; Same in the high table $01B0 further on W $04:D774 STA.L $7FC9B0,X ; Table 1: [$7F:C9B0 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D778 STA.L $7FCB60,X ; Table 2: [$7F:CB60 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D77C STA.L $7FCD10,X ; Table 3: [$7F:CD10 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D780 STA.L $7FCEC0,X ; Table 4: [$7F:CEC0 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D784 STA.L $7FD070,X ; Table 5: [$7F:D070 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D788 STA.L $7FD220,X ; Table 6: [$7F:D220 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D78C STA.L $7FD3D0,X ; Table 7: [$7F:D3D0 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D790 STA.L $7FD580,X ; Table 8: [$7F:D580 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D794 STA.L $7FD730,X ; Table 9: [$7F:D730 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D798 STA.L $7FD8E0,X ; Table 10: [$7F:D8E0 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D79C STA.L $7FDA90,X ; Table 11: [$7F:DA90 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7A0 STA.L $7FDC40,X ; Table 12: [$7F:DC40 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7A4 STA.L $7FDDF0,X ; Table 13: [$7F:DDF0 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7A8 STA.L $7FDFA0,X ; Table 14: [$7F:DFA0 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7AC STA.L $7FE150,X ; Table 15: [$7F:E150 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $05:836E STA.L $7FE200,X ; Store A at X within each of the 28 pages $7FC800-$7FFFFF (stride $200) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7B0 STA.L $7FE300,X ; Table 16: [$7F:E300 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7B4 STA.L $7FE4B0,X ; Table 17: [$7F:E4B0 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7B8 STA.L $7FE660,X ; Table 18: [$7F:E660 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7BC STA.L $7FE810,X ; Table 19: [$7F:E810 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7C0 STA.L $7FE9C0,X ; Table 20: [$7F:E9C0 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7C4 STA.L $7FEB70,X ; Table 21: [$7F:EB70 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7C8 STA.L $7FED20,X ; Table 22: [$7F:ED20 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7CC STA.L $7FEED0,X ; Table 23: [$7F:EED0 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7D0 STA.L $7FF080,X ; Table 24: [$7F:F080 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7D4 STA.L $7FF230,X ; Table 25: [$7F:F230 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7D8 STA.L $7FF3E0,X ; Table 26: [$7F:F3E0 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7DC STA.L $7FF590,X ; Table 27: [$7F:F590 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7E0 STA.L $7FF740,X ; Table 28: [$7F:F740 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7E4 STA.L $7FF8F0,X ; Table 29: [$7F:F8F0 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) W $04:D7E8 STA.L $7FFAA0,X ; Table 30: [$7F:FAA0 + X] = A No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write) No description written yet. The instructions below show how it is used.
1 use in 1 routine (1 write)