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

24 lines
382 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
#include "dolphin/types.h"
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
}
}
2023-02-26 17:50:56 -08:00
inline u8 JSULoByte(u16 in) {
return in & 0xff;
}
inline u8 JSUHiByte(u16 in) {
return in >> 8;
}
2022-01-12 19:14:44 +01:00
#endif