-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathmain.c
63 lines (44 loc) · 1.05 KB
/
main.c
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
#include <pge/pge.h>
int main(int argc, char*argv[])
{
pgeGfxInit(PGE_PIXEL_FORMAT_8888);
pgeControlsInit();
pgeNetInit();
pgeUtilsNetDialogInit();
while(pgeRunning())
{
pgeGfxStartDrawing();
pgeGfxClearScreen(0);
pgeGfxEndDrawing();
int result = pgeUtilsNetDialogUpdate();
if(result != -1)
break;
pgeGfxSwapBuffers(PGE_WAIT_VSYNC);
}
pspDebugScreenInit();
pspDebugScreenSetXY(0, 2);
pspDebugScreenPrintf("Downloading update...");
//download file
pgeNetGetFile("http://drakon.ixan.net/psp/Lamecraft.zip", "../Lamecraft.zip");
//installing file
pspDebugScreenSetXY(0, 4);
pspDebugScreenPrintf("Installing update...");
pgeZip* zipFiles = pgeZipOpen("../Lamecraft.zip");
chdir("..");
pgeZipExtract(zipFiles, NULL);
pgeZipClose(zipFiles);
pgeFileRemove("Lamecraft.zip");
pspDebugScreenSetXY(0, 6);
pspDebugScreenPrintf("Installation done - press X to exit");
while(1)
{
pgeControlsUpdate();
if(pgeControlsHeld(PGE_CTRL_CROSS))
{
break;
}
}
pgeNetShutdown();
pgeExit();
return 0;
}