#169816 - ArugulaZ - Wed Aug 05, 2009 2:10 am
Hey, I like the site and appreciate all your hard work on it. I had a question for you... how much room is there in VRAM for tiles? I'm working with Dragon BASIC right now, and I thought I had access to four 256x256 pages of character blocks, but I've found that weird things start to happen after I allocate about 140-150 tiles to VRAM. Fonts get flipped, characters lose their color... it's a friggin' mess. How many tiles can I fit in VRAM before the system goes bonkers? Does Dragon BASIC limit the number of tiles that can be used at any given time? Thanks in advance for any help you can provide.
#169818 - Dwedit - Wed Aug 05, 2009 5:19 am
The GBA hardware has 64K of VRAM for backgrounds, and 32K of VRAM for sprites. A background layer takes up 2K per screen, so if you use all 4 background layers in 4-screen mode, that's 32K.
In 32K of VRAM, you can fit 1024 tiles in 4-bit mode, or 512 tiles in 8-bit mode.
Of course, you don't have to use 4 background layers in 4-screen mode. You can often get away with 2 or 3 layers in 1-screen mode, which consumes 4 or 6K. That would leave you with over 768 extra tiles for a different background layer to use.
I have no idea what restrictions Dragon Basic places on stuff. Use the VRAM viewer from Visualboyadvance to see where it's putting the background maps.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
#169894 - ArugulaZ - Tue Aug 11, 2009 12:28 am
Thanks for all your help. I now realize what I was doing wrong... character blocks and screen blocks share the same space in VRAM, and you have to keep them separate to prevent them from overwriting each other.
Now I face a different problem... I seem to only be able to define two palettes. When I define a third, the color scheme gets all weird (reds become a disgusting brownish-orange, etc.). Any reason why?
#169909 - ArugulaZ - Thu Aug 13, 2009 12:18 am
Sorry folks, I figured out the problem. It was just a little human error on my part. :P