#87566 - Spaceface - Wed Jun 14, 2006 4:06 pm
Hey there.. Probably something very simple that I just can't seem to figure. I'm following the Pern tutorials. But they seem to be for DevKitAdvance or at least an older version of libgba, while I'm running the more recent DevKitPro from the updater. The libgba included with it doesn't seem compatible with about EVERY tutorial I found on the net.
For instance this code, the most simplest one:
It comes with a list of certain errors:
They all point to undeclared macro's which do not mean anything in the current version of libgba.
However after viewing some older .h files via google I can fill in the macro's with values:
But for one reason or another I keep getting a grey screen visualboy...
Anyone here who can help me out?
For instance this code, the most simplest one:
Code: |
#include <gba.h> //everything you need for gba devving
#define VideoBuffer ((volatile u16*)0x6000000) ///////////////// C code entry (main())///////////////////// int main() { unsigned char x,y; SetMode(MODE_3 | BG2_ENABLE); for(x = 0; x < SCREEN_WIDTH; x++) for(y = 0; y < SCREEN_HEIGHT; y++) VideoBuffer [x+ y * SCREEN_WIDTH] = RGB16(31,0,0); while(1){} }//end main |
Code: |
c:/devkitPro/projects/Smurfs/source/template.c:12: error: 'SCREEN_WIDTH' undeclared (first use in this function)
c:/devkitPro/projects/Smurfs/source/template.c:12: error: (Each undeclared identifier is reported only once c:/devkitPro/projects/Smurfs/source/template.c:12: error: for each function it appears in.) c:/devkitPro/projects/Smurfs/source/template.c:13: error: 'SCREEN_HEIGHT' undeclared (first use in this function) c:/devkitPro/projects/Smurfs/source/template.c:14: warning: implicit declaration of function 'RGB16' |
They all point to undeclared macro's which do not mean anything in the current version of libgba.
However after viewing some older .h files via google I can fill in the macro's with values:
Code: |
#include <gba.h> //everything you need for gba devving
#define VideoBuffer ((volatile u16*)0x6000000) ///////////////// C code entry (main())///////////////////// int main() { unsigned char x,y; SetMode(MODE_3 | BG2_ENABLE); for(x = 0; x < 240; x++) for(y = 0; y < 160; y++) VideoBuffer [x+ y * 240] = 0x111110000000000; while(1){} }//end main |
Anyone here who can help me out?