Files
tp/include/JSystem/JSupport/JSupport.h
T

28 lines
529 B
C++
Raw Normal View History

2022-01-12 19:14:44 +01:00
#ifndef JSUPPORT_H
#define JSUPPORT_H
2023-02-26 17:50:56 -08:00
2022-01-12 19:14:44 +01:00
template <typename T>
T* JSUConvertOffsetToPtr(const void* ptr, const void* offset) {
2022-10-04 17:29:53 -07:00
if (offset == NULL) {
2022-01-12 19:14:44 +01:00
return NULL;
} else {
2022-01-12 19:23:08 +01:00
return (T*)((s32)ptr + (s32)offset);
2022-01-12 19:14:44 +01:00
}
}
inline u8 JSULoNibble(u8 param_0) { return param_0 & 0x0f; }
inline u8 JSUHiNibble(u8 param_0) {return param_0 >> 4; }
2023-02-26 17:50:56 -08:00
inline u8 JSULoByte(u16 in) {
return in & 0xff;
}
inline u8 JSUHiByte(u16 in) {
return in >> 8;
}
inline u16 JSULoHalf(u32 param_0) {return param_0; }
2022-01-12 19:14:44 +01:00
#endif