gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > [solved] Problems with devkitarm in linux

#153550 - bluesceada - Tue Apr 01, 2008 7:40 pm

The solution was just to update to r21 ... I got r19 earlier, not from the official site and thought it was the newest one..

The thread can be removed I guess, sorry for being stupid!


I'm already sorry to post this and feel very dumb, as no tutorial and nothing could help me, I was searching all day long....

but to my problem:

I couldn't get any tutorial or other downloaded code either compile or compile decently with all the available devkits .. then I tried to concentrate on devkitarm but also couldnt get any working results... The best I could get is a white screen in VBA (but pre-compiled roms work)

The following SHOULD work? (or not?)

First my code (with other code I often have library problems etc.), It is partially from some howto, can't remember which, it's just one file, main.c:

Code:
#define RGB16(r,g,b)  ((r)+(g<<5)+(b<<10))

typedef unsigned char uint8;
typedef unsigned short int uint16;
typedef unsigned long int uint32;

// Register of the GBA Screen (begin of VRAM), up to 0x06017FFF
uint16 *Screen = (uint16*)0x6000000;

int main()
{
   uint8 x,y;
   // X Max is 240
   // Y Max is 160

   // Set the Background Mode of the Screen, Mode 3, BG2 on, Bitmap based Mode for still images
   *(uint16*)0x4000000 = 0x403;

   for(x = 0; x<240; x++)
   {
      for(y = 0; y<160; y++)
      {
         Screen[x+y*240] = RGB16(0,0,31);
      }
   }
   // draw a white HI on the background
   for(x = 20; x<=60; x+=15)
   {
      for(y = 30; y<50; y++)
      {
         Screen[x+y*240] = RGB16(31,31,31);
      }
   }
   for (x = 20; x < 35; x++)
   {
      Screen[x+40*240] = RGB16(31,31,31);
   }
   while(1) {};
}



this is the script I'm using to compile (I couldn't find any other help for this ) I use $1=test and $2=main.c

Code:
export PATH=/home/username/GBAcode/devkitARM/bin/:$PATH

arm-eabi-gcc -Wall -mthumb -mthumb-interwork -specs=gba.specs -o $1.elf $2

arm-eabi-objcopy -O binary $1.elf $1.gba

gbafix $1.gba
VisualBoyAdvance ./$1.gba


I don't have setup anything further than this, because I just couldn't find out what.

I'm not a beginner in coding, just setting up a compiler toolchain was never that hard

I get no errors nor warnings, just a white VBA screen....

I hope you point me in the right direction and sorry for the inconvenience (if it should have been more obvious to solve than it seems to me)

Much thanks in advance!

// EDIT:
For this tutorial, and exactly this example, using exactly their Makefile, I also just get a white screen (tried in VBA and mednafen) (everything compiles fine though) - the only thing I did is setting the DEVKITARM of course:
http://www.coranac.com/tonc/text/first.htm