Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JUTProcBar.h
Go to the documentation of this file.
1#ifndef JUTPROCBAR_H
2#define JUTPROCBAR_H
3
5#include "dolphin/os/OSTime.h"
6
7class JKRHeap;
8
14public:
15 class CTime {
16 public:
17 /* 802E7340 */ CTime() { clear(); }
18
19 void clear() {
20 mCost = 0;
21 field_0x8 = 0;
22 field_0xc = 0;
23 }
24
26 mR = param_0;
27 mG = param_1;
28 mB = param_2;
29 mTick = OSGetTick();
30 }
31
32 void end() {
33 mCost = ((OSGetTick() - mTick) * 8) / ((*(u32*)0x800000F8 / 4) / 125000);
34 if (mCost == 0) {
35 mCost = 1;
36 }
37 }
38
39 void accumePeek() {
40 if (++field_0xc >= 0x10 || mCost >= field_0x8) {
42 field_0xc = 0;
43 }
44 }
45
46 int calcBarSize(int p1, int p2) { return mCost * p1 / p2; }
47
48 /* 0x00 */ u32 mTick;
49 /* 0x04 */ u32 mCost;
50 /* 0x08 */ u32 field_0x8;
51 /* 0x0C */ u32 field_0xc;
52 /* 0x10 */ u8 mR;
53 /* 0x11 */ u8 mG;
54 /* 0x12 */ u8 mB;
55 };
56
57 class CParamSet {
58 public:
59 /* 0x00 */ int mBarWidth;
60 /* 0x04 */ int mPosX;
61 /* 0x08 */ int mPosY;
62 /* 0x0C */ int mWidth;
63 /* 0x10 */ int mUserPosition;
64
65 void setBarWidth(int width) { mBarWidth = width; }
66 void setPosition(int x, int y) {
67 mPosX = x;
68 mPosY = y;
69 }
70 void setWidth(int width) { mWidth = width; }
72 };
73
74 /* 802E5888 */ JUTProcBar();
75 /* 802E599C */ ~JUTProcBar();
76 /* 802E59E0 */ static JUTProcBar* create();
77 /* 802E5A28 */ static void destroy();
78 /* 802E5A60 */ static void clear();
79 /* 802E5B30 */ void bar_subroutine(int, int, int, int, int, int, int, JUtility::TColor,
81 /* 802E5CC4 */ void adjustMeterLength(u32, f32*, f32, f32, int*);
82 /* 802E5E08 */ void draw();
83 /* 802E5E3C */ void drawProcessBar();
84 /* 802E6FA0 */ void drawHeapBar();
85
86 void cpuStart() { mCpu.start(255, 129, 30); }
87 void cpuEnd() { mCpu.end(); }
88 void gpWaitStart() { mGpWait.start(255, 129, 30); }
89 void gpWaitEnd() { mGpWait.end(); }
90 void gpStart() { mGp.start(255, 129, 30); }
91 void gpEnd() { mGp.end(); }
92 void wholeLoopStart() { mWholeLoop.start(255, 129, 30); }
94 void idleStart() { mIdle.start(255, 129, 30); }
95 void idleEnd() { mIdle.end(); }
99
100 static JUTProcBar* getManager() { return sManager; }
101
103
104private:
105 /* 0x000 */ CTime mIdle;
106 /* 0x014 */ CTime mGp;
107 /* 0x028 */ CTime mCpu;
108 /* 0x03C */ CTime mGpWait;
109 /* 0x050 */ CTime mWholeLoop;
110 /* 0x064 */ CTime mUsers[8];
111 /* 0x104 */ int mCostFrame;
112 /* 0x108 */ int field_0x108;
113 /* 0x10C */ bool mVisible;
114 /* 0x110 */ int field_0x110;
115 /* 0x114 */ CParamSet mParams;
116 /* 0x128 */ int field_0x128;
117 /* 0x12C */ JKRHeap* mWatchHeap;
118 /* 0x130 */ bool mHeapBarVisible;
119};
120
121#endif /* JUTPROCBAR_H */
asm OSTick OSGetTick(void)
Definition OSTime.c:25
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition JKRHeap.h:16
Definition JUTProcBar.h:57
void setBarWidth(int width)
Definition JUTProcBar.h:65
void setPosition(int x, int y)
Definition JUTProcBar.h:66
int mUserPosition
Definition JUTProcBar.h:63
int mPosY
Definition JUTProcBar.h:61
int mWidth
Definition JUTProcBar.h:62
int mBarWidth
Definition JUTProcBar.h:59
void setUserPosition(int userPos)
Definition JUTProcBar.h:71
void setWidth(int width)
Definition JUTProcBar.h:70
int mPosX
Definition JUTProcBar.h:60
Definition JUTProcBar.h:15
u32 field_0xc
Definition JUTProcBar.h:51
u8 mG
Definition JUTProcBar.h:53
u32 field_0x8
Definition JUTProcBar.h:50
int calcBarSize(int p1, int p2)
Definition JUTProcBar.h:46
CTime()
Definition JUTProcBar.h:17
u32 mTick
Definition JUTProcBar.h:48
u8 mB
Definition JUTProcBar.h:54
void clear()
Definition JUTProcBar.h:19
u32 mCost
Definition JUTProcBar.h:49
void end()
Definition JUTProcBar.h:32
void start(u8 param_0, u8 param_1, u8 param_2)
Definition JUTProcBar.h:25
u8 mR
Definition JUTProcBar.h:52
void accumePeek()
Definition JUTProcBar.h:39
Definition JUTProcBar.h:13
static JUTProcBar * sManager
Definition JUTProcBar.h:102
void bar_subroutine(int, int, int, int, int, int, int, JUtility::TColor, JUtility::TColor)
Definition JUTProcBar.cpp:73
int field_0x110
Definition JUTProcBar.h:114
~JUTProcBar()
Definition JUTProcBar.cpp:33
void setVisibleHeapBar(bool visible)
Definition JUTProcBar.h:98
static void destroy()
Definition JUTProcBar.cpp:46
void cpuEnd()
Definition JUTProcBar.h:87
static void clear()
Definition JUTProcBar.cpp:61
CTime mGp
Definition JUTProcBar.h:106
int mCostFrame
Definition JUTProcBar.h:111
void cpuStart()
Definition JUTProcBar.h:86
void gpWaitEnd()
Definition JUTProcBar.h:89
static JUTProcBar * create()
Definition JUTProcBar.cpp:38
void draw()
Definition JUTProcBar.cpp:118
CTime mWholeLoop
Definition JUTProcBar.h:109
void wholeLoopStart()
Definition JUTProcBar.h:92
void idleStart()
Definition JUTProcBar.h:94
void wholeLoopEnd()
Definition JUTProcBar.h:93
void gpEnd()
Definition JUTProcBar.h:91
int field_0x108
Definition JUTProcBar.h:112
bool mVisible
Definition JUTProcBar.h:113
void setCostFrame(int frame)
Definition JUTProcBar.h:96
void drawProcessBar()
Definition JUTProcBar.cpp:124
void gpStart()
Definition JUTProcBar.h:90
JKRHeap * mWatchHeap
Definition JUTProcBar.h:117
void idleEnd()
Definition JUTProcBar.h:95
CTime mUsers[8]
Definition JUTProcBar.h:110
CTime mGpWait
Definition JUTProcBar.h:108
CTime mCpu
Definition JUTProcBar.h:107
int field_0x128
Definition JUTProcBar.h:116
CParamSet mParams
Definition JUTProcBar.h:115
JUTProcBar()
Definition JUTProcBar.cpp:7
static JUTProcBar * getManager()
Definition JUTProcBar.h:100
void gpWaitStart()
Definition JUTProcBar.h:88
void drawHeapBar()
Definition JUTProcBar.cpp:287
void adjustMeterLength(u32, f32 *, f32, f32, int *)
Definition JUTProcBar.cpp:89
bool mHeapBarVisible
Definition JUTProcBar.h:118
CTime mIdle
Definition JUTProcBar.h:105
void setVisible(bool visible)
Definition JUTProcBar.h:97
double x double x
Definition e_atan2.c:58
double x double y
Definition e_atan2.c:58
Definition TColor.h:12
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
unsigned char u8
Definition types.h:8