From: yellows8 Date: Sat, 6 Sep 2014 21:49:48 +0000 (-0400) Subject: Fixed broken CSND_playsound() code for looping(use vaddr1 for that instead of vaddr0... X-Git-Tag: v0.2.0~83^2~5 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=a9f4b3402beea2cf69728bda40572a387b640dda;p=corbenik%2Fctrulib.git Fixed broken CSND_playsound() code for looping(use vaddr1 for that instead of vaddr0, and adjust the size). --- diff --git a/libctru/source/services/csnd.c b/libctru/source/services/csnd.c index 9eb11bb..77b1686 100644 --- a/libctru/source/services/csnd.c +++ b/libctru/source/services/csnd.c @@ -285,7 +285,11 @@ Result CSND_playsound(u32 channel, u32 looping, u32 encoding, u32 samplerate, u3 CSND_sharedmemtype0_cmde(channel, looping, encoding, samplerate, unk0, unk1, physaddr0, physaddr1, totalbytesize); CSND_sharedmemtype0_cmd8(channel, samplerate); - if(looping)CSND_sharedmemtype0_cmd3(channel, physaddr0, totalbytesize); + if(looping) + { + if(physaddr1>physaddr0)totalbytesize-= (u32)physaddr1 - (u32)physaddr0; + CSND_sharedmemtype0_cmd3(channel, physaddr1, totalbytesize); + } CSND_sharedmemtype0_cmd8(channel, samplerate); CSND_sharedmemtype0_cmd9(channel, 0xffff); CSND_setchannel_playbackstate(channel, 1);