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.

C/C++ > simple multiboot sample not working

#1900 - circaeng - Sat Jan 25, 2003 6:11 am

Hi,

I am trying to get my first GBA program working. It works fine on BoyCott but the screen is blank when It runs on the real thing. I use my own cable with xboo. The cable wotks cause I don;t have problem downloading sample apps. The header to my app seems ok since the Nintendo logo appears. Here is the output of gbahdr.exe tool when run with my app:

gbahdr v0.1.2 by anarko

Start offset : 0x080000C0
Logo code : Ok
Game title :
Game code : 0x00000000
Maker code : 0x3031 (Nintendo)
Fixed value : Ok
Main unit code : 0x00
Device type : 0x00
Unused data : Ok
Software version : 0x00
Complementary check: 0xF0 (Calculated F0, Ok)
Checksum : 0x0000

The app I try to run is:

#include "gba.h"

#include "screenmodes.h"

#define MULTIBOOT volatile const u8 __gba_multiboot=0;
MULTIBOOT

u16* theVideoBuffer = (u16*)VideoBuffer;

#define RGB(r,g,b) (r+(g<<5)+(b<<10)) //Macro to build a color from its parts



int main(void)

{

SetMode( SCREENMODE3 | BG2ENABLE ); //Set screen mode

int x = 10, y = 10; //Pixel location



theVideoBuffer[ x + y * 240 ] = RGB( 31, 31, 31 ); //Plot our pixel

return 0;

}

What am I doing wrong?


Thank You!

Patrick

#1902 - tepples - Sat Jan 25, 2003 6:24 am

Boycott Advance doesn't claim to support .mb programs natively; it probably treats them the same as .gba programs.

Does your program work on VisualBoyAdvance, when renamed to something.mb (NOT something.gba or something.bin)?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#1903 - circaeng - Sat Jan 25, 2003 6:31 am

I tried to install VBA on my NT system but failed to run for lack of DirectX

#1935 - tepples - Sun Jan 26, 2003 9:36 am

circaeng wrote:
I tried to install VBA on my NT system but failed to run for lack of DirectX

I'm using Windows 2000 Professional sp3 (NT 5.0) on a Dell box with an 866 MHz PIII processor, and VisualBoyAdvance works just fine. VBA works out of the box on Windows XP (NT 5.1) as well. Windows NT 4, on the other hand, is limited to DirectX 3.0 and is not designed for developing or testing games.

Another way to test if a ROM is actually compiled as .mb or not is to put it in a Multiboot Menu and see if it runs.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#1942 - ampz - Sun Jan 26, 2003 11:39 am

circaeng wrote:
Hi,
Start offset : 0x080000C0

What am I doing wrong?
Patrick


Well, 0x080000C0 seems very wrong if you are trying to multiboot.

#2027 - circaeng - Mon Jan 27, 2003 11:06 pm

Found the problem .

I now use

int __gba_multiboot=0;

instead of const . const doesn't get included in code in c++. App now loads at 2000000

Patrick