From 40896468e71ea8776924098889783c2d3b893adb Mon Sep 17 00:00:00 2001 From: TurtleP Date: Sun, 28 Aug 2022 21:06:27 -0400 Subject: [PATCH] add ndspChnGet* methods --- libctru/include/3ds/ndsp/channel.h | 4 ++-- libctru/source/ndsp/ndsp-channel.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libctru/include/3ds/ndsp/channel.h b/libctru/include/3ds/ndsp/channel.h index 7cadd2d..e5b0f13 100644 --- a/libctru/include/3ds/ndsp/channel.h +++ b/libctru/include/3ds/ndsp/channel.h @@ -159,9 +159,9 @@ void ndspChnSetMix(int id, float mix[12]); /** * @brief Gets the mix parameters (volumes) of a channel. * @param id ID of the channel (0..23) - * @return The mix parameters. See \ref ndspChnSetMix. + * @param mix Mix parameters to write out to. See \ref ndspChnSetMix. */ -float* ndspChnGetMix(int id); +void ndspChnGetMix(int id, float* mix[12]); /** * @brief Sets the DSPADPCM coefficients of a channel. diff --git a/libctru/source/ndsp/ndsp-channel.c b/libctru/source/ndsp/ndsp-channel.c index b2ac176..7449e60 100644 --- a/libctru/source/ndsp/ndsp-channel.c +++ b/libctru/source/ndsp/ndsp-channel.c @@ -153,10 +153,10 @@ void ndspChnSetMix(int id, float mix[12]) LightLock_Unlock(&chn->lock); } -float* ndspChnGetMix(int id) +void ndspChnGetMix(int id, float mix[12]) { ndspChnSt* chn = &ndspChn[id]; - return chn->mix; + memcpy(mix, chn->mix, sizeof(mix)); } void ndspChnSetAdpcmCoefs(int id, u16 coefs[16])