#4347 - delbogun - Fri Mar 28, 2003 7:14 pm
I have problem displaying an image in mode 3 or 5. I used Kaleid to convert my bmp into a mode3 gba image. Don't know if I understand this mode correctly... but this is how I did it:
Anyone knows what i did wrong?
Code: |
typedef unsigned short u16; typedef unsigned long u32; #define REG_DISPCNT *(u32*) 0x4000000 #define MODE_3 0x3 #define BG2_ENABLE 0x400 #include "picture.h" u16* videoBuffer = (u16*) 0x6000000; int main( void ) { int x, y; // set mode 3 REG_DISPCNT = MODE_3 | BG2_ENABLE; // draw picture for( y = 0; y < 160; y++ ) { for( x = 0; x < 240; x++ ) videoBuffer[y*240 + x] = picData[y*240 + x]; } while( 1 ) { } return 0; } |
Anyone knows what i did wrong?