diff --git a/.gitignore b/.gitignore index 72281a18..2aca5358 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ objdiff.json /tools/objdiff.exe .vscode/c_cpp_properties.json tools/dtk +ctx.c diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 134541b6..412f0ec6 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -21893,7 +21893,7 @@ __OSStopAudioSystem = .text:0x803A4470; // type:function size:0xD0 scope:global DCEnable = .text:0x803A4540; // type:function size:0x14 scope:global DCInvalidateRange = .text:0x803A4560; // type:function size:0x2C scope:global DCFlushRange = .text:0x803A4590; // type:function size:0x30 scope:global -fn_803A45C0 = .text:0x803A45C0; // type:function size:0x30 +DCStoreRange = .text:0x803A45C0; // type:function size:0x30 DCFlushRangeNoSync = .text:0x803A45F0; // type:function size:0x2C scope:global fn_803A4620 = .text:0x803A4620; // type:function size:0x2C DCZeroRange = .text:0x803A4650; // type:function size:0x2C scope:global @@ -24143,7 +24143,7 @@ DirectPrint_IsActive__Q24nw4r2dbFv = .text:0x80434360; // type:function size:0x2 DirectPrint_EraseXfb__Q24nw4r2dbFiiii = .text:0x80434390; // type:function size:0x190 DirectPrint_ChangeXfb__Q24nw4r2dbFPvUsUs = .text:0x80434520; // type:function size:0x34 DirectPrint_StoreCache__Q24nw4r2dbFv = .text:0x80434560; // type:function size:0x14 -DirectPrint_DrawString__Q24nw4r2dbFiibPCce = .text:0x80434580; // type:function size:0xD0 +DirectPrint_DrawString__Q24nw4r2dbFiiPCce = .text:0x80434580; // type:function size:0xD0 DirectPrint_DrawString___Q24nw4r2dbFii = .text:0x80434650; // type:function size:0x70 DirectPrint_DrawStringToXfb__Q34nw4r2db6detailFiiPCcP16__va_list_structbb = .text:0x804346C0; // type:function size:0xE4 DrawStringToXfb___Q24nw4r2dbFiiPCcbb = .text:0x804347B0; // type:function size:0x154 diff --git a/configure.py b/configure.py index 97a58a26..54952295 100644 --- a/configure.py +++ b/configure.py @@ -191,7 +191,7 @@ cflags_egg = [ # nw4r flags cflags_nw4r = [ *cflags_base, - "-inline auto", + "-inline deferred", ] # REL flags diff --git a/include/MSL_C/MSL_Common/Src/printf.h b/include/MSL_C/MSL_Common/Src/printf.h index 5b1a7ccd..997e0018 100644 --- a/include/MSL_C/MSL_Common/Src/printf.h +++ b/include/MSL_C/MSL_Common/Src/printf.h @@ -2,18 +2,18 @@ #define MSL_COMMON_SRC_PRINTF_H #include "MSL_C/MSL_Common/Src/ansi_files.h" -#include "Runtime.PPCEABI.H/__va_arg.h" +#include "Runtime/__va_arg.h" #ifdef __cplusplus extern "C" { #endif -int fprintf(FILE* stream, const char* format, ...); -int printf(const char* format, ...); -int sprintf(const char* str, const char* format, ...); -int snprintf(const char* str, size_t n, const char* format, ...); -int vsnprintf(char* str, size_t n, const char* format, va_list arg); -int vprintf(const char* format, va_list arg); +int fprintf(FILE *stream, const char *format, ...); +int printf(const char *format, ...); +int sprintf(const char *str, const char *format, ...); +int snprintf(const char *str, size_t n, const char *format, ...); +int vsnprintf(char *str, size_t n, const char *format, va_list arg); +int vprintf(const char *format, va_list arg); #ifdef __cplusplus } diff --git a/include/Runtime/__va_arg.h b/include/Runtime/__va_arg.h index 6f136acd..1e06d49b 100644 --- a/include/Runtime/__va_arg.h +++ b/include/Runtime/__va_arg.h @@ -18,7 +18,7 @@ extern "C" void *__va_arg(_va_list_struct *, int); void *__va_arg(_va_list_struct *, int); #endif -#if IN_VSCODE_EDITOR +#if __INTELLISENSE__ #define __builtin_va_info(...) #define _var_arg_typeof(...) #endif diff --git a/include/rvl/macros.h b/include/rvl/macros.h index ea564007..64dd2ef9 100644 --- a/include/rvl/macros.h +++ b/include/rvl/macros.h @@ -1,16 +1,14 @@ #pragma once -#define MAX(x, y) ((x) > (y) ? (x) : (y)) -#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#define MAX(x, y) ((x) >= (y) ? (x) : (y)) +#define MIN(x, y) ((x) <= (y) ? (x) : (y)) -#define CLAMP(low, high, x) \ - ((x) > (high) ? (high) : ((x) < (low) ? (low) : (x))) +#define CLAMP(low, high, x) ((x) > (high) ? (high) : ((x) < (low) ? (low) : (x))) #define ROUND_UP(x, align) (((x) + (align)-1) & (-(align))) -#define ROUND_UP_PTR(x, align) \ - ((void*)((((u32)(x)) + (align)-1) & (~((align)-1)))) +#define ROUND_UP_PTR(x, align) ((void *)((((u32)(x)) + (align)-1) & (~((align)-1)))) #define ROUND_DOWN(x, align) ((x) & (-(align))) -#define ROUND_DOWN_PTR(x, align) ((void*)(((u32)(x)) & (~((align)-1)))) +#define ROUND_DOWN_PTR(x, align) ((void *)(((u32)(x)) & (~((align)-1)))) #define ARRAY_LENGTH(x) (sizeof((x)) / sizeof((x)[0])) @@ -25,15 +23,19 @@ // (Functions are given prototypes for -requireprotos) #ifdef __MWERKS__ // Force BSS order -#define CW_FORCE_BSS(module, ...) \ - void fake_function(...); \ - void FORCE_BSS##module##x(void); \ - void FORCE_BSS##module##x(void) { fake_function(__VA_ARGS__); } +#define CW_FORCE_BSS(module, ...) \ + void fake_function(...); \ + void FORCE_BSS##module##x(void); \ + void FORCE_BSS##module##x(void) { \ + fake_function(__VA_ARGS__); \ + } // Force strings into pool -#define CW_FORCE_STRINGS(module, ...) \ - void fake_function(...); \ - void FORCE_STRINGS##module(void); \ - void FORCE_STRINGS##module(void) { fake_function(__VA_ARGS__); } +#define CW_FORCE_STRINGS(module, ...) \ + void fake_function(...); \ + void FORCE_STRINGS##module(void); \ + void FORCE_STRINGS##module(void) { \ + fake_function(__VA_ARGS__); \ + } #else #define CW_FORCE_BSS(module, ...) #define CW_FORCE_STRINGS(module, ...)