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 > [newbe] wiki table explanation

#71160 - mlequim - Fri Feb 10, 2006 7:06 pm

Hi,

I have found this table in the Wiki for the modes:

Code:

VRAM_A_CR (128 KB)

7   1: Enabled   
4..3   Offset   
1..0   Mode   

Modes:
Bits   Name   ARM9 address, offset effect   
00   Framebuffer   0x06800000, offset ignored?   
01   Main BG   0x06000000, 0x06020000, 0x06040000, 0x06060000   
10   Main sprites   0x06400000 if offset=0x, 0x06420000 if offset=1x   
11   Textures   bank 0..3, *


I am not sure to have well understood, will this table say that we have from (0x06060000-0x06000000) bytes for the graphics of tiles ? then it does 6144 tiles 8X8 ? it seems to be too much, I think that I don't have well understood this table. Can someone explain me my error ?

will this table also say that we have 2048 tiles 8x8 for sprites ?

#71163 - mlequim - Fri Feb 10, 2006 7:27 pm

If i am right, it will say that by screen we have 0x60000 memory for tiles, thus if does also 393216 bytes. 393216/256/192 = 8 screen.

I does for each screen a memory for tiles of +/- 8 screens height. If I wonder if I am right it is because in GBA the memory for tiles was only a little bigger of the screen resolution,... and now we have memory for tiles of the background 8 times bigger for each screen,...

Someone can say If I have well understood the table ?

#71225 - mlequim - Sat Feb 11, 2006 9:07 am

nobody knows ? I am a little blocked without this information

#71230 - HyperHacker - Sat Feb 11, 2006 11:15 am

I'm not sure what that means, but the important part is it's 128KB. Each screen is 256x192, and you'd generally use 16-bit colour, so 256x192x2 = 98,304 bytes (96K). So you have enough space for about 1 1/4 screens.

#71250 - mlequim - Sat Feb 11, 2006 12:11 pm

thank's ;-)

Code:

I'm not sure what that means


I am wondering how much video memory I have to store the graphics for the background tiles for each screen.


Code:
Each screen is 256x192, and you'd generally use 16-bit colour


Our first idea was to use 256 colours for the graphic of tiles, but I have just read about extended palette. Your calculation is for tiles mode or framebuffer mode ?

Are the 128K available also if I use sprites or is the sprite memory shared in the 128K ?

#71254 - HyperHacker - Sat Feb 11, 2006 12:22 pm

I haven't used sprites, but I'm pretty sure it's shared among whatever you're using it for.
If you use 256 colours, then you only need 48K for the screen, so you can store about 2 1/2 screens. This doesn't account for the palette and any sprites you want to use, though.

Really I've only worked with a single 16-bit mode 5 background, since that's been all I've needed so far. I'll probably want to start using other things soon though.

#71256 - mlequim - Sat Feb 11, 2006 12:57 pm

thank's ;-),

I have only worked with tiles (ongba), never with framebuffer,

I have seen in the ndslib reference that we can address 9 banks, when you tell me about 128k, is it for one bank ? because if it is I should can use maybe two banks for backgrounds for each screen. then one by screen for sprites, and I have then three remaining bank for the map and maybe extended palettes. What do you think about that ?

#71332 - HyperHacker - Sat Feb 11, 2006 10:41 pm

The banks are all different sizes. Here's a list. (Not sure what Core A and Core B refer to here.)

#71390 - mlequim - Sun Feb 12, 2006 10:56 am

thanks hyperHacker, my last question about the banks is : can I have more than one bank for one function (ex two bank for sprite of upper screen)?

#71979 - genfish - Wed Feb 15, 2006 8:26 pm

i've been wondering this too, can you use say, MODE_3_3D on the main screen, have one VRAM bank for the 3d, one for text and then another VRAM bank for the extended rotation background?
_________________
there is no rl only afk

#72087 - mlequim - Thu Feb 16, 2006 9:40 am

Yes, I need something like that, I would like to have for the vertical shoot them up : two banks for the tiles of the four plans in mode 0 (two other for the other screen), and one plan for the sprites.

If I find something about what you want to do or the response to my problem I will send a post, I will try some tests this WE.