sprite pattern byte address

sprite pattern byte address
by on (#11626)
i am working on adding sprites now to my emulator. the sprites for the most part are in the correct locations on the screen. the sprite images appear wrong. i was thinking i might have the worng pattern table fetched. what is the address used for pattern table bytes for 8x8 and 8x16 sprites ?

matt

by on (#11628)
CHR is loaded from address: $ptt0 - $pttF... where 'p' is the pattern table (1 or 0), and 't' is the used tile ID (00-FF). For example... if using the left pattern table (p=0) and tile ID $3A ... you'd fetch from $03A0-$03AF


8x8 sprites:
Tile ID used as-is in OAM
Pattern Table selected by $2000.3

Top half of 8x16 sprites:
Tile ID used is OAM_tile & 0xFE (low bit always off)
Pattern Table selected by low bit of OAM_tile ($2000.3 ignored)

Bottom half of 8x16 sprites:
Tile ID used is OAM_tile | 0x01 (low bit always on)
Pattern Table selected by low bit of OAM_tile ($2000.3 ignored)


8x16 Example:
Sprite set to use tile $F3

Top half would be from $1F20, bottom half would be from $1F30