-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
73 lines (64 loc) · 1.17 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
64
65
66
67
68
69
70
71
72
73
#include <stddef.h>
#include <gem.h>
#include "main.h"
#include "clock.h"
#include "finish.h"
int scene = 0;
int main(void) {
appl_init();
//Hide cursor
graf_mouse(256, NULL);
init();
VdiHdl iGraf = graf_handle(NULL, NULL, NULL, NULL);
char echo[2];
short echo_xy[2] = {0, 0};
do {
update();
vsm_string(iGraf, 1, 0, echo_xy, echo);
} while(echo[0] != 'x');
deinit();
appl_exit();
return 0;
}
void update(void) {
int ns;
switch(scene) {
case 0:
ns = update_clock();
break;
case 1:
ns = update_finish();
break;
default:
return;
}
if (ns != scene) {
deinit();
scene = ns;
init();
}
}
void deinit(void) {
switch(scene) {
case 0:
deinit_clock();
break;
case 1:
deinit_finish();
break;
default:
return;
}
}
void init(void) {
switch(scene) {
case 0:
init_clock();
break;
case 1:
init_finish();
break;
default:
return;
}
}