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 > Tutorial for DevKitARM

#55506 - BrokenMemories - Wed Sep 28, 2005 10:37 pm

Hey All,

Well I've been looking into doing GBA programming for a while now and have downloaded DevKitARM. Its all working and i'm using the Programmers Notpad for coding. I've also read up on making makefiles.

As for coding. I'm intermeidate at C and Java and alittle C++ so coding isnt new to me. What is new to me is the DevkitARM.

I've looked everywhere for a simple beginners tutorial for GBA programming that uses devkitARM and as far as i can see there isnt one. The closest is TONC's and he/she uses their own freaken headers!! Sorry got a bit carried away there.. no offense to TONC .. but its really frustrating to have this kit and not know how to uses it.

Is there any tutorial out there that uses devkitARM and uses the devkitARM headers files. ie gba_base.h, gba_video.h, gba_type.h (with out completely rewriting them)

Thanks in advance to anyones response.

~BM~

(PS there seems to be a lot of out dated tutorials using dkadv, which as far as i can see isnt updated anymore or for a long time)

#55549 - Cearn - Thu Sep 29, 2005 8:36 am

BrokenMemories wrote:
I've looked everywhere for a simple beginners tutorial for GBA programming that uses devkitARM and as far as i can see there isnt one. The closest is TONC's and he/she uses their own freaken headers!! Sorry got a bit carried away there.. no offense to TONC .. but its really frustrating to have this kit and not know how to uses it.
.

Tonc's does use devkitARM. Strictly speaking, devkitARM != libgba. Apart from crt0.S and a linkscript, devkitARM (or the much older dkadv) have little to no GBA-specific code in them. The main purpose of devkitARM is to take your code and turn C code into ARM machine code.

All the headers you may find (whether it's pern, sgade, ham/hel, tonc, libgba) do mostly the same thing: defining some basic types, the memory map (all those REG_ things) and bit-defines for those registers; with the possible exception of the names, these are the same for each library, so the one you use is pretty much irrelevant. vid_mem, VideoBuffer, MODE3_FB -- they're all pointers to 0x0600:0000 so it doesn't matter which name you use. It's not the names that are important, it's what they stand for.

Just run with any tutorials that you can find to learn what you can and cannot do with the GBA, learn a bit about how to deal with the different memory sections, and then feel free to throw away the headers you find there and piece together your own set.

BrokenMemories wrote:
(PS there seems to be a lot of out dated tutorials using dkadv, which as far as i can see isnt updated anymore or for a long time)

Correct. The standard is devkitARM now, but in principle the toolchain you use to build your code is irrelevant. Of course in practice, devkitARM will do better job. But valid C code can be compiled with either toolchain, you only have to change the toolnames and compiler flags just a little bit.

#55555 - wintermute - Thu Sep 29, 2005 9:42 am

There are some gba examples distributed with the devkitPro installer which use the libgba headers. Documentation is being worked on as we speak and I hope to get that into the installer once it matures a bit.

The doxygen files are hosted here atm -> http://devkitpro.sourceforge.net/onlinedocs/libgba/files.html

#55557 - BrokenMemories - Thu Sep 29, 2005 10:36 am

Cheers, thank you both, for the link and the info.

I've started using the tutorial by gbajunkie. It seems really good. I also been poking round inside the headers and trying to match up the names/defines with the same ones that gbaJunkie uses (they are basicly the same anyway).

You are right Cearn its the princples behind whats going on that matters.

Thank you both again, i'm sure you'll see me poking my head in now and then over the next couple of months :-)

~BM~