Loading [MathJax]/extensions/MathZoom.js
Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
JSupport.h
Go to the documentation of this file.
1#ifndef JSUPPORT_H
2#define JSUPPORT_H
3
4#include <dolphin.h>
5
10template <typename T>
11T* JSUConvertOffsetToPtr(const void* ptr, u32 offset) {
12 if (offset == 0) {
13 return NULL;
14 } else {
15 return (T*)((s32)ptr + (s32)offset);
16 }
17}
18
23template <typename T>
24T* JSUConvertOffsetToPtr(const void* ptr, const void* offset) {
25 if (offset == NULL) {
26 return NULL;
27 } else {
28 return (T*)((s32)ptr + (s32)offset);
29 }
30}
31
32inline u8 JSULoNibble(u8 param_0) { return param_0 & 0x0f; }
33inline u8 JSUHiNibble(u8 param_0) {return param_0 >> 4; }
34
35inline u8 JSULoByte(u16 in) {
36 return in & 0xff;
37}
38
39inline u8 JSUHiByte(u16 in) {
40 return in >> 8;
41}
42
43inline u16 JSULoHalf(u32 param_0) {return param_0; }
44
45#endif
u8 JSUHiNibble(u8 param_0)
Definition JSupport.h:33
u8 JSULoNibble(u8 param_0)
Definition JSupport.h:32
u16 JSULoHalf(u32 param_0)
Definition JSupport.h:43
u8 JSUHiByte(u16 in)
Definition JSupport.h:39
u8 JSULoByte(u16 in)
Definition JSupport.h:35
T * JSUConvertOffsetToPtr(const void *ptr, u32 offset)
Definition JSupport.h:11
unsigned long u32
Definition types.h:9
unsigned short int u16
Definition types.h:7
signed long s32
Definition types.h:8
unsigned char u8
Definition types.h:5