#47602 - tonysavon - Mon Jul 11, 2005 8:43 am
Hello,
I'm trying to port my Gba Jpeg Viewer on the DS. I would like to use the top screen as a framebuffer to display the picture and the second screen as a 256 colors paletted bmp for the gui. I can succesfully write to the top framebuffer screen in 16 bit, but I cannot draw to to the second one, which is always black:-(
Here is my code:
What am I doing wrong? Thanks!
I'm trying to port my Gba Jpeg Viewer on the DS. I would like to use the top screen as a framebuffer to display the picture and the second screen as a 256 colors paletted bmp for the gui. I can succesfully write to the top framebuffer screen in 16 bit, but I cannot draw to to the second one, which is always black:-(
Here is my code:
Code: |
int main(void) { powerON(POWER_ALL); videoSetMode(MODE_FB0); vramSetBankA(VRAM_A_LCD); // videoSetModeSub(MODE_5_2D | DISPLAY_BG3_ACTIVE); vramSetBankC(VRAM_C_SUB_BG); SUB_BG3_CR = BG_BMP8_256x256; SUB_BG3_XDX = 1 << 8; SUB_BG3_XDY = 0; SUB_BG3_YDX = 0; SUB_BG3_YDY = 1 << 8; SUB_BG3_CX = 0; SUB_BG3_CY = 0; int z; u16* palette=(u16*)BG_PALETTE_SUB; u16* screen=(u16*)BG_GFX_SUB; //grey palette, just for try for (z=0;z<256;z++) palette[z]=RGB(z>>3,z>>3,z>>3)|BIT(15); // try to write something for (z=0;z<256*128;z++) screen[z]=(u16)z; // but nothing happens. //following is code to write in VRAM_A for top screen, which works. |
What am I doing wrong? Thanks!