Tonc - GBA Programming in rot13

Tonc is my reasonably successful tutorial on GBA programming, covering most aspects of the hardware in all its technical glory. Tonc explains the GBA hardware in detail, and how you should and should not work with it. Prior programming knowledge is required, an affinity for mathematics is also recommended.

1.4 is the final version, but I will try to fix errors when they are found. Look in the errata for details.

(2018-06-24) A recent change in devkitArm (probably 48?) changed the way ctype.h works, resulting in a broken libtonc.a. To fix it, recompile libtonc manually. Go to the tonclib folder and do `make clean` and `make`. That should do it.

(2013-03-24) fixed for change in DKA r41 prefix (the arm-none-eabi thing).

(2012-05-20) alright, 1.4 was supposed the final version, but GCC 4.7 requires an extra line for assembly routines, so I had to check and fix a number of things. Code's at 1.4.1 now and the rest will follow soon (hopefully).

Tonc Downloads

Current (and final) version: v1.4 / v1.4.2

Older versions:

NOTE. I've had a report a while back that the CHM version didn't work. The reason seems to be the silly security settings in Windows that block downloaded CHM files to open properly. If you get this too, open the file's properties and click `Unblock' (Thanks for pointing this out, Kevin.)

13 thoughts on “Tonc - GBA Programming in rot13

  1. In the latest tonc-code.zip, there appears to be no 'source' or 'gfx' subdirectories in code/adv/m7_demo/

  2. There is a problem building the tonclib v1.4. It seems that make isn't pointing out where the headers are. I looked through the makefile and found some discrepancies between the variables INCLUDE and INCLUDES. But after changing them all to INCLUDES, the same thing happened.

  3. Odd. I've rebuilt tonclib here and it seems to compile okay. It did seem I missed a few points in the main codebase, though, so I've re-uploaded everything. Maybe it'll work better this time.

    About INCLUDE vs INCLUDES: INCLUDES is supposed to be the list for include directories, and INCLUDE is the variable that the compiler needs to search for the directories. You shouldn't replace one for the other, that won't work. Because of the obvious potential for confusion here, I always used INCDIRS in the examples, but somehow missed it in the tonclib makefile.

  4. Okay this may be a needless / dispensable comment... but DUDE, thank you soo much for this!! Awesome. I love Tonc.

  5. Pingback: Third time’s the charm…I hope. | RubiksMaze

  6. Dude, this is awesome :) I'm using your tests to improve my WIP GBA emulator!!
    Thank you for your work!

  7. What's the license for Tonclib? I couldn't find one. (And under the law, if you don't declare a license, a work is automatically copyrighted with "all rights reserved" terms.)

  8. this is not working on my pc. I use the command program and it comes with a bunch of errors. I am using devkitpro and it is just not working. Im really confused on why this isnt working. I can send pictures of the code that comes from the cmd program and maybe someone can help me. It would be very helpful and greatly appreciated

  9. Damian, tonclib is MIT licenced. Or would have been if I hadn't forgotten to add the license file >_>

    Nicolas, I've added the explanation for the problem you have to the description. Thanks for bringing it to my attention!

Leave a Reply

Your email address will not be published. Required fields are marked *