summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTharo <17233964+Thar0@users.noreply.github.com>2024-12-14 00:27:45 +0000
committerGitHub <noreply@github.com>2024-12-13 16:27:45 -0800
commitfc8d1165c8beb6d6d54b54c2a56387c99b8d7861 (patch)
treeab379a63737ff2377e55161a95d8e654dee5ce41 /include
parent8efc382b9f9c670063611e32b21cac53345bd3b2 (diff)
[Audio 9/9] Loose ends (#1755)
* [Audio 9/9] Loose ends * Fix sampleconv memset bug * Doc updates from oot
Diffstat (limited to 'include')
-rw-r--r--include/audio/aseq.h4
-rw-r--r--include/libc/assert.h4
-rw-r--r--include/sfx.h26
3 files changed, 30 insertions, 4 deletions
diff --git a/include/audio/aseq.h b/include/audio/aseq.h
index 1c66a3a2c..8d5eb6be4 100644
--- a/include/audio/aseq.h
+++ b/include/audio/aseq.h
@@ -556,8 +556,8 @@ _RESET_SECTION
.macro .startseq name
/* Begin a sequence. */
- /* Write the sequence name into a special .name section */
- .pushsection .name, "", @note
+ /* Write the sequence name into a special .note.name section */
+ .pushsection .note.name, "", @note
.asciz "\name"
.balign 4
.popsection
diff --git a/include/libc/assert.h b/include/libc/assert.h
index 7fee0a815..fd3015347 100644
--- a/include/libc/assert.h
+++ b/include/libc/assert.h
@@ -3,9 +3,9 @@
// Static/compile-time assertions
-#if (__STDC_VERSION__ >= 202311L)
+#if !defined(__sgi) && (__STDC_VERSION__ >= 202311L)
// static_assert is a keyword in C23, do not define it
-#elif (__STDC_VERSION__ >= 201112L)
+#elif !defined(__sgi) && (__STDC_VERSION__ >= 201112L)
# define static_assert(cond, msg) _Static_assert(cond, msg)
#else
# ifndef GLUE
diff --git a/include/sfx.h b/include/sfx.h
index d37e333ac..8d1fa7993 100644
--- a/include/sfx.h
+++ b/include/sfx.h
@@ -2,6 +2,7 @@
#define SFX_H
#include "PR/ultratypes.h"
+#include "libc/assert.h"
#include "z64math.h"
/**
@@ -23,25 +24,50 @@
typedef enum SfxId {
NA_SE_NONE, // Requesting a sfx with this id will play no sound
+
NA_SE_PL_BASE = 0x7FF,
#include "tables/sfx/playerbank_table.h"
+ NA_SE_PL_END,
+
NA_SE_IT_BASE = 0x17FF,
#include "tables/sfx/itembank_table.h"
+ NA_SE_IT_END,
+
NA_SE_EV_BASE = 0x27FF,
#include "tables/sfx/environmentbank_table.h"
+ NA_SE_EV_END,
+
NA_SE_EN_BASE = 0x37FF,
#include "tables/sfx/enemybank_table.h"
+ NA_SE_EN_END,
+
NA_SE_SY_BASE = 0x47FF,
#include "tables/sfx/systembank_table.h"
+ NA_SE_SY_END,
+
NA_SE_OC_BASE = 0x57FF,
#include "tables/sfx/ocarinabank_table.h"
+ NA_SE_OC_END,
+
NA_SE_VO_BASE = 0x67FF,
#include "tables/sfx/voicebank_table.h"
+ NA_SE_VO_END,
+
NA_SE_MAX
} SfxId;
#undef DEFINE_SFX
+// These limits are due to the way Sequence 0 is programmed. There is also a global limit of 1024 entries for every bank
+// enforced in Audio_PlayActiveSfx in sfx.c
+static_assert(NA_SE_PL_END - (NA_SE_PL_BASE + 1) <= 512, "Player Bank SFX Table is limited to 512 entries due to Sequence 0");
+static_assert(NA_SE_IT_END - (NA_SE_IT_BASE + 1) <= 128, "Item Bank SFX Table is limited to 128 entries due to Sequence 0");
+static_assert(NA_SE_EV_END - (NA_SE_EV_BASE + 1) <= 512, "Environment Bank SFX Table is limited to 512 entries due to Sequence 0");
+static_assert(NA_SE_EN_END - (NA_SE_EN_BASE + 1) <= 768, "Enemy Bank SFX Table is limited to 768 entries due to Sequence 0");
+static_assert(NA_SE_SY_END - (NA_SE_SY_BASE + 1) <= 128, "System Bank SFX Table is limited to 128 entries due to Sequence 0");
+static_assert(NA_SE_OC_END - (NA_SE_OC_BASE + 1) <= 128, "Ocarina Bank SFX Table is limited to 128 entries due to Sequence 0");
+static_assert(NA_SE_VO_END - (NA_SE_VO_BASE + 1) <= 512, "Voice Bank SFX Table is limited to 512 entries due to Sequence 0");
+
typedef enum SfxPauseMenu {
/* 0 */ SFX_PAUSE_MENU_CLOSE,
/* 1 */ SFX_PAUSE_MENU_OPEN