Tile Stride Table

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
User avatar
jeffythedragonslayer
Posts: 344
Joined: Thu Dec 09, 2021 12:29 pm

Tile Stride Table

Post by jeffythedragonslayer »

I would like to create a "tile stride table." In other words, it tells you how many VRAM words a tile takes up. Note that I am talking about the raw tile data which indexes into CGRAM, not the data that is stored in the tilemap which indexes back into the raw tile data in the tileset.

In other other words, in the first column you will be able to lookup which bpp you are using. Then in the second column you will find the VRAM memory location of where the second tile in the tileset will be for that bpp, assuming the first tile is at $0000.

Also, if there are more dimensions/variables in this table than just bpp, I definitely want to include them too. What would be a correct way to figure out this information?
User avatar
jeffythedragonslayer
Posts: 344
Joined: Thu Dec 09, 2021 12:29 pm

Re: Tile Stride Table

Post by jeffythedragonslayer »

To get started, I'll consider the sizes of bitplanes.

As Raffzahn has pointed out here (https://retrocomputing.stackexchange.co ... n-the-snes), each byte of a bitplane stores (one bit for each of the) 8 adjacent pixels - a tile sliver. So for an 8x8 tile, that is 8 tile slivers, so a bitplane is a total of 8 bytes.

This result is confirmed by the example in this crate here - two bitplanes take up 16 bytes:

https://docs.rs/snes-bitplanes/latest/snes_bitplanes/
Last edited by jeffythedragonslayer on Wed Jun 29, 2022 11:19 am, edited 2 times in total.
User avatar
jeffythedragonslayer
Posts: 344
Joined: Thu Dec 09, 2021 12:29 pm

Re: Tile Stride Table

Post by jeffythedragonslayer »

I opened up the Tile Viewer in bsnes-plus which also confirmed my thoughts. Clicking the right arrow immediately to the right of the address offset box once shifts only the first tile out of view in every bpp, but it is byte-addressed.

tile_stride.png
tile_stride.png (21.09 KiB) Viewed 365 times
Dividing all the offsets by 2, we have:

Code: Select all

bpp	| tile stride
--------+------------
2	|  $08
4	|  $10
8	|  $20
I added the Tile Viewer to this issue: https://github.com/devinacker/bsnes-plus/issues/332
Post Reply