| 77 | } |
| 78 | |
| 79 | void SysDebug::ctrlDebugMode() { |
| 80 | if(mDrawPage) { |
| 81 | JUTProcBar::getManager()->setVisible(true); |
| 82 | f32 cpuFrameTime = JUTProcBar::getManager()->getCpuCost() / 16666.666f; |
| 83 | f32 gpuFrameTime = JUTProcBar::getManager()->getGpCost() / 16666.666f; |
| 84 | |
| 85 | if(mCPUTimes) { |
| 86 | mCPUTimes[mBufferIdx] = cpuFrameTime; |
| 87 | mGPUTimes[mBufferIdx] = gpuFrameTime; |
| 88 | mBufferIdx++; |
| 89 | if (mBufferIdx >= 60) |
| 90 | mDrawProcTime = true; |
| 91 | |
| 92 | mBufferIdx = mBufferIdx % 60; |
| 93 | } |
| 94 | |
| 95 | if(mPageNo >= 0 && mPageNo <= 2) { |
| 96 | if(mGamePad.testTrigger(JUTGamePad::L)) { |
| 97 | if(mPageNo > 0) |
| 98 | mPageNo--; |
| 99 | else |
| 100 | mPageNo = 2; |
| 101 | } |
| 102 | if(mGamePad.testTrigger(JUTGamePad::R)) { |
| 103 | if(mPageNo < 2) |
| 104 | mPageNo++; |
| 105 | else |
| 106 | mPageNo = 0; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | switch (mPageNo) |
| 111 | { |
| 112 | case 0: |
| 113 | { |
| 114 | if(mGamePad.testTrigger(JUTGamePad::Y)) { |
| 115 | if(mDrawUserTime) |
| 116 | mDrawUserTime = false; |
| 117 | else |
| 118 | mDrawUserTime = true; |
| 119 | } |
| 120 | switch(mProcTimeType) { |
| 121 | case 0: |
| 122 | { |
| 123 | if (mGamePad.testTrigger(JUTGamePad::CSTICK_DOWN)) |
| 124 | mProcTimeType = 1; |
| 125 | break; |
| 126 | } |
| 127 | case 1: |
| 128 | { |
| 129 | mProcTimeFrames++; |
| 130 | |
| 131 | if(cpuFrameTime > mCPUTimeMax) |
| 132 | mCPUTimeMax = cpuFrameTime; |
| 133 | mCPUTime += cpuFrameTime; |
| 134 | |
| 135 | if(gpuFrameTime > mAllTimeMax) |
| 136 | mAllTimeMax = gpuFrameTime; |
no test coverage detected