#152421 - ben0bi - Sat Mar 15, 2008 6:11 pm
i try to make normal text mode over a background. text mode alone works, background alone works too. but both together put out a mess on the screen.
can anyone tell me why that does not work and what to do to fix it?
here is my code:
i did not include the clearscreen function and the main screen buffer things here..
why does this not work?
on my machine, the pixels on bg2 are drawed. but the bg0 interfereres everywhere on screen, not only on the position where it should print.
can anyone tell me why that does not work and what to do to fix it?
here is my code:
Code: |
videoSetMode(MODE_5_2D | DISPLAY_BG3_ACTIVE); videoSetModeSub(MODE_5_2D | DISPLAY_BG2_ACTIVE DISPLAY_BG0_ACTIVE); vramSetBankA(VRAM_A_MAIN_BG_0x06000000); vramSetBankB(VRAM_B_LCD); vramSetBankC(VRAM_C_SUB_BG); vramSetBankD(VRAM_D_LCD); // text mode init SUB_BG0_CR = BG_MAP_BASE(31); BG_PALETTE_SUB[255] = RGB15(31,31,31); consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16); // graphics mode SUB_BG2_XDY = 0; SUB_BG2_XDX = 1 << 8; SUB_BG2_YDX = 0; SUB_BG2_YDY = 1 << 8; SUB_BG2_CX = 0; SUB_BG2_CY = 0; u8* sub_buffer[2]; sub_buffer[0]=(u8*)BG_BMP_RAM_SUB(0); sub_buffer[1]=(u8*)BG_BMP_RAM_SUB(3); bool actualBuffer=false; ... while(1) { if(bActualBuffer) { bActualBuffer=0; gfxSetDrawBuffer(sub_buffer[bActualBuffer]); SUB_BG2_CR = BG_BMP8_256x256 | BG_BMP_BASE(3); }else{ bActualBuffer=1; gfxSetDrawBuffer(sub_buffer[bActualBuffer]); SUB_BG2_CR = BG_BMP8_256x256 | BG_BMP_BASE(0); } ... print, draw, whatever ... swiWaitForVBlank } |
i did not include the clearscreen function and the main screen buffer things here..
why does this not work?
on my machine, the pixels on bg2 are drawed. but the bg0 interfereres everywhere on screen, not only on the position where it should print.