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 > 512x512 extended rotation backgrounds

#44578 - Pacifist - Fri Jun 03, 2005 12:46 am

First off big thanks to Dovoto for his 256 colour bitmap demo.

Now I'm confused about how 8bit extended rotation backgrounds larger than 256x256 work.

So a 256x256 background takes up exactly one Base block yes?

So a 512x512 background would take up 4? Is there a way to tell the DS what blocks you plan to use or are they always sequenchial and you just have to make sure you don't try to use them for anything else?

But there are defines for 1024x512 backgrounds. Wouldn't these take up 8 base blocks when the DS only has 4?

And in fact now that I pull my calculator out don't 256x256 backgrounds take up 128x256 = 32k when the base blocks are only 16k?

So then doesn't a 512x512 background take up 8 base blocks?

I've spent some serious quality time with my DS trying to figure this out but am lost. Any help would be much appretiated.

#44585 - Darkain - Fri Jun 03, 2005 3:11 am

i think you are getting confused between 16 colour tile mode, 256 colour tile mode, 256 colour bmp mode, and 16bit colour bmp mode.

base block != vram bank.

a 512x512 16bit bmp will take the first 4 vram banks, yes, as it is 524,288 bytes in size. you can have large 1024x1024 tile maps as well, but that would be the size in pixels, where as 8x8 pixels = 1 tile. (1024/8)*(1024/8)=16,384 tiles total, which is significantly less ram (32KB to be exact + size of tile data) compared to the 512KB of ram required for the 512x512 16bit BMP.
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#44587 - Pacifist - Fri Jun 03, 2005 3:35 am

Although I certainly am confused I don't think it's the differences between background types that's confusing me.

Yes I recognise that tiled backgrounds take up much less space and why. I'm pretty down with how tiled backgrounds work. I've got three of them running, one of which is 64x64 tiles with no troubles.

The relationship between VRAM and base blocks and what is displayed on the screen does confuse me.

So a 512x512 16 bit bmp background takes up the first four VRAM banks. Doesn't it also take up a bunch of base blocks?

I thought that the base blocks held the image. I know, for instance, that I can write to the base block containing my 256x256 bmp bground and change the image.

Can I have a 512x512 image without using up a great number of base blocks then?

How do I configure VRAM to make sure no other backgrounds try to use the four bannks the bmp is using? is that even an issue?

Confused, I certainly am...

#44588 - Pacifist - Fri Jun 03, 2005 4:16 am

hoho! victory.

OK so it was a VRAM problem.

I had to map A to MAIN_BG and B to MAIN_BG.

I had tried mapping other VRAMs to MAIN_BG and tried mapping other consecutive VRAMs to MAIN_BG. But didn't try mapping the first two to MAIN_BG at the same time.

I still don't understand the relationship between VRAM and base blocks but I seem to have slipped around that lack of knowledge again.

here's hoping I can also get it going on the sub-screen.

#44754 - Pacifist - Sun Jun 05, 2005 1:59 am

I figure documenting tirbulations and their solutions is good for everyone:

After mapping every VRAM bank and their dog to MAIN_BG I did get 512x512 8 bit exptended backgrounds going. But oddly enough this broke my previously functional background code.

My BG1 tiles loaded into BG_TILE_RAM(2) started being overwritten by my BG0 map in SCREEN_BASE_BLOCK(0). Very odd, very confusing.

The problem turned out to be that I was mapping too many VRAM banks to MAIN_BG. I had mapped 4, when I unmapped one of them the odd problems went away.

Still don't understand VRAM so I don't understand why this was a problem.

Just wanted to have the solution on the boards so people would have something to find in future searches.