summaryrefslogtreecommitdiff
path: root/libs/JSystem/JAudio2/JASProbe.cpp
blob: 6e3d3c35e42860e6661a737415384e1b37919575 (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
63
64
65
66
67
68
69
70
71
//
// Generated By: dol2asm
// Translation Unit: JASProbe
//

#include "JSystem/JAudio2/JASProbe.h"
#include "dolphin/os.h"

//
// Types:
//

//
// Forward References:
//

//
// External References:
//

//
// Declarations:
//
/* 80290D74-80290DC4 28B6B4 0050+00 1/1 0/0 0/0 .text            start__8JASProbeFPCc */
void JASProbe::start(char const* name) {
	volatile BOOL interrupts = OSDisableInterrupts();
	mName          = name;
	mStartTime     = OSGetTime();
	OSRestoreInterrupts(interrupts);
}

/* ############################################################################################## */

/* 80290DC4-80290EE4 28B704 0120+00 1/1 0/0 0/0 .text            stop__8JASProbeFv */
void JASProbe::stop() {
	volatile int interrupts = OSDisableInterrupts();
	_08            = (u32)OSGetTime() - mStartTime;
	_08 /= OS_TIMER_CLOCK / 59.94f;
	if (_10 < _08 && 100 < _1A8) {
		_10 = _08;
	}
	_0C             = _0C * 0.96f + _08 * 0.04f;
	u32 resultIndex = _1A8 % 100;
	_14 -= _18[resultIndex];
	_18[resultIndex] = _08;
	_14 += _08;
	_1A8++;
	OSRestoreInterrupts(interrupts);
}

/* ############################################################################################## */
/* 80431620-80431660 05E340 0040+00 2/2 0/0 0/0 .bss             sProbeTable__8JASProbe */
JASProbe* JASProbe::sProbeTable[16];

/* 80290EE4-80290F24 28B824 0040+00 0/0 7/7 0/0 .text            start__8JASProbeFlPCc */
void JASProbe::start(s32 index, char const* name) {
    if (index < 16) {
        if (sProbeTable[index] != NULL) {
            sProbeTable[index]->start(name);
        }
    }
}

/* 80290F24-80290F64 28B864 0040+00 0/0 6/6 0/0 .text            stop__8JASProbeFl */
void JASProbe::stop(s32 index) {
    if (index < 16) {
        if (sProbeTable[index] != NULL) {
            sProbeTable[index]->stop();
        }
    }
}