MCPcopy Create free account
hub / github.com/doldecomp/mkdd / SysDebug

Method SysDebug

src/Kaneshige/SysDebug.cpp:28–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28SysDebug::SysDebug() : mGamePad(JUTGamePad::Port2) {
29 mDrawPage = false;
30 mPageNo = 0;
31
32 if(OSGetConsoleSimulatedMemSize() >= 0x3000000) {
33 void *mem = JKRHeap::getRootHeap()->alloc(0xd00090, -4);
34 mDebugHeap = JKRExpHeap::create(mem, 0xd00090, nullptr, false);
35 }
36 else {
37 mDebugHeap = nullptr;
38 }
39 mBackupHeap = nullptr;
40 mSelectedHeap = JKRHeap::getRootHeap();
41 mGroupIdx = 0;
42 clrAllUserTimeLabel();
43 mDrawPosX = 16;
44 mDrawPosY = 40;
45 mCharWidth = 12;
46 mCharHeight = 12;
47 mDrawUserTime = false;
48 mProcTimeType = 0;
49 mProcTimeFrames = 0;
50 mCPUTime = 0.0f;
51 mCPUTimeMax = 0.0f;
52 mAllTime = 0.0f;
53 mAllTimeMax = 0.0f;
54 mBufferIdx = 0;
55 mDrawProcTime = false;
56 mCPUTimes = nullptr;
57 mGPUTimes = nullptr;
58 mUsrPageNo = 0;
59 mOrtho = nullptr;
60
61 if(mDebugHeap) {
62 beginDebugHeap();
63 JUTResFont *font = new JUTResFont(&JUTResFONT_Ascfont_fix12, mDebugHeap);
64 JUTDbPrint::getManager()->changeFont(font);
65 mOrtho = new J2DOrthoGraph(0.0f, 0.0f, 640.0f, 480.0f, -1.0f, 1.0f);
66 JUTColor color(0, 0, 0, 128);
67 mOrtho->setColor(color);
68 mCPUTimes = new f32[60];
69 mGPUTimes = new f32[60];
70
71 for(int i =0 ; i < 60; i++) {
72 mCPUTimes[i] = 0.0f;
73 mGPUTimes[i] = 0.0f;
74 }
75 endDebugHeap();
76 }
77}
78
79void SysDebug::ctrlDebugMode() {
80 if(mDrawPage) {

Callers

nothing calls this directly

Calls 6

getRootHeapFunction · 0.85
changeFontMethod · 0.80
createFunction · 0.50
allocMethod · 0.45
setColorMethod · 0.45

Tested by

no test coverage detected