#14750 - Dan_attacker - Mon Jan 12, 2004 9:36 am
Hello. I just started trying out GBA programming today. I'm having a problem with displaying an image on the screen using mode 3. The first image is the original test image, and the second is the compiled program running in VisualBoyAdvance...
Image 1 - Original Image
Image 2 - Running in Program
Here is the code...
I used PCX2GBA to convert the PCX image into a C header file. Is there something wrong with the code, or did PCX2GBA not convert the image correctly?
Oh, I got my code by slightly modifying this code from a tutorial...
This guy looks like he was typing too fast or something because I never really programmed in C++ but I can already tell that this program has problems.[/url]
Last edited by Dan_attacker on Mon Jan 12, 2004 11:27 pm; edited 1 time in total
Image 1 - Original Image
Image 2 - Running in Program
Here is the code...
Code: |
#include "gba.h"
#include "bilde.h" int main() { u16 x; SetMode( MODE_3 | BG2_ENABLE ); for (x=0; x<(240*160); x++) { FrontBuffer[x] = bildedata[x] ; } return 0; } |
I used PCX2GBA to convert the PCX image into a C header file. Is there something wrong with the code, or did PCX2GBA not convert the image correctly?
Oh, I got my code by slightly modifying this code from a tutorial...
Code: |
#include "gba.h"
#include "bilde.h" int main() { u16 loop, x; SetMode( MODE_4 | BG2_ENABLE ); for(loop=0;loop<256;loop++) { BG_PaletteMem[loop]=bildePalette[loop]; } for (x=0; x<(120*160); x++) { FrontBuffer[y] = bildeData[y] ; } return 0; } |
This guy looks like he was typing too fast or something because I never really programmed in C++ but I can already tell that this program has problems.[/url]
Last edited by Dan_attacker on Mon Jan 12, 2004 11:27 pm; edited 1 time in total