gbadev
Game Boy Advance homebrew development forum
Member
Joined:
Posts: 24

Does anyone know how to build the code in this tutorial?

https://ianfinlayson.net/class/cpsc305/notes/19-sound

It claims that the "complete program including the data files" can be downloaded via the link at the bottom, but there's no makefile there. When I tried to use the makefile from TONC's basic first example, and loaded the .gba file in mGBA, I got this error:

The game has crashed with the following error:

Jumped to invalid address: 783BD1F6

Administrator
avatar
Joined:
Posts: 49

Hmm, I imagine your Makefile is fine and there's something wrong with the code itself.

Oh god, yeah, this tutorial was part of a course which expected students to use 'devkitAdvance', a toolchain which hasn't been updated since 2003.

It's possible that the code was never correct, but happened to work because the compiler optimisations weren't very good back then.

Member
Joined:
Posts: 24

exelotl wrote:

Hmm, I imagine your Makefile is fine and there's something wrong with the code itself.

Oh god, yeah, this tutorial was part of a course which expected students to use 'devkitAdvance', a toolchain which hasn't been updated since 2003.

It's possible that the code was never correct, but happened to work because the compiler optimisations weren't very good back then.

Yet another reason I think it's a better idea to start out with optimizations off - you have more code massaging your code, which means more code that can fail.

Thanks. Anyway, the example project in this tutorial worked for me:

https://deku.gbadev.org/program/sound1.html

I did have to use the ARM compiler and linker from devkitPro as running the vanilla makefile didn't work though.

Moderator
Joined:
Posts: 13

Yet another reason I think it's a better idea to start out with optimizations off - you have more code massaging your code, which means more code that can fail.

As I've mentioned in here https://forum.gbadev.net/topic/29-can-t-build-in-programmer-s-notepad?page=1#pid175 I think it's generally a good idea to use optimizations always so that you're always testing the code you will eventually run in the final build.

I did have to use the ARM compiler and linker from devkitPro as running the vanilla makefile didn't work though.

Yes, when building old code in general you should replace the makefile by the new one of devkitPro, they don't update it often, but over the years it tends to change, and you really don't want to waste your time fixing an old makefile when you can just take the new one.

Member
Joined:
Posts: 24

SkyLyrac wrote:

Yet another reason I think it's a better idea to start out with optimizations off - you have more code massaging your code, which means more code that can fail.

As I've mentioned in here https://forum.gbadev.net/topic/29-can-t-build-in-programmer-s-notepad?page=1#pid175 I think it's generally a good idea to use optimizations always so that you're always testing the code you will eventually run in the final build.

Well, I think it's best if we agree to disagree on that one. (I did read your whole post over there, thank you for elaborating.)

I did have to use the ARM compiler and linker from devkitPro as running the vanilla makefile didn't work though.

Yes, when building old code in general you should replace the makefile by the new one of devkitPro, they don't update it often, but over the years it tends to change, and you really don't want to waste your time fixing an old makefile when you can just take the new one.

The Makefile in that tutorial was no big deal because I knew what binaries to point to but I'll keep that in mind. Thanks.