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.

DS development > VRAM banks 128Kb?

#75210 - patroclus02 - Sat Mar 11, 2006 12:41 am

Hello,
I'm sure this is stupid question.. but according to docs, each VRAM bank from
A to D are 128 Kb in size. But each bank can be divided intro 4 char memory blocks of 16Kb, or 32 map memory blocks of 2Kb. That makes 64Kb (32*2Kb or 4*16Kb)... isn't this contradictory?

#75216 - Webez - Sat Mar 11, 2006 1:10 am

That's on gba. There are 8 16 kbytes char memory blocks on ds for each of those banks. This is one of the problems of not having as much documentation or tutorials about ds as are about gba.

#75245 - patroclus02 - Sat Mar 11, 2006 11:03 am

So there're 8 banks of 16Kb, and that is 128Kb, right.
What about the map blocks? Are there 32 banks of 4Kb, or are there 64 banks of 2Kb??
In GBA there're 32 2Kb blocks..

#75247 - Webez - Sat Mar 11, 2006 11:10 am

There should be 64 but I don't know why if I use one greater than 32 (you can test this things easy with consoleInitDefault and see if it prints something) it doesn't work. I would like to know if this must be like that or if it is a bug

#75248 - patroclus02 - Sat Mar 11, 2006 11:35 am

Yes, I asked because I already tried to set map bank to 33 or higher and it does not work (but the emulator shows data correctly written to RAM memory address). So I supposed it won't for char block higher than 4 either.. and that's why thought VRAM banks were 64Kb in size.

#75279 - DekuTree64 - Sat Mar 11, 2006 9:00 pm

You can only reach the first 64KB for screen map starting addresses. There just aren't enough bits in the BG control regs to expand both of them, and I think the most screen data you could possibly use is 40 blocks (2 1024x1024 extended affine BGs, and 2 512x512 text BGs). I haven't tested it, but I assume you can let one of those 1024x1024's run past block 31, so it's still possible to have them all at once.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku