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 > Uber Noob :: Blank White Screen bug

#11213 - Ashes999 - Mon Sep 29, 2003 4:44 am

Before any of you berate me, yes, I did read the FAQ. Yes, I did use
objcopy -v -O binary yourromname.elf yourromname.gba
...And still, when I boot my rom, I get a blank, white screen. Here's my source:

Code:

/* hello.c - Gameboy Advance Tutorial - Loirak Development */

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

int main()
{
   char x,y; 
   unsigned short* Screen = (unsigned short*)0x6000000;
   *(unsigned long*)0x4000000 = 0x403; // mode3, bg2 on

   // clear screen, and draw a blue back ground
   for(x = 0; x<240; x++)   //loop through all x
   {
      for(y = 0; y<160; y++)  //loop through all 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) {
   }   //loop forever
   
}


Standard hello-noob stuff. I'm using DevKitAdv stable (4.x, I believe) and I'm on windows 2k. The source compiles ok, gba file creates ok, the conversion goes ok--yet, I get a white screen. Any ideas? This same tutorial worked for me about a year ago....
[/code]

#11214 - yaustar - Mon Sep 29, 2003 4:49 am

Well, it works....... :s
_________________
[Blog] [Portfolio]

#11215 - Ashes999 - Mon Sep 29, 2003 5:07 am

A thousand curses. I got my friend to go through the exact same tutorial page with the exact same tools, and his rom worked fine. The page is:

http://www.loirak.com/gameboy/gbatutor.html

....Wierd! Any ideas?

[Edit]: How queer of me. I forgot to set my path variable in my make.bat, which, coincidentally, looks the same whether or not the path variable is set. And runs the same either way. Grrrr....

#11218 - tepples - Mon Sep 29, 2003 6:29 am

If your build scripts silently fail when you don't set your PATH, you may have a native installation of GCC (djgpp? mingw? cygwin?) and you're compiling x86 opcodes instead of ARM opcodes. I've had this bite me a few times. But if you use any ARM-specific options such as -mthumb-interwork, you'll get a nice, clear warning from a compiler installation that doesn't target ARM architecture.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#11223 - Ashes999 - Mon Sep 29, 2003 1:55 pm

Ahhh, the secret comes out at last. Yeah, actually, I *do* have MinGW installed. Hrm. I tried compiling tetris, but my compiler gave me a "no such thing as thumbs flag" error or something. ...which makes sense, if I was using MinGW. Cheers!

#11226 - tepples - Mon Sep 29, 2003 4:29 pm

Speaking of tetris:

The other way to make sure you're using the right compiler, which I use in the build script for TOD, is to always call the cross-toolchain using its unique names: arm-agb-elf-gcc and arm-agb-elf-objcopy instead of gcc and objcopy.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#11243 - Ashes999 - Mon Sep 29, 2003 11:34 pm

Ah, thanks, I appreciate the help!

Nice webpage btw :)