#5222 - Link - Wed Apr 23, 2003 1:29 pm
i get the follow error when i compile the .bin file:
test3.c: In function `main':
test3.c:19: `gbatestPalette' undeclared (first use in this function)
test3.c:19: (Each undeclared identifier is reported only once
test3.c:19: for each function it appears in.)
test3.c:22: `gbatest' undeclared (first use in this function)
the code is:
test3.c: In function `main':
test3.c:19: `gbatestPalette' undeclared (first use in this function)
test3.c:19: (Each undeclared identifier is reported only once
test3.c:19: for each function it appears in.)
test3.c:22: `gbatest' undeclared (first use in this function)
the code is:
Code: |
#include "gba.h" #include "screenmodes.h" #include "gbatest.h" //header file ottenuto da pcx2gba u16* theVideoBuffer = (u16*)VideoBuffer; u16* theScreenPalette = (u16*)BGPaletteMem; #define RGB(r,g,b) (r+(g<<5)+(b<<10)) //Macro to build a color from its parts int main() { SetMode(SCREENMODE4|BG2ENABLE); //Copy the palette u16 i; for ( i = 0; i < 256; i++ ) theScreenPalette[ i ] = gbatestPalette[ i ]; //Cast a 16 bit pointer to our data so we can read/write 16 bits at a time easily u16* tempData = (u16*)gbatest; //Write the data //Note we?re using 120 instead of 240 because we?re writing 16 bits //(2 colors) at a time. u16 x, y; for ( x = 0; x < 120; x++ ) for ( y = 0; y < 160; y++ ) theVideoBuffer[ y * 120 + x ] = tempData[ y * 120 + x ]; return 0; } |