gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Something I was wondering about text background layers

#16409 - ramirez - Sun Feb 15, 2004 2:29 pm

Ok, I am sure that I have misunderstood something, or I don't have reliable info, but this is bugging me out so here I go.
For tile modes, you save your tile data into these character blocks, sized of 16KB (16384 bytes), say that you use text background layer and 4-bits pixels (16-color palettes obviously).
This means that every tile takes 32 bytes of space. Ok, then, when I do a simple calculation
16384/32, I get 512, so this means you can have 512 different tiles (at most) per character block.
The thing is that, text background layers has 10 bits reserved for tile index.
2^10 = 1024
What's the point having support for 1024 unique tiles, if you can only store 512 per character block?

Am I missing something here? Or don't I have the right info?
Is the one bit unused? Or does it use the tiles from next block if index is bigger than 512?

It all makes sense for rotating/scaling background layers, since you can only have 256 unique tiles (8 bits per tile index), and you can only use 8-bit pixel tiles (which is 64 bytes per tile).
16384/64 = 256

I'd appreciate if someone clarified this.

#16410 - Large Metal Teeth - Sun Feb 15, 2004 2:50 pm

The VRAM character base block field denotes the starting tile base block. Don't you think this question should be in the beginner's forum?

#16411 - ramirez - Sun Feb 15, 2004 2:59 pm

Large Metal Teeth wrote:
The VRAM character base block field denotes the starting tile base block. Don't you think this question should be in the beginner's forum?

Heh yeah, it probably should. x_x
I wasn't sure where I should post this anyway, so feel free to move.
Well, thanks for clarifying then.
What if I used the last block as starting block, and then used index greater than 512 (so it would exceed the 0x600FFFF), would it use the sprite character data from 0x6010000?

#16419 - tepples - Sun Feb 15, 2004 9:38 pm

Sounds like something that some developers, especially those coming from platforms where tiles and maps lie in strictly separate memory areas (such as NES and 8-bit Game Boy), could get hung up on. FAQ'd now.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.