In my attempts to try to understand how pattern and nametables work I've opened up a few games in FCEUXD to view the ppu memory and pattern tables. One question that i had was that if the nametable memory for a certain X,Y of the background is 0xFF (256th tile from the pattern table), how does the PPU know whether to read from the left or right pattern table? I noticed also that it looked like for DK the sprites took the left pattern table and the background the right.
The answer, I think, to my original question comes in the form of this diagram, where I see there is a flag for "Half of the sprite table" which i assume sets which half is used only for sprites and which is used for backgrounds. I'm having trouble understanding the context of this diagram though. It looks like a piece of two byte memory, but then where is that memory being read from?
This is the diagram from the nesdev wiki, this is all the section says.
The answer, I think, to my original question comes in the form of this diagram, where I see there is a flag for "Half of the sprite table" which i assume sets which half is used only for sprites and which is used for backgrounds. I'm having trouble understanding the context of this diagram though. It looks like a piece of two byte memory, but then where is that memory being read from?
This is the diagram from the nesdev wiki, this is all the section says.
Code:
PPU addresses within the pattern tables can be decoded as follows:
DCBA98 76543210
---------------
0HRRRR CCCCPTTT
|||||| |||||+++- T: Fine Y offset, the row number within a tile
|||||| ||||+---- P: Bit plane (0: "lower"; 1: "upper")
|||||| ++++----- C: Tile column
||++++---------- R: Tile row
|+-------------- H: Half of sprite table (0: "left"; 1: "right")
+--------------- 0: Pattern table is at $0000-$1FFF
DCBA98 76543210
---------------
0HRRRR CCCCPTTT
|||||| |||||+++- T: Fine Y offset, the row number within a tile
|||||| ||||+---- P: Bit plane (0: "lower"; 1: "upper")
|||||| ++++----- C: Tile column
||++++---------- R: Tile row
|+-------------- H: Half of sprite table (0: "left"; 1: "right")
+--------------- 0: Pattern table is at $0000-$1FFF