Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JUTAssert.h
Go to the documentation of this file.
1#ifndef JUTASSERT_H
2#define JUTASSERT_H
3
4#include "dolphin/os.h"
5
6#ifdef DEBUG
7#define JUT_ASSERT(LINE, COND) \
8 if ((COND) == 0) { \
9 JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, #COND); \
10 OSPanic(__FILE__, LINE, "Halt"); \
11 }
12
13#define JUT_ASSERT_REPORT(LINE, COND) \
14 if ((COND) == 0) { \
15 JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, #COND); \
16 OSPanic(__FILE__, LINE, "Halt"); \
17 OSReport("[%s] %d\n", __FILE__, __LINE__); \
18 }
19
20#define JUT_PANIC(LINE, TEXT) \
21 JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, TEXT); \
22 OSPanic(__FILE__, LINE, "Halt");
23
24#define JUT_WARN(LINE, ...) \
25 JUTAssertion::setWarningMessage_f(JUTAssertion::getSDevice(), __FILE__, LINE, __VA_ARGS__); \
26
27#define JUT_LOG(LINE, ...) \
28 JUTAssertion::setLogMessage_f(JUTAssertion::getSDevice(), __FILE__, LINE, __VA_ARGS__)
29
30#define JUT_CONFIRM(LINE, COND) \
31 JUTAssertion::setConfirmMessage(JUTAssertion::getSDevice(), __FILE__, LINE, COND, #COND)
32
33#else
34#define JUT_ASSERT(...)
35#define JUT_ASSERT_REPORT(...)
36#define JUT_PANIC(...)
37#define JUT_WARN(...)
38#define JUT_LOG(...)
39#define JUT_CONFIRM(...)
40#endif
41
42namespace JUTAssertion {
43 /* 802E495C */ void create();
44 /* 802E4960 */ u32 flush_subroutine();
45 /* 802E499C */ void flushMessage();
46 /* 802E4A54 */ void flushMessage_dbPrint();
47 /* 802E4C34 */ void setVisible(bool);
48 /* 802E4C3C */ void setMessageCount(int);
49
51 void showAssert(u32 device, const char * file, int line, const char * assertion);
52 void setWarningMessage_f(u32 device, char * file, int line, const char * fmt, ...);
53 void setLogMessage_f(u32 device, char* file, int line, const char* fmt, ...);
54};
55
56extern bool sAssertVisible;
57
58#endif /* JUTASSERT_H */
bool sAssertVisible
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition JUTAssert.cpp:12
void setWarningMessage_f(u32 device, char *file, int line, const char *msg,...)
Definition JUTAssert.cpp:175
u32 flush_subroutine()
Definition JUTAssert.cpp:39
void setMessageCount(int msg_count)
Definition JUTAssert.cpp:221
void showAssert(u32 device, const char *file, int line, const char *msg)
Definition JUTAssert.cpp:146
void flushMessage_dbPrint()
Definition JUTAssert.cpp:68
void create()
Definition JUTAssert.cpp:15
void flushMessage()
Definition JUTAssert.cpp:56
u32 getSDevice()
Definition JUTAssert.cpp:81
void setVisible(bool visible)
Definition JUTAssert.cpp:215
void setLogMessage_f(u32 device, char *file, int line, const char *msg,...)
Definition JUTAssert.cpp:207
unsigned long u32
Definition types.h:10