My image is a 256*192 PCX, which I have calculated uses up 128k of a VRAM bank. Now I would like to only use one VRAM bank for all of this as I have other things planned, so I thought I would try to map the PCX and the font for the console to the same bank.
I am using the SUB engine for something else, so that isn't an answer either
The tile base should in theory be block 6 and the screen/map should be 24.
However, when I munge it all together, i get a corrupted result. The image is being displayed, as is the text, but there are a load of stray characters all over the place.
I have the following code:
Code: Select all
/* Main screen VRAM */
vramSetBankA (VRAM_A_MAIN_BG_0x06000000);
consoleInitDefault ((u16*)SCREEN_BASE_BLOCK(24), (u16*)CHAR_BASE_BLOCK(6), 16);
BG_PALETTE[0] = RGB15(0,0,0);
BG_PALETTE[255] = RGB15(31,31,31);
/* Sub screen VRAM */
vramSetBankC (VRAM_C_SUB_BG);
// draw stuff to BG_GFX_SUB
/* Video modes */
videoSetMode (MODE_5_2D | DISPLAY_BG0_ACTIVE | DISPLAY_BG3_ACTIVE);
//set up main engine (leaving the console as is)
BG0_CR = BG_TILE_BASE(6) | BG_MAP_BASE(24);
BG3_CR = BG_BMP16_256x256;
// Set translations / / Set translations
BG3_XDX = 1<<8;
BG3_XDY = 0;
BG3_YDX = 0;
BG3_YDY = 1<<8;
BG3_CY = 0;
BG3_CX = 0;
Thanks