mirror of https://github.com/zeldaret/tmc.git
Merge pull request #689 from KEKW555/KEKW555-patch-3
This commit is contained in:
commit
d8a9e54fa9
|
@ -16,6 +16,7 @@ extern void GenericConfused(struct Entity_*);
|
||||||
extern void sub_08001290(struct Entity_*, u32);
|
extern void sub_08001290(struct Entity_*, u32);
|
||||||
extern void GenericKnockback(struct Entity_*);
|
extern void GenericKnockback(struct Entity_*);
|
||||||
extern u32 GetFuserId(struct Entity_*);
|
extern u32 GetFuserId(struct Entity_*);
|
||||||
|
#define GetFuserIdAndFuserTextId(ent) ((union SplitDWord)(*(MultiReturnTypeSingleEntityArg)(&GetFuserId))(ent))
|
||||||
extern u32 CheckPlayerInRegion(u32 centerX, u32 centerY, u32 radiusX, u32 radiusY);
|
extern u32 CheckPlayerInRegion(u32 centerX, u32 centerY, u32 radiusX, u32 radiusY);
|
||||||
extern u32 GravityUpdate(struct Entity_* entity, u32 gravity);
|
extern u32 GravityUpdate(struct Entity_* entity, u32 gravity);
|
||||||
enum {
|
enum {
|
||||||
|
|
|
@ -62,4 +62,6 @@ int MultiBoot(struct MultiBootParam* mp);
|
||||||
|
|
||||||
s32 Div(s32 num, s32 denom);
|
s32 Div(s32 num, s32 denom);
|
||||||
|
|
||||||
|
#define DivAndMod(num, denom) ((union SplitDWord)(*(MultiReturnTypeTwoS32Arg)(&Div))(num, denom))
|
||||||
|
|
||||||
#endif // SYSCALL_H
|
#endif // SYSCALL_H
|
||||||
|
|
|
@ -119,6 +119,17 @@ typedef struct {
|
||||||
s8 y;
|
s8 y;
|
||||||
} PACKED Coords8;
|
} PACKED Coords8;
|
||||||
|
|
||||||
|
union SplitDWord {
|
||||||
|
s64 DWORD;
|
||||||
|
u64 DWORD_U;
|
||||||
|
struct {
|
||||||
|
s32 LO, HI;
|
||||||
|
} HALF;
|
||||||
|
struct {
|
||||||
|
u32 LO, HI;
|
||||||
|
} HALF_U;
|
||||||
|
};
|
||||||
|
|
||||||
union SplitWord {
|
union SplitWord {
|
||||||
s32 WORD;
|
s32 WORD;
|
||||||
u32 WORD_U;
|
u32 WORD_U;
|
||||||
|
@ -152,4 +163,10 @@ struct Entity_;
|
||||||
#define BIT(bit) (1 << (bit))
|
#define BIT(bit) (1 << (bit))
|
||||||
#define IS_BIT_SET(value, bit) ((value)&BIT(bit))
|
#define IS_BIT_SET(value, bit) ((value)&BIT(bit))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Multi return function data type casts
|
||||||
|
*/
|
||||||
|
typedef u64 (*MultiReturnTypeSingleEntityArg)(struct Entity_*);
|
||||||
|
typedef s64 (*MultiReturnTypeTwoS32Arg)(s32, s32);
|
||||||
|
|
||||||
#endif // GLOBAL_H
|
#endif // GLOBAL_H
|
||||||
|
|
Loading…
Reference in New Issue