#141585 - SaruCoder - Thu Sep 27, 2007 6:09 am
Ok, so this has been bugging me for awhile, and chose to neglect the real meaning behind the tile/map block memory allocation until now.
When I mean by block memory allocation, I mean the values that go into BG_TILE_BASE(n) and BG_MAP_BASE(n) when you setup the BGx_CR. Because it's been trial and error to get my backgrounds showing up properly. I think I've figured it out by thoroughly working out the numbers, but I came across another realization and I can't seem to figure it out.
If I have a 256x256 pixel 256-color bitmap, and turned it into a tile map (32x32 tile blocks), then it would require 540672* bytes (524288 bytes for the tile, 16384 bytes for the map). Now, where in memory is this data stored? Because I'm looking at the virtual video and VRAM tables, and I can't seem to figure out where it all goes, especially when I have the 256x256 pixel bitmaps going on both screens, and with sprites too.
Right, now I declared to use my banks as so (and things do work on hardware and emu) :
According to the docs I've read so far, Bank A & C only has ?128k? So, where is the rest of it going to?
*this can be further explained if anybody wants to know how I got that number
Last edited by SaruCoder on Fri Sep 28, 2007 3:02 am; edited 1 time in total
When I mean by block memory allocation, I mean the values that go into BG_TILE_BASE(n) and BG_MAP_BASE(n) when you setup the BGx_CR. Because it's been trial and error to get my backgrounds showing up properly. I think I've figured it out by thoroughly working out the numbers, but I came across another realization and I can't seem to figure it out.
If I have a 256x256 pixel 256-color bitmap, and turned it into a tile map (32x32 tile blocks), then it would require 540672* bytes (524288 bytes for the tile, 16384 bytes for the map). Now, where in memory is this data stored? Because I'm looking at the virtual video and VRAM tables, and I can't seem to figure out where it all goes, especially when I have the 256x256 pixel bitmaps going on both screens, and with sprites too.
Right, now I declared to use my banks as so (and things do work on hardware and emu) :
Code: |
vramSetBankA(VRAM_A_MAIN_BG); vramSetBankB(VRAM_B_MAIN_SPRITE_0x6400000); vramSetBankC(VRAM_C_SUB_BG); vramSetBankD(VRAM_D_SUB_SPRITE); |
According to the docs I've read so far, Bank A & C only has ?128k? So, where is the rest of it going to?
*this can be further explained if anybody wants to know how I got that number
Last edited by SaruCoder on Fri Sep 28, 2007 3:02 am; edited 1 time in total