summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
authorElijah Thomas <42302100+elijah-thomas774@users.noreply.github.com>2025-03-16 11:26:15 -0400
committerGitHub <noreply@github.com>2025-03-16 11:26:15 -0400
commit9c3c480b245295475919a8192e9cafd37f5d84f2 (patch)
treeaf360c7e6eb4148e95209ac9a630589002ed5a0d /include/common.h
parentfbc35aefd234cd8c113b2702c931ac9339dc26bc (diff)
g3d source (#123)
* g3d_calcvtx GetData seems to have changed -> dwarf says r is a local and using ofs_to_ptr didnt work * g3d_light and g3d_fog sdata2 splits and func ordering * g3d_scnproc * g3d_init * g3d_scnmdl * g3d_scnmdlsmpl * g3d_scnroot * g3d_scnobj * g3d_res* progress * g3d_resmdl OK * g3d_restev OK * g3d_resmat OK * g3d_resvtx and g3d_restex OK * g3d_resnode OK * g3d_resanm OK * g3d_resanmchr Progress * the rest of g3d_res* OK * g3d_anmvis OK * g3d_anmclr OK * Some Splitting * more OK, Inline Issue in g3d_anmtexsrt * g3d_obj, g3d_anmobj, g3d_gpu, g3d_tmem, g3d_cpu OK * g3d_state OK * g3d/dcc OK * Include fixup * More Fixups * g3d_camera OK * g3d_draw OK * g3d_calcworld OK * g3d_calcworld actually OK * g3d_workmem, g3d_dcc OK * g3d_calcview OK * g3d_anmtexsrt OK with DONT_INLINE * g3d_transform OK (Feels Cheaty) * g3d_resanmchr OK * g3d_draw1mat1shp Close * g3d_draw1mat1shp OK (Thanks Lago!). Ran symbol applying script
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/common.h b/include/common.h
index 85144d82..1dd07be5 100644
--- a/include/common.h
+++ b/include/common.h
@@ -6,11 +6,11 @@
#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(x, align) (((x) + (align) - 1) & (-(align)))
+#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]))
@@ -44,6 +44,8 @@
#define DECOMP_FORCEACTIVE(module, ...)
#define DECOMP_FORCELITERAL(module, x)
#define DECOMP_FORCEDTOR(module, cls)
+#define DECOMP_INLINE
+#define DECOMP_DONT_INLINE
#else
// Force reference specific data
#define __CONCAT(x, y) x##y
@@ -69,6 +71,8 @@
cls dummy; \
dummy.~cls(); \
}
+#define DECOMP_INLINE inline
+#define DECOMP_DONT_INLINE __attribute__((never_inline))
#endif
#include "stddef.h"