Creating our Test Environment

We will need a simple project to pass a module to our player, and press the play button.

I hope you got the devkitPro GBA examples, copy the 'template' example to your project directory. Delete everything in the source directory and create a new "main.c". Put some test code in there (we'll use libgba too):

// main.c

#include <gba.h>
#include <stdio.h>

int main( void )
{
	// initialize interrupt handler
	irqInit();

	MOD_Setup();

	consoleInit( 0, 4, 0, NULL, 0, 15 );
	BG_COLORS[0] = RGB8( 0, 0, 255 );
	BG_COLORS[241] = RGB8( 255, 255, 255 );
	SetMode( MODE_0 | BG0_ON );

	iprintf( "\n Another MOD Player..." );
	
	while(1) {
		VBlankIntrWait();
	}
	return 0;
}

The MOD_Setup function is our routine to initialize our sound engine and start up the sound DMA. (see next chapter)

Previous: GBA Sound HardwareContentsNext: Basic Sound Implementation