diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2026-04-21 05:12:46 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-21 08:12:46 -0400 |
| commit | 57e41795f53f8d43d67e94f89b1b532e30cf8aec (patch) | |
| tree | b188e62dc98f6a0cace751c37f83236d5192afa5 /include | |
| parent | fa85e7cda5de980151ab71279b6a1bf2eca9b23f (diff) | |
String macros (#1871)
* PRINTF
* T
* fault
* yaz0
* __osMalloc
* audio_thread_manager
* graph
* padmgr
* sched
* z_play
* z_arrow_ice
* z_arrow_light
* z_elf_msg
* z_elf_msg3
* z_elf_msg4
* z_elf_msg5
* z_mir_ray
* stackcheck
* Include versions in macros.h
* Fix workaround for permuter
Diffstat (limited to 'include')
| -rw-r--r-- | include/CIC6105.h | 2 | ||||
| -rw-r--r-- | include/libc64/os_malloc.h | 4 | ||||
| -rw-r--r-- | include/macros.h | 32 |
3 files changed, 35 insertions, 3 deletions
diff --git a/include/CIC6105.h b/include/CIC6105.h index 60c55cbc7..3afcbc69d 100644 --- a/include/CIC6105.h +++ b/include/CIC6105.h @@ -17,7 +17,7 @@ void CIC6105_AddRomInfoFaultPage(void); void CIC6105_Destroy(void); void CIC6105_Init(void); -#if MM_VERSION <= N64_JP_1_1 +#if MM_VERSION < N64_US void CIC6105_ScheduleCICTask(void); #endif diff --git a/include/libc64/os_malloc.h b/include/libc64/os_malloc.h index 575529e1a..3441a1d04 100644 --- a/include/libc64/os_malloc.h +++ b/include/libc64/os_malloc.h @@ -15,7 +15,7 @@ typedef struct ArenaNode { /* 0x4 */ size_t size; /* 0x8 */ struct ArenaNode* next; /* 0xC */ struct ArenaNode* prev; - #if MM_VERSION <= N64_JP_1_1 + #if MM_VERSION < N64_US /* 0x10 */ const char* filename; /* 0x14 */ int line; /* 0x18 */ OSId threadId; @@ -44,7 +44,7 @@ void* __osRealloc(Arena* arena, void* ptr, size_t newSize); void __osGetSizes(Arena* arena, size_t* outMaxFree, size_t* outFree, size_t* outAlloc); s32 __osCheckArena(Arena* arena); -#if MM_VERSION <= N64_JP_1_1 +#if MM_VERSION < N64_US void *__osMallocDebug(Arena *arena, size_t size, const char* file, int line); void *__osMallocRDebug(Arena *arena, size_t size, const char* file, int line); void __osFreeDebug(Arena* arena, void* ptr, const char* file, int line); diff --git a/include/macros.h b/include/macros.h index 6ed8600a6..4de67b19e 100644 --- a/include/macros.h +++ b/include/macros.h @@ -2,6 +2,7 @@ #define MACROS_H #include "PR/ultratypes.h" +#include "versions.h" #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 @@ -71,4 +72,35 @@ } \ (void)0 +/** + * The T macro holds translations in English for original debug strings written in Japanese. + * The translated strings match the original debug strings, they are only direct translations. + * For example, any original name is left as is rather than being replaced with the name in the codebase. + */ +#define T(jp, en) jp + +// IDO doesn't support variadic macros, but it merely throws a warning for the +// number of arguments not matching the definition (warning 609) instead of +// throwing an error. We suppress this warning and rely on GCC to catch macro +// argument errors instead. +// Note some tools define __sgi but preprocess with a modern cpp implementation, +// ensure that these do not use the IDO workaround to avoid errors. +#define IDO_PRINTF_WORKAROUND (__sgi && !__GNUC__ && !M2CTX && !PERMUTER) + +#if DEBUG_FEATURES + #define PRINTF osSyncPrintf +#elif IDO_PRINTF_WORKAROUND + #if MM_VERSION >= N64_US + #define PRINTF(args) (void)0 + #else + #define PRINTF(args) (void)(args) + #endif +#else + #if MM_VERSION >= N64_US + #define PRINTF(format, ...) (void)0 + #else + #define PRINTF(format, ...) (void)(format) + #endif +#endif + #endif // MACROS_H |
