$7E0200 | 544 bytes | I/O | OAM table - handles all sprite tiles. There are 0x80 (128) slots for tiles. Generally, the table is indexed from either $0200 or $0300, with $0300 being used for normal sprites (and Mario) and $0200 being used for various other sprite types. Note that tiles are drawn to the screen from top to bottom of the table; that is, a sprite in slot 0 will always appear visually on top of a sprite in slot 1.
The actual OAM table consists of two sub-tables: - $7E0200-$7E03FF (512 bytes): Each slot consists of four bytes in the order of: X position, Y position, tile number, YXPPCCCT. Unused tiles are generally marked by giving them a Y position of #$F0 (which is offscreen). - $7E0400-$7E041F (32 bytes): Each slot gets 2 bits, used to handle a 9th bit of the X position (for handling sprite tiles that go past the left edge of the screen) and a "size bit" which (generally) controls whether the tile is 8x8 (0) or 16x16 (1). Since each tile only requires 2 bits, each byte of this table actually handles four separate tiles; see the details table for more information. It is not recommended that you write to this table directly, though, and you should use the table at $0420 instead.
Various tiles are documented here. Note that:
Code$7E0310-$7E0313 is for the player's upper half
$7E0314-$7E0317 for the player's lower half
$7E0318-$7E031B is for the player's hand. | HammerBrother |
|
Detail: $0400 formatting |
Slot number/$0200 Index | Bit position | RAM location | $00/$000 | ------SX | $0400 | $01/$004 | ----SX-- | $0400 | $02/$008 | --SX---- | $0400 | $03/$00C | SX------ | $0400 | $04/$010 | ------SX | $0401 | $05/$014 | ----SX-- | $0401 | $06/$018 | --SX---- | $0401 | $07/$01C | SX------ | $0401 | $08/$020 | ------SX | $0402 | ... | ... | ... | $7F/$1FC | SX------ | $041F |
|
An update was submitted and approved.
Follow Us On