mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-06-03 06:15:33 -05:00
- `resultVar` -> `destVarID` - Clean up member names for `HiddenLocation` and `DistributionEvent` - `Set/Clear` -> `Enable/Disable` for HiddenLocation script macros - `ScrCmd_SetOrClearHiddenLocation` -> `ScrCmd_SetHiddenLocation` - `SYSTEM_VARS_BLOCK_SIZE` -> `NUM_SYSTEM_VARS` - Identify `scripts_unk_0412` -> `scripts_init_new_game` - Add `SCRIPT_ID_OFFSET_INIT_NEW_GAME` constant definition - Add `SCRIPT_ID` functional macro - Use `SCRIPT_ID(INIT_NEW_GAME, 0)` in `FieldSystem_InitNewGameState` - Promote `LCRNG_MULTIPLIER` in `math.c` from private to public - Use private `LCRNG_INCREMENT` in `system_vars.c` for lottery sync
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
#ifndef POKEPLATINUM_MATH_H
|
|
#define POKEPLATINUM_MATH_H
|
|
|
|
#include <nitro/fx/fx.h>
|
|
|
|
#include "constants/heap.h"
|
|
|
|
#define LCRNG_MULTIPLIER 1103515245L
|
|
|
|
enum AffineTransformationMatrixMode {
|
|
AFFINE_MODE_NORMAL = 0,
|
|
AFFINE_MODE_MAX_256,
|
|
AFFINE_MODE_MAX_360,
|
|
};
|
|
|
|
fx32 CalcSineDegrees(u16 degrees);
|
|
fx32 CalcCosineDegrees(u16 degrees);
|
|
fx32 CalcSineDegrees_Wraparound(u16 degrees);
|
|
fx32 CalcCosineDegrees_Wraparound(u16 degrees);
|
|
u16 CalcAngleRotationIdx(u16 degrees);
|
|
u16 CalcAngleRotationIdx_Wraparound(u16 degrees);
|
|
fx32 CalcSineDegrees_FX32(fx32 degrees);
|
|
fx32 CalcCosineDegrees_FX32(fx32 degrees);
|
|
|
|
u32 LCRNG_GetSeed(void);
|
|
void LCRNG_SetSeed(u32 seed);
|
|
u16 LCRNG_Next(void);
|
|
u32 ARNG_Next(u32 seed);
|
|
void MTRNG_SetSeed(u32 seed);
|
|
u32 MTRNG_Next(void);
|
|
|
|
void CreateAffineTransformationMatrix(MtxFx22 *matrix, u16 degrees, fx32 xScale, fx32 yScale, u8 mode);
|
|
|
|
s32 CalcDotProduct2D(s32 x0, s32 y0, s32 x1, s32 y1, u32 unused);
|
|
s32 CalcRadialAngle(u16 radius, s32 distance);
|
|
|
|
u32 SumBytes(const void *data, u32 size);
|
|
void EncodeData(void *data, u32 size, u32 seed);
|
|
void DecodeData(void *data, u32 size, u32 seed);
|
|
u16 CalcCRC16Checksum(const void *data, u32 dataLen);
|
|
void InitCRC16Table(enum HeapId heapID);
|
|
|
|
#endif // POKEPLATINUM_MATH_H
|