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 > Compiling with DevKitArm

#26789 - yaustar - Sun Sep 26, 2004 3:39 am

At the moment I can get it to compile but the rom imageseems to show nothing more then a white screen... currently my batch files is:
Code:
path=d:\devkitarm\bin
arm-elf-gcc -g -o -specs=gba.specs keypad.elf keypad.cpp
arm-elf-objcopy -O binary keypad.elf keypad.gba
pause

_________________
[Blog] [Portfolio]

#26795 - Krakken - Sun Sep 26, 2004 5:42 am

I'm not 100% sure here but I think -o needs to have the output file name directly after it.

Code:

path=d:\devkitarm\bin
arm-elf-gcc -g -specs=gba.specs -o keypad.elf keypad.cpp
arm-elf-objcopy -O binary keypad.elf keypad.gba
pause


If not, it's a problem with your code. The only reason you would otherwise get a white screen would be if you were to set palette entry 0 with white or if you didn't setting the mode. Even mode 0 needs to be set, you MUST write to the REG_DISPCNT.

#26797 - MumblyJoe - Sun Sep 26, 2004 6:17 am

Check you dont have the "force blank" flag set in the display control register.
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!

#26804 - yaustar - Sun Sep 26, 2004 2:53 pm

it compiles fine with devkitAdv which is the part that bugs me.....
_________________
[Blog] [Portfolio]

#26805 - tepples - Sun Sep 26, 2004 2:55 pm

Quote:
Code:
arm-elf-gcc -g -o -specs=gba.specs keypad.elf keypad.cpp

The -o should immediately precede the name of the .elf file. Try this instead:
Code:
arm-elf-gcc -g -specs=gba.specs -o keypad.elf keypad.cpp

Or better yet this:
Code:
arm-elf-gcc -mthumb -mthumb-interwork -g -specs=gba.specs -o keypad.elf keypad.cpp

_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#26831 - yaustar - Mon Sep 27, 2004 12:11 am

Cheers tepples... the second one worked but why?
_________________
[Blog] [Portfolio]

#26873 - tepples - Tue Sep 28, 2004 1:18 am

To put it short, the -mthumb -mthumb-interwork tells the linker to use Thumb versions of your code and the C library. Read a few docs on gbadev.org to learn the difference between ARM and Thumb.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#26878 - LOst? - Tue Sep 28, 2004 2:50 am

tepples wrote:
To put it short, the -mthumb -mthumb-interwork tells the linker to use Thumb versions of your code and the C library. Read a few docs on gbadev.org to learn the difference between ARM and Thumb.


I believe Thumb runs so much faster. I made a mistake compiling my games in ARM and I didn't have time to do anything big in VBlank.

#26882 - poslundc - Tue Sep 28, 2004 3:16 am

LOst? wrote:
I believe Thumb runs so much faster. I made a mistake compiling my games in ARM and I didn't have time to do anything big in VBlank.


It is not nearly so simple as that. ARM instructions take longer to load than Thumb instructions (usually twice as long), but they are much more powerful, and GCC does a smarter job of compiling them than it does Thumb code. If you are running code from ROM then Thumb will usually be faster, but in my experience not tremendously so.

If you are running code from IWRAM, it takes the same amount of time to load a Thumb instruction as it does an ARM instruction, so Thumb instructions are a waste of time because they are so much less powerful than ARM instructions. Any code in IWRAM should always be ARM code.

Dan.

#26889 - yaustar - Tue Sep 28, 2004 11:37 am

Thanks!
_________________
[Blog] [Portfolio]