pokefirered/include/util.h
2026-03-15 15:24:25 +01:00

25 lines
872 B
C

#ifndef GUARD_UTIL_H
#define GUARD_UTIL_H
#include "global.h"
#include "sprite.h"
#define HP_EMPTY 0
extern const u8 gMiscBlank_Gfx[]; // unused in Emerald
u8 CreateInvisibleSpriteWithCallback(void (*)(struct Sprite *));
void StoreWordInTwoHalfwords(u16 *, u32);
void LoadWordFromTwoHalfwords(u16 *, u32 *);
int CountTrailingZeroBits(u32 value);
u16 CalcCRC16(const u8 *data, u32 length);
u16 CalcCRC16WithTable(const u8 *data, u32 length);
u32 CalcByteArraySum(const u8 *data, u32 length);
void BlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u32 blendColor);
void BlendPalettesAt(u16 * palbuff, u16 blend_pal, u32 coefficient, s32 size);
void DoBgAffineSet(struct BgAffineDstData * dest, u32 texX, u32 texY, s16 srcX, s16 srcY, s16 sx, s16 sy, u16 alpha);
s32 SubtractClamped(s32 lowestVal, s32 highestVal, s32 currentVal, s32 delta);
#endif // GUARD_UTIL_H