summaryrefslogtreecommitdiff
path: root/include/m_Do/m_Do_main.h
blob: 03027c9bfd57e6b9babd35e88f67a458231359a1 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef M_DO_M_DO_MAIN_H
#define M_DO_M_DO_MAIN_H

#include "JSystem/JKernel/JKRExpHeap.h"
#include "dolphin/os/OSTime.h"

class JKRExpHeap;

void version_check();
s32 LOAD_COPYDATE(void*);

extern OSThread mainThread;

const int HeapCheckTableNum = 6;

class HeapCheck {
public:
    void CheckHeap1();
    s32 getUsedCount() const;
    void heapDisplay();

    u32& getUsedCountRef() { return mUsedCount; }
    u32& getTotalUsedSizeRef() { return mTotalUsedSize; }
    JKRExpHeap* getHeap() { return mHeap; }
    void setHeap(JKRExpHeap* i_heap) { mHeap = i_heap; }
    void setHeapSize(u32 i_size) { mTargetHeapSize = i_size; }
    s32 getMaxTotalUsedSize() { return mMaxTotalUsedSize; }
    s32 getMaxTotalFreeSize() { return mMaxTotalFreeSize; }
    const char* getName() const { return mName; }
    void saveRelBase() {
        mUsedCount = getUsedCount();
        mTotalUsedSize = mHeap->getTotalUsedSize();
    }

    u32 getRelUsedCount() const { return getUsedCount() - mUsedCount; }
    u32 getRelTotalUsedSize() const { return mHeap->getTotalUsedSize() - mTotalUsedSize; }

    /* 0x00 */ const char* mName;
    /* 0x04 */ JKRExpHeap* mHeap;
    /* 0x08 */ s32 mMaxTotalUsedSize;
    /* 0x0C */ s32 mMaxTotalFreeSize;
    /* 0x10 */ s32 field_0x10;
    /* 0x14 */ s32 field_0x14;
    /* 0x18 */ u32 mTargetHeapSize;
    /* 0x1C */ u32 mUsedCount;
    /* 0x20 */ u32 mTotalUsedSize;
};

struct mDoMain {
#if VERSION == VERSION_DEMO
    static int argument;
    static int gameHeapSize;
    static int archiveHeapSize;
#endif
    static char COPYDATE_STRING[];
    static u32 memMargin;
    static OSTime sPowerOnTime;
    static OSTime sHungUpTime;
    static s8 developmentMode;
};

#endif /* M_DO_M_DO_MAIN_H */