diff options
Diffstat (limited to 'src/common.h')
-rw-r--r-- | src/common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h index 048708b..0fe2752 100644 --- a/src/common.h +++ b/src/common.h | |||
@@ -722,6 +722,11 @@ wait_vsync(void) { | |||
722 | #define CLAMP(X, MIN, MAX) ((X) <= (MIN) ? (MIN) : (X) > (MAX) ? (MAX): (X)) | 722 | #define CLAMP(X, MIN, MAX) ((X) <= (MIN) ? (MIN) : (X) > (MAX) ? (MAX): (X)) |
723 | #define LEN(ARR) (sizeof(ARR) / sizeof((ARR)[0])) | 723 | #define LEN(ARR) (sizeof(ARR) / sizeof((ARR)[0])) |
724 | 724 | ||
725 | // Fixed-point arithmetic for (i.P) numbers. | ||
726 | #define FP_MUL(A,B,P) (((A) * (B)) >> (P)) | ||
727 | #define FP_DIV(A,B,P) (((A) << (P)) / (B)) | ||
728 | #define FP_LERP(Y0,Y1,X,P) ((Y0) + FP_MUL((X), ((Y1) - (Y0)), P)) | ||
729 | |||
725 | // | 730 | // |
726 | // Memory section macros for devkitARM. | 731 | // Memory section macros for devkitARM. |
727 | // | 732 | // |