source: trunk/platform/a560/main.c @ 511

Revision 281, 1.8 KB checked in by EWAVR, 5 years ago (diff)

+ added PROPCASE_SHOOTING_MODE propertycase description

Line 
1#include "../generic/main.c"
2
3long get_vbatt_min()
4{
5    return 2250;
6}
7
8long get_vbatt_max()
9{
10    return 2550;
11}
12
13// aperture 2.6 2.8 3.2 3.5 4.0 4.5 5.0 5.5
14static const int fl_tbl[] = {5800, 6600, 7900, 9900, 12700, 16000, 19600, 23200};
15#define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0]))
16#define CF_EFL 60345
17
18const int zoom_points = NUM_FL;
19
20int get_effective_focal_length(int zp) {
21    return (CF_EFL*get_focal_length(zp))/10000;
22}
23
24int get_focal_length(int zp) {
25    if (zp<0) return fl_tbl[0];
26    else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1];
27    else return fl_tbl[zp];
28}
29
30int get_zoom_x(int zp) {
31    if (zp<1) return 10;
32    else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0];
33    else return fl_tbl[zp]*10/fl_tbl[0];
34}
35
36static struct {
37        int hackmode;
38        int canonmode;
39} modemap[] = {
40    { MODE_AUTO,               32768 },
41    { MODE_P,                  32772 },
42//  { MODE_M,                  32769 },
43    { MODE_VIDEO_STD,          2597  },
44    { MODE_VIDEO_SPEED,        2598  },
45    { MODE_VIDEO_COMPACT,      2599  },
46    { MODE_SCN_AQUARIUM,       16407 },
47    { MODE_SCN_NIGHT,          16398 },
48    { MODE_SCN_GRASS,          16402 },
49    { MODE_SCN_SNOW,           16403 },
50    { MODE_SCN_BEACH,          16404 },
51    { MODE_SCN_FIREWORK,       16405 },
52    { MODE_INDOOR,             32785 },
53    { MODE_KIDS_PETS,          32784 },
54    { MODE_NIGHT_SNAPSHOT,     32779 },
55    { MODE_LANDSCAPE,          32780 },
56    { MODE_PORTRAIT,           32781 },
57};
58#define MODESCNT (sizeof(modemap)/sizeof(modemap[0]))
59
60int mode_get() {
61    int mode, i, t=0xFF;
62    mode = (playrec_mode==1 || playrec_mode==2) ? MODE_REC : MODE_PLAY;
63    _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4);
64    for (i=0; i<MODESCNT; ++i) {
65        if (modemap[i].canonmode == t) {
66            return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK));
67        }
68    }
69    return (mode);
70}
Note: See TracBrowser for help on using the repository browser.