-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
59 lines (48 loc) · 1.31 KB
/
Copy pathmain.cpp
File metadata and controls
59 lines (48 loc) · 1.31 KB
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
#include "tinyme.h"
#include <pspdisplay.h>
#include <pspctrl.h>
PSP_MODULE_INFO("tiny-sample", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_VFPU | PSP_THREAD_ATTR_USER);
PSP_HEAP_SIZE_KB(-1024);
static volatile u32* mem = nullptr;
#define scCounter (mem[0])
#define meCounter (mem[1])
#define meStop (mem[2])
float meFloat = 0.4f;
void meLoop() {
meFloat += 0.5f;
do {
meDcacheWritebackInvalidateAll();
} while(!mem);
do {
meCounter++;
} while(!meStop);
meHalt();
}
int main() {
scePowerSetClockFrequency(333, 333, 166);
meGetUncached32(&mem, 4);
pspDebugScreenInit();
pspDebugScreenSetXY(0, 1);
pspDebugScreenPrintf("Init me...");
meInit();
SceCtrlData ctl;
do {
sceCtrlPeekBufferPositive(&ctl, 1);
pspDebugScreenSetXY(0, 1);
pspDebugScreenPrintf("sc counter 0x%x ", scCounter++);
pspDebugScreenSetXY(0, 2);
pspDebugScreenPrintf("me counter 0x%x ", meCounter);
pspDebugScreenSetXY(0, 3);
pspDebugScreenPrintf("me float %f ", meFloat);
sceDisplayWaitVblankStart();
} while(!(ctl.Buttons & PSP_CTRL_HOME));
meStop = true;
pspDebugScreenClear();
pspDebugScreenSetXY(0, 1);
pspDebugScreenPrintf("Exiting...");
sceKernelDelayThread(100000);
meGetUncached32(&mem, 0);
sceKernelExitGame();
return 0;
}