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 > just starting

#88200 - Chucky - Sun Jun 18, 2006 1:07 am

Hello gang, I'm just starting off with this developing, and I was wondering which do you guys recommend is better to use, HAM v2.8 or DevKitPro. I currently have both installed, I just find with DevkitPro there is much more manual things that need to be done in order to go from source > .gba file.

I also am not really sure why but I keep getting some errors with DevKitPro when I go to run make, i have a build.bat file that I got premade, and it still is giving me errors. So my question, would it be easier to just stick with HAM, or will i be missing some of the flexibility of DevKitPro?

Thanks again for all your help!

#88206 - keldon - Sun Jun 18, 2006 2:02 am

Goggle's I'm Feeling Lucky(c) for "Tonc gba tutorials"
Google's I'm Feeling Lucky(C)for "Make File Tutorial"

#88228 - Chucky - Sun Jun 18, 2006 6:32 am

Thanks for your reply.

From that TONC website I have copied and pasted exactly what they had done for their first.c program, but all I get is a white screen on my GBA (i made sure to change -specs=gba_mb.specs to -specs=gba.mb) and it will output a .gba file and say "Rom Fixed!" like it is supposed to, but I load it up and it's just a white screen... here is the code:

first.c:
Code:

// First demo. You are not expected to understand it
// (don't spend too much time trying and read on).
// But if you do understand (as a newbie): wow!

int main()
{
    *(unsigned int*)0x04000000 = 0x0403;

    ((unsigned short*)0x06000000)[120+80*240] = 0x001F;
    ((unsigned short*)0x06000000)[136+80*240] = 0x03E0;
    ((unsigned short*)0x06000000)[120+96*240] = 0x7C00;

    while(1);

    return 0;
}


and the makefile (first.mak):
Code:

#
# first.mak
#
# a minimal makefile (and I do mean minimal, look to the others
# for real-life use)

PROJ= first
CC= arm-eabi-gcc
OBJCOPY= arm-eabi-objcopy

.PHONY : build
build :
   $(CC) -mthumb-interwork -c $(PROJ).c
   $(CC) -specs=gba.specs -mthumb-interwork $(PROJ).o -o $(PROJ).elf
   $(OBJCOPY) -v -O binary $(PROJ).elf $(PROJ).gba
   gbafix $(PROJ).gba

.PHONY : clean
clean :
   @rm -fv $(PROJ).o
   @rm -fv $(PROJ).gba
   @rm -fv $(PROJ).elf


I have it setup like on their website with Programmer's Notepad so all I have to do is hit F9 and it will use make automatically.

Thanks again for bearing with me, like I said I am new and appreciate any help i can get!

#88253 - Cearn - Sun Jun 18, 2006 10:11 am

You may have caught devkitPro in something of a transitional phase, where it was found that the linkscripts sometimes didn't work correctly. See here for example. This should be fixed in devkitPro r19a, which came out just a few days ago.

Also (mostly for the rest I guess), the code posted is indeed the first example, quickly followed that this is not how one's supposed to write code (and why). Just to make that clear.

#88254 - Chucky - Sun Jun 18, 2006 10:19 am

THANK YOU!!!
I installed the update and now everything is working.

(now only if i could find all the hair i ripped off the top of my head ~.^ )

by the way your last statement, i apologize but did i post code improperly? or was I just not supposed to post it at all?

in any case,... THANK YOU FOR YOUR HELP!!! I had devkitpro installed for 2 weeks, like you said in transition... I should check on the updates more often!


Thanks again!

#88258 - Cearn - Sun Jun 18, 2006 10:30 am

Chucky wrote:
by the way your last statement, i apologize but did i post code improperly? or was I just not supposed to post it at all?
No no, the posting style was excellent, I just wish you hadn't pasted this particular piece of code. I'm kind of a stickler for good coding practices (which this definitely isn't) so this is, well, a little embarassing >_>.

Anyway, glad to see everything's working now. Happy coding.