#26287 - mr_square - Sat Sep 11, 2004 4:08 pm
Hi all - I have a single 256*256 text background which works fine. When I try to add a second background, it goes all wrong - looking in the map viewer in VBA shows that the second background is present and correct, but the first is just a load of garbage made up of the 2nd one's tiles. I assume from this that I'm putting the new tiles in the wrong position in memory, and so they're overwriting the first background's tiles.
My code currently, using GBAJunkie's background definitions:
I'm fairly sure its either the
background2.charBaseBlock or background2.screenBaseBlock lines thats messing it up, as I just took them from an example that happened to be using the same size text backgrounds. What should they be, and how would I calculate them?
thanks
*edit* - tried setting charBaseBlock to 17 and it seems to have worked, but I'd still quite like to know why!
My code currently, using GBAJunkie's background definitions:
Code: |
background1.number = 1; background1.charBaseBlock = 0; background1.screenBaseBlock = 28; background1.colorMode = BG_COLOR_256; background1.size = TEXTBG_SIZE_256x256; background1.mosaic = 0; background1.x_scroll = 0; background1.y_scroll = 43; background2.number = 2; background2.charBaseBlock = 16; background2.screenBaseBlock = 30; background2.colorMode = BG_COLOR_256; background2.size = TEXTBG_SIZE_256x256; background2.mosaic = 0; background2.x_scroll = 0; background2.y_scroll = 43; |
I'm fairly sure its either the
background2.charBaseBlock or background2.screenBaseBlock lines thats messing it up, as I just took them from an example that happened to be using the same size text backgrounds. What should they be, and how would I calculate them?
thanks
*edit* - tried setting charBaseBlock to 17 and it seems to have worked, but I'd still quite like to know why!