Changeset 847


Ignore:
Timestamp:
12/02/09 09:31:02 (3 years ago)
Author:
reyalp
Message:

Mode override support. See http://chdk.kernreaktor.org/mantis/view.php?id=64
All cameras except ixus40_sd400 should be supported

rec_mode_active (checks play_rec_mode, weak, can be overriden on cameras that need it)
screen_opened, screen_rotated: only defined on swivel screen cams, check phsw_ bits for screen pos

  • move old play/rec checking code to rec_switch_state. #ifdef'd out for now
  • move mode enum into it's own header file: modelist.h to allow easy lua generation.
  • use playrec_mode on tx1

+ add new generated lua file LUALIB/GEN/modelist.lua
+ add lua library LUALIB/capmode.lua see http://chdk.wikia.com/wiki/LUA/Scripts:Standard/Lualib/Capmode
+ add test scripts see

http://chdk.wikia.com/wiki/UBASIC/Scripts:Standard/Test/Setmode
http://chdk.wikia.com/wiki/LUA/Scripts:Standard/Test/Setmode

Location:
trunk
Files:
7 added
110 edited

Legend:

Unmodified
Added
Removed
  • trunk/CHDK/LUALIB/GEN

    • Property svn:ignore
      •  

        old new  
         1modelist.lua 
        12propset1.lua 
        23propset2.lua 
  • trunk/CHDK/LUALIB/GEN/README.TXT

    r541 r847  
    11lua modules generated by the CHDK build process. 
     2propset1 and propset2 
     3  This contain the propertycase IDs for the known property sets. 
     4  LUALIB/propcase.lua is the suggested way to access these values 
     5modelist.lua  
     6  Contains an array of capture mode names indexed by CHDK mode number 
     7  LUALIB/capmode.lua provides a friendly interface to capture modes 
  • trunk/CHDK/Makefile

    r709 r847  
    22include $(topdir)makefile.inc 
    33 
    4 GENLUA=LUALIB/GEN/propset1.lua LUALIB/GEN/propset2.lua 
     4GENLUA=LUALIB/GEN/propset1.lua LUALIB/GEN/propset2.lua LUALIB/GEN/modelist.lua 
    55# generate some lua files from CHDK source 
    66all: $(GENLUA) 
     
    1414        sed -n -f  $(topdir)tools/gen_propset_lua.sed < $< > $@ 
    1515 
     16LUALIB/GEN/modelist.lua:  $(topdir)include/modelist.h 
     17        @echo "->" $@ 
     18        sed -n -f  $(topdir)tools/gen_modelist_lua.sed < $< > $@ 
     19 
    1620clean: 
    1721        rm -f $(GENLUA) 
  • trunk/core/luascript.c

    r836 r847  
    10471047} 
    10481048 
    1049 /* TODO warning this interface may change! 
    1050   set_capture_mode(modenum) 
    1051   where modenum is a valid PROPCASE_SHOOTING_MODE value for the current camera 
     1049/*  
     1050  result=set_capture_mode_canon(value) 
     1051  where value is a valid PROPCASE_SHOOTING_MODE value for the current camera 
     1052  result is true if the camera is in rec mode 
    10521053*/ 
    1053 static int luaCB_set_capture_mode( lua_State* L ) 
     1054static int luaCB_set_capture_mode_canon( lua_State* L ) 
    10541055{ 
    10551056  int modenum = luaL_checknumber(L,1); 
     
    10571058  if(modenum < 0)  
    10581059    modenum &= 0xFFFF; 
    1059   SetCurrentCaptureModeType((unsigned)modenum); 
    1060   return 0; 
     1060  lua_pushboolean( L, shooting_set_mode_canon(modenum) ); 
     1061  return 1; 
     1062} 
     1063 
     1064/* 
     1065 result=set_capture_mode(modenum) 
     1066 where modenum is a valid CHDK modemap value 
     1067 result is true if modenum is a valid modemap value, otherwise false 
     1068*/ 
     1069static int luaCB_set_capture_mode( lua_State* L ) 
     1070{ 
     1071  int modenum = luaL_checknumber(L,1); 
     1072  lua_pushboolean( L, shooting_set_mode_chdk(modenum) ); 
     1073  return 1; 
     1074} 
     1075 
     1076/* 
     1077 result=is_capture_mode_valid(modenum) 
     1078 where modenum is a valid CHDK modemap value 
     1079 result is true if modenum is a valid modemap value, otherwise false 
     1080*/ 
     1081static int luaCB_is_capture_mode_valid( lua_State* L ) 
     1082{ 
     1083  int modenum = luaL_checknumber(L,1); 
     1084  lua_pushboolean( L, shooting_mode_chdk2canon(modenum) != -1 ); 
     1085  return 1; 
    10611086} 
    10621087 
     
    10641089  set_record(state) 
    10651090  if state is 0 (or false) the camera is set to play mode. If 1 or true, the camera is set to record mode. 
     1091  NOTE: this only begins the mode change. Script should wait until get_mode() reflects the change, 
     1092  before doing anything that requires the new mode. e.g. 
     1093  set_record(true) 
     1094  while not get_mode() do 
     1095        sleep(10) 
     1096  end 
    10661097*/ 
    10671098static int luaCB_set_record( lua_State* L ) 
     
    12251256   FUNC(set_levent_active); 
    12261257   FUNC(set_levent_script_mode); 
     1258 
    12271259   FUNC(set_capture_mode); 
     1260   FUNC(set_capture_mode_canon); 
     1261   FUNC(is_capture_mode_valid); 
    12281262 
    12291263   FUNC(set_record); 
  • trunk/include/platform.h

    r842 r847  
    1313#define MODE_SHOOTING_MASK      0x00FF 
    1414 
    15 enum { 
    16 MODE_AUTO               =1, 
    17 MODE_P                  , 
    18 MODE_TV                 , 
    19 MODE_AV                 , 
    20 MODE_M                  , 
    21 MODE_PORTRAIT           , 
    22 MODE_NIGHT              , 
    23 MODE_LANDSCAPE          , 
    24 MODE_VIDEO_STD          , 
    25 MODE_VIDEO_SPEED        , 
    26 MODE_VIDEO_COMPACT      , 
    27 MODE_VIDEO_MY_COLORS    , 
    28 MODE_VIDEO_COLOR_ACCENT , 
    29 MODE_VIDEO_COLOR_SWAP   , 
    30 MODE_STITCH             , 
    31 MODE_MY_COLORS          , 
    32 MODE_SCN_WATER          , 
    33 MODE_SCN_NIGHT          , 
    34 MODE_SCN_CHILD          , 
    35 MODE_SCN_PARTY          , 
    36 MODE_SCN_GRASS          , 
    37 MODE_SCN_SNOW           , 
    38 MODE_SCN_BEACH          , 
    39 MODE_SCN_FIREWORK       , 
    40 MODE_SCN_COLOR_ACCENT   , 
    41 MODE_SCN_COLOR_SWAP     , 
    42 MODE_VIDEO_HIRES        , 
    43 MODE_SCN_AQUARIUM       , 
    44 MODE_COLOR_ACCENT       , 
    45 MODE_SCN_NIGHT1         , 
    46 MODE_SCN_ISO_3200       , 
    47 MODE_SCN_SPORT          , 
    48 MODE_SCN_KIDS_PETS      , 
    49 MODE_INDOOR             , 
    50 MODE_KIDS_PETS          , 
    51 MODE_NIGHT_SNAPSHOT     , 
    52 MODE_DIGITAL_MACRO      , 
    53 MODE_SCN_FOLIAGE        , 
    54 MODE_VIDEO_TIME_LAPSE   , 
    55 MODE_SCN_INDOOR         , 
    56 MODE_SCN_PORTRAIT       , 
    57 MODE_SUPER_MACRO        , 
    58 MODE_VIDEO_PORTRAIT     , 
    59 MODE_VIDEO_NIGHT        , 
    60 MODE_VIDEO_INDOOR       , 
    61 MODE_VIDEO_FOLIAGE      , 
    62 MODE_VIDEO_SNOW         , 
    63 MODE_VIDEO_BEACH        , 
    64 MODE_VIDEO_AQUARIUM     , 
    65 MODE_VIDEO_SUPER_MACRO  , 
    66 MODE_VIDEO_STITCH       , 
    67 MODE_VIDEO_MANUAL       , 
    68 MODE_SPORTS             , 
    69 MODE_QUICK                          , 
    70 MODE_SCN_SUNSET         , 
    71 MODE_SCN_UNDERWATER     , 
    72 MODE_EASY               , 
    73 MODE_SCN_DIGITAL_MACRO  , 
    74 MODE_SCN_STITCH         , 
    75 }; 
     15/* capture mode constants. These are in their own header for easier sed processing*/ 
     16#include "modelist.h" 
    7617 
    7718// this is nasty, but not as nasty as checking each of the flags all over the place 
     
    9334                            ((m)&MODE_SHOOTING_MASK)==MODE_VIDEO_STITCH || \ 
    9435                            ((m)&MODE_SHOOTING_MASK)==MODE_VIDEO_MANUAL) 
     36/* propcase ID constants. These are in their own header files for easier sed processing */ 
    9537#if CAM_PROPSET == 2     // most digic3 cameras 
    9638 #include "propset2.h" 
     
    13779#define ZOOM_DIGITAL_OUT         12 
    13880#define ZOOM_DIGITAL_REACHED_MAX 13 
     81 
     82typedef struct { 
     83        int hackmode; // platform independent mode values from MODE_xxx enum 
     84        int canonmode; // PROPCASE_SHOOTING_MODE value 
     85} CapturemodeMap; 
    13986 
    14087typedef struct { 
     
    412359void shooting_iso_bracketing(); 
    413360/******************************************************************/ 
     361// capture mode functions 
     362// return a CHDK mode enum for a PROPCASE_SHOOTING_MODE value, or 0 if not found 
     363int shooting_mode_canon2chdk(int canonmode); 
     364// return a PROPCASE_SHOOTING_MODE value for a CHDK mode enum value, or -1 if not found. 0 is a valid mode on some cameras. 
     365int shooting_mode_chdk2canon(int hackmode); 
     366// set capture mode from CHDK mode, returns 0 if mode not found or not in rec, otherwise 1 
     367int shooting_set_mode_chdk(int mode); 
     368// set capture mode from PROPCASE_SHOOTING_MODE value. return 0 if not in rec or mode is -1, otherwise 1 
     369int shooting_set_mode_canon(int mode); 
     370 
     371// returns 0 if in play, nonzero if rec 
     372int rec_mode_active(void);  
     373 
     374// not used. Right now this is just to preserve code from earlier version of mode_get() 
     375// in case we want to check play/rec switch state in the future. 
     376// WARNING: it isn't known if all variants of this check the switch state or some other bit. 
     377// should return 0 is switch is in play position, non-zero otherwise 
     378//int rec_switch_state(void); 
     379 
     380// swivel screen state. 
     381#ifdef CAM_SWIVEL_SCREEN 
     382// 0 not open, non-zero open 
     383int screen_opened(void); 
     384// 0 not rotated, non-zero rotated 
     385int screen_rotated(void); 
     386#endif 
     387 
     388/******************************************************************/ 
    414389void clear_values(); 
    415390/******************************************************************/ 
    416  
    417391 
    418392int mode_get(); 
     
    502476void  SetLogicalEventActive(unsigned event, unsigned state); 
    503477void SetScriptMode(unsigned mode); 
    504 void SetCurrentCaptureModeType(unsigned mode); 
    505478 
    506479#define started() debug_led(1) 
  • trunk/include/propset1.h

    r830 r847  
    33/*  
    44constants for propset 1, most digic2 camera 
    5 WARNING: this file is used gen_propset_lua.sh to generate propset.lua 
     5WARNING: 
     6 The build uses tools/gen_propset_lua.sed to generate propset1.lua from this file 
    67*/ 
    78#define PROPCASE_DRIVE_MODE                             6 
  • trunk/include/propset2.h

    r830 r847  
    33/*  
    44constants for propset 2, most digic3 camera 
    5 WARNING: this file is used gen_propset_lua.sh to generate propset.lua 
     5WARNING: 
     6 The build uses tools/gen_propset_lua.sed to generate propset2.lua from this file 
    67*/ 
    78#define PROPCASE_DRIVE_MODE                                     102 
  • trunk/lib/ubasic/camera_functions.c

    r846 r847  
    523523} 
    524524 
    525  
     525int set_capture_mode(int x) 
     526{ 
     527    printf("*** set_capture_mode %d ***\n",x); 
     528        return 1; 
     529} 
     530 
     531int shooting_set_mode_chdk(int x) 
     532{ 
     533    printf("*** set_capture_mode_canon %d ***\n",x); 
     534        return 1; 
     535} 
     536 
     537int shooting_set_mode_canon(int x) 
     538{ 
     539    printf("*** set_capture_mode_canon %d ***\n",x); 
     540        return 1; 
     541} 
     542 
     543int shooting_mode_chdk2canon(int chdkmode) 
     544{ 
     545    printf("*** shooting_mode_chdk2canon %d ***\n",chdkmode); 
     546        if(chdkmode < 1 || chdkmode > 50) 
     547                return 0; 
     548        return 1; 
     549} 
    526550#endif 
  • trunk/lib/ubasic/tokenizer.c

    r846 r847  
    104104  {"get_av",                  TOKENIZER_GET_USER_AV_ID}, //FOR COMPATIBILITY 
    105105  {"get_bv96",                TOKENIZER_GET_BV96}, 
     106  {"get_capture_mode",        TOKENIZER_GET_CAPTURE_MODE}, 
    106107  {"get_display_mode",        TOKENIZER_GET_DISPLAY_MODE}, 
    107108  {"get_day_seconds",         TOKENIZER_GET_DAY_SECONDS}, 
     
    152153  {"set_av",                  TOKENIZER_SET_USER_AV_BY_ID}, //FOR COMPATIBILITY 
    153154  {"set_backlight",           TOKENIZER_SET_BACKLIGHT}, 
     155  {"set_capture_mode_canon",  TOKENIZER_SET_CAPTURE_MODE_CANON}, 
     156  {"set_capture_mode",        TOKENIZER_SET_CAPTURE_MODE}, 
    154157  {"set_focus",               TOKENIZER_SET_FOCUS}, 
    155158  {"set_iso_mode",            TOKENIZER_SET_ISO_MODE}, 
     
    214217   {"shot_histo_enable",       TOKENIZER_SHOT_HISTO_ENABLE}, 
    215218   {"set_aflock",            TOKENIZER_SET_AFLOCK}, 
     219  {"is_capture_mode_valid",  TOKENIZER_IS_CAPTURE_MODE_VALID}, 
    216220   
    217221  {"end",                     TOKENIZER_END}, 
  • trunk/lib/ubasic/tokenizer.h

    r826 r847  
    190190  TOKENIZER_SET_BACKLIGHT, 
    191191  TOKENIZER_SET_AFLOCK, 
     192  TOKENIZER_GET_CAPTURE_MODE, 
     193  TOKENIZER_SET_CAPTURE_MODE, 
     194  TOKENIZER_SET_CAPTURE_MODE_CANON, 
     195  TOKENIZER_IS_CAPTURE_MODE_VALID, 
    192196   
    193197} ubasic_token; 
  • trunk/lib/ubasic/ubasic.c

    r846 r847  
    477477  case TOKENIZER_GET_TIME: { 
    478478    accept(TOKENIZER_GET_TIME); 
    479     unsigned long t2 = time(NULL); 
     479          unsigned long t2 = time(NULL); 
    480480    int tmode = expr(); 
    481     static struct tm *ttm; 
    482     ttm = localtime(&t2); 
     481          static struct tm *ttm; 
     482          ttm = localtime(&t2); 
    483483    if (tmode==0) r = ttm->tm_sec; 
    484484    else if (tmode==1) r = ttm->tm_min; 
     
    487487    else if (tmode==4) r = ttm->tm_mon+1; 
    488488    else if (tmode==5) r = 1900+ttm->tm_year; 
    489     break; 
     489 break; 
    490490 } 
    491491 case TOKENIZER_GET_RAW: 
     
    497497#endif 
    498498    break; 
     499 // get CHDK capture mode value, or 0 if in playback or unknown (broken modemap) 
     500 // NOTE: different from get_mode, since this returns the actual value 
     501 case TOKENIZER_GET_CAPTURE_MODE: 
     502    accept(TOKENIZER_GET_CAPTURE_MODE); 
     503    r = mode_get(); 
     504    if ( (r&MODE_MASK) == MODE_REC)  
     505        r &= MODE_SHOOTING_MASK; 
     506    else 
     507        r = 0; 
     508    break; 
     509 // check if CHDK capture mode exists in modemap of this camera 
     510 case TOKENIZER_IS_CAPTURE_MODE_VALID: { 
     511    accept(TOKENIZER_IS_CAPTURE_MODE_VALID); 
     512    int modenum = expr(); 
     513    if (shooting_mode_chdk2canon(modenum) == -1) 
     514        r = 0; 
     515    else 
     516        r = 1; 
     517    break; 
     518  } 
    499519  default: 
    500520    r = varfactor(); 
     
    18961916    accept_cr(); 
    18971917} 
     1918 
     1919static void set_capture_mode_canon_statement() 
     1920{ 
     1921    int to; 
     1922    accept(TOKENIZER_SET_CAPTURE_MODE_CANON); 
     1923    to = expr(); 
     1924    // if the value as negative, assume it is a mistakenly sign extended PROPCASE_SHOOTING_MODE value 
     1925    if( to < 0)  
     1926        to &= 0xFFFF; 
     1927    shooting_set_mode_canon(to); 
     1928    accept_cr(); 
     1929} 
     1930 
     1931static void set_capture_mode_statement() 
     1932{ 
     1933    int to; 
     1934    accept(TOKENIZER_SET_CAPTURE_MODE); 
     1935    to = expr(); 
     1936    shooting_set_mode_chdk(to); 
     1937    accept_cr(); 
     1938} 
     1939 
    18981940/*---------------------------------------------------------------------------*/ 
    18991941 
     
    24412483    break; 
    24422484 
     2485  case TOKENIZER_SET_CAPTURE_MODE: 
     2486    set_capture_mode_statement(); 
     2487    break; 
     2488 
     2489  case TOKENIZER_SET_CAPTURE_MODE_CANON: 
     2490    set_capture_mode_canon_statement(); 
     2491    break; 
     2492 
     2493 
    24432494  default: 
    24442495    DEBUG_PRINTF("ubasic.c: statement(): not implemented %d\n", token); 
  • trunk/platform/a2000/main.c

    r835 r847  
    2828    boot(); 
    2929} 
    30  
    31 static struct { 
    32         int hackmode; 
    33         int canonmode; 
    34 } modemap[] = { 
    35   { MODE_VIDEO_STD,          2600  },  //Verified ok 
    36   { MODE_VIDEO_COMPACT,      2602  },  //Verified 
    37   { MODE_SCN_AQUARIUM,       16408 },  //Verified 
    38   { MODE_SCN_SNOW,           16404 },  //Verified 
    39   { MODE_SCN_FOLIAGE,        16403 },  //verified 
    40   { MODE_SCN_SUNSET,         16402 },  //verified 
    41   { MODE_SCN_NIGHT,          16398 },  //verified ok 
    42   { MODE_SCN_ISO_3200,       16413 },  //verified 
    43   { MODE_SCN_FIREWORK,       16406 },  //verified 
    44   { MODE_SCN_BEACH,          16405 },  //verified 
    45   { MODE_INDOOR,             32785 },  //verified ok 
    46   { MODE_KIDS_PETS,          32784 },  //verified ok 
    47   { MODE_NIGHT_SNAPSHOT,     32779 },  //verified ok 
    48   { MODE_LANDSCAPE,          32780 },  //verified ok 
    49   { MODE_PORTRAIT,           32781 },  //verified ok 
    50   { MODE_AUTO,               32768 },  //verified ok 
    51   { MODE_P,                  32772 },  //verified ok 
    52   { MODE_TV,                 32771 },  //verified 
    53   { MODE_AV,                 32770 },  //verified 
    54   { MODE_M,                  32769 },  //verified 
    55   { MODE_EASY,               33311 }   //verified ok 
    56 }; 
    57 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    58  
    59 int mode_get() { 
    60         int mode, i, t=0xFF; 
    61          
    62         mode  = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    63          
    64         _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    65         for (i=0; i<MODESCNT; ++i) { 
    66                 if (modemap[i].canonmode == t) { 
    67                         return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    68                 } 
    69         } 
    70         return (mode); 
    71 } 
    72  
    7330 
    7431static const int fl_tbl[] = {6400, 6800, 7600, 8800, 10500, 12300, 14100, 16100, 18500, 21200, 24000, 27100, 30700, 35100, 38400}; 
  • trunk/platform/a2000/shooting.c

    r800 r847  
    104104};           
    105105 
     106static const CapturemodeMap modemap[] = { 
     107  { MODE_VIDEO_STD,          2600  },  //Verified ok 
     108  { MODE_VIDEO_COMPACT,      2602  },  //Verified 
     109  { MODE_SCN_AQUARIUM,       16408 },  //Verified 
     110  { MODE_SCN_SNOW,           16404 },  //Verified 
     111  { MODE_SCN_FOLIAGE,        16403 },  //verified 
     112  { MODE_SCN_SUNSET,         16402 },  //verified 
     113  { MODE_SCN_NIGHT,          16398 },  //verified ok 
     114  { MODE_SCN_ISO_3200,       16413 },  //verified 
     115  { MODE_SCN_FIREWORK,       16406 },  //verified 
     116  { MODE_SCN_BEACH,          16405 },  //verified 
     117  { MODE_INDOOR,             32785 },  //verified ok 
     118  { MODE_KIDS_PETS,          32784 },  //verified ok 
     119  { MODE_NIGHT_SNAPSHOT,     32779 },  //verified ok 
     120  { MODE_LANDSCAPE,          32780 },  //verified ok 
     121  { MODE_PORTRAIT,           32781 },  //verified ok 
     122  { MODE_AUTO,               32768 },  //verified ok 
     123  { MODE_P,                  32772 },  //verified ok 
     124  { MODE_TV,                 32771 },  //verified 
     125  { MODE_AV,                 32770 },  //verified 
     126  { MODE_M,                  32769 },  //verified 
     127  { MODE_EASY,               33311 }   //verified ok 
     128}; 
     129 
    106130#include "../generic/shooting.c" 
    107131 
  • trunk/platform/a450/main.c

    r835 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               32768 }, 
    40     { MODE_P,                  32772 }, 
    41 //    { MODE_TV,                 32771 }, 
    42 //    { MODE_AV,                 32770 }, 
    43 //    { MODE_M,                  32769 }, 
    44     { MODE_PORTRAIT,           16397 }, 
    45 //    { MODE_NIGHT,              32782 }, 
    46 //    { MODE_LANDSCAPE,          32780 }, 
    47     { MODE_VIDEO_STD,          2597  }, 
    48 //    { MODE_VIDEO_SPEED,        2597  }, 
    49     { MODE_VIDEO_COMPACT,      2599  }, 
    50 //    { MODE_VIDEO_MY_COLORS,    2595  }, 
    51 //    { MODE_VIDEO_COLOR_ACCENT, 2594  }, 
    52 //    { MODE_STITCH,             33290 }, 
    53 //    { MODE_MY_COLORS,          16922 }, 
    54 //    { MODE_SCN_WATER,          16405 }, 
    55     { MODE_SCN_NIGHT,          16395 }, 
    56     { MODE_SCN_CHILD,          16400 }, 
    57     { MODE_SCN_PARTY,          16401 }, 
    58     { MODE_SCN_GRASS,          16402 }, 
    59     { MODE_SCN_SNOW,           16403 }, 
    60     { MODE_SCN_BEACH,          16404 }, 
    61     { MODE_SCN_FIREWORK,       16405 }//, 
    62     //{ MODE_SCN_COLOR_ACCENT,   16921 } 
    63 };  
    64 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    65  
    66 int mode_get() { 
    67     int mode, i, t=0xFF; 
    68                                                                           
    69 // play/rec without override 
    70 //    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY;            
    71  
    72     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    73      
    74     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    75     for (i=0; i<MODESCNT; ++i) { 
    76         if (modemap[i].canonmode == t) { 
    77             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    78         } 
    79     } 
    80     return (mode); 
     35#if 0 
     36int rec_switch_state(void) { 
     37//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY; 
     38        return (physw_status[2] & 0x00002000); 
    8139} 
     40#endif 
  • trunk/platform/a450/shooting.c

    r515 r847  
    7777};           
    7878 
     79static const CapturemodeMap modemap[] = { 
     80    { MODE_AUTO,               32768 }, 
     81    { MODE_P,                  32772 }, 
     82    { MODE_PORTRAIT,           16397 }, 
     83    { MODE_VIDEO_STD,          2597  }, 
     84    { MODE_VIDEO_COMPACT,      2599  }, 
     85    { MODE_SCN_NIGHT,          16395 }, 
     86    { MODE_SCN_CHILD,          16400 }, 
     87    { MODE_SCN_PARTY,          16401 }, 
     88    { MODE_SCN_GRASS,          16402 }, 
     89    { MODE_SCN_SNOW,           16403 }, 
     90    { MODE_SCN_BEACH,          16404 }, 
     91    { MODE_SCN_FIREWORK,       16405 }//, 
     92}; 
    7993#include "../generic/shooting.c" 
    8094 
  • trunk/platform/a460/main.c

    r835 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               32768 }, 
    40     { MODE_P,                  32772 }, 
    41 //    { MODE_TV,                 32771 }, 
    42 //    { MODE_AV,                 32770 }, 
    43 //    { MODE_M,                  32769 }, 
    44     { MODE_PORTRAIT,           16397 }, 
    45 //    { MODE_NIGHT,              32782 }, 
    46 //    { MODE_LANDSCAPE,          32780 }, 
    47     { MODE_VIDEO_STD,          2597  }, 
    48 //    { MODE_VIDEO_SPEED,        2597  }, 
    49     { MODE_VIDEO_COMPACT,      2599  }, 
    50 //    { MODE_VIDEO_MY_COLORS,    2595  }, 
    51 //    { MODE_VIDEO_COLOR_ACCENT, 2594  }, 
    52 //    { MODE_STITCH,             33290 }, 
    53 //    { MODE_MY_COLORS,          16922 }, 
    54 //    { MODE_SCN_WATER,          16405 }, 
    55     { MODE_SCN_NIGHT,          16395 }, 
    56     { MODE_SCN_CHILD,          16400 }, 
    57     { MODE_SCN_PARTY,          16401 }, 
    58     { MODE_SCN_GRASS,          16402 }, 
    59     { MODE_SCN_SNOW,           16403 }, 
    60     { MODE_SCN_BEACH,          16404 }, 
    61     { MODE_SCN_FIREWORK,       16405 }//, 
    62     //{ MODE_SCN_COLOR_ACCENT,   16921 } 
    63 };  
    64 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    6535 
    66 int mode_get() { 
    67     int mode, i, t=0xFF; 
    68                                                                           
    69 // play/rec without override 
     36#if 0 
     37int rec_switch_state(void) { 
    7038//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY;            
    71  
    72     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    73  
    74      
    75     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    76     for (i=0; i<MODESCNT; ++i) { 
    77         if (modemap[i].canonmode == t) { 
    78             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    79         } 
    80     } 
    81     return (mode); 
     39        return (physw_status[2] & 0x00002000); 
    8240} 
     41#endif 
  • trunk/platform/a460/shooting.c

    r515 r847  
    7979};           
    8080 
     81static const CapturemodeMap modemap[] = { 
     82    { MODE_AUTO,               32768 }, 
     83    { MODE_P,                  32772 }, 
     84    { MODE_PORTRAIT,           16397 }, 
     85    { MODE_VIDEO_STD,          2597  }, 
     86    { MODE_VIDEO_COMPACT,      2599  }, 
     87    { MODE_SCN_NIGHT,          16395 }, 
     88    { MODE_SCN_CHILD,          16400 }, 
     89    { MODE_SCN_PARTY,          16401 }, 
     90    { MODE_SCN_GRASS,          16402 }, 
     91    { MODE_SCN_SNOW,           16403 }, 
     92    { MODE_SCN_BEACH,          16404 }, 
     93    { MODE_SCN_FIREWORK,       16405 }//, 
     94}; 
     95 
    8196#include "../generic/shooting.c" 
    8297 
  • trunk/platform/a470/main.c

    r835 r847  
    2727} 
    2828 
    29 static struct { 
    30         int hackmode; 
    31         int canonmode; 
    32 } modemap[] = { 
    33     { MODE_AUTO,               32768 }, 
    34     { MODE_P,                  32772 }, 
    35     //{ MODE_TV,                 32771 }, 
    36     //{ MODE_AV,                 32770 }, 
    37     //{ MODE_M,                  32772 }, 
    38     { MODE_VIDEO_STD,          2599  }, 
    39     { MODE_VIDEO_COMPACT,      2601  }, 
    40     //{ MODE_STITCH,             33290 }, 
    41     //{ MODE_SCN_WATER,          16406 },   
    42     { MODE_SCN_AQUARIUM,       16408 },   
    43     { MODE_SCN_NIGHT,          16402 },  //Sunset?? 
    44     { MODE_SCN_GRASS,          16403 },    
    45     { MODE_SCN_SNOW,           16404 },   
    46     { MODE_SCN_BEACH,          16405 },   
    47     { MODE_SCN_FIREWORK,       16406 },  
    48         { MODE_PORTRAIT,           16397 },      
    49     { MODE_INDOOR,             16401 }, 
    50     { MODE_KIDS_PETS,          16400 },  
    51     { MODE_NIGHT_SNAPSHOT,     16395 }, 
    52     //{ MODE_LANDSCAPE,          32780 },        
    53 };  
    54  
    55  
    56 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    57  
    58  
    5929static const int fl_tbl[] ={6300, 8100, 9800, 12100, 14800, 17600, 21600}; 
    6030#define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 
     
    7949} 
    8050 
     51#if 0 
     52int rec_switch_state(void) { 
     53//    mode  = (physw_status[1] & 0x00000e00)?MODE_REC:MODE_PLAY; 
     54        return (physw_status[1] & 0x00000e00); 
     55} 
     56#endif 
    8157 
    82 int mode_get() { 
    83     int mode, i, t=0xFF; 
    84  
    85 // play/rec without override 
    86 //    mode  = (physw_status[1] & 0x00000e00)?MODE_REC:MODE_PLAY; 
    87  
    88     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    89      
    90     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    91     for (i=0; i<MODESCNT; ++i) { 
    92         if (modemap[i].canonmode == t) { 
    93             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    94         } 
    95     } 
    96     return (mode); 
    97 } 
    9858 
    9959long get_vbatt_min() 
  • trunk/platform/a470/shooting.c

    r795 r847  
    8484};           
    8585 
     86static const CapturemodeMap modemap[] = { 
     87    { MODE_AUTO,               32768 }, 
     88    { MODE_P,                  32772 }, 
     89    { MODE_VIDEO_STD,          2599  }, 
     90    { MODE_VIDEO_COMPACT,      2601  }, 
     91    { MODE_SCN_AQUARIUM,       16408 },   
     92    { MODE_SCN_NIGHT,          16402 },  //Sunset?? 
     93    { MODE_SCN_GRASS,          16403 },    
     94    { MODE_SCN_SNOW,           16404 },   
     95    { MODE_SCN_BEACH,          16405 },   
     96    { MODE_SCN_FIREWORK,       16406 },  
     97        { MODE_PORTRAIT,           16397 },      
     98    { MODE_INDOOR,             16401 }, 
     99    { MODE_KIDS_PETS,          16400 },  
     100    { MODE_NIGHT_SNAPSHOT,     16395 }, 
     101}; 
     102 
    86103#include "../generic/shooting.c" 
    87104 
  • trunk/platform/a530/main.c

    r835 r847  
    3434} 
    3535 
    36 static struct { 
    37         int hackmode; 
    38         int canonmode; 
    39 } modemap[] = { 
    40     { MODE_AUTO,               32768 }, 
    41     { MODE_P,                  32772 }, 
    42     { MODE_M,                  32769 }, 
    43     { MODE_VIDEO_STD,          2593  },//2597 
    44 //    { MODE_VIDEO_SPEED,        2598  }, 
    45     { MODE_VIDEO_COMPACT,      2595  },//2599 
    46 //    { MODE_SCN_AQUARIUM,       16407 }, 
    47     { MODE_SCN_NIGHT,          16395 }, //16398 
    48     { MODE_SCN_GRASS,          16401 },//16402 
    49     { MODE_SCN_SNOW,           16402 },//16403 
    50     { MODE_SCN_BEACH,          16403 },//16404 
    51     { MODE_SCN_FIREWORK,       16404 }, //16405 
    52     { MODE_INDOOR,             16400 },//32785 
    53     { MODE_KIDS_PETS,          16399 }, //32784 
    54     { MODE_NIGHT_SNAPSHOT,     32782 }, //32779 
    55     { MODE_LANDSCAPE,          32780 },  
    56     { MODE_PORTRAIT,           32781 }, 
    57 };  
    58 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    59  
    60 int mode_get() { 
    61     int mode, i, t=0xFF; 
    62  
    63 // play/rec without override 
     36#if 0 
     37int rec_switch_state(void) { 
    6438//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY; 
    65  
    66     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    67  
    68  
    69     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    70     for (i=0; i<MODESCNT; ++i) { 
    71         if (modemap[i].canonmode == t) { 
    72             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    73         } 
    74     } 
    75  
    76     return (mode); 
     39        return (physw_status[2] & 0x00002000); 
    7740} 
     41#endif 
  • trunk/platform/a530/shooting.c

    r515 r847  
    8383};           
    8484 
     85static const CapturemodeMap modemap[] = { 
     86    { MODE_AUTO,               32768 }, 
     87    { MODE_P,                  32772 }, 
     88    { MODE_M,                  32769 }, 
     89    { MODE_VIDEO_STD,          2593  },//2597 
     90    { MODE_VIDEO_COMPACT,      2595  },//2599 
     91    { MODE_SCN_NIGHT,          16395 }, //16398 
     92    { MODE_SCN_GRASS,          16401 },//16402 
     93    { MODE_SCN_SNOW,           16402 },//16403 
     94    { MODE_SCN_BEACH,          16403 },//16404 
     95    { MODE_SCN_FIREWORK,       16404 }, //16405 
     96    { MODE_INDOOR,             16400 },//32785 
     97    { MODE_KIDS_PETS,          16399 }, //32784 
     98    { MODE_NIGHT_SNAPSHOT,     32782 }, //32779 
     99    { MODE_LANDSCAPE,          32780 },  
     100    { MODE_PORTRAIT,           32781 }, 
     101}; 
     102 
    85103#include "../generic/shooting.c" 
    86104 
  • trunk/platform/a540/main.c

    r835 r847  
    3838} 
    3939 
    40 static struct { 
    41         int hackmode; 
    42         int canonmode; 
    43 } modemap[] = { 
    44     { MODE_M,                  32769 }, 
    45     { MODE_AV,                 32770 }, 
    46     { MODE_TV,                 32771 }, 
    47     { MODE_P,                  32772 }, 
    48     { MODE_AUTO,               32768 }, 
    49     { MODE_PORTRAIT,           32781 }, 
    50     { MODE_LANDSCAPE,          32780 }, 
    51     { MODE_NIGHT,              32782 }, // "night scene" on dial, different from "night snapshot" under "scene" below 
    52     { MODE_STITCH,             33290 }, 
    53     { MODE_SCN_NIGHT,          16395 }, // "night snapshot" 
    54     { MODE_SCN_KIDS_PETS,      16399 }, // "kids and pets" 
    55     { MODE_SCN_INDOOR,         16400 }, // "indoor" 
    56     { MODE_SCN_FOLIAGE,        16401 }, // "foliage" 
    57     { MODE_SCN_SNOW,           16402 }, // "snow" 
    58     { MODE_SCN_BEACH,          16403 }, // "beach" 
    59     { MODE_SCN_FIREWORK,       16404 }, // "fireworks" 
    60     { MODE_SCN_WATER,          16405 }, // "under water" (should this be AQUARIUM ?) 
    61     { MODE_SCN_COLOR_ACCENT,   16920 }, // "color accent" 
    62     { MODE_SCN_COLOR_SWAP,     16921 }, // "color swap" 
    63     { MODE_VIDEO_STD,          2593  }, 
    64     { MODE_VIDEO_SPEED,        2594  }, // "fast frame rate" 
    65     { MODE_VIDEO_COMPACT,      2595  }, // "compact" 
    66     { MODE_VIDEO_COLOR_ACCENT, 2591  }, // "color accent" 
    67     { MODE_VIDEO_COLOR_SWAP,   2592  }, // "color swap" 
    68 }; 
    69 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    70  
    71 int mode_get() { 
    72     int mode, i, t=0xFF; 
    73  
    74     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    75  
    76 // play/rec without override 
    77 //    mode  = (physw_status[1] & 0x00000400)?MODE_REC:MODE_PLAY; 
    78      
    79     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    80     for (i=0; i<MODESCNT; ++i) { 
    81         if (modemap[i].canonmode == t) { 
    82             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    83         } 
    84     } 
    85     return (mode); 
     40#if 0 
     41int rec_switch_state(void) { 
     42        // mode  = (physw_status[1] & 0x00000400)?MODE_REC:MODE_PLAY; 
     43        return (physw_status[1] & 0x00000400); 
    8644} 
    87 /* // seems to be added from ewavr's svn; although not yet used, might become useful... 
    88 int is_mode_photo(){ //from 710 added 
    89  int m=mode_get(); 
    90  return ((m&MODE_MASK) == MODE_REC )&& 
    91                  !((m&MODE_SHOOTING_MASK)==MODE_VIDEO_STD || (m&MODE_SHOOTING_MASK)==MODE_VIDEO_SPEED || (m&MODE_SHOOTING_MASK)==MODE_VIDEO_COMPACT || 
    92                    (m&MODE_SHOOTING_MASK)==MODE_VIDEO_MY_COLORS || (m&MODE_SHOOTING_MASK)==MODE_VIDEO_COLOR_ACCENT); 
    93  } 
    94 */ 
     45#endif 
  • trunk/platform/a540/shooting.c

    r515 r847  
    7676};           
    7777 
     78static const CapturemodeMap modemap[] = { 
     79    { MODE_M,                  32769 }, 
     80    { MODE_AV,                 32770 }, 
     81    { MODE_TV,                 32771 }, 
     82    { MODE_P,                  32772 }, 
     83    { MODE_AUTO,               32768 }, 
     84    { MODE_PORTRAIT,           32781 }, 
     85    { MODE_LANDSCAPE,          32780 }, 
     86    { MODE_NIGHT,              32782 }, // "night scene" on dial, different from "night snapshot" under "scene" below 
     87    { MODE_STITCH,             33290 }, 
     88    { MODE_SCN_NIGHT,          16395 }, // "night snapshot" 
     89    { MODE_SCN_KIDS_PETS,      16399 }, // "kids and pets" 
     90    { MODE_SCN_INDOOR,         16400 }, // "indoor" 
     91    { MODE_SCN_FOLIAGE,        16401 }, // "foliage" 
     92    { MODE_SCN_SNOW,           16402 }, // "snow" 
     93    { MODE_SCN_BEACH,          16403 }, // "beach" 
     94    { MODE_SCN_FIREWORK,       16404 }, // "fireworks" 
     95    { MODE_SCN_UNDERWATER,     16405 }, // "under water" 
     96    { MODE_SCN_COLOR_ACCENT,   16920 }, // "color accent" 
     97    { MODE_SCN_COLOR_SWAP,     16921 }, // "color swap" 
     98    { MODE_VIDEO_STD,          2593  }, 
     99    { MODE_VIDEO_SPEED,        2594  }, // "fast frame rate" 
     100    { MODE_VIDEO_COMPACT,      2595  }, // "compact" 
     101    { MODE_VIDEO_COLOR_ACCENT, 2591  }, // "color accent" 
     102    { MODE_VIDEO_COLOR_SWAP,   2592  }, // "color swap" 
     103}; 
     104 
    78105#include "../generic/shooting.c" 
    79106 
  • trunk/platform/a550/main.c

    r835 r847  
    4545} 
    4646 
    47 static struct 
    48 { 
    49         int hackmode; 
    50         int canonmode; 
    51 } modemap[] = 
    52 { 
    53                 { MODE_AUTO, 32768 }, 
    54                 { MODE_P, 32772 }, 
    55 //  { MODE_M,                  32769 }, 
    56                 { MODE_VIDEO_STD, 2597 }, 
    57                 { MODE_VIDEO_SPEED, 2598 }, 
    58                 { MODE_VIDEO_COMPACT, 2599 }, 
    59                 { MODE_SCN_AQUARIUM, 16407 }, 
    60                 { MODE_SCN_NIGHT, 16398 }, 
    61                 { MODE_SCN_GRASS, 16402 }, 
    62                 { MODE_SCN_SNOW, 16403 }, 
    63                 { MODE_SCN_BEACH, 16404 }, 
    64                 { MODE_SCN_FIREWORK, 16405 }, 
    65                 { MODE_INDOOR, 32785 }, 
    66                 { MODE_KIDS_PETS, 32784 }, 
    67                 { MODE_NIGHT_SNAPSHOT, 32779 }, 
    68                 { MODE_LANDSCAPE, 32780 }, 
    69                 { MODE_PORTRAIT, 32781 },  
    70 }; 
    71 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    72  
    73 int mode_get() 
    74 { 
    75         int mode, i, t=0xFF; 
    76  
    77         //_GetPropertyCase(219, &t, 4); 
    78 // play/rec without override 
     47#if 0 
     48int rec_switch_state(void) { 
    7949//      mode = (physw_status[1] & 0x00000040) ? MODE_REC : MODE_PLAY; //eb5ccdc0 ( 110111000000 ):eb5cc980 ( 100110000000 ) 
    80  
    81     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    82  
    83         // wtf ? angle sensor != rotated screen 
    84         //mode |= (t == 270) ? MODE_SCREEN_ROTATED : 0; 
    85         //mode |= (physw_status[2] & 0x00008000)?0:MODE_SCREEN_OPENED; 
    86         //mode |= (physw_status[2] & 0x00004000)?0:MODE_SCREEN_ROTATED; 
    87  
    88         _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    89         for (i=0; i<MODESCNT; ++i) 
    90         { 
    91                 if (modemap[i].canonmode == t) 
    92                 { 
    93                         return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    94                 } 
    95         } 
    96         return (mode); 
     50        return (physw_status[1] & 0x00000040); 
    9751} 
     52#endif 
  • trunk/platform/a550/shooting.c

    r515 r847  
    8080};           
    8181 
     82static const CapturemodeMap modemap[] = { 
     83                { MODE_AUTO, 32768 }, 
     84                { MODE_P, 32772 }, 
     85                { MODE_VIDEO_STD, 2597 }, 
     86                { MODE_VIDEO_SPEED, 2598 }, 
     87                { MODE_VIDEO_COMPACT, 2599 }, 
     88                { MODE_SCN_AQUARIUM, 16407 }, 
     89                { MODE_SCN_NIGHT, 16398 }, 
     90                { MODE_SCN_GRASS, 16402 }, 
     91                { MODE_SCN_SNOW, 16403 }, 
     92                { MODE_SCN_BEACH, 16404 }, 
     93                { MODE_SCN_FIREWORK, 16405 }, 
     94                { MODE_INDOOR, 32785 }, 
     95                { MODE_KIDS_PETS, 32784 }, 
     96                { MODE_NIGHT_SNAPSHOT, 32779 }, 
     97                { MODE_LANDSCAPE, 32780 }, 
     98                { MODE_PORTRAIT, 32781 },  
     99}; 
     100 
    82101#include "../generic/shooting.c" 
    83102 
  • trunk/platform/a560/main.c

    r838 r847  
    3434} 
    3535 
    36 static struct { 
    37         int hackmode; 
    38         int canonmode; 
    39 } modemap[] = { 
    40     { MODE_AUTO,               32768 }, 
    41     { MODE_P,                  32772 }, 
    42 //  { MODE_M,                  32769 }, 
    43     { MODE_VIDEO_STD,          2597  }, 
    44     { MODE_VIDEO_SPEED,        2598  }, 
    45     { MODE_VIDEO_COMPACT,      2599  }, 
    46     { MODE_SCN_AQUARIUM,       16407 }, 
    47     { MODE_SCN_NIGHT,          16398 }, 
    48     { MODE_SCN_GRASS,          16402 }, 
    49     { MODE_SCN_SNOW,           16403 }, 
    50     { MODE_SCN_BEACH,          16404 }, 
    51     { MODE_SCN_FIREWORK,       16405 }, 
    52     { MODE_INDOOR,             32785 }, 
    53     { MODE_KIDS_PETS,          32784 },  
    54     { MODE_NIGHT_SNAPSHOT,     32779 }, 
    55     { MODE_LANDSCAPE,          32780 },  
    56     { MODE_PORTRAIT,           32781 }, 
    57 };  
    58 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    59  
    60 int mode_get() { 
    61     int mode, i, t=0xFF; 
    62 //    mode = (playrec_mode==1 || playrec_mode==2) ? MODE_REC : MODE_PLAY; 
    63     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    64  
    65     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    66     for (i=0; i<MODESCNT; ++i) { 
    67         if (modemap[i].canonmode == t) { 
    68             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    69         } 
    70     } 
    71     return (mode); 
    72 } 
  • trunk/platform/a560/shooting.c

    r515 r847  
    7878};           
    7979 
     80static const CapturemodeMap modemap[] = { 
     81    { MODE_AUTO,               32768 }, 
     82    { MODE_P,                  32772 }, 
     83    { MODE_VIDEO_STD,          2597  }, 
     84    { MODE_VIDEO_SPEED,        2598  }, 
     85    { MODE_VIDEO_COMPACT,      2599  }, 
     86    { MODE_SCN_AQUARIUM,       16407 }, 
     87    { MODE_SCN_NIGHT,          16398 }, 
     88    { MODE_SCN_GRASS,          16402 }, 
     89    { MODE_SCN_SNOW,           16403 }, 
     90    { MODE_SCN_BEACH,          16404 }, 
     91    { MODE_SCN_FIREWORK,       16405 }, 
     92    { MODE_INDOOR,             32785 }, 
     93    { MODE_KIDS_PETS,          32784 },  
     94    { MODE_NIGHT_SNAPSHOT,     32779 }, 
     95    { MODE_LANDSCAPE,          32780 },  
     96    { MODE_PORTRAIT,           32781 }, 
     97}; 
     98 
    8099#include "../generic/shooting.c" 
    81100 
  • trunk/platform/a570/main.c

    r840 r847  
    3434} 
    3535 
    36 static struct { 
    37         int hackmode; 
    38         int canonmode; 
    39 } modemap[] = { 
    40     { MODE_AUTO,               32768 }, 
    41     { MODE_P,                  32772 }, 
    42     { MODE_TV,                 32771 }, 
    43     { MODE_AV,                 32770 }, 
    44     { MODE_M,                  32769 }, 
    45     { MODE_VIDEO_STD,          2597  }, 
    46     { MODE_VIDEO_SPEED,        2598  }, 
    47     { MODE_VIDEO_COMPACT,      2599  }, 
    48     { MODE_STITCH,             33290 }, 
    49     { MODE_SCN_WATER,          16406 }, 
    50     { MODE_SCN_AQUARIUM,       16407 }, 
    51     { MODE_SCN_NIGHT,          16398 }, 
    52     { MODE_SCN_GRASS,          16402 }, 
    53     { MODE_SCN_SNOW,           16403 }, 
    54     { MODE_SCN_BEACH,          16404 }, 
    55     { MODE_SCN_FIREWORK,       16405 }, 
    56     { MODE_INDOOR,             32785 }, 
    57     { MODE_KIDS_PETS,          32784 },  
    58     { MODE_NIGHT_SNAPSHOT,     32779 }, 
    59     { MODE_LANDSCAPE,          32780 },  
    60     { MODE_PORTRAIT,           32781 }, 
    61 };  
    62 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    63  
    64 int mode_get() { 
    65     int mode, i, t=0xFF; 
    66  
    67 // play/rec without override 
     36#if 0 
     37int rec_switch_state(void) { 
    6838//    mode  = (physw_status[1] & 0x02000000)?MODE_REC:MODE_PLAY; 
    69  
    70     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    71  
    72     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    73     for (i=0; i<MODESCNT; ++i) { 
    74         if (modemap[i].canonmode == t) { 
    75             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    76         } 
    77     } 
    78     return (mode); 
     39        return (physw_status[1] & 0x02000000); 
    7940} 
     41#endif 
  • trunk/platform/a570/shooting.c

    r515 r847  
    7878};           
    7979 
     80static const CapturemodeMap modemap[] = { 
     81    { MODE_AUTO,               32768 }, 
     82    { MODE_P,                  32772 }, 
     83    { MODE_TV,                 32771 }, 
     84    { MODE_AV,                 32770 }, 
     85    { MODE_M,                  32769 }, 
     86    { MODE_VIDEO_STD,          2597  }, 
     87    { MODE_VIDEO_SPEED,        2598  }, 
     88    { MODE_VIDEO_COMPACT,      2599  }, 
     89    { MODE_STITCH,             33290 }, 
     90    { MODE_SCN_WATER,          16406 }, 
     91    { MODE_SCN_AQUARIUM,       16407 }, 
     92    { MODE_SCN_NIGHT,          16398 }, 
     93    { MODE_SCN_GRASS,          16402 }, 
     94    { MODE_SCN_SNOW,           16403 }, 
     95    { MODE_SCN_BEACH,          16404 }, 
     96    { MODE_SCN_FIREWORK,       16405 }, 
     97    { MODE_INDOOR,             32785 }, 
     98    { MODE_KIDS_PETS,          32784 },  
     99    { MODE_NIGHT_SNAPSHOT,     32779 }, 
     100    { MODE_LANDSCAPE,          32780 },  
     101    { MODE_PORTRAIT,           32781 }, 
     102}; 
     103 
    80104#include "../generic/shooting.c" 
    81105 
  • trunk/platform/a590/main.c

    r835 r847  
    3030} 
    3131 
    32 static struct { 
    33         int hackmode; 
    34         int canonmode; 
    35 } modemap[] = { 
    36  { MODE_AUTO,               32768 }, // PROPCASE 49 
    37     { MODE_P,                  32772 }, // 
    38         { MODE_TV,                  32771 },// 
    39         { MODE_AV,                  32770 },// 
    40         { MODE_M,                  32769 },     // 
    41         { MODE_VIDEO_STD,          2597  }, 
    42     { MODE_VIDEO_COMPACT,      2599  }, 
    43         { MODE_INDOOR,              32785 },    // 
    44         { MODE_SCN_KIDS_PETS,           32784 },        // 
    45         { MODE_PORTRAIT,           32781 }, 
    46     { MODE_NIGHT_SNAPSHOT,     32779 }, 
    47         { MODE_LANDSCAPE,       32780 }, 
    48     { MODE_DIGITAL_MACRO,      33288 },//?? 
    49     { MODE_COLOR_ACCENT,       33306 }, //  { MODE_SCN_COLOR_ACCENT,   33306 }, 
    50     { MODE_MY_COLORS,          33307 }, 
    51     { MODE_SCN_KIDS_PETS,      16400 }, //  { MODE_SCN_CHILD,          16400 }, 
    52     { MODE_SCN_INDOOR,         16401 }, //  { MODE_SCN_PARTY,          16401 }, 
    53     { MODE_SCN_FOLIAGE,        16403 }, //  { MODE_SCN_GRASS,          16402 }, 
    54     { MODE_SCN_SNOW,           16404 }, 
    55     { MODE_SCN_BEACH,          16405 }, 
    56     { MODE_SCN_FIREWORK,       16406 }, 
    57     { MODE_SCN_AQUARIUM,       16408 }, 
    58     { MODE_SCN_WATER,          16402 }, 
    59 }; 
    60  
    61  
    62 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    63  
    64  
    6532static const int fl_tbl[] = {5800, 6600, 7900, 9900, 12700, 16000, 19600, 23200}; 
    6633#define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 
     
    8552} 
    8653 
    87  
    88 int mode_get() { 
    89     int mode, i, t=0xFF; 
    90  
    91 // play/rec without override 
     54#if 0 
     55int rec_switch_state(void) { 
    9256//      mode  = (physw_status[1] & 0x02000000)?MODE_REC:MODE_PLAY; 
    93  
    94     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    95      
    96     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    97     for (i=0; i<MODESCNT; ++i) { 
    98         if (modemap[i].canonmode == t) { 
    99             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    100         } 
    101     } 
    102     return (mode); 
     57        return (physw_status[1] & 0x02000000); 
    10358} 
     59#endif 
    10460 
    10561long get_vbatt_min() 
  • trunk/platform/a590/shooting.c

    r584 r847  
    8181};           
    8282 
     83static const CapturemodeMap modemap[] = { 
     84    { MODE_AUTO,               32768 }, // PROPCASE 49 
     85    { MODE_P,                  32772 }, // 
     86        { MODE_TV,                  32771 },// 
     87        { MODE_AV,                  32770 },// 
     88        { MODE_M,                  32769 },     // 
     89        { MODE_VIDEO_STD,          2597  }, 
     90    { MODE_VIDEO_COMPACT,      2599  }, 
     91        { MODE_INDOOR,              32785 },    // 
     92        { MODE_SCN_KIDS_PETS,           32784 },        // 
     93        { MODE_PORTRAIT,           32781 }, 
     94    { MODE_NIGHT_SNAPSHOT,     32779 }, 
     95        { MODE_LANDSCAPE,       32780 }, 
     96    { MODE_DIGITAL_MACRO,      33288 },//?? 
     97    { MODE_COLOR_ACCENT,       33306 }, //  { MODE_SCN_COLOR_ACCENT,   33306 }, 
     98    { MODE_MY_COLORS,          33307 }, 
     99    { MODE_SCN_KIDS_PETS,      16400 }, //  { MODE_SCN_CHILD,          16400 }, 
     100    { MODE_SCN_INDOOR,         16401 }, //  { MODE_SCN_PARTY,          16401 }, 
     101    { MODE_SCN_FOLIAGE,        16403 }, //  { MODE_SCN_GRASS,          16402 }, 
     102    { MODE_SCN_SNOW,           16404 }, 
     103    { MODE_SCN_BEACH,          16405 }, 
     104    { MODE_SCN_FIREWORK,       16406 }, 
     105    { MODE_SCN_AQUARIUM,       16408 }, 
     106    { MODE_SCN_WATER,          16402 }, 
     107}; 
     108 
    83109#include "../generic/shooting.c" 
    84110 
  • trunk/platform/a610/main.c

    r835 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               6  }, 
    40     { MODE_P,                  1  }, 
    41     { MODE_TV,                 3  }, 
    42     { MODE_AV,                 2  }, 
    43     { MODE_M,                  0  }, 
    44     { MODE_PORTRAIT,           9  }, 
    45     { MODE_NIGHT,              8  }, 
    46     { MODE_LANDSCAPE,          7  }, 
    47     { MODE_VIDEO_STD,          18 }, 
    48     { MODE_STITCH,             5  }, 
    49     { MODE_MY_COLORS,          4  }, 
    50     { MODE_SCN_WATER,          13 }, 
    51     { MODE_SCN_NIGHT,          15 }, 
    52     { MODE_SCN_CHILD,          16 }, 
    53     { MODE_SCN_PARTY,          14 }, 
    54     { MODE_SCN_GRASS,          10 }, 
    55     { MODE_SCN_SNOW,           11 }, 
    56     { MODE_SCN_BEACH,          12 }, 
    57     { MODE_SCN_FIREWORK,       17 } 
    58 }; 
    59 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
     35#if 0 
     36int rec_switch_state(void) { 
     37//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY; 
     38        return (physw_status[2] & 0x00002000); 
     39} 
     40#endif 
    6041 
    61 int mode_get() { 
    62     int mode, i, t=0xFF; 
     42int screen_opened(void) { 
     43//    mode |= (physw_status[2] & 0x00008000)?0:MODE_SCREEN_OPENED; 
     44        return !(physw_status[2] & 0x00008000); 
     45} 
    6346 
    64 // play/rec without override 
    65 //    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY; 
     47int screen_rotated(void) { 
     48//    mode |= (physw_status[2] & 0x00004000)?0:MODE_SCREEN_ROTATED; 
     49        return !(physw_status[2] & 0x00004000); 
     50} 
    6651 
    67     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    68  
    69     mode |= (physw_status[2] & 0x00008000)?0:MODE_SCREEN_OPENED; 
    70     mode |= (physw_status[2] & 0x00004000)?0:MODE_SCREEN_ROTATED; 
    71      
    72     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    73     for (i=0; i<MODESCNT; ++i) { 
    74         if (modemap[i].canonmode == t) { 
    75             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    76         } 
    77     } 
    78     return (mode); 
    79 } 
  • trunk/platform/a610/shooting.c

    r515 r847  
    8080};           
    8181 
     82static const CapturemodeMap modemap[] = { 
     83    { MODE_AUTO,               6  }, 
     84    { MODE_P,                  1  }, 
     85    { MODE_TV,                 3  }, 
     86    { MODE_AV,                 2  }, 
     87    { MODE_M,                  0  }, 
     88    { MODE_PORTRAIT,           9  }, 
     89    { MODE_NIGHT,              8  }, 
     90    { MODE_LANDSCAPE,          7  }, 
     91    { MODE_VIDEO_STD,          18 }, 
     92    { MODE_STITCH,             5  }, 
     93    { MODE_MY_COLORS,          4  }, 
     94    { MODE_SCN_WATER,          13 }, 
     95    { MODE_SCN_NIGHT,          15 }, 
     96    { MODE_SCN_CHILD,          16 }, 
     97    { MODE_SCN_PARTY,          14 }, 
     98    { MODE_SCN_GRASS,          10 }, 
     99    { MODE_SCN_SNOW,           11 }, 
     100    { MODE_SCN_BEACH,          12 }, 
     101    { MODE_SCN_FIREWORK,       17 } 
     102}; 
     103 
    82104#include "../generic/shooting.c" 
    83105 
  • trunk/platform/a620/main.c

    r835 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               6  }, 
    40     { MODE_P,                  1  }, 
    41     { MODE_TV,                 3  }, 
    42     { MODE_AV,                 2  }, 
    43     { MODE_M,                  0  }, 
    44     { MODE_PORTRAIT,           9  }, 
    45     { MODE_NIGHT,              8  }, 
    46     { MODE_LANDSCAPE,          7  }, 
    47     { MODE_VIDEO_STD,          18 }, 
    48     { MODE_STITCH,             5  }, 
    49     { MODE_MY_COLORS,          4  }, 
    50     { MODE_SCN_WATER,          13 }, 
    51     { MODE_SCN_NIGHT,          15 }, 
    52     { MODE_SCN_CHILD,          16 }, 
    53     { MODE_SCN_PARTY,          14 }, 
    54     { MODE_SCN_GRASS,          10 }, 
    55     { MODE_SCN_SNOW,           11 }, 
    56     { MODE_SCN_BEACH,          12 }, 
    57     { MODE_SCN_FIREWORK,       17 } 
    58 }; 
    59 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    6035 
    61 int mode_get() { 
    62     int mode, i, t=0xFF; 
     36int screen_opened(void) { 
     37//    mode |= (physw_status[2] & 0x00008000)?0:MODE_SCREEN_OPENED; 
     38        return !(physw_status[2] & 0x00008000); 
     39} 
    6340 
    64 // play/rec without override 
     41int screen_rotated(void) { 
     42//    mode |= (physw_status[2] & 0x00004000)?0:MODE_SCREEN_ROTATED; 
     43    return !(physw_status[2] & 0x00004000); 
     44} 
     45 
     46#if 0 
     47int rec_switch_state(void) { 
    6548//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY; 
    66  
    67     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    68  
    69     mode |= (physw_status[2] & 0x00008000)?0:MODE_SCREEN_OPENED; 
    70     mode |= (physw_status[2] & 0x00004000)?0:MODE_SCREEN_ROTATED; 
    71      
    72     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    73     for (i=0; i<MODESCNT; ++i) { 
    74         if (modemap[i].canonmode == t) { 
    75             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    76         } 
    77     } 
    78     return (mode); 
     49        return (physw_status[2] & 0x00002000); 
    7950} 
     51#endif 
  • trunk/platform/a620/shooting.c

    r515 r847  
    8080};           
    8181 
     82static const CapturemodeMap modemap[] = { 
     83    { MODE_AUTO,               6  }, 
     84    { MODE_P,                  1  }, 
     85    { MODE_TV,                 3  }, 
     86    { MODE_AV,                 2  }, 
     87    { MODE_M,                  0  }, 
     88    { MODE_PORTRAIT,           9  }, 
     89    { MODE_NIGHT,              8  }, 
     90    { MODE_LANDSCAPE,          7  }, 
     91    { MODE_VIDEO_STD,          18 }, 
     92    { MODE_STITCH,             5  }, 
     93    { MODE_MY_COLORS,          4  }, 
     94    { MODE_SCN_WATER,          13 }, 
     95    { MODE_SCN_NIGHT,          15 }, 
     96    { MODE_SCN_CHILD,          16 }, 
     97    { MODE_SCN_PARTY,          14 }, 
     98    { MODE_SCN_GRASS,          10 }, 
     99    { MODE_SCN_SNOW,           11 }, 
     100    { MODE_SCN_BEACH,          12 }, 
     101    { MODE_SCN_FIREWORK,       17 } 
     102}; 
     103 
    82104#include "../generic/shooting.c" 
    83105 
  • trunk/platform/a630/main.c

    r835 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               6  }, 
    40     { MODE_P,                  1  }, 
    41     { MODE_TV,                 3  }, 
    42     { MODE_AV,                 2  }, 
    43     { MODE_M,                  0  }, 
    44     { MODE_PORTRAIT,           9  }, 
    45     { MODE_NIGHT,              8  }, 
    46     { MODE_LANDSCAPE,          7  }, 
    47     { MODE_VIDEO_STD,          18 }, 
    48     { MODE_STITCH,             5  }, 
    49     { MODE_MY_COLORS,          4  }, 
    50     { MODE_SCN_WATER,          13 }, 
    51     { MODE_SCN_NIGHT,          15 }, 
    52     { MODE_SCN_CHILD,          16 }, 
    53     { MODE_SCN_PARTY,          14 }, 
    54     { MODE_SCN_GRASS,          10 }, 
    55     { MODE_SCN_SNOW,           11 }, 
    56     { MODE_SCN_BEACH,          12 }, 
    57     { MODE_SCN_FIREWORK,       17 } 
    58 }; 
    59 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
     35int screen_opened(void) { 
     36//    mode |= (physw_status[2] & 0x00008000)?0:MODE_SCREEN_OPENED; 
     37        return !(physw_status[2] & 0x00008000); 
     38} 
    6039 
    61 int mode_get() { 
    62     int mode, i, t=0xFF; 
     40int screen_rotated(void) { 
     41//    mode |= (physw_status[2] & 0x00004000)?0:MODE_SCREEN_ROTATED; 
     42        return !(physw_status[2] & 0x00004000); 
     43} 
    6344 
    64 // play/rec without override 
     45#if 0 
     46int rec_switch_state(void) { 
    6547//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY; 
    66  
    67     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    68  
    69     mode |= (physw_status[2] & 0x00008000)?0:MODE_SCREEN_OPENED; 
    70     mode |= (physw_status[2] & 0x00004000)?0:MODE_SCREEN_ROTATED; 
    71      
    72     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    73     for (i=0; i<MODESCNT; ++i) { 
    74         if (modemap[i].canonmode == t) { 
    75             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    76         } 
    77     } 
    78     return (mode); 
     48        return (physw_status[2] & 0x00002000); 
    7949} 
     50#endif 
  • trunk/platform/a630/shooting.c

    r515 r847  
    7676};           
    7777 
     78static const CapturemodeMap modemap[] = { 
     79    { MODE_AUTO,               6  }, 
     80    { MODE_P,                  1  }, 
     81    { MODE_TV,                 3  }, 
     82    { MODE_AV,                 2  }, 
     83    { MODE_M,                  0  }, 
     84    { MODE_PORTRAIT,           9  }, 
     85    { MODE_NIGHT,              8  }, 
     86    { MODE_LANDSCAPE,          7  }, 
     87    { MODE_VIDEO_STD,          18 }, 
     88    { MODE_STITCH,             5  }, 
     89    { MODE_MY_COLORS,          4  }, 
     90    { MODE_SCN_WATER,          13 }, 
     91    { MODE_SCN_NIGHT,          15 }, 
     92    { MODE_SCN_CHILD,          16 }, 
     93    { MODE_SCN_PARTY,          14 }, 
     94    { MODE_SCN_GRASS,          10 }, 
     95    { MODE_SCN_SNOW,           11 }, 
     96    { MODE_SCN_BEACH,          12 }, 
     97    { MODE_SCN_FIREWORK,       17 } 
     98}; 
     99 
    78100#include "../generic/shooting.c" 
    79101 
  • trunk/platform/a640/main.c

    r835 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               6  }, 
    40     { MODE_P,                  1  }, 
    41     { MODE_TV,                 3  }, 
    42     { MODE_AV,                 2  }, 
    43     { MODE_M,                  0  }, 
    44     { MODE_PORTRAIT,           9  }, 
    45     { MODE_NIGHT,              8  }, 
    46     { MODE_LANDSCAPE,          7  }, 
    47     { MODE_VIDEO_STD,          18 }, 
    48     { MODE_STITCH,             5  }, 
    49     { MODE_MY_COLORS,          4  }, 
    50     { MODE_SCN_WATER,          13 }, 
    51     { MODE_SCN_NIGHT,          15 }, 
    52     { MODE_SCN_CHILD,          16 }, 
    53     { MODE_SCN_PARTY,          14 }, 
    54     { MODE_SCN_GRASS,          10 }, 
    55     { MODE_SCN_SNOW,           11 }, 
    56     { MODE_SCN_BEACH,          12 }, 
    57     { MODE_SCN_FIREWORK,       17 } 
    58 }; 
    59 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
     35int screen_opened(void) { 
     36//    mode |= (physw_status[2] & 0x00008000)?0:MODE_SCREEN_OPENED; 
     37        return !(physw_status[2] & 0x00008000); 
     38} 
    6039 
    61 int mode_get() { 
    62     int mode, i, t=0xFF; 
     40int screen_rotated(void) { 
     41//    mode |= (physw_status[2] & 0x00004000)?0:MODE_SCREEN_ROTATED; 
     42        return !(physw_status[2] & 0x00004000); 
     43} 
    6344 
    64 // play/rec without override 
     45#if 0 
     46int rec_switch_state(void) { 
    6547//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY; 
    66  
    67     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    68  
    69     mode |= (physw_status[2] & 0x00008000)?0:MODE_SCREEN_OPENED; 
    70     mode |= (physw_status[2] & 0x00004000)?0:MODE_SCREEN_ROTATED; 
    71      
    72     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    73     for (i=0; i<MODESCNT; ++i) { 
    74         if (modemap[i].canonmode == t) { 
    75             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    76         } 
    77     } 
    78     return (mode); 
     48        return (physw_status[2] & 0x00002000); 
    7949} 
     50#endif 
  • trunk/platform/a640/shooting.c

    r515 r847  
    7676};           
    7777 
     78static const CapturemodeMap modemap[] = { 
     79    { MODE_AUTO,               6  }, 
     80    { MODE_P,                  1  }, 
     81    { MODE_TV,                 3  }, 
     82    { MODE_AV,                 2  }, 
     83    { MODE_M,                  0  }, 
     84    { MODE_PORTRAIT,           9  }, 
     85    { MODE_NIGHT,              8  }, 
     86    { MODE_LANDSCAPE,          7  }, 
     87    { MODE_VIDEO_STD,          18 }, 
     88    { MODE_STITCH,             5  }, 
     89    { MODE_MY_COLORS,          4  }, 
     90    { MODE_SCN_WATER,          13 }, 
     91    { MODE_SCN_NIGHT,          15 }, 
     92    { MODE_SCN_CHILD,          16 }, 
     93    { MODE_SCN_PARTY,          14 }, 
     94    { MODE_SCN_GRASS,          10 }, 
     95    { MODE_SCN_SNOW,           11 }, 
     96    { MODE_SCN_BEACH,          12 }, 
     97    { MODE_SCN_FIREWORK,       17 } 
     98}; 
     99 
    78100#include "../generic/shooting.c" 
    79101 
  • trunk/platform/a650/main.c

    r835 r847  
    2929} 
    3030 
    31 static struct { 
    32         int hackmode; 
    33         int canonmode; 
    34 } modemap[] = { 
    35     { MODE_AUTO,               32768 }, 
    36     { MODE_P,                  32772 }, 
    37     { MODE_TV,                 32771 }, 
    38     { MODE_AV,                 32770 }, 
    39     { MODE_M,                  32769 }, 
    40     { MODE_VIDEO_STD,          2597  }, 
    41     { MODE_VIDEO_COMPACT,      2599  }, 
    42     { MODE_STITCH,             33290 }, 
    43     { MODE_SCN_WATER,          16406 },   
    44     { MODE_SCN_AQUARIUM,       16407 },   
    45     { MODE_SCN_NIGHT,          16398 },   
    46     { MODE_SCN_GRASS,          16402 },    
    47     { MODE_SCN_SNOW,           16403 },   
    48     { MODE_SCN_BEACH,          16404 },   
    49     { MODE_SCN_FIREWORK,       16405 },   
    50     { MODE_INDOOR,             32785 }, 
    51     { MODE_KIDS_PETS,          32784 },  
    52     { MODE_NIGHT_SNAPSHOT,     32779 }, 
    53     { MODE_LANDSCAPE,          32780 },  
    54     { MODE_PORTRAIT,           32781 }, 
    55 };  
    56  
    57  
    58 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    59  
    6031 
    6132static const int fl_tbl[] = {7400, 8210, 9040, 9860, 10670, 12730, 14780, 16820, 18890, 21970, 25030, 29170, 36780, 44400}; 
     
    8152} 
    8253 
     54int screen_opened(void) { 
     55        return !(physw_status[0] & 0x04000000); 
     56} 
    8357 
    84 int mode_get() { 
    85     int mode, i, t=0xFF; 
     58int screen_rotated(void) { 
     59        return !(physw_status[0] & 0x08000000); 
     60} 
    8661 
    87 // play/rec without override 
     62#if 0 
     63int rec_switch_state(void) { 
    8864//    mode  = (physw_status[1] & 0x02000000)?MODE_PLAY:MODE_REC; 
    89  
    90     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    91  
    92     mode |= (physw_status[0] & 0x04000000)?0:MODE_SCREEN_OPENED; 
    93     mode |= (physw_status[0] & 0x08000000)?0:MODE_SCREEN_ROTATED; 
    94  
    95     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    96     for (i=0; i<MODESCNT; ++i) { 
    97         if (modemap[i].canonmode == t) { 
    98             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    99         } 
    100     } 
    101     return (mode); 
     65        return !(physw_status[1] & 0x02000000); 
    10266} 
     67#endif 
    10368 
    10469long get_vbatt_min() 
  • trunk/platform/a650/shooting.c

    r515 r847  
    7676};           
    7777 
     78static const CapturemodeMap modemap[] = { 
     79    { MODE_AUTO,               32768 }, 
     80    { MODE_P,                  32772 }, 
     81    { MODE_TV,                 32771 }, 
     82    { MODE_AV,                 32770 }, 
     83    { MODE_M,                  32769 }, 
     84    { MODE_VIDEO_STD,          2597  }, 
     85    { MODE_VIDEO_COMPACT,      2599  }, 
     86    { MODE_STITCH,             33290 }, 
     87    { MODE_SCN_WATER,          16406 },   
     88    { MODE_SCN_AQUARIUM,       16407 },   
     89    { MODE_SCN_NIGHT,          16398 },   
     90    { MODE_SCN_GRASS,          16402 },    
     91    { MODE_SCN_SNOW,           16403 },   
     92    { MODE_SCN_BEACH,          16404 },   
     93    { MODE_SCN_FIREWORK,       16405 },   
     94    { MODE_INDOOR,             32785 }, 
     95    { MODE_KIDS_PETS,          32784 },  
     96    { MODE_NIGHT_SNAPSHOT,     32779 }, 
     97    { MODE_LANDSCAPE,          32780 },  
     98    { MODE_PORTRAIT,           32781 }, 
     99}; 
     100 
    78101#include "../generic/shooting.c" 
    79102 
  • trunk/platform/a700/main.c

    r835 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               32768 }, 
    40     { MODE_P,                  32772 }, 
    41     { MODE_TV,                 32771 }, 
    42     { MODE_AV,                 32770 }, 
    43     { MODE_M,                  32769 }, 
    44     { MODE_PORTRAIT,           32781 }, 
    45     { MODE_NIGHT,              32782 }, 
    46     { MODE_LANDSCAPE,          32780 }, 
    47     { MODE_VIDEO_STD,          2596  }, 
    48     { MODE_VIDEO_SPEED,        2597  }, 
    49     { MODE_VIDEO_COMPACT,      2598  }, 
    50     { MODE_VIDEO_MY_COLORS,    2595  }, 
    51     { MODE_VIDEO_COLOR_ACCENT, 2594  }, 
    52     { MODE_STITCH,             33290 }, 
    53     { MODE_MY_COLORS,          16922 }, 
    54     { MODE_SCN_WATER,          16405 }, 
    55     { MODE_SCN_NIGHT,          16395 }, 
    56     { MODE_SCN_CHILD,          16399 }, 
    57     { MODE_SCN_PARTY,          16400 }, 
    58     { MODE_SCN_GRASS,          16401 }, 
    59     { MODE_SCN_SNOW,           16402 }, 
    60     { MODE_SCN_BEACH,          16403 }, 
    61     { MODE_SCN_FIREWORK,       16404 }, 
    62     { MODE_SCN_COLOR_ACCENT,   16921 } 
    63 }; 
    64 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    6535 
    66 int mode_get() { 
    67     int mode, i, t=0xFF; 
    68  
    69 // play/rec without override 
     36#if 0 
     37int rec_switch_state(void) { 
    7038//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY; 
    71  
    72     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    73  
    74     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    75     for (i=0; i<MODESCNT; ++i) { 
    76         if (modemap[i].canonmode == t) { 
    77             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    78         } 
    79     } 
    80     return (mode); 
     39        return (physw_status[2] & 0x00002000); 
    8140} 
     41#endif 
  • trunk/platform/a700/shooting.c

    r515 r847  
    7575};           
    7676 
     77static const CapturemodeMap modemap[] = { 
     78    { MODE_AUTO,               32768 }, 
     79    { MODE_P,                  32772 }, 
     80    { MODE_TV,                 32771 }, 
     81    { MODE_AV,                 32770 }, 
     82    { MODE_M,                  32769 }, 
     83    { MODE_PORTRAIT,           32781 }, 
     84    { MODE_NIGHT,              32782 }, 
     85    { MODE_LANDSCAPE,          32780 }, 
     86    { MODE_VIDEO_STD,          2596  }, 
     87    { MODE_VIDEO_SPEED,        2597  }, 
     88    { MODE_VIDEO_COMPACT,      2598  }, 
     89    { MODE_VIDEO_MY_COLORS,    2595  }, 
     90    { MODE_VIDEO_COLOR_ACCENT, 2594  }, 
     91    { MODE_STITCH,             33290 }, 
     92    { MODE_MY_COLORS,          16922 }, 
     93    { MODE_SCN_WATER,          16405 }, 
     94    { MODE_SCN_NIGHT,          16395 }, 
     95    { MODE_SCN_CHILD,          16399 }, 
     96    { MODE_SCN_PARTY,          16400 }, 
     97    { MODE_SCN_GRASS,          16401 }, 
     98    { MODE_SCN_SNOW,           16402 }, 
     99    { MODE_SCN_BEACH,          16403 }, 
     100    { MODE_SCN_FIREWORK,       16404 }, 
     101    { MODE_SCN_COLOR_ACCENT,   16921 } 
     102}; 
     103 
    77104#include "../generic/shooting.c" 
    78105 
  • trunk/platform/a710/main.c

    r835 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               32768 }, 
    40     { MODE_P,                  32772 }, 
    41     { MODE_TV,                 32771 }, 
    42     { MODE_AV,                 32770 }, 
    43     { MODE_M,                  32769 }, 
    44     { MODE_PORTRAIT,           32781 }, 
    45     { MODE_NIGHT,              32782 }, 
    46     { MODE_LANDSCAPE,          32780 }, 
    47     { MODE_VIDEO_STD,          2596  }, 
    48     { MODE_VIDEO_SPEED,        2597  }, 
    49     { MODE_VIDEO_COMPACT,      2598  }, 
    50     { MODE_VIDEO_MY_COLORS,    2595  }, 
    51     { MODE_VIDEO_COLOR_ACCENT, 2594  }, 
    52     { MODE_STITCH,             33290 }, 
    53     { MODE_MY_COLORS,          16922 }, 
    54     { MODE_SCN_WATER,          16405 }, 
    55     { MODE_SCN_NIGHT,          16395 }, 
    56     { MODE_SCN_CHILD,          16399 }, 
    57     { MODE_SCN_PARTY,          16400 }, 
    58     { MODE_SCN_GRASS,          16401 }, 
    59     { MODE_SCN_SNOW,           16402 }, 
    60     { MODE_SCN_BEACH,          16403 }, 
    61     { MODE_SCN_FIREWORK,       16404 }, 
    62     { MODE_SCN_COLOR_ACCENT,   16921 } 
    63 };  
    64 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    65  
    66 int mode_get() { 
    67     int mode, i, t=0xFF; 
    68  
    69 // play/rec without override 
     35#if 0 
     36int rec_switch_state(void) { 
    7037//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY; 
    71  
    72     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    73  
    74     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    75     for (i=0; i<MODESCNT; ++i) { 
    76         if (modemap[i].canonmode == t) { 
    77             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    78         } 
    79     } 
    80     return (mode); 
     38        return (physw_status[2] & 0x00002000); 
    8139} 
     40#endif 
  • trunk/platform/a710/shooting.c

    r515 r847  
    7676};           
    7777 
     78static const CapturemodeMap modemap[] = { 
     79    { MODE_AUTO,               32768 }, 
     80    { MODE_P,                  32772 }, 
     81    { MODE_TV,                 32771 }, 
     82    { MODE_AV,                 32770 }, 
     83    { MODE_M,                  32769 }, 
     84    { MODE_PORTRAIT,           32781 }, 
     85    { MODE_NIGHT,              32782 }, 
     86    { MODE_LANDSCAPE,          32780 }, 
     87    { MODE_VIDEO_STD,          2596  }, 
     88    { MODE_VIDEO_SPEED,        2597  }, 
     89    { MODE_VIDEO_COMPACT,      2598  }, 
     90    { MODE_VIDEO_MY_COLORS,    2595  }, 
     91    { MODE_VIDEO_COLOR_ACCENT, 2594  }, 
     92    { MODE_STITCH,             33290 }, 
     93    { MODE_MY_COLORS,          16922 }, 
     94    { MODE_SCN_WATER,          16405 }, 
     95    { MODE_SCN_NIGHT,          16395 }, 
     96    { MODE_SCN_CHILD,          16399 }, 
     97    { MODE_SCN_PARTY,          16400 }, 
     98    { MODE_SCN_GRASS,          16401 }, 
     99    { MODE_SCN_SNOW,           16402 }, 
     100    { MODE_SCN_BEACH,          16403 }, 
     101    { MODE_SCN_FIREWORK,       16404 }, 
     102    { MODE_SCN_COLOR_ACCENT,   16921 } 
     103}; 
     104 
    78105#include "../generic/shooting.c" 
    79106 
  • trunk/platform/a720/main.c

    r835 r847  
    2929} 
    3030 
    31 static struct { 
    32         int hackmode; 
    33         int canonmode; 
    34 } modemap[] = { 
    35     { MODE_AUTO,               32768 }, 
    36     { MODE_P,                  32772 }, 
    37     { MODE_TV,                 32771 }, 
    38     { MODE_AV,                 32770 }, 
    39     { MODE_M,                  32769 }, 
    40     { MODE_VIDEO_STD,          2597  }, 
    41     { MODE_VIDEO_COMPACT,      2599  }, 
    42     { MODE_STITCH,             33290 }, 
    43     { MODE_SCN_WATER,          16406 },   
    44     { MODE_SCN_AQUARIUM,       16407 },   
    45     { MODE_SCN_NIGHT,          16398 },   
    46     { MODE_SCN_GRASS,          16402 },    
    47     { MODE_SCN_SNOW,           16403 },   
    48     { MODE_SCN_BEACH,          16404 },   
    49     { MODE_SCN_FIREWORK,       16405 },   
    50     { MODE_INDOOR,             32785 }, 
    51     { MODE_KIDS_PETS,          32784 },  
    52     { MODE_NIGHT_SNAPSHOT,     32779 }, 
    53     { MODE_LANDSCAPE,          32780 },  
    54     { MODE_PORTRAIT,           32781 }, 
    55 };  
    56  
    57  
    58 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    59  
    6031 
    6132static const int fl_tbl[] = {5800, 6420, 7060, 7700, 8340, 9950, 11550, 13160, 14750, 17150, 19570, 22760, 26750, 30750, 34800}; 
     
    8152} 
    8253 
     54#if 0 
     55int rec_switch_state(void) { 
     56        return (physw_status[1] & 0x02000000); 
     57} 
     58#endif 
    8359 
    84 int mode_get() { 
    85     int mode, i, t=0xFF; 
    86  
    87 // play/rec without override 
    88 //    mode  = (physw_status[1] & 0x02000000)?MODE_REC:MODE_PLAY; 
    89  
    90     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    91      
    92     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    93     for (i=0; i<MODESCNT; ++i) { 
    94         if (modemap[i].canonmode == t) { 
    95             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    96         } 
    97     } 
    98     return (mode); 
    99 } 
    10060 
    10161long get_vbatt_min() 
  • trunk/platform/a720/shooting.c

    r515 r847  
    8080};           
    8181 
     82static const CapturemodeMap modemap[] = { 
     83    { MODE_AUTO,               32768 }, 
     84    { MODE_P,                  32772 }, 
     85    { MODE_TV,                 32771 }, 
     86    { MODE_AV,                 32770 }, 
     87    { MODE_M,                  32769 }, 
     88    { MODE_VIDEO_STD,          2597  }, 
     89    { MODE_VIDEO_COMPACT,      2599  }, 
     90    { MODE_STITCH,             33290 }, 
     91    { MODE_SCN_WATER,          16406 },   
     92    { MODE_SCN_AQUARIUM,       16407 },   
     93    { MODE_SCN_NIGHT,          16398 },   
     94    { MODE_SCN_GRASS,          16402 },    
     95    { MODE_SCN_SNOW,           16403 },   
     96    { MODE_SCN_BEACH,          16404 },   
     97    { MODE_SCN_FIREWORK,       16405 },   
     98    { MODE_INDOOR,             32785 }, 
     99    { MODE_KIDS_PETS,          32784 },  
     100    { MODE_NIGHT_SNAPSHOT,     32779 }, 
     101    { MODE_LANDSCAPE,          32780 },  
     102    { MODE_PORTRAIT,           32781 }, 
     103}; 
     104 
    82105#include "../generic/shooting.c" 
    83106 
  • trunk/platform/g7/main.c

    r831 r847  
    3232    else return fl_tbl[zp]*10/fl_tbl[0]; 
    3333} 
    34  
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               32768 }, 
    40     { MODE_P,                  32772 }, 
    41     { MODE_TV,                 32771 }, 
    42     { MODE_AV,                 32770 }, 
    43     { MODE_M,                  32769 }, 
    44     { MODE_VIDEO_STD,          2596  }, 
    45     { MODE_VIDEO_HIRES,        2599  }, 
    46     { MODE_VIDEO_COMPACT,      2598  }, 
    47     { MODE_VIDEO_MY_COLORS,    2595  }, 
    48     { MODE_VIDEO_COLOR_ACCENT, 2594  }, 
    49     { MODE_STITCH,             33290 }, 
    50     { MODE_MY_COLORS,      16922 }, 
    51     { MODE_SCN_WATER,          16405 }, 
    52     { MODE_SCN_AQUARIUM,       16406 }, 
    53     { MODE_SCN_NIGHT,          16395 }, 
    54     { MODE_SCN_NIGHT1,         16398 }, 
    55     { MODE_SCN_CHILD,          16399 }, 
    56     { MODE_SCN_PARTY,          16400 }, 
    57     { MODE_SCN_GRASS,          16401 }, 
    58     { MODE_SCN_SNOW,           16402 }, 
    59     { MODE_SCN_BEACH,          16403 }, 
    60     { MODE_SCN_FIREWORK,       16404 }, 
    61     { MODE_SCN_ISO_3200,       16411 }, 
    62     { MODE_PORTRAIT,           16397 }, 
    63     { MODE_LANDSCAPE,          16396 }, 
    64     { MODE_SCN_SPORT,          16903 }, 
    65     { MODE_SCN_COLOR_ACCENT,   16921 } 
    66 };  
    67  
    68 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    69  
    70 int mode_get() { 
    71     int mode, i, t=0xFF; 
    72  
    73     mode  = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    74      
    75     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    76     for (i=0; i<MODESCNT; ++i) { 
    77         if (modemap[i].canonmode == t) { 
    78             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    79         } 
    80     } 
    81     return (mode); 
    82 } 
  • trunk/platform/g7/shooting.c

    r515 r847  
    7777};           
    7878 
     79static const CapturemodeMap modemap[] = { 
     80    { MODE_AUTO,               32768 }, 
     81    { MODE_P,                  32772 }, 
     82    { MODE_TV,                 32771 }, 
     83    { MODE_AV,                 32770 }, 
     84    { MODE_M,                  32769 }, 
     85    { MODE_VIDEO_STD,          2596  }, 
     86    { MODE_VIDEO_HIRES,        2599  }, 
     87    { MODE_VIDEO_COMPACT,      2598  }, 
     88    { MODE_VIDEO_MY_COLORS,    2595  }, 
     89    { MODE_VIDEO_COLOR_ACCENT, 2594  }, 
     90    { MODE_STITCH,             33290 }, 
     91    { MODE_MY_COLORS,      16922 }, 
     92    { MODE_SCN_WATER,          16405 }, 
     93    { MODE_SCN_AQUARIUM,       16406 }, 
     94    { MODE_SCN_NIGHT,          16395 }, 
     95    { MODE_SCN_NIGHT1,         16398 }, 
     96    { MODE_SCN_CHILD,          16399 }, 
     97    { MODE_SCN_PARTY,          16400 }, 
     98    { MODE_SCN_GRASS,          16401 }, 
     99    { MODE_SCN_SNOW,           16402 }, 
     100    { MODE_SCN_BEACH,          16403 }, 
     101    { MODE_SCN_FIREWORK,       16404 }, 
     102    { MODE_SCN_ISO_3200,       16411 }, 
     103    { MODE_PORTRAIT,           16397 }, 
     104    { MODE_LANDSCAPE,          16396 }, 
     105    { MODE_SCN_SPORT,          16903 }, 
     106    { MODE_SCN_COLOR_ACCENT,   16921 } 
     107}; 
     108 
    79109#include "../generic/shooting.c" 
    80110 
  • trunk/platform/g9/main.c

    r831 r847  
    2929} 
    3030 
    31 static struct { 
    32         int hackmode; 
    33         int canonmode; 
    34 } modemap[] = { 
    35     { MODE_AUTO,               32768 }, 
    36     { MODE_P,                  32772 }, 
    37     { MODE_TV,                 32771 }, 
    38     { MODE_AV,                 32770 }, 
    39     { MODE_M,                  32769 }, 
    40     { MODE_VIDEO_STD,          2597  }, 
    41     { MODE_VIDEO_HIRES,        2600  }, 
    42     { MODE_VIDEO_COMPACT,      2599  }, 
    43     { MODE_VIDEO_COLOR_SWAP,   2596  }, 
    44     { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
    45     { MODE_VIDEO_TIME_LAPSE,   2601  }, 
    46     { MODE_STITCH,             33290 }, 
    47     { MODE_PORTRAIT,               16397 },       
    48     { MODE_SCN_NIGHT,          16398 }, 
    49     { MODE_NIGHT_SNAPSHOT,     16395 }, 
    50     { MODE_SCN_INDOOR,         16401 }, 
    51     { MODE_SCN_SNOW,           16403 }, 
    52     { MODE_SCN_FIREWORK,       16405 }, 
    53     { MODE_SCN_WATER,          16406 }, 
    54     { MODE_SCN_COLOR_ACCENT,   16922 },  
    55     { MODE_SCN_SPORT,          16903 }, 
    56     { MODE_SCN_KIDS_PETS,      16400 }, 
    57     { MODE_SCN_FOLIAGE,        16402 },  
    58     { MODE_SCN_BEACH,          16404 }, 
    59     { MODE_SCN_AQUARIUM,       16407 }, 
    60     { MODE_SCN_ISO_3200,       16412 }, 
    61     { MODE_SCN_COLOR_SWAP,         16923 }, 
    62     { MODE_LANDSCAPE,          16396 } 
    63  
    64 }; 
    65  
    66 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    67  
    6831 
    6932static const int fl_tbl[] = {7400, 8210, 9040, 9860, 10670, 12730, 14780, 16820, 18890, 21970, 25030, 29170, 36780, 44400}; 
     
    9053 
    9154 
    92 int mode_get() { 
    93     int mode, i, t=0xFF; 
    94  
    95     mode  = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    96          
    97     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    98     for (i=0; i<MODESCNT; ++i) { 
    99         if (modemap[i].canonmode == t) { 
    100             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    101         } 
    102     } 
    103     return (mode); 
    104 } 
    105  
    10655long get_vbatt_min() 
    10756{ 
  • trunk/platform/g9/shooting.c

    r576 r847  
    8181};           
    8282 
     83static const CapturemodeMap modemap[] = { 
     84    { MODE_AUTO,               32768 }, 
     85    { MODE_P,                  32772 }, 
     86    { MODE_TV,                 32771 }, 
     87    { MODE_AV,                 32770 }, 
     88    { MODE_M,                  32769 }, 
     89    { MODE_VIDEO_STD,          2597  }, 
     90    { MODE_VIDEO_HIRES,        2600  }, 
     91    { MODE_VIDEO_COMPACT,      2599  }, 
     92    { MODE_VIDEO_COLOR_SWAP,   2596  }, 
     93    { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
     94    { MODE_VIDEO_TIME_LAPSE,   2601  }, 
     95    { MODE_STITCH,             33290 }, 
     96    { MODE_PORTRAIT,               16397 }, 
     97    { MODE_SCN_NIGHT,          16398 }, 
     98    { MODE_NIGHT_SNAPSHOT,     16395 }, 
     99    { MODE_SCN_INDOOR,         16401 }, 
     100    { MODE_SCN_SNOW,           16403 }, 
     101    { MODE_SCN_FIREWORK,       16405 }, 
     102    { MODE_SCN_WATER,          16406 }, 
     103    { MODE_SCN_COLOR_ACCENT,   16922 }, 
     104    { MODE_SCN_SPORT,          16903 }, 
     105    { MODE_SCN_KIDS_PETS,      16400 }, 
     106    { MODE_SCN_FOLIAGE,        16402 }, 
     107    { MODE_SCN_BEACH,          16404 }, 
     108    { MODE_SCN_AQUARIUM,       16407 }, 
     109    { MODE_SCN_ISO_3200,       16412 }, 
     110    { MODE_SCN_COLOR_SWAP,         16923 }, 
     111    { MODE_LANDSCAPE,          16396 } 
     112}; 
     113 
    83114#include "../generic/shooting.c" 
    84115 
  • trunk/platform/generic/shooting.c

    r842 r847  
    2424#define ISO_MAX (iso_table[ISO_SIZE-1].id) 
    2525#define ISO_MIN_VALUE (iso_table[1-iso_table[0].id].prop_id) 
     26 
     27static const unsigned MODESCNT=(sizeof(modemap)/sizeof(modemap[0])); 
    2628 
    2729/*define PROPCASE_CONT_MODE_SHOOT_COUNT                 218*/ 
     
    13821384 
    13831385#endif 
     1386 
     1387int shooting_mode_canon2chdk(int canonmode) { 
     1388        int i; 
     1389        for (i=0; i < MODESCNT; i++) { 
     1390                if (modemap[i].canonmode == canonmode)  
     1391                        return modemap[i].hackmode; 
     1392        } 
     1393        return 0; 
     1394} 
     1395 
     1396int shooting_mode_chdk2canon(int hackmode) { 
     1397        int i; 
     1398        for (i=0; i < MODESCNT; i++) { 
     1399                if (modemap[i].hackmode == hackmode)  
     1400                        return modemap[i].canonmode; 
     1401        } 
     1402        return -1; // 0 is a valid mode on old cameras! 
     1403} 
     1404 
     1405int shooting_set_mode_chdk(int mode) { 
     1406        int canonmode = shooting_mode_chdk2canon(mode); 
     1407        if (canonmode == -1 || !rec_mode_active()) 
     1408                return 0; 
     1409        _SetCurrentCaptureModeType(canonmode); 
     1410        // TODO since mode seems to be fully set when this returns, 
     1411        // we could check if it worked 
     1412        return 1; 
     1413} 
     1414 
     1415int shooting_set_mode_canon(int canonmode) { 
     1416        if(canonmode == -1 || !rec_mode_active()) 
     1417                return 0; 
     1418        _SetCurrentCaptureModeType(canonmode); 
     1419        return 1; 
     1420} 
     1421 
     1422// override in platform/<cam>/main.c if playrec_mode is not found or different 
     1423int __attribute__((weak)) rec_mode_active(void) { 
     1424    return (playrec_mode==2 || playrec_mode==4 || playrec_mode==5); 
     1425} 
     1426 
     1427// currently nothing needs to override this, so not weak 
     1428int /*__attribute__((weak))*/ mode_get(void) { 
     1429    int mode, t=0xFF; 
     1430 
     1431    mode = (rec_mode_active())?MODE_REC:MODE_PLAY; 
     1432 
     1433#ifdef CAM_SWIVEL_SCREEN 
     1434    mode |= (screen_opened())?MODE_SCREEN_OPENED:0; 
     1435    mode |= (screen_rotated())?MODE_SCREEN_ROTATED:0; 
     1436#endif 
     1437 
     1438    _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
     1439        mode |= shooting_mode_canon2chdk(t); 
     1440 
     1441    return (mode); 
     1442} 
  • trunk/platform/generic/wrappers.c

    r842 r847  
    952952} 
    953953 
    954 void SetCurrentCaptureModeType(unsigned mode) { 
    955         _SetCurrentCaptureModeType(mode); 
    956 } 
    957  
    958954// TODO this belongs lib.c, but not all cameras include it 
    959955// same as bitmap width for most cameras, override in platform/sub/lib.c as needed 
  • trunk/platform/ixus40_sd300/main.c

    r515 r847  
    202202 
    203203 
    204 static struct 
    205         { 
    206         int hackmode; 
    207         int canonmode; 
    208         } 
    209         modemap[] = 
    210         { 
    211     { MODE_P,                   1 }, 
    212     { MODE_AUTO,                3 }, 
    213     { MODE_MY_COLORS,           4 }, 
    214     { MODE_PORTRAIT,            5 }, 
    215     { MODE_SCN_GRASS,           6 }, 
    216     { MODE_SCN_SNOW,            7 }, 
    217     { MODE_SCN_BEACH,           8 }, 
    218     { MODE_SCN_FIREWORK,        9 },  
    219     { MODE_SCN_WATER,          10 }, 
    220     { MODE_SCN_PARTY,          11 }, 
    221     { MODE_SCN_CHILD,          12 }, 
    222     { MODE_SCN_NIGHT,          13 }, 
    223     { MODE_STITCH,             14 }, 
    224     { MODE_VIDEO_STD,          15 } 
    225         }; 
    226  
    227 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    228  
    229 int mode_get()  
    230         { 
    231     int mode, i, t=0xFF; 
    232     mode  = (physw_status[0]&0x03)==0x01 ?  MODE_PLAY : MODE_REC; 
    233     t=0xFF; 
    234     _GetPropertyCase(0, &t, 4); 
    235     for (i=0; i<MODESCNT; ++i) 
    236                 { 
    237                 if (modemap[i].canonmode == t) 
    238                         { 
    239                         return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    240                         } 
    241                 } 
    242     return (mode); 
    243         } 
     204// TODO this may not work with play/rec override 
     205// playrec_mode not verified 
     206int rec_mode_active(void) { 
     207    return ((physw_status[0]&0x03)==0x01) ? 0 : 1; 
     208} 
    244209 
    245210#if 0 
  • trunk/platform/ixus40_sd300/shooting.c

    r515 r847  
    8181};           
    8282 
     83static const CapturemodeMap modemap[] = { 
     84    { MODE_P,                   1 }, 
     85    { MODE_AUTO,                3 }, 
     86    { MODE_MY_COLORS,           4 }, 
     87    { MODE_PORTRAIT,            5 }, 
     88    { MODE_SCN_GRASS,           6 }, 
     89    { MODE_SCN_SNOW,            7 }, 
     90    { MODE_SCN_BEACH,           8 }, 
     91    { MODE_SCN_FIREWORK,        9 },  
     92    { MODE_SCN_WATER,          10 }, 
     93    { MODE_SCN_PARTY,          11 }, 
     94    { MODE_SCN_CHILD,          12 }, 
     95    { MODE_SCN_NIGHT,          13 }, 
     96    { MODE_STITCH,             14 }, 
     97    { MODE_VIDEO_STD,          15 } 
     98}; 
     99 
    83100#include "../generic/shooting.c" 
    84101 
  • trunk/platform/ixus50_sd400/main.c

    r838 r847  
    183183 
    184184 
    185 static struct { 
    186         int hackmode; 
    187         int canonmode; 
    188 } modemap[] = { 
    189     { MODE_DIGITAL_MACRO,       0 }, 
    190     { MODE_P,                   1 }, 
    191     { MODE_AUTO,                3 }, 
    192     { MODE_MY_COLORS,           4 }, 
    193     { MODE_PORTRAIT,            5 }, 
    194         { MODE_SCN_WATER,           6 }, 
    195     { MODE_SCN_PARTY,           7 }, 
    196     { MODE_SCN_CHILD,           8 }, 
    197     { MODE_SCN_NIGHT,           9 }, 
    198         { MODE_STITCH,             10 }, 
    199     { MODE_VIDEO_STD,          11 } 
    200 }; 
     185#if 0 
     186int rec_switch_state(void) { 
     187        // mode  = (physw_status[0]&0x07)==0x01 ?  MODE_PLAY : MODE_REC; 
     188        return (physw_status[0]&0x07)==0x01 ?  0 : 1; 
     189} 
     190#endif 
    201191 
    202 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    203  
    204 int mode_get() { 
    205     int mode, i, t=0xFF; 
    206         // play/rec without overrides 
    207         // mode  = (physw_status[0]&0x07)==0x01 ?  MODE_PLAY : MODE_REC; 
    208  
    209     mode = (playrec_mode==1)?MODE_REC:MODE_PLAY; 
    210  
    211     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    212     for (i=0; i<MODESCNT; ++i) { 
    213         if (modemap[i].canonmode == t) { 
    214             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    215         } 
    216     } 
    217     return (mode); 
     192int rec_mode_active(void) { 
     193    return playrec_mode==1; 
    218194} 
  • trunk/platform/ixus50_sd400/shooting.c

    r515 r847  
    8181};           
    8282 
     83static const CapturemodeMap modemap[] = { 
     84    { MODE_DIGITAL_MACRO,       0 }, 
     85    { MODE_P,                   1 }, 
     86    { MODE_AUTO,                3 }, 
     87    { MODE_MY_COLORS,           4 }, 
     88    { MODE_PORTRAIT,            5 }, 
     89        { MODE_SCN_WATER,           6 }, 
     90    { MODE_SCN_PARTY,           7 }, 
     91    { MODE_SCN_CHILD,           8 }, 
     92    { MODE_SCN_NIGHT,           9 }, 
     93        { MODE_STITCH,             10 }, 
     94    { MODE_VIDEO_STD,          11 } 
     95}; 
     96 
    8397#include "../generic/shooting.c" 
    8498 
  • trunk/platform/ixus55_sd450/main.c

    r835 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_P,                   0 }, 
    40     { MODE_DIGITAL_MACRO,       2 }, 
    41     { MODE_MY_COLORS,           3 }, 
    42     { MODE_STITCH,              4 },  
    43     { MODE_AUTO,                5 }, 
    44     { MODE_PORTRAIT,            6 }, 
    45     { MODE_SCN_SNOW,            8 }, 
    46     { MODE_SCN_NIGHT,          12 }, 
    47     { MODE_VIDEO_STD,          15 } 
    48 }; 
    49 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    5035 
    51 /* 
    52    9xxxx - view 
    53    3xxxx - video 
    54    bxxxx - photo 
    55 */ 
    56  
    57  
    58 int mode_get() { 
    59     int mode, i, t=0xFF; 
    60  
    61 // play/rec without override 
     36#if 0 
     37int rec_switch_state(void) { 
    6238//    mode  = (physw_status[1] & 0x2)?MODE_REC:MODE_PLAY;  
    63  
    64     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    65  
    66     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    67     for (i=0; i<MODESCNT; ++i) { 
    68         if (modemap[i].canonmode == t) { 
    69             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    70         } 
    71     } 
    72     return (mode); 
     39        return (physw_status[1] & 0x2);  
    7340} 
     41#endif 
  • trunk/platform/ixus55_sd450/shooting.c

    r515 r847  
    8181};           
    8282 
     83static const CapturemodeMap modemap[] = { 
     84    { MODE_P,                   0 }, 
     85    { MODE_DIGITAL_MACRO,       2 }, 
     86    { MODE_MY_COLORS,           3 }, 
     87    { MODE_STITCH,              4 },  
     88    { MODE_AUTO,                5 }, 
     89    { MODE_PORTRAIT,            6 }, 
     90    { MODE_SCN_SNOW,            8 }, 
     91    { MODE_SCN_NIGHT,          12 }, 
     92    { MODE_VIDEO_STD,          15 } 
     93}; 
     94 
    8395#include "../generic/shooting.c" 
    8496 
  • trunk/platform/ixus60_sd600/main.c

    r835 r847  
    3838} 
    3939 
    40 static struct { 
    41         int hackmode; 
    42         int canonmode; 
    43 } modemap[] = { 
    44     { MODE_P,                  32772 }, // note, this is called Manual, but eqivalent to P on cameras with real manual 
    45     { MODE_AUTO,               32768 }, 
    46     { MODE_DIGITAL_MACRO,      33288 }, 
    47     { MODE_PORTRAIT,           32781 }, 
    48     { MODE_NIGHT_SNAPSHOT,     32779 }, // "night scene" on dial, different from "night snapshot" under "scene" below 
    49     { MODE_SCN_COLOR_ACCENT,   16920 }, // "color accent" 
    50     { MODE_SCN_COLOR_SWAP,     16921 }, // "color swap" 
    51     { MODE_SCN_KIDS_PETS,      16399 }, // "kids and pets" 
    52     { MODE_SCN_INDOOR,         16400 }, // "indoor" 
    53     { MODE_SCN_FOLIAGE,        16401 }, // "foliage" 
    54     { MODE_SCN_SNOW,           16402 }, // "snow" 
    55     { MODE_SCN_BEACH,          16403 }, // "beach" 
    56     { MODE_STITCH,             33290 }, 
    57     { MODE_SCN_FIREWORK,       16404 }, // "fireworks" 
    58     { MODE_SCN_UNDERWATER,     16405 }, // "under water" 
    59     { MODE_VIDEO_STD,          2593  }, 
    60     { MODE_VIDEO_SPEED,        2594  }, // "fast frame rate" 
    61     { MODE_VIDEO_COMPACT,      2595  }, // "compact" 
    62     { MODE_VIDEO_COLOR_ACCENT, 2591  }, // "color accent" 
    63     { MODE_VIDEO_COLOR_SWAP,   2592  }, // "color swap" 
    64 }; 
    65 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    66  
    67 /* 
    68    9xxxx - view 
    69    3xxxx - video 
    70    bxxxx - photo 
    71 */ 
    72  
    73  
    74 int mode_get() { 
    75     int mode, i, t=0xFF; 
    76  
    77 // play/rec without override 
     40#if 0 
     41int rec_switch_state(void) { 
    7842//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY; 
    79      
    80     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    81  
    82     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    83     for (i=0; i<MODESCNT; ++i) { 
    84         if (modemap[i].canonmode == t) { 
    85             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    86         } 
    87     } 
    88     return (mode); 
     43        return (physw_status[2] & 0x00002000); 
    8944} 
     45#endif 
  • trunk/platform/ixus60_sd600/shooting.c

    r515 r847  
    7676};           
    7777 
     78static const CapturemodeMap modemap[] = { 
     79    { MODE_P,                  32772 }, // note, this is called Manual, but eqivalent to P on cameras with real manual 
     80    { MODE_AUTO,               32768 }, 
     81    { MODE_DIGITAL_MACRO,      33288 }, 
     82    { MODE_PORTRAIT,           32781 }, 
     83    { MODE_NIGHT_SNAPSHOT,     32779 }, // "night scene" on dial, different from "night snapshot" under "scene" below 
     84    { MODE_SCN_COLOR_ACCENT,   16920 }, // "color accent" 
     85    { MODE_SCN_COLOR_SWAP,     16921 }, // "color swap" 
     86    { MODE_SCN_KIDS_PETS,      16399 }, // "kids and pets" 
     87    { MODE_SCN_INDOOR,         16400 }, // "indoor" 
     88    { MODE_SCN_FOLIAGE,        16401 }, // "foliage" 
     89    { MODE_SCN_SNOW,           16402 }, // "snow" 
     90    { MODE_SCN_BEACH,          16403 }, // "beach" 
     91    { MODE_STITCH,             33290 }, 
     92    { MODE_SCN_FIREWORK,       16404 }, // "fireworks" 
     93    { MODE_SCN_UNDERWATER,     16405 }, // "under water" 
     94    { MODE_VIDEO_STD,          2593  }, 
     95    { MODE_VIDEO_SPEED,        2594  }, // "fast frame rate" 
     96    { MODE_VIDEO_COMPACT,      2595  }, // "compact" 
     97    { MODE_VIDEO_COLOR_ACCENT, 2591  }, // "color accent" 
     98    { MODE_VIDEO_COLOR_SWAP,   2592  }, // "color swap" 
     99}; 
     100 
    78101#include "../generic/shooting.c" 
    79102 
  • trunk/platform/ixus65_sd630/main.c

    r835 r847  
    3838} 
    3939 
    40 static struct { 
    41         int hackmode; 
    42         int canonmode; 
    43 } modemap[] = { 
    44     { MODE_AUTO,               6  }, 
    45     { MODE_P,                  1  }, 
    46     { MODE_TV,                 3  }, 
    47     { MODE_AV,                 2  }, 
    48     { MODE_M,                  0  }, 
    49     { MODE_PORTRAIT,           9  }, 
    50     { MODE_NIGHT,              8  }, 
    51     { MODE_LANDSCAPE,          7  }, 
    52     { MODE_VIDEO_STD,          18 }, 
    53     { MODE_STITCH,             5  }, 
    54     { MODE_MY_COLORS,          4  }, 
    55     { MODE_SCN_WATER,          13 }, 
    56     { MODE_SCN_NIGHT,          15 }, 
    57     { MODE_SCN_CHILD,          16 }, 
    58     { MODE_SCN_PARTY,          14 }, 
    59     { MODE_SCN_GRASS,          10 }, 
    60     { MODE_SCN_SNOW,           11 }, 
    61     { MODE_SCN_BEACH,          12 }, 
    62     { MODE_SCN_FIREWORK,       17 } 
    63 }; 
    64 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    65  
    66 /* 
    67    9xxxx - view 
    68    3xxxx - video 
    69    bxxxx - photo 
    70 */ 
    71  
    72  
    73 int mode_get() { 
    74     int mode, i, t=0xFF; 
    75  
    76 // play/rec without override 
     40#if 0 
     41int rec_switch_state(void) { 
    7742//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY; 
    78  
    79     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    80      
    81     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    82     for (i=0; i<MODESCNT; ++i) { 
    83         if (modemap[i].canonmode == t) { 
    84             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    85         } 
    86     } 
    87     return (mode); 
     43        return (physw_status[2] & 0x00002000); 
    8844} 
     45#endif 
  • trunk/platform/ixus65_sd630/shooting.c

    r515 r847  
    7676};           
    7777 
     78static const CapturemodeMap modemap[] = { 
     79    { MODE_AUTO,               6  }, 
     80    { MODE_P,                  1  }, 
     81    { MODE_TV,                 3  }, 
     82    { MODE_AV,                 2  }, 
     83    { MODE_M,                  0  }, 
     84    { MODE_PORTRAIT,           9  }, 
     85    { MODE_NIGHT,              8  }, 
     86    { MODE_LANDSCAPE,          7  }, 
     87    { MODE_VIDEO_STD,          18 }, 
     88    { MODE_STITCH,             5  }, 
     89    { MODE_MY_COLORS,          4  }, 
     90    { MODE_SCN_WATER,          13 }, 
     91    { MODE_SCN_NIGHT,          15 }, 
     92    { MODE_SCN_CHILD,          16 }, 
     93    { MODE_SCN_PARTY,          14 }, 
     94    { MODE_SCN_GRASS,          10 }, 
     95    { MODE_SCN_SNOW,           11 }, 
     96    { MODE_SCN_BEACH,          12 }, 
     97    { MODE_SCN_FIREWORK,       17 } 
     98}; 
     99 
    78100#include "../generic/shooting.c" 
    79101 
  • trunk/platform/ixus700_sd500/main.c

    r841 r847  
    183183 
    184184 
    185 static struct { 
    186         int hackmode; 
    187         int canonmode; 
    188 } modemap[] = { 
    189     { MODE_DIGITAL_MACRO,       0 }, 
    190     { MODE_P,                   1 }, 
    191     { MODE_NIGHT,               2 }, // 1-15s 
    192     { MODE_AUTO,                3 }, 
    193     { MODE_MY_COLORS,           4 }, 
    194     { MODE_PORTRAIT,            5 }, 
    195     { MODE_SCN_GRASS,           6 }, 
    196     { MODE_SCN_SNOW,            7 }, 
    197     { MODE_SCN_BEACH,           8 }, 
    198     { MODE_SCN_FIREWORK,        9 },  
    199     { MODE_SCN_WATER,          10 }, 
    200     { MODE_SCN_PARTY,          11 }, 
    201     { MODE_SCN_CHILD,          12 }, 
    202     { MODE_SCN_NIGHT,          13 }, 
    203     { MODE_STITCH,             14 }, 
    204     { MODE_VIDEO_STD,          15 } 
    205 }; 
     185#if 0 
     186int rec_switch_state(void) { 
     187//    mode  = (physw_status[0]&0x0F)==0x0B ?  MODE_PLAY : MODE_REC; 
     188        return (physw_status[0]&0x0F)!=0x0B; 
     189} 
     190#endif 
    206191 
    207 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    208  
    209 int mode_get() { 
    210     int mode, i, t=0xFF; 
    211 // play/rec without override 
    212 //    mode  = (physw_status[0]&0x0F)==0x0B ?  MODE_PLAY : MODE_REC; 
    213  
    214 // note: different from later cams 
    215     mode = (playrec_mode==1)?MODE_REC:MODE_PLAY; 
    216  
    217     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    218     for (i=0; i<MODESCNT; ++i) { 
    219         if (modemap[i].canonmode == t) { 
    220             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    221         } 
    222     } 
    223     return (mode); 
     192int rec_mode_active(void) { 
     193    return (playrec_mode==1); 
    224194} 
  • trunk/platform/ixus700_sd500/shooting.c

    r515 r847  
    8181};           
    8282 
     83static const CapturemodeMap modemap[] = { 
     84    { MODE_DIGITAL_MACRO,       0 }, 
     85    { MODE_P,                   1 }, 
     86    { MODE_NIGHT,               2 }, // 1-15s 
     87    { MODE_AUTO,                3 }, 
     88    { MODE_MY_COLORS,           4 }, 
     89    { MODE_PORTRAIT,            5 }, 
     90    { MODE_SCN_GRASS,           6 }, 
     91    { MODE_SCN_SNOW,            7 }, 
     92    { MODE_SCN_BEACH,           8 }, 
     93    { MODE_SCN_FIREWORK,        9 },  
     94    { MODE_SCN_WATER,          10 }, 
     95    { MODE_SCN_PARTY,          11 }, 
     96    { MODE_SCN_CHILD,          12 }, 
     97    { MODE_SCN_NIGHT,          13 }, 
     98    { MODE_STITCH,             14 }, 
     99    { MODE_VIDEO_STD,          15 } 
     100}; 
     101 
    83102#include "../generic/shooting.c" 
    84103 
  • trunk/platform/ixus70_sd1000/main.c

    r835 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               32768 }, // PROPCACE 49 
    40 //    { MODE_M,                  32772 }, 
    41     { MODE_P,                  32772 }, 
    42     { MODE_DIGITAL_MACRO,      33288 }, 
    43     { MODE_PORTRAIT,           32781 }, 
    44     { MODE_NIGHT_SNAPSHOT,     32779 }, 
    45     { MODE_COLOR_ACCENT,       33306 }, //  { MODE_SCN_COLOR_ACCENT,   33306 }, 
    46     { MODE_MY_COLORS,          33307 }, 
    47     { MODE_SCN_KIDS_PETS,      16400 }, //  { MODE_SCN_CHILD,          16400 }, 
    48     { MODE_SCN_INDOOR,         16401 }, //  { MODE_SCN_PARTY,          16401 }, 
    49     { MODE_SCN_FOLIAGE,        16402 }, //  { MODE_SCN_GRASS,          16402 }, 
    50     { MODE_SCN_SNOW,           16403 }, 
    51     { MODE_SCN_BEACH,          16404 }, 
    52     { MODE_SCN_FIREWORK,       16405 }, 
    53     { MODE_SCN_AQUARIUM,       16407 }, 
    54     { MODE_SCN_WATER,          16406 }, 
    55     { MODE_VIDEO_STD,          2597  }, 
    56     { MODE_VIDEO_SPEED,        2598  }, 
    57     { MODE_VIDEO_COMPACT,      2599  }, 
    58     { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
    59     { MODE_VIDEO_MY_COLORS,    2596  }, 
    60     { MODE_VIDEO_TIME_LAPSE,   2601  }, 
    61     { MODE_STITCH,             33290 }, 
    62 }; 
    63 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    64  
    65 int mode_get() { 
    66     int mode, i, t=0xFF; 
    67  
    68 // play/rec without override 
     35#if 0 
     36int rec_switch_state(void) { 
    6937//    mode  = (physw_status[2] & 0x4000)?MODE_REC:MODE_PLAY;     
    70  
    71     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    72  
    73     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    74     for (i=0; i<MODESCNT; ++i) { 
    75         if (modemap[i].canonmode == t) { 
    76             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    77         } 
    78     } 
    79     return (mode); 
     38        return (physw_status[2] & 0x4000);     
    8039} 
     40#endif 
  • trunk/platform/ixus70_sd1000/shooting.c

    r515 r847  
    8181};           
    8282 
     83static const CapturemodeMap modemap[] = { 
     84    { MODE_AUTO,               32768 }, // PROPCACE 49 
     85//    { MODE_M,                  32772 }, 
     86    { MODE_P,                  32772 }, 
     87    { MODE_DIGITAL_MACRO,      33288 }, 
     88    { MODE_PORTRAIT,           32781 }, 
     89    { MODE_NIGHT_SNAPSHOT,     32779 }, 
     90    { MODE_COLOR_ACCENT,       33306 }, //  { MODE_SCN_COLOR_ACCENT,   33306 }, 
     91    { MODE_MY_COLORS,          33307 }, 
     92    { MODE_SCN_KIDS_PETS,      16400 }, //  { MODE_SCN_CHILD,          16400 }, 
     93    { MODE_SCN_INDOOR,         16401 }, //  { MODE_SCN_PARTY,          16401 }, 
     94    { MODE_SCN_FOLIAGE,        16402 }, //  { MODE_SCN_GRASS,          16402 }, 
     95    { MODE_SCN_SNOW,           16403 }, 
     96    { MODE_SCN_BEACH,          16404 }, 
     97    { MODE_SCN_FIREWORK,       16405 }, 
     98    { MODE_SCN_AQUARIUM,       16407 }, 
     99    { MODE_SCN_WATER,          16406 }, 
     100    { MODE_VIDEO_STD,          2597  }, 
     101    { MODE_VIDEO_SPEED,        2598  }, 
     102    { MODE_VIDEO_COMPACT,      2599  }, 
     103    { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
     104    { MODE_VIDEO_MY_COLORS,    2596  }, 
     105    { MODE_VIDEO_TIME_LAPSE,   2601  }, 
     106    { MODE_STITCH,             33290 }, 
     107}; 
     108 
    83109#include "../generic/shooting.c" 
    84110 
  • trunk/platform/ixus750_sd550/main.c

    r835 r847  
    3434} 
    3535 
    36 static struct { 
    37         int hackmode; 
    38         int canonmode; 
    39 } modemap[] = { 
    40     { MODE_DIGITAL_MACRO,       2 }, 
    41     { MODE_MY_COLORS,           3 }, 
    42     { MODE_STITCH,              4 }, 
    43     { MODE_AUTO,                5 }, 
    44     { MODE_SCN_PORTRAIT,        6 }, 
    45     { MODE_SCN_FOLIAGE,         7 }, 
    46     { MODE_SCN_SNOW,            8 }, 
    47     { MODE_SCN_BEACH,           9 }, 
    48     { MODE_SCN_WATER,          10 }, 
    49     { MODE_SCN_INDOOR,         11 }, 
    50     { MODE_SCN_NIGHT,          12 }, 
    51     { MODE_SCN_CHILD,          13 }, 
    52     { MODE_SCN_FIREWORK,       14 },  
    53     { MODE_VIDEO_STD,          15 } 
    54 }; 
    55  
    56 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    57  
    58 int mode_get() { 
    59     int mode, i, t=0xFF; 
    60  
    61 // play/rec without override 
     36#if 0 
     37int rec_switch_state(void) { 
    6238//    mode  = (physw_status[1]&0x0F)==0x0B ?  MODE_PLAY : MODE_REC; 
    63  
    64     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    65  
    66     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    67     for (i=0; i<MODESCNT; ++i) { 
    68         if (modemap[i].canonmode == t) { 
    69             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    70         } 
    71     } 
    72     return (mode); 
     39        return (physw_status[1]&0x0F)!=0x0B; 
    7340} 
     41#endif 
  • trunk/platform/ixus750_sd550/shooting.c

    r515 r847  
    8181};           
    8282 
     83static const CapturemodeMap modemap[] = { 
     84    { MODE_DIGITAL_MACRO,       2 }, 
     85    { MODE_MY_COLORS,           3 }, 
     86    { MODE_STITCH,              4 }, 
     87    { MODE_AUTO,                5 }, 
     88    { MODE_SCN_PORTRAIT,        6 }, 
     89    { MODE_SCN_FOLIAGE,         7 }, 
     90    { MODE_SCN_SNOW,            8 }, 
     91    { MODE_SCN_BEACH,           9 }, 
     92    { MODE_SCN_WATER,          10 }, 
     93    { MODE_SCN_INDOOR,         11 }, 
     94    { MODE_SCN_NIGHT,          12 }, 
     95    { MODE_SCN_CHILD,          13 }, 
     96    { MODE_SCN_FIREWORK,       14 },  
     97    { MODE_VIDEO_STD,          15 } 
     98}; 
     99 
    83100#include "../generic/shooting.c" 
    84101 
  • trunk/platform/ixus75_sd750/main.c

    r831 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               32768 }, // PROPCACE 49 
    40 //    { MODE_M,                  32772 }, camera really on has P 
    41     { MODE_P,                  32772 }, 
    42     { MODE_DIGITAL_MACRO,      33288 }, 
    43     { MODE_PORTRAIT,           32781 }, 
    44     { MODE_NIGHT_SNAPSHOT,     32779 }, 
    45     { MODE_COLOR_ACCENT,       33306 }, //  { MODE_SCN_COLOR_ACCENT,   33306 }, 
    46     { MODE_MY_COLORS,          33307 }, 
    47     { MODE_SCN_KIDS_PETS,      16400 }, //  { MODE_SCN_CHILD,          16400 }, 
    48     { MODE_SCN_INDOOR,         16401 }, //  { MODE_SCN_PARTY,          16401 }, 
    49     { MODE_SCN_FOLIAGE,        16402 }, //  { MODE_SCN_GRASS,          16402 }, 
    50     { MODE_SCN_SNOW,           16403 }, 
    51     { MODE_SCN_BEACH,          16404 }, 
    52     { MODE_SCN_FIREWORK,       16405 }, 
    53     { MODE_SCN_AQUARIUM,       16407 }, 
    54     { MODE_SCN_WATER,          16406 }, 
    55     { MODE_SCN_PORTRAIT,       16397 }, 
    56     { MODE_SCN_NIGHT,          16395 }, // "night snapshot" 
    57     { MODE_VIDEO_STD,          2597  }, 
    58     { MODE_VIDEO_SPEED,        2598  }, 
    59     { MODE_VIDEO_COMPACT,      2599  }, 
    60     { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
    61     { MODE_VIDEO_MY_COLORS,    2596  }, 
    62     { MODE_VIDEO_TIME_LAPSE,   2601  }, 
    63     { MODE_STITCH,             33290 }, 
    64 }; 
    65 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    66  
    67 int mode_get() { 
    68     int mode, i, t=0xFF; 
    69  
    70     mode  = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
     35#if 0 
     36int rec_switch_state(void) { 
    7137//    mode  = (physw_status[2] & 0x4000)?MODE_REC:MODE_PLAY;     
    72     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    73     for (i=0; i<MODESCNT; ++i) { 
    74         if (modemap[i].canonmode == t) { 
    75             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    76         } 
    77     } 
    78     return (mode); 
     38        return (physw_status[2] & 0x4000);     
    7939} 
     40#endif 
  • trunk/platform/ixus75_sd750/shooting.c

    r560 r847  
    8080};           
    8181 
     82static const CapturemodeMap modemap[] = { 
     83    { MODE_AUTO,               32768 }, // PROPCACE 49 
     84//    { MODE_M,                  32772 }, camera really on has P 
     85    { MODE_P,                  32772 }, 
     86    { MODE_DIGITAL_MACRO,      33288 }, 
     87    { MODE_PORTRAIT,           32781 }, 
     88    { MODE_NIGHT_SNAPSHOT,     32779 }, 
     89    { MODE_COLOR_ACCENT,       33306 }, //  { MODE_SCN_COLOR_ACCENT,   33306 }, 
     90    { MODE_MY_COLORS,          33307 }, 
     91    { MODE_SCN_KIDS_PETS,      16400 }, //  { MODE_SCN_CHILD,          16400 }, 
     92    { MODE_SCN_INDOOR,         16401 }, //  { MODE_SCN_PARTY,          16401 }, 
     93    { MODE_SCN_FOLIAGE,        16402 }, //  { MODE_SCN_GRASS,          16402 }, 
     94    { MODE_SCN_SNOW,           16403 }, 
     95    { MODE_SCN_BEACH,          16404 }, 
     96    { MODE_SCN_FIREWORK,       16405 }, 
     97    { MODE_SCN_AQUARIUM,       16407 }, 
     98    { MODE_SCN_WATER,          16406 }, 
     99    { MODE_SCN_PORTRAIT,       16397 }, 
     100    { MODE_SCN_NIGHT,          16395 }, // "night snapshot" 
     101    { MODE_VIDEO_STD,          2597  }, 
     102    { MODE_VIDEO_SPEED,        2598  }, 
     103    { MODE_VIDEO_COMPACT,      2599  }, 
     104    { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
     105    { MODE_VIDEO_MY_COLORS,    2596  }, 
     106    { MODE_VIDEO_TIME_LAPSE,   2601  }, 
     107    { MODE_STITCH,             33290 }, 
     108}; 
     109 
    82110#include "../generic/shooting.c" 
    83111 
  • trunk/platform/ixus800_sd700/main.c

    r835 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               32768 }, 
    40     { MODE_P,                  32772 }, 
    41     { MODE_DIGITAL_MACRO,      33288 },  
    42     { MODE_VIDEO_STD,          2593  }, 
    43     { MODE_STITCH,             33290 }, 
    44     { MODE_MY_COLORS,          16921 }, 
    45     { MODE_SCN_WATER,          16405 }, 
    46     { MODE_SCN_NIGHT,          16395 }, 
    47     { MODE_PORTRAIT,           16397 }, 
    48     { MODE_SCN_CHILD,          16399 }, 
    49     { MODE_SCN_PARTY,          16400 }, 
    50     { MODE_LANDSCAPE,          16401 }, 
    51     { MODE_SCN_SNOW,           16402 }, 
    52     { MODE_SCN_BEACH,          16403 }, 
    53     { MODE_SCN_FIREWORK,       16404 }, 
    54     { MODE_SCN_COLOR_ACCENT,   16920 } 
    55 }; 
    56 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    57  
    58 int mode_get() { 
    59     int mode, i, t=0xFF; 
    60  
    61 // play/rec without override 
     35#if 0 
     36int rec_switch_state(void) { 
    6237//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY;     
    63  
    64     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    65  
    66     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    67     for (i=0; i<MODESCNT; ++i) { 
    68         if (modemap[i].canonmode == t) { 
    69             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    70         } 
    71     } 
    72     return (mode); 
     38        return (physw_status[2] & 0x00002000);     
    7339} 
     40#endif 
  • trunk/platform/ixus800_sd700/shooting.c

    r515 r847  
    8484};           
    8585 
     86static const CapturemodeMap modemap[] = { 
     87   { MODE_AUTO,               32768 }, 
     88    { MODE_P,                  32772 }, 
     89    { MODE_DIGITAL_MACRO,      33288 },  
     90    { MODE_VIDEO_STD,          2593  }, 
     91    { MODE_STITCH,             33290 }, 
     92    { MODE_MY_COLORS,          16921 }, 
     93    { MODE_SCN_WATER,          16405 }, 
     94    { MODE_SCN_NIGHT,          16395 }, 
     95    { MODE_PORTRAIT,           16397 }, 
     96    { MODE_SCN_CHILD,          16399 }, 
     97    { MODE_SCN_PARTY,          16400 }, 
     98    { MODE_LANDSCAPE,          16401 }, 
     99    { MODE_SCN_SNOW,           16402 }, 
     100    { MODE_SCN_BEACH,          16403 }, 
     101    { MODE_SCN_FIREWORK,       16404 }, 
     102    { MODE_SCN_COLOR_ACCENT,   16920 } 
     103}; 
     104 
    86105#include "../generic/shooting.c" 
    87106 
  • trunk/platform/ixus80_sd1100/main.c

    r835 r847  
    2929} 
    3030 
    31 static struct { 
    32         int hackmode; 
    33         int canonmode; 
    34 } modemap[] = { 
    35     { MODE_AUTO,               32768 }, // PROPCACE 49 
    36     { MODE_P,                  32772 }, 
    37     { MODE_DIGITAL_MACRO,      33288 }, 
    38     { MODE_PORTRAIT,           16397 }, 
    39     { MODE_NIGHT_SNAPSHOT,     16395 }, 
    40     { MODE_COLOR_ACCENT,       33306 }, //  { MODE_SCN_COLOR_ACCENT,   33306 }, 
    41     { MODE_MY_COLORS,          33307 }, 
    42     { MODE_SCN_KIDS_PETS,      16400 }, //  { MODE_SCN_CHILD,          16400 }, 
    43     { MODE_SCN_INDOOR,         16401 }, //  { MODE_SCN_PARTY,          16401 }, 
    44     { MODE_SCN_FOLIAGE,        16402 }, //  { MODE_SCN_GRASS,          16402 }, 
    45     { MODE_SCN_SNOW,           16403 }, 
    46     { MODE_SCN_BEACH,          16404 }, 
    47     { MODE_SCN_FIREWORK,       16405 }, 
    48     { MODE_SCN_AQUARIUM,       16407 }, 
    49     { MODE_SCN_WATER,          16406 }, 
    50     { MODE_VIDEO_STD,          2597  }, 
    51 //    { MODE_VIDEO_SPEED,        2598  }, 
    52     { MODE_VIDEO_COMPACT,      2599  }, 
    53     { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
    54     { MODE_VIDEO_MY_COLORS,    2596  }, 
    55     { MODE_VIDEO_TIME_LAPSE,   2601  }, 
    56     { MODE_STITCH,             33290 }, 
    57 }; 
    58  
    59  
    60 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    6131 
    6232static const int fl_tbl[] = {6200, 7230, 8295, 9681, 11614, 14303, 18600}; 
     
    9666 
    9767*/ 
    98 int mode_get() { 
    99     int mode, i, t=0xFF; 
    100  
    101 // play/rec without override 
     68#if 0 
     69int rec_switch_state(void) { 
    10270//    mode  = (physw_status[1] & 0x10000000)?MODE_PLAY:MODE_REC; 
    103  
    104     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    105  
    106     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    107     for (i=0; i<MODESCNT; ++i) { 
    108         if (modemap[i].canonmode == t) { 
    109             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    110         } 
    111     } 
    112     return (mode); 
     71        return !(physw_status[1] & 0x10000000); 
    11372} 
     73#endif 
    11474 
    11575long get_vbatt_min() 
  • trunk/platform/ixus80_sd1100/shooting.c

    r569 r847  
    8686}; 
    8787 
     88static const CapturemodeMap modemap[] = { 
     89    { MODE_AUTO,               32768 }, // PROPCACE 49 
     90    { MODE_P,                  32772 }, 
     91    { MODE_DIGITAL_MACRO,      33288 }, 
     92    { MODE_PORTRAIT,           16397 }, 
     93    { MODE_NIGHT_SNAPSHOT,     16395 }, 
     94    { MODE_COLOR_ACCENT,       33306 }, //  { MODE_SCN_COLOR_ACCENT,   33306 }, 
     95    { MODE_MY_COLORS,          33307 }, 
     96    { MODE_SCN_KIDS_PETS,      16400 }, //  { MODE_SCN_CHILD,          16400 }, 
     97    { MODE_SCN_INDOOR,         16401 }, //  { MODE_SCN_PARTY,          16401 }, 
     98    { MODE_SCN_FOLIAGE,        16402 }, //  { MODE_SCN_GRASS,          16402 }, 
     99    { MODE_SCN_SNOW,           16403 }, 
     100    { MODE_SCN_BEACH,          16404 }, 
     101    { MODE_SCN_FIREWORK,       16405 }, 
     102    { MODE_SCN_AQUARIUM,       16407 }, 
     103    { MODE_SCN_WATER,          16406 }, 
     104    { MODE_VIDEO_STD,          2597  }, 
     105//    { MODE_VIDEO_SPEED,        2598  }, 
     106    { MODE_VIDEO_COMPACT,      2599  }, 
     107    { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
     108    { MODE_VIDEO_MY_COLORS,    2596  }, 
     109    { MODE_VIDEO_TIME_LAPSE,   2601  }, 
     110    { MODE_STITCH,             33290 }, 
     111}; 
     112 
    88113#include "../generic/shooting.c" 
    89114 
  • trunk/platform/ixus850_sd800/main.c

    r835 r847  
    3333} 
    3434 
    35 static struct { 
    36         int hackmode; 
    37         int canonmode; 
    38 } modemap[] = { 
    39     { MODE_AUTO,               32768 }, // PROPCACE 49 
    40 //    { MODE_M,                  32772 }, 
    41     { MODE_P,                  32772 }, 
    42     { MODE_DIGITAL_MACRO,      33288 }, 
    43     { MODE_PORTRAIT,           32781 }, 
    44     { MODE_NIGHT_SNAPSHOT,     32779 }, 
    45     { MODE_COLOR_ACCENT,       33306 }, //  { MODE_SCN_COLOR_ACCENT,   33306 }, 
    46     { MODE_MY_COLORS,          33307 }, 
    47     { MODE_SCN_KIDS_PETS,      16400 }, //  { MODE_SCN_CHILD,          16400 }, 
    48     { MODE_SCN_INDOOR,         16401 }, //  { MODE_SCN_PARTY,          16401 }, 
    49     { MODE_SCN_FOLIAGE,        16402 }, //  { MODE_SCN_GRASS,          16402 }, 
    50     { MODE_SCN_SNOW,           16403 }, 
    51     { MODE_SCN_BEACH,          16404 }, 
    52     { MODE_SCN_FIREWORK,       16405 }, 
    53     { MODE_SCN_AQUARIUM,       16407 }, 
    54     { MODE_SCN_WATER,          16406 }, 
    55     { MODE_VIDEO_STD,          2597  }, 
    56     { MODE_VIDEO_SPEED,        2598  }, 
    57     { MODE_VIDEO_COMPACT,      2599  }, 
    58     { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
    59     { MODE_VIDEO_MY_COLORS,    2596  }, 
    60     { MODE_VIDEO_TIME_LAPSE,   2601  }, 
    61     { MODE_STITCH,             33290 }, 
    62 }; 
    63 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    64  
    65 int mode_get() { 
    66     int mode, i, t=0xFF; 
    67  
    68 // play/rec without override 
     35#if 0 
     36int rec_switch_state(void) { 
    6937//    mode  = (physw_status[2] & 0x4000)?MODE_REC:MODE_PLAY;     
    70  
    71     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    72  
    73     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    74     for (i=0; i<MODESCNT; ++i) { 
    75         if (modemap[i].canonmode == t) { 
    76             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    77         } 
    78     } 
    79     return (mode); 
     38        return (physw_status[2] & 0x4000);     
    8039} 
     40#endif 
  • trunk/platform/ixus850_sd800/shooting.c

    r662 r847  
    8080};           
    8181 
     82static const CapturemodeMap modemap[] = { 
     83    { MODE_AUTO,               32768 }, // PROPCACE 49 
     84//    { MODE_M,                  32772 }, 
     85    { MODE_P,                  32772 }, 
     86    { MODE_DIGITAL_MACRO,      33288 }, 
     87    { MODE_PORTRAIT,           32781 }, 
     88    { MODE_NIGHT_SNAPSHOT,     32779 }, 
     89    { MODE_COLOR_ACCENT,       33306 }, //  { MODE_SCN_COLOR_ACCENT,   33306 }, 
     90    { MODE_MY_COLORS,          33307 }, 
     91    { MODE_SCN_KIDS_PETS,      16400 }, //  { MODE_SCN_CHILD,          16400 }, 
     92    { MODE_SCN_INDOOR,         16401 }, //  { MODE_SCN_PARTY,          16401 }, 
     93    { MODE_SCN_FOLIAGE,        16402 }, //  { MODE_SCN_GRASS,          16402 }, 
     94    { MODE_SCN_SNOW,           16403 }, 
     95    { MODE_SCN_BEACH,          16404 }, 
     96    { MODE_SCN_FIREWORK,       16405 }, 
     97    { MODE_SCN_AQUARIUM,       16407 }, 
     98    { MODE_SCN_WATER,          16406 }, 
     99    { MODE_VIDEO_STD,          2597  }, 
     100    { MODE_VIDEO_SPEED,        2598  }, 
     101    { MODE_VIDEO_COMPACT,      2599  }, 
     102    { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
     103    { MODE_VIDEO_MY_COLORS,    2596  }, 
     104    { MODE_VIDEO_TIME_LAPSE,   2601  }, 
     105    { MODE_STITCH,             33290 }, 
     106}; 
     107 
    82108#include "../generic/shooting.c" 
    83109 
  • trunk/platform/ixus860_sd870/main.c

    r835 r847  
    2929} 
    3030 
    31 static struct { 
    32         int hackmode; 
    33         int canonmode; 
    34 } modemap[] = { 
    35     { MODE_AUTO,               32768 }, // PROPCACE 49 
    36     { MODE_P,                  32772 }, 
    37     { MODE_DIGITAL_MACRO,      33288 }, 
    38     { MODE_PORTRAIT,           16397 }, 
    39     { MODE_NIGHT_SNAPSHOT,     16395 }, 
    40     { MODE_COLOR_ACCENT,       33306 }, //  { MODE_SCN_COLOR_ACCENT,   33306 }, 
    41     { MODE_MY_COLORS,          33307 }, 
    42     { MODE_SCN_KIDS_PETS,      16400 }, //  { MODE_SCN_CHILD,          16400 }, 
    43     { MODE_SCN_INDOOR,         16401 }, //  { MODE_SCN_PARTY,          16401 }, 
    44     { MODE_SCN_FOLIAGE,        16402 }, //  { MODE_SCN_GRASS,          16402 }, 
    45     { MODE_SCN_SNOW,           16403 }, 
    46     { MODE_SCN_BEACH,          16404 }, 
    47     { MODE_SCN_FIREWORK,       16405 }, 
    48     { MODE_SCN_AQUARIUM,       16407 }, 
    49     { MODE_SCN_WATER,          16406 }, 
    50     { MODE_VIDEO_STD,          2597  }, 
    51 //    { MODE_VIDEO_SPEED,        2598  }, 
    52     { MODE_VIDEO_COMPACT,      2599  }, 
    53     { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
    54     { MODE_VIDEO_MY_COLORS,    2596  }, 
    55     { MODE_VIDEO_TIME_LAPSE,   2601  }, 
    56     { MODE_STITCH,             33290 }, 
    57 };  
    58  
    59  
    60 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    61  
    6231 
    6332static const int fl_tbl[] = {4600, 6140, 7560, 9110, 10830, 12670, 14690, 17300}; 
     
    8352} 
    8453 
    85  
    86 int mode_get() { 
    87     int mode, i, t=0xFF; 
    88  
    89 // play/rec without override 
     54#if 0 
     55int rec_switch_state(void) { 
    9056//    mode  = (physw_status[1] & 0x08000000)?MODE_PLAY:MODE_REC; 
    91  
    92     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    93      
    94     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    95     for (i=0; i<MODESCNT; ++i) { 
    96         if (modemap[i].canonmode == t) { 
    97             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    98         } 
    99     } 
    100     return (mode); 
     57        return !(physw_status[1] & 0x08000000); 
    10158} 
     59#endif 
    10260 
    10361long get_vbatt_min() 
  • trunk/platform/ixus860_sd870/shooting.c

    r515 r847  
    8080};           
    8181 
     82static const CapturemodeMap modemap[] = { 
     83    { MODE_AUTO,               32768 }, // PROPCACE 49 
     84    { MODE_P,                  32772 }, 
     85    { MODE_DIGITAL_MACRO,      33288 }, 
     86    { MODE_PORTRAIT,           16397 }, 
     87    { MODE_NIGHT_SNAPSHOT,     16395 }, 
     88    { MODE_COLOR_ACCENT,       33306 }, //  { MODE_SCN_COLOR_ACCENT,   33306 }, 
     89    { MODE_MY_COLORS,          33307 }, 
     90    { MODE_SCN_KIDS_PETS,      16400 }, //  { MODE_SCN_CHILD,          16400 }, 
     91    { MODE_SCN_INDOOR,         16401 }, //  { MODE_SCN_PARTY,          16401 }, 
     92    { MODE_SCN_FOLIAGE,        16402 }, //  { MODE_SCN_GRASS,          16402 }, 
     93    { MODE_SCN_SNOW,           16403 }, 
     94    { MODE_SCN_BEACH,          16404 }, 
     95    { MODE_SCN_FIREWORK,       16405 }, 
     96    { MODE_SCN_AQUARIUM,       16407 }, 
     97    { MODE_SCN_WATER,          16406 }, 
     98    { MODE_VIDEO_STD,          2597  }, 
     99//    { MODE_VIDEO_SPEED,        2598  }, 
     100    { MODE_VIDEO_COMPACT,      2599  }, 
     101    { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
     102    { MODE_VIDEO_MY_COLORS,    2596  }, 
     103    { MODE_VIDEO_TIME_LAPSE,   2601  }, 
     104    { MODE_STITCH,             33290 }, 
     105}; 
     106 
    82107#include "../generic/shooting.c" 
    83108 
  • trunk/platform/ixus870_sd880/main.c

    r831 r847  
    2929} 
    3030 
    31  
    32 static struct { 
    33         int hackmode; 
    34         int canonmode; 
    35 } modemap[] = { 
    36         { MODE_VIDEO_STD,          2600   }, 
    37         { MODE_VIDEO_COLOR_ACCENT, 2598   }, 
    38         { MODE_VIDEO_COLOR_SWAP,   2599   }, 
    39  
    40         { MODE_SCN_PORTRAIT,       16397  }, 
    41         { MODE_SCN_NIGHT,          16395  }, 
    42         { MODE_SCN_KIDS_PETS,      16400  }, 
    43         { MODE_SCN_INDOOR,         16401  }, 
    44         { MODE_SCN_SUNSET,         16402  }, 
    45         { MODE_SCN_FOLIAGE,        16403  }, 
    46         { MODE_SCN_SNOW,           16404  }, 
    47         { MODE_SCN_BEACH,          16405  }, 
    48         { MODE_SCN_FIREWORK,       16406  }, 
    49         { MODE_SCN_AQUARIUM,       16408  }, 
    50         { MODE_SCN_UNDERWATER,     16407  }, 
    51         { MODE_SCN_ISO_3200,       16413  }, 
    52         { MODE_SCN_DIGITAL_MACRO,  33288  }, 
    53         { MODE_SCN_COLOR_ACCENT,   16923  }, 
    54         { MODE_SCN_COLOR_SWAP,     16924  }, 
    55         { MODE_SCN_STITCH,         16906  }, 
    56  
    57         { MODE_AUTO,               32768  }, 
    58         { MODE_P,                  32772  } 
    59 }; 
    60 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    61  
    62 int mode_get() { 
    63         int mode, i, t=0xFF; 
    64          
    65         mode  = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    66          
    67         _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    68         for (i=0; i<MODESCNT; ++i) { 
    69                 if (modemap[i].canonmode == t) { 
    70                         return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    71                 } 
    72         } 
    73         return (mode); 
    74 } 
    7531 
    7632static const int fl_tbl[] = {5000, 5984, 6935, 8118, 9368, 10797, 12524, 14843, 17174, 19998}; 
  • trunk/platform/ixus870_sd880/shooting.c

    r754 r847  
    110110};           
    111111 
     112static const CapturemodeMap modemap[] = { 
     113        { MODE_VIDEO_STD,          2600   }, 
     114        { MODE_VIDEO_COLOR_ACCENT, 2598   }, 
     115        { MODE_VIDEO_COLOR_SWAP,   2599   }, 
     116        { MODE_SCN_PORTRAIT,       16397  }, 
     117        { MODE_SCN_NIGHT,          16395  }, 
     118    { MODE_SCN_KIDS_PETS,      16400  }, 
     119        { MODE_SCN_INDOOR,         16401  }, 
     120        { MODE_SCN_SUNSET,         16402  }, 
     121        { MODE_SCN_FOLIAGE,        16403  }, 
     122        { MODE_SCN_SNOW,           16404  }, 
     123        { MODE_SCN_BEACH,          16405  }, 
     124        { MODE_SCN_FIREWORK,       16406  }, 
     125        { MODE_SCN_AQUARIUM,       16408  }, 
     126    { MODE_SCN_UNDERWATER,     16407  }, 
     127        { MODE_SCN_ISO_3200,       16413  }, 
     128    { MODE_SCN_DIGITAL_MACRO,  33288  }, 
     129        { MODE_SCN_COLOR_ACCENT,   16923  }, 
     130    { MODE_SCN_COLOR_SWAP,     16924  }, 
     131        { MODE_SCN_STITCH,         16906  }, 
     132        { MODE_AUTO,               32768  }, 
     133        { MODE_P,                  32772  } 
     134}; 
     135 
    112136#define PARAM_FILE_COUNTER      0x38 
    113137#define PARAM_EXPOSURE_COUNTER  0x02 
  • trunk/platform/ixus950_sd850/main.c

    r835 r847  
    3636} 
    3737 
    38 static struct { 
    39         int hackmode; 
    40         int canonmode; 
    41 } modemap[] = { // PROPCACE 49 
    42     { MODE_AUTO,               32768 }, 
    43 //    { MODE_M,                  32772 }, // real manual mode absent here... 
    44     { MODE_P,                  32772 }, 
    45     { MODE_DIGITAL_MACRO,      33288 }, 
    46     { MODE_PORTRAIT,           16397 }, // in this cam, it is scene->"portrait" 
    47     { MODE_COLOR_ACCENT,       33306 }, 
    48     { MODE_MY_COLORS,          33307 }, // "color swap" 
    49     { MODE_SCN_NIGHT,          16395 }, 
    50     { MODE_SCN_KIDS_PETS,      16400 }, 
    51     { MODE_SCN_INDOOR,         16401 }, 
    52     { MODE_SCN_FOLIAGE,        16402 }, 
    53     { MODE_SCN_SNOW,           16403 }, 
    54     { MODE_SCN_BEACH,          16404 }, 
    55     { MODE_SCN_FIREWORK,       16405 }, 
    56     { MODE_SCN_AQUARIUM,       16407 }, 
    57     { MODE_SCN_WATER,          16406 }, 
    58 // scene "creative effects",  16911 
    59     { MODE_VIDEO_STD,          2597  }, 
    60     { MODE_VIDEO_SPEED,        2598  }, // "fast frame rate" 
    61     { MODE_VIDEO_COMPACT,      2599  }, 
    62     { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
    63     { MODE_VIDEO_MY_COLORS,    2596  }, // "color swap" 
    64     { MODE_VIDEO_TIME_LAPSE,   2601  }, 
    65     { MODE_STITCH,             33290 }, 
    66  
    67 }; 
    68 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    69  
    70 int mode_get() { 
    71     int mode, i, t=0xFF; 
    72  
    73 // play/rec without override 
     38#if 0 
     39int rec_switch_state(void) { 
    7440//    mode  = (physw_status[2] & 0x1000)?MODE_REC:MODE_PLAY;     
    75  
    76     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    77  
    78     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    79     for (i=0; i<MODESCNT; ++i) { 
    80         if (modemap[i].canonmode == t) { 
    81             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    82         } 
    83     } 
    84     return (mode); 
     41        return (physw_status[2] & 0x1000);     
    8542} 
     43#endif 
  • trunk/platform/ixus950_sd850/shooting.c

    r515 r847  
    9191};           
    9292 
     93static const CapturemodeMap modemap[] = { 
     94    { MODE_AUTO,               32768 }, 
     95//    { MODE_M,                  32772 }, // real manual mode absent here... 
     96    { MODE_P,                  32772 }, 
     97    { MODE_DIGITAL_MACRO,      33288 }, 
     98    { MODE_PORTRAIT,           16397 }, // in this cam, it is scene->"portrait" 
     99    { MODE_COLOR_ACCENT,       33306 }, 
     100    { MODE_MY_COLORS,          33307 }, // "color swap" 
     101    { MODE_SCN_NIGHT,          16395 }, 
     102    { MODE_SCN_KIDS_PETS,      16400 }, 
     103    { MODE_SCN_INDOOR,         16401 }, 
     104    { MODE_SCN_FOLIAGE,        16402 }, 
     105    { MODE_SCN_SNOW,           16403 }, 
     106    { MODE_SCN_BEACH,          16404 }, 
     107    { MODE_SCN_FIREWORK,       16405 }, 
     108    { MODE_SCN_AQUARIUM,       16407 }, 
     109    { MODE_SCN_WATER,          16406 }, 
     110// scene "creative effects",  16911 
     111    { MODE_VIDEO_STD,          2597  }, 
     112    { MODE_VIDEO_SPEED,        2598  }, // "fast frame rate" 
     113    { MODE_VIDEO_COMPACT,      2599  }, 
     114    { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
     115    { MODE_VIDEO_MY_COLORS,    2596  }, // "color swap" 
     116    { MODE_VIDEO_TIME_LAPSE,   2601  }, 
     117    { MODE_STITCH,             33290 }, 
     118}; 
     119 
    93120#include "../generic/shooting.c" 
    94121//#include "shooting_my.c" 
  • trunk/platform/ixus960_sd950/main.c

    r835 r847  
    2424boot(); 
    2525} 
    26 static struct { 
    27 int hackmode; 
    28 int canonmode; 
    29 } modemap[] = { 
    30 { MODE_AUTO,               32768 },  
    31 { MODE_P,                  32772 }, 
    32 { MODE_DIGITAL_MACRO,      33288 }, 
    33 { MODE_PORTRAIT,           16397 }, 
    34 { MODE_NIGHT_SNAPSHOT,     16395 }, 
    35 { MODE_COLOR_ACCENT,       33306 },  
    36 { MODE_MY_COLORS,          33307 }, 
    37 { MODE_SCN_KIDS_PETS,      16400 },  
    38 { MODE_SCN_INDOOR,         16401 },  
    39 { MODE_SCN_FOLIAGE,        16402 },  
    40 { MODE_SCN_SNOW,           16403 }, 
    41 { MODE_SCN_BEACH,          16404 }, 
    42 { MODE_SCN_FIREWORK,       16405 }, 
    43 { MODE_SCN_AQUARIUM,       16407 }, 
    44 { MODE_SCN_WATER,          16406 }, 
    45 { MODE_VIDEO_STD,          2597  }, 
    46 { MODE_VIDEO_COMPACT,      2599  }, 
    47 { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
    48 { MODE_VIDEO_MY_COLORS,    2596  }, 
    49 { MODE_VIDEO_TIME_LAPSE,   2601  }, 
    50 { MODE_STITCH,             33290 }, 
    51 };  
    52 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
     26 
     27 
    5328static const int fl_tbl[] = {7700, 9572, 11454, 13683, 16293, 19548, 23495, 28500}; 
    5429#define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 
     
    6843else return fl_tbl[zp]*10/fl_tbl[0]; 
    6944} 
    70 int mode_get() { 
    71         int mode, i, t=0xFF; 
    72 // why two ? 
    73 /* 
    74         mode  = (physw_status[1] & 0x08000000)?MODE_PLAY:MODE_REC; 
    75         mode  = (physw_status[0] & 0x00000040)?MODE_REC:MODE_PLAY; 
    76 */ 
    77     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    78           
    79         _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    80         for (i=0; i<MODESCNT; ++i) { 
    81                 if (modemap[i].canonmode == t) { 
    82                         return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    83                 } 
    84         } 
    85         return (mode); 
     45#if 0 
     46int rec_switch_state(void) { 
     47// both were in the original mode_get() function, status unknown 
     48//      mode  = (physw_status[1] & 0x08000000)?MODE_PLAY:MODE_REC; 
     49//      mode  = (physw_status[0] & 0x00000040)?MODE_REC:MODE_PLAY; 
     50        return (physw_status[0] & 0x00000040); 
    8651} 
     52#endif 
    8753 
    8854long get_vbatt_min() 
  • trunk/platform/ixus960_sd950/shooting.c

    r515 r847  
    7171{  6, 1600, "1600", -1}, 
    7272};           
     73 
     74static const CapturemodeMap modemap[] = { 
     75        { MODE_AUTO,               32768 },  
     76        { MODE_P,                  32772 }, 
     77        { MODE_DIGITAL_MACRO,      33288 }, 
     78        { MODE_PORTRAIT,           16397 }, 
     79        { MODE_NIGHT_SNAPSHOT,     16395 }, 
     80        { MODE_COLOR_ACCENT,       33306 },  
     81        { MODE_MY_COLORS,          33307 }, 
     82        { MODE_SCN_KIDS_PETS,      16400 },  
     83        { MODE_SCN_INDOOR,         16401 },  
     84        { MODE_SCN_FOLIAGE,        16402 },  
     85        { MODE_SCN_SNOW,           16403 }, 
     86        { MODE_SCN_BEACH,          16404 }, 
     87        { MODE_SCN_FIREWORK,       16405 }, 
     88        { MODE_SCN_AQUARIUM,       16407 }, 
     89        { MODE_SCN_WATER,          16406 }, 
     90        { MODE_VIDEO_STD,          2597  }, 
     91        { MODE_VIDEO_COMPACT,      2599  }, 
     92        { MODE_VIDEO_COLOR_ACCENT, 2595  }, 
     93        { MODE_VIDEO_MY_COLORS,    2596  }, 
     94        { MODE_VIDEO_TIME_LAPSE,   2601  }, 
     95        { MODE_STITCH,             33290 }, 
     96}; 
     97 
    7398#include "../generic/shooting.c" 
    7499long get_file_next_counter() { 
  • trunk/platform/ixus970_sd890/main.c

    r835 r847  
    2626} 
    2727 
    28 static struct { 
    29         int hackmode; 
    30         int canonmode; 
    31 } modemap[] = { 
    32         { MODE_AUTO,               32768 }, 
    33         // 
    34 //      { MODE_M,                  32772 }, 
    35         { MODE_P,                  32772 }, 
    36         { MODE_DIGITAL_MACRO,      33288 }, 
    37         { MODE_COLOR_ACCENT,       33307 }, 
    38         { MODE_SCN_COLOR_SWAP,     33308 }, 
    39         { MODE_STITCH,             33290 }, 
    40         // 
    41         { MODE_NIGHT_SNAPSHOT,     16395 }, 
    42         { MODE_SCN_KIDS_PETS,      16400 }, 
    43         { MODE_SCN_INDOOR,         16401 }, 
    44         { MODE_SCN_SUNSET,         16402 }, 
    45         { MODE_SCN_FOLIAGE,        16403 }, 
    46         { MODE_SCN_SNOW,           16404 }, 
    47         { MODE_SCN_BEACH,          16405 }, 
    48         { MODE_SCN_FIREWORK,       16406 }, 
    49         { MODE_SCN_AQUARIUM,       16408 }, 
    50         { MODE_SCN_ISO_3200,       16413 }, 
    51         { MODE_PORTRAIT,           16397 }, 
    52         // 
    53         { MODE_VIDEO_STD,          2599  }, 
    54         { MODE_VIDEO_COMPACT,      2601  }, 
    55         { MODE_VIDEO_COLOR_ACCENT, 2597  }, 
    56         { MODE_VIDEO_COLOR_SWAP,   2598  }, 
    57         { MODE_VIDEO_TIME_LAPSE,   2603  }, 
    58 };  
    59  
    60 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    6128 
    6229static const int fl_tbl[] = {6600, 7800, 9000, 10300, 11900,13500, 15400, 17700, 20400, 23700, 28000, 33000}; 
     
    9360} 
    9461 
    95 int mode_get() 
    96 { 
    97         int mode, i, t=0xFF; 
    98  
     62#if 0 
     63int rec_switch_state(void) { 
    9964// play/rec without override ? This camera has play button, so not clear 
    10065//      mode  = (physw_status[1] & 0x00010000) ? MODE_REC : MODE_PLAY; 
    101  
    102     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    103  
    104         _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    105         for (i=0; i<MODESCNT; ++i) { 
    106                 if (modemap[i].canonmode == t) { 
    107                         return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    108                 } 
    109         } 
    110         return (mode); 
     66        return (physw_status[1] & 0x00010000); 
    11167} 
     68#endif 
    11269 
    11370long get_vbatt_min() 
  • trunk/platform/ixus970_sd890/shooting.c

    r730 r847  
    129129}; 
    130130 
     131static const CapturemodeMap modemap[] = { 
     132 
     133        { MODE_AUTO,               32768 }, 
     134        // 
     135//      { MODE_M,                  32772 }, 
     136        { MODE_P,                  32772 }, 
     137        { MODE_DIGITAL_MACRO,      33288 }, 
     138        { MODE_COLOR_ACCENT,       33307 }, 
     139        { MODE_SCN_COLOR_SWAP,     33308 }, 
     140        { MODE_STITCH,             33290 }, 
     141        // 
     142        { MODE_NIGHT_SNAPSHOT,     16395 }, 
     143        { MODE_SCN_KIDS_PETS,      16400 }, 
     144        { MODE_SCN_INDOOR,         16401 }, 
     145        { MODE_SCN_SUNSET,         16402 }, 
     146        { MODE_SCN_FOLIAGE,        16403 }, 
     147        { MODE_SCN_SNOW,           16404 }, 
     148        { MODE_SCN_BEACH,          16405 }, 
     149        { MODE_SCN_FIREWORK,       16406 }, 
     150        { MODE_SCN_AQUARIUM,       16408 }, 
     151        { MODE_SCN_ISO_3200,       16413 }, 
     152        { MODE_PORTRAIT,           16397 }, 
     153        // 
     154        { MODE_VIDEO_STD,          2599  }, 
     155        { MODE_VIDEO_COMPACT,      2601  }, 
     156        { MODE_VIDEO_COLOR_ACCENT, 2597  }, 
     157        { MODE_VIDEO_COLOR_SWAP,   2598  }, 
     158        { MODE_VIDEO_TIME_LAPSE,   2603  }, 
     159}; 
     160 
    131161#include "../generic/shooting.c" 
    132162 
  • trunk/platform/ixus980_sd990/main.c

    r835 r847  
    2929} 
    3030 
    31 // TODO setting the DP button as a shortcut to movie in canon menu 
    32 // gives a value of (current mode)+1024 while movie is recording, unless 
    33 // already in movie mode 
    34 static struct { 
    35         int hackmode; 
    36         int canonmode; 
    37 } modemap[] = { 
    38     { MODE_AUTO,               32768 },  
    39     { MODE_M,                  32769 }, 
    40     { MODE_P,                  32772 }, 
    41     { MODE_PORTRAIT,           16397 }, 
    42     { MODE_NIGHT_SNAPSHOT,     16395 }, 
    43     { MODE_SCN_KIDS_PETS,      16400 }, 
    44     { MODE_SCN_INDOOR,         16401 }, 
    45     { MODE_SCN_SUNSET,         16402 }, 
    46     { MODE_SCN_FOLIAGE,        16403 }, 
    47     { MODE_SCN_SNOW,           16404 }, 
    48     { MODE_SCN_BEACH,          16405 }, 
    49     { MODE_SCN_FIREWORK,       16406 }, 
    50     { MODE_SCN_UNDERWATER,     16407 }, 
    51     { MODE_SCN_AQUARIUM,       16408 }, 
    52     { MODE_SCN_ISO_3200,       16413 }, 
    53     { MODE_DIGITAL_MACRO,      33288 }, // SCN 
    54     { MODE_SCN_COLOR_ACCENT,   16923 }, 
    55     { MODE_SCN_COLOR_SWAP,     16924 }, 
    56     { MODE_STITCH,             16906 }, // SCN, either direction 
    57     { MODE_QUICK,              33312 }, 
    58  
    59     { MODE_VIDEO_STD,          2600  }, 
    60     { MODE_VIDEO_COLOR_ACCENT, 2598  }, 
    61     { MODE_VIDEO_COLOR_SWAP,   2599  }, 
    62 }; 
    63  
    64  
    65 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    66  
    6731// from sd950, zoom steps and sensor size same 
    6832static const int fl_tbl[] = {7700, 9572, 11454, 13683, 16293, 19548, 23495, 28500}; 
     
    9357} 
    9458 
    95 /* 
    96 physw_ bit OK 
    97 */ 
    98 int mode_get() { 
    99     int mode, i, t=0xFF; 
    100  
    101         mode  = (playrec_mode==2 || playrec_mode == 4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
     59#if 0 
     60int rec_switch_state(void) { 
    10261// camera has play button, not sure what this was checking 
    10362//    mode  = (physw_status[0] & 0x00200000)?MODE_REC:MODE_PLAY; 
    104  
    105     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    106     for (i=0; i<MODESCNT; ++i) { 
    107         if (modemap[i].canonmode == t) { 
    108             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    109         } 
    110     } 
    111     return (mode); 
     63        return (physw_status[0] & 0x00200000); 
    11264} 
     65#endif 
    11366 
    11467long get_vbatt_min() 
  • trunk/platform/ixus980_sd990/shooting.c

    r740 r847  
    9090};           
    9191 
     92// TODO setting the DP button as a shortcut to movie in canon menu 
     93// gives a value of (current mode)+1024 while movie is recording, unless 
     94// already in movie mode 
     95static const CapturemodeMap modemap[] = { 
     96    { MODE_AUTO,               32768 },  
     97    { MODE_M,                  32769 }, 
     98    { MODE_P,                  32772 }, 
     99    { MODE_PORTRAIT,           16397 }, 
     100    { MODE_NIGHT_SNAPSHOT,     16395 }, 
     101    { MODE_SCN_KIDS_PETS,      16400 }, 
     102    { MODE_SCN_INDOOR,         16401 }, 
     103    { MODE_SCN_SUNSET,         16402 }, 
     104    { MODE_SCN_FOLIAGE,        16403 }, 
     105    { MODE_SCN_SNOW,           16404 }, 
     106    { MODE_SCN_BEACH,          16405 }, 
     107    { MODE_SCN_FIREWORK,       16406 }, 
     108    { MODE_SCN_UNDERWATER,     16407 }, 
     109    { MODE_SCN_AQUARIUM,       16408 }, 
     110    { MODE_SCN_ISO_3200,       16413 }, 
     111    { MODE_DIGITAL_MACRO,      33288 }, // SCN 
     112    { MODE_SCN_COLOR_ACCENT,   16923 }, 
     113    { MODE_SCN_COLOR_SWAP,     16924 }, 
     114    { MODE_STITCH,             16906 }, // SCN, either direction 
     115    { MODE_QUICK,              33312 }, 
     116 
     117    { MODE_VIDEO_STD,          2600  }, 
     118    { MODE_VIDEO_COLOR_ACCENT, 2598  }, 
     119    { MODE_VIDEO_COLOR_SWAP,   2599  }, 
     120}; 
     121 
    92122#include "../generic/shooting.c" 
    93123 
  • trunk/platform/ixusizoom_sd30/main.c

    r835 r847  
    3434} 
    3535 
    36 static struct { 
    37         int hackmode; 
    38         int canonmode; 
    39 } modemap[] = { 
    40     { MODE_AUTO,               6  }, 
    41     { MODE_P,                  1  }, 
    42     { MODE_TV,                 3  }, 
    43     { MODE_AV,                 2  }, 
    44     { MODE_M,                  0  }, 
    45     { MODE_PORTRAIT,           9  }, 
    46     { MODE_NIGHT,              8  }, 
    47     { MODE_LANDSCAPE,          7  }, 
    48     { MODE_VIDEO_STD,          18 }, 
    49     { MODE_STITCH,             5  }, 
    50     { MODE_MY_COLORS,          4  }, 
    51     { MODE_SCN_WATER,          13 }, 
    52     { MODE_SCN_NIGHT,          15 }, 
    53     { MODE_SCN_CHILD,          16 }, 
    54     { MODE_SCN_PARTY,          14 }, 
    55     { MODE_SCN_GRASS,          10 }, 
    56     { MODE_SCN_SNOW,           11 }, 
    57     { MODE_SCN_BEACH,          12 }, 
    58     { MODE_SCN_FIREWORK,       17 } 
    59 }; 
    60 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    6136 
    62 /* 
    63    9xxxx - view 
    64    3xxxx - video 
    65    bxxxx - photo 
    66 */ 
    67  
    68  
    69 int mode_get() { 
    70     int mode, i, t=0xFF; 
    71  
    72 // play/rec without override 
     37#if 0 
     38int rec_switch_state(void) { 
    7339//    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY; 
    74  
    75     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    76      
    77     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    78     for (i=0; i<MODESCNT; ++i) { 
    79         if (modemap[i].canonmode == t) { 
    80             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    81         } 
    82     } 
    83     return (mode); 
     40        return (physw_status[2] & 0x00002000); 
    8441} 
     42#endif 
  • trunk/platform/ixusizoom_sd30/shooting.c

    r621 r847  
    7474};           
    7575 
     76static const CapturemodeMap modemap[] = { 
     77    { MODE_AUTO,               6  }, 
     78    { MODE_P,                  1  }, 
     79    { MODE_TV,                 3  }, 
     80    { MODE_AV,                 2  }, 
     81    { MODE_M,                  0  }, 
     82    { MODE_PORTRAIT,           9  }, 
     83    { MODE_NIGHT,              8  }, 
     84    { MODE_LANDSCAPE,          7  }, 
     85    { MODE_VIDEO_STD,          18 }, 
     86    { MODE_STITCH,             5  }, 
     87    { MODE_MY_COLORS,          4  }, 
     88    { MODE_SCN_WATER,          13 }, 
     89    { MODE_SCN_NIGHT,          15 }, 
     90    { MODE_SCN_CHILD,          16 }, 
     91    { MODE_SCN_PARTY,          14 }, 
     92    { MODE_SCN_GRASS,          10 }, 
     93    { MODE_SCN_SNOW,           11 }, 
     94    { MODE_SCN_BEACH,          12 }, 
     95    { MODE_SCN_FIREWORK,       17 } 
     96}; 
     97 
    7698#include "../generic/shooting.c" 
    7799 
  • trunk/platform/s2is/main.c

    r845 r847  
    203203} 
    204204 
    205 static struct { 
    206         int hackmode; 
    207         int canonmode; 
    208 } modemap[] = { 
    209     { MODE_AUTO,                5 }, 
    210     { MODE_P,                   1 }, 
    211     { MODE_TV,                  3 }, 
    212     { MODE_AV,                  2 }, 
    213     { MODE_M,                   0 }, 
    214     { MODE_PORTRAIT,            6 }, 
    215     { MODE_NIGHT,               8 }, 
    216     { MODE_LANDSCAPE,           7 }, 
    217     { MODE_VIDEO_STD,           16 }, 
    218     { MODE_STITCH,              15 }, 
    219     { MODE_MY_COLORS,           4 }, 
    220     { MODE_SCN_NIGHT,           14 }, 
    221     { MODE_SCN_INDOOR,          13 }, 
    222     { MODE_SCN_FOLIAGE,         9 }, 
    223     { MODE_SCN_SNOW,            10 }, 
    224     { MODE_SCN_BEACH,           11 }, 
    225     { MODE_SCN_FIREWORK,        12 },  
    226 }; 
    227 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    228  
    229 int mode_get() { 
    230     int mode, i, t=0xFF; 
    231     mode  = (playrec_mode==1)?MODE_REC:MODE_PLAY; 
    232     mode |= (physw_copy[1] & 0x00000001)?0:MODE_SCREEN_OPENED; 
    233     mode |= (physw_copy[1] & 0x00000002)?0:MODE_SCREEN_ROTATED; 
    234      
    235     t=0xFF; 
    236     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    237     for (i=0; i<MODESCNT; ++i) { 
    238         if (modemap[i].canonmode == t) { 
    239             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    240         } 
    241     } 
    242     return (mode); 
    243 } 
     205 
     206int screen_opened(void) { 
     207//    mode |= (physw_copy[1] & 0x00000001)?0:MODE_SCREEN_OPENED; 
     208        return !(physw_copy[1] & 0x00000001); 
     209} 
     210 
     211int screen_rotated(void) { 
     212//    mode |= (physw_copy[1] & 0x00000002)?0:MODE_SCREEN_ROTATED; 
     213        return !(physw_copy[1] & 0x00000002); 
     214} 
     215 
     216int rec_mode_active(void) { 
     217//    mode  = (playrec_mode==1)?MODE_REC:MODE_PLAY; 
     218        return (playrec_mode==1); 
     219} 
  • trunk/platform/s2is/shooting.c

    r515 r847  
    7575};           
    7676 
     77static const CapturemodeMap modemap[] = { 
     78    { MODE_AUTO,                5 }, 
     79    { MODE_P,                   1 }, 
     80    { MODE_TV,                  3 }, 
     81    { MODE_AV,                  2 }, 
     82    { MODE_M,                   0 }, 
     83    { MODE_PORTRAIT,            6 }, 
     84    { MODE_NIGHT,               8 }, 
     85    { MODE_LANDSCAPE,           7 }, 
     86    { MODE_VIDEO_STD,           16 }, 
     87    { MODE_STITCH,              15 }, 
     88    { MODE_MY_COLORS,           4 }, 
     89    { MODE_SCN_NIGHT,           14 }, 
     90    { MODE_SCN_INDOOR,          13 }, 
     91    { MODE_SCN_FOLIAGE,         9 }, 
     92    { MODE_SCN_SNOW,            10 }, 
     93    { MODE_SCN_BEACH,           11 }, 
     94    { MODE_SCN_FIREWORK,        12 },  
     95}; 
     96 
    7797#include "../generic/shooting.c" 
    7898 
  • trunk/platform/s3is/main.c

    r831 r847  
    5454} 
    5555 
    56 static struct { 
    57         int hackmode; 
    58         int canonmode; 
    59 } modemap[] = { 
    60     { MODE_AUTO,                32768 }, 
    61     { MODE_P,                   32772 }, 
    62     { MODE_TV,                  32771 }, 
    63     { MODE_AV,                  32770 }, 
    64     { MODE_M,                   32769 }, 
    65     { MODE_PORTRAIT,            32781 }, 
    66     { MODE_NIGHT,               32782 }, 
    67     { MODE_LANDSCAPE,           32780 }, 
    68     { MODE_VIDEO_STD,           2590  }, 
    69     { MODE_STITCH,              33290 }, 
    70     { MODE_MY_COLORS,           16921 }, 
    71     { MODE_SCN_NIGHT,           16395 }, 
    72     { MODE_SPORTS,                        32775 }, 
    73     { MODE_SCN_PARTY,           16400 }, 
    74     { MODE_SCN_GRASS,           16401 }, 
    75     { MODE_SCN_SNOW,            16402 }, 
    76     { MODE_SCN_BEACH,           16403 }, 
    77     { MODE_SCN_FIREWORK,        16404 },  
    78     { MODE_SCN_COLOR_ACCENT,    16920 }  
    79 }; 
    80 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    8156 
    82 int mode_get() { 
    83     int mode, i, t=0xFF; 
     57int screen_opened(void) { 
     58//    mode |= (physw_status[1] & 0x00000001)?0:MODE_SCREEN_OPENED; 
     59        return !(physw_status[1] & 0x00000001); 
     60} 
    8461 
    85     mode  = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    86     mode |= (physw_status[1] & 0x00000001)?0:MODE_SCREEN_OPENED; 
    87     mode |= (physw_status[1] & 0x00000002)?0:MODE_SCREEN_ROTATED; 
    88      
    89     t=0xFF; 
    90     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    91     for (i=0; i<MODESCNT; ++i) { 
    92         if (modemap[i].canonmode == t) { 
    93             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    94         } 
    95     } 
    96     return (mode); 
     62int screen_rotated(void) { 
     63//    mode |= (physw_status[1] & 0x00000002)?0:MODE_SCREEN_ROTATED; 
     64        return !(physw_status[1] & 0x00000002); 
    9765} 
  • trunk/platform/s3is/shooting.c

    r515 r847  
    7777};           
    7878 
     79static const CapturemodeMap modemap[] = { 
     80    { MODE_AUTO,                32768 }, 
     81    { MODE_P,                   32772 }, 
     82    { MODE_TV,                  32771 }, 
     83    { MODE_AV,                  32770 }, 
     84    { MODE_M,                   32769 }, 
     85    { MODE_PORTRAIT,            32781 }, 
     86    { MODE_NIGHT,               32782 }, 
     87    { MODE_LANDSCAPE,           32780 }, 
     88    { MODE_VIDEO_STD,           2590  }, 
     89    { MODE_STITCH,              33290 }, 
     90    { MODE_MY_COLORS,           16921 }, 
     91    { MODE_SCN_NIGHT,           16395 }, 
     92    { MODE_SPORTS,                        32775 }, 
     93    { MODE_SCN_PARTY,           16400 }, 
     94    { MODE_SCN_GRASS,           16401 }, 
     95    { MODE_SCN_SNOW,            16402 }, 
     96    { MODE_SCN_BEACH,           16403 }, 
     97    { MODE_SCN_FIREWORK,        16404 },  
     98    { MODE_SCN_COLOR_ACCENT,    16920 }  
     99}; 
     100 
    79101#include "../generic/shooting.c" 
    80102 
  • trunk/platform/s5is/main.c

    r835 r847  
    2929 
    3030 
    31 static struct { 
    32         int hackmode; 
    33         int canonmode; 
    34 } modemap[] = { 
    35         { MODE_AUTO,               32768  }, 
    36         { MODE_P,                  32772  }, 
    37         { MODE_TV,                 32771  }, 
    38         { MODE_AV,                 32770  }, 
    39         { MODE_M,                  32769  }, 
    40         { MODE_PORTRAIT,           32781  }, 
    41         { MODE_NIGHT_SNAPSHOT,     32779  }, // not MODE_NIGHT? I changed it, camera says snapshot 
    42         { MODE_LANDSCAPE,          32780  }, 
    43         { MODE_VIDEO_STD,          2594   }, 
    44 //      { MODE_VIDEO_RECORDING,    3618   }, 
    45         { MODE_STITCH,             33290  }, 
    46         { MODE_MY_COLORS,          16923  }, // Is this SCN mode? (=color override) 
    47         { MODE_SCN_NIGHT,          16398  }, 
    48         { MODE_SCN_INDOOR,         16401  }, 
    49         { MODE_SCN_FOLIAGE,        16402  }, 
    50         { MODE_SCN_SNOW,           16403  }, 
    51         { MODE_SCN_BEACH,          16404  }, 
    52         { MODE_SCN_FIREWORK,       16405  }, 
    53         { MODE_SCN_AQUARIUM,       16407  }, 
    54         { MODE_SCN_COLOR_ACCENT,   16922  } 
    55 }; 
    56 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
     31int screen_opened(void) { 
     32//      mode |= (physw_status[1] & 0x00000100)?0:MODE_SCREEN_OPENED; 
     33        return !(physw_status[1] & 0x00000100); 
     34} 
    5735 
    58 int mode_get() { 
    59         int mode, i, t=0xFF; 
    60          
     36int screen_rotated(void) { 
     37//      mode |= (physw_status[1] & 0x00000200)?0:MODE_SCREEN_ROTATED; 
     38        return !(physw_status[1] & 0x00000200); 
     39} 
     40 
     41#if 0 
     42int rec_switch_state(void) { 
     43// not sure what this was checking 
    6144//      volatile int *physw_mmio = (int *) 0xC0220200; // I don't know where else I can find this... 
    6245//      mode  = (physw_mmio[1] & 0x00010000)?MODE_REC:MODE_PLAY; 
    63  
    64     mode = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    65  
    66         mode |= (physw_status[1] & 0x00000100)?0:MODE_SCREEN_OPENED; 
    67         mode |= (physw_status[1] & 0x00000200)?0:MODE_SCREEN_ROTATED; 
    68          
    69         _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    70         for (i=0; i<MODESCNT; ++i) { 
    71                 if (modemap[i].canonmode == t) { 
    72                         return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    73                 } 
    74         } 
    75         return (mode); 
    7646} 
     47#endif 
    7748 
    7849static const struct { 
  • trunk/platform/s5is/shooting.c

    r515 r847  
    8484};           
    8585 
     86static const CapturemodeMap modemap[] = { 
     87        { MODE_AUTO,               32768  }, 
     88        { MODE_P,                  32772  }, 
     89        { MODE_TV,                 32771  }, 
     90        { MODE_AV,                 32770  }, 
     91        { MODE_M,                  32769  }, 
     92        { MODE_PORTRAIT,           32781  }, 
     93        { MODE_NIGHT_SNAPSHOT,     32779  }, // not MODE_NIGHT? I changed it, camera says snapshot 
     94        { MODE_LANDSCAPE,          32780  }, 
     95        { MODE_VIDEO_STD,          2594   }, 
     96//      { MODE_VIDEO_RECORDING,    3618   }, 
     97        { MODE_STITCH,             33290  }, 
     98        { MODE_MY_COLORS,          16923  }, // Is this SCN mode? (=color override) 
     99        { MODE_SCN_NIGHT,          16398  }, 
     100        { MODE_SCN_INDOOR,         16401  }, 
     101        { MODE_SCN_FOLIAGE,        16402  }, 
     102        { MODE_SCN_SNOW,           16403  }, 
     103        { MODE_SCN_BEACH,          16404  }, 
     104        { MODE_SCN_FIREWORK,       16405  }, 
     105        { MODE_SCN_AQUARIUM,       16407  }, 
     106        { MODE_SCN_COLOR_ACCENT,   16922  } 
     107}; 
     108 
    86109#include "../generic/shooting.c" 
    87110 
  • trunk/platform/sx1/main.c

    r831 r847  
    2828} 
    2929 
     30int screen_opened(void) { 
     31//      mode |= (physw_status[1] & 0x01000000)?0:MODE_SCREEN_OPENED; 
     32        return !(physw_status[1] & 0x01000000); 
     33} 
    3034 
    31 static struct { 
    32         int hackmode; 
    33         int canonmode; 
    34 } modemap[] = { 
    35         { MODE_AUTO,               32768  }, 
    36         { MODE_P,                  32772  }, 
    37         { MODE_TV,                 32771  }, 
    38         { MODE_AV,                 32770  }, 
    39         { MODE_M,                  32769  }, 
    40         { MODE_PORTRAIT,           32781  }, 
    41         { MODE_NIGHT_SNAPSHOT,     32779  },  
    42         { MODE_LANDSCAPE,          32780  }, 
    43         { MODE_VIDEO_STD,          2597   }, // video standby 
    44         { MODE_VIDEO_STD,          3622   }, // video in progress 
    45         { MODE_STITCH,             33290  }, 
    46         { MODE_SPORTS,             33287  }, 
    47  
    48         { MODE_SCN_NIGHT,          16398  }, 
    49         { MODE_SCN_INDOOR,         16401  }, 
    50         { MODE_SCN_SUNSET,         16402  }, 
    51         { MODE_SCN_FOLIAGE,        16403  }, 
    52         { MODE_SCN_SNOW,           16404  }, 
    53         { MODE_SCN_BEACH,          16405  }, 
    54         { MODE_SCN_FIREWORK,       16406  }, 
    55         { MODE_SCN_AQUARIUM,       16408  }, 
    56         { MODE_SCN_ISO_3200,       16413  }, 
    57         { MODE_SCN_COLOR_ACCENT,   16923  }, 
    58         { MODE_SCN_COLOR_SWAP,     16924  } 
    59 }; 
    60 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    61  
    62 int mode_get() { 
    63         int mode, i, t=0xFF; 
    64          
    65         mode  = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    66         mode |= (physw_status[1] & 0x01000000)?0:MODE_SCREEN_OPENED; 
    67         mode |= (physw_status[1] & 0x00080000)?0:MODE_SCREEN_ROTATED; 
    68          
    69         _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    70         for (i=0; i<MODESCNT; ++i) { 
    71                 if (modemap[i].canonmode == t) { 
    72                         return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    73                 } 
    74         } 
    75         return (mode); 
     35int screen_rotated(void) { 
     36//      mode |= (physw_status[1] & 0x00080000)?0:MODE_SCREEN_ROTATED; 
     37        return !(physw_status[1] & 0x00080000); 
    7638} 
    7739 
  • trunk/platform/sx1/shooting.c

    r736 r847  
    8080};           
    8181 
     82static const CapturemodeMap modemap[] = { 
     83        { MODE_AUTO,               32768  }, 
     84        { MODE_P,                  32772  }, 
     85        { MODE_TV,                 32771  }, 
     86        { MODE_AV,                 32770  }, 
     87        { MODE_M,                  32769  }, 
     88        { MODE_PORTRAIT,           32781  }, 
     89        { MODE_NIGHT_SNAPSHOT,     32779  },  
     90        { MODE_LANDSCAPE,          32780  }, 
     91        // TODO are dupes a problem ?  
     92        //Order matters for CHDK->canon mapping, first one should be what we can set 
     93        { MODE_VIDEO_STD,          2597   }, // video standby 
     94        { MODE_VIDEO_STD,          3622   }, // video in progress 
     95        { MODE_STITCH,             33290  }, 
     96        { MODE_SPORTS,             33287  }, 
     97 
     98        { MODE_SCN_NIGHT,          16398  }, 
     99        { MODE_SCN_INDOOR,         16401  }, 
     100        { MODE_SCN_SUNSET,         16402  }, 
     101        { MODE_SCN_FOLIAGE,        16403  }, 
     102        { MODE_SCN_SNOW,           16404  }, 
     103        { MODE_SCN_BEACH,          16405  }, 
     104        { MODE_SCN_FIREWORK,       16406  }, 
     105        { MODE_SCN_AQUARIUM,       16408  }, 
     106        { MODE_SCN_ISO_3200,       16413  }, 
     107        { MODE_SCN_COLOR_ACCENT,   16923  }, 
     108    { MODE_SCN_COLOR_SWAP,     16924  } 
     109}; 
     110 
    82111#include "../generic/shooting.c" 
    83112 
  • trunk/platform/sx10/main.c

    r831 r847  
    2828} 
    2929 
     30int screen_opened(void) { 
     31//      mode |= (physw_status[1] & 0x01000000)?0:MODE_SCREEN_OPENED; 
     32        return !(physw_status[1] & 0x01000000); 
     33} 
    3034 
    31 static struct { 
    32         int hackmode; 
    33         int canonmode; 
    34 } modemap[] = { 
    35         { MODE_AUTO,               32768  }, 
    36         { MODE_P,                  32772  }, 
    37         { MODE_TV,                 32771  }, 
    38         { MODE_AV,                 32770  }, 
    39         { MODE_M,                  32769  }, 
    40         { MODE_PORTRAIT,           32781  }, 
    41         { MODE_NIGHT_SNAPSHOT,     32779  },  
    42         { MODE_LANDSCAPE,          32780  }, 
    43         { MODE_VIDEO_STD,          2597   }, // video standby 
    44         { MODE_VIDEO_STD,          3622   }, // video in progress 
    45         { MODE_STITCH,             33290  }, 
    46         { MODE_SPORTS,             33287  }, 
    47  
    48         { MODE_SCN_NIGHT,          16398  }, 
    49         { MODE_SCN_INDOOR,         16401  }, 
    50         { MODE_SCN_SUNSET,         16402  }, 
    51         { MODE_SCN_FOLIAGE,        16403  }, 
    52         { MODE_SCN_SNOW,           16404  }, 
    53         { MODE_SCN_BEACH,          16405  }, 
    54         { MODE_SCN_FIREWORK,       16406  }, 
    55         { MODE_SCN_AQUARIUM,       16408  }, 
    56         { MODE_SCN_ISO_3200,       16413  }, 
    57         { MODE_SCN_COLOR_ACCENT,   16923  }, 
    58         { MODE_SCN_COLOR_SWAP,     16924  } 
    59 }; 
    60 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    61  
    62 int mode_get() { 
    63         int mode, i, t=0xFF; 
    64          
    65         mode  = (playrec_mode==2 || playrec_mode == 4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    66         mode |= (physw_status[1] & 0x01000000)?0:MODE_SCREEN_OPENED; 
    67         mode |= (physw_status[1] & 0x00080000)?0:MODE_SCREEN_ROTATED; 
    68          
    69         _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    70         for (i=0; i<MODESCNT; ++i) { 
    71                 if (modemap[i].canonmode == t) { 
    72                         return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    73                 } 
    74         } 
    75         return (mode); 
     35int screen_rotated(void) { 
     36//      mode |= (physw_status[1] & 0x00080000)?0:MODE_SCREEN_ROTATED; 
     37        return !(physw_status[1] & 0x00080000); 
    7638} 
    7739 
  • trunk/platform/sx10/shooting.c

    r736 r847  
    8080};           
    8181 
     82static const CapturemodeMap modemap[] = { 
     83        { MODE_AUTO,               32768  }, 
     84        { MODE_P,                  32772  }, 
     85        { MODE_TV,                 32771  }, 
     86        { MODE_AV,                 32770  }, 
     87        { MODE_M,                  32769  }, 
     88        { MODE_PORTRAIT,           32781  }, 
     89        { MODE_NIGHT_SNAPSHOT,     32779  },  
     90        { MODE_LANDSCAPE,          32780  }, 
     91        // TODO dupe, order matters 
     92        { MODE_VIDEO_STD,          2597   }, // video standby 
     93        { MODE_VIDEO_STD,          3622   }, // video in progress 
     94        { MODE_STITCH,             33290  }, 
     95        { MODE_SPORTS,             33287  }, 
     96 
     97        { MODE_SCN_NIGHT,          16398  }, 
     98        { MODE_SCN_INDOOR,         16401  }, 
     99        { MODE_SCN_SUNSET,         16402  }, 
     100        { MODE_SCN_FOLIAGE,        16403  }, 
     101        { MODE_SCN_SNOW,           16404  }, 
     102        { MODE_SCN_BEACH,          16405  }, 
     103        { MODE_SCN_FIREWORK,       16406  }, 
     104        { MODE_SCN_AQUARIUM,       16408  }, 
     105        { MODE_SCN_ISO_3200,       16413  }, 
     106        { MODE_SCN_COLOR_ACCENT,   16923  }, 
     107        { MODE_SCN_COLOR_SWAP,     16924  } 
     108}; 
     109 
    82110#include "../generic/shooting.c" 
    83111 
  • trunk/platform/sx100is/main.c

    r831 r847  
    2929} 
    3030 
    31 static struct { 
    32         int hackmode; 
    33         int canonmode; 
    34 } modemap[] = { 
    35     { MODE_AUTO,               32768 }, 
    36     { MODE_P,                  32772 }, 
    37     { MODE_TV,                 32771 }, 
    38     { MODE_AV,                 32770 }, 
    39     { MODE_M,                  32769 }, 
    40     { MODE_VIDEO_STD,          2597  }, 
    41     { MODE_VIDEO_COMPACT,      2599  }, 
    42     { MODE_STITCH,             33290 }, 
    43     { MODE_SCN_WATER,          16406 },   
    44     { MODE_SCN_AQUARIUM,       16407 },   
    45     { MODE_SCN_NIGHT,          16398 },   
    46     { MODE_SCN_INDOOR,         16401 }, 
    47     { MODE_SCN_GRASS,          16402 },    
    48     { MODE_SCN_SNOW,           16403 },   
    49     { MODE_SCN_BEACH,          16404 },   
    50     { MODE_SCN_FIREWORK,       16405 },   
    51     { MODE_INDOOR,             32785 }, 
    52     { MODE_KIDS_PETS,          32784 },  
    53     { MODE_NIGHT_SNAPSHOT,     32779 }, 
    54     { MODE_LANDSCAPE,          32780 },  
    55     { MODE_PORTRAIT,           32781 }, 
    56 };  
    57  
    58  
    59 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    60  
    6131 
    6232static const int fl_tbl[] = {6000, 6700, 7300, 8200, 9100, 10300, 11500, 12800, 14400, 16100, 18100, 20100, 22400, 25200, 28100, 31500, 34900, 38900, 42500, 46600, 51100, 55900, 60000}; 
     
    8252} 
    8353 
    84  
    85 int mode_get() { 
    86     int mode, i, t=0xFF; 
    87  
    88     mode  = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY;  
    89  
    90      
    91     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    92     for (i=0; i<MODESCNT; ++i) { 
    93         if (modemap[i].canonmode == t) { 
    94             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    95         } 
    96     } 
    97     return (mode); 
    98 } 
    99  
    10054long get_vbatt_min() 
    10155{ 
  • trunk/platform/sx100is/shooting.c

    r515 r847  
    8080};           
    8181 
     82static const CapturemodeMap modemap[] = { 
     83        { MODE_AUTO,               32768 }, 
     84    { MODE_P,                  32772 }, 
     85    { MODE_TV,                 32771 }, 
     86    { MODE_AV,                 32770 }, 
     87    { MODE_M,                  32769 }, 
     88    { MODE_VIDEO_STD,          2597  }, 
     89    { MODE_VIDEO_COMPACT,      2599  }, 
     90    { MODE_STITCH,             33290 }, 
     91    { MODE_SCN_WATER,          16406 }, 
     92    { MODE_SCN_AQUARIUM,       16407 }, 
     93    { MODE_SCN_NIGHT,          16398 }, 
     94    { MODE_SCN_INDOOR,         16401 }, 
     95    { MODE_SCN_GRASS,          16402 }, 
     96    { MODE_SCN_SNOW,           16403 }, 
     97    { MODE_SCN_BEACH,          16404 }, 
     98    { MODE_SCN_FIREWORK,       16405 }, 
     99    { MODE_INDOOR,             32785 }, 
     100    { MODE_KIDS_PETS,          32784 },  
     101    { MODE_NIGHT_SNAPSHOT,     32779 }, 
     102    { MODE_LANDSCAPE,          32780 },  
     103    { MODE_PORTRAIT,           32781 }, 
     104}; 
     105 
    82106#include "../generic/shooting.c" 
    83107 
  • trunk/platform/sx110is/main.c

    r835 r847  
    2727//debug_led(1); 
    2828    boot(); 
    29 } 
    30  
    31 static struct { 
    32         int hackmode; 
    33         int canonmode; 
    34 } modemap[] = { 
    35   { MODE_VIDEO_STD,          2600  },  //Verified 
    36   { MODE_VIDEO_COMPACT,      2602  },  //Verified 
    37   { MODE_SCN_AQUARIUM,       16408 },  //Verified 
    38   { MODE_SCN_SNOW,           16404 },  //Verified 
    39   { MODE_SCN_FOLIAGE,        16403 },  //verified 
    40   { MODE_SCN_SUNSET,         16402 },  //verified 
    41   { MODE_SCN_NIGHT,          16398 },  //verified 
    42   { MODE_SCN_ISO_3200,       16413 },  //verified 
    43   { MODE_SCN_FIREWORK,       16406 },  //verified 
    44   { MODE_SCN_BEACH,          16405 },  //verified 
    45   { MODE_INDOOR,             32785 },  //verified 
    46   { MODE_KIDS_PETS,          32784 },  //verified 
    47   { MODE_NIGHT_SNAPSHOT,     32779 },  //verified 
    48   { MODE_LANDSCAPE,          32780 },  //verified 
    49   { MODE_PORTRAIT,           32781 },  //verified 
    50   { MODE_AUTO,               32768 },  //verified 
    51   { MODE_P,                  32772 },  //verified 
    52   { MODE_TV,                 32771 },  //verified 
    53   { MODE_AV,                 32770 },  //verified 
    54   { MODE_M,                  32769 },  //verified 
    55   { MODE_EASY,               33311 }   //verified 
    56 }; 
    57 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    58  
    59 int mode_get() { 
    60         int mode, i, t=0xFF; 
    61          
    62         mode  = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    63          
    64         _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    65         for (i=0; i<MODESCNT; ++i) { 
    66                 if (modemap[i].canonmode == t) { 
    67                         return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    68                 } 
    69         } 
    70         return (mode); 
    7129} 
    7230 
  • trunk/platform/sx110is/shooting.c

    r749 r847  
    7979};           
    8080 
     81static const CapturemodeMap modemap[] = { 
     82  { MODE_VIDEO_STD,          2600  },  //Verified 
     83  { MODE_VIDEO_COMPACT,      2602  },  //Verified 
     84  { MODE_SCN_AQUARIUM,       16408 },  //Verified 
     85  { MODE_SCN_SNOW,           16404 },  //Verified 
     86  { MODE_SCN_FOLIAGE,        16403 },  //verified 
     87  { MODE_SCN_SUNSET,         16402 },  //verified 
     88  { MODE_SCN_NIGHT,          16398 },  //verified 
     89  { MODE_SCN_ISO_3200,       16413 },  //verified 
     90  { MODE_SCN_FIREWORK,       16406 },  //verified 
     91  { MODE_SCN_BEACH,          16405 },  //verified 
     92  { MODE_INDOOR,             32785 },  //verified 
     93  { MODE_KIDS_PETS,          32784 },  //verified 
     94  { MODE_NIGHT_SNAPSHOT,     32779 },  //verified 
     95  { MODE_LANDSCAPE,          32780 },  //verified 
     96  { MODE_PORTRAIT,           32781 },  //verified 
     97  { MODE_AUTO,               32768 },  //verified 
     98  { MODE_P,                  32772 },  //verified 
     99  { MODE_TV,                 32771 },  //verified 
     100  { MODE_AV,                 32770 },  //verified 
     101  { MODE_M,                  32769 },  //verified 
     102  { MODE_EASY,               33311 }   //verified 
     103}; 
     104 
    81105#include "../generic/shooting.c" 
    82106 
  • trunk/platform/sx200is/main.c

    r839 r847  
    2828} 
    2929 
    30  
    31 static struct { 
    32         int hackmode; 
    33         int canonmode; 
    34 } modemap[] = { 
    35         { MODE_AUTO,               32768  }, 
    36         { MODE_P,                  32772  }, 
    37         { MODE_TV,                 32771  }, 
    38         { MODE_AV,                 32770  }, 
    39         { MODE_M,                  32769  }, 
    40         { MODE_EASY,               33311  }, 
    41         { MODE_PORTRAIT,           32781  }, 
    42         { MODE_NIGHT_SNAPSHOT,     32779  },  
    43         { MODE_LANDSCAPE,          32780  }, 
    44         { MODE_VIDEO_COLOR_ACCENT, 2599   }, 
    45         { MODE_VIDEO_COLOR_SWAP,   2600   }, 
    46         { MODE_VIDEO_STD,          2601   }, 
    47         { MODE_KIDS_PETS,          32784  }, 
    48         { MODE_INDOOR,             32785  }, 
    49  
    50         { MODE_SCN_SUNSET,         16402  }, 
    51         { MODE_SCN_NIGHT,          16398  }, 
    52         { MODE_SCN_FIREWORK,       16406  }, 
    53         { MODE_SCN_BEACH,          16405  }, 
    54         { MODE_SCN_AQUARIUM,       16408  }, 
    55         { MODE_SCN_FOLIAGE,        16403  }, 
    56         { MODE_SCN_SNOW,           16404  }, 
    57         { MODE_SCN_ISO_3200,       16413  }, 
    58         { MODE_SCN_COLOR_ACCENT,   16923  }, 
    59         { MODE_SCN_COLOR_SWAP,     16924  }, 
    60         { MODE_SCN_STITCH,         16906  } 
    61  
    62 }; 
    63 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    6430 
    6531//zoom position is get_parameter_data(87) 
     
    11480 
    11581 
    116 int mode_get() { 
    117     int mode, i, t=0xFF; 
    118     mode  = (playrec_mode==2 || playrec_mode==4 || playrec_mode==5)?MODE_REC:MODE_PLAY; 
    119  
    120     _GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4); 
    121     for (i=0; i<MODESCNT; ++i) { 
    122         if (modemap[i].canonmode == t) { 
    123             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    124         } 
    125     } 
    126     return (mode); 
    127 } 
    128  
    12982long get_vbatt_min() 
    13083{ 
  • trunk/platform/sx200is/shooting.c

    r804 r847  
    7676        {  6, 1600, "1600", -1}, 
    7777        {  7, 3200, "3200", -1}, 
    78 };           
     78};     
     79       
     80static const CapturemodeMap modemap[] = { 
     81        { MODE_AUTO,               32768  }, 
     82        { MODE_P,                  32772  }, 
     83        { MODE_TV,                 32771  }, 
     84        { MODE_AV,                 32770  }, 
     85        { MODE_M,                  32769  }, 
     86        { MODE_EASY,               33311  }, 
     87        { MODE_PORTRAIT,           32781  }, 
     88        { MODE_NIGHT_SNAPSHOT,     32779  },  
     89        { MODE_LANDSCAPE,          32780  }, 
     90        { MODE_VIDEO_COLOR_ACCENT, 2599   }, 
     91        { MODE_VIDEO_COLOR_SWAP,   2600   }, 
     92        { MODE_VIDEO_STD,          2601   }, 
     93        { MODE_KIDS_PETS,          32784  }, 
     94        { MODE_INDOOR,             32785  }, 
     95 
     96        { MODE_SCN_SUNSET,         16402  }, 
     97        { MODE_SCN_NIGHT,          16398  }, 
     98        { MODE_SCN_FIREWORK,       16406  }, 
     99        { MODE_SCN_BEACH,          16405  }, 
     100        { MODE_SCN_AQUARIUM,       16408  }, 
     101        { MODE_SCN_FOLIAGE,        16403  }, 
     102        { MODE_SCN_SNOW,           16404  }, 
     103        { MODE_SCN_ISO_3200,       16413  }, 
     104        { MODE_SCN_COLOR_ACCENT,   16923  }, 
     105        { MODE_SCN_COLOR_SWAP,     16924  }, 
     106        { MODE_SCN_STITCH,         16906  } 
     107}; 
    79108 
    80109#include "../generic/shooting.c" 
  • trunk/platform/tx1/main.c

    r807 r847  
    6969} 
    7070 
    71 static struct { 
    72         int hackmode; 
    73         int canonmode; 
    74 } modemap[] = { 
    75     { MODE_AUTO,               32768 }, 
    76 //    { MODE_M,                  32772 }, 
    77     { MODE_P,                  32772 }, 
    78     { MODE_SUPER_MACRO,        33289 }, 
    79     { MODE_COLOR_ACCENT,       33306 }, 
    80     { MODE_MY_COLORS,          33307 }, 
    81     { MODE_STITCH,             33290 },  
    82     { MODE_SCN_PORTRAIT,       16397 }, 
    83     { MODE_SCN_NIGHT,          16395 }, 
    84     { MODE_SCN_INDOOR,         16401 }, 
    85     { MODE_SCN_FOLIAGE,        16402 }, 
    86     { MODE_SCN_SNOW,           16403 }, 
    87     { MODE_SCN_BEACH,          16404 }, 
    88     { MODE_SCN_AQUARIUM,       16407 }, 
    89     { MODE_VIDEO_STD,          33792 }, 
    90     { MODE_VIDEO_MANUAL,       33796 }, 
    91     { MODE_VIDEO_COLOR_ACCENT, 34330 }, 
    92     { MODE_VIDEO_MY_COLORS,    34331 }, 
    93     { MODE_VIDEO_STITCH,       34314 }, 
    94     { MODE_VIDEO_PORTRAIT,     17421 }, 
    95     { MODE_VIDEO_NIGHT,        17419 }, 
    96     { MODE_VIDEO_INDOOR,       17425 }, 
    97     { MODE_VIDEO_FOLIAGE,      17426 }, 
    98     { MODE_VIDEO_SNOW,         17427 }, 
    99     { MODE_VIDEO_BEACH,        17428 }, 
    100     { MODE_VIDEO_AQUARIUM,     17431 }, 
    101     { MODE_VIDEO_SUPER_MACRO,  34313 }, 
    102 }; 
     71#if 0 
     72int rec_switch_state(void) { 
     73//    mode  = (physw_status[1] & 0x08000000)?MODE_REC:MODE_PLAY;  
     74    return (physw_status[1] & 0x08000000);  
     75} 
     76#endif 
     77// TODO this camera defines CAM_SWIVEL_SCREEN but screen position checks didn't exist in mode_get() 
     78int screen_opened(void) { 
     79        return 0; 
     80} 
    10381 
    104 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 
    105  
    106 int mode_get() { 
    107     int mode, i, t=0xFF; 
    108  
    109     mode  = (physw_status[1] & 0x08000000)?MODE_REC:MODE_PLAY;  
    110     _GetPropertyCase(PROPCASE_SHOOTING_MODE /*49*/, &t, 4); 
    111     for (i=0; i<MODESCNT; ++i) { 
    112         if (modemap[i].canonmode == t) { 
    113             return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK)); 
    114         } 
    115     } 
    116     return (mode); 
     82int screen_rotated(void) { 
     83        return 0; 
    11784} 
  • trunk/platform/tx1/shooting.c

    r515 r847  
    7777};           
    7878 
     79static const CapturemodeMap modemap[] = { 
     80   { MODE_AUTO,               32768 }, 
     81//    { MODE_M,                  32772 }, 
     82    { MODE_P,                  32772 }, 
     83    { MODE_SUPER_MACRO,        33289 }, 
     84    { MODE_COLOR_ACCENT,       33306 }, 
     85    { MODE_MY_COLORS,          33307 }, 
     86    { MODE_STITCH,             33290 },  
     87    { MODE_SCN_PORTRAIT,       16397 }, 
     88    { MODE_SCN_NIGHT,          16395 }, 
     89    { MODE_SCN_INDOOR,         16401 }, 
     90    { MODE_SCN_FOLIAGE,        16402 }, 
     91    { MODE_SCN_SNOW,           16403 }, 
     92    { MODE_SCN_BEACH,          16404 }, 
     93    { MODE_SCN_AQUARIUM,       16407 }, 
     94    { MODE_VIDEO_STD,          33792 }, 
     95    { MODE_VIDEO_MANUAL,       33796 }, 
     96    { MODE_VIDEO_COLOR_ACCENT, 34330 }, 
     97    { MODE_VIDEO_MY_COLORS,    34331 }, 
     98    { MODE_VIDEO_STITCH,       34314 }, 
     99    { MODE_VIDEO_PORTRAIT,     17421 }, 
     100    { MODE_VIDEO_NIGHT,        17419 }, 
     101    { MODE_VIDEO_INDOOR,       17425 }, 
     102    { MODE_VIDEO_FOLIAGE,      17426 }, 
     103    { MODE_VIDEO_SNOW,         17427 }, 
     104    { MODE_VIDEO_BEACH,        17428 }, 
     105    { MODE_VIDEO_AQUARIUM,     17431 }, 
     106    { MODE_VIDEO_SUPER_MACRO,  34313 }, 
     107}; 
     108 
    79109#include "../generic/shooting.c" 
    80110 
  • trunk/version.inc

    r735 r847  
    1 BUILD_NUMBER := 0.9.8 
     1BUILD_NUMBER := 0.9.9 
Note: See TracChangeset for help on using the changeset viewer.