Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[battle, fpmath] revert changes to Q_24_8 format #3125

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/fpmath.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef FPMATH_H_
#define FPMATH_H_

typedef s32 q4_12_t;
typedef s16 q4_12_t;
typedef u32 uq4_12_t;

#define Q_4_12_SHIFT (12)
Expand All @@ -15,7 +15,7 @@ typedef u32 uq4_12_t;
#define UQ_4_12(n) ((uq4_12_t)((n) * 4096))

// Converts a number to Q24.8 fixed-point format
#define Q_24_8(n) ((s32)((n) * 256))
#define Q_24_8(n) ((s32)((n) << 8))

// Converts a Q8.8 fixed-point format number to a regular integer
#define Q_8_8_TO_INT(n) ((s32)((n) / 256))
Expand All @@ -25,7 +25,7 @@ typedef u32 uq4_12_t;
#define UQ_4_12_TO_INT(n) ((u32)((n) / 4096))

// Converts a Q24.8 fixed-point format number to a regular integer
#define Q_24_8_TO_INT(n) ((s32)((n) / 256))
#define Q_24_8_TO_INT(n) ((s32)((n) >> 8))

// Rounding value for Q4.12 fixed-point format
#define Q_4_12_ROUND ((1) << (Q_4_12_SHIFT - 1))
Expand Down