This is the code I use to setup video:
Code: Select all
System::System( void )
{
videoSetMode ( MODE_5_2D );
videoSetModeSub( MODE_5_2D );
vramSetBankA( VRAM_A_MAIN_BG );
vramSetBankC( VRAM_C_SUB_BG );
consoleInit( NULL, 0, BgType_Text4bpp, BgSize_T_256x256, 4, 0, true, true );
bgIndex = bgInit( 3, BgType_Bmp16, BgSize_B16_256x256, 5, 0 );
this->mainScreen.setFrameBuffer( ( u16 * ) bgGetGfxPtr( bgIndex ) );
bgIndex = bgInitSub( 3, BgType_Bmp16, BgSize_B16_256x256, 0, 0 );
this->subScreen.setFrameBuffer( ( u16 * ) bgGetGfxPtr( bgIndex ) );
}
My main problem is that I can't figure out how to properly map the memory, which leads to graphic artifacts on the console whenever I try to draw on the screen and print text. From what I searched on the forum, it's probably caused by shared VRAM memory.
I'd appreciate if anyone could help me with this problem and give me some insight on proper VRAM mapping in general.