Changeset 1059


Ignore:
Timestamp:
02/14/11 03:53:00 (2 years ago)
Author:
reyalP
Message:

add s95 100e and 100h source, thanks to waldo in http://chdk.setepontos.com/index.php?topic=650.msg59919#msg59919

Location:
trunk
Files:
43 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/gui.c

    r1037 r1059  
    23262326     if (x) { 
    23272327      get_property_case(PROPCASE_DIGITAL_ZOOM_POSITION, &x, sizeof(x)); 
    2328 #if defined (CAMERA_s90) 
     2328#if defined (CAMERA_s90) || defined (CAMERA_s95) 
    23292329          if (x==0) zoom_status=ZOOM_OPTICAL_MAX; //ERR99: No zoom back from digital to optical zoom possible if set to medium 
    23302330#elif defined (CAMERA_sx30)     || defined (CAMERA_g12)         // can't find, crashes camera ******* 
  • trunk/core/gui_draw.h

    r1024 r1059  
    226226#undef SCREEN_COLOR 
    227227#define SCREEN_COLOR            0x1D 
     228#elif CAM_BITMAP_PALETTE==8                     // s95 
     229#define COLOR_TRANSPARENT   0x00 
     230#define COLOR_WHITE         0x01 
     231#define COLOR_RED           0x66 
     232#define COLOR_GREY          0x6D 
     233#define COLOR_GREEN         0x69 
     234#define COLOR_BLUE_LT       0x68 
     235#define COLOR_BLUE          0x67 
     236#define COLOR_YELLOW        0x60 
     237#define COLOR_BLACK         0xFF 
     238#define COLOR_BG            0x20 
     239#define COLOR_FG            COLOR_WHITE 
     240#define COLOR_SELECTED_BG   COLOR_RED 
     241#define COLOR_SELECTED_FG   COLOR_WHITE 
     242#define COLOR_ALT_BG        0x20 
     243#define COLOR_SPLASH_RED    COLOR_RED 
     244#define COLOR_SPLASH_PINK   COLOR_GREY 
     245#define COLOR_SPLASH_GREY   0xDE 
     246#define COLOR_HISTO_R       COLOR_RED 
     247#define COLOR_HISTO_R_PLAY  COLOR_RED 
     248#define COLOR_HISTO_B       COLOR_BLUE 
     249#define COLOR_HISTO_G       COLOR_GREEN 
     250#define COLOR_HISTO_G_PLAY  COLOR_GREEN 
     251#define COLOR_HISTO_BG      COLOR_BLUE_LT 
     252#define COLOR_HISTO_RG      COLOR_YELLOW 
     253#define COLOR_HISTO_RB      COLOR_RED 
     254#define COLOR_HISTO_RB_PLAY COLOR_HISTO_RB 
     255#define COLOR_HISTO_B_PLAY  COLOR_HISTO_B 
     256#define COLOR_HISTO_BG_PLAY COLOR_BLUE_LT 
     257#define COLOR_HISTO_RG_PLAY COLOR_YELLOW 
     258 
    228259#else 
    229260#error CAM_BITMAP_PALETTE not defined 
  • trunk/core/kbd.c

    r1056 r1059  
    102102static int nTxtbl[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13}; 
    103103#endif 
    104 #if defined(CAMERA_s90) 
     104#if defined(CAMERA_s90) || defined(CAMERA_s95) 
    105105#define ZSTEP_TABLE_SIZE 10 
    106106static int nTxtbl[]={0,1,2,3,4,5,6,7,8,9}; 
  • trunk/include/camera.h

    r1056 r1059  
    30283028//---------------------------------------------------------- 
    30293029 
     3030#elif defined (CAMERA_s95) 
     3031    #define CAM_DRYOS_2_3_R39                   1 
     3032    #define CAM_PROPSET                 4 
     3033    #define CAM_DRYOS                   1 
     3034    #undef  CAM_USE_ZOOM_FOR_MF 
     3035    #define CAM_RAW_ROWPIX              3744 
     3036    #define CAM_RAW_ROWS                2784 
     3037    #undef  CAM_EMUL_KEYPRESS_DURATION 
     3038    #define CAM_EMUL_KEYPRESS_DURATION  10 
     3039    #undef CAM_MENU_BORDERWIDTH 
     3040    #define CAM_MENU_BORDERWIDTH        10 
     3041        #define CAM_QUALITY_OVERRIDE 1 
     3042    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1 
     3043    #define CAM_HAS_JOGDIAL             1 
     3044        #undef CAM_HAS_ERASE_BUTTON 
     3045    #undef  CAM_CONSOLE_LOG_ENABLED         // Development: internal camera stdout -> A/stdout.txt 
     3046    #define CAM_BRACKETING              1 
     3047        #undef  CAM_VIDEO_CONTROL 
     3048        #define CAM_VIDEO_QUALITY_ONLY          1 
     3049    #define CAM_MULTIPART               1 
     3050    #define CAM_EXT_TV_RANGE            1 
     3051    #undef OPT_CURVES 
     3052    #undef CAM_UNCACHED_BIT 
     3053    #define CAM_UNCACHED_BIT            0x40000000  // S94 100E @FF89100C 
     3054        #define CAM_SHOW_OSD_IN_SHOOT_MENU  1 
     3055 
     3056    // camera name 
     3057    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData 
     3058    #undef  CAM_SENSOR_BITS_PER_PIXEL 
     3059    #define CAM_SENSOR_BITS_PER_PIXEL   12 
     3060    #undef  CAM_WHITE_LEVEL 
     3061    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1) 
     3062    #undef  CAM_BLACK_LEVEL 
     3063    #define CAM_BLACK_LEVEL             127 
     3064 
     3065    #undef CAM_USES_ASPECT_CORRECTION 
     3066    #define CAM_USES_ASPECT_CORRECTION  1  //camera uses the modified graphics primitives to map screens an viewports to buffers more sized 
     3067    #undef CAM_USES_ASPECT_YCORRECTION 
     3068    #define CAM_USES_ASPECT_YCORRECTION  0  //only uses mappings on x coordinate 
     3069 
     3070    //games mappings 
     3071        #undef GAMES_SCREEN_WIDTH 
     3072        #define GAMES_SCREEN_WIDTH 360 
     3073        #undef GAMES_SCREEN_HEIGHT 
     3074        #define GAMES_SCREEN_HEIGHT 240 
     3075 
     3076    #undef CAM_BITMAP_PALETTE 
     3077    #define CAM_BITMAP_PALETTE    7 
     3078 
     3079    #undef ASPECT_XCORRECTION 
     3080        #define ASPECT_XCORRECTION(x)  ( ( ((x)<<3) + (x) )  >>2 ) 
     3081        #undef ASPECT_GAMES_XCORRECTION 
     3082        #define ASPECT_GAMES_XCORRECTION(x)   ( ((x)<<1) ) 
     3083        #undef ASPECT_GAMES_YCORRECTION 
     3084        #define ASPECT_GAMES_YCORRECTION(y)   ( (y) )  //none 
     3085 
     3086    #undef ASPECT_GRID_XCORRECTION 
     3087    #define ASPECT_GRID_XCORRECTION(x)  ( ((x)<<3)/9  )  //grids are designed on a 360x240 basis and screen is 320x240, we need x*320/360=x*8/9 
     3088    #undef ASPECT_GRID_YCORRECTION 
     3089    #define ASPECT_GRID_YCORRECTION(y)  ( (y) )       //y correction for grids  made on a 360x240 As the buffer is 720x240 we have no correction here. 
     3090 
     3091    #undef ASPECT_VIEWPORT_XCORRECTION 
     3092    #define ASPECT_VIEWPORT_XCORRECTION(x) ASPECT_GRID_XCORRECTION(x) //viewport is 360x240 and screen 320x240, we need x*320/360=x*8/9, equal than grids, used by edgeoverlay 
     3093    #undef ASPECT_VIEWPORT_YCORRECTION 
     3094    #define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) ) 
     3095    #undef EDGE_HMARGIN 
     3096    #define EDGE_HMARGIN 28 
     3097 
     3098    #define DNG_SUPPORT    1 
     3099    // pattern 
     3100    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue 
     3101    // color 
     3102    //need fixing ***************************************************** 
     3103    #define CAM_COLORMATRIX1                               \ 
     3104      14134, 1000000, -5576, 1000000, -1527, 1000000, \ 
     3105     -1991,  1000000, 10719,  1000000, 1273,   1000000, \ 
     3106      -1158,   1000000, 1929,   1000000, 3581,  1000000 
     3107    #define cam_CalibrationIlluminant1 17 // Standard Light A 
     3108 
     3109    // cropping 
     3110    #define CAM_JPEG_WIDTH  3600 
     3111    #define CAM_JPEG_HEIGHT 2700 
     3112    #define CAM_ACTIVE_AREA_X1 52 
     3113    #define CAM_ACTIVE_AREA_Y1 14 
     3114    #define CAM_ACTIVE_AREA_X2 3648 
     3115    #define CAM_ACTIVE_AREA_Y2 2736 
     3116 
     3117   #define CAM_ZEBRA_ASPECT_ADJUST 1 
     3118 
     3119   // todo - we may need this to save memory 
     3120    //#define CAM_ZEBRA_NOBUF 1 
     3121//========================================================== 
     3122// END of Camera-dependent settings 
     3123//========================================================== 
     3124 
    30303125#elif defined (CAMERA_sx30) 
    30313126        #define CAM_PROPSET                                     4 
  • trunk/include/propset4.h

    r1007 r1059  
    1 #ifndef PROPSET3_H 
    2 #define PROPSET3_H 
     1#ifndef PROPSET4_H 
     2#define PROPSET4_H 
    33 
    44/* 
    55constants for propset 4 
    66WARNING: 
    7 The build uses tools/gen_propset_lua.sed to generate propset3.lua from this file 
     7The build uses tools/gen_propset_lua.sed to generate propset4.lua from this file 
    88*/ 
    99 
  • trunk/lib/ubasic/ubasic.c

    r1042 r1059  
    372372  case TOKENIZER_GET_PROPSET: 
    373373    accept(TOKENIZER_GET_PROPSET); 
    374     #if CAM_PROPSET == 1 
    375     r = 1; 
    376     #elif CAM_PROPSET == 2 
    377     r = 2; 
    378     #elif CAM_PROPSET == 3 
    379     r = 3; 
    380     #elif CAM_PROPSET == 3 
    381     r = 3; 
    382     #endif 
     374    r = CAM_PROPSET; 
    383375   break; 
    384376  case TOKENIZER_GET_TV96: 
  • trunk/makefile.inc

    r1056 r1059  
    292292#PLATFORM=d10 
    293293#PLATFORMSUB=100a 
     294 
     295#PLATFORM=s95 
     296#PLATFORMSUB=100e 
     297 
    294298 
    295299MEMISOSIZE="(&_end-&_start)" 
  • trunk/platform/generic/kbd.c

    r1031 r1059  
    4949#endif 
    5050 
    51 #if defined(CAMERA_s90) 
     51#if defined(CAMERA_s90) || defined(CAMERA_s95) 
    5252#define USB_MASK (0x200000) 
    5353#define USB_REG 2 
  • trunk/platform/generic/shooting.c

    r960 r1059  
    737737        defined (CAMERA_s90) || \ 
    738738        defined (CAMERA_sx20) || \ 
    739         defined (CAMERA_d10) 
     739        defined (CAMERA_d10) || \ 
     740        defined (CAMERA_s95) 
    740741   short n; 
    741742   // unlike other cameras, sx200 does set PROPCASE_DRIVE_MODE when in custom timer mode 
  • trunk/platform/generic/wrappers.c

    r1024 r1059  
    122122void lens_set_zoom_point(long newpt) 
    123123{ 
     124#if defined (CAMERA_s95) 
     125        long startTime; 
     126#endif 
     127 
    124128    if (newpt < 0) { 
    125129        newpt = 0; 
     
    138142#else 
    139143    _MoveZoomLensWithPoint((short*)&newpt); 
    140     while (zoom_busy); 
     144 
     145#if defined (CAMERA_s95) 
     146        // this will hang sometimes on s95 when zoom_busy gets stuck as a 1 
     147        // we add a timeout as a work-around for this problem 
     148        startTime = get_tick_count(); 
     149        while (get_tick_count() < (startTime + 2000)) { 
     150                if (!zoom_busy) 
     151                        break; 
     152        } 
     153#else 
     154        while (zoom_busy) ; 
     155#endif 
     156 
    141157    if (newpt==0) zoom_status=ZOOM_OPTICAL_MIN; 
    142158    else if (newpt >= zoom_points) zoom_status=ZOOM_OPTICAL_MAX; 
    143     else zoom_status=ZOOM_OPTICAL_MEDIUM;  
     159    else zoom_status=ZOOM_OPTICAL_MEDIUM; 
    144160    _SetPropertyCase(PROPCASE_OPTICAL_ZOOM_POSITION, &newpt, sizeof(newpt)); 
    145161#endif 
     
    346362 
    347363char *strrchr(const char *s, int c) { 
     364#if defined (CAMERA_s95) 
     365        // unable to find strrchr in s95 - we use our own fn 
     366        char *result = 0; 
     367 
     368        c = (char) c; 
     369 
     370        do { 
     371                if (c == *s) 
     372                        result = (char*) s; 
     373        } while (*s++ != '\0'); 
     374 
     375        return result; 
     376#else 
    348377    return _strrchr(s, c); 
     378#endif 
    349379} 
    350380 
Note: See TracChangeset for help on using the changeset viewer.