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.

Flash Equipment > Multiboot bug in HAM?

#15757 - Gene Ostrowski - Thu Jan 29, 2004 8:57 am

I have an odd issue. I just started with the HAM DevKit and today received my multiboot/flash cart.

I am able to flash my demo to the cart no problems and it works without issue (of course it also works in VBA).

However, no multiboot code seems to want to work. When trying to run *.mb from the linker, it seems to download into the GBA ok, but sits at the loader screen and says "Doing..." and never launches the application. That looks like it's not truly a multiboot chunk of code.

Then I noticed that in VBA running HAMLib 2.8, I do NOT see the MULTIBOOT message in the lower left corner, like I should for code that has been compiled for multiboot. I DO have the MULTIBOOT macro in my code, so I *thought* it was compiling for multiboot, and received no errors indicating otherwise.

However, it appears that it did not actually compile for multiboot!. I actually had to comment out the MULTIBOOT macro and add the line...

int __gba_multiboot=0;

...manually into my source code! It made no sense at all. But now I see that it TRULY is compiling for multiboot mode, as the "MULTIBOOT" indicator appears in the emulator when the demo runs. Could there be some bug in HAM/VisualHAM that could cause this? I've not messed with any of the configs/make files that were installed during the default HAM 2.8/VisualHAM 2.5 installation, so I couldn't have messed something up.

Unfortunately though, when it tries to run without the cart using the MVB2 in multiboot mode, the demo does NOT run (i.e. multiboot code is only working in the emulator or when I flash it to the actual cart). It starts, displays MULTIBOOT and version 2.8 on the screen, but the HAM logo/animation does not play and it appears to hang. I think several other people have had this happen as well.

The demo is less than 40K and does nothing funky that would cause >256K allocation or anything of the sort.

Any ideas about either of the possible bug issue with the MULTIBOOT macro or why the darn thing hangs on multiboot code?

Any assistance would be helpful!

Thanks.
_________________
------------------
Gene Ostrowski

#15822 - dagamer34 - Sat Jan 31, 2004 4:51 am

Maybe you can upload it somewhere so we can test it.

Which flash cart are you using? What does your demo do? Are you sure it's not a software problem? Have you tried flashing any of the 100+ VisualHAM demos included with the package? They should be compiled for multiboot.

One tip: Use VBA Win when testing and such. Its more accurate than SDL.

Sometimes demos run just like you want them to in an emulator but don't work on real hardware. I hate when that happens!
_________________
Little kids and Playstation 2's don't mix. :(

#15975 - Gene Ostrowski - Thu Feb 05, 2004 2:05 am

Ok, I've narrowed it down. It's not a problem with my code, as I'll show you how to reproduce it:

Start a new .CPP project with HAM and VBL support. It should create a skeleton application with a VBL loop. Without changing *anything*, press F6 to see it run. You'll notice that even though MULTIBOOT is in main.h, you do NOT see the MULTIBOOT line at the bottom of the HAM splash page.

Just to be sure the app isn't locked up, add the following lines right after the ham_StartIntHandler and before the game loop:

Code:
 ham_InitText(0);
   ham_DrawText(0,0,"Hello World!");


Hit F6 again and notice that it still doesn't show multiboot.

Now, comment out the MULTIBOOT line in main.h and add the following line into main.CPP file. Be sure to put it in the .CPP and NOT the .h file:

Code:
int __gba_multiboot=0;


Hit F6 again and now you will see the MULTIBOOT message at the bottom of the HAM splash page!

Also note that if you put this line into main.h instead of main.cpp, you will NOT get the multiboot indicator. Try it.

This is a fresh install of HAM and the new 2.5 install of Visual HAM, without modifying any of the .mak files or mucking with any linker scripts.
_________________
------------------
Gene Ostrowski

#15977 - dagamer34 - Thu Feb 05, 2004 2:32 am

Hmm.... okay. Then that means that it is a very simple problem.

Just add this line to your mygba.h header file

#define MULTIBOOT int __gba_multiboot = 0;

Even emanuel forgets things sometimes. Only shows he is human!
_________________
Little kids and Playstation 2's don't mix. :(

#15983 - Gene Ostrowski - Thu Feb 05, 2004 3:46 am

It's already in there:

Code:
#ifdef HAM_MULTIBOOT

#ifndef MULTIBOOT
#define MULTIBOOT volatile const int __gba_multiboot = 1; 
#endif

#else

#define MULTIBOOT

#endif


And it's getting defined in the master.mak file:

Code:
# make Multiboot the standard, comment out
# normal Cart booting
#
HAM_CFLAGS += -DHAM_MULTIBOOT


Very odd. And it still doesn't explain why it wont have an effect if it's put in the .h file instead of the .cpp file.

Any other thoughts?
_________________
------------------
Gene Ostrowski