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:

$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:8096 LDA [$00],Y
R $00:80B6 LDA [$00],Y ; A = block length
R $00:80BB LDA [$00],Y ; A = block destination address in SPC700 RAM
W $00:80EA STA $0000
W $00:80FF STA $0000
W $00:8110 STA $0000
W $00:814A STA $0000
W $00:815B STA $0000
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)
R $00:86EF LDA [$00],Y
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
R $00:8758 LDA [$00],Y
R $00:8764 ADC $00
R $00:8789 ADC $00
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
R $00:8B32 LDA $00
R $00:8B3C LDA $00
W $00:8E9A STA $00
R $00:8EA7 LDA $00
W $00:8EC9 STA $00
W $00:8EF7 STA $00
W $00:8F89 STZ $00
W $00:8FE2 STA $00 ; [$00] = count - 1: slot X shows a coin while [$00] is not negative
R $00:8FE8 LDA $00
RW $00:8FF2 DEC $00
R $00:9021 LDA $00
W $00:9030 STA $00 ; Value = difference
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)
R $00:90B9 ORA $00
W $00:91CA STA $00
R $00:91F5 LDA $00
W $00:9200 STA $00
W $00:9448 STA $00
R $00:9574 LDA [$00]
RW $00:9579 INC $00 ; [$00] += 2
RW $00:957B INC $00 ; (second INC of the 16-bit pointer)
W $00:9794 STA $00
W $00:97A7 STA $00
W $00:98EF STA $00 ; [$00] = bytes per update
R $00:9912 ADC $00 ; [$02] += [$00]
R $00:9916 LDA $00
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
RW $00:9D0C DEC $00 ; Count down
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
R $00:9DA8 LDA $00
W $00:9DAD STA $00 ; Save it
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:9FC0 STA $00
R $00:9FC9 ADC $00
R $00:A026 ADC $00
W $00:A033 STA $00 ; [$00] = it
W $00:A41C STZ $00 ; CGRAM address = $64 and offset [$00] = 0: animated palette color
R $00:A426 ADC $00
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
W $00:A51A STA $00 ; Store it in [$00]
R $00:A83A LDA $00
W $00:A840 STA $00
R $00:A848 LDA [$00] ; A = bitplanes 0 and 1 of one tile row
RW $00:A850 INC $00
RW $00:A852 INC $00 ; [$00] += 2
R $00:A85A LDA [$00]
RW $00:A865 INC $00 ; [$00]++
W $00:A87C STA $00 ; [$00] = $B3F0
R $00:A889 LDA [$00] ; A = bitplanes 0 and 1 of one tile row
RW $00:A890 INC $00
RW $00:A892 INC $00 ; [$00] += 2
R $00:A89A LDA [$00]
RW $00:A8A4 INC $00 ; [$00]++
W $00:A8B1 STA $00
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)
RW $00:AADA INC $00
RW $00:AADC INC $00 ; [$00] += 2
R $00:AAE3 LDA [$00]
R $00:AAEA LDA [$00]
RW $00:AAF7 INC $00 ; [$00]++
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)
RW $00:AB1A INC $00
RW $00:AB1C INC $00 ; [$00] += 2
R $00:AB23 LDA [$00]
R $00:AB2A LDA [$00]
RW $00:AB37 INC $00 ; [$00]++
R $00:AB50 LDA [$00],Y
R $00:AB6F LDA [$00],Y
R $00:AB93 LDA [$00],Y
W $00:AC08 STA $00
W $00:AC1F STA $00
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:AC56 STA $00
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:AC7F STA $00
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)
W $00:ACA8 STA $00
W $00:ACBF STA $00
W $00:ACD6 STA $00
R $00:AD03 LDA ($00) ; A = next color (BGR555) from the source at [$00]
RW $00:AD08 INC $00
RW $00:AD0A INC $00 ; [$00] += 2: next source color
W $00:AD32 STY $00 ; [$00] = base address of the palette sets
R $00:AD48 ADC $00
W $00:AD4A STA $00 ; [$00] += A: source = start of the chosen set
W $00:AD61 STA $00
W $00:AD78 STA $00
W $00:AD8F STA $00
W $00:ADAB STA $00
W $00:ADC2 STA $00
W $00:ADE7 STA $00
W $00:ADFE STA $00
W $00:AE2D STA $00
W $00:AF51 STA $00 ; [$00] = 7 colors per palette (colors 7 down to 1)
RW $00:AF65 DEC $00
W $00:B051 STA $00 ; [$00] = [$0D82]: pointer to the player's palette
R $00:B056 LDA [$00],Y
W $00:B06B STA $00 ; [$00] = 7 colors per palette
RW $00:B07F DEC $00
W $00:B896 STY $00
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
R $00:B970 LDA [$00],Y
W $00:B974 STA [$00],Y ; Append it to the output
W $00:BA3D STA $00
W $00:BEE0 STA $00
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
W $00:C348 STA $00
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
RW $00:C3AE DEC $00
W $00:C4E8 STA $00
W $00:CA79 STA $00 ; [$00] = Mario screen X + 8: iris center X
R $00:CAC1 ADC $00
R $00:CACA LDA $00
R $00:CAE9 ADC $00
R $00:CAF2 LDA $00
W $00:DA48 STY $00 ; [$00] = Y
R $00:DA53 ORA $00 ; A |= [$00]
W $00:E9E2 STA $00 ; [$00] = scroll speed
R $00:E9EC LDA $00
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
W $00:F496 STA $00
W $00:F4B6 STA $00
R $00:F4BE ORA $00 ; Row | column
W $00:F4C5 STA $00
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:F50A ORA $00 ; Row | column
W $00:F511 STA $00
W $00:F52B STA $00
R $00:F533 ORA $00 ; Row | column
W $00:F53A STA $00
W $00:F71F STA $00
W $00:F772 STA $00
W $00:F803 STA $00
W $00:F93F STA $00 ; [$00] = it
R $00:F948 CMP $00 ; Compare with [$00] (result used by CODE_00E9C8)
W $00:FA3B STA $00
W $00:FF3D STA $00
R $00:FF43 SBC $00 ; $22 = $30 - $00: BG3 X scroll follows the sprite
W $00:FF54 STA $00
R $00:FF5A SBC $00 ; $24 = $100 - $00: BG3 Y scroll follows the sprite
W $00:FF82 STA $00 ; $00 = sprite Y
R $00:FF88 SBC $00
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]
W $01:88B2 STA $00
W $01:89CE STA $00 ; [$00] = friction
R $01:89D9 ADC $00
R $01:89DC ADC $00
R $01:89DF SBC $00 ; A -= friction
W $01:8A46 STA $00 ; [$00] = friction
R $01:8A52 ADC $00
R $01:8A55 ADC $00
R $01:8A58 SBC $00 ; Speed -= friction (towards zero)
R $01:8E16 LDA $00
W $01:8ECC STA $00 ; [$00] = state & 3
R $01:8EE4 LDY $00 ; Y = state
W $01:906B STA $00
RW $01:906E ROR $00 ; $00 = speed / 2 again
R $01:9072 ADC $00
R $01:9353 LDA $00
W $01:945F STA $00 ; [$00] = clip Y rounded down to 16
R $01:9487 ORA $00
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
R $01:94FA ORA $00
W $01:94FC STA $00 ; [$00] |= block column
R $01:950E ADC $00 ; [$05] = pointer low + [$00]
W $01:974E STY $00
R $01:9754 LDA $00
W $01:9862 STA $00
R $01:9877 ADC $00
W $01:9953 STA $00
W $01:9B6C STA $00
R $01:9B7A LDA $00
R $01:9D21 LDA $00
R $01:9DA9 LDA $00
W $01:9E3E STA $00 ; [$00] = sprite X position low
R $01:9E54 LDA $00
W $01:9E5A STA $00
R $01:9E62 LDA $00
R $01:9F2D LDA $00
W $01:A09B STA $00 ; Same sign: copy Mario X speed to [$00], shift sign into carry
RW $01:A09D ASL $00
W $01:A0E5 STA $00
R $01:A0F7 LDA $00
W $01:A235 STA $00
RW $01:A3AF ROL $00 ; Shift the comparison carry into $00
RW $01:A3B7 LSR $00 ; Recover comparison carry into carry
W $01:A3D5 STA $00
W $01:A43F STA $00
R $01:A452 LDA $00
W $01:A472 STA $00
R $01:A49D LDA $00
W $01:A57C STA $00
R $01:A58C LDA $00
R $01:A5AC LDA $00
W $01:A6D9 STY $00 ; $00 = Y index
W $01:A79D STY $00 ; $00 = facing
R $01:A7AD LDY $00
RW $01:A8A0 ROL $00
RW $01:A8A5 LSR $00
W $01:AAE1 STA $00 ; [$00] = standing height
R $01:AAE6 SBC $00 ; Mario Y = sprite Y - [$00] (low byte)
RW $01:AC62 ROL $00
RW $01:AC69 LSR $00
W $01:AC72 STA $00
W $01:AC7A STA $00 ; Store result
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
RW $01:ACE0 LSR $00
W $01:ACE9 STA $00 ; Store result
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:AF64 LDA $00
W $01:B110 STA $00
R $01:B117 ORA $00 ; Sprite properties bit 0 = $00 (selects the tile page)
W $01:B184 STA $00 ; $00 = bubble Y low
W $01:B3A2 STY $00
R $01:B3B3 LDX $00
R $01:B3C6 LDX $00
R $01:B3D2 LDX $00
R $01:B424 LDA $00
R $01:B446 LDY $00
W $01:B461 STA $00
R $01:B468 CMP $00
R $01:B4D0 CMP $00
W $01:B597 STY $00
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
W $01:B5CD STY $00
R $01:B5D1 CMP $00 ; Sprite Y speed >= limit: skip
R $01:B5DD LDA $00
W $01:B603 STY $00
R $01:B60C ADC $00 ; Y speed += [$00]: platform dips as Mario jumps off
W $01:B631 STY $00 ; $00 = offset
R $01:B637 SBC $00 ; Sprite Y low -= [$00]
R $01:B66C LDA $00
W $01:B713 STZ $00
W $01:B723 STA.W $0000,Y
R $01:B75F SBC $00 ; Tile 2 X = center X - [$00]
R $01:B76D ADC $00 ; Tile 0 X = center X + [$00]
R $01:B7A1 LDA $00
W $01:B7B0 STA $00 ; Restore [$00]
W $01:B7C4 STA $00 ; $00 = sprite Y position low
R $01:B825 ADC $00
W $01:B88F STA $00 ; $00 = standing offset
R $01:B894 SBC $00
W $01:B8DA STA $00 ; $00 = [$0E] + $10: horizontal push distance
R $01:B8E7 LDA $00
W $01:B8EC STA $00 ; Yes: negate $00, push Mario to the left
R $01:B8F2 ADC $00
R $01:B8FF LDA $00
R $01:B90A SBC $00
R $01:B915 LDA $00
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
R $01:BB55 LDA $00
R $01:BB6A LDA $00
R $01:BB80 LDA $00
W $01:BC1F STA $00 ; $00 = Mario X low
R $01:BD08 LDA $00
W $01:BD0D STA $00 ; Screen X -= 4
R $01:BD1C LDA $00
R $01:BD42 LDA $00
R $01:BD68 LDA $00
R $01:BF5F LDA $00
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)
R $01:BFBC LDA $00
W $01:BFC1 STA $00
R $01:BFC6 LDA $00
W $01:BFD1 STA $00
W $01:C031 STZ $00 ; Byte counter $00 = 0
RW $01:C03F INC $00 ; Count it
R $01:C041 LDA $00
W $01:C0C4 STA $00 ; $00 = tape X low
R $01:C0D0 SBC $00
R $01:C135 LDA $00
R $01:C648 LDA $00
R $01:C672 LDA $00
R $01:C6B2 LDA $00
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:C90F STA $00
R $01:C96C ADC $00
W $01:CB3C STA $00 ; [$00] = angle + $80 (quarter turn: cosine)
W $01:CB5D STA $00 ; [$00] = radius X
W $01:CB86 STA $00 ; [$00] = radius Y
W $01:CBC5 STA $00 ; [$00] = radius Y
W $01:CBEE STA $00 ; [$00] = radius X
R $01:CC28 LDA $00
R $01:CC3F LDA $00
W $01:CCB3 STA $00 ; [$00] = tile row
R $01:CCBC ORA $00
W $01:CDC4 STA $00 ; [$00] = flip bit
R $01:CDD3 ADC $00 ; A += flip bit
W $01:D075 STA $00
R $01:D091 LDA $00
W $01:D3C7 STA $00 ; To [$00]
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:D5C7 STY $00 ; [$00] = Y offset
R $01:D5CD ADC $00 ; Add offset
W $01:D61A STZ $00 ; [$00] = 0 (Y high sign)
RW $01:D625 DEC $00 ; Negative: [$00] = $FF
R $01:D62F ADC $00 ; Add sign
W $01:D731 STA $00 ; [$00] = X offset
W $01:D80F STA $00
R $01:D81E LDA $00
R $01:D8B6 LDA $00
R $01:D94D LDA $00 ; Read Map16 tile at ($02,$00): [$1693] = tile number, Z = flag
W $01:DA53 STA $00 ; $00 = sprite Y low
R $01:DA5F SBC $00
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
R $01:DBA8 LDA $00
R $01:DC11 LDA $00
R $01:DC57 LDA $00
W $01:DC5C STA $00
R $01:DC85 LDA $00
W $01:DF21 STA $00 ; $00 = bounce height
R $01:DF52 SBC $00
W $01:DFDB STA $00 ; $00 = line counter, 7 down to 0
R $01:DFE1 LDA $00
R $01:DFE4 ADC $00
RW $01:E035 DEC $00
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:E0F3 LDA $00
R $01:E23D LDA $00
W $01:E664 STA $00 ; $00 = offset
R $01:E66F SBC $00 ; Mario Y position (low) = sprite Y - offset
R $01:E708 LDA $00
W $01:E8A7 STA $00 ; $00 = wobble offset
R $01:E8B8 SBC $00 ; Lakitu Y (low) = cloud Y - wobble offset
R $01:E8EB LDA $00
W $01:E99B STA $00 ; $00 = A
R $01:E99D LDY $00 ; Y = side of Mario
W $01:EE92 STA $00 ; $00 = tile number the head was drawn with (Yoshi GFX buffer tile)
R $01:EEAC LDA $00
W $01:F06A STA $00
R $01:F076 LDA $00
W $01:F181 STA $00 ; $00 = YoshiAbilityIndex[Y] * 4
R $01:F18F ORA $00
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:F4FB STA $00 ; $00 = Y offset $F8
R $01:F4FF LDA $00 ; A = Y offset
W $01:F543 STA $00 ; $00 = tongue tip X low
R $01:F5D1 LDA $00 ; Tongue tip X low
W $01:F701 STY $00 ; $00 = that side
R $01:F70A CMP $00 ; Compare with the side
W $01:F7B1 STA $00 ; $00 = flip bit
R $01:F7B8 ORA $00
W $01:F7CF STA $00 ; $00 = egg X low
R $01:F7F9 LDA $00
W $01:F85A STA $00 ; $00 = color bits
R $01:F861 ORA $00 ; Insert the saved color
W $01:FA61 STA $00 ; [$00] = X-flip bit from direction
R $01:FA77 EOR $00
W $01:FAFF STY $00 ; [$00] = side
R $01:FB07 CMP $00
W $01:FBA9 STY $00 ; [$00] = tilt step
R $01:FBDD LDY $00 ; Y = tilt step
W $01:FC8A STA $00 ; [$00] = [$14B8] - 8 (kid hitbox X)
W $02:80D5 STA $00
R $02:80ED LDA $00
W $02:80F3 STA $00
R $02:8109 LDA $00
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
RW $02:83BC INC $00
R $02:83BE LDA $00
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
R $02:8464 LDX $00
R $02:8481 LDA $00
W $02:8486 STA $00 ; $00 += $10: next 16-pixel segment
W $02:84C2 STA $00 ; $00 = splash timer
R $02:850A LDA $00
W $02:8532 STA $00 ; $00 = 4: spawn five particles
RW $02:858A DEC $00
W $02:85AB STA $00 ; $00 = (random AND mask) + base + Mario Y: random point on Mario's body
R $02:85CF LDA $00
W $02:8664 STA $00 ; $00 = A: parameter copied to each piece's [$1850]
R $02:86B5 LDA $00
W $02:8BB9 STZ $00 ; Side [$00] = 0
RW $02:8BBE INC $00 ; Side = 1: fall through for right puff
R $02:8BEE LDX $00 ; X = side
W $02:8C77 STA $00
R $02:8C8F LDA $00
W $02:8D08 STA $00
R $02:8D11 LDA $00
W $02:8D66 STZ $00 ; $00 = 0: X wobble offset
W $02:8D89 STA $00 ; $00 = X wobble offset
R $02:8D92 ADC $00
W $02:8FD0 STA $00
R $02:8FF4 LDA $00
W $02:9143 STA $00 ; $00 = offset
R $02:9149 SBC $00 ; Mario Y position = block Y - [$00] (stand on the block)
W $02:9241 STA $00
W $02:927B STA $00 ; $00 = (bounce Y low - 3) rounded to a tile row (high nibble)
R $02:92A0 ORA $00
W $02:92A2 STA $00 ; $00 = YYYYXXXX: tile row | tile column within the screen
R $02:92B3 ADC $00
W $02:92D2 STA $00 ; $00 = (bounce Y low - 3) rounded to a tile row (horizontal level)
R $02:92F3 ORA $00
W $02:92F5 STA $00 ; $00 = YYYYXXXX: tile row | tile column within the screen
R $02:9306 ADC $00
W $02:9555 STA $00
R $02:9584 ORA $00
W $02:9586 STA $00 ; $00 = YYYYXXXX: tile row | tile column within the screen
R $02:9597 ADC $00
W $02:95B7 STA $00
R $02:95E6 ORA $00
W $02:95E8 STA $00 ; $00 = YYYYXXXX: tile row | tile column within the screen
R $02:95F9 ADC $00
W $02:966F STA $00 ; $00 = bounce block X low + offset
W $02:969C STA $00 ; $00 = cape X low - 2
W $02:98FE STA $00 ; [$00] = smoke X
R $02:990D ADC $00 ; A = X + DATA_0298C2[X]
W $02:9A33 STA $00 ; [$00] = X on screen
R $02:9A44 LDA $00 ; A = X on screen
R $02:9A75 LDA $00
W $02:9B5A STA $00 ; [$00] = X on screen = ExSprite X low - [$1A]
R $02:9B76 LDA $00 ; A = X on screen
W $02:9BEE STZ $00 ; [$00] = 0: first (right) trail
RW $02:9BF3 INC $00 ; [$00] = 1: second (left) trail
R $02:9C14 LDX $00 ; X = which trail
W $02:9D1B STA $00
W $02:9DD1 STA $00
R $02:9DE9 LDA $00
R $02:9E17 LDA $00
W $02:9EA6 STA $00
R $02:9EAF LDA $00
W $02:9F44 STA $00
R $02:9F4D ADC $00 ; OAM X += wobble
W $02:A058 STA $00
R $02:A08A EOR $00
R $02:A194 EOR $00 ; OAM properties = DATA_02A167 EOR [$00]
W $02:A1AF STA $00
R $02:A1F2 EOR $00
W $02:A277 STA $00
R $02:A28A LDA $00
R $02:A330 EOR $00
W $02:A54D STA $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)
W $02:A650 STA $00
R $02:A661 ADC $00 ; $05 = low pointer + index
W $02:A683 STA $00 ; $00 = Y rounded down to 16
R $02:A68E LDA $00
R $02:A6B4 ORA $00 ; $00 = Y row | X column (Map16 index within a screen)
W $02:A6B6 STA $00
R $02:A6C7 ADC $00 ; $05 = low pointer + index
R $02:A70E LDA $00
W $02:A811 STA $00
W $02:A81F STA $00
R $02:A852 CMP $00 ; Skip if not at the target column ($00)
R $02:A909 LDA $00
R $02:A950 LDA $00
R $02:A968 LDA $00
R $02:AB59 LDA $00
R $02:ABBB LDA $00
R $02:ABD5 LDA $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:AC16 LDX $00
R $02:AF59 LDA $00 ; X position low from $00
R $02:AFC5 LDA $00 ; A = X position low from $00
W $02:B27B STA $00 ; $00 = stop slot
R $02:B283 CPX $00 ; Reached the stop slot?
W $02:B41A STA $00 ; [$00] = direction (for the arm below)
R $02:B45A LDX $00 ; X = direction
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
W $02:B85F STA $00
RW $02:B862 ROR $00 ; [$00] = hitting sprite X speed / 2 (sign kept)
R $02:B864 LDA $00
R $02:B90E LDA $00
R $02:B917 LDA $00
W $02:B96B STA $00
R $02:B977 LDA $00
R $02:BA0C LDA $00
R $02:BA59 LDA $00
R $02:BACA LDA $00
W $02:BB2C STA $00 ; [$00] = sprite X low
R $02:BB41 LDA $00
W $02:BB48 STA $00
R $02:BB51 LDA $00
R $02:BC24 LDA $00 ; A = on-screen X
R $02:BEC9 LDA $00
R $02:BEF7 LDA $00
W $02:BF08 STA $00 ; Restore [$00] and [$01]
R $02:BF23 LDA $00
R $02:BF86 LDA $00
W $02:C1B1 STA $00
R $02:C1C0 LDA $00
W $02:C480 STA $00
R $02:C49C LDA $00
R $02:C8AB LDA $00
W $02:C8AF STA $00
R $02:C8D9 ADC $00 ; OAM X = sprite X + offset
R $02:CA40 LDA $00
R $02:CA49 LDA $00
R $02:CAB8 LDA $00
R $02:CAC1 LDA $00
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
R $02:CB65 LDA $00
R $02:CBCA LDA $00
W $02:CC43 STA $00
R $02:CC55 LDA $00 ; A = cage X
R $02:CC74 LDA $00
W $02:CCC2 STA $00
R $02:CCD4 LDA $00
R $02:CD91 LDA $00
W $02:CE4F STA $00 ; [$00] = -[$151C]: negative amplitude
R $02:CE79 CMP $00
R $02:CE7E LDA $00
R $02:CF13 ADC $00 ; A = screen X + X offset
RW $02:D05C ROL $00 ; Rotate carry into [$00]
RW $02:D063 LSR $00 ; Restore carry
W $02:D06C STA $00 ; [$00] = signed distance
W $02:D074 STA $00 ; [$00] = result
R $02:D076 LDA $00 ; A = result
RW $02:D0A8 ROL $00 ; Rotate carry into [$00]
RW $02:D0B0 LSR $00 ; Restore carry
W $02:D0B9 STA $00 ; [$00] = signed distance
W $02:D0C1 STA $00 ; [$00] = result
R $02:D0C3 LDA $00 ; A = result
W $02:D0F1 STA $00
R $02:D11F ORA $00
W $02:D121 STA $00
R $02:D132 ADC $00
W $02:D153 STA $00 ; [$00] = (sprite Y + 8) rounded down to a 16 pixel boundary
R $02:D186 ORA $00
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
R $02:D2E9 LDA $00 ; A = speed
W $02:D334 STA $00 ; [$00] = 0 (result)
RW $02:D343 INC $00 ; Else remainder -= long distance, result++
R $02:D34D LDA $00
W $02:D352 STA $00
R $02:D357 LDA $00 ; A = Y speed
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:D3DD STA $00
W $02:D4B1 STA $00 ; [$00] = sprite X low
R $02:D4BD ADC $00 ; A += sprite X
R $02:D5EA LDA $00 ; A = sprite X on screen
W $02:D65B STA $00 ; [$00] = angle low
R $02:D65F LDA $00 ; A = angle
R $02:D66A LDA $00 ; A = angle
W $02:D6E0 STZ $00 ; [$00] = 0: high byte of X offset
RW $02:D6E6 DEC $00 ; [$00] = $FF: sign extend
R $02:D6FE ADC $00 ; + sign extension
R $02:D765 LDA $00 ; A = ball screen X ([$00] from the draw routine)
W $02:D776 STA $00
R $02:D7AF LDA $00 ; A = link X on screen
R $02:D7C3 LDA $00 ; A = link X on screen
W $02:D7CB STA $00 ; [$00] = distance
RW $02:D7CE ROR $00 ; [$00] = distance / 2 (arithmetic shift)
R $02:D7D0 LDA $00 ; A = half distance
W $02:D7D8 STA $00 ; [$00] = pivot X + half distance - screen X (second link)
R $02:D819 LDA $00 ; A = sprite X on screen
R $02:D84E LDA $00
R $02:D9FE LDA $00 ; A = screen X
W $02:DAB6 STY $00
R $02:DAE3 LDA $00
R $02:DB08 LDA $00
R $02:DC63 LDA $00
R $02:DE65 LDA $00
W $02:DF2E STA $00 ; $00 = sprite X (low)
R $02:DF51 LDA $00
W $02:E083 STA $00 ; Loop counter $00 = 3 (spawn four fire balls)
R $02:E0B1 LDX $00 ; X = fire ball number
RW $02:E0C0 DEC $00
W $02:E1C0 STA $00 ; Fire ball X speed = $F0 (to the left)
R $02:E1F2 LDA $00
W $02:E2B4 STA $00
R $02:E2BA ORA $00
R $02:E3C6 LDA $00
R $02:E581 LDA $00
R $02:E63D LDA $00
R $02:E685 LDA $00
R $02:E905 LDA $00
R $02:E9EF LDA $00
W $02:EA2B STA $00 ; [$00] = tile number the earlier draw code picked (baby Yoshi frame)
R $02:EA36 LDA $00
W $02:EB93 STZ $00 ; [$00] = 0: not accelerating yet
RW $02:EBA9 INC $00 ; [$00]++: marks that acceleration happened
R $02:EBBF LDY $00
W $02:EBDE STZ $00 ; [$00] = 0
R $02:ED62 LDA $00
W $02:ED91 STA $00 ; [$00] = 2: three skulls to spawn
R $02:EDAE LDX $00
RW $02:EDCB DEC $00
W $02:EE1D STZ $00 ; [$00] = 0
W $02:EE34 STA $00 ; [$00] = its contact flags
W $02:EEDD STA $00
R $02:EEEE LDA $00
R $02:EF45 LDA $00
W $02:F052 STA $00 ; Save the palette bits
R $02:F059 ORA $00
W $02:F204 STA $00 ; [$00] = sprite X low
R $02:F20D LDA $00
W $02:F226 STA $00 ; [$00] = 4: segment counter for contact check
RW $02:F2CB DEC $00
W $02:F48B STA $00 ; Save in [$00]
R $02:F497 SBC $00
R $02:F49E ADC $00
W $02:F5E2 STA $00 ; [$00] = tile X - scroll X (low)
R $02:F5ED LDA $00 ; A = tile X
W $02:F69A STA $00 ; [$00] = vertical offset of the tile block (0-$30 pixels, bigger = higher)
R $02:F6CB SBC $00
W $02:F783 STA $00 ; [$00] = $B8 - [RAM_ScreenBndryXLo]: block X on screen
R $02:F79D LDA $00
R $02:F7D0 LDA $00
W $02:F868 STA $00
W $02:F879 STA $00
R $02:F880 LDA $00
W $02:F8A3 STA $00 ; [$00] = slot * 4 + [RAM_FrameCounterB] (staggers the slots)
R $02:F8AB LDA $00
R $02:F968 LDA $00
W $02:FAAD STZ $00
RW $02:FAB1 DEC $00 ; [$00] = sign extension of the signed speed
R $02:FABD ADC $00
W $02:FAC7 STA $00
R $02:FAD0 LDA $00
W $02:FAFD STA $00 ; [$00] = ring angle low + Boo angle offset low ([DATA_02FA84+X])
R $02:FB0C LDA $00
R $02:FB17 LDA $00
W $02:FB7F STZ $00
RW $02:FB85 DEC $00 ; [$00] = sign extension of the X offset
R $02:FB91 ADC $00
W $02:FBF0 STZ $00
R $02:FBFA ADC $00
R $02:FC32 LDA $00
W $02:FC90 STA $00
R $02:FC99 LDA $00
W $02:FD24 STZ $00
RW $02:FD34 DEC $00 ; Bob direction from bit 6 of (slot * 8 + frame): Y = +1, or -1 with [$00] = $FF
R $02:FD3E LDA $00
W $02:FD66 STA $00 ; [$00] = animation frame, toggles every 8 frames
R $02:FD6C ADC $00
W $02:FDA1 STA $00 ; [$00] = bat wing frame, toggles every 4 frames
R $02:FDA7 ORA $00
W $02:FE29 STA $00 ; [$00] = hit height
R $02:FE34 CMP $00
W $02:FE7E STA $00
R $02:FE8A SBC $00
RW $02:FEEF ROL $00
RW $02:FEF7 LSR $00
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
R $02:FF0A LDA $00
RW $02:FF2E ROL $00
RW $02:FF37 LSR $00
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
R $02:FF4A LDA $00
W $03:824F STZ $00 ; [$00] = 0: byte counter
RW $03:825D INC $00 ; [$00]++
R $03:825F LDA $00
R $03:8406 ADC $00
R $03:8498 LDA $00
R $03:85C6 LDA $00
R $03:86C2 LDA $00
R $03:8740 LDA $00
W $03:8748 STA $00 ; Next tile X += $10
R $03:8862 LDA $00
W $03:89BD STA $00 ; [$00] = |X speed|
R $03:89C4 LDY $00 ; Y = |X speed| (stick to slope)
W $03:8A0B STA $00
R $03:8A29 ADC $00
W $03:8AEB STA $00
R $03:8AF7 LDA $00
R $03:8B5F LDA $00
W $03:8C9B STA $00
R $03:8CA3 CMP $00
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:8CE9 STA $00
R $03:8D34 LDA $00
R $03:8E2E LDA $00
R $03:8EBA LDA $00
R $03:8F39 LDA $00
W $03:8F93 STA $00
R $03:8F99 ORA $00
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)
R $03:91DC LDA $00
R $03:94E7 LDA $00
R $03:96B0 LDA $00
R $03:97CB LDA $00
W $03:9832 STA $00
RW $03:9841 INC $00 ; ...$0B -= $0D and $00++
R $03:984B LDA $00
W $03:9850 STA $00
R $03:9855 LDA $00 ; A = $00
W $03:9860 STA $00
W $03:9924 STA $00
R $03:9931 LDA $00
W $03:9937 STA $00
R $03:9942 LDA $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:99C0 ADC $00 ; Add sign extension
R $03:9B46 LDA $00 ; A = aimed Y speed
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
R $03:A0C3 LDA $00
R $03:A3FF LDA $00
W $03:AA76 STA $00
R $03:AA8D LDA $00
R $03:AAD7 LDA $00
W $03:AC9C STA $00 ; [$00] = Peach screen X position
W $03:AD7D STZ $00
RW $03:AD86 DEC $00
R $03:AD91 ADC $00
W $03:AEEE STA $00
R $03:AEF4 LDA $00
R $03:AEFB ORA $00
W $03:AEFD STA $00 ; [$00] = v | v<<5
R $03:AF04 ORA $00
W $03:AF06 STA $00 ; [$00] = v | v<<5 | v<<10 (grey color value v)
R $03:AF19 LDA $00
R $03:AF7B LDA $00
R $03:AFB9 ADC $00 ; Add [$00] plus $15 with direction-based offset
W $03:B047 STA $00 ; [$00] = Bowser X low
R $03:B051 LDA $00
R $03:B22C LDA $00
R $03:B3B2 LDA $00
R $03:B411 LDA $00
W $03:B66A STA $00
W $03:B6FC STA $00
R $03:B72E LDA $00,X
R $03:B747 SBC $00,X
RW $03:B7A3 ROL $00 ; Keep the carry in $00
RW $03:B7AB LSR $00
W $03:B7C5 STA $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
R $03:B8A8 LDA $00 ; A = [$00]
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
R $03:B8F5 LDA $00 ; A = [$00]
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
R $03:C286 LDA $00
R $03:C414 LDA $00
R $03:C979 LDA $00
W $03:CA1E STA $00
R $03:CA32 LDA $00
R $03:CA48 LDY $00
W $03:CAED STA $00
R $03:CB01 LDA $00
R $03:CB17 LDY $00
W $03:CBDC STA $00 ; $00 = spawner X high
R $03:CBED LDA $00
W $03:CDDC STA $00
R $03:CDE5 ORA $00
R $03:D4A9 LDA $00
R $03:D4EE LDA $00
W $03:D798 STX $00 ; $00 = tilemap page offset (0 or 4)
R $03:D7B6 ADC $00
W $03:D986 STA $00
R $03:D99C LDA $00
R $03:D9C9 LDA $00
W $03:D9CE STA $00
W $03:DDA7 STA $00
R $03:DDB2 LDA [$00],Y
R $03:DE2E LDA $00
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)
R $03:DE9C LDA $00
W $03:DEA2 STA $00
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:DF65 LDA $00
R $03:DF85 ADC $00 ; A = saved table offset + row width: next row
W $03:E040 STA $00 ; Byte counter = $0E (colors 1-7)
RW $03:E04B DEC $00
W $04:8091 STA $00
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)
RW $04:80F2 ASL $00
RW $04:80F9 LSR $00
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)
R $04:8188 LDA $00
W $04:818F STA $00 ; Carry this row to the next
W $04:82BB STA $00
W $04:8511 STZ $00 ; [$00] = 0
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
R $04:85F3 LDA $00
W $04:85FB STA $00
W $04:861C STA $00 ; [$00] = $18: X back to the left edge
W $04:863E STA $00
R $04:867C LDA $00
W $04:8681 STA $00
R $04:869C LDA $00
W $04:896C STA $00
R $04:8974 ADC $00 ; Y = pose offset + animation frame * 8 (frame advances every 8 frames)
R $04:8986 LDA $00
W $04:8CF3 STA $00
R $04:8CFC ADC $00 ; Y = pose offset + 0 or $10 (2 frames, switching every 8 frames)
W $04:8DFC STA $00
W $04:8E68 STA $00 ; [$00] = player's tile column ([$1F1F])
W $04:8E76 STZ $00 ; [$00] = 0
W $04:8E86 STA $00 ; [$00] = level name data for that translevel (LevelNames)
W $04:8F1F STA $00
W $04:9011 STA $00 ; [$00] = tile column
W $04:91F5 STA $00
R $04:92CF LDA $00,X
W $04:92D5 STA $00,X
W $04:9310 STA $00 ; [$00] = level number
R $04:9349 CMP $00
W $04:934D STX $00 ; [$00] = path index
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
W $04:93C7 STX $00 ; [$00] = +8 or -8
R $04:93DA LDA $00
W $04:93F8 STA $00 ; [$00] = direction
R $04:9400 ORA $00 ; Add the facing direction
W $04:947C STA $00,X
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:953E STZ $00 ; [$00] = 0
W $04:954E STA $00 ; [$00] = name index
W $04:9588 STA $00
R $04:959A LDA $00,X
W $04:95A0 STA $00,X
R $04:9605 LDA $00
W $04:96ED STA $00
R $04:96F8 CMP $00
W $04:9728 STA $00 ; [$00] = movement offset ([$00] = dx, [$01] = dy)
R $04:9759 LDA $00
W $04:975E STA $00
R $04:977E LDA $00,X
R $04:97A0 LDA $00
R $04:97DA LDA $00
W $04:9847 STA $00 ; [$00] = player X position
R $04:985E LDA $00,X
R $04:9885 LDA $00
R $04:988C LDA $00
W $04:991E STA $00
R $04:9D3F LDA $00
R $04:9D5A LDA $00
W $04:9E80 STA $00
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
RW $04:D847 INC $00 ; Next level number
R $04:DABE LDA [$00],Y
R $04:DAC7 LDA [$00],Y
R $04:DADD LDA [$00],Y ; Fetch the byte to repeat
W $04:DB65 STA $00 ; Store it
R $04:DB7A CPX $00
W $04:DC3D STA $00 ; [$00] = $D000
R $04:DC42 LDA $00
R $04:DC47 LDA $00
W $04:DC4D STA $00 ; Next tile definition: [$00] += 8
W $04:DC74 STA $00 ; [$00] = $A533
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:DCFE LDA $00
RW $04:DD33 INC $00 ; Next tile
R $04:DD35 LDA $00
W $04:E4D3 STA $00 ; [$00] = 1: 2 rows
RW $04:E51B DEC $00
W $04:E523 STA $00 ; [$00] = 5: 6 rows
RW $04:E56B DEC $00
W $04:E713 STA $00 ; [$00] = map offset
R $04:E720 LDA $00 ; A = map offset
R $04:E72C LDA $00 ; A = map offset
R $04:E7A7 LDY $00 ; Y = offset into the source tilemap
R $04:E7F3 LDA $00 ; A = source offset
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
R $04:E8B3 LDA $00 ; A = source offset
W $04:E8BA STA $00 ; [$00] = source offset
W $04:E8C9 STA $00 ; [$00] = source offset
W $04:EA35 STA $00 ; [$00] = value
R $04:EA46 LDY $00 ; Y = [$00] (source index)
R $04:EA54 LDA $00 ; A = tile number
R $04:EAEB LDA $00 ; A = X position
R $04:EC34 LDA $00 ; A = effect X
W $04:EC6D STA $00 ; [$00] = screen X
W $04:EDBB STA $00
R $04:EDE6 LDA $00 ; A = VRAM address (first tile row)
W $04:EE42 STA $00 ; [$00] = that word
W $04:EECC STA $00 ; [$00] = DATA_04E587[X]: VRAM address of the first block row
R $04:EEE2 LDA $00 ; A = VRAM address
W $04:EEF6 STA $00
W $04:F2AB STA $00 ; [$00] = 7: eight particles per batch
R $04:F2D9 LDY $00 ; Y = [$00]: direction index 0-7
RW $04:F2F0 DEC $00 ; Next direction
R $04:F35B LDA $00
W $04:F3DD STA.W $0000,Y ; Store in [$00,$02,$04] by Y
W $04:F7B9 STX $00 ; [$00] = X: outer loop counter
R $04:F7BD LDX $00
R $04:F7E1 LDY $00
R $04:F7F0 LDX $00
W $04:F882 STA $00 ; [$00] = hide mask (the lightning code enters here with its own mask)
R $04:F89F AND $00
R $04:F8EA LDA $00
W $04:F8F0 STA $00
R $04:F94F EOR $00
R $04:FA13 ADC $00
W $04:FA15 STA $00
R $04:FADF LDA $00
W $04:FAE5 STA $00
R $04:FB15 LDA $00
R $04:FB49 LDA $00
R $04:FB6B LDA $00
W $04:FB71 STA $00
R $04:FCA5 LDA $00
W $04:FCAB STA $00
R $04:FCFC LDA $00
W $04:FD01 STA $00 ; [$00] -= 8: next tile to the left
R $04:FD93 LDA $00 ; A = screen X [$00]
W $04:FD99 STA $00 ; Store screen X
W $04:FDB7 STA $00 ; [$00] = counter; masks the acceleration steps below
R $04:FDD9 AND $00 ; AND the phase counter [$00]
R $04:FE1F LDA $00 ; A = screen X [$00]
W $04:FE25 STA $00 ; Store screen X
R $04:FE36 LDA $00
W $04:FE3C STA $00 ; Store screen X
W $04:FE8A STA.W $0000,Y ; Store screen-relative position in [$00,Y]
W $04:FF03 STA $00 ; [$00] = dx
W $04:FF98 STA $00,X ; Store speed in [$00,X] ($00 X, $02 Y, $04 Z)
R $04:FFA1 LDA $00 ; A = X speed
W $05:80E6 STA $00 ; [$00] = 7: loop counter (8 tiles, $133-$13A)
RW $05:80F5 DEC $00
W $05:81A0 STA $00 ; [$00] = $9100: base for the default Map16 pointer table
R $05:81A5 LDA $00 ; A = [$00]
R $05:81AA LDA $00
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])
R $05:8255 LDA $00
R $05:825A LDA $00
W $05:8260 STA $00 ; [$00] += 8
W $05:8298 STA $00 ; [$00] = $8A70: data for these tiles
R $05:829D LDA $00 ; A = [$00]
W $05:82A6 STA $00 ; [$00] += 8
R $05:82B5 LDA $00 ; A = [$00] (continues after $1C7's data)
W $05:82BE STA $00 ; [$00] += 8
W $05:8541 STA $00 ; [$00] = byte 3
R $05:8566 LDA $00
W $05:8575 STA $00 ; [$00] = byte 4
R $05:8590 LDA $00 ; A = byte 4
R $05:8597 LDA $00 ; A = byte 4
W $05:85E6 STA $00 ; [$00] = low nibble of [$0A]
R $05:85FA ORA $00
W $05:8678 STA $00 ; [$00] = low byte of the screen address table for this level mode
R $05:86A1 LDA [$00],Y
R $05:86AA LDA [$00],Y
R $05:86B3 LDA [$00],Y
W $05:87B5 STA $00 ; [$00] = 7: loop counter (8 entries)
RW $05:87C4 DEC $00 ; Count down the 8 entries
W $05:8A1F STA $00
R $05:8A23 ADC $00 ; Y = screen number * 3, screen = ([$45+X] & $01F0) >> 4
W $05:8A5C STA $00
R $05:8A62 LDA $00
W $05:8AD6 STA $00
R $05:8ADE ORA $00 ; $1BE4 = VRAM address high byte: $20 (or $28 if bit 4 of [$45+X]) | ([$45+X] >> 2) & 3
W $05:8AFB STA $00
R $05:8AFF ADC $00 ; Y = screen number * 3, screen = ([$45+X] & $01F0) >> 4
W $05:8B3C STA $00
R $05:8B42 LDA $00
W $05:8BED STA $00
R $05:8BF1 ADC $00 ; Y = screen number * 3, screen = ([$49+X] & $01F0) >> 4
W $05:8C2A STA $00
R $05:8C30 LDA $00
W $05:8CBB STA $00
R $05:8CC3 ORA $00 ; $1CE6 = VRAM address high byte: $30 (or $38 if bit 4 of [$49+X]) | ([$49+X] >> 2) & 3
W $05:8CE0 STA $00
R $05:8CE4 ADC $00 ; Y = screen number * 3, screen = ([$49+X] & $01F0) >> 4
W $05:8D21 STA $00
R $05:8D27 LDA $00
W $05:8DE0 STA $00
R $05:8DE6 LDA $00
W $05:B1E3 STA $00 ; [$00] = text offset
R $05:B206 LDY $00 ; Y = 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
R $05:B2FF LDX $00
RW $05:B30A INC $00
RW $05:B30C INC $00 ; [$00] += 2
W $05:B330 STA $00 ; [$00] = number of coins to add
R $05:B33F SBC $00 ; A = [$0DC0] - coins added
W $05:BB40 STA $00
R $05:BB43 ADC $00 ; Y = frame * 3 (first of the three animation slots)
W $05:BB51 STA $00
R $05:BB90 ORA $00 ; Add the frame offset: A = byte offset in AnimatedTileData
W $05:BE16 STA $00 ; [$00] = A
R $05:BE1D LDA $00 ; A = [$00]
W $05:C07F STA $00 ; [$00] = layer X position
R $05:C09D SBC $00 ; [$00] = target X - layer X position (signed distance)
W $05:C09F STA $00
R $05:C167 BIT $00,X ; Test the sign of this axis' distance [$00+X]
W $05:C225 STA $00
R $05:C239 LDA $00
W $05:C23F STA $00
R $05:C244 LDA $00
W $05:C484 STA $00
R $05:C489 ADC $00 ; BG3 X [$22] += [$00]: BG3 also follows layer 1
W $05:C558 STA $00
R $05:C571 LDA $00
W $05:C577 STA $00
R $05:C57C LDA $00
W $05:C5F4 STA $00
R $05:C60D LDA $00
W $05:C613 STA $00
R $05:C618 LDA $00
W $05:C81E STZ $00
W $05:C823 STY $00
RW $05:C84E DEC $00
W $05:CD00 STZ $00 ; [$00] = 0
R $05:CE12 LDA $00
W $05:CE22 STA $00 ; Keep the subtraction result as the new value
W $05:CE56 STA $00 ; [$00] = hundreds value
R $05:CE63 ADC $00
W $05:CE65 STA $00 ; [$00] += tens value
R $05:CE6E ADC $00
W $05:CE70 STA $00 ; [$00] = timer value (0..999)
R $05:CE74 LDA $00
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
R $05:CF9C CPX $00
W $05:D7ED STA $00 ; [$00] = secondary exit start position byte ($05FA00[Y])
R $05:D7FE LDA $00
R $05:D80D LDA $00
W $05:D856 STA $00
R $05:D86E ORA $00 ; [$00] |= (tile X & $10) << 4: bit 4 of X becomes bit 8
W $05:D870 STA $00
R $05:D87F ORA $00 ; X = index into the overworld level map: Y bit 4 becomes bit 9
W $05:DAAA STX $00
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
R $0C:94AB LDA $00
R $0C:94B0 LDA $00
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)
R $0C:9505 LDA $00
RW $0C:953D INC $00 ; Next Map16: [$00]++
W $0C:9EFF STA $00 ; [$00] = byte count - 1
R $0C:9F1C LDA $00
RW $0C:9F31 DEC $00
RW $0C:9F33 DEC $00
W $0C:9F76 STA $00,X ; Work copy [$00] = BG2 H-scroll [$1E]
R $0C:9F7B LDA $00,X
W $0C:9F90 STA $00,X
R $0C:9F97 LDA $00,X
R $0C:9FE2 ADC $00,X
W $0C:9FE4 STA $00,X ; Position [$00,X] += pixels
W $0C:A01F STA $00
W $0C:A0E5 STA $00
R $0C:A101 LDA $00
R $0C:A11A LDA $00
W $0C:A11F STA $00 ; X += $10: next column
W $0C:A127 STA $00 ; X back to the left edge
W $0C:A14F STZ $00
R $0C:A15B LDA $00
W $0C:A161 STA $00
W $0C:A176 STA $00 ; $00 = $02 = $0080 - [$04] - $0040: X position of the second banner half
R $0C:A192 LDA $00
R $0C:A1AD LDA $00
W $0C:A1B3 STA $00 ; X position += $0010: next tile column
W $0C:A1C0 STA $00
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:A2C6 STA $00
R $0C:A2CF LDA $00
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:A67A STA $00
W $0C:A6D9 STA $00
W $0C:A6F1 STA $00
R $0C:A844 LDA $00
W $0C:A8EE STA $00 ; $00 = slot X position
R $0C:A8F7 LDA $00
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:AA27 LDA $00
W $0C:ABE1 STA $00
R $0C:ABF1 ADC $00 ; $00 = $B0B0 + [DATA_0CAB9C+[DATA_0CABAB+Y]]: source palette block
W $0C:ABF3 STA $00
R $0C:AC06 LDA [$00]
RW $0C:AC0B INC $00
RW $0C:AC0D INC $00
W $0C:AE1B STA.W $0000 ; [$00] = pointer low
R $0C:AE32 LDA [$00],Y
W $0C:B5CA STY $00 ; [$00] = priority bits to merge into each sprite's properties
R $0C:B622 ORA $00
W $0C:C964 STA $00 ; [$00] = (cutscene number - 1) * 8
R $0C:C970 ORA $00
W $0C:C972 STA $00 ; [$00] += text line index = [$1443] bits 7-5
R $0C:C976 ADC $00
W $0C:CA5D STA $00
W $0C:CAF7 STA $00
R $0C:CAFD LDA $00
W $0C:CB8A STX $00 ; [$00] = X of the next sprite in the row
R $0C:CB92 LDA $00
R $0C:CBB5 LDA $00
W $0C:CBBA STA $00 ; Next sprite X = X + $10
W $0C:CBFE STA $00
R $0C:CC08 LDA $00
R $0C:CC29 LDA $00
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
R $0C:CCED LDA $00
R $0C:CD04 LDA $00
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:CE5C STA $00
R $0C:CE71 LDA $00 ; A = X position
R $0C:CE92 LDA $00
W $0C:CE97 STA $00 ; [$00] += $10: next tile to the right
W $0C:CF94 STA $00 ; X position = $A8
W $0C:D054 STX $00
W $0C:D072 STA $00 ; $00, $02 = Mario X + $10
R $0C:D07D LDA $00
R $0C:D09C LDA $00
W $0C:D0A1 STA $00 ; [$00] += 8: next piece to the right
W $0C:D0AA STA $00
W $0C:D257 STA $00
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
RW $0C:D4EE DEC $00 ; Next sprite
W $0C:D523 STX $00
R $0C:D536 ADC $00 ; OAM Y = Mario Y + object 2 Y + [$00]
W $0C:D58F STX $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]
R $0C:D724 LDA $00
W $0C:D76A STA $00 ; [$00] = Y of this sprite
R $0C:D77B LDA $00 ; OAM Y = [$00]
W $0C:D789 STA $00
W $0D:A57F STA $00 ; [$00] = tile table index (also used for item memory checks)
R $0D:A596 LDA $00
R $0D:A5B6 LDX $00
W $0D:A71F STA $00 ; $00 = 8: width - 1 (9 columns)
R $0D:A72A LDA $00
W $0D:A764 STA $00
R $0D:A76F LDA $00
W $0D:A8C9 STA $00 ; $00 = $02 = [$59] AND $0F: width - 1
R $0D:A94F LDA $00
W $0D:AA2E STA $00
RW $0D:AA85 DEC $00
RW $0D:AA8C DEC $00
W $0D:AABA STA $00 ; $00 = $01 = [$59] AND $0F: pipe length
R $0D:AAFC LDA $00
W $0D:AB74 STA $00
W $0D:AB7F STA $00 ; $00 = ([$59] >> 4) + 1: rows in the slope
RW $0D:AB81 INC $00
RW $0D:ABBF DEC $00 ; Rows left: $00--
W $0D:AC29 STA $00
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)
W $0D:ACA3 STA $00
RW $0D:ACA5 INC $00 ; [$00] = (size >> 4) + 1 = number of rows
RW $0D:AD0A DEC $00 ; One row done
W $0D:AD4A STX $00 ; [$02] = [$00] = 1 (slope tiles in first row)
W $0D:AD55 STA $00
RW $0D:AD57 INC $00 ; [$00] = (size >> 4) + 1 = number of rows
R $0D:AD7B LDA $00
RW $0D:AD9B DEC $00 ; [$02] += 2, X = [$02], next row
W $0D:ADA9 STX $00 ; [$02] = [$00] = 0 (slope tiles in first row)
W $0D:ADB4 STA $00
RW $0D:ADB6 INC $00 ; [$00] = (size >> 4) + 1 = number of rows
R $0D:ADD0 LDA $00
RW $0D:ADE6 DEC $00
W $0D:ADFA STA $00
RW $0D:ADFC INC $00 ; [$00] = (size >> 4) + 1 = number of rows
R $0D:AE32 LDA $00
RW $0D:AE65 DEC $00 ; Decrement rows left
W $0D:AE75 STA $00 ; [$00] = size >> 4 = height
RW $0D:AEF4 DEC $00
W $0D:AF04 STA $00 ; [$00] = size >> 4 = height
RW $0D:AF5C DEC $00
W $0D:AF69 STA $00
RW $0D:AFD7 DEC $00
W $0D:AFF2 STA $00
RW $0D:B034 DEC $00
W $0D:B07D STA $00 ; [$00] = size >> 4 (height)
RW $0D:B09A DEC $00
RW $0D:B0BC DEC $00
RW $0D:B0DE DEC $00
W $0D:B1CA STA $00
W $0D:B1D8 STA $00
R $0D:B20B LDX $00
W $0D:B232 STA $00
R $0D:B2BD LDA $00
W $0D:B33C STA $00
R $0D:B3B1 LDX $00 ; Reload width
W $0D:B3C3 STA $00
RW $0D:B3D6 DEC $00
W $0D:B3E9 STA $00 ; Width
R $0D:B422 LDA $00
W $0D:B433 STA $00 ; Width (the height bits are obviously unused)
R $0D:B457 LDA $00
W $0D:B469 STA $00
R $0D:B475 LDA $00
RW $0D:B48C DEC $00
W $0D:B4A6 STA $00
RW $0D:B4CA DEC $00
W $0D:B5BD STA $00
RW $0D:B5DA DEC $00
W $0D:B608 STA $00
R $0D:B615 LDA $00
R $0D:B666 LDA $00
W $0D:B6C9 STA $00
RW $0D:B6DC DEC $00
W $0D:B70D STA $00
RW $0D:B72A DEC $00
W $0D:B747 STA $00 ; $00 = size = high nibble of [$59] (number of extra rows)
RW $0D:B76F DEC $00
RW $0D:B79B DEC $00
W $0D:B7B0 STA $00
W $0D:B869 STA $00
W $0D:B926 STA $00 ; $00 = width = low nibble of [$59]
R $0D:B930 LDA $00
W $0D:B973 STA $00 ; $00 = height = high nibble of [$59]
RW $0D:B982 DEC $00
RW $0D:B992 DEC $00
W $0D:B9C8 STA $00 ; $00 = height = high nibble of [$59] (width bits are unused)
RW $0D:B9D8 DEC $00
RW $0D:B9F1 DEC $00
W $0D:BA10 STA $00
R $0D:BA3D LDX $00 ; X = width
W $0D:BA59 STA $00 ; $00 = height = high nibble of [$59]
RW $0D:BA77 DEC $00
W $0D:BAED STA $00 ; $00 = 15: sixteen tiles per row (one screen wide)
R $0D:BAF2 LDA $00
W $0D:C2EF STA $00 ; $00 = 8: 8 tiles drawn with the blank check, plus 1 without
RW $0D:C302 DEC $00
W $0D:C324 STA $00 ; $00 = 1: two tiles per row (count - 1)
R $0D:C326 LDA $00
W $0D:C36C STA $00
RW $0D:C36E INC $00 ; $00 = number of rows = high nibble of [$59] + 1
RW $0D:C3A0 DEC $00
W $0D:C3EC STA $00
RW $0D:C3EE INC $00 ; $00 = number of rows = high nibble of [$59] + 1
R $0D:C40D LDA $00
RW $0D:C427 DEC $00
W $0D:C434 STA $00 ; $00 = width-1 = low nibble of [$59]
RW $0D:C447 DEC $00
W $0D:C457 STA $00 ; $00 = height-1 = high nibble of [$59]
RW $0D:C46A DEC $00
W $0D:C47E STA $00 ; $00 = low nibble of [$59] (tiles per row)
R $0D:C48D LDA $00
W $0D:C4CF STA $00 ; $00 = width-1 = low nibble of [$59]
R $0D:C4D1 LDX $00 ; X = width-1
R $0D:C4E1 LDX $00 ; X = width-1
W $0D:C4FC STA $00 ; $00 = height-1 = high nibble of [$59]
RW $0D:C544 DEC $00
RW $0D:C56E DEC $00
W $0D:C590 STA $00 ; $00 = width-1 = low nibble of [$59]
R $0D:C59D LDX $00 ; X = width-1
R $0D:C5B8 LDX $00 ; X = width-1
W $0D:C5E0 STA $00 ; $00 = height-1 = high nibble of [$59]
RW $0D:C60C DEC $00
W $0D:CEF8 STA $00 ; $00 = width-1 = low nibble of [$59]
RW $0D:CF0B DEC $00
W $0D:CF18 STA $00 ; $00 = width-1 = low nibble of [$59]
RW $0D:CF2B DEC $00
W $0D:CF40 STA $00 ; $00 = height-1 = high nibble of [$59]
RW $0D:CF4E DEC $00
W $0D:CFB9 STA $00 ; $00 = tile
R $0D:CFC7 LDA $00
W $0D:D03C STA $00 ; $00 = tile
R $0D:D04A LDA $00
W $0D:D109 STA $00
RW $0D:D12B DEC $00
W $0D:D14B STA $00
R $0D:D158 LDX $00 ; X = width
R $0D:D178 LDX $00 ; X = width again
W $0D:D1E6 STA $00
RW $0D:D1FE DEC $00
RW $0D:D21A DEC $00
RW $0D:D247 DEC $00
W $0D:D254 STA $00
R $0D:D278 LDA $00
W $0D:DAD5 STA $00
RW $0D:DAED DEC $00
W $0D:DB0C STA $00
W $0D:DB17 STA $00
RW $0D:DB19 INC $00
RW $0D:DB57 DEC $00
W $0D:DB95 STA $00
W $0D:DBA0 STA $00
RW $0D:DBA2 INC $00
RW $0D:DBCC DEC $00
W $0D:DC08 STX $00
W $0D:DC13 STA $00
RW $0D:DC15 INC $00
R $0D:DC39 LDA $00
RW $0D:DC59 DEC $00
W $0D:DC67 STX $00
W $0D:DC72 STA $00
RW $0D:DC74 INC $00
R $0D:DC8E LDA $00
RW $0D:DCA4 DEC $00
W $0D:DCAF STA $00
R $0D:DCBD LDX $00 ; X = width
R $0D:DCE3 LDX $00
W $0D:DCF2 STA $00
R $0D:DCFD LDA $00
RW $0D:DD14 DEC $00
W $0D:DD36 STA $00
R $0D:DD3D LDA $00
RW $0D:DD4D DEC $00
W $0D:DD64 STA $00
RW $0D:DD82 DEC $00
W $0D:DD9F STA $00
RW $0D:DE34 DEC $00
W $0D:DE42 STA $00
RW $0D:DED4 DEC $00
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
R $0D:DF84 LDX $00
RW $0D:E009 INC $00 ; Next canvass index
W $0D:E02B STA $00 ; [$00] = $01B0: bytes in one screen
R $0D:E033 LDA $00
W $0D:E040 STA $00 ; [$00] = $01B0: bytes in one screen
R $0D:E048 LDA $00
W $0D:E13B STA $00
R $0D:E14A LDA $00
W $0D:E973 STA $00 ; [$00] = 3: fill four 256-tile pages
RW $0D:E98A DEC $00
W $0D:E9B1 STA $00
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:E9DA STA $00 ; Row width - 1 = 2
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:EA17 STA $00 ; Row width - 1 = 1
W $0D:EA4C STA $00 ; [$00] = [$01] = 3: width and height - 1
RW $0D:EA5E DEC $00 ; Next tile; repeat for the row
W $0D:EA6A STA $00 ; Row width - 1 = 3
W $0D:EAC5 STA $00 ; Row width - 1 = 5
RW $0D:EAD2 DEC $00 ; Next tile; repeat for 6 tiles
W $0D:EB70 STA $00 ; Row width - 1 = 9
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:ECA2 STA $00
R $0D:ECA6 LDA $00
W $0D:ECD4 STA $00 ; [$00] = [$02] = width, low nibble of [$59]
R $0D:ED00 LDA $00
W $0D:ED18 STA $00
RW $0D:ED35 DEC $00
W $0D:ED73 STA $00
RW $0D:ED90 DEC $00
W $0D:EDA6 STA $00
RW $0D:EDB4 DEC $00
W $0D:EDE1 STA $00
R $0D:EDEE LDX $00 ; X = width
R $0D:EE05 LDX $00 ; Reload the width
W $0D:EE1D STA $00
R $0D:EE2A LDX $00 ; X = width
R $0D:EE4B LDX $00 ; Reload the width
W $0D:EE58 STA $00
R $0D:EE65 LDX $00 ; X = width
R $0D:EE82 LDX $00 ; Reload the width
W $0D:EE8F STA $00
R $0D:EEA4 LDX $00 ; X = width
R $0D:EEB9 LDX $00 ; Reload the width
W $0D:EEC6 STA $00
RW $0D:EF3D DEC $00
W $0D:EF6D STA $00
R $0D:EF77 LDX $00 ; X = width
R $0D:EF91 LDX $00 ; Reload the width
W $0D:EFAE STA $00
R $0D:EFBB LDA $00
R $0D:F001 LDA $00
RW $0D:F01F DEC $00
W $0D:F031 STA $00
R $0D:F03E LDX $00 ; X = width
R $0D:F04E LDX $00 ; X = width
W $0D:F072 STA $00
RW $0D:F085 DEC $00

$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:80EF STA $0001
W $00:8104 STA $0001
W $00:8115 STA $0001
W $00:814F STA $0001
W $00:8160 STA $0001
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)
R $00:8B49 ADC $01
W $00:8E9C STZ $01 ; [$00]-[$01] = high byte of the score, as a 16-bit value
W $00:8ECB STZ $01
W $00:8EF9 STZ $01
W $00:8F8B STZ $01
W $00:908E STY $01 ; [$01] = OAM offset of the item box sprite
R $00:90AB LDY $01 ; Y = OAM offset
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
R $00:920B LDA $01
W $00:944C STA $01 ; Circle centre: [$00] = $80 (X), [$01] = $70 (Y)
RW $00:9796 ROL $01 ; [$01] = carry (high byte)
W $00:97AC STA $01
W $00:A028 STA $01 ; [$01] = it
R $00:A02C ADC $01
W $00:A039 STA $01 ; [$01] = it
W $00:A490 STZ $01 ; [$01] = 0
W $00:A881 STA $01 ; [$01] = $7EB3, so [$00] = $7E:B3F0 (offset $06F0 in the decompressed buffer)
W $00:BA41 STA $01
W $00:C4F3 STA $01
W $00:CA86 STA $01 ; [$01] = Mario screen Y + A: iris center Y
R $00:CA96 LDA $01
R $00:CAB5 LDA $01
RW $00:CAB9 DEC $01 ; [$01]--
R $00:CB02 LDA $01
RW $00:CB06 DEC $01
R $00:CC15 LDA $01
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)
R $00:FA41 ORA $01
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:88C2 STA $01
R $01:8E20 LDA $01
W $01:9474 STA $01 ; [$01] = copy of clip X low
R $01:9481 LDA $01
W $01:94E5 STA $01 ; [$01] = copy of clip X low
R $01:94F4 LDA $01
W $01:975B STA $01
R $01:97A2 LDA $01
R $01:9D00 ADC $01 ; Add the Y offset to the Y position
W $01:9D02 STA $01
R $01:9D2A LDA $01
R $01:9D9E LDA $01
R $01:9E02 LDA $01
W $01:9E47 STA $01 ; [$01] = sprite Y position low
R $01:9E6F LDA $01
R $01:9F32 LDA $01
W $01:A0EA STA $01
R $01:A0FF LDA $01
W $01:A243 STA $01
W $01:A317 STZ $01 ; [$01] = 0
RW $01:A32C DEC $01
R $01:A33A ADC $01 ; Item X = baby Yoshi X + offset (16-bit)
W $01:A3DC STA $01
W $01:A444 STA $01
W $01:A479 STA $01
W $01:A78F STY $01 ; $01 = Y index
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:A899 STA $01 ; [$01] = $14
R $01:A89E SBC $01
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:ACC3 STA $01
R $01:ACEB LDY $01 ; Y = [$01]
R $01:AF6D LDA $01
W $01:B18B STA $01
W $01:B2E5 STA $01 ; $01 = animation frame [$1602] (0 short, 1 long)
R $01:B2F5 LDX $01
R $01:B316 LDX $01
R $01:B329 LDA $01
R $01:B36D LDA $01
R $01:B378 LDY $01 ; A = 4 (5 tiles) for the long platform
W $01:B3D8 STA $01
R $01:B408 LDX $01
RW $01:B41A DEC $01
W $01:B488 STA $01
R $01:B48D SBC $01 ; Mario Y low = sprite Y low - [$01]
R $01:B675 LDA $01
W $01:B715 STZ $01
W $01:B727 STA.W $0001,Y
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
R $01:B82A ADC $01
W $01:BB47 STA $01 ; $01 = sprite Y on screen
R $01:BB8E LDA $01 ; A = sprite Y on screen
W $01:BC23 STA $01 ; $01 = Mario Y low
R $01:BD01 LDA $01
W $01:BD06 STA $01 ; Screen Y -= 4 (center the 8x8 tiles)
R $01:BD11 LDA $01
R $01:BD2F LDA $01
R $01:BD55 LDA $01
R $01:BF64 LDA $01
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)
R $01:BFBF LDA $01
W $01:BFC4 STA $01 ; Yes: swap $00 and $01
R $01:BFD3 LDA $01
W $01:BFDE STA $01
W $01:C0C9 STA $01 ; $01 = tape X high
R $01:C149 LDA $01
R $01:C64D LDA $01
R $01:C67D LDA $01
R $01:C6B7 LDA $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:C971 ADC $01
R $01:CB4C LDA $01
R $01:CC5B LDA $01
R $01:CC77 LDA $01
W $01:D07A STA $01
R $01:D09A LDA $01
W $01:D3D1 STA $01 ; To [$01]
W $01:D477 STA $01 ; [$01] = X high
R $01:D4C5 LDA $01 ; Sprite screen Y ([$01])
W $01:D735 STA $01 ; [$01] = $F2 (spark Y offset, above sprite)
W $01:D817 STA $01
R $01:D8BA LDA $01
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
R $01:DBB1 LDA $01
R $01:DC1A LDA $01
R $01:DC5E LDA $01
W $01:DC63 STA $01
R $01:DC8A LDA $01
W $01:DC92 STA $01
W $01:DFDF STX $01 ; X = $01 = cell counter, 2 down to 0
R $01:DFE7 ADC $01 ; Y = line * 3 + cell
R $01:E245 LDA $01
R $01:E713 LDA $01
R $01:E8F0 LDA $01
W $01:EE94 STZ $01
W $01:F071 STA $01
R $01:F080 LDA $01
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:F5B1 LDA $01
R $01:F5DB LDA $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:80DF STA $01
R $02:80F5 LDA $01
W $02:80FB STA $01
R $02:810E LDA $01
W $02:84AA STA $01 ; $01 = 2: spawn three splashes
RW $02:84B7 DEC $01
W $02:859B STX $01 ; $01 = vertical base offset
R $02:85A6 ADC $01
W $02:8C86 STA $01
R $02:8C94 LDA $01
W $02:8FE6 STA $01
R $02:8FEF LDA $01
W $02:9236 STA $01
W $02:928F STA $01 ; $01 = bounce X low
R $02:929A LDA $01
W $02:92E2 STA $01 ; $01 = bounce X low
R $02:92ED LDA $01
W $02:956D STA $01
R $02:957E LDA $01
W $02:95CF STA $01
R $02:95E0 LDA $01
W $02:9685 STA $01 ; $01 = bounce block Y low + offset
W $02:96AC STA $01 ; $01 = cape Y low
W $02:98F9 STA $01 ; [$01] = smoke Y
R $02:9916 ADC $01 ; A = Y + DATA_0298C6[X]
W $02:9A3B STA $01 ; [$01] = Y on screen
R $02:9A49 LDA $01 ; A = Y on screen
R $02:9A80 LDA $01
W $02:9B69 STA $01 ; [$01] = Y on screen = ExSprite Y low - [$1C]
R $02:9B7B LDA $01 ; A = Y on screen
W $02:9D02 STA $01
R $02:9D27 LDA $01
R $02:9D45 LDA $01
W $02:9DDD STA $01
R $02:9E23 LDA $01
W $02:A077 STA $01 ; [$01] = behind layers flag
R $02:A091 LDX $01
W $02:A1B7 STA $01
R $02:A1D8 LDA $01
W $02:A1E0 STA $01 ; [$01] = behind layers flag
R $02:A1F9 LDX $01
W $02:A295 STA $01
R $02:A29E LDA $01
W $02:A560 STA $01
W $02:A637 STA $01 ; X + 4: [$01] and block X low
R $02:A648 LDA $01
W $02:A69D STA $01 ; X + 4: [$01] and block X low
R $02:A6AE LDA $01
W $02:A828 STA $01 ; $01 = screen to spawn sprites from
R $02:A842 CMP $01
R $02:A954 LDA $01
R $02:A96C LDA $01
R $02:AB5E LDA $01
R $02:ABC0 LDA $01
R $02:ABDA LDA $01
R $02:AF5D LDA $01 ; X position high from $01
R $02:AFCD LDA $01 ; A = X position high from $01
R $02:B729 LDA $01
W $02:B72E STA $01
R $02:B76B LDA $01 ; A = this segment's Y
R $02:B781 LDA $01
W $02:B786 STA $01
R $02:B8FA LDA $01
W $02:B970 STA $01
R $02:B97F LDA $01
R $02:B9FE LDA $01
R $02:BA48 LDA $01
R $02:BAD8 LDA $01
W $02:BB35 STA $01 ; [$01] = sprite Y low
R $02:BB5E LDA $01
R $02:BC4E LDA $01
R $02:BED2 LDA $01
R $02:BEFA LDA $01
W $02:BF05 STA $01
R $02:BF2C LDA $01
R $02:BF8F LDA $01
W $02:C1B6 STA $01
R $02:C1C9 LDA $01
W $02:C485 STA $01
R $02:C4A5 LDA $01
R $02:C8E0 LDA $01
R $02:CA54 LDA $01
R $02:CA5D LDA $01
R $02:CACA LDA $01
R $02:CB1F LDA $01
R $02:CB76 ADC $01 ; Store tile Y = sprite Y + offset
R $02:CBE1 LDA $01
W $02:CC48 STA $01
W $02:CCC9 STA $01
R $02:CCE0 LDA $01
R $02:CD9A LDA $01
R $02:CF26 ADC $01 ; A = screen Y + Y offset
W $02:D053 STA $01
RW $02:D06E LSR $01 ; Test bit 0 of [$01]
W $02:D09F STA $01 ; [$01] = [$13] bit 1
R $02:D0BB LDY $01 ; Y = [$01]
W $02:D10B STA $01
R $02:D119 LDA $01
W $02:D16C STA $01
R $02:D180 LDA $01
W $02:D2FB STA $01 ; [$01] = speed (travelled along the longer axis)
R $02:D336 LDX $01 ; X = speed: loop counter
R $02:D350 LDA $01
W $02:D355 STA $01
R $02:D364 LDA $01 ; A = X speed
W $02:D36F STA $01 ; [$01] = X speed toward Mario
W $02:D3E4 STA $01
W $02:D4B6 STA $01 ; [$01] = sprite X high
R $02:D5F3 LDA $01 ; A = sprite Y on screen
W $02:D656 STA $01 ; [$01] = angle high
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:D713 ADC $01 ; + sign extension
R $02:D778 LDA $01 ; A = ball screen Y ([$01] from the draw routine)
W $02:D789 STA $01
R $02:D7B4 LDA $01 ; A = link Y on screen
R $02:D7DA LDA $01 ; A = link Y on screen
W $02:D7E2 STA $01 ; [$01] = distance
RW $02:D7E5 ROR $01 ; [$01] = distance / 2 (arithmetic shift)
R $02:D7E7 LDA $01 ; A = half distance
W $02:D7EF STA $01
R $02:D822 LDA $01 ; A = sprite Y on screen
R $02:D857 LDA $01
R $02:DA07 LDA $01
R $02:DB11 LDA $01
R $02:DC6C LDA $01
R $02:DE6F LDA $01
W $02:DF33 STA $01 ; $01 = sprite X (high)
R $02:DF5A LDA $01
R $02:E3E1 LDA $01
R $02:E58F LDA $01
R $02:E646 LDA $01
R $02:E696 LDA $01
R $02:E910 LDA $01
R $02:E9F7 LDA $01
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)
R $02:EBA3 LDY $01
R $02:ECFD LDA $01
W $02:EE80 STA $01 ; [$01] = height
R $02:EE85 SBC $01
W $02:EEE2 STA $01 ; [$00] = sprite Y position (16 bit)
R $02:EF4D LDA $01
W $02:F209 STA $01 ; [$01] = sprite X high
W $02:F78A STA $01 ; [$01] = $60 - [RAM_ScreenBndryYLo]: block Y on screen
R $02:F7AE LDA $01
R $02:F7E1 LDA $01
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)
R $02:F88F LDA $01
R $02:F978 ADC $01
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:FB4D LSR $01
W $02:FB96 STZ $01
RW $02:FB9C DEC $01 ; [$01] = sign extension of the Y offset
R $02:FBA8 ADC $01
R $02:FC39 LDA $01
W $02:FC95 STA $01 ; [$00] = X position (16-bit)
W $02:FE83 STA $01 ; [$00] = sprite X position (16-bit)
W $02:FEE6 STA $01
RW $02:FF02 LSR $01
W $02:FF25 STA $01
R $02:FF42 LDY $01
R $03:8418 LDA $01
R $03:84A1 LDA $01
R $03:85B4 LDA $01
R $03:86CB LDA $01
R $03:874A LDA $01
R $03:886C LDA $01
W $03:8A0F STA $01 ; Smoke offset: X +4, Y +$0A
R $03:8A31 ADC $01
W $03:8AF0 STA $01
R $03:8B00 LDA $01
R $03:8B73 LDA $01
W $03:8D03 STA $01
R $03:8D3D LDA $01
R $03:8E37 LDA $01
R $03:8EC3 LDA $01
R $03:8F2F LDA $01
R $03:9191 LDA $01
R $03:94EC LDA $01
R $03:96BA LDA $01
R $03:97BD LDA $01
W $03:97F9 STA $01 ; Aim at Mario. A: speed. Save to $01
R $03:9834 LDX $01 ; X = speed [$01]
R $03:984E LDA $01
W $03:9853 STA $01
R $03:9862 LDA $01 ; A = $01
W $03:986D STA $01
W $03:992D STA $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:99E4 ADC $01 ; Add sign extension
R $03:9B4B LDA $01 ; A = aimed X speed
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]
R $03:A0B1 LDA $01
R $03:A40B LDA $01
W $03:AA83 STA $01
R $03:AA9B LDA $01
R $03:AAE0 LDA $01
W $03:ACA3 STA $01 ; [$01] = Peach screen Y position
W $03:AEF0 STZ $01 ; [$00] = timer / 2
R $03:AF1E LDA $01
R $03:AF84 LDA $01
R $03:AFC1 LDA $01
W $03:B04C STA $01 ; [$01] = Bowser X high
R $03:B05A LDA $01
R $03:B235 LDA $01
R $03:B3D1 LDA $01
R $03:B41A LDA $01
W $03:B4AF STZ $01 ; $01 = 0: running X
R $03:B4C7 LDA $01
W $03:B4D2 STA $01
W $03:B695 STA $01
W $03:B719 STA $01
W $03:B7CC STA $01
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
R $03:B8ED LDY $01 ; Y = [$01]
R $03:C294 LDA $01 ; A = on-screen Y
R $03:C42C LDA $01
R $03:C981 LDA $01
W $03:CA30 STA $01
R $03:CA51 LDA $01
R $03:CA67 LDY $01
W $03:CAFE STA $01
R $03:CB20 LDA $01
R $03:CB36 LDY $01
W $03:CBD7 STA $01 ; $01 = spawner X low
R $03:CBE3 LDA $01
R $03:D4B2 LDA $01
R $03:D4F7 LDA $01
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)
R $03:D9A1 LDA $01
RW $03:D9D2 INC $01 ; [$00]/[$01] += $0080: next Mode 7 tilemap row
W $03:DDAC STA $01
W $04:82A6 STA $01
R $04:8307 LDY $01,X
W $04:830E STA $01,X ; Store the speed of the shorter axis in [$01,X]
R $04:8316 LDY $01,X
W $04:831C STA $01,X ; Store the speed in [$01,X]
R $04:8323 LDA.W $0001,Y
R $04:8331 LDA.W $0001,Y ; A = speed
W $04:850F STA $01
W $04:85EE STA $01 ; [$01] = $07: Y of the first backdrop tile
R $04:85FD LDA $01
R $04:861E LDA $01
W $04:8623 STA $01
W $04:8688 STA $01
R $04:86A2 LDA $01
R $04:9760 LDA $01
W $04:9765 STA $01
R $04:97B7 LDA $01
R $04:97ED LDA $01
R $04:9D28 LDA $01
W $04:DCCD STA $01 ; [$01] = [$1DE8] - 1: map page
R $04:DCE1 LDA $01
W $04:DCE6 STA $01 ; Other submap: page += 4
R $04:EAEF LDA $01 ; A = Y position
R $04:EB22 LDA $01 ; A = Y position
W $04:EB27 STA $01 ; [$01] = Y position
R $04:EC3D LDA $01 ; A = effect Y
W $04:EC75 STA $01 ; [$01] = screen Y
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
R $04:F7CC LDX $01
RW $04:F8F4 INC $01 ; [$00]/[$01] += DATA_04F8A6[X] (16-bit, accumulates)
R $04:F9C3 LDA $01
RW $04:FA19 INC $01 ; [$00] += A (16-bit)
R $04:FB11 LDA $01
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]
R $05:85F2 ORA $01
W $05:8681 STA $01 ; [$01] = high byte
W $05:8A60 STA $01
W $05:8B40 STA $01
W $05:8C2E STA $01
W $05:8D25 STA $01
W $05:8DE4 STA $01
R $05:CE8C LDA $01
W $05:D81F STA $01 ; [$01] = secondary exit X position byte ($05FC00[Y])
W $05:D99F STA $01 ; [$01] = $05F600[Y]
R $05:D9EE LDA $01
W $05:D9F2 STA $01
R $05:D9FA LDA $01
R $05:DA01 LDA $01
W $0C:9F01 STZ $01 ; [$01] = 0: length high byte
R $0C:9F16 LDA $01
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:A106 LDA $01
R $0C:A129 LDA $01
W $0C:A12E STA $01 ; Y += $10: next row
R $0C:A183 LDA $01 ; Draw loop entry: X position high byte
W $0C:A1C4 STA $01
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:A29D STA $01 ; $01 = high byte
W $0C:A2CB STA $01 ; $00 = actor 7 X position (16-bit with high byte $0B75)
W $0C:A365 STZ $01 ; X high byte = 0
W $0C:A381 STZ $01 ; X high byte = 0
W $0C:A483 STZ $01 ; X high byte = 0
W $0C:A49D STZ $01 ; X high byte = 0
W $0C:A4BA STZ $01 ; X high byte = 0
W $0C:A4D2 STZ $01 ; X high byte = 0
W $0C:A680 STZ $01
W $0C:A6E9 STZ $01 ; $01 = 0: X high byte
W $0C:A6F8 STA $01
R $0C:A83C LDA $01
W $0C:A8F3 STA $01 ; $01 = slot Y position
R $0C:A8FC LDA $01
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)
R $0C:B60B LDY $01
RW $0C:B62F DEC $01 ; Previous high-table slot
W $0C:CB8E STA $01 ; [$01] = Y of the row = $67
R $0C:CB9B LDA $01
W $0C:CC04 STA $01 ; [$01] = $5F: top Y of the block
R $0C:CC0D LDA $01
R $0C:CC39 LDA $01
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:CF9A STA $01 ; Y position = $5F
W $0C:D05A STA $01
W $0C:D07B STA $01 ; $01 = Mario Y + $10
R $0C:D082 LDA $01
R $0C:D0AC LDA $01
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]
R $0C:D737 LDA $01
W $0D:A723 STA $01 ; $01 = 4: height - 1 (5 rows)
RW $0D:A743 DEC $01 ; Rows left: $01--
W $0D:A768 STA $01
RW $0D:A788 DEC $01 ; Rows left: $01--
W $0D:A8D3 STA $01
RW $0D:A953 DEC $01
W $0D:AABC STA $01
RW $0D:AAE8 DEC $01
RW $0D:AAEF DEC $01
W $0D:AAFE STA $01 ; $01 = $00: reload the length
W $0D:AE7E STA $01 ; [$01] = 0: first-line flag
R $0D:AEC0 LDA $01 ; First row?
RW $0D:AEC4 INC $01 ; Clear the first-line flag
W $0D:AF0D STA $01 ; [$01] = 0: first-line flag
R $0D:AF38 LDA $01
RW $0D:AF57 INC $01 ; Clear the first-line flag
W $0D:AF71 STA $01 ; [$01] = 0: first-line flag
R $0D:AFA1 LDA $01 ; First row?
RW $0D:AFA5 INC $01 ; Clear the first-line flag
W $0D:AFF8 STA $01 ; [$01] = 0: first-line flag
R $0D:B01B LDA $01
RW $0D:B02F INC $01 ; Clear the first-line flag
W $0D:B234 STA $01 ; [$00] = [$01] = height (high nibble of [$59])
RW $0D:B261 DEC $01
RW $0D:B28B DEC $01
W $0D:B2BF STA $01 ; [$01] = height again
W $0D:B345 STA $01 ; Y = position, X = width, [$00] = width, [$01] = height
RW $0D:B3B3 DEC $01
W $0D:B3F3 STA $01
RW $0D:B426 DEC $01
W $0D:B435 STA $01
RW $0D:B44D DEC $01
W $0D:B459 STA $01 ; Reload width
W $0D:B46F STA $01 ; Width
R $0D:B48A LDX $01 ; Reload size
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)
R $0D:B752 LDA $01
RW $0D:B76B INC $01
RW $0D:B76D INC $01 ; Next row is two tiles wider
RW $0D:B777 DEC $01 ; Widest rows are 5 tiles, not 6
R $0D:B779 LDA $01
W $0D:B7BE STX $01 ; X = $01 = 1: width of the top row
RW $0D:B803 INC $01
RW $0D:B805 INC $01 ; Next row is two tiles wider
R $0D:B807 LDX $01 ; X = new row width
W $0D:B816 STX $01 ; $01 = new width
R $0D:B847 LDX $01 ; X = row width
W $0D:B877 STX $01 ; X = $01 = 1: width of the first row
RW $0D:B8BD INC $01
RW $0D:B8BF INC $01 ; Rows get two tiles wider
R $0D:B8C1 LDX $01 ; X = row width
W $0D:B8C8 STX $01 ; Next (lower) rows are one tile narrower: $01 = X - 1
R $0D:B90F LDX $01 ; X = row width
W $0D:B92E STA $01 ; $01 = height = high nibble of [$59]
RW $0D:B95D DEC $01
W $0D:BA19 STA $01 ; $01 = height = high nibble of [$59]
RW $0D:BA3F DEC $01
W $0D:BAE9 STA $01 ; $01 = 5: six rows
RW $0D:BB12 DEC $01
W $0D:C328 STA $01 ; $01 = tiles left in this row
RW $0D:C335 DEC $01 ; Next tile
W $0D:C486 STA $01 ; $01 = row count-1 = high nibble of [$59]
RW $0D:C4BD DEC $01
W $0D:C598 STA $01 ; $01 = height-1 = high nibble of [$59]
RW $0D:C5D3 DEC $01
W $0D:D153 STA $01
RW $0D:D17D DEC $01
W $0D:D256 STA $01
RW $0D:D26E DEC $01
W $0D:D27A STA $01 ; Reload the width counter
W $0D:DCB7 STA $01
RW $0D:DCE5 DEC $01 ; X = width; next row; loop while rows remain (rows below the top use $1FF)
W $0D:DCF8 STA $01
R $0D:DD01 LDX $01 ; X = width
R $0D:DD18 LDX $01 ; X = width
W $0D:DD6A STA $01
R $0D:DD6F LDX $01 ; X = width
W $0D:DDA5 STA $01
R $0D:DDAA LDX $01 ; X = [$01]: tiles remaining in this column
RW $0D:DE30 DEC $01
RW $0D:DE32 DEC $01 ; [$01] -= 2: next column is two tiles shorter
W $0D:DE48 STA $01
R $0D:DE4D LDX $01 ; X = [$01]: tiles remaining in this column
RW $0D:DED0 DEC $01
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
RW $0D:DF6C DEC $01
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:E143 STA $01
RW $0D:E17A DEC $01
W $0D:E9BE STA $01
RW $0D:E9DC DEC $01
W $0D:E9FB STA $01
RW $0D:EA19 DEC $01
W $0D:EA4E STA $01
RW $0D:EA6C DEC $01
W $0D:ECA4 STA $01 ; [$00] = [$01] = 1: width and height minus one
RW $0D:ECBC DEC $01
W $0D:ECDE STA $01
RW $0D:ED04 DEC $01
W $0D:EDE9 STA $01
R $0D:EDF0 LDA $01
RW $0D:EE07 DEC $01
W $0D:EE25 STA $01
RW $0D:EE4D DEC $01
W $0D:EE60 STA $01
RW $0D:EE84 DEC $01
W $0D:EE97 STA $01
RW $0D:EEBB DEC $01
W $0D:EED4 STA $01
R $0D:EF00 LDX $01 ; X = column height
W $0D:EF75 STA $01
RW $0D:EF87 DEC $01
W $0D:EFB6 STA $01
RW $0D:F00C DEC $01
W $0D:F039 STA $01
RW $0D:F061 DEC $01

$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:80F4 STA $0002
W $00:8109 STA $0002
W $00:811A STA $0002
W $00:8154 STA $0002
W $00:8165 STA $0002
W $00:85E1 STA $02 ; [$02] = pointer bank
W $00:86FD STY $02 ; [$02] = low byte of the pushed return address (table address - 1)
R $00:870E LDA [$02],Y
R $00:8713 LDA [$02],Y
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
R $00:9019 LDA $02
W $00:902C STA $02
R $00:9058 LDA $02
W $00:9064 STA $02 ; Value = difference
W $00:98F4 STA $02 ; [$02] = source address $C680 (bank $7E)
R $00:990C LDA $02
W $00:9914 STA $02
W $00:9EA2 STA $02 ; [$8A] = [$02] = entry counter
RW $00:9ECE DEC $02 ; Next entry
W $00:A03F STA $02 ; [$02] = it
W $00:A48E STX $02 ; [$02] = bank
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:B89A STA $02
W $00:BA45 STA $02
W $00:C35B STA $02 ; [$02] = address of the cage tile words
R $00:C3A4 LDA [$02],Y
R $00:CACD SBC $02
W $00:CC58 STA $02 ; [$02] = half-width from the table at [$04]
W $00:F4D1 STA $02 ; [$02] = $7E
RW $00:F4D8 INC $02 ; [$02] = $7F: the high-byte table
W $00:F732 STA $02 ; [$02] = distance
R $00:F73C LDA $02
W $00:F77F STA $02
R $00:F789 LDA $02
W $00:F814 STA $02 ; [$02] = A
W $00:F81D STZ $02 ; [$02] = 0 (no scroll)
R $00:F81F LDA $02
R $00:F881 LDA $02 ; A = [$02]
R $00:F88B LDA $02 ; A = [$02]
R $00:F8C6 EOR $02 ; Same sign as the distance [$02]?
R $00:F8CD EOR $02 ; Same sign as [$02]?
R $00:F8D1 LDA $02
W $00:F8D9 STA $02 ; Store the adjusted distance
W $01:88BD STA $02 ; [$02] = $44: box width
W $01:8DFA STA $02 ; [$02] = frame * 2
R $01:8E0B ADC $02 ; A += [$02] (frame * 2)
W $01:9D0E STA $02
R $01:9D33 LDA $02
W $01:9D76 STA $02 ; [$02] = direction
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
W $01:A0EF STA $02
R $01:A11B ADC $02 ; Sprite Y low = Mario Y + A
W $01:A449 STA $02
R $01:A455 SBC $02
W $01:A48F STA $02
R $01:A4A0 SBC $02
W $01:A6F6 STZ $02 ; $02 = 0
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:AF5A STA $02 ; $02 = face [$1528]
R $01:AF86 LDX $02
W $01:B16A STA $02
R $01:B171 LDA $02
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
W $01:B717 STZ $02 ; $00-$03 = 0
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:B7AD STA $02 ; Restore [$02]
W $01:B7D2 STA $02 ; $02 = sprite X position low
R $01:B7FF ADC $02
W $01:B867 STA $02 ; $02 = sprite Y on screen
R $01:B8B2 LDA $02
W $01:B8B7 STA $02 ; $02 = sprite Y on screen + [$0D]: bottom of the solid box
R $01:B8C8 CMP $02
R $01:B903 LDA $02
R $01:B920 SBC $02
R $01:B92B LDA $02
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
R $01:BD0F LDX $02 ; X = Y phase index
R $01:BD25 LDA $02
W $01:BD2C STA $02 ; [$02] = ([$02] + 5) & $0F: next tile is 5 of 16 steps further round the circle
R $01:BD4B LDA $02
W $01:BD52 STA $02 ; [$02] = ([$02] + 5) & $0F
W $01:BF71 STY $02 ; [$02] = 1 if Mario is above
R $01:BFC8 LDY $02
W $01:C815 STA $02 ; [$02] = Y step per link (8.8 fixed point), low byte
R $01:C899 ADC $02
W $01:C8D5 STX $02 ; [$02] = tile counter
W $01:C91E STA $02
R $01:C949 ADC $02
W $01:CB58 STA $02 ; [$02] = cosine
W $01:CB81 STA $02 ; [$02] = sine
W $01:CBC0 STA $02 ; [$02] = cosine
W $01:CBE9 STA $02 ; [$02] = sine
R $01:CC2D LDA $02
R $01:CC60 LDA $02
W $01:D3DA STA $02 ; Fireball hitbox is 8x8: [$02] = [$03] = 8
W $01:D494 STA $02 ; [$02] = direction * 2
R $01:D4AC ADC $02 ; + direction * 2
W $01:D71E STA $02 ; [$02] = staggered counter
R $01:D726 LDA $02 ; Counter
W $01:D7FF STA $02
R $01:D82C LDA $02
R $01:D8BF LDA $02
R $01:D953 LDA $02
W $01:DC6F STA $02
R $01:DC9C LDX $02
W $01:DFF1 STA $02 ; $02 = Y position of that position (DATA_01DD9A)
R $01:DFFD CMP $02
W $01:E8FB STA $02
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
R $01:F074 LDX $02 ; X = table index
W $01:F560 STA $02 ; $02 = tongue hitbox width
W $01:F7D3 STA $02 ; $02 = egg Y low
R $01:F802 LDA $02
W $01:FC96 STA $02 ; [$02] = $0F (hitbox width)
W $01:FED2 STA $02 ; [$02] = X-flip bit
R $01:FEE5 LDA $02
R $01:FF2D ORA $02
W $02:80CB STA $02 ; $02 = ([$1540] >> 1) AND 3: number of offset steps for this frame
RW $02:80FD DEC $02
W $02:82F0 STA $02 ; $02 = OAM X (kept for the wrap-around test)
R $02:8326 LDA $02
R $02:84B0 LDA $02
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
R $02:84F8 ADC $02
W $02:85B8 STA $02 ; $02 = (random AND $0F) - 2 + Mario X
R $02:85D4 LDA $02
W $02:8BE7 STA $02 ; To [$02]
R $02:8BF6 LDA $02
W $02:8D7D STA $02
R $02:8D82 LDA $02
W $02:9204 STA $02 ; $02 = camera Y low of that layer
R $02:9218 CMP $02
R $02:9234 SBC $02
W $02:9298 STA $02 ; $02 = X high
R $02:92C3 ADC $02
W $02:92DD STA $02
R $02:9316 ADC $02
W $02:957A STA $02
R $02:95A7 ADC $02
W $02:95C4 STA $02
R $02:9609 ADC $02
W $02:967C STA $02 ; $02 = width
W $02:96A7 STA $02 ; $02 = width $14
W $02:9A11 STA $02 ; [$02] = layer Y position low
R $02:9A20 CMP $02
R $02:9A39 SBC $02 ; A = coin Y - layer Y
W $02:9DBC STA $02
R $02:9DC2 ADC $02
W $02:A1C6 STA $02
R $02:A1CF LDA $02
W $02:A558 STA $02 ; $02 = width $0C
W $02:A644 STA $02
R $02:A671 ADC $02
W $02:A68A STA $02 ; $02 = Y high byte, block Y high
R $02:A6D7 ADC $02
W $02:A839 STA $02
R $02:A840 ORA $02
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
R $02:A999 LDA $02
R $02:A9D8 LDX $02
R $02:AB68 LDA $02
W $02:AB78 STX $02 ; [$02] = index of the sprite in the level
R $02:ABDF LDA $02
R $02:ABEC LDX $02
W $02:AE66 STA $02 ; $02 = screen Y
R $02:AE92 CMP $02
R $02:AEA9 SBC $02
R $02:AF0E SBC $02
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)
R $02:B788 LDA $02
W $02:B908 STA $02
R $02:B923 ORA $02
W $02:B97D STA $02
R $02:B985 LDA $02
R $02:B994 LDA $02
W $02:BB23 STA $02 ; [$02] = A (wing frame 0 or 1)
R $02:BB3E ADC $02
W $02:BC22 STA $02 ; [$02] = X speed
RW $02:BC26 ASL $02 ; Carry = sign of the X speed (set: moving left)
W $02:BF13 STA $02 ; [$02] = eye tile
R $02:BF35 LDA $02
W $02:BF7D STA $02 ; [$02] = animation frame
R $02:BFAC LDX $02
W $02:C1AD STA $02 ; $02 = Chuck direction
R $02:C1BE LDX $02 ; X = direction
W $02:C8B4 STA $02 ; [$02] = head pose
R $02:C8EC LDX $02
W $02:CB54 STA $02 ; [$02] = pose
R $02:CB6E LDX $02
W $02:CBB9 STA $02 ; [$02] = shovel index
R $02:CBC3 LDA $02
R $02:CBDF LDX $02 ; X = shovel index
W $02:CC4C STA $02
R $02:CC7F LDA $02 ; A = cage Y
R $02:CC9B LDA $02
W $02:CCCE STY $02 ; [$02] = OAM index of the current column
R $02:CCD0 LDY $02 ; Y = OAM index of the current column
R $02:CD21 LDA $02
W $02:CD26 STA $02
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
RW $02:CF43 DEC $02 ; Next piece
R $02:CFED LDY $02 ; Y = [$02] (piece number)
W $02:D117 STA $02
R $02:D142 ADC $02
W $02:D15E STA $02 ; [$02] = Y high
R $02:D1A9 ADC $02
W $02:D302 STY $02 ; [$02] = vertical sign (1 = Mario above the sprite)
R $02:D359 LDY $02 ; Y = vertical sign
W $02:D668 STA $02
R $02:D677 LDA $02 ; A = angle + $80
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:DB1B LDA $02
W $02:DC59 STA $02
R $02:DC60 ORA $02 ; X = tile counter | animation set offset
W $02:DE4B STA $02 ; Store the flip flag
R $02:DE5C LDA $02 ; Flipped?
R $02:DE86 ADC $02 ; OAM properties = $34 + flip flag + carry
W $02:DEFC STA $02 ; $02 = flame timer
W $02:E3B9 STA $02 ; $02 = wobble X offset
R $02:E3D6 ADC $02
R $02:E3DC SBC $02
W $02:ECE4 STA $02 ; [$02] = direction
R $02:ED18 LDA $02
W $02:EEE6 STA $02
R $02:EEF0 CMP $02 ; Compare Y with $0110
W $02:F124 STA $02 ; [$02] = segment facing history
RW $02:F180 LSR $02
W $02:F3F7 STA $02 ; Save in [$02]
R $02:F41D LDA $02
W $02:F5DA STZ $02 ; [$02] = 0: X high-bit flag
RW $02:F5EB INC $02 ; No: set the OAM X high bit flag
R $02:F60B ORA $02
W $02:F78C STX $02 ; [$02] = tile number within the frame
R $02:F797 ADC $02
R $02:F7AC LDX $02 ; X = tile number
R $02:F7DF LDX $02 ; X = tile number
W $02:FB15 STA $02 ; [$02] = ([$00] + $80) & $1FF: angle + 90 degrees
R $02:FB24 LDA $02
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]
W $02:FE77 STA $02
R $02:FE90 CMP $02 ; Mario X - sprite X + $0A must be below the width
W $02:FE9B STA $02
R $02:FEB5 SBC $02
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
R $03:85BE LDA $02
W $03:86B6 STA $02 ; [$02] = 0 or 5: wing frame from [$14] bit 3
R $03:86BF ADC $02
W $03:8845 STA $02 ; [$02] = graphics direction
R $03:885A LDA $02
R $03:8883 LDX $02
W $03:8B52 STA $02 ; [$02] = direction
R $03:8B58 LDA $02
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
W $03:8F22 STA $02
R $03:8F36 ORA $02 ; X = loop counter | $02 (index into X offsets)
R $03:8F50 LDX $02
W $03:918B STA $02 ; $02 = direction
R $03:91B7 LDA $02
R $03:91D3 LDA $02
W $03:94D2 STZ $02 ; $02 = 0: table offset for first spike type
W $03:94DC STA $02
R $03:94E4 ADC $02 ; X = tile counter + [$02]: table index
W $03:969E STA $02 ; $02 = direction
R $03:96A8 LDX $02 ; X = direction
R $03:96C9 LDX $02
W $03:97A8 STA $02
R $03:97C8 ORA $02 ; X = tile counter | direction offset
W $03:9800 STY $02 ; $02 = vertical side
R $03:9857 LDY $02 ; Y = vertical side
W $03:9940 STA $02
R $03:994F LDA $02
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
R $03:9BBE LDX $02
W $03:9C00 STA $02 ; $02 = platform Y offset
R $03:9C11 SBC $02 ; Minus the bounce offset
W $03:9E4F STA $02 ; $02 = direction
R $03:9E61 LDA $02 ; A = direction
R $03:9ED9 LDX $02 ; X = direction
R $03:9F05 LDX $02 ; X = direction
W $03:A0AA STA $02 ; $02 = direction
R $03:A0BA LDA $02 ; A = direction
R $03:A0D7 LDX $02 ; X = direction
W $03:A2C3 STA $02 ; $02 = offset
W $03:A3EF STA $02
R $03:A3FC ORA $02 ; X = phase row | particle
R $03:AA7E SBC $02
W $03:AF67 STA $02 ; [$02] = ([$14] >> 2) AND 7: rotation phase
R $03:AF76 ADC $02
W $03:B019 STZ $02
RW $03:B01E INC $02 ; [$02] = 1: spawn the right one
R $03:B04F LDX $02 ; X = [$02]: which side
R $03:B067 LDY $02 ; Y = [$02]
W $03:B39A STA $02
R $03:B3AF ADC $02 ; X = tile index + direction offset
W $03:B40B STA $02
R $03:B42A LDX $02 ; X = key frame
W $03:B674 STA $02 ; $02 = hitbox width $0C
W $03:B709 STA $02 ; $02 = hitbox width
R $03:B74E LDA $02,X
W $03:C0D3 STX $02 ; [$02] = tile counter
W $03:C284 STA $02 ; A = on-screen X
R $03:C2A0 ADC $02 ; + jitter
W $03:C3EF STA $02
R $03:C407 ADC $02 ; X = direction * 3 + tile index
W $03:C99E STA $02
R $03:C9A8 ORA $02
W $03:CA4F STA $02
R $03:CA87 ADC $02
W $03:CB1E STA $02
R $03:CB56 ADC $02
W $03:D492 STA $02 ; $02 = [$1602] * 6: offset of this animation frame (6 tiles per frame)
R $03:D4A6 ADC $02
R $03:D4EB ADC $02
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
R $03:DF87 LDX $02 ; X = passes left
W $04:8097 STY $02
W $04:8151 STY $02
W $04:8186 STA $02 ; [$02] = this row
R $04:818D LDA $02
W $04:8650 STA $02
R $04:8683 LDA $02
W $04:868F STA $02
R $04:870E LDA $02
W $04:8E05 STA $02
W $04:8E6D STA $02 ; [$02] = player's tile row ([$1F21])
W $04:8F28 STA $02
W $04:901A STA $02 ; [$02] = tile row
W $04:9201 STA $02
W $04:935A STY $02 ; [$02] = pressed direction (Y)
R $04:9362 CMP $02
W $04:9389 STZ $02 ; [$02] = 0
W $04:93AC STA $02 ; [$02] = second offset
R $04:93E8 LDA $02
W $04:9535 STA $02 ; [$02] = player tile Y ([$1F21+X])
W $04:958D STA $02
R $04:960A LDA $02
W $04:984C STA $02 ; [$02] = player Y position
R $04:9899 LDA $02
R $04:98A6 LDA $02
W $04:992A STA $02
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
RW $04:9A85 DEC $02
RW $04:9A87 DEC $02 ; [$02] -= 2
W $04:9D10 STA $02
R $04:9D6A CPX $02
R $04:9D83 CPX $02
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
R $04:DCF8 LDA $02
W $04:DD09 STA $02 ; [$02] = column byte offset
R $04:DD10 ORA $02 ; Add row offset
W $04:DD47 STY $02 ; [$02] = $8D00
R $04:DD59 LDA [$02],Y
R $04:DD62 LDA [$02],Y
R $04:DD77 LDA [$02],Y ; Fetch the byte to repeat
R $04:DD85 LDA [$02],Y
W $04:E71E STA $02 ; [$02] = VRAM address
R $04:E776 LDA $02 ; A = VRAM address
R $04:E7C9 LDA $02 ; A = VRAM address
R $04:E7E9 LDA $02 ; A = VRAM address
W $04:E7F1 STA $02 ; [$02] = VRAM address of the next row
R $04:E80B LDA $02 ; A = VRAM address
W $04:E81A STA $02 ; [$02] = VRAM address
R $04:E82E LDA $02 ; A = VRAM address
R $04:E889 LDA $02 ; A = VRAM address
R $04:E8A9 LDA $02 ; A = VRAM address
W $04:E8B1 STA $02 ; [$02] = VRAM address of the next row
R $04:E8CB LDA $02 ; A = VRAM address
W $04:E8DA STA $02 ; [$02] = VRAM address
W $04:EA2A STA $02 ; [$02] = flag
R $04:EA3D LDA $02 ; A = flag
W $04:EAED STA $02 ; [$02] = X position of this tile
R $04:EB11 LDA $02 ; A = X position
W $04:EC0D STA $02 ; [$02] = tile
W $04:EC29 STA $02 ; [$02] = tile
R $04:EC46 LDA $02 ; A = tile number
W $04:EE4D STA $02
R $04:F34A ADC $02 ; [$02] += height: screen Y adjusted for how high the particle is
W $04:F34C STA $02
W $04:F7C5 STA $02
R $04:F7DA CMP $02
R $04:F8D8 LDA $02
W $04:F8FC STA $02
R $04:F960 EOR $02
R $04:FA1F ADC $02
W $04:FA21 STA $02
W $04:FAC3 STA $02
R $04:FB1F LDA $02
R $04:FB54 LDA $02
R $04:FC9D ADC $02
W $04:FC9F STA $02
R $04:FD9B LDA $02 ; A = screen Y [$02]
W $04:FDA1 STA $02 ; Store screen Y
R $04:FE4E LDA $02 ; A = screen Y low [$02]
W $04:FE54 STA $02 ; Store screen Y
R $04:FE6F LDA $02 ; A = screen Y [$02]
W $04:FE75 STA $02 ; Store screen Y
W $04:FF23 STA $02 ; [$02] = dy
R $04:FFA6 LDA $02 ; A = Y speed
W $05:8224 STA $02 ; [$02] = $8000: start of the shared Map16 data
R $05:8243 LDA $02
R $05:8248 LDA $02
W $05:824E STA $02 ; [$02] += 8 (each Map16 tile is 8 bytes)
W $05:8689 STA $02
W $05:B202 STA $02 ; [$02] = 18 tiles per row
RW $05:B224 DEC $02
W $05:C084 STA $02 ; [$02] = layer Y position
R $05:C0C2 SBC $02 ; [$02] = target Y - layer Y position (signed distance)
W $05:C0C4 STA $02
W $05:C1E7 STX $02 ; [$02] = limit
W $05:C1EB STA $02 ; [$02] = position
R $05:C1F1 LDA $02
W $05:C295 STA $02 ; [$02] = distance
R $05:C2A9 LDA $02
W $05:C340 STA $02 ; [$02] = distance
R $05:C354 LDA $02
W $05:C534 STX $02 ; [$04] = larger, [$02] = smaller of the two values
W $05:C538 STA $02
R $05:C53E LDA $02
W $05:C5D0 STX $02 ; [$04] = larger, [$02] = smaller of the two values
W $05:C5D4 STA $02
R $05:C5DA LDA $02
R $05:CD02 LDA $02
R $05:CE0A LDA $02
W $05:CE1E STA $02
W $05:CE85 STA $02 ; [$02] = low byte of low byte * 50
W $05:CEF0 STA $02 ; [$0F40] -= step; [$02] = new remaining bonus
W $05:D862 STA $02
R $05:D87D ORA $02
W $05:D966 STA $02 ; [$02] = $05F200[Y]
R $05:D977 LDA $02
W $05:D984 STA $02 ; [$02] = $05F400[Y]
R $05:D98F LDA $02
R $05:D9BD LDA $02
R $05:D9E1 LDA $02
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
R $07:F20A ADC $02
W $0C:94F1 STA $02 ; [$02] = Map16 number, low byte
R $0C:94F9 LDA $02
W $0C:9EFA STA $02 ; [$02] = starting column
R $0C:9F0E ADC $02
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
R $0C:A125 LDA $02
W $0C:A151 STZ $02
W $0C:A163 STA $02 ; $00 = $02 = [$00] + $0080: X position of the first banner half (left edge)
W $0C:A178 STA $02
R $0C:A1BE LDA $02
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:A6DE STA $02
W $0C:A6FC STA $02 ; $02 = $9F: Y position
R $0C:A855 LDA $02
R $0C:A875 LDA $02
W $0C:A87A STA $02
R $0C:A8F5 LDX $02 ; X = OAM offset [$02]
RW $0C:A92C INC $02
RW $0C:A92E INC $02
RW $0C:A930 INC $02 ; OAM offset [$02] += 4
RW $0C:A932 INC $02
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]
R $0C:AA2F LDA $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
R $0C:CC35 LDA $02
W $0C:CCCE STA $02 ; $02 = Y position of the current row = $57
R $0C:CCF2 LDA $02
R $0C:CD17 LDA $02
W $0C:CD1C STA $02 ; Y position [$02] += $10 (next row down)
W $0C:CE33 STA $02
W $0C:CF96 STA $02
W $0C:D056 STX $02
W $0C:D074 STA $02
R $0C:D0A8 LDA $02
W $0C:D4AF STX $02
R $0C:D4D1 ADC $02 ; OAM Y = Mario Y + Y offset + [$02]
W $0C:D71C STA $02
R $0C:D72A BIT $02
R $0C:D749 LDA $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--
W $0D:A8CB STA $02
RW $0D:A943 DEC $02 ; Columns left in the row: $02--
R $0D:A945 LDA $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:ABBB INC $02
RW $0D:ABBD INC $02 ; $02 += 2: the next row has two more tiles
R $0D:ABEC LDX $02
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
RW $0D:AC5A INC $02
R $0D:AC89 LDX $02 ; X = row length
W $0D:AC96 STA $02
R $0D:ACA7 LDX $02 ; X = number of tiles in this row
R $0D:AD03 LDA $02
W $0D:AD08 STA $02 ; [$02] += 4 (each lower row is 4 tiles longer)
R $0D:AD37 LDX $02
W $0D:AD48 STX $02
RW $0D:AD95 INC $02
RW $0D:AD97 INC $02
R $0D:AD99 LDX $02
W $0D:ADA7 STX $02
RW $0D:ADE2 INC $02
R $0D:ADE4 LDX $02
W $0D:ADEF STX $02 ; [$02] = 3 (slope tiles in first row)
R $0D:AE5C LDA $02
W $0D:AE61 STA $02
R $0D:AE63 LDX $02 ; [$02] += 4, X = [$02] (next row is 4 tiles longer)
W $0D:AE78 STA $02
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
R $0D:AECC LDA $02
W $0D:AED1 STA $02 ; [$02] -= 2 (each lower row is 2 tiles shorter)
W $0D:AF07 STA $02
RW $0D:AF09 INC $02 ; [$02] = 2*height + 1 (width of the first row)
R $0D:AF12 LDX $02 ; X = tiles in row
R $0D:AF4F LDA $02
W $0D:AF54 STA $02 ; [$02] -= 2 (next row is 2 tiles shorter)
W $0D:AF6B STA $02
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
R $0D:AFA7 LDX $02 ; X = row length
R $0D:AFAF LDA $02
W $0D:AFB4 STA $02 ; [$02]-- (row is one tile shorter)
W $0D:AFF4 STA $02 ; [$00] = [$02] = size >> 4 (height)
R $0D:AFFD LDX $02 ; X = tiles in row
R $0D:B02A LDX $02
W $0D:B02D STX $02 ; [$02] = X - 1 (row is one tile shorter)
W $0D:B1CF STA $02 ; [$02] = 2 (height)
W $0D:B1E1 STA $02 ; [$02] = height (high nibble)
RW $0D:B20D DEC $02
W $0D:B22A STA $02 ; [$02] = type (0 = midway gate, nonzero = goal gate)
R $0D:B241 LDA $02
R $0D:B26B LDA $02
R $0D:B295 LDA $02
W $0D:B3EB STA $02
RW $0D:B407 DEC $02
RW $0D:B418 DEC $02
W $0D:B424 STA $02 ; Reload width
W $0D:B617 STA $02 ; Reload width
RW $0D:B62C DEC $02
RW $0D:B64E DEC $02
W $0D:B668 STA $02 ; Reload width
RW $0D:B67D DEC $02
RW $0D:B69F DEC $02
W $0D:B754 STA $02 ; $02 = tiles left in this row
RW $0D:B761 DEC $02
W $0D:B77B STA $02 ; $02 = tiles left in this row (widest rows)
RW $0D:B788 DEC $02
W $0D:B7B2 STA $02 ; $00 = $02 = height = low nibble of [$59]
RW $0D:B809 DEC $02
W $0D:B86B STA $02 ; $00 = $02 = width = low nibble of [$59]
RW $0D:B8C3 DEC $02
W $0D:B932 STA $02 ; $02 = tiles left in this row
RW $0D:B953 DEC $02
W $0D:BAF4 STA $02 ; $02 = tiles left in this row
RW $0D:BAFE DEC $02
W $0D:C35C STA $02 ; $02 = 0: first row has 1 conveyor tile (count - 1)
R $0D:C370 LDA $02
RW $0D:C39E INC $02 ; Next row is one tile wider
R $0D:C3CD LDA $02
W $0D:C3DC STA $02 ; $02 = 0: width of the first row
RW $0D:C421 INC $02 ; Next row is one tile wider
R $0D:C423 LDA $02
W $0D:C48F STA $02 ; $02 = tiles left in this row
RW $0D:C4A8 DEC $02
W $0D:DB0A STA $02 ; First line width = 1; [$02] = [$00] = 1
R $0D:DB1B LDX $02 ; X = line width counter
RW $0D:DB53 INC $02
RW $0D:DB55 INC $02 ; Line width += 2 (each line grows by one tile each side)
R $0D:DB84 LDX $02
W $0D:DB93 STA $02 ; First line width = 0; [$02] = [$00] = 0
R $0D:DBA4 LDX $02 ; X = line width counter
RW $0D:DBCA INC $02 ; Line width += 1
R $0D:DBF9 LDX $02 ; X = line width so far
W $0D:DC06 STX $02 ; First line width = 1; [$02] = [$00] = 1
RW $0D:DC53 INC $02
RW $0D:DC55 INC $02 ; Line width += 2
R $0D:DC57 LDX $02 ; Reload the line width
W $0D:DC65 STX $02 ; First line width = 0; [$02] = [$00] = 0
RW $0D:DCA0 INC $02 ; Line width += 1
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
RW $0D:E165 DEC $02
W $0D:ECA8 STA $02 ; [$02] = row width counter
RW $0D:ECB5 DEC $02 ; X++; repeat for 2 tiles per row
W $0D:ECD6 STA $02
RW $0D:ECF4 DEC $02
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
RW $0D:EFCE DEC $02
RW $0D:EFF1 DEC $02
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)
R $00:86F5 LDY $03 ; Restore Y
W $00:8704 STA $03 ; [$03] = index
R $00:8707 ADC $03
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
R $00:8753 LDA $03
R $00:8783 LDA $03
W $00:8795 STX $03
R $00:8799 ADC $03
W $00:8ED0 STA $03
W $00:8EFE STA $03
W $00:8F8D STZ $03 ; [$00], [$01], [$03] = 0: clear the high bytes of the 32-bit input
W $00:A4AA STA $03 ; [$03] = length
R $00:A4C3 ADC $03 ; Y += length: next record
R $00:CAE7 LDA $03
R $00:CAF5 SBC $03
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:8E3D LDX $03 ; X = wing number
W $01:9D15 STA $03
R $01:9D49 ORA $03 ; Properties = GeneralSprGfxProp[X] | [$03]
W $01:A0F4 STA $03
R $01:A11F LDA $03
W $01:A44E STA $03
W $01:A496 STA $03
W $01:AC23 STA $03 ; Entry 3: [$03] = 6 (selects the wide horizontal margin), skip to common code
W $01:AC2D STA $03
W $01:AC31 STZ $03 ; Entry 0: [$03] = 0
R $01:AC57 ORA $03
W $01:B3E3 STA $03 ; $03 = sprite palette bits
R $01:B405 ORA $03 ; A = priority bits [$64] | palette [$03]
W $01:B719 STZ $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
R $01:B804 ADC $03
W $01:BB38 STA $03 ; $03 = OAM index
R $01:BBCC LDY $03 ; Y = OAM index
W $01:BC29 STA $03
W $01:BCF8 STA $03 ; $03 = ([FrameCounterB] / 2) & $0F: phase index for the X offset
R $01:BD1A LDX $03 ; X = X phase index
R $01:BD38 LDA $03
W $01:BD3F STA $03 ; [$03] = ([$03] + 5) & $0F
R $01:BD5E LDA $03
W $01:BD65 STA $03 ; [$03] = ([$03] + 5) & $0F
W $01:BF81 STY $03 ; [$03] = 1 if Mario is to the left
R $01:BFD5 LDY $03
W $01:C81C STA $03 ; [$03] = Y step, high byte
R $01:C89F ADC $03
W $01:C925 STA $03 ; [$02] = pivot X (16-bit) - 8
R $01:C94E ADC $03
W $01:CA1E STA $03 ; [$03] = platform screen Y
R $01:CC44 LDA $03
R $01:CC7C LDA $03
W $01:D3DC STA $03
W $01:D48E STA $03 ; [$03] = frame * 2 (tile index)
R $01:D4CE ADC $03 ; + frame * 2
W $01:D807 STA $03
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
R $01:DCB5 CPX $03 ; All tiles drawn?
W $01:DFF6 STA $03 ; $03 = X position of that position (DATA_01DD91)
R $01:E004 CMP $03
W $01:E8FF STA $03 ; $03 = 3: puff counter
R $01:E901 LDA $03 ; A = puff counter
RW $01:E93E DEC $03 ; Next puff
W $01:EEA3 STZ $03
W $01:F564 STA $03 ; $03 = tongue hitbox height
W $01:F7D8 STA $03 ; $03 = egg Y high
R $01:F80B LDA $03 ; A = egg Y high
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
R $02:835C LDA $03
W $02:8361 STA $03 ; $03 += 4: next spare slot
W $02:84A6 STA $03 ; $03 = A: X spacing between splashes
R $02:84B3 ADC $03
W $02:8BEB STA $03 ; To [$03]
R $02:8BFF LDA $03
W $02:9209 STA $03 ; $03 = camera X low
R $02:9224 CMP $03
R $02:923F SBC $03
W $02:9286 STA $03 ; $03 = screen number
R $02:92A4 LDX $03 ; X = screen number
W $02:92EB STA $03 ; $03 = screen number
R $02:92F7 LDX $03 ; X = screen number
W $02:9562 STA $03
R $02:9588 LDX $03 ; X = screen number
W $02:95DC STA $03
R $02:95EA LDX $03 ; X = screen number
W $02:9692 STA $03 ; $03 = height
W $02:96B5 STA $03 ; $03 = height $10
W $02:9A16 STA $03 ; [$03] = layer X position low
R $02:9A2D SBC $03 ; A = coin X - layer X (8-bit)
W $02:9DC5 STY $03
R $02:9E00 LDX $03 ; X = [$03]
W $02:A56B STA $03 ; $03 = height $13
W $02:A62D STA $03
R $02:A652 LDX $03 ; X = screen number
W $02:A6AA STA $03
R $02:A6B8 LDX $03 ; X = screen number
W $02:A893 STY $03 ; $03 = data offset
W $02:A8A3 STY $03 ; $03 = data offset
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:AE97 SBC $03
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:B741 STA $03
R $02:B776 LDA $03
W $02:BEC4 STA $03
R $02:BEDD ORA $03
W $02:BF82 STA $03 ; [$03] = [$1558] (eye timer)
R $02:BFA4 LDX $03
W $02:C8B9 STA $03 ; [$03] = direction
R $02:C8D1 LDX $03
R $02:CA2B LDY $03
W $02:CC51 STA $03
W $02:CEF0 STA $03 ; [$03] = [$C2] (compression, signed)
R $02:CF18 LDA $03
W $02:D021 STA $03 ; [$03] = entry point value
W $02:D025 STZ $03 ; [$03] = 0
R $02:D032 LDA $03
R $02:D051 ORA $03 ; [$01] = [$13] bit 0 | [$03]: alternates the limit used each frame
W $02:D0FC STA $03
R $02:D123 LDX $03
W $02:D17E STA $03 ; [$03] = X high
R $02:D18A LDX $03 ; X = screen number
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]
R $02:DA1F LDA $03
W $02:E3BE STA $03 ; $03 = wobble Y offset
R $02:E3F1 ADC $03
R $02:E3F7 SBC $03
W $02:ECF2 STA $03 ; [$03] = frame * 4: first tile index of this frame
R $02:ECF7 LDA $03
W $02:EEEA STA $03 ; [$02] = $0110
W $02:F116 STA $03 ; [$03] = animation counter [$1570]
R $02:F130 LDA $03
W $02:F77A STA $03 ; [$03] = animation frame (0-3) = [DATA_02F749+Y]
R $02:F791 LDA $03
R $02:F7B7 LDA $03
R $02:F7EA LDA $03
RW $02:FB70 LSR $03
W $02:FE79 STZ $03 ; [$02] = width, [$03] = 0
W $02:FEA2 STA $03 ; [$02] = sprite Y + 3 (16-bit)
W $03:83CC STA $03
R $03:83D0 ADC $03
W $03:85AA STA $03 ; [$03] = [$14] & 4: animation frame offset (0 or 4), changes every 4 frames
R $03:85D9 ORA $03
W $03:8854 STA $03 ; [$03] = 0 or 4: animation frame (changes every 4 frames, per sprite)
R $03:8878 ADC $03
W $03:8B48 STA $03 ; [$03] = ([$04] EOR 1) - 1: loop end index
R $03:8B9C CPX $03
W $03:8CF5 STA $03
W $03:8F2A STA $03
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:91BE EOR $03
W $03:9699 STA $03
R $03:96A5 ORA $03 ; A = frame start + tile counter (index of this tile)
R $03:96D6 LDX $03
W $03:97AE STA $03
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
R $03:9B8F LDA $03 ; A = frame offset
R $03:9BAE ORA $03
W $03:9EAC STA $03 ; $03 = lowest flame segment to draw
R $03:9F20 CPX $03 ; Compare with lowest segment [$03]
W $03:A0A5 STA $03
R $03:A0CE ADC $03
W $03:A2C8 STA $03
W $03:A3EA STA $03
R $03:A417 LDX $03
R $03:AAC8 LDA $03
W $03:ACCB STY $03 ; [$03] = frame number
W $03:B391 STA $03
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)
R $03:B883 ORA $03
W $03:C278 STA $03 ; [$03] = blade segment Y spacing
R $03:C29D ADC $03 ; + spacing
R $03:C2A6 ADC $03 ; + spacing
W $03:C3FA STA $03
R $03:C429 ADC $03 ; X = frame * 3 + tile index
W $03:CA6E STA $03
R $03:CA8F LDA $03
W $03:CB3D STA $03
R $03:CB5E LDA $03
W $03:D99A STA $03 ; $03 = 0: first of the two tile rows of this block row
R $03:D9B3 ORA $03
R $03:D9D4 LDA $03
W $03:DDCE STA $03 ; $03 = $80: number of 3bpp tiles to convert
RW $03:DDD3 DEC $03
W $04:8088 STZ $03 ; [$03] = 0: index into DATA_048000
R $04:808C LDX $03
R $04:80A8 LDA $03
W $04:80AC STA $03
W $04:8696 STA $03
R $04:8714 LDA $03
W $04:DAC0 STA $03
RW $04:DACF DEC $03
R $04:DAD6 LDA $03
W $04:DADA STA $03 ; [$03] = repeat count - 1
RW $04:DAE5 DEC $03
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
RW $04:EB1E DEC $03 ; Next column
W $04:EC30 STA $03 ; [$03] = 3: four sprites
RW $04:EC56 DEC $03 ; Next sprite
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
R $04:FB1A LDA $03
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
RW $04:FE58 INC $03 ; Carry: [$03]++
RW $04:FE79 DEC $03 ; Borrow: [$03]--
W $05:812C STY $03
R $05:813A LDY $03 ; Y = source offset [$03]
W $05:8143 STY $03 ; [$03] = Y
W $05:8156 STY $03 ; [$03] = Y
R $05:816C LDY $03 ; Y = source offset
W $05:8175 STY $03 ; [$03] = Y
R $05:818A LDY $03 ; Y = source offset
W $05:865E STA $03 ; [$03] = pointer (bank 0)
R $05:8676 LDA [$03],Y
R $05:867F LDA [$03],Y
W $05:8BA7 STY $03
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
W $05:8C8B STY $03
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
R $05:B20A BIT.W $0003
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
R $05:CE9E ADC $03
W $05:CEA0 STA $03 ; [$03] += low byte of (high byte * 50): [$02] = timer * 50
W $0C:9451 STY $03
R $0C:945B LDY $03 ; Y = source index
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
R $0C:9492 LDY $03 ; Y = 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:B23F STA $03
W $0D:B249 STA $03 ; [$03] = top tile of column X (midway table; goal table if type != 0)
R $0D:B24E LDA $03
W $0D:B269 STA $03
W $0D:B273 STA $03 ; [$03] = middle tile of column X (midway or goal table)
R $0D:B278 LDA $03
W $0D:B293 STA $03
W $0D:B29D STA $03 ; [$03] = bottom tile of column X (midway or goal table)
R $0D:B2A2 LDA $03
W $0D:B60C STA $03 ; Height
RW $0D:B6B9 DEC $03
W $0D:B7BA STA $03 ; $03 = width = high nibble of [$59]
RW $0D:B849 DEC $03
W $0D:B873 STA $03 ; $03 = height = high nibble of [$59]
RW $0D:B911 DEC $03
W $0D:C372 STA $03 ; $03 = tiles left in this row (excluding the conveyor tile)
RW $0D:C37E DEC $03
RW $0D:C397 DEC $03
W $0D:C3CF STA $03 ; Reload the row width
RW $0D:C3FB DEC $03
R $0D:C3FD LDA $03
W $0D:C425 STA $03 ; $03 = tiles left in this row
W $0D:DF7E STA $03 ; [$03] = 7: draw 8 canvasses
RW $0D:E005 DEC $03

$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)
R $00:902E LDA $04
W $00:9D5B STX $04 ; File counter [$04] = 2 (files 2, 1, 0)
R $00:9DAF LDX $04
W $00:A494 STZ $04 ; [$04] = 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
R $00:AA11 LDA $04,X
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
R $00:AA52 LDA $04,X
R $00:AB57 LDA $04
R $00:AB5F LDA $04
W $00:AB64 STZ $04
RW $00:AB68 ROL $04
RW $00:AB6C ROL $04
RW $00:AB75 ROL $04 ; Shift in 1 bit from byte 1: pixel 2 complete
R $00:AB77 LDA $04
R $00:AB7F LDA $04
R $00:AB87 LDA $04
W $00:AB8C STZ $04
RW $00:AB90 ROL $04
RW $00:AB99 ROL $04
RW $00:AB9D ROL $04
R $00:AB9F LDA $04
R $00:ABA7 LDA $04
R $00:ABAF LDA $04
W $00:ABC4 STZ $04
RW $00:ABC8 ROL $04
RW $00:ABCC ROL $04
RW $00:ABD0 ROL $04
W $00:ABF2 STA $04
W $00:ABFD STA $04
W $00:AC0D STA $04
W $00:AC24 STA $04
W $00:AC5B STA $04
W $00:AC84 STA $04
W $00:ACAD STA $04
W $00:ACC4 STA $04
W $00:ACDB STA $04
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)
R $00:AD11 LDA $04
W $00:AD17 STA $04
W $00:AD4F STA $04
W $00:AD66 STA $04
W $00:AD7D STA $04
W $00:AD94 STA $04
W $00:ADB0 STA $04
W $00:ADC7 STA $04
W $00:ADEC STA $04
W $00:AE03 STA $04
W $00:AE32 STA $04
R $00:AF5E LDA $04
R $00:AF7F LDA $04
R $00:AF93 LDA $04
W $00:AFDA STZ $04 ; [$04] = 0: result color
RW $00:AFFF TSB $04 ; Merge it into the result [$04]
R $00:B01F LDA $04
R $00:B028 SBC $04
R $00:B078 LDA $04
W $00:BF0B STA $04 ; $04 = low byte of the screen table address for this mode
R $00:BF1D LDA [$04],Y
R $00:BF24 LDA [$04],Y
W $00:BF4B STA $04 ; $04 = tilemap page
W $00:BF55 STA $04
R $00:BF63 ORA $04
W $00:BF6E STA $04 ; $04 = column offset
R $00:BF74 ORA $04
W $00:C01A STA $04
R $00:C028 ORA $04 ; $04 |= (block X & $80) / 128: left or right half of the screen
W $00:C02A STA $04
R $00:C033 LDA $04
W $00:C038 STA $04
R $00:C047 ADC $04 ; $04 += word from DATA_00BFFF
W $00:C049 STA $04
W $00:C07E STA $04
R $00:C089 ORA $04
W $00:C0CB STA $04
R $00:C0D6 ORA $04
W $00:C17F STA $04 ; [$04] = pointer to the tile's 8 bytes of tile words (table at $0FBE)
R $00:C184 LDA [$04],Y
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:C1B6 STA $04
R $00:C1C1 ORA $04
W $00:C261 STA $04 ; [$04] = pointer to the tile's tile words (table at $0FBE)
R $00:C266 LDA [$04],Y
R $00:C272 LDA [$04],Y
R $00:C27E LDA [$04],Y
R $00:C28A LDA [$04],Y
W $00:C353 STA $04 ; [$04] = bank
W $00:C3D8 STA $04
R $00:C3E3 ORA $04
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)
R $00:CC46 LDA ($04),Y
W $00:E38D STA $04 ; [$04] = $C8 (tile size bits: 16x16, 16x16, 8x8, 8x8, 16x16...); $E8 for image $43
R $00:E3E4 LDX $04
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)
R $00:F89F LDA $04
W $01:8DFF STA $04 ; [$04] = sprite direction
R $01:8E0E LDX $04 ; X = direction
R $01:8E3F LDA $04
W $01:9D1C STA $04 ; [$04] = tile counter, 3 down to 0
R $01:9D1F LDX $04 ; X = tile counter
R $01:9D36 ADC $04
R $01:9D43 ADC $04 ; X = [$05] * 4 + tile counter
RW $01:9D52 DEC $04
W $01:9E43 STA $04 ; [$04] = sprite X position high
R $01:9E5C LDA $04
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)
R $01:9F44 ORA $04
W $01:B801 STA $04 ; $04 = tile X in the level = offset + sprite X low
R $01:B846 LDA $04
W $01:B90C STA $04 ; $04 = sprite X low - [$00]
W $01:C842 STA $04 ; [$04] = X step per link, low byte
R $01:C8BC ADC $04
W $01:C94B STA $04
R $01:C985 LDA $04
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
R $01:CB93 LDA $04 ; Low word
W $01:CB9B STA $04 ; [$04] = +/- radius Y * sine (low word)
R $01:CBA7 LDA $04
W $01:CBAC STA $04 ; [$04] += [$08]
R $01:CBD2 LDA $04 ; Low word
R $01:CBFB LDA $04 ; Low word
W $01:CC03 STA $04 ; [$04] = +/- radius X * sine (low word)
R $01:CC0F LDA $04
W $01:CC14 STA $04
W $01:CC38 STA $04 ; [$04] = low word of [$00] * [$02]
W $01:D410 STA $04
W $01:D7B8 STA $04 ; To [$04]
R $01:D7BF LDA ($04),Y ; Table byte for this step
R $01:D7C5 LDA ($04),Y ; Table byte again
W $01:D822 STA $04
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
R $01:E017 LDA $04
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
R $02:87DC LDA $04
W $02:87F6 STA $04
R $02:8807 LDA $04 ; Bounce type [$04]
W $02:880D STZ $04 ; [$04] = 0
R $02:8818 LDA $04 ; Bounce type [$04]
R $02:882A LDA $04
W $02:8CCE STA $04
W $02:920E STA $04 ; $04 = camera Y high
R $02:921D SBC $04
W $02:9A1B STA $04 ; [$04] = layer Y position high
R $02:9A25 SBC $04
W $02:A523 STA $04
W $02:A8DF STA $04 ; [$04] = initial sprite status
R $02:A973 LDA $04
W $02:AB7D STA $04 ; [$04] = sprite number
R $02:ABA0 LDA $04
W $02:AE6B STA $04 ; $04 = screen X
R $02:AE77 SBC $04
R $02:AE86 CMP $04
R $02:AEB5 SBC $04
R $02:AF02 SBC $04
W $02:AF43 STA $04 ; $04 = counter
R $02:AF6B LDY $04 ; Y = counter
RW $02:AF82 DEC $04 ; Counter--
W $02:AFAD STA $04 ; $04 = counter
R $02:AFC3 LDY $04 ; Y = counter
RW $02:AFF9 DEC $04 ; Counter--
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)
W $02:BA20 STA $04
R $02:BA31 ADC $04 ; [$05] = low byte of the map16 address
W $02:BA4C STA $04
R $02:BA6B ORA $04 ; [$04] = column (X low >> 4) | row (Y low & $F0)
W $02:BA6D STA $04
R $02:BA7E ADC $04
W $02:BB31 STA $04 ; [$04] = sprite X high
R $02:BB4A LDA $04
W $02:C891 STY $04 ; Y = pose [$1602], copy to [$04]
R $02:C8CC LDX $04
R $02:C8DE LDX $04
R $02:CA29 LDA $04 ; A = pose [$04]
R $02:CA37 LDY $04
R $02:CA52 LDX $04 ; X = pose
R $02:CA9D LDA $04
W $02:CEF7 STA $04 ; [$04] = |[$C2]|
R $02:CEFC LDA $04 ; A = |[$C2]|
R $02:CF00 ADC $04
W $02:D675 STA $04 ; [$04] = sine
R $02:D689 LDA $04 ; A = sine low byte
W $02:D6AA STA $04 ; [$04] = X offset from the pivot
R $02:D6E2 LDA $04 ; A = X offset
W $02:ECF5 STZ $04 ; [$04] = 0: tile counter
R $02:ECFA ADC $04
RW $02:ED6F INC $04 ; [$04]++
R $02:ED71 LDA $04
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)
R $02:FB33 LDA $04
W $02:FB54 STA $04 ; [$04] = X offset from the ring center
R $02:FB81 LDA $04
W $02:FEB0 STA $04 ; [$04] = height
R $02:FEBB CMP $04 ; Mario Y - sprite Y + $1C must be below the height
W $03:83D7 STA $04 ; [$04] = sprite direction [$157C]
R $03:83E9 LDA $04
W $03:8B43 STA $04 ; [$04] = graphics frame
R $03:8B7D LDA $04
W $03:9101 STA $04
W $03:9186 STA $04 ; $04 = animation frame [$1602]
R $03:91CA LDA $04
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
R $03:99AC LDA $04 ; A = X offset
W $03:9DCA STA $04 ; $04 = X position low + flame X offset
W $03:9E54 STA $04 ; $04 = frame
R $03:9E7B LDA $04
R $03:9E89 LDA $04
W $03:9EB1 STA $04 ; $04 = frame
R $03:9EBD LDX $04 ; X = frame
R $03:9ECA LDA $04 ; A = frame
R $03:9EF6 LDX $04 ; X = frame
W $03:AACC STA $04
R $03:AAD4 ADC $04 ; X = counter + [$04]: table index
W $03:AF5F STA $04 ; [$04] = Bowser direction
R $03:AFB2 LDA $04
W $03:B385 STA $04 ; $04 = palette bits
R $03:B3BE ORA $04 ; Properties | palette | priority bits [$64]
W $03:B6B6 STA $04
R $03:B731 SBC $04,X ; Low byte of distance between hitbox origins (B - A); save it
R $03:B744 LDA $04,X
W $03:C27D STA $04 ; [$04] = blade tile properties
R $03:C2C9 LDA $04
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
R $03:CA7B ADC $04
R $03:CABB EOR $04
W $03:CADC STX $04 ; $04 = particle index
R $03:CB4A ADC $04
R $03:CB8A EOR $04
W $03:D9AA STA $04 ; $04 = 16 blocks per row
RW $03:D9C5 DEC $04
W $03:DF67 STA $04 ; $04 = row width - 1: tile counter
RW $03:DF7B DEC $04
W $04:82C6 STA $04 ; [$04] = |delta X| / 2
R $04:82F0 LDY $04,X
W $04:8664 STA $04
R $04:868A LDA $04
W $04:86CC STA $04
R $04:8751 LDA $04
W $04:8756 STA $04
R $04:878D LDA $04
R $04:8978 LDA $04
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:8E10 LDX $04 ; X = tile offset
R $04:8E78 LDX $04 ; X = tile offset
R $04:8E8B LDX $04
R $04:8F43 LDX $04 ; X = tile offset
R $04:8F61 LDX $04 ; X = tile offset
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:92CB LDA $04
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:948F LDA $04
R $04:9497 CMP $04 ; Compare |dY| with |dX|
R $04:949D LDA $04 ; Otherwise swap: [$0A] = |dY| (major), [$0C] = |dX| (minor)
R $04:9540 LDX $04 ; X = tile position
R $04:95CE LDX $04 ; X = tile position
R $04:96BE LDX $04 ; X = tile position
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]
W $04:977C STA $04
R $04:9788 LDA $04
W $04:978E STA $04
R $04:9798 LDA $04
W $04:988A STA $04
R $04:9895 ADC $04
W $04:9897 STA $04
R $04:98A2 ADC $04
W $04:98A4 STA $04
R $04:98AD LDA $04
W $04:98B3 STA $04
R $04:98BD LDA $04
W $04:98C3 STA $04
R $04:9938 LDX $04 ; X = tile position
R $04:994E LDX $04 ; X = tile position
W $04:D813 STA $04
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
R $04:DA81 LDA [$04],Y ; Load the tile
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
R $04:E503 LDA $04
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
R $04:E553 LDA $04
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?
RW $04:E7E5 DEC $04 ; Next column
W $04:E865 STA $04 ; [$04] = 5: six columns
R $04:E87B LDA $04 ; Last column already?
RW $04:E8A5 DEC $04 ; Next column
W $04:EA3B STA $04 ; [$04] = destination
R $04:EA52 LDX $04 ; X = destination offset
W $04:EB01 STA $04 ; [$04] = flips
R $04:EB0A ORA $04 ; Add flips
W $04:F8DA STA $04
R $04:F8F6 LDA $04
W $04:FC7E STA $04 ; [$04] = 3: number of puffs
RW $04:FCD9 DEC $04
W $04:FCE6 STA $04 ; [$04] = 4: number of tiles in Bowser's sign
RW $04:FD05 DEC $04
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 $04:FE46 LDA $04 ; A = [$04]
R $04:FFAB LDA $04 ; A = Z speed
W $05:822B STZ $04
W $05:C06B STA $04
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:C0DE LDA $04
R $05:C0E6 CMP $04 ; Y distance < X distance?
R $05:C0EC LDA $04
W $05:C1E5 STA $04 ; [$04] = position (the larger)
W $05:C1ED STX $04 ; [$04] = limit
R $05:C1F3 CMP $04 ; Not equal (limit not reached): skip the turn-around
W $05:C532 STA $04
W $05:C53A STX $04 ; Same, other order
R $05:C540 CMP $04 ; Smaller < larger: not at the turnaround yet, go to $05C585
W $05:C5CE STA $04
W $05:C5D6 STX $04 ; Same, other order
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 $05:CE20 LDA $04
W $07:F1CD STA $04 ; $04 = timer
R $07:F21C LDX $04 ; X = bonus display timer [$04]
W $0C:94DB STY $04 ; [$04] = $00F0: source index of the first Map16 number
R $0C:94ED LDY $04 ; Y = source index
RW $0C:953F INC $04 ; Next source entry: [$04]++
R $0C:954A LDA $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]
R $0C:9F99 CMP $04
W $0C:A153 STZ $04 ; $00 = $02 = $04 = 0: X work values cleared
R $0C:A170 SBC $04
W $0C:A67E STA $04
W $0C:A83A STA $04 ; $04 = 1: draw two rows
RW $0C:A89C DEC $04
W $0C:A9A8 STA $04 ; $04 = 2: three pairs of tiles to draw
R $0C:A9EE LDA $04
RW $0C:AA06 DEC $04
W $0C:ABFA STA $04 ; $04 = 0: buffer offset
R $0C:AC01 LDX $04 ; X = buffer offset
R $0C:AC14 LDA $04
W $0C:AC1A STA $04
R $0C:B5FA SBC $04
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
R $0C:CD13 LDA $04
W $0C:CE67 STY $04 ; $04 = prop
R $0C:CE82 LDA $04
W $0D:A6B3 STA $04
R $0D:A6BA LDA $04
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
R $0D:E037 LDY $04

$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:86FA STY $05 ; Save Y in [$05]
R $00:8719 LDY $05 ; Restore Y
W $00:8748 STA $05 ; [$05] = $08 if RLE (bit 6) else 0: DMA 'fixed source' flag
R $00:876C LDA $05 ; A = RLE 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
RW $00:9D5D LSR $05
W $00:BF10 STA $05 ; $05 = high byte of the screen table address
W $00:BF5E STA $05 ; $05 = row offset low part
R $00:BF70 LDA $05
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:E4B2 INC $05
RW $00:E4B4 INC $05 ; [$05] += 2: next position entry
W $00:F1D0 STA $05 ; [$05] = contents for the bounce sprite spawner
W $00:F21E STA $05 ; [$05] = 5
W $00:F23C STZ $05 ; [$05] = 0 (no contents)
W $00:FA1B STY $05
W $01:8DF7 STA $05 ; [$05] = wing frame = A + [$1602,X]
R $01:8E29 LDX $05 ; X = wing frame [$05]
R $01:934B LDA [$05],Y
R $01:9359 CMP [$05],Y
R $01:935D LDA [$05],Y
W $01:949D STA $05
W $01:9510 STA $05
R $01:952A LDA [$05]
R $01:9531 LDA [$05] ; A = map16 high byte (page)
W $01:9CF5 STA $05 ; [$05] = property row
R $01:9D3F LDA $05
R $01:A89B LDA $05
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
R $01:C8C2 ADC $05
W $01:C950 STA $05 ; [$04] = world X of this tile = delta + pivot world X (16-bit)
R $01:C98A LDA $05
W $01:CAB5 STA $05
R $01:CBB4 LDA $05
R $01:CC20 SBC $05
W $01:CC3D STA $05 ; [$05] = high byte of that product (starts the 32-bit sum)
R $01:CC50 ADC $05
W $01:CC52 STA $05 ; [$05] += low byte of [$00] * [$03]
R $01:CC6C ADC $05
W $01:CC6E STA $05 ; [$05] += low byte of [$01] * [$02]
W $01:D17F STA $05
R $01:D1BE LDA.W $0005,Y
W $01:D42F STA $05 ; Hitbox Y low [$05]
W $01:D7BD STA $05 ; To [$05]
W $01:D830 STA $05
R $01:D836 CMP $05 ; Probe is in the sprite's own tile: ignore it, next probe
W $01:D96B STA $05
W $01:D97F STA $05
R $01:D990 LDA [$05] ; A = Map16 tile number (low byte)
R $01:D997 LDA [$05] ; A = byte at $7F:xxxx
W $01:D99A STY $05 ; $05 = tile column
R $01:D99D LDA $05
R $01:E019 CMP $05
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)
R $01:F6EC LDA $05
W $01:FCAC STA $05 ; [$05] = Mario Y [$80] + $10
W $01:FD26 STA $05 ; [$05] = fireball Y - screen Y
W $01:FEC3 STY $05 ; [$05] = state
R $01:FF10 LDX $05 ; X = state
W $02:8285 STA $05 ; $05 = -[screen X low]: full-speed scroll offset
R $02:87DF LDA $05
W $02:87F3 STA $05
R $02:887D LDA $05 ; Sprite to spawn from the block [$05]
R $02:8885 LDA $05 ; Sprite index [$05]
R $02:88DC LDY $05 ; Y = sprite index [$05]
R $02:8925 LDY $05 ; Y = sprite index
W $02:8CDD STA $05
W $02:9213 STA $05 ; $05 = camera X high
R $02:9229 SBC $05
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]
R $02:9321 LDA [$05]
R $02:9328 LDA [$05]
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:9611 LDA [$05]
R $02:9618 LDA [$05] ; A = tile number high byte
W $02:A538 STA $05
W $02:A663 STA $05
W $02:A6C9 STA $05
R $02:A6E2 LDA [$05]
R $02:A6E9 LDA [$05] ; A = Map16 high byte
R $02:A714 CMP [$05],Y
R $02:A718 LDA [$05],Y
W $02:A863 STA $05 ; $05 = sprite number
R $02:A874 LDA $05
R $02:A8EF LDA $05
R $02:A8FE LDA $05
R $02:A922 LDA $05 ; Sprite number
R $02:AE7C SBC $05
R $02:AE8B SBC $05
W $02:B743 STZ $05 ; [$05] = 0: current squish offset
W $02:B778 STA $05 ; Segment moved: [$05] = squish offset [$03]
R $02:B77C SBC $05
W $02:BA0A STA $05 ; [$05] = Y high byte (screen)
R $02:BA22 LDX $05 ; X = screen number
W $02:BA33 STA $05
W $02:BA80 STA $05 ; [$05] = low byte of the map16 address of the tile
R $02:BA99 LDA [$05]
R $02:BAA0 LDA [$05]
W $02:BF78 STZ $05 ; [$05] = 0: tile counter
R $02:BF84 LDX $05 ; X = tile counter
RW $02:BFB8 INC $05 ; [$05]++ (next tile)
R $02:BFBA LDA $05
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
R $02:CB5F LDA $05
W $02:CEEC STA $05 ; [$05] = sprite number - $6B (bit 0 = which wall: mirrors the X offsets)
R $02:CF05 LDA $05
W $02:D134 STA $05
W $02:D19B STA $05
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
RW $02:DE9C DEC $05
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
R $02:F13A ADC $05
W $02:F9D9 STA $05 ; [$05] = flame Y low + [DATA_02F9AA+Y] (hitbox Y)
R $02:FB3A LDY $05
W $03:83DC STA $05 ; [$05] = sprite properties [$15F6]
R $03:83EF ORA $05
W $03:8B4D STA $05 ; [$05] = sprite palette
R $03:8B6B ORA $05
W $03:9116 STA $05
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:B6D3 STA $05
W $03:C3E6 STA $05 ; [$05] = turn timer [$15AC]
R $03:C40B LDA $05
W $03:C9EC STA $05
R $03:CA78 LDA $05
R $03:CA98 LDA $05
R $03:CAAF LDA $05
R $03:CB47 LDA $05
R $03:CB67 LDA $05
R $03:CB7E LDA $05
W $03:D97A STA $05
R $03:D9AC LDA [$05],Y ; A = block number from the layout
W $03:DDEA STA $05 ; $05 = 8 rows per tile
RW $03:DE0F DEC $05
W $03:DE18 STY $05 ; $05 = 8 pixels per row
RW $03:DE21 DEC $05
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
R $04:80A0 LDA $05
W $04:80A6 STA $05
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:D817 STA $05
W $04:DD5C STA $05
RW $04:DD6A DEC $05
R $04:DD71 LDA $05
W $04:DD75 STA $05 ; [$05] = repeat count - 1
RW $04:DD7E DEC $05
W $04:EAE2 STX $05 ; [$05] = columns
R $04:EAE7 LDA $05 ; A = columns
R $04:F8FE LDA $05
W $04:FCEA STA $05 ; [$05] = $6F: tile number of the rightmost tile
R $04:FCF7 LDA $05
RW $04:FD03 DEC $05 ; Tile number--
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 $05:8180 STY $05 ; [$05] = Y
W $05:8672 STA $05
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 $0C:A684 STZ $05
W $0D:A6B7 STA $05 ; Save the level buffer pointer [$6B] in [$04]
R $0D:A6C0 LDA $05
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)
R $00:902A LDA $06
W $00:905E STA $06 ; [$06] = [$02] - low word of 10^n
R $00:9062 LDA $06
W $00:977C STZ.W $0006,X ; Clear [$0006+X]
W $00:AC12 STA $06
W $00:AC29 STA $06
W $00:AC60 STA $06
W $00:AC89 STA $06
W $00:ACB2 STA $06
W $00:ACC9 STA $06
W $00:ACE0 STA $06
R $00:AD01 LDY $06 ; Y = [$06]: colors per row - 1
W $00:AD54 STA $06
W $00:AD6B STA $06
W $00:AD82 STA $06
W $00:AD99 STA $06
W $00:ADB5 STA $06
W $00:ADCC STA $06
W $00:ADF1 STA $06
W $00:AE08 STA $06
W $00:AE37 STA $06
W $00:AFC7 STA $06 ; [$06] = red * 4
R $00:AFE0 LDA.W $0006,Y
W $00:BF12 STZ $06 ; $06 = 0: bank $00
W $00:BF65 STA $06 ; $06 = VRAM address high byte of the tile
R $00:C145 LDA $06
W $00:C178 STA $06 ; [$06] = $0D (VRAM address in [$06] is no longer needed)
R $00:C229 LDA $06
W $00:C25A STA $06 ; [$06] = $0D
R $00:C33D LDA $06
W $00:C341 STA $06
R $00:C367 LDA $06
R $00:C386 LDA $06
W $00:C38A STA $06
R $00:C40C LDA $06
R $00:C43C LDA $06
W $00:C440 STA $06
W $00:C4DB STZ $06 ; [$06] = 0 (bank)
W $00:CA68 STA $06
R $00:CC32 LDA ($06),Y
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
W $00:FA1F STY $06
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
R $01:BB64 LDA $06 ; A = door frame
R $01:BB7C LDA $06 ; A = door frame
R $01:BBB5 LDA $06
R $01:BBBA ADC $06
R $01:BBF2 LDA $06 ; A = door frame
W $01:C817 STA $06 ; [$06] = running Y offset, low byte (starts at one step)
R $01:C896 LDA $06
W $01:C89B STA $06
W $01:C92D STA $06 ; [$06] = screen Y of tile 1 (pivot), reference point
R $01:C966 SBC $06
W $01:CAAD STA $06 ; [$06] = width $40
R $01:CB74 LDA $06 ; High word of the product
R $01:CB9D LDA $06 ; High word
W $01:CBA5 STA $06 ; [$06] = +/- radius Y * sine (high word)
R $01:CBAE LDA $06
W $01:CBB2 STA $06 ; [$06] += [$0A]
R $01:CBDC LDA $06 ; High word
R $01:CC05 LDA $06 ; High word
W $01:CC0D STA $06 ; [$06] = +/- radius X * sine (high word)
R $01:CC16 LDA $06
W $01:CC1A STA $06 ; [$06] -= [$0A]
W $01:CC59 STA $06 ; [$06] = high byte of it + carry
R $01:CC73 ADC $06
W $01:CC75 STA $06 ; [$06] += high byte + carry
R $01:CC88 ADC $06
W $01:CC8A STA $06 ; [$06] += low byte of [$01] * [$03]
W $01:D181 STA $06
W $01:D41B STA $06 ; Hitbox width [$06] = $10
W $01:D7C3 STA $06 ; [$06] = X offset
R $01:D7DC ADC $06 ; Add X offset
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:D973 STA $06
W $01:D987 STA $06
R $01:E01D CMP $06
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
RW $01:F4AD DEC $06 ; Next tile
W $01:FCB0 STA $06 ; [$06] = $0C (Mario width)
W $01:FD2C STA $06
W $02:8294 STA $06 ; $06 = -(screen X >> 1): half-speed scroll offset
R $02:82E4 LDA $06
R $02:87E2 LDA $06
W $02:87F0 STA $06
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:A52F STA $06 ; $06 = hitbox width
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:A8FC STA $06 ; ...and lowest slot
W $02:A914 STA $06 ; [$06] = $FF: search all the way down to slot 0
R $02:A91E CPX $06
R $02:A932 CPX $06
W $02:B74B STX $06 ; Segment loop: [$06] = segment number
R $02:B753 ADC $06
R $02:B769 LDX $06 ; X = segment number
W $02:BA43 STA $06 ; [$06] = high byte of the map16 address
W $02:BA5B STA $06 ; [$06] = X low
R $02:BA65 LDA $06
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:D144 STA $06
W $02:D1AB STA $06 ; [$06] = pointer high
W $02:D682 STA $06 ; [$06] = cosine
R $02:D6AC LDA $06 ; A = cosine
W $02:D6CD STA $06 ; [$06] = Y offset from the pivot
R $02:D705 LDA $06 ; A = Y offset
W $02:DC5D STX $06 ; X = 3: four tiles, [$06] = tile counter
R $02:DC76 LDX $06 ; X = tile counter
R $02:DCA7 LDX $06 ; X = tile counter
W $02:F13E STA $06 ; Save phase
R $02:F162 LDX $06 ; X = phase
R $02:F173 LDX $06
W $02:F9CD STA $06 ; [$06] = $0C (hitbox width)
W $02:FB2F STA $06 ; [$06] = CircleCoords[([$02]) & $FF] (cosine)
R $02:FB56 LDA $06
W $02:FB77 STA $06 ; [$06] = Y offset from the ring center
R $02:FB98 LDA $06
W $03:83C8 STA $06 ; [$06] = graphics frame [$1602]
R $03:840D LDA $06
W $03:86BB STX $06 ; Loop counter [$06] = 4 (five tiles)
R $03:86F0 LDX $06
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
R $03:99D1 LDA $06 ; A = Y offset
W $03:9DD7 STA $06 ; $06 = width
W $03:9EC8 STX $06 ; $06 = current segment index
R $03:9EF0 LDA $06 ; A = segment index
R $03:9F0B LDX $06 ; X = segment index
W $03:B6C3 STA $06 ; $06 = hitbox width
R $03:B74A ADC $06,X ; $0F = A - B + size of A (0 if A's far edge touches B's origin)
R $03:B751 ADC $06,X
W $03:C9F1 STA $06 ; $06 = [$1570]: burst radius scale
R $03:CA3C LDA $06
R $03:CA5B LDA $06
R $03:CB0B LDA $06
R $03:CB2A LDA $06
W $03:D97E STA $06
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:8676 STA $06
R $04:8691 LDA $06
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:89CE LDA $06
W $04:9005 STZ $06 ; [$06] = 0
W $04:9295 STZ $06 ; [$06] = 0
R $04:9493 LDA $06 ; [$0A] = |dX| (major), [$0C] = |dY| (minor)
W $04:95B0 STY $06 ; [$06] = direction
R $04:95BC CMP $06
W $04:96BC STZ $06 ; [$06] = 0
W $04:D81B STA $06
W $04:DA7F STA $06 ; [$06] = $7E: bank of the map pointer
W $04:E4B8 STA $06 ; [$06] = $0000: pointer to $7F:0000 (attributes)
R $04:E4E5 LDA [$06],Y
R $04:E535 LDA [$06],Y
W $04:E76F STA $06 ; [$06] = 1: two rows
RW $04:E81C DEC $06 ; Next row
W $04:E827 STA $06 ; [$06] = 5: six rows
RW $04:E8DC DEC $06 ; Next row
W $04:F8E8 STX $06 ; [$06] = X: tile loop index
R $04:F90C LDX $06
R $04:F953 LDA $06
W $04:FC82 STA $06 ; [$06] = [$13]: counter for the size flicker
R $04:FCC7 LDA $06
W $04:FCCC STA $06 ; [$06] += $0A
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:FEDA LDA $06 ; A = |dx| [$06]
W $04:FF0B STA $06 ; [$06] = |dx|
RW $04:FF31 LSR $06 ; [$06] = |dx| / 2
R $04:FF49 CMP $06 ; >= |dx| / 2?
R $04:FF4F LDA $06 ; A = |dx| / 2
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:867A LDA [$06],Y
R $05:8683 LDA [$06],Y
W $05:C073 STA $06
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)
R $05:CE1C LDA $06
W $0C:950D STA $06
R $0C:9514 ORA $06
W $0D:E026 STA $06 ; [$06] = this screen's high-byte buffer ($7F:xxxx) from DATA_0DDF1A
R $0D:E04C LDY $06

$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)
W $00:8737 STZ $07
RW $00:873A ROL $07 ; [$07] = bit 7 of the third byte (1 = step down a column)
R $00:8772 LDA $07
R $00:879E LDA $07
W $00:BF16 STA $07 ; $07 = block X high byte (screen number)
R $00:BF1A ADC $07
W $00:BF76 STA $07 ; $07 = VRAM address low byte of the tile
R $00:C14F LDA $07
R $00:C233 LDA $07
RW $00:C334 INC $07
R $00:C336 LDA $07
W $00:C33B STA $07
R $00:C36D LDA $07 ; Record header: VRAM address = [$06]/[$07]
R $00:C37F LDA $07
W $00:C384 STA $07
R $00:C412 LDA $07 ; Record header: VRAM address = [$06]/[$07]
R $00:C435 LDA $07
W $00:C43A STA $07
R $00:CADB LDA $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 $00:FA23 STY $07
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
RW $01:BBC8 DEC $07 ; Count down
W $01:C81E STA $07 ; [$07] = running Y offset, high byte
R $01:C887 ADC $07
R $01:C891 SBC $07
R $01:C89D LDA $07
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
R $01:C943 SBC $07
W $01:CAC0 STA $07 ; [$07] = height $13
W $01:CC91 STA $07 ; [$07] = high byte + carry (result in [$04]-[$07])
W $01:D18A STA $07
W $01:D41F STA $07 ; Hitbox height [$07] = $10
W $01:D7CC STA $07 ; [$07] = Y offset
R $01:D7D3 ADC $07 ; Add Y offset
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:ED2A STA $07
W $01:F457 STA $07 ; $07 = direction
R $01:F490 LDA $07 ; Yoshi's direction
W $01:FCB4 STA $07 ; [$07] = $0E (Mario height)
W $01:FD2E STA $07 ; [$06] = [$07] = 8 (fireball hitbox)
W $02:82F5 STA $07
RW $02:82F8 ROR $07 ; $07 = [RAM_Layer1DispYLo] >> 1 (sign kept)
R $02:8300 SBC $07
R $02:87E5 LDA $07 ; Save the spawn parameters [$04]-[$07]
W $02:87ED STA $07
R $02:8864 LDA $07
W $02:8CEA STA $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:960F STA $07 ; $07 = $7E
RW $02:9616 INC $07 ; $07 = $7F
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:B734 STA $07
R $02:B758 LDA $07
W $02:BA0E STA $07 ; [$07] = X low
R $02:BA18 LDA $07
W $02:BA63 STA $07 ; [$07] = X high (screen)
R $02:BA6F LDX $07 ; X = screen number
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:C8A6 STA $07
R $02:C8E7 SBC $07 ; OAM Y = A - [$07]
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
R $02:F17C LDA $07
W $02:F9DD STA $07 ; [$07] = $14 (hitbox height)
R $02:FB5D LDY $07
W $03:910F STA $07
R $03:9988 LDY $07 ; Y = high byte of the value
W $03:9DEC STA $07 ; $07 = height
W $03:B6E0 STA $07 ; $07 = hitbox height
W $03:C9F6 STA $07 ; $07 = [$1602]: animation frame
R $03:CA72 LDA $07
R $03:CAA5 ADC $07
R $03:CB41 LDA $07
R $03:CB74 ADC $07
W $03:D982 STA $07 ; [$05] = $03D7EC: pointer to the platform block layout (IggyPlatform)
W $04:80BF STA $07 ; [$07] = [$09] = 8 (row counters)
RW $04:80CC DEC $07
W $04:86A4 STA $07 ; [$07] and [$8B] = Y of the first tile
W $04:86C3 STA $07
W $04:8716 STA $07 ; [$07] and [$8B] = second player's sprite Y
W $04:8737 STA $07
W $04:FC84 STZ $07 ; [$07] = 0: accumulated Y offset
R $04:FC96 LDA $07
R $04:FCBC LDA $07
W $04:FCC0 STA $07 ; Wrapped: [$07] -= $0C (later puffs sit higher)
W $05:813E STA $07 ; [$07] = next control byte from [$68]
R $05:814B LDA $07
W $05:814F STA $07 ; [$07] = run length - 1 (control byte & $7F)
RW $05:815F DEC $07
RW $05:8184 DEC $07
W $0C:945F STA $07 ; [$07] = control byte
R $0C:9468 LDA $07
W $0C:946C STA $07 ; [$07] = control byte & $7F (count - 1)
RW $0C:9478 DEC $07
RW $0C:948E DEC $07

$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
RW $00:AD19 DEC $08
W $00:AD59 STA $08
W $00:AD70 STA $08
W $00:AD87 STA $08
W $00:AD9E STA $08
W $00:ADBA STA $08
W $00:ADD1 STA $08
W $00:ADF6 STA $08
W $00:AE0D STA $08
W $00:AE39 STZ $08 ; Source $B5F4, [$04] = $18, [$06] = 3, [$08] = 0: palette 0, colors C-F
W $00:AFD1 STA $08 ; [$08] = green * 4
W $00:BFB2 STX $08 ; $08 = reference X position
R $00:C10D LDA $08
R $00:C1F1 LDA $08
W $00:FA2B STA $08 ; [$08] = A
W $01:88B9 STA $08
R $01:9363 LDX $08
W $01:A23C STA $08
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:BC2D STA $08 ; $08 = Mario X high
W $01:C844 STA $08 ; [$08] = running X offset, low byte
R $01:C8B9 LDA $08
W $01:C8BE STA $08
W $01:C907 STA $08 ; [$08] = 9: loop over all 10 OAM tiles of this sprite
R $01:C97F LDA $08
RW $01:C99D DEC $08 ; Next tile
W $01:CB72 STA $08 ; [$08] = +/- radius X * cosine (low word)
R $01:CBAA ADC $08
W $01:CBDA STA $08 ; [$08] = +/- radius Y * cosine (low word)
R $01:CC12 SBC $08 ; [$04] -= [$08]
W $01:D18C STA $08
W $01:D3CC STA $08 ; To [$08]
W $01:D8A6 STA $08
R $01:D938 LDA $08
R $01:E02B LDY $08
W $01:F549 STA $08 ; $08 = tongue tip X high
R $01:F5D6 LDA $08 ; Tongue tip X high
W $01:FC9C STZ $08
W $02:884E STA $08 ; [$08] = layer flag
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:A554 STA $08
R $02:A71E LDX $08
W $02:AF3A STA $08 ; $08 = Y position low
R $02:AF62 LDA $08 ; Y position low
W $02:AFA4 STA $08 ; $08 = Y position low
R $02:AFD5 LDA $08 ; Y position low
R $02:BA10 LDA $08
R $02:BA5D LDA $08
R $02:BAD1 LDA $08
W $02:C8C0 STA $08
R $02:C8F1 ORA $08
R $02:CA6E LDA $08
R $02:CADF LDA $08
W $02:CCBB STA $08
R $02:CCD2 LDX $08 ; X = column number (3..0)
R $02:CCF8 EOR $08
RW $02:CD28 DEC $08 ; Next column
W $02:CF10 STA $08 ; [$08] = X offset
W $02:D100 STA $08
W $02:D7AB STA $08 ; [$08] = link tile
R $02:D7B9 LDA $08 ; A = link tile
W $02:F120 STA $08 ; [$08] = angry flag
R $02:F144 LDA $08
R $02:F1A0 LDA $08
W $03:8CEF STA $08
W $03:B670 STA $08
W $03:B703 STA $08
R $03:B734 LDA $08,X
W $03:C9FA STA $08 ; $08 = burst center X low
R $03:CA8A ADC $08
R $03:CB59 ADC $08
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
R $04:9246 LDX $08
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)
R $04:94F0 LDA $08
R $04:9505 LDA $08
W $04:950B STA $08
R $04:9514 LDA $08
W $04:9565 STA $08 ; [$08] = 8: direction candidate counter
R $04:9575 LDA $08
W $04:957B STA $08
W $04:990E STA $08 ; [$08] = shift count
R $04:9941 LDX $08 ; X = shift count
W $04:E4AD STA $08 ; [$08] = $7F
W $04:E786 STA $08 ; [$08] = column
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:E795 LDA $08
R $04:E7DA LDA $08 ; A = tiles to the screen edge
W $04:E83E STA $08 ; [$08] = column
R $04:E844 SBC $08 ; A = 32 - column
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:F965 LDA $08
R $04:FEE1 LDA $08 ; A = |dy| [$08]
W $04:FF2B STA $08 ; [$08] = |dy|
RW $04:FF33 LSR $08 ; [$08] = |dy| / 2
R $04:FF41 CMP $08 ; height / 2 >= |dy| / 2?
R $04:FF47 LDA $08 ; A = |dy| / 2
W $05:8674 STA $08 ; [$05] = [$08] = 0 (bank bytes)
W $05:8A50 STA $08
R $05:8A55 LDY $08 ; Y = [$08]: index of this block in the screen data
R $05:8A8C LDA $08
W $05:8A92 STA $08
W $05:8B30 STA $08
R $05:8B35 LDY $08 ; Y = [$08]: index of this block in the screen data
R $05:8B6C LDA $08
W $05:8B73 STA $08
W $05:8B82 STA $08
R $05:8B84 LDA $08
W $05:8C1E STA $08
R $05:8C23 LDY $08 ; Y = [$08]: index of this block in the screen data
R $05:8C62 LDA $08
W $05:8C68 STA $08
W $05:8D15 STA $08
R $05:8D1A LDY $08 ; Y = [$08]: index of this block in the screen data
R $05:8D59 LDA $08
W $05:8D60 STA $08
W $05:8D6F STA $08
R $05:8D71 LDA $08
W $05:8DD4 STA $08
R $05:8DD9 LDY $08 ; Y = [$08]: index of this block in the screen data
R $05:8E0A LDA $08
W $05:8E10 STA $08
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
R $05:C516 LDA $08
W $05:C51C STA $08
W $0C:94E9 STX $08 ; [$08] = $7F: Map16 tiles left in this pass - 1
RW $0C:9541 DEC $08
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:A17D STA $08
R $0C:A197 LDA $08
R $0C:A1C6 LDA $08
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
RW $0C:AC1C DEC $08
W $0C:CCBE STA $08 ; $08 = tile table index
R $0C:CCD2 LDY $08
RW $0C:CD02 INC $08 ; Next table entry
W $0D:A5FE STA $08 ; [$08] = low byte of item memory pointer, $19F8 + table offset
R $0D:A62D LDA ($08),Y
W $0D:A8EA STA $08
R $0D:A918 LDA ($08),Y
W $0D:B2EA STA $08 ; [$08] = low byte of item memory table pointer ($19F8 + [$13BE] offset)
R $0D:B31A LDA ($08),Y
W $0D:B358 STA $08 ; [$08] = low byte of item memory table pointer ($19F8 + [$13BE] offset)
R $0D:B386 LDA ($08),Y
W $0D:E010 STA $08 ; First screen to copy to = 1
R $0D:E018 LDA $08
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)
RW $00:BED4 LSR $09 ; $09 >>= 1
R $00:BED8 LDA $09
R $00:BF31 LDA $09
R $00:BF7A LDA $09
R $00:F63A LDA $09
R $00:F63F CMP $09
W $01:88C7 STA $09
W $01:A24A STA $09
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:BC31 STA $09 ; $09 = Mario Y high
W $01:C84B STA $09 ; [$09] = running X offset, high byte
R $01:C8AA ADC $09
R $01:C8B4 SBC $09
R $01:C8C0 LDA $09
W $01:C8C4 STA $09 ; Running X offset += X step (16-bit)
W $01:C96E STA $09
R $01:C98F LDA $09
R $01:C9C1 LDA $09
W $01:C9C8 STA $09
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:D3D6 STA $09 ; To [$09]
W $01:D8AB STA $09
R $01:D93C LDA $09
R $01:E030 LDY $09
W $01:F55C STA $09 ; $09 = tongue tip Y high
R $01:F5E0 LDA $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:96B1 STA $09 ; $09 = cape Y high
W $02:A567 STA $09
W $02:AF3F STA $09 ; $09 = Y position high
R $02:AF66 LDA $09 ; Y position high
W $02:AFA9 STA $09 ; $09 = Y position high
R $02:AFD9 LDA $09 ; Y position high
R $02:BA04 LDA $09
R $02:BA4E LDA $09
R $02:BADF LDA $09
W $02:CF23 STA $09 ; [$09] = Y offset
W $02:F14D STY $09 ; Save the history offset in [$09]
R $02:F159 LDY $09
W $03:8D09 STA $09
W $03:B69B STA $09
W $03:B720 STA $09
W $03:CA01 STA $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:80C1 STA $09
RW $04:80DB DEC $09
W $04:921A STZ $09 ; [$09] = 0
W $04:9910 STZ $09 ; [$09] = 0
W $04:E4BD STA $09 ; [$09] = $8000: pointer to $0C:8000 (tile numbers)
R $04:E4DE LDA [$09],Y
R $04:E52E LDA [$09],Y
W $05:822D STZ $09
RW $05:8266 INC $09 ; [$09]++ (tile counter, apparently unused)
W $0D:A606 STA $09 ; [$09] = high byte of item memory pointer
W $0D:A8F2 STA $09
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
R $00:AAF0 AND $0A
W $00:AB05 STA $0A ; [$0A] = $FF00: plane 3 = OR of planes 0-2 for every tile
R $00:AB30 AND $0A
W $00:AFC0 STA $0A ; [$0A] = original color
R $00:AFC9 LDA $0A
W $00:AFD8 STA $0A ; [$0A] = blue * 4 (bits 10-14 of the color)
W $00:BFB4 STY $0A ; $0A = reference Y position
R $00:C127 LDA $0A
R $00:C20B LDA $0A
W $00:E3B9 STA $0A ; [$0A] = DATA_00E00C[Y] (upper body graphic tile)
R $00:F658 LDA $0A
R $00:F65D CMP $0A
R $00:FA3D LDA $0A
R $01:9425 LDA $0A
W $01:9472 STA $0A
W $01:94E3 STA $0A
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
R $01:C6CC EOR $0A
W $01:C85D STA $0A
R $01:C884 LDA $0A
R $01:C88E LDA $0A
W $01:C973 STA $0A ; [$09] = world Y of this tile = delta + pivot world Y (16-bit)
R $01:C994 LDA $0A
W $01:CAA9 STA $0A
W $01:CB7C STA $0A ; [$0A] = +/- radius X * cosine (high word)
R $01:CBB0 ADC $0A
W $01:CBE4 STA $0A ; [$0A] = +/- radius Y * cosine (high word)
R $01:CC18 SBC $0A
W $01:D190 STA $0A
W $01:D417 STA $0A ; Hitbox X high
W $01:D8AF STA $0A
R $01:D941 LDA $0A
W $01:ED18 STA $0A ; Hitbox X high
W $01:FCB6 STZ $0A
W $01:FD1E STZ $0A ; [$0A] = 0
W $02:82E0 STA $0A
R $02:82E7 LDX $0A
R $02:8305 LDX $0A ; X = table index
W $02:8CD5 STA $0A
W $02:A52A STA $0A
W $02:A704 STY $0A ; $0A = block X low
W $02:BA16 STA $0A ; [$0A] = X high
R $02:BA41 ADC $0A
W $02:CF69 STA $0A
R $02:CF7F SBC $0A
W $02:D79A STA $0A ; [$0A] = pivot X low
R $02:D7C9 SBC $0A
R $02:D7D6 ADC $0A
W $02:F9C9 STA $0A ; [$0A] = X high + carry
W $03:9109 STA $0A
W $03:9DD2 STA $0A ; $0A = X position high + offset high
W $03:B6BD STA $0A
R $03:B736 SBC $0A,X ; High byte of that distance -> $0C
W $03:CA06 STA $0A ; $0A = [$1534]: firework type
R $03:CA0F LDA $0A
R $03:CA21 LDA $0A
R $03:CAB5 LDX $0A
R $03:CADE LDA $0A
R $03:CAEF LDA $0A
R $03:CB84 LDX $0A
W $04:8652 STA $0A ; Store the screen Y in [$02] and [$0A]
W $04:9491 STA $0A
W $04:949B STA $0A
R $04:94CA LDA $0A
W $04:94EB STA $0A ; [$0A] = major axis speed
R $04:94F4 LDA $0A
W $04:9571 STA $0A
R $04:957D CMP $0A
W $04:D807 STA $0A
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
R $04:E7AB AND $0A ; Mask with [$0A]
R $04:E86B AND $0A ; Mask with [$0A]
W $04:EDD9 STA $0A ; [$0A] = $04ECD3: table of 4 tile words per tile type
R $04:EDFF LDA [$0A],Y
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:EE57 STA $0A ; [$0A] = $FFFF
W $04:EEBE STA $0A ; [$0A] = $04EE7A: table of 2x2 tile blocks
R $04:EF03 LDA [$0A],Y
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 $04:FF3B STA $0A ; [$0A] = height / 2
R $05:85E2 LDA $0A
R $05:85EE LDA $0A
W $05:85F4 STA $0A ; [$0A] = high nibble of [$0A] | [$01]
W $05:8605 STA $0A
R $05:8626 LDA $0A
R $05:863E LDA $0A
R $05:868D LDA $0A
R $05:86BB LDA $0A
W $05:89DF STA $0A
R $05:8A26 LDA [$0A],Y
R $05:8A32 LDA [$0A],Y
W $05:8A69 STA $0A ; [$0A] = address of this block's Map16 definition, from the RAM table $0FBE
R $05:8A6E LDA [$0A],Y
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:8AAC STA $0A
R $05:8B02 LDA [$0A],Y
R $05:8B0E LDA [$0A],Y
W $05:8B49 STA $0A ; [$0A] = address of this block's Map16 definition, from the RAM table $0FBE
R $05:8B4E LDA [$0A],Y
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:8BAD STA $0A
R $05:8BF4 LDA [$0A],Y
R $05:8C00 LDA [$0A],Y
W $05:8C37 STA $0A ; [$0A] = address of this block's Map16 definition, from the RAM table $0FBE
R $05:8C3C LDA [$0A],Y
R $05:8C45 LDA [$0A],Y
R $05:8C4E LDA [$0A],Y
R $05:8C57 LDA [$0A],Y
W $05:8C91 STA $0A
R $05:8CE7 LDA [$0A],Y
R $05:8CF3 LDA [$0A],Y
W $05:8D2E STA $0A ; [$0A] = address of this block's Map16 definition, from the RAM table $0FBE
R $05:8D33 LDA [$0A],Y
R $05:8D3C LDA [$0A],Y
R $05:8D47 LDA [$0A],Y
R $05:8D50 LDA [$0A],Y
W $05:8DA4 STA $0A ; [$0A] = $9100: Map16 definitions at $0D:9100, read directly (8 bytes each)
R $05:8DEC LDA [$0A],Y
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:C0E0 STA $0A
W $05:C0EA STA $0A ; No: [$0A] = Y distance (long axis)
R $05:C0F5 LDA $0A
W $05:C123 STA $0A ; [$0A] = number of steps
R $05:C137 CMP $0A
R $05:C13B SBC $0A ; Software divide: [$0E] = ([$0C] * 16) / steps
W $05:C159 STA $0A
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)
R $05:CFE0 LDA $0A
W $0C:A14D STA $0A
W $0C:A17F STA $0A ; $08 = $0A = $003F: Y position reset for the second half
W $0C:A68A STA $0A
W $0C:A842 STA $0A ; $0A = 2: large size, X bit 8 clear
W $0C:A853 STA $0A
R $0C:A88A LDA $0A
R $0D:A525 LDA $0A
R $0D:A53D LDA $0A
R $0D:A60F LDA $0A
R $0D:A8FB LDA $0A
R $0D:B2FB LDA $0A
R $0D:B369 LDA $0A

$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)
R $00:AFD3 LDA $0B
W $00:E3BE STA $0B ; [$0B] = DATA_00E0CC[Y] (lower body graphic tile)
R $00:F674 LDA $0B
R $01:9429 LDA $0B
W $01:947F STA $0B ; [$0B] = clip point X high
R $01:94AC ADC $0B
W $01:94EC STA $0B
R $01:94FE LDX $0B ; X = screen number ([$0B])
R $01:A8A7 LDA $0B
W $01:B7BB STY $0B ; $0B = OAM size/X-high bits for the tiles (Y on entry: $00 = 8x8, $02 = 16x16)
R $01:B7E2 LDA $0B
W $01:B929 STA $0B ; $0B = sprite Y high - borrow
W $01:BFA1 STA $0B
R $01:BFA7 LDA $0B
W $01:BFB4 STA $0B
W $01:C86B STA $0B
R $01:C8A7 LDA $0B
R $01:C8B1 LDA $0B
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]
W $01:D8B4 STA $0B
R $01:D945 LDA $0B ; Restore the sprite position saved in $08-$0B
W $01:ED26 STA $0B ; Hitbox Y high
W $01:FCB8 STZ $0B ; [$0A] and [$0B] = 0 (high bytes)
W $01:FD28 STZ $0B ; [$0B] = 0
W $02:8CE4 STA $0B
R $02:9FEC LDA $0B
W $02:9FF1 STA $0B
R $02:9FF3 LDA $0B
W $02:A53F STA $0B
W $02:A572 STZ $0B ; [$0B] = 0
W $02:A725 STA $0B
W $02:CF79 STA $0B ; [$0B] = Mario screen Y + offset
R $02:CF98 SBC $0B
W $02:D332 STA $0B ; [$0B] = 0 (remainder)
R $02:D338 LDA $0B ; A = remainder
W $02:D345 STA $0B ; Store the remainder
W $02:D79E STA $0B ; [$0B] = pivot Y low
R $02:D7E0 SBC $0B
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:911D STA $0B
W $03:9830 STA $0B ; $0B = $00 = 0
R $03:9836 LDA $0B
W $03:9843 STA $0B ; Store $0B
W $03:9DE7 STA $0B ; $0B = Y position high + offset high
W $03:B6DA STA $0B
W $04:812A STZ $0B ; [$0B] = 0: pointer table offset (16 bytes per tile)
R $04:812F LDA $0B
R $04:8145 ADC $0B ; X = [$0B] + frame offset: index into DATA_048006
R $04:8162 LDA $0B
W $04:8168 STA $0B
W $04:D80B STA $0B
W $04:E4B1 STA $0B ; [$0B] = $0C
W $05:822F STZ $0B ; [$04] = [$09] = [$0B] = 0 ([$0B] = bit counter)
RW $05:8268 INC $0B ; Bit counter [$0B]++
R $05:826A LDA $0B
W $05:8270 STZ $0B ; [$0B] = 0
R $05:85E8 LDA $0B
R $05:85F6 LDA $0B
W $05:85FC STA $0B ; [$0B] = high nibble of [$0B] | [$00] (X/Y nibbles swapped)
W $05:860A STA $0B
R $05:861E LDA $0B
R $05:8648 LDA $0B
W $05:89E5 STA $0B
W $05:8AB2 STA $0B
W $05:8BB3 STA $0B
W $05:8C97 STA $0B
R $0D:A52F LDA $0B
R $0D:A536 LDA $0B
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)
W $00:AAE8 STA $0C
R $00:AAF2 ORA $0C ; Write plane 2 (low) and plane 3 = (plane 2 | [$1BB2+X]) & [$0A] (high) to VRAM
W $00:AB28 STA $0C
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:AFE3 ORA $0C
W $00:BEC0 STA $0C ; $0C = X position
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:C11E CMP $0C ; Compare with [$0C]
R $00:C1F8 CMP $0C ; Compare with [$0C] (block X)
R $00:C202 CMP $0C ; Compare with [$0C]
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 $00:F689 LDA $0C
R $00:FA37 LDA $0C
R $01:9386 LDA $0C
R $01:93B0 LDA $0C
R $01:942D LDA $0C
W $01:945B STA $0C
W $01:94C5 STA $0C
R $01:94D4 LDA $0C
W $01:BF7C STA $0C
R $01:BF92 CMP $0C ; dx| >= |dy|: keep order
R $01:BF98 LDA $0C
W $01:BF9D STA $0C ; Swap $0C and $0D so $0D is the larger distance
R $01:BFAA ADC $0C
W $01:D185 STA $0C
W $01:D912 STA $0C ; $0C = sprite Y low before the trial step
R $01:D91B LDA $0C
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:82D0 STX $0C
R $02:82DE ADC $0C
W $02:83D4 STA $0C ; $0C = [$153D] - $1E: X position of column 0
R $02:845D LDA $0C,X
R $02:9F17 LDA $0C
W $02:A5C4 STA $0C ; [$0C] = Map16 tile found
W $02:A708 STY $0C ; $0C = block Y low
W $02:D30D STA $0C
R $02:D323 CMP $0C ; Horizontal >= vertical?
R $02:D329 LDA $0C
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|
R $03:9827 LDA $0C
W $03:982C STA $0C
R $03:9839 ADC $0C
W $03:B738 STA $0C
R $03:B73E LDA $0C
W $04:8666 STA $0C ; Store the screen X in [$04] and [$0C]
R $04:8743 LDA $0C
W $04:9495 STA $0C
W $04:949F STA $0C
R $04:94B5 LDA $0C ; A = minor axis distance
W $04:D80F STA $0C
W $04:E4DA STA $0C ; [$0C] = 1: 2 tiles per row
RW $04:E4FF DEC $0C
W $04:E52A STA $0C ; [$0C] = 5: 6 tiles per row
RW $04:E54F DEC $0C
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:EE52 STA $0C ; [$0C] = $4000
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:89F5 STA $0C
W $05:8A47 STY $0C
W $05:8AC2 STA $0C
W $05:8B23 STY $0C
W $05:8BC3 STA $0C
W $05:8C15 STY $0C
W $05:8CA7 STA $0C
W $05:8D08 STY $0C
W $05:8DCA STY $0C ; [$0C] = $0D: bank of the Map16 definitions
W $05:C0E4 STA $0C
W $05:C0EE STA $0C ; [$0C] = X distance (short axis)
R $05:C125 LDA $0C
W $05:C12B STA $0C
RW $05:C134 ASL $0C
W $0D:A5C3 STA $0C ; [$0C] = tile to write
W $0D:A646 STA $0C ; Replace with tile $32 on page 1 (brown used block)
R $0D:A648 LDA $0C ; A = tile to write
W $0D:A932 STA $0C ; $0C = Map16 tile for object ID X [DATA_0DA8B4+X]
R $0D:A93E LDA $0C
W $0D:ABFD STA $0C ; Tile number in A; [$0C] = A
R $0D:AC11 LDA $0C
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)
R $0D:B139 LDA $0C
RW $0D:B14B INC $0C ; ...use the next tile number
R $0D:B14D LDA $0C
W $0D:B1AA STA $0C ; [$0C] = A (tile to place)
R $0D:B1B9 LDA $0C
W $0D:B397 STA $0C ; [$0C] = tile to place ($2C, coin)
R $0D:B3A3 LDA $0C
W $0D:B4D9 STA $0C ; Preserve tile
W $0D:B4F0 STA $0C ; Change to new tile
R $0D:B4F5 LDA $0C ; Add tile
W $0D:B4FE STA $0C ; Preserve tile
W $0D:B515 STA $0C ; Change to new tile
R $0D:B51A LDA $0C ; Add tile

$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:94D0 STA $0D
R $01:951F ADC $0D
R $01:B86A SBC $0D
R $01:B882 LDA $0D
R $01:B8B5 ADC $0D
W $01:B905 STA $0D ; $0D = [$02] (half height margin)
W $01:BF8C STA $0D
R $01:BF90 LDA $0D
W $01:BF9A STA $0D
R $01:BFAC CMP $0D ; $0B += small distance; if >= large distance:
R $01:BFB0 SBC $0D
W $01:D916 STA $0D ; $0D = sprite X low before the trial step
R $01:D927 LDA $0D
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
R $02:9F21 LDA $0D
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]
W $02:BA54 STA $0D
R $02:BA8E ADC $0D
W $02:D31D STA $0D
R $02:D321 LDA $0D ; A = horizontal distance
W $02:D32B STA $0D
R $02:D33D CMP $0D ; Below the long distance?
R $02:D341 SBC $0D
W $03:981B STA $0D ; $0D = |horizontal distance|
R $03:981F LDA $0D ; A = |horizontal|
W $03:9829 STA $0D
R $03:983B CMP $0D ; $0B += $0C; if >= $0D...
R $03:983F SBC $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
R $04:815A LDA $0D
W $04:8160 STA $0D
W $04:D7FB STA $0D
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
W $04:ED8C STA $0D
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:815C STA [$0D],Y
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
R $05:86A5 LDA [$0D],Y
R $05:86AE LDA [$0D],Y
R $05:86B7 LDA [$0D],Y
W $05:89EB STA $0D
R $05:8A2A LDA [$0D],Y
R $05:8A36 LDA [$0D],Y
W $05:8AB8 STA $0D
R $05:8B06 LDA [$0D],Y
R $05:8B12 LDA [$0D],Y
W $05:8BB9 STA $0D
R $05:8BF8 LDA [$0D],Y
R $05:8C04 LDA [$0D],Y
W $05:8C9D STA $0D
R $05:8CEB LDA [$0D],Y
R $05:8CF7 LDA [$0D],Y
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
R $00:A9A3 LDA $0E
RW $00:A9BE INC $0E ; Next 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
W $00:BEC4 STA $0E ; $0E = Y position
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:C138 CMP $0E ; Compare with [$0E]
R $00:C212 CMP $0E ; Compare with [$0E] (block Y)
R $00:C21C CMP $0E ; Compare with [$0E]
W $00:E415 STA $0E ; [$0E] = DATA_00E1D8[X] (third cape tile set)
R $00:E451 LDA $0E
R $01:A806 LDA $0E ; A = $0E
W $01:AD49 STA $0E ; [$0E] = low byte of vertical distance
R $01:B8D5 LDA $0E
W $01:B901 STA $0E ; $0E = [$00] (half width margin)
R $01:BF73 LDA $0E
W $01:CA23 STA $0E ; [$0E] = platform screen Y - 8 (top of the platform)
R $01:CA2A CMP $0E
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
R $01:F022 LDA $0E
W $01:F02D STA $0E ; Restore head OAM index
R $01:F03C LDY $0E ; Y = head OAM index
W $02:893F STA $0E ; Also in [$0E]
W $02:93AC STZ $0E ; $0E = 0: bounce block mode (not cape)
R $02:93E2 LDA $0E
R $02:944B LDA $0E
R $02:94A4 LDY $0E
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]
R $02:A60C LDA $0E
W $02:A9E0 STA $0E
W $02:A9E4 STZ $0E ; [$0E] = 0: no slots left free
R $02:A9FB SBC $0E
W $02:AB24 STA $0E ; [$0E] = 9: ten entries per group, index counted down
R $02:AB38 LDA $0E
RW $02:AB6D DEC $0E
R $02:C06A LDA $0E
R $02:C3D3 LDA $0E ; A = $0E
R $02:C527 LDA $0E ; A = $0E
R $02:C64D LDA $0E
R $02:C6BD LDA $0E
R $02:C7C7 LDA $0E
R $02:D304 LDA $0E
W $02:D513 STA $0E ; [$0E] = difference (low)
W $02:D889 STA $0E ; $0E = quotient low byte
RW $02:D88E ASL $0E
RW $02:D891 ASL $0E
RW $02:D894 ASL $0E
RW $02:D897 ASL $0E ; A:$0E = quotient * 16 (shift left 4 times)
R $03:87E0 LDA $0E
R $03:9802 LDA $0E ; A = vertical distance
W $04:8678 STA $0E ; Store the screen Y in [$06] and [$0E]
R $04:874A LDA $0E
W $04:895A STA $0E
R $04:8D4B LDA $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:96E0 STA $0E
R $04:976D LDA $0E
R $04:9777 LDA $0E
W $04:D7FF STA $0E
R $04:DAEA CPX $0E
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)
R $04:EDC3 LDX $0E ; X = [$0E]
R $04:EDDB LDA $0E
W $04:EE34 STA $0E ; [$0E] = $7F: bank of the pointer at [$0C]/[$0A]
W $05:8685 STA $0E ; [$0E] = high byte
W $05:89F1 STA $0E
W $05:8ABE STA $0E
W $05:8BBF STA $0E
W $05:8CA3 STA $0E
W $05:C132 STA $0E ; [$0E] = 0 (quotient), A = 0 (remainder)
RW $05:C13D ROL $0E
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:D8B9 LDA $0E
R $05:D8BD ADC $0E ; Y = [$0E] * 3 (layer pointer table entries are 3 bytes)
R $05:D8E2 LDA $0E
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
R $0C:A8C6 LDA $0E
W $0C:A8E2 STA $0E ; $0E = hatched-egg bit mask [$145A]
RW $0C:A901 LSR $0E
R $0C:AA16 LDA $0E
W $0D:A60D STA $0E ; [$0E] = current screen number * 4
R $0D:A615 LDA $0E
W $0D:A619 STA $0E ; If the object is in the lower half (Y bit 4 of [$0A]), [$0E] |= 2
R $0D:A620 LDA $0E
W $0D:A624 STA $0E ; If the X column is >= 8, [$0E] |= 1
R $0D:A62B LDY $0E
W $0D:A8F9 STA $0E
R $0D:A901 LDA $0E
W $0D:A905 STA $0E
R $0D:A90C LDA $0E
W $0D:A910 STA $0E
R $0D:A916 LDY $0E
W $0D:B2F9 STA $0E ; [$0E] = [$1BA1] * 4 (screen number part of item memory index)
R $0D:B301 LDA $0E
W $0D:B305 STA $0E ; If [$0A] bit 4 set, [$0E] |= 2 (high Y bit)
R $0D:B30E LDA $0E
W $0D:B312 STA $0E ; If Y bit 3 set, [$0E] |= 1 (high X bit)
R $0D:B318 LDY $0E
W $0D:B367 STA $0E ; [$0E] = [$1BA1] * 4 (screen number part of index)
R $0D:B36F LDA $0E
W $0D:B373 STA $0E ; If [$0A] bit 4 set, [$0E] |= 2 (high Y bit)
R $0D:B37A LDA $0E
W $0D:B37E STA $0E ; If Y bit 3 set, [$0E] |= 1 (high X bit)
R $0D:B384 LDY $0E
W $0D:BAE2 STA $0E
R $0D:BB05 LDA $0E
W $0D:BB0A STA $0E

$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
RW $00:A9C0 DEC $0F
W $00:A9F2 STA $0F ; [$0F] = 3: slot counter
R $00:A9F4 LDX $0F ; X = [$0F]: slot number
RW $00:AA0B DEC $0F
W $00:AA33 STA $0F ; [$0F] = 3: slot counter
R $00:AA35 LDX $0F ; X = [$0F]: slot number
RW $00:AA4C DEC $0F
W $00:AB52 STA $0F ; [$0F] = next source byte
RW $00:AB66 ROL $0F
RW $00:AB6A ROL $0F ; [$04] = last 2 bits of byte 0 (pixel 2 takes 1 more bit from byte 1)
W $00:AB71 STA $0F ; [$0F] = byte 1
RW $00:AB73 ROL $0F
RW $00:AB8E ROL $0F ; [$04] = last bit of byte 1 (pixel 5 takes 2 more bits from byte 2)
W $00:AB95 STA $0F ; [$0F] = byte 2
RW $00:AB97 ROL $0F
RW $00:AB9B ROL $0F ; Shift in 2 bits from byte 2: pixel 5 complete
RW $00:ABC6 ROL $0F
RW $00:ABCA ROL $0F
RW $00:ABCE ROL $0F ; [$04] = top 3 bits of [$0F], shifted out of it
W $00:FB41 STZ $0F ; [$0F] = 0
W $00:FB4A STA $0F
R $00:FB64 LDA $0F ; A = [$0F]
R $01:8ED3 LDA $0F
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:9537 LDY $0F ; Y = clipping point
W $01:9CF7 STY $0F ; [$0F] = Y offset
R $01:9CFC LDY $0F ; Get on-screen X in [$00], Y in [$01] and OAM index
R $01:A7FA LDA $0F ; A = $0F
W $01:A9A2 STA $0F ; Save in [$0F]
R $01:A9AD ORA $0F ; Merge the saved palette back in
W $01:AD37 STA $0F ; [$0F] = low byte of horizontal distance
R $01:AED7 LDA $0F
R $01:AEE5 LDA $0F
R $01:BE33 LDA $0F
R $01:BF83 LDA $0F
W $01:CA45 STA $0F ; [$0F] = Mario standing height
R $01:CA4B SBC $0F
R $01:D208 LDA $0F
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:EC9A STY $0F ; [$0F] = direction
R $01:ECC9 LDY $0F ; Y = direction
W $01:EF24 STA $0F ; Head tile = YoshiHeadTiles[frame]; kept in $0F (bit 7 = hide head)
R $01:EFAF LDA $0F
R $01:F771 LDA $0F ; A = distance
R $01:F903 LDA $0F
R $01:F914 LDA $0F
W $02:80C2 STY $0F ; $0F = 4: puff counter (five puffs, 4..0)
R $02:80E1 LDY $0F ; Y = puff number
R $02:8101 LDA $0F
RW $02:812E DEC $0F
W $02:83E0 STX $0F ; X = $0F = 1: handle column 1, then column 0
R $02:847B LDX $0F ; X = column index
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:92AA LDY $0F
R $02:92BB LDY $0F
R $02:92FD LDY $0F
R $02:930E LDY $0F
W $02:950B STZ $0F ; $0F = 0: layer 1
RW $02:9514 INC $0F ; $0F = 1: layer 2
R $02:9545 LDA $0F
R $02:958E LDY $0F
R $02:959F LDY $0F
R $02:95F0 LDY $0F
R $02:9601 LDY $0F
R $02:9622 LDA $0F
W $02:9A40 STY $0F ; [$0F] = OAM index
R $02:9A42 LDY $0F ; Y = OAM index (redundant reload)
R $02:9A71 LDY $0F ; Y = OAM index
W $02:9D13 STY $0F ; Y = [$0F] = OAM index for this extended sprite slot
W $02:9DB7 STA $0F ; [$0F] = frame
R $02:9DBA ADC $0F ; [$02] = frame * 3 (three tiles per frame)
R $02:9E0C LDX $0F
R $02:9F1D LDA $0F
W $02:A56E STZ $0F ; [$0F] = 0 (check layer 1 first)
RW $02:A5CA INC $0F ; [$0F] = 1 (checking layer 2)
R $02:A611 LDA $0F
R $02:A658 LDY $0F
R $02:A669 LDY $0F
R $02:A6BE LDY $0F
R $02:A6CF LDY $0F
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
R $02:AA04 CPY $0F
W $02:AB20 STY $0F ; [$0F] = 1 for sprite $E2, $FF for $E3 (probably direction)
R $02:AB3D LDA $0F
W $02:AB42 STZ $0F
W $02:B9FA STZ $0F ; [$0F] = 0: use the horizontal level map16 layout
R $02:BA28 LDY $0F
R $02:BA39 LDY $0F
R $02:BA75 LDY $0F
R $02:BA86 LDY $0F
R $02:C05F LDA $0F
R $02:C363 LDA $0F ; A = $0F
R $02:C609 LDA $0F
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
R $02:CFB6 SBC $0F
W $02:D0E6 STZ $0F ; [$0F] = 0 (layer 1)
R $02:D129 LDY $0F
R $02:D13A LDY $0F
R $02:D190 LDY $0F ; Y = [$0F]
R $02:D1A1 LDY $0F ; Y = [$0F]
R $02:D314 LDA $0F
W $02:D501 STA $0F ; [$0F] = difference (low)
R $02:DBF0 LDA $0F
R $02:E146 LDA $0F
R $02:E450 LDA $0F
R $02:E882 LDA $0F
R $02:E975 LDA $0F
R $03:88EC LDA $0F
R $03:9251 LDA $0F
R $03:9491 LDA $0F
R $03:9812 LDA $0F ; A = horizontal distance
W $03:9E5F STX $0F ; $0F = tile counter
R $03:9E7F LDX $0F ; X = tile counter
R $03:9E8D ADC $0F ; X = frame * 4 + tile counter
R $03:9E9A LDX $0F ; X = tile counter
R $03:9F62 LDA $0F ; A = horizontal distance
W $03:B4B4 STA $0F ; $0F = Bowser fight stage [$190D]
R $03:B4F4 LDA $0F
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
W $03:B74C STA $0F
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)
R $03:C603 LDA $0F
W $03:CA9C STA $0F
R $03:CAA1 ADC $0F
R $03:CAA3 ADC $0F
W $03:CB6B STA $0F
R $03:CB70 ADC $0F
R $03:CB72 ADC $0F
W $04:895C STZ $0F ; [$0E] = Yoshi color (16-bit)
W $04:D803 STA $0F
W $04:D84F STZ $0F ; [$0F] = 0 (first level)
RW $04:D854 INC $0F ; Next level
R $04:D856 LDA $0F
R $04:DA4B LDA $0F
R $04:DA54 LDA $0F
R $04:DA6C LDA $0F
R $04:DA9D LDA $0F
R $04:DAA7 LDA $0F
W $04:DCA0 STA $0F ; Start with event 0
RW $04:DCA5 INC $0F ; Next event
R $04:DCA7 LDA $0F
R $04:E455 LDA $0F
R $04:E45A LDA $0F
R $04:E46A LDA $0F
W $04:E9EF STA $0F ; [$0F] = event number
R $04:EA5D LDA $0F ; A = event number
W $04:EC7A STA $0F ; [$0F] = $7E
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
R $04:F378 LDA $0F
W $04:F383 STA $0F ; Save 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 $05:D7D2 STA $0F
W $05:D83E STZ $0F ; [$0F] = 0
W $05:D8B5 STA $0F
W $0C:9459 STA $0F ; [$0F] = $7E: destination bank
W $0D:A633 STA $0F ; [$0F] = item memory byte ([$08]),Y masked with bit X
R $0D:A639 LDA $0F
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)
R $0D:A7AC LDA $0F
W $0D:A91E STA $0F
R $0D:A924 LDA $0F ; A = collected bit
W $0D:B38C STA $0F ; [$0F] = item memory bit for this coin (nonzero = already collected)
R $0D:B399 LDA $0F
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)
R $0D:B85E LDA $0F
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)
R $0D:B94E LDA $0F
W $0D:B997 STA $0F ; $0F = tile to add
W $0D:B9A7 STA $0F
RW $0D:B9A9 INC $0F ; ... use that tile + 1 ($0B2 / $0B7)
W $0D:B9B9 STA $0F ; Page 1 and tile $10D instead
R $0D:B9BB LDA $0F
W $0D:BADE STA $0F ; $0F = number of screens = [$59]
RW $0D:BB27 DEC $0F

$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
R $00:806B LDA $10
W $00:8075 STZ $10
R $00:81DA LDA $10
RW $00:81E7 INC $10 ; Mark the frame handled: [$10]++
R $00:82C4 LDA $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
R $00:83BF LDY $11
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)
R $00:85E6 LDA $12
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:909E LDA RAM_FrameCounter
R $00:A253 LDA RAM_FrameCounter
R $00:AF1A LDA RAM_FrameCounter
R $00:AF35 LDA RAM_FrameCounter
R $00:C94C LDA RAM_FrameCounter
R $00:D0BD LDA RAM_FrameCounter
R $00:D114 LDA RAM_FrameCounter
R $00:E2E3 LDA RAM_FrameCounter ; A = frame counter
R $00:E308 LDA RAM_FrameCounter ; A = frame counter
R $00:EFCD LDA RAM_FrameCounter
R $00:F232 AND RAM_FrameCounter ; A = (A xor 3) AND frame counter: probably a timing check
R $00:FE4A LDA RAM_FrameCounter
R $01:8053 LDA RAM_FrameCounter
R $01:876A LDA RAM_FrameCounter
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:93D9 LDA RAM_FrameCounter
R $01:96D7 LDA RAM_FrameCounter
R $01:98FD LDA RAM_FrameCounter
R $01:9FA1 LDA RAM_FrameCounter
R $01:A411 EOR RAM_FrameCounter
R $01:A7EC EOR RAM_FrameCounter
R $01:AC53 LDA RAM_FrameCounter
R $01:ACAC LDA RAM_FrameCounter
R $01:ACBE LDA RAM_FrameCounter
R $01:AD9B LDA RAM_FrameCounter
R $01:ADC5 LDA RAM_FrameCounter
R $01:B066 ADC RAM_FrameCounter
R $01:B14E LDA RAM_FrameCounter
R $01:B1E0 LDA RAM_FrameCounter
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:BCC0 LDA RAM_FrameCounter
R $01:C21D LDA RAM_FrameCounter
R $01:C268 LDA RAM_FrameCounter
R $01:C42F LDA RAM_FrameCounter
R $01:C6A5 LDA RAM_FrameCounter
R $01:C77A LDA RAM_FrameCounter
R $01:CA79 LDA RAM_FrameCounter
R $01:CF35 LDA RAM_FrameCounter
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:DB6A LDA RAM_FrameCounter
R $01:DDE5 ADC RAM_FrameCounter
R $01:DDF9 EOR RAM_FrameCounter
R $01:E155 ADC RAM_FrameCounter ; A = slot * 4 + frame counter
R $01:E26A LDA RAM_FrameCounter
R $01:E581 LDA RAM_FrameCounter ; A = frame counter
R $01:E9BD LDA RAM_FrameCounter
R $01:EA05 LDA RAM_FrameCounter ; A = frame counter
R $01:EB3A LDA RAM_FrameCounter
R $01:F62F EOR RAM_FrameCounter
R $01:F948 AND RAM_FrameCounter
R $01:F98C LDA RAM_FrameCounter
R $01:FB7E LDA RAM_FrameCounter
R $02:8118 LDA RAM_FrameCounter
R $02:8AE4 LDA RAM_FrameCounter ; Frame counter
R $02:8B25 LDA RAM_FrameCounter
R $02:8C2A EOR RAM_FrameCounter ; EOR frame counter
R $02:8D7F LDA RAM_FrameCounter
R $02:8F8F LDA RAM_FrameCounter
R $02:8FC1 LDA RAM_FrameCounter
R $02:9014 LDA RAM_FrameCounter
R $02:94FC LDA RAM_FrameCounter
R $02:9540 LDA RAM_FrameCounter
R $02:9BB2 LDA RAM_FrameCounter
R $02:9BCB ADC RAM_FrameCounter
R $02:9CA2 LDA RAM_FrameCounter ; A = [RAM_FrameCounter]
R $02:9F09 EOR RAM_FrameCounter
R $02:A0AD EOR RAM_FrameCounter
R $02:A25E LDA RAM_FrameCounter
R $02:A7FC LDA RAM_FrameCounter
R $02:AE40 LDA RAM_FrameCounter ; A = frame counter
R $02:B39B LDA RAM_FrameCounter ; A = frame counter
R $02:B7AF EOR RAM_FrameCounter
R $02:B8BC LDA RAM_FrameCounter
R $02:B8DC LDA RAM_FrameCounter
R $02:BBB8 EOR RAM_FrameCounter
R $02:C032 LDA RAM_FrameCounter
R $02:C08A LDA RAM_FrameCounter
R $02:C095 LDA RAM_FrameCounter
R $02:C3E7 LDA RAM_FrameCounter
R $02:C4C4 ADC RAM_FrameCounter ; A = (X * 8 + [$13]) & $7F
R $02:C61D LDA RAM_FrameCounter
R $02:C713 LDA RAM_FrameCounter ; A = frame counter
R $02:D04D LDA RAM_FrameCounter
R $02:D098 LDA RAM_FrameCounter
R $02:D908 LDA RAM_FrameCounter
R $02:D93C LDA RAM_FrameCounter
R $02:DA80 LDA RAM_FrameCounter
R $02:DBA5 LDA RAM_FrameCounter
R $02:E266 LDA RAM_FrameCounter
R $02:E32A LDA RAM_FrameCounter
R $02:E5FF EOR RAM_FrameCounter
R $02:E7DD LDA RAM_FrameCounter
R $02:E9A8 LDA RAM_FrameCounter
R $02:EA56 EOR RAM_FrameCounter
R $02:EB6B LDA RAM_FrameCounter
R $02:EB8D LDA RAM_FrameCounter
R $02:EBB7 LDA RAM_FrameCounter
R $02:EBFA LDA RAM_FrameCounter
R $02:F504 LDA RAM_FrameCounter
R $02:F9AF EOR RAM_FrameCounter
R $02:FA21 LDA RAM_FrameCounter
R $02:FBB1 EOR RAM_FrameCounter
R $02:FBCE LDA RAM_FrameCounter
R $02:FC65 EOR RAM_FrameCounter
R $02:FCF2 LDA RAM_FrameCounter
R $02:FD1E EOR RAM_FrameCounter
R $02:FD2C ADC RAM_FrameCounter
R $02:FDE1 EOR RAM_FrameCounter
R $02:FEE2 LDA RAM_FrameCounter
R $02:FF1E LDA RAM_FrameCounter
R $03:8905 LDA RAM_FrameCounter
R $03:8915 LDA RAM_FrameCounter
R $03:8936 LDA RAM_FrameCounter
R $03:89CE LDA RAM_FrameCounter
R $03:8A03 LDA RAM_FrameCounter
R $03:8ACE ADC RAM_FrameCounter
R $03:8DC5 LDA RAM_FrameCounter
R $03:908B ADC RAM_FrameCounter ; A = ((sprite index * 16 + [$13]) AND $3F)
R $03:90AF LDA RAM_FrameCounter
R $03:92B0 LDA RAM_FrameCounter
R $03:970D ADC RAM_FrameCounter ; + frame counter
R $03:99F5 LDA RAM_FrameCounter ; A = frame counter
R $03:9D81 EOR RAM_FrameCounter
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:A4DA LDA RAM_FrameCounter
R $03:A4ED LDA RAM_FrameCounter ; Frame counter AND $1F: every 32 frames
R $03:A6AC LDA RAM_FrameCounter ; Frame counter
R $03:A738 LDA RAM_FrameCounter
R $03:A756 LDA RAM_FrameCounter
R $03:A774 LDA RAM_FrameCounter
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:AC3C LDA RAM_FrameCounter
R $03:ACA5 LDA RAM_FrameCounter
R $03:AD63 LDA RAM_FrameCounter
R $03:B87F LDA RAM_FrameCounter
R $03:B8CA LDA RAM_FrameCounter
R $03:C12D LDA RAM_FrameCounter
R $03:C4BB LDA RAM_FrameCounter
R $03:C572 LDA RAM_FrameCounter
R $03:C941 LDA RAM_FrameCounter
R $03:C96E EOR RAM_FrameCounter
R $03:C98B LDA RAM_FrameCounter
R $03:C999 LDA RAM_FrameCounter
R $03:C9A0 LDA RAM_FrameCounter
R $03:C9EA EOR RAM_FrameCounter ; $05 = sprite slot XOR frame counter (seed that varies tile and palette)
R $04:80E0 LDA RAM_FrameCounter
R $04:8101 LDA RAM_FrameCounter
R $04:810C LDA RAM_FrameCounter
R $04:813A AND RAM_FrameCounter
R $04:83B7 LDA RAM_FrameCounter
R $04:83DC LDA RAM_FrameCounter
R $04:896E LDA RAM_FrameCounter
R $04:8998 LDA RAM_FrameCounter
R $04:8CF5 LDA RAM_FrameCounter
R $04:8D0C LDA RAM_FrameCounter
R $04:9E63 LDA RAM_FrameCounter
R $04:F714 LDA RAM_FrameCounter
R $04:FAB3 AND RAM_FrameCounter
R $04:FC69 LDA RAM_FrameCounter
R $04:FC80 LDA RAM_FrameCounter
R $04:FCEF LDA RAM_FrameCounter
R $04:FE5B LDA RAM_FrameCounter ; A = frame counter [$13]
R $05:B13F LDA RAM_FrameCounter
R $05:CF0C LDA RAM_FrameCounter
R $07:F22E LDA RAM_FrameCounter
R $0C:A6FE LDA RAM_FrameCounter
R $0C:C98C LDA RAM_FrameCounter
R $0C:CC51 LDA RAM_FrameCounter
R $0C:CDA1 LDA RAM_FrameCounter ; Cutscene state: screen drops with growing speed and shakes
R $0C:CEB8 LDA RAM_FrameCounter
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
R $0C:D285 LDA RAM_FrameCounter
R $0C:D3AE LDA RAM_FrameCounter
R $0C:D3E1 LDA RAM_FrameCounter
R $0C:D43F LDA RAM_FrameCounter
R $0C:D7AF LDA RAM_FrameCounter

$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]++
R $00:98AF LDA RAM_FrameCounterB
RW $00:A1C1 INC RAM_FrameCounterB ; Frame counter B [$14]++
R $00:A421 LDA RAM_FrameCounterB
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:C513 LDA RAM_FrameCounterB
R $00:CF20 LDA RAM_FrameCounterB
R $00:D9C4 LDA RAM_FrameCounterB
R $00:DA0B LDA RAM_FrameCounterB
R $00:E2DA LDA RAM_FrameCounterB
R $00:FD13 AND RAM_FrameCounterB ; A = mask & [$14] (frame counter B)
R $01:9882 LDA RAM_FrameCounterB
R $01:9A2F LDA RAM_FrameCounterB
R $01:A12F LDA RAM_FrameCounterB
R $01:A26F LDA RAM_FrameCounterB
R $01:A2A1 LDA RAM_FrameCounterB
R $01:B67E LDA RAM_FrameCounterB
R $01:BCF3 LDA RAM_FrameCounterB
R $01:C197 LDA RAM_FrameCounterB
R $01:C271 LDA RAM_FrameCounterB
R $01:C349 LDA RAM_FrameCounterB
R $01:C387 LDA RAM_FrameCounterB
R $01:C661 ADC RAM_FrameCounterB
R $01:CEEF LDA RAM_FrameCounterB
R $01:CF92 LDA RAM_FrameCounterB
R $01:D146 LDA RAM_FrameCounterB
R $01:D4B8 LDA RAM_FrameCounterB ; Frame counter
R $01:D71C EOR RAM_FrameCounterB ; XOR frame counter
R $01:DBBA LDA RAM_FrameCounterB
R $01:DBED LDA RAM_FrameCounterB
R $01:DC23 LDA RAM_FrameCounterB
R $01:DC68 EOR RAM_FrameCounterB
R $01:DDFB ADC RAM_FrameCounterB
R $01:DE45 LDA RAM_FrameCounterB
R $01:E109 LDA RAM_FrameCounterB
R $01:E174 LDA RAM_FrameCounterB
R $01:E349 LDA RAM_FrameCounterB
R $01:E363 LDA RAM_FrameCounterB
R $01:E7B0 LDA RAM_FrameCounterB ; A = frame counter B
R $01:E854 LDA RAM_FrameCounterB
R $01:E89C LDA RAM_FrameCounterB
R $01:E8F5 LDA RAM_FrameCounterB
R $01:EF00 LDA RAM_FrameCounterB
R $01:EFBC LDA RAM_FrameCounterB
R $01:EFD2 LDA RAM_FrameCounterB
R $01:F009 LDA RAM_FrameCounterB
R $01:F1A2 LDA RAM_FrameCounterB
R $01:FA66 LDA RAM_FrameCounterB
R $01:FF77 LDA RAM_FrameCounterB
R $02:8398 LDA RAM_FrameCounterB
R $02:9001 LDA RAM_FrameCounterB
R $02:9A65 ADC RAM_FrameCounterB
R $02:9B8B LDA RAM_FrameCounterB
R $02:9C4A LDA RAM_FrameCounterB
R $02:9CD2 LDA RAM_FrameCounterB
R $02:9F71 LDA RAM_FrameCounterB
R $02:A183 LDA RAM_FrameCounterB
R $02:A1E2 LDA RAM_FrameCounterB
R $02:A2A8 LDA RAM_FrameCounterB
R $02:A392 LDA RAM_FrameCounterB
R $02:A3DA LDA RAM_FrameCounterB
R $02:B036 LDA RAM_FrameCounterB
R $02:B07C LDA RAM_FrameCounterB
R $02:B0CD LDA RAM_FrameCounterB
R $02:B15B LDA RAM_FrameCounterB
R $02:B1BC LDA RAM_FrameCounterB
R $02:B207 LDA RAM_FrameCounterB
R $02:B26C LDA RAM_FrameCounterB
R $02:B2D6 LDA RAM_FrameCounterB
R $02:B329 LDA RAM_FrameCounterB
R $02:B74D LDA RAM_FrameCounterB
R $02:B8E6 ADC RAM_FrameCounterB
R $02:B93A LDA RAM_FrameCounterB
R $02:BBA7 LDA RAM_FrameCounterB
R $02:BC00 LDA RAM_FrameCounterB
R $02:BC5A LDA RAM_FrameCounterB
R $02:BD04 LDA RAM_FrameCounterB
R $02:BE63 LDA RAM_FrameCounterB
R $02:BE7E LDA RAM_FrameCounterB
R $02:BEC0 LDA RAM_FrameCounterB
R $02:C217 LDA RAM_FrameCounterB
R $02:C37B LDA RAM_FrameCounterB
R $02:C388 LDA RAM_FrameCounterB ; [$14] & $30
R $02:C394 LDA RAM_FrameCounterB
R $02:C3F5 LDA RAM_FrameCounterB
R $02:C677 LDA RAM_FrameCounterB
R $02:C701 LDA RAM_FrameCounterB
R $02:C76C LDA RAM_FrameCounterB
R $02:D8D7 LDA RAM_FrameCounterB
R $02:D9D9 LDA RAM_FrameCounterB
R $02:DC54 LDA RAM_FrameCounterB
R $02:E182 LDA RAM_FrameCounterB
R $02:EB3D LDA RAM_FrameCounterB
R $02:ED2C LDA RAM_FrameCounterB
R $02:EDFD LDA RAM_FrameCounterB
R $02:EEC2 LDA RAM_FrameCounterB
R $02:EED5 LDA RAM_FrameCounterB
R $02:EF32 LDA RAM_FrameCounterB
R $02:F47C LDA RAM_FrameCounterB
R $02:F53E LDA RAM_FrameCounterB
R $02:F8A1 ADC RAM_FrameCounterB
R $02:F983 LDA RAM_FrameCounterB
R $02:FD5F LDA RAM_FrameCounterB
R $02:FD9B LDA RAM_FrameCounterB
R $03:814A LDA RAM_FrameCounterB
R $03:8166 LDA RAM_FrameCounterB
R $03:84D1 LDA.W RAM_FrameCounterB
R $03:84FC LDA RAM_FrameCounterB
R $03:854B LDA RAM_FrameCounterB
R $03:85A6 LDA RAM_FrameCounterB
R $03:86AE LDA RAM_FrameCounterB
R $03:8847 LDA RAM_FrameCounterB
R $03:892B LDA RAM_FrameCounterB
R $03:8F24 LDA RAM_FrameCounterB
R $03:8F8B LDA RAM_FrameCounterB
R $03:8FB0 EOR RAM_FrameCounterB
R $03:8FF6 LDA RAM_FrameCounterB
R $03:91A3 LDA RAM_FrameCounterB
R $03:91ED LDA RAM_FrameCounterB
R $03:9A15 ADC RAM_FrameCounterB
R $03:9CCD ADC RAM_FrameCounterB
R $03:9EB4 LDA RAM_FrameCounterB
R $03:A291 LDA RAM_FrameCounterB
R $03:AAB0 LDA RAM_FrameCounterB
R $03:ADDD LDA RAM_FrameCounterB
R $03:AF61 LDA RAM_FrameCounterB
R $03:C048 LDA RAM_FrameCounterB
R $03:C0EC LDA RAM_FrameCounterB
R $03:C280 LDA RAM_FrameCounterB
R $03:C2AB LDA RAM_FrameCounterB
R $03:CE38 LDA RAM_FrameCounterB
R $03:DFF0 LDA RAM_FrameCounterB ; A = [RAM_FrameCounterB]
R $05:BB3C LDA RAM_FrameCounterB
R $05:BB4A LDA RAM_FrameCounterB
R $05:C49F LDA RAM_FrameCounterB
W $05:C671 STZ 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
R $00:9510 LDA RAM_ControllerA
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)
R $00:A25B LDA RAM_ControllerA
R $00:A276 BIT RAM_ControllerA
R $00:C572 LDA RAM_ControllerA
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:CC8E LDA RAM_ControllerA
R $00:CC99 LDA RAM_ControllerA
R $00:CC9F BIT RAM_ControllerA
R $00:CD5E LDA RAM_ControllerA
R $00:CDFA ORA RAM_ControllerA ; Any button besides L/R pressed?
R $00:CFC7 LDA RAM_ControllerA
R $00:CFD8 LDA RAM_ControllerA
W $00:D22F STA RAM_ControllerA ; Fake controller input: X/Y held
R $00:D600 LDA RAM_ControllerA
R $00:D687 LDA RAM_ControllerA
R $00:D715 BIT RAM_ControllerA
R $00:D838 LDA RAM_ControllerA
R $00:D85B BIT RAM_ControllerA
R $00:D904 LDA RAM_ControllerA,X
R $00:D92A LDA RAM_ControllerA
R $00:D9AF LDA RAM_ControllerA
R $00:D9E1 LDA RAM_ControllerA
R $00:DA13 LDA RAM_ControllerA
R $00:DA33 LDA RAM_ControllerA
R $00:DA40 LDA RAM_ControllerA
R $00:DBD0 LDA RAM_ControllerA
R $00:DBF2 LDA RAM_ControllerA
R $00:EA78 LDA RAM_ControllerA
R $00:EEF2 LDA RAM_ControllerA ; A = held buttons [RAM_ControllerA]
R $00:F40C LDA RAM_ControllerA
W $00:F62D STZ RAM_ControllerA
R $00:FD0A LDA RAM_ControllerA ; A = controller 1 held
R $00:FE58 LDA RAM_ControllerA
R $01:A00D BIT RAM_ControllerA ; Test Y/X button bit ($40) of controller A
R $01:A02D LDA RAM_ControllerA
R $01:A039 LDA RAM_ControllerA
R $01:A041 LDA RAM_ControllerA
R $01:AA39 BIT RAM_ControllerA ; Test controller A (B/A button state)
R $01:AA58 LDA RAM_ControllerA ; A = controller A
R $01:DA26 LDA RAM_ControllerA
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 $01:EB02 LDA RAM_ControllerA
R $01:EB16 LDA RAM_ControllerA
R $01:ED79 LDA RAM_ControllerA
R $02:CDDD BIT RAM_ControllerA
R $02:D214 LDA RAM_ControllerA
R $02:D24F LDA RAM_ControllerA
R $02:D261 LDA RAM_ControllerA
R $02:E29A LDA RAM_ControllerA
R $04:83A1 LDA RAM_ControllerA
R $04:83AB LDA RAM_ControllerA
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:9AD9 LDA $16
R $00:9AEC LDA $16
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)
R $00:A21B LDA $16
R $00:C56C LDA $16
W $00:C782 STA $16 ; Newly pressed buttons [$16] = command without bit 6 (Y button)
R $00:C88F LDA $16
R $00:CDD0 BIT $16 ; Unreachable
R $00:D068 BIT $16
R $00:D08C BIT $16
R $00:D618 LDA $16
R $00:D6BF LDY $16
R $00:D99E LDA $16
R $00:D9EB LDA $16
R $00:DB98 BIT $16 ; N = bit 7 of [$16] (B newly pressed), V = bit 6 (A newly pressed)
R $00:EC0A LDA $16
R $00:F26B BIT $16
W $00:F62F STZ $16
R $01:CA71 LDA $16
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 $01:F1E5 BIT $16
R $04:837D LDA $16
R $04:9132 LDA $16 ; A = [$16] (buttons newly pressed)
R $04:9150 LDA $16
R $04:925F LDA $16 ; A = [$16] (buttons newly pressed)
R $05:B174 EOR $16
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:9508 LDA RAM_ControllerB
R $00:9CBE LDA RAM_ControllerB ; A = controller 1 byte 2 ([$17], A X L R)
R $00:CC68 LDA RAM_ControllerB
R $00:CDF6 LDA RAM_ControllerB
R $00:CDFE LDA RAM_ControllerB
R $00:EA80 LDA RAM_ControllerB
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)
R $04:9141 LDA RAM_ControllerB
R $05:B17A LDA RAM_ControllerB

$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
RW $00:A20F TRB $18
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:CC6E LDA $18
R $00:D61A ORA $18 ; B or A newly pressed: start a jump at $00D630
R $00:D63C LDA $18
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
W $00:F633 STZ $18 :/
R $01:ED9A BIT $18
R $04:9152 ORA $18
R $05:B180 EOR $18
R $0C:CFE8 ORA $18

$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
R $00:A764 LDA RAM_MarioPowerUp
R $00:C578 LDA RAM_MarioPowerUp
W $00:C581 STA RAM_MarioPowerUp ; Store Mario's power-up
R $00:CA7D LDY RAM_MarioPowerUp
R $00:CD97 LDX RAM_MarioPowerUp
R $00:CF35 LDA RAM_MarioPowerUp ; A = power-up status
R $00:CF3F LDY RAM_MarioPowerUp
R $00:CFEE LDY RAM_MarioPowerUp
R $00:D062 LDA RAM_MarioPowerUp
W $00:D0B6 STZ RAM_MarioPowerUp ; Power-up = 0 (small)
RW $00:D156 INC RAM_MarioPowerUp ; Power-up += 1
R $00:D168 LDA RAM_MarioPowerUp
R $00:D802 LDX RAM_MarioPowerUp
R $00:D8E0 CPY RAM_MarioPowerUp
R $00:D8E7 LDA RAM_MarioPowerUp
R $00:E314 LDA RAM_MarioPowerUp
R $00:E333 LDY RAM_MarioPowerUp
R $00:E34F LDY RAM_MarioPowerUp
R $00:E393 LDA RAM_MarioPowerUp
R $00:E3A4 LDY RAM_MarioPowerUp ; Y = powerup
R $00:E3FB LDA RAM_MarioPowerUp
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:EBFD LDA RAM_MarioPowerUp
R $00:EE67 LDX RAM_MarioPowerUp ; X = power-up
R $00:EFA3 LDA RAM_MarioPowerUp ; A = power-up
R $00:F1C1 LDY RAM_MarioPowerUp
R $00:F2E0 LDA RAM_MarioPowerUp
W $00:F2E6 STA RAM_MarioPowerUp ; Small Mario becomes big
R $00:F5D5 LDA RAM_MarioPowerUp
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
R $01:A10D LDY RAM_MarioPowerUp
R $01:AE30 LDA RAM_MarioPowerUp
R $01:B4C0 LDY RAM_MarioPowerUp
R $01:B5C8 LDA RAM_MarioPowerUp
R $01:B5FD LDA RAM_MarioPowerUp
R $01:B62B LDA RAM_MarioPowerUp
R $01:B8BF LDY RAM_MarioPowerUp
R $01:C53D ORA RAM_MarioPowerUp
W $01:C59A STA RAM_MarioPowerUp ; Mario power-up = 2 (cape)
W $01:C5F9 STA RAM_MarioPowerUp ; Mario power-up = 3 (fire)
R $01:DE63 LDY RAM_MarioPowerUp
R $02:8593 LDA RAM_MarioPowerUp
R $02:CF88 LDA RAM_MarioPowerUp
R $02:D49E LDY RAM_MarioPowerUp ; Y = Mario power-up
R $02:FE23 LDY RAM_MarioPowerUp
R $02:FEA9 LDY RAM_MarioPowerUp
R $03:ACE6 LDA RAM_MarioPowerUp
R $03:B67C LDA RAM_MarioPowerUp
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
R $0C:D4A9 LDA RAM_MarioPowerUp
R $0C:D51D LDA RAM_MarioPowerUp
R $0C:D589 LDA RAM_MarioPowerUp
R $0C:D69C LDA RAM_MarioPowerUp
R $0C:D705 LDY RAM_MarioPowerUp
R $0C:D812 LDY RAM_MarioPowerUp

$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)
R $00:8246 LDA RAM_ScreenBndryXLo
R $00:8420 LDA RAM_ScreenBndryXLo
R $00:92F5 LDA.W RAM_ScreenBndryXLo,Y
W $00:94E2 STZ RAM_ScreenBndryXLo,X
R $00:952F LDA RAM_ScreenBndryXLo
W $00:9537 STA RAM_ScreenBndryXLo
W $00:9549 STA RAM_ScreenBndryXLo
R $00:96FA LDA RAM_ScreenBndryXLo,X
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:A137 STA RAM_ScreenBndryXLo
W $00:A1AD STZ RAM_ScreenBndryXLo,X ; Clear [$1A+X]
R $00:BF81 LDA RAM_ScreenBndryXLo
R $00:BF9B LDX RAM_ScreenBndryXLo ; Vertical layer 1: X = screen boundary X
R $00:C4E3 SBC RAM_ScreenBndryXLo
R $00:CE39 CMP RAM_ScreenBndryXLo
R $00:E342 SBC RAM_ScreenBndryXLo
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])
R $00:F73F ADC RAM_ScreenBndryXLo
W $00:F746 STA RAM_ScreenBndryXLo ; Clamp: do not scroll past the left edge (X = 0)
R $00:F754 CMP RAM_ScreenBndryXLo
W $00:F758 STA RAM_ScreenBndryXLo
R $00:F770 SBC RAM_ScreenBndryXLo ; [$00] = A = Mario X on screen
R $00:F78C ADC RAM_ScreenBndryXLo
W $00:F79B STA RAM_ScreenBndryXLo ; Layer 1 X = A
R $00:F7A2 LDA RAM_ScreenBndryXLo ; A = layer 1 X
R $00:F7C4 LDA RAM_ScreenBndryXLo
R $00:F7EA LDA RAM_ScreenBndryXLo,X
R $00:FC4A LDA RAM_ScreenBndryXLo
R $00:FF3B SBC RAM_ScreenBndryXLo ; $00 = sprite X - screen X (position on screen)
R $01:99AE SBC RAM_ScreenBndryXLo
R $01:9E65 SBC RAM_ScreenBndryXLo ; OAM X = sprite X + wing X offset - screen X boundary
R $01:A152 LDA RAM_ScreenBndryXLo
R $01:A15E EOR RAM_ScreenBndryXLo ; Odd timer: screen X boundary XOR 1 (1-pixel shake)
W $01:A160 STA RAM_ScreenBndryXLo
W $01:A167 STA RAM_ScreenBndryXLo ; Restore screen X boundary
R $01:A36D CMP RAM_ScreenBndryXLo
R $01:A382 SBC RAM_ScreenBndryXLo
R $01:A3D3 SBC RAM_ScreenBndryXLo ; $00 = sprite X position relative to the screen
R $01:AC5C LDA RAM_ScreenBndryXLo
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:B3F3 SBC RAM_ScreenBndryXLo
R $01:B756 SBC RAM_ScreenBndryXLo ; Center tile (4) X = sprite X - screen X
R $01:B7D5 SBC RAM_ScreenBndryXLo
R $01:B849 SBC RAM_ScreenBndryXLo
R $01:B8E1 SBC RAM_ScreenBndryXLo
R $01:BB3E SBC RAM_ScreenBndryXLo
R $01:BE23 ADC RAM_ScreenBndryXLo
R $01:BEDF SBC RAM_ScreenBndryXLo ; Wand X on screen = sprite X + DATA_01BE6C[dir] - screen X
R $01:C7E1 SBC RAM_ScreenBndryXLo
R $01:C866 SBC RAM_ScreenBndryXLo
R $01:C8EB SBC RAM_ScreenBndryXLo
R $01:C9F6 SBC RAM_ScreenBndryXLo
R $01:CE34 LDA RAM_ScreenBndryXLo
R $01:DF29 SBC RAM_ScreenBndryXLo ; A = block X on screen
R $01:F068 SBC RAM_ScreenBndryXLo ; $00 = Yoshi screen X
R $01:F42C SBC RAM_ScreenBndryXLo
R $01:FD1A SBC RAM_ScreenBndryXLo
R $02:8054 ADC RAM_ScreenBndryXLo
R $02:80D0 SBC RAM_ScreenBndryXLo
R $02:827D LDA RAM_ScreenBndryXLo ; A = screen X low
R $02:8B46 LDA RAM_ScreenBndryXLo
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:8D52 CMP RAM_ScreenBndryXLo
R $02:8D95 SBC RAM_ScreenBndryXLo ; Convert to screen X
R $02:8E27 SBC RAM_ScreenBndryXLo
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:8F32 CMP RAM_ScreenBndryXLo
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:9206 LDA.W RAM_ScreenBndryXLo,Y
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:9A13 LDA.W RAM_ScreenBndryXLo,Y
R $02:9B58 SBC RAM_ScreenBndryXLo
R $02:9D07 CMP RAM_ScreenBndryXLo
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:A05E SBC RAM_ScreenBndryXLo
R $02:A1B5 SBC RAM_ScreenBndryXLo ; [$01] = X position on screen
R $02:A275 SBC RAM_ScreenBndryXLo ; $00 = X position on screen (low byte)
R $02:A370 SBC RAM_ScreenBndryXLo
R $02:A3B8 SBC RAM_ScreenBndryXLo
R $02:A817 LDA RAM_ScreenBndryXLo
R $02:AA45 ADC RAM_ScreenBndryXLo
R $02:AAE7 ADC RAM_ScreenBndryXLo
R $02:ACA8 LDA RAM_ScreenBndryXLo
W $02:ACAE STA RAM_ScreenBndryXLo ; Screen X -= $60, low
R $02:ACC0 LDA RAM_ScreenBndryXLo
W $02:ACC5 STA RAM_ScreenBndryXLo ; Screen X += $10, low
W $02:ACDB STA RAM_ScreenBndryXLo
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:B3CF CMP RAM_ScreenBndryXLo
R $02:B3DC SBC RAM_ScreenBndryXLo
R $02:B47F CMP RAM_ScreenBndryXLo
R $02:B48C SBC RAM_ScreenBndryXLo
R $02:B987 CMP RAM_ScreenBndryXLo
R $02:BB54 SBC RAM_ScreenBndryXLo
R $02:C28B SBC RAM_ScreenBndryXLo
R $02:CCC0 SBC RAM_ScreenBndryXLo ; [$00] = sprite X position on screen
R $02:D056 LDA RAM_ScreenBndryXLo
R $02:D380 CMP RAM_ScreenBndryXLo ; Compare with screen X low (carry)
R $02:D395 SBC RAM_ScreenBndryXLo
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:D7C6 ADC RAM_ScreenBndryXLo
R $02:D7D3 SBC RAM_ScreenBndryXLo
R $02:DF7C CMP RAM_ScreenBndryXLo
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 $02:F5D0 LDA RAM_ScreenBndryXLo
R $02:F5E0 SBC RAM_ScreenBndryXLo
R $02:F781 SBC RAM_ScreenBndryXLo
R $02:F883 ADC RAM_ScreenBndryXLo
R $02:FAD3 SBC RAM_ScreenBndryXLo
R $02:FBF5 SBC RAM_ScreenBndryXLo
R $02:FBF7 ADC RAM_ScreenBndryXLo
R $02:FC9C SBC RAM_ScreenBndryXLo
R $02:FCC4 CMP RAM_ScreenBndryXLo
R $02:FD51 SBC RAM_ScreenBndryXLo
R $02:FE4F SBC RAM_ScreenBndryXLo
R $02:FEE9 LDA RAM_ScreenBndryXLo
R $02:FF28 LDA RAM_ScreenBndryXLo
R $03:AA74 SBC RAM_ScreenBndryXLo ; $00 = Bowser X + 4 - [layer 1 X low] (screen X)
R $03:AC9A SBC RAM_ScreenBndryXLo
R $03:B4CA SBC RAM_ScreenBndryXLo
R $03:B4FE SBC RAM_ScreenBndryXLo
R $03:B538 SBC RAM_ScreenBndryXLo
R $03:B768 CMP RAM_ScreenBndryXLo
R $03:B77D SBC RAM_ScreenBndryXLo
R $03:B7C3 SBC RAM_ScreenBndryXLo ; $00 = sprite X - screen X
R $03:B888 LDA RAM_ScreenBndryXLo ; A = screen boundary X low
R $03:D771 SBC RAM_ScreenBndryXLo
R $03:DFBC ADC RAM_ScreenBndryXLo,X
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])
R $04:8342 ADC RAM_ScreenBndryXLo,X
W $04:8344 STA RAM_ScreenBndryXLo,X ; Screen X/Y position low += pixels + carry (and BG2 mirror)
R $04:838E LDA RAM_ScreenBndryXLo
R $04:83E3 LDA RAM_ScreenBndryXLo
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
R $04:865D SBC RAM_ScreenBndryXLo
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:F3D6 SBC.W RAM_ScreenBndryXLo,Y
R $04:F78B LDA RAM_ScreenBndryXLo
R $04:FE87 SBC.W RAM_ScreenBndryXLo,Y ; - screen scroll ([$1A] for Y = 0, [$1C] for Y = 2)
R $05:8707 LDA RAM_ScreenBndryXLo
R $05:8789 LDA RAM_ScreenBndryXLo ; A = screen X position of layer 1
R $05:BC10 SBC RAM_ScreenBndryXLo
W $05:BEBC STZ RAM_ScreenBndryXLo ; Layer 1 X position low = 0
W $05:BF9C STZ RAM_ScreenBndryXLo ; Layer 1 X position low = 0
R $05:C421 LDA RAM_ScreenBndryXLo
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:AEBE LDA RAM_ScreenBndryXLo
R $0C:AED0 LDA RAM_ScreenBndryXLo
W $0C:AED6 STA RAM_ScreenBndryXLo
R $0C:AEEC LDA RAM_ScreenBndryXLo
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
R $0C:D13F LDA RAM_ScreenBndryXLo
W $0C:D167 STA RAM_ScreenBndryXLo
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 $00:FC52 LDA RAM_ScreenBndryXHi
R $01:9E6B SBC RAM_ScreenBndryXHi ; Skip if the wing is off screen horizontally (high byte differs)
R $01:A372 SBC RAM_ScreenBndryXHi
R $01:AC67 LDA RAM_ScreenBndryXHi
R $01:B176 SBC RAM_ScreenBndryXHi ; High byte - screen X high - borrow
R $01:BE29 LDA RAM_ScreenBndryXHi
R $02:8058 LDA RAM_ScreenBndryXHi
R $02:8287 LDA RAM_ScreenBndryXHi ; A = screen X high
R $02:8B4F LDA RAM_ScreenBndryXHi
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:9210 LDA.W RAM_ScreenBndryXHi,Y
R $02:9B5F SBC RAM_ScreenBndryXHi
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
R $02:AA4D LDA RAM_ScreenBndryXHi
R $02:AAEF LDA RAM_ScreenBndryXHi
R $02:ACB0 LDA RAM_ScreenBndryXHi
W $02:ACB5 STA RAM_ScreenBndryXHi ; Screen X -= $60, high (saved first)
R $02:ACC7 LDA RAM_ScreenBndryXHi
W $02:ACCB STA RAM_ScreenBndryXHi ; Screen X high carry
W $02:ACD8 STA RAM_ScreenBndryXHi
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:B98B SBC RAM_ScreenBndryXHi
R $02:BB5A SBC RAM_ScreenBndryXHi
R $02:D061 LDA RAM_ScreenBndryXHi ; A = screen X high
R $02:D385 SBC RAM_ScreenBndryXHi ; Minus screen X high with borrow
R $02:DF81 SBC RAM_ScreenBndryXHi
R $02:F5E7 SBC RAM_ScreenBndryXHi
R $02:F888 LDA RAM_ScreenBndryXHi
R $02:FC01 LDA RAM_ScreenBndryXHi
R $02:FCC9 SBC RAM_ScreenBndryXHi
R $02:FEF5 LDA RAM_ScreenBndryXHi
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
R $04:8349 ADC RAM_ScreenBndryXHi,X
W $04:834B STA RAM_ScreenBndryXHi,X ; Screen position high byte += sign extension + carry (and mirror)
W $0C:CD2D STZ RAM_ScreenBndryXHi
W $0C:D030 STZ RAM_ScreenBndryXHi
R $0C:D144 LDA RAM_ScreenBndryXHi
W $0C:D16C STA RAM_ScreenBndryXHi

$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:8250 LDA RAM_ScreenBndryYLo
R $00:842A LDA RAM_ScreenBndryYLo
R $00:9532 LDA RAM_ScreenBndryYLo ; Save layer 1 position on the stack
W $00:953B STA RAM_ScreenBndryYLo
W $00:9546 STA RAM_ScreenBndryYLo
W $00:9820 STA RAM_ScreenBndryYLo ; Layer 1 Y position = $FF90
W $00:9933 STZ RAM_ScreenBndryYLo ; Layer 1 Y position = 0
W $00:A13E STA RAM_ScreenBndryYLo
R $00:A2A9 LDA RAM_ScreenBndryYLo
R $00:A2C7 ADC RAM_ScreenBndryYLo ; Layer 1 Y scroll low += displacement low
W $00:A2C9 STA RAM_ScreenBndryYLo
W $00:A2EE STA RAM_ScreenBndryYLo
R $00:A6CC LDA RAM_ScreenBndryYLo
R $00:A7A3 SBC RAM_ScreenBndryYLo
R $00:A7A7 LDA RAM_ScreenBndryYLo ; A = [$1C]
R $00:BF88 LDY RAM_ScreenBndryYLo ; Y = layer 1 screen boundary Y
R $00:BF9D LDA RAM_ScreenBndryYLo
R $00:C4EE SBC RAM_ScreenBndryYLo
R $00:C704 LDY RAM_ScreenBndryYLo
R $00:C709 ADC RAM_ScreenBndryYLo
R $00:C710 SBC RAM_ScreenBndryYLo ; A = Mario Y; Y speed = $D0 (-$30)
R $00:E360 SBC RAM_ScreenBndryYLo ; A -= screen Y
R $00:F59B ADC RAM_ScreenBndryYLo
W $00:F6F9 STA RAM_ScreenBndryYLo ; Layer 1 Y = [$1464]
R $00:F7AF LDA RAM_ScreenBndryYLo ; A = layer 1 Y
R $00:F7CD LDA RAM_ScreenBndryYLo
R $00:F801 SBC RAM_ScreenBndryYLo ; [$00] = A = Mario Y on screen
R $00:F893 ADC RAM_ScreenBndryYLo
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:901A SBC RAM_ScreenBndryYLo
R $01:9E72 SBC RAM_ScreenBndryYLo
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:ACD2 LDA RAM_ScreenBndryYLo
R $01:B2EA SBC RAM_ScreenBndryYLo
R $01:B3A8 SBC RAM_ScreenBndryYLo
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:B7C7 SBC RAM_ScreenBndryYLo
R $01:B865 SBC RAM_ScreenBndryYLo
R $01:BB45 SBC RAM_ScreenBndryYLo
R $01:BCD6 SBC RAM_ScreenBndryYLo
R $01:BE11 ADC RAM_ScreenBndryYLo
R $01:BEEA SBC RAM_ScreenBndryYLo
R $01:C7D5 SBC RAM_ScreenBndryYLo
R $01:C858 SBC RAM_ScreenBndryYLo
R $01:C8DF SBC RAM_ScreenBndryYLo
R $01:C9CB SBC RAM_ScreenBndryYLo
R $01:CA1C SBC RAM_ScreenBndryYLo
R $01:DE6D SBC RAM_ScreenBndryYLo
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 $01:FD24 SBC RAM_ScreenBndryYLo
R $02:8062 ADC RAM_ScreenBndryYLo
R $02:80DA SBC RAM_ScreenBndryYLo
R $02:8449 SBC RAM_ScreenBndryYLo
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:8E38 SBC RAM_ScreenBndryYLo
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:9201 LDA.W RAM_ScreenBndryYLo,Y
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:9A0E LDA.W RAM_ScreenBndryYLo,Y
R $02:9B67 SBC RAM_ScreenBndryYLo
R $02:9CFC SBC RAM_ScreenBndryYLo
R $02:9DDB SBC RAM_ScreenBndryYLo ; [$01] = Y position + Y offset - screen Y
R $02:9EB8 SBC RAM_ScreenBndryYLo
R $02:9F2D CMP RAM_ScreenBndryYLo
R $02:9FB6 CMP RAM_ScreenBndryYLo
R $02:A06B SBC RAM_ScreenBndryYLo
R $02:A1C4 SBC RAM_ScreenBndryYLo ; [$02] = Y position on screen
R $02:A293 SBC RAM_ScreenBndryYLo ; $01 = Y position on screen (low byte)
R $02:A37D SBC RAM_ScreenBndryYLo
R $02:A3C5 SBC RAM_ScreenBndryYLo
R $02:A691 SBC RAM_ScreenBndryYLo
R $02:A809 LDA RAM_ScreenBndryYLo
R $02:AAFE ADC RAM_ScreenBndryYLo
R $02:AC68 LDA RAM_ScreenBndryYLo
W $02:AC6E STA RAM_ScreenBndryYLo ; Screen Y -= $60 (vertical level), low
R $02:AC80 LDA RAM_ScreenBndryYLo
W $02:AC85 STA RAM_ScreenBndryYLo ; Screen Y += $10, low
W $02:AC9B STA RAM_ScreenBndryYLo
R $02:AD0C SBC RAM_ScreenBndryYLo
R $02:AE4C SBC RAM_ScreenBndryYLo
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:B175 LDA RAM_ScreenBndryYLo
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:B351 LDA RAM_ScreenBndryYLo
R $02:B3C3 CMP RAM_ScreenBndryYLo
R $02:B473 CMP RAM_ScreenBndryYLo
R $02:BB61 SBC RAM_ScreenBndryYLo
R $02:BDAA SBC RAM_ScreenBndryYLo
R $02:CCC7 SBC RAM_ScreenBndryYLo ; [$01] = sprite Y position on screen
R $02:CFBA ADC RAM_ScreenBndryYLo
R $02:D0A2 LDA RAM_ScreenBndryYLo
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)
R $02:D7DD ADC RAM_ScreenBndryYLo
R $02:D7EA SBC RAM_ScreenBndryYLo
R $02:E22B LDA RAM_ScreenBndryYLo
W $02:E231 STA RAM_ScreenBndryYLo
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 $02:F459 SBC RAM_ScreenBndryYLo
R $02:F4A6 SBC RAM_ScreenBndryYLo
R $02:F6C8 SBC RAM_ScreenBndryYLo
R $02:F788 SBC RAM_ScreenBndryYLo
R $02:F892 ADC RAM_ScreenBndryYLo
R $02:FC11 SBC RAM_ScreenBndryYLo
R $02:FC13 ADC RAM_ScreenBndryYLo
R $02:FCB5 CMP RAM_ScreenBndryYLo
R $02:FD5A SBC RAM_ScreenBndryYLo
R $02:FE58 SBC RAM_ScreenBndryYLo
R $03:8D98 LDA RAM_ScreenBndryYLo
W $03:8D9F STA RAM_ScreenBndryYLo
W $03:8DB8 STA RAM_ScreenBndryYLo
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:ACA1 SBC RAM_ScreenBndryYLo
R $03:B4C2 SBC RAM_ScreenBndryYLo
R $03:B507 SBC RAM_ScreenBndryYLo
R $03:B541 SBC RAM_ScreenBndryYLo
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
R $03:C230 LDA RAM_ScreenBndryYLo
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])
R $04:8393 LDA RAM_ScreenBndryYLo
R $04:83EB LDA RAM_ScreenBndryYLo
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
R $04:8646 SBC RAM_ScreenBndryYLo
R $04:866C SBC RAM_ScreenBndryYLo
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)
R $04:D720 LDA RAM_ScreenBndryYLo
W $04:D726 STA RAM_ScreenBndryYLo
W $04:D72F STA RAM_ScreenBndryYLo ; Layer 1 Y position = [$20] (restore it)
R $04:F79C LDA RAM_ScreenBndryYLo
R $05:871B LDA RAM_ScreenBndryYLo
R $05:87CD LDA RAM_ScreenBndryYLo ; A = screen Y position of layer 1
R $05:BC1D SBC RAM_ScreenBndryYLo
R $05:BE9E LDA RAM_ScreenBndryYLo ; A = layer 1 Y position [RAM_ScreenBndryYLo]
R $05:C48D LDA 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
R $0C:CD25 LDA RAM_ScreenBndryYLo
W $0C:CD4E STA RAM_ScreenBndryYLo ; Screen Y scroll (low) = actor 0 Y (low)
R $0C:CD59 LDA RAM_ScreenBndryYLo
R $0C:CD62 LDA RAM_ScreenBndryYLo
R $0C:CDBB LDA RAM_ScreenBndryYLo ; Actor 0 Y position = screen Y scroll
W $0C:CDE2 STA RAM_ScreenBndryYLo
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
W $0C:D15D STA RAM_ScreenBndryYLo

$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:8259 LDA RAM_ScreenBndryYHi
R $00:8433 LDA RAM_ScreenBndryYHi
R $00:A2AC LDA RAM_ScreenBndryYHi ; Save the layer 1 Y scroll position on the stack
R $00:A2D1 ADC RAM_ScreenBndryYHi
W $00:A2D3 STA RAM_ScreenBndryYHi ; Layer 1 Y scroll high += displacement high (+ carry)
W $00:A2EB STA RAM_ScreenBndryYHi
R $01:A3B9 SBC RAM_ScreenBndryYHi ; Subtract screen boundary Y high (with borrow)
R $01:ACDD LDA.W RAM_ScreenBndryYHi
R $01:BE17 LDA RAM_ScreenBndryYHi
R $02:8066 LDA RAM_ScreenBndryYHi
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:920B LDA.W RAM_ScreenBndryYHi,Y
R $02:9A18 LDA.W RAM_ScreenBndryYHi,Y
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
R $02:A813 LDA RAM_ScreenBndryYHi
R $02:AB03 LDA RAM_ScreenBndryYHi
R $02:AC70 LDA RAM_ScreenBndryYHi
W $02:AC75 STA RAM_ScreenBndryYHi ; Screen Y -= $60, high (saved first)
R $02:AC87 LDA RAM_ScreenBndryYHi
W $02:AC8B STA RAM_ScreenBndryYHi ; Screen Y high carry
W $02:AC98 STA RAM_ScreenBndryYHi
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:B17C LDA RAM_ScreenBndryYHi
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:B358 LDA RAM_ScreenBndryYHi
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:CFBE LDA RAM_ScreenBndryYHi
R $02:D0AD LDA.W RAM_ScreenBndryYHi ; A = screen Y high
R $02:D3C5 SBC RAM_ScreenBndryYHi ; Minus screen Y high
R $02:E233 LDA RAM_ScreenBndryYHi
W $02:E238 STA RAM_ScreenBndryYHi
W $02:E25A STA RAM_ScreenBndryYHi ; Restore screen Y high
R $02:F897 LDA RAM_ScreenBndryYHi
R $02:FC1F LDA RAM_ScreenBndryYHi
R $02:FCBA SBC RAM_ScreenBndryYHi
R $02:FF34 LDA.W RAM_ScreenBndryYHi
R $03:8DA1 LDA RAM_ScreenBndryYHi
W $03:8DA6 STA RAM_ScreenBndryYHi
W $03:8DB5 STA RAM_ScreenBndryYHi
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
R $03:C239 LDA RAM_ScreenBndryYHi
W $03:C23E STA RAM_ScreenBndryYHi ; Add the carry
W $03:C255 STA RAM_ScreenBndryYHi ; Restore screen Y high
R $03:C7E7 LDA RAM_ScreenBndryYHi
W $05:D934 STZ RAM_ScreenBndryYHi ; Layer 1 Y position high = 0
W $05:DA05 STA RAM_ScreenBndryYHi
R $0C:CD34 LDA RAM_ScreenBndryYHi
W $0C:CD49 STA RAM_ScreenBndryYHi ; Screen Y scroll (high) = actor 0 Y (high)
R $0C:CDC0 LDA RAM_ScreenBndryYHi
W $0C:CDDD STA RAM_ScreenBndryYHi
R $0C:D0E0 LDA RAM_ScreenBndryYHi
W $0C:D105 STA RAM_ScreenBndryYHi
R $0C:D13A LDA RAM_ScreenBndryYHi
W $0C:D162 STA RAM_ScreenBndryYHi

$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)
R $00:8261 LDA $1E
R $00:9535 LDA $1E
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
R $00:BFA9 LDA $1E
W $00:F6FE STA $1E ; Layer 2 X = [$1466]
W $00:F7A8 STA $1E ; Store layer 2 X
R $00:F7D6 LDA $1E
R $02:FA32 SBC $1E
W $04:82DC STA $1E
W $04:8346 STA $1E,X
W $04:83E9 STA $1E
W $04:842C STA $1E,X
W $04:987A STA $1E,X ; BG2 scroll ([$1E] X, [$20] Y) = A
W $04:9AB9 STA $1E
R $04:EC6B SBC $1E ; Minus layer 1 X scroll [$1E]
R $05:8747 LDA $1E
R $05:87EB LDA $1E ; A = layer 2 X position ($1E)
R $05:BC2A SBC $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
R $0C:9F74 LDA $1E,X
W $0C:9F7D STA $1E,X ; BG2 H-scroll = updated position
W $0C:AE79 STZ $1E ; Layer 2 X = 0
W $0C:AE9B STA $1E ; Layer 2 X = $FF80
RW $0C:AEE7 INC $1E ; Layer 2 X += 1

$001F

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)

$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:826B LDA $20
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:A7A0 LDA $20
R $00:A7B4 ADC $20
R $00:BF91 LDA $20
R $00:BFB0 LDY $20 ; Y = layer 2 scroll Y
W $00:F703 STA $20 ; Layer 2 Y = [$1468]
W $00:F7C0 STA $20 ; Store layer 2 Y
R $00:F7DF LDA $20
R $02:FA3B SBC $20
W $04:82E3 STA $20
W $04:83F1 STA $20
W $04:9AC0 STA $20
R $04:D72D LDA $20
R $04:EC73 SBC $20 ; Minus layer 1 Y scroll [$20] and 1
R $05:875B LDA $20
R $05:8804 LDA $20 ; A = layer 2 Y position ($20)
R $05:BC3A SBC $20
W $05:BF92 STA $20 ; [$20] = A (layer 2 Y position)
W $05:BFC7 STA $20 ; [$20] = A (layer 2 Y position)
R $05:C1A3 LDA $20
W $05:C1A9 STA $20
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 $05:DA79 STA $20
W $0C:AE6A STA $20 ; [$20] = Layer 2 Y position
R $0C:D177 LDA $20 ; Layer 2 Y position -= 1
W $0C:D17D STA $20
R $0C:D185 LDA $20 ; Layer 2 Y position += 1
W $0C:D18B STA $20
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)

$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)
R $00:8394 LDA $22
W $00:9FFF STA $22 ; BG3 horizontal scroll [$22] = layer 1 X / 2
W $00:FF45 STA $22
W $00:FF76 STA $22 ; BG3 X scroll [$22] = A
W $05:B248 STZ $22
R $05:BC5F LDA $22
W $05:C424 STA $22
R $05:C472 ADC $22 ; BG3 X [$22] += pixels moved
W $05:C474 STA $22
R $05:C486 LDA $22
W $05:C48B STA $22
R $05:C4EC LDA $22
W $05:C4F2 STA $22
W $05:CC8F STZ $22 ; BG3 X scroll [$22] = 0
W $0C:AE7B STZ $22 ; Layer 3 X = 0
W $0C:AE8D STA $22 ; Layer 3 X = $FF00
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)

$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)
R $00:839E LDA $24
W $00:9FE0 STA $24 ; BG3 vertical scroll low [$24] = A
W $00:A017 STA $24 ; BG3 vertical scroll low [$24] = A
W $00:FF5C STA $24
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:C4C0 LDA $24
R $05:C4E8 ADC $24 ; BG3 Y [$24] += [$145A] / 16 (sign-extended) + carry from the line above
W $05:C4EA STA $24
W $05:CC91 STZ $24 ; BG3 Y scroll [$24] = 0
R $0C:9F7F LDA $24
R $0C:9F8E LDA $24
W $0C:9F9D STA $24 ; BG3 V-scroll = new position
R $0C:9F9F LDA $24
R $0C:9FAE LDA $24

$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)

$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)

$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:9522 ADC $27
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)

$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:9533 ADC $29
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)

$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)
R $00:8304 LDA $2B
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)
R $00:830B LDA $2C
W $00:982D STA $2C ; Mode 7 center Y [$2C] = $0050
W $00:9940 STA $2C ; Mode 7 center Y [$2C] = $00A0
R $01:CCCE LDA $2C
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

$002D

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 read)

$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)
R $00:831A LDA $2E
R $00:8ADC LDA $2E
W $00:8B26 STA $2E ; [$2E] = cos(angle) * scale (matrix A)

$002F

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)
R $00:8324 LDA $30
R $00:8AE0 LDA $30
W $00:8B0A STA $30 ; [$30] = sin(angle) * scale (matrix B)

$0031

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]

$0032

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $00:832E LDA $32
W $00:8AE6 STA $32 ; [$32] (matrix C) = -[$30] = -sin * [$39]; then fall into the second pass

$0033

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]

$0034

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $00:8338 LDA $34
W $00:8ADE STA $34 ; [$34] (matrix D) = [$2E] = cos * [$39]

$0035

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)
R $00:F9C9 LDA $36 ; A = [$36] (tilt)
W $00:F9D0 STA $36
W $00:F9D8 STA $36 ; [$36] = original
W $01:CB18 STA $36 ; [$36] = angle low byte
R $01:CB28 LDA $36
R $01:CB36 LDA $36
W $01:CE78 STZ $36
R $01:CF49 LDA $36
R $01:CF5C ADC $36
W $01:CF5E STA $36
R $01:CFFC LDA $36
W $01:D001 STA $36
W $01:D001 STA $36
R $01:D192 LDA $36
R $01:D227 LDA $36
W $01:D22D STA $36
R $01:D271 LDA $36
R $01:D277 LDA $36
W $01:D27C STA $36
W $01:D2A3 STZ $36
R $01:FB01 LDA $36
R $01:FB9D LDA $36
R $01:FD72 LDA $36
W $01:FD7B STA $36 ; [$36] = -[$36] & $1FF (negate platform angle)
R $01:FD87 LDA $36
W $01:FD90 STA $36 ; [$36] = -[$36] & $1FF (restore angle)
R $03:98C5 LDA $36
W $03:98CE STA $36
R $03:991E LDA $36
W $03:A5EE STA $36 ; [$36] = tilt low
W $03:A5F6 STZ $36 ; Yes: [$36] = 0 and [$37] = 1 (tilt $0100)
W $03:A69D STA $36 ; [$36] = shake low (signed)
R $03:ABCA LDA $36
W $03:ABCF STA $36 ; [$36]/[$37] += $0A (16-bit)
W $03:ABD9 STZ $36 ; [$36] = 0
R $03:AC2F LDA $36
W $03:AC34 STA $36 ; [$36]/[$37] += $05 (16-bit)
R $03:B085 LDA $36
R $03:C145 LDA $36 ; A = [$36], platform tilt (low byte)
W $03:C14C STA $36 ; [$36] = new tilt

$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
R $01:CB20 LDA $37
W $01:CE7A STZ $37 ; Room rotation angle [$36]/[$37] = 0
R $01:CF4B ORA $37 ; Room angle zero: skip rotation
R $01:CF61 ADC $37
W $01:CF65 STA $37
R $01:D003 LDA $37
W $01:D009 STA $37
R $01:D22F LDA $37
W $01:D236 STA $37
R $01:D273 ORA $37 ; If rotation angle [$36]/[$37] is non-zero, keep it turning
R $01:D27E LDA $37
W $01:D284 STA $37
W $01:D2A5 STZ $37 ; Rotation angle [$36]/[$37] = 0
R $01:FBB7 LDA $37
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
W $03:A5F0 STZ $37 ; [$37] = 0
RW $03:A5F8 INC $37
W $03:A69F STZ $37 ; [$37] = 0
RW $03:A6A3 INC $37 ; Negative: [$37] = 1
R $03:ABD1 LDA $37
W $03:ABD5 STA $37
R $03:AC36 LDA $37
W $03:AC3A STA $37
R $03:B087 ORA $37
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)
R $00:8AD6 LDA $38
W $00:97C9 STA $38 ; Mode 7 scaling [$38] = $20
W $01:CD65 STA $38 ; Mode 7 room parameters [$38] = [$39] = $20
R $01:CFA1 LDA $38
RW $01:CFA7 INC $38
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
R $03:A279 LDA $38
R $03:A2D9 LDA $38 ; A = [$38]
R $03:A77B LDA $38
W $03:A781 STA $38
W $03:A7AF STA $38
W $03:A7D6 STA $38
RW $03:A85E INC $38 ; Scale [$38]++
R $03:A862 LDA $38 ; Scale reached $20?
R $03:AC42 LDA $38
RW $03:AC48 INC $38 ; [$39]++
R $03:B078 LDA $38
W $03:DD93 STA $38

$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)
R $00:8ACD LDA $39
W $00:97CB STA $39 ; Mode 7 scaling [$39] = $20
W $01:CD67 STA $39
R $01:CFA9 LDA $39
RW $01:CFAF DEC $39
RW $01:CFF1 DEC $39 ; Room parameter [$39]--
RW $01:D00D INC $39 ; Room parameter [$39]++
R $01:D00F LDA $39
R $01:D0C9 LDA $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:A7B1 STA $39 ; Scale [$39] = $60
W $03:A7D8 STA $39 ; Scale [$39] = 8
RW $03:A860 INC $39 ; Scale [$39]++
RW $03:AC4A INC $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)
R $00:8400 LDA $3A
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])

$003B

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)

$003C

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)

$003D

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)

$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)
R $00:846F LDA $3F
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)
R $00:81CE LDA $40
R $00:83AD LDA $40
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)
R $00:81B2 LDA $41
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 $00:CA54 STA $41
W $04:DB91 STA $41 ; Window 1 enabled on BG1 and BG2 [$41] = $33
W $04:F407 STZ $41
W $04:F492 STA $41 ; [$41] = $22: window mask W12SEL (BG1/BG2 window 1)
W $05:B123 STZ $41
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)
R $00:81B7 LDA $42
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 $00:CA5A STA $42 ; [$42] = $03
W $04:F409 STZ $42 ; Clear window mask mirrors [$41]/[$42]/[$43]
W $05:B125 STZ $42

$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)
R $00:81BC LDA $43
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)
R $00:81C1 LDA $44
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)
R $05:80B0 LDA $45
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)
R $05:89FC LDA $45,X
R $05:8A07 LDA $45,X
R $05:8A16 LDA $45,X
R $05:8A4B LDA $45,X
R $05:8ACC LDA $45,X
R $05:8AD8 LDA $45,X
R $05:8AE3 LDA $45,X
R $05:8AF2 LDA $45,X
R $05:8B27 LDA $45,X
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]++
R $05:80D3 LDA $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)
R $05:80B4 LDA $49
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
R $05:8BCA LDA $49,X
R $05:8BD5 LDA $49,X
R $05:8BE4 LDA $49,X
R $05:8C19 LDA $49,X
R $05:8CB1 LDA $49,X
R $05:8CBD LDA $49,X
R $05:8CC8 LDA $49,X
R $05:8CD7 LDA $49,X
R $05:8D0C LDA $49,X

$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)
RW $05:80CF INC $4B ; [$4B]++
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)
W $05:80A9 STA $4D
W $05:811C STA $4D
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 $04:D6F2 STA $4F
W $04:D73D STA $4F
W $05:80AB STA $4F ; [$4D]-[$50] = $FFFF (probably 'nothing drawn yet' markers)
W $05:811E STA $4F

$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

$0053

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)
W $00:F728 STY $55
W $00:F80C STY $55
R $02:A802 LDY $55 ; Y = screen scroll direction [$55]
R $02:AC61 LDA $55
W $02:AC66 STA $55 ; [$55] = 1 (purpose unclear)
W $02:AC9E STA $55 ; Restore screen Y high, screen Y low and [$55]
R $02:ACA1 LDA $55
W $02:ACA6 STA $55 ; [$55] = 1
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)
R $05:8701 LDA $55
R $05:8715 LDA $55
R $05:879F LDA $55
R $05:89F9 LDA $55
R $05:8AC6 LDA $55
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)
R $05:8741 LDA $56
R $05:8755 LDA $56
R $05:8BC7 LDA $56
R $05:8CAB LDA $56
W $05:C674 STZ $56 ; [$56] = 0
W $05:C78B STA $56
W $05:C7C3 STA $56 ; [$56] = 2

$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)
R $05:864C ORA $57
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:A626 LDA $57
R $0D:A656 LDY $57 ; Y = tile position [$57]
R $0D:A673 LDY $57 ; Y = tile position [$57]
R $0D:A69E LDY $57 ; Y = position
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:A760 LDY $57
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:A82A LDA $57
W $0D:A82F STA $57
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
R $0D:A977 LDA $57
R $0D:A97D LDA $57
W $0D:A982 STA $57
R $0D:A992 LDA $57
W $0D:A9B1 STY $57 ; Save the new position: [$57] = Y
R $0D:A9B4 LDA $57
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
R $0D:ABC8 LDA $57
W $0D:ABE7 STY $57 ; Save the new position: [$57] = Y
R $0D:AC21 LDY $57 ; Y = start position [$57]
R $0D:AC65 LDA $57
W $0D:AC84 STY $57 ; Save new position
R $0D:AC92 LDY $57 ; Y = start position [$57]
R $0D:AD13 LDA $57
W $0D:AD32 STY $57 ; Save new position
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:AED3 LDA $57
W $0D:AEF2 STY $57 ; Save new position
R $0D:AEFC LDY $57 ; Y = start position [$57]
R $0D:AF61 LDY $57 ; Y = start position [$57]
R $0D:AFB6 LDA $57
W $0D:AFD5 STY $57 ; Save new position
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)
R $0D:B2A9 LDA $57
R $0D:B2B6 LDA $57
W $0D:B2BB STY $57 ; [$57] = new column position
R $0D:B307 LDY $57
R $0D:B322 LDY $57 ; Y = [$57] (position)
R $0D:B336 LDY $57
R $0D:B3BD LDY $57 ; Position
R $0D:B3E3 LDY $57 ; Position
R $0D:B42D LDY $57 ; Position
R $0D:B461 LDY $57 ; Position
R $0D:B49E LDY $57 ; Position
R $0D:B51F LDY $57 ; Position
R $0D:B547 LDY $57 ; Position
R $0D:B571 LDY $57 ; Y = [$57] (position)
R $0D:B58D LDY $57 ; Position
R $0D:B5B7 LDY $57 ; Position
R $0D:B613 LDY $57 ; Position
R $0D:B664 LDY $57 ; Position
R $0D:B6C3 LDY $57 ; Position
R $0D:B6E3 LDY $57 ; Position
R $0D:B705 LDY $57 ; Position
R $0D:B73F LDY $57 ; Y = object position index [$57]
R $0D:B7AA LDY $57 ; Y = object position index [$57]
W $0D:B810 STY $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:BAE0 LDA $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:C3A9 LDA $57
W $0D:C3C8 STY $57 ; Save the index
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:CF8C LDA $57
W $0D:CFAB STY $57 ; Save index
R $0D:CFBB LDY $57 ; Y = object start index in Map16 buffer
R $0D:CFCB LDA $57
W $0D:CFEA STY $57 ; Save index
R $0D:CFF0 LDY $57 ; Y = object start index in Map16 buffer
R $0D:D00E LDA $57
W $0D:D02E STY $57 ; Save index
R $0D:D03E LDY $57 ; Y = object start index in Map16 buffer
R $0D:D04E LDA $57
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
R $0D:DB60 LDA $57
W $0D:DB7F STY $57 ; Save the new start position in [$57]
R $0D:DB8F LDY $57 ; Y = [$57]: object position
R $0D:DBD5 LDA $57
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:DE0F LDA $57
W $0D:DE2E STY $57
R $0D:DE3C LDY $57 ; Y = [$57] (object position)
R $0D:DEB2 LDA $57
W $0D:DECE STY $57
W $0D:DF45 STY $57 ; Position [$57] = $50 (row 5 of screen 0)
R $0D:DF5F LDA $57
W $0D:DF64 STA $57
W $0D:DF8A STA $57
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:EEDF LDA $57
R $0D:EEE9 LDA $57
W $0D:EEF5 STA $57
R $0D:EF27 LDA $57
W $0D:EF3B STY $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 $05:85DC LDA $59 ; A = [$59]
W $05:860F STA $59
R $0D:A108 LDA $59 ; A = extended object number
R $0D:A8C5 LDA $59
R $0D:A8CD LDA $59
R $0D:AA28 LDA $59
R $0D:AA30 LDA $59
R $0D:AAB6 LDA $59
R $0D:AABE LDA $59
R $0D:AB0F LDA $59
R $0D:AB3E LDA $59
R $0D:AB79 LDA $59
R $0D:AC23 LDA $59
R $0D:AC9D LDA $59
R $0D:AD4F LDA $59
R $0D:ADAE LDA $59
R $0D:ADF4 LDA $59
R $0D:AE6F LDA $59
R $0D:AEFE LDA $59
R $0D:AF63 LDA $59
R $0D:AFEC LDA $59
R $0D:B077 LDA $59
R $0D:B07F LDA $59
R $0D:B1C8 LDA $59
R $0D:B1D4 LDA $59
R $0D:B1DB LDA $59
R $0D:B226 LDA $59
R $0D:B22C LDA $59
R $0D:B338 LDA $59
R $0D:B33F LDA $59
R $0D:B3BF LDA $59
R $0D:B3C5 LDA $59
R $0D:B3E5 LDA $59
R $0D:B3ED LDA $59
R $0D:B42F LDA $59
R $0D:B463 LDA $59
R $0D:B46B LDA $59
R $0D:B4A0 LDA $59
R $0D:B4A8 LDA $59
R $0D:B521 LDA $59
R $0D:B549 LDA $59
R $0D:B573 LDA $59 ; A = [$59] (object number $68-$6F)
R $0D:B5B9 LDA $59
R $0D:B5BF LDA $59
R $0D:B604 LDA $59
R $0D:B6C5 LDA $59
R $0D:B6CB LDA $59
R $0D:B6E5 LDA $59
R $0D:B707 LDA $59
R $0D:B70F LDA $59
R $0D:B741 LDA $59
R $0D:B7AC LDA $59
R $0D:B7B4 LDA $59
R $0D:B865 LDA $59
R $0D:B86D LDA $59
R $0D:B922 LDA $59
R $0D:B928 LDA $59
R $0D:B968 LDA $59
R $0D:B96D LDA $59
R $0D:B9C2 LDA $59
R $0D:BA0C LDA $59
R $0D:BA13 LDA $59
R $0D:BA4E LDA $59
R $0D:BA53 LDA $59
R $0D:BADC LDA $59
R $0D:BB2E LDA $59
R $0D:C25B LDA $59
R $0D:C341 LDA $59
R $0D:C35E LDA $59
R $0D:C366 LDA $59
R $0D:C3DE LDA $59
R $0D:C3E6 LDA $59
R $0D:C430 LDA $59
R $0D:C436 LDA $59
R $0D:C451 LDA $59
R $0D:C459 LDA $59
R $0D:C47A LDA $59
R $0D:C480 LDA $59
R $0D:C4CB LDA $59
R $0D:C4F1 LDA $59
R $0D:C4F6 LDA $59
R $0D:C58C LDA $59
R $0D:C592 LDA $59
R $0D:C5DA LDA $59
R $0D:CE69 LDA $59
R $0D:CE96 LDA $59
R $0D:CEA8 LDA $59
R $0D:CEC2 LDA $59 ; Dummy load of the object byte (unused)
R $0D:CEDC LDA $59 ; Dummy load of the object byte (unused)
R $0D:CEF4 LDA $59
R $0D:CEFA LDA $59
R $0D:CF14 LDA $59
R $0D:CF1A LDA $59
R $0D:CF35 LDA $59
R $0D:CF3A LDA $59
R $0D:CF53 LDA $59
R $0D:CF70 LDA $59
R $0D:CFBD LDA $59
R $0D:CFF2 LDA $59
R $0D:D040 LDA $59
R $0D:D070 LDA $59
R $0D:D082 LDA $59
R $0D:D0C5 LDA $59
R $0D:D105 LDA $59
R $0D:D147 LDA $59
R $0D:D14D LDA $59
R $0D:D184 LDA $59
R $0D:D1A7 LDA $59
R $0D:D1DB LDA $59
R $0D:D1E0 LDA $59
R $0D:D250 LDA $59
R $0D:DA6A LDA $59
R $0D:DA82 LDA $59
R $0D:DACA LDA $59
R $0D:DACF LDA $59
R $0D:DAF2 LDA $59
R $0D:DB11 LDA $59
R $0D:DB9A LDA $59
R $0D:DC0D LDA $59
R $0D:DC6C LDA $59
R $0D:DCAB LDA $59
R $0D:DCB1 LDA $59
R $0D:DCEC LDA $59
R $0D:DCF4 LDA $59
R $0D:DD30 LDA $59
R $0D:DD38 LDA $59
R $0D:DD5E LDA $59
R $0D:DD66 LDA $59
R $0D:DD87 LDA $59
R $0D:DD9B LDA $59
R $0D:DE3E LDA $59
R $0D:DF3A LDA $59
W $0D:DF3E STA $59
RW $0D:E054 DEC $59
R $0D:E0B0 LDA $59
R $0D:E137 LDA $59
R $0D:E13D LDA $59
R $0D:E961 LDA $59
R $0D:E9AC LDA $59
R $0D:E9ED LDA $59
R $0D:EA40 LDA $59
R $0D:EC90 LDA $59
R $0D:ECD0 LDA $59
R $0D:ECD8 LDA $59
R $0D:ED14 LDA $59
R $0D:ED1A LDA $59
R $0D:ED45 LDA $59
R $0D:ED6D LDA $59
R $0D:ED75 LDA $59
R $0D:ED99 LDA $59
R $0D:EDA0 LDA $59
R $0D:EDBB LDA $59
R $0D:EDDD LDA $59
R $0D:EDE3 LDA $59
R $0D:EE19 LDA $59
R $0D:EE1F LDA $59
R $0D:EE54 LDA $59
R $0D:EE5A LDA $59
R $0D:EE8B LDA $59
R $0D:EE91 LDA $59
R $0D:EEC2 LDA $59
R $0D:EECE LDA $59
R $0D:EF47 LDA $59
R $0D:EF69 LDA $59
R $0D:EF6F LDA $59
R $0D:EFAA LDA $59
R $0D:EFB0 LDA $59
R $0D:F02D LDA $59
R $0D:F033 LDA $59
R $0D:F06E LDA $59
R $0D:F074 LDA $59

$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)
R $05:85D8 LDA $5A
W $05:8624 STA $5A ; [$5A] = object number: [$0B] >> 4 | ([$0A] & $60) >> 1
R $05:862B ORA $5A
W $05:862D STA $5A
R $05:86C5 LDA $5A
R $0D:A44D LDX $5A ; X = standard object number [$5A]
W $0D:A516 STA $5A ; [$5A] = destination screen
R $0D:A52A LDA $5A
R $0D:C192 LDX $5A ; X = standard object number [$5A]
R $0D:CD92 LDX $5A ; X = object number [$5A]
R $0D:D992 LDX $5A
R $0D:E892 LDX $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 $00:BECB LDA RAM_IsVerticalLvl
R $00:C0FB LDA RAM_IsVerticalLvl
R $00:C1DF LDA RAM_IsVerticalLvl
R $00:C921 LDA RAM_IsVerticalLvl
R $00:E944 LDA RAM_IsVerticalLvl
R $00:E97B LDA RAM_IsVerticalLvl
R $00:F705 LDA RAM_IsVerticalLvl
R $01:9158 LDA RAM_IsVerticalLvl
R $01:9451 AND RAM_IsVerticalLvl ; ([$185E] + 1) & [$5B]: zero = horizontal layer ($0194BF)
R $01:AC38 LDA RAM_IsVerticalLvl
R $01:D95D LDA RAM_IsVerticalLvl
R $02:926F AND RAM_IsVerticalLvl
R $02:9510 LDA RAM_IsVerticalLvl
R $02:9548 AND RAM_IsVerticalLvl ; Is the current layer ($0F + 1) vertical?
R $02:A5C6 LDA RAM_IsVerticalLvl
R $02:A614 AND RAM_IsVerticalLvl ; Layer being checked is horizontal: go to CODE_02A679
R $02:A804 LDA RAM_IsVerticalLvl
R $02:A93E LDA RAM_IsVerticalLvl
R $02:ABA8 LDA RAM_IsVerticalLvl
R $02:AC5C LDA RAM_IsVerticalLvl
R $02:D02C LDA RAM_IsVerticalLvl
R $02:FECD LDA RAM_IsVerticalLvl
R $03:B864 LDA RAM_IsVerticalLvl
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]
R $05:86F9 LDA RAM_IsVerticalLvl
R $05:8739 LDA RAM_IsVerticalLvl
R $05:8781 LDA RAM_IsVerticalLvl
R $05:87E3 LDA RAM_IsVerticalLvl
R $05:C0D0 LDA RAM_IsVerticalLvl
W $05:C716 STY RAM_IsVerticalLvl ; [$5B] (RAM_IsVerticalLvl) = Y
R $05:D7B5 LDA RAM_IsVerticalLvl
W $05:D94A STA RAM_IsVerticalLvl
R $05:D9A1 LDA RAM_IsVerticalLvl
R $05:D9F4 LDA RAM_IsVerticalLvl
W $05:DAA1 STZ RAM_IsVerticalLvl ; Horizontal level
R $05:DBB7 LDA RAM_IsVerticalLvl

$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 $01:9466 CMP RAM_ScreensInLvl
R $01:94F0 CMP RAM_ScreensInLvl
R $02:9282 CMP RAM_ScreensInLvl
R $02:92E7 CMP RAM_ScreensInLvl
R $02:955E CMP RAM_ScreensInLvl
R $02:95D8 CMP RAM_ScreensInLvl
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
R $02:D0F8 CMP RAM_ScreensInLvl
R $02:D177 CMP RAM_ScreensInLvl
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)

$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)
R $00:F75C LDA $5F
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)
R $01:8E49 ORA $64
R $01:8E7B LDA $64
W $01:8E85 STA $64 ; Priority [$64] = $10 (draw behind objects)
W $01:8E98 STA $64 ; Restore priority [$64]
R $01:9546 LDA $64
W $01:954B STA $64
W $01:9551 STA $64
R $01:9892 LDA $64
R $01:9B4C LDA $64
W $01:9B56 STA $64 ; ... for the draw routine
W $01:9B5C STA $64 ; Restore [$64]
R $01:9B6E LDA $64
W $01:9B78 STA $64 ; ... for the draw routine
W $01:9B80 STA $64 ; Restore [$64]
R $01:9D13 ORA $64 ; [$03] = palette | layer priority
R $01:9DBE ORA $64
R $01:9E81 LDA $64
R $01:9F46 ORA $64 ; OAM property = A OR [$04] OR [$64]
R $01:9F86 LDA RAM_SpriteProp
W $01:9F90 STA RAM_SpriteProp
W $01:9F96 STA RAM_SpriteProp ; Restore sprite property bits
R $01:AF79 ORA $64 ; Tile properties = ThwompGfxProp[X] | sprite priority [$64]
R $01:B359 LDA $64
R $01:B403 LDA $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)
W $01:BA78 STA $64 ; Restore [$64]
R $01:BBD0 LDA $64
R $01:BD77 ORA $64 ; Tile properties = sprite palette | sprite priority bits [$64]
R $01:BEFC ORA $64
R $01:C183 LDA $64
W $01:C18F STA $64 ; Timer >= $20: priority = $10 (drawn behind layers while growing out of block)
W $01:C1A7 STA $64 ; Restore [$64]
R $01:C208 LDA $64 ; Unreferenced: save level priority [$64]
W $01:C20D STA $64 ; [$64] = $10 (draw behind layers)
W $01:C213 STA $64 ; Restore [$64]
R $01:C36A ORA $64
R $01:C371 LDA $64
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:C65A ORA $64
R $01:C6C7 ORA $64
R $01:DBFC ORA $64 ; Properties = table value | sprite properties [$64]
R $01:DF92 LDA $64
R $01:E189 ORA $64
R $01:E3EF LDA $64
W $01:E3F9 STA $64 ; Emerging: priority $10 (draw behind the layer)
W $01:E3FF STA $64 ; Restore the priority
R $01:E741 LDA $64
R $01:E935 LDA $64
R $01:EB97 LDA $64
W $01:EBAB STA $64 ; [$64] = $10: Yoshi drawn behind the foreground (in pipe)
W $01:EBB1 STA $64 ; Restore [$64]
R $01:F499 ORA $64 ; Add the sprite priority bits [$64]
R $02:8120 ORA $64
R $02:8CA7 LDA $64
R $02:8D31 ORA $64
R $02:8DBF LDA $64
R $02:8E41 LDA $64
R $02:8EBD ORA $64 ; Prop = X/Y flip from timer bits 6-7 (spinning) | palette 1 | [$64]
R $02:8F17 LDA $64
R $02:8F73 LDA $64
R $02:901B ORA $64 ; Prop = palette | flips from DATA_028B8C[X] | [$64]
R $02:9249 ORA $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:9ED2 LDA $64
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:B88A LDA $64
W $02:B894 STA $64
W $02:B89A STA $64 ; Restore [$64]
R $02:B906 ORA $64 ; [$02] = sprite palette | draw priority [$64]
R $02:BB72 LDA $64
R $02:BC78 ORA $64 ; Properties = sprite palette | priority [$64]
R $02:BE72 ORA $64
R $02:BEE9 ORA $64
R $02:BF3C ORA $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:CF30 LDA $64
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]
R $02:E0D1 LDA $64
W $02:E0D6 STA $64 ; [$64] = $10: sprite is in front of layers
W $02:E120 STA $64 ; Restore [$64]
R $02:E21D LDA $64
W $02:E229 STA $64 ; Else [$64] = $10 (draw in front)
W $02:E260 STA $64 ; Restore [$64]
R $02:E5A3 ORA $64 ; Left tile properties = sprite palette | priority [$64]
R $02:E7BD LDA $64
W $02:E7C7 STA $64 ; Timer running (rock is breaking): [$64] = $10 (draw behind layers)
W $02:E7CE STA $64 ; Restore [$64]
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 $02:F98C ORA $64
R $03:83F5 ORA $64
R $03:84AE ORA $64
R $03:85D2 ORA $64
R $03:8758 ORA $64
R $03:8889 ORA $64 ; Add level priority [$64]
R $03:8B6D ORA $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:8F56 ORA $64
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:AF95 ORA $64
R $03:AFD2 ORA $64
R $03:B247 ORA $64 ; Properties from table | sprite priority bits [$64]
R $03:B3C0 ORA $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:C0E4 LDA $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
R $05:C6A1 EOR $64,X

$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 $00:BF09 LDA [$65],Y
R $00:BF0E LDA [$65],Y
W $04:DCBE STX $65 ; [$65] = $D000
R $04:DD13 LDA [$65],Y
R $04:DD1B LDA [$65],Y
R $04:DD23 LDA [$65],Y
R $04:DD2B LDA [$65],Y
R $05:83C9 LDA [$65],Y
W $05:8400 STA $65
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:85AC LDA [$65],Y ; Reload byte 5
R $05:85B6 LDA [$65],Y ; Reload byte 5
R $05:85CA LDA $65
W $05:85CF STA $65
R $05:8603 LDA [$65],Y
R $05:8608 LDA [$65],Y ; Read 3 object bytes at [$65] into [$0A], [$0B], [$59]
R $05:860D LDA [$65],Y
R $05:8614 ADC $65
W $05:8616 STA $65 ; [$65]-[$67] += 3 (bytes consumed)
R $05:86D9 LDA [$65],Y
W $05:D8C5 STA $65
R $05:D9AA LDA [$65],Y
R $05:DA28 LDA [$65],Y
W $05:DAB5 STA $65
R $05:DAF3 LDA [$65],Y
W $05:DB4F STA $65 ; Layer 1 pointer low word [$65] = ChocIsld2Layer1[X] (bank byte unchanged)
W $0C:93F4 STA $65
W $0C:9436 STA $65 ; [$65] = $5840: VRAM address of the first credits text row (BG3)
R $0C:9519 AND $65
R $0C:9523 AND $65
R $0C:952D AND $65
R $0C:9537 AND $65
R $0C:9EC3 LDA $65
R $0C:9F0B LDA $65
R $0C:9F47 LDA $65
W $0C:9F4D STA $65 ; [$65] += $20: VRAM address of the next tilemap row
R $0C:9F54 LDA $65
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
R $0D:A51B ADC $65
W $0D:A51D STA $65

$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)

$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 $00:BF02 STZ $67 ; $67 = 0: bank $00
W $04:DCC2 STA $67 ; [$67] = $05 (placeholder bank)
W $05:840A STA $67
W $05:D8CF STA $67
W $05:DABF STA $67
W $0C:943A STZ $67 ; [$67] = 0: index of the next credits text row
R $0C:9EE1 LDA $67
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)
R $05:8044 LDX $68
R $05:813C LDA [$68],Y
R $05:8151 LDA [$68],Y
R $05:8170 LDA [$68],Y
R $05:818E LDA [$68],Y
R $05:8195 LDA [$68],Y
R $05:83FB LDA $68
W $05:D8D4 STA $68
W $05:DAC4 STA $68
W $05:DB5B STA $68 ; Layer 2 pointer low word [$68] = ChocIsld2Layer2[X]
W $0C:93EE STA $68
R $0C:93FB LDX $68 ; X = source pointer
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
R $0C:9494 LDA [$68],Y
R $0C:949B LDA [$68],Y
W $0C:9500 STA $68 ; [$68] = address of this Map16's four tile words
R $0C:9517 LDA [$68],Y
R $0C:9521 LDA [$68],Y
R $0C:952B LDA [$68],Y
R $0C:9535 LDA [$68],Y
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)
W $05:D8D9 STA $69
W $05:DAC9 STA $69

$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)
R $05:8039 LDA $6A
W $05:8062 STA $6A ; Layer 2 bank = $0C (all prebuilt backgrounds live in bank $0C)
R $05:8408 LDA $6A
W $05:D8DE STA $6A
W $05:DACE STA $6A
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
R $05:8A57 LDA [$6B],Y
W $05:8B04 STA $6B ; [$6B] = low word of this screen's Map16 low-byte data pointer
R $05:8B37 LDA [$6B],Y
W $05:8BF6 STA $6B ; [$6B] = low word of this screen's Map16 low-byte data pointer
R $05:8C25 LDA [$6B],Y
W $05:8CE9 STA $6B ; [$6B] = low word of this screen's Map16 low-byte data pointer
R $05:8D1C LDA [$6B],Y
W $05:8D9A STA $6B ; [$6B] = $B900: low word of the Map16 low-byte data at $7E:B900
R $05:8DAE LDA $6B
W $05:8DB4 STA $6B
R $05:8DDB LDA [$6B],Y
W $0C:94C7 STX $6B ; [$6B] = $B900: pointer to the decompressed Map16 low bytes
R $0C:94EF LDA [$6B],Y
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:A6AE STA [$6B],Y ; Write it
R $0D:A6B1 LDA $6B
W $0D:A6BC STA $6B
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:A81B STA [$6B],Y
W $0D:A827 STA [$6B],Y
W $0D:A85E STA [$6B],Y
W $0D:A874 STA [$6B],Y
W $0D:A88B STA [$6B],Y
W $0D:A897 STA [$6B],Y
W $0D:A8A3 STA [$6B],Y
W $0D:A95B STA [$6B],Y ; Store tile [A] at the current Map16 position
R $0D:A963 LDA $6B
W $0D:A968 STA $6B
R $0D:A9D6 LDA $6B
W $0D:A9DB STA $6B
R $0D:A9EF LDA $6B
W $0D:A9F4 STA $6B
W $0D:AA4D STA [$6B],Y
W $0D:AA63 STA [$6B],Y
W $0D:AA75 STA [$6B],Y
W $0D:AAA1 STA [$6B],Y
W $0D:AAFA STA [$6B],Y
W $0D:AB1B STA [$6B],Y
W $0D:AB28 STA [$6B],Y
W $0D:AB35 STA [$6B],Y
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:B250 STA [$6B],Y ; Write top tile
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)
W $0D:B4BE STA [$6B],Y
R $0D:B4DB LDA [$6B],Y ; Load tile we're on
W $0D:B4F7 STA [$6B],Y
R $0D:B500 LDA [$6B],Y ; Load tile we're on
W $0D:B51C STA [$6B],Y
W $0D:B537 STA [$6B],Y
W $0D:B544 STA [$6B],Y
W $0D:B566 STA [$6B],Y
W $0D:B580 STA [$6B],Y
W $0D:B59B STA [$6B],Y
W $0D:B5A5 STA [$6B],Y
W $0D:B5E5 STA [$6B],Y
W $0D:B6F2 STA [$6B],Y
W $0D:B725 STA [$6B],Y
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:B9BD STA [$6B],Y ; Write the tile
W $0D:B9E9 STA [$6B],Y ; Page 0 tile $0BC
R $0D:B9F6 LDA [$6B],Y ; Tile already on the map here
W $0D:BA07 STA [$6B],Y ; Add tile X + 1
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
R $0D:BB16 LDA $6B
W $0D:BB1B STA $6B
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:D08C STA [$6B],Y
W $0D:D09D STA [$6B],Y
W $0D:D0CF STA [$6B],Y
W $0D:D0E0 STA [$6B],Y
R $0D:D110 LDA [$6B],Y
R $0D:D134 LDA [$6B],Y
W $0D:D1BB STA [$6B],Y
W $0D:D1C8 STA [$6B],Y
W $0D:D1FC STA [$6B],Y
W $0D:D218 STA [$6B],Y
W $0D:D238 STA [$6B],Y
W $0D:DA5E STA [$6B],Y ; Low byte $FE: Map16 tile $1FE
W $0D:DA77 STA [$6B],Y
W $0D:DA8F STA [$6B],Y
W $0D:DA9B STA [$6B],Y
W $0D:DAE8 STA [$6B],Y ; Store the tile low byte
W $0D:DD48 STA [$6B],Y
W $0D:DDB1 STA [$6B],Y
W $0D:DDC7 STA [$6B],Y
W $0D:DDDD STA [$6B],Y
W $0D:DDF8 STA [$6B],Y
W $0D:DE54 STA [$6B],Y
W $0D:DE6A STA [$6B],Y
W $0D:DE80 STA [$6B],Y
W $0D:DE9B STA [$6B],Y
W $0D:DF72 STA $6B
W $0D:DFCD STA [$6B],Y
W $0D:E110 STA [$6B],Y
W $0D:E170 STA [$6B],Y
W $0D:E96E STA [$6B],Y
W $0D:E97C STA [$6B],Y
W $0D:EB88 STA [$6B],Y
W $0D:EC51 STA [$6B],Y
W $0D:EC63 STA [$6B],Y ; Write Map16 tile $110 at the position
W $0D:EC73 STA [$6B],Y
W $0D:ED40 STA [$6B],Y
W $0D:ED62 STA [$6B],Y
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]
W $0D:EDD8 STA [$6B],Y
W $0D:EF0F STA [$6B],Y ; Store the tile
W $0D:EF64 STA [$6B],Y
W $0D:EFD7 STA [$6B],Y
W $0D:EFFC STA [$6B],Y
W $0D:F028 STA [$6B],Y

$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
RW $05:86C1 INC $6C
R $0D:A6B5 LDA $6C
W $0D:A6C2 STA $6C
R $0D:A834 LDA $6C
W $0D:A839 STA $6C
R $0D:A96C LDA $6C
W $0D:A970 STA $6C
R $0D:A987 LDA $6C
W $0D:A98B STA $6C
R $0D:A9E1 LDA $6C
W $0D:A9E5 STA $6C
R $0D:A9FA LDA $6C
W $0D:A9FE STA $6C
R $0D:AFDF LDA $6C ; A = high pointer byte
W $0D:AFE3 STA $6C ; [$6C] = [$6F] = [$05] = new page
R $0D:B259 LDA $6C
W $0D:B25D STA $6C
R $0D:B283 LDA $6C
W $0D:B287 STA $6C
R $0D:BB1F LDA $6C
W $0D:BB23 STA $6C
R $0D:DDBA LDA $6C
W $0D:DDBE STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte)
R $0D:DDD0 LDA $6C
W $0D:DDD4 STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte)
R $0D:DDE6 LDA $6C
W $0D:DDEA STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte)
R $0D:DE01 LDA $6C
W $0D:DE05 STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte)
R $0D:DE5D LDA $6C
W $0D:DE61 STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte)
R $0D:DE73 LDA $6C
W $0D:DE77 STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte)
R $0D:DE89 LDA $6C
W $0D:DE8D STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte)
R $0D:DEA4 LDA $6C
W $0D:DEA8 STA $6C ; Move pointer down one row (Y += $10, carry into screen high byte)
W $0D:DF91 STA $6C
R $0D:E981 LDA $6C
W $0D:E986 STA $6C ; Next page: [$6C] and [$6F] += 1
R $0D:EF18 LDA $6C
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
W $0C:94CB STA $6D

$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 $00:BF21 STA $6E
R $00:C094 LDA [$6E],Y
W $00:C098 STA [$6E],Y
R $00:C0E5 LDA [$6E],Y
W $00:C0E9 STA [$6E],Y
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:8DB6 LDA $6E
W $05:8DBC STA $6E
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)
R $0C:94F3 LDA [$6E],Y
W $0D:A6BE STA $6E
W $0D:A96A STA $6E ; Mirror into [$6E]
W $0D:A9DD STA $6E ; Mirror into [$6E]
W $0D:A9F6 STA $6E ; Mirror into [$6E]
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)
W $0D:BB1D STA $6E
W $0D:DF76 STA $6E

$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 $00:BF28 STA $6F
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:A972 STA $6F ; Mirror into [$6F]
W $0D:A98D STA $6F ; Mirror into [$6F]
W $0D:A9E7 STA $6F ; Mirror into [$6F]
W $0D:AA00 STA $6F ; Mirror into [$6F]
W $0D:AFE5 STA $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)
W $0D:DDC0 STA $6F
W $0D:DDD6 STA $6F
W $0D:DDEC STA $6F
W $0D:DE07 STA $6F
W $0D:DE63 STA $6F
W $0D:DE79 STA $6F
W $0D:DE8F STA $6F
W $0D:DEAA STA $6F
W $0D:DF95 STA $6F
W $0D:E988 STA $6F
W $0D:EF1F STA $6F

$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:A676 STZ $70,X
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)
R $00:919B LDA RAM_MarioAnimation
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)
R $00:A200 ORA RAM_MarioAnimation
R $00:A226 LDA RAM_MarioAnimation
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
R $00:F5B7 LDA RAM_MarioAnimation
W $00:F5FE STA RAM_MarioAnimation ; Mario animation = 1 (power down)
W $00:F616 STA RAM_MarioAnimation ; Mario animation = 9 (dying)
R $01:9FBE LDA RAM_MarioAnimation
R $01:9FE3 LDA RAM_MarioAnimation
R $01:A80F LDA RAM_MarioAnimation
R $01:B857 LDA RAM_MarioAnimation
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
R $01:FC62 LDA RAM_MarioAnimation
R $02:9134 LDA RAM_MarioAnimation
R $02:CC1E LDA RAM_MarioAnimation
R $02:CF52 LDA RAM_MarioAnimation
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
R $00:C92E LDA RAM_IsFlying
R $00:C984 LDA RAM_IsFlying
R $00:CCED LDA RAM_IsFlying
R $00:CD64 LDY RAM_IsFlying
R $00:CEB9 LDA RAM_IsFlying
R $00:CF26 LDA RAM_IsFlying
R $00:CF76 LDY RAM_IsFlying
R $00:CF9D LDA RAM_IsFlying
W $00:D263 STZ RAM_IsFlying ; Not flying
W $00:D291 STA RAM_IsFlying ; [RAM_IsFlying] = $0C (airborne)
R $00:D5F2 LDA RAM_IsFlying
W $00:D67D STA RAM_IsFlying ; [RAM_IsFlying] = A: Mario is in the air
R $00:D727 LDA RAM_IsFlying
R $00:D758 LDY RAM_IsFlying
R $00:D767 LDA RAM_IsFlying
R $00:D77F ORA RAM_IsFlying ; Level ending or in the air: use the normal deceleration table
R $00:D7E9 LDA RAM_IsFlying
W $00:D818 STA RAM_IsFlying ; [RAM_IsFlying] = $0B: rising
R $00:D8CD LDA RAM_IsFlying
R $00:D8ED LDA RAM_IsFlying
R $00:D93C LDX RAM_IsFlying
W $00:D946 STX RAM_IsFlying
R $00:D99A LDA RAM_IsFlying
W $00:D9A6 STA RAM_IsFlying ; [RAM_IsFlying] = $0B: Mario is rising
R $00:D9F9 LDA RAM_IsFlying
W $00:D9FF STA RAM_IsFlying ; [RAM_IsFlying] = $0B: Mario is rising
R $00:DA2F LDA RAM_IsFlying
R $00:DA5E LDA RAM_IsFlying
R $00:DA73 LDA RAM_IsFlying
R $00:DA88 LDA RAM_IsFlying
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)
R $00:E940 LDA RAM_IsFlying
W $00:EA9D STA RAM_IsFlying ; [RAM_IsFlying] = $0B (in the air)
R $00:EAF7 LDA RAM_IsFlying
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
R $00:EE31 ORA RAM_IsFlying
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:F87A LDX RAM_IsFlying
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 $00:FE4E ORA RAM_IsFlying
R $01:A020 LDA RAM_IsFlying
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
R $01:EAE2 LDA RAM_IsFlying
R $01:EAF7 LDA RAM_IsFlying
R $01:EC61 LDA RAM_IsFlying
R $01:ED38 LDA RAM_IsFlying
R $01:EDB3 LDY RAM_IsFlying
R $01:EEEB LDA RAM_IsFlying
R $01:FCCA LDA RAM_IsFlying
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)
R $00:CDC0 LDY RAM_IsDucking
W $00:CF1E STZ RAM_IsDucking ; Not ducking
R $00:CF6B LDY RAM_IsDucking
R $00:D06C LDA RAM_IsDucking
R $00:D085 LDA RAM_IsDucking
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)
R $00:D61E LDA RAM_IsDucking
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 $01:A109 LDY RAM_IsDucking
R $01:B4BC LDY RAM_IsDucking
R $01:B8BB LDY RAM_IsDucking
R $02:D4A2 LDY RAM_IsDucking ; Y = ducking flag
R $02:FE1F LDY RAM_IsDucking
R $03:B678 LDA RAM_IsDucking

$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)
R $00:CD4A LDA RAM_IsClimbing
W $00:CD74 STA RAM_IsClimbing ; Start climbing: [$74] = [$8B]
R $00:DBAE LDA RAM_IsClimbing ; A = [RAM_IsClimbing]
R $00:DBE0 LDA 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)
R $01:AA33 LDA RAM_IsClimbing
R $02:93D2 LDY RAM_IsClimbing

$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:CD79 LDA RAM_IsSwimming
R $00:CEC7 LDA RAM_IsSwimming
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
R $00:EA4D LDA RAM_IsSwimming
W $00:EA60 STA RAM_IsSwimming ; [RAM_IsSwimming] = 1
R $00:EA69 LDA RAM_IsSwimming
W $00:EAA3 STZ RAM_IsSwimming ; [RAM_IsSwimming] = 0
R $00:F856 LDX RAM_IsSwimming

$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
R $00:C714 LDY RAM_MarioDirection
W $00:C97C STA RAM_MarioDirection ; Mario faces right
R $00:CE4E LDA RAM_MarioDirection
W $00:CF3D STA RAM_MarioDirection ; Mario direction = DATA_00CEA1[X] (spin makes Mario face left/right in turn)
R $00:CF5A ORA RAM_MarioDirection
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:D64E LDY RAM_MarioDirection
R $00:D6BB CMP RAM_MarioDirection
R $00:D6C3 LDX RAM_MarioDirection ; X = facing direction
R $00:D6D5 LDY RAM_MarioDirection ; Y = facing direction
R $00:D6D7 CMP RAM_MarioDirection
W $00:D6EA STA RAM_MarioDirection ; Face the held direction
R $00:D84A LDY RAM_MarioDirection
R $00:D8B9 LDX RAM_MarioDirection
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:DC26 LDA RAM_MarioDirection
W $00:DC2A STA RAM_MarioDirection
R $00:E39C ORA RAM_MarioDirection
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:F425 LDA RAM_MarioDirection
W $00:F429 STA RAM_MarioDirection
R $00:FCDA LDA RAM_MarioDirection
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)
R $01:A087 LDY RAM_MarioDirection
R $01:A0B3 LDA RAM_MarioDirection
R $01:A170 LDA RAM_MarioDirection
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)
R $01:F90E CPY RAM_MarioDirection
R $03:AD02 LDA RAM_MarioDirection
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)
R $0C:D68E LDA RAM_MarioDirection
R $0C:D6AD LDX RAM_MarioDirection
R $0C:D715 LDA RAM_MarioDirection

$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)
R $00:CD28 LDA RAM_MarioObjStatus
R $00:D612 LDA RAM_MarioObjStatus
R $00:E9A7 LDA RAM_MarioObjStatus
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)
R $00:E9FB LDA RAM_MarioObjStatus
R $00:EA0D LDA RAM_MarioObjStatus
R $00:EA22 LDA RAM_MarioObjStatus
R $00:EA92 LDA RAM_MarioObjStatus
W $00:EAA9 STZ RAM_MarioObjStatus ; Blocked status [$77] = 0
RW $00:EC7E TSB RAM_MarioObjStatus ; Set the blocked bits in [RAM_MarioObjStatus]
R $00:ED1C LDA RAM_MarioObjStatus
W $00:ED22 STA RAM_MarioObjStatus
RW $00:ED39 TSB RAM_MarioObjStatus ; Set bit 3 (blocked above) in [RAM_MarioObjStatus]
R $00:EE2D LDA RAM_MarioObjStatus
RW $00:EF77 TSB RAM_MarioObjStatus ; Set bit 2 (on ground) in [RAM_MarioObjStatus]
R $01:B470 LDA RAM_MarioObjStatus
R $01:B498 LDA RAM_MarioObjStatus
R $01:CA56 LDA RAM_MarioObjStatus
R $01:D9F3 LDA RAM_MarioObjStatus
R $02:EE90 LDA 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:C47E STZ $78 ; [$78] = 0
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
R $00:E2C0 LDA $78
R $00:E2D4 LDA $78
RW $00:E441 TSB $78 ; Set bits in tile mask [$78]
RW $00:E45D LSR $78
W $01:CA77 STA $78 ; B not pressed: [$78] = $FF (probably cancels Mario's remaining jump/bonk state)
W $02:D739 STA $78 ; [$78] = $FF

$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:D792 STA $7A
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:C816 LDY RAM_MarioSpeedX
R $00:C81F ADC RAM_MarioSpeedX ; X speed += A: decay toward 0
W $00:C821 STA RAM_MarioSpeedX
W $00:C825 STZ RAM_MarioSpeedX ; Unreachable: X speed = 0
W $00:C982 STA RAM_MarioSpeedX ; Mario X speed = 5
R $00:C98B LDA RAM_MarioSpeedX
W $00:CCD8 STZ RAM_MarioSpeedX ; Mario X speed = 0
R $00:CEDE LDA RAM_MarioSpeedX
R $00:CFBC LDA RAM_MarioSpeedX
W $00:D10C STZ RAM_MarioSpeedX ; Mario X speed = 0
R $00:D24E LDA RAM_MarioSpeedX
W $00:D25C STA RAM_MarioSpeedX ; Mario X speed = PipeSpeedX[Y]
W $00:D2B4 STA RAM_MarioSpeedX ; Mario X speed = $40
R $00:D622 LDA RAM_MarioSpeedX
R $00:D630 LDA RAM_MarioSpeedX
R $00:D6F4 LDA RAM_MarioSpeedX
R $00:D71C LDA RAM_MarioSpeedX
R $00:D742 LDA RAM_MarioSpeedX
R $00:D772 LDA RAM_MarioSpeedX
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)
R $00:E9E5 SBC RAM_MarioSpeedX
W $00:E9EE STA RAM_MarioSpeedX ; Mario X speed = scroll speed (carried along with the screen)
R $00:EA2B LDA RAM_MarioSpeedX
W $00:EA32 STZ RAM_MarioSpeedX ; Mario X speed = 0
R $00:EAEC LDA RAM_MarioSpeedX
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:EF1F LDA RAM_MarioSpeedX
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 $00:FE5E LDA RAM_MarioSpeedX
R $01:A060 ADC RAM_MarioSpeedX ; Sprite X speed = Mario X speed +/- 4
R $01:A070 LDA RAM_MarioSpeedX
R $01:A095 EOR RAM_MarioSpeedX ; Compare sign of kick speed and Mario X speed
R $01:A099 LDA RAM_MarioSpeedX
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
R $01:BC78 ADC RAM_MarioSpeedX
R $01:C2FB LDA RAM_MarioSpeedX
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
R $01:E839 LDA RAM_MarioSpeedX
R $01:EAA9 LDA RAM_MarioSpeedX
W $01:ED4D STZ RAM_MarioSpeedX
R $01:EDAD LDA RAM_MarioSpeedX
W $01:EDBD STA RAM_MarioSpeedX ; Mario X speed = DATA_01EBC0[Y] (+$10 or -$10 kick-off)
R $01:EEEF LDA RAM_MarioSpeedX
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
R $02:CC57 LDY RAM_MarioSpeedX
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)
R $0C:D831 LDY RAM_MarioSpeedX
R $0C:D845 LDA RAM_MarioSpeedX

$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
R $00:C6F0 LDA RAM_MarioSpeedY
W $00:C730 STX RAM_MarioSpeedY ; Mario Y speed = X
R $00:C807 LDA RAM_MarioSpeedY
W $00:C812 STA RAM_MarioSpeedY
R $00:CD24 LDA RAM_MarioSpeedY
W $00:CD2E STZ RAM_MarioSpeedY ; Yes: Y speed = 0
R $00:CEBF BIT RAM_MarioSpeedY
R $00:CF2A LDA RAM_MarioSpeedY
R $00:D250 ORA RAM_MarioSpeedY
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:D808 LDA RAM_MarioSpeedY
R $00:D834 LDY RAM_MarioSpeedY
R $00:D886 LDA RAM_MarioSpeedY
R $00:D8A4 LDA RAM_MarioSpeedY
W $00:D8B4 STX RAM_MarioSpeedY
R $00:D90D LDA RAM_MarioSpeedY
R $00:D91E CMP RAM_MarioSpeedY
R $00:D930 LDA RAM_MarioSpeedY
W $00:D94C STA RAM_MarioSpeedY
R $00:D952 LDA RAM_MarioSpeedY
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]
R $00:DC2D LDA RAM_MarioSpeedY
W $00:DC3E STA RAM_MarioSpeedY ; Wall run: Mario Y speed = +/- X speed
W $00:DC4C STA RAM_MarioSpeedY ; Restore Mario Y speed
R $00:EA51 LDA RAM_MarioSpeedY
W $00:EA5C STZ RAM_MarioSpeedY ; Mario Y speed = 0 on entering the water
R $00:EA6F CMP RAM_MarioSpeedY
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:EE85 LDA RAM_MarioSpeedY
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
R $01:B46C LDA RAM_MarioSpeedY
W $01:B478 STA RAM_MarioSpeedY ; Mario Y speed = $10: keep him pressed onto the sprite
R $01:B4D4 LDA RAM_MarioSpeedY
W $01:B4DA STA RAM_MarioSpeedY ; Mario Y speed = $10: bumped back down
R $01:B5A6 LDA RAM_MarioSpeedY
R $01:B5F7 LDA RAM_MarioSpeedY
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
R $01:C2B3 LDA RAM_MarioSpeedY
W $01:C2BE STA RAM_MarioSpeedY ; Mario Y speed = $D0 (bounce off it)
R $01:C2F7 LDA RAM_MarioSpeedY
R $01:CA2E LDA RAM_MarioSpeedY
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)
R $01:DE5D LDA RAM_MarioSpeedY
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:E852 STA RAM_MarioSpeedY
W $01:E88E STA RAM_MarioSpeedY ; Mario Y speed = $C0: jump off the cloud
R $01:EAE8 LDA RAM_MarioSpeedY
R $01:ED44 LDA RAM_MarioSpeedY
W $01:ED4F STZ RAM_MarioSpeedY ; Mario speed = 0
W $01:EDC1 STA RAM_MarioSpeedY ; Mario Y speed = A (jump away)
R $01:EF04 LDY RAM_MarioSpeedY
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)
R $02:CC81 LDY RAM_MarioSpeedY
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)
R $02:CFA1 LDA RAM_MarioSpeedY
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 $02:D967 STZ RAM_MarioSpeedY
R $02:EE5D LDA RAM_MarioSpeedY
R $02:F265 LDA RAM_MarioSpeedY
R $03:87E6 LDA RAM_MarioSpeedY
W $03:87F4 STZ RAM_MarioSpeedY ; Mario Y speed = 0
R $03:8C76 LDA RAM_MarioSpeedY
W $03:8CCA STZ RAM_MarioSpeedY ; Mario Y speed = 0
R $03:959A LDA RAM_MarioSpeedY
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
R $03:CEAD LDA RAM_MarioSpeedY

$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)

$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 $00:FD5A LDA $7F ; A = [$7F]
R $00:FE50 ORA $7F
R $01:C5B0 ORA $7F ; Mario X or Y position high byte non-zero?
R $02:8AF5 ORA $7F ; OR Mario offscreen flag [$7F]
R $02:CF5A ORA $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)
R $00:CA84 ADC $80
W $00:E369 STA $80 ; [$80] = Mario Y on screen
R $00:E46F LDA $80 ; A = [$80] (Mario Y screen position)
R $00:F999 LDA $80 ; A = [$80]
R $01:B463 LDA $80
R $01:B4CE ADC $80 ; Compare Mario's head ([$80] + A) with the sprite top ([$00])
R $01:B86E LDA $80
R $01:B8C6 ADC $80
R $01:CA25 LDA $80
R $01:DE6F CMP $80 ; Compare block Y (on screen) + offset with Mario's screen Y [$80]
R $01:FCA7 LDA $80
R $02:8AFB LDA $80 ; Mario screen Y [$80]
R $02:9E26 SBC $80
R $02:CF77 ADC $80
R $02:D4AB CMP $80 ; Compared with Mario's Y position on screen [$80]
R $02:E6D7 LDA $80
R $02:F23B SBC $80
R $03:ACF2 LDA $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:ECE1 LDA [$82],Y
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)

$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 $00:CFD4 LDA $86
R $00:D626 LDA $86
R $00:D702 LDA $86
R $00:D754 LDY $86
R $01:8057 ORA $86 ; Return unless [frame counter] & 3 = 0 and [$86] (slippery level flag) = 0
R $01:89C5 LDA $86
R $01:8A3D LDA $86

$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:A776 LDA $88
W $00:A77C STA $88
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
R $00:D1DB LDX $88
R $00:D23A LDY $88
RW $00:D241 DEC $88 ; Pipe timer [$88] -= 1
R $00:D282 ADC $88
W $00:D284 STA $88
RW $00:D296 DEC $88 ; Timer [$88] -= 1
R $00:D29D LDA $88
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)
W $00:A6BA STY $89 ; [$89] = 1
W $00:A743 STA $89
R $00:A774 LDX $89 ; X = [$89]
RW $00:C89B DEC $89 ; Frames remaining in this script step: [$89]--
W $00:C8A6 STA $89 ; [$89] = frame count of the new step
R $00:D1C4 LDA $89
R $00:D236 LDA $89
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)
W $00:9BE8 STA $8A
R $00:9BFB SBC $8A ; A = $5A5A - sum: the checksum word
W $00:9DCA STA $8A ; [$8A] = it
R $00:9DD6 ADC $8A ; [$8A] += A (16-bit, carry below)
W $00:9DD8 STA $8A
R $00:9DE6 LDA $8A ; A = checksum + sum of data
W $00:9EA0 STA $8A
W $00:B88D STY $8A
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]
R $00:B985 LDX $8A
W $00:B98F STX $8A ; Store the advanced pointer
W $00:BA2F STA $8A
W $00:DC2F STA $8A ; Save Mario Y speed in [$8A]
R $00:DC4A LDA $8A
RW $00:EA49 LSR $8A
RW $00:EA55 LSR $8A
RW $00:EA65 LSR $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:86A0 STA $8A
W $04:8712 STA $8A
R $04:8789 LDA $8A
R $04:879D LDA $8A
W $04:87C8 STA $8A ; Restore [$8A]
R $04:89A9 LDA $8A
R $04:89BF LDA $8A
W $04:89C4 STA $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
RW $04:EB4F DEC $8A ; Next pass

$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:BA34 STA $8B
W $00:CD48 STA $8B ; Yes: [$8B] = $1F (touching all climbable tiles)
R $00:CD56 LDA $8B
R $00:CD6C LDA $8B
R $00:CD72 LDA $8B
R $00:DBD8 LDA $8B ; A = [$8B] (climb tile flags)
RW $00:DBFC LSR $8B
R $00:DC05 LDA $8B
R $00:EA3B LDA $8B
W $00:EAB3 STZ $8B ; [$8B] = 0
RW $00:F302 TSB $8B ; Set the flag bits in [$8B] (probably the climbing / tile-contact flags)
W $04:86A6 STA $8B
R $04:86BC LDA $8B
W $04:86C1 STA $8B ; Walking poses are drawn 5 pixels higher: [$8B] and [$07] -= 5
W $04:8718 STA $8B
R $04:8730 LDA $8B
W $04:8735 STA $8B ; Walking poses are drawn 5 pixels higher: [$8B] and [$07] -= 5
R $04:87A8 LDA $8B
R $04:89D2 LDA $8B
W $04:89D7 STA $8B
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)
W $00:B891 STA $8C
RW $00:B98D INC $8C ; Pointer wrapped past $FFFF: restart at $8000 of the next bank
W $00:BA39 STA $8C
R $00:DBE4 CPX $8C
W $00:F306 STA $8C ; [$8C] = [$93]
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
RW $04:89C6 DEC $8C
R $04:89C8 LDA $8C
R $04:89D9 LDA $8C
W $04:8CE8 STA $8C ; [$8C] = 7: tile counter for 8 tiles (rider + Yoshi)
RW $04:8D6F DEC $8C

$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:B8A8 STA $8D
W $00:B8B7 STA [$8D]
RW $00:B8BA DEC $8D ; X--; $8D -= 2
RW $00:B8BC DEC $8D
W $00:B8C9 STA [$8D] ; Store it at [$8D]
RW $00:B8CE DEC $8D
RW $00:B8D0 DEC $8D ; $8D -= 2
W $00:B912 STA $8D ; $8D = byte count
R $00:B924 LDX $8D ; X = count
R $00:B936 LDX $8D
W $00:B939 STX $8D
R $00:B942 LDX $8D ; X = count
R $00:B953 LDX $8D ; X = count
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)
R $00:EE89 LDA $8D

$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)
W $00:EE26 STZ $8E ; [$8E] = 0
R $00:EF3B LDX $8E ; X = [$8E]
R $00:F46B LDA $8E
W $00:F992 STA $8E

$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:B8A1 STA $8F
W $00:B8ED STA $8F ; Remember the command byte in [$8F]
R $00:B8F6 LDA $8F
R $00:B8FF LDA $8F
R $00:B907 LDA $8F
R $00:C742 LDA $8F
RW $00:C74D INC $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:EC06 LDA $8F
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)
R $00:F3C8 LDY $8F

$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)
W $00:EADF STA $90
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:ED80 LDA $90
W $00:ED84 STA $90
R $00:EDAE LDA $90 ; A = [$90] (Mario Y offset inside the block)
W $00:EDC4 STZ $90 ; [$90] = 0
R $00:EE11 LDA $90 ; A = [$90]
W $00:EE15 STZ $90 ; [$90] = 0
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:ECD4 LDA $91
W $00:ECD8 STA $91
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]
R $00:F015 LDA $92 ; A = X column [$92]
R $00:F3F3 LDA $92 ; A = [$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]
R $00:F304 LDA $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:94CB STA RAM_MarioXPos
W $00:9811 STA RAM_MarioXPos ; Mario X position = $0050
W $00:992C STA RAM_MarioXPos ; Mario X position = $0020
R $00:A2F5 LDA RAM_MarioXPos
R $00:A6F5 LDA RAM_MarioXPos
RW $00:A728 TSB RAM_MarioXPos ; Mario X position low |= 8
RW $00:A758 TSB RAM_MarioXPos ; Mario X position low |= 8
R $00:A783 LDA RAM_MarioXPos
W $00:A789 STA RAM_MarioXPos
R $00:C6FA LDY RAM_MarioXPos
RW $00:C7CA TRB RAM_MarioXPos ; Round Mario's X position down to a multiple of 8
R $00:CCA8 LDA RAM_MarioXPos,X
W $00:CCAE STA RAM_MarioXPos,X
W $00:CCF6 STA RAM_MarioXPos ; Mario X position = keyhole X [$1436]
R $00:CD04 LDA RAM_MarioXPos
R $00:D04D LDA RAM_MarioXPos
R $00:D214 LDA RAM_MarioXPos
R $00:D220 LDA RAM_MarioXPos
W $00:D226 STA RAM_MarioXPos ; Mario X += PipeCntringSpeed[X]
R $00:DBBA LDA RAM_MarioXPos ; A = Mario X position low
R $00:DC71 ADC RAM_MarioXPos,X
W $00:DC73 STA RAM_MarioXPos,X ; Position [$94,X] += A + carry
R $00:E340 LDA RAM_MarioXPos
R $00:E953 LDA RAM_MarioXPos
W $00:E958 STA RAM_MarioXPos ; Mario X += [$26] (layer 2 X displacement)
R $00:E968 LDA RAM_MarioXPos
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)
R $00:E9BF LDA RAM_MarioXPos
R $00:EA18 LDA RAM_MarioXPos
W $00:EA1E STA RAM_MarioXPos ; Mario X += [DATA_00E90D+Y]: push out of the wall by 1 pixel (-1 or +1)
R $00:EB19 LDA RAM_MarioXPos
W $00:EB1F STA RAM_MarioXPos
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:F393 LDA RAM_MarioXPos
R $00:F3D1 LDA RAM_MarioXPos ; A = Mario X position
R $00:F443 LDA RAM_MarioXPos
R $00:F451 LDA RAM_MarioXPos
R $00:F71A LDA RAM_MarioXPos
R $00:F76D LDA RAM_MarioXPos
R $00:F933 CMP RAM_MarioXPos ; Compare with Mario X
R $00:F942 LDA RAM_MarioXPos ; A = Mario X + $0F
R $00:F9AA LDA RAM_MarioXPos
W $00:F9E4 STA RAM_MarioXPos ; Mario X = result
R $00:FCA1 LDA RAM_MarioXPos
R $00:FD2D LDA RAM_MarioXPos
R $00:FDDE LDA RAM_MarioXPos
R $00:FE33 LDA RAM_MarioXPos
R $00:FE77 LDA RAM_MarioXPos
R $00:FEDF LDA RAM_MarioXPos
R $00:FF16 ADC RAM_MarioXPos ; Mario X += signed [$17BD] (layer 1 X movement)
W $00:FF18 STA RAM_MarioXPos
R $01:A0E2 LDA.W RAM_MarioXPos,Y
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:ABAF LDA RAM_MarioXPos
R $01:B4A7 ADC RAM_MarioXPos ; Mario X low += A
W $01:B4A9 STA RAM_MarioXPos
W $01:B528 STA RAM_MarioXPos
R $01:B8A8 ADC RAM_MarioXPos
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:BAEA LDA RAM_MarioXPos
R $01:BC1D LDA RAM_MarioXPos
R $01:C0CD LDA RAM_MarioXPos
R $01:C5E6 LDA RAM_MarioXPos
R $01:CA65 ADC RAM_MarioXPos
W $01:CA67 STA RAM_MarioXPos
R $01:D310 CMP RAM_MarioXPos
R $01:DA75 CMP RAM_MarioXPos
R $01:DA98 ADC RAM_MarioXPos ; Mario X low += A
W $01:DA9A STA RAM_MarioXPos
R $01:EB51 LDA RAM_MarioXPos
R $02:848F LDA RAM_MarioXPos
R $02:85B6 ADC RAM_MarioXPos
R $02:8644 LDA RAM_MarioXPos
R $02:86CF LDA RAM_MarioXPos ; Mario X low
R $02:8BE5 LDA RAM_MarioXPos ; Mario X low
R $02:9C16 LDA RAM_MarioXPos
R $02:B495 LDA RAM_MarioXPos
R $02:B4FF LDA RAM_MarioXPos
R $02:CC60 CMP RAM_MarioXPos
W $02:CC64 STA RAM_MarioXPos ; Push Mario to the left wall
R $02:CC70 CMP RAM_MarioXPos
W $02:CC79 STA RAM_MarioXPos
R $02:D2C9 LDA RAM_MarioXPos
W $02:D2D8 STA RAM_MarioXPos
W $02:D2F8 STA RAM_MarioXPos
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 $02:EE9F ADC RAM_MarioXPos
W $02:EEA1 STA RAM_MarioXPos
R $02:F210 SBC RAM_MarioXPos
R $02:FE10 LDA RAM_MarioXPos
R $02:FE87 LDA RAM_MarioXPos
R $03:8814 ADC RAM_MarioXPos
W $03:8816 STA RAM_MarioXPos
R $03:8C7A LDA RAM_MarioXPos
R $03:8CDA ADC RAM_MarioXPos ; Mario X low += sprite movement
W $03:8CDC STA RAM_MarioXPos
R $03:8CE4 LDA RAM_MarioXPos
R $03:949F LDA RAM_MarioXPos
W $03:94A5 STA RAM_MarioXPos
R $03:AB34 CMP RAM_MarioXPos
R $03:B665 LDA RAM_MarioXPos
R $03:B819 LDA RAM_MarioXPos
R $03:C2EF LDA RAM_MarioXPos
W $04:85AF STA RAM_MarioXPos
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:D06D LDA RAM_MarioXPos
R $0C:D252 LDA RAM_MarioXPos
R $0C:D3D1 LDA RAM_MarioXPos
R $0C:D4C5 ADC RAM_MarioXPos ; OAM X = Mario X + offset
R $0C:D52A ADC RAM_MarioXPos ; OAM X = Mario X + 4
R $0C:D599 ADC RAM_MarioXPos
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
R $0C:D7BA LDA RAM_MarioXPos
W $0C:D7C2 STA RAM_MarioXPos ; Mario X += 1
R $0C:D818 LDA RAM_MarioXPos
R $0C:D82B LDY RAM_MarioXPos
R $0C:D83F CMP RAM_MarioXPos
W $0C:D843 STA RAM_MarioXPos

$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:F398 LDA RAM_MarioXPosHi
R $00:FCA5 LDA RAM_MarioXPosHi ; Yoshi X = Mario X
R $00:FD36 LDA RAM_MarioXPosHi
R $00:FDE3 LDA RAM_MarioXPosHi
R $00:FE3B LDA RAM_MarioXPosHi
R $00:FEE8 LDA RAM_MarioXPosHi
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:B4AE STA RAM_MarioXPosHi
W $01:B530 STA RAM_MarioXPosHi
R $01:B8AD ADC RAM_MarioXPosHi
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
R $01:BC2B LDA RAM_MarioXPosHi
R $01:CA6A ADC RAM_MarioXPosHi
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
W $01:DA9F STA RAM_MarioXPosHi
R $01:EB59 LDA RAM_MarioXPosHi
R $02:8496 LDA RAM_MarioXPosHi
R $02:8648 LDA RAM_MarioXPosHi,X
R $02:86D4 LDA RAM_MarioXPosHi ; Mario X high
R $02:8BE9 LDA RAM_MarioXPosHi ; Mario X high
R $02:9C1F LDA RAM_MarioXPosHi
R $02:B504 LDA RAM_MarioXPosHi
R $02:D2CC LDA RAM_MarioXPosHi
W $02:D2DD STA RAM_MarioXPosHi
W $02:D2F5 STA RAM_MarioXPosHi
R $02:D503 LDA RAM_MarioXPosHi ; A = Mario X high
W $02:EAEE STA RAM_MarioXPosHi ; Mario X position high byte with carry
R $02:EEA4 ADC RAM_MarioXPosHi
W $02:EEA6 STA RAM_MarioXPosHi ; Mario X += platform movement (16 bit)
R $03:8819 ADC RAM_MarioXPosHi
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 $03:8CE1 STA RAM_MarioXPosHi
R $03:8CEB LDA RAM_MarioXPosHi
R $03:94A7 LDA RAM_MarioXPosHi
W $03:94AC STA RAM_MarioXPosHi
R $03:AB39 SBC RAM_MarioXPosHi
R $03:B66C LDA RAM_MarioXPosHi
R $03:B820 LDA RAM_MarioXPosHi
R $03:C2F3 LDA RAM_MarioXPosHi
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:D9E7 STA RAM_MarioXPosHi
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
W $0C:A25F STA RAM_MarioXPosHi

$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:94D0 STA RAM_MarioYPos
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)
R $00:A6FC LDA RAM_MarioYPos
W $00:A70F STA RAM_MarioYPos ; Mario Y position low = $A0
RW $00:A72C TSB RAM_MarioYPos ; Mario Y position low |= 2
R $00:A78B LDA RAM_MarioYPos
W $00:A791 STA RAM_MarioYPos
R $00:C6F4 LDA RAM_MarioYPos
W $00:C73D STA RAM_MarioYPos ; Mario Y = A (snap to the ground)
R $00:C8EC CMP RAM_MarioYPos
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]
R $00:CD0C LDA RAM_MarioYPos
R $00:D056 LDA RAM_MarioYPos
R $00:D1B4 LDA RAM_MarioYPos
W $00:D1C0 STA RAM_MarioYPos ; Mario Y = ((Y - 8) & $FFF0) | $0E (center on the pipe)
RW $00:D1E7 INC RAM_MarioYPos
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
R $00:E95A LDA RAM_MarioYPos
W $00:E95F STA RAM_MarioYPos ; Mario Y += [$28] (layer 2 Y displacement)
R $00:E96F LDA RAM_MarioYPos
W $00:E974 STA RAM_MarioYPos ; Mario Y -= [$28] (undo the displacement)
R $00:EADB LDA RAM_MarioYPos
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)
W $00:ED31 STA RAM_MarioYPos
R $00:EED4 LDA RAM_MarioYPos
W $00:EED9 STA RAM_MarioYPos
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
R $00:F39D LDA RAM_MarioYPos
R $00:F459 LDA RAM_MarioYPos
R $00:F59D CMP RAM_MarioYPos
W $00:F5A1 STA RAM_MarioYPos ; Clamp: Mario Y = top of screen - $80
R $00:F7FE LDA RAM_MarioYPos
R $00:F909 LDA RAM_MarioYPos ; A = Mario Y
W $00:F913 STA RAM_MarioYPos
R $00:F9B3 LDA RAM_MarioYPos
W $00:F9F0 STA RAM_MarioYPos ; Mario Y = result
R $00:FC59 LDA RAM_MarioYPos
R $00:FCAA LDA RAM_MarioYPos
W $00:FCAF STA RAM_MarioYPos
R $00:FD4A ADC RAM_MarioYPos ; Bubble Y = Mario Y + offset
R $00:FDC3 LDA RAM_MarioYPos ; A = Mario Y low
R $00:FE24 LDA RAM_MarioYPos
R $00:FE7E LDA RAM_MarioYPos
R $00:FEF0 LDA RAM_MarioYPos
R $00:FF2B ADC RAM_MarioYPos ; Mario Y += -[$17BC] (follows layer 1 Y movement)
W $00:FF2D STA RAM_MarioYPos
R $01:A0EC LDA.W RAM_MarioYPos,Y
W $01:AAE8 STA RAM_MarioYPos
R $01:ABC0 ADC RAM_MarioYPos
W $01:B48F STA RAM_MarioYPos
W $01:B896 STA RAM_MarioYPos ; Mario Y low = sprite Y low - offset
R $01:BC21 LDA RAM_MarioYPos
R $01:C0DC CMP RAM_MarioYPos
R $01:C5DE LDA RAM_MarioYPos
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
W $01:DA4A STA RAM_MarioYPos
R $01:DA5C LDA RAM_MarioYPos
RW $01:DA66 INC RAM_MarioYPos ; Mario above the sprite: pull him down 1 pixel (unreferenced)
W $01:E671 STA RAM_MarioYPos
R $01:E6BB SBC RAM_MarioYPos
R $01:EB64 LDA RAM_MarioYPos
W $01:EDD4 STA RAM_MarioYPos
R $01:F6AA LDA RAM_MarioYPos
R $02:85A9 ADC RAM_MarioYPos
R $02:863B LDA RAM_MarioYPos
R $02:86D9 LDA RAM_MarioYPos
W $02:914B STA RAM_MarioYPos
R $02:9170 LDA RAM_MarioYPos
W $02:9175 STA RAM_MarioYPos
R $02:9C05 LDA RAM_MarioYPos
R $02:CC89 CMP RAM_MarioYPos
R $02:CC97 CMP RAM_MarioYPos
W $02:CCA0 STA RAM_MarioYPos
W $02:CFBC STA RAM_MarioYPos
R $02:D1E1 LDA RAM_MarioYPos
W $02:D1E8 STA RAM_MarioYPos ; Mario Y position = (Mario Y + 8) rounded down to a 16 pixel boundary
R $02:D2CF LDA RAM_MarioYPos
W $02:D2E2 STA RAM_MarioYPos
W $02:D2F2 STA RAM_MarioYPos
R $02:D50E LDA RAM_MarioYPos ; A = Mario Y low
W $02:EE87 STA RAM_MarioYPos ; Mario Y low = sprite Y - height
R $02:FE2B LDA RAM_MarioYPos
R $02:FEB2 LDA RAM_MarioYPos
W $03:8802 STA RAM_MarioYPos
R $03:8C99 ADC RAM_MarioYPos ; $00 = Mario Y + A (Y of Mario's feet)
W $03:8CBE STA RAM_MarioYPos
R $03:8D01 ADC RAM_MarioYPos ; $01 = Mario Y + A (hitbox at Mario's feet)
R $03:9A47 LDA RAM_MarioYPos
R $03:B68E LDA RAM_MarioYPos
R $03:B82B LDA RAM_MarioYPos
R $03:C2F8 LDA RAM_MarioYPos
W $04:85B7 STA RAM_MarioYPos
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
W $0C:A6BB STA RAM_MarioYPos
R $0C:D076 LDA RAM_MarioYPos
R $0C:D3D9 LDA RAM_MarioYPos
R $0C:D4CE ADC RAM_MarioYPos
R $0C:D533 ADC RAM_MarioYPos
R $0C:D5A5 ADC RAM_MarioYPos
R $0C:D6A1 LDA RAM_MarioYPos
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:EEDB LDA RAM_MarioYPosHi
W $00:EEDF STA RAM_MarioYPosHi
R $00:F3A2 LDA RAM_MarioYPosHi ; Score sprite position = Mario's position
R $00:FC5E LDA RAM_MarioYPosHi
R $00:FCB3 LDA RAM_MarioYPosHi
W $00:FCB7 STA RAM_MarioYPosHi ; Yoshi Y = Mario Y - $10 and Mario Y -= $10 as well
R $00:FD4F LDA RAM_MarioYPosHi
R $00:FDD2 LDA RAM_MarioYPosHi
R $00:FE2C LDA RAM_MarioYPosHi
R $00:FEF9 LDA RAM_MarioYPosHi
R $01:A0F1 LDA.W RAM_MarioYPosHi,Y ; [$02]/[$03] = Mario Y position (low/high)
W $01:AAEF STA RAM_MarioYPosHi
W $01:B496 STA RAM_MarioYPosHi
W $01:B89D STA RAM_MarioYPosHi ; Mario Y high = sprite Y high - borrow
R $01:BC2F LDA RAM_MarioYPosHi
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:DA4F STA RAM_MarioYPosHi
W $01:E678 STA RAM_MarioYPosHi
R $01:EB6B LDA RAM_MarioYPosHi
W $01:EDDD STA RAM_MarioYPosHi ; Mario Y high = Yoshi Y high - borrow
R $02:863F LDA RAM_MarioYPosHi
R $02:86E1 LDA RAM_MarioYPosHi
W $02:9152 STA RAM_MarioYPosHi
R $02:9177 LDA RAM_MarioYPosHi
W $02:917B STA RAM_MarioYPosHi
R $02:9C0D LDA RAM_MarioYPosHi
W $02:CFC5 STA RAM_MarioYPosHi ; Mario Y position = piece screen Y - feet offset + screen Y (stand on the coil)
R $02:D1EA LDA RAM_MarioYPosHi
W $02:D1EE STA RAM_MarioYPosHi
R $02:D2D2 LDA RAM_MarioYPosHi ; Save Mario's 16-bit X and Y position
W $02:D2E7 STA RAM_MarioYPosHi
W $02:D2EF STA RAM_MarioYPosHi
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 $03:8CC8 STA RAM_MarioYPosHi
R $03:8D05 LDA RAM_MarioYPosHi
R $03:B697 LDA RAM_MarioYPosHi
R $03:B832 LDA RAM_MarioYPosHi
R $03:C2FC LDA RAM_MarioYPosHi
R $05:D7BB LDX RAM_MarioYPosHi
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:D9AE STA RAM_MarioYPosHi
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
R $05:DBBD LDX RAM_MarioYPosHi
W $0C:A1FC STA RAM_MarioYPosHi
W $0C:A6BF STA RAM_MarioYPosHi

$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 $00:BF57 LDA RAM_BlockYLo
R $00:C02C LDA RAM_BlockYLo
R $00:C079 LDA RAM_BlockYLo
R $00:C0C6 LDA RAM_BlockYLo
R $00:C1B1 LDA RAM_BlockYLo
R $00:C3D3 LDA RAM_BlockYLo
R $00:ECBF LDA RAM_BlockYLo
W $00:ECC5 STA RAM_BlockYLo
R $00:ED6B LDA RAM_BlockYLo
W $00:ED71 STA RAM_BlockYLo
RW $00:F1DF TRB RAM_BlockYLo
R $00:F1FC LDA RAM_BlockYLo
R $00:F338 LDA RAM_BlockYLo
W $00:F33D STA RAM_BlockYLo
W $00:F45F STA RAM_BlockYLo
R $00:F476 LDA RAM_BlockYLo
R $00:F4B2 LDA RAM_BlockYLo
R $00:F4F1 LDA RAM_BlockYLo
R $00:F527 LDA RAM_BlockYLo
R $00:FA62 LDA RAM_BlockYLo
R $00:FD77 LDA RAM_BlockYLo
R $00:FD8D LDA RAM_BlockYLo
W $01:942F STA RAM_BlockYLo
W $01:95B8 STA RAM_BlockYLo
W $01:99F1 STA RAM_BlockYLo
W $01:AE21 STA RAM_BlockYLo
R $01:BCAB LDA RAM_BlockYLo
W $01:C1DE STA RAM_BlockYLo
W $01:E334 STA RAM_BlockYLo
R $02:8699 LDA RAM_BlockYLo
R $02:8702 LDA RAM_BlockYLo ; Block Y low
R $02:8720 LDA RAM_BlockYLo
R $02:87B6 LDA RAM_BlockYLo
W $02:87CE STA RAM_BlockYLo
W $02:87FC STA RAM_BlockYLo
R $02:883F LDA RAM_BlockYLo
R $02:897B LDA RAM_BlockYLo
R $02:8997 LDA RAM_BlockYLo
R $02:8A55 LDA RAM_BlockYLo ; Block Y low
R $02:8A8E LDA RAM_BlockYLo
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:A61E STA RAM_BlockYLo
W $02:A67F STA RAM_BlockYLo
R $02:A706 LDY RAM_BlockYLo
R $02:A72B LDA RAM_BlockYLo
R $02:A735 LDA RAM_BlockYLo
W $02:B9B1 STA RAM_BlockYLo ; Block Y position = sprite Y position (lo)
W $02:BADD STA RAM_BlockYLo
R $02:C2B6 LDA RAM_BlockYLo ; Save block X/Y position
W $02:C2C9 STA RAM_BlockYLo
W $02:CD72 STA RAM_BlockYLo ; Block Y position = sprite Y position - $10
W $02:D200 STA RAM_BlockYLo
W $02:DEE4 STA RAM_BlockYLo ; Block Y = sprite Y (low)
W $02:E2CE STA RAM_BlockYLo
W $02:E481 STA RAM_BlockYLo ; Block Y low
W $02:E543 STA RAM_BlockYLo
W $02:E8D6 STA RAM_BlockYLo
W $02:E8F6 STA RAM_BlockYLo
W $03:821F STA RAM_BlockYLo
W $03:9398 STA RAM_BlockYLo ; Block Y position low = sprite Y low
W $03:C015 STA RAM_BlockYLo
W $03:D72F STA RAM_BlockYLo
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:BEE2 LDA RAM_BlockYHi
W $00:BEE8 STA RAM_BlockYHi
R $00:BF37 LDA RAM_BlockYHi
R $00:BF44 LDA RAM_BlockYHi ; A = block Y high byte
R $00:F1F9 LDA RAM_BlockYHi
R $00:F498 LDA RAM_BlockYHi
R $00:F4AC LDX RAM_BlockYHi
R $00:F513 LDA RAM_BlockYHi
R $00:F521 LDX RAM_BlockYHi
R $00:FA6C LDA RAM_BlockYHi
W $01:9433 STA RAM_BlockYHi
W $01:95BD STA RAM_BlockYHi
W $01:99F6 STA RAM_BlockYHi
W $01:AE26 STA RAM_BlockYHi
R $01:BCA6 LDA RAM_BlockYHi
W $01:C1E3 STA RAM_BlockYHi
W $01:E339 STA RAM_BlockYHi ; Block Y = sprite Y (for block creation)
R $02:86A2 LDA RAM_BlockYHi
R $02:8707 LDA RAM_BlockYHi ; Block Y high
R $02:8728 LDA RAM_BlockYHi
R $02:87B9 LDA RAM_BlockYHi ; Save block position [$98]-[$9B] on the stack
W $02:87D5 STA RAM_BlockYHi
W $02:87F9 STA RAM_BlockYHi
R $02:8844 LDA RAM_BlockYHi ; Bounce sprite Y = block Y
R $02:897F LDA RAM_BlockYHi
R $02:899E LDA RAM_BlockYHi
R $02:8A96 LDA RAM_BlockYHi
W $02:91DC STA RAM_BlockYHi
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:A68C STA RAM_BlockYHi
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]
R $02:C2B3 LDA RAM_BlockYHi
W $02:C2CE STA RAM_BlockYHi
W $02:CD79 STA RAM_BlockYHi
W $02:D205 STA RAM_BlockYHi
W $02:E2D3 STA RAM_BlockYHi
W $02:E486 STA RAM_BlockYHi ; Block Y high
W $02:E548 STA RAM_BlockYHi
W $02:E8DB STA RAM_BlockYHi
W $02:E8FB STA RAM_BlockYHi
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
R $00:BF67 LDA RAM_BlockXLo
R $00:C00F LDA RAM_BlockXLo
R $00:C01C LDA RAM_BlockXLo
R $00:C04C LDA RAM_BlockXLo
R $00:C080 LDA RAM_BlockXLo
R $00:C0CD LDA RAM_BlockXLo
R $00:C1B8 LDA RAM_BlockXLo
R $00:C3DA LDA RAM_BlockXLo
R $00:EEA0 LDA RAM_BlockXLo
W $00:EEA6 STA RAM_BlockXLo ; [RAM_BlockXLo] -= $10 (use the left block of the switch)
R $00:F1AF LDA RAM_BlockXLo
RW $00:F1DD TRB RAM_BlockXLo ; Snap the block position to the 16x16 grid (clear low nibbles)
R $00:F204 LDA RAM_BlockXLo
W $00:F25A STA RAM_BlockXLo ; [BlockXLo] = X position of block X (DATA_00F0F8)
W $00:F457 STA RAM_BlockXLo
R $00:F489 LDA RAM_BlockXLo
R $00:F4B8 LDA RAM_BlockXLo
R $00:F504 LDA RAM_BlockXLo
R $00:F52D LDA RAM_BlockXLo
R $00:FA56 LDA RAM_BlockXLo
R $00:FD70 LDA RAM_BlockXLo
R $00:FD83 LDA RAM_BlockXLo
W $01:9427 STA RAM_BlockXLo
W $01:95AB STA RAM_BlockXLo
W $01:99E8 STA RAM_BlockXLo
W $01:AE18 STA RAM_BlockXLo
R $01:BCA0 LDA RAM_BlockXLo
W $01:C1D5 STA RAM_BlockXLo
W $01:E32B STA RAM_BlockXLo
R $02:8689 LDA RAM_BlockXLo
R $02:86F8 LDA RAM_BlockXLo ; Block X low
R $02:8711 LDA RAM_BlockXLo
R $02:87B0 LDA RAM_BlockXLo
W $02:87BF STA RAM_BlockXLo
W $02:8802 STA RAM_BlockXLo
R $02:8835 LDA RAM_BlockXLo
R $02:88E2 LDA RAM_BlockXLo ; Block X low
R $02:8972 LDA RAM_BlockXLo
R $02:8989 LDA RAM_BlockXLo
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:A639 STA RAM_BlockXLo
W $02:A69F STA RAM_BlockXLo
R $02:A702 LDY RAM_BlockXLo
W $02:B9A8 STA RAM_BlockXLo ; Block X position = sprite X position (lo)
W $02:BACF STA RAM_BlockXLo
R $02:C2B0 LDA RAM_BlockXLo
W $02:C2D1 STA RAM_BlockXLo
W $02:CD66 STA RAM_BlockXLo
W $02:D1F6 STA RAM_BlockXLo
W $02:DEE0 STA RAM_BlockXLo ; Block X = sprite X (low)
W $02:E2C5 STA RAM_BlockXLo
W $02:E478 STA RAM_BlockXLo ; Block X low = sprite X low
W $02:E53A STA RAM_BlockXLo
W $02:E8CD STA RAM_BlockXLo
W $02:E8EB STA RAM_BlockXLo
W $03:8216 STA RAM_BlockXLo
W $03:938F STA RAM_BlockXLo ; Block X position low = sprite X low
W $03:C007 STA RAM_BlockXLo
W $03:D729 STA RAM_BlockXLo
R $03:D75F SBC RAM_BlockXLo
W $03:D761 STA RAM_BlockXLo ; Block X = $0170 - Block X: mirror about the bridge center (X = $00B8)
R $03:D76E LDA RAM_BlockXLo
R $03:D77F LDA RAM_BlockXLo

$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:BEDE LDA RAM_BlockXHi
W $00:BEE4 STA RAM_BlockXHi
R $00:BF14 LDA RAM_BlockXHi
R $00:BF3A LDA RAM_BlockXHi
R $00:BF41 LDA RAM_BlockXHi
R $00:F483 LDX RAM_BlockXHi
R $00:F4A6 LDA RAM_BlockXHi
R $00:F4C7 LDA RAM_BlockXHi
R $00:F4FE LDX RAM_BlockXHi
R $00:F51B LDA RAM_BlockXHi
R $00:F53C LDA RAM_BlockXHi
R $00:FA5D LDA RAM_BlockXHi ; Sprite X high = block X high [$9B]
W $01:942B STA RAM_BlockXHi
W $01:95B2 STA RAM_BlockXHi
W $01:99ED STA RAM_BlockXHi
W $01:AE1D STA RAM_BlockXHi
R $01:BC9B LDA RAM_BlockXHi
W $01:C1DA STA RAM_BlockXHi
W $01:E330 STA RAM_BlockXHi ; Block X = sprite X (for block creation)
R $02:8692 LDA RAM_BlockXHi
R $02:86FD LDA RAM_BlockXHi ; Block X high
R $02:8719 LDA RAM_BlockXHi
R $02:87B3 LDA RAM_BlockXHi
W $02:87C4 STA RAM_BlockXHi
W $02:87FF STA RAM_BlockXHi
R $02:883A LDA RAM_BlockXHi ; Bounce sprite X = block X
R $02:8976 LDA RAM_BlockXHi
R $02:8990 LDA RAM_BlockXHi
R $02:8A89 LDA RAM_BlockXHi ; Block X high
W $02:91CB STA RAM_BlockXHi
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)
R $02:C2AD LDA RAM_BlockXHi
W $02:C2D4 STA RAM_BlockXHi
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:E2CA STA RAM_BlockXHi
W $02:E47D STA RAM_BlockXHi ; Block X high
W $02:E53F STA RAM_BlockXHi
W $02:E8D2 STA RAM_BlockXHi
W $02:E8F2 STA RAM_BlockXHi
W $03:821B STA RAM_BlockXHi
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)
R $03:D78E LDX RAM_BlockXHi

$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)
R $00:BEB4 LDA RAM_BlockBlock
R $00:BFBE LDA RAM_BlockBlock
R $00:C08C LDA RAM_BlockBlock
R $00:C0D9 LDA RAM_BlockBlock
R $00:C343 LDA RAM_BlockBlock
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:C1E7 STA RAM_BlockBlock
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)
R $00:8E1D ORA RAM_SpritesLocked
W $00:A6E6 STZ RAM_SpritesLocked ; Unlock sprites: [$9D] = 0
W $00:C494 STY RAM_SpritesLocked ; Lock sprites too
R $00:C500 LDA RAM_SpritesLocked
W $00:C94A STY RAM_SpritesLocked ; Lock sprites ([$9D] = 1)
R $00:CCC6 LDA RAM_SpritesLocked
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
R $00:E37C ORA RAM_SpritesLocked
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:8766 LDA 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:8C18 LDA RAM_SpritesLocked
R $01:8C4D LDA RAM_SpritesLocked
R $01:8CC6 LDA RAM_SpritesLocked
R $01:8D31 LDA RAM_SpritesLocked ; Sprites locked?
R $01:8E9D LDA RAM_SpritesLocked
R $01:8F0D LDA RAM_SpritesLocked
R $01:8FEC LDA RAM_SpritesLocked
R $01:956A LDA RAM_SpritesLocked
R $01:98A9 LDA RAM_SpritesLocked
R $01:993C LDA RAM_SpritesLocked
R $01:9AD6 LDA RAM_SpritesLocked
R $01:9AE4 LDA RAM_SpritesLocked
R $01:9FFB LDA RAM_SpritesLocked
R $01:A22C LDA RAM_SpritesLocked
R $01:AD97 LDA RAM_SpritesLocked
R $01:AEAD LDA RAM_SpritesLocked
R $01:AFA6 LDA RAM_SpritesLocked
R $01:B03A LDA RAM_SpritesLocked
R $01:B155 ORA RAM_SpritesLocked ; Only every 4th frame, while on-screen vertically and sprites not locked
R $01:B195 LDA RAM_SpritesLocked
R $01:B1B4 LDA RAM_SpritesLocked
R $01:B26F LDA RAM_SpritesLocked
R $01:B53D LDA RAM_SpritesLocked
R $01:B563 LDA RAM_SpritesLocked
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:B9FB LDA RAM_SpritesLocked
R $01:BA37 LDA RAM_SpritesLocked
R $01:BC38 LDA RAM_SpritesLocked ; Sprites locked?
R $01:BDFB LDA RAM_SpritesLocked ; Branch if sprites locked
R $01:BE8B LDA RAM_SpritesLocked
R $01:C09B LDA RAM_SpritesLocked ; Branch if sprites locked
R $01:C1A9 LDA RAM_SpritesLocked ; Branch if sprites locked
R $01:C1F9 LDA RAM_SpritesLocked
R $01:C37C LDA RAM_SpritesLocked
R $01:C3A0 LDA RAM_SpritesLocked
R $01:C3AE LDA RAM_SpritesLocked
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
R $01:C6ED LDA RAM_SpritesLocked
R $01:C776 LDA RAM_SpritesLocked
R $01:C9AC LDA RAM_SpritesLocked
R $01:CA04 ORA RAM_SpritesLocked
R $01:CDDF LDA RAM_SpritesLocked
RW $01:CE2E INC RAM_SpritesLocked ; Lock sprites ([$9D]++)
R $01:D44E LDA RAM_SpritesLocked ; Sprites locked?
R $01:D505 LDA RAM_SpritesLocked
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:D768 LDA RAM_SpritesLocked
R $01:DB44 LDA RAM_SpritesLocked ; State 2: sprite fell off the end of a line
R $01:DB66 LDA RAM_SpritesLocked
R $01:DE37 LDA RAM_SpritesLocked
R $01:E0A7 LDA RAM_SpritesLocked
R $01:E131 LDY RAM_SpritesLocked
RW $01:E21D INC RAM_SpritesLocked ; Lock sprites
R $01:E401 LDA RAM_SpritesLocked
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
R $01:EAB7 LDA RAM_SpritesLocked
W $01:EC1B STA RAM_SpritesLocked ; Lock sprites while growing
W $01:EC24 STZ RAM_SpritesLocked ; Unlock sprites
R $01:EC4C LDA RAM_SpritesLocked
W $01:EC74 STZ RAM_SpritesLocked ; Unlock sprites
W $01:EC7E STY RAM_SpritesLocked ; Lock sprites during swallow
R $01:EE6F ORA RAM_SpritesLocked
R $01:F625 ORA RAM_SpritesLocked
R $01:F897 LDA RAM_SpritesLocked
R $01:F8EB LDA RAM_SpritesLocked
R $01:FA7D LDA RAM_SpritesLocked
R $01:FAF5 LDA RAM_SpritesLocked
R $01:FB3A LDA RAM_SpritesLocked
R $01:FC3F LDA RAM_SpritesLocked
R $02:8095 LDA RAM_SpritesLocked
W $02:83EC STA RAM_SpritesLocked
W $02:842E STZ RAM_SpritesLocked ; Unlock sprites ([RAM_SpritesLocked] = 0)
R $02:8B29 ORA RAM_SpritesLocked
R $02:8CC4 LDA RAM_SpritesLocked
R $02:8D6E ORA RAM_SpritesLocked ; Sink only on even timer values and when sprites are not locked
R $02:8DCF LDA RAM_SpritesLocked
R $02:8DDB LDA RAM_SpritesLocked
R $02:8EDA LDY RAM_SpritesLocked
R $02:8F40 LDY RAM_SpritesLocked
R $02:8F8B LDA RAM_SpritesLocked
R $02:9034 LDA RAM_SpritesLocked
R $02:9052 LDY RAM_SpritesLocked
R $02:9076 LDA RAM_SpritesLocked
R $02:90E1 LDA RAM_SpritesLocked
R $02:96ED LDA RAM_SpritesLocked
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:9B1B LDY RAM_SpritesLocked
R $02:9BA5 LDA RAM_SpritesLocked
R $02:9C67 LDA RAM_SpritesLocked ; Sprites locked?
R $02:9C98 LDA RAM_SpritesLocked
R $02:9CB5 LDA RAM_SpritesLocked ; Skip physics while sprites are locked
R $02:9E4F LDA RAM_SpritesLocked
R $02:9E86 LDA RAM_SpritesLocked ; Skip physics while sprites are locked
R $02:9EEE LDA RAM_SpritesLocked
R $02:9F61 LDA RAM_SpritesLocked
R $02:9FAF LDA RAM_SpritesLocked
R $02:A16B LDA RAM_SpritesLocked
R $02:A219 LDA RAM_SpritesLocked
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:B89C LDA RAM_SpritesLocked
R $02:BB97 LDA RAM_SpritesLocked
R $02:BCE5 ORA RAM_SpritesLocked
R $02:BD3F LDA RAM_SpritesLocked
R $02:BFD1 LDA RAM_SpritesLocked ; Sprites locked?
R $02:C256 LDA RAM_SpritesLocked ; Sprites locked?
R $02:CBFE LDA RAM_SpritesLocked
R $02:CDD1 LDA RAM_SpritesLocked
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:DF96 LDA RAM_SpritesLocked
R $02:E122 LDA RAM_SpritesLocked
R $02:E262 LDA RAM_SpritesLocked
R $02:E314 LDA RAM_SpritesLocked
R $02:E423 LDA RAM_SpritesLocked
R $02:E559 LDY RAM_SpritesLocked ; Y = [RAM_SpritesLocked]
R $02:E5BF LDA RAM_SpritesLocked
R $02:E72B LDA RAM_SpritesLocked
R $02:E7D0 LDA RAM_SpritesLocked
R $02:E878 LDA RAM_SpritesLocked
R $02:E94F LDA RAM_SpritesLocked
R $02:EB49 LDA RAM_SpritesLocked
R $02:EE19 LDA RAM_SpritesLocked
R $02:EEBE LDA RAM_SpritesLocked
R $02:F038 LDA RAM_SpritesLocked
R $02:F8A7 ORA RAM_SpritesLocked
R $02:F921 LDY RAM_SpritesLocked
R $02:FA16 LDA RAM_SpritesLocked
R $02:FAA4 LDA RAM_SpritesLocked
R $02:FBD2 ORA RAM_SpritesLocked
R $02:FC41 LDA RAM_SpritesLocked
R $02:FC55 LDA RAM_SpritesLocked
R $02:FCE2 LDA RAM_SpritesLocked
R $03:8016 LDA RAM_SpritesLocked
R $03:80A6 LDA RAM_SpritesLocked
R $03:8457 LDA RAM_SpritesLocked
R $03:84F5 LDA RAM_SpritesLocked
R $03:8532 LDA RAM_SpritesLocked
R $03:85F9 LDA RAM_SpritesLocked
R $03:8702 LDA RAM_SpritesLocked
R $03:8785 LDA RAM_SpritesLocked
R $03:88C0 LDA RAM_SpritesLocked
R $03:899A LDA RAM_SpritesLocked
R $03:8A3F LDA RAM_SpritesLocked
R $03:8C32 LDA RAM_SpritesLocked
R $03:8DBE LDA RAM_SpritesLocked
R $03:8E7C LDA RAM_SpritesLocked
R $03:8EEF LDA RAM_SpritesLocked
R $03:8FAB LDA RAM_SpritesLocked
R $03:9068 LDA RAM_SpritesLocked
R $03:9237 LDA 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:9AAD LDA RAM_SpritesLocked
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
R $03:B166 LDA RAM_SpritesLocked
R $03:B2B4 LDA RAM_SpritesLocked
R $03:C0C6 LDA RAM_SpritesLocked
R $03:C11E LDA RAM_SpritesLocked
R $03:C1F5 LDA RAM_SpritesLocked
R $03:C350 LDA RAM_SpritesLocked
R $03:C525 LDA RAM_SpritesLocked
R $03:CC1E LDA RAM_SpritesLocked
R $05:BC79 LDA.W RAM_SpritesLocked
R $05:BCAF LDY.W RAM_SpritesLocked
R $05:C428 LDY.W RAM_SpritesLocked
R $05:C497 LDA.W RAM_SpritesLocked

$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)
W $00:FA4E STA.W RAM_SpriteNum,Y
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:89EE LDY RAM_SpriteNum,X
R $01:8A04 LDY RAM_SpriteNum,X
R $01:8AB1 LDA.W RAM_SpriteNum,Y ; Its sprite number
R $01:8AD4 LDA RAM_SpriteNum,X
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
R $01:8CDF LDA RAM_SpriteNum,X
R $01:8EB9 LDY RAM_SpriteNum,X
R $01:9245 LDA RAM_SpriteNum,X
R $01:9323 LDA RAM_SpriteNum,X
R $01:953C LDA RAM_SpriteNum,X
R $01:957F LDA RAM_SpriteNum,X
R $01:95E0 LDA RAM_SpriteNum,X
R $01:9624 LDA RAM_SpriteNum,X
R $01:96A9 LDA RAM_SpriteNum,X
R $01:96EC LDA RAM_SpriteNum,X
W $01:96F2 STA.W RAM_SpriteNum,Y
R $01:9765 LDA RAM_SpriteNum,X
W $01:977D STA.W RAM_SpriteNum,Y ; Coin sprite number = $21 (Moving Coin)
R $01:97F0 LDA RAM_SpriteNum,X
R $01:984D LDA RAM_SpriteNum,X
R $01:9992 LDA RAM_SpriteNum,X
R $01:99D2 LDA RAM_SpriteNum,X
R $01:9AA2 LDA RAM_SpriteNum,X
R $01:9AFE LDA RAM_SpriteNum,X
R $01:9B2E LDA RAM_SpriteNum,X
R $01:9D04 LDY RAM_SpriteNum,X
R $01:9D79 LDY RAM_SpriteNum,X
R $01:9D83 LDY RAM_SpriteNum,X
R $01:9DE7 LDY RAM_SpriteNum,X
R $01:9F17 LDY RAM_SpriteNum,X
R $01:9F9B LDA RAM_SpriteNum,X
R $01:A01A LDA RAM_SpriteNum,X
R $01:A033 LDA RAM_SpriteNum,X
R $01:A18E LDA RAM_SpriteNum,X ; A = sprite number
R $01:A29A LDA.W RAM_SpriteNum,Y
W $01:A2BD STA.W RAM_SpriteNum,X ; Sprite = $35 (Yoshi)
R $01:A4E9 LDA.W RAM_SpriteNum,Y
R $01:A561 LDA RAM_SpriteNum,X
R $01:A5C4 LDA.W RAM_SpriteNum,Y
R $01:A625 LDA RAM_SpriteNum,X
R $01:A685 LDA RAM_SpriteNum,X
R $01:A69D LDA.W RAM_SpriteNum,Y
R $01:A710 LDA RAM_SpriteNum,X
R $01:A733 LDA.W RAM_SpriteNum,Y
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:A9F2 LDA RAM_SpriteNum,X
R $01:AA16 LDY RAM_SpriteNum,X
R $01:AA74 LDA RAM_SpriteNum,X
R $01:AAF1 LDA RAM_SpriteNum,X ; A = sprite number
R $01:AC80 LDA RAM_SpriteNum,X
R $01:ACC8 LDA RAM_SpriteNum,X
R $01:ADBA LDA RAM_SpriteNum,X
R $01:AE50 LDA.W RAM_SpriteNum,Y
R $01:B29A LDY RAM_SpriteNum,X
R $01:B2A5 LDA RAM_SpriteNum,X
R $01:B2D1 LDA RAM_SpriteNum,X
R $01:B39B LDA RAM_SpriteNum,X
R $01:B3E5 LDA RAM_SpriteNum,X
R $01:B428 LDA RAM_SpriteNum,X
R $01:B4DC LDA RAM_SpriteNum,X
R $01:B508 LDA RAM_SpriteNum,X
R $01:B577 LDA RAM_SpriteNum,X
R $01:B58F LDA RAM_SpriteNum,X
R $01:B5A9 LDA RAM_SpriteNum,X
R $01:B5C0 LDA RAM_SpriteNum,X
R $01:B651 LDA RAM_SpriteNum,X
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)
R $01:C1FD LDA RAM_SpriteNum,X
R $01:C255 LDA RAM_SpriteNum,X
R $01:C28F LDA RAM_SpriteNum,X
R $01:C2DC LDA.W RAM_SpriteNum,Y
W $01:C333 STA RAM_SpriteNum,X ; Sprite number = ChangingItemSprite[Y]
W $01:C33E STA RAM_SpriteNum,X ; Sprite number = $81 (changing item) again
R $01:C3B9 LDA RAM_SpriteNum,X
R $01:C3C5 LDA RAM_SpriteNum,X
R $01:C44A LDA RAM_SpriteNum,X
R $01:C474 LDA RAM_SpriteNum,X
R $01:C4C9 LDA RAM_SpriteNum,X
R $01:C636 LDA RAM_SpriteNum,X
R $01:C6D1 LDA RAM_SpriteNum,X
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:E1D1 LDA.W RAM_SpriteNum,Y
R $01:E323 LDA RAM_SpriteNum,X
R $01:E343 LDA RAM_SpriteNum,X
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
R $01:EA62 LDA RAM_SpriteNum,X
W $01:EC92 STA.W RAM_SpriteNum,Y ; New sprite number = $2C (Yoshi egg/spit item; probably)
R $01:F15D LDA.W RAM_SpriteNum,Y
R $01:F25E LDA.W RAM_SpriteNum,Y
R $01:F2EC LDX.W RAM_SpriteNum,Y ; X = sprite number
W $01:F2F4 STA.W RAM_SpriteNum,Y ; Sprite number = the new sprite
R $01:F360 LDA.W RAM_SpriteNum,Y
W $01:F36C STA.W RAM_SpriteNum,Y ; Koopa becomes its shell form
R $01:F384 LDA.W RAM_SpriteNum,Y
W $01:F394 STA.W RAM_SpriteNum,Y ; (unused) Sprite becomes a Mushroom
R $01:F39F LDA.W RAM_SpriteNum,Y
W $01:F3B7 STA.W RAM_SpriteNum,Y ; (unused) Sprite number = the item
R $01:F5A7 LDA.W RAM_SpriteNum,Y
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
R $01:F9CE LDA RAM_SpriteNum,X
W $01:FDBE STA.W RAM_SpriteNum,Y ; New sprite number = $A7 (Iggy's ball)
R $02:8032 LDA RAM_SpriteNum,X
W $02:804B STA RAM_SpriteNum,X
R $02:84C6 LDA RAM_SpriteNum,X
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
R $02:9409 LDA RAM_SpriteNum,X
R $02:9439 LDA RAM_SpriteNum,X
R $02:9460 LDA RAM_SpriteNum,X
R $02:9494 LDA RAM_SpriteNum,X
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
R $02:A9A4 LDA RAM_SpriteNum,X
W $02:A9B2 STA RAM_SpriteNum,X ; Otherwise it becomes sprite $21 (moving coin)
R $02:AC22 LDA RAM_SpriteNum,X
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)
R $02:BBE0 LDA RAM_SpriteNum,X
R $02:BC14 LDA RAM_SpriteNum,X
R $02:BCEE LDA RAM_SpriteNum,X
R $02:BD4A LDA RAM_SpriteNum,X
R $02:BD75 LDA RAM_SpriteNum,X
R $02:BDD6 LDY RAM_SpriteNum,X
R $02:BDE9 LDY RAM_SpriteNum,X
R $02:BE3B LDA RAM_SpriteNum,X
R $02:BE4E LDA RAM_SpriteNum,X
W $02:C1A7 STA.W RAM_SpriteNum,Y ; Sprite number = $48 (rock)
R $02:C58E LDA RAM_SpriteNum,X
W $02:C5C9 STA.W RAM_SpriteNum,Y ; Clone sprite number = $91 (Chargin' Chuck)
R $02:C777 LDA RAM_SpriteNum,X
W $02:C783 STA RAM_SpriteNum,X ; Yes: it becomes a Chargin' Chuck ($91)
R $02:CBA1 LDA RAM_SpriteNum,X
R $02:CEE7 LDA RAM_SpriteNum,X
R $02:D249 LDA RAM_SpriteNum,X
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
R $02:DB6D LDA.W RAM_SpriteNum,Y
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
R $02:EA6A LDA.W RAM_SpriteNum,Y
W $02:EAFF STA.W RAM_SpriteNum,Y ; Sprite number = $77 (Feather)
R $02:EB5A LDA RAM_SpriteNum,X
R $02:ED3B LDA RAM_SpriteNum,X
W $02:EDA0 STA.W RAM_SpriteNum,Y ; Sprite number = $61 (floating skull)
R $02:EDE6 LDA.W RAM_SpriteNum,Y
R $02:EE26 LDA.W RAM_SpriteNum,Y
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)
R $03:83A0 LDA RAM_SpriteNum,X
R $03:8665 LDA.W RAM_SpriteNum,Y
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)
R $03:8C51 LDY RAM_SpriteNum,X
R $03:8C83 LDY RAM_SpriteNum,X
R $03:8D28 LDA RAM_SpriteNum,X
R $03:8FB9 LDA RAM_SpriteNum,X
R $03:94D4 LDA RAM_SpriteNum,X
W $03:9AD3 STA.W RAM_SpriteNum,Y ; Sprite number $A9 (dead Reznor)
R $03:9C34 LDA RAM_SpriteNum,X
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:A802 STA.W RAM_SpriteNum,Y
W $03:A8EF STA.W RAM_SpriteNum,Y
W $03:B032 STA.W RAM_SpriteNum,Y ; Sprite number $A2: Mecha-Koopa
R $03:B801 LDA RAM_SpriteNum,X
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
R $03:C26F LDA RAM_SpriteNum,X
W $03:C2ED STA RAM_SpriteNum,X ; Sprite number = $78 (1-Up mushroom)
W $03:C31A STA RAM_SpriteNum,X ; Sprite number = $74 (mushroom)
R $03:C3DA LDA RAM_SpriteNum,X
R $03:C4EF LDA.W RAM_SpriteNum,Y
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:A624 STA $A6
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:FBF7 INC RAM_SpriteSpeedY,X
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:8160 DEC RAM_SpriteSpeedY,X
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
W $01:8D16 STA RAM_SpriteSpeedY,X
RW $01:8D3F DEC RAM_SpriteSpeedY,X ; Reduce gravity by 1
R $01:8D55 LDA RAM_SpriteSpeedY,X
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
R $01:9049 LDA RAM_SpriteSpeedY,X
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
R $01:92CB LDA RAM_SpriteSpeedY,X
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)
R $01:97E6 LDA RAM_SpriteSpeedY,X
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
R $01:ADA7 LDA RAM_SpriteSpeedY,X
W $01:ADAD STA RAM_SpriteSpeedY,X
W $01:AEF7 STA RAM_SpriteSpeedY,X ; Y speed = 0
R $01:AEFD LDA RAM_SpriteSpeedY,X
W $01:AF05 STA RAM_SpriteSpeedY,X ; No: Y speed += 4 (gravity)
W $01:AF3A STA RAM_SpriteSpeedY,X ; Y speed = $F0 (rise slowly)
R $01:AFB9 LDA RAM_SpriteSpeedY,X
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:B07D STA RAM_SpriteSpeedY,X
W $01:B0DE STA RAM_SpriteSpeedY,X ; Y speed = DATA_01B01F[Y]
W $01:B13E STA RAM_SpriteSpeedY,X ; Y speed = $E0 (knocked up)
R $01:B1A5 LDA RAM_SpriteSpeedY,X
W $01:B1AE STA RAM_SpriteSpeedY,X ; Store Y speed
W $01:B1D2 STA RAM_SpriteSpeedY,X
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)
R $01:B286 LDA RAM_SpriteSpeedY,X
W $01:B28C STA RAM_SpriteSpeedY,X ; X speed and Y speed += DATA_01B268[Y]
R $01:B580 LDA RAM_SpriteSpeedY,X
RW $01:B586 INC RAM_SpriteSpeedY,X
R $01:B599 LDA RAM_SpriteSpeedY,X
W $01:B5A4 STA RAM_SpriteSpeedY,X
R $01:B5CF LDA RAM_SpriteSpeedY,X
W $01:B5D8 STA RAM_SpriteSpeedY,X
W $01:B5E5 STA RAM_SpriteSpeedY,X
R $01:B605 LDA RAM_SpriteSpeedY,X
W $01:B60E STA RAM_SpriteSpeedY,X
R $01:B616 LDA RAM_SpriteSpeedY,X
W $01:B622 STA RAM_SpriteSpeedY,X
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
R $01:BA7F LDA RAM_SpriteSpeedY,X
W $01:BA84 STA RAM_SpriteSpeedY,X ; Y speed = -Y speed
R $01:BC48 LDA RAM_SpriteSpeedY,X
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)
R $01:C229 LDA RAM_SpriteSpeedY,X
W $01:C22F STA RAM_SpriteSpeedY,X ; Y speed += DATA_01C1EE[Y] (acceleration up or down)
R $01:C240 LDA RAM_SpriteSpeedY,X
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:C424 INC RAM_SpriteSpeedY,X
RW $01:C426 INC RAM_SpriteSpeedY,X
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
R $01:C453 LDA RAM_SpriteSpeedY,X
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)
R $01:CE43 LDA RAM_SpriteSpeedY,X
W $01:CE4C STA RAM_SpriteSpeedY,X
W $01:CED9 STA RAM_SpriteSpeedY,X ; Y speed = $D8 (jump up)
R $01:CF21 LDA RAM_SpriteSpeedY,X
W $01:CF27 STZ RAM_SpriteSpeedY,X ; Speed X = 0, speed Y = 0
R $01:CF3A LDA RAM_SpriteSpeedY,X
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
R $01:D0C0 LDA RAM_SpriteSpeedY,X
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:D26F STA RAM_SpriteSpeedY,X
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
R $01:E0D3 LDA RAM_SpriteSpeedY,X
W $01:E103 STA RAM_SpriteSpeedY,X ; Y speed = launch speed
R $01:E11A LDA RAM_SpriteSpeedY,X
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:E4BB STZ RAM_SpriteSpeedY,X
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
R $01:E84D LDA RAM_SpriteSpeedY,X
R $01:E9D6 LDA RAM_SpriteSpeedY,X
W $01:E9DC STA RAM_SpriteSpeedY,X
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
R $01:F964 LDA RAM_SpriteSpeedY,X
W $01:F96D STA RAM_SpriteSpeedY,X ; Y speed moves one step toward 0
R $01:F9BB LDA RAM_SpriteSpeedY,X
W $01:F9C6 STA RAM_SpriteSpeedY,X ; Y speed += DATA_01EBB4[Y]: accelerate toward Mario
R $01:FA8F LDA RAM_SpriteSpeedY,X
W $01:FA98 STA RAM_SpriteSpeedY,X ; Y speed += 4 (gravity)
W $01:FAA1 STA RAM_SpriteSpeedY,X ; Hit platform: bounce, Y speed = $F0
R $01:FB4C LDA RAM_SpriteSpeedY,X
RW $01:FB52 INC RAM_SpriteSpeedY,X
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)
R $02:84D0 LDA RAM_SpriteSpeedY,X
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:B69F INC RAM_SpriteSpeedY,X
RW $02:B6A1 INC RAM_SpriteSpeedY,X ; Y speed += 2 (fall)
R $02:B6DD LDA RAM_SpriteSpeedY,X
W $02:B6E6 STA RAM_SpriteSpeedY,X
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)
R $02:BBAD LDA RAM_SpriteSpeedY,X
RW $02:BBB5 INC RAM_SpriteSpeedY,X ; Gravity: Y speed++
R $02:BBC1 LDA RAM_SpriteSpeedY,X
R $02:BBCA LDA RAM_SpriteSpeedY,X
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
R $02:BD98 LDA RAM_SpriteSpeedY,X
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:BFEA STA RAM_SpriteSpeedY,X
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:C030 STA RAM_SpriteSpeedY,X
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
R $02:D271 LDA RAM_SpriteSpeedY,X
RW $02:D279 INC RAM_SpriteSpeedY,X
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)
R $02:D283 LDA RAM_SpriteSpeedY,X
R $02:D294 LDA RAM_SpriteSpeedY,X
R $02:D2A5 LDA RAM_SpriteSpeedY,X
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:D463 STA RAM_SpriteSpeedY,X
W $02:D48B STA RAM_SpriteSpeedY,X ; Y speed = $E0 (rise)
R $02:D4DE LDA RAM_SpriteSpeedY,X ; A = sprite Y speed
R $02:D948 LDA RAM_SpriteSpeedY,X
W $02:D94E STA RAM_SpriteSpeedY,X ; Store the new Y speed
R $02:DBC7 LDA RAM_SpriteSpeedY,X
W $02:DBCD STA RAM_SpriteSpeedY,X
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
R $02:DFA7 LDA RAM_SpriteSpeedY,X
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)
R $02:E159 LDA RAM_SpriteSpeedY,X
W $02:E164 STA RAM_SpriteSpeedY,X
R $02:E169 LDA RAM_SpriteSpeedY,X
R $02:E188 LDA RAM_SpriteSpeedY,X
W $02:E18F STA RAM_SpriteSpeedY,X ; Y speed++
W $02:E292 STA RAM_SpriteSpeedY,X ; Y speed from DATA_02E1FD
R $02:E335 LDA RAM_SpriteSpeedY,X
W $02:E33B STA RAM_SpriteSpeedY,X ; Store Y speed
W $02:E46D STA RAM_SpriteSpeedY,X ; Y speed = $D0 (up)
R $02:E52A LDA RAM_SpriteSpeedY,X
R $02:E52E LDA RAM_SpriteSpeedY,X
W $02:E562 STA RAM_SpriteSpeedY,X ; Y speed = saved value
W $02:E785 STA RAM_SpriteSpeedY,X ; Y speed = $A0 (-$60, upward)
R $02:E796 LDA RAM_SpriteSpeedY,X
W $02:E7A1 STA RAM_SpriteSpeedY,X
W $02:E806 STA RAM_SpriteSpeedY,X ; Hit ceiling: Y speed = $10 (downward)
R $02:E80F LDA RAM_SpriteSpeedY,X
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)
R $02:EB71 LDA RAM_SpriteSpeedY,X
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)
R $02:EBD1 LDA RAM_SpriteSpeedY,X
W $02:EBD6 STA RAM_SpriteSpeedY,X ; Y speed += 2
R $02:EBEF LDA RAM_SpriteSpeedY,X
W $02:EBF6 STA RAM_SpriteSpeedY,X ; Y speed -= 1
R $02:EE3E LDA RAM_SpriteSpeedY,X
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)
R $02:EF05 LDA RAM_SpriteSpeedY,X
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)
R $02:F32A LDA RAM_SpriteSpeedY,X
W $02:F32F STA RAM_SpriteSpeedY,X ; Y speed += 3 (gravity)
R $02:F34D LDA RAM_SpriteSpeedY,X
W $02:F35D STA RAM_SpriteSpeedY,X ; Y speed = $F0 (hop)
W $02:F38F STZ RAM_SpriteSpeedY,X
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)
R $03:8172 LDA RAM_SpriteSpeedY,X
W $03:8178 STA RAM_SpriteSpeedY,X ; Y speed += DATA_038100[[$1528] & 1]
W $03:81DC STA RAM_SpriteSpeedY,X ; Y speed = $D0 (up)
R $03:845E LDA RAM_SpriteSpeedY,X
R $03:8467 LDA RAM_SpriteSpeedY,X
W $03:8470 STA RAM_SpriteSpeedY,X ; Y speed += 2
R $03:847C LDA RAM_SpriteSpeedY,X
W $03:8482 STA RAM_SpriteSpeedY,X ; Y speed = 3: start falling
R $03:8507 LDA RAM_SpriteSpeedY,X
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)
R $03:890B LDA RAM_SpriteSpeedY,X
RW $03:890F DEC RAM_SpriteSpeedY,X ; Y speed decays toward 0
R $03:8942 LDA RAM_SpriteSpeedY,X
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
R $03:8A76 LDA RAM_SpriteSpeedY,X
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
R $03:8FE3 LDA RAM_SpriteSpeedY,X
W $03:8FE8 STA RAM_SpriteSpeedY,X
R $03:9005 LDY RAM_SpriteSpeedY,X
R $03:90BA LDA RAM_SpriteSpeedY,X
W $03:90C0 STA RAM_SpriteSpeedY,X
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:9335 STA RAM_SpriteSpeedY,X
W $03:9343 STA RAM_SpriteSpeedY,X
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:9F9F INC RAM_SpriteSpeedY,X
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:A452 STA RAM_SpriteSpeedY,X
W $03:A465 STZ RAM_SpriteSpeedY,X ; Y speed = 0
R $03:A4C1 LDA RAM_SpriteSpeedY,X
W $03:A4C7 STA RAM_SpriteSpeedY,X
W $03:A713 STZ RAM_SpriteSpeedY,X ; Y speed = 0
R $03:A75D LDA RAM_SpriteSpeedY,X
W $03:A763 STA RAM_SpriteSpeedY,X
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
W $03:A91A STA RAM_SpriteSpeedY,X
R $03:AB54 LDA RAM_SpriteSpeedY,X ; Y speed
W $03:AB5F STA RAM_SpriteSpeedY,X ; Y speed
R $03:AB72 LDA RAM_SpriteSpeedY,X
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)
R $03:AD40 LDA RAM_SpriteSpeedY,X
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)
R $03:B14A LDA.W RAM_SpriteSpeedY,Y
W $03:B152 STA.W RAM_SpriteSpeedY,Y ; Y speed = $10 or $D0
R $03:B179 LDA RAM_SpriteSpeedY,X
W $03:B182 STA RAM_SpriteSpeedY,X
W $03:B188 STA RAM_SpriteSpeedY,X ; Clamp Y speed to $40 (terminal velocity)
R $03:B18A LDA RAM_SpriteSpeedY,X
R $03:B19D LDA RAM_SpriteSpeedY,X
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)
R $03:C387 LDY RAM_SpriteSpeedY,X
W $03:C82E STA RAM_SpriteSpeedY,X
RW $03:C867 INC RAM_SpriteSpeedY,X ; ...slow the rise: Y speed++
R $03:C869 LDA RAM_SpriteSpeedY,X
W $03:C8E2 STZ RAM_SpriteSpeedY,X ; Y speed = 0
RW $03:C947 INC RAM_SpriteSpeedY,X ; ...Y speed++ (falling faster)
R $03:C94F LDY RAM_SpriteSpeedY,X
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
R $03:CE5E LDA RAM_SpriteSpeedY,X
W $03:CE67 STA RAM_SpriteSpeedY,X
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
W $01:8A36 STA RAM_SpriteSpeedX,X
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:8A6D STA.W RAM_SpriteSpeedX,Y
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
R $01:8D10 LDA RAM_SpriteSpeedX,X
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
R $01:905D LDA RAM_SpriteSpeedX,X
RW $01:9066 ROR RAM_SpriteSpeedX,X ; Water: X speed halved (arithmetic shift)
R $01:9068 LDA RAM_SpriteSpeedX,X
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
R $01:90A2 LDA RAM_SpriteSpeedX,X
W $01:90A7 STA RAM_SpriteSpeedX,X ; X speed = -X speed
R $01:91E1 LDA RAM_SpriteSpeedX,X
R $01:9277 LDA RAM_SpriteSpeedX,X
R $01:9288 LDA RAM_SpriteSpeedX,X
R $01:9375 EOR RAM_SpriteSpeedX,X
R $01:9379 LDA RAM_SpriteSpeedX,X
R $01:95E9 LDA RAM_SpriteSpeedX,X
RW $01:95ED ROR RAM_SpriteSpeedX,X
RW $01:95F0 ROR RAM_SpriteSpeedX,X
W $01:9742 STA.W RAM_SpriteSpeedX,Y ; New sprite X speed = Spr0to13SpeedX[direction] (walk speed)
W $01:9751 STA.W RAM_SpriteSpeedX,Y
R $01:97D5 LDA RAM_SpriteSpeedX,X
W $01:97E4 STA RAM_SpriteSpeedX,X ; Store the halved X speed
R $01:98BD LDA RAM_SpriteSpeedX,X
RW $01:98CA INC RAM_SpriteSpeedX,X
RW $01:98CC INC RAM_SpriteSpeedX,X ; X speed += 2
RW $01:98D4 DEC RAM_SpriteSpeedX,X
RW $01:98D6 DEC RAM_SpriteSpeedX,X ; X speed -= 2
W $01:98E8 STA RAM_SpriteSpeedX,X
R $01:992D LDA RAM_SpriteSpeedX,X
R $01:995F EOR RAM_SpriteSpeedX,X
R $01:9A17 LDY RAM_SpriteSpeedX,X ; A = 0; X speed 0: leave direction unchanged
R $01:9A8A LDA RAM_SpriteSpeedX,X
RW $01:9A90 INC RAM_SpriteSpeedX,X ; X speed negative: += 1
RW $01:9A94 DEC RAM_SpriteSpeedX,X
W $01:9A9B STZ RAM_SpriteSpeedX,X ; X speed = 0
W $01:9AFC STZ RAM_SpriteSpeedX,X ; X speed = 0
W $01:A062 STA RAM_SpriteSpeedX,X
W $01:A072 STA RAM_SpriteSpeedX,X
RW $01:A075 ROR RAM_SpriteSpeedX,X
W $01:A093 STA RAM_SpriteSpeedX,X ; Sprite X speed = ShellSpeedX[Y]
W $01:A0A4 STA RAM_SpriteSpeedX,X
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:A9DD STZ RAM_SpriteSpeedX,X
W $01:A9EE STZ RAM_SpriteSpeedX,X
W $01:AAAF STA RAM_SpriteSpeedX,X ; Sprite X speed = kick speed, away from Mario
R $01:ADD1 LDA RAM_SpriteSpeedX,X
W $01:ADD7 STA RAM_SpriteSpeedX,X
W $01:ADEA STA RAM_SpriteSpeedX,X ; Sprite $83: X speed = $F4 (flies left)
W $01:AFDD STZ RAM_SpriteSpeedX,X
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:B28E STA RAM_SpriteSpeedX,X
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
R $01:C71B LDA RAM_SpriteSpeedX,X
W $01:C721 STA RAM_SpriteSpeedX,X ; X speed += DATA_01C6E6[Y] (+2 or -2)
R $01:C72B LDA RAM_SpriteSpeedX,X
R $01:CEDF LDA RAM_SpriteSpeedX,X
W $01:CEEA STA RAM_SpriteSpeedX,X
W $01:CF08 STA RAM_SpriteSpeedX,X ; Timer ran out: X speed = jump speed [$160E]
R $01:CF0F LDA RAM_SpriteSpeedX,X
RW $01:CF15 INC RAM_SpriteSpeedX,X
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:CF25 STZ RAM_SpriteSpeedX,X
R $01:CF4F LDA RAM_SpriteSpeedX,X
W $01:D0B4 STA.W RAM_SpriteSpeedX,Y
W $01:D1EA STA RAM_SpriteSpeedX,X ; X speed = DATA_01D122[Y]
W $01:D39D STZ RAM_SpriteSpeedX,X
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
R $01:E3AC LDA RAM_SpriteSpeedX,X
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
R $01:E640 LDA RAM_SpriteSpeedX,X
RW $01:E644 ROR RAM_SpriteSpeedX,X
RW $01:E647 ROR RAM_SpriteSpeedX,X
W $01:E83B STA RAM_SpriteSpeedX,X ; Cloud X speed = Mario X speed
R $01:E9C3 LDA RAM_SpriteSpeedX,X ; A = X speed
W $01:E9CE STA RAM_SpriteSpeedX,X
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:E9F7 STA RAM_SpriteSpeedX,X
W $01:E9FD STA RAM_SpriteSpeedX,X
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
R $01:F959 LDA RAM_SpriteSpeedX,X
W $01:F962 STA RAM_SpriteSpeedX,X ; X speed moves one step toward 0
R $01:F995 LDA RAM_SpriteSpeedX,X
W $01:F9A0 STA RAM_SpriteSpeedX,X ; X speed += DATA_01EBB4[Y] (+1 / -1): accelerate toward Mario
R $01:F9D4 LDA RAM_SpriteSpeedX,X
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
R $01:FBF3 LDA RAM_SpriteSpeedX,X
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]
R $02:B85D LDA RAM_SpriteSpeedX,X
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:B8D0 STA RAM_SpriteSpeedX,X
R $02:BBE8 LDA RAM_SpriteSpeedX,X
W $02:BBEE STA RAM_SpriteSpeedX,X ; X speed += acceleration from DATA_02BB88
R $02:BC20 LDA RAM_SpriteSpeedX,X
R $02:BD91 LDA RAM_SpriteSpeedX,X
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
R $02:BFDC LDA RAM_SpriteSpeedX,X
R $02:BFEC LDA RAM_SpriteSpeedX,X
W $02:BFF1 STA RAM_SpriteSpeedX,X
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
R $02:C128 LDA RAM_SpriteSpeedX,X
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:D220 INC RAM_SpriteSpeedX,X
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)
R $02:D22D LDA RAM_SpriteSpeedX,X
R $02:D238 LDA RAM_SpriteSpeedX,X
W $02:D245 STA RAM_SpriteSpeedX,X ; Store the new X speed
R $02:D27F LDA RAM_SpriteSpeedX,X
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)
R $02:DBB1 LDA RAM_SpriteSpeedX,X
W $02:DBB7 STA RAM_SpriteSpeedX,X
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
R $02:E2E2 LDA RAM_SpriteSpeedX,X
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
R $02:E7F6 LDA RAM_SpriteSpeedX,X
W $02:E7FB STA RAM_SpriteSpeedX,X
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
R $02:EB98 LDA RAM_SpriteSpeedX,X
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
R $02:F306 LDA RAM_SpriteSpeedX,X
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
R $03:8038 LDA RAM_SpriteSpeedX,X
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
R $03:8156 LDA RAM_SpriteSpeedX,X
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]
R $03:8551 LDA RAM_SpriteSpeedX,X
W $03:855C STA RAM_SpriteSpeedX,X ; X speed += PorcuPuffAccel[direction]
R $03:855E LDA RAM_SpriteSpeedX,X
R $03:8568 ADC RAM_SpriteSpeedX,X
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]
R $03:895A LDY RAM_SpriteSpeedX,X
R $03:89B4 LDA RAM_SpriteSpeedX,X
R $03:89C6 EOR RAM_SpriteSpeedX,X
R $03:89D9 LDA RAM_SpriteSpeedX,X
RW $03:89E5 INC RAM_SpriteSpeedX,X
RW $03:89E7 INC RAM_SpriteSpeedX,X
RW $03:89E9 DEC RAM_SpriteSpeedX,X ; Move X speed one step toward 0
R $03:89F1 LDA RAM_SpriteSpeedX,X
W $03:89FC STA RAM_SpriteSpeedX,X ; X speed += acceleration
R $03:89FF LDA RAM_SpriteSpeedX,X
R $03:8A8A LDA RAM_SpriteSpeedX,X
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)
W $03:8E9A STA RAM_SpriteSpeedX,X
W $03:8F00 STA RAM_SpriteSpeedX,X
R $03:8F7C LDY RAM_SpriteSpeedX,X
R $03:8FD5 LDA RAM_SpriteSpeedX,X
W $03:8FDA STA RAM_SpriteSpeedX,X
R $03:8FFF LDY RAM_SpriteSpeedX,X
R $03:9057 LDA RAM_SpriteSpeedX,X
R $03:90A2 LDA RAM_SpriteSpeedX,X
W $03:90AD STA RAM_SpriteSpeedX,X
R $03:90C9 LDA RAM_SpriteSpeedX,X
R $03:90D8 ADC RAM_SpriteSpeedX,X ; X speed += [$17BD] * 8 (compensates for screen scrolling, probably)
W $03:90DA STA RAM_SpriteSpeedX,X
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
W $03:9753 STA RAM_SpriteSpeedX,X
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
R $03:A4AB LDA RAM_SpriteSpeedX,X
W $03:A4B1 STA RAM_SpriteSpeedX,X
W $03:A6C5 STZ RAM_SpriteSpeedX,X ; X speed = 0
W $03:A711 STZ RAM_SpriteSpeedX,X ; X speed = 0
R $03:A73F LDA RAM_SpriteSpeedX,X
W $03:A745 STA RAM_SpriteSpeedX,X
W $03:A7DC STA RAM_SpriteSpeedX,X
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
R $03:B1B9 LDA RAM_SpriteSpeedX,X
W $03:B1C3 STA RAM_SpriteSpeedX,X ; Start rolling toward Mario (X speed from BowserBallSpeed)
R $03:B1C5 LDA RAM_SpriteSpeedX,X
W $03:B2D2 STA RAM_SpriteSpeedX,X ; X speed = walk speed for the direction
R $03:B2EA LDA RAM_SpriteSpeedX,X
W $03:B2EF STA RAM_SpriteSpeedX,X
RW $03:C85F INC RAM_SpriteSpeedX,X ; X speed [$B6] used as a frame counter
R $03:C861 LDA RAM_SpriteSpeedX,X
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)
W $00:FC65 STA.W RAM_SpriteState,Y
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]
W $01:83CF STA RAM_SpriteState,X
W $01:8418 STA RAM_SpriteState,X
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]
R $01:8D04 LDA RAM_SpriteState,X
R $01:8D41 LDA RAM_SpriteState,X
RW $01:8D4E INC RAM_SpriteState,X ; Count a frame in [RAM_SpriteState,X]
R $01:8D6E LDA RAM_SpriteState,X
R $01:8EAC LDA RAM_SpriteState,X
R $01:8EC8 LDA 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)
R $01:9542 LDA RAM_SpriteState,X
W $01:9662 STA RAM_SpriteState,X
R $01:9A2A LDA RAM_SpriteState,X
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
R $01:AD90 LDA RAM_SpriteState,X
R $01:AE08 LDY RAM_SpriteState,X
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:AE71 LDA RAM_SpriteState,X
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)
R $01:AFEF LDA RAM_SpriteState,X
RW $01:B0C8 INC RAM_SpriteState,X ; State [$C2]++ (reverses direction)
R $01:B0CA LDA RAM_SpriteState,X
R $01:B1C6 LDA RAM_SpriteState,X
RW $01:B1CC INC RAM_SpriteState,X ; State [$C2]++
R $01:B1FA LDA RAM_SpriteState,X
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)
R $01:B27A LDA RAM_SpriteState,X
R $01:B4E7 LDA RAM_SpriteState,X
RW $01:B4EB INC RAM_SpriteState,X ; Sprite state = 1 (hit)
R $01:B536 LDA RAM_SpriteState,X
R $01:B6B2 LDA RAM_SpriteState,X
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)
R $01:B709 LDA RAM_SpriteState,X
W $01:B70D STA RAM_SpriteState,X
R $01:B71B LDA RAM_SpriteState,X
R $01:B779 LDA RAM_SpriteState,X
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)
R $01:BDE2 LDA RAM_SpriteState,X
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:C07A STA RAM_SpriteState,X
R $01:C0C2 LDA RAM_SpriteState,X
R $01:C262 LDA RAM_SpriteState,X
R $01:C27F LDA RAM_SpriteState,X
R $01:C3E1 LDA RAM_SpriteState,X
W $01:C3EF STZ RAM_SpriteState,X ; Clear the state once it is free
R $01:C481 ORA RAM_SpriteState,X
R $01:C494 LDA RAM_SpriteState,X
R $01:C4B6 LDA RAM_SpriteState,X
R $01:C6F1 LDA RAM_SpriteState,X
W $01:C6FD STZ RAM_SpriteState,X ; Clear the state
R $01:C7C6 SBC RAM_SpriteState,X
W $01:C7CC STA RAM_SpriteState,X ; Remember the current X in [$C2,X] for next frame
W $01:CD35 STA RAM_SpriteState,X
R $01:CD6D LDY RAM_SpriteState,X
R $01:CDC6 LDY RAM_SpriteState,X
R $01:CE56 LDA RAM_SpriteState,X
R $01:CE5F LDA RAM_SpriteState,X
R $01:CFBC LDA RAM_SpriteState,X
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
R $01:D867 LDA RAM_SpriteState,X
W $01:D86F STA RAM_SpriteState,X ; No line found: sprite state = 2 (fall off the end)
R $01:D907 LDA RAM_SpriteState,X
W $01:D935 STA RAM_SpriteState,X ; Sprite state = 1: follow the segment
R $01:DE41 LDA RAM_SpriteState,X
RW $01:DE7C INC RAM_SpriteState,X ; Block state = 1 (hit; its symbol is now frozen)
R $01:DEB2 LDA.W RAM_SpriteState,Y
R $01:E10D ORA RAM_SpriteState,X ; Every 8th frame, state 0 only ...
R $01:E11E LDY RAM_SpriteState,X
R $01:E12D LDA RAM_SpriteState,X
R $01:E2D2 LDA RAM_SpriteState,X
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]
R $01:EA9D LDA RAM_SpriteState,X
R $01:EAD7 LDA RAM_SpriteState,X
R $01:EB21 LDA RAM_SpriteState,X
R $01:EB48 LDA RAM_SpriteState,X
R $01:ECE1 LDA RAM_SpriteState,X
R $01:ECF5 LDA RAM_SpriteState,X
W $01:ED58 STA RAM_SpriteState,X ; Yoshi state = 1 (ridden)
R $01:ED70 LDA RAM_SpriteState,X
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:F1DF LDA RAM_SpriteState,X
W $01:F220 STA.W RAM_SpriteState,Y
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
R $01:F8FF LDA RAM_SpriteState,X
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:F932 LDA RAM_SpriteState,X
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)
R $02:940F LDA RAM_SpriteState,X
W $02:9413 STZ RAM_SpriteState,X ; Reset its state to 0
R $02:943F LDA RAM_SpriteState,X
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:B688 LDA RAM_SpriteState,X
R $02:B6A7 LDA RAM_SpriteState,X
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
R $02:B730 LDA RAM_SpriteState,X
R $02:B803 LDA RAM_SpriteState,X
W $02:B808 STA RAM_SpriteState,X
R $02:B86F LDA RAM_SpriteState,X
W $02:B873 STA.W RAM_SpriteState,Y
R $02:BBDC LDA RAM_SpriteState,X
RW $02:BBF5 INC RAM_SpriteState,X ; State++ (reverses direction)
R $02:BCF4 LDY RAM_SpriteState,X ; Y = state (orientation)
R $02:BD5C LDA RAM_SpriteState,X
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)
R $02:BDFE LDA RAM_SpriteState,X
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)
R $02:BE1F LDA RAM_SpriteState,X
W $02:BE2D STA RAM_SpriteState,X ; State = A
R $02:BE2F LDY RAM_SpriteState,X ; Y = state
R $02:BF20 LDA RAM_SpriteState,X
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
R $02:C7E2 LDA RAM_SpriteState,X
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
R $02:CE58 LDA RAM_SpriteState,X
W $02:CE5D STA RAM_SpriteState,X ; [$C2] += 4 (moving toward positive amplitude)
W $02:CE6A STA RAM_SpriteState,X ; [$C2] = [$151C]
R $02:CE70 LDA RAM_SpriteState,X
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:CEEE LDA RAM_SpriteState,X
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:DC42 LDA RAM_SpriteState,X
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
R $02:E330 LDA RAM_SpriteState,X
RW $02:E342 INC RAM_SpriteState,X ; Flip direction of acceleration (state++)
R $02:E463 LDA RAM_SpriteState,X
R $02:E4C4 LDA RAM_SpriteState,X
R $02:E73F LDA RAM_SpriteState,X
RW $02:E77C INC RAM_SpriteState,X ; State++ (jump)
RW $02:E7AA INC RAM_SpriteState,X ; State++ (back to swimming)
R $02:E88B LDA RAM_SpriteState,X
RW $02:E89E INC RAM_SpriteState,X ; Next phase
R $02:E95D LDA RAM_SpriteState,X
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++
R $02:EDD8 LDA RAM_SpriteState,X
R $02:EEB5 LDA RAM_SpriteState,X
RW $02:EEB9 INC RAM_SpriteState,X
R $02:F0D0 LDA RAM_SpriteState,X
W $02:F0D6 STA RAM_SpriteState,X ; State = ([state] << 1) OR direction (per-segment facing history)
R $02:F122 LDA RAM_SpriteState,X
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 $02:F517 LDA RAM_SpriteState,X
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)
R $03:83A8 LDY RAM_SpriteState,X
R $03:8502 LDA RAM_SpriteState,X
RW $03:8514 INC RAM_SpriteState,X ; Max reached: state++ (reverse direction)
R $03:88D3 LDA RAM_SpriteState,X
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)
R $03:8A46 LDA RAM_SpriteState,X
RW $03:8C3E INC RAM_SpriteState,X ; Next movement phase: [sprite state]++
R $03:8C45 LDA RAM_SpriteState,X
W $03:8D85 STZ RAM_SpriteState,X ; Clear sprite state
R $03:8DCB LDA RAM_SpriteState,X
W $03:8DED STA RAM_SpriteState,X
RW $03:8E85 INC RAM_SpriteState,X ; Next phase: state++
R $03:8E87 LDA RAM_SpriteState,X
R $03:8E92 LDA RAM_SpriteState,X
R $03:90B5 LDA RAM_SpriteState,X
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
RW $03:9756 INC RAM_SpriteState,X
W $03:9776 STZ RAM_SpriteState,X
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++
R $03:B2D4 LDA RAM_SpriteState,X
RW $03:B2D6 INC RAM_SpriteState,X
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:C37B LDA RAM_SpriteState,X
R $03:C4B3 LDA RAM_SpriteState,X ; A = state (lit flag)
R $03:C514 LDA RAM_SpriteState,X
R $03:C5AE LDA RAM_SpriteState,X
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)
R $03:C8A5 LDA RAM_SpriteState,X
RW $03:C8E0 INC RAM_SpriteState,X ; State++ (fade out)
R $03:CCAD LDA RAM_SpriteState,X
R $03:CCFF LDA RAM_SpriteState,X
W $03:CD01 STA.W RAM_SpriteState,Y ; Copy [$C2] (state value used for Y position) from the main sprite
R $03:D494 LDA RAM_SpriteState,X
R $03:DD81 LDY RAM_SpriteState,X
RW $05:C6A3 LSR RAM_SpriteState,X
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:A83C LDA [$CE],Y
R $02:A84E LDA [$CE],Y
R $02:A861 LDA [$CE],Y
R $02:A87D LDA [$CE],Y
R $02:A943 LDA [$CE],Y
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:AA56 LDA [$CE],Y
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
W $05:D8EE STA $CE
R $05:D8F9 LDA [$CE] ; A = first byte of the level's sprite data (sprite header)
R $05:D900 LDA [$CE]
W $05:DA80 STA $CE
R $05:DA8A LDA [$CE]
R $05:DA91 LDA [$CE]
W $05:DB55 STA $CE ; Sprite pointer low word [$CE] = ChocIsld2Sprites[X]
R $05:DB5F LDA [$CE]
R $05:DB66 LDA [$CE]

$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
W $05:DA88 STA $D0

$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)

$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)

$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)
W $00:A2FB STA $D3
R $00:D27F SBC $D3
R $01:A8A2 CMP $D3
R $01:AABD SBC $D3 ; [A] = sprite Y - Mario Y
R $01:AD44 LDA $D3 ; A = Mario Y low [$D3]
R $01:E5C9 LDA $D3
R $01:E81E ADC $D3 ; Cloud Y (low) = Mario Y + offset
R $01:E86F LDA $D3
W $01:EDD6 STA $D3 ; Mario Y position (and copy in $D3)
R $01:F9A2 LDA $D3
W $01:F9A9 STA $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:A8AC SBC $D4
R $01:AD4B LDA $D4 ; A = Mario Y high [$D4]
R $01:E822 LDA $D4
R $01:E877 LDA $D4
W $01:EDDF STA $D4 ; Copy to [$D4]
R $01:F9AB LDA $D4
W $01:F9B0 STA $D4 ; Temporarily Mario Y [$D3] -= [$18B6] (aim above Mario's feet)
W $01:F9B6 STA $D4

$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
R $02:F0DF LDA $D5
R $02:F0E6 LDA $D5
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)
W $00:FA69 STA.W RAM_SpriteYLo,Y
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:FCB1 STA RAM_SpriteYLo,X
W $00:FD00 STA RAM_SpriteYLo,X ; Sprite Y low = 0
R $00:FF4D LDA RAM_SpriteYLo,X
R $00:FF7E LDA RAM_SpriteYLo,X
R $01:807F LDA RAM_SpriteYLo,X
RW $01:830F INC RAM_SpriteYLo,X
RW $01:8311 INC RAM_SpriteYLo,X ; Y position += 2
R $01:835B LDA RAM_SpriteYLo,X
W $01:8360 STA RAM_SpriteYLo,X
R $01:83B5 LDA RAM_SpriteYLo,X
RW $01:8404 INC RAM_SpriteYLo,X ; Y position low += 1 (sprite hugs the wall)
R $01:8490 LDA RAM_SpriteYLo,X
R $01:84B9 LDA RAM_SpriteYLo,X
W $01:84BB STA.W RAM_SpriteYLo,Y ; Cloud Y position low = Lakitu's
R $01:856E LDA RAM_SpriteYLo,X
R $01:85A1 LDA RAM_SpriteYLo,X
W $01:85A6 STA RAM_SpriteYLo,X
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
R $01:88BF LDA.W RAM_SpriteYLo,Y
R $01:8BF0 LDA RAM_SpriteYLo,X
W $01:8BF5 STA RAM_SpriteYLo,X
W $01:8C08 STA RAM_SpriteYLo,X ; Restore Y position low
R $01:8F7C LDA RAM_SpriteYLo,X
R $01:9017 LDA RAM_SpriteYLo,X
R $01:916E LDA RAM_SpriteYLo,X
W $01:9173 STA RAM_SpriteYLo,X
R $01:918F LDA RAM_SpriteYLo,X
W $01:9194 STA RAM_SpriteYLo,X
R $01:939D LDA RAM_SpriteYLo,X
W $01:93A2 STA RAM_SpriteYLo,X
R $01:940A LDA RAM_SpriteYLo,X
W $01:9412 STA RAM_SpriteYLo,X
R $01:9455 LDA RAM_SpriteYLo,X
R $01:94BF LDA RAM_SpriteYLo,X
R $01:95B4 LDA RAM_SpriteYLo,X
R $01:9708 LDA RAM_SpriteYLo,X
W $01:970A STA.W RAM_SpriteYLo,Y
R $01:978B LDA RAM_SpriteYLo,X
W $01:978D STA.W RAM_SpriteYLo,Y
R $01:99EF LDA RAM_SpriteYLo,X
R $01:9E45 LDA RAM_SpriteYLo,X
R $01:9E95 LDA RAM_SpriteYLo,X ; Draw both Koopa wings: save sprite Y low
W $01:9E9B STA RAM_SpriteYLo,X
W $01:9F06 STA RAM_SpriteYLo,X ; Restore sprite Y low
W $01:A11D STA RAM_SpriteYLo,X
R $01:A23E LDA RAM_SpriteYLo,X
R $01:A2CA LDA RAM_SpriteYLo,X
W $01:A2CE STA RAM_SpriteYLo,X
R $01:A33F LDA RAM_SpriteYLo,X
W $01:A344 STA.W RAM_SpriteYLo,Y
R $01:A3A6 LDA RAM_SpriteYLo,X ; A = sprite Y low
R $01:A3D7 LDA RAM_SpriteYLo,X
R $01:A46C LDA RAM_SpriteYLo,X
R $01:A488 LDA.W RAM_SpriteYLo,Y
R $01:AABA LDA RAM_SpriteYLo,X ; A = sprite Y low
R $01:AAE3 LDA RAM_SpriteYLo,X
R $01:AB8D LDA RAM_SpriteYLo,X ; Smoke X/Y = sprite position (low bytes)
R $01:ABFA ADC RAM_SpriteYLo,X
W $01:ABFC STA RAM_SpriteYLo,X ; Position low byte += displacement + carry
R $01:AC3E LDA RAM_SpriteYLo,X
R $01:ACDA CMP RAM_SpriteYLo,X
R $01:AD47 SBC RAM_SpriteYLo,X ; Minus sprite Y low
R $01:AE1F LDA RAM_SpriteYLo,X
R $01:AE96 LDA RAM_SpriteYLo,X
R $01:AF2C LDA RAM_SpriteYLo,X
R $01:B182 ADC RAM_SpriteYLo,X
R $01:B248 LDA RAM_SpriteYLo,X
W $01:B24D STA RAM_SpriteYLo,X
R $01:B2E7 LDA RAM_SpriteYLo,X
R $01:B3A5 LDA RAM_SpriteYLo,X
R $01:B45C LDA RAM_SpriteYLo,X
R $01:B48A LDA RAM_SpriteYLo,X
R $01:B633 LDA RAM_SpriteYLo,X
W $01:B639 STA RAM_SpriteYLo,X
W $01:B64C STA RAM_SpriteYLo,X ; Restore sprite Y low
R $01:B72D LDA RAM_SpriteYLo,X
R $01:B7C2 LDA RAM_SpriteYLo,X
R $01:B862 LDA RAM_SpriteYLo,X
R $01:B891 LDA RAM_SpriteYLo,X
R $01:B91D LDA RAM_SpriteYLo,X
R $01:B9A3 LDY RAM_SpriteYLo,X
R $01:B9B7 LDA RAM_SpriteYLo,X
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
R $01:BA8E LDA RAM_SpriteYLo,X
W $01:BA92 STA RAM_SpriteYLo,X ; Sprite Y += 7 (carry from the add above is clear)
R $01:BB42 LDA RAM_SpriteYLo,X
W $01:BCAF STA RAM_SpriteYLo,X ; Sprite Y low = block Y low rounded to 16
R $01:BCD3 LDA RAM_SpriteYLo,X
R $01:BDAD LDA RAM_SpriteYLo,X
W $01:BE15 STA RAM_SpriteYLo,X ; Sprite Y = (random + screen Y) & $F0: random row on screen
R $01:BEE7 LDA RAM_SpriteYLo,X
R $01:BF42 LDA RAM_SpriteYLo,X
W $01:BF47 STA.W RAM_SpriteYLo,Y ; New Y = this sprite's Y + $0A (at the wand)
R $01:C065 LDA RAM_SpriteYLo,X
W $01:C06A STA RAM_SpriteYLo,X
R $01:C084 LDA RAM_SpriteYLo,X
R $01:C115 SBC RAM_SpriteYLo,X
R $01:C1CB LDA RAM_SpriteYLo,X
R $01:C1DC LDA RAM_SpriteYLo,X ; $98 = Sprite Y position
R $01:C409 LDA RAM_SpriteYLo,X
W $01:C411 STA RAM_SpriteYLo,X ; Snap Y to a 16-pixel boundary
R $01:C505 LDA RAM_SpriteYLo,X
R $01:C763 LDA RAM_SpriteYLo,X
W $01:C768 STA RAM_SpriteYLo,X
R $01:CAF7 LDA RAM_SpriteYLo,X
R $01:CD2F LDA RAM_SpriteYLo,X
W $01:CD41 STA RAM_SpriteYLo,X ; Sprite Y low = $40
W $01:CD50 STY RAM_SpriteYLo,X ; Sprite Y low = $90
R $01:CFE5 LDA RAM_SpriteYLo,X
W $01:CFEA STA RAM_SpriteYLo,X
R $01:D026 LDA RAM_SpriteYLo,X
W $01:D034 STA RAM_SpriteYLo,X ; Sprite Y low = $D0
R $01:D07C LDA RAM_SpriteYLo,X
W $01:D081 STA.W RAM_SpriteYLo,Y
R $01:D0CD LDA RAM_SpriteYLo,X
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
R $01:D2E8 CMP RAM_SpriteYLo,X
R $01:D362 LDA RAM_SpriteYLo,X ; Y low
W $01:D368 STA RAM_SpriteYLo,X
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:D809 LDA RAM_SpriteYLo,X
R $01:D824 LDA RAM_SpriteYLo,X
R $01:D8A4 LDA RAM_SpriteYLo,X
W $01:D8B8 STA RAM_SpriteYLo,X
R $01:D8F5 LDA RAM_SpriteYLo,X ; A = sprite Y low
R $01:D910 LDA RAM_SpriteYLo,X
R $01:D91E SBC RAM_SpriteYLo,X
W $01:D93A STA RAM_SpriteYLo,X
R $01:D9D9 LDA RAM_SpriteYLo,X
R $01:D9E1 SBC RAM_SpriteYLo,X
R $01:DA51 LDA RAM_SpriteYLo,X
R $01:DABE LDA RAM_SpriteYLo,X
W $01:DAC4 STA RAM_SpriteYLo,X
W $01:DAD7 STA RAM_SpriteYLo,X ; Restore Y low
R $01:DB10 LDA RAM_SpriteYLo,X
W $01:DB16 STA RAM_SpriteYLo,X
W $01:DB36 STA RAM_SpriteYLo,X ; Restore Y low
W $01:DDCE STA RAM_SpriteYLo,X ; Sprite Y low = start position table
R $01:DE6A ADC RAM_SpriteYLo,X
R $01:DE98 LDA RAM_SpriteYLo,X
R $01:DEB7 LDA.W RAM_SpriteYLo,Y
W $01:DEBF STA.W RAM_SpriteYLo,Y ; Snap block Y to the 8-pixel grid: Y = ([Y] + 4) & $F8
R $01:DF4F LDA RAM_SpriteYLo,X
R $01:DFFA LDA.W RAM_SpriteYLo,Y
R $01:E050 LDA RAM_SpriteYLo,X
R $01:E05B LDA RAM_SpriteYLo,X
W $01:E060 STA RAM_SpriteYLo,X ; Y position += $10 ...
R $01:E0E2 LDA RAM_SpriteYLo,X
R $01:E164 LDA RAM_SpriteYLo,X
R $01:E230 LDA RAM_SpriteYLo,X
R $01:E332 LDA RAM_SpriteYLo,X
R $01:E5CE CMP RAM_SpriteYLo,X ; If Mario's Y + $14 >= sprite Y (Mario not above it): hurt Mario
R $01:E66C LDA RAM_SpriteYLo,X
R $01:E6B8 LDA RAM_SpriteYLo,X
W $01:E820 STA RAM_SpriteYLo,X
W $01:E875 STA RAM_SpriteYLo,X
R $01:E8B5 LDA RAM_SpriteYLo,X
W $01:E8BA STA.W RAM_SpriteYLo,Y
R $01:EA45 LDA RAM_SpriteYLo,X
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
R $01:ECB3 LDA RAM_SpriteYLo,X
W $01:ECB8 STA.W RAM_SpriteYLo,Y ; Y low = Yoshi Y low + 8
R $01:ED1D ADC RAM_SpriteYLo,X
R $01:EDCE LDA RAM_SpriteYLo,X
R $01:EF26 LDA RAM_SpriteYLo,X
W $01:EF2D STA RAM_SpriteYLo,X ; Y position += YoshiPositionY[frame] (body bob)
R $01:EF97 LDA RAM_SpriteYLo,X
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
R $01:F06C LDA RAM_SpriteYLo,X
R $01:F213 LDA RAM_SpriteYLo,X
W $01:F215 STA.W RAM_SpriteYLo,Y ; Item Y lo = Yoshi Y lo
R $01:F2A8 LDA RAM_SpriteYLo,X
R $01:F413 ADC RAM_SpriteYLo,X
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
R $01:F5B4 SBC.W RAM_SpriteYLo,Y
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
R $01:FAA6 LDA RAM_SpriteYLo,X
R $01:FB56 LDA RAM_SpriteYLo,X
R $01:FB73 LDA RAM_SpriteYLo,X
W $01:FC7F STA RAM_SpriteYLo,X ; ...and [$14BA]
R $01:FCDA LDA RAM_SpriteYLo,X
W $01:FCEB STA RAM_SpriteYLo,X ; Sprite Y = [$14BA] - $10
W $01:FCF5 STA RAM_SpriteYLo,X ; Restore sprite Y
R $01:FD60 LDA RAM_SpriteYLo,X
W $01:FDE7 STA.W RAM_SpriteYLo,Y
R $01:FFA8 LDA RAM_SpriteYLo,X
W $02:8064 STA RAM_SpriteYLo,X
R $02:80D7 LDA RAM_SpriteYLo,X
R $02:84E8 LDA RAM_SpriteYLo,X
R $02:8544 LDA RAM_SpriteYLo,X
R $02:861C ADC RAM_SpriteYLo,X
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:899C STA RAM_SpriteYLo,X
W $02:8B59 STA RAM_SpriteYLo,X ; Sprite Y low = [$18C3]
R $02:8BD5 LDA RAM_SpriteYLo,X
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
R $02:AC30 LDA RAM_SpriteYLo,X
W $02:AC32 STA RAM_SpriteYLo ; Copy Y position low
R $02:ACF9 LDA RAM_SpriteYLo,X
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:B4C8 STA.W RAM_SpriteYLo,Y
W $02:B142 STA.W RAM_SpriteYLo,Y ; Sprite Y low
W $02:B17A STA RAM_SpriteYLo,X
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:B404 STA.W RAM_SpriteYLo,Y
R $02:B7DB LDA.W RAM_SpriteYLo,Y
R $02:B7DF SBC RAM_SpriteYLo,X
R $02:B852 LDA RAM_SpriteYLo,X
W $02:B854 STA.W RAM_SpriteYLo,Y
R $02:B999 LDA RAM_SpriteYLo,X
R $02:B9AF LDA RAM_SpriteYLo,X
W $02:BADA STA.W RAM_SpriteYLo,Y
R $02:BB33 LDA RAM_SpriteYLo,X
R $02:BDA7 LDA RAM_SpriteYLo,X
R $02:C04D LDA RAM_SpriteYLo,X
W $02:C051 STA RAM_SpriteYLo,X
R $02:C113 LDA RAM_SpriteYLo,X
R $02:C1D8 LDA RAM_SpriteYLo,X
W $02:C1DD STA.W RAM_SpriteYLo,Y
R $02:C487 LDA RAM_SpriteYLo,X
R $02:C5D7 LDA RAM_SpriteYLo,X
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]
W $02:CC38 STA RAM_SpriteYLo,X
R $02:CC4A LDA RAM_SpriteYLo,X
R $02:CCC4 LDA RAM_SpriteYLo,X
R $02:CD6D LDA RAM_SpriteYLo,X
R $02:D038 LDA RAM_SpriteYLo,X
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:D149 LDA RAM_SpriteYLo,X
R $02:D2B4 ADC RAM_SpriteYLo,X
W $02:D2B6 STA RAM_SpriteYLo,X
R $02:D2DF LDA.W RAM_SpriteYLo,Y
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:D6D6 LDA RAM_SpriteYLo,X
R $02:D70C ADC RAM_SpriteYLo,X ; Sprite Y low += Y offset
W $02:D70E STA RAM_SpriteYLo,X
W $02:D75C STA RAM_SpriteYLo,X
R $02:D77E SBC RAM_SpriteYLo,X ; minus pivot Y low: signed Y distance to the ball
R $02:D784 ADC RAM_SpriteYLo,X
R $02:D79C LDA RAM_SpriteYLo,X ; A = pivot Y low
R $02:DAD3 LDA RAM_SpriteYLo,X
R $02:DB88 LDA RAM_SpriteYLo,X
W $02:DB8D STA.W RAM_SpriteYLo,Y
R $02:DDAE LDA RAM_SpriteYLo,X
W $02:DDB0 STA.W RAM_SpriteYLo,Y ; Lightning Y position = Sumo Bro Y position
R $02:DEE2 LDA RAM_SpriteYLo,X
R $02:DF63 LDA RAM_SpriteYLo,X
R $02:E0A5 LDA RAM_SpriteYLo,X
R $02:E0FC LDA RAM_SpriteYLo,X
W $02:E102 STA RAM_SpriteYLo,X
W $02:E11D STA RAM_SpriteYLo,X ; Restore Y low
R $02:E1E2 LDA RAM_SpriteYLo,X
R $02:E2B0 LDA RAM_SpriteYLo,X
R $02:E2CC LDA RAM_SpriteYLo,X
R $02:E47F LDA RAM_SpriteYLo,X
R $02:E4B2 LDA RAM_SpriteYLo,X
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
R $02:E50A LDA RAM_SpriteYLo,X
R $02:E524 LDA RAM_SpriteYLo,X
R $02:E541 LDA RAM_SpriteYLo,X
R $02:E7A4 LDA RAM_SpriteYLo,X
W $02:E7A8 STA RAM_SpriteYLo,X
R $02:E84A LDA RAM_SpriteYLo,X
W $02:E851 STA RAM_SpriteYLo,X
W $02:E866 STA RAM_SpriteYLo,X ; Restore Y lo
R $02:E8A9 LDA RAM_SpriteYLo,X
R $02:E8D4 LDA RAM_SpriteYLo,X
R $02:E8F4 LDA RAM_SpriteYLo,X
R $02:EB0D LDA RAM_SpriteYLo,X
W $02:EB0F STA.W RAM_SpriteYLo,Y ; New sprite Y low = this sprite's Y low
R $02:EDA3 LDA RAM_SpriteYLo,X
W $02:EDA5 STA.W RAM_SpriteYLo,Y ; Y low = this sprite's
R $02:EE82 LDA RAM_SpriteYLo,X
R $02:EEDB LDA RAM_SpriteYLo,X
R $02:EF90 LDA RAM_SpriteYLo,X
W $02:EF92 STA.W RAM_SpriteYLo,Y ; Copy Y low
R $02:EFD1 LDA RAM_SpriteYLo,X
R $02:EFFE LDA RAM_SpriteYLo,X
R $02:F0FD LDA RAM_SpriteYLo,X
R $02:F2F7 LDA RAM_SpriteYLo,X
R $02:F2FC LDA RAM_SpriteYLo,X
R $02:F351 LDA RAM_SpriteYLo,X
W $02:F359 STA RAM_SpriteYLo,X ; Snap Y to the ground (multiple of 8)
R $02:F409 LDA RAM_SpriteYLo,X
R $02:F456 LDA RAM_SpriteYLo,X
R $02:F4A3 LDA RAM_SpriteYLo,X
W $02:F573 STA RAM_SpriteYLo,X ; Y low = $E0
W $02:F957 STA RAM_SpriteYLo ; Sprite 0 Y low = cluster Y low
W $02:FC18 STA RAM_SpriteYLo
R $03:821D LDA RAM_SpriteYLo,X
R $03:8800 ADC RAM_SpriteYLo,X
R $03:8A2E LDA RAM_SpriteYLo,X
R $03:8B0E LDA RAM_SpriteYLo,X
W $03:8B13 STA.W RAM_SpriteYLo,Y
R $03:8C9D LDA RAM_SpriteYLo,X
R $03:8CB4 LDA RAM_SpriteYLo,X
R $03:9047 LDA RAM_SpriteYLo,X
R $03:9111 LDA RAM_SpriteYLo,X
R $03:92E4 LDA RAM_SpriteYLo,X
R $03:9356 LDA RAM_SpriteYLo,X ; A = Y low
W $03:935C STA RAM_SpriteYLo,X
W $03:9370 STA RAM_SpriteYLo,X ; Store Y low
R $03:9396 LDA RAM_SpriteYLo,X
W $03:98B4 STA RAM_SpriteYLo
W $03:99DD STA RAM_SpriteYLo,X ; Sprite Y position low
R $03:9A4A SBC RAM_SpriteYLo,X
R $03:9AE1 LDA RAM_SpriteYLo,X
W $03:9AE3 STA.W RAM_SpriteYLo,Y
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:9DD9 LDA RAM_SpriteYLo,X
R $03:9F80 LDA RAM_SpriteYLo,X ; Remember home Y low
W $03:A031 STA RAM_SpriteYLo,X ; 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:A05F STA RAM_SpriteYLo,X ; Y low
W $03:A0FA STA RAM_SpriteYLo,X ; Y low = $80
R $03:A456 LDA RAM_SpriteYLo,X
R $03:A635 LDA RAM_SpriteYLo,X
W $03:A7CD STA RAM_SpriteYLo,X
W $03:A819 STA.W RAM_SpriteYLo,Y
R $03:A902 LDA RAM_SpriteYLo,X
W $03:A907 STA.W RAM_SpriteYLo,Y
R $03:AA78 LDA RAM_SpriteYLo,X
R $03:AB4D LDA RAM_SpriteYLo,X ; Bowser Y low
R $03:AB79 LDA RAM_SpriteYLo,X
W $03:AB86 STA RAM_SpriteYLo,X ; Bowser Y = $64 (land on the floor)
R $03:ABA9 LDA RAM_SpriteYLo,X
R $03:AC7B LDA RAM_SpriteYLo,X
R $03:AC9E LDA RAM_SpriteYLo,X
R $03:AD50 LDA RAM_SpriteYLo,X
W $03:AD58 STA RAM_SpriteYLo,X ; Peach Y = $A0 (ground)
R $03:AD9B ADC RAM_SpriteYLo,X
R $03:B035 LDA RAM_SpriteYLo,X
W $03:B03A STA.W RAM_SpriteYLo,Y ; Y position = Bowser Y + $10
R $03:B193 LDA RAM_SpriteYLo,X
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:B79A LDA RAM_SpriteYLo,X
R $03:B7C7 LDA RAM_SpriteYLo,X
R $03:B82E SBC RAM_SpriteYLo,X
R $03:B86A LDA RAM_SpriteYLo,X
R $03:B8DC CMP RAM_SpriteYLo,X ; Compare with sprite Y low
R $03:C010 LDA RAM_SpriteYLo,X
R $03:C071 LDA RAM_SpriteYLo,X
W $03:C075 STA RAM_SpriteYLo,X
W $03:C2FA STA RAM_SpriteYLo,X
R $03:C325 LDA RAM_SpriteYLo,X
W $03:C32A STA RAM_SpriteYLo,X
R $03:C466 LDA RAM_SpriteYLo,X
W $03:C7E4 STA.W RAM_SpriteYLo,Y
R $03:C9FC LDA RAM_SpriteYLo,X
R $03:CBCA LDA RAM_SpriteYLo,X
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
R $03:CD15 LDA RAM_SpriteYLo,X
W $03:CD17 STA.W RAM_SpriteYLo,Y ; Copy Y low
R $03:CE6E LDA RAM_SpriteYLo,X
R $03:DEF1 LDA RAM_SpriteYLo,X ; A = sprite Y position (16 bit)
R $07:FC5B LDA RAM_SpriteYLo,X
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)
W $00:FA5A STA.W RAM_SpriteXLo,Y
R $00:FB98 LDA.W RAM_SpriteXLo,Y ; A = sprite X low
R $00:FBBD ADC RAM_SpriteXLo,X
W $00:FBBF STA RAM_SpriteXLo,X
W $00:FC4F STA.W RAM_SpriteXLo,Y
W $00:FCA3 STA RAM_SpriteXLo,X
W $00:FCF7 STA RAM_SpriteXLo,X ; Sprite X low = $A0
R $00:FF36 LDA RAM_SpriteXLo,X
R $00:FF65 LDA RAM_SpriteXLo,X
R $01:8078 LDA RAM_SpriteXLo,X
R $01:8328 LDA RAM_SpriteXLo,X
R $01:8339 LDA RAM_SpriteXLo,X
R $01:83A4 LDA RAM_SpriteXLo,X
R $01:83C0 LDA RAM_SpriteXLo,X
R $01:83C9 LDA RAM_SpriteXLo,X
R $01:841B LDA RAM_SpriteXLo,X ; A = X position low
R $01:843E LDA RAM_SpriteXLo,X
W $01:8443 STA RAM_SpriteXLo,X
R $01:844E LDA RAM_SpriteXLo,X
R $01:84AE LDA RAM_SpriteXLo,X
W $01:84B0 STA.W RAM_SpriteXLo,Y ; Cloud X position low = Lakitu's
R $01:84CE LDA RAM_SpriteXLo,X
R $01:84ED LDA RAM_SpriteXLo,X
R $01:850D LDA RAM_SpriteXLo,X
R $01:8531 LDA RAM_SpriteXLo,X
R $01:85B0 LDA RAM_SpriteXLo,X
W $01:85B5 STA RAM_SpriteXLo,X
R $01:88AC LDA.W RAM_SpriteXLo,Y
R $01:8979 LDA RAM_SpriteXLo,X
R $01:897C SBC.W RAM_SpriteXLo,Y
R $01:8F6C LDA RAM_SpriteXLo,X
R $01:915F LDA RAM_SpriteXLo,X
W $01:9164 STA RAM_SpriteXLo,X
R $01:9180 LDA RAM_SpriteXLo,X
W $01:9185 STA RAM_SpriteXLo,X
R $01:91B3 ADC RAM_SpriteXLo,X
W $01:91B5 STA RAM_SpriteXLo,X
R $01:91D0 LDA RAM_SpriteXLo,X
W $01:91D6 STA RAM_SpriteXLo,X
R $01:93F4 LDA RAM_SpriteXLo,X
W $01:93FA STA RAM_SpriteXLo,X
R $01:946C LDA RAM_SpriteXLo,X
R $01:94DD LDA RAM_SpriteXLo,X
R $01:95A6 LDA RAM_SpriteXLo,X
R $01:96FD LDA RAM_SpriteXLo,X
W $01:96FF STA.W RAM_SpriteXLo,Y
R $01:9780 LDA RAM_SpriteXLo,X
W $01:9782 STA.W RAM_SpriteXLo,Y
R $01:99AB LDA RAM_SpriteXLo,X
R $01:99E6 LDA RAM_SpriteXLo,X
R $01:9E3C LDA RAM_SpriteXLo,X
R $01:9EA6 LDA RAM_SpriteXLo,X ; Save sprite X low
W $01:9EAC STA RAM_SpriteXLo,X
R $01:9ED4 LDA RAM_SpriteXLo,X
W $01:9ED9 STA RAM_SpriteXLo,X
W $01:9EFF STA RAM_SpriteXLo,X ; Restore sprite X low
W $01:A04F STA RAM_SpriteXLo,X
W $01:A0FD STA RAM_SpriteXLo,X
R $01:A230 LDA RAM_SpriteXLo,X
R $01:A332 ADC RAM_SpriteXLo,X
W $01:A334 STA.W RAM_SpriteXLo,Y
R $01:A36B LDA RAM_SpriteXLo,X
R $01:A37D LDA RAM_SpriteXLo,X
R $01:A3D0 LDA RAM_SpriteXLo,X
R $01:A43D LDA RAM_SpriteXLo,X
R $01:A446 LDA.W RAM_SpriteXLo,Y
R $01:A56D LDA RAM_SpriteXLo,X
R $01:A570 SBC.W RAM_SpriteXLo,Y
R $01:A6F8 LDA RAM_SpriteXLo,X
R $01:A6FB SBC.W RAM_SpriteXLo,Y ; A = X low difference X - Y; sign selects side
R $01:A79F LDA RAM_SpriteXLo,X
W $01:A7A7 STA.W RAM_SpriteXLo,Y
R $01:AB88 LDA RAM_SpriteXLo,X
R $01:AC64 CMP RAM_SpriteXLo,X ; Compare screen X low + offset with sprite X low, remember result
R $01:ACB1 LDA RAM_SpriteXLo,X
R $01:AD35 SBC RAM_SpriteXLo,X ; Minus sprite X low
R $01:AD59 LDA RAM_SpriteXLo,X ; A = sprite X low
R $01:AE16 LDA RAM_SpriteXLo,X
R $01:AE9B LDA RAM_SpriteXLo,X
W $01:AEA0 STA RAM_SpriteXLo,X
R $01:B168 ADC RAM_SpriteXLo,X ; $02 = random offset + sprite X low
R $01:B21C LDA RAM_SpriteXLo,X
R $01:B302 LDA RAM_SpriteXLo,X
R $01:B3F0 LDA RAM_SpriteXLo,X
R $01:B526 ADC RAM_SpriteXLo,X ; Mario X low = sprite X low + offset table [Y]
R $01:B753 LDA RAM_SpriteXLo,X
R $01:B7D0 LDA RAM_SpriteXLo,X
R $01:B8DE LDA RAM_SpriteXLo,X
R $01:B8EF LDA RAM_SpriteXLo,X
R $01:B907 LDA RAM_SpriteXLo,X
R $01:B950 LDA RAM_SpriteXLo,X ; A = sprite X low
R $01:BA87 LDA RAM_SpriteXLo,X
W $01:BA8C STA RAM_SpriteXLo,X ; Sprite X += 8
R $01:BAF0 SBC RAM_SpriteXLo,X
R $01:BB3B LDA RAM_SpriteXLo,X
W $01:BCA4 STA RAM_SpriteXLo,X ; Sprite X low = block X low rounded to 16
R $01:BDA8 LDA RAM_SpriteXLo,X
W $01:BE27 STA RAM_SpriteXLo,X ; Sprite X = (random + screen X) & $F0: random column on screen
R $01:BED8 LDA RAM_SpriteXLo,X
R $01:BF37 LDA RAM_SpriteXLo,X
W $01:BF39 STA.W RAM_SpriteXLo,Y ; New X low = this sprite's X low
R $01:C075 LDA RAM_SpriteXLo,X
R $01:C1D3 LDA RAM_SpriteXLo,X ; $9A = Sprite X position
R $01:C500 LDA RAM_SpriteXLo,X
R $01:C754 LDA RAM_SpriteXLo,X
W $01:C759 STA RAM_SpriteXLo,X
R $01:CAD9 LDA RAM_SpriteXLo,X
W $01:CD3D STA RAM_SpriteXLo,X ; Sprite X = $78
W $01:CD7F STA RAM_SpriteXLo,X ; Ludwig: sprite X low = $70
R $01:D01F LDA RAM_SpriteXLo,X
R $01:D073 LDA RAM_SpriteXLo,X
W $01:D097 STA.W RAM_SpriteXLo,Y ; New sprite X low
R $01:D166 LDY RAM_SpriteXLo,X
R $01:D1A1 LDA RAM_SpriteXLo,X
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:D357 STA RAM_SpriteXLo,X
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
W $01:D6FB STA RAM_SpriteXLo,X
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:D7F9 LDA RAM_SpriteXLo,X
R $01:D832 LDA RAM_SpriteXLo,X
R $01:D8AD LDA RAM_SpriteXLo,X
W $01:D8C1 STA RAM_SpriteXLo,X
R $01:D8FF LDA RAM_SpriteXLo,X ; A = sprite X low
R $01:D914 LDA RAM_SpriteXLo,X
R $01:D92A SBC RAM_SpriteXLo,X
W $01:D943 STA RAM_SpriteXLo,X
R $01:D9D6 LDA RAM_SpriteXLo,X
R $01:D9EB SBC RAM_SpriteXLo,X
R $01:DA70 LDA RAM_SpriteXLo,X
R $01:DAAD LDA RAM_SpriteXLo,X
W $01:DAB3 STA RAM_SpriteXLo,X
W $01:DADE STA RAM_SpriteXLo,X ; Restore X low
R $01:DAE0 LDA RAM_SpriteXLo,X
R $01:DAE8 SBC RAM_SpriteXLo,X
R $01:DAFF LDA RAM_SpriteXLo,X
W $01:DB05 STA RAM_SpriteXLo,X
W $01:DB3D STA RAM_SpriteXLo,X ; Restore X low
W $01:DDC4 STA RAM_SpriteXLo,X ; Sprite X low = start position table
R $01:DE91 LDA RAM_SpriteXLo,X
R $01:DEC2 LDA.W RAM_SpriteXLo,Y
W $01:DECA STA.W RAM_SpriteXLo,Y ; Snap block X to the 8-pixel grid: X = ([X] + 4) & $F8
R $01:DF26 LDA RAM_SpriteXLo,X
R $01:E001 LDA.W RAM_SpriteXLo,Y
R $01:E1B8 LDA RAM_SpriteXLo,X
W $01:E1BD STA RAM_SpriteXLo,X ; Sprite X position += 8 (center the keyhole)
R $01:E225 LDA RAM_SpriteXLo,X
R $01:E329 LDA RAM_SpriteXLo,X
W $01:E82B STA RAM_SpriteXLo,X ; Cloud X (low) = Mario X
W $01:E868 STA RAM_SpriteXLo,X ; Cloud X (low) = Mario X
R $01:E8AA LDA RAM_SpriteXLo,X
W $01:E8AC STA.W RAM_SpriteXLo,Y ; Lakitu X (low) = cloud X
R $01:EA3A LDA RAM_SpriteXLo,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]
R $01:EC9C LDA RAM_SpriteXLo,X
W $01:ECA3 STA.W RAM_SpriteXLo,Y ; Store in new sprite
R $01:ED0F ADC RAM_SpriteXLo,X
R $01:EF42 LDA RAM_SpriteXLo,X
W $01:EF49 STA RAM_SpriteXLo,X ; X position += YoshiHeadDispX[index] (head offset)
W $01:EF8C STA RAM_SpriteXLo,X ; Restore X position lo
R $01:F065 LDA RAM_SpriteXLo,X
R $01:F1FC LDA RAM_SpriteXLo,X
W $01:F203 STA.W RAM_SpriteXLo,Y ; Item X lo = Yoshi X lo + DATA_01F305[dir]
R $01:F29D LDA RAM_SpriteXLo,X
R $01:F429 LDA RAM_SpriteXLo,X
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
R $01:FB6E LDA RAM_SpriteXLo,X
R $01:FBBB LDA RAM_SpriteXLo,X
R $01:FBCB LDA RAM_SpriteXLo,X
R $01:FC6D LDA RAM_SpriteXLo,X
W $01:FC7A STA RAM_SpriteXLo,X ; Kid walked off the edge: use screen position [$14B8]
R $01:FCD7 LDA RAM_SpriteXLo,X
W $01:FCE3 STA RAM_SpriteXLo,X ; Sprite X = [$14B8] - 8
W $01:FCF8 STA RAM_SpriteXLo,X ; Restore sprite X
R $01:FD50 LDA RAM_SpriteXLo,X
W $01:FDD9 STA.W RAM_SpriteXLo,Y ; Ball X low = [$14B8] - 8 + BallPositionDispX[dir]
R $01:FF98 LDA RAM_SpriteXLo,X
W $02:8056 STA RAM_SpriteXLo,X
R $02:80CD LDA RAM_SpriteXLo,X
R $02:8492 SBC RAM_SpriteXLo,X
R $02:84F5 LDA RAM_SpriteXLo,X
R $02:854F LDA RAM_SpriteXLo,X
R $02:8606 ADC RAM_SpriteXLo,X
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
W $02:898E STA RAM_SpriteXLo,X
R $02:89AB LDA RAM_SpriteXLo,X ; Sprite X low
R $02:8A2A LDA RAM_SpriteXLo,X
W $02:8B4D STA RAM_SpriteXLo,X
W $02:A948 STA RAM_SpriteXLo,X ; Vertical level: X position low = high nibble of the first byte
W $02:A96A STA RAM_SpriteXLo,X
R $02:AC26 LDA RAM_SpriteXLo,X
W $02:AC28 STA RAM_SpriteXLo ; Copy X position low
R $02:AD22 LDA RAM_SpriteXLo,X
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:B4B9 STA.W RAM_SpriteXLo,Y
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:B3F8 STA.W RAM_SpriteXLo,Y
R $02:B83E LDA RAM_SpriteXLo,X
W $02:B840 STA.W RAM_SpriteXLo,Y
R $02:B969 LDA RAM_SpriteXLo,X
R $02:B9A6 LDA RAM_SpriteXLo,X
W $02:BACC STA.W RAM_SpriteXLo,Y
R $02:BB2A LDA RAM_SpriteXLo,X
R $02:C10B LDA RAM_SpriteXLo,X
R $02:C1AF LDA RAM_SpriteXLo,X
W $02:C1C6 STA.W RAM_SpriteXLo,Y
R $02:C288 LDA RAM_SpriteXLo,X
R $02:C3A1 LDA RAM_SpriteXLo,X
R $02:C47E LDA RAM_SpriteXLo,X
R $02:C5CC LDA RAM_SpriteXLo,X
W $02:C5CE STA.W RAM_SpriteXLo,Y ; Clone X position low = this Chuck's
R $02:CC0E LDA RAM_SpriteXLo,X
W $02:CC14 STA RAM_SpriteXLo,X ; Store X low
R $02:CC41 LDA RAM_SpriteXLo,X
R $02:CCBD LDA RAM_SpriteXLo,X
R $02:CD64 LDA RAM_SpriteXLo,X
R $02:D05E CMP RAM_SpriteXLo,X ; Compare with sprite X low
R $02:D105 LDA RAM_SpriteXLo,X
R $02:D166 LDA RAM_SpriteXLo,X
R $02:D2D5 LDA.W RAM_SpriteXLo,Y
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
R $02:D3FE ADC RAM_SpriteXLo,X
W $02:D400 STA RAM_SpriteXLo,X
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:D6CF LDA RAM_SpriteXLo,X
R $02:D6E9 ADC RAM_SpriteXLo,X ; Sprite X low += X offset
W $02:D6EB STA RAM_SpriteXLo,X
W $02:D763 STA RAM_SpriteXLo,X
R $02:D76B SBC RAM_SpriteXLo,X ; minus pivot X low: signed X distance to the ball
R $02:D771 ADC RAM_SpriteXLo,X
R $02:D798 LDA RAM_SpriteXLo,X ; A = pivot X low
R $02:DAC8 LDA RAM_SpriteXLo,X
R $02:DB7D LDA RAM_SpriteXLo,X
W $02:DB7F STA.W RAM_SpriteXLo,Y ; Hammer Bro X position = platform X position
R $02:DD9F LDA RAM_SpriteXLo,X
W $02:DDA3 STA.W RAM_SpriteXLo,Y
R $02:DEDE LDA RAM_SpriteXLo,X
R $02:DF2C LDA RAM_SpriteXLo,X
R $02:E095 LDA RAM_SpriteXLo,X
R $02:E1D2 LDA RAM_SpriteXLo,X
R $02:E2B6 LDA RAM_SpriteXLo,X
R $02:E2C3 LDA RAM_SpriteXLo,X
R $02:E476 LDA RAM_SpriteXLo,X
R $02:E4AB LDA RAM_SpriteXLo,X
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
R $02:E538 LDA RAM_SpriteXLo,X
R $02:E8CB LDA RAM_SpriteXLo,X
R $02:E8E6 LDA RAM_SpriteXLo,X
R $02:EABD LDA RAM_SpriteXLo,X
R $02:EABF CMP.W RAM_SpriteXLo,Y
R $02:EAE2 LDA RAM_SpriteXLo,X
R $02:EB02 LDA RAM_SpriteXLo,X
W $02:EB04 STA.W RAM_SpriteXLo,Y ; New sprite X low = this sprite's X low
R $02:EDB7 ADC RAM_SpriteXLo,X
W $02:EDB9 STA.W RAM_SpriteXLo,Y ; New X low = this X + offset
R $02:EF85 LDA RAM_SpriteXLo,X
W $02:EF87 STA.W RAM_SpriteXLo,Y ; Copy X low
R $02:EFC1 LDA RAM_SpriteXLo,X
R $02:EFFA LDA RAM_SpriteXLo,X
R $02:F0F9 LDA RAM_SpriteXLo,X
R $02:F202 LDA RAM_SpriteXLo,X
R $02:F2EC LDA RAM_SpriteXLo,X
R $02:F35F LDA RAM_SpriteXLo,X
R $02:F401 LDA RAM_SpriteXLo,X
R $02:F490 LDA RAM_SpriteXLo,X
R $02:F4DA LDA RAM_SpriteXLo,X
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 $02:FBFF STA RAM_SpriteXLo
R $03:8214 LDA RAM_SpriteXLo,X
R $03:8A26 LDA RAM_SpriteXLo,X
R $03:8AE9 LDA RAM_SpriteXLo,X
W $03:8AFD STA.W RAM_SpriteXLo,Y
R $03:8C60 LDA RAM_SpriteXLo,X
R $03:8D87 LDA RAM_SpriteXLo,X
R $03:903C LDA RAM_SpriteXLo,X
R $03:90FB LDA RAM_SpriteXLo,X
R $03:92E6 ORA RAM_SpriteXLo,X
R $03:9345 LDA RAM_SpriteXLo,X
W $03:934B STA RAM_SpriteXLo,X
W $03:9377 STA RAM_SpriteXLo,X ; Store X low
R $03:938D LDA RAM_SpriteXLo,X
W $03:98AD STA RAM_SpriteXLo
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:99C7 SBC RAM_SpriteXLo,X
R $03:9AD6 LDA RAM_SpriteXLo,X
W $03:9AD8 STA.W RAM_SpriteXLo,Y
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:9DC4 LDA RAM_SpriteXLo,X
R $03:9F75 LDA RAM_SpriteXLo,X ; Remember home X low
W $03:A026 STA RAM_SpriteXLo,X ; X low
W $03:A103 STA RAM_SpriteXLo,X ; X low = $D0
R $03:A626 LDA RAM_SpriteXLo,X
W $03:A7BA STA RAM_SpriteXLo,X
W $03:A809 STA.W RAM_SpriteXLo,Y ; Sprite X low
R $03:A8F2 LDA RAM_SpriteXLo,X
W $03:A8F7 STA.W RAM_SpriteXLo,Y
R $03:A921 LDA RAM_SpriteXLo,X ; Mushroom X low
R $03:AA6E LDA RAM_SpriteXLo,X
R $03:AB32 LDA RAM_SpriteXLo,X
R $03:AC6C LDA RAM_SpriteXLo,X
R $03:AC97 LDA RAM_SpriteXLo,X
R $03:AD89 ADC RAM_SpriteXLo,X
R $03:B045 LDA RAM_SpriteXLo,X
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:B766 LDA RAM_SpriteXLo,X
R $03:B778 LDA RAM_SpriteXLo,X
R $03:B7C0 LDA RAM_SpriteXLo,X
R $03:B81C SBC RAM_SpriteXLo,X
R $03:B890 CMP RAM_SpriteXLo,X ; Compare with sprite X low
R $03:C002 LDA RAM_SpriteXLo,X
R $03:C1D5 LDA RAM_SpriteXLo,X
W $03:C1DB STA RAM_SpriteXLo,X ; Store it
W $03:C2F1 STA RAM_SpriteXLo,X
R $03:C476 LDA RAM_SpriteXLo,X
W $03:C808 STA.W RAM_SpriteXLo,Y ; New sprite X low = DATA_03C776[X]
R $03:C9F8 LDA RAM_SpriteXLo,X
R $03:CBD5 LDA RAM_SpriteXLo,X
W $03:CBEA STA.W RAM_SpriteXLo,Y
W $03:CCAB STA RAM_SpriteXLo,X ; X position = DATA_03CC38[pipe number]
R $03:CD0A LDA RAM_SpriteXLo,X
W $03:CD0C STA.W RAM_SpriteXLo,Y ; Copy X low
R $03:DEE6 LDA RAM_SpriteXLo,X ; A = sprite X position (16 bit)
R $07:FC6B LDA RAM_SpriteXLo,X
W $0C:A006 STA RAM_SpriteXLo ; Sprite slot 0 X low = $52
R $0C:A21A LDA RAM_SpriteXLo
W $0C:A273 STA RAM_SpriteXLo
R $0C:A510 LDA RAM_SpriteXLo
R $0C:A6D7 LDA RAM_SpriteXLo

$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:9B2C DEC.W RAM_GameMode
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)
R $00:C5C4 LDA.W RAM_GameMode
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
R $05:8091 LDA.W RAM_GameMode
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:A718 INC.W RAM_GameMode
RW $0C:AB52 INC.W RAM_GameMode
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)
W $0C:CFF3 STA.W RAM_GameMode

$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)

$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)

$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)
R $00:969C ORA.W $0109
R $00:96BE LDA.W $0109 ; A = [$0109]
W $00:96CF STA.W $0109 ; [$0109] = A (level load override)
R $00:971A LDA.W $0109
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
R $00:A096 LDA.W $0109 ; A = [$0109]
R $01:EC33 ORA.W $0109
R $05:B132 LDA.W $0109
W $05:B160 STZ.W $0109 ; Clear [$0109] (intro level flag)
R $05:B186 LDA.W $0109
R $05:D842 LDA.W $0109

$010A

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:8F56 STA.W OAM_ExtendedDispX,Y
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
R $02:9F49 LDA.W OAM_ExtendedDispX,Y
W $02:9F4F STA.W OAM_ExtendedDispX,Y
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:CA8C STA.W OAM_ExtendedDispX,Y
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:A84C STA.W OAM_ExtendedDispX,X
W $0C:A8F9 STA.W OAM_ExtendedDispX,X ; OAM X = slot X position
W $0C:A9B0 STA.W OAM_ExtendedDispX,X
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
W $0C:D4C7 STA.W OAM_ExtendedDispX,X
W $0C:D52C STA.W OAM_ExtendedDispX,X
W $0C:D59E STA.W OAM_ExtendedDispX,X

$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:8F63 STA.W OAM_ExtendedDispY,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:9D2C STA.W OAM_ExtendedDispY,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
R $02:9F52 LDA.W OAM_ExtendedDispY,Y
W $02:9F58 STA.W OAM_ExtendedDispY,Y
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 $03:CA94 STA.W OAM_ExtendedDispY,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:A9C2 STA.W OAM_ExtendedDispY,X
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
W $0C:D4D3 STA.W OAM_ExtendedDispY,X
W $0C:D538 STA.W OAM_ExtendedDispY,X
W $0C:D5AA STA.W OAM_ExtendedDispY,X

$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:9ECF STA.W OAM_ExtendedTile,Y
W $02:9F5D STA.W OAM_ExtendedTile,Y ; Tile $1C (bubble)
W $02:9F7F STA.W OAM_ExtendedTile,Y
W $02:A18E STA.W OAM_ExtendedTile,Y ; OAM tile from ReznorFireTiles
W $02:A1EC STA.W OAM_ExtendedTile,Y
W $02:A243 STA.W OAM_ExtendedTile,Y
W $02:A2A5 STA.W OAM_ExtendedTile,Y ; OAM tile = $AD (baseball)
R $02:A2C6 LDA.W OAM_ExtendedTile,Y
W $02:A2D1 STA.W OAM_ExtendedTile,Y
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:A907 STA.W OAM_ExtendedTile,X
W $0C:A919 STA.W OAM_ExtendedTile,X
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]
W $0C:D5B6 STA.W OAM_ExtendedTile,X

$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:8CAB STA.W OAM_ExtendedProp,Y
W $02:8D35 STA.W OAM_ExtendedProp,Y
W $02:8DC3 STA.W OAM_ExtendedProp,Y
W $02:8E45 STA.W OAM_ExtendedProp,Y
W $02:8EBF STA.W OAM_ExtendedProp,Y
W $02:8F1B STA.W OAM_ExtendedProp,Y
W $02:8F77 STA.W OAM_ExtendedProp,Y
W $02:901D STA.W OAM_ExtendedProp,Y
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
R $02:9A92 LDA.W OAM_ExtendedProp,Y
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:9D38 STA.W OAM_ExtendedProp,Y
W $02:9DFD STA.W OAM_ExtendedProp,Y ; OAM properties from UnusedExSprGfxProp
R $02:9E6E LDA.W OAM_ExtendedProp,Y
W $02:9E75 STA.W OAM_ExtendedProp,Y
W $02:9ED6 STA.W OAM_ExtendedProp,Y
W $02:9F8C STA.W OAM_ExtendedProp,Y
W $02:A196 STA.W OAM_ExtendedProp,Y
W $02:A1F6 STA.W OAM_ExtendedProp,Y
W $02:A201 STA.W OAM_ExtendedProp,Y
R $02:A246 LDA.W OAM_ExtendedProp,Y
W $02:A24D STA.W OAM_ExtendedProp,Y
W $02:A2B2 STA.W OAM_ExtendedProp,Y ; OAM properties = flip bits | $39 (priority 3, palette 4, tile page 1)
R $02:A2D4 LDA.W OAM_ExtendedProp,Y
W $02:A2DB STA.W OAM_ExtendedProp,Y
W $02:A336 STA.W OAM_ExtendedProp,Y
W $02:A39E STA.W OAM_ExtendedProp,Y
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 $03:CAC1 STA.W OAM_ExtendedProp,Y
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:A90C STA.W OAM_ExtendedProp,X
W $0C:A91F STA.W OAM_ExtendedProp,X
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:A9B9 STA.W $0204,X
W $0C:AA2C STA.W $0204,X
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)

$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]
W $0C:CCD9 STA.W $0206,X ; OAM tile = A
W $0C:CE7F STA.W $0206,X ; OAM tile

$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]
W $0C:CCEA STA.W $0207,X ; OAM prop
W $0C:CE84 STA.W $0207,X ; OAM prop

$0208

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)
W $01:E969 STA.W $0208
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 $01:E972 STA.W $0209
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

$020B

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)
R $02:8337 LDA.W $020C,Y
W $02:833A STA.W $020C,X
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
R $02:833D LDA.W $020D,Y
W $02:8340 STA.W $020D,X
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]
R $02:8343 LDA.W $020E,Y
W $02:8346 STA.W $020E,X
R $02:83AF LDA.W $020E,Y
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)
R $02:8349 LDA.W $020F,Y
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

$0240

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]

$0241

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]

$0242

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

$0243

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

$0280

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0281

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0282

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0283

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:8D29 STA.W $029C,X
W $04:F571 STA.W $029C ; OAM sprite 39: X = $48, Y = $78

$029D

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:89B4 STA.W $029E,X
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

$02A0

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)
W $03:AA92 STA.W $02A0
W $04:F577 STA.W $02A0 ; OAM sprite 40: X = $90, Y = $78

$02A1

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

$02A2

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)
W $03:AAA8 STA.W $02A2 ; OAM $02A2 tile
W $04:F583 STA.W $02A2 ; OAM sprite 40: tile $0A, properties $36

$02A3

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

$02A4

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02A5

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02A6

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $03:AAAD STA.W $02A6 ; OAM $02A6 tile

$02A7

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

$02B4

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]

$02B5

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

$02B6

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

$02B7

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)

$02B8

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02B9

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02BA

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02BB

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)

$02BF

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02C3

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02C7

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02CB

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02CF

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02D3

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)

$02FB

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02FC

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02FD

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$02FE

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

$02FF

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
W $0C:D696 STA.W $02FF,Y

$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:8E1C STA.W OAM_DispX,Y
W $01:986A STA.W OAM_DispX,Y
W $01:9D27 STA.W OAM_DispX,Y
W $01:9DAB STA.W OAM_DispX,Y ; Both tiles X = [$00]
W $01:9E67 STA.W OAM_DispX,Y
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:AF6A STA.W OAM_DispX,Y
W $01:B307 STA.W OAM_DispX,Y
W $01:B3F6 STA.W OAM_DispX,Y ; Tile X = A
W $01:B672 STA.W OAM_DispX,Y ; Tile X
W $01:B76F STA.W OAM_DispX,Y
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:C677 STA.W OAM_DispX,Y
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)
R $01:C93F LDA.W OAM_DispX,Y
W $01:D4B5 STA.W OAM_DispX,Y ; OAM X position
W $01:DBAE STA.W OAM_DispX,Y
R $01:DBDA LDA.W OAM_DispX,Y
W $01:DBE0 STA.W OAM_DispX,Y
W $01:DC17 STA.W OAM_DispX,Y
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
R $01:E49B LDA.W OAM_DispX,Y
W $01:E4A0 STA.W OAM_DispX,Y
W $01:E70A STA.W OAM_DispX,Y ; First tile X = sprite X
W $01:E911 STA.W OAM_DispX,Y
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 $01:FF6B STA.W OAM_DispX,Y
W $02:810B STA.W OAM_DispX,Y ; OAM X = $00
W $02:970E STA.W OAM_DispX,Y ; OAM X
W $02:9844 STA.W OAM_DispX,Y ; Sprite 1 X
W $02:99A8 STA.W OAM_DispX,Y ; OAM X
W $02:A064 STA.W OAM_DispX,Y
W $02:A3BE STA.W OAM_DispX,Y ; OAM X (page 2)
W $02:B766 STA.W OAM_DispX,Y
W $02:B914 STA.W OAM_DispX,Y
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:C8DB STA.W OAM_DispX,Y
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:CB0C STA.W OAM_DispX,Y
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
R $02:CF7B LDA.W OAM_DispX,Y
W $02:D5F0 STA.W OAM_DispX,Y ; OAM X
W $02:D7B1 STA.W OAM_DispX,Y ; OAM X
W $02:D81F STA.W OAM_DispX,Y ; OAM X
W $02:D854 STA.W OAM_DispX,Y
W $02:DA04 STA.W OAM_DispX,Y
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
R $02:E028 LDA.W OAM_DispX,Y
W $02:E3DE STA.W OAM_DispX,Y ; Store tile X
W $02:E586 STA.W OAM_DispX,Y
W $02:E643 STA.W OAM_DispX,Y ; Store tile X
W $02:E68A STA.W OAM_DispX,Y
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:EF4A STA.W OAM_DispX,Y ; Store X
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:F4F4 STA.W OAM_DispX,Y
W $02:F5EF STA.W OAM_DispX,Y ; Write X
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)
R $02:FA5F LDA.W OAM_DispX,Y
R $02:FA66 LDA.W OAM_DispX,Y
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:8D3A STA.W OAM_DispX,Y
W $03:8E34 STA.W OAM_DispX,Y
W $03:8EC0 STA.W OAM_DispX,Y
W $03:8F3F STA.W OAM_DispX,Y
W $03:91E2 STA.W OAM_DispX,Y
R $03:9231 ADC.W OAM_DispX,Y
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:96B6 STA.W OAM_DispX,Y
W $03:97D1 STA.W OAM_DispX,Y
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:9E78 STA.W OAM_DispX,Y
W $03:9EE4 STA.W OAM_DispX,Y
W $03:A0C9 STA.W OAM_DispX,Y
W $03:A408 STA.W OAM_DispX,Y
W $03:AADD STA.W OAM_DispX,Y
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
R $03:AFE6 LDA.W OAM_DispX,Y
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:C41A STA.W OAM_DispX,Y
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:CB5B STA.W OAM_DispX,Y
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:8E26 STA.W OAM_DispY,Y
W $01:9879 STA.W OAM_DispY,Y ; Both feet Y = body Y + [$00]
W $01:9D30 STA.W OAM_DispY,Y
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:9E78 STA.W OAM_DispY,Y
W $01:9F34 STA.W OAM_DispY,Y ; OAM Y = [$01]
W $01:9FDC STA.W OAM_DispY,Y
R $01:AD86 LDA.W OAM_DispY,Y
W $01:AD8A STA.W OAM_DispY,Y
R $01:AE68 LDA.W OAM_DispY,Y
W $01:AE6E STA.W OAM_DispY,Y
W $01:AF73 STA.W OAM_DispY,Y
W $01:B2EC STA.W OAM_DispY,Y
W $01:B3AA STA.W OAM_DispY,Y ; Tile 0 Y = A (top row)
W $01:B67B STA.W OAM_DispY,Y ; Tile Y
W $01:B749 STA.W OAM_DispY,Y
R $01:B81B LDA.W OAM_DispY,Y
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:BB90 STA.W OAM_DispY,Y ; Tile 0 Y
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
R $01:C962 LDA.W OAM_DispY,Y
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:DBB7 STA.W OAM_DispY,Y
R $01:DBE3 LDA.W OAM_DispY,Y
W $01:DBE9 STA.W OAM_DispY,Y
W $01:DC20 STA.W OAM_DispY,Y
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
R $01:E47C LDA.W OAM_DispY,Y
W $01:E718 STA.W OAM_DispY,Y ; Both tiles Y = sprite Y + 8 (squashed, lower)
W $01:E91B STA.W OAM_DispY,Y
R $01:EF75 LDA.W OAM_DispY,Y
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 $01:FF74 STA.W OAM_DispY,Y
W $02:8110 STA.W OAM_DispY,Y ; OAM Y = $01
W $02:971B STA.W OAM_DispY,Y ; OAM Y
W $02:9859 STA.W OAM_DispY,Y ; Sprite 1 Y
W $02:993B STA.W OAM_DispY,Y ; Hide the sprite
W $02:99B1 STA.W OAM_DispY,Y ; OAM Y
W $02:A071 STA.W OAM_DispY,Y
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:BC50 STA.W OAM_DispY,Y
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:C8E9 STA.W OAM_DispY,Y
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:CB24 STA.W OAM_DispY,Y
W $02:CB78 STA.W OAM_DispY,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
R $02:CF94 LDA.W OAM_DispY,Y
R $02:CFB2 LDA.W OAM_DispY,Y
W $02:D5F9 STA.W OAM_DispY,Y ; OAM Y
W $02:D7B6 STA.W OAM_DispY,Y ; OAM Y
W $02:D828 STA.W OAM_DispY,Y ; OAM Y
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
R $02:DC81 LDA.W OAM_DispY,Y
W $02:DC87 STA.W OAM_DispY,Y
W $02:DE75 STA.W OAM_DispY,Y ; Store OAM Y
R $02:E037 LDA.W OAM_DispY,Y
W $02:E3F9 STA.W OAM_DispY,Y ; Store tile Y
W $02:E592 STA.W OAM_DispY,Y
W $02:E648 STA.W OAM_DispY,Y ; Tile Y = sprite Y
W $02:E69B STA.W OAM_DispY,Y
W $02:E6FD STA.W OAM_DispY,Y ; Line tile Y = [$18B6]
W $02:E913 STA.W OAM_DispY,Y
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
R $02:EE0C LDA.W OAM_DispY,Y
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:EF52 STA.W OAM_DispY,Y ; Store Y
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:F5F5 STA.W OAM_DispY,Y ; Write Y
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)
R $02:FA6C LDA.W OAM_DispY,Y
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:8D43 STA.W OAM_DispY,Y
W $03:8E3D STA.W OAM_DispY,Y
W $03:8EC9 STA.W OAM_DispY,Y
W $03:8F31 STA.W OAM_DispY,Y ; OAM Y = sprite Y
W $03:9197 STA.W OAM_DispY,Y
R $03:9220 LDA.W OAM_DispY,Y
W $03:9224 STA.W OAM_DispY,Y
R $03:928B LDA.W OAM_DispY,Y
W $03:928F STA.W OAM_DispY,Y
W $03:94F2 STA.W OAM_DispY,Y
W $03:96C0 STA.W OAM_DispY,Y
W $03:97C3 STA.W OAM_DispY,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:9E86 STA.W OAM_DispY,Y
W $03:9EED STA.W OAM_DispY,Y
W $03:A0B7 STA.W OAM_DispY,Y
W $03:A414 STA.W OAM_DispY,Y
W $03:AAE6 STA.W OAM_DispY,Y
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
R $03:AFEC LDA.W OAM_DispY,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:C432 STA.W OAM_DispY,Y
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:CB63 STA.W OAM_DispY,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:9B0C STA.W OAM_Tile,Y
W $01:9D3C STA.W OAM_Tile,Y
W $01:9D92 STA.W OAM_Tile,Y ; Top tile
W $01:9DFC STA.W OAM_Tile,Y
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:A1CC STA.W OAM_Tile,Y
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:D4D4 STA.W OAM_Tile,Y ; OAM tile
W $01:DBC0 STA.W OAM_Tile,Y
W $01:DBF6 STA.W OAM_Tile,Y ; Tile = $C8
W $01:DC29 STA.W OAM_Tile,Y
W $01:DCA2 STA.W OAM_Tile,Y ; Store the tile number
W $01:DF77 STA.W OAM_Tile,Y ; Store it
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
R $01:E488 LDA.W OAM_Tile,Y
W $01:E73A STA.W OAM_Tile,Y
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
R $01:EE8F LDA.W OAM_Tile,Y
W $01:EE98 STA.W OAM_Tile,Y ; Head OAM tile = $06 (fixed VRAM slot for the dynamic head graphics)
R $01:EE9E LDA.W OAM_Tile,Y
W $01:EEA7 STA.W OAM_Tile,Y ; Body OAM tile = $08 (fixed VRAM slot for the dynamic body graphics)
R $01:EFE7 LDA.W OAM_Tile,Y
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]
R $01:FF22 LDA.W OAM_Tile,Y
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:BC65 STA.W OAM_Tile,Y ; Tile 1
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:D5FF STA.W OAM_Tile,Y ; OAM tile
W $02:D7BB STA.W OAM_Tile,Y ; OAM tile
W $02:D82E STA.W OAM_Tile,Y ; OAM tile
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
R $02:EA28 LDA.W OAM_Tile,Y
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:EF2F STA.W OAM_Tile,Y ; Tile $60
W $02:EF57 STA.W OAM_Tile,Y ; Tile $4D
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]
R $02:FA72 LDA.W OAM_Tile,Y
W $02:FD73 STA.W OAM_Tile,Y ; OAM tile
W $02:FDAE STA.W OAM_Tile,Y ; OAM tile
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:88B2 STA.W OAM_Tile,Y
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:8E49 STA.W OAM_Tile,Y
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:A0D4 STA.W OAM_Tile,Y
W $03:A41C STA.W OAM_Tile,Y
W $03:AAEC STA.W OAM_Tile,Y ; OAM tile
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)
R $03:AFF2 LDA.W OAM_Tile,Y
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:B4D6 STA.W OAM_Tile,Y ; Tile $08
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 $00:E3D2 STA.W OAM_Prop,Y
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:9A6E STA.W OAM_Prop,Y
W $01:9A73 STA.W OAM_Prop,Y
W $01:9D4B STA.W OAM_Prop,Y
W $01:9DC0 STA.W OAM_Prop,Y ; Properties = A | layer priority [$64] for both tiles
W $01:9E86 STA.W OAM_Prop,Y
W $01:9F48 STA.W OAM_Prop,Y
R $01:A20F LDA.W OAM_Prop,Y
W $01:A214 STA.W OAM_Prop,Y
W $01:AF7B STA.W OAM_Prop,Y
W $01:B35E STA.W OAM_Prop,Y
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:BD79 STA.W OAM_Prop,Y
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]
R $01:C68F LDA.W OAM_Prop,Y
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:DBFE STA.W OAM_Prop,Y
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)
R $01:E482 LDA.W OAM_Prop,Y
W $01:E746 STA.W OAM_Prop,Y
W $01:E937 STA.W OAM_Prop,Y ; Puff properties = [$64]
R $01:F093 LDA.W OAM_Prop,Y
W $01:F098 STA.W OAM_Prop ; OAM slot 0 properties = Yoshi's, palette bit 0 set
R $01:F7B3 LDA.W OAM_Prop,Y
W $01:F7BA STA.W OAM_Prop,Y ; OAM properties = ([prop] & $FE) | [$00]
R $01:FA2A LDA.W OAM_Prop,Y
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 $01:FF8A STA.W OAM_Prop,Y
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:A08E STA.W OAM_Prop,Y
W $02:A099 STA.W OAM_Prop,Y
W $02:A3E6 STA.W OAM_Prop,Y
W $02:B798 STA.W OAM_Prop,Y
W $02:B925 STA.W OAM_Prop,Y ; Both tiles' properties = DATA_02B8F5[direction] | [$02]
W $02:BC7F STA.W OAM_Prop,Y
W $02:BE74 STA.W OAM_Prop,Y ; OAM properties = table | priority [$64]
R $02:BE86 EOR.W OAM_Prop,Y
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:CB2F STA.W OAM_Prop,Y
W $02:CB84 STA.W OAM_Prop,Y
W $02:CBDC STA.W OAM_Prop,Y
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:D8D4 STA.W OAM_Prop,Y
W $02:DA1C STA.W OAM_Prop,Y ; Store OAM properties
W $02:DA2B STA.W OAM_Prop,Y
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:DE88 STA.W OAM_Prop,Y
R $02:E019 LDA.W OAM_Prop,Y
W $02:E020 STA.W OAM_Prop,Y ; Store properties for tile 1
R $02:E251 LDA.W OAM_Prop,Y
W $02:E256 STA.W OAM_Prop,Y
W $02:E405 STA.W OAM_Prop,Y ; Tile properties
W $02:E5A5 STA.W OAM_Prop,Y
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:E928 STA.W OAM_Prop,Y
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]
R $02:FA78 LDA.W OAM_Prop,Y
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
R $03:84EC LDA.W OAM_Prop,Y
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:8D51 STA.W OAM_Prop,Y
W $03:8E51 STA.W OAM_Prop,Y
W $03:8ED6 STA.W OAM_Prop,Y
W $03:8F58 STA.W OAM_Prop,Y ; OAM properties = A | [$64]
R $03:9015 LDA.W OAM_Prop,Y
W $03:901C STA.W OAM_Prop,Y
W $03:91C6 STA.W OAM_Prop,Y ; OAM properties = A
R $03:9297 LDA.W OAM_Prop,Y
W $03:929C STA.W OAM_Prop,Y
W $03:94FE STA.W OAM_Prop,Y ; OAM properties = WoodSpikeGfxProp[X]
W $03:96D0 STA.W OAM_Prop,Y
W $03:97D9 STA.W OAM_Prop,Y
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:9E6F STA.W OAM_Prop,Y
W $03:9F18 STA.W OAM_Prop,Y ; Store OAM property
R $03:A079 LDA.W OAM_Prop,Y
W $03:A07E STA.W OAM_Prop,Y
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]
R $03:AFF8 LDA.W OAM_Prop,Y
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)
R $03:C24C LDA.W OAM_Prop,Y
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:C423 STA.W OAM_Prop,Y
W $03:C4CA STA.W OAM_Prop,Y ; OAM properties = DATA_03C49C[X]
W $03:C9AC STA.W OAM_Prop,Y
W $03:CB90 STA.W OAM_Prop,Y
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:9870 STA.W OAM_Tile2DispX,Y
W $01:9DAE STA.W OAM_Tile2DispX,Y
W $01:A406 STA.W OAM_Tile2DispX,X ; Tile 2 X = $80 (off screen)
W $01:B30D STA.W OAM_Tile2DispX,Y
W $01:B776 STA.W OAM_Tile2DispX,Y
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
R $01:C92F LDA.W OAM_Tile2DispX,Y
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
R $01:E4A4 LDA.W OAM_Tile2DispX,Y
W $01:E4A9 STA.W OAM_Tile2DispX,Y
W $01:E710 STA.W OAM_Tile2DispX,Y
W $02:984D STA.W OAM_Tile2DispX,Y ; Sprite 2 X
W $02:B91D STA.W OAM_Tile2DispX,Y
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:CB13 STA.W OAM_Tile2DispX,Y
W $02:CCDD STA.W OAM_Tile2DispX,Y ; Lower tile X position (same as the upper tile)
W $02:E58C STA.W OAM_Tile2DispX,Y
W $02:E693 STA.W OAM_Tile2DispX,Y ; Bait X
R $02:E6CD SBC.W OAM_Tile2DispX,Y
W $02:E90D STA.W OAM_Tile2DispX,Y
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)
R $02:F22B LDA.W OAM_Tile2DispX,Y
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
R $03:B26E LDA.W OAM_Tile2DispX,Y
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
W $03:C97E STA.W OAM_Tile2DispX,Y

$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)
R $01:8FAF LDA.W OAM_Tile2DispY,Y
W $01:8FB5 STA.W OAM_Tile2DispY,Y ; Tile 2 Y -= 3 (raise the second tile while throwing)
W $01:987C STA.W OAM_Tile2DispY,Y
W $01:9DA6 STA.W OAM_Tile2DispY,Y
W $01:9E0A STA.W OAM_Tile2DispY,Y
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:B750 STA.W OAM_Tile2DispY,Y
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:C151 STA.W OAM_Tile2DispY,Y
W $01:C682 STA.W OAM_Tile2DispY,Y ; Store tile 2 Y
R $01:C92A LDA.W OAM_Tile2DispY,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 $01:E71B STA.W OAM_Tile2DispY,Y
W $02:985C STA.W OAM_Tile2DispY,Y ; Sprite 2 Y
W $02:B8FF STA.W OAM_Tile2DispY,Y
W $02:BC53 STA.W OAM_Tile2DispY,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:E6A4 STA.W OAM_Tile2DispY,Y
R $02:E6DA SBC.W OAM_Tile2DispY,Y
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
R $02:F1B7 LDA.W OAM_Tile2DispY,Y
R $02:F1DA LDA.W OAM_Tile2DispY,Y
R $02:F237 LDA.W OAM_Tile2DispY,Y
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
R $03:B278 LDA.W OAM_Tile2DispY,Y
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:988F STA.W OAM_Tile2,Y
W $01:9D98 STA.W OAM_Tile2,Y ; Bottom tile
W $01:9DF6 STA.W OAM_Tile2,Y
W $01:B334 STA.W OAM_Tile2,Y
W $01:B34B STA.W OAM_Tile2,Y
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:DF7D STA.W OAM_Tile2,Y ; Store it
W $01:E257 STA.W OAM_Tile2,Y ; Bottom tile = $FB
W $01:E48C STA.W OAM_Tile2,Y
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:BC6B STA.W OAM_Tile2,Y ; 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:E016 STA.W OAM_Tile2,Y
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:9C1E STA.W OAM_Tile2,Y
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 $00:E3D5 STA.W OAM_Tile2Prop,Y
W $01:9897 STA.W OAM_Tile2Prop,Y
W $01:9DC3 STA.W OAM_Tile2Prop,Y
W $01:B361 STA.W OAM_Tile2Prop,Y
W $01:B793 STA.W OAM_Tile2Prop,Y ; Tile 1 properties
W $01:BD7C STA.W OAM_Tile2Prop,Y
W $01:C168 STA.W OAM_Tile2Prop,Y
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:B928 STA.W OAM_Tile2Prop,Y
W $02:BC82 STA.W OAM_Tile2Prop,Y ; Same properties for all three tiles
W $02:CA7D STA.W OAM_Tile2Prop,Y
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
R $02:DEF3 LDA.W OAM_Tile2Prop,Y
W $02:DEF8 STA.W OAM_Tile2Prop,Y
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)
W $00:91F7 STA.W OAM_Tile3DispX,Y
R $01:9843 LDA.W OAM_Tile3DispX,Y ; A = timer / 2: carry = timer bit 0
W $01:984A STA.W OAM_Tile3DispX,Y
R $01:9864 LDA.W OAM_Tile3DispX,Y
W $01:B313 STA.W OAM_Tile3DispX,Y
W $01:B761 STA.W OAM_Tile3DispX,Y
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 $02:E02E STA.W OAM_Tile3DispX,Y
R $03:B289 LDA.W OAM_Tile3DispX,Y
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
R $01:9873 LDA.W OAM_Tile3DispY,Y
W $01:B2F2 STA.W OAM_Tile3DispY,Y
W $01:B3AD STA.W OAM_Tile3DispY,Y ; Tile 2 Y = A (top row)
W $01:B73B STA.W OAM_Tile3DispY,Y
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
R $03:B293 LDA.W OAM_Tile3DispY,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 $01:DF83 STA.W OAM_Tile3,Y ; Store it
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:BC71 STA.W OAM_Tile3,Y ; Tile 3
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:8E8D LDA.W OAM_Tile3Prop,Y
W $01:8E94 STA.W OAM_Tile3Prop,Y
R $01:9A47 EOR.W OAM_Tile3Prop,Y ; Toggle X flip of the third OAM slot
W $01:9A4A STA.W OAM_Tile3Prop,Y
W $01:B364 STA.W OAM_Tile3Prop,Y
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:C16B STA.W OAM_Tile3Prop,Y
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 $02:BC85 STA.W OAM_Tile3Prop,Y
W $02:E05B STA.W OAM_Tile3Prop,Y
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:B31D STA.W OAM_Tile4DispX,Y
W $01:B768 STA.W OAM_Tile4DispX,Y
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
W $02:E034 STA.W OAM_Tile4DispX,Y

$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:B2F9 STA.W OAM_Tile4DispY,Y
W $01:B3C3 STA.W OAM_Tile4DispY,Y ; Tile 3 Y = A (bottom row)
W $01:B742 STA.W OAM_Tile4DispY,Y
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:B33A STA.W OAM_Tile4,Y
W $01:B351 STA.W OAM_Tile4,Y
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 $01:DF89 STA.W OAM_Tile4,Y ; Store it
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 $00:E3D8 STA.W OAM_Tile4Prop,Y
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:B323 STA.W $0310,Y
W $01:B758 STA.W $0310,Y
W $01:BB76 STA.W $0310,Y ; Tile 4 X
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:B732 STA.W $0311,Y
W $01:BB9F STA.W $0311,Y ; Tile 4 Y
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 $00:E3DB STA.W $0313,Y
W $01:B36A STA.W $0313,Y
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]
W $03:91FC STA.W $0313,Y

$0314

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $01:BB79 STA.W $0314,Y ; Tile 5 X

$0315

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)
W $01:BBAB STA.W $0315,Y ; Tile 5 Y

$0317

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

$0318

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $01:BB85 STA.W $0318,Y ; Tile 6 X

$0319

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)
W $01:BB96 STA.W $0319,Y ; Tile 6 Y

$031C

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $01:BB88 STA.W $031C,Y ; Tile 7 X

$031D

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)
W $01:BBA2 STA.W $031D,Y ; Tile 7 Y

$0320

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $01:BB8B STA.W $0320,Y ; Tile 8 X

$0321

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)
W $01:BBAE STA.W $0321,Y ; Tile 8 Y

$0323

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)

$0327

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
W $0C:D734 STA.W $0340,Y
W $0C:D778 STA.W $0340,Y

$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
W $0C:D740 STA.W $0341,Y
W $0C:D77D STA.W $0341,Y

$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 $04:F36C STA.W $0343,Y
W $0C:D74B STA.W $0343,Y ; OAM properties = [$02]
W $0C:D773 STA.W $0343,Y ; OAM properties = $21

$0350

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)

$0351

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)

$0352

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

$0353

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:CB98 STA.W $0380,X ; OAM X
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:CBDD STA.W $0381,X ; OAM Y = $6F
W $0C:CC0F STA.W $0381,X ; OAM Y = [$01]
W $0C:D858 STA.W $0381 ; OAM Y = A

$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:CBEA STA.W $0382,X ; OAM tile
W $0C:CC15 STA.W $0382,X ; OAM tile = DATA_0CCB7C[Y]
W $0C:D861 STZ.W $0382 ; OAM tile = 0

$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

$03E0

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

$03E1

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$03E2

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

$03E3

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)

$03EC

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$03ED

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$03EE

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$03EF

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

$0401

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)
R $00:84A8 ORA.W $0420,X
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:9D41 STA.W $0420,Y
W $02:9D56 STA.W $0420,Y ; Size = 16x16 (overrides the 8x8 just set)
W $02:9E11 STA.W $0420,Y
W $02:9E7E STA.W $0420,Y
W $02:9EDF STA.W $0420,Y
W $02:9F95 STA.W $0420,Y
W $02:A19F STA.W $0420,X
W $02:A20A STA.W $0420,Y
W $02:A2BB STA.W $0420,Y ; Size = 0 (8x8)
W $02:A33F STA.W $0420,X
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:B525 STA.W $0420,Y ; Size = 16x16
W $03:CACC STA.W $0420,Y
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:A929 STA.W $0420,X
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:D098 STZ.W $0420,X
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
W $0C:D553 STZ.W $0420,X
W $0C:D5C2 STZ.W $0420,X

$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)

$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)
R $00:849E ORA.W $0422,X
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)
R $00:8499 LDA.W $0423,X
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

$0424

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 read)

$0425

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 read)

$0426

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 read)

$0427

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 read)

$0430

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

$0440

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)

$0441

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0442

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0443

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0447

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)
W $04:86E1 STZ.W $0447
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 $03:AAC0 STA.W $0448 ; OAM $0448 size
W $04:86E4 STZ.W $0448
W $04:F58D STA.W $0448 ; OAM size bit for sprite 40: large

$0449

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)

$044A

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$044B

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$044C

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$044D

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)

$044E

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$044F

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0450

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0451

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0452

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0453

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0454

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0455

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)

$0456

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$045F

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:9F54 STA.W OAM_TileSize,Y
W $01:A3EB STA.W OAM_TileSize,Y ; OAM high bit for tile 1 = 1 (X bit 8, pushes it off screen)
R $01:B7E6 LDA.W OAM_TileSize,X
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)
R $01:B811 LDA.W OAM_TileSize,X
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:E754 STA.W OAM_TileSize,Y
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:A0A2 STA.W OAM_TileSize,Y
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:8E5C STA.W OAM_TileSize,Y
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
R $03:B003 LDA.W OAM_TileSize,Y
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:CB9B STA.W OAM_TileSize,Y
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
W $0C:A1A3 STA.W OAM_TileSize,X

$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:98A3 STA.W $0461,Y
W $01:9DD2 STA.W $0461,Y
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 $00:920F STA.W $0462,Y
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

$0464

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)

$0465

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $01:BC0E STA.W $0465,Y ; Hide tile 5

$0466

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)

$0467

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $01:BC16 STA.W $0467,Y ; Hide tile 7

$0468

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $01:BC19 STA.W $0468,Y ; Hide tile 8

$0470

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
W $0C:D6F6 STA.W $0470,Y

$0474

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)

$0498

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)

$049B

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:926A STA.W $04A0,X
W $00:9291 STZ.W $04A0,X ; Left edge of this line = $00
W $00:92B4 STA.W $04A0
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:CAAA STA.W $04A0,Y
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:926D STZ.W $04A1,X
W $00:9296 STA.W $04A1,X ; Right edge = $FF: the line is fully covered by the window
W $00:92F8 STA.W $04A1,X
W $00:A188 STA.W $04A1,X ; [$04A1+X] = $FF
W $00:CAA2 STZ.W $04A1,X
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

$04A3

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

$04A4

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)

$04A6

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

$04A7

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]

$04A9

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$04AA

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$04AD

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

$04B0

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

$04B3

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$04B4

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

$04B7

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

$04BA

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

$04BD

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)

$04EC

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)

$04EE

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$04F0

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)

$04F1

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

$053C

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)

$0548

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

$057E

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

$0598

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)
R $00:A4D4 LDA.W $0680
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)
R $00:B041 LDA.W $0680
W $04:DBC1 STA.W $0680 ; [$0680] = 6
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)
R $01:C047 LDX.W $0681 ; X = [$0681]
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
R $03:8265 LDX.W $0681 ; X = [$0681]
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)
W $0C:ABB6 STA.W $0682

$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
W $0C:ABBE STA.W $0683

$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:DFD8 STZ.W $0684,X
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

$0690

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:93DA STZ.W $0701
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:AC3E STA.W $0701
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)
R $00:AF88 LDA.W $0701
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 $04:F48B STZ.W $0701 ; Clear $0701
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:922F STZ.W $0703
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)
W $04:DBB4 STA.W $0703 ; [$0703] = $FE
R $04:EA6A LDA.W $0703,X ; A = palette mirror byte [$0703+X]

$0704

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)

$0707

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$071B

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

$071D

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

$0753

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 read)

$0754

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 $00:B024 LDA.W $0783,X
R $04:EA7A LDA.W $0783,X ; A = palette byte [$0783+X]

$0803

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0807

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)

$0823

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

$0827

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

$08A7

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

$08C7

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

$08E7

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

$0903

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
R $00:AF53 LDA.W $0905,X
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)
R $00:B012 LDA.W $0907,X
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)

$091F

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $00:AF74 LDA.W $091F,X
W $00:AF81 STA.W $091F,X ; Store the new color in the DMA list

$0977

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)

$0979

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]

$09E9

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)

$0A05

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

$0A11

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

$0A25

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $00:B06D LDA.W $0A25,X
W $00:B07A STA.W $0A25,X ; Store the new color in the second list

$0AF5

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
R $04:817D LDA.W $0AF6,X
R $04:8183 LDA.W $0AF6,X
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]
W $0C:A8C3 STA.W $0AF6,X ; Gravity = 1

$0AFD

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)
R $0C:A317 LDA.W $0B05,X
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]
R $0C:A5E5 LDA.W $0B05,X
W $0C:A5EF STA.W $0B05,X
R $0C:A721 LDA.W $0B05,X
R $0C:A730 LDA.W $0B05,X
R $0C:A8A5 LDA.W $0B05,X
W $0C:A8AC STA.W $0B05,X
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
W $0C:CDC8 STA.W $0B05,X
R $0C:CE06 LDA.W $0B05,X ; A = actor 1 Y speed
W $0C:D0E7 STA.W $0B05,X
W $0C:D14C STA.W $0B05,X
R $0C:D33A LDA.W $0B05,X
R $0C:D349 LDA.W $0B05,X
W $0C:D3C8 STA.W $0B05,X ; Y speed = DATA_0CD386[X] (initial upward speed)
R $0C:D3FB LDA.W $0B05,X ; A = Y speed
W $0C:D408 STA.W $0B05,X
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)

$0B07

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)

$0B08

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0B09

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

$0B0A

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0B0B

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

$0B0C

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)
R $0C:A65D LDA.W $0B14,X
W $0C:A663 STA.W $0B14,X
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:CD98 STA.W $0B14,X
W $0C:D151 STA.W $0B14,X
W $0C:D3CE STA.W $0B14,X ; X speed = DATA_0CD396[X]
W $0C:D568 STA.W $0B14,X ; Object 3 X speed = 6

$0B16

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)
W $0C:A056 STZ.W $0B23,X
R $0C:A729 ADC.W $0B23,X ; Y subpixel [$0B23+X] += fraction; carry kept for the position add
W $0C:A72C STA.W $0B23,X
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
W $0C:D345 STA.W $0B23,X
W $0C:D373 STZ.W $0B23

$0B24

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
W $0C:A3E0 STZ.W $0B32
W $0C:D376 STZ.W $0B32

$0B33

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)

$0B34

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)
W $0C:D382 STZ.W $0B34

$0B36

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

$0B39

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
R $0C:A323 LDA.W $0B41,X
W $0C:A331 STA.W $0B41,X ; Y position = $9F
W $0C:A417 STA.W $0B41,X ; Actor X Y position = DATA_0CA3BB[Y]
R $0C:A622 LDA.W $0B41,Y
R $0C:A62F LDA.W $0B41,Y
R $0C:A741 ADC.W $0B41,X
W $0C:A744 STA.W $0B41,X ; Y position low [$0B41+X] += integer part + carry
R $0C:A8B2 LDA.W $0B41,X
W $0C:A8C8 STA.W $0B41,X ; Y position = floor
R $0C:A8F0 LDA.W $0B41,Y
W $0C:CD31 STA.W $0B41,X ; Actor 0 Y position (low) = screen Y scroll (low)
R $0C:CD4B LDA.W $0B41,X
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
W $0C:CDBD STA.W $0B41,X
R $0C:CDCE LDA.W $0B41,X
R $0C:CDDF LDA.W $0B41,X
R $0C:CDEF LDA.W $0B41,X
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:CE21 SBC.W $0B41
R $0C:CE38 SBC.W $0B41
W $0C:D0DD STA.W $0B41,X
R $0C:D0ED LDA.W $0B41,X
W $0C:D137 STA.W $0B41,X
R $0C:D15A LDA.W $0B41,X ; Screen scroll = actor 0 position
R $0C:D35A ADC.W $0B41,X
W $0C:D35D STA.W $0B41,X ; Y position += pixel movement + carry
W $0C:D3DE STA.W $0B41,X
R $0C:D411 LDA.W $0B41,X
R $0C:D438 LDA.W $0B41,Y
R $0C:D50C LDA.W $0B41,X

$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)
R $0C:A367 LDA.W $0B42
R $0C:A383 LDA.W $0B42
R $0C:A3A5 LDA.W $0B42
W $0C:A400 STA.W $0B42 ; Actor 1 Y position = $9F
R $0C:A44B LDA.W $0B42
R $0C:A6DB LDA.W $0B42 ; $00 = Yoshi sprite X low, $02 = [$0B42] (probably the tall sprite Y)
R $0C:CE76 LDA.W $0B42
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:CEB2 LDA.W $0B43
R $0C:CEFF LDA.W $0B43 ; A = Y position of the object
R $0C:CF58 LDA.W $0B43
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
R $0C:D52F LDA.W $0B43
R $0C:D53B LDA.W $0B43

$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)

$0B45

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

$0B46

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0B47

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

$0B48

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
R $0C:A22F LDA.W $0B50
R $0C:A257 LDA.W $0B50,X
R $0C:A26D LDA.W $0B50
R $0C:A290 LDA.W $0B50
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]
R $0C:A629 LDA.W $0B50,Y
R $0C:A669 LDA.W $0B50,X
R $0C:A6EB LDA.W $0B50
R $0C:A8EB LDA.W $0B50,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
R $0C:CBC9 LDA.W $0B50
W $0C:D141 STA.W $0B50,X
R $0C:D164 LDA.W $0B50,X
W $0C:D321 STA.W $0B50 ; Object 0 X position = $5F
W $0C:D3D6 STA.W $0B50,X
R $0C:D42E LDA.W $0B50,Y
R $0C:D576 LDA.W $0B50,X

$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:CA61 STA.W $0B51
W $0C:CAD8 STA.W $0B51 ; Object Y [$0B51] = $98 (start height)
R $0C:CAE2 LDA.W $0B51
R $0C:CB02 LDA.W $0B51

$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
R $0C:CF52 LDA.W $0B52
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:A584 STA.W $0B53
W $0C:D55F STZ.W $0B53 ; Inactive: clear object 3 X and Y positions
R $0C:D595 LDA.W $0B53
R $0C:D5AD LDA.W $0B53

$0B54

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0B55

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

$0B56

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

$0B57

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 read)

$0B5B

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:A069 STZ.W $0B5F,X ; $0B5F[X] = 0
W $0C:A41A STZ.W $0B5F,X ; Actor Y position high byte = 0
R $0C:A61D LDA.W $0B5F,Y
R $0C:A748 ADC.W $0B5F,X ; Y position high [$0B5F+X] += sign byte + carry
W $0C:A74B STA.W $0B5F,X
W $0C:CD36 STA.W $0B5F,X ; Actor 0 Y position (high) = screen Y scroll (high)
R $0C:CD46 LDA.W $0B5F,X
W $0C:CDC2 STA.W $0B5F,X
R $0C:CDDA LDA.W $0B5F,X ; Screen Y scroll = actor 0 Y position
W $0C:D0E2 STA.W $0B5F,X
R $0C:D102 LDA.W $0B5F,X
W $0C:D13C STA.W $0B5F,X
R $0C:D15F LDA.W $0B5F,X
R $0C:D361 ADC.W $0B5F,X ; Y position high byte += sign extension + carry
W $0C:D364 STA.W $0B5F,X

$0B61

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

$0B62

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0B63

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0B64

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0B65

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:A072 STZ.W $0B6E,X ; $0B6E[X] = 0
R $0C:A237 LDA.W $0B6E
R $0C:A25C LDA.W $0B6E,X
R $0C:A275 LDA.W $0B6E
R $0C:A298 LDA.W $0B6E
W $0C:A3DD STA.W $0B6E
W $0C:A42E STA.W $0B6E,X ; Actor X position high byte = 1
R $0C:A618 LDA.W $0B6E,Y
R $0C:A6F3 LDA.W $0B6E
R $0C:A8E6 LDA.W $0B6E,Y
W $0C:D146 STA.W $0B6E,X
R $0C:D169 LDA.W $0B6E,X

$0B70

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

$0B71

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0B72

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0B73

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0B74

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

$0B75

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 read)

$0B7D

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

$0BF6

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]
R $00:A405 LDA.W $0D76
W $05:BB99 STA.W $0D76,X ; Source address for the NMI tile DMA ([$0D76] + X)

$0D78

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]

$0D7A

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]

$0D7C

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $00:A3D2 LDA.W $0D7C
W $05:BB62 STA.W $0D7C ; [$0D7C] = VRAM destination of tile 1

$0D7E

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $00:A3BB LDA.W $0D7E
W $05:BB5C STA.W $0D7E ; [$0D7E] = VRAM destination of tile 2

$0D80

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $00:A3A4 LDA.W $0D80
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)

$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
R $00:A304 LDY.W $0D84
R $00:A368 CPX.W $0D84
R $00:A388 CPX.W $0D84
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)

$0D85

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $00:A355 LDA.W $0D85,X
W $00:F64C STA.W $0D85 ; [$0D85] = DMA source for Mario graphics part 1

$0D87

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

$0D89

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 $01:EEB7 STA.W $0D8B
W $02:EA41 STA.W $0D8B ; Dynamic graphics source, first row = A (probably used by NMI DMA)

$0D8D

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

$0D8F

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)

$0D91

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0D93

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

$0D97

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

$0D99

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $00:A339 LDA.W $0D99
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:81C6 LDA $0D9B
R $00:81DE LDA $0D9B
R $00:81EC LDA $0D9B
R $00:8275 LDA $0D9B
R $00:82DA BIT.W $0D9B
R $00:82E2 LDA.W $0D9B
R $00:8345 LDA.W $0D9B
R $00:835E BIT.W $0D9B
R $00:8387 LDY.W $0D9B ; Y = [$0D9B] (special level mode)
R $00:83BA BIT.W $0D9B
R $00:8E21 LDA.W $0D9B
R $00:907B BIT.W $0D9B ; V = [$0D9B] bit 6 (Mode 7 boss room)
R $00:9082 LDA.W $0D9B
R $00:9286 LDA.W $0D9B
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:98A9 LDA.W $0D9B ; A = [$0D9B]
R $00:994B LDA.W $0D9B ; A = [$0D9B]
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:A28A LDA.W $0D9B
R $00:A5AF LDA.W $0D9B
R $00:CCE0 LDA.W $0D9B
R $00:CCE8 BIT.W $0D9B
R $00:F8F5 BIT.W $0D9B ; Test [$0D9B] (V = bit 6)
R $01:9202 BIT.W $0D9B
R $01:A817 BIT.W $0D9B ; Boss room mode 7 ([$0D9B] bit 6): skip the layer test
R $01:C3F3 LDA.W $0D9B
R $01:C3FA BIT.W $0D9B
R $01:C624 LDA.W $0D9B
R $01:C62B BIT.W $0D9B
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:97A8 LDA.W $0D9B ; A = [$0D9B]
R $02:992C BIT.W $0D9B ; Test [$0D9B] bit 6 (boss room)
R $02:995A LDA.W $0D9B ; A = [$0D9B]
R $02:A032 LDA.W $0D9B
R $02:A178 LDA.W $0D9B
R $02:A359 LDA.W $0D9B
R $02:A57C LDA.W $0D9B
R $02:A585 LDA.W $0D9B
R $02:A75A LDA.W $0D9B
R $02:ADA4 BIT.W $0D9B ; Bit 6 of [$0D9B]: Mode 7 boss room
R $02:ADA9 LDA.W $0D9B
R $02:AE9E BIT.W $0D9B ; Mode 7 boss room flag [$0D9B] bit 6?
R $03:D970 BIT.W $0D9B
R $03:DF00 LDA.W $0D9B
W $05:851D STA.W $0D9B ; [$0D9B] = special level type from SpecialLevTable (80/C0/C1 = boss rooms)

$0D9D

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $05:8105 LDA.W $0D9D
W $05:8509 STA.W $0D9D ; TM mirror [$0D9D] = main screen layers from LevMainScrnTbl

$0D9E

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $05:810E LDA.W $0D9E
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)
R $00:8289 LDY $0D9F
R $00:82B6 LDA.W $0D9F
R $00:8351 LDA.W $0D9F
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:C5CE STZ.W $0D9F ; Turn off 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)

$0DA0

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
R $00:866F AND.W $0DA2
R $00:86AD ORA.W $0DA2,X

$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
R $00:8697 AND.W $0DA3
R $00:A24E LDA.W $0DA3

$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:865C AND.W $0DA4
R $00:86A8 LDA.W $0DA4,X
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
R $00:8684 AND.W $0DA5

$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 $00:86BC ORA.W RAM_OWControllerA,X
R $04:8246 LDA.W RAM_OWControllerA,X ; Read the player's overworld controller
R $04:F513 LDA.W RAM_OWControllerA
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 $00:A249 BIT.W $0DA7
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)
R $00:86B7 LDA.W $0DA8,X
R $00:86C1 LDA.W $0DA8,X
R $04:8366 LDA.W $0DA8

$0DA9

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
R $04:8369 ORA.W $0DA9

$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)
R $00:866C EOR.W $0DAA
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)
R $00:8694 EOR.W $0DAB
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)
R $00:8659 EOR.W $0DAC
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)
R $00:8681 EOR.W $0DAD
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)
R $00:8283 LDY $0DAE
R $00:82B0 LDA.W $0DAE
R $00:834B LDA.W $0DAE
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:9F53 STA.W $0DAE ; Save it
W $00:C9F8 STZ.W $0DAE ; Screen brightness [$0DAE] = 0
R $04:9E2F LDA.W $0DAE
W $04:9E37 STA.W $0DAE

$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:9F5E LDA.W $0DAF
W $00:9F63 STA.W $0DAF
R $00:9F77 LDY.W $0DAF ; Y = fade direction [$0DAF]
W $00:C9FB STZ.W $0DAF ; [$0DAF] = 0
R $04:9E2C LDX.W $0DAF ; X = [$0DAF]: fade direction (0 = in, 1 = out)
R $04:9E43 LDA.W $0DAF
W $04:9E48 STA.W $0DAF

$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]
W $00:9F49 STA.W $0DB0 ; Save it
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)
W $00:C9ED STX.W $0DB0 ; [$0DB0] = $F0

$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:8FF1 STA.W $0DB1 ; [$0DB1] = 2
W $04:91DD STA.W $0DB1 ; [$0DB1] = 2 (fade speed)
RW $04:9DBC DEC.W $0DB1
W $04:9DC3 STA.W $0DB1 ; Timer [$0DB1] = 2
W $04:9E16 STA.W $0DB1 ; Timer [$0DB1] = 2
RW $04:9E22 DEC.W $0DB1
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:828A LDY.W $0DB2
R $04:873B LDA.W $0DB2
R $04:9D9A LDA.W $0DB2 ; A = [$0DB2] (2 player game flag)
R $04:DBDD LDA.W $0DB2

$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:8EEF LDA.W $0DB3
R $00:8F5B LDX.W $0DB3 ; X = current player [$0DB3]
R $00:8F86 LDX.W $0DB3 ; X = current player [$0DB3]
R $00:8FC8 LDA.W $0DB3
R $00:91D8 LDA.W $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 $00:E317 ORA.W $0DB3
R $01:E2F3 LDY.W $0DB3
R $01:EC29 LDY.W $0DB3
R $02:8758 LDA.W $0DB3
R $02:875C ADC.W $0DB3 ; X = [$0DB3] * 3: score offset of the current player
R $02:AE12 LDA.W $0DB3
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:8509 LDY.W $0DB3
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:8E3A LDX.W $0DB3
R $04:8E57 LDA.W $0DB3
R $04:91B5 LDX.W $0DB3 ; X = [$0DB3] (current player)
R $04:9334 LDA.W $0DB3
R $04:9D9F LDA.W $0DB3
R $04:9DD1 LDA.W $0DB3
W $04:9DD6 STA.W $0DB3
R $04:9E08 LDX.W $0DB3
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)
R $05:CCB1 LDA.W $0DB3
R $05:CED1 LDA.W $0DB3
R $05:CF12 LDX.W $0DB3
R $05:DC03 LDA.W $0DB3

$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)
R $00:976F LDA.W RAM_PlayerLives
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:91BE LDA.W RAM_PlayerLives,X
R $04:9DA5 LDA.W RAM_PlayerLives,X
R $04:9DE0 LDA.W RAM_PlayerLives,X
R $04:F417 LDA.W RAM_PlayerLives
R $04:F520 LDA.W RAM_PlayerLives,X
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?
W $00:9E1E STA.W $0DB5 ; [$0DB5] = $FF
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
R $04:91B8 LDA.W RAM_PlayerCoins,X
R $04:9DDA LDA.W RAM_PlayerCoins,X

$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
R $04:91C4 LDA.W RAM_PlayerPowerUp,X
R $04:9DE6 LDA.W RAM_PlayerPowerUp,X

$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
R $04:824D LDA.W RAM_PlyrYoshiColor,X
W $04:825E STA.W RAM_PlyrYoshiColor,X
R $04:8955 LDA.W RAM_PlyrYoshiColor,Y
R $04:91C9 LDA.W RAM_PlyrYoshiColor,X
R $04:9DEB LDA.W RAM_PlyrYoshiColor,X

$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)

$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)
R $00:8F3B LDA.W RAM_StatusLives
W $00:8F46 STA.W RAM_StatusLives ; Clamp lives to $62 (shown as 99)
R $00:8F49 LDA.W RAM_StatusLives
R $00:9767 LDA.W RAM_StatusLives
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
R $00:8F28 LDA.W RAM_StatusCoins
R $00:8F32 LDA.W RAM_StatusCoins
W $00:8F38 STA.W RAM_StatusCoins ; Coins -= 100
R $00:8F73 LDA.W RAM_StatusCoins
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)
R $00:F1A7 LDY.W $0DC0
R $05:B339 LDA.W $0DC0
W $05:B345 STA.W $0DC0 ; Store [$0DC0] (probably coins left until some reward)
R $05:B352 LDA.W $0DC0
RW $05:B357 DEC.W $0DC0 ; [$0DC0] -= 1
R $05:DB70 LDA.W $0DC0

$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?
R $00:A6C0 LDA.W RAM_OWHasYoshi
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
R $01:83E6 LDA.W RAM_OWHasYoshi
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
R $02:A763 LDA.W RAM_OWHasYoshi
W $04:91CC STA.W RAM_OWHasYoshi
W $04:9DEE STA.W RAM_OWHasYoshi

$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)
R $00:9090 LDY.W $0DC2
R $00:90BE LDX.W $0DC2
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)
R $03:B457 LDA.W $0DC2
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)

$0DC9

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)
R $04:9815 ADC.W $0DCF,Y

$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

$0DD4

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)
R $00:A269 LDA.W $0DD5
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:8EB1 LDX.W $0DD5
R $04:8ED9 LDA.W $0DD5
R $04:8F3A LDA.W $0DD5
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
R $04:920F LDX.W $0DD5
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)
R $04:9DAA LDA.W $0DD5
W $04:9DB4 STZ.W $0DD5 ; Clear [$0DD5]
W $04:9DC6 STZ.W $0DD5 ; Clear [$0DD5]
R $04:E5EE LDA.W $0DD5
W $04:E629 STA.W $0DD5 ; [$0DD5] = $E0
W $04:E63C STA.W $0DD5 ; [$0DD5] = $80
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:8630 LDX.W $0DD6
R $04:86A8 LDA.W $0DD6
R $04:86C7 LDA.W $0DD6
R $04:86D4 LDA.W $0DD6
R $04:871A LDA.W $0DD6
R $04:875E LDA.W $0DD6
R $04:8DF2 LDX.W $0DD6 ; X = [$0DD6]: current player index
W $04:8E5F STA.W $0DD6
R $04:8E62 LDX.W $0DD6 ; X = [$0DD6]
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:919F LDA.W $0DD6
R $04:91EB LDX.W $0DD6 ; X = [$0DD6] (current player * 4)
R $04:9276 LDA.W $0DD6
R $04:92D7 LDA.W $0DD6
R $04:9321 LDX.W $0DD6 ; X = [$0DD6]
R $04:939C ADC.W $0DD6
R $04:93D6 ADC.W $0DD6 ; X = X + [$0DD6]: index into this player's X/Y position
R $04:946A LDA.W $0DD6
R $04:952A LDX.W $0DD6 ; X = [$0DD6]: current player * 4
R $04:9582 LDX.W $0DD6 ; X = [$0DD6]
R $04:95A2 LDA.W $0DD6
R $04:9602 LDX.W $0DD6 ; X = [$0DD6]
R $04:9663 LDA.W $0DD6
R $04:9676 LDA.W $0DD6
R $04:96D2 LDA.W $0DD6
R $04:9790 LDA.W $0DD6
R $04:979D LDX.W $0DD6 ; X = [$0DD6]
R $04:9803 LDA.W $0DD6
R $04:9841 LDX.W $0DD6 ; X = [$0DD6]
R $04:9914 LDX.W $0DD6 ; X = [$0DD6]
R $04:9A26 LDA.W $0DD6
R $04:9A3C LDX.W $0DD6 ; X = [$0DD6]
R $04:9A93 LDA.W $0DD6
R $04:9E82 LDX.W $0DD6 ; X = [$0DD6]: player * 4
R $04:D6F9 LDA.W $0DD6
R $04:D75A LDA.W $0DD6
R $04:DB9D LDA.W $0DD6
R $04:DBD7 LDA.W $0DD6
R $04:DC0B LDA.W $0DD6
R $04:DCD1 LDA.W $0DD6
R $04:F2B0 LDY.W $0DD6 ; Y = [$0DD6]: index of the current player on the overworld
R $04:F892 LDA.W $0DD6
R $04:F9D7 LDY.W $0DD6
R $04:FC46 LDA.W $0DD6
R $04:FEFC LDY.W $0DD6 ; Y = [$0DD6] (player index)
R $04:FF1C LDY.W $0DD6 ; Y = [$0DD6] (player index)
R $05:D7C5 LDA.W $0DD6
R $05:D84D LDX.W $0DD6 ; X = overworld position index of the current player
R $05:D882 LDA.W $0DD6

$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
W $04:9120 STZ.W $0DD8 ; [$0DD8] = 0
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:A645 LDA.W $0DDA
R $00:A64A LDA.W $0DDA
W $00:A651 STA.W $0DDA
R $00:A6ED LDA.W $0DDA
W $00:A6F2 STA.W $0DDA
R $00:C53E LDA.W $0DDA ; A = [$0DDA] (level music to resume)
W $00:C9F3 STZ.W $0DDA ; [$0DDA] = 0
R $00:E2EB LDA.W $0DDA
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)
W $01:8780 STA.W $0DDA
R $01:AB02 LDA.W $0DDA ; A = music flag [$0DDA]
W $01:C0F6 STA.W $0DDA ; [$0DDA] = $FF (music flag)
RW $01:C58A ASL.W $0DDA
RW $01:C58A ASL.W $0DDA
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 $02:E27F LDA.W $0DDA
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
R $00:9B73 ORA.W $0DDE
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:F7E6 STA.W $0DDF,X
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)
W $04:F7B1 STA.W $0DE0,X
R $04:F7BF LDY.W $0DE0,X ; Y = slot at list position [$00]
R $04:F7E3 LDA.W $0DE0,Y
W $04:F7EA STA.W $0DE0,Y ; Swap the list entries at positions [$01] - 1 and [$00]
R $04:F81A LDA.W $0DE0,X

$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]
R $04:F770 LDA.W $0DE5,X
W $04:F777 STA.W $0DE5,X ; Spawn sprite type 5 (cloud) in this slot
R $04:F858 LDA.W $0DE5,X
R $04:F87C LDY.W $0DE5,X
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
R $04:F984 LDA.W $0DF5,X
R $04:FA3E LDA.W $0DF5,X
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]
R $04:FB98 LDA.W $0DF5,X
W $04:FBCD STA.W $0DF5,X ; State = 2
R $04:FBE6 LDY.W $0DF5,X ; Y = state
RW $04:FBF3 DEC.W $0DF5,X ; State--: next phase
R $04:FC6F LDA.W $0DF5,X
W $04:FC79 STA.W $0DF5,X ; [$0DF5+X] = ([$0DF5+X] + 1) wrapped at 12: animation phase
R $04:FC89 LDA.W $0DF5,X
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]

$0E04

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)
R $04:F928 LDA.W $0E05,X
R $04:F93D LDA.W $0E05,X
W $04:F942 STA.W $0E05,X ; Yes: flip the direction bit [$0E05+X] bit 0
R $04:F971 EOR.W $0E05,X
W $04:F974 STA.W $0E05,X ; [$0E05+X] ^= A: reverse that axis' direction flag
R $04:F98E LDA.W $0E05,X
RW $04:FBE0 INC.W $0E05,X ; Animation counter [$0E05+X]++
R $04:FC05 AND.W $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)
R $04:F920 LDA.W $0E15,X
RW $04:FD3C INC.W $0E15,X ; Animation counter [$0E15,X]++
R $04:FD3F LDA.W $0E15,X ; A = counter
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]
R $04:F805 LDA.W $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)
R $04:FA96 ORA.W $0E25,X
R $04:FACC LDA.W $0E25,X
W $04:FBD5 STZ.W $0E25,X ; Wait timer [$0E25+X] = 0
R $04:FBDB LDA.W $0E25,X
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:F793 STA.W $0E35,X
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]
R $04:FBE9 LDA.W $0E35,X
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
W $04:FECC STA.W $0E35,X ; Store
R $04:FEF3 LDA.W $0E35,X ; A = X position low byte [$0E35,X]

$0E38

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)
W $04:F7A4 STA.W $0E45,X
R $04:F7C2 LDA.W $0E45,Y
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]

$0E48

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:FA93 LDA.W $0E55,X
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

$0E58

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
W $04:FED3 STA.W $0E65,X ; Store
R $04:FEEF LDA.W $0E65,X ; A = X position high byte [$0E65,X]

$0E68

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
R $04:F7C7 LDA.W $0E75,Y
R $04:F7D1 LDA.W $0E75,Y
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]

$0E78

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)
R $04:F998 LDA.W $0E95,X
W $04:F9A4 STA.W $0E95,X ; Speed [$0E95+X] += step, unless it is at the limit (DATA_04F8C8)
R $04:F9C8 LDA.W $0E95,X
W $04:F9D4 STA.W $0E95,X ; X speed += DATA_04F8C6[Y] (accelerate toward Mario), limited to +/-$10
R $04:F9EE LDY.W $0E95,X
R $04:FA0A BIT.W $0E95,X
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)
R $04:FEB9 LDA.W $0E95,X ; A = speed
W $04:FF58 STZ.W $0E95,X ; X speed = 0
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:FF5B STZ.W $0EA5,X ; Y speed = 0
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:F6B8 STA.W $0EB5,X
R $04:F92E LDA.W $0EB5,X
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)
RW $04:FA83 DEC.W $0EB5,X
R $04:FA86 LDA.W $0EB5,X
R $04:FAA6 BIT.W $0EB5,X
W $04:FF5E STZ.W $0EB5,X ; Z speed = 0
W $04:FFAD STA.W $0EB5,X ; Store [$0EB5,X]

$0EC5

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)
W $04:8ED4 STA.W $0EF5
R $04:FBAB LDA.W $0EF5

$0EF6

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $04:8EAE LDA.W $0EF6 ; A = [$0EF6]
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)
R $04:8EA0 LDX.W $0EF7
R $04:9123 LDY.W $0EF7 ; Y = [$0EF7]
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

$0EF8

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 read-modify-write)
R $01:EC30 ORA.W $0EF8
RW $01:EC38 INC.W $0EF8 ; Mark message shown [$0EF8]++

$0EF9

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)
W $00:8FD2 STA.W $0EF9,X

$0EFF

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]

$0F03

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
W $00:8FB7 STA.W $0F03,X

$0F13

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]

$0F14

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]++

$0F16

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0F17

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:8FA4 STA.W $0F1E,X
R $00:8FAF LDA.W $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

$0F25

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0F26

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$0F27

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
RW $00:8E28 DEC.W $0F30
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:8E32 LDA.W $0F31
RW $00:8E3F DEC.W $0F31,X
W $00:8E46 STA.W $0F31,X
R $00:8E4C LDA.W $0F31
R $00:8E60 LDA.W $0F31
R $00:8E6F LDA.W $0F31
R $00:8E85 LDA.W $0F31,Y ; Time digit [$0F31+Y]
W $00:91BD STZ.W $0F31
W $00:9A91 STZ.W $0F31 ; Level timer [$0F31] = 0
R $00:D0E8 LDA.W $0F31
RW $01:F10E INC.W $0F31 ; ... carrying into the tens digit [$0F31]
W $05:8587 STA.W $0F31 ; [$0F31] = hundreds digit
R $05:CCD3 LDA.W $0F31,Y
R $05:CE4E LDA.W $0F31
R $05:DB84 LDA.W $0F31

$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)

$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)

$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)
R $00:8EA0 LDA.W $0F34,X
W $00:8EBC STA.W $0F34,X ; Clamp the score to $0F423F (999,999)
R $00:8ED2 LDA.W $0F34
W $00:9E4E STZ.W $0F34 ; Player 1 score low word = 0
R $02:8760 LDA.W $0F34,X
W $02:8766 STA.W $0F34,X
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]
R $05:CEF6 ADC.W $0F34,X
W $05:CEF9 STA.W $0F34,X

$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)
W $00:8EB7 STA.W $0F35,X
R $00:8ECD LDA.W $0F35
RW $02:876B INC.W $0F35,X ; Carry into the middle score byte
R $02:AE24 LDA.W $0F35,X
W $02:AE2A STA.W $0F35,X

$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)
R $00:8E97 LDA.W $0F36,X
W $00:8EB2 STA.W $0F36,X
R $00:8EC6 LDA.W $0F36
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
R $02:AE2D LDA.W $0F36,X
W $02:AE32 STA.W $0F36,X
R $05:CEFC LDA.W $0F36,X
W $05:CF02 STA.W $0F36,X ; Score (24-bit at $0F34,X) += 1 or 10 (carry into the third byte)

$0F37

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)

$0F38

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 read)

$0F39

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)

$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]
W $05:CEED STA.W $0F40
R $05:CF36 LDA.W $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]
R $00:8F6A LDA.W $0F48,X
W $00:8F70 STA.W $0F48,X ; Bonus stars -= 100
R $00:8F8F LDA.W $0F48,X
W $00:9E4B STZ.W $0F48 ; Clear [$0F48] (probably bonus star counters)
R $05:CC6B LDA.W $0F48,X
R $05:CF15 LDA.W $0F48,X
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
R $02:F9B5 LDA.W $0F4A,X
RW $02:FA28 INC.W $0F4A,X ; Flame animation counter [$0F4A,X]++
R $02:FA42 LDA.W $0F4A,X
R $02:FAA8 LDA.W $0F4A,X
R $02:FCF8 LDA.W $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])
R $02:FAF1 LDA.W $0F72,X
W $02:FC1C STA.W $0F72,X
R $02:FC7D CMP.W $0F72,X

$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
R $02:FBE3 LDA.W $0F86,X
RW $02:FBE8 INC.W $0F86,X ; Wake this slot: state [$0F86] = 1
R $02:FC4D LDA.W $0F86,X
W $02:FC87 STZ.W $0F86,X ; Back on the ceiling: state [$0F86] = 0
R $02:FDA3 LDA.W $0F86,X
R $02:FF0E LDY.W $0F86,X

$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
R $02:FC45 LDA.W $0F9A,X
RW $02:FC4A DEC.W $0F9A,X ; Count down timer [$0F9A] if non-zero
R $02:FC59 LDA.W $0F9A,X
R $02:FCED LDA.W $0F9A,X
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)
R $02:FAB4 ADC.W $0FAE,Y
W $02:FAB7 STA.W $0FAE,Y ; Ring angle low [$0FAE,Y] += speed
R $02:FAFA ADC.W $0FAE,Y

$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)
R $02:FABA LDA.W $0FB0,Y
W $02:FAC1 STA.W $0FB0,Y ; Ring angle high bit [$0FB0,Y] = (high + carry) & 1 (9-bit angle)
R $02:FB02 ADC.W $0FB0,Y

$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
R $02:FAC4 LDA.W $0FB2,Y
R $02:FB88 ADC.W $0FB2,Y

$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
R $02:FAC9 LDA.W $0FB4,Y
R $02:FB8E LDA.W $0FB4,Y

$0FB6

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)
R $02:FB9F ADC.W $0FB6,Y

$0FB8

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
R $02:FBA5 LDA.W $0FB8,Y

$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

$0FBC

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)
R $00:C17C LDA.W $0FBE,Y
R $00:C25E LDA.W $0FBE,Y
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
R $05:8A66 LDA.W $0FBE,Y
R $05:8B46 LDA.W $0FBE,Y
R $05:8C34 LDA.W $0FBE,Y
R $05:8D2B LDA.W $0FBE,Y
W $0C:94AD STA.W $0FBE,X ; Table $0FBE+X = address of this definition
R $0C:94FD LDA.W $0FBE,X

$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)
R $00:C03A LDA.W $13BE
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)
R $0D:B2E0 LDX.W $13BE
R $0D:B34E LDX.W $13BE

$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:A261 LDY.W $13BF
R $00:CA08 LDA.W $13BF ; A = current level number [$13BF]
R $00:F3B2 LDA.W $13BF
R $00:F3B9 LDA.W $13BF
R $01:E526 LDA.W $13BF ; A = [$13BF] (translevel number)
R $01:E5A0 LDA.W $13BF ; A = [$13BF] (translevel number)
R $04:8DD1 LDA.W $13BF
R $04:8E25 LDA.W $13BF
R $04:E65C LDA.W $13BF ; A = [$13BF] (level number just beaten)
R $05:B1B4 CMP.W $13BF
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]
R $05:DA47 LDA.W $13BF
R $05:DAE1 LDA.W $13BF
R $0D:A589 LDA.W $13BF
R $0D:A590 LDA.W $13BF
R $0D:A68E LDX.W $13BF
R $0D:B2CA LDA.W $13BF
R $0D:B2D1 LDA.W $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 $00:96A1 LDA.W $13C1
W $04:8E9B STA.W $13C1
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:9149 LDA.W $13C1
R $04:915E LDA.W $13C1
R $04:917D LDA.W $13C1
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:968D LDA.W $13C1
R $04:96A8 LDA.W $13C1
R $04:E61F CMP.W $13C1 ; Compare with [$13C1] (probably OW tile Mario stands on)
R $04:FA43 LDA.W $13C1
R $04:FB9D LDA.W $13C1

$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)
W $04:856A STA.W $13C3
W $04:9A32 STA.W $13C3
R $04:9A55 CMP.W $13C3
W $04:9A6C STA.W $13C3
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]

$13C4

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $04:9E11 STZ.W $13C4 ; Clear [$13C4]

$13C5

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:81F7 LDA $13C6
R $00:827C LDY $13C6
R $00:9471 LDX.W $13C6 ; X = cutscene number [$13C6] (1-7 castle scenes, 8 = credits)
R $00:9501 LDA.W $13C6
R $00:9516 LDA.W $13C6
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)
R $00:C926 LDA.W $13C6
R $00:CA01 LDA.W $13C6
W $00:CA20 STX.W $13C6 ; [$13C6] = X: cutscene number
RW $01:D048 INC.W $13C6 ; Cutscene/level end flag [$13C6]++
R $01:EA92 ORA.W $13C6
R $01:EFCD ORA.W $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)
R $04:8DDF LDA.W $13C6
R $04:8DE7 LDA.W $13C6
W $04:8DED STA.W $13C6
R $0C:C95D LDA.W $13C6
R $0C:C99D LDA.W $13C6
R $0C:CB34 LDA.W $13C6
R $0C:CC68 LDX.W $13C6

$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
R $00:FCC5 LDA.W RAM_YoshiColor
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)
R $04:8275 LDA.W $13C9

$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)
W $00:C489 STZ.W $13CB ; Clear [$13CB]
RW $00:FB5C INC.W $13CB ; [$13CB]++

$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)
R $00:8F1D LDA.W $13CC
RW $00:8F22 DEC.W $13CC ; [$13CC]-- (one coin is added per frame)
R $05:B333 ADC.W $13CC ; Coin counter [$13CC] += A
W $05:B336 STA.W $13CC
RW $05:B34A INC.W $13CC ; Coin counter [$13CC] += 1

$13CD

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 $00:CA2D STA.W $13CE ; [$13CE] = 1
R $04:8F35 LDA.W $13CE
W $05:B155 STA.W $13CE ; [$13CE] = 1 (level cleared flag, probably)
W $05:D9C6 STZ.W $13CE ; [$13CE] = 0
R $0D:A699 LDA.W $13CE

$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)
R $00:A6AC LDA.W $13CF
R $00:A736 LDA.W $13CF
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
R $05:DA60 LDA.W $13CF

$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)

$13D1

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
R $04:EEC0 LDA.W $13D1

$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
R $00:C956 LDA.W $13D2
W $00:EEB7 STA.W $13D2 ; [$13D2] = 1 (a switch was pressed)
R $04:826A LDA.W $13D2
W $04:F297 STZ.W $13D2 ; Effect finished: [$13D2] = 0
R $04:F365 LDA.W $13D2
R $05:B135 ORA.W $13D2 ; A = [$0109] | [$13D2]: intro level or Switch Palace message
R $05:B14A LDA.W $13D2
W $05:B1CA STX.W $13D2 ; [$13D2] = X + 1 (switch palace message flag)
R $05:B287 LDY.W $13D2

$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
R $00:A211 LDA.W $13D3
RW $00:A216 DEC.W $13D3
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)
R $00:A233 LDA.W $13D4
W $00:A238 STA.W $13D4
R $00:A242 LDA.W $13D4
R $04:8295 LDA.W $13D4
W $04:82E7 STZ.W $13D4 ; [$13D4] = 0: leave look-around mode
RW $04:8383 INC.W $13D4 ; [$13D4]++: toggle look-around mode
R $04:8386 LDA.W $13D4
R $04:839A LDA.W $13D4

$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)
W $00:96E9 STZ.W $13D5 ; [$13D5] = 0
RW $00:A012 INC.W $13D5 ; [$13D5]++ (no animated layer 3 flag)
R $04:980E LDA.W $13D5,Y
W $04:9818 STA.W $13D5,Y
W $05:B245 STA.W $13D5 ; [$13D5] = 1 (probably: message box is using layer 3)
R $05:BC3F LDA.W $13D5
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)
W $00:96F1 STA.W $13D6 ; [$13D6] = $50
RW $05:CDD5 DEC.W $13D6 ; Count down the [$13D6] timer
W $05:CF42 STX.W $13D6 ; [$13D6] = $30: delay before the next state

$13D7

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
W $04:98CF STA.W $13D7

$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)
R $00:8222 LDA $13D9
W $00:96EC STZ.W $13D9 ; [$13D9] = 0: stop overworld processing
W $00:A173 STZ.W $13D9 ; [$13D9] = 0 (overworld process: normal)
R $00:A50C LDA.W $13D9
W $00:A67D STZ.W $13D9,X
R $04:8356 LDA.W $13D9
R $04:83F7 LDA.W $13D9
R $04:8576 LDA.W $13D9 ; A = [$13D9]: overworld process number
R $04:8700 LDY.W $13D9
R $04:8990 LDA.W $13D9
R $04:8D04 LDA.W $13D9
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)
R $04:97F7 LDA.W $13D9
R $04:9833 LDA.W $13D9
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 $04:F884 LDY.W $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:D02A LDA.W $13DB
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)
R $0C:D701 LDA.W $13DB
R $0C:D823 LDA.W $13DB

$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
R $00:CFB7 LDA.W RAM_ChangingDir
W $00:D708 STA.W RAM_ChangingDir ; Show the turn-around pose ([RAM_ChangingDir] = $0D)
R $01:9F74 LDA.W RAM_ChangingDir
R $01:A0CD LDA.W RAM_ChangingDir

$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:C5B5 STZ.W $13DE
W $00:C6EA STZ.W $13DE ; Clear [$13DE]
W $00:C898 STZ.W $13DE ; [$13DE] = 0
W $00:C91B STZ.W $13DE ; [$13DE] = 0
W $00:CCCD STZ.W $13DE ; [$13E8] = [$13DE] = 0 (no cape interaction)
W $00:CFCF STA.W $13DE
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)
W $00:A71E STY.W $13DF ; [$13DF] = 1
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
R $00:E420 LDA.W $13DF

$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:E3A6 LDA.W 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)
W $0C:D764 STY.W MarioFrame
W $0C:D7B7 STA.W MarioFrame

$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)
R $00:CF55 LDA.W $13E1
R $00:D69D LDA.W $13E1
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:D73C ORA.W $13E1
R $00:D76B LDA.W $13E1 ; A = slope index [$13E1]
W $00:EAAB STZ.W $13E1 ; [$13E1] = 0
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:D01A LDY.W RAM_WallWalkStatus
R $00:DC31 LDA.W RAM_WallWalkStatus
R $00:E32B CMP.W RAM_WallWalkStatus
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)
R $00:F5C9 LDA.W RAM_WallWalkStatus
R $00:F82C LDA.W RAM_WallWalkStatus

$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
R $00:D66A LDY.W $13E4
R $00:D96A LDA.W $13E4
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
R $00:CFF8 ORA.W $13E5
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:CCCA STZ.W $13E8
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
R $02:94F5 LDA.W $13E8

$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]
R $02:9516 LDA.W $13E9
W $02:951C STA.W $13E9 ; Cape X low += [$26]
R $02:9566 LDA.W $13E9
R $02:95C8 LDA.W $13E9
R $02:9696 LDA.W $13E9

$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)

$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]
R $02:9527 LDA.W $13EB
W $02:952D STA.W $13EB ; Cape Y low += [$28]
R $02:954C LDA.W $13EB
R $02:95AE LDA.W $13EB
R $02:96A9 LDA.W $13EB

$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)

$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)
R $00:CF4E LDA.W $13ED
R $00:D16F LDA.W $13ED
R $00:D17C LDA.W $13ED
W $00:D181 STA.W $13ED ; Clear bit 7 of [$13ED]
R $00:D5FB LDA.W $13ED
W $00:D67F STZ.W $13ED ; Not sliding any more
R $00:D682 LDA.W $13ED
R $00:D68D LDA.W $13ED
W $00:D6B1 STZ.W $13ED ; Not sliding any more
R $00:D7F8 LDA.W $13ED
W $00:D7FF STZ.W $13ED ; Clear the sliding flag
W $00:D988 STZ.W $13ED ; No slope sliding
W $00:D9A8 STZ.W $13ED ; No sliding
W $00:DA01 STZ.W $13ED ; No sliding
R $00:EEE6 LDX.W $13ED ; X = [$13ED] (slide timer)
R $00:EEFB ORA.W $13ED ; A = [$148F] | [$13ED]
W $00:EF02 STX.W $13ED ; [$13ED] = X
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)

$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)
R $00:E938 LDA.W $13EF
W $00:E93D STZ.W $13EF ; [$13EF] = 0
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)
RW $00:EF65 INC.W $13EF ; [$13EF]++

$13F0

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)
RW $00:A6D2 INC.W $13F1
R $00:F864 LDX.W $13F1
W $00:F869 STX.W $13F1 ; [$13F1] = X
R $00:F86C LDX.W $13F1
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)
R $00:CD3C LDY.W $13F3
W $00:CDA0 STY.W $13F3 ; Store the counter
R $00:F20B LDA.W $13F3,Y
R $00:F212 LDX.W $13F3,Y ; [$13F3 + Y] |= bit mask for X (DATA_00F0EC); X = previous value
W $00:F215 STA.W $13F3,Y
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]
R $01:C2ED LDY.W $13F3
W $01:C301 STA.W $13F3 ; [$13F3] = 9: Mario is in balloon mode
R $01:ED95 LDA.W $13F3
W $02:803F STZ.W $13F3 ; P-balloon was being carried: [$13F3] = 0 (probably Mario's balloon pose)

$13F4

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 read)

$13F5

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 read)

$13F6

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 read)

$13F7

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 read)

$13F8

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:D26A STZ.W RAM_IsBehindScenery
W $00:D28C STA.W RAM_IsBehindScenery ; Behind-scenery flag = 2
W $00:D2AA STZ.W RAM_IsBehindScenery
R $00:DB81 LDX.W RAM_IsBehindScenery ; X = [$13F9] (Mario is behind scenery: 0 front, 1 behind)
R $00:E3C2 LDX.W RAM_IsBehindScenery
R $00:E448 LDX.W RAM_IsBehindScenery ; X = [$13F9]
R $00:EA34 LDA.W RAM_IsBehindScenery
W $00:EA3F STZ.W RAM_IsBehindScenery ; If [RAM_IsBehindScenery] = 1 and [$8B] = 0 (probably no longer on a scenery tile), clear it
R $00:FF00 LDA.W RAM_IsBehindScenery
R $01:A81C LDA.W RAM_IsBehindScenery ; A = Mario behind scenery flag
R $01:BB2B LDA.W RAM_IsBehindScenery
W $01:BB30 STA.W RAM_IsBehindScenery ; Toggle Mario's behind-scenery flag [$13F9]
R $02:93D9 EOR.W RAM_IsBehindScenery
R $02:A3F6 LDA.W RAM_IsBehindScenery
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)
R $00:D9BE LDA.W $13FA
R $00:D9F1 LDA.W $13FA
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 $00:E37E ORA.W $13FB
W $01:CDAB STZ.W $13FB ; Clear [$13FB]
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:83E9 STA.W $13FB
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:8363 LDA.W $13FC
R $00:97E4 LDY.W $13FC ; Y = [$13FC] (boss number)
R $00:995D LDA.W $13FC
R $00:9A60 LDA.W $13FC ; A = [$13FC] (boss number)
R $00:F8FD LDA.W $13FC
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)
R $00:CDE5 LDA.W $13FD
RW $00:CE27 INC.W $13FD ; [$13FD]++: freeze sprites while the screen scrolls
W $00:CE6D STX.W $13FD ; Unfreeze sprites ([$13FD] = 0)
R $00:F8AB LDY.W $13FD

$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:CDF1 STZ.W $13FE ; [$13FE] = 0
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)
W $00:CE51 STA.W $13FF
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)
R $00:CDEC LDA.W $1400
W $00:CE73 STX.W $1400 ; [$1400] = 0
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]++
R $00:CE0E LDX.W $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 $00:C58F STZ.W $1402 ; [$1402] = 0
R $00:EC6F LDA.W $1402 ; A = [$1402]
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 $00:DA55 LDY.W $1403
R $00:DA6C LDA.W $1403
R $05:BC4C LDY.W $1403
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]
R $00:F875 LDX.W $1404
RW $00:F87E INC.W $1404 ; Enable free vertical scroll [$1404]

$1405

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)
R $01:EBA4 LDA.W $1405

$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)
W $00:EF6F STZ.W $1406 ; [$1406] = 0
W $00:F02D STA.W $1406 ; [$1406] = $80
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)
R $00:D174 ORA.W $1407
W $00:D179 STZ.W $1407 ; Cape flight phase [$1407] = 0
R $00:D6B6 LDY.W $1407
R $00:D7E4 LDY.W $1407
R $00:D83F LDA.W $1407
R $00:D861 LDA.W $1407
W $00:D86D STA.W $1407
R $00:D881 LDY.W $1407
W $00:D98D STZ.W $1407 ; No cape flight
R $00:EF79 LDY.W $1407 ; Y = [$1407] (cape flight state)
W $00:EF9C STZ.W $1407 ; [$1407] = 0 (end cape flight state)
R $00:F5DD LDA.W $1407
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)
R $00:D82B LDX.W $1408
R $00:D851 CPX.W $1408
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
R $00:D872 LDY.W $1409
R $00:D89F LDX.W $1409
R $00:D8AF CMP.W $1409
W $00:D8B6 STZ.W $1409 ; Use the boost as Y speed and clear it
R $00:D95F CMP.W $1409
W $00:D964 STA.W $1409

$140A

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
R $00:CF16 LDA.W RAM_IsSpinJump
R $00:D071 ORA.W RAM_IsSpinJump
R $00:D090 LDA.W RAM_IsSpinJump
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
R $03:95AB LDA.W RAM_IsSpinJump

$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)

$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)
R $00:F833 LDA.W RAM_YoshiHasWingsB
W $01:EBD0 STA.W RAM_YoshiHasWingsB ; [RAM_YoshiHasWingsB] = winged Yoshi flag
R $01:EEDF LDA.W RAM_YoshiHasWingsB
R $01:F0AC LDA.W RAM_YoshiHasWingsB

$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)
R $00:CDDD LDA.W $1411
R $00:E9CE LDA.W $1411
R $00:F713 LDY.W $1411
R $00:F766 LDY.W $1411
W $01:CE25 STZ.W $1411 ; Clear [$1411]
W $05:85C2 STZ.W $1411 ; [$1411] = 0
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)
W $05:D925 STA.W $1411 ; [$1411] = 1
W $05:DA9E STZ.W $1411 ; [$1411] = 0

$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)
R $00:F7F4 LDX.W $1412
R $00:F85E LDX.W $1412
W $05:85C7 STA.W $1412 ; [$1412] = scroll setting
W $05:D9B5 STA.W $1412 ; [$1412] = 1 (probably the vertical level flag)
W $05:DA14 STA.W $1412 ; [$1412] = 1

$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)
R $00:F79D LDY.W $1413
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)
W $05:DA98 STZ.W $1413 ; [$1413] = 0

$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)
R $00:F7AA LDY.W $1414
W $05:BF0A STZ.W $1414 ; [$1414] = 0
W $05:D920 STA.W $1414 ; [$1414] = DATA_05D710[X] (probably vertical scroll setting)
R $05:DA09 LDY.W $1414 ; Y = [$1414]
W $05:DA9B STZ.W $1414 ; [$1414] = 0

$1417

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:A748 STA.W RAM_YoshiInPipe
W $00:D26D STZ.W RAM_YoshiInPipe ; Clear behind-scenery and Yoshi-in-pipe flags
W $00:D2AD STZ.W RAM_YoshiInPipe
W $00:F431 STX.W RAM_YoshiInPipe ; [$1419] = 1 (horizontal) or 2 (vertical): entering a pipe
R $01:9F79 LDA.W RAM_YoshiInPipe
R $01:9F89 LDA.W RAM_YoshiInPipe
R $01:9FE9 LDA.W RAM_YoshiInPipe
R $01:A008 LDA.W RAM_YoshiInPipe
R $01:A0C4 LDA.W RAM_YoshiInPipe
R $01:EB33 LDA.W RAM_YoshiInPipe
R $01:EB9F LDA.W RAM_YoshiInPipe
R $01:EC09 LDA.W RAM_YoshiInPipe
R $01:EE6C LDA.W RAM_YoshiInPipe
R $01:EE7D LDA.W RAM_YoshiInPipe
R $01:EF5C ORA.W RAM_YoshiInPipe
R $01:F404 ORA.W RAM_YoshiInPipe

$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)

$141B

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)
R $00:F226 LDA.W $141B

$141C

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]
R $00:96E0 LDA.W $141D
R $00:A6A1 LDA.W $141D
RW $00:C8FB INC.W $141D ; [$141D]++ (probably flags that the walk-in finished)
R $05:DA3D LDA.W $141D

$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)
R $00:CDC9 LDA.W RAM_YoshiHasWings
R $00:D8D8 LDA.W RAM_YoshiHasWings
R $00:F84F LDX.W RAM_YoshiHasWings
W $00:FC38 STZ.W RAM_YoshiHasWings ; No Yoshi wings
W $01:A2B8 STZ.W RAM_YoshiHasWings ; No Yoshi wings
R $01:EBCD LDA.W RAM_YoshiHasWings
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
W $05:D93D STA.W $141F
R $05:DA42 LDA.W $141F

$1420

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
RW $00:F37A INC.W $1420 ; [$1420]++

$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:F294 CMP.W $1421
R $00:F29A CMP.W $1421 ; Touched the one before the counter: ignore
R $00:F29F LDA.W $1421
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:8FD8 LDA.W $1422
RW $00:F343 INC.W $1422
R $00:F346 LDA.W $1422 ; [$1422]++ : Yoshi coins collected in this level
R $05:DB40 LDA.W $1422

$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:91B8 LDY.W $1425
R $00:9691 LDA.W $1425 ; A = [$1425] (bonus game flag, probably)
R $00:A1E4 LDA.W $1425
R $00:A833 LDA.W $1425 ; A = [$1425]
R $00:C519 LDA.W $1425
R $00:C9E1 LDX.W $1425
W $00:C9E8 STX.W $1425 ; Yes: [$1425] = $FF
R $05:D7A3 LDY.W $1425
R $05:DADC LDA.W $1425

$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)
R $00:A1DA LDA.W $1426
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 $03:8D90 STA.W $1426
W $05:B11D STZ.W $1426 ; Box closed: no message box active ([$1426] = 0)
R $05:B1AF CPY.W $1426
R $05:B1BC LDY.W $1426

$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)
W $03:A30F STZ.W $1427 ; [$1427] = 0
RW $03:A317 INC.W $1427 ; [$1427] = 1 while the timer runs
W $03:A6BC STA.W $1427
W $03:AB66 STA.W $1427 ; Bowser animation/drawing mode [$1427] = 3
R $03:DF9B LDA.W $1427

$1428

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)

$1429

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
R $00:CE18 LDA.W $142A
RW $00:CE24 TRB.W $142A ; Clear bit 0 of [$142A]
R $00:CE56 LDA.W $142A
W $00:CE70 STA.W $142A ; Store the camera region position
R $00:F6E0 LDA.W $142A
R $00:F721 CMP.W $142A
R $00:F774 CMP.W $142A
R $00:F8B9 LDA.W $142A

$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)
W $00:F6E7 STA.W $142C
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

$142E

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)
R $01:92EF CMP.W $1430
W $05:820C STA.W $1430 ; [$1430] = $C4: lower bound of the Map16 tile range sprites react to (probably)
W $05:8283 STA.W $1430

$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)

$1432

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)
R $00:9436 LDA.W $1433
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:C4C0 STA.W $1433
R $00:C9CC LDA.W $1433
W $00:CA40 STA.W $1433 ; Iris-out radius [$1433] = $F0
R $00:CA44 LDA.W $1433
R $00:CA6E ADC.W $1433
W $00:CA71 STA.W $1433 ; [$1433] += A (iris radius)
R $00:CA98 CMP.W $1433 ; [$01] = vertical distance to center; inside the circle?
R $00:CC1D LDA.W $1433
R $00:CC37 LDA.W $1433
R $00:CC4B LDA.W $1433

$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:A6E8 LDA.W $1434
R $00:A739 ORA.W $1434 ; [$13CF] | [$1434] non-zero: go to A6E0
R $00:C48C LDY.W $1434
W $00:C4B7 STY.W $1434 ; Store Y in [$1434]
W $01:E212 STA.W $1434 ; [$1434] = $30: keyhole exit animation timer

$1435

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:A6F9 STA.W RAM_KeyHolePos1
R $00:C4DF LDA.W RAM_KeyHolePos1
R $00:CCF3 LDA.W RAM_KeyHolePos1
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
RW $04:F314 DEC.W $1437 ; Spawn timer--

$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:A701 STA.W RAM_KeyHolePos2
R $00:C4EA LDA.W RAM_KeyHolePos2
R $00:CCF8 LDA.W RAM_KeyHolePos2
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]
R $04:F2F8 LDA.W RAM_KeyHolePos2
W $04:F304 STA.W RAM_KeyHolePos2 ; Save the OAM offset
R $04:F317 LDA.W RAM_KeyHolePos2

$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]++
R $04:F38B LDA.W $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)
R $00:820D LDA $143A
R $00:82CA LDA.W $143A
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

$143B

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:978E STA.W $143C ; [$143C] = A
R $00:97A4 SBC.W $143C
W $00:D0FA STA.W $143C ; Death message animation [$143C] = $C0

$143D

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]++
R $02:A86A LDA.W RAM_ScrollSprNum
W $02:A879 STA.W RAM_ScrollSprNum
W $02:AC55 STZ.W RAM_ScrollSprNum ; Scroll sprite number = 0
R $05:BC7E LDA.W RAM_ScrollSprNum
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:CB1C LDA.W RAM_ScrollSprNum
R $0C:CB5D LDA.W RAM_ScrollSprNum
R $0C:CB82 LDA.W RAM_ScrollSprNum
R $0C:CBC4 LDA.W RAM_ScrollSprNum
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
W $0C:D03B STA.W RAM_ScrollSprNum
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 $02:AC58 STZ.W $143F ; [$143F] = 0
R $05:BC2C LDY.W $143F
R $05:BCAA LDA.W $143F
R $05:BD0E LDA.W $143F
W $0C:CB28 STA.W $143F ; [$143F] = 1: animation timer
RW $0C:CB43 DEC.W $143F
W $0C:CB4A STA.W $143F ; Reload the timer with 1
RW $0C:CC82 DEC.W $143F
W $0C:CC94 STA.W $143F ; [$143F] = DATA_0CCC49[frame]: its duration
W $0C:CDFA STA.W $143F
RW $0C:CE48 DEC.W $143F ; Every 6 frames (timer $143F)...
W $0C:CE4F STA.W $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
W $0C:CF79 STA.W $143F
W $0C:CFCE STA.W $143F
RW $0C:CFD3 DEC.W $143F ; Yes: count down the timer
W $0C:D014 STA.W $143F
R $0C:D019 LDA.W $143F ; Sub-scene 2: while the timer is >= 8, draw the puff effect
RW $0C:D026 DEC.W $143F ; Count down
W $0C:D036 STA.W $143F
RW $0C:D03E DEC.W $143F ; Sub-scene 3: count down the timer
W $0C:D127 STA.W $143F
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]
W $0C:D30B STA.W $143F ; [$143F] = 2
W $0C:D32E STA.W $143F ; [$143F] = 5

$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)
W $02:A881 STA.W $1440
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]
W $05:BD8B STA.W $1440 ; [$1440] = A
R $05:BD90 LDY.W $1440 ; Y = [$1440] (layer 1 command)
R $05:BDDD LDA.W $1440 ; Unused. A = [$1440]
W $05:BDED STA.W $1440 ; [$1440] = A
R $05:BDF2 LDY.W $1440 ; Y = [$1440] (layer 1 command)
R $05:BE3A LDA.W $1440 ; Unused. A = [$1440]
W $05:BE4A STA.W $1440 ; [$1440] = A
R $05:BE4F LDY.W $1440 ; Y = [$1440] (layer 1 command)
R $05:BEA9 LDA.W $1440 ; A = [$1440]
W $05:BEB9 STA.W $1440 ; [$1440] = A
R $05:BEC8 LDY.W $1440 ; Y = [$1440] (layer 1 command)
R $05:BF0D LDA.W $1440 ; A = [$1440]
W $05:BF1D STA.W $1440 ; [$1440] = A
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:BF70 STA.W $1440 ; [$1440] = A
R $05:BF81 LDA.W $1440 ; A = [$1440]
W $05:BFCC STZ.W $1440 ; [$1440] = 0
R $05:C008 LDA.W $1440
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)
R $05:C211 LDY.W $1440
R $05:C2E5 LDX.W $1440 ; X = [$1440]
R $05:C3C5 LDX.W $1440 ; X = [$1440]
R $05:C544 LDY.W $1440
R $05:C5E0 LDY.W $1440
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
R $0C:CB4D LDA.W $1440
W $0C:CB52 STA.W $1440 ; Toggle animation frame [$1440] between 0 and 1
R $0C:CBE2 LDA.W $1440
R $0C:CC87 LDA.W $1440
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:CCDE LDA.W $1440
R $0C:CE52 LDA.W $1440
W $0C:CE57 STA.W $1440
R $0C:CE60 LDA.W $1440
R $0C:CE69 LDA.W $1440
R $0C:CEE2 LDA.W $1440 ; Cutscene state: object falls and bounces, then plays a frame sequence
R $0C:CEEF LDA.W $1440
W $0C:CEF4 STA.W $1440
W $0C:CF08 STA.W $1440
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
R $0C:CF7F LDA.W $1440
R $0C:CFA3 LDY.W $1440 ; Y = [$1440]
W $0C:D29C STA.W $1440 ; [$1440] = $FF (timer)
W $0C:D2D5 STZ.W $1440 ; [$1440] = 0
W $0C:D30E STZ.W $1440 ; [$1440] = 0
W $0C:D329 STZ.W $1440 ; [$1440] = 0

$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]
W $05:BF76 STA.W $1441 ; [$1441] = A
W $05:BFB6 STA.W $1441 ; [$1441] = $60
R $05:C21C LDY.W $1441
R $05:C2F0 LDX.W $1441 ; X = [$1441]
R $05:C3D0 LDX.W $1441 ; X = [$1441]
R $05:C54C LDY.W $1441
R $05:C5E8 LDY.W $1441
R $05:C659 LDA.W $1441 ; A = [$1441] (shake timer)
RW $05:C65E DEC.W $1441 ; [$1441]--
W $05:C693 STY.W $1441
R $05:C958 LDY.W $1441 ; Y = [$1441] (number of entries)
RW $0C:CC60 DEC.W $1441
W $0C:D2A1 STA.W $1441 ; [$1441] = $30

$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
W $05:BFD5 STZ.W $1442 ; [$1442] = 0
R $05:C061 LDA.W $1442,X
RW $05:C118 INC.W $1442,X ; Segment too short: next path node, [$1442+n]++
R $05:C14B LDA.W $1442,X
R $05:C22B LDA.W $1442,X
W $05:C231 STA.W $1442,X
R $05:C256 LDA.W $1442,Y
R $05:C2A0 LDA.W $1442,X
R $05:C2CC LDA.W $1442,X
R $05:C34B LDA.W $1442,X
R $05:C377 LDA.W $1442,X
R $05:C3A8 LDA.W $1442,X ; A = direction [$1442+n]
R $05:C563 LDA.W $1442,X
W $05:C569 STA.W $1442,X
R $05:C58E LDA.W $1442,X
R $05:C5FF LDA.W $1442,X
W $05:C605 STA.W $1442,X
R $05:C62A LDA.W $1442,X
W $05:C83D STZ.W $1442 ; [$1442] = 0
R $05:C854 LDA.W $1442
W $05:C85A STA.W $1442 ; [$1442] |= [$140E]; zero: nothing triggered, return (go to $05C87D)
W $05:C96F STA.W $1442
R $05:C98B LDA.W $1442
R $0C:A1D7 LDA.W $1442
R $0C:A215 LDA.W $1442 ; Substate 0?
R $0C:A2D6 LDA.W $1442
RW $0C:A2DB INC.W $1442
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:CA35 LDA.W $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:CFFC INC.W $1442
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)
R $05:C72E CPX.W $1443
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
R $05:C9B7 LDA.W $1443
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:C956 LDA.W $1443
R $0C:C966 LDA.W $1443
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
W $0C:D5CB STA.W $1443 ; [$1443] = $FF

$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)
W $04:940E STZ.W $1444 ; [$1444] = 0
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:BFD2 STZ.W $1444 ; [$1444] = 0
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]
RW $05:C1B9 DEC.W $1444,X ; Timer--
R $05:C1BC LDA.W $1444,X ; A = timer
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
R $05:C982 LDA.W $1444
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]
R $0C:CA54 LDA.W $1444
W $0C:CAD3 STZ.W $1444 ; State 0: clear the object flag [$1444]
R $0C:CADD LDA.W $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 $00:C7BB STY.W $1445 ; [$1445] = $88
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]
R $0C:D3A6 LDA.W $1445
R $0C:D4B7 LDA.W $1445
R $0C:D661 LDA.W $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)
RW $00:C7B1 INC.W $1446 ; [$1446]++
W $00:C7C5 STA.W $1446 ; Command $24: [$1446] = $38
R $00:E9D9 LDA.W $1446
W $05:BD51 STZ.W $1446,X
W $05:BDC9 STZ.W $1446,X ; [$1446+X] = 0 (shared entry)
W $05:BE2E STZ.W $1446,X
W $05:BE7E STZ.W $1446,X
W $05:BFDB STZ.W $1446
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:C183 LDA.W $1446,X
W $05:C18A STA.W $1446,X
R $05:C3EA CMP.W $1446,X ; Compare with the current X speed [$1446+L]
R $05:C3F3 LDA.W $1446,X
W $05:C3FA STA.W $1446,X
R $05:C500 ADC.W $1446,X ; [$144E+X] = ([$144E+X] & $FF) + speed [$1446+X]: sub-pixel accumulator
R $05:C5A5 CMP.W $1446,X
R $05:C5AE LDA.W $1446,X
W $05:C5B5 STA.W $1446,X
W $05:C6B4 STA.W $1446
W $05:C6C2 STZ.W $1446 ; [$1446] = 0 (stop)
R $05:C79B LDA.W $1446,X
W $05:C7A4 STA.W $1446,X
W $05:C7B3 STZ.W $1446,X
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:9FD2 ADC.W $1446,X
R $0C:D259 LDA.W $1446
R $0C:D4F8 LDA.W $1446 ; Is the rising sprite active? ([$1446])
W $0C:D516 STZ.W $1446 ; Return
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)
R $0C:D75B LDA.W $1446
R $0C:D798 LDA.W $1446 ; A = [$1446]
W $0C:D7D0 STZ.W $1446
W $0C:D7E2 STA.W $1446

$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...
W $0C:CDAD STA.W $1447
W $0C:CDB6 STA.W $1447
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
W $0C:CF18 STA.W $1447
W $0C:D0FB STA.W $1447
RW $0C:D10F DEC.W $1447 ; [$1447] -= 1 (acts as timer and Y speed)
R $0C:D112 LDA.W $1447
R $0C:D11E LDA.W $1447
R $0C:D149 LDA.W $1447 ; Actor 0 Y speed = [$1447]
W $0C:D2C7 STZ.W $1447 ; [$1447] = 0
W $0C:D311 STZ.W $1447 ; [$1447] = 0

$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:BD54 STZ.W $1448,X
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:BFDE STZ.W $1448
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:C276 LDA.W $1448,X
W $05:C27D STA.W $1448,X
R $05:C30A CMP.W $1448,X ; Compare with the current Y speed [$1448+L]
R $05:C313 LDA.W $1448,X
W $05:C31A STA.W $1448,X
R $05:C641 CMP.W $1448,X
R $05:C64A LDA.W $1448,X
W $05:C651 STA.W $1448,X
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)
R $0C:D7A0 LDA.W $1449
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)

$144B

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)
R $0C:D84F LDA.W $144B

$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:BFAC STZ.W $144C ; [$144C] = 0
W $05:BFEA STZ.W $144C
W $05:C02A STZ.W $144C
R $05:C678 LDA.W $144C
W $05:C681 STA.W $144C
W $05:C68C STZ.W $144C
R $05:C6D2 LDA.W $144C
W $05:C6DB STA.W $144C
W $05:C6E6 STZ.W $144C ; Layer 2 Y speed = 0
W $05:C743 STZ.W $144C
R $05:C770 LDA.W $144C
W $05:C77C STA.W $144C
W $05:C846 STZ.W $144C ; Layer 2 Y speed = 0
R $05:C869 LDA.W $144C
W $05:C875 STA.W $144C ; Store layer 2 Y speed [$144C]
W $0C:D81E STA.W $144C
R $0C:D85B LDA.W $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
R $0C:C992 LDA.W $144D
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)
W $0C:D5D0 STA.W $144D ; [$144D] = $D0

$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)
R $00:E9F0 LDA.W $144E
W $04:8D99 STA.W $144E ; [$144E] = $0F (purpose unclear)
RW $04:926E DEC.W $144E ; Idle timer [$144E]--
W $04:9273 STZ.W $144E ; [$144E] = 0
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:BE84 STZ.W $144E,X
W $05:BF04 STZ.W $144E,X ; [$144E+X] = 0
W $05:BF5B STA.W $144E,X ; [$144E+X] = A (hedged: layer Y target)
W $05:BFE1 STZ.W $144E
R $05:C1D9 LDA.W $144E,Y
R $05:C1E0 CMP.W $144E,Y ; Compare with the limit
R $05:C247 ADC.W $144E,X ; Move the limit: [$144E+L] += [$00]
W $05:C24A STA.W $144E,X
R $05:C288 LDA.W $144E,Y
R $05:C4F9 LDA.W $144E,X
W $05:C503 STA.W $144E,X
R $05:C5C2 LDA.W $144E,Y
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 $05:C61E STA.W $144E,X
R $0C:9FCB LDA.W $144E,X
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)
R $0C:A2AD LDA.W $144F
W $0C:A2B2 STA.W $144F ; Toggle walk frame [$144F] between 0 and 1
R $0C:A2B5 LDA.W $144F
W $0C:A3EE STZ.W $144F ; Walk frame = 0

$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:BD5A STZ.W $1450,X
W $05:BDC6 STZ.W $1450,X ; [$1450+X] = 0
W $05:BE34 STZ.W $1450,X
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:BFE4 STZ.W $1450
W $05:C20E STZ.W $1450,X ; [$1450+L] = 0
R $05:C333 LDA.W $1450,Y
R $05:C526 LDA.W $1450,Y
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]
W $05:C582 STA.W $1450,X

$1452

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)

$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
W $05:BCD9 STZ.W $1456 ; [$1456] = 0
W $05:BCE1 STA.W $1456 ; [$1456] = 4
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:BD93 LDA.W $1456
R $05:BD9E LDA.W $1456
R $05:BDB9 LDX.W $1456 ; X = [$1456]: layer offset (0 or 4)
R $05:BDF5 LDA.W $1456
R $05:BE00 LDA.W $1456
R $05:BE1A LDX.W $1456 ; X = [$1456]: layer offset
R $05:BE52 LDA.W $1456
R $05:BE5D LDA.W $1456
R $05:BE6D LDX.W $1456 ; X = [$1456]: layer offset
R $05:BECB LDA.W $1456
R $05:BED6 LDA.W $1456
R $05:BEF7 LDX.W $1456 ; X = [$1456]: layer offset
R $05:BF25 LDA.W $1456
R $05:BF30 LDA.W $1456
R $05:BF51 LDX.W $1456 ; X = [$1456]: layer offset
R $05:C04D LDA.W $1456
R $05:C058 LDX.W $1456 ; X = [$1456]: layer offset (0 or 4)
R $05:C075 LDA.W $1456
R $05:C10F LDA.W $1456
R $05:C142 LDA.W $1456
R $05:C173 ADC.W $1456 ; X = [$1456] + axis: index of this axis' variables
R $05:C1AE LDA.W $1456
R $05:C1C5 LDX.W $1456 ; X = [$1456]
R $05:C1D6 LDY.W $1456 ; Y = [$1456]
R $05:C1F9 LDA.W $1456
R $05:C208 LDX.W $1456 ; X = [$1456]
R $05:C214 LDA.W $1456
R $05:C241 LDX.W $1456
R $05:C24D LDA.W $1456
R $05:C268 LDX.W $1456 ; X = [$1456]
R $05:C285 LDY.W $1456 ; Y = [$1456]
R $05:C297 LDA.W $1456
R $05:C2C3 LDA.W $1456
R $05:C2D0 LDX.W $1456 ; X = [$1456]
R $05:C2E8 LDA.W $1456
R $05:C305 LDX.W $1456 ; X = [$1456]
R $05:C31D LDA.W $1456
R $05:C330 LDY.W $1456 ; Y = [$1456]
R $05:C342 LDA.W $1456
R $05:C36E LDA.W $1456
R $05:C37B LDX.W $1456 ; X = [$1456]
R $05:C39F LDA.W $1456
R $05:C3C8 LDA.W $1456
R $05:C3E5 LDX.W $1456 ; X = [$1456]
R $05:C3FD LDX.W $1456 ; X = [$1456]
R $05:C521 LDY.W $1456 ; Y = [$1456] (0 = layer 1 slot, 4 = layer 2 slot)
R $05:C547 LDA.W $1456
R $05:C55A LDA.W $1456
R $05:C579 LDX.W $1456
R $05:C585 LDA.W $1456
R $05:C5A0 LDX.W $1456 ; X = [$1456]
R $05:C5BD LDY.W $1456 ; Y = [$1456] (0 = layer 1 slot, 4 = layer 2 slot)
R $05:C5E3 LDA.W $1456
R $05:C5F6 LDA.W $1456
R $05:C615 LDX.W $1456
R $05:C621 LDA.W $1456
R $05:C63C LDX.W $1456 ; X = [$1456]
R $05:C78D LDA.W $1456
R $05:C796 LDX.W $1456 ; X = [$1456]
R $0C:A796 LDA.W $1456
W $0C:A79C STA.W $1456

$1457

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)
W $05:BE95 STZ.W $1458 ; [$1458] = 0
R $05:C448 CMP.W $1458
R $05:C451 LDA.W $1458
W $05:C458 STA.W $1458
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
R $0C:A36C LDY.W $1458 ; Y = pose
R $0C:A388 LDY.W $1458 ; Y = pose
R $0C:A399 LDY.W $1458 ; Y = pose
W $0C:A3F1 STZ.W $1458 ; Pose = 0
R $0C:A43C LDA.W $1458 ; Pose [$1458]
R $0C:A446 LDA.W $1458 ; Pose
W $0C:A454 STA.W $1458 ; Landed on pose 0: start the landing animation (pose 8)
RW $0C:A466 INC.W $1458 ; Next pose
R $0C:A469 LDA.W $1458
W $0C:A472 STA.W $1458 ; Pose = $0A (hold the last pose)
R $0C:A478 LDA.W $1458 ; Pose
R $0C:A489 LDA.W $1458
R $0C:A4A3 LDA.W $1458
R $0C:A4C0 LDA.W $1458
R $0C:A4D8 LDA.W $1458
R $0C:A4E9 LDA.W $1458
R $0C:A505 LDA.W $1458
RW $0C:A69D DEC.W $1458 ; [$1458] -= 1: scene animation phase
R $0C:A6A0 LDA.W $1458
W $0C:A6A9 STA.W $1458
R $0C:A6CF LDY.W $1458

$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
RW $0C:A45C DEC.W $1459 ; Pose timer -1
W $0C:A463 STA.W $1459 ; Reload pose timer = 6
RW $0C:A693 DEC.W $1459
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)
W $05:BE98 STZ.W $145A ; [$145A] = 0
R $05:C4A5 LDA.W $145A
W $05:C4B8 STA.W $145A
R $05:C4CD LDA.W $145A
R $05:C4DB LDA.W $145A
RW $0C:A5A2 TSB.W $145A ; Set this actor's bit in the visible mask [$145A]
R $0C:A8DF LDA.W $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
RW $0C:A5A5 INC.W $145B ; Next release
R $0C:A5A8 LDA.W $145B
W $0C:A71D STA.W $145B
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
R $0C:AEC5 LDA.W $145B
RW $0C:AECA DEC.W $145B ; Layers met: count down the hold timer
R $0C:AEF8 LDA.W $145B

$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)
W $05:BE9B STZ.W $145C ; [$145C] = 0
R $05:C45B LDA.W $145C
W $05:C465 STA.W $145C
R $05:C4D5 ADC.W $145C ; [$145C] += [$145A] * 16 (sub-pixel accumulator, carry kept)
W $05:C4D8 STA.W $145C
R $0C:A532 LDA.W $145C ; [$145C]: release in progress?
W $0C:A556 STA.W $145C ; [$145C] = X + 1: release in progress
R $0C:A5DE LDA.W $145C
W $0C:A611 STZ.W $145C

$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
RW $0C:A710 DEC.W $145D
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)
W $05:BE92 STA.W $1460 ; [$1460] = A
R $05:C42D LDA.W $1460
R $05:C49C LDY.W $1460 ; Y = [$1460] (direction)
W $05:C4CA STA.W $1460

$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)
R $00:92FE LDA.W $1462,Y
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:E9B1 LDA.W $1462
R $00:E9C5 CMP.W $1462 ; Compare Mario X - 8 with [$1462] (left border)
R $00:F6F1 LDA.W $1462
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:BC0C LDA.W $1462
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
W $05:BEBE STZ.W $1462 ; [$1462] = 0
R $05:BEFB ADC.W $1462,X ; A += [$1462+X] (layer X position)
W $05:BF9E STZ.W $1462 ; [$1462] = 0
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:C337 SBC.W $1462,Y
R $05:C38A ADC.W $1462,X ; Layer X position [$1462+L] += A
W $05:C38D STA.W $1462,X
R $05:C510 ADC.W $1462,X ; Position [$1462+X] += pixels moved
W $05:C513 STA.W $1462,X
R $05:C52A LDA.W $1462,Y
R $05:C700 LDA.W $1462 ; A = [$1462] (low byte; B kept)
R $05:C7AE CMP.W $1462,X
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:AEDA LDA.W $1462
W $0C:AEE1 STA.W $1462
R $0C:AEEE AND.W $1462
R $0C:B5E5 LDY.W $1462 ; Yes: scroll with [$1462] (the opposite-moving group) instead

$1463

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
R $05:C6F7 LDA.W $1463

$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:F6F6 LDA.W $1464
R $00:F7D0 SBC.W $1464 ; [$17BC] = layer 1 Y scroll delta this frame
R $05:BC19 LDA.W $1464
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:C1C8 LDA.W $1464,X
W $05:C1CE STA.W $1464,X
R $05:C1DD LDA.W $1464,Y ; A = layer Y position
R $05:C28C SBC.W $1464,Y
R $05:C2DF ADC.W $1464,X ; Layer Y position [$1464+L] += A
W $05:C2E2 STA.W $1464,X
R $05:C5C6 LDA.W $1464,Y
R $05:C66B LDA.W $1464

$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:F6FB LDA.W $1466
R $00:F7D9 SBC.W $1466 ; [$17BF] = layer 2 X scroll delta (positive = scrolled left)
R $05:BC26 LDA.W $1466
R $05:BC51 LDA.W $1466
W $05:BEC3 STZ.W $1466 ; [$1466] = 0
W $05:BFA3 STZ.W $1466 ; [$1466] = 0
W $05:BFC1 STZ.W $1466 ; [$1466] = 0
R $05:C19D LDA.W $1466
W $05:C711 STA.W $1466
R $05:C7E7 ADC.W $1466 ; Layer 2 X [$1466] += [$17BD] (layer 1 X movement, sign-extended)
W $05:C7EA STA.W $1466
R $05:C830 LDA.W $1466
R $05:C95D LDA.W $1466
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:F700 LDA.W $1468
R $00:F7E2 SBC.W $1468 ; [$17BE] = layer 2 Y scroll delta
R $05:BC36 LDA.W $1468
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:BFC9 STA.W $1468 ; [$1468] = A
R $05:C684 LDA.W $1468
R $05:C6E1 LDA.W $1468
R $05:C73B LDA.W $1468
W $05:C740 STA.W $1468
R $05:C751 LDA.W $1468
W $05:C843 STA.W $1468 ; Layer 2 Y [$1468] = start height (DATA_05C80E)
R $05:C861 LDA.W $1468
W $05:C975 STA.W $1468 ; Layer 2 Y [$1468] = $00C1 (start position)
R $05:C997 LDA.W $1468
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)
R $01:AA5E LDA.W $1470
RW $01:AA6B INC.W $1470 ; Set carrying flag [$1470]
R $01:DA0F LDA.W $1470
R $01:E6D2 LDA.W $1470
R $01:ED3C LDA.W $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:D60B LDA.W $1471
R $00:EA03 LDA.W $1471
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)
R $01:A0D9 LDA.W $1471
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

$1472

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
R $03:C57A LDA.W $1472

$1474

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
R $03:C595 LDA.W $1474

$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:C550 LDA.W $1476
W $03:C557 STA.W $1476
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:C55A LDA.W $1478
W $03:C561 STA.W $1478
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:C5DA DEC.W $147A
RW $03:C5DD DEC.W $147A ; Edge moves left: net -1
R $03:C60F LDA.W $147A

$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:C5FD DEC.W $147C
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)
R $03:C5BD LDA.W $147E
W $03:C5C4 STA.W $147E
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)
R $03:C5E0 LDA.W $147F
W $03:C5E7 STA.W $147F
W $03:C5F2 STA.W $147F ; Overflow: subtract $CF

$1480

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]

$1481

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]

$1482

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:C529 LDA.W $1482
RW $03:C54A INC.W $1482 ; Set-up done

$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
R $03:C569 LDA.W $1483
W $03:C56F STA.W $1483

$1484

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)
R $03:C5D5 LDA.W $1484

$1485

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
R $03:C5F8 LDA.W $1485

$1486

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:AD07 LDA.W $148B
R $01:AD0D ADC.W $148B ; [$148B] = [$148B] * 5 + 1
W $01:AD10 STA.W $148B
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)
RW $01:AD13 ASL.W $148C ; [$148C] <<= 1
R $01:AD18 BIT.W $148C ; Test bit 5 of [$148C]
RW $01:AD23 INC.W $148C ; Set bit 0 of [$148C] (feedback)
R $01:AD26 LDA.W $148C ; A = [$148C]

$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)
R $01:8F5A LDA.W RAM_RandomByte1
W $01:AD2C STA.W RAM_RandomByte1,Y ; Store in random byte [$148D+Y]
R $01:B07F LDA.W RAM_RandomByte1
R $01:B092 LDA.W RAM_RandomByte1
R $02:85A2 AND.W RAM_RandomByte1
R $02:85FD LDA.W RAM_RandomByte1
R $02:B35F LDA.W RAM_RandomByte1 ; A = random byte 1
R $02:FD10 LDA.W RAM_RandomByte1

$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 $01:B074 LDA.W RAM_RandomByte2
R $01:B17A LDA.W RAM_RandomByte2
R $01:BC75 ADC.W RAM_RandomByte2
R $02:856E LDA.W RAM_RandomByte2
R $02:85AD LDA.W RAM_RandomByte2
R $02:8613 LDA.W RAM_RandomByte2
R $02:AAF6 LDA.W RAM_RandomByte2
R $02:B1A2 LDA.W RAM_RandomByte2
R $02:B303 LDA.W RAM_RandomByte2 ; A = random byte 2
R $03:AD96 LDA.W RAM_RandomByte2

$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)
RW $00:C7E4 INC.W $148F ; [$148F]++
W $00:C7F0 STZ.W $148F ; [$148F] = 0
R $00:CD4E LDA.W $148F If mario isn't holding something or riding yoshi
R $00:CF64 LDY.W $148F
R $00:CFAE LDY.W $148F
R $00:D00A LDY.W $148F
R $00:D1CC LDX.W $148F
R $00:D640 LDA.W $148F
R $00:D6DB LDY.W $148F
R $00:D7ED LDA.W $148F
R $00:D995 LDA.W $148F
R $00:DA9F LDY.W $148F
R $00:EA84 LDA.W $148F
R $00:EAF9 ORA.W $148F
R $00:EEF8 LDA.W $148F
R $00:F040 LDA.W $148F
R $00:F26F LDA.W $148F
R $00:F420 LDA.W $148F
R $01:808F LDA.W $148F
W $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
W $0C:D83A STZ.W $148F ; [$148F] = 0

$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)
R $00:A640 LDA.W $1490
W $00:A65D STZ.W $1490 ; Cancel star power timer
R $00:E2CF LDY.W $1490 ; Y = [$1490] (star timer)
RW $00:E2E0 DEC.W $1490 ; Star timer--
R $00:F1C9 LDY.W $1490
R $00:F5BE ORA.W $1490
R $00:FB02 LDA.W $1490 ; Star timer [$1490]?
R $01:A83B LDA.W $1490
R $01:B0F7 LDA.W $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 $01:F70E LDA.W $1490
R $02:8AD5 LDA.W $1490
R $02:A469 LDA.W $1490
R $02:BFE2 LDY.W $1490 ; [$1490] = Mario star timer
R $02:C7A8 LDA.W $1490
R $02:F24F LDA.W $1490
R $02:F9F0 LDA.W $1490
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
R $01:ADEF LDA.W $1491
W $01:B2B3 STZ.W $1491 ; No horizontal carry for Mario: [$1491] = 0
R $01:B2B6 LDA.W $1491
R $01:B544 LDA.W $1491
W $01:B574 STZ.W $1491 ; [$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
R $01:CA5E LDA.W $1491
W $02:D2C3 STA.W $1491 ; [$1491] = amount the sprite moved vertically this frame
R $02:E566 LDA.W $1491
R $02:EE98 LDA.W $1491
R $03:880D LDA.W $1491
R $03:8CD3 LDA.W $1491 ; Y = 0, A = [$1491] (sprite X movement this frame, probably)
R $03:8DF4 LDA.W $1491

$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
R $00:C9B2 LDA.W $1492
RW $00:C9B7 DEC.W $1492 ; [$1492]--

$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:83E3 LDY.W $1493
R $00:8E1A LDA.W $1493
R $00:A202 ORA.W $1493 ; A = [Mario animation] | [$1493]; if both 0 (nothing special going on) skip
R $00:A221 LDA.W $1493
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)
R $00:AFF1 BIT.W $1493
R $00:C5BB LDA.W $1493
RW $00:C951 DEC.W $1493 ; [$1493]--: level end timer
R $00:C973 LDA.W $1493
W $00:C9F0 STZ.W $1493 ; [$1493] = 0
R $00:CCBB LDA.W $1493
R $00:D77C LDA.W $1493
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)
R $03:C120 ORA.W $1493
W $03:C7A3 STA.W $1493 ; End-of-level timer [$1493] = $FF
W $03:CE96 STA.W $1493 ; [$1493] = $FF (end-of-level timer)

$1494

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)
R $00:83E8 LDY.W $1495
W $00:A68C STZ.W $1495 ; Clear [$1495]
R $00:AF3B LDA.W $1495
W $00:AFA6 STA.W $1495 ; [$1495] = step + 2
R $00:C508 LDA.W $1495,X
RW $00:C50D DEC.W $1495,X
R $00:C93D LDA.W $1495
W $00:C9A1 STZ.W $1495 ; [$1495] = 0
W $04:EA62 STZ.W $1495 ; [$1495] = 0 (event timer)
R $04:EAA4 LDA.W $1495
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)
R $00:CFE6 LDY.W $1496
W $00:CFFF STA.W $1496 ; Animation timer [$1496] = A
RW $00:D0C3 DEC.W $1496 ; Every 4th frame: [$1496] -= 1 (death timer)
R $00:D0C6 LDA.W $1496
R $00:D129 LDA.W $1496
R $00:D137 LDA.W $1496
RW $00:D13C DEC.W $1496 ; Timer -= 1
R $00:D147 LDA.W $1496
RW $00:D163 DEC.W $1496 ; Timer [$1496] -= 1
R $00:DA94 LDA.W $1496
R $00:DAAE LDA.W $1496
W $00:DAB3 STA.W $1496
R $00:DC1A LDA.W $1496
W $00:DC1F STA.W $1496
W $00:F61D STA.W $1496 ; [$1496] = hurt timer (A)
W $01:C567 STA.W $1496,Y
W $01:C567 STA.W $1496,Y
W $01:C5BA STA.W $1496 ; Animation timer [$1496] = $18
R $04:85D8 LDA.W $1496
RW $04:85DD DEC.W $1496
R $0C:A767 LDA.W $1496
RW $0C:A76C DEC.W $1496

$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)
R $00:E36D LDA.W $1497
R $00:E379 AND.W $1497
R $00:F5BB LDA.W $1497
W $00:F5EE STA.W $1497 ; Flashing timer [$1497] = $30
R $01:A8F9 LDA.W $1497
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
R $03:95CA LDA.W $1497

$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
R $00:CF8A LDY.W RAM_PickUpImgTimer
R $01:A113 LDY.W RAM_PickUpImgTimer
W $01:AA70 STA.W RAM_PickUpImgTimer ; Pick-up pose timer = 8 frames
W $02:865C STA.W RAM_PickUpImgTimer
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)
R $00:CF91 LDY.W RAM_FaceCamImgTimer
RW $00:D1D3 DEC.W RAM_FaceCamImgTimer
RW $00:D1D8 INC.W RAM_FaceCamImgTimer ; Face-camera timer -= 1, but not below 0
R $00:D6E0 LDY.W RAM_FaceCamImgTimer
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:
R $01:A0B8 LDA.W RAM_FaceCamImgTimer

$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
R $00:CF80 LDY.W RAM_KickImgTimer
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)
R $00:CF6F LDA.W RAM_FireballImgTimer
R $00:DA8F LDY.W RAM_FireballImgTimer
W $00:FEBC STA.W RAM_FireballImgTimer ; Fireball shoot pose timer [$149C] = $0A

$149D

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
R $01:BB0A LDA.W $149E

$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
R $00:D671 LDA.W $149F
W $00:D678 STA.W $149F ; [$149F] = $50: allow cape takeoff (vertical scrolling)
R $00:D80C LDA.W $149F
R $00:D8F5 CPY.W $149F ; Takeoff timer [$149F] >= 2: leave it
RW $00:D8FA INC.W $149F ; [$149F] += 1
R $00:F837 ORA.W $149F ; OR fly timer [$149F]

$14A0

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $00:CFA1 LDY.W $14A0
W $00:D72D STA.W $14A0 ; On the ground: running animation timer [$14A0] = $10

$14A1

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $00:D6FD LDA.W $14A1
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)
R $00:CEB1 LDA.W $14A2
W $00:CF13 STA.W $14A2 ; [$14A2] = timer
R $00:D1F4 LDA.W $14A2
RW $00:D1F9 DEC.W $14A2 ; Decrement [$14A2] if non-zero
R $04:85E0 LDA.W $14A2
RW $04:85E5 DEC.W $14A2
R $0C:A76F LDA.W $14A2
RW $0C:A774 DEC.W $14A2

$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)

$14A4

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $00:D856 LDA.W $14A4
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)
R $00:D8FF LDA.W $14A5
W $00:D90A STA.W $14A5 ; Start float: [$14A5] = $10
RW $05:C664 ASL.W $14A5

$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)
R $00:DA83 LDA.W $14A6

$14A7

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $03:D733 LDA.W $14A7
W $03:D74F STA.W $14A7 ; Segment timer [$14A7] = $40

$14A8

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 read-modify-write)

$14A9

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $02:94C6 STZ.W $14A9 ; Clear [$14A9]

$14AA

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:A1E9 LDA.W $14AB
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)
R $00:A635 LDA.W RAM_BluePowTimer
W $00:A654 STZ.W RAM_BluePowTimer ; Cancel blue POW timer
R $00:C533 LDY.W RAM_BluePowTimer
R $00:E2F8 LDA.W RAM_BluePowTimer
R $00:EBF0 LDA.W RAM_BluePowTimer ; A = blue P-switch timer
R $00:F32D LDA.W RAM_BluePowTimer
R $00:F54F LDY.W RAM_BluePowTimer
R $00:F56C LDY.W RAM_BluePowTimer
R $00:F57E LDY.W RAM_BluePowTimer
W $01:AB1C STA.W RAM_BluePowTimer,Y ; Switch timer [$14AD+Y] = $B0 (176 frames)
R $02:E23A LDA.W RAM_BluePowTimer
R $02:E277 LDA.W RAM_BluePowTimer
R $05:BB77 LDY.W RAM_BluePowTimer,X

$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)
R $00:A638 ORA.W RAM_SilverPowTimer
W $00:A657 STZ.W RAM_SilverPowTimer ; Cancel silver POW timer
R $00:C536 CPY.W RAM_SilverPowTimer
R $00:C53B LDY.W RAM_SilverPowTimer
R $00:E2FB ORA.W RAM_SilverPowTimer
R $00:F588 LDY.W RAM_SilverPowTimer
R $01:EA2C LDA.W RAM_SilverPowTimer
R $02:A99E LDA.W RAM_SilverPowTimer
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)
R $01:D84A LDA.W RAM_OnOffStatus
R $01:D851 LDA.W RAM_OnOffStatus
R $02:9191 LDA.W RAM_OnOffStatus
W $02:9196 STA.W RAM_OnOffStatus
R $05:C727 LDX.W RAM_OnOffStatus
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
R $01:C862 LDA.W $14B0
R $01:C918 LDA.W $14B0
W $01:CAEB STA.W $14B0
R $01:CBB7 ADC.W $14B0
W $01:CCCB STA.W $14B0 ; Pivot X [$14B0] = [$2A] (Mode 7 center X)
R $01:CCD7 SBC.W $14B0
W $01:E8ED STA.W $14B0 ; [$14B0] = cloud screen X
R $01:E90E ADC.W $14B0 ; Puff X = cloud X + DATA_01E76F[X]
R $01:E963 LDA.W $14B0
R $03:A2E4 LDA.W $14B0 ; A = [$14B0]
RW $03:A2EF DEC.W $14B0 ; [$14B0]--
W $03:A48C STA.W $14B0
R $03:A4FD LDA.W $14B0 ; Phase timer [$14B0] non-zero: no attack yet
W $03:A5B9 STA.W $14B0
W $03:A619 STA.W $14B0 ; Phase timer [$14B0]
W $03:A673 STA.W $14B0
W $03:A79B STA.W $14B0
R $03:A7BC LDA.W $14B0 ; Phase timer [$14B0]
W $03:A8AA STA.W $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)
R $01:C920 LDA.W $14B1
W $01:CAF4 STA.W $14B1 ; Pivot X [$14B0] = sprite X - radius
W $03:A529 STA.W $14B1
R $03:A5AD LDA.W $14B1 ; Mechakoopa drop timer [$14B1]
RW $03:A5B2 DEC.W $14B1 ; Timer--
R $03:A5C6 LDA.W $14B1 ; Timer at $80?
W $03:A666 STZ.W $14B1 ; Cancel the Mechakoopa drop
R $03:B0A6 LDA.W $14B1

$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
R $01:C854 LDA.W $14B2
R $01:C909 LDA.W $14B2
W $01:CB09 STA.W $14B2
R $01:CC1C LDA.W $14B2
W $01:CCD0 STA.W $14B2 ; Pivot Y [$14B2] = [$2C] (Mode 7 center Y)
R $01:CCE1 SBC.W $14B2
W $01:E8F2 STA.W $14B2 ; [$14B2] = cloud screen Y
R $01:E918 ADC.W $14B2 ; Puff Y = cloud Y + DATA_01E77F[X]
R $01:E96C LDA.W $14B2
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)
R $01:C911 LDA.W $14B3
W $01:CB12 STA.W $14B3 ; Pivot Y [$14B2] = sprite Y - radius Y
R $03:AFA2 LDA.W $14B3
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)

$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)
R $01:CAEE LDA.W $14B5
R $01:CC9D LDA.W $14B5
W $01:FD5D STA.W $14B5 ; [$14B5] = X high + carry
W $01:FFA5 STA.W $14B5
W $02:A5A0 STA.W $14B5
R $03:A2A5 LDA.W $14B5 ; A = [$14B5] (Bowser hurt timer, probably)
R $03:A661 LDA.W $14B5 ; Hurt timer [$14B5]
RW $03:A66C DEC.W $14B5 ; Hurt timer--
R $03:A694 LDA.W $14B5 ; Hurt timer
R $03:B116 LDA.W $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)

$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)
R $01:CB0C LDA.W $14B7
R $01:CCA0 ORA.W $14B7
W $01:FD6D STA.W $14B7 ; [$14B7] = Y high + carry
W $01:FFB5 STA.W $14B7
W $02:A5B1 STA.W $14B7
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]
W $03:A80F STA.W $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
R $01:C7C1 LDA.W $14B8
R $01:C7DD LDA.W $14B8
R $01:C822 LDA.W $14B8
R $01:C8E7 LDA.W $14B8
W $01:C987 STA.W $14B8
R $01:C9F0 LDA.W $14B8
R $01:CA9C LDA.W $14B8
W $01:CBBA STA.W $14B8 ; Platform X [$14B8] = pivot X + integer part of the rotated X offset
R $01:CCB5 LDA.W $14B8
W $01:FB70 STA.W $14B8 ; Remember kid X position in [$14B8]
R $01:FC77 LDA.W $14B8
R $01:FC84 LDA.W $14B8
R $01:FCDD LDA.W $14B8
R $01:FDD0 LDA.W $14B8
R $01:FEEE LDA.W $14B8
R $01:FF65 LDA.W $14B8
RW $03:A509 INC.W $14B8 ; Ball counter [$14B8]++
R $03:A50C LDA.W $14B8
W $03:A51A STZ.W $14B8 ; Ball counter [$14B8] = 0
R $03:A610 LDY.W $14B8 ; [$14B8]

$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
R $01:C9EC LDA.W $14B9
R $01:CAA4 LDA.W $14B9

$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
R $01:C7D1 LDA.W $14BA
R $01:C7F5 LDA.W $14BA
R $01:C8DB LDA.W $14BA
W $01:C991 STA.W $14BA
R $01:CA18 LDA.W $14BA
R $01:CA47 LDA.W $14BA
R $01:CAAF LDA.W $14BA
W $01:CC22 STA.W $14BA ; Platform Y [$14BA] = pivot Y - integer part of the rotated Y offset
R $01:CCAE LDA.W $14BA
W $01:FB75 STA.W $14BA ; Remember kid Y position in [$14BA]
R $01:FC7C LDA.W $14BA
R $01:FC8C LDA.W $14BA
R $01:FCE5 LDA.W $14BA
R $01:FDE1 LDA.W $14BA
R $01:FEFC LDA.W $14BA
R $01:FF6E LDA.W $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
R $01:CA4F LDA.W $14BB
R $01:CAB7 LDA.W $14BB

$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])
R $01:CAE8 SBC.W $14BC
R $01:CB5A LDA.W $14BC
R $01:CBEB LDA.W $14BC
W $01:CCDA STA.W $14BC ; Radius X [$14BC] = point X [$14B4] - pivot X

$14BD

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
R $01:CAF1 SBC.W $14BD

$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])
R $01:CB06 SBC.W $14BF
R $01:CB83 LDA.W $14BF
R $01:CBC2 LDA.W $14BF
W $01:CCE4 STA.W $14BF ; Radius Y [$14BF] = point Y [$14B6] - pivot Y

$14C0

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
R $01:CB0F SBC.W $14C0

$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])
R $01:CB7E LDA.W $14C2
R $01:CBE6 LDA.W $14C2

$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
R $01:CB55 LDA.W $14C5
R $01:CBBD LDA.W $14C5

$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)
W $00:FA12 STZ.W $14C8,X
W $00:FA53 STA.W $14C8,Y
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:88A1 LDA.W $14C8,Y
R $01:8972 LDA.W $14C8,Y ; Status of that sprite
W $01:899A STA.W $14C8,Y ; Kicked sprite status = $0A (kicked)
R $01:8A1D LDA.W $14C8,Y ; Its status
W $01:8A75 STA.W $14C8,Y ; Kicked sprite status = 9 (carryable)
R $01:8AA5 LDA.W $14C8,Y ; Its status
W $01:8AF1 STA.W $14C8,X ; Sprite status = 9 (stunned/carryable)
R $01:8C1C LDA.W $14C8,X
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)
R $01:938E LDA.W $14C8,X
R $01:93BF LDA.W $14C8,X
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)
R $01:976D LDA.W $14C8,Y
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)
R $01:9FF4 LDA.W RAM_SpriteAction,X
W $01:A02A STA.W RAM_SpriteAction,X ; Sprite status = 9 (stunned)
W $01:A084 STA.W RAM_SpriteAction,X ; Sprite status = $0A (kicked)
R $01:A169 LDA.W RAM_SpriteAction,X
R $01:A25D LDA.W $14C8,X
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:A397 LDA.W $14C8,X
R $01:A417 LDA.W $14C8,X
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)
R $01:A88B LDA.W $14C8,X
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)
R $01:AC8E LDA.W $14C8,X
W $01:ACA1 STZ.W $14C8,X ; Sprite status = 0: erase sprite
R $01:AEA6 LDA.W $14C8,X
R $01:AF9F LDA.W $14C8,X
R $01:B033 LDA.W $14C8,X
W $01:B142 STA.W $14C8,X ; Sprite status = 2 (killed)
W $01:B264 STA.W $14C8,X ; Sprite status = 1 (initialization)
R $01:B559 LDA.W $14C8,X
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
R $01:C1F2 LDA.W $14C8,X
W $01:C2B9 STA.W $14C8,X ; Sprite status = 9 (carryable)
R $01:C2D5 LDA.W $14C8,Y
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)
R $01:C3B2 LDA.W $14C8,X
W $01:C4C6 STZ.W $14C8,X ; Remove the sprite (status 0)
R $01:C701 LDA.W $14C8,X
W $01:D053 STZ.W $14C8,X ; Sprite status = 0 (erase the Koopa Kid)
R $01:D060 LDA.W $14C8,Y
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)
R $01:E1CA LDA.W $14C8,Y
R $01:E1F3 LDA.W $14C8,Y
R $01:E42B LDA.W $14C8,X
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)
R $01:EBDC LDA.W $14C8,X
R $01:EBF6 LDA.W $14C8,X
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)
R $01:F575 LDA.W $14C8,Y
W $01:F5C9 STA.W $14C8,Y ; New sprite status = 8 (normal)
R $01:F640 LDA.W $14C8,Y
R $01:F64A LDA.W $14C8,Y
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
R $01:F8E4 LDA.W $14C8,X
R $01:FA09 LDA.W $14C8,X
R $01:FA3D LDA.W $14C8,X
W $01:FB32 STZ.W $14C8,X ; Erase the sprite (status 0)
R $01:FDA9 LDA.W $14C8,Y
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])
R $02:8038 LDA.W RAM_SpriteAction,X
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)
R $02:8141 LDA.W $14C8,Y
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)
R $02:93B3 LDA.W $14C8,X
R $02:9432 LDA.W $14C8,X
W $02:945D STA.W $14C8,X ; Sprite status = 2 (killed)
W $02:9482 STA.W $14C8,X ; Sprite status = 9 (carryable)
R $02:94CE LDA.W $14C8,X
R $02:9DA3 LDA.W $14C8,Y
R $02:A0BD LDA.W $14C8,X
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
R $02:AC05 LDA.W $14C8,X
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)
R $02:B677 LDA.W $14C8,X
R $02:B695 LDA.W $14C8,X
W $02:B6AB STZ.W $14C8,X ; Sprite status = 0 (erase)
R $02:B7B4 LDA.W $14C8,Y
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)
R $02:BAB7 LDA.W $14C8,Y
W $02:BAC2 STA.W $14C8,Y ; Sprite status = 8 (normal)
R $02:BD2F LDA.W $14C8,X
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
R $02:DB66 LDA.W $14C8,Y
W $02:DBFF STA.W $14C8,Y ; Hammer Bro status = 2 (killed)
R $02:DCBE LDA.W $14C8,X
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
R $02:E318 LDA.W $14C8,X
R $02:E605 LDA.W $14C8,Y
R $02:E93D LDA.W $14C8,X
R $02:EA63 LDA.W $14C8,Y
W $02:EAFA STA.W $14C8,Y ; Status = 8 (normal)
R $02:EB34 LDA.W $14C8,X
W $02:ED9B STA.W $14C8,Y ; Status = 8 (normal)
R $02:EDDF LDA.W $14C8,X
W $02:EDEF STA.W $14C8,Y ; Erase it too (status 0)
R $02:EE21 LDA.W $14C8,Y
R $02:EF70 LDA.W $14C8,Y
W $02:EF7D STA.W $14C8,Y ; Status = 8 (normal)
R $02:F21D LDA.W $14C8,X
W $02:F29F STA.W $14C8,X ; Sprite status = 2 (killed)
W $02:F45F STZ.W $14C8,X ; Yes: remove the sprite
R $02:F54A LDA.W $14C8,Y
W $02:F55A STA.W $14C8,Y ; Status = 8 (normal)
R $03:808F LDA.W $14C8,X
W $03:81D5 STA.W $14C8,X ; Status = 2 (killed, falls off screen)
R $03:81E6 LDA.W $14C8,Y
W $03:8211 STZ.W $14C8,X ; Remove that sprite (status 0)
R $03:84E5 LDA.W $14C8,X
R $03:8536 LDA.W $14C8,X
W $03:8717 STZ.W $14C8,X ; Clear load status so the platform respawns; remove sprite
R $03:8773 LDA.W $14C8,X
R $03:88B6 LDA.W $14C8,X
R $03:898C LDA.W $14C8,X
W $03:8AE1 STA.W $14C8,Y ; New sprite status = 8 (normal)
R $03:8FA4 LDA.W $14C8,X
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)
R $03:A7EB LDA.W $14C8,Y ; Slot status
W $03:A7FD STA.W $14C8,Y ; Sprite status = 8 (normal)
R $03:A8D8 LDA.W $14C8,Y ; Slot status
W $03:A8EA STA.W $14C8,Y ; Sprite status = 8 (normal)
R $03:B022 LDA.W $14C8,Y
W $03:B02D STA.W $14C8,Y ; Status = 8 (normal)
R $03:B0DF LDA.W $14C8,Y
W $03:B157 STA.W $14C8,Y ; Status 2: killed
R $03:B2AD LDA.W $14C8,X
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
R $03:C2DC LDA.W $14C8,X
W $03:C2E8 STA.W $14C8,X ; Sprite status = 8 (normal)
R $03:C4E8 LDA.W $14C8,Y
W $03:C4F6 STZ.W $14C8,X ; Another dark room sprite exists: erase this one
R $03:C7C7 LDA.W $14C8,Y
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)
R $03:CC17 LDA.W $14C8,X
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)

$14C9

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

$14CB

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $02:AA6E STA.W $14CB ; [$14CB] = 7

$14D0

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)
W $03:A61F STA.W $14D0
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:FA70 STA.W RAM_SpriteYHi,Y
W $00:FC60 STA.W RAM_SpriteYHi,Y
W $00:FCB9 STA.W RAM_SpriteYHi,X
W $00:FD04 STA.W RAM_SpriteYHi,X ; Sprite Y high = 0
R $00:FF49 LDA.W RAM_SpriteYHi,X
R $00:FF7A LDA.W RAM_SpriteYHi,X
R $01:8362 LDA.W RAM_SpriteYHi,X
W $01:8367 STA.W RAM_SpriteYHi,X
R $01:83BA LDA.W RAM_SpriteYHi,X
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]
R $01:84BE LDA.W RAM_SpriteYHi,X
W $01:84C1 STA.W RAM_SpriteYHi,Y ; Cloud Y position high = Lakitu's
R $01:85A8 LDA.W RAM_SpriteYHi,X
W $01:85AD STA.W RAM_SpriteYHi,X
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)
R $01:8BF7 LDA.W RAM_SpriteYHi,X
W $01:8BFD STA.W RAM_SpriteYHi,X
W $01:8C04 STA.W RAM_SpriteYHi,X ; Restore Y position high
R $01:8F84 LDA.W RAM_SpriteYHi,X
R $01:9175 LDA.W RAM_SpriteYHi,X
W $01:917A STA.W RAM_SpriteYHi,X
R $01:9196 LDA.W RAM_SpriteYHi,X
W $01:919B STA.W RAM_SpriteYHi,X
R $01:93A4 LDA.W RAM_SpriteYHi,X
W $01:93A9 STA.W RAM_SpriteYHi,X
R $01:9461 LDA.W RAM_SpriteYHi,X
R $01:94CB LDA.W RAM_SpriteYHi,X
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
W $01:9710 STA.W RAM_SpriteYHi,Y
R $01:9790 LDA.W RAM_SpriteYHi,X ; Coin Y position = Koopa Y position
W $01:9793 STA.W RAM_SpriteYHi,Y
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:9EA3 STA.W RAM_SpriteYHi,X
W $01:9F02 STA.W RAM_SpriteYHi,X ; Restore sprite Y high
W $01:A123 STA.W RAM_SpriteYHi,X
R $01:A245 LDA.W RAM_SpriteYHi,X
R $01:A2D0 LDA.W RAM_SpriteYHi,X
W $01:A2D5 STA.W RAM_SpriteYHi,X
R $01:A347 LDA.W RAM_SpriteYHi,X
W $01:A34C STA.W RAM_SpriteYHi,Y
R $01:A3B2 LDA.W RAM_SpriteYHi,X ; A = sprite Y high
R $01:A474 LDA.W RAM_SpriteYHi,X
R $01:A491 LDA.W RAM_SpriteYHi,Y
R $01:AAEA LDA.W RAM_SpriteYHi,X
R $01:ABFF ADC.W RAM_SpriteYHi,X ; Position high byte += sign byte + carry
W $01:AC02 STA.W RAM_SpriteYHi,X
R $01:AC43 LDA.W RAM_SpriteYHi,X
R $01:ACE6 SBC.W RAM_SpriteYHi,X
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)
R $01:B186 LDA.W RAM_SpriteYHi,X
R $01:B24F LDA.W RAM_SpriteYHi,X
W $01:B254 STA.W RAM_SpriteYHi,X
R $01:B491 LDA.W RAM_SpriteYHi,X
R $01:B63B LDA.W RAM_SpriteYHi,X
W $01:B641 STA.W RAM_SpriteYHi,X ; Sprite Y high -= borrow
W $01:B648 STA.W RAM_SpriteYHi,X ; Restore sprite Y high
R $01:B7CB LDA.W RAM_SpriteYHi,X
R $01:B898 LDA.W RAM_SpriteYHi,X
R $01:B924 LDA.W RAM_SpriteYHi,X
R $01:B9A6 LDY.W RAM_SpriteYHi,X
R $01:B9BE LDA.W RAM_SpriteYHi,X
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)
R $01:BF4A LDA.W RAM_SpriteYHi,X
W $01:BF4F STA.W RAM_SpriteYHi,Y ; New Y high byte
R $01:C06C LDA.W RAM_SpriteYHi,X
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:C091 STA.W RAM_SpriteYHi,X
R $01:C1C3 LDA.W RAM_SpriteYHi,X
R $01:C1E0 LDA.W RAM_SpriteYHi,X
R $01:C404 LDA.W RAM_SpriteYHi,X
R $01:C76A LDA.W RAM_SpriteYHi,X
W $01:C76F STA.W RAM_SpriteYHi,X ; Sprite Y += $0068 (16-bit)
R $01:CAFC LDA.W RAM_SpriteYHi,X
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:D084 LDA.W RAM_SpriteYHi,X
W $01:D089 STA.W RAM_SpriteYHi,Y
R $01:D0C4 LDA.W RAM_SpriteYHi,X
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
R $01:D811 LDA.W RAM_SpriteYHi,X
R $01:D8A8 LDA.W RAM_SpriteYHi,X
W $01:D8BC STA.W RAM_SpriteYHi,X
W $01:D93E STA.W RAM_SpriteYHi,X
R $01:DA55 LDA.W RAM_SpriteYHi,X
R $01:DAC6 LDA.W RAM_SpriteYHi,X
W $01:DACC STA.W RAM_SpriteYHi,X
W $01:DAD3 STA.W RAM_SpriteYHi,X ; Restore Y high
R $01:DB18 LDA.W RAM_SpriteYHi,X
W $01:DB1E STA.W RAM_SpriteYHi,X
W $01:DB32 STA.W RAM_SpriteYHi,X ; Restore Y high
W $01:DDD6 STA.W RAM_SpriteYHi,X ; Store Y high
R $01:E055 LDA.W RAM_SpriteYHi,X
R $01:E062 LDA.W RAM_SpriteYHi,X
W $01:E067 STA.W RAM_SpriteYHi,X ; ... (16 bit)
R $01:E0EA LDA.W RAM_SpriteYHi,X
R $01:E22A LDA.W RAM_SpriteYHi,X
R $01:E336 LDA.W RAM_SpriteYHi,X
R $01:E673 LDA.W RAM_SpriteYHi,X
W $01:E826 STA.W RAM_SpriteYHi,X
W $01:E87B STA.W RAM_SpriteYHi,X
R $01:E8BD LDA.W RAM_SpriteYHi,X
W $01:E8C2 STA.W RAM_SpriteYHi,Y
R $01:EA4A LDA.W RAM_SpriteYHi,X
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
R $01:ECBB LDA.W RAM_SpriteYHi,X
W $01:ECC0 STA.W RAM_SpriteYHi,Y ; Y high = Yoshi Y high + carry
R $01:ED21 LDA.W RAM_SpriteYHi,X
R $01:EDD8 LDA.W RAM_SpriteYHi,X
R $01:EF2F LDA.W RAM_SpriteYHi,X
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
R $01:F218 LDA.W RAM_SpriteYHi,X
W $01:F21B STA.W RAM_SpriteYHi,Y ; Item Y hi = Yoshi Y hi
R $01:F2AD LDA.W RAM_SpriteYHi,X
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
R $01:FD68 LDA.W RAM_SpriteYHi,X
W $01:FDEE STA.W RAM_SpriteYHi,Y ; Ball Y = [$14BA] - $18 (16-bit)
R $01:FFB0 LDA.W RAM_SpriteYHi,X
W $02:806A STA.W RAM_SpriteYHi,X
R $02:8549 LDA.W RAM_SpriteYHi,X
R $02:8621 LDA.W RAM_SpriteYHi,X
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:89A2 STA.W RAM_SpriteYHi,X
W $02:8B5E STA.W RAM_SpriteYHi,X ; Sprite Y high = [$18C4]
R $02:8BDD LDA.W RAM_SpriteYHi,X
W $02:A956 STA.W RAM_SpriteYHi,X
W $02:A965 STA.W RAM_SpriteYHi,X ; Y position high = bits 0, 2 and 3 (the extra bits)
R $02:AC34 LDA.W RAM_SpriteYHi,X
W $02:AC37 STA.W RAM_SpriteYHi ; Copy Y position high
R $02:AD02 LDA.W RAM_SpriteYHi,X
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:B4D0 STA.W RAM_SpriteYHi,Y
W $02:B149 STA.W RAM_SpriteYHi,Y ; Sprite Y high
W $02:B180 STA.W RAM_SpriteYHi,X
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
W $02:B40A STA.W RAM_SpriteYHi,Y
R $02:B857 LDA.W RAM_SpriteYHi,X ; New sprite Y = hitting sprite Y
W $02:B85A STA.W RAM_SpriteYHi,Y
R $02:B9B3 LDA.W RAM_SpriteYHi,X
W $02:BAE1 STA.W RAM_SpriteYHi,Y
R $02:C1E0 LDA.W RAM_SpriteYHi,X
W $02:C1E5 STA.W RAM_SpriteYHi,Y
R $02:C48F LDA.W RAM_SpriteYHi,X
R $02:C5DC LDA.W RAM_SpriteYHi,X
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
W $02:CC3E STA.W RAM_SpriteYHi,X
R $02:CC4E LDA.W RAM_SpriteYHi,X ; [$02] = sprite Y (16 bit)
R $02:CD74 LDA.W RAM_SpriteYHi,X
R $02:D03D LDA.W RAM_SpriteYHi,X
R $02:D0B6 SBC.W RAM_SpriteYHi,X ; Subtract sprite Y high
R $02:D0F3 LDA.W RAM_SpriteYHi,X
R $02:D155 LDA.W RAM_SpriteYHi,X
R $02:D2B9 ADC.W RAM_SpriteYHi,X ; Sprite Y position (16-bit) += A (sign extended) + carry
W $02:D2BC STA.W RAM_SpriteYHi,X
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:D758 STA.W RAM_SpriteYHi,X
R $02:DAD8 LDA.W RAM_SpriteYHi,X
R $02:DB90 LDA.W RAM_SpriteYHi,X
W $02:DB95 STA.W RAM_SpriteYHi,Y
R $02:DDB3 LDA.W RAM_SpriteYHi,X
W $02:DDB6 STA.W RAM_SpriteYHi,Y
R $02:DF6B LDA.W RAM_SpriteYHi,X
R $02:E0AA LDA.W RAM_SpriteYHi,X
R $02:E104 LDA.W RAM_SpriteYHi,X
W $02:E10A STA.W RAM_SpriteYHi,X
W $02:E119 STA.W RAM_SpriteYHi,X ; Restore Y high
R $02:E1E7 LDA.W RAM_SpriteYHi,X
R $02:E2D0 LDA.W RAM_SpriteYHi,X ; Block Y = sprite Y
R $02:E483 LDA.W RAM_SpriteYHi,X
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:E511 LDA.W RAM_SpriteYHi,X
R $02:E545 LDA.W RAM_SpriteYHi,X ; Block Y position = sprite Y position
R $02:E853 LDA.W RAM_SpriteYHi,X
W $02:E859 STA.W RAM_SpriteYHi,X
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
R $02:EB12 LDA.W RAM_SpriteYHi,X
W $02:EB15 STA.W RAM_SpriteYHi,Y ; New sprite Y high
R $02:EDA8 LDA.W RAM_SpriteYHi,X
W $02:EDAB STA.W RAM_SpriteYHi,Y ; Y high = this sprite's
R $02:EE89 LDA.W RAM_SpriteYHi,X
R $02:EEDF LDA.W RAM_SpriteYHi,X
R $02:EF95 LDA.W RAM_SpriteYHi,X
W $02:EF98 STA.W RAM_SpriteYHi,Y ; Copy Y high
R $02:EFD6 LDA.W RAM_SpriteYHi,X
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
R $03:8221 LDA.W RAM_SpriteYHi,X
R $03:8804 LDA.W RAM_SpriteYHi,X
R $03:8B16 LDA.W RAM_SpriteYHi,X
W $03:8B1B STA.W RAM_SpriteYHi,Y ; New sprite Y = statue Y - 2
R $03:8CC0 LDA.W RAM_SpriteYHi,X
R $03:904C LDA.W RAM_SpriteYHi,X ; Extended sprite Y position = sprite Y (low, high)
R $03:9118 LDA.W RAM_SpriteYHi,X
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
R $03:939A LDA.W RAM_SpriteYHi,X
W $03:98B6 STZ.W RAM_SpriteYHi ; Slot 0 Y position = $00B2
W $03:99E6 STA.W RAM_SpriteYHi,X ; Sprite Y position high
R $03:9AE6 LDA.W RAM_SpriteYHi,X
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:9DE1 LDA.W RAM_SpriteYHi,X
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)
R $03:A63C LDA.W RAM_SpriteYHi,X
W $03:A7D1 STA.W RAM_SpriteYHi,X
W $03:A81C STA.W RAM_SpriteYHi,Y ; Y high = 0
R $03:A90A LDA.W RAM_SpriteYHi,X
W $03:A90F STA.W RAM_SpriteYHi,Y
R $03:AB7F LDA.W RAM_SpriteYHi,X
R $03:ABA2 LDA.W RAM_SpriteYHi,X
W $03:AC5F STA.W RAM_SpriteYHi,X ; Set X and Y high bytes to $FE: move the clown car far off-screen
R $03:AC82 LDA.W RAM_SpriteYHi,X
R $03:AD4B LDA.W RAM_SpriteYHi,X
R $03:ADA0 LDA.W RAM_SpriteYHi,X
R $03:B03D LDA.W RAM_SpriteYHi,X
W $03:B042 STA.W RAM_SpriteYHi,Y ; Y high byte
R $03:B18E LDA.W RAM_SpriteYHi,X
R $03:B6D5 LDA.W RAM_SpriteYHi,Y
R $03:B71B LDA.W RAM_SpriteYHi,Y
R $03:B7A6 LDA.W RAM_SpriteYHi,X
R $03:B834 SBC.W RAM_SpriteYHi,X ; 16-bit borrow: sign of the high byte tells which side Mario is on
R $03:B86F LDA.W RAM_SpriteYHi,X
R $03:B8E8 SBC.W RAM_SpriteYHi,X ; A = (screen Y + limit) - sprite Y, high byte (16-bit subtract)
R $03:C017 LDA.W RAM_SpriteYHi,X
R $03:C077 LDA.W RAM_SpriteYHi,X
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
R $03:C32C LDA.W RAM_SpriteYHi,X
W $03:C331 STA.W RAM_SpriteYHi,X ; Sprite Y position -= $0F (16-bit)
R $03:C46E LDA.W RAM_SpriteYHi,X
W $03:C7EB STA.W RAM_SpriteYHi,Y
R $03:CBCF LDA.W RAM_SpriteYHi,X
W $03:CBD2 STA.W RAM_SpriteYHi,Y ; New sprite Y high = spawner Y high
R $03:CD1A LDA.W RAM_SpriteYHi,X
W $03:CD1D STA.W RAM_SpriteYHi,Y ; Copy Y high
R $03:CE69 LDA.W RAM_SpriteYHi,X
R $03:DEED LDA.W RAM_SpriteYHi,X
R $07:FC63 LDA.W RAM_SpriteYHi,X
W $0C:A00F STZ.W RAM_SpriteYHi ; Sprite slot 0 Y high = 0
W $0C:A283 STA.W RAM_SpriteYHi

$14DC

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)
W $00:FA5F STA.W RAM_SpriteXHi,Y
R $00:FBC2 ADC.W RAM_SpriteXHi,X ; Sprite X += signed [$17BD]: coin follows layer 1 scrolling
W $00:FBC5 STA.W RAM_SpriteXHi,X
W $00:FC56 STA.W RAM_SpriteXHi,Y
W $00:FCA7 STA.W RAM_SpriteXHi,X
W $00:FCFB STA.W RAM_SpriteXHi,X ; Sprite X high = 0
R $00:FF32 LDA.W RAM_SpriteXHi,X
R $00:FF61 LDA.W RAM_SpriteXHi,X
R $01:83D1 LDA.W RAM_SpriteXHi,X
R $01:8445 LDA.W RAM_SpriteXHi,X
W $01:844A STA.W RAM_SpriteXHi,X
R $01:84B3 LDA.W RAM_SpriteXHi,X
W $01:84B6 STA.W RAM_SpriteXHi,Y ; Cloud X position high = Lakitu's
R $01:88B4 LDA.W RAM_SpriteXHi,Y
R $01:8F74 LDA.W RAM_SpriteXHi,X
R $01:9166 LDA.W RAM_SpriteXHi,X
W $01:916B STA.W RAM_SpriteXHi,X
R $01:9187 LDA.W RAM_SpriteXHi,X
W $01:918C STA.W RAM_SpriteXHi,X
R $01:91B8 ADC.W RAM_SpriteXHi,X ; Sprite X += that, so it rides a moving layer 2
W $01:91BB STA.W RAM_SpriteXHi,X
R $01:91D8 LDA.W RAM_SpriteXHi,X
W $01:91DE STA.W RAM_SpriteXHi,X
R $01:93FC LDA.W RAM_SpriteXHi,X
W $01:9402 STA.W RAM_SpriteXHi,X
R $01:9476 LDA.W RAM_SpriteXHi,X
R $01:94E7 LDA.W RAM_SpriteXHi,X
R $01:95AD LDA.W RAM_SpriteXHi,X
R $01:9702 LDA.W RAM_SpriteXHi,X
W $01:9705 STA.W RAM_SpriteXHi,Y
R $01:9785 LDA.W RAM_SpriteXHi,X ; Coin X position = Koopa X position
W $01:9788 STA.W RAM_SpriteXHi,Y
R $01:99EA LDA.W RAM_SpriteXHi,X ; Block X position = sprite X position
R $01:9E40 LDA.W RAM_SpriteXHi,X
R $01:9EAE LDA.W RAM_SpriteXHi,X ; Save sprite X high
W $01:9EB4 STA.W RAM_SpriteXHi,X
R $01:9EDB LDA.W RAM_SpriteXHi,X
W $01:9EE0 STA.W RAM_SpriteXHi,X
W $01:9EFB STA.W RAM_SpriteXHi,X ; Restore sprite X high
W $01:A056 STA.W RAM_SpriteXHi,X
W $01:A104 STA.W RAM_SpriteXHi,X
R $01:A237 LDA.W RAM_SpriteXHi,X
R $01:A337 LDA.W RAM_SpriteXHi,X
W $01:A33C STA.W RAM_SpriteXHi,Y
R $01:A36F LDA.W RAM_SpriteXHi,X
R $01:A379 LDA.W RAM_SpriteXHi,X
R $01:A441 LDA.W RAM_SpriteXHi,X
R $01:A44B LDA.W RAM_SpriteXHi,Y ; $00-$01 = X position of B, $02-$03 = X position of A
R $01:A573 LDA.W RAM_SpriteXHi,X
R $01:A576 SBC.W RAM_SpriteXHi,Y
R $01:A7AA LDA.W RAM_SpriteXHi,X
W $01:A7B4 STA.W RAM_SpriteXHi,Y
R $01:AC6F SBC.W RAM_SpriteXHi,X ; 16-bit compare with sprite X high: sign of (screen + offset - sprite X)
R $01:ACB5 LDA.W RAM_SpriteXHi,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
R $01:B7D9 LDA.W RAM_SpriteXHi,X
R $01:B8F7 ADC.W RAM_SpriteXHi,X
R $01:B90E LDA.W RAM_SpriteXHi,X
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)
R $01:BF3C LDA.W RAM_SpriteXHi,X
W $01:BF3F STA.W RAM_SpriteXHi,Y ; New X high = this sprite's X high
R $01:C07C LDA.W RAM_SpriteXHi,X
R $01:C1D7 LDA.W RAM_SpriteXHi,X
R $01:C75B LDA.W RAM_SpriteXHi,X
W $01:C760 STA.W RAM_SpriteXHi,X ; Sprite X += $0078 (16-bit)
R $01:CADE LDA.W RAM_SpriteXHi,X
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
W $01:D09E STA.W RAM_SpriteXHi,Y
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:D801 LDA.W RAM_SpriteXHi,X
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:D8C5 STA.W RAM_SpriteXHi,X
W $01:D947 STA.W RAM_SpriteXHi,X
R $01:DAB5 LDA.W RAM_SpriteXHi,X
W $01:DABB STA.W RAM_SpriteXHi,X
W $01:DADA STA.W RAM_SpriteXHi,X ; Restore X high
R $01:DB07 LDA.W RAM_SpriteXHi,X
W $01:DB0D STA.W RAM_SpriteXHi,X
W $01:DB39 STA.W RAM_SpriteXHi,X ; Restore X high
W $01:DDC8 STA.W RAM_SpriteXHi,X ; Sprite X high = 0
R $01:E1BF LDA.W RAM_SpriteXHi,X
W $01:E1C4 STA.W RAM_SpriteXHi,X ; Store it
R $01:E21F LDA.W RAM_SpriteXHi,X
R $01:E32D LDA.W RAM_SpriteXHi,X
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
R $01:E8AF LDA.W RAM_SpriteXHi,X
W $01:E8B2 STA.W RAM_SpriteXHi,Y ; Lakitu X (high) = cloud X high
R $01:EA3F LDA.W RAM_SpriteXHi,X
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
R $01:ECA9 LDA.W RAM_SpriteXHi,X
W $01:ECB0 STA.W RAM_SpriteXHi,Y ; Store
R $01:ED13 LDA.W RAM_SpriteXHi,X
R $01:EF4B LDA.W RAM_SpriteXHi,X
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
R $01:F209 LDA.W RAM_SpriteXHi,X
W $01:F210 STA.W RAM_SpriteXHi,Y ; Item X hi = Yoshi X hi + DATA_01F307[dir]
R $01:F2A2 LDA.W RAM_SpriteXHi,X
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
R $01:FD58 LDA.W RAM_SpriteXHi,X
W $01:FDDE STA.W RAM_SpriteXHi,Y ; Ball X high = 0
R $01:FFA0 LDA.W RAM_SpriteXHi,X
W $02:805C STA.W RAM_SpriteXHi,X
R $02:8498 SBC.W RAM_SpriteXHi,X
R $02:84FD LDA.W RAM_SpriteXHi,X
R $02:8557 LDA.W RAM_SpriteXHi,X
R $02:860B LDA.W RAM_SpriteXHi,X
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:8994 STA.W RAM_SpriteXHi,X
W $02:8B53 STA.W RAM_SpriteXHi,X
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]
R $02:AC2A LDA.W RAM_SpriteXHi,X
W $02:AC2D STA.W RAM_SpriteXHi ; Copy X position high
R $02:AD27 LDA.W RAM_SpriteXHi,X
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:B4BF STA.W RAM_SpriteXHi,Y
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
W $02:B3FE STA.W RAM_SpriteXHi,Y
R $02:B843 LDA.W RAM_SpriteXHi,X ; New sprite X = Pokey X
W $02:B846 STA.W RAM_SpriteXHi,Y
R $02:B96D LDA.W RAM_SpriteXHi,X ; [$00]/[$01] = sprite X (16-bit)
R $02:B9AA LDA.W RAM_SpriteXHi,X
W $02:BAD3 STA.W RAM_SpriteXHi,Y
R $02:BB2E LDA.W RAM_SpriteXHi,X
R $02:C1B3 LDA.W RAM_SpriteXHi,X ; $00/$01 = Chuck X position
W $02:C1CE STA.W RAM_SpriteXHi,Y
R $02:C482 LDA.W RAM_SpriteXHi,X ; $00/$01 = Chuck X position
R $02:C5D1 LDA.W RAM_SpriteXHi,X
W $02:C5D4 STA.W RAM_SpriteXHi,Y ; Clone X position high = this Chuck's
R $02:CC16 LDA.W RAM_SpriteXHi,X
W $02:CC1B STA.W RAM_SpriteXHi,X
R $02:CC45 LDA.W RAM_SpriteXHi,X ; [$00] = sprite X (16 bit)
R $02:CD68 LDA.W RAM_SpriteXHi,X
R $02:D069 SBC.W RAM_SpriteXHi,X ; Subtract sprite X high
R $02:D10D LDA.W RAM_SpriteXHi,X
R $02:D171 LDA.W RAM_SpriteXHi,X
R $02:D2DA LDA.W RAM_SpriteXHi,Y
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:D406 STA.W RAM_SpriteXHi,X
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
W $02:D75F STA.W RAM_SpriteXHi,X
R $02:DACD LDA.W RAM_SpriteXHi,X
R $02:DB82 LDA.W RAM_SpriteXHi,X
W $02:DB85 STA.W RAM_SpriteXHi,Y
R $02:DDA6 LDA.W RAM_SpriteXHi,X
W $02:DDAB STA.W RAM_SpriteXHi,Y
R $02:DF30 LDA.W RAM_SpriteXHi,X
R $02:E09D LDA.W RAM_SpriteXHi,X
R $02:E1DA LDA.W RAM_SpriteXHi,X
R $02:E2C7 LDA.W RAM_SpriteXHi,X ; Block X = sprite X
R $02:E47A LDA.W RAM_SpriteXHi,X
R $02:E4AE LDA.W RAM_SpriteXHi,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
R $02:E8ED LDA.W RAM_SpriteXHi,X
R $02:EAC2 LDA.W RAM_SpriteXHi,X
R $02:EAC5 SBC.W RAM_SpriteXHi,Y
R $02:EAE9 LDA.W RAM_SpriteXHi,X
R $02:EB07 LDA.W RAM_SpriteXHi,X
W $02:EB0A STA.W RAM_SpriteXHi,Y ; New sprite X high
R $02:EDBC LDA.W RAM_SpriteXHi,X
W $02:EDC1 STA.W RAM_SpriteXHi,Y ; New X high with carry
R $02:EF8A LDA.W RAM_SpriteXHi,X
W $02:EF8D STA.W RAM_SpriteXHi,Y ; Copy X high
R $02:EFC9 LDA.W RAM_SpriteXHi,X
R $02:F206 LDA.W RAM_SpriteXHi,X
R $02:F2F1 LDA.W RAM_SpriteXHi,X
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
R $03:8218 LDA.W RAM_SpriteXHi,X
R $03:8AED LDA.W RAM_SpriteXHi,X
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:9103 LDA.W RAM_SpriteXHi,X
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
R $03:9391 LDA.W RAM_SpriteXHi,X
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
R $03:9ADB LDA.W RAM_SpriteXHi,X
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:9DCC LDA.W RAM_SpriteXHi,X
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:A62D LDA.W RAM_SpriteXHi,X
R $03:A78D LDA.W RAM_SpriteXHi,X ; Bowser X high byte
W $03:A7B5 STA.W RAM_SpriteXHi,X
W $03:A814 STA.W RAM_SpriteXHi,Y
R $03:A8FA LDA.W RAM_SpriteXHi,X
W $03:A8FF STA.W RAM_SpriteXHi,Y
R $03:AB36 LDA.W RAM_SpriteXHi,X ; Compare Bowser X to Mario X (16-bit)
W $03:AC5C STA.W RAM_SpriteXHi,X
R $03:AC73 LDA.W RAM_SpriteXHi,X
R $03:AD8E LDA.W RAM_SpriteXHi,X
R $03:B049 LDA.W RAM_SpriteXHi,X
W $03:B05F STA.W RAM_SpriteXHi,Y ; X high = Bowser X high + DATA_03B015[X] (carry)
R $03:B6B8 LDA.W RAM_SpriteXHi,Y
R $03:B6FE LDA.W RAM_SpriteXHi,Y
R $03:B76A LDA.W RAM_SpriteXHi,X
R $03:B774 LDA.W RAM_SpriteXHi,X
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)
R $03:C009 LDA.W RAM_SpriteXHi,X
R $03:C1DD LDA.W RAM_SpriteXHi,X
W $03:C1E3 STA.W RAM_SpriteXHi,X ; Store it
W $03:C2F5 STA.W RAM_SpriteXHi,X ; Sprite X position = Mario X position
R $03:C47B LDA.W RAM_SpriteXHi,X
W $03:C7DC STA.W RAM_SpriteXHi,Y ; X high = 0
R $03:CBD9 LDA.W RAM_SpriteXHi,X
W $03:CBF3 STA.W RAM_SpriteXHi,Y
R $03:CD0F LDA.W RAM_SpriteXHi,X
W $03:CD12 STA.W RAM_SpriteXHi,Y ; Copy X high
R $03:DEE2 LDA.W RAM_SpriteXHi,X
R $07:FC73 LDA.W RAM_SpriteXHi,X
W $0C:A008 STZ.W RAM_SpriteXHi ; Sprite slot 0 X high = 0
W $0C:A27A STA.W RAM_SpriteXHi ; Yoshi X high byte

$14E8

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)
W $01:ABE4 STA.W $14EC,X
R $02:D29B ADC.W $14EC,X ; Y fraction [$14EC+X] += speed * 16 (carry kept)
W $02:D29E STA.W $14EC,X
W $07:F75B STZ.W $14EC,X ; Sprite Y fraction bits = 0

$14F8

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)
R $01:C785 LDY.W $1504,X
R $01:C78F ADC.W $1504,X
W $01:C792 STA.W $1504,X ; Swing speed [$1504,X] moves one step toward 0 (friction)
R $01:CA8C LDA.W $1504,X
W $01:CA98 STA.W $1504,X ; Otherwise speed += 1 or -1: Mario's weight pumps the swing
R $01:CCF0 LDA.W $1504,X
R $01:CD01 LDA.W $1504,X
W $07:F77F STZ.W $1504,X ; $1504,X = 0

$1510

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $01:CCF8 ADC.W $1510,X
W $01:CCFB STA.W $1510,X ; Angle fraction [$1510,X] += A

$151B

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
R $01:840E LDA.W $151C,X
W $01:8413 STA.W $151C,X
W $01:8421 STA.W $151C,X ; [$151C,X] = direction bit
W $01:8456 STA.W $151C,X
W $01:84D2 STA.W $151C,X
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)
R $01:8B9A LDA.W $151C,X
W $01:8BAD STA.W $151C,X ; [$151C,X] = 1 (turned already)
R $01:8D0A LDA.W $151C,X
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++
R $01:8D8C LDA.W $151C,X
W $01:8D93 STZ.W $151C,X ; Reset hop counter
R $01:8FB8 LDA.W $151C,X ; [$151C,X]
R $01:98B3 LDA.W $151C,X
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)
R $01:B0CF LDA.W $151C,X
W $01:B1BB STA.W $151C,X ; [$151C] = previous in-water flag
R $01:B1F0 CMP.W $151C,X
W $01:B238 STA.W $151C,X ; [$151C] = 3 (tries left)
RW $01:B243 DEC.W $151C,X
R $01:B280 LDA.W $151C,X
RW $01:B295 INC.W $151C,X ; Reverse direction: [$151C]++
R $01:B5EA CMP.W $151C,X
W $01:B5ED STA.W $151C,X ; Compare on-platform flag with last frame's ([$151C]) and save it; same: skip
R $01:B6B7 LDA.W $151C,X
R $01:B6C6 LDA.W $151C,X
W $01:B6CD STA.W $151C,X
R $01:B6E9 LDA.W $151C,X
R $01:B6F8 LDA.W $151C,X
W $01:B6FF STA.W $151C,X
R $01:B720 LDA.W $151C,X
W $01:C081 STA.W $151C,X ; [$151C,X] = X high byte (minus borrow)
R $01:C0C6 LDA.W $151C,X
R $01:C223 LDA.W $151C,X
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)
R $01:C3CB LDA.W $151C,X
R $01:C3DA LDA.W $151C,X
R $01:C46F LDA.W $151C,X
R $01:C4B1 LDA.W $151C,X
W $01:C74C STA.W $151C,X ; [$151C,X] = $80
R $01:C795 LDA.W $151C,X
R $01:C7A0 SBC.W $151C,X
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
R $01:CA7E LDA.W $151C,X
R $01:CB15 LDA.W $151C,X
R $01:CD10 ADC.W $151C,X
W $01:CD13 STA.W $151C,X ; Angle low [$151C,X] += step + carry
R $01:CE0B LDA.W $151C,X
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:E396 LDA.W $151C,X
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...
R $01:EAFB LDA.W $151C,X
R $01:EB27 LDA.W $151C,X
W $01:ECDC STA.W $151C,X ; New sprite's [$151C] = [$18DA] (what Yoshi swallowed)
R $01:ED88 ORA.W $151C,X
R $01:EFCA LDA.W $151C,X
R $01:EFE2 LDA.W $151C,X
W $01:F1D3 STZ.W $151C,X ; Tongue length = 0
R $01:F314 LDA.W $151C,X
W $01:F31A STA.W $151C,X ; Tongue length [$151C,X] += 3
R $01:F337 LDA.W $151C,X
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:F4C3 LDA.W $151C,X
R $01:F52C ADC.W $151C,X ; Right: A = X offset + tongue length
R $01:F531 LDA.W $151C,X
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)
R $02:B736 LDA.W $151C,X
W $02:B80A STA.W $151C,X ; Remember the new bitmask in [$151C]
R $02:BBD7 LDA.W $151C,X
W $02:C076 STA.W $151C,X ; [$151C] = chase timer
RW $02:C090 DEC.W $151C,X ; [$151C]--
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:C8B1 LDA.W $151C,X
R $02:CDE4 LDY.W $151C,X ; Y = [$151C] (compression strength)
R $02:CE24 CMP.W $151C,X
R $02:CE2F LDA.W $151C,X
RW $02:CE44 DEC.W $151C,X ; ...[$151C]-- (damp the oscillation)
R $02:CE49 LDA.W $151C,X
R $02:CE61 CMP.W $151C,X
R $02:CE67 LDA.W $151C,X
W $02:CFF2 STA.W $151C,X ; [$151C] = target compression
R $02:D64B ADC.W $151C,X
W $02:D650 STA.W $151C,X
R $02:D653 LDA.W $151C,X ; A = angle high
R $02:D942 LDA.W $151C,X
RW $02:D955 INC.W $151C,X ; Yes: flip the phase
R $02:DBC1 LDA.W $151C,X
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]
R $02:E050 LDA.W $151C,X
R $02:E0F1 LDA.W $151C,X
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:E2BE LDA.W $151C,X
R $02:E4B9 LDA.W $151C,X
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:E57A STA.W $151C,X
W $02:E6E4 STZ.W $151C,X ; [$151C] = 0: bait is gone
RW $02:EBAB INC.W $151C,X
R $02:EBAE LDA.W $151C,X ; Count frames in [$151C]
R $02:F06D LDA.W $151C,X
R $02:F089 LDA.W $151C,X
R $02:F11D LDA.W $151C,X
R $02:F274 LDA.W $151C,X
RW $02:F28F INC.W $151C,X ; Angry flag [$151C] = 1
RW $02:F482 INC.W $151C,X ; ...age [$151C]++
R $02:F485 LDY.W $151C,X
R $03:8150 LDA.W $151C,X
RW $03:8163 INC.W $151C,X ; [$151C]++: reverse the X acceleration
R $03:862C LDY.W $151C,X
W $03:87D4 STA.W $151C,X ; Graphics direction [$151C] = walking direction
R $03:8842 LDA.W $151C,X
R $03:893C LDA.W $151C,X
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:8C7D SBC.W $151C,X
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:99E9 LDA.W $151C,X
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
R $03:9B75 LDA.W $151C,X
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:A487 STA.W $151C,X
R $03:A502 LDA.W $151C,X ; Bowser state
R $03:A67B LDA.W $151C,X ; Bowser state
W $03:A689 STA.W $151C,X
W $03:A6C2 STA.W $151C,X
W $03:A796 STA.W $151C,X
W $03:A7C8 STA.W $151C,X
W $03:A8A1 STA.W $151C,X ; 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:ADF0 LDA.W $151C,X
R $03:B07E LDA.W $151C,X
R $03:B123 LDA.W $151C,X
R $03:B12E LDA.W $151C,X
W $03:C877 STA.W $151C,X
R $03:C8B8 ADC.W $151C,X ; Burst size [$1570] += expansion rate [$151C]
R $03:C8C5 LDA.W $151C,X
W $03:C8CF STA.W $151C,X ; Rate -= 1 (expansion slows down)
W $03:C8D6 STA.W $151C,X ; Rate = 1
R $03:C8E4 LDA.W $151C,X
R $03:CC22 LDA.W $151C,X
RW $03:CCD6 INC.W $151C,X ; State + 1 (rise out of the pipe)
RW $03:CD2B INC.W $151C,X
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)
W $07:F72A STZ.W $151C,X ; $151C,X = 0

$1520 Reznor1Dead RAM_Reznor1Dead

No 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?
R $03:D70D LDA.W RAM_Reznor1Dead

$1521 Reznor2Dead RAM_Reznor2Dead

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 read)

$1522 Reznor3Dead RAM_Reznor3Dead

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 read)

$1523 Reznor4Dead RAM_Reznor4Dead

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 read)
R $03:98EC LDA.W RAM_Reznor4Dead
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:8BA0 ORA.W $1528,X
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)
R $01:9928 LDA.W $1528,X
W $01:9939 STZ.W $1528,X ; [$1528] = 0
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)
R $01:AF57 LDA.W $1528,X
W $01:B2B9 STA.W $1528,X ; [$1528] = [$1491] (X movement that carries Mario)
R $01:B4A0 LDA.W $1528,X
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
R $01:C0D9 LDA.W $1528,X
R $01:C111 LDA.W $1528,X
R $01:C397 LDA.W $1528,X
R $01:C715 LDA.W $1528,X
RW $01:C728 INC.W $1528,X ; Reverse swing: [$1528,X]++
W $01:C751 STA.W $1528,X ; [$1528,X] = 1
R $01:C799 LDA.W $1528,X
R $01:C7A8 SBC.W $1528,X
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
R $01:CA84 LDA.W $1528,X
R $01:CB1A LDA.W $1528,X
R $01:CD17 ADC.W $1528,X
W $01:CD1A STA.W $1528,X ; Angle high [$1528,X] += sign extension + carry
R $01:CE6B LDA.W $1528,X
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)
R $01:D116 LDA.W $1528,X
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:D2B6 LDA.W $1528,X
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:DAF1 STA.W $1528,X
W $01:DB40 STA.W $1528,X ; Restore [$1528]
W $01:E052 STA.W $1528,X ; Remember spawn Y position low: [$1528]
R $01:E0E5 SBC.W $1528,X
RW $01:E586 INC.W $1528,X ; Odd frame: [$1528]++ (phase counter)
R $01:E589 LDA.W $1528,X ; A = [$1528]
RW $01:E58E INC.W $1528,X ; Wrapped: [$1528] = 1
RW $02:A0FC INC.W $1528,X ; Chuck: hit count [$1528]++
R $02:A0FF LDA.W $1528,X
W $02:BBA4 STA.W $1528,X ; [$1528] = A (probably X movement this frame, used to carry Mario)
W $02:BD36 STZ.W $1528,X ; [$1528] = 0
RW $02:BF61 INC.W $1528,X ; [$1528]++ (next animation frame)
R $02:BF69 LDA.W $1528,X
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:C7EB LDA.W $1528,X
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:D6F3 STA.W $1528,X
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)
R $03:816C LDA.W $1528,X
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:99CC STA.W $1528,X
W $03:9F77 STA.W $1528,X ; [$1528] = X low
R $03:A023 LDA.W $1528,X ; Restore X low from [$1528]
R $03:A4A5 LDA.W $1528,X
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)
R $03:CDDE LDA.W $1528,X
W $07:F72D STZ.W $1528,X ; $1528,X = 0

$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)
R $01:A791 LDY.W $1534,X ; Y = $1534,X
W $01:A7BD STA.W $1534,X ; $1534,X = 1
R $01:ADCB LDA.W $1534,X
RW $01:ADDE INC.W $1534,X ; Reverse the direction: [$1534]++
W $01:C094 STA.W $1534,X ; [$1534,X] = Y high byte, anchor
R $01:C0DE LDA.W $1534,X
R $01:C377 LDA.W $1534,X
R $01:C571 LDY.W $1534,X
R $01:C571 LDY.W $1534,X
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:D17C LDA.W $1534,X
R $01:D1A7 CMP.W $1534,X
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
R $01:D787 LDA.W $1534,X ; Step index
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
R $01:E9D0 LDA.W $1534,X
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]++
R $01:FB0E LDA.W $1534,X
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:C15B INC.W $1534,X ; Next phase
R $02:C15E LDA.W $1534,X ; Phase
R $02:C171 LDA.W $1534,X
R $02:C3CB LDA.W $1534,X ; Mode
RW $02:C3E4 INC.W $1534,X ; Mode = 1
W $02:C45C STZ.W $1534,X ; Mode = 0
R $02:C67D LDA.W $1534,X
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
R $02:D91D LDA.W $1534,X ; A = [$1534]
R $02:D96B LDA.W $1534,X ; A = [$1534]
W $02:D974 STA.W $1534,X ; Start popping: [$1534] = 6
R $02:D9F1 LDA.W $1534,X
R $02:DBAB LDA.W $1534,X
RW $02:DBBE INC.W $1534,X ; Yes: flip the X phase
R $02:E4BF LDA.W $1534,X
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
W $02:E573 STA.W $1534,X
R $02:E845 LDA.W $1534,X
R $02:E84E SBC.W $1534,X ; Y = Y - [$1534]
R $02:E868 LDA.W $1534,X
W $02:E86E STA.W $1534,X
R $02:ED27 LDA.W $1534,X
RW $02:F075 INC.W $1534,X
R $02:F078 LDA.W $1534,X
RW $03:819B INC.W $1534,X ; Hit counter [$1534]++
R $03:819E LDA.W $1534,X
R $03:8602 LDA.W $1534,X ; A = [$1534]
RW $03:8605 INC.W $1534,X ; [$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]
R $03:A4BB LDA.W $1534,X
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
R $03:C4DC LDA.W $1534,X
RW $03:C4FD INC.W $1534,X ; Mark as initialized
R $03:C7BE LDA.W $1534,X
R $03:C7F6 LDA.W $1534,X
W $03:C7FB STA.W $1534,Y
RW $03:C80C INC.W $1534,X ; Rockets launched [$1534]++
R $03:C828 LDY.W $1534,X
R $03:C84C LDY.W $1534,X ; Y = rocket number
R $03:C871 LDY.W $1534,X
R $03:C893 LDY.W $1534,X
R $03:C8B1 LDY.W $1534,X ; Y = rocket number
R $03:C987 LDA.W $1534,X
R $03:CA03 LDA.W $1534,X
RW $03:CE13 INC.W $1534,X ; Stomp count [$1534] + 1
R $03:CE16 LDA.W $1534,X
R $03:CED0 LDA.W $1534,X
W $07:F730 STZ.W $1534,X ; $1534,X = 0

$153D

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 read)

$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:FA7C STA.W $1540,Y
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)
R $01:80EE LDA.W $1540,X
RW $01:80F3 DEC.W $1540,X
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:899D LDA.W $1540,Y
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]
W $01:8D9E STA.W $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]
R $01:962A LDA.W $1540,X
W $01:963D STA.W $1540,X ; [$1540] = $40: explosion timer
R $01:965C LDA.W $1540,X
R $01:969C LDA.W $1540,X
RW $01:96DD INC.W $1540,X
R $01:9723 LDA.W $1540,X
W $01:9726 STZ.W $1540,X
R $01:9839 LDA.W $1540,X
R $01:9A52 LDA.W $1540,X
R $01:9A5D LDA.W $1540,X
W $01:9AD2 STA.W $1540,X ; ... with smoke timer [$1540] = $1F
R $01:9AE8 LDA.W $1540,X
R $01:A07D LDA.W $1540,X
R $01:A133 LDY.W $1540,X
R $01:A155 LDA.W $1540,X
R $01:A1D4 LDA.W $1540,X
R $01:A72E LDA.W $1540,Y
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]
R $01:ADC0 LDA.W $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
R $01:AF24 LDA.W $1540,X
R $01:AFE1 LDA.W $1540,X
W $01:B003 STA.W $1540,X ; Wait timer [$1540] = $40 frames
R $01:B0BE LDA.W $1540,X
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
R $01:B273 LDA.W $1540,X
W $01:B2A2 STA.W $1540,X ; Set the pause timer [$1540]
R $01:B6BF LDA.W $1540,X
W $01:B6D4 STA.W $1540,X ; Pause timer [$1540] = $40
R $01:B6F1 LDA.W $1540,X
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:BAF5 LDA.W $1540,X
R $01:BB16 LDA.W $1540,X ; A = door timer
R $01:BB49 LDA.W $1540,X
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:BE9E LDA.W $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?
W $01:C0AE STA.W $1540,X ; Timer = $7C
W $01:C11C STA.W $1540,X ; Timer = $80
R $01:C175 LDA.W $1540,X ; Hit: timer [$1540,X] running?
R $01:C186 LDA.W $1540,X
R $01:C1B4 LDA.W $1540,X
R $01:C203 LDA.W $1540,X
W $01:C2C2 STZ.W $1540,X ; [$1540,X] = 0
R $01:C38F LDA.W $1540,X
R $01:C48D LDA.W $1540,X
R $01:C4BF LDA.W $1540,X
W $01:CD4A STA.W $1540,X ; Spawn delay timer [$1540] = $80
R $01:CE7C LDA.W $1540,X
R $01:CE93 LDA.W $1540,X
W $01:CEAA STA.W $1540,X ; Timer [$1540] = $FF
R $01:CEB6 LDA.W $1540,X
W $01:CECF STA.W $1540,X ; Timer [$1540] = $30
R $01:CEFD LDA.W $1540,X
R $01:CF85 LDA.W $1540,X
W $01:CFDC STA.W $1540,X ; Timer [$1540] = $13
R $01:CFE0 LDY.W $1540,X
W $01:D03F STA.W $1540,X ; Timer [$1540] = $30
R $01:D043 LDA.W $1540,X
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:D49E LDA.W $1540,X ; Timer
R $01:D509 LDA.W $1540,X
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:D750 LDA.W $1540,X ; Timer
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
R $01:DF19 LDA.W $1540,X
W $01:E077 STA.W $1540,X ; [$1540] = $20: wait before the first jump
R $01:E096 LDA.W $1540,X
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:E309 LDA.W $1540,X
R $01:E3F2 LDA.W $1540,X
R $01:E446 LDY.W $1540,X ; Y = [$1540] (reassemble timer)
R $01:E48F LDA.W $1540,X ; A = [$1540] (reassemble timer)
R $01:E4DF LDA.W $1540,X ; A = [$1540]
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
R $01:E5E1 LDA.W $1540,X
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)
R $01:E683 LDA.W $1540,X ; A = [$1540]
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:E7C5 LDA.W $1540,X ; A = [$1540]
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
R $01:F8F5 LDA.W $1540,X
W $01:F8FC STA.W $1540,X ; Re-check whether Mario faces the Boo every $20 frames
R $02:809C LDA.W $1540,X
R $02:80A5 LDA.W $1540,X
R $02:80B2 LDA.W $1540,X
R $02:80C4 LDA.W $1540,X
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
R $02:B73B LDY.W $1540,X
W $02:B814 STA.W $1540,X ; Squish timer [$1540] = $0C
R $02:B88D LDA.W $1540,X
R $02:B8A7 LDA.W $1540,X
R $02:B931 LDA.W $1540,X
R $02:BD68 LDA.W $1540,X
W $02:BD6F STA.W $1540,X ; [$1540] = $80: moving time
R $02:BD7B LDA.W $1540,X
W $02:BDA1 STA.W $1540,X ; [$1540] = $40: pause before moving again
R $02:BDB3 LDA.W $1540,X
W $02:BDE4 STA.W $1540,X ; [$1540] = corner timer
R $02:BDF7 CMP.W $1540,X
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:C3ED LDA.W $1540,X ; [$1540]
RW $02:C3F2 INC.W $1540,X ; [$1540]++
R $02:C3FE LDA.W $1540,X ; [$1540]
W $02:C409 STA.W $1540,X ; Store timer
R $02:C40C LDA.W $1540,X ; [$1540]
R $02:C428 LDA.W $1540,X ; [$1540]
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
W $02:C550 STA.W $1540,X ; [$1540] = 8
R $02:C569 LDA.W $1540,X ; [$1540]
R $02:C585 LDA.W $1540,X ; A = state timer [$1540]
W $02:C5AB STA.W $1540,X ; Timer = $50
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
R $02:C643 LDA.W $1540,X
W $02:C662 STA.W $1540,X ; Timer = $18
R $02:C668 LDA.W $1540,X ; Timer = 0?
W $02:C6D1 STA.W $1540,X ; Timer = $20 (charge time)
R $02:C6D7 LDA.W $1540,X
W $02:C6E9 STA.W $1540,X
R $02:C72B LDA.W $1540,X ; Timer = 0?
W $02:C739 STA.W $1540,X ; Timer = $40
R $02:C74D LDA.W $1540,X ; Timer = 0?
W $02:C75D STA.W $1540,X ; Timer = step duration
W $02:C787 STA.W $1540,X ; Timer = $30
W $02:C801 STA.W $1540,X ; Timer = 3
R $02:C898 LDA.W $1540,X
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:CFD7 LDA.W $1540,X ; A = [$1540]
R $02:D422 LDA.W $1540,X ; Wait for the timer
W $02:D42B STA.W $1540,X ; Timer = $80 frames
R $02:D445 LDA.W $1540,X ; A = timer
W $02:D47B STA.W $1540,X ; Timer = $30 frames of rest
R $02:D481 LDA.W $1540,X ; A = timer
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
W $02:DCF9 STA.W $1540,X ; [$1540] = 3
R $02:DCFF LDA.W $1540,X ; A = timer [$1540]
R $02:DD1B LDA.W $1540,X
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
R $02:DFC9 LDA.W $1540,X
W $02:DFD0 STA.W $1540,X ; Store timer
R $02:DFDF LDA.W $1540,X
R $02:DFEF LDA.W $1540,X
R $02:E13E LDA.W $1540,X
W $02:E171 STA.W $1540,X ; Timer = $50 (hang time at apex)
R $02:E17A LDA.W $1540,X
W $02:E1A0 STA.W $1540,X ; Timer = $40
R $02:E220 LDA.W $1540,X
R $02:E759 LDA.W $1540,X
W $02:E778 STA.W $1540,X
W $02:E780 STA.W $1540,X ; Timer = $80
R $02:E788 LDA.W $1540,X ; Timer [$1540] = 0: finished the jump
W $02:E7B1 STA.W $1540,X ; Timer = $20
R $02:E7C0 LDA.W $1540,X
R $02:E7D4 LDA.W $1540,X
R $02:E7EA LDA.W $1540,X
R $02:E96D LDA.W $1540,X
W $02:E980 STA.W $1540,X ; Set timer [$1540] = A
R $02:E986 LDA.W $1540,X
R $02:E9B4 LDA.W $1540,X
R $02:E9BD LDA.W $1540,X
R $02:E9D5 LDA.W $1540,X
R $02:F043 LDA.W $1540,X
W $02:F28C STA.W $1540,X ; [$1540] = $40: flash timer before getting angry
R $02:F396 LDA.W $1540,X
W $02:F3B3 STA.W $1540,X ; [$1540] = (random AND $1F) OR $0A: time to peck
R $02:F44B LDA.W $1540,X
W $02:F577 STA.W $1540,X ; [$1540] = $20: delay before drifting sideways
R $03:8021 LDA.W $1540,X
R $03:804F LDA.W $1540,X
W $03:80CF STA.W $1540,X ; [$1540] = 8: delay between fade steps
R $03:80D5 LDA.W $1540,X
W $03:80DC STA.W $1540,X ; [$1540] = 8
W $03:80F6 STA.W $1540,X ; [$1540] = $40
R $03:8106 LDA.W $1540,X
R $03:818B LDA.W $1540,X
W $03:8194 STA.W $1540,X ; [$1540] = 8
R $03:81BC LDA.W $1540,X
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
R $03:8462 LDA.W $1540,X
W $03:8486 STA.W $1540,X ; [$1540] = $18: delay before accelerating
R $03:8709 LDA.W $1540,X
R $03:8725 LDA.W $1540,X
W $03:8730 STA.W $1540,X ; Sink timer = $40 frames
W $03:87A8 STA.W $1540,X ; [$1540] = $0A
R $03:87AB LDA.W $1540,X
R $03:899C ORA.W $1540,X
R $03:8AA6 LDA.W $1540,X
W $03:8AC3 STA.W $1540,X ; Wait timer = $30 frames
R $03:8C39 LDA.W $1540,X
W $03:8C42 STA.W $1540,X ; Phase timer [$1540] = $80 frames
R $03:8E80 LDA.W $1540,X
W $03:8E8F STA.W $1540,X
R $03:9227 LDA.W $1540,X
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]
W $03:975A STA.W $1540,X
R $03:9761 LDA.W $1540,X ; A = timer
W $03:977A STA.W $1540,X
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
R $03:9FC8 LDA.W $1540,X ; A = timer
W $03:9FD8 STA.W $1540,X ; Timer = $20
R $03:9FF2 LDA.W $1540,X ; A = timer
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:A461 STA.W $1540,X
W $03:A68E STA.W $1540,X
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:A86A STA.W $1540,X
W $03:ABB6 STA.W $1540,X ; Phase timer [$1540] = $60
R $03:ABC5 LDA.W $1540,X
W $03:ABE2 STA.W $1540,X ; Phase timer [$1540] = $60
R $03:AC22 LDA.W $1540,X
W $03:AD5E STA.W $1540,X ; Timer [$1540] = $A0
R $03:ADB3 LDA.W $1540,X
W $03:AE21 STA.W $1540,X ; Timer [$1540] = $60
R $03:AE25 LDA.W $1540,X
W $03:AE2E STA.W $1540,X ; Timer [$1540] = $A0
R $03:AE32 LDA.W $1540,X
R $03:AEB2 LDA.W $1540,X
W $03:AEC4 STA.W $1540,X ; Timer = delay for this step
W $03:AECC STA.W $1540,X ; Timer [$1540] = $40
R $03:AEE8 LDA.W $1540,X
R $03:B35A LDA.W $1540,X
R $03:B36F LDA.W $1540,X
R $03:C36F LDA.W $1540,X
W $03:C376 STA.W $1540,X ; Hop timer [$1540] = $60 frames
W $03:CC04 STA.W $1540,Y ; New [$1540] = $10 (sprite timer)
R $03:CC8A LDA.W $1540,X
W $03:CCD3 STA.W $1540,X
R $03:CD21 LDA.W $1540,X
W $03:CD28 STA.W $1540,X ; Timer expired: [$1540] = $40, state + 1
R $03:CDCA LDA.W $1540,X
W $03:CDD1 STA.W $1540,X ; Timer = $24
R $03:CDEF LDA.W $1540,X
W $03:CE02 STA.W $1540,X ; Timer = $30 (wait before reappearing)
R $03:CE0E LDA.W $1540,X
W $03:CE7B STA.W $1540,X ; Timer = $80
R $03:CE89 LDA.W $1540,X
W $03:CEE9 STA.W $1540,X
R $07:F1CA LDA.W $1540,X ; A = bonus display timer [$1540,X]
W $07:F73F STZ.W $1540,X ; $1540,X = 0 (timer)

$1549

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
R $01:80F6 LDA.W RAM_DisableInter,X
RW $01:80FB DEC.W RAM_DisableInter,X
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
R $01:A881 LDA.W RAM_DisableInter,X
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:C4BA LDA.W RAM_DisableInter,X
R $01:C708 LDA.W RAM_DisableInter,X
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
R $01:DF3D LDA.W RAM_DisableInter,X
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
R $01:E20B LDA.W RAM_DisableInter,X
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
R $01:FAF7 ORA.W RAM_DisableInter,X
R $01:FBB2 LDA.W RAM_DisableInter,X
R $01:FC0E LDA.W RAM_DisableInter,X
R $01:FCFA LDA.W RAM_DisableInter,X
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
R $02:93C6 ORA.W RAM_DisableInter,X
W $02:9406 STA.W RAM_DisableInter,X ; Disable the sprite's interaction for 8 frames
R $02:94E4 ORA.W RAM_DisableInter,X
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
R $02:F254 LDA.W RAM_DisableInter,X
W $02:F25D STA.W RAM_DisableInter,X ; Disable interaction for 8 frames
R $02:F381 LDA.W RAM_DisableInter,X
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:881E LDA.W RAM_DisableInter,X
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:A47E STA.W RAM_DisableInter,X
W $03:ABDD STA.W RAM_DisableInter,X ; Disable sprite interaction for $20 frames
R $03:AC06 LDA.W RAM_DisableInter,X
W $03:ACB5 STA.W RAM_DisableInter,X ; Blink timer [$154C] = $0C
R $03:ACBB LDA.W RAM_DisableInter,X
W $03:AE48 STA.W RAM_DisableInter,X ; Blink timer [$154C] = $14
R $03:B08E LDA.W RAM_DisableInter,X
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:80FE LDA.W $1558,X
RW $01:8103 DEC.W $1558,X
R $01:8A9B LDA.W $1558,X ; Timer [$1558,X]
W $01:8AD1 STA.W $1558,Y ; Other sprite [$1558] = $10
R $01:8B9D ORA.W $1558,X
R $01:8F99 LDA.W $1558,X ; Throw timer [$1558,X]
R $01:8FA7 LDA.W $1558,X ; Throw timer
W $01:9337 STA.W $1558,X ; Sink timer [$1558] = $40
R $01:965F ORA.W $1558,X ; Sprite state [$C2] = [$1540] | [$1558]
R $01:9664 LDA.W $1558,X
R $01:9834 LDA.W $1558,X
W $01:9A2C STA.W $1558,X ; [$1558] = [$C2] (sprite state, for the draw routine)
W $01:9A3D STZ.W $1558,X ; [$1558] = 0
R $01:9A7B LDA.W $1558,X
R $01:A54D LDA.W $1558,X
R $01:A550 ORA.W $1558,Y ; Return if either sprite has its $1558 timer running (kick/hop in progress)
R $01:A6EE LDA.W $1558,Y
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
R $01:AE01 LDA.W $1558,X
W $01:B4EF STA.W $1558,X ; [$1558] = $10 (timer)
R $01:C47E LDA.W $1558,X
W $01:CED4 STA.W $1558,X ; Timer [$1558] = $60
R $01:CF44 LDA.W $1558,X
R $01:E13E LDA.W $1558,X
W $01:E14C STA.W $1558,X ; [$1558] = $80: time to stay on the ground
R $01:E3DA LDA.W $1558,X
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)
R $01:F12E LDA.W $1558,X
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
R $01:F332 LDA.W $1558,X
W $01:F606 STA.W $1558,X ; Timer $1558 = $0A
W $01:F956 STA.W $1558,X ; Counter wrapped: [$1558] = $20 (purpose unclear)
R $01:FCC0 LDA.W $1558,X
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]
R $02:B7D6 LDA.W $1558,X
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:BF0C LDY.W $1558,X
R $02:BF7F LDA.W $1558,X
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:C466 LDA.W $1558,X
R $02:DBE4 LDA.W $1558,X ; A = [$1558] (Mario on platform timer, probably set by InvisBlkMainRt)
R $02:DC46 LDA.W $1558,X
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]
R $03:83AE LDY.W $1558,X
R $03:8437 LDA.W $1558,X
R $03:896B LDA.W $1558,X
R $03:899F ORA.W $1558,X
W $03:89DF STA.W $1558,X ; Stopped: start $20-frame timer to become a Koopa
R $03:8D76 LDA.W $1558,X
W $03:8D82 STZ.W $1558,X ; Clear the message timer
R $03:8D93 LDA.W $1558,X
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
R $03:9A95 LDA.W $1558,X
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)
R $03:A312 LDA.W $1558,X ; A = [$1558]
R $03:ACDE LDA.W $1558,X
W $03:AE57 STA.W $1558,X ; Start blush timer [$1558] = $80
R $03:C200 LDA.W $1558,X ; A = hit timer [$1558]
R $03:C22B LDA.W $1558,X
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)
R $01:8106 LDA.W $1564,X
RW $01:810B DEC.W $1564,X
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:A429 ORA.W $1564,X
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:E115 LDA.W $1564,X
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
R $01:FB82 ORA.W $1564,X
R $01:FC2A LDA.W $1564,X
R $02:BCF6 LDA.W $1564,X
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:9AB4 LDA.W $1564,X
R $03:9BF7 LDA.W $1564,X ; A = platform bounce timer [$1564,X]
R $03:A2AD LDA.W $1564,X ; A = [$1564,X]
R $03:A3E5 LDA.W $1564,X ; A = [$1564]
R $03:ABF8 LDA.W $1564,X
W $03:ABFF STA.W $1564,X ; Start the $1564 animation timer at $12
R $03:C796 LDA.W $1564,X
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
R $03:C845 LDA.W $1564,X
W $07:F748 STZ.W $1564,X ; $1564,X = 0 (timer)

$156D

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)

$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
R $01:8C7C LDA.W $1570,X
R $01:8CEC LDA.W $1570,X
RW $01:8D59 INC.W $1570,X
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)
R $01:8DEC LDA.W $1570,X
RW $01:8E5F INC.W $1570,X ; Animation counter [$1570,X]++
R $01:8E62 LDA.W $1570,X
R $01:9EC8 LDA.W $1570,X
RW $01:A2F4 INC.W $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:B1EA INC.W $1570,X
RW $01:B1ED INC.W $1570,X ; Animation counter [$1570] += 2
RW $01:BA3B INC.W $1570,X ; Animation frame counter ++
R $01:BA57 LDA.W $1570,X
W $01:BE51 STZ.W $1570,X ; Fade step counter [$1570,X] = 0
RW $01:BFED DEC.W $1570,X ; Step counter [$1570,X]--
R $01:BFF0 LDA.W $1570,X
RW $01:C00E INC.W $1570,X ; Step counter [$1570,X]++
R $01:C011 LDA.W $1570,X
R $01:C028 LDA.W $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:D799 DEC.W $1570,X ; Length--
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
W $01:DDE9 STA.W $1570,X
RW $01:DE4B INC.W $1570,X
R $01:DE4E LDA.W $1570,X
W $01:DE55 STZ.W $1570,X
R $01:DE7E LDY.W $1570,X
W $01:DE84 STA.W $1570,X
R $01:DF6C LDA.W $1570,X ; A = symbol frame [$1570]
R $01:E00D LDA.W $1570,Y
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)
RW $01:EABB DEC.W $1570,X
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
R $01:FBFA LDA.W $1570,X
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)
RW $02:B6BE INC.W $1570,X
R $02:B6C1 LDA.W $1570,X ; Walk timer [$1570]++, mod $80
RW $02:C006 INC.W $1570,X ; Animation timer [$1570]++
R $02:C07D LDA.W $1570,X
R $02:C0BD LDA.W $1570,X
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]
RW $02:C752 INC.W $1570,X
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]
R $02:CCF2 LDA.W $1570,X
RW $02:CE3A INC.W $1570,X ; [$1570]++ (frame counter)
R $02:CE3D LDA.W $1570,X ; A = [$1570]
W $02:CFFA STZ.W $1570,X ; [$1570] = 0
RW $02:DA86 INC.W $1570,X
R $02:DA89 LDA.W $1570,X
R $02:DA97 LDA.W $1570,X
RW $02:DD20 INC.W $1570,X ; Walk counter [$1570]++
R $02:DD23 LDA.W $1570,X
R $02:DD2F LDA.W $1570,X
W $02:DD36 STZ.W $1570,X ; Reset the walk counter
RW $02:DF11 INC.W $1570,X ; Next flame offset index [$1570]++
R $02:DF14 LDA.W $1570,X
RW $02:DF1E INC.W $1570,X ; [$1570]++
R $02:DF4D LDA.W $1570,X
R $02:E0D8 LDA.W $1570,X
RW $02:E166 INC.W $1570,X ; [$1570]++ (animation counter)
RW $02:E17F INC.W $1570,X ; [$1570]++
W $02:E1AA STZ.W $1570,X ; [$1570] = 0
RW $02:E347 INC.W $1570,X ; [$1570]++ (animation counter)
R $02:E3AD LDA.W $1570,X
RW $02:E42F INC.W $1570,X ; [$1570]++
R $02:E432 LDA.W $1570,X
R $02:E43B LDA.W $1570,X
RW $02:E5C3 INC.W $1570,X ; Frame timer [$1570]++
R $02:E5C8 LDA.W $1570,X
RW $02:E75E INC.W $1570,X
R $02:E761 LDY.W $1570,X ; Swim leg counter [$1570]++
W $02:E7AC STZ.W $1570,X ; Swim leg counter = 0
RW $02:E890 INC.W $1570,X
R $02:E893 LDA.W $1570,X ; Phase timer [$1570]++
W $02:E89B STZ.W $1570,X ; Timer = 0
R $02:EEC8 LDA.W $1570,X
RW $02:EECF INC.W $1570,X ; Spawn count++
R $02:EEF9 LDA.W $1570,X
R $02:EFAA LDA.W $1570,X
RW $02:F06A INC.W $1570,X ; Animation counter [$1570]++
RW $02:F072 INC.W $1570,X ; Angry: animation counter runs twice as fast
R $02:F113 LDA.W $1570,X
R $02:F368 LDA.W $1570,X
RW $02:F36D DEC.W $1570,X ; Hops left--
W $02:F37D STA.W $1570,X ; [$1570] = DATA_02F33C[random]
R $02:F3A3 LDA.W $1570,X
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]++
R $02:F439 LDA.W $1570,X
RW $03:80C3 INC.W $1570,X ; [$1570]++: hidden time counter
R $03:80C6 LDA.W $1570,X
W $03:810F STA.W $1570,X ; [$1570] = $40
R $03:8DCF LDA.W $1570,X
RW $03:8DD4 DEC.W $1570,X ; Count down timer [$1570]
R $03:8DD7 LDA.W $1570,X
R $03:8E15 LDA.W $1570,X
RW $03:92F1 DEC.W $1570,X ; Creating: decrement step timer [$1570]
W $03:9316 STA.W $1570,X
RW $03:9537 INC.W $1570,X ; Frame counter [$1570]++
R $03:953A LDA.W $1570,X ; A = [$1570]
RW $03:972F INC.W $1570,X ; Animation counter [$1570]++
R $03:9732 LDA.W $1570,X ; A = counter
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
R $03:A285 LDA.W $1570,X
W $03:A44D STA.W $1570,X
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)
R $03:B264 LDA.W $1570,X
RW $03:B2F9 INC.W $1570,X ; Walk animation counter [$1570]++
R $03:B2FC LDA.W $1570,X
R $03:B404 LDA.W $1570,X
RW $03:C09B INC.W $1570,X ; Count this eaten sprite: [$1570] += 1
R $03:C09E LDA.W $1570,X ; A = eaten sprite count
R $03:C8B4 LDA.W $1570,X
W $03:C8BB STA.W $1570,X
W $03:C8DD STA.W $1570,X ; Size = $FF
R $03:C9EE LDA.W $1570,X
R $03:CC8F LDA.W $1570,X
R $03:CCA0 ORA.W $1570,X
R $03:CCBC LDY.W $1570,X
W $03:CCFC STA.W $1570,Y ; [$1570,Y] = DATA_03CCE0[Y]: part offset ($10 or $20)
R $03:CDF4 LDA.W $1570,X
R $03:CE2A LDY.W $1570,X
R $03:CEC6 LDA.W $1570,X
R $03:CEE2 LDY.W $1570,X
W $07:F751 STZ.W $1570,X ; $1570,X = 0

$1579

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

$157B

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
W $00:FCDE STA.W RAM_SpriteDir,X
RW $01:8314 INC.W RAM_SpriteDir,X ; Direction = 1
RW $01:83E3 INC.W RAM_SpriteDir,X ; Direction = 1
W $01:8515 STA.W RAM_SpriteDir,X
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?
R $01:8BC3 LDA.W RAM_SpriteDir,X
R $01:8BD8 EOR.W RAM_SpriteDir,X
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:8CCA LDA.W RAM_SpriteDir,X
R $01:8CD2 CMP.W RAM_SpriteDir,X ; Direction changed?
R $01:8DBD LDY.W RAM_SpriteDir,X ; Y = direction
R $01:8DFC LDA.W RAM_SpriteDir,X
W $01:8FE9 STA.W RAM_SpriteDir,X ; Direction = 1 (always)
R $01:9089 LDA.W RAM_SpriteDir,X
R $01:90A9 LDA.W RAM_SpriteDir,X
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:973A STA.W RAM_SpriteDir,Y
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]
R $01:98BF LDY.W RAM_SpriteDir,X
W $01:9A1E STA.W RAM_SpriteDir,X ; [RAM_SpriteDir] = A
R $01:9D73 LDA.W RAM_SpriteDir,X
R $01:9DB1 LDA.W RAM_SpriteDir,X
R $01:9DDC LDA.W RAM_SpriteDir,X
R $01:9E4D LDA.W RAM_SpriteDir,X
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:9EF3 STA.W RAM_SpriteDir,X
R $01:9F12 LDA.W RAM_SpriteDir,X
R $01:9F37 LDA.W RAM_SpriteDir,X
W $01:A174 STA.W RAM_SpriteDir,X
W $01:A21A STA.W RAM_SpriteDir,X ; Direction = 1
R $01:A324 LDY.W RAM_SpriteDir,X
R $01:A588 LDA.W RAM_SpriteDir,Y
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?
R $01:A5A8 LDA.W RAM_SpriteDir,X
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:A709 LDA.W RAM_SpriteDir,X
R $01:A787 LDA.W RAM_SpriteDir,X
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
R $01:BEF2 LDA.W RAM_SpriteDir,X
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)
R $01:C6BD LDA.W RAM_SpriteDir,X
W $01:CD60 STA.W RAM_SpriteDir,X ; Direction = 1 (facing right)
R $01:CDBA LDY.W RAM_SpriteDir,X
R $01:CDF5 LDA.W RAM_SpriteDir,X
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
R $01:D0AA LDA.W RAM_SpriteDir,X
W $01:D0AD STA.W RAM_SpriteDir,Y ; New sprite direction = Kid direction
R $01:D1B5 LDA.W RAM_SpriteDir,X
R $01:D1FA LDY.W RAM_SpriteDir,X
R $01:D215 LDY.W RAM_SpriteDir,X
R $01:D224 LDY.W RAM_SpriteDir,X
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
R $01:D874 LDA.W RAM_SpriteDir,X
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)
R $01:DED7 LDA.W RAM_SpriteDir,X
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:EB90 LDA.W RAM_SpriteDir,X
R $01:EC97 LDY.W RAM_SpriteDir,X ; Y = Yoshi direction
R $01:ECA6 LDY.W RAM_SpriteDir,X
R $01:ED80 CMP.W RAM_SpriteDir,X
R $01:EE73 LDA.W RAM_SpriteDir,X
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:F04C LDY.W RAM_SpriteDir,X
R $01:F1F9 LDY.W RAM_SpriteDir,X ; Y = Yoshi direction
R $01:F206 LDY.W RAM_SpriteDir,X
R $01:F238 LDA.W RAM_SpriteDir,X
W $01:F23B STA.W RAM_SpriteDir,Y ; Item direction = Yoshi direction
R $01:F2B9 LDA.W RAM_SpriteDir,X
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
R $01:F923 CMP.W RAM_SpriteDir,X
R $01:F976 LDA.W RAM_SpriteDir,X
W $01:F97B STA.W RAM_SpriteDir,X
R $01:FA5B LDY.W RAM_SpriteDir,X
R $01:FA81 LDY.W RAM_SpriteDir,X
R $01:FB87 LDA.W RAM_SpriteDir,X
R $01:FB8F CMP.W RAM_SpriteDir,X
R $01:FC13 LDA.W RAM_SpriteDir,X
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
R $01:FDC9 LDA.W RAM_SpriteDir,X
W $01:FDCC STA.W RAM_SpriteDir,Y ; Ball direction = kid direction
R $01:FEC8 LDA.W RAM_SpriteDir,X
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
W $02:A140 STA.W RAM_SpriteDir,X
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:B417 STA.W RAM_SpriteDir,X
W $02:B6CC STA.W RAM_SpriteDir,X ; Store it
R $02:B6CF LDY.W RAM_SpriteDir,X ; Y = sprite direction
R $02:B6FC LDA.W RAM_SpriteDir,X
W $02:B701 STA.W RAM_SpriteDir,X
R $02:B8C2 LDY.W RAM_SpriteDir,X ; Y = direction
R $02:B90A LDA.W RAM_SpriteDir,X
R $02:B973 LDA.W RAM_SpriteDir,X
R $02:BB3A LDA.W RAM_SpriteDir,X
W $02:BC06 STA.W RAM_SpriteDir,X
R $02:C0D1 LDY.W RAM_SpriteDir,X
W $02:C12E STA.W RAM_SpriteDir,X
R $02:C18A LDY.W RAM_SpriteDir,X ; Y = direction
R $02:C1AA LDA.W RAM_SpriteDir,X
R $02:C498 LDA.W RAM_SpriteDir,X
W $02:C55A STA.W RAM_SpriteDir,X ; Direction = side
W $02:C606 STA.W RAM_SpriteDir,X ; Sprite direction = that side
R $02:C66D LDA.W RAM_SpriteDir,X
W $02:C672 STA.W RAM_SpriteDir,X
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:C8B6 LDA.W RAM_SpriteDir,X
R $02:CAFE LDA.W RAM_SpriteDir,X
R $02:CB56 LDY.W RAM_SpriteDir,X
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)
R $02:CE51 LDA.W RAM_SpriteDir,X
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:D102 LDY.W RAM_SpriteDir,X
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:DAAF LDA.W RAM_SpriteDir,X
R $02:DB00 LDA.W RAM_SpriteDir,X
R $02:DD13 LDY.W RAM_SpriteDir,X ; Y = sprite direction
R $02:DD81 LDA.W RAM_SpriteDir,X
W $02:DD86 STA.W RAM_SpriteDir,X
R $02:DE41 LDA.W RAM_SpriteDir,X
R $02:E31F LDY.W RAM_SpriteDir,X ; Y = direction
W $02:E473 STA.W RAM_SpriteDir,X ; Facing = direction
R $02:E74E LDY.W RAM_SpriteDir,X
R $02:E768 LDA.W RAM_SpriteDir,X
W $02:E76D STA.W RAM_SpriteDir,X
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)
R $02:EA14 LDA.W RAM_SpriteDir,X
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:EB60 LDY.W RAM_SpriteDir,X
R $02:EB95 LDY.W RAM_SpriteDir,X ; Y = direction
R $02:EBE7 LDY.W RAM_SpriteDir,X
R $02:ECE1 LDA.W RAM_SpriteDir,X
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]
R $02:F0B3 LDA.W RAM_SpriteDir,X
W $02:F0B8 STA.W RAM_SpriteDir,X ; Flip direction
R $02:F0D3 ORA.W RAM_SpriteDir,X
R $02:F1A8 LDA.W RAM_SpriteDir,X ; A = direction
R $02:F1CB LDA.W RAM_SpriteDir,X ; A = direction
R $02:F342 LDY.W RAM_SpriteDir,X
R $02:F3C1 LDA.W RAM_SpriteDir,X
W $02:F3C6 STA.W RAM_SpriteDir,X ; Flip direction
R $02:F3F1 LDY.W RAM_SpriteDir,X
R $03:8128 CMP.W RAM_SpriteDir,X
R $03:8137 LDA.W RAM_SpriteDir,X
W $03:813C STA.W RAM_SpriteDir,X ; Flip direction: [$157C] ^= 1
R $03:83D4 LDA.W RAM_SpriteDir,X
R $03:8516 LDY.W RAM_SpriteDir,X
W $03:8548 STA.W RAM_SpriteDir,X ; Face Mario: [$157C] = 1 if Mario is to the left, else 0
R $03:85AC LDA.W RAM_SpriteDir,X
RW $03:861B INC.W RAM_SpriteDir,X ; [$1602] = $FF; [$157C]++: swap the direction
R $03:861E LDA.W RAM_SpriteDir,X
R $03:877D LDY.W RAM_SpriteDir,X
R $03:87C5 LDA.W RAM_SpriteDir,X
W $03:87CA STA.W RAM_SpriteDir,X ; Flip walking direction
R $03:87D1 LDA.W RAM_SpriteDir,X
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
R $03:8972 LDA.W RAM_SpriteDir,X
W $03:897F STA.W RAM_SpriteDir,X ; Restore direction
R $03:8A91 LDA.W RAM_SpriteDir,X
W $03:8A96 STA.W RAM_SpriteDir,X ; Flip direction
W $03:8AB6 STA.W RAM_SpriteDir,X
R $03:8AF3 LDA.W RAM_SpriteDir,X
R $03:8B1E LDA.W RAM_SpriteDir,X
W $03:8B21 STA.W RAM_SpriteDir,Y ; New sprite direction = statue direction
R $03:8B4F LDA.W RAM_SpriteDir,X
R $03:8EFA LDY.W RAM_SpriteDir,X
R $03:8F1E LDA.W RAM_SpriteDir,X
W $03:8F81 STA.W RAM_SpriteDir,X
W $03:9083 STA.W RAM_SpriteDir,X ; Face Mario: direction = Y
R $03:90F3 LDA.W RAM_SpriteDir,X
R $03:9188 LDA.W RAM_SpriteDir,X
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
R $03:9579 LDA.W RAM_SpriteDir,X
W $03:957E STA.W RAM_SpriteDir,X
W $03:95D6 STA.W RAM_SpriteDir,X ; Rex turns towards Mario
R $03:969B LDA.W RAM_SpriteDir,X
R $03:9745 LDY.W RAM_SpriteDir,X ; Y = direction
R $03:97A4 LDA.W RAM_SpriteDir,X
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:9B84 LDA.W RAM_SpriteDir,X
R $03:9C81 LDA.W RAM_SpriteDir,X
W $03:9C86 STA.W RAM_SpriteDir,X
W $03:9CD7 STA.W RAM_SpriteDir,X
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
R $03:ACC1 LDA.W RAM_SpriteDir,X
W $03:ADC6 STA.W RAM_SpriteDir,X ; Peach faces Mario
W $03:AE0A STA.W RAM_SpriteDir,X
W $03:AE18 STA.W RAM_SpriteDir,X
R $03:AF5C LDA.W RAM_SpriteDir,X
R $03:B2CC LDY.W RAM_SpriteDir,X ; Y = facing direction
W $03:B2E0 STA.W RAM_SpriteDir,X
R $03:B2F1 LDA.W RAM_SpriteDir,X
W $03:B2F6 STA.W RAM_SpriteDir,X
R $03:B393 LDA.W RAM_SpriteDir,X
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)
W $03:C358 STA.W RAM_SpriteDir,X
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:C3E8 LDA.W RAM_SpriteDir,X
R $03:C3EC ADC.W RAM_SpriteDir,X ; [$02] = direction * 3 (index into the X offset tables)
R $03:C481 LDA.W RAM_SpriteDir,X
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:8008 LDA.W RAM_SprObjStatus,X
R $01:800E LDA.W RAM_SprObjStatus,X
R $01:8014 LDA.W RAM_SprObjStatus,X
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
R $01:8C68 AND.W RAM_SprObjStatus,X
W $01:9085 STZ.W RAM_SprObjStatus,X ; Ignore objects: clear the object status
R $01:908D AND.W RAM_SprObjStatus,X
W $01:9143 STZ.W RAM_SprObjStatus,X ; Clear sprite-object status (blocked bits)
R $01:919E LDA.W RAM_SprObjStatus,X
R $01:91C3 LDA.W RAM_SprObjStatus,X
R $01:91E5 LDA.W RAM_SprObjStatus,X
W $01:91EA STA.W RAM_SprObjStatus,X
R $01:92B2 LDA.W RAM_SprObjStatus,X
W $01:92B7 STA.W RAM_SprObjStatus,X
R $01:9307 LDA.W RAM_SprObjStatus,X
W $01:930C STA.W RAM_SprObjStatus,X
R $01:941C LDA.W RAM_SprObjStatus,X
W $01:9421 STA.W RAM_SprObjStatus,X
R $01:9437 LDA.W RAM_SprObjStatus,X
W $01:943D STA.W RAM_SprObjStatus,X
R $01:95BF LDA.W RAM_SprObjStatus,X
R $01:97FE LDY.W RAM_SprObjStatus,X
R $01:99B7 LDA.W RAM_SprObjStatus,X
R $01:9A04 LDA.W RAM_SprObjStatus,X
R $01:A4E2 LDA.W RAM_SprObjStatus,Y
R $01:A6E0 LDA.W RAM_SprObjStatus,Y
R $01:A73A LDA.W RAM_SprObjStatus,Y
R $01:B0B3 LDA.W RAM_SprObjStatus,X ; A = block contact flags
R $01:B56A LDA.W RAM_SprObjStatus,X
R $01:BA04 LDA.W RAM_SprObjStatus,X ; A = blocked-status bits
RW $01:C0B1 INC.W RAM_SprObjStatus,X ; Flip direction [$1588,X]++
R $01:C0B4 LDA.W RAM_SprObjStatus,X
R $01:C1BE LDA.W RAM_SprObjStatus,X
R $01:C3EA LDA.W RAM_SprObjStatus,X
W $01:C3FF STZ.W RAM_SprObjStatus,X ; Unreferenced (Mode 7 boss room movement): clear contact flags
R $01:C413 LDA.W RAM_SprObjStatus,X
W $01:C418 STA.W RAM_SprObjStatus,X ; Set "on ground" flag (bit 2)
R $01:C463 LDY.W RAM_SprObjStatus,X
R $01:C6F8 LDA.W RAM_SprObjStatus,X
R $01:E135 LDA.W RAM_SprObjStatus,X
R $01:E4E6 AND.W RAM_SprObjStatus,X
R $02:94D5 LDA.W RAM_SprObjStatus,X
R $02:B6EC LDA.W RAM_SprObjStatus,X
R $02:B6F5 LDA.W RAM_SprObjStatus,X
R $02:BD8A LDA.W RAM_SprObjStatus,X
R $02:BDC8 LDA.W RAM_SprObjStatus,X
R $02:BE10 LDA.W RAM_SprObjStatus,X
R $02:C009 LDA.W RAM_SprObjStatus,X
R $02:C012 LDA.W RAM_SprObjStatus,X
R $02:C044 LDA.W RAM_SprObjStatus,X
R $02:C23D LDA.W RAM_SprObjStatus,X
R $02:C269 LDA.W RAM_SprObjStatus,X
R $02:C274 LDA.W RAM_SprObjStatus,X
R $02:C294 LDA.W RAM_SprObjStatus,X
R $02:C2A6 LDA.W RAM_SprObjStatus,X
R $02:C2E4 LDA.W RAM_SprObjStatus,X
R $02:C2F7 LDA.W RAM_SprObjStatus,X
R $02:C507 LDA.W RAM_SprObjStatus,X
R $02:C541 LDA.W RAM_SprObjStatus,X
R $02:C56E LDA.W RAM_SprObjStatus,X
R $02:C6A7 LDA.W RAM_SprObjStatus,X
R $02:C6F5 LDA.W RAM_SprObjStatus,X
R $02:D958 LDA.W RAM_SprObjStatus,X ; A = object contact flags
R $02:DCD0 LDA.W RAM_SprObjStatus,X
R $02:DEC5 LDA.W RAM_SprObjStatus,X
R $02:DFB3 LDA.W RAM_SprObjStatus,X
R $02:E195 LDA.W RAM_SprObjStatus,X
R $02:E7EF LDA.W RAM_SprObjStatus,X
R $02:E7FD LDA.W RAM_SprObjStatus,X
R $02:E808 LDA.W RAM_SprObjStatus,X
R $02:EE2D LDA.W RAM_SprObjStatus,Y
R $02:EE4C LDA.W RAM_SprObjStatus,X
R $02:F09B LDA.W RAM_SprObjStatus,X
R $02:F0A2 LDA.W RAM_SprObjStatus,X
R $02:FFD1 LDA.W RAM_SprObjStatus,X
R $03:8031 LDA.W RAM_SprObjStatus,X
R $03:803F LDA.W RAM_SprObjStatus,X
R $03:8048 LDA.W RAM_SprObjStatus,X
R $03:8789 LDA.W RAM_SprObjStatus,X
R $03:8797 LDA.W RAM_SprObjStatus,X
R $03:87B5 LDA.W RAM_SprObjStatus,X
R $03:89A8 LDA.W RAM_SprObjStatus,X
R $03:8A5F LDA.W RAM_SprObjStatus,X
R $03:8A83 LDA.W RAM_SprObjStatus,X
R $03:8A99 LDA.W RAM_SprObjStatus,X
R $03:8FCE LDA.W RAM_SprObjStatus,X
R $03:8FDC LDA.W RAM_SprObjStatus,X
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:9C7A LDA.W RAM_SprObjStatus,X
R $03:9C8C LDA.W RAM_SprObjStatus,X ; A = object contact flags
R $03:9CA8 LDA.W RAM_SprObjStatus,X
R $03:9CF1 LDA.W RAM_SprObjStatus,X ; A = object contact flags
R $03:B2C3 LDA.W RAM_SprObjStatus,X
R $03:B2E3 LDA.W RAM_SprObjStatus,X
R $03:B80F LDY.W RAM_SprObjStatus,X
R $03:C366 LDA.W RAM_SprObjStatus,X
W $07:F736 STZ.W RAM_SprObjStatus,X ; Sprite object-contact status = 0

$1593

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:8EDC STA.W $1594,X
W $01:8EE1 STZ.W $1594,X ; Clear the Mario nearby flag
R $01:966D LDY.W $1594,X
W $01:A770 STA.W $1594,Y ; $1594,Y = X (link the pair)
W $01:A774 STA.W $1594,X ; $1594,X = Y
R $01:ADA1 LDA.W $1594,X
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:D19A LDY.W $1594,X
R $01:D1C3 LDY.W $1594,X
R $01:D1E3 ADC.W $1594,X
R $01:D1F7 LDA.W $1594,X ; A = wall number
R $01:D218 LDA.W $1594,X
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]
R $01:F0C4 LDA.W $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 $01:F737 STZ.W $1594,X ; Clear $1594
R $02:C683 LDA.W $1594,X
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]
W $03:A8BA STA.W $1594,X
R $07:F1D1 LDA.W $1594,X
R $07:F253 LDA.W $1594,X
W $07:F77C STZ.W $1594,X ; $1594,X = 0

$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 $00:FAAA LDA.W RAM_OffscreenHorz,Y
R $01:80CB LDA.W RAM_OffscreenHorz,X
R $01:8F07 LDA.W RAM_OffscreenHorz,X ; Sprite off-screen horizontally flag
R $01:99A6 LDA.W RAM_OffscreenHorz,X
R $01:9DCC ORA.W RAM_OffscreenHorz,X
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)
RW $01:A376 INC.W RAM_OffscreenHorz,X
R $01:A7F0 ORA.W RAM_OffscreenHorz,X ; Only every other frame, and only if on screen horizontally
R $01:AEC8 LDA.W RAM_OffscreenHorz,X
R $01:BC5A LDA.W RAM_OffscreenHorz,X ; Off-screen horizontally?
R $01:BDDB LDA.W RAM_OffscreenHorz,X
R $01:BE8D ORA.W RAM_OffscreenHorz,X ; Sprites locked or off-screen horizontally?
R $01:BF0F ORA.W RAM_OffscreenHorz,X
R $01:D015 LDA.W RAM_OffscreenHorz,X
W $01:DE2A STZ.W RAM_OffscreenHorz,X ; Clear this block's off-screen-horizontal flag
R $01:E2EC LDA.W RAM_OffscreenHorz,X
R $01:E95E LDA.W RAM_OffscreenHorz,X ; A = horizontal offscreen flag
R $01:F3FE LDA.W RAM_OffscreenHorz,X
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:C0DC LDA.W RAM_OffscreenHorz,X
R $02:C27B LDA.W RAM_OffscreenHorz,X
R $02:CF5C ORA.W RAM_OffscreenHorz,X
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:DD57 LDA.W RAM_OffscreenHorz,X
R $02:DED6 LDA.W RAM_OffscreenHorz,X
R $02:E079 LDA.W RAM_OffscreenHorz,X
R $02:E1B1 LDA.W RAM_OffscreenHorz,X
R $02:E459 LDY.W RAM_OffscreenHorz,X
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
R $03:88E4 LDA.W RAM_OffscreenHorz,X
R $03:9F57 LDA.W RAM_OffscreenHorz,X
W $03:A0F5 STZ.W RAM_OffscreenHorz,X ; Not off-screen horizontally
R $03:B0E6 LDA.W RAM_OffscreenHorz,Y
W $03:B763 STZ.W RAM_OffscreenHorz,X ; Clear horizontal offscreen flag
RW $03:B771 INC.W RAM_OffscreenHorz,X ; Set horizontal offscreen flag
R $03:B8FB LDA.W RAM_OffscreenHorz,X
R $03:C44E LDA.W RAM_OffscreenHorz,X
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)
R $01:8116 LDA.W $15AC,X
RW $01:811B DEC.W $15AC,X
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
R $01:9098 LDA.W $15AC,X
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
R $01:A597 LDA.W $15AC,Y
W $01:A59E STA.W $15AC,Y ; $15AC,A = 8 (turning animation)
R $01:A5B9 LDA.W $15AC,X
W $01:A5C0 STA.W $15AC,X ; $15AC,B = 8 (turning animation)
R $01:CDB5 LDA.W $15AC,X
W $01:CE08 STA.W $15AC,X ; Direction changed: turn timer [$15AC] = $10
R $01:CE89 LDY.W $15AC,X
R $01:D157 LDY.W $15AC,X
W $01:D25A STA.W $15AC,X ; Set turning timer [$15AC] = $0A
R $01:EAF0 LDA.W $15AC,X
R $01:ED85 LDA.W $15AC,X
W $01:ED92 STA.W $15AC,X ; ...set turning timer [$15AC] = $10
R $01:EE65 LDY.W $15AC,X ; Y = turn timer [$15AC,X]
R $01:EF59 LDA.W $15AC,X
R $01:F91D LDA.W $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
R $01:FC17 LDY.W $15AC,X
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)
R $02:F0AE LDA.W $15AC,X
W $02:F0C0 STA.W $15AC,X ; Turn timer [$15AC] = 8
R $02:F317 LDA.W $15AC,X
W $02:F3CB STA.W $15AC,X ; Turn timer [$15AC] = $0A
R $03:811F LDA.W $15AC,X
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:9076 LDA.W $15AC,X
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]
R $03:C397 LDY.W $15AC,X
R $03:C3E3 LDA.W $15AC,X
W $03:C87D STA.W $15AC,X ; Burst delay [$15AC] = DATA_03C841[rocket]
R $03:C88D LDA.W $15AC,X

$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:9949 LDA.W $15B8,X
R $01:995A CMP.W $15B8,X
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 $02:E81D LDY.W $15B8,X
R $02:FFD8 LDY.W $15B8,X
R $03:8068 LDY.W $15B8,X
R $03:89BF LDA.W $15B8,X
R $03:89D4 LDA.W $15B8,X
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)
W $02:D3A3 STA.W $15C4,X
R $02:D78B LDA.W $15C4,X ; A = offscreen flag [$15C4+X]
W $03:B78B STA.W $15C4,X
W $07:F739 STZ.W $15C4,X ; $15C4,X = 0

$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:91CB LDA.W $15D0,X
R $01:9405 LDA.W $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
R $01:C31C LDA.W $15D0,X
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:F223 STA.W $15D0,Y
W $01:F520 STA.W $15D0,Y ; Eaten sprite flag $15D0 = 1 (being eaten)
R $01:F656 ORA.W $15D0,Y
R $02:93C3 ORA.W $15D0,X
R $02:94E1 ORA.W $15D0,X
R $02:A0C9 ORA.W $15D0,X
R $02:F277 ORA.W $15D0,X
R $03:8821 ORA.W $15D0,X
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)
R $01:907C LDA.W $15DC,X
R $02:E60C LDA.W $15DC,Y
W $02:E629 STA.W $15DC,Y ; [$15DC,Y] = 0 (no contact)
W $02:E630 STA.W $15DC,Y
W $07:F75E STZ.W $15DC,X ; $15DC,X = 0

$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:96FA LDX.W $15E9
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:DF4A ADC.W $15E9 ; Unreachable
R $01:E039 LDX.W $15E9 ; X = this sprite index
R $01:E179 ADC.W $15E9
R $01:E91E LDX.W $15E9 ; X = sprite index
R $01:E942 LDX.W $15E9 ; X = sprite index
R $01:EA7B LDA.W $15E9
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 $01:F63B CPY.W $15E9
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:9B8E EOR.W $15E9
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:E5F9 CPY.W $15E9
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:EA5B CPY.W $15E9
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:84D8 ADC.W $15E9
R $03:8660 CPY.W $15E9
R $03:884D ADC.W $15E9
R $03:99A4 LDX.W $15E9 ; X = sprite index
R $03:AAF3 LDX.W $15E9 ; X = current sprite index
R $03:C4E3 CPY.W $15E9
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
R $01:8DAF LDA.W RAM_SprOAMIndex,X
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
R $01:9808 LDY.W RAM_SprOAMIndex,X
R $01:9812 LDA.W RAM_SprOAMIndex,X
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:9A44 LDY.W RAM_SprOAMIndex,X
R $01:9A5A LDY.W RAM_SprOAMIndex,X ; Y = OAM index
R $01:9B07 LDY.W RAM_SprOAMIndex,X
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
W $01:9EBE STA.W RAM_SprOAMIndex,X
R $01:9EE3 LDA.W RAM_SprOAMIndex,X
W $01:9EE9 STA.W RAM_SprOAMIndex,X
W $01:9EF7 STA.W RAM_SprOAMIndex,X
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
R $01:9FD7 LDY.W RAM_SprOAMIndex,X
R $01:A1C7 LDY.W RAM_SprOAMIndex,X
R $01:A20C LDY.W RAM_SprOAMIndex,X
R $01:A222 LDY.W RAM_SprOAMIndex,X
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:BEBC LDA.W RAM_SprOAMIndex,X
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:E469 STA.W RAM_SprOAMIndex,X
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:EF55 LDA.W RAM_SprOAMIndex,X
W $01:EF63 STA.W RAM_SprOAMIndex,X
R $01:EF66 LDA.W RAM_SprOAMIndex,X
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:8105 ADC.W RAM_SprOAMIndex,X
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)
R $02:BF15 LDA.W RAM_SprOAMIndex,X
W $02:BF1B STA.W RAM_SprOAMIndex,X ; OAM index -= 4 (back to the reserved slot)
R $02:C8C2 LDA.W RAM_SprOAMIndex,X
R $02:CBBB LDA.W RAM_SprOAMIndex,X
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:D8BB LDA.W RAM_SprOAMIndex,X
W $02:D8C1 STA.W RAM_SprOAMIndex,X
R $02:D8CB LDY.W RAM_SprOAMIndex,X ; Y = OAM index of the contained sprite tile
R $02:D9E6 LDA.W RAM_SprOAMIndex,X
W $02:D9EC STA.W RAM_SprOAMIndex,X
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:E061 LDA.W RAM_SprOAMIndex,X
W $02:E067 STA.W RAM_SprOAMIndex,X
R $02:E0E8 LDA.W RAM_SprOAMIndex,X
W $02:E0EE STA.W RAM_SprOAMIndex,X
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:E4EB LDA.W RAM_SprOAMIndex,X
W $02:E4F1 STA.W RAM_SprOAMIndex,X
W $02:E681 STA.W RAM_SprOAMIndex,X
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
R $02:EE66 LDA.W RAM_SprOAMIndex,X
R $02:EF1C LDA.W RAM_SprOAMIndex,X
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
R $02:F4EB LDA.W RAM_SprOAMIndex,X
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:97B0 LDA.W RAM_SprOAMIndex,X
W $03:97B6 STA.W RAM_SprOAMIndex,X
R $03:9BEB LDA.W RAM_SprOAMIndex,X
W $03:9BF1 STA.W RAM_SprOAMIndex,X
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:B3F7 LDA.W RAM_SprOAMIndex,X
W $03:B3FD STA.W RAM_SprOAMIndex,X
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)
R $00:FC3B LDA.W RAM_SpritePal,Y
W $00:FC42 STA.W RAM_SpritePal,Y
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:845D STA.W RAM_SpritePal,X
RW $01:859A ASL.W RAM_SpritePal,X
RW $01:859E ROR.W RAM_SpritePal,X
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
W $01:9658 STA.W RAM_SpritePal,X
RW $01:967C ASL.W RAM_SpritePal,X
RW $01:967F LSR.W RAM_SpritePal,X ; Clear [$15F6] bit 7 (vertical flip)
RW $01:96D0 ASL.W RAM_SpritePal,X
RW $01:96D3 LSR.W RAM_SpritePal,X ; Clear [$15F6] bit 7 (vertical flip)
R $01:9858 LDA.W RAM_SpritePal,X
R $01:9903 LDA.W RAM_SpritePal,X
W $01:990A STA.W RAM_SpritePal,X
R $01:9B44 LDA.W RAM_SpritePal,X
W $01:9B49 STA.W RAM_SpritePal,X
R $01:9D10 LDA.W RAM_SpritePal,X
R $01:9D67 LDA.W RAM_SpritePal,X
R $01:9DB7 ORA.W RAM_SpritePal,X
R $01:9F3D ORA.W RAM_SpritePal,X ; A = sprite palette bits
R $01:A17B LDA.W RAM_SpritePal,X
W $01:A180 STA.W RAM_SpritePal,X
R $01:A1DE LDA.W RAM_SpritePal,X
W $01:A1E5 STA.W RAM_SpritePal,X
R $01:A2D8 LDA.W RAM_SpritePal,X ; Save palette
W $01:A2E3 STA.W RAM_SpritePal,X ; Clear palette bit 0
R $01:A741 LDA.W RAM_SpritePal,Y
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:AB11 LSR.W RAM_SpritePal,X
RW $01:AB14 ASL.W RAM_SpritePal,X ; Clear bit 0 of sprite palette/properties [$15F6,X]
R $01:B086 LDA.W RAM_SpritePal,X
W $01:B08B STA.W RAM_SpritePal,X
RW $01:B0AD ASL.W RAM_SpritePal,X
RW $01:B0B0 LSR.W RAM_SpritePal,X ; Clear Y flip
R $01:B112 LDA.W RAM_SpritePal,X
W $01:B119 STA.W RAM_SpritePal,X
RW $01:B122 LSR.W RAM_SpritePal,X
RW $01:B126 ROL.W RAM_SpritePal,X
R $01:B35B ORA.W RAM_SpritePal,X ; Tile properties = priority [$64] | sprite properties (first tile)
R $01:B3E0 LDA.W RAM_SpritePal,X
R $01:B95D LDA.W RAM_SpritePal,X
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
R $01:BD74 LDA.W RAM_SpritePal,X
R $01:BEFE ORA.W RAM_SpritePal,X
R $01:C276 EOR.W RAM_SpritePal,X
W $01:C279 STA.W RAM_SpritePal,X ; Cycle the sprite palette: [$15F6,X] ^= ([$14] >> 1) & $0E
R $01:C4D3 LDA.W RAM_SpritePal,X
R $01:C657 LDA.W RAM_SpritePal,X
R $01:C6C9 ORA.W RAM_SpritePal,X
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
R $01:E0B7 LDA.W RAM_SpritePal,X
W $01:E0C8 STA.W RAM_SpritePal,X ; Store the flip bit
W $01:E36B STA.W RAM_SpritePal,X ; Store
R $01:E376 LDA.W RAM_SpritePal,X
W $01:E37B STA.W RAM_SpritePal,X ; Clear the flip bits again
RW $01:E432 ASL.W RAM_SpritePal,X
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:EB8A LDA.W RAM_SpritePal,X
R $01:F175 LDA.W RAM_SpritePal,X
R $01:F185 LDA.W RAM_SpritePal,Y
R $01:F26A LDA.W RAM_SpritePal,Y
R $01:F273 LDA.W RAM_SpritePal,X
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:9485 ASL.W RAM_SpritePal,X
RW $02:9489 ROR.W RAM_SpritePal,X ; Set the Y flip bit of the sprite palette byte (upside down)
R $02:A9BD LDA.W RAM_SpritePal,X
W $02:A9C4 STA.W RAM_SpritePal,X ; Sprite palette = 1 (silver coin colours), other bits kept
R $02:AC3A LDA.W RAM_SpritePal,X
W $02:AC45 STA.W RAM_SpritePal ; Restore the palette
R $02:B903 LDA.W RAM_SpritePal,X
R $02:B9E9 LDA.W RAM_SpritePal,X
W $02:B9F0 STA.W RAM_SpritePal,X ; Sprite palette: clear bits 1-3, then palette bits = 2 (silver coin colors)
R $02:BC75 LDA.W RAM_SpritePal,X
R $02:BD12 LDA.W RAM_SpritePal,X
W $02:BD1A STA.W RAM_SpritePal,X ; Sprite palette bits: keep low 6, set X/Y flip from table
R $02:C8BB LDA.W RAM_SpritePal,X
W $02:E10F STA.W RAM_SpritePal,X ; Palette = $0A
R $02:E5A0 LDA.W RAM_SpritePal,X
R $02:E923 LDA.W RAM_SpritePal,X
R $02:ECE6 LDA.W RAM_SpritePal,X
R $02:F054 LDA.W RAM_SpritePal,X
W $02:F05B STA.W RAM_SpritePal,X ; Sprite palette = ([pal] AND $F1) OR [$00]
R $02:F118 LDA.W RAM_SpritePal,X
R $03:8054 LDA.W RAM_SpritePal,X
W $03:8059 STA.W RAM_SpritePal,X ; Flip the sprite horizontally: [$15F6] ^= $40
R $03:81B0 EOR.W RAM_SpritePal,X
W $03:81B3 STA.W RAM_SpritePal,X ; Flash: [$15F6] ^= [$1540] & $0E (palette bits)
R $03:83D9 LDA.W RAM_SpritePal,X
R $03:8B4A LDA.W RAM_SpritePal,X
W $03:B357 STA.W RAM_SpritePal,X ; Set sprite palette
W $03:B37C STA.W RAM_SpritePal,X
R $03:B382 LDA.W RAM_SpritePal,X
R $03:C07F LDA.W RAM_SpritePal,X
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:83D6 STA.W $1602,X
R $01:8916 LDA.W $1602,X
W $01:891C STA.W $1602,X
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)
W $01:8D48 STA.W $1602,X
R $01:8DF4 ADC.W $1602,X
W $01:8E6A STA.W $1602,X
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
R $01:982A LDA.W $1602,X
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
R $01:9D06 LDA.W $1602,X
R $01:9D85 LDA.W $1602,X
R $01:9DE9 LDA.W $1602,X
R $01:9E2F LDA.W $1602,X
R $01:9F19 LDA.W $1602,X
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]
R $01:B09C LDA.W $1602,X
W $01:B0A2 STA.W $1602,X
R $01:B10A LDA.W $1602,X
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)
R $01:B2E2 LDA.W $1602,X
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:BEAF LDA.W $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]++)
R $01:C77E ORA.W $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
R $01:CDAE LDA.W $1602,X
R $01:CDCB LDY.W $1602,X
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]
R $01:D634 LDA.W $1602,X ; Frame
W $01:D642 STA.W $1602,X ; Store [$1602] (enemy pose)
W $01:D64A STZ.W $1602,X ; Landed: frame 0
R $01:D64D LDY.W $1602,X ; Y = frame
W $01:D6D8 STA.W $1602,X ; Animation frame [$1602] = $10 or 0
R $01:DAA4 LDA.W $1602,X ; Platform type [$1602]
R $01:DAF6 LDA.W $1602,X
RW $01:E0C0 INC.W $1602,X
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]
R $01:EB61 LDY.W $1602,X ; Y = pose
R $01:EB7A LDY.W $1602,X
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:EE87 STA.W $1602,X
W $01:EED9 STA.W $1602,X ; Restore the original animation frame
R $01:EF18 LDY.W $1602,X
W $01:EF21 STA.W $1602,X
W $01:EF94 STA.W $1602,X ; Body tile = YoshiBodyTiles[frame]
R $01:F054 LDY.W $1602,X
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
R $01:FA1C LDA.W $1602,X ; A = frame
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)
R $01:FED4 LDA.W $1602,X
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
R $02:BF7A LDA.W $1602,X
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:C358 STA.W $1602,X ; Set it
W $02:C391 STA.W $1602,X ; Set body frame
W $02:C415 STA.W $1602,X ; Idle: body frame 0
W $02:C425 STA.W $1602,X
W $02:C450 STA.W $1602,X ; Set body frame
W $02:C4BD STZ.W $1602,X
W $02:C4DF STA.W $1602,X ; Set 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:C722 STA.W $1602,X ; Store pose
W $02:C728 STA.W $1602,X ; Pose = 3 (standing)
W $02:C763 STA.W $1602,X ; Pose = hurt pose by step
R $02:C88E LDY.W $1602,X
R $02:CBA7 LDA.W $1602,X
W $02:D1D9 STA.W $1602,X ; [$1602] = Yoshi pose
R $02:D644 ADC.W $1602,X ; Angle low [$1602+X] += step
W $02:D647 STA.W $1602,X
R $02:D658 LDA.W $1602,X ; A = angle low
W $02:DCEC STA.W $1602,X
W $02:DCF4 STZ.W $1602,X ; Frame = 0
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
R $02:DE50 LDA.W $1602,X
W $02:DFDB STA.W $1602,X ; Store in [$1602]
W $02:E004 STA.W $1602,X ; Store in [$1602]
R $02:E041 LDA.W $1602,X
W $02:E0E1 STA.W $1602,X ; Store in [$1602]
W $02:E0F9 STA.W $1602,X ; Store in [$1602]
W $02:E155 STZ.W $1602,X ; Frame = 0
R $02:E4C8 LDA.W $1602,X
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)
R $02:EA03 LDA.W $1602,X
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]
R $02:ECED LDA.W $1602,X
W $02:F0BB STZ.W $1602,X ; Reset the segment state counter [$1602]
R $02:F0C6 LDA.W $1602,X
RW $02:F0C9 INC.W $1602,X ; A = [$1602], then [$1602]++
W $02:F31E STA.W $1602,X ; Frame [$1602] = 4 (turned)
W $02:F34A STZ.W $1602,X ; Frame 0
W $02:F393 STZ.W $1602,X ; Frame 0
RW $02:F39F INC.W $1602,X ; Last 8 frames: frame 1 (peck)
R $02:F412 LDA.W $1602,X
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]
R $03:83C5 LDA.W $1602,X
R $03:8430 LDA.W $1602,X
RW $03:860C DEC.W $1602,X ; [$1602]--: direction switch timer
R $03:860F LDA.W $1602,X
W $03:8618 STA.W $1602,X
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
R $03:88AB LDA.W $1602,X
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)
R $03:8B40 LDA.W $1602,X
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
R $03:9183 LDA.W $1602,X
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:9685 STA.W $1602,X ; Store frame
W $03:968F STA.W $1602,X ; Store frame
R $03:9695 LDA.W $1602,X
W $03:9739 STA.W $1602,X
W $03:975E STZ.W $1602,X ; Animation frame = 0
R $03:97AA LDA.W $1602,X
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
R $03:9B7D LDA.W $1602,X
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:A09D LDA.W $1602,X
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
R $03:B38C LDA.W $1602,X
W $03:C08F STA.W $1602,X ; [$1602] = $0C (animation frame)
W $03:C38C STA.W $1602,X
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
R $03:C9F3 LDA.W $1602,X
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:CE3E STA.W $1602,X
W $03:CE52 STA.W $1602,X ; [$1602] = DATA_03CE56[Y]: recoil animation frame
R $03:D487 LDA.W $1602,X
R $03:D48C ADC.W $1602,X
R $03:D48F ADC.W $1602,X
R $03:D49B LDA.W $1602,X
R $03:D4E0 LDA.W $1602,X
W $07:F73C STZ.W $1602,X ; $1602,X = 0 (animation frame)
R $0C:A01A LDX.W $1602 ; X = [$1602] (Yoshi animation frame)
R $0C:A781 LDA.W $1602
W $0C:A78A STA.W $1602 ; Restore [$1602]
R $0C:A7A1 LDA.W $1602
W $0C:A7A5 STA.W $1602
W $0C:A7AC STZ.W $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)
W $01:8572 STA.W $160E,X
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]
R $01:9682 LDY.W $160E,X ; Y = [$160E]
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])
R $01:A295 LDA.W $160E,Y
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])?
R $01:C353 LDA.W $160E,X
R $01:C9DA LDA.W $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
R $01:CF05 LDA.W $160E,X
RW $01:D179 DEC.W $160E,X ; Right walk limit [$160E]--
R $01:D187 LDA.W $160E,X
R $01:D1AE CMP.W $160E,X
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
R $01:F34A LDY.W $160E,X
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
R $01:F636 CMP.W $160E,X
R $01:FB41 LDA.W $160E,X
R $01:FC68 LDA.W $160E,X
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
R $02:EA51 CMP.W $160E,X
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:CC9A STA.W $160E,X
R $03:CC9D LDA.W $160E,X
R $03:CD04 LDA.W $160E,X
W $03:CD07 STA.W $160E,Y ; Copy [$160E] (pipe seed) from the main sprite
W $07:F779 STZ.W $160E,X ; $160E,X = 0

$1617

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 read)

$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
R $01:AC95 LDY.W RAM_SprIndexInLvl,X
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 $02:D081 LDY.W RAM_SprIndexInLvl,X
R $03:870F LDY.W RAM_SprIndexInLvl,X
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)
RW $01:A601 INC.W $1626,X
R $01:A604 LDY.W $1626,X ; B consecutive-kill counter $1626++, Y = count
R $01:A64B LDA.W $1626,Y
W $01:A64F STA.W $1626,Y
R $01:A652 LDX.W $1626,Y
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]
RW $01:CFC6 INC.W $1626,X
R $01:CFC9 LDA.W $1626,X ; Hit counter [$1626]++
R $01:D149 LDY.W $1626,X
R $01:D1D8 LDA.W $1626,X
RW $01:D3F8 INC.W $1626,X ; Fireball hit count [$1626]++
R $01:D3FB LDA.W $1626,X ; Hit count
RW $01:D6E9 INC.W $1626,X ; [$1626]++ (probably 'waiting for Mario' flag)
R $01:D73E ORA.W $1626,X ; OR [$1626]
R $01:D757 ORA.W $1626,X ; OR [$1626]
R $01:DA84 LDA.W $1626,X ; Rope waiting flag [$1626]?
W $01:DA89 STZ.W $1626,X ; Clear the waiting flag
R $01:DB26 LDA.W $1626,X
W $01:DB2B STZ.W $1626,X
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]
W $07:F74E STZ.W $1626,X ; $1626,X = 0

$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:9B4F LDY.W RAM_SprBehindScrn,X
R $01:9B71 LDY.W RAM_SprBehindScrn,X
R $01:A432 ORA.W RAM_SprBehindScrn,X
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
R $01:B992 LDA.W RAM_SprBehindScrn,X
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:BA65 LDA.W RAM_SprBehindScrn,X
R $01:BA6B LDA.W RAM_SprBehindScrn,X ; A = behind-scenery flag
R $01:C49C LDA.W RAM_SprBehindScrn,X
R $01:F57C LDA.W RAM_SprBehindScrn,Y
R $01:F659 ORA.W RAM_SprBehindScrn,Y
R $02:93CE LDA.W RAM_SprBehindScrn,X ; A = sprite is behind scenery flag
R $02:A0CC ORA.W RAM_SprBehindScrn,X
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

$163D

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)
R $01:811E LDA.W $163E,X
RW $01:8123 DEC.W $163E,X
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?
R $01:A1FD LDY.W $163E,X
R $01:A254 LDA.W $163E,X
R $01:A30A LDA.W $163E,X
R $01:A319 LDA.W $163E,X
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
R $01:AD6E LDA.W $163E,X
W $01:AE13 STA.W $163E,X ; [$163E] = $50: draw-priority timer
R $01:CDF0 LDA.W $163E,X
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:F622 LDA.W $163E,X
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
R $01:FB1D LDA.W $163E,X
W $01:FB67 STA.W $163E,X ; Defeat timer [$163E] = $50
R $02:BF5C LDA.W $163E,X
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
R $02:C6AE LDA.W $163E,X
W $02:C7DF STZ.W $163E,X ; Clear [$163E]
R $02:EA9B LDA.W $163E,X
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
R $01:914C LDA.W $164A,X
W $01:9152 STZ.W $164A,X
R $01:91ED LDA.W $164A,X
R $01:923B LDA.W $164A,X
W $01:9258 STA.W $164A,X ; [$164A] = liquid flags (bit 0 water, bit 7 lava)
R $01:971D LDA.W $164A,X
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)
R $01:B044 LDA.W $164A,X
R $01:B0F2 LDA.W $164A,X
R $01:B1B8 LDA.W $164A,X
R $01:B1C1 LDA.W $164A,X
W $01:B1D9 STZ.W $164A,X ; Clear in-water flag
R $01:B23E LDA.W $164A,X
R $01:B588 LDA.W $164A,X
W $01:CFC2 STA.W $164A,X ; Other kids: timer [$164A] = $20 (arena narrows)
R $01:D161 LDA.W $164A,X
RW $01:D170 DEC.W $164A,X ; Timer [$164A]--
R $01:E06D LDA.W $164A,X
R $01:E0CE LDA.W $164A,X
R $01:F69E LDA.W $164A,Y ; Sprite flag $164A
R $02:BBC5 LDA.W $164A,X
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
R $03:8579 LDA.W $164A,X
R $03:AC4D LDA.W $164A,X
RW $03:AC57 INC.W $164A,X ; Mark the music as changed
W $07:F722 STZ.W $164A,X ; $164A,X = 0

$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
R $01:9443 LDA.W RAM_Tweaker1656,X
R $01:9AC4 LDA.W RAM_Tweaker1656,X
R $01:A6E7 LDA.W RAM_Tweaker1656,X
R $01:A8C9 LDA.W RAM_Tweaker1656,X
R $01:A9CC LDA.W RAM_Tweaker1656,X
R $01:AA4E LDA.W RAM_Tweaker1656,X
W $02:808A STZ.W RAM_Tweaker1656,X ; [RAM_Tweaker1656] = 0: sprite cannot be stomped
R $02:9472 LDA.W RAM_Tweaker1656,X
R $02:9479 LDA.W RAM_Tweaker1656,X
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
R $01:9B27 LDA.W RAM_Tweaker1662,X
R $01:A464 LDA.W RAM_Tweaker1662,X
R $01:A480 LDA.W RAM_Tweaker1662,Y
R $01:A9E2 LDA.W RAM_Tweaker1662,X
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
R $01:F9E2 LDA.W RAM_Tweaker1662,X
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
R $02:946B LDA.W RAM_Tweaker1662,X
W $02:B64E STA.W RAM_Tweaker1662,X ; Clipping index [$1662+X] = PokeyClipIndex[segment count]
R $02:BAEF LDA.W RAM_Tweaker1662,X
W $02:BAF6 STA.W RAM_Tweaker1662,X
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:A82F STA.W RAM_Tweaker1662,X
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)
R $03:B6A2 LDA.W RAM_Tweaker1662,X
R $03:B6E8 LDA.W RAM_Tweaker1662,X
R $03:B792 LDA.W RAM_Tweaker1662,X
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)
R $01:91F6 LDA.W RAM_Tweaker166E,X
R $01:926A LDA.W RAM_Tweaker166E,X
R $01:968E LDA.W RAM_Tweaker166E,X
W $01:9693 STA.W RAM_Tweaker166E,X
R $02:93BE LDA.W RAM_Tweaker166E,X
R $02:94DC LDA.W RAM_Tweaker166E,X
R $02:A0EE LDA.W RAM_Tweaker166E,X
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:893C ASL.W RAM_Tweaker167A,X
RW $01:8940 ROR.W RAM_Tweaker167A,X
RW $01:894B ASL.W RAM_Tweaker167A,X
RW $01:894E LSR.W RAM_Tweaker167A,X ; Restore bit 7 of tweaker [$167A,X] to 0
R $01:89A8 LDA.W RAM_Tweaker167A,Y
R $01:924B LDA.W RAM_Tweaker167A,X
R $01:9329 LDA.W RAM_Tweaker167A,X
R $01:991B LDA.W RAM_Tweaker167A,X
R $01:9B13 LDA.W RAM_Tweaker167A,X
R $01:A187 LDA.W RAM_Tweaker167A,X
R $01:A7E4 LDA.W RAM_Tweaker167A,X
R $01:A832 LDA.W RAM_Tweaker167A,X
R $01:A840 LDA.W RAM_Tweaker167A,X
RW $01:AAF7 ASL.W RAM_Tweaker167A,X
RW $01:AAFA LSR.W RAM_Tweaker167A,X ; Clear bit 7 of tweaker [$167A,X] (stop being interactable once pressed)
R $01:AC4C LDA.W RAM_Tweaker167A,X
R $01:ACA5 LDA.W RAM_Tweaker167A,X
R $01:C2C5 LDA.W RAM_Tweaker167A,X
W $01:C2CA STA.W RAM_Tweaker167A,X ; Clear bit 7 of tweaker [$167A,X]: default interaction with Mario
R $01:F397 LDA.W RAM_Tweaker167A,Y
W $01:F39C STA.W RAM_Tweaker167A,Y ; (unused) Set tweaker $167A bit 6: gives power-up when eaten
R $01:F3BD LDA.W RAM_Tweaker167A,Y
R $01:F651 LDA.W RAM_Tweaker167A,Y
R $01:F9E6 LDA.W RAM_Tweaker167A,X
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:8161 LDA.W RAM_Tweaker167A,Y
R $02:942B LDA.W RAM_Tweaker167A,X
R $02:A0C4 LDA.W RAM_Tweaker167A,X
R $02:A92A LDA.W RAM_Tweaker167A,X ; Tweaker bits of slot X
R $02:BAF9 LDA.W RAM_Tweaker167A,X
W $02:BAFE STA.W RAM_Tweaker167A,X ; Clear bit 6 of tweaker $167A: no longer gives a powerup when eaten
R $02:D046 LDA.W RAM_Tweaker167A,X
R $02:D091 LDA.W RAM_Tweaker167A,X
RW $03:8A69 ASL.W RAM_Tweaker167A,X
RW $03:8A6C LSR.W RAM_Tweaker167A,X ; Clear bit 7 of tweaker $167A (ASL then LSR)
R $03:B878 LDA.W RAM_Tweaker167A,X
R $03:B8C3 LDA.W RAM_Tweaker167A,X
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)
R $00:FAB2 LDA.W RAM_Tweaker1686,Y
W $01:8543 STA.W RAM_Tweaker1686,X ; Sprite tweaker 1686 = $10
R $01:925B LDA.W RAM_Tweaker1686,X
R $01:93B8 LDA.W RAM_Tweaker1686,X
R $01:9645 LDA.W RAM_Tweaker1686,X
W $01:964A STA.W RAM_Tweaker1686,X
R $01:A421 LDA.W RAM_Tweaker1686,X
R $01:A424 ORA.W RAM_Tweaker1686,Y ; A = (tweaker $1686 of B or A) bit 3: no sprite-sprite interaction
R $01:A57E LDA.W RAM_Tweaker1686,Y
R $01:A5A1 LDA.W RAM_Tweaker1686,X
R $01:A903 LDA.W RAM_Tweaker1686,X
R $01:A962 LDA.W RAM_Tweaker1686,X
W $01:C125 STZ.W RAM_Tweaker1686,X ; Clear tweaker byte [$1686,X]
R $01:F2E4 LDA.W RAM_Tweaker1686,Y
R $01:F34F LDA.W RAM_Tweaker1686,Y
R $01:F59B LDA.W RAM_Tweaker1686,Y
R $02:948C LDA.W RAM_Tweaker1686,X
R $02:EA79 LDA.W RAM_Tweaker1686,Y
RW $03:A827 ASL.W RAM_Tweaker1686,X ; Clear bit 7 of tweaker [$1686]
RW $03:A82A LSR.W RAM_Tweaker1686,X
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 $00:FC88 LDA.W $1692 ; A = [$1692]
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 $01:DC77 LDY.W $1692
R $01:DCC7 LDY.W $1692
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)
W $05:DA8E STA.W $1692
W $05:DB63 STA.W $1692

$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:9221 LDA.W $1693
R $01:922C LDA.W $1693 ; A = acts-like tile
R $01:9233 LDA.W $1693
R $01:9299 LDA.W $1693
R $01:92A7 LDA.W $1693
R $01:92BA LDA.W $1693
R $01:92D7 LDA.W $1693
R $01:92E0 LDA.W $1693 ; A = acts-like tile
R $01:92FC LDA.W $1693
R $01:93CE LDY.W $1693
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
R $02:932C LDA.W $1693
W $02:9613 STA.W $1693 ; $1693 = tile number low byte
R $02:9627 LDA.W $1693 ; A = tile number low byte
R $02:A5C1 LDA.W $1693
R $02:A5F7 LDA.W $1693
W $02:A6E4 STA.W $1693 ; [$1693] = Map16 tile number (low byte)
R $02:A6F3 LDA.W $1693
W $02:AC4D STZ.W $1693,X
W $02:BA9B STA.W $1693 ; [$1693] = map16 tile number (low byte)
R $02:BAA4 LDA.W $1693
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 $01:94BB STA.W $1694 ; [$1694] = 0
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)
R $01:D861 LDY.W $1695
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 $01:FD0C STY.W $1695 ; [$1695] = slot
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]
R $02:EAAE LDY.W $1695
R $02:EAB4 LDA.W $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:A8BB LDA.W $1697
R $01:AB47 LDA.W $1697 ; A = consecutive stomp counter [$1697]
RW $01:AB4E INC.W $1697 ; [$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]
R $02:F260 LDA.W $1697
R $02:F280 LDA.W $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:9005 ADC.W $1698
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
W $02:882D STA.W RAM_BounceSprNum,Y
R $02:886E LDA.W RAM_BounceSprNum,Y ; Bounce sprite number
R $02:904D LDA.W RAM_BounceSprNum,X
W $02:90CA STZ.W RAM_BounceSprNum,X ; Free the bounce sprite slot
R $02:9185 LDY.W RAM_BounceSprNum,X
W $02:9199 STZ.W RAM_BounceSprNum,X ; Free the bounce sprite slot
R $02:924E LDA.W RAM_BounceSprNum,X

$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
R $02:907A LDA.W RAM_BounceSprInit,X
RW $02:907F INC.W RAM_BounceSprInit,X ; Mark initialized
R $02:90E5 LDA.W RAM_BounceSprInit,X
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)
R $02:87C6 LDA.W RAM_BounceSprYLo,Y
W $02:8841 STA.W RAM_BounceSprYLo,Y
R $02:908E LDA.W RAM_BounceSprYLo,X
W $02:9096 STA.W RAM_BounceSprYLo,X ; Store low byte
R $02:9145 LDA.W RAM_BounceSprYLo,X
R $02:91CD LDA.W RAM_BounceSprYLo,X
R $02:9215 LDA.W RAM_BounceSprYLo,X
R $02:9230 LDA.W RAM_BounceSprYLo,X
R $02:9273 LDA.W RAM_BounceSprYLo,X
R $02:92CA LDA.W RAM_BounceSprYLo,X
R $02:9333 LDA.W RAM_BounceSprYLo,X
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
R $02:9376 LDA.W RAM_BounceSprYLo,X
R $02:B546 ADC.W RAM_BounceSprYLo,X
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)
R $02:87BC LDA.W RAM_BounceSprXLo,Y
W $02:8837 STA.W RAM_BounceSprXLo,Y
R $02:91BC LDA.W RAM_BounceSprXLo,X
R $02:9221 LDA.W RAM_BounceSprXLo,X
R $02:923B LDA.W RAM_BounceSprXLo,X
R $02:928C LDA.W RAM_BounceSprXLo,X
R $02:92DF LDA.W RAM_BounceSprXLo,X
R $02:936A LDA.W RAM_BounceSprXLo,X

$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)
R $02:87D0 LDA.W RAM_BounceSprYHi,Y
W $02:8846 STA.W RAM_BounceSprYHi,Y
R $02:9099 LDA.W RAM_BounceSprYHi,X
W $02:909E STA.W RAM_BounceSprYHi,X
R $02:914D LDA.W RAM_BounceSprYHi,X
R $02:91D7 LDA.W RAM_BounceSprYHi,X
R $02:921A LDA.W RAM_BounceSprYHi,X
R $02:927D LDA.W RAM_BounceSprYHi,X
R $02:92D4 LDA.W RAM_BounceSprYHi,X
R $02:933E LDA.W RAM_BounceSprYHi,X
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:937C LDA.W RAM_BounceSprYHi,X
R $02:B54D ADC.W RAM_BounceSprYHi,X ; Y position high += sign extension + carry
W $02:B550 STA.W RAM_BounceSprYHi,X

$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
W $02:883C STA.W RAM_BounceSprXHi,Y
R $02:91C6 LDA.W RAM_BounceSprXHi,X
R $02:9226 LDA.W RAM_BounceSprXHi,X
R $02:9291 LDA.W RAM_BounceSprXHi,X
R $02:92E4 LDA.W RAM_BounceSprXHi,X
R $02:9370 LDA.W RAM_BounceSprXHi,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
R $02:90AE LDA.W RAM_BouncBlkSpeedY,X
W $02:90B5 STA.W RAM_BouncBlkSpeedY,X
R $02:9117 LDA.W RAM_BouncBlkSpeedY,X
W $02:911E STA.W RAM_BouncBlkSpeedY,X
R $02:B526 LDA.W RAM_BouncBlkSpeedY,X
R $02:B535 LDA.W RAM_BouncBlkSpeedY,X

$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
R $02:9121 LDA.W RAM_BouncBlkSpeedX,X
W $02:9128 STA.W RAM_BouncBlkSpeedX,X

$16B9

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $02:B52E ADC.W $16B9,X
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)
R $02:87D7 LDA.W RAM_BounceSprBlock,Y
W $02:8866 STA.W RAM_BounceSprBlock,Y ; Tile to turn into when it lands = [$07]
R $02:90C4 LDA.W RAM_BounceSprBlock,X
R $02:919F LDA.W RAM_BounceSprBlock,X

$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
R $02:9056 LDY.W RAM_BounceSprTimer,X
RW $02:905B DEC.W RAM_BounceSprTimer,X ; Timer -= 1
R $02:9085 LDA.W RAM_BounceSprTimer,X
R $02:915E LDA.W RAM_BounceSprTimer,X

$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
R $02:90F3 LDA.W $16C9,X
R $02:9111 LDA.W $16C9,X
R $02:912B LDA.W $16C9,X
R $02:9163 LDA.W $16C9,X
R $02:91DE LDA.W $16C9,X
R $02:91FA LDA.W $16C9,X
R $02:9267 LDY.W $16C9,X
R $02:9382 LDA.W $16C9,X

$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
R $02:9398 LDA.W RAM_BouncBlkStatus,X
R $02:9664 LDA.W RAM_BouncBlkStatus,Y

$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
W $02:86FA STA.W $16D1,Y ; Hitbox X low
W $02:8716 STA.W $16D1,Y
R $02:9668 LDA.W $16D1,Y

$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
W $02:871D STA.W $16D5,Y
R $02:9671 LDA.W $16D5,Y

$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)
W $02:86DE STA.W $16D9,Y
W $02:8704 STA.W $16D9,Y ; Hitbox Y low
W $02:8725 STA.W $16D9,Y
R $02:967E LDA.W $16D9,Y

$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:86E5 STA.W $16DD,Y
W $02:8709 STA.W $16DD,Y ; Hitbox Y high
W $02:872C STA.W $16DD,Y
R $02:9687 LDA.W $16DD,Y

$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:A443 STA.W RAM_ScoreSprNum,Y
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 $00:F39F STA.W RAM_ScoreSprYLo,Y
W $02:9AB4 STA.W RAM_ScoreSprYLo,Y ; Score sprite Y low
W $02:A449 STA.W RAM_ScoreSprYLo,Y
W $02:ACFE STA.W RAM_ScoreSprYLo,Y ; Score Y low = sprite Y low - 8
R $02:AD12 LDA.W RAM_ScoreSprYLo,Y
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
R $02:AE8F LDA.W RAM_ScoreSprYLo,X
R $02:AEA5 LDA.W RAM_ScoreSprYLo,X
R $02:AF0A LDA.W RAM_ScoreSprYLo,X
W $02:FF7B STA.W RAM_ScoreSprYLo,Y

$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 $00:F395 STA.W RAM_ScoreSprXLo,Y
W $02:9AC0 STA.W RAM_ScoreSprXLo,Y ; Score sprite X low
W $02:A455 STA.W RAM_ScoreSprXLo,Y
W $02:AD24 STA.W RAM_ScoreSprXLo,Y ; Score X low = sprite X low
R $02:AE6F LDA.W RAM_ScoreSprXLo,X
R $02:AE83 LDA.W RAM_ScoreSprXLo,X
R $02:AEB1 LDA.W RAM_ScoreSprXLo,X
R $02:AEFE LDA.W RAM_ScoreSprXLo,X
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 $00:F39A STA.W RAM_ScoreSprXHi,Y
W $02:9AC6 STA.W RAM_ScoreSprXHi,Y ; Score sprite X high
W $02:A45B STA.W RAM_ScoreSprXHi,Y
W $02:AD2A STA.W RAM_ScoreSprXHi,Y ; Score X high = sprite X high
R $02:AE79 LDA.W RAM_ScoreSprXHi,X
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 $00:F3A4 STA.W RAM_ScoreSprYHi,Y
W $02:9ABA STA.W RAM_ScoreSprYHi,Y ; Score sprite Y high
W $02:A44F STA.W RAM_ScoreSprYHi,Y
W $02:AD07 STA.W RAM_ScoreSprYHi,Y ; Score Y high = sprite Y high (borrow)
R $02:AD1A LDA.W RAM_ScoreSprYHi,Y
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:A460 STA.W RAM_ScoreSprSpeedY,Y
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)

$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
R $01:FD0F LDA.W RAM_ExSpriteNum,Y
W $01:FD38 STA.W RAM_ExSpriteNum,Y ; Extended sprite = smoke puff (1)
R $02:8536 LDA.W RAM_ExSpriteNum,Y
W $02:8541 STA.W RAM_ExSpriteNum,Y ; Extended sprite = 7 (lava splash)
R $02:9636 LDA.W RAM_ExSpriteNum,X
R $02:9649 LDA.W RAM_ExSpriteNum,X
R $02:9B16 LDA.W RAM_ExSpriteNum,X
W $02:9BDA STZ.W RAM_ExSpriteNum,X ; Clear the extended sprite
R $02:9BF7 LDA.W RAM_ExSpriteNum,Y
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
R $02:9CC9 LDA.W RAM_ExSpriteNum,X
R $02:9D20 LDA.W RAM_ExSpriteNum,X
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
R $02:A0E1 LDA.W RAM_ExSpriteNum,Y
W $02:A213 STA.W RAM_ExSpriteNum,X ; Clear extended sprite number
R $02:A26A LDA.W RAM_ExSpriteNum,X
W $02:A2BF STZ.W RAM_ExSpriteNum,X ; Delete the extended sprite
R $02:A30C LDA.W RAM_ExSpriteNum,X
R $02:A40B LDA.W RAM_ExSpriteNum,X
W $02:A419 STZ.W RAM_ExSpriteNum,X ; Delete the extended sprite
R $02:A4B5 LDA.W RAM_ExSpriteNum,X
R $02:A519 LDY.W RAM_ExSpriteNum,X ; Y = extended sprite number
R $02:B424 LDA.W RAM_ExSpriteNum,Y
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)
R $02:DABA LDA.W RAM_ExSpriteNum,Y
W $02:DAC5 STA.W RAM_ExSpriteNum,Y ; Extended sprite type = $04 (Hammer)
R $02:E087 LDA.W RAM_ExSpriteNum,Y
W $02:E092 STA.W RAM_ExSpriteNum,Y ; Extended sprite = Volcano Lotus fire ($0C)
R $02:E1C4 LDA.W RAM_ExSpriteNum,Y
W $02:E1CF STA.W RAM_ExSpriteNum,Y ; Extended sprite = Piranha fireball ($0B)
R $02:EFB3 LDA.W RAM_ExSpriteNum,Y
W $02:EFBE STA.W RAM_ExSpriteNum,Y ; Extended sprite = $0A (cloud game coin)
R $02:F2D9 LDA.W RAM_ExSpriteNum,Y
W $02:F2E4 STA.W RAM_ExSpriteNum,Y ; Extended sprite = $0E (Wiggler flower)
W $03:990A STA.W RAM_ExSpriteNum,Y
R $03:9AFA LDA.W RAM_ExSpriteNum,Y
W $03:9B0A STA.W RAM_ExSpriteNum,Y ; Extended sprite number = 2 (Reznor fireball)
R $03:C458 LDA.W RAM_ExSpriteNum,Y
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 $00:FD4C STA.W RAM_ExSpriteYLo,X
W $00:FE29 STA.W RAM_ExSpriteYLo,Y
W $00:FEF6 STA.W RAM_ExSpriteYLo,X
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
R $01:FD20 LDA.W RAM_ExSpriteYLo,Y
W $02:8546 STA.W RAM_ExSpriteYLo,Y
R $02:9B63 LDA.W RAM_ExSpriteYLo,X
W $02:9C0A STA.W RAM_ExSpriteYLo,Y ; Extended sprite Y low
R $02:9CF8 LDA.W RAM_ExSpriteYLo,X
R $02:9DD3 LDA.W RAM_ExSpriteYLo,X
R $02:9EB4 LDA.W RAM_ExSpriteYLo,X
RW $02:9EFC DEC.W RAM_ExSpriteYLo,X
R $02:9EFF LDY.W RAM_ExSpriteYLo,X
R $02:9F2A LDA.W RAM_ExSpriteYLo,X
R $02:9FB3 LDA.W RAM_ExSpriteYLo,X
R $02:9FFF LDA.W RAM_ExSpriteYLo,X
W $02:A006 STA.W RAM_ExSpriteYLo,X
R $02:A067 LDA.W RAM_ExSpriteYLo,X
R $02:A1C0 LDA.W RAM_ExSpriteYLo,X
R $02:A28F LDA.W RAM_ExSpriteYLo,X
R $02:A379 LDA.W RAM_ExSpriteYLo,X
R $02:A3C1 LDA.W RAM_ExSpriteYLo,X
R $02:A432 LDA.W RAM_ExSpriteYLo,X
R $02:A446 LDA.W RAM_ExSpriteYLo,X
R $02:A4CD LDA.W RAM_ExSpriteYLo,X
W $02:A4D3 STA.W RAM_ExSpriteYLo,X
R $02:A531 LDA.W RAM_ExSpriteYLo,X
R $02:A55A LDA.W RAM_ExSpriteYLo,Y
R $02:A58C LDA.W RAM_ExSpriteYLo,X
R $02:A5A3 LDA.W RAM_ExSpriteYLo,X
R $02:A5DF LDA.W RAM_ExSpriteYLo,X
W $02:A5E6 STA.W RAM_ExSpriteYLo,X
W $02:A601 STA.W RAM_ExSpriteYLo,X ; Restore Y low
R $02:A618 LDA.W RAM_ExSpriteYLo,X
R $02:A679 LDA.W RAM_ExSpriteYLo,X
R $02:A73D LDA.W RAM_ExSpriteYLo,X
W $02:A743 STA.W RAM_ExSpriteYLo,X
W $02:B449 STA.W RAM_ExSpriteYLo,Y
R $02:B580 ADC.W RAM_ExSpriteYLo,X
W $02:B583 STA.W RAM_ExSpriteYLo,X ; Extended sprite Y low += whole pixels + carry
W $02:C48C STA.W RAM_ExSpriteYLo,Y
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 $03:C46B STA.W RAM_ExSpriteYLo,Y
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 $00:FD33 STA.W RAM_ExSpriteXLo,X
W $00:FE38 STA.W RAM_ExSpriteXLo,Y
W $00:FEE5 STA.W RAM_ExSpriteXLo,X
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
R $01:FD16 LDA.W RAM_ExSpriteXLo,Y
W $02:8554 STA.W RAM_ExSpriteXLo,Y
R $02:9B54 LDA.W RAM_ExSpriteXLo,X
W $02:9C1C STA.W RAM_ExSpriteXLo,Y ; Extended sprite X low
R $02:9D04 LDA.W RAM_ExSpriteXLo,X
R $02:9D15 LDA.W RAM_ExSpriteXLo,X
R $02:9DC7 LDA.W RAM_ExSpriteXLo,X
R $02:9EA0 LDA.W RAM_ExSpriteXLo,X
R $02:A01C ADC.W RAM_ExSpriteXLo,X
W $02:A01F STA.W RAM_ExSpriteXLo,X
R $02:A05A LDA.W RAM_ExSpriteXLo,X
R $02:A1B1 LDA.W RAM_ExSpriteXLo,X
R $02:A271 LDA.W RAM_ExSpriteXLo,X
R $02:A36C LDA.W RAM_ExSpriteXLo,X
R $02:A3B4 LDA.W RAM_ExSpriteXLo,X
R $02:A42C LDA.W RAM_ExSpriteXLo,X
R $02:A452 LDA.W RAM_ExSpriteXLo,X
R $02:A4BC LDA.W RAM_ExSpriteXLo,X
W $02:A4C2 STA.W RAM_ExSpriteXLo,X
R $02:A51C LDA.W RAM_ExSpriteXLo,X
R $02:A547 LDA.W RAM_ExSpriteXLo,Y
R $02:A592 LDA.W RAM_ExSpriteXLo,X
R $02:A5CC LDA.W RAM_ExSpriteXLo,X
W $02:A5D3 STA.W RAM_ExSpriteXLo,X
W $02:A609 STA.W RAM_ExSpriteXLo,X ; Restore X low
R $02:A631 LDA.W RAM_ExSpriteXLo,X
R $02:A697 LDA.W RAM_ExSpriteXLo,X
W $02:B438 STA.W RAM_ExSpriteXLo,Y
W $02:C4A2 STA.W RAM_ExSpriteXLo,Y
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 $00:FD53 STA.W RAM_ExSpriteYHi,X
W $00:FE30 STA.W RAM_ExSpriteYHi,Y
W $00:FEFD STA.W RAM_ExSpriteYHi,X
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
R $02:9B6B LDA.W RAM_ExSpriteYHi,X
W $02:9C11 STA.W RAM_ExSpriteYHi,Y ; Extended sprite Y high
RW $02:9F05 DEC.W RAM_ExSpriteYHi,X
R $02:9F2F LDA.W RAM_ExSpriteYHi,X
R $02:9FB8 LDA.W RAM_ExSpriteYHi,X
RW $02:A00B DEC.W RAM_ExSpriteYHi,X ; Borrow from Y position high byte
R $02:A1C8 LDA.W RAM_ExSpriteYHi,X
R $02:A297 LDA.W RAM_ExSpriteYHi,X
R $02:A44C LDA.W RAM_ExSpriteYHi,X
R $02:A4D6 LDA.W RAM_ExSpriteYHi,X
W $02:A4DB STA.W RAM_ExSpriteYHi,X
R $02:A53A LDA.W RAM_ExSpriteYHi,X
R $02:A562 LDA.W RAM_ExSpriteYHi,Y
R $02:A5AC LDA.W RAM_ExSpriteYHi,X
R $02:A5E9 LDA.W RAM_ExSpriteYHi,X
W $02:A5EF STA.W RAM_ExSpriteYHi,X
W $02:A5FD STA.W RAM_ExSpriteYHi,X ; Restore Y high
R $02:A624 LDA.W RAM_ExSpriteYHi,X
R $02:A685 LDA.W RAM_ExSpriteYHi,X
R $02:A746 LDA.W RAM_ExSpriteYHi,X
W $02:A74B STA.W RAM_ExSpriteYHi,X
W $02:B451 STA.W RAM_ExSpriteYHi,Y
R $02:B587 ADC.W RAM_ExSpriteYHi,X ; Extended sprite Y high += sign extension + carry
W $02:B58A STA.W RAM_ExSpriteYHi,X
W $02:C494 STA.W RAM_ExSpriteYHi,Y
W $02:DADB STA.W RAM_ExSpriteYHi,Y
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 $03:C473 STA.W RAM_ExSpriteYHi,Y
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 $00:FD3A STA.W RAM_ExSpriteXHi,X
W $00:FE3F STA.W RAM_ExSpriteXHi,Y
W $00:FEED STA.W RAM_ExSpriteXHi,X
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
R $02:9B5C LDA.W RAM_ExSpriteXHi,X
W $02:9C24 STA.W RAM_ExSpriteXHi,Y ; Extended sprite X high
R $02:9D09 LDA.W RAM_ExSpriteXHi,X
R $02:9EA8 LDA.W RAM_ExSpriteXHi,X
R $02:A023 ADC.W RAM_ExSpriteXHi,X ; X position += X speed (16-bit)
W $02:A026 STA.W RAM_ExSpriteXHi,X
R $02:A1B9 LDA.W RAM_ExSpriteXHi,X
R $02:A279 LDA.W RAM_ExSpriteXHi,X
R $02:A458 LDA.W RAM_ExSpriteXHi,X
R $02:A4C5 LDA.W RAM_ExSpriteXHi,X
W $02:A4CA STA.W RAM_ExSpriteXHi,X
R $02:A525 LDA.W RAM_ExSpriteXHi,X
R $02:A54F LDA.W RAM_ExSpriteXHi,Y
R $02:A59B LDA.W RAM_ExSpriteXHi,X
R $02:A5D6 LDA.W RAM_ExSpriteXHi,X
W $02:A5DC STA.W RAM_ExSpriteXHi,X
W $02:A605 STA.W RAM_ExSpriteXHi,X ; Restore X high
R $02:A63B LDA.W RAM_ExSpriteXHi,X
R $02:A6A1 LDA.W RAM_ExSpriteXHi,X
W $02:B440 STA.W RAM_ExSpriteXHi,Y
W $02:C4AA STA.W RAM_ExSpriteXHi,Y
W $02:DAD0 STA.W RAM_ExSpriteXHi,Y
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
R $02:9CBC LDA.W RAM_ExSprSpeedY,X
W $02:9CC6 STA.W RAM_ExSprSpeedY,X
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
R $02:9E90 LDA.W RAM_ExSprSpeedY,X
W $02:9E96 STA.W RAM_ExSprSpeedY,X
R $02:9FC8 LDA.W RAM_ExSprSpeedY,X
R $02:9FCF LDA.W RAM_ExSprSpeedY,X
W $02:9FD5 STA.W RAM_ExSprSpeedY,X
W $02:9FFC STA.W RAM_ExSprSpeedY,X ; Bounce: Y speed from DATA_029F99
R $02:A2F9 LDA.W RAM_ExSprSpeedY,X
RW $02:A300 INC.W RAM_ExSprSpeedY,X ; Gravity: Y speed += 2 until it reaches $40 (terminal velocity)
RW $02:A303 INC.W RAM_ExSprSpeedY,X
R $02:B560 LDA.W RAM_ExSprSpeedY,X
R $02:B571 LDA.W RAM_ExSprSpeedY,X
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
R $02:9C74 LDA.W RAM_ExSprSpeedX,X
RW $02:9C78 ROR.W RAM_ExSprSpeedX,X ; Timer = 6: halve the X speed (arithmetic shift right)
W $02:9CDB STA.W RAM_ExSprSpeedX,X
R $02:9DA0 LDY.W RAM_ExSprSpeedX,X ; Y = [ExSprSpeedX]: misused as the index of the sprite it follows
R $02:9F82 LDA.W RAM_ExSprSpeedX,X
R $02:9FE7 LDA.W RAM_ExSprSpeedX,X
R $02:A015 LDA.W RAM_ExSprSpeedX,X
R $02:A052 LDA.W RAM_ExSprSpeedX,X
R $02:A1A7 LDA.W RAM_ExSprSpeedX,X
R $02:A280 EOR.W RAM_ExSprSpeedX,X
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

$1751

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]
W $02:B56B STA.W $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]++
R $02:9FE0 LDA.W $175B,X
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)
W $00:FE21 STA.W $1765,Y
R $02:9CE3 LDA.W $1765,X ; Coin: bounce counter [$1765]
RW $02:9CF2 INC.W $1765,X ; Count the bounce
R $02:9DBE LDA.W $1765,X
R $02:9DF6 LDA.W $1765,X
RW $02:9EF2 INC.W $1765,X
R $02:9EF5 LDA.W $1765,X
R $02:9F39 LDA.W $1765,X
RW $02:9FC2 INC.W $1765,X ; Animation counter [$1765]++
R $02:A079 LDA.W $1765,X
RW $02:A21D INC.W $1765,X ; Animation counter [$1765]++
R $02:A238 LDA.W $1765,X
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
R $02:A31D LDA.W $1765,X
W $02:EFE6 STA.W $1765,Y ; Clear $1765 too
W $02:F2E9 STA.W $1765,Y ; [$1765] = 1

$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)
RW $02:9B24 DEC.W $176F,X ; Timer--
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:9C6B LDA.W $176F,X ; A = timer
R $02:9C83 LDA.W $176F,X ; A = timer [$176F,X]
R $02:9C9C LDA.W $176F,X
R $02:9DAA LDA.W $176F,X
R $02:9E3F LDA.W $176F,X
R $02:9EC1 LDA.W $176F,X
R $02:A220 LDA.W $176F,X
R $02:A34F LDA.W $176F,X
R $02:A386 LDA.W $176F,X
R $02:A3CE LDA.W $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:A074 LDA.W $1779,X
R $02:A0CF EOR.W $1779,Y ; Skip if fire-immune, being eaten, or on a different layer than the fireball
R $02:A1DD LDA.W $1779,X
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
R $02:B3C0 LDA.W RAM_ShooterYLo,X
R $02:B401 LDA.W RAM_ShooterYLo,X
R $02:B443 LDA.W RAM_ShooterYLo,X
R $02:B470 LDA.W RAM_ShooterYLo,X
R $02:B4C2 LDA.W RAM_ShooterYLo,X
R $02:B4F0 LDA.W RAM_ShooterYLo,X

$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:ABC2 STA.W RAM_ShooterYHi,X
W $02:ABD2 STA.W RAM_ShooterYHi,X ; Shooter Y high = bit 0
R $02:B3C5 LDA.W RAM_ShooterYHi,X
R $02:B407 LDA.W RAM_ShooterYHi,X ; New sprite position = shooter position
R $02:B44C LDA.W RAM_ShooterYHi,X
R $02:B475 LDA.W RAM_ShooterYHi,X
R $02:B4CB LDA.W RAM_ShooterYHi,X

$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
R $02:B3CC LDA.W RAM_ShooterXLo,X
R $02:B3D8 LDA.W RAM_ShooterXLo,X
R $02:B3F5 LDA.W RAM_ShooterXLo,X
R $02:B432 LDA.W RAM_ShooterXLo,X
R $02:B47C LDA.W RAM_ShooterXLo,X
R $02:B488 LDA.W RAM_ShooterXLo,X
R $02:B497 SBC.W RAM_ShooterXLo,X
R $02:B4B6 LDA.W RAM_ShooterXLo,X
R $02:B4FB LDA.W RAM_ShooterXLo,X
R $02:B501 CMP.W RAM_ShooterXLo,X

$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
W $02:ABDC STA.W RAM_ShooterXHi,X
R $02:B3D1 LDA.W RAM_ShooterXHi,X
R $02:B3FB LDA.W RAM_ShooterXHi,X
R $02:B43B LDA.W RAM_ShooterXHi,X
R $02:B481 LDA.W RAM_ShooterXHi,X
R $02:B4BC LDA.W RAM_ShooterXHi,X ; New sprite X = shooter X
R $02:B506 SBC.W RAM_ShooterXHi,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

$17B3

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)
R $00:FF1A LDA.W $17BB
W $05:D7C0 STA.W $17BB ; [$17BB] = level number (low byte)
W $05:D7E7 STA.W $17BB
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)
W $00:F7D3 STA.W $17BC
R $00:FF09 LDA.W $17BC
R $02:CC2F LDA.W $17BC
R $05:BC20 ADC.W $17BC ; [$17BC] += [$1464] - [$1C]: layer 1 Y scroll this frame
W $05:BC23 STA.W $17BC

$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)
W $00:F7CA STA.W $17BD
R $00:FBB6 LDA.W $17BD ; A = [$17BD] (layer 1 X movement this frame)
R $01:E9EE LDA.W $17BD
R $02:CC11 ADC.W $17BD
R $02:D3F7 LDA.W $17BD ; A = [$17BD] (probably horizontal scroll delta)
R $03:8561 LDA.W $17BD
R $03:90D1 LDA.W $17BD
R $05:BC13 ADC.W $17BD ; [$17BD] += [$1462] - [$1A]: layer 1 X scroll this frame
W $05:BC16 STA.W $17BD
R $05:C476 LDA.W $17BD
R $05:C4EF ADC.W $17BD ; BG3 X low byte [$22] += [$17BD] + 1
R $05:C7D8 LDA.W $17BD

$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 $00:F7E5 STA.W $17BE
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)

$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)
R $01:AB7A LDA.W $17C0,Y
W $01:AB85 STA.W $17C0,Y ; Smoke slot Y type = 2 (contact star/smoke puff)
R $01:ABA1 LDA.W $17C0,Y
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)
R $01:C4F2 LDA.W $17C0,Y
W $01:C4FD STA.W $17C0,Y ; Effect [$17C0,Y] = 5 (sparkle)
R $01:C5BF LDA.W $17C0,Y
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)
R $02:96C0 LDA.W $17C0,X
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
R $02:9ADC LDA.W $17C0,Y
W $02:9AE7 STA.W $17C0,Y ; Set the slot's type
R $02:A41E LDA.W $17C0,Y
W $02:A429 STA.W $17C0,Y
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)
R $02:B954 LDA.W $17C0,Y
W $02:B991 STA.W $17C0,Y ; Smoke type [$17C0+Y] = 1
R $03:8A18 LDA.W $17C0,Y
W $03:8A23 STA.W $17C0,Y ; Smoke type 3

$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 $00:FD7B STA.W $17C4,Y
W $00:FD94 STA.W $17C4,Y
W $00:FE8A STA.W $17C4,Y ; Smoke Y = A
W $01:8083 STA.W $17C4,Y
W $01:AB8F STA.W $17C4,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
W $01:D02A STA.W $17C4
W $02:8A57 STA.W $17C4,X ; Smoke Y
R $02:9711 LDA.W $17C4,X
R $02:975A LDA.W $17C4,X
R $02:97CD LDA.W $17C4,X
R $02:9853 LDA.W $17C4,X
R $02:98F6 LDA.W $17C4,X ; A = smoke Y
RW $02:994C DEC.W $17C4,X ; ...the puff rises 1 pixel: Y--
R $02:9978 LDA.W $17C4,X
R $02:99AB LDA.W $17C4,X
W $02:9B01 STA.W $17C4,Y ; Smoke Y
W $02:A435 STA.W $17C4,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 $00:FD74 STA.W $17C8,Y
W $00:FD8A STA.W $17C8,Y
W $00:FE7B STA.W $17C8,Y
W $01:807C STA.W $17C8,Y
W $01:AB8A STA.W $17C8,Y
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 $01:D023 STA.W $17C8
W $02:8A5C STA.W $17C8,X ; Smoke X
R $02:9704 LDA.W $17C8,X
R $02:974D LDA.W $17C8,X
R $02:97B4 LDA.W $17C8,X
R $02:983A LDA.W $17C8,X
R $02:98FB LDA.W $17C8,X ; A = smoke X
R $02:996F LDA.W $17C8,X
R $02:99A2 LDA.W $17C8,X
W $02:9AF6 STA.W $17C8,Y ; Smoke X
W $02:A42F STA.W $17C8,Y
W $02:B513 STA.W $17C8,Y
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?
RW $02:96F1 DEC.W $17CC,X ; Timer--
R $02:971E LDA.W $17CC,X ; A = timer
R $02:9732 LDA.W $17CC,X ; A = timer
R $02:9767 LDA.W $17CC,X ; A = timer
R $02:977B LDA.W $17CC,X ; A = timer
R $02:9797 LDA.W $17CC,X ; Smoke type 2 (four-tile burst): timer = 0?
RW $02:97A0 DEC.W $17CC,X ; Timer--
R $02:97E2 LDA.W $17CC,X
R $02:97FC LDA.W $17CC,X ; A = timer
R $02:9868 LDA.W $17CC,X
R $02:9882 LDA.W $17CC,X ; A = timer
R $02:98CA LDA.W $17CC,X ; Smoke type 5 (sparkle spawner): timer = 0?
RW $02:98D3 DEC.W $17CC,X ; Timer--
R $02:9900 LDA.W $17CC,X
R $02:9927 LDA.W $17CC,X ; Smoke type 3 (rising puff): timer = 0?
RW $02:9945 DEC.W $17CC,X ; Timer--
R $02:9986 LDA.W $17CC,X
R $02:99B9 LDA.W $17CC,X
W $02:9B06 STA.W $17CC,Y ; Set the smoke timer
W $02:A43A STA.W $17CC,Y
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
R $02:9358 LDA.W $17D0,Y
W $02:9363 STA.W $17D0,Y ; [$17D0,Y] = 1: spinning coin in use
R $02:99D7 LDA.W $17D0,X
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:8A93 STA.W $17D4,X
W $02:9379 STA.W $17D4,Y ; Coin Y low = bounce sprite Y low
R $02:9A1D LDA.W $17D4,X
R $02:9A35 LDA.W $17D4,X
R $02:9AB1 LDA.W $17D4,X ; Coin Y low
R $02:9AF9 LDA.W $17D4,X ; A = coin Y low
R $02:B5AE ADC.W $17D4,X
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)
R $02:99F8 LDA.W $17D8,X
W $02:99FE STA.W $17D8,X ; Coin Y speed [$17D8,X] += 3 (gravity)
R $02:B58E LDA.W $17D8,X
R $02:B59F LDA.W $17D8,X

$17DC

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]
W $02:B599 STA.W $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:8A86 STA.W $17E0,X ; Coin X low
W $02:936D STA.W $17E0,Y ; Coin X low = bounce sprite X low
R $02:9A29 LDA.W $17E0,X
R $02:9ABD LDA.W $17E0,X ; Coin 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:8AA0 STA.W $17E4,X ; Coin layer
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:9ACE LDA.W $17E4,X ; Coin layer
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:8A9A STA.W $17E8,X
W $02:937F STA.W $17E8,Y ; Coin Y high = bounce sprite Y high
R $02:9A22 LDA.W $17E8,X
R $02:9AB7 LDA.W $17E8,X ; Coin Y high
R $02:B5B5 ADC.W $17E8,X ; Position high [$17E8+X] += sign extension + carry
W $02:B5B8 STA.W $17E8,X

$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:8A8B STA.W $17EC,X ; Coin X high
W $02:9373 STA.W $17EC,Y ; Coin X high = bounce sprite X high
R $02:9AC3 LDA.W $17EC,X ; Coin 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)
R $01:F7DF LDA.W $17F0,X ; Slot in use?
W $01:F7F6 STA.W $17F0,X ; Minor extended sprite type 3 (egg shard)
R $02:84DF LDA.W $17F0,Y
W $02:8507 STA.W $17F0,Y ; Minor extended sprite = 7 (water splash)
R $02:85BC LDA.W $17F0,Y
W $02:85C7 STA.W $17F0,Y ; Minor extended sprite = 5
R $02:85E6 LDA.W $17F0,Y
W $02:85F5 STA.W $17F0,Y ; Minor extended sprite = 4
R $02:866A LDA.W $17F0,X
W $02:8686 STA.W $17F0,X ; Minor extended sprite = 1 (brick piece)
R $02:8B69 LDA.W $17F0,X ; Slot type [$17F0+X]
R $02:8BC2 LDA.W $17F0,Y ; Slot type
W $02:8BCD STA.W $17F0,Y ; Type = $0B (smoke puff)
R $02:8C32 LDA.W $17F0,Y ; Slot type
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
R $02:8E02 LDY.W $17F0,X
R $02:8E4F LDA.W $17F0,X
W $02:8E76 STZ.W $17F0,X ; Delete this minor extended sprite
R $02:8EFE LDA.W $17F0,X
W $02:8F87 STZ.W $17F0,X ; Delete this minor extended sprite
R $02:98DC LDA.W $17F0,Y
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 $02:C108 STA.W $17F0,Y ; Spawn it
R $03:9022 LDA.W $17F0,Y
W $03:9039 STA.W $17F0,Y ; Extended sprite number = $0A (Boo stream tile)
R $03:AD6B LDA.W $17F0,Y
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 $01:F808 STA.W $17FC,X ; Shard Y low
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]
W $02:8BDA STA.W $17FC,Y
R $02:8C4F LDA.W $17FC,X
W $02:8C52 STA.W $17FC,Y ; Copy Y low
R $02:8C80 LDA.W $17FC,X
R $02:8CD7 LDA.W $17FC,X
R $02:8D16 LDA.W $17FC,X
RW $02:8D72 INC.W $17FC,X ; Y position += 1 (splash sinks)
R $02:8D9E LDA.W $17FC,X
RW $02:8E1D DEC.W $17FC,X ; Y position -= 1
R $02:8E34 LDA.W $17FC,X
R $02:8E97 LDA.W $17FC,X
R $02:8EF1 LDA.W $17FC,X
R $02:8F59 LDA.W $17FC,X
R $02:8FB4 ADC.W $17FC,X ; Y position low += Y speed
W $02:8FB7 STA.W $17FC,X
R $02:8FCA LDA.W $17FC,X
W $02:9918 STA.W $17FC,Y ; New sprite Y low
R $02:B5E5 ADC.W $17FC,X
W $02:B5E8 STA.W $17FC,X ; Y position [$17FC+X] += whole pixels + carry
W $02:C118 STA.W $17FC,Y
W $03:9049 STA.W $17FC,Y
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 $01:F7FF STA.W $1808,X ; Shard 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]
W $02:8BFC STA.W $1808,Y
R $02:8C43 LDA.W $1808,X
W $02:8C46 STA.W $1808,Y ; Copy X low
R $02:8C71 LDA.W $1808,X
R $02:8CC8 LDA.W $1808,X
R $02:8D02 LDA.W $1808,X
R $02:8D4F LDA.W $1808,X
R $02:8D8E LDA.W $1808,X
R $02:8E23 LDA.W $1808,X
R $02:8EA4 LDA.W $1808,X
R $02:8EE4 LDA.W $1808,X
R $02:8F2F LDA.W $1808,X
R $02:8F50 LDA.W $1808,X
R $02:8F9E ADC.W $1808,X ; X position low += X speed
W $02:8FA1 STA.W $1808,X
R $02:8FE0 LDA.W $1808,X
W $02:990F STA.W $1808,Y ; New sprite X low
W $02:C110 STA.W $1808,Y
W $03:903E STA.W $1808,Y
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 $01:F80D STA.W $1814,X ; Shard Y high
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
W $02:8BE2 STA.W $1814,Y
R $02:8C55 LDA.W $1814,X
W $02:8C58 STA.W $1814,Y ; Copy Y high
R $02:8C88 LDA.W $1814,X
R $02:8CDF LDA.W $1814,X
R $02:8FBB ADC.W $1814,X ; Y position high += sign extension
W $02:8FBE STA.W $1814,X
R $02:8FD2 LDA.W $1814,X
W $03:904F STA.W $1814,Y
W $03:ADA5 STA.W $1814,Y

$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:8E8E INC.W $1820,X
RW $02:8E91 INC.W $1820,X ; Y speed += 2 (gravity)
RW $02:8F4A INC.W $1820,X ; Y speed += 1 (gravity)
R $02:8FAD LDA.W $1820,X
RW $02:8FC7 INC.W $1820,X ; ...Y speed += 1 (slow gravity)
R $02:B5C8 LDA.W $1820,X
R $02:B5D7 LDA.W $1820,X
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
R $02:8C14 LDA.W $182C,X ; X speed
W $02:8C23 STA.W $182C,X ; Speed -= 8
R $02:8D29 LDA.W $182C,X
RW $02:8DF1 INC.W $182C,X
RW $02:8DF8 DEC.W $182C,X ; X speed -= 1
RW $02:8DFB DEC.W $182C,X ; X speed -= 1 (net -1)
R $02:8DFE LDA.W $182C,X
W $02:8E0C STA.W $182C,X
W $02:8E13 STA.W $182C,X ; Restore the original X speed
R $02:8F97 LDA.W $182C,X
W $02:C122 STA.W $182C,Y ; Store Y speed
W $03:9059 STA.W $182C,Y ; Extended sprite X speed = sprite X speed

$1838

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]
W $02:B5D3 STA.W $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
W $02:8BD2 STA.W $1850,Y ; Timer = 0
R $02:8C0F LDA.W $1850,X ; Timer [$1850]
W $02:8C5D STA.W $1850,Y ; Child lifetime = $10 frames
RW $02:8C61 DEC.W $1850,X ; Timer - 1
R $02:8C9A LDA.W $1850,X
RW $02:8CFA DEC.W $1850,X ; Count down the lifetime timer
R $02:8D5B LDA.W $1850,X
R $02:8D75 LDA.W $1850,X
R $02:8DAB LDA.W $1850,X
RW $02:8DD3 INC.W $1850,X ; Advance the animation timer
R $02:8DDF LDA.W $1850,X
RW $02:8DE4 DEC.W $1850,X
R $02:8DE7 LDA.W $1850,X
R $02:8DEE LDA.W $1850,X
R $02:8E16 LDA.W $1850,X
R $02:8E48 LDA.W $1850,X
R $02:8E58 LDA.W $1850,X
RW $02:8E7E DEC.W $1850,X
R $02:8E81 LDA.W $1850,X ; Timer -= 1
R $02:8EB6 LDA.W $1850,X
R $02:8ED2 LDA.W $1850,X
RW $02:8EDE DEC.W $1850,X ; Timer -= 1
R $02:8F02 LDA.W $1850,X
R $02:8F3B LDA.W $1850,X
RW $02:8F44 DEC.W $1850,X ; Timer -= 1
R $02:8F66 LDA.W $1850,X
R $02:8FFD LDA.W $1850,X
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)
R $00:E92E LDA.W $185C
R $02:E5DD LDA.W $185C
W $02:E5EC STZ.W $185C ; Clear [$185C]
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 $01:F7EE STA.W $185D ; Store
R $01:F7F1 LDX.W $185D ; X = slot
RW $02:8672 DEC.W $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
RW $02:98E4 DEC.W $185D
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
RW $03:902A DEC.W $185D
W $03:9031 STA.W $185D ; No free slot: pick one round-robin from [$185D] (counts 11 to 0)
R $03:9034 LDY.W $185D

$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:9260 LDA.W $185E
R $01:92AD LDA.W $185E
R $01:9302 LDA.W $185E
R $01:9417 LDA.W $185E
R $01:944D LDA.W $185E
R $01:9491 LDY.W $185E
R $01:94A3 LDY.W $185E
R $01:9504 LDY.W $185E
R $01:9516 LDY.W $185E
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
R $01:B5E7 LDA.W $185E
R $01:B5F2 LDA.W $185E
R $01:B624 LDY.W $185E
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
W $01:D9E6 STA.W $185E
R $01:DA41 LDA.W $185E ; A = Y movement of the sprite
W $01:EF1B STY.W $185E ; Y = frame; remember it in $185E
R $01:EF72 LDX.W $185E ; X = frame
R $01:EF8E LDY.W $185E ; Y = frame
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)
R $01:F54C LDA.W $185E
W $01:F5AE STY.W $185E ; $185E = index of the sprite being eaten
R $01:F5EB LDX.W $185E ; X = old Pokey
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]++
R $02:E503 LDA.W $185E
W $02:E690 STA.W $185E
R $02:E6F4 LDA.W $185E
W $02:E8BD STA.W $185E ; Left tile = GrowingPipeTiles1[Y], saved in [$185E]
R $02:E8C6 LDA.W $185E
W $02:F840 STA.W $185E ; [$185E] = copy of the timer for this frame
R $02:F8C8 LDY.W $185E ; Y = timer copy
W $02:F930 STA.W $185E ; [$185E] = animation frame * 2
R $02:F96E ORA.W $185E
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)
R $02:E2EB LDA.W $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:9975 LDA.W $1860
R $01:BA27 LDA.W $1860 ; A = second Map16 tile ($1860)
R $02:E2F8 LDA.W $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:8021 DEC.W $1861
W $02:8028 STA.W $1861
R $02:802B LDA.W $1861
RW $02:8911 DEC.W $1861 ; No free slot: alternate between slots $0A and $0B with [$1861]
W $02:8918 STA.W $1861 ; [$1861] = 1
R $02:891B LDA.W $1861 ; [$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)
R $02:E2F3 LDA.W $1862

$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
R $01:C5D1 LDY.W $1863 ; Y = [$1863]

$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]
W $02:8A77 STA.W $1865 ; Store
R $02:8A7A LDX.W $1865 ; X = slot

$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)
R $01:CB8D LDA.W $1866
R $01:CBF5 LDA.W $1866

$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)
R $01:CB64 LDA.W $1867
R $01:CBCC LDA.W $1867

$1868

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
R $02:902D LDA.W $186B
RW $02:9038 DEC.W $186B ; Count the multiple coin block timer down
R $02:91AA LDY.W $186B
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
R $01:9E37 LDA.W RAM_OffscreenVert,X
W $01:A365 STZ.W RAM_OffscreenVert,X ; Clear vertical off-screen flags of this sprite
R $01:A3BD LDA.W RAM_OffscreenVert,X
W $01:A3C3 STA.W RAM_OffscreenVert,X
R $01:A3DF LDA.W RAM_OffscreenVert,X ; A = vertical off-screen flags [$186C]
R $01:AEC3 LDA.W RAM_OffscreenVert,X
R $01:B152 ORA.W RAM_OffscreenVert,X
R $01:E8CD LDA.W RAM_OffscreenVert,X ; A = vertical offscreen flag
R $01:F401 ORA.W RAM_OffscreenVert,X
R $02:84A2 ORA.W RAM_OffscreenVert,X ; A |= [RAM_OffscreenVert+X]
R $02:852B LDA.W 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:CF5F ORA.W RAM_OffscreenVert,X
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:B7B1 LDA.W RAM_OffscreenVert,X
W $03:B7B7 STA.W RAM_OffscreenVert,X
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:DB48 LDA.W $1878 ; A = [$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:A76F LDA.W RAM_OnYoshi
R $00:C8DA LDY.W RAM_OnYoshi
R $00:CA33 LDY.W RAM_OnYoshi
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:CD8F LDY.W RAM_OnYoshi
R $00:D06E ORA.W RAM_OnYoshi
R $00:D087 ORA.W RAM_OnYoshi
R $00:D1A8 LDA.W RAM_OnYoshi
R $00:D20B LDY.W RAM_OnYoshi
R $00:D656 LDA.W RAM_OnYoshi
R $00:D7F0 ORA.W RAM_OnYoshi
R $00:D8D3 LDA.W RAM_OnYoshi
R $00:EAFE ORA.W RAM_OnYoshi
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:F121 LDA.W RAM_OnYoshi
R $00:F272 ORA.W RAM_OnYoshi ; Return if carrying something ([$148F]) or riding Yoshi
R $00:F401 LDY.W RAM_OnYoshi
R $00:F84A LDX.W RAM_OnYoshi
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
W $01:80C3 STZ.W RAM_OnYoshi
R $01:854D LDY.W RAM_OnYoshi
R $01:A089 LDA.W RAM_OnYoshi
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:ABB4 LDA.W RAM_OnYoshi
R $01:AD76 LDA.W RAM_OnYoshi
R $01:B0FC LDA.W RAM_OnYoshi
R $01:B481 LDY.W RAM_OnYoshi
R $01:B4C6 LDY.W RAM_OnYoshi
R $01:B887 LDY.W RAM_OnYoshi ; Y = riding Yoshi flag
R $01:CA3E LDY.W RAM_OnYoshi
R $01:DA12 ORA.W RAM_OnYoshi ; Carrying an item or riding Yoshi: do not grab, release
R $01:E1DB LDA.W RAM_OnYoshi
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]
R $01:EB2E LDA.W RAM_OnYoshi
W $01:EB82 STA.W RAM_OnYoshi ; [RAM_OnYoshi] = A
R $01:EB9A LDA.W RAM_OnYoshi
R $01:EBEE LDA.W RAM_OnYoshi
R $01:EC04 LDA.W RAM_OnYoshi
R $01:EC50 LDY.W RAM_OnYoshi ; Y = [RAM_OnYoshi]
R $01:ED3F ORA.W RAM_OnYoshi
W $01:EDC3 STZ.W RAM_OnYoshi ; Mario is no longer on Yoshi
R $01:EEE6 LDA.W RAM_OnYoshi
W $01:F726 STZ.W RAM_OnYoshi ; Mario is no longer on Yoshi
R $02:913C LDY.W RAM_OnYoshi
R $02:A46E LDA.W RAM_OnYoshi
W $02:A48A STZ.W RAM_OnYoshi ; Mario no longer on Yoshi
R $02:C810 LDA.W RAM_OnYoshi ; Mario riding Yoshi?
R $02:CF6B LDA.W RAM_OnYoshi
R $02:CFA8 LDX.W RAM_OnYoshi ; X = [RAM_OnYoshi]
R $02:D72C LDA.W RAM_OnYoshi ; A = on-Yoshi flag
R $02:EE79 LDY.W RAM_OnYoshi
R $02:F240 LDY.W RAM_OnYoshi
R $02:F9F5 LDA.W RAM_OnYoshi
R $03:87F8 LDY.W RAM_OnYoshi
R $03:8C8D LDA.W RAM_OnYoshi
R $03:8CA7 LDA.W RAM_OnYoshi
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
R $03:B681 LDA.W RAM_OnYoshi
W $04:91D2 STA.W RAM_OnYoshi
W $04:9DF4 STA.W RAM_OnYoshi
R $05:B1D5 LDA.W RAM_OnYoshi

$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)
W $01:84F5 STA.W $187B,X
RW $01:968B INC.W $187B,X ; [$187B] += 1
R $01:9913 LDA.W $187B,X
R $01:A782 LDA.W $187B,Y ; A = $187B,Y
R $01:A94A LDA.W $187B,X ; A = per-sprite flag [$187B,X] (probably 'pushes Mario away')
W $01:C08C STA.W $187B,X
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:C324 LDA.W $187B,X
W $01:CD72 STA.W $187B,X
R $01:CDE9 LDA.W $187B,X
R $01:CE1E LDA.W $187B,X
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:F16C LDA.W $187B,Y
R $01:F265 LDA.W $187B,Y
R $01:F3A6 LDA.W $187B,Y
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:C202 CMP.W $187B,X ; Still zero?
R $02:C283 LDA.W $187B,X ; [$187B] = charging flag
R $02:C403 LDY.W $187B,X ; Y = [$187B]
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)
R $02:C6FC LDA.W $187B,X
R $02:C715 LDY.W $187B,X
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)
R $02:D6B1 LDA.W $187B,X ; A = radius
R $02:D87C LDA.W $187B,X
W $03:A10C STA.W $187B,X ; [$187B] = 2 (hit counter, probably)
RW $03:A676 DEC.W $187B,X ; Hits-left counter [$187B]--
W $03:A684 STA.W $187B,X
R $03:B135 LDA.W $187B,X
W $07:F776 STZ.W $187B,X ; $187B,X = 0

$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)
R $02:82C6 LDA.W $1884
R $02:832C LDA.W $1884
R $02:837B LDA.W $1884

$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)
R $00:A2B5 LDA.W RAM_ShakeGrndTimer
RW $00:A2BA DEC.W RAM_ShakeGrndTimer ; [$1887]--
W $00:FA47 STA.W RAM_ShakeGrndTimer
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:8253 ADC RAM_Layer1DispYLo
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:A2AF STZ.W RAM_Layer1DispYLo
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 $02:82F2 LDA.W RAM_Layer1DispYLo
R $02:844C SBC.W RAM_Layer1DispYLo
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

$188A

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)
W $00:F625 STZ.W $188A ; [$188A] = 0
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)
R $00:E346 LDA.W $188B
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)
W $03:AE3C STZ.W $188B ; Clear $188B

$188C

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $02:8307 LDA.W $188C
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
R $02:828E LDA.W $188D
RW $02:8298 ROR.W $188D ; Pull A, [$188D] = (screen X >> 2) low
R $02:829B LDA.W $188D
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)
W $01:DDEF STZ.W $188F ; Clear $188F
R $01:DE3B LDA.W $188F
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)
W $01:DDF2 STZ.W $1890 ; Clear $1890
RW $01:E021 INC.W $1890 ; Matching line: [$1890]++
R $01:E03E LDA.W $1890
R $01:E270 LDA.W $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)
W $00:FA83 STZ.W $1891 ; [$1891] = 0
RW $01:9FA7 DEC.W RAM_BalloonTimer ; Decrement the P-balloon timer [$1891]
R $01:9FAC LDA.W RAM_BalloonTimer
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)
R $01:E283 LDA.W $1892,Y
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
R $02:AB28 LDA.W $1892,X
W $02:AB2F STA.W $1892,X ; Cluster sprite type [$1892,X] = 4
R $02:DF37 LDA.W $1892,Y
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
R $02:FCE6 LDA.W $1892,X
R $02:FD91 LDA.W $1892,X
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

$18A6

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)
RW $01:CE28 INC.W $18A8 ; [$18A8]++
R $02:83E2 LDA.W $18A8,X ; A = state of column X ([$18A8+X])
RW $02:8408 ASL.W $18A8,X
RW $02:840C ROR.W $18A8,X ; Set bit 7 of [$18A8+X]: column has landed

$18A9

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:841D LDA.W $18A9
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)
W $01:CE2B STZ.W $18AA ; Clear [$18AA]
R $02:83F8 LDA.W $18AA,X
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
R $02:8445 LDA.W $18AA,X

$18AB

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $02:8425 STZ.W $18AB ; [$18AB] = 0

$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:A2B5 STZ.W $18AC ; Clear [$18AC]
R $01:F000 LDY.W $18AC
R $01:F155 LDA.W $18AC
R $01:F1A8 LDA.W $18AC
RW $01:F1AD DEC.W $18AC
R $01:F1E9 LDA.W $18AC
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)
RW $01:EAC6 DEC.W $18AD
W $01:EACD STA.W $18AD ; Walk frame index [$18AD] = ([$18AD] - 1) mod 3
R $01:EAD0 LDY.W $18AD

$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)
R $01:EFF3 LDA.W $18AE
R $01:F0BA LDA.W $18AE
W $01:F0C1 STA.W $18AE ; [$18AE] = 6: start the wind-up
R $01:F1C6 LDA.W $18AE
RW $01:F1CB DEC.W $18AE
W $01:F73D STZ.W $18AE ; Clear $18AE
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)
R $01:EB0C LDA.W $18AF
RW $01:EB11 DEC.W $18AF
W $01:ED53 STA.W $18AF ; [$18AF] = $0C (mount timer)

$18B0

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)
R $02:D1F3 LDA.W $18B0

$18B1

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)

$18B2

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
R $02:D1FD LDA.W $18B2

$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)

$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 $00:EF68 STZ.W $18B5 ; [$18B5] = 0
R $02:CC24 LDA.W $18B5
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)
W $01:D9F0 STA.W $18B6
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
R $01:E951 LDA.W $18B6
W $01:F8E1 STA.W $18B6 ; [$18B6] = $10: Y offset used when aiming at Mario (Big Boo enters here with $20)
R $01:F9A6 SBC.W $18B6
W $02:AC77 STZ.W $18B6 ; [$18B6] = 0: step counter
RW $02:AC8D INC.W $18B6
R $02:AC90 LDA.W $18B6
W $02:ACB7 STZ.W $18B6 ; [$18B6] = 0: step counter
RW $02:ACCD INC.W $18B6
R $02:ACD0 LDA.W $18B6
W $02:E69E STA.W $18B6 ; Save line start Y in [$18B6]
R $02:E6FA LDA.W $18B6
W $02:E703 STA.W $18B6
W $02:E8C3 STA.W $18B6 ; Right tile = GrowingPipeTiles2[Y], saved in [$18B6]
R $02:E8E1 LDA.W $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)
R $01:80B5 LDA.W $18B8
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:AB11 LDY.W $18BA
R $02:AB32 LDA.W $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
R $02:F86F LDA.W $18BA
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
R $02:EE39 LDA.W $18BC
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)
R $00:CCD0 LDA.W RAM_LockMarioTimer
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)
R $00:CD41 LDA.W $18BE
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:848A STZ.W $18BF ; [$18BF] = 0
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 $01:E9E9 LDY.W $18BF ; Y = [$18BF]
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)
R $02:D419 LDA.W $18BF ; A = [$18BF]
R $02:F859 LDA.W $18BF
R $03:9099 LDA.W $18BF
R $03:90CC LDY.W $18BF

$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:AC8B STA.W RAM_TimeTillRespawn
W $01:E7D2 STA.W RAM_TimeTillRespawn ; [RAM_TimeTillRespawn] = $FF
R $02:8B20 LDA.W RAM_TimeTillRespawn
RW $02:8B30 DEC.W RAM_TimeTillRespawn
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:AC86 STA.W RAM_SpriteToRespawn
W $01:E7D7 STA.W RAM_SpriteToRespawn ; [RAM_SpriteToRespawn] = $1E: respawn Lakitu
R $02:8B41 LDA.W RAM_SpriteToRespawn

$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)
W $00:C918 STZ.W $18C2 ; [$18C2] = 0
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)

$18C3

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)

$18C4

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)
R $02:90BB LDA.W $18CE,X
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++
R $01:A84E LDA.W $18D2 ; A = counter
W $01:A857 STA.W $18D2 ; Cap counter at 8
R $01:A85E LDY.W $18D2 ; Y = counter
W $01:A87E STZ.W $18D2 ; Clear [$18D2]
RW $02:F2A6 INC.W $18D2 ; Star kill counter [$18D2]++
R $02:F2A9 LDA.W $18D2
W $02:F2B2 STA.W $18D2 ; [$18D2] = 9
R $02:F2B9 LDY.W $18D2 ; Y = kill streak
RW $03:9603 INC.W $18D2 ; Star kill counter [$18D2]++
R $03:9606 LDA.W $18D2 ; A = counter
W $03:960F STA.W $18D2 ; Counter = 8 (max)
R $03:9616 LDY.W $18D2 ; Y = counter

$18D3

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]
RW $02:8AF0 DEC.W $18D3 ; Count down

$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)
RW $01:F0E8 INC.W $18D4
R $01:F0EB LDA.W $18D4
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)
RW $01:F116 INC.W $18D5
R $01:F119 LDA.W $18D5
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)
R $01:C364 LDX.W $18D6
R $01:F0DC LDA.W $18D6
W $01:F0E1 STZ.W $18D6 ; Clear it
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

$18D7

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)
R $02:E2E6 LDA.W $18D7

$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

$18DA

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $01:ECD9 LDA.W $18DA
W $01:F125 STA.W $18DA ; [$18DA] = reward sprite number

$18DB

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $00:CDD6 STA.W $18DB ; [$18DB] = 8

$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)
R $00:FED8 LDA.W $18DC ; A = [$18DC]
W $01:EA9A STZ.W $18DC ; [$18DC] = 0 (Yoshi ducking/looking down flag)
RW $01:EB1E INC.W $18DC ; [$18DC]++ (flag: Yoshi ducking)
R $01:ED8B ORA.W $18DC
R $01:F229 LDA.W $18DC
R $01:F3CD LDY.W $18DC ; Y = [$18DC]
R $02:D1D3 LDY.W $18DC ; Y = [$18DC]

$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)
W $00:FA8C STZ.W $18DD ; [$18DD] = 0
R $00:FC05 LDA.W $18DD ; A = [$18DD] (next point value index)
R $00:FC12 LDA.W $18DD
W $00:FC18 STA.W $18DD
R $01:C4E0 LDA.W $18DD
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)
R $01:EC0E LDA.W $18DE
R $01:EC65 LDA.W $18DE
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)
R $01:809E LDA.W $18DF
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)
R $01:E7B6 LDA.W $18E0 ; A = [$18E0]
RW $01:E7BB DEC.W $18E0 ; [$18E0]--

$18E1

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)
W $00:F5C6 STZ.W $18E3 ; [$18E3] = 0
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
R $02:EF67 LDA.W $18E3

$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
R $02:AE07 ADC.W $18E4
W $02:AE0A STA.W $18E4 ; Lives to add [$18E4] += A, [$18E5] = 0
RW $05:CC81 INC.W $18E4

$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)
R $02:8AB9 LDA.W $18E5 ; Delay [$18E5]
RW $02:8ABE DEC.W $18E5 ; Count down delay
W $02:8ACA STA.W $18E5 ; Delay between awards = $23
W $02:AE0D STZ.W $18E5

$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)
R $01:EA8F LDA.W $18E8
R $01:EC13 LDA.W $18E8
RW $01:EC18 DEC.W $18E8 ; Count the growing timer down
R $02:EA7E ORA.W $18E8
R $02:EAA4 LDA.W $18E8
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
W $02:8C04 STA.W $18EA,Y
R $02:8C49 LDA.W $18EA,X
W $02:8C4C STA.W $18EA,Y ; Copy X high
R $02:8C79 LDA.W $18EA,X
R $02:8CD0 LDA.W $18EA,X
R $02:8D0A LDA.W $18EA,X
R $02:8D54 LDA.W $18EA,X
R $02:8F34 LDA.W $18EA,X
R $02:8FA5 ADC.W $18EA,X ; X position high += sign extension
W $02:8FA8 STA.W $18EA,X
R $02:8FE8 LDA.W $18EA,X
W $03:9044 STA.W $18EA,Y
W $03:AD93 STA.W $18EA,Y

$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)
RW $02:AD3E DEC.W $18F7
W $02:AD45 STA.W $18F7
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)
RW $02:939D DEC.W $18F8,X
R $02:93A2 LDA.W $18F8,X

$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)
RW $01:8EF9 DEC.W $18FC
W $01:8F00 STA.W $18FC ; Wrap to 7
R $01:8F03 LDY.W $18FC ; Y = round-robin slot (it will be overwritten)

$18FD

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
W $02:C3AF STA.W $18FD ; [$18FD] = 9

$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)
R $02:B0D2 LDA.W $18FE
RW $02:B0D5 INC.W $18FE
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)
RW $02:AB89 DEC.W $18FF
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?
R $05:CD99 LDA.W $1900
R $05:CDAE LDA.W $1900
R $05:CDDA LDA.W $1900
R $05:CF05 LDX.W $1900
R $05:CF1E LDA.W $1900
W $05:CF22 STA.W $1900 ; Bonus star counter [$1900] -= 1 (BCD)
R $05:CF2B LDA.W $1900
W $05:CF31 STA.W $1900 ; ... subtract 6: BCD borrow correction ($xF -> $x9)
R $05:CF3B LDX.W $1900
R $05:CFAE LDA.W $1900
R $05:CFC3 LDA.W $1900
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]
R $02:9246 LDA.W $1901,X

$1905

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)
R $03:C125 LDA.W $1906
RW $03:C12A DEC.W $1906 ; Count the stationary timer down
R $03:C131 ORA.W $1906
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
R $03:C16B LDA.W $1907
W $03:C172 STZ.W $1907 ; Phase = 0

$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)
W $00:EE7C STZ.W $1909 ; [$1909] = 0
W $01:84D8 STA.W $1909 ; [$1909] = $FF
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)
W $02:AA8D STZ.W $190A ; [$190A] = 0
R $02:F83D LDA.W $190A ; A = [$190A] (fade timer, counts $FF down to 0)
RW $02:F846 DEC.W $190A ; Timer -= 1
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:80E2 LDA.W $190B
RW $03:81C6 DEC.W $190B
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
R $00:C547 LDY.W $190C ; Y = [$190C]
R $00:E2FE ORA.W $190C
W $02:896F STZ.W $190C ; Clear directional coin timer [$190C]
RW $02:E26C DEC.W $190C
W $02:E271 STZ.W $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)
R $03:B44F LDA.W $190D
R $03:B4B1 LDA.W $190D
R $03:DFE4 LDA.W $190D

$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)
R $00:FAC5 LDA.W RAM_Tweaker190F,Y
R $01:91BE LDA.W RAM_Tweaker190F,X
R $01:9272 LDA.W RAM_Tweaker190F,X
RW $01:9A84 ASL.W RAM_Tweaker190F,X
RW $01:9A87 LSR.W RAM_Tweaker190F,X ; Clear bit 7 of tweaker [$190F]
R $01:9B20 LDA.W RAM_Tweaker190F,X
R $01:A39E LDA.W RAM_Tweaker190F,X
R $01:A8B4 LDA.W RAM_Tweaker190F,X
R $01:A8EB LDA.W RAM_Tweaker190F,X
R $01:B4B4 LDA.W RAM_Tweaker190F,X
R $01:F4F2 LDA.W RAM_Tweaker190F,Y
R $02:8A1F LDA.W RAM_Tweaker190F,X ; Tweaker byte [$190F]
R $02:A0F5 LDA.W RAM_Tweaker190F,X
R $02:B9CB LDA.W RAM_Tweaker190F,Y
W $07:F7CC STA.W RAM_Tweaker190F,Y ; Tweaker $190F,Y = Sprite190FVals[sprite number]

$191B

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $01:EBD9 STZ.W $191B ; Clear [$191B]

$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)
R $01:E1E0 LDA.W $191C
W $01:EA78 STZ.W $191C ; Clear [$191C]
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)
RW $02:DF3F DEC.W $191D
W $02:DF46 STA.W $191D ; Store index
R $02:DF49 LDY.W $191D ; Y = slot to overwrite

$191E

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)

$1920

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)
RW $02:FE3E DEC.W $1920

$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]
RW $03:AEBE INC.W $1921 ; Step++
R $03:D677 LDX.W $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)
R $00:BF04 LDA.W $1925
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]
R $05:83D4 LDA.W $1925 ; A = level mode
W $05:84FB STA.W $1925 ; Level mode [$1925] = byte2 & $1F
R $05:8666 LDA.W $1925
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]
R $05:89D1 LDA.W $1925
R $05:8A9E LDA.W $1925
R $05:8B90 LDA.W $1925
R $05:8C74 LDA.W $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 $00:C5D8 STA.W $1928 ; [$1928] = 7
W $05:8036 STZ.W $1928 ; [$1928] = 0 (screen counter used while loading level data)
W $05:8089 STZ.W $1928 ; [$1928] = 0
W $05:80A1 STZ.W $1928 ; [$1928] = 0 (column counter)
RW $05:80FB INC.W $1928 ; [$1928]++
R $05:80FE LDA.W $1928
W $05:840C STZ.W $1928 ; [$1928] = 0
R $05:8692 ADC.W $1928
W $05:8695 STA.W $1928 ; New page flag ([$0A] bit 7): [$1928]++ (A = screen number)
R $05:869D ADC.W $1928
R $05:8D7D LDA.W $1928
R $05:8D88 LDA.W $1928
R $05:8DA6 LDA.W $1928
R $05:8DCE LDA.W $1928
W $0C:93DF STZ.W $1928 ; [$1928] = 0: start with credits background 0
R $0C:93E2 LDA.W $1928
RW $0C:9428 INC.W $1928 ; Next background: [$1928]++
R $0C:942B LDA.W $1928
W $0C:943C STZ.W $1928 ; [$1928] = 0: show background 0 first
R $0C:94DD LDA.W $1928
R $0C:9586 LDA.W $1928
R $0C:95B1 LDA.W $1928
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)
R $0D:A6C6 LDA.W $1928

$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)
W $05:D838 STA.W $192A
W $05:D97E STA.W $192A
W $05:DA7B STZ.W $192A ; [$192A] = 0

$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)
R $02:BE5B LDA.W $192B
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)
R $00:AC46 LDA.W $192D
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
R $00:AC6F LDA.W $192E
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:9481 STA.W $192F
W $00:9650 STA.W $192F ; Background color setting [$192F] = 3
R $00:AC33 LDA.W $192F
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:9487 STA.W $1930
W $00:9655 STA.W $1930 ; FG palette setting [$1930] = 3
R $00:AC98 LDA.W $1930
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)
RW $00:94AA INC.W $1931
W $00:97D5 STA.W $1931 ; Tileset [$1931] = $FF
RW $00:97FC DEC.W $1931 ; Tileset [$1931]-- ($FE)
R $00:9FB8 LDA.W $1931
R $00:9FBD ADC.W $1931 ; [$00] = tileset [$1931] * 3
R $00:9FEF LDA.W $1931 ; A = tileset
R $00:A694 LDX.W $1931
R $00:AA19 LDA.W $1931 ; A = tileset [$1931]
R $00:AA22 LDA.W $1931
R $00:AA85 LDX.W $1931 ; X = tileset [$1931]
R $00:AD34 LDA.W $1931 ; A = [$1931]
R $00:C873 LDX.W $1931
R $00:C8C4 LDX.W $1931
R $00:C8E1 LDX.W $1931
R $00:EBE1 LDA.W $1931 ; A = tileset [$1931]
R $00:ED86 LDA.W $1931 ; A = tileset [$1931]
R $00:EDFB LDA.W $1931 ; A = tileset
R $00:EE3D LDA.W $1931 ; A = tileset
R $00:F134 LDA.W $1931
R $00:F14D LDA.W $1931
R $00:F169 LDX.W $1931 ; X = tileset number ([$1931])
R $00:F1E5 LDY.W $1931
R $01:9318 LDY.W $1931
R $01:93E4 LDA.W $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:81FD LDA.W $1931
R $05:8278 LDA.W $1931
W $05:85A6 STA.W $1931
R $05:8A3E LDA.W $1931
R $05:8B1A LDA.W $1931
R $05:8B9D LDA.W $1931
R $05:8C0C LDA.W $1931
R $05:8C81 LDA.W $1931
R $05:8CFF LDA.W $1931
R $05:BB81 LDY.W $1931 ; Y = level tileset [$1931]
R $05:C416 LDY.W $1931
W $05:DAD4 STA.W $1931 ; [$1931] = tileset number DATA_05D760[X]
R $0D:A417 LDA.W $1931 ; A = tileset [$1931]

$1932

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)

$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)
R $00:BECF LDA.W $1933
R $00:BEF1 LDA.W $1933
R $00:BF8A LDA.W $1933
R $00:BFA4 LDA.W $1933
R $00:C0FF LDA.W $1933
R $00:C1E3 LDA.W $1933
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)
W $01:95CA STA.W $1933
W $01:99C1 STA.W $1933
R $02:870C LDA.W $1933 ; Layer 2 flag [$1933]
R $02:8849 LDA.W $1933 ; Layer 2 flag [$1933]
R $02:8984 LDA.W $1933 ; Layer 2 flag
R $02:8A9D LDA.W $1933 ; Layer flag
W $02:91E5 STA.W $1933
W $02:9624 STA.W $1933 ; [$1933] = layer
W $05:83AF STZ.W $1933 ; Layer number [$1933] = 0 (layer 1)
RW $05:83F1 INC.W $1933
R $05:83F4 LDA.W $1933 ; Layer number [$1933]++ (to layer 2)
W $05:8412 STZ.W $1933 ; Layer number [$1933] = 0
R $05:8631 LDY.W $1933
R $05:8652 LDA.W $1933

$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:A43B STZ.W $1935 ; Clear the flag
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
R $02:A856 LDA.W RAM_SprLoadStatus,X
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:8714 STA.W RAM_SprLoadStatus,Y
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

$19D8

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)

$19F8

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:9304 STZ.W $1B7A ; [$1B7A] = 0
W $04:9357 STA.W $1B7A ; [$1B7A] = offset - 1 (index of the last tile walked)
R $04:95B2 LDX.W $1B7A
W $04:95C0 STX.W $1B7A ; [$1B7A] = path step

$1B7C

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
W $04:832E STA.W $1B7C,Y

$1B7E

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
R $04:96E7 LDA.W $1B7E

$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)
R $04:94DE LDX.W $1B80 ; X = [$1B80]
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:E741 LDA.W $1B84 ; A = [$1B84]
R $04:EAD4 LDA.W $1B84 ; A = [$1B84] (tile source index)
RW $04:EBEB DEC.W $1B84 ; Timer [$1B84]--
R $04:EBF4 LDA.W $1B84 ; A = timer
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)
W $04:DAA4 STZ.W $1B86 ; [$1B86] = 0
R $04:E570 LDA.W $1B86
RW $04:E640 INC.W $1B86 ; Go to state 1: [$1B86]++
R $04:E668 LDA.W $1B86 ; A = [$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:E6F5 INC.W $1B86 ; and state 4
RW $04:E768 INC.W $1B86 ; Go to state 4: [$1B86]++
R $04:E9FC LDA.W $1B86 ; A = [$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
R $04:8281 LDA.W $1B87
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]++
R $04:F432 LDA.W $1B87 ; A = new state
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
R $0C:9FBB LDA.W $1B88
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 $04:F46A LDA.W $1B89
R $04:F46E ADC.W $1B89
R $04:F478 SBC.W $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 $05:B25A STA.W $1B89
R $05:B264 SBC.W $1B89
R $05:B26D CPX.W $1B89
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
R $0C:AB3D LDA.W $1B89
W $0C:AB68 STA.W $1B89
R $0C:AB74 CPX.W $1B89

$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
R $04:F5DB LDA.W $1B8A

$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]++
R $04:F5D4 LDA.W $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)
W $04:9628 STZ.W $1B8C ; [$1B8C] = 0
R $04:DB1A LDX.W $1B8C ; X = [$1B8C]: 0 closing, 2 opening
W $04:DB57 STX.W $1B8C ; Save it

$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
R $04:DB1D LDA.W $1B8D
W $04:DB24 STA.W $1B8D ; [$1B8D] += width step
W $04:DB46 STA.W $1B8D ; Clamp [$1B8D] to its limit

$1B8E

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (2 read)
R $04:DB67 LDA.W $1B8E
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
R $04:DB30 LDA.W $1B8F
W $04:DB37 STA.W $1B8F ; [$1B8F] += height step
W $04:DB4C STA.W $1B8F ; Clamp [$1B8F] to its limit

$1B90

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)
R $05:D7D4 LDA.W $1B93
R $05:D94C LDA.W $1B93
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 $00:FC81 LDA.W $1B94 ; A = [$1B94]
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)

$1B96

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (1 read, 1 write)
R $00:E98C LDA.W $1B96
W $02:F4D7 STA.W $1B96 ; Side exit flag [$1B96] = 1

$1B97

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$1B99

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:C96E LDA.W $1B99
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)
R $03:85FD LDA.W $1B9A
R $03:863D LDA.W $1B9A
R $03:864F LDA.W $1B9A
W $03:8656 STA.W $1B9A ; [$1B9A] = 8: start the movement
R $05:C7BC LDA.W $1B9A

$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)

$1B9C

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)

$1B9D

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 write, 1 read-modify-write)
RW $05:C4AA DEC.W $1B9D
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)
W $04:915B STZ.W $1B9E ; [$1B9E] = 0
W $04:9622 STA.W $1B9E ; [$1B9E] = 1
R $04:DBE2 LDA.W $1B9E
W $04:DBFE STZ.W $1B9E ; [$1B9E] = 0

$1B9F

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)
R $04:83C3 LDX.W $1BA0
RW $04:83FE DEC.W $1BA0
R $04:983A LDA.W $1BA0
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)
R $03:DF58 LDY.W $1BA1
W $05:8698 STA.W $1BA1 ; [$1BA1] = current screen number
W $0D:A544 STA.W $1BA1 ; Also [$1BA1] = screen number
R $0D:A608 LDA.W $1BA1
W $0D:A6C9 STA.W $1BA1 ; Restore current screen [$1BA1] from [$1928]
R $0D:A8F4 LDA.W $1BA1
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]++
R $0D:B2F4 LDA.W $1BA1
R $0D:B362 LDA.W $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
W $03:98BB STA.W $1BA2 ; [$1BA2] = $2C
W $03:A28E STA.W $1BA2
R $03:DF2E LDA.W $1BA2
R $03:DF48 LDA.W $1BA2
R $03:DF6D BIT.W $1BA2

$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)
R $03:DDFB LDA.W $1BA3,X
W $03:DE04 STA.W $1BA3,X ; A = 3-bit color of this pixel: rotate the three collected plane bits down
R $03:DE1A LDY.W $1BA3,X
RW $03:DE43 ROR.W $1BA3,X

$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)

$1BBC

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
R $00:AAAE LDA.W $1BBC

$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:D931 STA.W $1BE3
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)
R $00:87CB LDA.W $1BE4
R $00:87EA LDA.W $1BE4
R $00:880D LDA.W $1BE4
R $00:882D LDA.W $1BE4
R $00:8854 LDA.W $1BE4
R $00:8873 LDA.W $1BE4
R $00:889D LDA.W $1BE4
R $00:88BF LDA.W $1BE4
W $00:88DF STA.W $1BE4 ; [$1BE4] = 0: layer 1 update done
W $05:8A11 STA.W $1BE4
W $05:8AE0 STA.W $1BE4

$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)
R $00:87C5 LDA.W $1BE5
R $00:87E4 LDA.W $1BE5
R $00:8806 LDA.W $1BE5
R $00:8826 LDA.W $1BE5
R $00:884E LDA.W $1BE5
R $00:886D LDA.W $1BE5
R $00:8894 LDA.W $1BE5
R $00:88B6 LDA.W $1BE5
W $05:8A01 STA.W $1BE5
W $05:8AED STA.W $1BE5

$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
W $05:8B60 STA.W $1BE6,X

$1BE8

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)
W $05:8A7E STA.W $1C66,X
W $05:8B57 STA.W $1C66,X
W $05:8B67 STA.W $1C66,X

$1C68

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)
R $00:88FE LDA.W $1CE6
R $00:891D LDA.W $1CE6
R $00:8940 LDA.W $1CE6
R $00:8960 LDA.W $1CE6
R $00:8987 LDA.W $1CE6
R $00:89A6 LDA.W $1CE6
R $00:89D0 LDA.W $1CE6
R $00:89F2 LDA.W $1CE6
W $00:8A12 STA.W $1CE6 ; [$1CE6] = 0: layer 2 update done
W $05:8BDF STA.W $1CE6
W $05:8CC5 STA.W $1CE6
W $05:8D92 STA.W $1CE6

$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)
R $00:88F8 LDA.W $1CE7
R $00:8917 LDA.W $1CE7
R $00:8939 LDA.W $1CE7
R $00:8959 LDA.W $1CE7
R $00:8981 LDA.W $1CE7
R $00:89A0 LDA.W $1CE7
R $00:89C7 LDA.W $1CE7
R $00:89E9 LDA.W $1CE7
W $05:8BCF STA.W $1CE7
W $05:8CD2 STA.W $1CE7
W $05:8D83 STA.W $1CE7

$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:8C40 STA.W $1CE8,X
W $05:8D37 STA.W $1CE8,X
W $05:8D4B STA.W $1CE8,X
W $05:8DEE STA.W $1CE8,X ; Word 0 (top-left 8x8 tile) to left column buffer $1CE8

$1CEA

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)
W $05:8C52 STA.W $1D68,X
W $05:8D40 STA.W $1D68,X
W $05:8D54 STA.W $1D68,X
W $05:8DFC STA.W $1D68,X

$1D6A

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)
R $00:8229 LDY $1DE8
R $04:DAF1 LDA.W $1DE8
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
R $04:DCC9 LDA.W $1DE8
RW $04:DD3B INC.W $1DE8 ; Next submap switch state
R $04:F88B LDY.W $1DE8

$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)
R $00:95FA LDA.W $1DE9 ; A = [$1DE9]
RW $00:A281 INC.W $1DE9 ; [$1DE9]++ (general transition counter, probably)
RW $00:CA28 INC.W $1DE9 ; [$1DE9]++
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:AD94 LDA.W $1DE9
R $0C:ADF9 LDA.W $1DE9 ; A = [$1DE9]: ending enemy scene (0 = Lakitu ... 12 = Bowser)
R $0C:AE00 ADC.W $1DE9
R $0C:AE13 LDA.W $1DE9
R $0C:AE6C LDA.W $1DE9
R $0C:AEAF LDA.W $1DE9
R $0C:AF00 LDA.W $1DE9
R $0C:B5C1 LDA.W $1DE9 ; A = scene

$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)
RW $04:E5F5 INC.W $1DEA
R $04:E5FD LDA.W $1DEA ; A = event number [$1DEA]
R $04:E604 LDA.W $1DEA
R $04:E60A LDA.W $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
R $04:ED8E LDA.W $1DEA
R $04:EDAF LDA.W $1DEA
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
R $04:E47E CMP.W $1DEB
RW $04:E488 INC.W $1DEB ; Next record
R $04:E48B LDA.W $1DEB
R $04:E498 LDA.W $1DEB
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
R $04:EAB9 LDA.W $1DEB ; A = [$1DEB]
R $04:EE38 LDA.W $1DEB

$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)
R $04:E48E CMP.W $1DED
W $04:E6E8 STA.W $1DED ; [$1DED] = end index
R $04:EABC CMP.W $1DED

$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)
R $04:82B5 LDA.W $1DF0
R $04:82D7 LDA.W $1DF0
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)
R $04:82A0 LDA.W $1DF2
R $04:82DE LDA.W $1DF2
W $04:8395 STA.W $1DF2 ; Save current Y scroll in [$1DF2]

$1DF4

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:9C7A STA.W $1DF5 ; [$1DF5] = it
W $00:A09D STA.W $1DF5 ; [$1DF5] = $B0 (delay timer)
W $00:C964 STA.W $1DF5 ; [$1DF5] = $A0
R $05:B13A LDA.W $1DF5
RW $05:B145 DEC.W $1DF5

$1DF6

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
RW $04:9E69 INC.W $1DF7
R $04:9E6C LDA.W $1DF7
W $04:9E75 STA.W $1DF7
R $04:9E7A LDA.W $1DF7

$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
RW $04:9E57 INC.W $1DF8
R $04:9E5A LDA.W $1DF8

$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
R $00:818F LDA $1DF9
W $00:81A1 STZ $1DF9
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:D8AA STA.W $1DF9
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 $00:FB7F STA.W $1DF9 ; Play SFX $0C
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:A65C STA.W $1DF9
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:C899 STA.W $1DF9
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)
R $00:8195 LDA $1DFA
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)
R $00:8179 LDA $1DFB
W $00:818C STZ $1DFB
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:AB09 STA.W $1DFB ; Change music
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:8969 STA.W $1DFB ; Request music
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:A7C3 STA.W $1DFB ; Change music
W $03:A88E STA.W $1DFB ; Change music
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)
R $00:819B LDA $1DFC
W $00:81A7 STZ $1DFC
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:C10B STA.W $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:C383 STA.W $1DFC
W $02:C4FA STA.W $1DFC ; Play sound $19
W $02:C538 STA.W $1DFC ; Play sound 8
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

$1DFD

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)

$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
R $00:CC77 LDA.W $1E01
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]
R $02:F8B5 LDA.W $1E02,X
W $02:F8BC STA.W $1E02,X ; Y position low += [DATA_02F837+Y] (+1 or -1)
R $02:F954 LDA.W $1E02,X
R $02:F9D2 LDA.W $1E02,X
R $02:FA37 LDA.W $1E02,X
W $02:FBA2 STA.W $1E02,X
R $02:FC0E LDA.W $1E02,X
W $02:FC15 STA.W $1E02,X
R $02:FC78 LDA.W $1E02,X
R $02:FCAE LDA.W $1E02,X
R $02:FD38 ADC.W $1E02,X
W $02:FD3B STA.W $1E02,X
R $02:FD56 LDA.W $1E02,X
R $02:FDD1 LDA.W $1E02,X
W $02:FDDA STA.W $1E02,X
R $02:FE2E SBC.W $1E02,X
R $02:FE54 LDA.W $1E02,X
R $02:FE96 LDA.W $1E02,X
R $02:FED3 LDA.W $1E02,X
R $02:FF30 CMP.W $1E02,X
R $02:FF75 LDA.W $1E02,X
R $02:FFC3 ADC.W $1E02,X
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:AA47 STA.W $1E16,X
W $02:AA7B STA.W $1E16,X ; X position low from DATA_02AA68
W $02:AAE9 STA.W $1E16,X
W $02:DF57 STA.W $1E16,Y ; Store at [$1E16,Y]
R $02:DF79 LDA.W $1E16,Y
W $02:F885 STA.W $1E16,X ; Cluster X low = [$00] + [RAM_ScreenBndryXLo]
R $02:F949 LDA.W $1E16,X
R $02:F9BC LDA.W $1E16,X
R $02:FA2E LDA.W $1E16,X
W $02:FB8B STA.W $1E16,X
R $02:FBF2 LDA.W $1E16,X
W $02:FBFC STA.W $1E16,X
R $02:FC8D LDA.W $1E16,X
R $02:FCC1 LDA.W $1E16,X
R $02:FD4D LDA.W $1E16,X
R $02:FDEF ADC.W $1E16,X
W $02:FDF2 STA.W $1E16,X ; X position low byte += X speed [$1E66]
R $02:FDF5 LDA.W $1E16,X
R $02:FDFD LDA.W $1E16,X
R $02:FE13 SBC.W $1E16,X
R $02:FE4B LDA.W $1E16,X
R $02:FE7B LDA.W $1E16,X
R $02:FEF1 CMP.W $1E16,X
R $02:FF86 LDA.W $1E16,X

$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
R $02:F8BF LDA.W $1E2A,X
W $02:F8C5 STA.W $1E2A,X ; Y position high += [DATA_02F839+Y]
R $02:F959 LDA.W $1E2A,X
R $02:F9DF LDA.W $1E2A,X
W $02:FBAA STA.W $1E2A,X ; Cluster Y (16-bit) = ring center Y + Y offset
W $02:FC23 STA.W $1E2A,X
R $02:FCB7 LDA.W $1E2A,X
R $02:FD40 ADC.W $1E2A,X
W $02:FD43 STA.W $1E2A,X ; Y position += +1 or -1 (16-bit)
R $02:FDCC LDA.W $1E2A,X
R $02:FE9D LDA.W $1E2A,X
R $02:FED9 LDA.W $1E2A,X
R $02:FF3D SBC.W $1E2A,X
R $02:FF7E LDA.W $1E2A,X
R $02:FFCA ADC.W $1E2A,X
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
R $02:F94E LDA.W $1E3E,X
R $02:F9C4 LDA.W $1E3E,X
W $02:FB93 STA.W $1E3E,X ; Cluster X (16-bit) = ring center X + X offset
W $02:FC08 STA.W $1E3E,X
R $02:FC92 LDA.W $1E3E,X
R $02:FCC6 LDA.W $1E3E,X
R $02:FE80 LDA.W $1E3E,X
R $02:FEFD SBC.W $1E3E,X
R $02:FF8C LDA.W $1E3E,X

$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
R $02:F86A LDA.W $1E52,X
W $02:FC36 STA.W $1E52,X ; Y speed [$1E52] = aimed Y speed + 9 (downward bias)
R $02:FC6E LDA.W $1E52,X
RW $02:FC75 DEC.W $1E52,X ; Y speed -= 1 each time while it is above about -31 (swoops back up)
R $02:FC82 LDA.W $1E52,X
R $02:FDBF LDA.W $1E52,X
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
R $02:FDE6 LDA.W $1E52,X
R $02:FFA3 LDA.W $1E52,X
R $02:FFB2 LDA.W $1E52,X

$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:AA35 STZ.W $1E66,X
W $02:AA9D STA.W $1E66,X ; [$1E66,X] = high nibble of table 1 value
W $02:AAD7 STZ.W $1E66,X
R $02:F865 LDA.W $1E66,X
W $02:FC3B STA.W $1E66,X ; X speed [$1E66] = aimed X speed
W $02:FC8A STZ.W $1E66,X ; X speed = 0
R $02:FCFE LDA.W $1E66,X
W $02:FD05 STA.W $1E66,X ; X speed [$1E66] += +1 or -1 (DATA_02FBBB)
R $02:FD77 LDA.W $1E66,X
R $02:FDEB LDA.W $1E66,X
R $02:FDF8 EOR.W $1E66,X
R $02:FE07 LDA.W $1E66,X
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
R $02:F87B LDA.W $1E7A,X
R $02:FFAB ADC.W $1E7A,X
W $02:FFAE STA.W $1E7A,X ; Y fraction [$1E7A] += speed * 16 (low nibble)

$1E8E

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
R $02:F876 LDA.W $1E8E,X

$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
R $04:8E1A LDA.W $1EA2,X
R $04:8F4D LDA.W $1EA2,X
W $04:8F53 STA.W $1EA2,X ; Set bit 6 (midway point reached) in the level flags
R $04:8F6B LDA.W $1EA2,X
W $04:8F74 STA.W $1EA2,X
R $04:9043 LDA.W $1EA2,X
R $04:92A2 AND.W $1EA2,X
R $04:96CB ORA.W $1EA2,X ; Set the exit bit of the entry side in [$1EA2+X] (bits from DATA_04941E)
W $04:96CE STA.W $1EA2,X
R $04:995B ORA.W $1EA2,X ; Set the exit bit in [$1EA2+X] (bits from DATA_04941E)
W $04:995E STA.W $1EA2,X
R $05:D9D7 LDA.W $1EA2,X

$1EEA

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 $00:AA73 LDA.W $1EEB
R $01:9825 LDA.W $1EEB
R $01:B9CC LDA.W $1EEB
R $02:A985 LDY.W $1EEB ; Y = [$1EEB] (bit 7 probably set once the Special Zone is cleared)
R $0C:AE0E LDA.W $1EEB ; A = [$1EEB]

$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:8F96 LDA.W $1F02,X
R $04:DA5C LDA.W $1F02,Y
R $04:E460 LDA.W $1F02,Y
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

$1F07

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)
W $01:E762 STA.W $1F11 ; [$1F11] = 1
R $01:EC2C LDA.W $1F11,Y
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:8378 LDA.W $1F11,X
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:8EF6 LDA.W $1F11
R $04:933B LDA.W $1F11,X
R $04:9852 LDA.W $1F11,X
R $04:98B5 LDA.W $1F11,X
R $04:9A2C LDA.W $1F11,X
R $04:9A9C LDA.W $1F11,X
W $04:9AA5 STA.W $1F11,X
R $04:9E0B LDA.W $1F11,X
R $04:D702 LDA.W $1F11,X
R $04:D760 LDA.W $1F11,X ; A = submap the player is on
R $04:DBA3 LDA.W $1F11,X
R $04:DBEB LDA.W $1F11,Y
R $04:DBEE CMP.W $1F11,X
R $04:DBF3 LDA.W $1F11,Y
R $04:DC11 LDA.W $1F11,X
R $04:DCDC LDA.W $1F11,X
R $04:EB3D LDA.W $1F11,X ; A = OW submap [$1F11+X]
R $04:F898 LDA.W $1F11,Y
R $04:FC4C LDA.W $1F11,Y
R $04:FD7C LDA.W $1F11,Y ; A = [$1F11,Y] (probably the player's current submap)
R $05:D7CB LDA.W $1F11,Y
R $05:D88B LDA.W $1F11,Y
R $05:D8AE LDA.W $1F11,Y

$1F12

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:86AD LDA.W $1F13,Y
R $04:8721 LDA.W $1F13,Y
R $04:8965 LDA.W $1F13,Y
R $04:8CEC LDA.W $1F13,Y
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
R $04:966B LDA.W $1F13,X
W $04:9671 STA.W $1F13,X
R $04:967E LDA.W $1F13,X
W $04:9684 STA.W $1F13,X
R $04:96DA LDA.W $1F13,X
W $04:979A STA.W $1F13,X ; Player animation [$1F13+X] = [$04]
W $04:98C6 STZ.W $1F13 ; [$1F13] = 0 (Mario animation: standing)

$1F15

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)
R $04:8659 LDA.W $1F17,X
R $04:8DF5 LDA.W $1F17,X
W $04:8EC0 STA.W $1F17,Y ; Player map X = DATA_048E49[X]
R $04:8EFD LDA.W $1F17
R $04:8F18 LDA.W $1F17,X
R $04:900A LDA.W $1F17,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:97AE ADC.W $1F17,X
R $04:9825 ADC.W $1F17,X ; Player position [$1F17+X] += whole pixels
W $04:9828 STA.W $1F17,X
R $04:9844 LDA.W $1F17,X
R $04:9917 LDA.W $1F17,X
R $04:9A47 LDA.W $1F17,X
W $04:9A63 STA.W $1F17,X ; Player X position = destination X (DATA_0499AC)
R $04:F2B3 LDA.W $1F17,Y
R $04:FF00 SBC.W $1F17,Y ; - player map X [$1F17,Y]

$1F18

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
R $04:8642 LDA.W $1F19,X
R $04:8668 LDA.W $1F19,X
R $04:8DFE LDA.W $1F19,X
W $04:8EC6 STA.W $1F19,Y ; Player map Y = DATA_048E4F[X]
R $04:8F04 LDA.W $1F19
R $04:8F21 LDA.W $1F19,X
R $04:9013 LDA.W $1F19,X
R $04:91FA LDA.W $1F19,X ; A = player Y position
R $04:9324 LDA.W $1F19,X ; A = player Y position
R $04:97C5 ADC.W $1F19,X
R $04:9849 LDA.W $1F19,X
R $04:98DF ADC.W $1F19
W $04:98E2 STA.W $1F19 ; Mario Y position low [$1F19] += -1 + carry
R $04:98EC LDA.W $1F19
R $04:9923 LDA.W $1F19,X
R $04:9A3F LDA.W $1F19,X
W $04:9A5D STA.W $1F19,X ; Player Y position = destination Y (DATA_0499AA)
R $04:9E85 LDA.W $1F19,X
W $04:9E8B STA.W $1F19,X
R $04:F2C1 LDA.W $1F19,Y
R $04:F9DA LDA.W $1F19,Y
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)
W $04:98E9 STA.W $1F1A
R $04:F2C8 LDA.W $1F1A,Y
R $04:F9E0 LDA.W $1F1A,Y

$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)
R $04:8524 CMP.W $1F1F,X
W $04:8554 STA.W $1F1F,X
R $04:8E65 LDA.W $1F1F,X
W $04:91F7 STA.W $1F1F,X ; [$00] and [$1F1F,X] = tile column
R $04:952D LDA.W $1F1F,X
R $04:9585 LDA.W $1F1F,X
W $04:9607 STA.W $1F1F,X ; Player tile X = new tile X
W $04:9920 STA.W $1F1F,X ; [$1F1F+X] = tile X
W $04:9A80 STA.W $1F1F,X
R $05:D850 LDA.W $1F1F,X
R $05:D864 LDA.W $1F1F,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)
R $04:8529 LDA.W $1F21,X
W $04:8561 STA.W $1F21,X
R $04:8E6A LDA.W $1F21,X
W $04:9203 STA.W $1F21,X ; [$02] and [$1F21,X] = tile row
R $04:9532 LDA.W $1F21,X
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
W $04:9A77 STA.W $1F21,X
R $05:D858 LDA.W $1F21,X
R $05:D872 LDA.W $1F21,X

$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)

$1F29

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 read)

$1F2E

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)
R $00:F351 ORA.W $1F2F,Y
W $00:F354 STA.W $1F2F,Y ; 5 Yoshi coins: set the level's flag in the bit array at [$1F2F + Y]
R $0D:B2D7 LDA.W $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)
R $00:F2B8 ORA.W $1F3C,Y
W $00:F2BB STA.W $1F3C,Y ; Set the level's flag in the bit array at [$1F3C + Y]
R $0D:A5A7 LDA.W $1F3C,Y

$1F48

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
W $04:9046 STA.W $1F49,X

$1FA9

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 $01:E765 STA.W $1FB8 ; [$1FB8] = 1
R $04:8FD6 LDA.W $1FB8,X
W $04:8FD9 STA.W $1FB8,Y ; Save buffer: copy submap ($1FB8) to the other player

$1FBA

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $04:8FC8 LDA.W $1FBA,X
W $04:8FCB STA.W $1FBA,Y ; Save buffer: copy animation/facing ($1FBA) to the other player

$1FBE

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $04:8FA9 LDA.W $1FBE,X
W $04:8FAC STA.W $1FBE,Y ; Save buffer: copy player X position ($1FBE) to the other player

$1FC0

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $04:8FAF LDA.W $1FC0,X
W $04:8FB2 STA.W $1FC0,Y ; Save buffer: copy player Y position ($1FC0) to the other player

$1FC6

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $04:8FB5 LDA.W $1FC6,X
W $04:8FB8 STA.W $1FC6,Y ; Save buffer: copy tile X position ($1FC6) to the other player

$1FC8

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $04:8FBB LDA.W $1FC8,X
W $04:8FBE STA.W $1FC8,Y ; Save buffer: copy tile Y position ($1FC8) to the other player

$1FD6

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)
W $07:F782 STZ.W $1FD6,X ; $1FD6,X = 0

$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:810E LDA.W $1FE2,X
RW $01:8113 DEC.W $1FE2,X
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
R $02:93C9 ORA.W $1FE2,X
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]
W $07:F74B STZ.W $1FE2,X ; $1FE2,X = 0

$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)
R $03:C7B9 LDA.W $1FEB
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]
R $00:F322 ORA.W $1FEE,Y
W $00:F325 STA.W $1FEE,Y ; Set the level's flag in the bit array at [$1FEE + Y] (moon collected)
R $0D:A59C LDA.W $1FEE,Y

$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]--
R $04:F70F LDY.W $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)
RW $03:DFF5 DEC.W $1FFC
W $03:E006 STA.W $1FFC ; [$1FFC] = DATA_04F6F8[X] (frames until the next flash)
RW $04:F719 DEC.W $1FFC
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
RW $04:F73B DEC.W $1FFD
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)
R $00:81FE LDA $1FFE
W $0C:95C2 STZ.W $1FFE ; [$1FFE] = 0: background reload request done
RW $0C:AB59 INC.W $1FFE ; [$1FFE] += 1: request a palette reload

$7E:2000

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (2 read)
R $00:B8B0 LDA.L $7E2000,X
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])
R $04:F3C9 ADC.L $7EB900,X
W $04:F3CD STA.L $7EB900,X ; Position high += delta high byte (+ carry)
W $05:8028 STA.L $7EB900,X

$7E:B928

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])

$7E:B950

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
R $04:F33E LDA.L $7EB950,X

$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])
R $04:F3BF ADC.L $7EB978,X
W $04:F3C3 STA.L $7EB978,X ; Position low += delta (+ carry from fraction)

$7E:B9A0

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])

$7E:B9C8

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
R $04:F343 LDA.L $7EB9C8,X

$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]
R $04:F39D LDA.L $7EB9F0,X
R $04:F3AE LDA.L $7EB9F0,X ; A = speed

$7E:BA18

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)
R $04:F32B LDA.L $7EBA40,X
W $04:F33A STA.L $7EBA40,X ; Store the height speed

$7E:BA68

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)
W $04:F3AA STA.L $7EBA68,X

$7E:BB00

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)

$7E:BD00

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
W $0C:9409 STA.L $7EBD00,X

$7E:BF00

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)

$7E:C680

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)
W $03:DDDB STA.L $7EC680,X
W $03:DF76 STA.L $7EC680,X ; Store the tile in the tilemap buffer

$7E:C681

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]

$7E:C683

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]

$7E:C685

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:8E94 LDA.L $7EC800,X
R $04:9027 LDA.L $7EC800,X ; A = overworld tile number at $7E:C800 + offset
R $04:92E9 LDA.L $7EC800,X
R $04:95D7 LDA.L $7EC800,X
R $04:DCEA LDA.L $7EC800,X
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
W $05:82C8 STA.L $7EC800,X

$7E:C9B0

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

$7E:CA00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:CC00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:CE00

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 $04:8E12 LDA.L $7ED000,X
R $04:8E7A LDA.L $7ED000,X
R $04:8F45 LDA.L $7ED000,X
R $04:8F63 LDA.L $7ED000,X
R $04:9220 LDA.L $7ED000,X
R $04:9299 LDA.L $7ED000,X
R $04:9309 LDA.L $7ED000,X
R $04:9542 LDA.L $7ED000,X
R $04:96C0 LDA.L $7ED000,X
R $04:9950 LDA.L $7ED000,X
W $05:82D8 STA.L $7ED000,X
R $05:D89B LDA.L $7ED000,X ; A = level number at the player's overworld position (table at $7E:D000)

$7E:D200

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:D400

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:D600

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)

$7E:DA00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:DC00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:DE00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:E000

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:E200

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)

$7E:E300

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

$7E:E400

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)

$7E:E402

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)

$7E:E440

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)

$7E:E442

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)

$7E:E600

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:E800

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:EA00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:EC00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:EE00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:F000

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:F200

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:F400

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:F600

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:F800

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:FA00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:FC00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7E:FE00

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

$7F:4002

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

$7F:4040

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)

$7F:4042

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

$7F:8000

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

$7F:8002

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)

$7F:8003

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

$7F:8182

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)
R $00:C13E LDA.L $7F837B
W $00:C1A7 STA.L $7F837B
R $00:C222 LDA.L $7F837B
W $00:C299 STA.L $7F837B
R $00:C35D LDA.L $7F837B
R $00:C397 LDA.L $7F837B
R $00:C3C4 LDA.L $7F837B
W $00:C3CC STA.L $7F837B
R $00:C3E6 LDA.L $7F837B
W $00:C44E STA.L $7F837B ; Write index = X (past the new records)
R $03:D7AD LDA.L $7F837B
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:9D16 STA.L $7F837B
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
R $04:EDE1 LDA.L $7F837B
W $04:EE29 STA.L $7F837B
W $04:EE73 STA.L $7F837B ; Update the stripe write index [$7F:837B]
R $04:EECE LDA.L $7F837B
R $04:F598 ADC.L $7F837B ; Stripe write index += $51; X = new end
W $04:F59C STA.L $7F837B
R $05:B1E7 LDA.L $7F837B
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:CCAA LDA.L $7F837B
R $05:CCCE ADC.L $7F837B ; X = stripe buffer index + 4
R $05:CCDF LDA.L $7F837B
R $05:CD33 ADC.L $7F837B
W $05:CD38 STA.L $7F837B
R $05:CD84 ADC.L $7F837B ; X = [$7F:837B] + $22: end offset of the 35-byte stripe template
R $05:CD94 LDA.L $7F837B
R $05:CDCC ADC.L $7F837B
W $05:CDD1 STA.L $7F837B ; Advance the buffer write index [$7F:837B] by $22 + 1 = 35 bytes
R $05:CDFD LDA.L $7F837B,X
W $05:CE04 STA.L $7F837B,X ; Clear the tile number of this digit, keep the attribute byte
R $05:CE24 LDA.L $7F837B,X
W $05:CE29 STA.L $7F837B,X ; Digit tile number += 1
R $05:CF51 ADC.L $7F837B
R $05:CF6D LDA.L $7F837B
R $05:CF7B LDA.L $7F837B
R $05:CF85 LDA.L $7F837B
R $05:CFA9 LDA.L $7F837B
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)
R $0C:9EB3 LDA.L $7F837B
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)
R $0C:D1E7 ADC.L $7F837B
W $0C:D1EB STA.L $7F837B ; Buffer index += $28 (the $FF terminator is overwritten next time)
R $0C:D22D LDA.L $7F837B
R $0C:D237 ADC.L $7F837B
R $0C:D24A ADC.L $7F837B ; Advance the stripe image index by 12 bytes
W $0C:D24E STA.L $7F837B

$7F:837C

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:C369 STA.L $7F837D,X
W $00:C3C0 STA.L $7F837D,X ; End marker $FF after the last record
W $00:C40E STA.L $7F837D,X
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 $04:F5A4 STA.L $7F837D,X ; Store byte
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 $05:DBFA STA.L $7F837D,X
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:AE34 STA.L $7F837D,X
W $0C:D1DC STA.L $7F837D,X ; Copy to the stripe buffer at $7F837D
W $0C:D23F STA.L $7F837D,X
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 $00:C151 STA.L $7F837E,X
W $00:C235 STA.L $7F837E,X
W $00:C36F STA.L $7F837E,X
W $00:C414 STA.L $7F837E,X
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 $03:D7C6 STA.L $7F837F,X
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:9D8C STA.L $7F8380,X
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 $03:D7D1 STA.L $7F8381,X
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:CCBC STA.L $7F8381,X
R $05:CF8A LDA.L $7F8381,X
W $05:CF96 STA.L $7F8381,X ; Replace the zero digit with a blank tile ($38FC)
W $05:DC26 STA.L $7F8381

$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:C196 STA.L $7F8383,X
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 $04:EE11 STA.L $7F8383,X
W $04:EF15 STA.L $7F8383,X
W $05:DC18 STA.L $7F8383
W $0C:D273 STA.L $7F8383,X ; Patch second tile word (entry + 6) from DATA_0CD1FF[Y]

$7F:8384

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 $00:C14B STA.L $7F8385,X
W $00:C26C STA.L $7F8385,X
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

$7F:8386

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 $00:C162 STA.L $7F8387,X
W $00:C284 STA.L $7F8387,X
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

$7F:8388

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)

$7F:838A

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)

$7F:838C

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

$7F:838F

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

$7F:8391

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)

$7F:8393

No description written yet. The instructions below show how it is used.

2 uses in 2 routines (2 write)
W $00:C290 STA.L $7F8393,X
W $05:CDBE STA.L $7F8393,X ; Tens digit, bottom tile -> buffer + $16

$7F:8395

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

$7F:8397

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

$7F:8399

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

$7F:839B

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

$7F:839D

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

$7F:839F

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

$7F:83A1

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
R $05:CCE4 LDA.L $7F83AF,X
W $05:CCEE STA.L $7F83AF,X ; Replace leading zero with blank tile $FC

$7F:83B1

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)

$7F:83B3

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

$7F:83B9

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

$7F:83BB

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

$7F:83BD

No description written yet. The instructions below show how it is used.

2 uses in 1 routine (1 read, 1 write)
R $05:CD10 LDA.L $7F83BD,X
W $05:CD1C STA.L $7F83BD,X ; Replace leading zero with blank tile $38FC

$7F:83C1

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

$7F:83C3

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

$7F:83C9

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

$7F:83CB

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

$7F:8401

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

$7F:8403

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

$7F:8405

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

$7F:8407

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

$7F:8445

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

$7F:8447

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

$7F:8485

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

$7F:8487

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

$7F:8489

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

$7F:848B

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

$7F:84C9

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

$7F:84CB

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

$7F:977B

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
R $04:DCF2 LDA.L $7FC800,X
W $05:833A STA.L $7FC800,X

$7F:C9B0

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

$7F:CA00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:CB60

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

$7F:CC00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:CD10

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

$7F:CE00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:CEC0

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

$7F:D000

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:D070

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

$7F:D200

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:D220

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

$7F:D3D0

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

$7F:D400

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:D580

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

$7F:D600

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:D730

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

$7F:D800

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:D8E0

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

$7F:DA00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:DA90

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

$7F:DC00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:DC40

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

$7F:DDF0

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

$7F:DE00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:DFA0

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

$7F:E000

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:E150

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

$7F:E200

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)

$7F:E300

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

$7F:E400

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:E4B0

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

$7F:E600

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:E660

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

$7F:E800

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:E810

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

$7F:E9C0

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

$7F:EA00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:EB70

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

$7F:EC00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:ED20

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

$7F:EE00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:EED0

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

$7F:F000

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:F080

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

$7F:F200

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:F230

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

$7F:F3E0

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

$7F:F400

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:F590

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

$7F:F600

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:F740

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

$7F:F800

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:F8F0

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

$7F:FA00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:FAA0

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

$7F:FC00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:FC50

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)

$7F:FE00

No description written yet. The instructions below show how it is used.

1 use in 1 routine (1 write)