- Timestamp:
- 02/02/12 08:21:50 (16 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 95 edited
-
core/Makefile (modified) (1 diff)
-
core/conf.c (modified) (2 diffs)
-
core/curves.c (modified) (1 diff)
-
core/gui.c (modified) (3 diffs)
-
core/gui_osd.c (modified) (3 diffs)
-
core/kbd.c (modified) (3 diffs)
-
core/luascript.c (modified) (6 diffs)
-
core/shooting.c (added)
-
include/lolevel.h (modified) (1 diff)
-
include/platform.h (modified) (5 diffs)
-
lib/ubasic/ubasic.c (modified) (1 diff)
-
platform/a1100/shooting.c (modified) (1 diff)
-
platform/a2000/shooting.c (modified) (1 diff)
-
platform/a3000/shooting.c (modified) (1 diff)
-
platform/a3300/shooting.c (modified) (1 diff)
-
platform/a410/shooting.c (modified) (1 diff)
-
platform/a430/shooting.c (modified) (1 diff)
-
platform/a450/shooting.c (modified) (1 diff)
-
platform/a460/shooting.c (modified) (1 diff)
-
platform/a470/shooting.c (modified) (1 diff)
-
platform/a480/shooting.c (modified) (1 diff)
-
platform/a490/shooting.c (modified) (1 diff)
-
platform/a495/shooting.c (modified) (1 diff)
-
platform/a530/shooting.c (modified) (1 diff)
-
platform/a540/shooting.c (modified) (1 diff)
-
platform/a550/shooting.c (modified) (1 diff)
-
platform/a560/shooting.c (modified) (1 diff)
-
platform/a570/shooting.c (modified) (1 diff)
-
platform/a580/shooting.c (modified) (1 diff)
-
platform/a590/shooting.c (modified) (1 diff)
-
platform/a610/shooting.c (modified) (1 diff)
-
platform/a620/shooting.c (modified) (1 diff)
-
platform/a630/shooting.c (modified) (1 diff)
-
platform/a640/shooting.c (modified) (1 diff)
-
platform/a650/shooting.c (modified) (1 diff)
-
platform/a700/shooting.c (modified) (1 diff)
-
platform/a710/shooting.c (modified) (1 diff)
-
platform/a720/shooting.c (modified) (1 diff)
-
platform/d10/shooting.c (modified) (1 diff)
-
platform/g10/shooting.c (modified) (1 diff)
-
platform/g11/shooting.c (modified) (1 diff)
-
platform/g12/shooting.c (modified) (2 diffs)
-
platform/g7/shooting.c (modified) (1 diff)
-
platform/g9/shooting.c (modified) (1 diff)
-
platform/generic/shooting.c (modified) (2 diffs)
-
platform/generic/wrappers.c (modified) (1 diff)
-
platform/ixus1000_sd4500/shooting.c (modified) (1 diff)
-
platform/ixus100_sd780/shooting.c (modified) (1 diff)
-
platform/ixus120_sd940/shooting.c (modified) (1 diff)
-
platform/ixus200_sd980/shooting.c (modified) (1 diff)
-
platform/ixus220_elph300hs/shooting.c (modified) (2 diffs)
-
platform/ixus230_elph310hs/shooting.c (modified) (1 diff)
-
platform/ixus300_sd4000/shooting.c (modified) (1 diff)
-
platform/ixus310_elph500hs/shooting.c (modified) (2 diffs)
-
platform/ixus40_sd300/shooting.c (modified) (1 diff)
-
platform/ixus50_sd400/shooting.c (modified) (1 diff)
-
platform/ixus55_sd450/shooting.c (modified) (1 diff)
-
platform/ixus60_sd600/shooting.c (modified) (1 diff)
-
platform/ixus65_sd630/shooting.c (modified) (1 diff)
-
platform/ixus700_sd500/shooting.c (modified) (1 diff)
-
platform/ixus70_sd1000/shooting.c (modified) (1 diff)
-
platform/ixus750_sd550/shooting.c (modified) (1 diff)
-
platform/ixus75_sd750/shooting.c (modified) (1 diff)
-
platform/ixus800_sd700/shooting.c (modified) (1 diff)
-
platform/ixus80_sd1100/shooting.c (modified) (1 diff)
-
platform/ixus850_sd800/shooting.c (modified) (1 diff)
-
platform/ixus85_sd770/shooting.c (modified) (1 diff)
-
platform/ixus860_sd870/shooting.c (modified) (1 diff)
-
platform/ixus870_sd880/shooting.c (modified) (1 diff)
-
platform/ixus900_sd900/shooting.c (modified) (1 diff)
-
platform/ixus90_sd790/shooting.c (modified) (1 diff)
-
platform/ixus950_sd850/shooting.c (modified) (1 diff)
-
platform/ixus95_sd1200/shooting.c (modified) (1 diff)
-
platform/ixus960_sd950/shooting.c (modified) (1 diff)
-
platform/ixus970_sd890/shooting.c (modified) (1 diff)
-
platform/ixus980_sd990/shooting.c (modified) (1 diff)
-
platform/ixusizoom_sd30/shooting.c (modified) (1 diff)
-
platform/s2is/shooting.c (modified) (1 diff)
-
platform/s3is/shooting.c (modified) (1 diff)
-
platform/s5is/shooting.c (modified) (1 diff)
-
platform/s90/shooting.c (modified) (1 diff)
-
platform/s95/shooting.c (modified) (1 diff)
-
platform/sx1/shooting.c (modified) (1 diff)
-
platform/sx10/shooting.c (modified) (1 diff)
-
platform/sx100is/shooting.c (modified) (1 diff)
-
platform/sx110is/shooting.c (modified) (1 diff)
-
platform/sx120is/shooting.c (modified) (1 diff)
-
platform/sx130is/shooting.c (modified) (1 diff)
-
platform/sx150is/shooting.c (modified) (1 diff)
-
platform/sx20/shooting.c (modified) (1 diff)
-
platform/sx200is/shooting.c (modified) (1 diff)
-
platform/sx220hs/shooting.c (modified) (2 diffs)
-
platform/sx230hs/shooting.c (modified) (2 diffs)
-
platform/sx30/shooting.c (modified) (2 diffs)
-
platform/sx40hs/shooting.c (modified) (2 diffs)
-
platform/tx1/shooting.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/Makefile
r1621 r1632 65 65 histogram.o gui_batt.o gui_space.o gui_osd.o raw.o \ 66 66 gui_usb.o gui_lang.o modules.o module_load.o \ 67 levent.o shot_histogram.o console.o \67 levent.o shot_histogram.o console.o shooting.o \ 68 68 usb_input.o usb_module.o usb_remote.o $(OPT_OBJS) 69 69 -
trunk/core/conf.c
r1621 r1632 763 763 ((movie_status > 1) && conf.save_raw_in_video) || // True is movie mode and save_raw_in_video is disabled 764 764 #ifdef CAM_DISABLE_RAW_IN_LOW_LIGHT_MODE 765 (shooting_get_ prop(PROPCASE_RESOLUTION)==7) ||// True if shooting resolution is 'low light'765 (shooting_get_resolution()==7) || // True if shooting resolution is 'low light' 766 766 #endif 767 767 #if defined(CAM_DISABLE_RAW_IN_HQ_BURST) … … 771 771 (m == MODE_NIGHT_SCENE) || // True if HandHeld Night Scene (SX40HS corrupts JPEG images if RAW enabled in this mode) 772 772 #endif 773 (shooting_get_ prop(PROPCASE_RESOLUTION)==5) ||// True if shooting resolution is ??? (what is mode 5)773 (shooting_get_resolution()==5) || // True if shooting resolution is ??? (what is mode 5) 774 774 ((m==MODE_SPORTS) && conf.save_raw_in_sports) || // True if sports mode and save_raw_in_sports is disabled 775 775 ((m==MODE_AUTO) && conf.save_raw_in_auto) || // True if auto mode and save_raw_in_auto is disabled -
trunk/core/curves.c
r1594 r1632 26 26 (using Zebra) 27 27 28 External function added: shooting_get_ev_correction1 (added in generic/shooting)28 External function added: shooting_get_ev_correction1 (added in core/shooting) 29 29 Modified gui.c for curve enable 30 30 -
trunk/core/gui.c
r1621 r1632 1699 1699 int m=mode_get()&MODE_SHOOTING_MASK; 1700 1700 if ((m==MODE_M) || (m==MODE_AV)) 1701 conf.subj_dist_override_value=(int)shooting_get_hyperfocal_distance_f(shooting_get_aperture_from_av96(shooting_get_user_av96()),get_focal_length( lens_get_zoom_point()));1701 conf.subj_dist_override_value=(int)shooting_get_hyperfocal_distance_f(shooting_get_aperture_from_av96(shooting_get_user_av96()),get_focal_length(shooting_get_zoom())); 1702 1702 else conf.subj_dist_override_value=(int)shooting_get_hyperfocal_distance(); 1703 1703 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); … … 2116 2116 if (recreview_hold==0) 2117 2117 { 2118 if ( shooting_get_ prop(PROPCASE_DISPLAY_MODE) == 0) return( 1 );2118 if ( shooting_get_display_mode() == 0) return( 1 ); 2119 2119 } 2120 2120 else … … 2139 2139 } 2140 2140 #else 2141 if ( shooting_get_ prop(PROPCASE_DISPLAY_MODE) == 0) return( 1 );2141 if ( shooting_get_display_mode() == 0) return( 1 ); 2142 2142 } 2143 2143 } -
trunk/core/gui_osd.c
r1621 r1632 62 62 av=shooting_get_min_real_aperture(); 63 63 #endif 64 fl=get_focal_length( lens_get_zoom_point());64 fl=get_focal_length(shooting_get_zoom()); 65 65 dof.far_limit=-1.0; 66 66 dof.near_limit=-1.0; … … 317 317 if (conf.values_show_zoom) 318 318 { 319 int fl, zp= lens_get_zoom_point(), fl1=get_focal_length(zp);319 int fl, zp=shooting_get_zoom(), fl1=get_focal_length(zp); 320 320 switch (conf.zoom_value) 321 321 { … … 529 529 { 530 530 static char *s[6]={" ", "1/6", "1/3", "1/2", "2/3", "5/6"}; 531 short ev=shooting_get_ prop(PROPCASE_EV_CORRECTION_1);531 short ev=shooting_get_ev_correction1(); 532 532 if (ev/96 || (ev==0)) sprintf(osd_buf, "EV: %d %s", abs(ev/96), s[abs(ev/16%6)]); 533 533 else sprintf(osd_buf, "EV: %s ", s[abs(ev/16%6)]); -
trunk/core/kbd.c
r1621 r1632 187 187 if (kbd_is_key_pressed(KEY_UP) && ((m&MODE_SHOOTING_MASK) != MODE_M) && !mode_video) { 188 188 if (conf.fast_ev && key_pressed == 0) { 189 shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_ prop(PROPCASE_EV_CORRECTION_1)+(conf.fast_ev_step+1)*16);190 shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_ prop(PROPCASE_EV_CORRECTION_2)+(conf.fast_ev_step+1)*16);189 shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_ev_correction1()+(conf.fast_ev_step+1)*16); 190 shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_ev_correction2()+(conf.fast_ev_step+1)*16); 191 191 EnterToCompensationEVF(); 192 192 key_pressed = KEY_UP; … … 200 200 if (conf.fast_ev && key_pressed == 0) { 201 201 kbd_key_release_all(); 202 shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_ prop(PROPCASE_EV_CORRECTION_1)-(conf.fast_ev_step+1)*16);203 shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_ prop(PROPCASE_EV_CORRECTION_2)-(conf.fast_ev_step+1)*16);202 shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_ev_correction1()-(conf.fast_ev_step+1)*16); 203 shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_ev_correction2()-(conf.fast_ev_step+1)*16); 204 204 key_pressed = KEY_DOWN; 205 205 EnterToCompensationEVF(); … … 212 212 213 213 if (conf.fast_ev &&kbd_is_key_pressed(KEY_SHOOT_HALF) && (jogdial==JOGDIAL_RIGHT) && ((m&MODE_SHOOTING_MASK) != MODE_M) && !mode_video) { 214 shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_ prop(PROPCASE_EV_CORRECTION_1)+(conf.fast_ev_step+1)*16);215 shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_ prop(PROPCASE_EV_CORRECTION_2)+(conf.fast_ev_step+1)*16);214 shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_ev_correction1()+(conf.fast_ev_step+1)*16); 215 shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_ev_correction2()+(conf.fast_ev_step+1)*16); 216 216 EnterToCompensationEVF(); 217 217 } 218 218 219 219 if (conf.fast_ev &&kbd_is_key_pressed(KEY_SHOOT_HALF) && (jogdial==JOGDIAL_LEFT) && ((m&MODE_SHOOTING_MASK) != MODE_M) && !mode_video) { 220 shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_ prop(PROPCASE_EV_CORRECTION_1)-(conf.fast_ev_step+1)*16);221 shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_ prop(PROPCASE_EV_CORRECTION_2)-(conf.fast_ev_step+1)*16);220 shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_ev_correction1()-(conf.fast_ev_step+1)*16); 221 shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_ev_correction2()-(conf.fast_ev_step+1)*16); 222 222 EnterToCompensationEVF(); 223 223 } -
trunk/core/luascript.c
r1621 r1632 1097 1097 static int luaCB_get_focus_mode( lua_State* L ) 1098 1098 { 1099 lua_pushnumber( L, shooting_get_ prop(PROPCASE_FOCUS_MODE) );1099 lua_pushnumber( L, shooting_get_focus_mode() ); 1100 1100 return 1; 1101 1101 } … … 1103 1103 static int luaCB_get_flash_mode( lua_State* L ) 1104 1104 { 1105 lua_pushnumber( L, shooting_get_ prop(PROPCASE_FLASH_MODE) );1105 lua_pushnumber( L, shooting_get_flash_mode() ); 1106 1106 return 1; 1107 1107 } … … 1109 1109 static int luaCB_get_shooting( lua_State* L ) 1110 1110 { 1111 lua_pushboolean( L, shooting_ get_prop(PROPCASE_SHOOTING) );1111 lua_pushboolean( L, shooting_in_progress() ); 1112 1112 return 1; 1113 1113 } … … 1115 1115 static int luaCB_get_flash_ready( lua_State* L ) 1116 1116 { 1117 lua_pushboolean( L, shooting_ get_prop(PROPCASE_IS_FLASH_READY) );1117 lua_pushboolean( L, shooting_is_flash() ); 1118 1118 return 1; 1119 1119 } … … 1121 1121 static int luaCB_get_IS_mode( lua_State* L ) 1122 1122 { 1123 lua_pushnumber( L, shooting_get_ prop(PROPCASE_IS_MODE) );1123 lua_pushnumber( L, shooting_get_is_mode() ); 1124 1124 return 1; 1125 1125 } … … 1161 1161 static int luaCB_get_ev( lua_State* L ) 1162 1162 { 1163 lua_pushnumber( L, shooting_get_ prop(PROPCASE_EV_CORRECTION_1) );1163 lua_pushnumber( L, shooting_get_ev_correction1() ); 1164 1164 return 1; 1165 1165 } -
trunk/include/lolevel.h
r1621 r1632 21 21 extern long _GetFocusLensSubjectDistanceFromLens(); 22 22 extern void _MoveFocusLensToDistance(short *dist); 23 #ifdef CAM_AV_OVERRIDE_IRIS_FIX 24 extern int _MoveIrisWithAv(short*); 25 #endif 23 26 extern void _PutInNdFilter(); 24 27 extern void _PutOutNdFilter(); -
trunk/include/platform.h
r1621 r1632 304 304 /******************************************************************/ 305 305 short shooting_get_aperture_sizes_table_size(); 306 short shooting_get_aperture_sizes_table_prop_id(short i);307 306 short shooting_get_max_aperture_sizes_table_prop_id(); 308 307 short shooting_get_aperture_from_av96(short av96); … … 332 331 extern int circle_of_confusion; 333 332 /******************************************************************/ 333 extern short shooting_get_is_mode(); 334 extern short shooting_get_resolution(); 335 extern short shooting_get_display_mode(); 336 /******************************************************************/ 334 337 extern const int zoom_points; 335 338 int shooting_get_zoom(); … … 338 341 void shooting_set_zoom_speed(int v); 339 342 /******************************************************************/ 340 int shooting_get_focus();341 343 void shooting_set_focus(int v, short is_now); 342 344 short shooting_get_focus_mode(); … … 471 473 void ExitFromCompensationEVF(void); 472 474 475 extern void PutInNdFilter(); 476 extern void PutOutNdFilter(); 477 extern long GetCurrentAvValue(); 478 extern long IsStrobeChargeCompleted(); 479 extern void SetCurrentCaptureModeType(); 480 #if CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 481 extern void UnsetZoomForMovie(); 482 #endif 483 #ifdef CAM_AV_OVERRIDE_IRIS_FIX 484 extern int MoveIrisWithAv(short*); 485 #endif 486 #if CAM_EV_IN_VIDEO 487 extern void ExpCtrlTool_StartContiAE(int, int); 488 extern void ExpCtrlTool_StopContiAE(int, int); 489 extern short SetAE_ShutterSpeed(short* tv); 490 #endif 491 473 492 void TurnOnBackLight(void); 474 493 void TurnOffBackLight(void); … … 476 495 void wait_until_remote_button_is_released(void); 477 496 short shooting_get_ev_correction1(); 497 short shooting_get_ev_correction2(); 478 498 479 499 //image_quality_override -
trunk/lib/ubasic/ubasic.c
r1612 r1632 338 338 case TOKENIZER_GET_FOCUS_MODE: 339 339 accept(TOKENIZER_GET_FOCUS_MODE); 340 r = shooting_get_ prop(PROPCASE_FOCUS_MODE);340 r = shooting_get_focus_mode(); 341 341 break; 342 342 case TOKENIZER_GET_DISPLAY_MODE: 343 343 accept(TOKENIZER_GET_DISPLAY_MODE); 344 r = shooting_get_ prop(PROPCASE_DISPLAY_MODE);344 r = shooting_get_display_mode(); 345 345 break; 346 346 case TOKENIZER_GET_FLASH_MODE: 347 347 accept(TOKENIZER_GET_FLASH_MODE); 348 r = shooting_get_ prop(PROPCASE_FLASH_MODE);348 r = shooting_get_flash_mode(); 349 349 break; 350 350 case TOKENIZER_GET_SHOOTING: 351 351 accept(TOKENIZER_GET_SHOOTING); 352 r = shooting_ get_prop(PROPCASE_SHOOTING);352 r = shooting_in_progress(); 353 353 break; 354 354 case TOKENIZER_GET_FLASH_READY: 355 355 accept(TOKENIZER_GET_FLASH_READY); 356 r = shooting_ get_prop(PROPCASE_IS_FLASH_READY);356 r = shooting_is_flash(); 357 357 break; 358 358 case TOKENIZER_GET_IS_MODE: 359 359 accept(TOKENIZER_GET_IS_MODE); 360 r = shooting_get_ prop(PROPCASE_IS_MODE);360 r = shooting_get_is_mode(); 361 361 break; 362 362 case TOKENIZER_GET_EV: 363 363 accept(TOKENIZER_GET_EV); 364 r = shooting_get_ prop(PROPCASE_EV_CORRECTION_1);364 r = shooting_get_ev_correction1(); 365 365 break; 366 366 case TOKENIZER_GET_RESOLUTION: 367 367 accept(TOKENIZER_GET_RESOLUTION); 368 r = shooting_get_ prop(PROPCASE_RESOLUTION);368 r = shooting_get_resolution(); 369 369 break; 370 370 case TOKENIZER_GET_QUALITY: -
trunk/platform/a1100/shooting.c
r1233 r1632 81 81 }; 82 82 83 staticconst CapturemodeMap modemap[] = {83 const CapturemodeMap modemap[] = { 84 84 { MODE_AUTO, 32768 }, 85 85 { MODE_P, 32772 }, -
trunk/platform/a2000/shooting.c
r860 r1632 115 115 canon mode list FFEB9B10 in 100c 116 116 */ 117 staticconst CapturemodeMap modemap[] = {117 const CapturemodeMap modemap[] = { 118 118 { MODE_LONG_SHUTTER, 32774 }, // not verified 119 119 { MODE_VIDEO_STD, 2600 }, -
trunk/platform/a3000/shooting.c
r1372 r1632 83 83 }; 84 84 85 staticconst CapturemodeMap modemap[] = { // prop 4985 const CapturemodeMap modemap[] = { // prop 49 86 86 { MODE_AUTO, 32768 }, 87 87 { MODE_P, 32772 }, -
trunk/platform/a3300/shooting.c
r1620 r1632 74 74 }; 75 75 76 st atic struct {76 struct { 77 77 int hackmode; 78 78 int canonmode; -
trunk/platform/a410/shooting.c
r1287 r1632 80 80 canon mode list ffd39b10 in a410 100f 81 81 */ 82 staticconst CapturemodeMap modemap[] = {82 const CapturemodeMap modemap[] = { 83 83 { MODE_P, 0 }, 84 84 { MODE_AUTO, 4 }, -
trunk/platform/a430/shooting.c
r1628 r1632 84 84 canon mode list FFD588D4 in 100b 85 85 */ 86 staticconst CapturemodeMap modemap[] = {86 const CapturemodeMap modemap[] = { 87 87 // { MODE_M, 32769 }, 88 88 { MODE_P, 32772 }, -
trunk/platform/a450/shooting.c
r1276 r1632 90 90 canon mode list FFEAB878 in 100d 91 91 */ 92 staticconst CapturemodeMap modemap[] = {92 const CapturemodeMap modemap[] = { 93 93 { MODE_LONG_SHUTTER, 32774 }, // confirmed on a460 94 94 { MODE_AUTO, 32768 }, -
trunk/platform/a460/shooting.c
r1276 r1632 92 92 canon mode list FFEAB860 in 100d 93 93 */ 94 staticconst CapturemodeMap modemap[] = {94 const CapturemodeMap modemap[] = { 95 95 { MODE_LONG_SHUTTER, 32774 }, 96 96 { MODE_SUPER_MACRO, 33289 }, -
trunk/platform/a470/shooting.c
r860 r1632 98 98 canon mode list FFE8FAB4 in 100e 99 99 */ 100 staticconst CapturemodeMap modemap[] = {100 const CapturemodeMap modemap[] = { 101 101 { MODE_LONG_SHUTTER, 32774 }, // guessed 102 102 { MODE_AUTO, 32768 }, -
trunk/platform/a480/shooting.c
r884 r1632 78 78 }; 79 79 80 staticconst CapturemodeMap modemap[] = {80 const CapturemodeMap modemap[] = { 81 81 { MODE_AUTO, 32768 }, 82 82 { MODE_P, 32772 }, -
trunk/platform/a490/shooting.c
r1482 r1632 78 78 }; 79 79 80 staticconst CapturemodeMap modemap[] = {80 const CapturemodeMap modemap[] = { 81 81 { MODE_AUTO, 32768 }, 82 82 { MODE_P, 32772 }, -
trunk/platform/a495/shooting.c
r1376 r1632 78 78 }; 79 79 80 staticconst CapturemodeMap modemap[] = {80 const CapturemodeMap modemap[] = { 81 81 { MODE_AUTO, 32768 }, 82 82 { MODE_P, 32772 }, -
trunk/platform/a530/shooting.c
r1276 r1632 95 95 canon mode list FFD47FC4 in 100a 96 96 */ 97 staticconst CapturemodeMap modemap[] = {97 const CapturemodeMap modemap[] = { 98 98 { MODE_AUTO, 32768 }, 99 99 { MODE_P, 32772 }, -
trunk/platform/a540/shooting.c
r1276 r1632 88 88 canon mode list FFD588D4 in 100b 89 89 */ 90 staticconst CapturemodeMap modemap[] = {90 const CapturemodeMap modemap[] = { 91 91 { MODE_M, 32769 }, 92 92 { MODE_AV, 32770 }, -
trunk/platform/a550/shooting.c
r860 r1632 91 91 canon mode list FFEA9F04 in 100c 92 92 */ 93 staticconst CapturemodeMap modemap[] = {93 const CapturemodeMap modemap[] = { 94 94 { MODE_LONG_SHUTTER, 32774 }, // guessed 95 95 { MODE_AUTO, 32768 }, -
trunk/platform/a560/shooting.c
r860 r1632 89 89 canon mode list FFED1124 in 100a 90 90 */ 91 staticconst CapturemodeMap modemap[] = {91 const CapturemodeMap modemap[] = { 92 92 { MODE_LONG_SHUTTER, 32774 }, // guessed 93 93 { MODE_AUTO, 32768 }, -
trunk/platform/a570/shooting.c
r860 r1632 92 92 */ 93 93 94 staticconst CapturemodeMap modemap[] = {94 const CapturemodeMap modemap[] = { 95 95 { MODE_AUTO, 32768 }, 96 96 { MODE_P, 32772 }, -
trunk/platform/a580/shooting.c
r1308 r1632 98 98 canon mode list in @FFE7CFFC in 100c 99 99 */ 100 staticconst CapturemodeMap modemap[] = {100 const CapturemodeMap modemap[] = { 101 101 { MODE_P, 32772 }, // OK! 102 102 { MODE_LONG_SHUTTER, 32774 }, // OK! -
trunk/platform/a590/shooting.c
r860 r1632 94 94 */ 95 95 // PROPCASE 49, verified by whim in http://chdk.setepontos.com/index.php/topic,3228.msg44199.html#msg44199 96 staticconst CapturemodeMap modemap[] = {96 const CapturemodeMap modemap[] = { 97 97 // common modes 98 98 { MODE_M, 32769 }, -
trunk/platform/a610/shooting.c
r860 r1632 90 90 canon mode list FFD49168 in 100e 91 91 */ 92 staticconst CapturemodeMap modemap[] = {92 const CapturemodeMap modemap[] = { 93 93 { MODE_AUTO, 6 }, 94 94 { MODE_P, 1 }, -
trunk/platform/a620/shooting.c
r860 r1632 91 91 canon mode list @FFD4A024 in 100f 92 92 */ 93 staticconst CapturemodeMap modemap[] = {93 const CapturemodeMap modemap[] = { 94 94 { MODE_AUTO, 6 }, 95 95 { MODE_P, 1 }, -
trunk/platform/a630/shooting.c
r860 r1632 90 90 160 x 120 (3 min. at 15 fps) 91 91 */ 92 staticconst CapturemodeMap modemap[] = {92 const CapturemodeMap modemap[] = { 93 93 // these are common on most cameras except very old vxworks that use 0-n, should be OK 94 94 { MODE_M, 32769 }, -
trunk/platform/a640/shooting.c
r860 r1632 93 93 and canon mode lists are identical 94 94 */ 95 staticconst CapturemodeMap modemap[] = {95 const CapturemodeMap modemap[] = { 96 96 // these are common on most cameras except very old vxworks that use 0-n, should be OK 97 97 { MODE_M, 32769 }, -
trunk/platform/a650/shooting.c
r880 r1632 90 90 */ 91 91 92 staticconst CapturemodeMap modemap[] = {92 const CapturemodeMap modemap[] = { 93 93 { MODE_AUTO, 32768 }, 94 94 { MODE_P, 32772 }, -
trunk/platform/a700/shooting.c
r860 r1632 90 90 Canon implies there should be a My Colors mode, but all the modes in the list are accounted for. 91 91 */ 92 staticconst CapturemodeMap modemap[] = {92 const CapturemodeMap modemap[] = { 93 93 // common modes, probably OK 94 94 { MODE_M, 32769 }, -
trunk/platform/a710/shooting.c
r860 r1632 90 90 160 x 120 (3 min. at 15 fps) 91 91 */ 92 staticconst CapturemodeMap modemap[] = {92 const CapturemodeMap modemap[] = { 93 93 { MODE_M, 32769 }, 94 94 { MODE_P, 32772 }, -
trunk/platform/a720/shooting.c
r860 r1632 92 92 canon mode list in FFE7CFFC 100c 93 93 */ 94 staticconst CapturemodeMap modemap[] = {94 const CapturemodeMap modemap[] = { 95 95 { MODE_AUTO, 32768 }, 96 96 { MODE_P, 32772 }, -
trunk/platform/d10/shooting.c
r1276 r1632 107 107 108 108 */ 109 staticconst CapturemodeMap modemap[] = {109 const CapturemodeMap modemap[] = { 110 110 { MODE_SCN_LONG_SHUTTER, 16390 }, 111 111 { MODE_P, 32772 }, -
trunk/platform/g10/shooting.c
r1329 r1632 83 83 84 84 // G10 values inserted 85 staticconst CapturemodeMap modemap[] = {85 const CapturemodeMap modemap[] = { 86 86 { MODE_AUTO, 32768 }, 87 87 { MODE_P, 32772 }, -
trunk/platform/g11/shooting.c
r1376 r1632 85 85 }; 86 86 87 staticconst CapturemodeMap modemap[] = {87 const CapturemodeMap modemap[] = { 88 88 { MODE_AUTO, 32768 }, 89 89 { MODE_P, 32772 }, // also C1,C2 -
trunk/platform/g12/shooting.c
r1273 r1632 99 99 */ 100 100 // G12 modelist table found @0xFFC89550 (firmware 1.00c) 101 staticconst CapturemodeMap modemap[] = {101 const CapturemodeMap modemap[] = { 102 102 { MODE_QUICK, 33315 }, 103 103 { MODE_TV, 32771 }, … … 138 138 #include "../generic/shooting.c" 139 139 140 // Override ISO settings (need to do this before exposure calc for ISO, as well as after)141 void __attribute__((naked,noinline)) shooting_expo_iso_override(void){142 asm volatile("STMFD SP!, {R0-R12,LR}\n");143 144 if ((state_kbd_script_run) && (photo_param_put_off.sv96))145 {146 shooting_set_sv96(photo_param_put_off.sv96, SET_NOW);147 // photo_param_put_off.sv96 is not reset here, it will be reset in next call to shooting_expo_param_override148 }149 else if ((conf.iso_override_value) && (conf.iso_override_koef) && !(conf.override_disable==1))150 shooting_set_iso_real(shooting_get_iso_override_value(), SET_NOW);151 else if (conf.autoiso_enable && shooting_get_flash_mode()/*NOT FOR FLASH AUTO MODE*/ && !(conf.override_disable==1 && conf.override_disable_all))152 shooting_set_autoiso(shooting_get_iso_mode());153 154 asm volatile("LDMFD SP!, {R0-R12,PC}\n");155 }156 157 140 long get_file_next_counter() { 158 141 return get_file_counter(); -
trunk/platform/g7/shooting.c
r860 r1632 92 92 canon mode list FF9B62B0 in 100e 93 93 */ 94 staticconst CapturemodeMap modemap[] = {94 const CapturemodeMap modemap[] = { 95 95 { MODE_AUTO, 32768 }, 96 96 { MODE_P, 32772 }, -
trunk/platform/g9/shooting.c
r880 r1632 95 95 canon modelist in 100d 96 96 */ 97 staticconst CapturemodeMap modemap[] = {97 const CapturemodeMap modemap[] = { 98 98 { MODE_AUTO, 32768 }, 99 99 { MODE_P, 32772 }, -
trunk/platform/generic/shooting.c
r1612 r1632 7 7 #include "conf.h" 8 8 9 #define USE_FILE_COUNTER_FOR_EXP_COUNTING 10 11 #define SS_SIZE (sizeof(shutter_speeds_table)/sizeof(shutter_speeds_table[0])) 12 #define SSID_MIN (shutter_speeds_table[0].id) 13 #define SSID_MAX (shutter_speeds_table[SS_SIZE-1].id) 14 15 #define AS_SIZE (sizeof(aperture_sizes_table)/sizeof(aperture_sizes_table[0])) 16 #define ASID_MIN (aperture_sizes_table[0].id) 17 #define ASID_MAX (aperture_sizes_table[AS_SIZE-1].id) 9 #ifndef PARAM_FILE_COUNTER 10 # error Please define PARAM_FILE_COUNTER in platform/CAMERA/shooting.c! 11 #endif 18 12 19 13 #define AV96_MIN (aperture_sizes_table[0].prop_id) 20 #define AV96_MAX (aperture_sizes_table[AS_SIZE-1].prop_id)21 14 22 #define ISO_SIZE (sizeof(iso_table)/sizeof(iso_table[0])) 23 #define ISO_MIN (iso_table[0].id) 24 #define ISO_MAX (iso_table[ISO_SIZE-1].id) 25 #define ISO_MIN_VALUE (iso_table[1-iso_table[0].id].prop_id) 15 const unsigned int SS_SIZE = sizeof(shutter_speeds_table)/sizeof(shutter_speeds_table[0]); 16 const unsigned int AS_SIZE = sizeof(aperture_sizes_table)/sizeof(aperture_sizes_table[0]); 17 const unsigned int ISO_SIZE = sizeof(iso_table)/sizeof(iso_table[0]); 18 const unsigned int MODESCNT = sizeof(modemap)/sizeof(modemap[0]); 26 19 27 static const unsigned MODESCNT=(sizeof(modemap)/sizeof(modemap[0]));20 const unsigned int param_file_counter = PARAM_FILE_COUNTER; 28 21 29 /*define PROPCASE_CONT_MODE_SHOOT_COUNT 218*/ 30 static short iso_market_base=0; 31 //static short iso_base=0; 32 static short sv96_base=0; 33 static short svm96_base=0; 34 static short sv96_base_tmp=0; 35 //static short override_iso=0; 36 static const double sqrt2=1.4142135623731;//square root from 2 37 static const double log_2=0.6931471805599;//natural logarithm of 2 38 static const double k=12.5;//K is the reflected-light meter calibration constant 39 static const short koef[] = {0, 1,10,100,1000}; 40 static const float shutter_koef[] = {0, 0.00001, 0.0001,0.001,0.01,0.1,1,10,100,1000}; 41 static const char * expo_shift[] = { "Off", "1/3Ev","2/3Ev", "1Ev", "1 1/3Ev", "1 2/3Ev", "2Ev", "2 1/3Ev", "2 2/3Ev", "3Ev", "3 1/3Ev", "3 2/3Ev", "4Ev"}; 42 const char* tv_override[]={ 43 #ifdef CAM_EXT_TV_RANGE 44 // add very long time exposures as approximately powers of 2, adding 15 exposures 45 "2048","1625","1290","1024","812","645","512","406","322","256","203","161","128","101","80", 46 #endif 47 "64","50.8", "40.3", "32", "25.4","20","16", "12.7", "10","8", "6.3","5","4","3.2", "2.5","2", "1.6", "1.3", "1", "0.8", "0.6", "0.5", "0.4", "0.3", "1/4", "1/5", "1/6", "1/8", "1/10", "1/13", "1/15", "1/20", "1/25", "1/30", "1/40", "1/50", "1/60", "1/80", "1/100", "1/125", "1/160", "1/200", "1/250", "1/320", "1/400", "1/500", "1/640","1/800", "1/1000", "1/1250", "1/1600","1/2000","1/2500","1/3200","1/4000", "1/5000", "1/6400", "1/8000", "1/10000", "1/12500", "1/16000", "1/20000", "1/25000", "1/32000", "1/40000", "1/50000", "1/64000","1/80000", "1/100k"}; 48 const int tv_override_amount = sizeof(tv_override)/sizeof(tv_override[0]); 22 //------------------------------------------------------------------- 49 23 50 // offset index into tv_override to translate into 1/3 stops in APEX 51 #if CAM_EXT_TV_RANGE 52 const int tv_override_zero_shift = 18+15; 53 #else 54 const int tv_override_zero_shift = 18; 55 #endif 56 static const char * expo_type[] = { "+/-", "-","+"}; 24 // Note: shooting functions moved to core/shooting.c 25 // this compiles them as THUMB code to save space 57 26 58 static PHOTO_PARAM photo_param_put_off; 59 60 EXPO_BRACKETING_VALUES bracketing; 27 //------------------------------------------------------------------- 61 28 62 29 //*********************** … … 101 68 //*********************** 102 69 103 int shooting_get_user_tv_id() 70 // Core override function 71 void __attribute__((naked,noinline)) shooting_expo_param_override(void) 104 72 { 105 #if CAM_HAS_USER_TV_MODES 106 short tvv; 107 long i; 108 _GetPropertyCase(PROPCASE_USER_TV, &tvv, sizeof(tvv)); 109 for (i=0;i<SS_SIZE;i++){ 110 if (shutter_speeds_table[i].prop_id == tvv) 111 return shutter_speeds_table[i].id; 112 } 113 #endif 114 return 0; 73 // Save registers 74 asm volatile("STMFD SP!, {R0-R12,LR}\n"); 75 76 // Call thumb code version in core/shooting.c 77 extern void shooting_expo_param_override_thumb(); 78 shooting_expo_param_override_thumb(); 79 80 // Restore registers 81 asm volatile("LDMFD SP!, {R0-R12,PC}\n"); 115 82 } 116 83 117 short shooting_get_is_mode() 84 // Override ISO settings only 85 // need to do this before exposure calc for ISO, as well as after on some cameras 86 void __attribute__((naked,noinline)) shooting_expo_iso_override(void) 118 87 { 119 short ism = 0; 120 _GetPropertyCase(PROPCASE_IS_MODE, &ism, sizeof(ism)); 121 return ism; 88 // Save registers 89 asm volatile("STMFD SP!, {R0-R12,LR}\n"); 90 91 // Call thumb code version in core/shooting.c 92 extern void shooting_expo_iso_override_thumb(void); 93 shooting_expo_iso_override_thumb(); 94 95 // Restore registers 96 asm volatile("LDMFD SP!, {R0-R12,PC}\n"); 122 97 } 123 124 125 const ShutterSpeed *shooting_get_tv_line()126 {127 short tvv;128 long i;129 _GetPropertyCase(PROPCASE_USER_TV, &tvv, sizeof(tvv));130 for (i=0;i<SS_SIZE;i++){131 if (shutter_speeds_table[i].prop_id == tvv)132 return &shutter_speeds_table[i];133 }134 return 0;135 }136 137 void shooting_set_user_tv_by_id(int v)138 {139 #if CAM_HAS_USER_TV_MODES140 if ((mode_get()&MODE_MASK) != MODE_PLAY){141 long i;142 // if ((v<SSID_MIN) || (v>SSID_MAX))143 // return;144 for (i=0;i<SS_SIZE;i++){145 if (shutter_speeds_table[i].id == v){146 short vv = shutter_speeds_table[i].prop_id;147 _SetPropertyCase(PROPCASE_USER_TV, &vv, sizeof(vv));148 //_SetPropertyCase(PROPCASE_TV, &vv, sizeof(vv));149 return;150 }151 }152 }153 #endif154 }155 void shooting_set_prop(int id, int v)156 {157 short vv = v;158 _SetPropertyCase(id, &vv, sizeof(vv));159 return;160 }161 162 int shooting_get_prop(int id)163 {164 short vv;165 _GetPropertyCase(id, &vv, sizeof(vv));166 return vv;167 }168 169 short shooting_get_canon_iso_mode()170 {171 short isom;172 _GetPropertyCase(PROPCASE_ISO_MODE, &isom, sizeof(isom));173 return isom;174 }175 176 177 int shooting_get_iso_mode()178 {179 short isov;180 long i;181 _GetPropertyCase(PROPCASE_ISO_MODE, &isov, sizeof(isov));182 for (i=0;i<ISO_SIZE;i++){183 if (iso_table[i].prop_id == isov)184 return iso_table[i].id;185 }186 return 0;187 }188 189 void shooting_set_user_tv_by_id_rel(int v)190 {191 #if CAM_HAS_USER_TV_MODES192 if ((mode_get()&MODE_MASK) != MODE_PLAY){193 int cv = shooting_get_user_tv_id();194 shooting_set_user_tv_by_id(cv+v);195 }196 #endif197 }198 199 int shooting_get_user_av_id()200 {201 #if CAM_HAS_IRIS_DIAPHRAGM202 short avv;203 long i;204 _GetPropertyCase(PROPCASE_USER_AV, &avv, sizeof(avv));205 for (i=0;i<AS_SIZE;i++){206 if (aperture_sizes_table[i].prop_id == avv)207 return aperture_sizes_table[i].id;208 }209 #endif210 return 0;211 }212 213 short shooting_get_real_aperture() {214 //#if !CAM_HAS_IRIS_DIAPHRAGM215 // return shooting_get_min_real_aperture();216 //#else217 //I hope that GetCurrentAvValue is correct for ixus70_sd1000 ixus700_sd500 now218 return shooting_get_aperture_from_av96(_GetCurrentAvValue());219 //#endif220 }221 222 short shooting_get_aperture_from_av96(short av96) {223 if (av96) return (short)((pow(sqrt2, ((double)av96)/96.0))*100.0);224 else return -1;225 }226 227 short shooting_get_min_real_aperture() {228 short av96;229 _GetPropertyCase(PROPCASE_MIN_AV, &av96, sizeof(av96));230 if (av96) return shooting_get_aperture_from_av96(av96);231 else return shooting_get_real_aperture();232 }233 234 short shooting_get_iso_from_sv96(short sv96)235 {236 return (short)(pow(2, (((double) sv96+168.0)/96.0)));237 }238 239 short shooting_get_iso_real()240 {241 short sv;242 _GetPropertyCase(PROPCASE_SV, &sv, sizeof(sv));243 if (sv == 0) {244 return 0;245 }246 return shooting_get_iso_from_sv96(sv);247 }248 249 short shooting_get_svm96()250 {251 short sv;252 _GetPropertyCase(PROPCASE_SV_MARKET, &sv, sizeof(sv));253 return sv;254 }255 256 short shooting_get_sv96()257 {258 short sv;259 _GetPropertyCase(PROPCASE_SV, &sv, sizeof(sv));260 return sv;261 }262 263 short shooting_get_base_sv96()264 {265 short dsv,sv;266 if (shooting_get_canon_iso_mode()<50) {267 _GetPropertyCase(PROPCASE_DELTA_SV, &dsv, sizeof(dsv));268 _GetPropertyCase(PROPCASE_SV, &sv, sizeof(sv));269 sv96_base=(sv-dsv);270 }271 return sv96_base;272 }273 274 short shooting_get_sv96_from_iso(short iso)275 {276 if (iso>0)277 return (short)(log(pow(2.0,(-7.0/4.0))*(double)(iso))*96.0/(log_2));278 return 0;279 }280 281 short shooting_get_svm96_from_iso(short iso)282 {283 if (iso>0) return (short)(log((double)(iso)*32.0/100.0)*96.0/(log_2));284 return 0;285 }286 287 short shooting_get_iso_market_from_svm96(short svm96)288 {289 if (svm96>0 )290 return (short)((double)pow(2, (((double)svm96)/96.0))*100.0/32.0);291 return 0;292 }293 294 short shooting_get_iso_market_base()295 {296 //if ((iso_market_base==0) && (shooting_get_iso_mode() <= 0)) {297 // iso_market_base=(short)shooting_get_iso_market_from_svm96(shooting_get_svm96());298 // }299 //return iso_market_base;300 if (iso_market_base==0) {301 if (ISO_MIN_VALUE==50) iso_market_base=50;302 #if defined(CAMERA_sx40hs)303 else iso_market_base=200;304 #else305 else iso_market_base=100;306 #endif307 }308 return iso_market_base;309 }310 311 short shooting_get_svm96_base()312 {313 if (svm96_base==0) svm96_base=shooting_get_svm96_from_iso(shooting_get_iso_market_base());314 return svm96_base;315 }316 317 short shooting_get_iso_base()318 {319 sv96_base=shooting_get_base_sv96();320 if (sv96_base!=0) return shooting_get_iso_from_sv96(sv96_base);321 else return 0;322 }323 324 // AUTOISO:EXIF325 short shooting_get_iso_market()326 {327 //double koef;328 short iso_mode=shooting_get_canon_iso_mode();329 if ((iso_mode < 50) || (conf.iso_override_koef && conf.iso_override_value) || (conf.iso_bracket_koef && conf.iso_bracket_value))330 {331 short iso_b=shooting_get_iso_base();332 if (iso_b) return (short)((shooting_get_iso_market_base()*shooting_get_iso_real())/iso_b);333 }334 return iso_mode;335 }336 337 void shooting_set_sv96(short sv96, short is_now){338 short dsv96=0, iso_mode=shooting_get_canon_iso_mode();339 if ((mode_get()&MODE_MASK) != MODE_PLAY){340 if (is_now) {341 if (iso_mode<50) dsv96 =sv96-shooting_get_base_sv96();342 else if (sv96_base) dsv96=sv96-sv96_base;343 else if (sv96_base_tmp) dsv96=sv96-sv96_base_tmp;344 else345 {346 sv96_base_tmp= (short)((shooting_get_svm96_base()*shooting_get_sv96())/shooting_get_svm96());347 dsv96=sv96-sv96_base_tmp;348 }349 while ((shooting_is_flash_ready()!=1) || (focus_busy));350 short svm96_base =shooting_get_svm96_base();351 if (iso_mode>=50) shooting_set_iso_mode(0);352 _SetPropertyCase(PROPCASE_SV_MARKET, &svm96_base, sizeof(svm96_base));353 _SetPropertyCase(PROPCASE_SV, &sv96, sizeof(sv96));354 _SetPropertyCase(PROPCASE_DELTA_SV, &dsv96, sizeof(dsv96));355 }356 else photo_param_put_off.sv96=sv96;357 }358 }359 360 /*void shooting_set_iso_real_delta_from_base(int diso)361 {362 return;363 int iso=(int)((short)shooting_get_iso_base()+diso);364 365 if (iso>0) {366 shooting_set_sv96((short)(shooting_get_sv96_from_iso(iso)));367 }368 }*/369 370 void shooting_set_iso_real(short iso, short is_now)371 {372 if ((mode_get()&MODE_MASK) != MODE_PLAY){373 if (iso>0) shooting_set_sv96(shooting_get_sv96_from_iso(iso), is_now);374 }375 }376 377 short shooting_get_bv96()378 {379 short bv = 0;380 _GetPropertyCase(PROPCASE_BV, &bv, sizeof(bv));381 return bv;382 }383 384 short shooting_get_canon_overexposure_value()385 {386 short bv = 0;387 _GetPropertyCase(PROPCASE_OVEREXPOSURE, &bv, sizeof(bv));388 return bv;389 }390 391 392 short shooting_get_flash_mode()393 {394 short fm = 0;395 _GetPropertyCase(PROPCASE_FLASH_MODE, &fm, sizeof(fm));396 return fm;397 }398 399 int shooting_get_luminance()// http://en.wikipedia.org/wiki/APEX_system400 {401 short bv = shooting_get_bv96();402 int b=(int)(100*k*pow(2.0,((double)(bv-168)/96.0)));403 return b;404 }405 406 /*void shooting_set_iso_market(int isom)407 {408 if (isom>0) {409 shooting_set_sv96(shooting_get_sv96_from_iso((int)(((double)isom*(double)shooting_get_iso_base())/(double)shooting_get_iso_market_base())));410 }411 }*/412 413 int shooting_get_exif_subject_dist()414 {415 int sd = 0;416 _GetPropertyCase(PROPCASE_SUBJECT_DIST1, &sd, sizeof(sd));417 return sd;418 }419 420 int shooting_get_lens_to_focal_plane_width()421 {422 return (int)(lens_get_focus_pos()-lens_get_focus_pos_from_lens());423 }424 425 int shooting_get_hyperfocal_distance_()426 {427 int av=shooting_get_real_aperture();428 float fl=get_focal_length(lens_get_zoom_point());429 if ((av>0) && (fl>0)) return (fl*fl)/(float)(10*circle_of_confusion*av);430 else return (-1);431 }432 433 int shooting_get_hyperfocal_distance()434 {435 int h=shooting_get_hyperfocal_distance_();436 if ((h>0) && (conf.dof_dist_from_lens))437 return (h-shooting_get_lens_to_focal_plane_width());438 else return h;439 }440 441 int shooting_get_hyperfocal_distance_f(int av, int fl)442 {443 if ((av>0) && (fl>0) && (circle_of_confusion>0)) return ((float)fl*(float)fl)/(float)(10*circle_of_confusion*av);444 else return (-1);445 }446 447 int shooting_get_canon_subject_distance()448 {449 if (conf.dof_use_exif_subj_dist) return shooting_get_exif_subject_dist();450 else return lens_get_focus_pos();451 }452 453 int shooting_get_subject_distance_()454 {455 if (!conf.dof_subj_dist_as_near_limit) return shooting_get_canon_subject_distance();456 else {457 float h, v, m;458 int fl=get_focal_length(lens_get_zoom_point());459 int near=shooting_get_canon_subject_distance();460 float v1=(fl*fl);461 int av_min=shooting_get_min_real_aperture();462 int c_of_c=circle_of_confusion*10;463 if ((av_min!=0) && (c_of_c!=0) && (v1)) {464 h=v1/(float)(c_of_c*av_min);465 if ((near>0) && (near<MAX_DIST)) {466 v=(h-near);467 m=h*(float)near;468 if ((v>0) && (m>0)) return m/v;469 }470 }471 return (-1);472 }473 }474 475 int shooting_get_subject_distance()476 {477 int h=shooting_get_subject_distance_();478 if ((h>0) && (conf.dof_dist_from_lens))479 return (h-shooting_get_lens_to_focal_plane_width());480 else return h;481 }482 483 int shooting_get_near_limit_of_acceptable_sharpness_()484 {485 int s=shooting_get_canon_subject_distance();486 if (conf.dof_subj_dist_as_near_limit) return s;487 else {488 int h = shooting_get_hyperfocal_distance_();489 float m = (float)h*(float)s;490 int v = h+s;491 if ((m>0) && (v>0)) return (m/v);492 else return (-1);493 }494 }495 496 int shooting_get_near_limit_of_acceptable_sharpness()497 {498 int h=shooting_get_near_limit_of_acceptable_sharpness_();499 if ((h>0) && (conf.dof_dist_from_lens))500 return (h-shooting_get_lens_to_focal_plane_width());501 else return h;502 }503 504 int shooting_get_near_limit_f(int s, int a, int fl)505 {506 int h = shooting_get_hyperfocal_distance_f(a, fl);507 float m = (float)h*(float)s;508 int v = h+s;509 if ((m>0) && (v>0)) return (m/v);510 else return (-1);511 }512 513 int shooting_get_far_limit_of_acceptable_sharpness_()514 {515 int s=shooting_get_subject_distance_(), h=shooting_get_hyperfocal_distance_();516 int v = h-s;517 float m = (float)h*(float)s;518 if ((m>0) && (v>0)) return (m/v);519 else return (-1);520 }521 522 int shooting_get_far_limit_of_acceptable_sharpness()523 {524 int h=shooting_get_far_limit_of_acceptable_sharpness_();525 if ((h>0) && (conf.dof_dist_from_lens))526 return (h-shooting_get_lens_to_focal_plane_width());527 else return h;528 }529 530 int shooting_get_depth_of_field()531 {532 int far=shooting_get_far_limit_of_acceptable_sharpness_(), near=shooting_get_near_limit_of_acceptable_sharpness_();533 if ((far>0) && (near>0)) return far-near;534 else return (-1);535 }536 537 short shooting_get_tv96_from_shutter_speed(float t)538 {539 if (t>0) return (short) (96.0*log(1.0/t)/log_2);540 else return (-10000);541 }542 543 float shooting_get_shutter_speed_from_tv96(short tv)544 {545 return pow(2,(float)((-1)*tv)/96.0 );546 }547 548 short shooting_get_tv96()549 {550 short tv96;551 _GetPropertyCase(PROPCASE_TV, &tv96, sizeof(tv96));552 return tv96;553 }554 555 short shooting_get_user_tv96()556 {557 #if CAM_HAS_USER_TV_MODES558 short tv;559 _GetPropertyCase(PROPCASE_USER_TV, &tv, sizeof(tv));560 return tv;561 #else562 return 0;563 #endif564 }565 566 void shooting_set_user_tv96(short v)567 {568 #if CAM_HAS_USER_TV_MODES569 if ((mode_get()&MODE_MASK) != MODE_PLAY){570 long i;571 // if ((v<SSID_MIN) || (v>SSID_MAX))572 // return;573 for (i=0;i<SS_SIZE;i++){574 if (shutter_speeds_table[i].prop_id == v){575 _SetPropertyCase(PROPCASE_USER_TV, &v, sizeof(v));576 //_SetPropertyCase(PROPCASE_TV, &v, sizeof(v));577 return;578 }579 }580 }581 #endif582 }583 584 void shooting_set_tv96(short v, short is_now)585 {586 long i;587 // if ((v<SSID_MIN) || (v>SSID_MAX))588 // return;589 if ((mode_get()&MODE_MASK) != MODE_PLAY){590 for (i=0;i<SS_SIZE;i++){591 if (shutter_speeds_table[i].prop_id == v){592 shooting_set_tv96_direct(v, is_now);593 return;594 }595 }596 }597 }598 599 void shooting_set_tv96_direct(short v, short is_now)600 {601 if ((mode_get()&MODE_MASK) != MODE_PLAY){602 if(is_now) {603 _SetPropertyCase(PROPCASE_TV, &v, sizeof(v));604 #ifdef PROPCASE_TV2605 _SetPropertyCase(PROPCASE_TV2, &v, sizeof(v)); // Save override to property that will update JPEG header & Canon OSD606 #endif607 }608 else photo_param_put_off.tv96=v;609 }610 }611 612 613 void shooting_set_shutter_speed(float t, short is_now)614 {615 if (t>0) shooting_set_tv96_direct((short) 96.0*log(1/t)/log_2, is_now);616 }617 618 void shooting_set_shutter_speed_ubasic(int t, short is_now)619 {620 if ((mode_get()&MODE_MASK) != MODE_PLAY){621 if (t>0) shooting_set_tv96_direct((short) (96.0*log(100000.0/(double)t)/log_2), is_now);622 }623 }624 625 short shooting_get_av96()626 {627 short av;628 _GetPropertyCase(PROPCASE_AV, &av, sizeof(av));629 return av;630 }631 632 short shooting_get_aperture_sizes_table_size()633 {634 return AS_SIZE;635 }636 637 638 short shooting_get_aperture_sizes_table_prop_id(short i)639 {640 return aperture_sizes_table[i].prop_id;641 }642 643 short shooting_get_max_aperture_sizes_table_prop_id()644 {645 return AV96_MAX;646 }647 648 649 650 short shooting_get_av_prop_id()651 {652 short av;653 _GetPropertyCase(PROPCASE_AV, &av, sizeof(av));654 return av;655 }656 657 658 659 short shooting_get_user_av96()660 {661 #if CAM_HAS_IRIS_DIAPHRAGM662 short av;663 _GetPropertyCase(PROPCASE_USER_AV, &av, sizeof(av));664 return av;665 #else666 return 0;667 #endif668 }669 670 671 void shooting_set_av96(short v, short is_now)672 {673 #if CAM_HAS_IRIS_DIAPHRAGM674 if ((mode_get()&MODE_MASK) != MODE_PLAY){675 long i;676 // if ((v<ASID_MIN) || (v>ASID_MAX))677 // return;678 for (i=0;i<AS_SIZE;i++){679 if (aperture_sizes_table[i].prop_id == v){680 shooting_set_av96_direct(v, is_now);681 return;682 }683 }684 }685 #endif686 }687 688 void shooting_set_nd_filter_state(short v, short is_now)689 {690 #if CAM_HAS_ND_FILTER691 if ((mode_get()&MODE_MASK) != MODE_PLAY){692 if (is_now) {693 if (v==1) _PutInNdFilter();694 else if (v==2) _PutOutNdFilter();695 }696 else photo_param_put_off.nd_filter=v;697 }698 #endif699 }700 701 702 703 void shooting_set_av96_direct(short v, short is_now)704 {705 #if CAM_HAS_IRIS_DIAPHRAGM706 if ((mode_get()&MODE_MASK) != MODE_PLAY){707 if(is_now) {708 _SetPropertyCase(PROPCASE_AV, &v, sizeof(v));709 #ifdef PROPCASE_AV2710 _SetPropertyCase(PROPCASE_AV2, &v, sizeof(v)); // Save override to property that will update JPEG header & Canon OSD711 #endif712 }713 else photo_param_put_off.av96=v;714 }715 #endif716 }717 718 719 void shooting_set_user_av96(short v)720 {721 #if CAM_HAS_IRIS_DIAPHRAGM722 long i;723 if ((mode_get()&MODE_MASK) != MODE_PLAY){724 // if ((v<ASID_MIN) || (v>ASID_MAX))725 // return;726 727 for (i=0;i<AS_SIZE;i++){728 if (aperture_sizes_table[i].prop_id == v){729 _SetPropertyCase(PROPCASE_USER_AV, &v, sizeof(v));730 //_SetPropertyCase(PROPCASE_AV, &v, sizeof(v));731 return;732 }733 }734 }735 #endif736 }737 738 short shooting_get_drive_mode()739 {740 short m;741 // these cameras do not set PROPCASE_DRIVE_MODE when in custom timer mode742 // SX 200 IS 0,1,2,3,4=Off, 2 Second, Custom, Face Detection743 #if defined (CAM_DRIVE_MODE_FROM_TIMER_MODE)744 short n;745 _GetPropertyCase(PROPCASE_TIMER_MODE, &n, sizeof(n));746 // note we return this only in custom mode.747 // Other cameras would return 3 if any timer mode is set (?) even if it doesn't do multiple exposures748 // note that face detect does multiple exposure749 if(n==3){750 return n;751 }752 #endif753 754 _GetPropertyCase(PROPCASE_DRIVE_MODE, &m, sizeof(m));755 return m;756 }757 758 short shooting_can_focus()759 {760 int m=mode_get()&MODE_SHOOTING_MASK;761 #if !CAM_CAN_SD_OVER_NOT_IN_MF && CAM_CAN_SD_OVERRIDE762 #if CAM_CAN_SD_OVER_IN_AF_LOCK763 if (shooting_get_prop(PROPCASE_AF_LOCK))764 return 1;765 #endif766 return (shooting_get_common_focus_mode() || MODE_IS_VIDEO(m));767 #elif !CAM_CAN_SD_OVERRIDE768 return MODE_IS_VIDEO(m);769 #elif defined (CAMERA_ixus800_sd700)770 // TODO whats the reason for this ?!?771 return (shooting_get_zoom()<8) && (m!=MODE_AUTO) && (m!=MODE_SCN_UNDERWATER);772 #else773 return 1;774 #endif775 }776 777 short shooting_get_common_focus_mode()778 {779 #if !CAM_HAS_MANUAL_FOCUS && CAM_CAN_SD_OVERRIDE780 return shooting_get_subject_distance_override_koef();781 #elif !CAM_CAN_SD_OVERRIDE782 return 0;783 #else784 return shooting_get_focus_mode();785 #endif786 }787 788 short shooting_get_focus_mode()789 {790 short m;791 _GetPropertyCase(PROPCASE_FOCUS_MODE, &m, sizeof(m));792 return m;793 }794 795 796 /*797 short shooting_get_continuous_mode_shoot_count()798 {799 short c;800 _GetPropertyCase(PROPCASE_CONT_MODE_SHOOT_COUNT, &c, sizeof(c));801 return c;802 }803 */804 805 806 void shooting_set_user_av_by_id(int v)807 {808 #if CAM_HAS_IRIS_DIAPHRAGM809 long i;810 if ((mode_get()&MODE_MASK) != MODE_PLAY){811 // if ((v<ASID_MIN) || (v>ASID_MAX))812 // return;813 for (i=0;i<AS_SIZE;i++){814 if (aperture_sizes_table[i].id == v){815 short vv = aperture_sizes_table[i].prop_id;816 _SetPropertyCase(PROPCASE_USER_AV, &vv, sizeof(vv));817 //_SetPropertyCase(PROPCASE_AV, &vv, sizeof(vv));818 return;819 }820 }821 }822 #endif823 }824 825 void shooting_set_user_av_by_id_rel(int v)826 {827 #if CAM_HAS_IRIS_DIAPHRAGM828 if ((mode_get()&MODE_MASK) != MODE_PLAY){829 int cv = shooting_get_user_av_id();830 shooting_set_user_av_by_id(cv+v);831 }832 #endif833 }834 835 836 int shooting_get_day_seconds()837 {838 struct tm *ttm;839 ttm = get_localtime();840 return ttm->tm_hour * 3600 + ttm->tm_min * 60 + ttm->tm_sec;841 }842 843 int shooting_get_tick_count()844 {845 return (int)get_tick_count();846 }847 848 void shooting_set_iso_mode(int v)849 {850 long i;851 for (i=0;i<ISO_SIZE;i++){852 if (iso_table[i].id == v){853 short vv = iso_table[i].prop_id;854 _SetPropertyCase(PROPCASE_ISO_MODE, &vv, sizeof(vv));855 return;856 }857 }858 }859 860 int shooting_in_progress()861 {862 int t = 0;863 _GetPropertyCase(PROPCASE_SHOOTING, &t, sizeof(&t));864 return t != 0;865 }866 867 int shooting_is_flash()868 {869 int t = 0;870 _GetPropertyCase(PROPCASE_IS_FLASH_READY, &t,sizeof(&t));871 return t;872 }873 874 int shooting_is_flash_ready()875 {876 int t = 0;877 /* well, I'm not sure what's exactly is happening here878 * but it works for a610-100e879 */880 // _GetPropertyCase(204, &t, 4);881 // if (t == 3){882 _GetPropertyCase(PROPCASE_FLASH_MODE, &t, sizeof(&t));883 if ((t != 2) && (shooting_in_progress()))884 if (shooting_is_flash()) return _IsStrobeChargeCompleted();885 return 1;886 }887 888 long get_file_counter()889 {890 #ifndef PARAM_FILE_COUNTER891 # error Please define PARAM_FILE_COUNTER in platform`s shooting.c!892 #endif893 long v = 0;894 get_parameter_data(PARAM_FILE_COUNTER, &v, 4);895 return v;896 }897 898 long get_exposure_counter()899 {900 #if defined(USE_FILE_COUNTER_FOR_EXP_COUNTING) || !defined(PARAM_EXPOSURE_COUNTER)901 long v = 0;902 get_parameter_data(PARAM_FILE_COUNTER, &v, 4);903 v = ((v>>4)&0x3FFF);904 return v;905 #else906 long v = 0;907 get_parameter_data(PARAM_EXPOSURE_COUNTER, &v, 4);908 return v;909 #endif910 }911 912 short shooting_get_ev_correction1()913 {914 short evc1 = 0;915 _GetPropertyCase(PROPCASE_EV_CORRECTION_1, &evc1, sizeof(evc1));916 return evc1;917 }918 919 #if CAM_QUALITY_OVERRIDE920 void shooting_set_image_quality(int imq)921 {922 if (imq != 3){923 _SetPropertyCase(PROPCASE_QUALITY, &imq, sizeof(imq));924 }925 }926 #endif927 928 int shooting_get_zoom() {929 return lens_get_zoom_point();930 }931 932 void shooting_set_zoom(int v) {933 int dist;934 if ((mode_get()&MODE_MASK) != MODE_PLAY)935 {936 dist = shooting_get_focus();937 lens_set_zoom_point(v);938 #if defined(CAM_NEED_SET_ZOOM_DELAY)939 msleep(CAM_NEED_SET_ZOOM_DELAY);940 #endif941 shooting_set_focus(dist, SET_NOW);942 }943 }944 945 void shooting_set_zoom_rel(int v) {946 int cv = shooting_get_zoom();947 if ((mode_get()&MODE_MASK) != MODE_PLAY){948 shooting_set_zoom(cv+v);949 }950 }951 952 void shooting_set_zoom_speed(int v) {953 if ((mode_get()&MODE_MASK) != MODE_PLAY){954 lens_set_zoom_speed(v);955 }956 }957 958 int shooting_get_focus() {959 return shooting_get_subject_distance();960 }961 962 void shooting_set_focus(int v, short is_now) {963 int s=v;964 if ((mode_get()&MODE_MASK) != MODE_PLAY){965 if ((is_now) && shooting_can_focus()) {966 if (conf.dof_dist_from_lens) s+=shooting_get_lens_to_focal_plane_width();967 if (!conf.dof_subj_dist_as_near_limit) lens_set_focus_pos(s);968 else {969 int near=shooting_get_near_limit_f(s,shooting_get_min_real_aperture(),get_focal_length(lens_get_zoom_point()));970 if (near>0) lens_set_focus_pos(near);971 }972 }973 else photo_param_put_off.subj_dist=v;974 }975 }976 977 void shooting_set_autoiso(int iso_mode) {978 short max_iso;979 switch (iso_mode) {980 case -1: // ISO HI981 max_iso = conf.autoiso_max_iso_hi*10;982 break;983 case 0: // ISO AUTO984 max_iso = conf.autoiso_max_iso_auto*10;985 break;986 default:987 return;988 }989 int m=mode_get()&MODE_SHOOTING_MASK;990 // TODO also long shutter ?991 if (m==MODE_M || m==MODE_TV || m==MODE_STITCH) return; //Only operate outside of M and Tv992 static const short shutter[]={0, 8, 15, 30, 60, 125, 250, 500, 1000};993 float current_shutter = shooting_get_shutter_speed_from_tv96(shooting_get_tv96());994 995 short current_iso=shooting_get_iso_real();996 997 short min_shutter = shutter[conf.autoiso_shutter];998 if (min_shutter == 0)999 {1000 short IS_factor = (shooting_get_is_mode()<=1)?conf.autoiso_is_factor:1;1001 min_shutter = get_focal_length(lens_get_zoom_point())*conf.autoiso_user_factor / (IS_factor*1000);1002 //min_shutter is NOT 1/Xs but optimized for the calculation.1003 }1004 1005 short target_iso = current_iso * min_shutter * current_shutter;1006 short min_iso = conf.autoiso_min_iso*10;1007 1008 if (target_iso > max_iso)1009 { target_iso = max_iso; }1010 else if (target_iso < min_iso)1011 { target_iso = min_iso; }1012 1013 float target_shutter = current_shutter * current_iso / target_iso;1014 1015 shooting_set_shutter_speed(target_shutter, SET_NOW);1016 1017 shooting_set_iso_real(target_iso, SET_NOW);1018 1019 }1020 1021 void shooting_video_bitrate_change(int v){1022 int m[]={1,2,3,4,5,6,7,8,10,12}; // m[v]/4 = bitrate*1x1023 if (v>=(sizeof(m)/sizeof(m[0]))) v=(sizeof(m)/sizeof(m[0]))-1;1024 #if CAM_CHDK_HAS_EXT_VIDEO_MENU1025 change_video_tables(m[v],4);1026 #endif1027 }1028 1029 float shooting_get_shutter_speed_override_value()1030 {1031 return (float)conf.tv_override_value*shutter_koef[conf.tv_override_koef];1032 }1033 1034 const char * shooting_get_tv_bracket_value()1035 {1036 return expo_shift[conf.tv_bracket_value];1037 }1038 1039 const char * shooting_get_tv_override_value()1040 {1041 return tv_override[conf.tv_override_value];1042 }1043 1044 1045 const char * shooting_get_bracket_type()1046 {1047 return expo_type[conf.bracket_type];1048 }1049 1050 1051 short shooting_get_iso_override_value()1052 {1053 return conf.iso_override_value*koef[conf.iso_override_koef];1054 }1055 1056 short shooting_get_iso_bracket_value()1057 {1058 return conf.iso_bracket_value*koef[conf.iso_bracket_koef];1059 }1060 1061 1062 1063 short shooting_get_av96_override_value()1064 {1065 if (conf.av_override_value<=AS_SIZE) return (short) aperture_sizes_table[conf.av_override_value-1].prop_id;1066 else return (short) (AV96_MAX+32*(conf.av_override_value-AS_SIZE));1067 }1068 1069 const char * shooting_get_av_bracket_value()1070 {1071 return expo_shift[conf.av_bracket_value];1072 }1073 1074 1075 int shooting_get_subject_distance_override_value()1076 {1077 return conf.subj_dist_override_value;1078 }1079 1080 int shooting_get_subject_distance_bracket_value()1081 {1082 return conf.subj_dist_bracket_value*koef[conf.subj_dist_bracket_koef];1083 }1084 1085 int shooting_get_subject_distance_override_koef()1086 {1087 // Define the adjustment factor values for the subject distance override1088 #if MAX_DIST > 1000000 // Superzoom - e.g. SX30, SX401089 static const int koef[] = {0,1,10,100,1000,10000,100000,1000000,-1};1090 #elif MAX_DIST > 100000 // G12, IXUS3101091 static const int koef[] = {0,1,10,100,1000,10000,100000,-1};1092 #else // Original values (MAX_DIST = 65535)1093 static const int koef[] = {0,1,10,100,1000};1094 #endif1095 return koef[(conf.subj_dist_override_koef)];1096 }1097 1098 void shooting_tv_bracketing(int when){1099 short value, is_odd;1100 int m=mode_get()&MODE_SHOOTING_MASK;1101 if (bracketing.shoot_counter==0) { // first shoot1102 bracketing.shoot_counter=1;1103 // if Tv override is enabled... (this was adapted from function shooting_expo_param_override() )1104 if ( ((conf.tv_enum_type) || (conf.tv_override_value)) && (conf.tv_override_koef) && !(conf.override_disable==1) ) {1105 // ...use Tv override value as seed for bracketing:1106 if (conf.tv_enum_type)1107 bracketing.tv96 = 32*(conf.tv_override_value-tv_override_zero_shift);1108 else1109 bracketing.tv96 = shooting_get_tv96_from_shutter_speed(shooting_get_shutter_speed_override_value());1110 }1111 // Tv override is disabled, use camera's opinion of Tv for bracketing seed value.1112 else {1113 if (!(m==MODE_M || m==MODE_TV || m==MODE_LONG_SHUTTER)) bracketing.tv96=shooting_get_tv96();1114 else bracketing.tv96=shooting_get_user_tv96();1115 }1116 bracketing.tv96_step=32*conf.tv_bracket_value;1117 }1118 // other shoots1119 bracketing.shoot_counter++;1120 is_odd=(bracketing.shoot_counter&1);1121 if ((!is_odd) || (conf.bracket_type>0)) bracketing.dtv96+=bracketing.tv96_step;1122 if (((!is_odd) && (conf.bracket_type==0)) || (conf.bracket_type==1)) value=bracketing.tv96-bracketing.dtv96;1123 else value=bracketing.tv96+bracketing.dtv96;1124 1125 shooting_set_tv96_direct(value, when);1126 1127 }1128 1129 void shooting_av_bracketing(int when){1130 short value,is_odd;1131 1132 int m = mode_get()&MODE_SHOOTING_MASK;1133 1134 if (bracketing.shoot_counter == 0) { // first shoot1135 bracketing.shoot_counter = 1;1136 //short av_override_value=shooting_get_av96_override_value;1137 //if (av_override_value) bracketing.av96=av_override_value;1138 if (!(m==MODE_M || m==MODE_AV))1139 bracketing.av96 = shooting_get_av96();1140 else1141 bracketing.av96 = shooting_get_user_av96();1142 bracketing.av96_step = 32*conf.av_bracket_value;1143 }1144 // other shoots1145 bracketing.shoot_counter++;1146 is_odd = (bracketing.shoot_counter&1);1147 value = bracketing.av96;1148 1149 if ( !is_odd || (conf.bracket_type > 0) ||1150 ( is_odd && (conf.bracket_type == 0) && ((bracketing.av96 - bracketing.dav96) < AV96_MIN) ))1151 {1152 bracketing.dav96 += bracketing.av96_step;1153 }1154 1155 if (((!is_odd && (conf.bracket_type == 0)) || (conf.bracket_type == 1)) && ((bracketing.av96 - bracketing.dav96) >= AV96_MIN))1156 {1157 value -= bracketing.dav96;1158 }1159 else if ((is_odd && (conf.bracket_type == 0))1160 || (conf.bracket_type == 2)1161 || ((!is_odd && (conf.bracket_type == 0)) && ((bracketing.av96 - bracketing.dav96) < AV96_MIN)))1162 {1163 value += bracketing.dav96;1164 }1165 1166 if (value != bracketing.av96)1167 {1168 shooting_set_av96_direct(value, when);1169 #ifdef CAM_AV_OVERRIDE_IRIS_FIX1170 extern int _MoveIrisWithAv(short*);1171 _MoveIrisWithAv(&value);1172 #endif1173 }1174 }1175 1176 1177 void shooting_iso_bracketing(int when){1178 short value=0, is_odd;1179 if (bracketing.shoot_counter==0) { // first shoot1180 bracketing.shoot_counter=1;1181 bracketing.iso=shooting_get_iso_real();1182 bracketing.iso_step=shooting_get_iso_bracket_value();1183 }1184 // other shoots1185 bracketing.shoot_counter++;1186 is_odd=(bracketing.shoot_counter&1);1187 1188 if (((!is_odd) || (conf.bracket_type>0)) || (((is_odd) && (conf.bracket_type==0)) && (bracketing.iso<=bracketing.diso)))1189 {1190 bracketing.diso+=bracketing.iso_step;1191 }1192 if ((((!is_odd) && (conf.bracket_type==0)) || (conf.bracket_type==1)) && (bracketing.iso>bracketing.diso))1193 {1194 value=bracketing.iso-bracketing.diso;1195 shooting_set_iso_real(value, when);1196 }1197 else if ((((is_odd) && (conf.bracket_type==0)) || (conf.bracket_type==2)) || (((!is_odd) && (conf.bracket_type==0)) && (bracketing.iso<=bracketing.diso)))1198 {1199 value=bracketing.iso+bracketing.diso;1200 shooting_set_iso_real(value, when);1201 }1202 }1203 1204 void shooting_subject_distance_bracketing(int when){1205 short value=0, is_odd;1206 if (bracketing.shoot_counter==0) { // first shoot1207 bracketing.shoot_counter=1;1208 bracketing.subj_dist=shooting_get_focus();1209 bracketing.subj_dist_step=shooting_get_subject_distance_bracket_value();1210 }1211 // other shoots1212 bracketing.shoot_counter++;1213 is_odd=(bracketing.shoot_counter&1);1214 if (((!is_odd) || (conf.bracket_type>0)) || (((is_odd) && (conf.bracket_type==0)) && (bracketing.subj_dist<=bracketing.dsubj_dist)))1215 {1216 bracketing.dsubj_dist+=bracketing.subj_dist_step;1217 }1218 if ((((!is_odd) && (conf.bracket_type==0)) || (conf.bracket_type==1)) && (bracketing.subj_dist>bracketing.dsubj_dist))1219 {1220 value=bracketing.subj_dist-bracketing.dsubj_dist;1221 shooting_set_focus(value, when);1222 }1223 else if ((((is_odd) && (conf.bracket_type==0)) || (conf.bracket_type==2)) || (((!is_odd) && (conf.bracket_type==0)) && (bracketing.subj_dist<=bracketing.dsubj_dist)))1224 {1225 value=bracketing.subj_dist+bracketing.dsubj_dist;1226 shooting_set_focus(value, when);1227 }1228 }1229 1230 void bracketing_reset()1231 {1232 bracketing.shoot_counter=0;1233 bracketing.av96=0;1234 bracketing.dav96=0;1235 bracketing.tv96=0;1236 bracketing.dtv96=0;1237 bracketing.sv96=0;1238 bracketing.dsv96=0;1239 bracketing.iso=0;1240 bracketing.diso=0;1241 bracketing.subj_dist=0;1242 bracketing.dsubj_dist=0;1243 bracketing.type=0;1244 }1245 1246 void bracketing_step(int when)1247 {1248 if (conf.tv_bracket_value && !(conf.override_disable==1 && conf.override_disable_all)) shooting_tv_bracketing(when);1249 else if (conf.av_bracket_value && !(conf.override_disable==1 && conf.override_disable_all)) shooting_av_bracketing(when);1250 else if ((conf.iso_bracket_value && !(conf.override_disable==1 && conf.override_disable_all)) && (conf.iso_bracket_koef)) shooting_iso_bracketing(when);1251 else if ((conf.subj_dist_bracket_value && !(conf.override_disable==1 && conf.override_disable_all)) && (conf.subj_dist_bracket_koef)) shooting_subject_distance_bracketing(when);1252 else if ((conf.subj_dist_bracket_value) && (conf.subj_dist_bracket_koef)) shooting_subject_distance_bracketing(when) ;1253 }1254 1255 void shooting_bracketing(void)1256 {1257 short drive_mode=shooting_get_drive_mode();1258 if (shooting_get_drive_mode()!=0)1259 {1260 int m=mode_get()&MODE_SHOOTING_MASK;1261 if (m!=MODE_STITCH && m!=MODE_SCN_BEST_IMAGE)1262 {1263 if (state_shooting_progress != SHOOTING_PROGRESS_PROCESSING) bracketing_reset() ;1264 bracketing_step(SET_NOW) ;1265 }1266 }1267 1268 }1269 1270 1271 #if CAM_REAR_CURTAIN1272 void shooting_set_flash_sync_curtain(int curtain){1273 _SetPropertyCase(PROPCASE_FLASH_SYNC_CURTAIN, &curtain, sizeof(curtain));1274 }1275 #endif1276 1277 // forces manual flash. if set, flash will ALWAYS be triggered (manual)1278 void shooting_set_flash_video_override(int flash, int power){1279 int mode = 1;1280 if ((conf.flash_manual_override && conf.flash_video_override && (movie_status > 1)) || (conf.flash_manual_override && !conf.flash_video_override)) {1281 _SetPropertyCase(PROPCASE_FLASH_ADJUST_MODE, &mode, sizeof(mode));1282 _SetPropertyCase(PROPCASE_FLASH_FIRE, &flash, sizeof(flash));1283 _SetPropertyCase(PROPCASE_FLASH_MANUAL_OUTPUT, &power, sizeof(power));1284 }1285 }1286 1287 // TODO sd990 hack for overrides1288 // caller must save regs1289 int captseq_hack_override_active() {1290 if (state_kbd_script_run)1291 if ( photo_param_put_off.tv96 || photo_param_put_off.sv96 )1292 return 1;1293 if(conf.override_disable==1)1294 return 0;1295 if(conf.iso_override_value && conf.iso_override_koef)1296 return 1;1297 if((conf.tv_enum_type || conf.tv_override_value) && conf.tv_override_koef)1298 return 1;1299 return 0;1300 }1301 1302 extern int usb_remote_active ;1303 1304 void __attribute__((naked,noinline)) shooting_expo_param_override(void){1305 asm volatile("STMFD SP!, {R0-R12,LR}\n");1306 1307 //if (conf.tv_override) shooting_set_tv96_direct(-384-32*conf.tv_override);1308 //short drive_mode=shooting_get_drive_mode();1309 /*if(drive_mode!=last_drive_mode)1310 {1311 if (last_drive_mode==0) shoot_counter=0;1312 last_drive_mode=drive_mode;1313 }*/1314 //int m=mode_get()&MODE_SHOOTING_MASK;1315 1316 if ( ((state_kbd_script_run) || (usb_remote_active)) && photo_param_put_off.tv96 ) {1317 shooting_set_tv96_direct(photo_param_put_off.tv96, SET_NOW);1318 photo_param_put_off.tv96=0;1319 }1320 else if (((conf.tv_enum_type) || (conf.tv_override_value)) && (conf.tv_override_koef) && !(conf.override_disable==1))1321 {1322 if (conf.tv_enum_type)1323 shooting_set_tv96_direct(32*(conf.tv_override_value-(tv_override_zero_shift)),SET_NOW);1324 else1325 shooting_set_tv96_direct(shooting_get_tv96_from_shutter_speed(shooting_get_shutter_speed_override_value()), SET_NOW);1326 }1327 1328 if (((state_kbd_script_run) || (usb_remote_active)) && (photo_param_put_off.sv96)) {1329 shooting_set_sv96(photo_param_put_off.sv96, SET_NOW);1330 photo_param_put_off.sv96=0;1331 }1332 else if ((conf.iso_override_value) && (conf.iso_override_koef) && !(conf.override_disable==1))1333 shooting_set_iso_real(shooting_get_iso_override_value(), SET_NOW);1334 else if (conf.autoiso_enable && shooting_get_flash_mode()/*NOT FOR FLASH AUTO MODE*/ && !(conf.override_disable==1 && conf.override_disable_all))1335 shooting_set_autoiso(shooting_get_iso_mode());1336 1337 if (((state_kbd_script_run) || (usb_remote_active)) && (photo_param_put_off.av96)) {1338 shooting_set_av96_direct(photo_param_put_off.av96, SET_NOW);1339 photo_param_put_off.av96=0;1340 }1341 else if (conf.av_override_value && !(conf.override_disable==1))1342 shooting_set_av96_direct(shooting_get_av96_override_value(), SET_NOW);1343 1344 if (((state_kbd_script_run) || (usb_remote_active)) && (photo_param_put_off.subj_dist)) {1345 shooting_set_focus(photo_param_put_off.subj_dist, SET_NOW);1346 photo_param_put_off.subj_dist=0;1347 }1348 else if ((conf.subj_dist_override_value) && (conf.subj_dist_override_koef) && !(conf.override_disable==1))1349 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW);1350 1351 #if CAM_HAS_ND_FILTER1352 if ((state_kbd_script_run) && (photo_param_put_off.nd_filter)) {1353 shooting_set_nd_filter_state(photo_param_put_off.nd_filter, SET_NOW);1354 photo_param_put_off.nd_filter=0;1355 }1356 else if (conf.nd_filter_state && !(conf.override_disable==1))1357 shooting_set_nd_filter_state(conf.nd_filter_state, SET_NOW);1358 #endif1359 1360 #if CAM_REAR_CURTAIN1361 shooting_set_flash_sync_curtain(conf.flash_sync_curtain);1362 #endif1363 1364 1365 shooting_set_flash_video_override(conf.flash_manual_override,conf.flash_video_override_power);1366 #if CAM_QUALITY_OVERRIDE1367 // this doesn't really need to be set in the override hook.1368 // should only need to be set once if the users doesn't change back, but doing it here ensures it is set1369 shooting_set_image_quality(conf.fast_image_quality);1370 #endif1371 1372 asm volatile("LDMFD SP!, {R0-R12,PC}\n");1373 }1374 void unlock_optical_zoom(void){1375 1376 #if CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO1377 if (conf.unlock_optical_zoom_for_video) _UnsetZoomForMovie();1378 #endif1379 1380 #if CAM_EV_IN_VIDEO1381 set_ev_video_avail(0);1382 #endif1383 1384 }1385 1386 1387 #if CAM_EV_IN_VIDEO1388 1389 int ev_video_avail;1390 int ev_video;1391 int save_tv_video;1392 int tv_min_video;1393 1394 int get_ev_video_avail(void){1395 return ev_video_avail;1396 }1397 1398 void set_ev_video_avail(int x){1399 if (ev_video_avail==x) return;1400 ev_video_avail=x;1401 if (x) {1402 ev_video=0;1403 _ExpCtrlTool_StopContiAE(0,0);1404 _GetPropertyCase(PROPCASE_TV,&save_tv_video,2);1405 if ((mode_get()&MODE_SHOOTING_MASK)==MODE_VIDEO_SPEED) tv_min_video=577; // 1/601406 else tv_min_video=480; //1/301407 }1408 else _ExpCtrlTool_StartContiAE(0,0);1409 }1410 1411 int get_ev_video(void){1412 return ev_video;1413 }1414 1415 void set_ev_video(int x){1416 short ev, tv;1417 if ((x<-4)||(x>4)) return;1418 ev=48*x;1419 tv=save_tv_video-ev;1420 if (tv>=tv_min_video) {1421 ev_video=x;1422 _SetAE_ShutterSpeed(&tv);1423 }1424 }1425 1426 #endif1427 1428 int shooting_mode_canon2chdk(int canonmode) {1429 int i;1430 for (i=0; i < MODESCNT; i++) {1431 if (modemap[i].canonmode == canonmode)1432 return modemap[i].hackmode;1433 }1434 return 0;1435 }1436 1437 int shooting_mode_chdk2canon(int hackmode) {1438 int i;1439 for (i=0; i < MODESCNT; i++) {1440 if (modemap[i].hackmode == hackmode)1441 return modemap[i].canonmode;1442 }1443 return -1; // 0 is a valid mode on old cameras!1444 }1445 1446 int shooting_set_mode_chdk(int mode) {1447 int canonmode = shooting_mode_chdk2canon(mode);1448 if (canonmode == -1 || !rec_mode_active())1449 return 0;1450 _SetCurrentCaptureModeType(canonmode);1451 // TODO since mode seems to be fully set when this returns,1452 // we could check if it worked1453 return 1;1454 }1455 1456 int shooting_set_mode_canon(int canonmode) {1457 if(canonmode == -1 || !rec_mode_active())1458 return 0;1459 _SetCurrentCaptureModeType(canonmode);1460 return 1;1461 }1462 1463 // override in platform/<cam>/main.c if playrec_mode is not found or different1464 int __attribute__((weak)) rec_mode_active(void) {1465 return (playrec_mode==2 || playrec_mode==4 || playrec_mode==5);1466 }1467 1468 // Converted from MODE_IS_VIDEO macro (philmoz July 2011)1469 int mode_is_video(int m)1470 {1471 m = m & MODE_SHOOTING_MASK;1472 return (m==MODE_VIDEO_STD ||1473 m==MODE_VIDEO_SPEED ||1474 m==MODE_VIDEO_COMPACT ||1475 m==MODE_VIDEO_MY_COLORS ||1476 m==MODE_VIDEO_COLOR_ACCENT ||1477 m==MODE_VIDEO_COLOR_SWAP ||1478 m==MODE_VIDEO_MINIATURE ||1479 m==MODE_VIDEO_TIME_LAPSE ||1480 m==MODE_VIDEO_PORTRAIT ||1481 m==MODE_VIDEO_NIGHT ||1482 m==MODE_VIDEO_INDOOR ||1483 m==MODE_VIDEO_FOLIAGE ||1484 m==MODE_VIDEO_SNOW ||1485 m==MODE_VIDEO_BEACH ||1486 m==MODE_VIDEO_AQUARIUM ||1487 m==MODE_VIDEO_SUPER_MACRO ||1488 m==MODE_VIDEO_STITCH ||1489 m==MODE_VIDEO_MANUAL ||1490 m==MODE_VIDEO_MINIATURE ||1491 m==MODE_VIDEO_IFRAME_MOVIE1492 // not clear if this should be considered a video mode ?1493 /* m==MODE_VIDEO_MOVIE_DIGEST*/1494 );1495 }1496 1497 // currently nothing needs to override this, so not weak1498 int /*__attribute__((weak))*/ mode_get(void) {1499 int mode, t=0xFF;1500 1501 mode = (rec_mode_active())?MODE_REC:MODE_PLAY;1502 1503 #ifdef CAM_SWIVEL_SCREEN1504 mode |= (screen_opened())?MODE_SCREEN_OPENED:0;1505 mode |= (screen_rotated())?MODE_SCREEN_ROTATED:0;1506 #endif1507 1508 _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4);1509 mode |= shooting_mode_canon2chdk(t);1510 1511 return (mode);1512 }1513 1514 // Only needed on VxWorks1515 #if CAM_DRAW_EXPOSITION1516 1517 // compare PROPCASE_TV with shutter_speeds_table1518 char* shooting_get_tv_str() {1519 short int tvv;1520 long i;1521 _GetPropertyCase(PROPCASE_TV, &tvv, sizeof(tvv));1522 for(i=0; i<SS_SIZE; i++) {1523 if(shutter_speeds_table[i].prop_id >= tvv)1524 return (char*)shutter_speeds_table[i].name;1525 }1526 return (void*)"?";1527 }1528 1529 // compare PROPCASE_AV with aperture_sizes_table1530 char* shooting_get_av_str() {1531 short int avv;1532 long i;1533 _GetPropertyCase(PROPCASE_AV, &avv, sizeof(avv));1534 for(i=0; i<AS_SIZE; i++) {1535 if(aperture_sizes_table[i].prop_id == avv)1536 return (char*)aperture_sizes_table[i].name;1537 }1538 return (char*) "?";1539 }1540 1541 #endif1542 1543 /*1544 char* shooting_get_iso_str() {1545 short int isov;1546 long i;1547 _GetPropertyCase(PROPCASE_ISO_MODE, &isov, sizeof(isov));1548 for(i=0; i<ISO_SIZE; i++) {1549 if(iso_table[i].prop_id == isov)1550 return (char*)iso_table[i].name;1551 }1552 return (char*) "?";1553 }1554 */ -
trunk/platform/generic/wrappers.c
r1623 r1632 267 267 #endif 268 268 } 269 270 #if CAM_HAS_ND_FILTER 271 void PutInNdFilter() { _PutInNdFilter(); } 272 void PutOutNdFilter() { _PutOutNdFilter(); } 273 #endif 274 275 long GetCurrentAvValue() { return _GetCurrentAvValue(); } 276 long IsStrobeChargeCompleted() { return _IsStrobeChargeCompleted(); } 277 void SetCurrentCaptureModeType() { _SetCurrentCaptureModeType(); } 278 279 #if CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 280 void UnsetZoomForMovie() { _UnsetZoomForMovie(); } 281 #endif 282 283 #ifdef CAM_AV_OVERRIDE_IRIS_FIX 284 int MoveIrisWithAv(short *v) { return _MoveIrisWithAv(v); } 285 #endif 286 287 #if CAM_EV_IN_VIDEO 288 void ExpCtrlTool_StartContiAE(int v1, int v2) { _ExpCtrlTool_StartContiAE(v1,v2); } 289 void ExpCtrlTool_StopContiAE(int v1, int v2) { _ExpCtrlTool_StopContiAE(v1, v2); } 290 short SetAE_ShutterSpeed(short *tv) { _SetAE_ShutterSpeed(tv); } 291 #endif 269 292 270 293 //---------------------------------------------------------------------------- -
trunk/platform/ixus1000_sd4500/shooting.c
r1590 r1632 99 99 100 100 */ 101 staticconst CapturemodeMap modemap[] = {101 const CapturemodeMap modemap[] = { 102 102 { MODE_AUTO, 32768 }, 103 103 { MODE_P, 32772 }, -
trunk/platform/ixus100_sd780/shooting.c
r1328 r1632 110 110 canon mode list FFB2D2EC in 100e 111 111 */ 112 staticconst CapturemodeMap modemap[] = {112 const CapturemodeMap modemap[] = { 113 113 { MODE_AUTO, 32768 }, 114 114 { MODE_P, 32772 }, -
trunk/platform/ixus120_sd940/shooting.c
r1216 r1632 82 82 }; 83 83 84 st atic struct {84 struct { 85 85 int hackmode; 86 86 int canonmode; -
trunk/platform/ixus200_sd980/shooting.c
r1212 r1632 82 82 }; 83 83 84 st atic struct {84 struct { 85 85 int hackmode; 86 86 int canonmode; -
trunk/platform/ixus220_elph300hs/shooting.c
r1448 r1632 90 90 // modemap, values have been verified for IXUS220HS on 1.00c/1.01a/1.01c 91 91 // http://chdk.setepontos.com/index.php?topic=6341.msg76892#msg76892 92 staticconst CapturemodeMap modemap[] = {92 const CapturemodeMap modemap[] = { 93 93 { MODE_AUTO, 32768 }, 94 94 { MODE_P, 32772 }, … … 128 128 #include "../generic/shooting.c" 129 129 130 // Override ISO settings (need to do this before exposure calc for ISO as well as after)131 void __attribute__((naked,noinline)) shooting_expo_iso_override(void){132 asm volatile("STMFD SP!, {R0-R12,LR}\n");133 134 if ((state_kbd_script_run) && (photo_param_put_off.sv96))135 {136 shooting_set_sv96(photo_param_put_off.sv96, SET_NOW);137 // photo_param_put_off.sv96 is not reset here, it will be reset in next call to shooting_expo_param_override138 }139 else if ((conf.iso_override_value) && (conf.iso_override_koef) && !(conf.override_disable==1))140 shooting_set_iso_real(shooting_get_iso_override_value(), SET_NOW);141 else if (conf.autoiso_enable && shooting_get_flash_mode()/*NOT FOR FLASH AUTO MODE*/ && !(conf.override_disable==1 && conf.override_disable_all))142 shooting_set_autoiso(shooting_get_iso_mode());143 144 asm volatile("LDMFD SP!, {R0-R12,PC}\n");145 }146 147 130 long get_file_next_counter() { 148 131 return get_file_counter(); -
trunk/platform/ixus230_elph310hs/shooting.c
r1567 r1632 82 82 }; 83 83 84 staticconst CapturemodeMap modemap[] = {84 const CapturemodeMap modemap[] = { 85 85 { MODE_AUTO, 32768 }, 86 86 { MODE_P, 32772 }, -
trunk/platform/ixus300_sd4000/shooting.c
r1377 r1632 103 103 // finsig2 found 33324, 33323, 33320, 33322, 33321, 33288, 33289 in firmware but not in modemap 104 104 // ROM:FFC0041C Table with Data Words 105 staticconst CapturemodeMap modemap[] = {105 const CapturemodeMap modemap[] = { 106 106 { MODE_AUTO, 32768 }, 107 107 { MODE_P, 32772 }, -
trunk/platform/ixus310_elph500hs/shooting.c
r1440 r1632 104 104 */ 105 105 // IXUS 310 HS modelist table found @0xff4ce6f0 (firmware 1.00a) 106 staticconst CapturemodeMap modemap[] = {106 const CapturemodeMap modemap[] = { 107 107 { MODE_TV, 32771 }, 108 108 { MODE_AV, 32770 }, … … 140 140 #include "../generic/shooting.c" 141 141 142 // Override ISO settings (need to do this before exposure calc for ISO as well as after)143 void __attribute__((naked,noinline)) shooting_expo_iso_override(void){144 asm volatile("STMFD SP!, {R0-R12,LR}\n");145 146 if ((state_kbd_script_run) && (photo_param_put_off.sv96))147 {148 shooting_set_sv96(photo_param_put_off.sv96, SET_NOW);149 // photo_param_put_off.sv96 is not reset here, it will be reset in next call to shooting_expo_param_override150 }151 else if ((conf.iso_override_value) && (conf.iso_override_koef) && !(conf.override_disable==1))152 shooting_set_iso_real(shooting_get_iso_override_value(), SET_NOW);153 else if (conf.autoiso_enable && shooting_get_flash_mode()/*NOT FOR FLASH AUTO MODE*/ && !(conf.override_disable==1 && conf.override_disable_all))154 shooting_set_autoiso(shooting_get_iso_mode());155 156 asm volatile("LDMFD SP!, {R0-R12,PC}\n");157 }158 159 142 long get_file_next_counter() { 160 143 return get_file_counter(); -
trunk/platform/ixus40_sd300/shooting.c
r880 r1632 94 94 NOTE: mode override is not implemented on this camera 95 95 */ 96 staticconst CapturemodeMap modemap[] = {96 const CapturemodeMap modemap[] = { 97 97 { MODE_P, 1 }, 98 98 { MODE_LONG_SHUTTER, 2 }, // guessed -
trunk/platform/ixus50_sd400/shooting.c
r1276 r1632 93 93 */ 94 94 95 staticconst CapturemodeMap modemap[] = {95 const CapturemodeMap modemap[] = { 96 96 { MODE_SCN_DIGITAL_MACRO, 0 }, 97 97 { MODE_P, 1 }, -
trunk/platform/ixus55_sd450/shooting.c
r1276 r1632 92 92 canon mode list FF95FC68 in 100b 93 93 */ 94 staticconst CapturemodeMap modemap[] = {94 const CapturemodeMap modemap[] = { 95 95 { MODE_P, 0 }, 96 96 { MODE_LONG_SHUTTER, 1 }, // guessed long shutter -
trunk/platform/ixus60_sd600/shooting.c
r1276 r1632 92 92 320 x 240 (1 min. at 60 fps), 160 x 120 (3 min. at 15 fps 93 93 */ 94 staticconst CapturemodeMap modemap[] = {94 const CapturemodeMap modemap[] = { 95 95 { MODE_P, 32772 }, // note, this is called Manual, but eqivalent to P on cameras with real manual 96 96 { MODE_AUTO, 32768 }, -
trunk/platform/ixus65_sd630/shooting.c
r1276 r1632 89 89 */ 90 90 /* names below mostly guessed from a540 and ixus60_sd600 */ 91 staticconst CapturemodeMap modemap[] = {91 const CapturemodeMap modemap[] = { 92 92 // common, should be OK 93 93 { MODE_P, 32772 }, // may be called manual, but effectively P -
trunk/platform/ixus700_sd500/shooting.c
r1276 r1632 95 95 Movie: 640x480, 320x240, 160x120 96 96 */ 97 staticconst CapturemodeMap modemap[] = {97 const CapturemodeMap modemap[] = { 98 98 { MODE_SCN_DIGITAL_MACRO, 0 }, 99 99 { MODE_P, 1 }, -
trunk/platform/ixus70_sd1000/shooting.c
r1276 r1632 95 95 */ 96 96 // PROPCACE 49 97 staticconst CapturemodeMap modemap[] = {97 const CapturemodeMap modemap[] = { 98 98 { MODE_LONG_SHUTTER, 32774 }, // guessed 99 99 { MODE_AUTO, 32768 }, -
trunk/platform/ixus750_sd550/shooting.c
r1276 r1632 93 93 canon mode list FF960434 in 100f 94 94 */ 95 staticconst CapturemodeMap modemap[] = {95 const CapturemodeMap modemap[] = { 96 96 { MODE_P, 0 }, // guessed! 97 97 { MODE_LONG_SHUTTER, 1 }, // guessed! -
trunk/platform/ixus75_sd750/shooting.c
r1276 r1632 95 95 */ 96 96 // PROPCACE 49 97 staticconst CapturemodeMap modemap[] = {97 const CapturemodeMap modemap[] = { 98 98 { MODE_LONG_SHUTTER, 32774 }, // guessed! 99 99 { MODE_AUTO, 32768 }, -
trunk/platform/ixus800_sd700/shooting.c
r1276 r1632 97 97 canon mode list FF972360 in 100b 98 98 */ 99 staticconst CapturemodeMap modemap[] = {99 const CapturemodeMap modemap[] = { 100 100 { MODE_LONG_SHUTTER, 32774 }, // guessed! 101 101 { MODE_AUTO, 32768 }, -
trunk/platform/ixus80_sd1100/shooting.c
r860 r1632 101 101 */ 102 102 // PROPCACE 49 103 staticconst CapturemodeMap modemap[] = {103 const CapturemodeMap modemap[] = { 104 104 { MODE_LONG_SHUTTER, 32774 }, // guessed 105 105 { MODE_AUTO, 32768 }, -
trunk/platform/ixus850_sd800/shooting.c
r1276 r1632 94 94 */ 95 95 // PROPCACE 49 96 staticconst CapturemodeMap modemap[] = {96 const CapturemodeMap modemap[] = { 97 97 { MODE_LONG_SHUTTER, 32774 }, // guessed 98 98 { MODE_AUTO, 32768 }, -
trunk/platform/ixus85_sd770/shooting.c
r1376 r1632 129 129 }; 130 130 131 staticconst CapturemodeMap modemap[] = {131 const CapturemodeMap modemap[] = { 132 132 133 133 { MODE_AUTO, 32768 }, -
trunk/platform/ixus860_sd870/shooting.c
r860 r1632 96 96 */ 97 97 // PROPCACE 49 98 staticconst CapturemodeMap modemap[] = {98 const CapturemodeMap modemap[] = { 99 99 { MODE_LONG_SHUTTER, 32774 }, 100 100 { MODE_AUTO, 32768 }, -
trunk/platform/ixus870_sd880/shooting.c
r860 r1632 124 124 canon mode list FFB2D2EC in 100e 125 125 */ 126 staticconst CapturemodeMap modemap[] = {126 const CapturemodeMap modemap[] = { 127 127 { MODE_VIDEO_STD, 2600 }, 128 128 { MODE_VIDEO_COLOR_ACCENT, 2598 }, -
trunk/platform/ixus900_sd900/shooting.c
r1276 r1632 105 105 // PROPCASE 49 106 106 // Mapping between camera mode and PROPCASE_SHOOTING_MODE 107 staticconst CapturemodeMap modemap[] = { // PROPCASE 0, check with CHDK debug menu option "Show Parameter Data 0"107 const CapturemodeMap modemap[] = { // PROPCASE 0, check with CHDK debug menu option "Show Parameter Data 0" 108 108 {MODE_AUTO, 32768}, 109 109 {MODE_M, 33772}, -
trunk/platform/ixus90_sd790/shooting.c
r1376 r1632 83 83 }; 84 84 85 st atic struct {85 struct { 86 86 int hackmode; 87 87 int canonmode; -
trunk/platform/ixus950_sd850/shooting.c
r1276 r1632 103 103 canon mode list FFB4B564 in 100c 104 104 */ 105 staticconst CapturemodeMap modemap[] = {105 const CapturemodeMap modemap[] = { 106 106 { MODE_LONG_SHUTTER, 32774 }, // guessed 107 107 { MODE_AUTO, 32768 }, -
trunk/platform/ixus95_sd1200/shooting.c
r1376 r1632 91 91 92 92 // PROPCACE 49 93 staticconst CapturemodeMap modemap[] = {93 const CapturemodeMap modemap[] = { 94 94 { MODE_AUTO, 32768 }, 95 95 { MODE_M, 32769 }, -
trunk/platform/ixus960_sd950/shooting.c
r880 r1632 87 87 */ 88 88 89 staticconst CapturemodeMap modemap[] = {89 const CapturemodeMap modemap[] = { 90 90 { MODE_LONG_SHUTTER, 32774 }, // guessed 91 91 { MODE_AUTO, 32768 }, -
trunk/platform/ixus970_sd890/shooting.c
r1377 r1632 143 143 canon mode list FFAF9460 in 100b 144 144 */ 145 staticconst CapturemodeMap modemap[] = {145 const CapturemodeMap modemap[] = { 146 146 { MODE_LONG_SHUTTER, 32774 }, // guessed 147 147 { MODE_AUTO, 32768 }, -
trunk/platform/ixus980_sd990/shooting.c
r1276 r1632 105 105 canon mode list FFB49820 in 100e 106 106 */ 107 staticconst CapturemodeMap modemap[] = {107 const CapturemodeMap modemap[] = { 108 108 { MODE_AUTO, 32768 }, 109 109 { MODE_M, 32769 }, // unlike most other ixus/sd, this has a real M mode -
trunk/platform/ixusizoom_sd30/shooting.c
r1276 r1632 87 87 // TODO this is completely wrong, camera has no M, Tv, Av. Should have "long shutter" 88 88 // valid mode 0-15, 0x10010-0x1012 89 staticconst CapturemodeMap modemap[] = {89 const CapturemodeMap modemap[] = { 90 90 { MODE_AUTO, 6 }, 91 91 { MODE_P, 1 }, -
trunk/platform/s2is/shooting.c
r860 r1632 86 86 canon mode list FF983777 in 100e 87 87 */ 88 staticconst CapturemodeMap modemap[] = {88 const CapturemodeMap modemap[] = { 89 89 { MODE_AUTO, 5 }, 90 90 { MODE_P, 1 }, -
trunk/platform/s3is/shooting.c
r860 r1632 88 88 canon mode list @FF98F378 in 100a 89 89 */ 90 staticconst CapturemodeMap modemap[] = {90 const CapturemodeMap modemap[] = { 91 91 { MODE_AUTO, 32768 }, 92 92 { MODE_P, 32772 }, -
trunk/platform/s5is/shooting.c
r860 r1632 94 94 canon mode list in 101a 95 95 */ 96 staticconst CapturemodeMap modemap[] = {96 const CapturemodeMap modemap[] = { 97 97 { MODE_AUTO, 32768 }, 98 98 { MODE_P, 32772 }, -
trunk/platform/s90/shooting.c
r888 r1632 93 93 }; 94 94 95 staticconst CapturemodeMap modemap[] = {95 const CapturemodeMap modemap[] = { 96 96 { MODE_AUTO, 32768 }, 97 97 { MODE_P, 32772 }, // also C1,C2 -
trunk/platform/s95/shooting.c
r1244 r1632 91 91 }; 92 92 93 staticconst CapturemodeMap modemap[] = {93 const CapturemodeMap modemap[] = { 94 94 { MODE_P, 32772 }, 95 95 { MODE_TV, 32771 }, -
trunk/platform/sx1/shooting.c
r860 r1632 93 93 canon mode list FFBBB0CC in 200h 94 94 */ 95 staticconst CapturemodeMap modemap[] = {95 const CapturemodeMap modemap[] = { 96 96 { MODE_AUTO, 32768 }, 97 97 { MODE_P, 32772 }, -
trunk/platform/sx10/shooting.c
r860 r1632 93 93 canon mode list FFB74378 in 100c 94 94 */ 95 staticconst CapturemodeMap modemap[] = {95 const CapturemodeMap modemap[] = { 96 96 { MODE_AUTO, 32768 }, 97 97 { MODE_P, 32772 }, -
trunk/platform/sx100is/shooting.c
r1345 r1632 93 93 canon mode list FFE9E7EC in 100b, ffe9e824 in 100c 94 94 */ 95 staticconst CapturemodeMap modemap[] = {95 const CapturemodeMap modemap[] = { 96 96 { MODE_AUTO, 32768 }, 97 97 { MODE_P, 32772 }, -
trunk/platform/sx110is/shooting.c
r860 r1632 93 93 canon mode list FFEDD5F4 in 100b 94 94 */ 95 staticconst CapturemodeMap modemap[] = {95 const CapturemodeMap modemap[] = { 96 96 { MODE_VIDEO_STD, 2600 }, //Verified 97 97 { MODE_VIDEO_COMPACT, 2602 }, //Verified -
trunk/platform/sx120is/shooting.c
r1527 r1632 80 80 81 81 82 staticconst CapturemodeMap modemap[] = {82 const CapturemodeMap modemap[] = { 83 83 { MODE_VIDEO_STD, 2600 }, 84 84 { MODE_VIDEO_COMPACT, 2602 }, -
trunk/platform/sx130is/shooting.c
r1258 r1632 100 100 */ 101 101 // Corrected for SX130 102 staticconst CapturemodeMap modemap[] = {102 const CapturemodeMap modemap[] = { 103 103 { MODE_AUTO, 32768 }, 104 104 { MODE_P, 32772 }, -
trunk/platform/sx150is/shooting.c
r1598 r1632 100 100 */ 101 101 // Corrected for SX150 102 staticconst CapturemodeMap modemap[] = {102 const CapturemodeMap modemap[] = { 103 103 { MODE_AUTO, 32768 }, 104 104 { MODE_P, 32772 }, -
trunk/platform/sx20/shooting.c
r1303 r1632 93 93 canon mode list FFB74378 in 100c 94 94 */ 95 staticconst CapturemodeMap modemap[] = {95 const CapturemodeMap modemap[] = { 96 96 { MODE_AUTO, 32768 }, 97 97 { MODE_P, 32772 }, -
trunk/platform/sx200is/shooting.c
r880 r1632 91 91 canon mode list FFB6D0A4 in 100c 92 92 */ 93 staticconst CapturemodeMap modemap[] = {93 const CapturemodeMap modemap[] = { 94 94 { MODE_AUTO, 32768 }, 95 95 { MODE_P, 32772 }, -
trunk/platform/sx220hs/shooting.c
r1305 r1632 86 86 }; 87 87 88 staticconst CapturemodeMap modemap[] = {88 const CapturemodeMap modemap[] = { 89 89 { MODE_AUTO, 32768 }, 90 90 { MODE_P, 32772 }, … … 125 125 #include "../generic/shooting.c" 126 126 127 // Override ISO settings (need to do this before exposure calc for ISO as well as after)128 void __attribute__((naked,noinline)) shooting_expo_iso_override(void){129 asm volatile("STMFD SP!, {R0-R12,LR}\n");130 131 if ((state_kbd_script_run) && (photo_param_put_off.sv96))132 {133 shooting_set_sv96(photo_param_put_off.sv96, SET_NOW);134 // photo_param_put_off.sv96 is not reset here, it will be reset in next call to shooting_expo_param_override135 }136 else if ((conf.iso_override_value) && (conf.iso_override_koef) && !(conf.override_disable==1))137 shooting_set_iso_real(shooting_get_iso_override_value(), SET_NOW);138 else if (conf.autoiso_enable && shooting_get_flash_mode()/*NOT FOR FLASH AUTO MODE*/ && !(conf.override_disable==1 && conf.override_disable_all))139 shooting_set_autoiso(shooting_get_iso_mode());140 141 asm volatile("LDMFD SP!, {R0-R12,PC}\n");142 }143 144 127 long get_file_next_counter() { 145 128 return get_file_counter(); -
trunk/platform/sx230hs/shooting.c
r1331 r1632 94 94 Standard Definition: 640 x 480 (30 fps), 320 x 240 (30 fps) 95 95 */ 96 staticconst CapturemodeMap modemap[] = {96 const CapturemodeMap modemap[] = { 97 97 { MODE_AUTO , 0x8000 }, 98 98 { MODE_P , 0x8004 }, // Called "camera manual" on many cameras without a true manual mode, only allows +/- Ev adjustment … … 132 132 #include "../generic/shooting.c" 133 133 134 // Override ISO settings (need to do this before exposure calc for ISO, as well as after)135 136 void __attribute__((naked,noinline)) shooting_expo_iso_override(void){137 138 asm volatile("STMFD SP!, {R0-R12,LR}\n");139 140 if ((state_kbd_script_run) && (photo_param_put_off.sv96))141 {142 shooting_set_sv96(photo_param_put_off.sv96, SET_NOW);143 // photo_param_put_off.sv96 is not reset here, it will be reset in next call to shooting_expo_param_override144 }145 else if ((conf.iso_override_value) && (conf.iso_override_koef) && !(conf.override_disable==1))146 shooting_set_iso_real(shooting_get_iso_override_value(), SET_NOW);147 else if (conf.autoiso_enable && shooting_get_flash_mode()/*NOT FOR FLASH AUTO MODE*/ && !(conf.override_disable==1 && conf.override_disable_all))148 shooting_set_autoiso(shooting_get_iso_mode());149 150 asm volatile("LDMFD SP!, {R0-R12,PC}\n");151 }152 153 154 134 long get_file_next_counter() { 155 135 return get_file_counter(); -
trunk/platform/sx30/shooting.c
r1273 r1632 97 97 */ 98 98 // SX30 modelist table found @0xFFC67954 (firmware 1.00h) 99 staticconst CapturemodeMap modemap[] = {99 const CapturemodeMap modemap[] = { 100 100 { MODE_M, 32769 }, 101 101 { MODE_TV, 32771 }, … … 131 131 #include "../generic/shooting.c" 132 132 133 // Override ISO settings (need to do this before exposure calc for ISO as well as after)134 void __attribute__((naked,noinline)) shooting_expo_iso_override(void){135 asm volatile("STMFD SP!, {R0-R12,LR}\n");136 137 if ((state_kbd_script_run) && (photo_param_put_off.sv96))138 {139 shooting_set_sv96(photo_param_put_off.sv96, SET_NOW);140 // photo_param_put_off.sv96 is not reset here, it will be reset in next call to shooting_expo_param_override141 }142 else if ((conf.iso_override_value) && (conf.iso_override_koef) && !(conf.override_disable==1))143 shooting_set_iso_real(shooting_get_iso_override_value(), SET_NOW);144 else if (conf.autoiso_enable && shooting_get_flash_mode()/*NOT FOR FLASH AUTO MODE*/ && !(conf.override_disable==1 && conf.override_disable_all))145 shooting_set_autoiso(shooting_get_iso_mode());146 147 asm volatile("LDMFD SP!, {R0-R12,PC}\n");148 }149 150 133 long get_file_next_counter() { 151 134 return get_file_counter(); -
trunk/platform/sx40hs/shooting.c
r1414 r1632 96 96 */ 97 97 // SX40 modelist table found @0xff607d14 (firmware 1.00g) 98 staticconst CapturemodeMap modemap[] = {98 const CapturemodeMap modemap[] = { 99 99 { MODE_M, 32769 }, 100 100 { MODE_TV, 32771 }, … … 136 136 #include "../generic/shooting.c" 137 137 138 // Override ISO settings (need to do this before exposure calc for ISO as well as after)139 void __attribute__((naked,noinline)) shooting_expo_iso_override(void){140 asm volatile("STMFD SP!, {R0-R12,LR}\n");141 142 if ((state_kbd_script_run) && (photo_param_put_off.sv96))143 {144 shooting_set_sv96(photo_param_put_off.sv96, SET_NOW);145 // photo_param_put_off.sv96 is not reset here, it will be reset in next call to shooting_expo_param_override146 }147 else if ((conf.iso_override_value) && (conf.iso_override_koef) && !(conf.override_disable==1))148 shooting_set_iso_real(shooting_get_iso_override_value(), SET_NOW);149 else if (conf.autoiso_enable && shooting_get_flash_mode()/*NOT FOR FLASH AUTO MODE*/ && !(conf.override_disable==1 && conf.override_disable_all))150 shooting_set_autoiso(shooting_get_iso_mode());151 152 asm volatile("LDMFD SP!, {R0-R12,PC}\n");153 }154 155 138 long get_file_next_counter() { 156 139 return get_file_counter(); -
trunk/platform/tx1/shooting.c
r1276 r1632 90 90 canon mode list FFB68D28 in 100g 91 91 */ 92 staticconst CapturemodeMap modemap[] = {92 const CapturemodeMap modemap[] = { 93 93 { MODE_LONG_SHUTTER, 32774 }, // guessed 94 94 { MODE_AUTO, 32768 },
Note: See TracChangeset
for help on using the changeset viewer.