From 65d29dc33702ac590f1c78a2791ebe5937e0c221 Mon Sep 17 00:00:00 2001 From: Gregory Heskett Date: Fri, 20 Jan 2023 10:31:30 -0500 Subject: [PATCH] Increase max number of concurrent layers and channels (#527) At worst, this eats up a few KB of memory. Runtime difference should be negligible when the extra data is not being used. --- src/audio/internal.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/audio/internal.h b/src/audio/internal.h index d01da280..bf90a495 100644 --- a/src/audio/internal.h +++ b/src/audio/internal.h @@ -7,21 +7,26 @@ #if defined(VERSION_EU) || defined(VERSION_SH) #define SEQUENCE_PLAYERS 4 -#define SEQUENCE_CHANNELS 48 -#define SEQUENCE_LAYERS 64 #else #define SEQUENCE_PLAYERS 3 -#define SEQUENCE_CHANNELS 32 -#ifdef VERSION_JP -#define SEQUENCE_LAYERS 48 -#else -#define SEQUENCE_LAYERS 52 -#endif #endif #define LAYERS_MAX 4 #define CHANNELS_MAX 16 +#ifdef EXPAND_AUDIO_HEAP // Not technically on the heap but it's memory nonetheless... +#define SEQUENCE_CHANNELS (SEQUENCE_PLAYERS * CHANNELS_MAX) +#define SEQUENCE_LAYERS ((SEQUENCE_CHANNELS * LAYERS_MAX) / 2) // This should be more than plenty in nearly all circumstances. +#else // EXPAND_AUDIO_HEAP +#if defined(VERSION_EU) || defined(VERSION_SH) +#define SEQUENCE_CHANNELS 48 +#define SEQUENCE_LAYERS 64 +#else +#define SEQUENCE_CHANNELS 32 +#define SEQUENCE_LAYERS 52 +#endif +#endif // EXPAND_AUDIO_HEAP + #define NO_LAYER ((struct SequenceChannelLayer *)(-1)) enum MuteBehaviors {