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++ > Code will not boot on GBA hardware.

#2615 - cesium - Sun Feb 09, 2003 5:37 am

My code will simply not boot on actual GBA hardware. It emulates fine,
it multiboots fine (I just send 2 copies to the GBA using the Flash 2 Advance, and it pre-pends a loader).

Any ideas?

I have implemented all the suggestions from other topics on crt0.s.
I am using CPP, so I un-commented the CPP section in the lnkscript.
I am using devkit advance, so I copied over the crtbegin and end from
one of the interwork sub-dirs.
I have crt0 as the first of my o files. Should crtbegin be first?
I commented out boot.o.

Headers: whew, headers. I have hammered on my bin file with
every possible header tool on the net. Although none of them ever
seem to come up with the same 'complement check' value.

Flash2Advance: Using ver1.3NT, have tried checking and unchecking all
config options, ktl.

Give a man a fish... and all that. I am really looking for some sound
debugging concepts here... but if standing on my head and left shift
clicking on location 0x0c makes it work... well that's ok too.

Thanks

#2616 - cesium - Sun Feb 09, 2003 6:00 am

Correction to prev post: I probably mis-used the term 'multiboot'.
What I meant was that I can get my code to run on real hardware
if I send 2 copies of it via Flash2Advance and let it install its loader.
Ick!

#2617 - gb_feedback - Sun Feb 09, 2003 9:38 am

It does sound like an initial state problem - what goes wrong? Blank screen?
Maybe there's something you haven't set up but which emulators, and the memu programs do for you?

#2621 - cesium - Sun Feb 09, 2003 3:09 pm

Good one!

What I see is basically a blank 'white' screen.

You're suggestion that I have omitted some initialization code is a
good one. I will study that further. Also, could you suggest an app that
I could download to test booting?

This way I could take a peek at their init code.

A small app of the 'Hello World' variety would be great.

I'll take this opportunity to say that the GBA dev community
is darned impressive. There are some good coders, writers, and
generous folks here.

#2623 - cesium - Sun Feb 09, 2003 3:51 pm

Found the problem!

The ol' "blank the display bit."
(My code was running after all...)

I init the display using macros that OR my settings into the current
state of the display control register. Thus I
had a 1 in the blanking bit and never cleared it.

The demos I see on the net show
initialization by WRITING a couple bits into the control register.
That clears the other bits.

You da' man! Thanks!