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.

DS development > Sample Looping

#119476 - Nelzon - Fri Feb 23, 2007 12:17 pm

On the page of the drunkencoders guys there is the following piece of code which should play a sound from the beginning to the end and then keep looping between the loopOffset and the end of the sample. I think it doesn't work in the described way but plays SampleLength - loopOffset bytes from the beginning and then starts looping between loopOffset and the end of the sample.

SCHANNEL_LENGTH(c) = SampleLength - loopOffset;
SCHANNEL_REPEAT_POINT(c) = loopOffset;
SCHANNEL_CR(c) = SOUND_ENABLE | SOUND_VOL(0x3F) | SOUND_REPEAT;

Does anybody know how to get it done like it's meant to be? I'm afraid there is some sort of notification IRQ necessary, fired when the sample's been played completely but I haven't found anything about it.

Thanks!

#120192 - Nelzon - Thu Mar 01, 2007 6:35 pm

Has anybody an idea on this topic?
_________________
The mind creates reality.