#25371 - Fatnickc - Sat Aug 21, 2004 5:41 pm
Whenever I compile This part of code in Vham, something happens:
When compiling (The whole file, not the line on its own)
It outputs this:
Any ideas what the problem causng it is?
The whole file (From J Harbour's eBook) is:
Thanks in advance,
Fatnickc.
Code: |
DrawPixel3(x, y, mode3_Bitmap[y * 240 + x]); |
When compiling (The whole file, not the line on its own)
It outputs this:
Code: |
/gcc-arm/bin/arm-thumb-elf-as.exe -mthumb-interwork /system/crt0.s -ocrt0.o
/gcc-arm/bin/arm-thumb-elf-gcc.exe -I /gcc-arm/include -I /gcc-arm/arm-thumb-elf/include -I /include -I /system -c -DHAM_HAM -DHAM_MULTIBOOT -DHAM_ENABLE_MBV2LIB -O2 -DHAM_WITH_LIBHAM -mthumb-interwork -mlong-calls -Wall -save-temps -fverbose-asm -nostartfiles main.c -o main.o main.c: In function `main': main.c:27: error: `mode3_Bitmap' undeclared (first use in this function) main.c:27: error: (Each undeclared identifier is reported only once main.c:27: error: for each function it appears in.) make: *** [main.o] Error 1 |
Any ideas what the problem causng it is?
The whole file (From J Harbour's eBook) is:
Code: |
#define MULTIBOOT int __gba_multiboot;
MULTIBOOT //include files #include <stdlib.h> #include "C:\vham\gfx\bg.raw.c" //declare the function prototype void DrawPixel3(int, int, unsigned short); //declare some defines for the video mode #define REG_DISPCNT *(unsigned long*)0x4000000 #define MODE_3 0x3 #define BG2_ENABLE 0x400 //changes the video mode #define SetMode(mode) REG_DISPCNT = (mode) //create a pointer to the video buffer unsigned short* videoBuffer = (unsigned short*)0x6000000; ///////////////////////////////////////////////////////////// // Function: main() // Entry point for the program ///////////////////////////////////////////////////////////// int main(void) { int x, y; SetMode(MODE_3 | BG2_ENABLE); //display the bitmap for(y = 0; y < 160; y++) for(x = 0; x < 240; x++) DrawPixel3(x, y, mode3_Bitmap[y * 240 + x]); //endless loop while(1) { } return 0; } void DrawPixel3(int x, int y, unsigned short c) { videoBuffer[y * 240 + x] = c; } |
Thanks in advance,
Fatnickc.