Changeset 324


Ignore:
Timestamp:
03/12/08 18:38:02 (5 years ago)
Author:
GrAnd
Message:
  • Separated camera-model-dependent stuff to a single file 'include/camera.h'
Location:
trunk
Files:
1 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/conf.c

    r312 r324  
    44#include "histogram.h" 
    55#include "font.h" 
     6#include "camera.h" 
    67#include "raw.h" 
    78#include "gui_draw.h" 
     
    302303 
    303304static void conf_change_alt_mode_button() { 
    304 #if defined(CAMERA_s2is) || defined(CAMERA_s3is) || defined(CAMERA_g7) 
     305#if CAM_ADJUSTABLE_ALT_BUTTON 
    305306    kbd_set_alt_mode_key_mask(conf.alt_mode_button); 
    306307#else 
  • trunk/core/gui.c

    r323 r324  
    44#include "keyboard.h" 
    55#include "conf.h" 
     6#include "camera.h" 
    67#include "ubasic.h" 
    78#include "font.h" 
     
    3940// #define KEY_NONE (KEY_DUMMY+1) 
    4041 
    41 #if   defined(CAMERA_ixus700_sd500) || defined(CAMERA_ixus800_sd700) || defined(CAMERA_ixus65_sd630) || defined(CAMERA_a560) || defined(CAMERA_ixus850_sd800) || defined (CAMERA_ixus70_sd1000) || defined (CAMERA_ixus950_sd850) || defined(CAMERA_ixus55_sd450) || defined(CAMERA_a550) 
     42#if !CAM_HAS_ERASE_BUTTON 
    4243//Alt mode 
    4344 #define SHORTCUT_TOGGLE_RAW          KEY_DISPLAY 
     
    136137static const char* gui_show_values_enum(int change, int arg); 
    137138static const char* gui_dof_show_value_enum(int change, int arg); 
    138 #if defined(CAMERA_s2is) || defined(CAMERA_s3is) || defined(CAMERA_g7) 
     139#if CAM_ADJUSTABLE_ALT_BUTTON 
    139140static const char* gui_alt_mode_button_enum(int change, int arg); 
    140141#endif 
     
    183184        {LANG_MENU_SCRIPT_AUTOSTART,            MENUITEM_BOOL,                                          &conf.script_startup }, 
    184185 
    185 #if !defined (CAMERA_a560) && !defined (CAMERA_a700) 
     186#if CAM_REMOTE 
    186187        {LANG_MENU_SCRIPT_REMOTE_ENABLE,        MENUITEM_BOOL,                                          &conf.remote_enable}, 
    187188#endif 
     
    229230    {LANG_MENU_MISC_TEXT_READER,        MENUITEM_SUBMENU, (int*)&reader_submenu }, 
    230231    {LANG_MENU_MISC_GAMES,              MENUITEM_SUBMENU, (int*)&games_submenu }, 
    231 #if defined(CAMERA_a610) || defined(CAMERA_a620) || defined(CAMERA_a630) || defined(CAMERA_a640) || defined(CAMERA_a650) || defined (CAMERA_s2is) || defined (CAMERA_s3is) || defined (CAMERA_s5is) 
     232#if CAM_SWIVEL_SCREEN 
    232233    {LANG_MENU_MISC_FLASHLIGHT,         MENUITEM_BOOL,    &conf.flashlight }, 
    233234#endif 
    234235    {LANG_MENU_MISC_SHOW_SPLASH,        MENUITEM_BOOL,    &conf.splash_show }, 
    235 #if !defined(CAMERA_g7) && !defined (CAMERA_ixus700_sd500) && !defined (CAMERA_ixus800_sd700) && !defined (CAMERA_a560) && !defined (CAMERA_ixus850_sd800)  && !defined (CAMERA_ixus70_sd1000) && !defined (CAMERA_ixus950_sd850) && !defined (CAMERA_a460) && !defined(CAMERA_ixus55_sd450) && !defined(CAMERA_a550) 
     236#if CAM_USE_ZOOM_FOR_MF 
    236237    {LANG_MENU_MISC_ZOOM_FOR_MF,        MENUITEM_BOOL,    &conf.use_zoom_mf }, 
    237238#endif 
    238 #if defined(CAMERA_s2is) || defined(CAMERA_s3is) || defined(CAMERA_g7) 
     239#if CAM_ADJUSTABLE_ALT_BUTTON 
    239240    {LANG_MENU_MISC_ALT_BUTTON,         MENUITEM_ENUM,    (int*)gui_alt_mode_button_enum }, 
    240241#endif 
     
    258259    {LANG_MENU_DEBUG_DUMP_RAM,          MENUITEM_BOOL,          &conf.ns_enable_memdump }, 
    259260    {LANG_MENU_DEBUG_MAKE_BOOTABLE,     MENUITEM_PROC,          (int*)gui_menuproc_mkbootdisk }, 
    260 #if defined (CAMERA_MULTIPART) 
     261#if CAM_MULTIPART 
    261262    {LANG_MENU_DEBUG_CREATE_MULTIPART , MENUITEM_PROC,          (int*)gui_menuproc_break_card }, 
    262263    {LANG_MENU_DEBUG_SWAP_PART,         MENUITEM_PROC,          (int*)gui_menuproc_swap_patitons }, 
     
    798799 
    799800//------------------------------------------------------------------- 
    800 #if defined(CAMERA_s2is) || defined(CAMERA_s3is) || defined(CAMERA_g7) 
     801#if CAM_ADJUSTABLE_ALT_BUTTON 
    801802const char* gui_alt_mode_button_enum(int change, int arg) { 
    802803#if defined(CAMERA_s2is) || defined(CAMERA_s3is) 
     
    11541155//------------------------------------------------------------------- 
    11551156 
    1156 #if defined (CAMERA_MULTIPART) 
     1157#if CAM_MULTIPART 
    11571158void card_break_proc(unsigned int btn){ 
    11581159 if (btn==MBOX_BTN_YES) create_partitions(); 
     
    14441445                                  }    
    14451446                                else   
    1446                                 switch (kbd_get_autoclicked_key()) { 
    1447 #if defined (CAMERA_a460) 
    1448               case KEY_RIGHT: 
     1447                  switch (kbd_get_autoclicked_key()) { 
     1448#if CAM_HAS_ZOOM_LEVER 
     1449                    case KEY_ZOOM_IN: 
    14491450#else 
    1450                                   case KEY_ZOOM_IN: 
    1451 #endif 
    1452                   gui_subj_dist_override_value_enum(1,0); 
    1453                   shooting_set_focus(shooting_get_subject_distance_override_value(),SET_NOW); 
    1454                   break; 
    1455 #if defined (CAMERA_a460) 
    1456               case KEY_LEFT: 
     1451                    case KEY_RIGHT: 
     1452#endif 
     1453                        gui_subj_dist_override_value_enum(1,0); 
     1454                        shooting_set_focus(shooting_get_subject_distance_override_value(),SET_NOW); 
     1455                        break; 
     1456#if CAM_HAS_ZOOM_LEVER 
     1457                    case KEY_ZOOM_OUT: 
    14571458#else 
    1458                  case KEY_ZOOM_OUT: 
    1459 #endif 
    1460                   gui_subj_dist_override_value_enum(-1,0); 
    1461                   shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 
    1462                   break; 
     1459                    case KEY_LEFT: 
     1460#endif 
     1461                        gui_subj_dist_override_value_enum(-1,0); 
     1462                        shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 
     1463                        break; 
    14631464                  } 
    14641465              } 
     
    16931694    } 
    16941695 
    1695 #if defined (CAMERA_ixus700_sd500) || defined (CAMERA_ixus800_sd700) || defined (CAMERA_ixus850_sd800) || defined (CAMERA_a460)  
    1696     if (gui_mode==GUI_MODE_NONE && kbd_is_key_pressed(KEY_SHOOT_HALF) && ((m&MODE_MASK)==MODE_REC) && ((m&MODE_SHOOTING_MASK))!=MODE_VIDEO_STD && (m&MODE_SHOOTING_MASK)!=MODE_VIDEO_COMPACT) {     
     1696#if CAM_DRAW_EXPOSITION 
     1697    if (gui_mode==GUI_MODE_NONE && kbd_is_key_pressed(KEY_SHOOT_HALF) && ((m&MODE_MASK)==MODE_REC) && ((m&MODE_SHOOTING_MASK))!=MODE_VIDEO_STD && (m&MODE_SHOOTING_MASK)!=MODE_VIDEO_COMPACT) { 
    16971698     strcpy(osd_buf,shooting_get_tv_str()); 
    16981699     strcat(osd_buf,"\"  F"); 
  • trunk/core/gui_calendar.c

    r323 r324  
    111111            need_redraw = 1; 
    112112            break; 
    113       #if defined (CAMERA_ixus700_sd500) || defined (CAMERA_ixus800_sd700) || defined (CAMERA_a560) || defined (CAMERA_ixus850_sd800) || defined (CAMERA_ixus70_sd1000) || defined (CAMERA_a460) || defined(CAMERA_ixus55_sd450) || defined(CAMERA_a550) 
     113      #if CAM_HAS_ERASE_BUTTON 
     114        case KEY_ERASE: 
     115      #else 
    114116        case KEY_DISPLAY: 
    115       #else 
    116         case KEY_ERASE: 
    117117      #endif 
    118118            calendar_goto_today(); 
  • trunk/core/gui_fselect.c

    r323 r324  
    707707            } 
    708708            break; 
    709     #if defined (CAMERA_ixus700_sd500) || defined (CAMERA_ixus800_sd700) || defined (CAMERA_a560) || defined (CAMERA_ixus850_sd800) || defined (CAMERA_ixus70_sd1000) || defined (CAMERA_a460) || defined(CAMERA_ixus55_sd450) || defined(CAMERA_a550) 
     709      #if CAM_HAS_ERASE_BUTTON 
     710        case KEY_ERASE: 
     711      #else 
    710712        case KEY_DISPLAY: 
    711     #else 
    712         case KEY_ERASE: 
    713     #endif 
     713      #endif 
    714714            if (selected && selected->attr != 0xFF) { 
    715715                if (selected->attr & DOS_ATTR_DIRECTORY) { 
  • trunk/core/gui_menu.c

    r321 r324  
    9494#if !defined (CAMERA_a460) 
    9595 
    96 #if defined(CAMERA_ixus700_sd500) || defined(CAMERA_ixus800_sd700) || defined(CAMERA_a560) || defined(CAMERA_ixus850_sd800) || defined(CAMERA_ixus70_sd1000) || defined(CAMERA_ixus950_sd850) 
    97                 case KEY_SHOOT_HALF: 
     96#if CAM_HAS_ERASE_BUTTON 
     97        case KEY_ERASE: 
    9898#else     
    99         case KEY_ERASE: 
     99        case KEY_SHOOT_HALF: 
    100100#endif 
    101101                if (conf.user_menu_enable == 3) { 
     
    317317            break; 
    318318 
    319 #if defined (CAMERA_a460) 
     319#if CAM_HAS_ZOOM_LEVER 
     320        case KEY_ZOOM_IN: 
     321            if (int_incr >= 10){ 
     322                int_incr /= 10; 
     323            } 
     324            sprintf(sbuf, "±%d",int_incr); 
     325            draw_string(FONT_WIDTH*2,0,"    ", MAKE_COLOR(COLOR_TRANSPARENT, COLOR_TRANSPARENT)); 
     326            draw_string(0,0,sbuf,MAKE_COLOR(COLOR_SELECTED_BG, COLOR_SELECTED_FG)); 
     327            break; 
     328 
     329        case KEY_ZOOM_OUT: 
     330            if (int_incr <= 1000){ 
     331                int_incr *= 10; 
     332            } 
     333            sprintf(sbuf, "±%d",int_incr); 
     334            draw_string(0,0,sbuf,MAKE_COLOR(COLOR_SELECTED_BG, COLOR_SELECTED_FG)); 
     335            break; 
     336 
     337        case KEY_DISPLAY: 
     338            if (gui_menu_stack_ptr > 0){ 
     339                gui_menu_stack_ptr--; 
     340                gui_menu_set_curr_menu(gui_menu_stack[gui_menu_stack_ptr].menu, gui_menu_stack[gui_menu_stack_ptr].toppos, gui_menu_stack[gui_menu_stack_ptr].curpos); 
     341                gui_menu_redraw=2; 
     342                draw_restore(); 
     343                gui_force_restore(); 
     344            } 
     345            break; 
     346#else 
    320347        case KEY_DISPLAY: 
    321348            if (conf.user_menu_enable == 2) { 
     
    338365               } 
    339366               draw_string(0,0,sbuf,MAKE_COLOR(COLOR_SELECTED_BG, COLOR_SELECTED_FG)); 
    340             } 
    341             break; 
    342  
    343 #else 
    344         case KEY_ZOOM_IN: 
    345             if (int_incr >= 10){ 
    346                 int_incr /= 10; 
    347             } 
    348             sprintf(sbuf, "±%d",int_incr); 
    349             draw_string(FONT_WIDTH*2,0,"    ", MAKE_COLOR(COLOR_TRANSPARENT, COLOR_TRANSPARENT)); 
    350             draw_string(0,0,sbuf,MAKE_COLOR(COLOR_SELECTED_BG, COLOR_SELECTED_FG)); 
    351             break; 
    352  
    353         case KEY_ZOOM_OUT: 
    354             if (int_incr <= 1000){ 
    355                 int_incr *= 10; 
    356             } 
    357             sprintf(sbuf, "±%d",int_incr); 
    358             draw_string(0,0,sbuf,MAKE_COLOR(COLOR_SELECTED_BG, COLOR_SELECTED_FG)); 
    359             break; 
    360  
    361         case KEY_DISPLAY: 
    362             if (gui_menu_stack_ptr > 0){ 
    363                 gui_menu_stack_ptr--; 
    364                 gui_menu_set_curr_menu(gui_menu_stack[gui_menu_stack_ptr].menu, gui_menu_stack[gui_menu_stack_ptr].toppos, gui_menu_stack[gui_menu_stack_ptr].curpos); 
    365                 gui_menu_redraw=2; 
    366                 draw_restore(); 
    367                 gui_force_restore(); 
    368367            } 
    369368            break; 
  • trunk/core/gui_osd.c

    r323 r324  
    469469    //long lfpfl=lens_get_focus_pos_fl(); 
    470470 
    471 #if defined(CAMERA_ixus700_sd500) || defined(CAMERA_ixus800_sd700) || defined(CAMERA_ixus65_sd630) || defined(CAMERA_a560) || defined(CAMERA_ixus850_sd800) || defined(CAMERA_ixus70_sd1000) || defined(CAMERA_ixus950_sd850) || defined(CAMERA_a460) || defined(CAMERA_ixus55_sd450) || defined(CAMERA_a550) 
     471#if CAM_HAS_IRIS_DIAPHRAGM 
     472    av=shooting_get_real_aperture(); 
     473#else 
    472474    av=shooting_get_min_real_aperture(); 
    473 #else 
    474     av=shooting_get_real_aperture(); 
    475475#endif 
    476476    fl=get_focal_length(lens_get_zoom_point());  
     
    713713    } 
    714714    if (conf.av_override_value || gui_mode==GUI_MODE_OSD) gui_print_osd_state_string_float("AV:", "%d.%02d ", 100, shooting_get_aperture_from_av96(shooting_get_av96_override_value())); 
    715 #if defined (CAMERA_ixus700_sd500) || defined (CAMERA_ixus800_sd700) || defined (CAMERA_ixus850_sd800) || defined (CAMERA_ixus70_sd1000) || defined (CAMERA_ixus950_sd850) || defined (CAMERA_a560) || defined (CAMERA_a570) || defined (CAMERA_a710) ||  defined (CAMERA_g7) || defined(CAMERA_ixus55_sd450) || defined(CAMERA_a550) 
     715#if CAM_HAS_ND_FILTER 
    716716    if (conf.nd_filter_state || gui_mode==GUI_MODE_OSD) gui_print_osd_state_string_chr("NDFILTER:", ((conf.nd_filter_state==1)?"IN":"OUT")); 
    717717#endif     
  • trunk/core/gui_reversi.c

    r323 r324  
    378378            need_redraw = 1; 
    379379            break; 
    380     #if defined (CAMERA_ixus700_sd500) || defined (CAMERA_ixus800_sd700) || defined (CAMERA_a560) || defined (CAMERA_ixus850_sd800) || defined (CAMERA_ixus70_sd1000) || defined (CAMERA_a460) || defined(CAMERA_ixus55_sd450) || defined(CAMERA_a550) 
     380      #if CAM_HAS_ERASE_BUTTON 
     381        case KEY_ERASE: 
     382      #else 
    381383        case KEY_DISPLAY: 
    382     #else 
    383         case KEY_ERASE: 
    384     #endif 
     384      #endif 
    385385            if (InGame) 
    386386                Computer=COMPUTER_ONLY; 
     
    389389            need_redraw = 1; 
    390390            break; 
    391     #if !defined (CAMERA_ixus700_sd500) && !defined (CAMERA_ixus800_sd700) && !defined (CAMERA_a560) && !defined (CAMERA_ixus850_sd800) && !defined (CAMERA_ixus70_sd1000) && !defined (CAMERA_a460) && !defined(CAMERA_ixus55_sd450) && !defined(CAMERA_a550) 
     391      #if CAM_HAS_ERASE_BUTTON 
    392392        case KEY_DISPLAY: 
    393393            gui_mbox_init(LANG_MBOX_ABOUT_TITLE, (int)"REVERSI\n(c) GrAnd, 2007", MBOX_TEXT_CENTER, NULL); 
    394394            need_redraw_all = 1; 
    395395            break; 
    396     #endif 
     396      #endif 
    397397    } 
    398398} 
  • trunk/core/gui_sokoban.c

    r323 r324  
    259259            need_redraw = 1; 
    260260            break; 
    261      #if defined (CAMERA_ixus700_sd500) || defined (CAMERA_ixus800_sd700) || defined (CAMERA_a560) || defined (CAMERA_ixus850_sd800) || defined (CAMERA_ixus70_sd1000) || defined (CAMERA_a460) || defined(CAMERA_ixus55_sd450) || defined(CAMERA_a550) 
     261      #if CAM_HAS_ERASE_BUTTON 
     262        case KEY_ERASE: 
     263      #else 
    262264        case KEY_DISPLAY: 
    263      #else 
    264         case KEY_ERASE: 
    265      #endif 
     265      #endif 
    266266            sokoban_set_level(conf.sokoban_level); 
    267267            need_redraw = 1; 
    268268            break; 
    269      #if !defined (CAMERA_ixus700_sd500) && !defined (CAMERA_ixus800_sd700) && !defined (CAMERA_a560) && !defined (CAMERA_ixus850_sd800) && !defined (CAMERA_ixus70_sd1000) && !defined (CAMERA_a460) && !defined(CAMERA_ixus55_sd450) && !defined(CAMERA_a550) 
     269      #if CAM_HAS_ERASE_BUTTON 
    270270        case KEY_DISPLAY: 
    271271            gui_mbox_init(LANG_MBOX_ABOUT_TITLE, (int)"SOKOBAN\n(c) GrAnd, 2007", MBOX_TEXT_CENTER, NULL); 
  • trunk/core/raw.c

    r258 r324  
    112112 
    113113void set_raw_pixel(unsigned int x, unsigned int y, unsigned short value){ 
    114  unsigned char* addr=hook_raw_image_addr()+y*ROWLEN+(x/8)*10; 
     114 unsigned char* addr=hook_raw_image_addr()+y*RAW_ROWLEN+(x/8)*10; 
    115115 switch (x%8) { 
    116116  case 0: addr[0]=(addr[0]&0x3F)|(value<<6); addr[1]=value>>2;                  break; 
     
    127127//------------------------------------------------------------------- 
    128128unsigned short get_raw_pixel(unsigned int x,unsigned  int y){ 
    129  unsigned char* addr=hook_raw_image_addr()+y*ROWLEN+(x/8)*10; 
     129 unsigned char* addr=hook_raw_image_addr()+y*RAW_ROWLEN+(x/8)*10; 
    130130 switch (x%8) { 
    131131  case 0: return ((0x3fc&(((unsigned short)addr[1])<<2)) | (addr[0] >> 6)); 
     
    143143//------------------------------------------------------------------- 
    144144void patch_bad_pixel(unsigned int x,unsigned  int y){ 
    145  if ((x>=2) && (x<ROWPIX-2) && (y>=2) && (y<ROWS-2))  
     145 if ((x>=2) && (x<CAM_RAW_ROWPIX-2) && (y>=2) && (y<CAM_RAW_ROWS-2))  
    146146  set_raw_pixel(x,y,(get_raw_pixel(x-2,y)+get_raw_pixel(x+2,y)+get_raw_pixel(x,y-2)+get_raw_pixel(x,y+2))/4); 
    147147} 
  • trunk/core/raw.h

    r323 r324  
    11#ifndef RAW_H 
    22#define RAW_H 
     3 
     4#include "camera.h" 
    35 
    46//------------------------------------------------------------------- 
     
    1517//------------------------------------------------------------------- 
    1618 
    17 #if defined (CAMERA_g7) || (CAMERA_a640) 
    18 #define ROWPIX 3736   // for 10 MP 
    19 #define ROWS   2772   // for 10 MP 
    20  
    21 #elif defined (CAMERA_a630) 
    22 #define ROWPIX 3344   // for 8 MP 
    23 #define ROWS   2484   // for 8 MP 
    24  
    25 #elif defined (CAMERA_a620) || defined (CAMERA_a710) || defined (CAMERA_a560) || defined (CAMERA_a570) || defined (CAMERA_ixus700_sd500) || defined (CAMERA_ixus850_sd800) || defined (CAMERA_ixus70_sd1000) || defined(CAMERA_a550) 
    26 #define ROWPIX 3152   // for 7 MP 
    27 #define ROWS   2340   // for 7 MP 
    28  
    29 #elif defined (CAMERA_a700) || defined (CAMERA_s3is) || defined (CAMERA_ixus65_sd630) || defined (CAMERA_ixus800_sd700) 
    30 #define ROWPIX 2888   // for 6 MP 
    31 #define ROWS   2136   // for 6 MP 
    32  
    33 #elif defined (CAMERA_a610) || defined (CAMERA_s2is) || defined (CAMERA_ixus55_sd450) 
    34 #define ROWPIX 2672   // for 5 MP 
    35 #define ROWS   1968   // for 5 MP 
    36  
    37 #elif defined (CAMERA_a720) || defined (CAMERA_s5is) || defined (CAMERA_ixus950_sd850) 
    38 #define ROWPIX 3336   // for new 8 MP 
    39 #define ROWS   2480   // for new 8 MP 
    40  
    41 #elif defined (CAMERA_a650) 
    42 #define ROWPIX 4104   // for 12 MP 
    43 #define ROWS   3048   // for 12 MP 
    44  
    45 #elif defined (CAMERA_a460) 
    46 #define ROWPIX 2664   // for 5 MP 1/3" sensor size 
    47 #define ROWS   1968   // for 5 MP 1/3" sensor size 
    48  
    49 #else 
    50 #error camera type not defined 
    51  
    52 #endif 
    53  
    54 #define ROWLEN ((ROWPIX*10)/8) 
     19#define RAW_ROWLEN ((CAM_RAW_ROWPIX*10)/8) 
    5520 
    5621//------------------------------------------------------------------- 
  • trunk/core/raw_merge.c

    r254 r324  
    2121int raw_merge_start(int action){ 
    2222 unsigned int req, avail; 
    23  req=((ROWPIX*ROWS)>>18)+1; 
     23 req=((CAM_RAW_ROWPIX*CAM_RAW_ROWS)>>18)+1; 
    2424 avail=GetFreeCardSpaceKb()>>10; 
    2525 if (avail<req) { 
     
    3030 raw_action=action; 
    3131 raw_count=0; 
    32  row=malloc(ROWPIX*sizeof(unsigned short)); 
     32 row=malloc(CAM_RAW_ROWPIX*sizeof(unsigned short)); 
    3333 if (!row) return 0; 
    34  rawrow=malloc(ROWLEN); 
     34 rawrow=malloc(RAW_ROWLEN); 
    3535 if (!rawrow) { free(row); return 0;} 
    3636 return 1; 
     
    5454       fbrawout=fopen(TEMP_FILE_NAME_1,"w+b"); 
    5555        if (fbrawout){ 
    56          fread(rawrow, 1, ROWLEN, fcraw); 
    57          if (raw_count) fread(row, 1, ROWPIX*sizeof(unsigned short), fbrawin); else for (i=0;i<ROWPIX;i++) row[i]=0; 
     56         fread(rawrow, 1, RAW_ROWLEN, fcraw); 
     57         if (raw_count) fread(row, 1, CAM_RAW_ROWPIX*sizeof(unsigned short), fbrawin); else for (i=0;i<CAM_RAW_ROWPIX;i++) row[i]=0; 
    5858 
    59          for (nrow=0,j=0;nrow<ROWS;nrow++,j++){ 
     59         for (nrow=0,j=0;nrow<CAM_RAW_ROWS;nrow++,j++){ 
    6060          
    61          for (i=0,src=0; i<ROWPIX; i+=8, src+=10){ 
     61         for (i=0,src=0; i<CAM_RAW_ROWPIX; i+=8, src+=10){ 
    6262 
    6363           row[i+0]+=((0x3fc&(((unsigned short)rawrow[src+1])<<2)) | (rawrow[src+0] >> 6)); 
     
    7171           
    7272         } 
    73          fwrite(row, 1, ROWPIX*sizeof(unsigned short), fbrawout); 
    74          if (raw_count) fread(row, 1, ROWPIX*sizeof(unsigned short), fbrawin); else for (i=0;i<ROWPIX;i++) row[i]=0; 
    75          fread(rawrow, 1, ROWLEN, fcraw); 
    76          if (j>=ROWS/10) {j-=ROWS/10; gui_browser_progress_show(filename, nrow*100/ROWS);} 
     73         fwrite(row, 1, CAM_RAW_ROWPIX*sizeof(unsigned short), fbrawout); 
     74         if (raw_count) fread(row, 1, CAM_RAW_ROWPIX*sizeof(unsigned short), fbrawin); else for (i=0;i<CAM_RAW_ROWPIX;i++) row[i]=0; 
     75         fread(rawrow, 1, RAW_ROWLEN, fcraw); 
     76         if (j>=CAM_RAW_ROWS/10) {j-=CAM_RAW_ROWS/10; gui_browser_progress_show(filename, nrow*100/CAM_RAW_ROWS);} 
    7777       } 
    7878     raw_count++; 
     
    101101     fcraw=fopen(namebuf,"w+b"); 
    102102     if (fcraw) { 
    103         fread(row, 1, ROWPIX*sizeof(unsigned short), fbraw); 
    104         for (nrow=0,j=0;nrow<ROWS;nrow++,j++){ 
    105          for (i=0;i<ROWPIX;i++){ 
     103        fread(row, 1, CAM_RAW_ROWPIX*sizeof(unsigned short), fbraw); 
     104        for (nrow=0,j=0;nrow<CAM_RAW_ROWS;nrow++,j++){ 
     105         for (i=0;i<CAM_RAW_ROWPIX;i++){ 
    106106          if (raw_action==RAW_OPERATIOM_AVERAGE) row[i]/=raw_count; else { 
    107107           if (row[i]>BLACK_LEVEL*(raw_count-1)) row[i]-=BLACK_LEVEL*(raw_count-1); else row[i]=0; 
     
    110110        } 
    111111          
    112          for (i=0,src=0;i<ROWPIX;i+=8,src+=10) { 
     112         for (i=0,src=0;i<CAM_RAW_ROWPIX;i+=8,src+=10) { 
    113113            rawrow[src+0]=(row[i+0]<<6)|(row[i+1]>>4); 
    114114            rawrow[src+1]=(row[i+0]>>2); 
     
    122122            rawrow[src+9]=(row[i+6]<<2)|(row[i+7]>>8); 
    123123         } 
    124          fwrite(rawrow, 1, ROWLEN, fcraw); 
    125          fread(row, 1, ROWPIX*sizeof(unsigned short), fbraw); 
    126          if (j>=ROWS/5) {j-=ROWS/5; gui_browser_progress_show(namebuf, nrow*100/ROWS);} 
     124         fwrite(rawrow, 1, RAW_ROWLEN, fcraw); 
     125         fread(row, 1, CAM_RAW_ROWPIX*sizeof(unsigned short), fbraw); 
     126         if (j>=CAM_RAW_ROWS/5) {j-=CAM_RAW_ROWS/5; gui_browser_progress_show(namebuf, nrow*100/CAM_RAW_ROWS);} 
    127127        } 
    128128    fclose(fcraw); 
  • trunk/include/platform.h

    r323 r324  
    11#ifndef PLATFORM_H 
    22#define PLATFORM_H 
     3 
     4#include "camera.h" 
    35 
    46#define SSID_INVALID (-32767) 
     
    5254}; 
    5355 
    54 #if defined(CAMERA_a570) || defined(CAMERA_a560) || defined(CAMERA_a720) || defined (CAMERA_ixus70_sd1000) || defined (CAMERA_ixus950_sd850) || defined(CAMERA_a650) || defined(CAMERA_a460) || defined(CAMERA_a550) 
     56#if CAM_DIGIC3 
    5557 #define PROPCASE_DRIVE_MODE                                    102 
    5658 #define PROPCASE_FOCUS_MODE                                    133 
     
    7375 #define PROPCASE_SHOOTING_MODE                                 49 
    7476 
    75 #else 
     77#elif CAM_DIGIC2 
    7678 #define PROPCASE_DRIVE_MODE                                    6 
    7779 #define PROPCASE_FOCUS_MODE                                    12 
     
    9395 #define PROPCASE_OVEREXPOSURE                                  76 
    9496 #define PROPCASE_SHOOTING_MODE                                 0 
     97  
     98#else 
     99 #error unknown camera processor 
    95100#endif 
    96101 
     
    109114#define ASID_MIN (aperture_sizes_table[0].id) 
    110115#define ASID_MAX (aperture_sizes_table[AS_SIZE-1].id) 
    111  
    112 #if defined (CAMERA_g7) || defined (CAMERA_a710) || defined (CAMERA_s3is) || defined (CAMERA_a630) || defined (CAMERA_a640) || defined (CAMERA_a560) || defined (CAMERA_a570) || defined(CAMERA_a550) 
    113 #define CAMERA_MULTIPART 
    114 #endif 
    115116 
    116117/* Keyboard repeat and initial delays */ 
  • trunk/lib/ubasic/ubasic.c

    r323 r324  
    4646#include "platform.h" 
    4747#include "script.h" 
     48#include "camera.h" 
    4849#endif 
    4950#include "tokenizer.h" 
  • trunk/makefile.inc

    r323 r324  
    134134CFLAGS+=-mthumb-interwork 
    135135CFLAGS+=-I$(topdir)include $(PLFLAGS) $(CPPFLAGS) 
    136 CFLAGS+=-DPLATFORM=\"$(PLATFORM)\" -DPLATFORMSUB=\"$(PLATFORMSUB)\" -DHDK_VERSION=\"$(VER)\" -DBUILD_NUMBER=\"$(BUILD_NUMBER)\" -DCAMERA_$(PLATFORM) 
     136CFLAGS+=-DPLATFORM=\"$(PLATFORM)\" -DPLATFORMSUB=\"$(PLATFORMSUB)\" -DHDK_VERSION=\"$(VER)\" -DBUILD_NUMBER=\"$(BUILD_NUMBER)\" -DCAMERA_$(PLATFORM)=1 
    137137CFLAGS+=-Wall -Wno-unused -Wno-format 
    138138LDFLAGS=-L$(topdir)lib/math -L$(topdir)lib/font 
  • trunk/platform/generic/main.c

    r300 r324  
     1#include "camera.h" 
    12#include "lolevel.h" 
    23#include "platform.h" 
     
    101102        if (my_ncmp(name, "tInitFileM", 10) == 0){ 
    102103            init_file_modules_prev = (void*)(*entry); 
    103           #if defined (CAMERA_MULTIPART) 
     104          #if CAM_MULTIPART 
    104105            *entry = (long)init_file_modules_task; 
    105106          #else 
  • trunk/platform/generic/wrappers.c

    r316 r324  
     1#include "camera.h" 
    12#include "lolevel.h" 
    23#include "platform.h" 
     
    444445} 
    445446 
    446 #if defined(CAMERA_MULTIPART) 
     447#if CAM_MULTIPART 
    447448static char mbr_buf[512]; 
    448449static unsigned long drive_sectors; 
Note: See TracChangeset for help on using the changeset viewer.