11
NitroTracker Community / Re: Open Source!1!11!
« on: April 17, 2009, 21:17:28 »
Nope. Maxmod is an external library (maybe based on libnds, dunno), and the simple sound engine functions (soundPlayNoise, soundPlaySample, etc.) are made to be called from the ARM9 code.
Also, these two APIs have only been included in version 1.3.1.
I'm pretty sure Tob didn't use any of these functions, but he used the ARM7 macros of the previous libnds versions (lower-level, probably faster).
A sample code looks like:
Immediately after the values are changed in the registry of channel 0, the sound starts to be played.
Also, these two APIs have only been included in version 1.3.1.
I'm pretty sure Tob didn't use any of these functions, but he used the ARM7 macros of the previous libnds versions (lower-level, probably faster).
A sample code looks like:
Code: [Select]
SCHANNEL_TIMER(0) = SOUND_FREQ(22050);
SCHANNEL_SOURCE(0) = (uint32)sample;
SCHANNEL_LENGTH(0) = ((int)sample_end - (int)sample) >> 2;
SCHANNEL_CR(0) = SCHANNEL_ENABLE | SOUND_ONE_SHOT | SOUND_8BIT | SOUND_VOL(0x3F);
Immediately after the values are changed in the registry of channel 0, the sound starts to be played.