source: trunk/platform/a3000/shooting.c @ 1372

Revision 1372, 4.0 KB checked in by philmoz, 19 months ago (diff)

A3000 port from ERR99 - http://chdk.setepontos.com/index.php?topic=650.msg74533#msg74533
Firmware versions 1.00b, 1.00c and 1.00d.

  • Property svn:eol-style set to native
Line 
1#define PARAM_FILE_COUNTER      0x3A
2#define PARAM_EXPOSURE_COUNTER  0x02
3
4#include "platform.h"
5
6// These F-numbers are the "mock" values shown by the cam.
7// They're linked to FL (zoom) and ND8 filter.
8// aperture_sizes_table[].id is just a serial number.
9const ApertureSize aperture_sizes_table[] = { // PROPCASE 23 at different zoom steps
10    {  9, 274, "2.7" },
11    { 10, 297, "2.8" },
12    { 11, 321, "3.2" },
13    { 12, 349, "3.5" },
14    { 13, 379, "4.0" },
15    { 14, 413, "4.5" },
16    { 15, 447, "5.0" },
17    { 16, 483, "5.6" },
18        /* With ND Filter*/
19        { 17, 562, "8.0" },
20        { 18, 585, "8.0" },
21        { 19, 609, "9.0" },
22        { 20, 637, "10.0" },
23        { 21, 667, "11.0" },
24        { 22, 701, "13.0" },
25        { 23, 735, "14.0" },
26};
27
28const ShutterSpeed shutter_speeds_table[] = {
29    { -12, -384, "15", 15000000 },
30    { -11, -352, "13", 13000000 },
31    { -10, -320, "10", 10000000 },
32    {  -9, -288, "8",   8000000 },
33    {  -8, -256, "6",   6000000 },
34    {  -7, -224, "5",   5000000 },
35    {  -6, -192, "4",   4000000 },
36    {  -5, -160, "3.2", 3200000 },
37    {  -4, -128, "2.5", 2500000 },
38    {  -3,  -96, "2",   2000000 },
39    {  -2,  -64, "1.6", 1600000 },
40    {  -1,  -32, "1.3", 1300000 },
41    {   0,    0, "1",   1000000 },
42    {   1,   31, "0.8",  800000 },
43    {   2,   71, "0.6",  600000 },
44    {   3,   87, "0.5",  500000 },
45    {   4,  128, "0.4",  400000 }, //not checked for A3000
46    {   5,  147, "0.3",  300000 },
47    {   6,  178, "1/4",  250000 },
48    {   7,  224, "1/5",  200000 }, //not checked for A3000
49    {   8,  250, "1/6",  166667 },
50    {   9,  291, "1/8",  125000 },
51    {  10,  334, "1/10", 100000 },
52    {  11,  359, "1/13",  76923 },
53    {  12,  376, "1/15",  66667 },
54    {  13,  421, "1/20",  50000 },
55    {  14,  448, "1/25",  40000 }, //not checked for A3000
56    {  15,  480, "1/30",  33333 },
57    {  16,  525, "1/40",  25000 },
58    {  17,  529, "1/50",  20000 },
59    {  18,  574, "1/60",  16667 },
60    {  19,  615, "1/80",  12500 },
61    {  20,  652, "1/100", 10000 },
62    {  21,  672, "1/125",  8000 }, //not checked for A3000
63    {  22,  702, "1/160",  6250 },
64    {  23,  736, "1/200",  5000 }, //not checked for A3000
65    {  24,  761, "1/250",  4000 },
66    {  25,  815, "1/320",  3125 },
67    {  26,  827, "1/400",  2500 },
68    {  27,  864, "1/500",  2000 },
69    {  28,  906, "1/640",  1563 },
70    {  29,  915, "1/800",  1250 },
71    {  30,  971, "1/1000", 1000 },
72    {  31,  992, "1/1250",  800 }, //not checked for A3000
73    {  32, 1024, "1/1600",  625 }  //not checked for A3000
74};
75
76const ISOTable iso_table[] = {
77    {  0,     0,  "Auto", -1},
78    {  1,   100,   "100", -1},
79    {  2,   200,   "200", -1},
80    {  3,   400,   "400", -1},
81    {  4,   800,   "800", -1},
82    {  5,  1600,  "1600", -1}
83};       
84
85static const CapturemodeMap modemap[] = { // prop 49
86        { MODE_AUTO,               32768  },
87        { MODE_P,                  32772  },
88        { MODE_EASY,               33314  },
89        { MODE_PORTRAIT,           32783  },
90        { MODE_LANDSCAPE,              32782  },
91        { MODE_NIGHT_SCENE,        32781  },
92        { MODE_KIDS_PETS,          32786  },
93        { MODE_INDOOR,                 32787  },
94        { MODE_SCN_FACE_SELF_TIMER,16936  },
95        { MODE_SCN_LOWLIGHT,       16417  },
96        { MODE_SCN_SUPER_VIVID,    16934  },
97        { MODE_SCN_POSTER_EFFECT,  16935  },
98        { MODE_SCN_BEACH,          16407  },
99        { MODE_SCN_FOLIAGE,                16405  },
100        { MODE_SCN_SNOW,           16406  },
101    { MODE_SCN_FIREWORK,           16408  },
102    { MODE_SCN_LONG_SHUTTER,   16390  }
103};
104
105
106#include "../generic/shooting.c"
107
108const int dof_tbl[] = {6200, 7780, 9410, 11370, 13790, 16770, 20180, 24800};
109const int dof_tbl_size = sizeof(dof_tbl)/sizeof(dof_tbl[0]);
110
111long get_file_next_counter() {
112    return get_file_counter();
113}
114
115long get_target_file_num() {
116    long n;
117   
118    n = get_file_next_counter();
119    n = (n>>4)&0x3FFF;
120    return n;
121}
122
123#if defined(CAM_DATE_FOLDER_NAMING)
124void get_target_dir_name(char *out)
125{
126        extern void _GetImageFolder(char*,int,int,int);
127        out[0] = 'A';
128        _GetImageFolder(out+1,get_file_next_counter(),0x400,time(NULL));
129}
130#else
131long get_target_dir_num() {
132        long n;
133       
134        n = get_file_next_counter();
135        n = (n>>18)&0x3FF;
136        return n;
137}
138#endif
139
140
141int circle_of_confusion = 7;
142
Note: See TracBrowser for help on using the repository browser.