summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Ravier <gabravier@gmail.com>2026-02-21 09:17:30 +0100
committerGitHub <noreply@github.com>2026-02-21 09:17:30 +0100
commit5ab42786f43b09060d6382a9d8c33102e75cc548 (patch)
tree77da11f6633f7843b863e4db344ce5a1cb372ccc
parent155e957634940c501ff94bd06642b0b4f7652b6e (diff)
Document src/n64dd/n64dd_error_headers.c (#2667)
* Document src/n64dd/n64dd_error_headers.c * Incorporate feedback from PR review. (see also https://github.com/zeldaret/oot/pull/2667) * Put translation of gN64DDLocalizedErrorNumberHeaders[0] in a line comment (From feedback to https://github.com/zeldaret/oot/pull/2667)
-rw-r--r--include/n64dd.h2
-rw-r--r--src/n64dd/n64dd_801C9B70.c2
-rw-r--r--src/n64dd/n64dd_error_headers.c13
3 files changed, 13 insertions, 4 deletions
diff --git a/include/n64dd.h b/include/n64dd.h
index 97064bc35..e5b1b7aa3 100644
--- a/include/n64dd.h
+++ b/include/n64dd.h
@@ -167,7 +167,7 @@ extern s32 B_801E0F64;
extern void (*D_801D2EB4)(void*, void*, void*);
// Error messages
-extern const char* D_801D2ED0[]; // "Error Number " array
+extern const char* gN64DDLocalizedErrorNumberHeaders[]; // "Error Number " array
extern const char* D_801D2EE0[2][8][4]; // Array of error message strings
// Error textures
diff --git a/src/n64dd/n64dd_801C9B70.c b/src/n64dd/n64dd_801C9B70.c
index 2437904c3..79f205c77 100644
--- a/src/n64dd/n64dd_801C9B70.c
+++ b/src/n64dd/n64dd_801C9B70.c
@@ -61,7 +61,7 @@ void func_801C9C74(u8* dest, u8 value, u32 count) {
// n64ddError_GetErrorHeader
const char* func_801C9CA4(void) {
- return D_801D2ED0[func_801C9C48()];
+ return gN64DDLocalizedErrorNumberHeaders[func_801C9C48()];
}
// n64ddError_WriteNumberJP
diff --git a/src/n64dd/n64dd_error_headers.c b/src/n64dd/n64dd_error_headers.c
index ee7d611c2..bac2f97b9 100644
--- a/src/n64dd/n64dd_error_headers.c
+++ b/src/n64dd/n64dd_error_headers.c
@@ -1,4 +1,13 @@
#include "n64dd.h"
-// Padding in .rodata suggests that these are in a separate file
-const char* D_801D2ED0[4] = { "エラー番号   ", "Error Number ", NULL, NULL };
+// Padding in .rodata suggests that this array is in a separate file
+
+/**
+ * Region-specific "error number" headers used in N64DD error handling.
+ * The first one is used if the current region is Japan (gCurrentRegion == REGION_JP),
+ * the second otherwise.
+ */
+const char* gN64DDLocalizedErrorNumberHeaders[2] = {
+ "エラー番号   ", // "Error Number"
+ "Error Number ",
+};