#174694 - ericd3742 - Fri Jul 09, 2010 1:43 am
i am learning how to use HAM, and i have been trying to build the program on page 29 of [http://www.aaronrogers.com/ham/Books/PTGBA/GBA_05.pdf] and i cant find what i have done wrong! the HAM error thing at the bottom of the window says i have multiple errors. it says this:
/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:24: error: `REG_DISPCNT' undeclared (first use in this function)
main.c:24: error: (Each undeclared identifier is reported only once
main.c:24: error: for each function it appears in.)
main.c:28: error: `X' undeclared (first use in this function)
main.c:29: error: `mode3_Bitmap' undeclared (first use in this function)
make: *** [main.o] Error 1
my code looks like this:
#define MULTIBOOT int __gba_multiboot;
MULTIBOOT
//include files
#include <stdlib.h>
#include "mode3.raw.c"
void DrawPixel3(int, int, unsigned short);
#define RED_DISPCNT *(unsigned long*)0x4000000
#define MODE_3 0x3
#define BG2_ENABLE 0x400
#define SetMode(mode) REG_DISPCNT = (mode)
unsigned short* videoBuffer = (unsigned short*)0x6000000;
//function: main()
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]);
//loop
while(1)
{
}
return 0;
}
if anybody can tell me what ive done wrong it would be greatly appreciated.
/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:24: error: `REG_DISPCNT' undeclared (first use in this function)
main.c:24: error: (Each undeclared identifier is reported only once
main.c:24: error: for each function it appears in.)
main.c:28: error: `X' undeclared (first use in this function)
main.c:29: error: `mode3_Bitmap' undeclared (first use in this function)
make: *** [main.o] Error 1
my code looks like this:
#define MULTIBOOT int __gba_multiboot;
MULTIBOOT
//include files
#include <stdlib.h>
#include "mode3.raw.c"
void DrawPixel3(int, int, unsigned short);
#define RED_DISPCNT *(unsigned long*)0x4000000
#define MODE_3 0x3
#define BG2_ENABLE 0x400
#define SetMode(mode) REG_DISPCNT = (mode)
unsigned short* videoBuffer = (unsigned short*)0x6000000;
//function: main()
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]);
//loop
while(1)
{
}
return 0;
}
if anybody can tell me what ive done wrong it would be greatly appreciated.