This source file includes following definitions.
- startup
- get_effective_focal_length
- get_focal_length
- get_zoom_x
- get_vbatt_min
- get_vbatt_max
1
2
3
4
5
6
7
8
9
10 #include "lolevel.h"
11 #include "platform.h"
12 #include "core.h"
13 #include "keyboard.h"
14
15
16 extern long link_bss_start;
17 extern long link_bss_end;
18 extern void boot();
19
20
21 void startup()
22 {
23 long *bss = &link_bss_start;
24
25
26 if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)){
27 started();
28 shutdown();
29 }
30
31
32 while (bss<&link_bss_end)
33 *bss++ = 0;
34
35 boot();
36 }
37
38
39
40
41
42
43
44
45
46 static const int fl_tbl[] = {6400, 6800, 7600, 8800, 10500, 12300, 14100, 18500, 21200, 27100, 30700, 35100, 38400};
47
48
49 #define NUM_FL (int)(sizeof(fl_tbl)/sizeof(fl_tbl[0]))
50
51
52
53
54
55
56
57
58 #define CF_EFL 56250
59
60 const int zoom_points = NUM_FL;
61
62 int get_effective_focal_length(int zp) {
63 return (CF_EFL*get_focal_length(zp))/10000;
64 }
65
66 int get_focal_length(int zp) {
67 if (zp<0) return fl_tbl[0];
68 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1];
69 else return fl_tbl[zp];
70 }
71
72 int get_zoom_x(int zp) {
73 if (zp<1) return 10;
74 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0];
75 else return fl_tbl[zp]*10/fl_tbl[0];
76 }
77
78
79
80
81 long get_vbatt_min()
82 {
83 return 2200;
84 }
85
86 long get_vbatt_max()
87 {
88 return 3150;
89 }
90