summaryrefslogtreecommitdiff
path: root/include/egg/util/eggException.h
blob: 8fa16b85ff64fc067f9168f284dd05f23e1a83b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef EGG_EXCEPTION_H
#define EGG_EXCEPTION_H

#include "common.h"
#include "nw4r/db/db_console.h"

namespace EGG {

class Heap;
class CoreStatus;

class Exception {
public:
    Exception(u16, u16, u16, EGG::Heap *, int);
    virtual ~Exception();

    static void ExceptionWaitTime(u32 time);
    static bool ExceptionCallback(nw4r::db::ConsoleHandle handle, void *);
    static bool ExceptionCallback_(nw4r::db::ConsoleHandle handle, void *);
    static Exception *create(u16, u16, u16, Heap *, int);

    static Exception *sException;

    static nw4r::db::ConsoleHandle sConsoleHandle;
    static void *sMapFileWorks;
    static u32 sMapFileNumMax;
    static u32 sCurrentMapFileNum;
    static volatile bool sUserCallbackMode;

    // inofficial

    static void (*sPreException)();
    static void (*sUserCallbackFunc)(CoreStatus *status);
    static s16 sExceptionDisplayInfo;

    static void SetUserCallback(void (*cb)(CoreStatus *status));
    static void SetPreExceptionCallback(void (*cb)());
    static void SetCallbackMode(bool);
    static void SetCallbackArgs(void *);
    static nw4r::db::ConsoleHandle GetConsoleHandle();
};

} // namespace EGG

#endif