Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
d_bg_pc.h
Go to the documentation of this file.
1#ifndef D_BG_D_BG_PC_H
2#define D_BG_D_BG_PC_H
3
4#include "dolphin/types.h"
5
6struct sBgPc {
7 /* 0x00 */ u32 code0;
8 /* 0x04 */ u32 code1;
9 /* 0x08 */ u32 code2;
10 /* 0x0C */ u32 code3;
11 /* 0x10 */ u32 code4;
12}; // Size: 0x14
13
14#define BGPC_GET_BITS(code, shift, bits) \
15 ((code >> shift) & ((1 << bits) - 1))
16
17#define BGPC_CHECK_BIT(code, bit) \
18 (code & (1 << bit))
19
20class dBgPc {
21public:
22 void setCode(sBgPc&);
23
24 u8 getExit() const { return BGPC_GET_BITS(m_code.code0, 0, 6); }
25 u8 getPolyCol() const { return BGPC_GET_BITS(m_code.code0, 6, 8); }
26 u32 getObjThrough() const { return BGPC_CHECK_BIT(m_code.code0, 14); }
27 u32 getCamThrough() const { return BGPC_CHECK_BIT(m_code.code0, 15); }
28 u32 getLinkThrough() const { return BGPC_CHECK_BIT(m_code.code0, 16); }
30 u32 getHSStick() const { return BGPC_CHECK_BIT(m_code.code0, 18); }
32 u32 getRopeThrough() const { return BGPC_CHECK_BIT(m_code.code0, 20); }
33 u32 getHorseNoEntry() const { return BGPC_CHECK_BIT(m_code.code0, 21) != 0; }
34 u32 getShdwThrough() const { return BGPC_CHECK_BIT(m_code.code0, 22); }
35 u32 getBombThrough() const { return BGPC_CHECK_BIT(m_code.code0, 23); }
36 s32 getSpl() const { return BGPC_GET_BITS(m_code.code0, 24, 4); }
37 u32 getMagnet() const { return BGPC_GET_BITS(m_code.code0, 28, 2); }
39 u32 getMonkeyBars() const { return BGPC_CHECK_BIT(m_code.code0, 31) != 0; }
40
41 u8 getLinkNo() const { return BGPC_GET_BITS(m_code.code1, 0, 8); }
42 s32 getWallCode() const { return BGPC_GET_BITS(m_code.code1, 8, 4); }
43 u32 getAtt0Code() const { return BGPC_GET_BITS(m_code.code1, 12, 4); }
44 u32 getAtt1Code() const { return BGPC_GET_BITS(m_code.code1, 16, 3); }
45 u32 getGroundCode() const { return BGPC_GET_BITS(m_code.code1, 19, 5); }
48
49 u8 getCamMoveBG() const { return BGPC_GET_BITS(m_code.code2, 0, 8); }
50 u8 getRoomCam() const { return BGPC_GET_BITS(m_code.code2, 8, 8); }
51 u8 getRoomPath() const { return BGPC_GET_BITS(m_code.code2, 16, 8); }
52 u8 getRoomPathPnt() const { return BGPC_GET_BITS(m_code.code2, 24, 8); }
53
54 u8 getRoomInf() const { return BGPC_GET_BITS(m_code.code4, 0, 8); }
56 // BUG: Seems like this uses the same mask as maskNrm
58 u8 getSnd() const { return BGPC_GET_BITS(m_code.code4, 11, 8); }
59 u8 getRoom() const { return BGPC_GET_BITS(m_code.code4, 20, 8); }
60
61 /* 0x0 */ sBgPc m_code;
62};
63
64#endif /* D_BG_D_BG_PC_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:79
Definition d_bg_pc.h:20
void setCode(sBgPc &)
Definition d_bg_pc.cpp:8
u8 getSnd() const
Definition d_bg_pc.h:58
u32 getAttackThrough() const
Definition d_bg_pc.h:47
u32 getBoomerangThrough() const
Definition d_bg_pc.h:31
u32 getAtt1Code() const
Definition d_bg_pc.h:44
u8 getRoomInf() const
Definition d_bg_pc.h:54
u32 getGroundCode() const
Definition d_bg_pc.h:45
u32 getHSStick() const
Definition d_bg_pc.h:30
u32 getCamThrough() const
Definition d_bg_pc.h:27
u32 getMonkeyBars() const
Definition d_bg_pc.h:39
u8 getExit() const
Definition d_bg_pc.h:24
s32 getSpl() const
Definition d_bg_pc.h:36
u32 getShdwThrough() const
Definition d_bg_pc.h:34
u8 getLinkNo() const
Definition d_bg_pc.h:41
u32 getAtt0Code() const
Definition d_bg_pc.h:43
u32 getBombThrough() const
Definition d_bg_pc.h:35
u32 getIronBallThrough() const
Definition d_bg_pc.h:46
u8 getRoomPath() const
Definition d_bg_pc.h:51
s32 getWallCode() const
Definition d_bg_pc.h:42
u8 getRoom() const
Definition d_bg_pc.h:59
u32 getUnderwaterRoof() const
Definition d_bg_pc.h:38
u8 getRoomPathPnt() const
Definition d_bg_pc.h:52
u8 getCamMoveBG() const
Definition d_bg_pc.h:49
u32 getMagnet() const
Definition d_bg_pc.h:37
u32 getRopeThrough() const
Definition d_bg_pc.h:32
u32 getLinkThrough() const
Definition d_bg_pc.h:28
u32 getHorseNoEntry() const
Definition d_bg_pc.h:33
u8 getPolyCol() const
Definition d_bg_pc.h:25
u32 getArrowThrough() const
Definition d_bg_pc.h:29
u32 maskNrm()
Definition d_bg_pc.h:55
sBgPc m_code
Definition d_bg_pc.h:61
u32 getWtr()
Definition d_bg_pc.h:57
u32 getObjThrough() const
Definition d_bg_pc.h:26
u8 getRoomCam() const
Definition d_bg_pc.h:50
Definition d_bg_pc.h:6
u32 code2
Definition d_bg_pc.h:9
u32 code0
Definition d_bg_pc.h:7
u32 code4
Definition d_bg_pc.h:11
u32 code1
Definition d_bg_pc.h:8
u32 code3
Definition d_bg_pc.h:10
unsigned long u32
Definition types.h:10
signed long s32
Definition types.h:6
unsigned char u8
Definition types.h:8