Changeset 1719


Ignore:
Timestamp:
03/10/12 04:23:15 (16 months ago)
Author:
philmoz
Message:

Merged revision(s) 1712-1713 from branches/release-1_0:

Location:
trunk
Files:
40 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/CHDK/LANG/english.lng

    r1682 r1719  
    148148 
    149149106 "*** Build Info ***" 
    150 107 "CHDK Ver: %s %s\nDate:    %s\nTime:    %s\nCamera:  %s\nFW Vers: %s\nCompiler: %s" 
     150107 "CHDK Ver: %s %s\nRevision: %s\nDate:    %s\nTime:    %s\nCamera:  %s\nFW Vers: %s\nCompiler: %s" 
    151151 
    152152108 "*** Memory Info ***" 
  • trunk/CHDK/LANG/german.lng

    r1676 r1719  
    140140 
    141141106 "***Versions-Info***" 
    142 107 "CHDK Ver: %s %s\nDatum:    %s\nZeit:    %s\nKamera:  %s\nFW Vers: %s\nCompiler: %s" 
     142107 "CHDK-Ver: %s %s\nRevision: %s\nDatum:    %s\nZeit:     %s\nKamera:   %s\nFW-Vers: %s\nCompiler: %s" 
    143143 
    144144108 "***Speicher-Info***" 
  • trunk/Makefile

    r1689 r1719  
    22srcdir=./ 
    33 
     4include buildconf.inc 
     5tmp:=$(shell echo "BUILD_SVNREV := $(DEF_SVN_REF)" > revision.inc) 
     6 
    47include makefile.inc 
     8 
     9BUILD_SVNREV:=$(shell svnversion -cn $(topdir) | $(ESED) 's/[0-9]*:([0-9]+)[MPS]*/\1/') 
     10ifeq ($(BUILD_SVNREV), ) 
     11        BUILD_SVNREV:=$(DEF_SVN_REF) 
     12endif 
     13#for CHDK-Shell up to svn revision 1.6 
     14ifeq ($(BUILD_SVNREV), exported) 
     15        BUILD_SVNREV:=$(DEF_SVN_REF) 
     16endif 
     17ifeq ($(BUILD_SVNREV), exportiert) 
     18        BUILD_SVNREV:=$(DEF_SVN_REF) 
     19endif 
     20#for CHDK-Shell svn revision 1.7 
     21ifeq ($(BUILD_SVNREV), Unversioned directory) 
     22        BUILD_SVNREV:=$(DEF_SVN_REF) 
     23endif 
     24tmp:=$(shell echo "BUILD_SVNREV := $(BUILD_SVNREV)" > revision.inc) 
    525 
    626SUBDIRS=tools lib platform core loader CHDK 
     
    1131 
    1232firsub: all 
    13         mkdir -p  $(topdir)bin 
     33        mkdir -p $(topdir)bin 
    1434        mkdir -p  $(topdir)CHDK/MODULES 
    1535        cp $(topdir)loader/$(PLATFORM)/main.bin $(topdir)bin/main.bin 
    16 ifndef NOZERO100K 
    17 ifeq ($(OSTYPE),Windows) 
    18         zero | dd bs=1k count=100 >> $(topdir)bin/main.bin 2> $(DEVNULL) 
    19 else 
    20         dd if=/dev/zero bs=1k count=100 >> $(topdir)bin/main.bin 2> $(DEVNULL) 
    21 endif 
    22 endif 
    23 ifdef PLATFORMOS 
    24   ifeq ($(PLATFORMOS),vxworks) 
    25         @echo \-\> PS.FIR 
    26         $(PAKWIF) $(topdir)bin/PS.FIR $(topdir)bin/main.bin $(PLATFORMID) 0x01000101 
    27   endif 
    28   ifeq ($(PLATFORMOS),dryos) 
    29 ifdef OPT_FI2 
    30   ifdef FI2KEY 
    31                 @echo \-\> PS.FI2 
    32                 $(PAKFI2)  $(topdir)bin/main.bin -p $(PLATFORMID) -key $(FI2KEY) -iv $(FI2IV) $(topdir)bin/PS.FI2 
    33   else 
    34                 @echo WARNING OPT_FI2 set but FI2KEY is not! please read platform/fi2.inc.txt 
    35   endif 
    36 endif 
    37   endif 
    38 endif 
    39 ifdef NEED_ENCODED_DISKBOOT 
    40         @echo dance \-\> DISKBOOT.BIN ver $(NEED_ENCODED_DISKBOOT) 
    41         $(ENCODE_DISKBOOT) $(topdir)bin/main.bin  $(topdir)bin/DISKBOOT.BIN $(NEED_ENCODED_DISKBOOT) 
    42         rm $(topdir)bin/main.bin 
    43 else 
    44         mv $(topdir)bin/main.bin  $(topdir)bin/DISKBOOT.BIN 
    45 endif 
     36    ifndef NOZERO100K 
     37        ifeq ($(OSTYPE),Windows) 
     38                        zero | dd bs=1k count=100 >> $(topdir)bin/main.bin 2> $(DEVNULL) 
     39        else 
     40                        dd if=/dev/zero bs=1k count=100 >> $(topdir)bin/main.bin 2> $(DEVNULL) 
     41        endif 
     42    endif 
     43    ifdef PLATFORMOS 
     44        ifeq ($(PLATFORMOS),vxworks) 
     45                        @echo \-\> PS.FIR 
     46                        $(PAKWIF) $(topdir)bin/PS.FIR $(topdir)bin/main.bin $(PLATFORMID) 0x01000101 
     47        endif 
     48        ifeq ($(PLATFORMOS),dryos) 
     49            ifdef OPT_FI2 
     50                ifdef FI2KEY 
     51                                        @echo \-\> PS.FI2 
     52                                        $(PAKFI2)  $(topdir)bin/main.bin -p $(PLATFORMID) -key $(FI2KEY) -iv $(FI2IV) $(topdir)bin/PS.FI2 
     53                else 
     54                                        @echo WARNING OPT_FI2 set but FI2KEY is not! please read platform/fi2.inc.txt 
     55                endif 
     56            endif 
     57        endif 
     58    endif 
     59    ifdef NEED_ENCODED_DISKBOOT 
     60                @echo dance \-\> DISKBOOT.BIN ver $(NEED_ENCODED_DISKBOOT) 
     61                $(ENCODE_DISKBOOT) $(topdir)bin/main.bin  $(topdir)bin/DISKBOOT.BIN $(NEED_ENCODED_DISKBOOT)  
     62                rm $(topdir)bin/main.bin 
     63    else 
     64                mv $(topdir)bin/main.bin  $(topdir)bin/DISKBOOT.BIN 
     65    endif 
    4666        rm -f $(topdir)CHDK/MODULES/* 
    4767        cp $(topdir)core/modules/*.flt $(topdir)CHDK/MODULES 
     
    5777 
    5878infoline: 
    59         @echo "**** GCC $(GCC_VERSION) : BUILDING CHDK-$(VER), #$(BUILD_NUMBER)$(STATE) FOR $(PLATFORM)-$(PLATFORMSUB)" 
     79        @echo "**** GCC $(GCC_VERSION) : BUILDING CHDK-$(VER), #$(BUILD_NUMBER)$(STATE) FOR $(PLATFORM)-$(PLATFORMSUB)-$(BUILD_SVNREV)" 
    6080 
    6181.PHONY: version 
     
    7797                zip -9jz $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/DISKBOOT.BIN > $(DEVNULL) 
    7898    ifdef PLATFORMOS 
    79       ifeq ($(PLATFORMOS),vxworks) 
    80                 zip -9j $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/PS.FIR > $(DEVNULL) 
    81                 rm -f $(topdir)bin/PS.FIR 
    82       endif 
    83       ifeq ($(PLATFORMOS),dryos) 
    84         ifdef OPT_FI2 
    85           ifdef FI2KEY 
    86                         zip -9j $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/PS.FI2 > $(DEVNULL) 
    87                         rm -f $(topdir)bin/PS.FI2 
    88           endif 
    89         endif 
    90       endif 
     99        ifeq ($(PLATFORMOS),vxworks) 
     100                        zip -9j $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/PS.FIR > $(DEVNULL) 
     101                        rm -f $(topdir)bin/PS.FIR 
     102        endif 
     103        ifeq ($(PLATFORMOS),dryos) 
     104            ifdef OPT_FI2 
     105                ifdef FI2KEY 
     106                                        zip -9j $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/PS.FI2 > $(DEVNULL) 
     107                                        rm -f $(topdir)bin/PS.FI2 
     108                endif 
     109            endif 
     110        endif 
    91111    endif 
    92112        zip -9 $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)CHDK/MODULES/* 
    93         # if COPY_TO is defined then copy this camera/firmware version to the copied firmware version 
    94         # Define COPY_TO in $(topdir)/platform/$(PLATFORM)/sub/$(PLATFORMSUB)/makefile.inc of the source 
    95         # firmware version that needs to be copied to another firmware version 
     113    # if COPY_TO is defined then copy this camera/firmware version to the copied firmware version 
     114    # Define COPY_TO in $(topdir)/platform/$(PLATFORM)/sub/$(PLATFORMSUB)/makefile.inc of the source 
     115    # firmware version that needs to be copied to another firmware version 
    96116        # For the case where one CHDK version applies to two or more other Canon firmware version place all the 
    97117        # 'copy to' firmware versions together seperated by ':' - e.g. "a2000,100c,BETA,100a:100b," 
     
    125145        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/LUALIB/GEN/*   > $(DEVNULL) 
    126146        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/*  > $(DEVNULL) 
    127         zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/EXAM/*     > $(DEVNULL) 
    128         zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/TEST/*     > $(DEVNULL) 
     147        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/EXAM/*     > $(DEVNULL) 
     148        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/TEST/*     > $(DEVNULL) 
    129149        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/EDITOR/*   > $(DEVNULL) 
    130         zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/syscurves.CVF     > $(DEVNULL) 
     150        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/syscurves.CVF     > $(DEVNULL) 
    131151        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)doc/changelog.txt  > $(DEVNULL) 
    132152        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)doc/changelog.txt  > $(DEVNULL) 
     
    139159 
    140160    ifdef PLATFORMOS 
    141       ifeq ($(PLATFORMOS),vxworks) 
    142                 zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)bin/PS.FIR > $(DEVNULL) 
    143                 zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/PS.FIR > $(DEVNULL) 
    144                 rm -f $(topdir)bin/PS.FIR 
    145       endif 
    146       ifeq ($(PLATFORMOS),dryos) 
    147         ifdef OPT_FI2 
    148           ifdef FI2KEY 
    149                         zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)bin/PS.FI2 > $(DEVNULL) 
    150                         zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/PS.FI2 > $(DEVNULL) 
    151                         rm -f $(topdir)bin/PS.FI2 
    152           endif 
    153         endif 
    154       endif 
    155     endif 
    156         # if COPY_TO is defined then copy this camera/firmware version to the copied firmware version 
    157         # Define COPY_TO in $(topdir)/platform/$(PLATFORM)/sub/$(PLATFORMSUB)/makefile.inc of the source 
    158         # firmware version that needs to be copied to another firmware version 
     161        ifeq ($(PLATFORMOS),vxworks) 
     162                        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)bin/PS.FIR > $(DEVNULL) 
     163                        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/PS.FIR > $(DEVNULL) 
     164                        rm -f $(topdir)bin/PS.FIR 
     165        endif 
     166        ifeq ($(PLATFORMOS),dryos) 
     167            ifdef OPT_FI2 
     168                ifdef FI2KEY 
     169                                        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)bin/PS.FI2 > $(DEVNULL) 
     170                                        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/PS.FI2 > $(DEVNULL) 
     171                                        rm -f $(topdir)bin/PS.FI2 
     172                endif 
     173            endif 
     174        endif 
     175    endif 
     176    # if COPY_TO is defined then copy this camera/firmware version to the copied firmware version 
     177    # Define COPY_TO in $(topdir)/platform/$(PLATFORM)/sub/$(PLATFORMSUB)/makefile.inc of the source 
     178    # firmware version that needs to be copied to another firmware version 
    159179        # For the case where one CHDK version applies to two or more other Canon firmware version place all the 
    160180        # 'copy to' firmware versions together seperated by ':' - e.g. "a2000,100c,BETA,100a:100b," 
  • trunk/buildconf.inc

    r1689 r1719  
    11#!build time optional components - comment out the features you dont want to have in your build or copy this file to localbuildconf.inc and override settings there 
    2  
    32OPT_GAMES=1 
    43OPT_CURVES=1 
     
    76OPT_DEBUGGING=1 
    87OPT_EDGEOVERLAY=1 
    9 # experimental PTP/USB interface. Enabled/disabled for individual cameras in camera.h 
    10 OPT_PTP=1 
    118 
    129# Scripting components 
     
    3128#OPT_EXMEM_TESTING=1 
    3229 
     30# experimental PTP/USB interface 
     31OPT_PTP=1 
     32 
    3333#OPT_MD_DEBUG=1 
    34 # require correct FI2 keys in platform/fi2.inc , see http://chdk.wikia.com/wiki/For_Developers/fi2offsets and http://chdk.setepontos.com/index.php/topic,2995.0.html 
     34# needs proper fi2.inc in platform/ !!! see http://chdk.setepontos.com/index.php/topic,2995.0.html 
    3535#OPT_FI2=1 
    3636# if enabled, compiler will produce a lot of warnings, maybe not always correct ones, see http://chdk.setepontos.com/index.php/topic,2509.msg32191.html#msg32191 
     
    5050# Set the value to the language file name without extension - e.g. OPT_DEFAULT_LANG=russian 
    5151#OPT_DEFAULT_LANG= 
     52 
     53# Default svn revsion. Used when svnversion fail. 
     54DEF_SVN_REF=0 
  • trunk/core/Makefile

    r1689 r1719  
    6666     gui_lang.o modules.o module_load.o \ 
    6767     levent.o shot_histogram.o console.o shooting.o \ 
    68      usb_input.o usb_module.o usb_remote.o $(OPT_OBJS) 
     68     usb_input.o usb_module.o usb_remote.o gps_math.o gps.o $(OPT_OBJS) 
    6969 
    7070gui.o: FORCE 
  • trunk/core/conf.c

    r1682 r1719  
    1111#include "gui_osd.h" 
    1212#include "gui_grid.h" 
     13#include "gui_lang.h" 
    1314#include "core.h" 
    1415#include "stdlib.h" 
     
    1718 
    1819//------------------------------------------------------------------- 
    19 #define CONF_FILE  "A/CHDK/CCHDK.CFG" 
     20#define CONF_FILE  "A/CHDK/CCHDK2.CFG" 
    2021#define CONF_MAGICK_VALUE   (0x33204741) 
    2122 
     
    4243static void conf_change_video_bitrate(); 
    4344static void conf_change_dng_ext(); 
     45static void conf_change_autoiso(); 
     46extern void cb_autoiso_menu_change(unsigned int item); 
    4447 
    4548void camera_set_raw(int mode) 
     
    7881    if (conf.platformid != PLATFORMID) // the following config entries will be resetted if you switch the camera using the same cfg 
    7982    { 
    80         conf.raw_cache = 0; 
    81         conf.zoom_override_value = 0; 
    82         conf.fast_ev = 0; 
    83         conf.fast_movie_control = 0; 
    84         conf.fast_movie_quality_control = 0; 
    85         conf.zoom_scale = 100; 
    86         conf.platformid = PLATFORMID; 
    87         conf.flash_video_override = 0; 
     83    conf.raw_cache = 0; 
     84#if ZOOM_OVERRIDE 
     85    conf.zoom_override_value = 0; 
     86#endif 
     87    conf.fast_ev = 0; 
     88    conf.fast_movie_control = 0; 
     89    conf.fast_movie_quality_control = 0; 
     90    conf.zoom_scale = 100; 
     91    conf.platformid = PLATFORMID; 
     92    conf.flash_video_override = 0; 
    8893    } 
    8994 
     
    96101        conf.nd_filter_state=0; 
    97102    } 
     103#if ZOOM_OVERRIDE 
    98104    if (conf.clear_zoom_override) 
    99105    { 
    100106        conf.zoom_override = 0; 
    101107    } 
     108#endif 
    102109    if (conf.clear_bracket) 
    103110    { 
     
    150157    CONF_INFO( 27, conf.histo_color,            CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_WHITE), NULL), 
    151158    CONF_INFO( 28, conf.osd_color,              CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_FG), NULL), 
    152     CONF_INFO( 29, conf.batt_icon_color,        CONF_DEF_VALUE, cl:COLOR_WHITE, NULL), 
     159//    CONF_INFO( 29, conf.batt_icon_color,        CONF_DEF_VALUE, cl:COLOR_WHITE, NULL), 
    153160    CONF_INFO( 30, conf.menu_color,             CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_FG), NULL), 
    154     //CONF_INFO( 31, conf.reader_color,           CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_GREY, COLOR_WHITE), NULL),    // moved to text reader module 
     161//    CONF_INFO( 31, conf.reader_color,           CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_GREY, COLOR_WHITE), NULL),    // moved to text reader module 
    155162    CONF_INFO( 32, conf.ricoh_ca1_mode,         CONF_DEF_VALUE, i:0, NULL), 
    156163    CONF_INFO( 33, conf.flashlight,             CONF_DEF_VALUE, i:0, NULL), 
     
    187194    CONF_INFO( 63, conf.alt_mode_button,        CONF_DEF_VALUE, i:KEY_PRINT, conf_change_alt_mode_button), 
    188195    CONF_INFO( 64, conf.lang_file,              CONF_CHAR_PTR,   ptr:"", NULL), 
    189     CONF_INFO( 65, conf.font_cp,                CONF_DEF_VALUE, i:FONT_CP_WIN_1251, conf_change_font_cp), 
     196#if defined(VER_CHDK) 
     197    CONF_INFO( 65, conf.font_cp,                    CONF_DEF_VALUE,     i:FONT_CP_WIN_1251, conf_change_font_cp), 
     198#else   // CHDK-DE 
     199    CONF_INFO( 65, conf.font_cp,                    CONF_DEF_VALUE,     i:FONT_CP_WIN_1252, conf_change_font_cp), 
     200#endif 
    190201    CONF_INFO( 66, conf.menu_rbf_file,          CONF_CHAR_PTR,   ptr:"", conf_change_menu_rbf_file), 
    191202    CONF_INFO( 67, conf.alt_prevent_shutdown,   CONF_DEF_VALUE, i:ALT_PREVENT_SHUTDOWN_ALT, conf_update_prevent_shutdown), 
     
    196207    //CONF_INFO( 72, conf.grid_color,             CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_FG), NULL),         // moved to grid module 
    197208 
    198     CONF_INFO( 80, conf.dof_subj_dist_as_near_limit,CONF_DEF_VALUE, i:0, NULL), 
    199     CONF_INFO( 81, conf.dof_use_exif_subj_dist,     CONF_DEF_VALUE, i:0, NULL), 
    200     CONF_INFO( 82, conf.dof_subj_dist_in_misc,      CONF_DEF_VALUE, i:1, NULL), 
    201     CONF_INFO( 83, conf.dof_near_limit_in_misc,     CONF_DEF_VALUE, i:1, NULL), 
    202     CONF_INFO( 84, conf.dof_far_limit_in_misc,      CONF_DEF_VALUE, i:1, NULL), 
    203     CONF_INFO( 85, conf.dof_hyperfocal_in_misc,     CONF_DEF_VALUE, i:1, NULL), 
    204     CONF_INFO( 86, conf.dof_depth_in_misc,          CONF_DEF_VALUE, i:0, NULL), 
    205  
    206         CONF_INFO( 87, conf.values_show_in_review,    CONF_DEF_VALUE, i:0, NULL), 
    207     CONF_INFO( 88, conf.values_show_zoom,         CONF_DEF_VALUE, i:1, NULL), 
    208     CONF_INFO( 89, conf.values_show_real_aperture,CONF_DEF_VALUE, i:0, NULL), 
    209     CONF_INFO( 90, conf.values_show_real_iso,     CONF_DEF_VALUE, i:1, NULL), 
    210     CONF_INFO( 91, conf.values_show_market_iso,   CONF_DEF_VALUE, i:0, NULL), 
     209    CONF_INFO( 80, conf.dof_subj_dist_as_near_limit,CONF_DEF_VALUE,     i:0, NULL), 
     210    CONF_INFO( 81, conf.dof_use_exif_subj_dist,     CONF_DEF_VALUE,     i:0, NULL), 
     211    CONF_INFO( 82, conf.dof_subj_dist_in_misc,      CONF_DEF_VALUE,     i:1, NULL), 
     212    CONF_INFO( 83, conf.dof_near_limit_in_misc,     CONF_DEF_VALUE,     i:1, NULL), 
     213    CONF_INFO( 84, conf.dof_far_limit_in_misc,      CONF_DEF_VALUE,     i:1, NULL), 
     214    CONF_INFO( 85, conf.dof_hyperfocal_in_misc,     CONF_DEF_VALUE,     i:1, NULL), 
     215    CONF_INFO( 86, conf.dof_depth_in_misc,          CONF_DEF_VALUE,     i:0, NULL), 
     216 
     217    CONF_INFO( 87, conf.values_show_in_review,      CONF_DEF_VALUE,    i:0, NULL), 
     218    CONF_INFO( 88, conf.values_show_zoom,           CONF_DEF_VALUE,    i:1, NULL), 
     219    CONF_INFO( 89, conf.values_show_real_aperture,  CONF_DEF_VALUE,    i:0, NULL), 
     220    CONF_INFO( 90, conf.values_show_real_iso,       CONF_DEF_VALUE,    i:1, NULL), 
     221    CONF_INFO( 91, conf.values_show_market_iso,     CONF_DEF_VALUE,    i:0, NULL), 
    211222    CONF_INFO( 92, conf.values_show_iso_only_in_autoiso_mode, CONF_DEF_VALUE, i:0, NULL), 
    212     CONF_INFO( 93, conf.values_show_ev_seted,     CONF_DEF_VALUE, i:0, NULL), 
    213     CONF_INFO( 94, conf.values_show_ev_measured,  CONF_DEF_VALUE, i:0, NULL), 
    214     CONF_INFO( 95, conf.values_show_bv_measured,  CONF_DEF_VALUE, i:0, NULL), 
    215     CONF_INFO( 96, conf.values_show_bv_seted,     CONF_DEF_VALUE, i:0, NULL), 
    216     CONF_INFO( 97, conf.values_show_overexposure, CONF_DEF_VALUE, i:0, NULL), 
    217     CONF_INFO( 98, conf.values_show_luminance,    CONF_DEF_VALUE, i:0, NULL), 
    218  
    219     CONF_INFO( 99, conf.video_mode,             CONF_DEF_VALUE, i:0, NULL), 
    220     CONF_INFO(100, conf.video_quality,          CONF_DEF_VALUE, i:VIDEO_DEFAULT_QUALITY,NULL), 
    221     CONF_INFO(101, conf.video_bitrate,          CONF_DEF_VALUE, i:VIDEO_DEFAULT_BITRATE, conf_change_video_bitrate), 
    222      
    223     CONF_INFO(102, conf.tv_override_value,      CONF_DEF_VALUE, i:0, NULL),      
    224     CONF_INFO(103, conf.tv_override_koef,       CONF_DEF_VALUE, i:0, NULL),      
    225  
    226     CONF_INFO(104, conf.av_override_value,      CONF_DEF_VALUE, i:0, NULL), 
    227     CONF_INFO(105, conf.iso_override_value,     CONF_DEF_VALUE, i:0, NULL), 
    228     CONF_INFO(106, conf.iso_override_koef,      CONF_DEF_VALUE, i:0, NULL), 
    229      
    230     CONF_INFO(107, conf.subj_dist_override_value,CONF_DEF_VALUE, i:0, NULL), 
    231     CONF_INFO(108, conf.subj_dist_override_koef, CONF_DEF_VALUE, i:0, NULL), 
    232      
    233     CONF_INFO(109, conf.tv_bracket_value,       CONF_DEF_VALUE, i:0, NULL), 
    234     CONF_INFO(110, conf.av_bracket_value,       CONF_DEF_VALUE, i:0, NULL), 
    235     CONF_INFO(111, conf.iso_bracket_value,      CONF_DEF_VALUE, i:0, NULL), 
    236     CONF_INFO(112, conf.iso_bracket_koef,       CONF_DEF_VALUE, i:0, NULL), 
    237     CONF_INFO(113, conf.subj_dist_bracket_value,CONF_DEF_VALUE, i:0, NULL), 
    238     CONF_INFO(114, conf.subj_dist_bracket_koef, CONF_DEF_VALUE, i:0, NULL), 
    239     CONF_INFO(115, conf.bracket_type,           CONF_DEF_VALUE, i:0, NULL), 
    240      
    241     CONF_INFO(116, conf.recalc_exposure,        CONF_DEF_VALUE, i:0, NULL), 
    242     CONF_INFO(117, conf.tv_exposure_order,      CONF_DEF_VALUE, i:2, NULL), 
    243     CONF_INFO(118, conf.av_exposure_order,      CONF_DEF_VALUE, i:1, NULL), 
    244     CONF_INFO(119, conf.iso_exposure_order,     CONF_DEF_VALUE, i:3, NULL), 
    245      
    246     CONF_INFO(120, conf.script_startup,         CONF_DEF_VALUE, i:0, NULL), 
    247     CONF_INFO(121, conf.remote_enable,          CONF_DEF_VALUE, i:0, NULL), 
     223    CONF_INFO( 93, conf.values_show_ev_seted,       CONF_DEF_VALUE,    i:0, NULL), 
     224    CONF_INFO( 94, conf.values_show_ev_measured,    CONF_DEF_VALUE,    i:0, NULL), 
     225    CONF_INFO( 95, conf.values_show_bv_measured,    CONF_DEF_VALUE,    i:0, NULL), 
     226    CONF_INFO( 96, conf.values_show_bv_seted,       CONF_DEF_VALUE,    i:0, NULL), 
     227    CONF_INFO( 97, conf.values_show_overexposure,   CONF_DEF_VALUE,    i:0, NULL), 
     228    CONF_INFO( 98, conf.values_show_luminance,      CONF_DEF_VALUE,    i:0, NULL), 
     229 
     230    CONF_INFO( 99, conf.video_mode,                 CONF_DEF_VALUE,    i:0, NULL), 
     231    CONF_INFO(100, conf.video_quality,              CONF_DEF_VALUE,    i:VIDEO_DEFAULT_QUALITY,NULL), 
     232    CONF_INFO(101, conf.video_bitrate,              CONF_DEF_VALUE,    i:VIDEO_DEFAULT_BITRATE, conf_change_video_bitrate), 
     233     
     234    CONF_INFO(102, conf.tv_override_value,          CONF_DEF_VALUE,     i:0, NULL), 
     235    CONF_INFO(103, conf.tv_override_koef,           CONF_DEF_VALUE,     i:0, NULL), 
     236 
     237    CONF_INFO(104, conf.av_override_value,          CONF_DEF_VALUE,    i:0, NULL), 
     238    CONF_INFO(105, conf.iso_override_value,         CONF_DEF_VALUE,    i:0, NULL), 
     239    CONF_INFO(106, conf.iso_override_koef,          CONF_DEF_VALUE,    i:0, NULL), 
     240     
     241    CONF_INFO(107, conf.subj_dist_override_value,   CONF_DEF_VALUE,    i:0, NULL), 
     242    CONF_INFO(108, conf.subj_dist_override_koef,    CONF_DEF_VALUE,    i:0, NULL), 
     243     
     244    CONF_INFO(109, conf.tv_bracket_value,           CONF_DEF_VALUE,    i:0, NULL), 
     245    CONF_INFO(110, conf.av_bracket_value,           CONF_DEF_VALUE,    i:0, NULL), 
     246    CONF_INFO(111, conf.iso_bracket_value,          CONF_DEF_VALUE,    i:0, NULL), 
     247    CONF_INFO(112, conf.iso_bracket_koef,           CONF_DEF_VALUE,    i:0, NULL), 
     248    CONF_INFO(113, conf.subj_dist_bracket_value,    CONF_DEF_VALUE,    i:0, NULL), 
     249    CONF_INFO(114, conf.subj_dist_bracket_koef,     CONF_DEF_VALUE,    i:0, NULL), 
     250    CONF_INFO(115, conf.bracket_type,               CONF_DEF_VALUE,    i:0, NULL), 
     251 
     252//    CONF_INFO(116, conf.recalc_exposure,            CONF_DEF_VALUE,    i:0, NULL), 
     253//    CONF_INFO(117, conf.tv_exposure_order,          CONF_DEF_VALUE,    i:2, NULL), 
     254//    CONF_INFO(118, conf.av_exposure_order,          CONF_DEF_VALUE,    i:1, NULL), 
     255//    CONF_INFO(119, conf.iso_exposure_order,         CONF_DEF_VALUE,    i:3, NULL), 
     256 
     257    CONF_INFO(120, conf.script_startup,             CONF_DEF_VALUE,    i:0, NULL), 
     258    CONF_INFO(121, conf.remote_enable,              CONF_DEF_VALUE,    i:0, NULL), 
    248259     
    249260    CONF_INFO(122, conf.values_show_canon_overexposure, CONF_DEF_VALUE, i:0, NULL), 
    250     CONF_INFO(123, conf.clear_override,         CONF_DEF_VALUE, i:1, NULL), 
    251      
    252     CONF_INFO(124, conf.show_osd_in_review,     CONF_DEF_VALUE, i:0, NULL), 
    253      
    254     CONF_INFO(125, conf.dof_dist_from_lens,     CONF_DEF_VALUE, i:0, NULL), 
    255      
    256     CONF_INFO(126, conf.clear_bracket,          CONF_DEF_VALUE, i:1, NULL), 
    257     //CONF_INFO(127, conf.zebra_multichannel,     CONF_DEF_VALUE, i:0, NULL),                                       // moved to zebra module 
    258  
    259     CONF_INFO(128, conf.nd_filter_state,        CONF_DEF_VALUE, i:0, NULL), 
    260     CONF_INFO(129, conf.histo_show_ev_grid,     CONF_DEF_VALUE, i:0, NULL), 
    261      
    262     CONF_INFO(130, conf.osd_color_warn,         CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_RED), NULL), 
    263     CONF_INFO(131, conf.space_color,            CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_FG), NULL), 
    264     CONF_INFO(132, conf.space_icon_show,        CONF_DEF_VALUE, i:0, NULL), 
    265     CONF_INFO2(133, conf.space_icon_pos,        CONF_OSD_POS,   CAM_SCREEN_WIDTH-100,0), 
    266     CONF_INFO(134, conf.space_perc_show,        CONF_DEF_VALUE, i:0, NULL), 
    267     CONF_INFO(135, conf.space_mb_show,          CONF_DEF_VALUE, i:1, NULL), 
    268     CONF_INFO2(136, conf.space_txt_pos,         CONF_OSD_POS,   128,0), 
    269     CONF_INFO(137, conf.show_remaining_raw,     CONF_DEF_VALUE, i:1, NULL), 
    270     CONF_INFO2(138, conf.mode_raw_pos,          CONF_OSD_POS,   CAM_SCREEN_WIDTH-7*FONT_WIDTH-2,CAM_SCREEN_HEIGHT-3*FONT_HEIGHT-2), 
    271     CONF_INFO(139, conf.show_raw_state,         CONF_DEF_VALUE, i:1, NULL), 
    272      
    273     CONF_INFO(140, conf.show_values_in_video,   CONF_DEF_VALUE, i:0, NULL), 
    274     CONF_INFO(141, conf.tv_enum_type,           CONF_DEF_VALUE, i:1, NULL), 
     261    CONF_INFO(123, conf.clear_override,             CONF_DEF_VALUE,    i:1, NULL), 
     262     
     263    CONF_INFO(124, conf.show_osd_in_review,         CONF_DEF_VALUE,    i:0, NULL), 
     264     
     265//    CONF_INFO(125, conf.dof_dist_from_lens,         CONF_DEF_VALUE,    i:0, NULL), 
     266     
     267    CONF_INFO(126, conf.clear_bracket,              CONF_DEF_VALUE,    i:1, NULL), 
     268    //CONF_INFO(127, conf.zebra_multichannel,         CONF_DEF_VALUE,     i:0, NULL),                               // moved to zebra module 
     269     
     270    CONF_INFO(128, conf.nd_filter_state,            CONF_DEF_VALUE,    i:0, NULL), 
     271    CONF_INFO(129, conf.histo_show_ev_grid,         CONF_DEF_VALUE,    i:0, NULL), 
     272     
     273    CONF_INFO(130, conf.osd_color_warn,             CONF_DEF_VALUE,    cl:MAKE_COLOR(COLOR_BG, COLOR_RED), NULL), 
     274    CONF_INFO(131, conf.space_color,                CONF_DEF_VALUE,    cl:MAKE_COLOR(COLOR_BG, COLOR_FG), NULL), 
     275    CONF_INFO(132, conf.space_icon_show,            CONF_DEF_VALUE,    i:0, NULL), 
     276    CONF_INFO2(133, conf.space_icon_pos,            CONF_OSD_POS,       CAM_SCREEN_WIDTH-100,0), 
     277    CONF_INFO(134, conf.space_perc_show,            CONF_DEF_VALUE,    i:0, NULL), 
     278    CONF_INFO(135, conf.space_mb_show,              CONF_DEF_VALUE,    i:1, NULL), 
     279    CONF_INFO2(136, conf.space_txt_pos,             CONF_OSD_POS,       128,0), 
     280    CONF_INFO(137, conf.show_remaining_raw,         CONF_DEF_VALUE,    i:1, NULL), 
     281    CONF_INFO2(138, conf.mode_raw_pos,              CONF_OSD_POS,       CAM_SCREEN_WIDTH-7*FONT_WIDTH-2,CAM_SCREEN_HEIGHT-3*FONT_HEIGHT-2), 
     282    CONF_INFO(139, conf.show_raw_state,             CONF_DEF_VALUE,    i:1, NULL), 
     283     
     284    CONF_INFO(140, conf.show_values_in_video,       CONF_DEF_VALUE,    i:0, NULL), 
     285    CONF_INFO(141, conf.tv_enum_type,               CONF_DEF_VALUE,    i:1, NULL), 
    275286 
    276287    CONF_INFO(142, conf.user_menu_enable,       CONF_DEF_VALUE, i:0, NULL), 
     
    291302    CONF_INFO(157, conf.clock_halfpress,        CONF_DEF_VALUE, i:1, NULL), 
    292303     
    293     CONF_INFO(158, conf.autoiso_enable,         CONF_DEF_VALUE, i:0, NULL), 
    294     CONF_INFO(159, conf.autoiso_shutter,        CONF_DEF_VALUE, i:0, NULL), 
    295     CONF_INFO(160, conf.autoiso_user_factor,    CONF_DEF_VALUE, i:5, NULL), 
    296     CONF_INFO(161, conf.autoiso_is_factor,      CONF_DEF_VALUE, i:2, NULL), 
    297     CONF_INFO(162, conf.autoiso_max_iso_hi,     CONF_DEF_VALUE, i:55, NULL), 
    298     CONF_INFO(163, conf.autoiso_max_iso_auto,   CONF_DEF_VALUE, i:35, NULL), 
    299     CONF_INFO(164, conf.autoiso_min_iso,        CONF_DEF_VALUE, i:5, NULL), 
    300  
    301     CONF_INFO(165, conf.menu_title_color,       CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_WHITE, COLOR_BLACK), NULL), 
    302     CONF_INFO(166, conf.menu_cursor_color,      CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_SELECTED_BG, COLOR_SELECTED_FG), NULL), 
    303     CONF_INFO(167, conf.menu_center,            CONF_DEF_VALUE, i:1, NULL), 
    304     CONF_INFO(168, conf.mute_on_zoom,           CONF_DEF_VALUE, i:0, NULL),  
    305     CONF_INFO(169, conf.bad_pixel_removal,      CONF_DEF_VALUE, i:0, NULL), 
    306     CONF_INFO(170, conf.video_af_key,           CONF_DEF_VALUE, i:0, NULL), 
    307     CONF_INFO(171, conf.osd_color_override,     CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_RED), NULL), 
    308     CONF_INFO(172, conf.override_disable,       CONF_DEF_VALUE, i:2, NULL), 
    309     CONF_INFO(173, conf.override_disable_all,   CONF_DEF_VALUE, i:1, NULL), 
    310     CONF_INFO(174, conf.hide_osd,   CONF_DEF_VALUE, i:1, NULL), 
    311     CONF_INFO(175, conf.save_raw_in_video,      CONF_DEF_VALUE, i:1, NULL), 
    312     CONF_INFO(176, conf.show_movie_time,        CONF_DEF_VALUE, i:3, NULL), 
    313     CONF_INFO(177, conf.show_movie_refresh,     CONF_DEF_VALUE, i:1, NULL), 
    314     CONF_INFO2(178, conf.mode_video_pos,        CONF_OSD_POS,   CAM_SCREEN_WIDTH-25*FONT_WIDTH-2,CAM_SCREEN_HEIGHT-6*FONT_HEIGHT-2), 
    315     CONF_INFO(179, conf.clear_video,            CONF_DEF_VALUE, i:0, NULL), 
    316     CONF_INFO(180, conf.fast_ev,                CONF_DEF_VALUE, i:0, NULL), 
    317     CONF_INFO(181, conf.fast_ev_step,           CONF_DEF_VALUE, i:1, NULL), 
    318     CONF_INFO2(182, conf.mode_ev_pos,           CONF_OSD_POS,   CAM_SCREEN_WIDTH-40*FONT_WIDTH-2,CAM_SCREEN_HEIGHT-8*FONT_HEIGHT-2), 
    319     CONF_INFO(183, conf.menu_symbol_rbf_file,   CONF_CHAR_PTR,   ptr:DEFAULT_SYMBOL_FILE, conf_change_menu_symbol_rbf_file), 
    320     CONF_INFO(184, conf.menu_symbol_color,      CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_FG), NULL), 
    321     CONF_INFO(185, conf.curve_file,             CONF_CHAR_PTR, ptr:"", NULL), 
    322     CONF_INFO(186, conf.curve_enable,           CONF_DEF_VALUE, i:0, NULL), 
    323     CONF_INFO(187, conf.edge_overlay_enable,    CONF_DEF_VALUE, i:0, NULL), 
    324     CONF_INFO(188, conf.edge_overlay_thresh,    CONF_DEF_VALUE, i:60, NULL), 
    325     //CONF_INFO(189, conf.edge_overlay_color,     CONF_DEF_VALUE, cl:0x66, NULL),                                   // moved to edge overlay module 
    326     CONF_INFO(190, conf.synch_enable,           CONF_DEF_VALUE, i:0, NULL), 
    327     CONF_INFO(191, conf.synch_delay_enable,     CONF_DEF_VALUE, i:0, NULL), 
    328     CONF_INFO(192, conf.synch_delay_value,      CONF_DEF_VALUE, i:100, NULL), 
    329     //CONF_INFO(193, conf.synch_delay_coarse_value, CONF_DEF_VALUE, i:0, NULL),                                     // obsolete - no longer used 
    330     CONF_INFO(194, conf.script_file,            CONF_CHAR_PTR,   ptr:"", conf_change_script_file), 
    331     CONF_INFO(195, conf.mem_view_addr_init,     CONF_DEF_VALUE, i:0x1000, NULL), 
    332     CONF_INFO(196, conf.save_raw_in_sports,     CONF_DEF_VALUE, i:0, NULL), 
    333     CONF_INFO(197, conf.save_raw_in_burst,      CONF_DEF_VALUE, i:0, NULL), 
    334     CONF_INFO(198, conf.save_raw_in_ev_bracketing, CONF_DEF_VALUE, i:0, NULL), 
    335     CONF_INFO(199, conf.save_raw_in_timer,      CONF_DEF_VALUE, i:0, NULL), 
    336     CONF_INFO(200, conf.raw_exceptions_warn,    CONF_DEF_VALUE, i:1, NULL), 
    337     CONF_INFO(201, conf.menu_select_first_entry, CONF_DEF_VALUE, i:1, NULL), 
    338     CONF_INFO(202, conf.fast_movie_control,     CONF_DEF_VALUE, i:0, NULL), 
    339     CONF_INFO(203, conf.show_temp,              CONF_DEF_VALUE, i:1, NULL), 
    340     CONF_INFO2(204, conf.temp_pos,              CONF_OSD_POS,   CAM_SCREEN_WIDTH-9*FONT_WIDTH-2,FONT_HEIGHT), 
     304    CONF_INFO(158, conf.autoiso_enable,             CONF_DEF_VALUE,     i:1, NULL), 
     305    CONF_INFO(159, conf.autoiso_shutter_enum,       CONF_DEF_VALUE,     i:5, NULL), // 5='1/125' 
     306    CONF_INFO(160, conf.autoiso_user_factor,        CONF_DEF_VALUE,     i:5, NULL), 
     307    CONF_INFO(161, conf.autoiso_is_factor,          CONF_DEF_VALUE,     i:2, NULL), 
     308    CONF_INFO(162, conf.autoiso_max_iso_hi,         CONF_DEF_VALUE,     i:55, NULL), 
     309    CONF_INFO(163, conf.autoiso_max_iso_auto,       CONF_DEF_VALUE,     i:32, NULL), 
     310    CONF_INFO(164, conf.autoiso_min_iso,            CONF_DEF_VALUE,     i:8, NULL), 
     311 
     312    CONF_INFO(165, conf.menu_title_color,           CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_WHITE, COLOR_BLACK), NULL), 
     313    CONF_INFO(166, conf.menu_cursor_color,          CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_SELECTED_BG, COLOR_SELECTED_FG), NULL), 
     314    CONF_INFO(167, conf.menu_center,                CONF_DEF_VALUE, i:1, NULL), 
     315    CONF_INFO(168, conf.mute_on_zoom,               CONF_DEF_VALUE, i:0, NULL),  
     316    CONF_INFO(169, conf.bad_pixel_removal,          CONF_DEF_VALUE, i:0, NULL), 
     317    CONF_INFO(170, conf.video_af_key,               CONF_DEF_VALUE, i:0, NULL), 
     318    CONF_INFO(171, conf.osd_color_override,         CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_RED), NULL), 
     319    CONF_INFO(172, conf.override_disable,           CONF_DEF_VALUE, i:2, NULL), 
     320    CONF_INFO(173, conf.override_disable_all,       CONF_DEF_VALUE, i:1, NULL), 
     321    CONF_INFO(174, conf.hide_osd,                   CONF_DEF_VALUE, i:1, NULL), 
     322    CONF_INFO(175, conf.save_raw_in_video,          CONF_DEF_VALUE, i:1, NULL), 
     323    CONF_INFO(176, conf.show_movie_time,            CONF_DEF_VALUE, i:3, NULL), 
     324    CONF_INFO(177, conf.show_movie_refresh,         CONF_DEF_VALUE, i:1, NULL), 
     325    CONF_INFO2(178, conf.mode_video_pos,            CONF_OSD_POS,   CAM_SCREEN_WIDTH-25*FONT_WIDTH-2,CAM_SCREEN_HEIGHT-6*FONT_HEIGHT-2), 
     326    CONF_INFO(179, conf.clear_video,                CONF_DEF_VALUE, i:0, NULL), 
     327    CONF_INFO(180, conf.fast_ev,                    CONF_DEF_VALUE, i:0, NULL), 
     328    CONF_INFO(181, conf.fast_ev_step,               CONF_DEF_VALUE, i:1, NULL), 
     329    CONF_INFO2(182, conf.mode_ev_pos,               CONF_OSD_POS,   CAM_SCREEN_WIDTH-40*FONT_WIDTH-2,CAM_SCREEN_HEIGHT-8*FONT_HEIGHT-2), 
     330    CONF_INFO(183, conf.menu_symbol_rbf_file,       CONF_CHAR_PTR,   ptr:DEFAULT_SYMBOL_FILE, conf_change_menu_symbol_rbf_file), 
     331    CONF_INFO(184, conf.menu_symbol_color,          CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_FG), NULL), 
     332#ifdef OPT_CURVES 
     333    CONF_INFO(185, conf.curve_file,                 CONF_CHAR_PTR,      ptr:"", NULL), 
     334    CONF_INFO(186, conf.curve_enable,               CONF_DEF_VALUE,     i:0, NULL), 
     335#endif 
     336    CONF_INFO(187, conf.edge_overlay_enable,        CONF_DEF_VALUE, i:0, NULL), 
     337    CONF_INFO(188, conf.edge_overlay_thresh,        CONF_DEF_VALUE, i:60, NULL), 
     338    //CONF_INFO(189, conf.edge_overlay_color,         CONF_DEF_VALUE, cl:0x66, NULL),                                   // moved to edge overlay module 
     339    CONF_INFO(190, conf.synch_enable,               CONF_DEF_VALUE, i:0, NULL), 
     340    CONF_INFO(191, conf.synch_delay_enable,         CONF_DEF_VALUE, i:0, NULL), 
     341    CONF_INFO(192, conf.synch_delay_value,          CONF_DEF_VALUE, i:100, NULL), 
     342    //CONF_INFO(193, conf.synch_delay_coarse_value,   CONF_DEF_VALUE, i:0, NULL),                                     // obsolete - no longer used 
     343    CONF_INFO(194, conf.script_file,                CONF_CHAR_PTR,   ptr:"", conf_change_script_file), 
     344    CONF_INFO(195, conf.mem_view_addr_init,         CONF_DEF_VALUE, i:0x1000, NULL), 
     345    CONF_INFO(196, conf.save_raw_in_sports,         CONF_DEF_VALUE, i:0, NULL), 
     346    CONF_INFO(197, conf.save_raw_in_burst,          CONF_DEF_VALUE, i:0, NULL), 
     347    CONF_INFO(198, conf.save_raw_in_ev_bracketing,  CONF_DEF_VALUE, i:0, NULL), 
     348    CONF_INFO(199, conf.save_raw_in_timer,          CONF_DEF_VALUE, i:0, NULL), 
     349    CONF_INFO(200, conf.raw_exceptions_warn,        CONF_DEF_VALUE, i:1, NULL), 
     350    CONF_INFO(201, conf.menu_select_first_entry,    CONF_DEF_VALUE, i:1, NULL), 
     351    CONF_INFO(202, conf.fast_movie_control,         CONF_DEF_VALUE, i:0, NULL), 
     352    CONF_INFO(203, conf.show_temp,                  CONF_DEF_VALUE, i:1, NULL), 
     353    CONF_INFO2(204, conf.temp_pos,                  CONF_OSD_POS,   CAM_SCREEN_WIDTH-9*FONT_WIDTH-2,FONT_HEIGHT), 
    341354    CONF_INFO(205, conf.fast_movie_quality_control, CONF_DEF_VALUE, i:1, NULL), 
    342     CONF_INFO(206, conf.remote_zoom_enable,     CONF_DEF_VALUE, i:0, NULL), 
    343     CONF_INFO(207, conf.zoom_timeout,           CONF_DEF_VALUE, i:5, NULL), 
    344         CONF_INFO(208, conf.start_sound,     CONF_DEF_VALUE, i:0, NULL), 
    345     CONF_INFO(209, conf.sub_batch_prefix,  CONF_DEF_VALUE, i:RAW_PREFIX_SND, NULL), // SND_ 
    346     CONF_INFO(210, conf.sub_batch_ext,  CONF_DEF_VALUE, i:DEFAULT_RAW_EXT, NULL), // .CRW 
    347     CONF_INFO(211, conf.sub_in_dark_value,  CONF_DEF_VALUE, i:30, NULL),  
    348     CONF_INFO(212, conf.sub_out_dark_value,  CONF_DEF_VALUE, i:0, NULL),  
    349         CONF_INFO(213, conf.debug_display,     CONF_DEF_VALUE, i:0, NULL), 
    350         CONF_INFO(214, conf.script_param_save,      CONF_DEF_VALUE, i:1, NULL), 
    351     CONF_INFO2(215, conf.ev_video_pos,          CONF_OSD_POS,   18,80), 
    352     CONF_INFO(216, conf.zoom_override_value,     CONF_DEF_VALUE, i:0, NULL), 
    353     CONF_INFO(217, conf.zoom_override,      CONF_DEF_VALUE, i:0, NULL), 
    354     CONF_INFO(218, conf.clear_zoom_override,         CONF_DEF_VALUE, i:1, NULL),                         
    355     CONF_INFO(219, conf.bracketing_add_raw_suffix,         CONF_DEF_VALUE, i:0, NULL),                   
    356     CONF_INFO(220, conf.temperature_unit,              CONF_DEF_VALUE, i:0, NULL), 
    357     CONF_INFO(221, conf.clear_zoom_override,         CONF_DEF_VALUE, i:1, NULL),                         
    358     //CONF_INFO(222, conf.edge_overlay_play,    CONF_DEF_VALUE, i:0, NULL),                                         // moved to edge overlay module 
    359     //CONF_INFO(223, conf.edge_overlay_pano,              CONF_DEF_VALUE, i:0, NULL),                               // moved to edge overlay module 
    360     //CONF_INFO(224, conf.edge_overlay_zoom,                CONF_DEF_VALUE, i:1, NULL),                             // moved to edge overlay module 
    361     CONF_INFO(225, conf.raw_cache,              CONF_DEF_VALUE, i:0, NULL), 
    362     CONF_INFO(226, conf.dng_raw,                CONF_DEF_VALUE, i:0, conf_change_dng), 
    363     CONF_INFO(227, conf.flash_sync_curtain,     CONF_DEF_VALUE, i:0, NULL), 
    364     CONF_INFO(228, conf.raw_timer,     CONF_DEF_VALUE, i:0, NULL), 
    365     CONF_INFO(229, conf.platformid,     CONF_DEF_VALUE, i:PLATFORMID, NULL), 
    366     CONF_INFO(230, conf.save_raw_in_edgeoverlay,     CONF_DEF_VALUE, i:0, NULL), 
    367     CONF_INFO(231, conf.save_raw_in_auto,     CONF_DEF_VALUE, i:0, NULL), 
    368     CONF_INFO(232, conf.flash_video_override,     CONF_DEF_VALUE, i:0, NULL), 
    369     CONF_INFO(233, conf.flash_video_override_power,     CONF_DEF_VALUE, i:0, NULL), 
    370     CONF_INFO(234, conf.raw_dng_ext,     CONF_DEF_VALUE, i:0, NULL), 
    371     CONF_INFO(235, conf.dng_usb_ext,     CONF_DEF_VALUE, i:0, conf_change_dng_ext), 
    372     CONF_INFO(236, conf.flash_manual_override,     CONF_DEF_VALUE, i:0, NULL), 
    373     CONF_INFO(237, conf.fast_image_quality,     CONF_DEF_VALUE, i:3, NULL), 
    374         CONF_INFO(238, conf.debug_lua_restart_on_error,     CONF_DEF_VALUE, i:0, NULL), 
    375         CONF_INFO(239, conf.debug_propcase_page,     CONF_DEF_VALUE, i:0, NULL), 
    376         CONF_INFO(240, conf.debug_misc_vals_show,     CONF_DEF_VALUE, i:0, NULL), 
    377         //CONF_INFO(241, conf.edge_overlay_filter,     CONF_DEF_VALUE, i:0, NULL),                                      // moved to edge overlay module 
    378         //CONF_INFO(242, conf.edge_overlay_show,     CONF_DEF_VALUE, i:0, NULL),                                        // moved to edge overlay module 
    379     //CONF_INFO(243, conf.edge_overlay_pano_overlap,   CONF_DEF_VALUE, i:30, NULL),                                 // moved to edge overlay module 
     355    CONF_INFO(206, conf.remote_zoom_enable,         CONF_DEF_VALUE, i:0, NULL), 
     356    CONF_INFO(207, conf.zoom_timeout,               CONF_DEF_VALUE, i:5, NULL), 
     357        CONF_INFO(208, conf.start_sound,                CONF_DEF_VALUE, i:0, NULL), 
     358    CONF_INFO(209, conf.sub_batch_prefix,           CONF_DEF_VALUE, i:RAW_PREFIX_SND, NULL), // SND_ 
     359    CONF_INFO(210, conf.sub_batch_ext,              CONF_DEF_VALUE, i:DEFAULT_RAW_EXT, NULL), // .CRW 
     360//    CONF_INFO(211, conf.sub_in_dark_value,          CONF_DEF_VALUE, i:30, NULL),  
     361//    CONF_INFO(212, conf.sub_out_dark_value,         CONF_DEF_VALUE, i:0, NULL),  
     362        CONF_INFO(213, conf.debug_display,              CONF_DEF_VALUE, i:0, NULL), 
     363        CONF_INFO(214, conf.script_param_save,          CONF_DEF_VALUE, i:1, NULL), 
     364    CONF_INFO2(215, conf.ev_video_pos,              CONF_OSD_POS,   18,80), 
     365#if ZOOM_OVERRIDE 
     366    CONF_INFO(216, conf.zoom_override_value,        CONF_DEF_VALUE,     i:0, NULL), 
     367    CONF_INFO(217, conf.zoom_override,              CONF_DEF_VALUE,     i:0, NULL), 
     368    CONF_INFO(218, conf.clear_zoom_override,        CONF_DEF_VALUE,     i:1, NULL), 
     369#endif  
     370    CONF_INFO(219, conf.bracketing_add_raw_suffix,  CONF_DEF_VALUE, i:0, NULL),                  
     371    CONF_INFO(220, conf.temperature_unit,           CONF_DEF_VALUE, i:0, NULL), 
     372//    CONF_INFO(221, conf.clear_zoom_override,        CONF_DEF_VALUE, i:1, NULL),                        
     373    //CONF_INFO(222, conf.edge_overlay_play,          CONF_DEF_VALUE, i:0, NULL),               // moved to edge overlay module 
     374    CONF_INFO(223, conf.edge_overlay_pano,          CONF_DEF_VALUE, i:0, NULL), 
     375    //CONF_INFO(224, conf.edge_overlay_zoom,          CONF_DEF_VALUE, i:1, NULL),               // moved to edge overlay module 
     376    CONF_INFO(225, conf.raw_cache,                  CONF_DEF_VALUE, i:0, NULL), 
     377    CONF_INFO(226, conf.dng_raw,                    CONF_DEF_VALUE, i:0, conf_change_dng), 
     378    CONF_INFO(227, conf.flash_sync_curtain,         CONF_DEF_VALUE, i:0, NULL), 
     379    CONF_INFO(228, conf.raw_timer,                  CONF_DEF_VALUE, i:0, NULL), 
     380    CONF_INFO(229, conf.platformid,                 CONF_DEF_VALUE, i:PLATFORMID, NULL), 
     381    CONF_INFO(230, conf.save_raw_in_edgeoverlay,    CONF_DEF_VALUE, i:0, NULL), 
     382    CONF_INFO(231, conf.save_raw_in_auto,           CONF_DEF_VALUE, i:0, NULL), 
     383    CONF_INFO(232, conf.flash_video_override,       CONF_DEF_VALUE, i:0, NULL), 
     384    CONF_INFO(233, conf.flash_video_override_power, CONF_DEF_VALUE, i:0, NULL), 
     385    CONF_INFO(234, conf.raw_dng_ext,                CONF_DEF_VALUE, i:0, NULL), 
     386    CONF_INFO(235, conf.dng_usb_ext,                CONF_DEF_VALUE, i:0, conf_change_dng_ext), 
     387    CONF_INFO(236, conf.flash_manual_override,      CONF_DEF_VALUE, i:0, NULL), 
     388    CONF_INFO(237, conf.fast_image_quality,         CONF_DEF_VALUE, i:3, NULL), 
     389        CONF_INFO(238, conf.debug_lua_restart_on_error, CONF_DEF_VALUE, i:0, NULL), 
     390        CONF_INFO(239, conf.debug_propcase_page,        CONF_DEF_VALUE, i:0, NULL), 
     391        CONF_INFO(240, conf.debug_misc_vals_show,       CONF_DEF_VALUE, i:0, NULL), 
     392        //CONF_INFO(241, conf.edge_overlay_filter,        CONF_DEF_VALUE, i:0, NULL),               // moved to edge overlay module 
     393        //CONF_INFO(242, conf.edge_overlay_show,          CONF_DEF_VALUE, i:0, NULL),               // moved to edge overlay module 
     394    //CONF_INFO(243, conf.edge_overlay_pano_overlap,  CONF_DEF_VALUE, i:30, NULL),              // moved to edge overlay module 
    380395 
    381396    // Touch screen U/I overrides 
    382     CONF_INFO(244, conf.touchscreen_disable_video_controls, CONF_DEF_VALUE, i:0, NULL), 
    383     CONF_INFO(245, conf.touchscreen_disable_shortcut_controls, CONF_DEF_VALUE, i:0, NULL), 
     397    CONF_INFO(244, conf.touchscreen_disable_video_controls,     CONF_DEF_VALUE, i:0, NULL), 
     398    CONF_INFO(245, conf.touchscreen_disable_shortcut_controls,  CONF_DEF_VALUE, i:0, NULL), 
    384399 
    385400        // USB Icon enable & position 
    386     CONF_INFO(246, conf.usb_info_enable, CONF_DEF_VALUE, i:0, NULL), 
    387     CONF_INFO2(247, conf.usb_info_pos,          CONF_OSD_POS,   95,0), 
     401    CONF_INFO(246, conf.usb_info_enable,            CONF_DEF_VALUE, i:0, NULL), 
     402    CONF_INFO2(247, conf.usb_info_pos,              CONF_OSD_POS,   95,0), 
    388403 
    389404        // new USB remote stuff 
    390         CONF_INFO(248, conf.remote_switch_type,  CONF_DEF_VALUE, i:0, NULL), 
    391         CONF_INFO(249, conf.remote_control_mode,  CONF_DEF_VALUE, i:0, NULL), 
    392  
    393         CONF_INFO(250, conf.remote_enable_scripts, CONF_DEF_VALUE, i:0, NULL), 
    394  
    395    }; 
     405        CONF_INFO(248, conf.remote_switch_type,         CONF_DEF_VALUE, i:0, NULL), 
     406        CONF_INFO(249, conf.remote_control_mode,        CONF_DEF_VALUE, i:0, NULL), 
     407 
     408        CONF_INFO(250, conf.remote_enable_scripts,      CONF_DEF_VALUE, i:0, NULL), 
     409 
     410    CONF_INFO(251, conf.show_partition_nr,          CONF_DEF_VALUE,     i:0, NULL), 
     411    CONF_INFO(252, conf.ext_video_time,             CONF_DEF_VALUE,     i:0, NULL), 
     412#ifdef CAM_HAS_GPS 
     413    // GPS 
     414    CONF_INFO(253, conf.gps_record,                 CONF_DEF_VALUE,     i:0, NULL), 
     415    CONF_INFO(254, conf.gps_navi_show,              CONF_DEF_VALUE,     i:0, NULL), 
     416    CONF_INFO(255, conf.gps_kompass_show,           CONF_DEF_VALUE,     i:0, NULL), 
     417    CONF_INFO(256, conf.gps_coordinates_show,       CONF_DEF_VALUE,     i:0, NULL), 
     418    CONF_INFO(257, conf.gps_height_show,            CONF_DEF_VALUE,     i:0, NULL), 
     419    CONF_INFO(258, conf.gps_waypoint_save,          CONF_DEF_VALUE,     i:0, NULL), 
     420    CONF_INFO(259, conf.gps_track_time,             CONF_DEF_VALUE,     i:1, NULL), 
     421    CONF_INFO(260, conf.gps_kompass_hide,           CONF_DEF_VALUE,     i:0, NULL), 
     422 
     423    CONF_INFO(261, conf.gps_wait_for_signal,        CONF_DEF_VALUE,     i:300, NULL), 
     424    CONF_INFO(262, conf.gps_kompass_time,           CONF_DEF_VALUE,     i:1, NULL), 
     425    CONF_INFO(263, conf.gps_navi_time,              CONF_DEF_VALUE,     i:1, NULL), 
     426    CONF_INFO(264, conf.gps_wait_for_signal_time,   CONF_DEF_VALUE,     i:5, NULL), 
     427    CONF_INFO(265, conf.gps_kompass_smooth,         CONF_DEF_VALUE,     i:7, NULL), 
     428    CONF_INFO(266, conf.gps_batt,                   CONF_DEF_VALUE,     i:25, NULL), 
     429    CONF_INFO(267, conf.gps_countdown,              CONF_DEF_VALUE,     i:0, NULL), 
     430    CONF_INFO(268, conf.gps_2D_3D_fix,              CONF_DEF_VALUE,     i:2, NULL), 
     431    CONF_INFO(269, conf.gps_countdown_blink,        CONF_DEF_VALUE,     i:1, NULL), 
     432     
     433    CONF_INFO(270, conf.gps_rec_play_set,           CONF_DEF_VALUE,     i:0, NULL), 
     434    CONF_INFO(271, conf.gps_play_dark_set,          CONF_DEF_VALUE,     i:0, NULL), 
     435    CONF_INFO(272, conf.gps_rec_play_time,          CONF_DEF_VALUE,     i:30, NULL), 
     436    CONF_INFO(273, conf.gps_play_dark_time,         CONF_DEF_VALUE,     i:45, NULL), 
     437 
     438    CONF_INFO(274, conf.gps_rec_play_set_1,         CONF_DEF_VALUE,     i:0, NULL), 
     439    CONF_INFO(275, conf.gps_play_dark_set_1,        CONF_DEF_VALUE,     i:0, NULL), 
     440    CONF_INFO(276, conf.gps_rec_play_time_1,        CONF_DEF_VALUE,     i:10, NULL), 
     441    CONF_INFO(277, conf.gps_play_dark_time_1,       CONF_DEF_VALUE,     i:15, NULL), 
     442    CONF_INFO(278, conf.gps_show_symbol,            CONF_DEF_VALUE,     i:0, NULL), 
     443    CONF_INFO(279, conf.gps_batt_warn,              CONF_DEF_VALUE,     i:0, NULL), 
     444    CONF_INFO(270, conf.gps_track_symbol,           CONF_DEF_VALUE,     i:0, NULL), 
     445    CONF_INFO(280, conf.gps_test_timezone,          CONF_DEF_VALUE,     i:0, NULL), 
     446    CONF_INFO(281, conf.gps_beep_warn,              CONF_DEF_VALUE,     i:0, NULL), 
     447    CONF_INFO(282, conf.gps_on_off,                 CONF_DEF_VALUE,     i:0, NULL), 
     448#endif 
     449 
     450    // AutoISO2 
     451    CONF_INFO(283, conf.autoiso2_shutter_enum,      CONF_DEF_VALUE,     i:6, NULL), // 6='1/20' 
     452    CONF_INFO(284, conf.autoiso2_max_iso_auto,      CONF_DEF_VALUE,     i:60, NULL), 
     453    CONF_INFO(285, conf.autoiso2_over,              CONF_DEF_VALUE,     i:1, NULL), 
     454    CONF_INFO(286, conf.overexp_threshold,          CONF_DEF_VALUE,     i:5, NULL), 
     455    CONF_INFO(287, conf.overexp_ev_enum,            CONF_DEF_VALUE,     i:3, conf_change_autoiso), 
     456    }; 
    396457#define CONF_NUM (sizeof(conf_info)/sizeof(conf_info[0])) 
    397458 
     
    402463    { 
    403464    case  63: conf_change_alt_mode_button(); break; 
     465    case  64: gui_lang_init(); break; 
    404466    case  65: conf_change_font_cp(); break; 
    405467    case  66: conf_change_menu_rbf_file(); break; 
    406468    case  67: conf_update_prevent_shutdown(); break; 
    407469    case 101: conf_change_video_bitrate(); break; 
     470    case 143: user_menu_restore(); break; 
    408471    case 183: conf_change_menu_symbol_rbf_file(); break; 
    409472    case 194: conf_change_script_file(); break; 
     
    411474    case 226: conf_change_dng(); break; 
    412475    case 235: conf_change_dng_ext(); break; 
     476    case 284: conf_change_autoiso(); break; 
    413477    } 
    414478} 
     
    468532 if (conf.dng_usb_ext) change_ext_to_dng(); else change_ext_to_default(); 
    469533#endif  
     534} 
     535 
     536void conf_change_autoiso() 
     537{ 
     538  // Use menu callback ( some required enum declaration are isolated there) 
     539  cb_autoiso_menu_change(-1); 
    470540} 
    471541 
     
    682752                        configVal->pos.y = pos->y; 
    683753                        ret = CONF_OSD_POS; 
    684                         configVal->pInt = (int*)conf_info[i].var; 
     754                        configVal->pInt = (int*)conf_info[i].var; 
    685755                    break; 
    686756                } 
  • trunk/core/edgeoverlay.c

    r1621 r1719  
    2020    int edge_overlay_filter; 
    2121    int edge_overlay_zoom;    // shall zoom be set when *edg file is loaded? 
    22     int edge_overlay_pano;    // whether a full press changes back to live mode 
     22    //int edge_overlay_pano;    // whether a full press changes back to live mode 
    2323    int edge_overlay_pano_overlap;    // overlap in % in pano mode 
    2424    int edge_overlay_show;    // whether to show overlay even when no button is pressed 
     
    2929 
    3030static ConfInfo conf_info[] = { 
    31     CONF_INFO( 1, econf.edge_overlay_color,     CONF_DEF_VALUE, cl:0, NULL), 
    32     CONF_INFO( 2, econf.edge_overlay_play,    CONF_DEF_VALUE, i:0, NULL), 
    33     CONF_INFO( 3, econf.edge_overlay_pano,              CONF_DEF_VALUE, i:0, NULL), 
    34     CONF_INFO( 4, econf.edge_overlay_zoom,                CONF_DEF_VALUE, i:1, NULL), 
    35         CONF_INFO( 5, econf.edge_overlay_filter,     CONF_DEF_VALUE, i:0, NULL), 
    36         CONF_INFO( 6, econf.edge_overlay_show,     CONF_DEF_VALUE, i:0, NULL), 
    37     CONF_INFO( 7, econf.edge_overlay_pano_overlap,   CONF_DEF_VALUE, i:30, NULL), 
     31    CONF_INFO( 1, econf.edge_overlay_color,         CONF_DEF_VALUE, cl:0, NULL), 
     32    CONF_INFO( 2, econf.edge_overlay_play,          CONF_DEF_VALUE, i:0, NULL), 
     33    //CONF_INFO( 3, econf.edge_overlay_pano,           CONF_DEF_VALUE, i:0, NULL), 
     34    CONF_INFO( 4, econf.edge_overlay_zoom,          CONF_DEF_VALUE, i:1, NULL), 
     35        CONF_INFO( 5, econf.edge_overlay_filter,        CONF_DEF_VALUE, i:0, NULL), 
     36        CONF_INFO( 6, econf.edge_overlay_show,          CONF_DEF_VALUE, i:0, NULL), 
     37    CONF_INFO( 7, econf.edge_overlay_pano_overlap,  CONF_DEF_VALUE, i:30, NULL), 
    3838}; 
    3939 
     
    605605    const int x_max = (viewport_width - 2); 
    606606 
    607     switch(econf.edge_overlay_pano) 
     607    switch(conf.edge_overlay_pano) 
    608608    { 
    609609    case 0:     // pano off 
     
    659659    const int bHalfPress = kbd_is_key_pressed(KEY_SHOOT_HALF); 
    660660    const int bPlayMode = (mode_get() & MODE_MASK) == MODE_PLAY; 
    661     const int bPanoramaMode = (econf.edge_overlay_pano != 0); 
     661    const int bPanoramaMode = (conf.edge_overlay_pano != 0); 
    662662    const int bNeedHalfPress = (econf.edge_overlay_show != 1); 
    663663    const int bDisplayInPlay = (econf.edge_overlay_play == 1); 
     
    687687    case EDGE_LIVE: 
    688688    { 
     689        edge_state_draw=0; 
    689690        // In this state we assume no edge overlay in memory, 
    690691        // but we are ready to create one if the user presses wishes so. 
     
    723724    case EDGE_FROZEN: 
    724725    { 
     726        edge_state_draw=1; 
    725727        // We have a stored edge overlay in memory and we display 
    726728        // it on screen in 'frozen' mode. 
     
    744746            // calculations. 
    745747            bFullPress |= draw_edge_overlay(); 
    746             draw_string(0, 0, "Frozen", conf.osd_color); 
     748            //draw_string(0, 0, "Frozen", conf.osd_color); 
    747749        } 
    748750 
     
    796798    MENU_ITEM(0x5c,LANG_MENU_EDGE_OVERLAY_ENABLE,   MENUITEM_BOOL,              &conf.edge_overlay_enable, 0 ), 
    797799    MENU_ITEM(0x5c,LANG_MENU_EDGE_FILTER,           MENUITEM_BOOL,              &econf.edge_overlay_filter, 0 ), 
    798     MENU_ENUM2(0x5f,LANG_MENU_EDGE_PANO,            &econf.edge_overlay_pano,    gui_edge_pano_modes ), 
     800    MENU_ENUM2(0x5f,LANG_MENU_EDGE_PANO,            &conf.edge_overlay_pano,    gui_edge_pano_modes ), 
    799801    MENU_ITEM(0x5e,LANG_MENU_EDGE_PANO_OVERLAP,     MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &econf.edge_overlay_pano_overlap, MENU_MINMAX(0, 100) ), 
    800802    MENU_ITEM(0x5c,LANG_MENU_EDGE_SHOW,             MENUITEM_BOOL,              &econf.edge_overlay_show, 0 ), 
  • trunk/core/edgeoverlay.h

    r1569 r1719  
    1414}; 
    1515 
     16int edge_state_draw; 
     17 
    1618// Defines of exported to chdk symbols 
    1719#ifdef THIS_IS_CHDK_CORE 
  • trunk/core/gps.c

    r1558 r1719  
    1 #include "camera.h" 
     1/*----------------------------------------------------------------------------------- 
     2**      $Id: gps.c, v 1.2 2012/01/05 genie01 Exp $ 
     3**---------------------------------------------------------------------------------*/ 
     4 
     5#include "stdio.h" 
    26#include "stdlib.h" 
    37#include "platform.h" 
     
    1014        memset(gps, 0, sizeof(tGPS)); 
    1115} 
     16 
     17#ifdef CAM_HAS_GPS 
     18 
     19#include "stddef.h" 
     20#include "conf.h" 
     21#include "string.h" 
     22#include "keyboard.h" 
     23#include "lang.h" 
     24#include "levent.h" 
     25#include "math.h" 
     26#include "gui.h" 
     27#include "gui_draw.h" 
     28#include "gui_batt.h" 
     29#include "gui_lang.h" 
     30//---------------- 
     31 
     32// GPS - Sachen 
     33#include "gps_math.h" 
     34#include "gps_palette.h" 
     35//---------------- 
     36 
     37 
     38extern int exit_gpx_record; 
     39extern int exit_gps_kompass; 
     40extern int exit_gps_navi; 
     41extern int exit_gps_data; 
     42 
     43int Taste_Funktion=0; 
     44int Taste_Taste=0; 
     45int Taste_Druck=0; 
     46int Taste_press=0; 
     47int test_einmal_timezone=0; 
     48 
     49char g_d_tim[10]; 
     50char g_d_dat[12]; 
     51char g_d_tim_gps[10]; 
     52char g_d_dat_gps[12]; 
     53int g_d_lat_ref; 
     54int g_d_lon_ref; 
     55 
     56int bild_ohne_signal=0; 
     57int zeit_bis_ende=0; 
     58int g_d_stat; 
     59 
     60double g_d_lat_nav=0.0; 
     61double g_d_lon_nav=0.0; 
     62double g_d_lat; 
     63double g_d_lon; 
     64double g_d_hei; 
     65 
     66int anzeige_symbol=0; 
     67int nav_home=0; 
     68 
     69 
     70static t_regression_xy buffer1[50]; 
     71static t_regression_xy buffer2[50]; 
     72static t_regression_xy buffer3[50]; 
     73 
     74#define PI      (3.1415926535) 
     75#define RHO     (180.0/3.1415926535) 
     76#define EARTH   (40.e6/360.0) 
     77 
     78typedef struct { 
     79        double lat_w; 
     80        double lon_w; 
     81} t_geo; 
     82 
     83typedef struct { 
     84        double north; 
     85        double east; 
     86} t_rectangular; 
     87 
     88typedef struct { 
     89        double delta; 
     90        double alpha;   // radian 
     91} t_polar; 
     92 
     93void 
     94geodiff (t_geo * von, t_geo* nach, t_geo* delta) { 
     95        delta->lat_w = nach->lat_w - von->lat_w; 
     96        delta->lon_w = nach->lon_w - von->lon_w; 
     97} 
     98 
     99void 
     100geo2rect (t_geo * g, t_rectangular* r, double lat_w) { 
     101        r->north= g->lat_w * EARTH; 
     102        r->east = g->lon_w * EARTH * cos(lat_w/RHO); 
     103} 
     104 
     105void 
     106rect2polar (t_rectangular* r, t_polar* p) { 
     107        p->delta = sqrt (r->north*r->north + r->east*r->east); 
     108        p->alpha = arctan2 (r->east, r->north); 
     109} 
     110 
     111void 
     112polar2rect (t_rectangular* r, t_polar* p) { 
     113        r->east = sin(p->alpha) * p->delta; 
     114        r->north= cos(p->alpha) * p->delta; 
     115} 
     116 
     117int 
     118radian2deg (double alpha) { 
     119        return (int) (alpha * RHO + 360.5) % 360; 
     120} 
     121 
     122typedef struct { 
     123        t_regression lat_w; 
     124        t_regression lon_w; 
     125} t_georeg; 
     126 
     127void 
     128georegInit (t_georeg* reg, int size, t_regression_xy * buffer1, t_regression_xy * buffer2) { 
     129        regressionInit (&reg->lat_w, size, buffer1); 
     130        regressionInit (&reg->lon_w, size, buffer2); 
     131} 
     132 
     133void 
     134georegAdd (t_georeg* reg, double time, t_geo* geo) { 
     135        regressionAdd (&reg->lat_w, time, geo->lat_w); 
     136        regressionAdd (&reg->lon_w, time, geo->lon_w); 
     137} 
     138 
     139void 
     140georegActual (t_georeg* reg, t_geo* geo) { 
     141        geo->lat_w = regressionActual (&reg->lat_w); 
     142        geo->lon_w = regressionActual (&reg->lon_w); 
     143} 
     144 
     145void 
     146georegChange (t_georeg* reg, t_geo* geo) { 
     147        geo->lat_w = regressionChange (&reg->lat_w); 
     148        geo->lon_w = regressionChange (&reg->lon_w); 
     149} 
     150 
     151void 
     152readGps (t_geo * gps) { 
     153 
     154        msleep((int)conf.gps_navi_time*1000);           // Warte eine bestimmte Zeit 
     155        gps->lat_w = g_d_lat; 
     156        gps->lon_w = g_d_lon; 
     157} 
     158 
     159double jetzt;                                   // Sekundenuhr 
     160t_geo gps;                                      // gemessene verrauschte Position 
     161t_georeg georeg;                                // Regression fuer Istposition 
     162t_geo ist;                                      // Ist-Position aus Regression 
     163t_geo speed;                                    // Ist Geschwindigkeit in Grad/s 
     164t_rectangular mspeed;                                   // Ist Geschwindigkeit in m/s (N/E) 
     165t_polar pspeed;                                 // Ist Geschwindigkeit in m/s + Winkel 
     166int marsch;                                     // Marschrichtung 
     167t_geo soll;                                     // Soll-Position 
     168t_geo delta;                                    // Entfernung zum Ziel (in Grad) 
     169t_rectangular rdelta;                                   // Entfernung zum Ziel (metrisch N/E) 
     170t_polar pdelta;                                 // Entfernung zum Ziel (metrisch+Winkel) 
     171int peil;                                       // Peilung zum Ziel 
     172int winkel;                                     // Winkel auf Anzeige von Marsch zum Ziel 
     173t_regression deltareg;                                  // Gl?ttung und Geschwindigkeit 
     174 
     175 
     176void gps_updateData(){ 
     177 
     178        GPS_UpdateData(); 
     179} 
     180 
     181void gps_get_data(){ 
     182 
     183        if ((int)conf.gps_on_off ==0) {return; } 
     184 
     185        tGPS gps; 
     186 
     187        int tim00=0; 
     188        int tim01=0; 
     189        int tim02=0; 
     190        int nm=1; 
     191        unsigned long t; 
     192        static struct tm *ttm; 
     193 
     194        char buf[100]; 
     195        char anz1[40]; 
     196        char anz2[40]; 
     197         
     198        while ( nm==1 ) 
     199        { 
     200                gps_updateData(); 
     201                gps_getData(&gps); 
     202 
     203                t=time(NULL); 
     204                ttm = localtime(&t); 
     205 
     206                g_d_lat_ref = gps.latitudeRef; 
     207                g_d_lat=0.0; 
     208                g_d_lat=(gps.latitude[0]/(gps.latitude[1]*1.0)) + (gps.latitude[2]/(gps.latitude[3]*60.0)) + (gps.latitude[4]/(gps.latitude[5]*3600.0)); 
     209 
     210                g_d_lon_ref=gps.longitudeRef; 
     211                g_d_lon=0.0; 
     212                g_d_lon=(gps.longitude[0]/(gps.longitude[1]*1.0)) + (gps.longitude[2]/(gps.longitude[3]*60.0)) + (gps.longitude[4]/(gps.longitude[5]*3600.0)); 
     213 
     214                g_d_hei=0.0; 
     215                g_d_hei=gps.height[0]/(gps.height[1]*1.0); 
     216 
     217                sprintf(g_d_tim, "%02d:%02d:%02d", ttm->tm_hour, ttm->tm_min, ttm->tm_sec); 
     218                sprintf(g_d_dat, "%04d-%02d-%02d", ttm->tm_year+1900, ttm->tm_mon+1, ttm->tm_mday); 
     219                 
     220                g_d_stat=0; 
     221                if ((int)g_d_lat == 0) {g_d_stat = 0; } 
     222                if ((int)g_d_lat != 0 && (int)g_d_hei == 0) {g_d_stat=1; } 
     223                if ((int)g_d_lat != 0 && (int)g_d_hei != 0) {g_d_stat=2; } 
     224 
     225                if (g_d_stat > 0) 
     226                { 
     227                        tim00=(int)(gps.timeStamp[0]/gps.timeStamp[1]); 
     228                        tim01=(int)(gps.timeStamp[2]/gps.timeStamp[3]); 
     229                        tim02=(int)(gps.timeStamp[4]/gps.timeStamp[5]); 
     230                        sprintf(g_d_tim_gps, "%02d:%02d:%02d", tim00, tim01, tim02); 
     231 
     232                        sprintf(g_d_dat_gps, "%c%c%c%c-%c%c-%c%c", 
     233                                gps.dateStamp[0], 
     234                                gps.dateStamp[1], 
     235                                gps.dateStamp[2], 
     236                                gps.dateStamp[3], 
     237                                gps.dateStamp[5], 
     238                                gps.dateStamp[6], 
     239                                gps.dateStamp[8], 
     240                                gps.dateStamp[9]); 
     241 
     242                        if ((int)conf.gps_test_timezone == 1) 
     243                        { 
     244                                if (test_einmal_timezone==0) 
     245                                { 
     246                                        test_timezone(); 
     247                                        test_einmal_timezone=1; 
     248                                } 
     249                        } 
     250                } 
     251                 
     252                if ((int)conf.gps_show_symbol == 1) 
     253                { 
     254                        if (anzeige_symbol==0) 
     255                        { 
     256                                _CreateTask("ANZSYMBOL", 0x19, 0x500, anzeige_gps, 0); 
     257                                anzeige_symbol=1; 
     258                        } 
     259                } 
     260                msleep(900); 
     261                nm=(int)conf.gps_on_off; 
     262        } 
     263        test_einmal_timezone=0; 
     264        anzeige_symbol=0; 
     265        exit_gps_data=1; 
     266        ExitTask(); 
     267} 
     268 
     269void write_timezone(){ 
     270 
     271        if ((int)conf.gps_on_off ==0) {return; } 
     272 
     273        char vBuf[30]; 
     274        char timezone_name[30]; 
     275 
     276        if (g_d_stat !=0) 
     277        { 
     278                mkdir_if_not_exist("A/GPS"); 
     279                mkdir_if_not_exist("A/GPS/Timezone"); 
     280                sprintf(timezone_name, "A/GPS/Timezone/Timezone.txt"); 
     281 
     282                FILE* fp = fopen(timezone_name, "w"); 
     283                if( fp ) 
     284                { 
     285                        sprintf(vBuf, "%i\n", (long)(g_d_lat*10000000)); 
     286                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     287                        sprintf(vBuf, "%i\n", (long)(g_d_lon*10000000)); 
     288                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     289                } 
     290                fclose(fp); 
     291        } 
     292        else 
     293        { 
     294                int zba; 
     295                for(zba=5; zba>0; zba--) 
     296                { 
     297                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_1)); 
     298                        draw_txt_string(8, 8, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     299                        msleep(1000); 
     300                } 
     301        } 
     302} 
     303 
     304void write_home(){ 
     305 
     306        if ((int)conf.gps_on_off ==0) {return; } 
     307 
     308        char vBuf[30]; 
     309        char home_name[30]; 
     310 
     311        if (g_d_stat !=0) 
     312        { 
     313                mkdir_if_not_exist("A/GPS"); 
     314                mkdir_if_not_exist("A/GPS/Navigation"); 
     315                sprintf(home_name, "A/GPS/Navigation/Home.txt"); 
     316 
     317                FILE* fp = fopen(home_name, "w"); 
     318                if( fp ) 
     319                { 
     320                        sprintf(vBuf, "%i\n", (long)(g_d_lat*10000000)); 
     321                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     322                        sprintf(vBuf, "%i\n", (long)(g_d_lon*10000000)); 
     323                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     324                } 
     325                fclose(fp); 
     326        } 
     327        else 
     328        { 
     329                int zba; 
     330                for(zba=5; zba>0; zba--) 
     331                { 
     332                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_1)); 
     333                        draw_txt_string(8, 8, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     334                        msleep(1000); 
     335                } 
     336        } 
     337} 
     338 
     339void test_timezone(){ 
     340 
     341        if ((int)conf.gps_on_off ==0) {return; } 
     342 
     343        char vBuf[512]; 
     344        char text[2][30]; 
     345        char home_name[30]; 
     346        int zeitzone_1, zeitzone_2; 
     347        char * succ; 
     348 
     349        sprintf(home_name, "A/GPS/Timezone/Timezone.txt"); 
     350 
     351        FILE* fp = fopen(home_name, "r"); 
     352        if( fp ) 
     353        { 
     354                fgets(text[1], 15, fp); 
     355                fgets(text[2], 15, fp); 
     356                fclose(fp); 
     357 
     358                g_d_lat_nav = (strtol (text[1], &succ, 10 )) / 10000000.0; 
     359                g_d_lon_nav = (strtol (text[2], &succ, 10 )) / 10000000.0; 
     360 
     361                zeitzone_1 = (int)((g_d_lon_nav+7.5)/15); 
     362                zeitzone_2 = (int)((g_d_lon+7.5)/15); 
     363 
     364                if (zeitzone_1 != zeitzone_2) 
     365                { 
     366                        char vBuf[256]; 
     367                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_2)); 
     368                        draw_txt_string(1, 13, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     369                        msleep(5000); 
     370                } 
     371        } 
     372} 
     373 
     374void anzeige_gps(){ 
     375 
     376        if ((int)conf.gps_on_off ==0) {return; } 
     377 
     378        char *bitmap; 
     379        bitmap = load_bitmap("A/CHDK/DATA/GPS_Sat.txt"); 
     380 
     381        if(bitmap) 
     382        { 
     383                int laenge1 = strlen(bitmap); 
     384                int pos1=0; 
     385                int mx1=0; 
     386                int my1=0; 
     387                int o_x1=270; 
     388                int o_y1=0; 
     389                int nm=1; 
     390                int zp=1; 
     391 
     392                int f_v_0; 
     393                int f_h_0; 
     394                int f_v_1; 
     395                int f_h_1; 
     396                int f_v_2; 
     397                int f_h_2; 
     398                int f_v_3; 
     399                int f_h_3; 
     400                int f_v_4; 
     401                int f_h_4; 
     402 
     403                while ( nm==1 ) 
     404                { 
     405                        mx1=0; 
     406                        my1=0; 
     407 
     408                        f_v_0=COLOR_GPS_TRANSPARENT; 
     409                        f_h_0=COLOR_GPS_TRANSPARENT; 
     410 
     411                        f_v_1=COLOR_GPS_GREEN; 
     412                        f_h_1=COLOR_GPS_GREEN; 
     413 
     414                        if (g_d_stat == 0) 
     415                        { 
     416                                f_v_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_RED : COLOR_GPS_PLAY_RED; 
     417                                f_h_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_RED : COLOR_GPS_PLAY_RED; 
     418                        } 
     419                        if (g_d_stat == 1) 
     420                        { 
     421                                f_v_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_YELLOW : COLOR_GPS_PLAY_YELLOW; 
     422                                f_h_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_YELLOW : COLOR_GPS_PLAY_YELLOW; 
     423                        } 
     424                        if (g_d_stat == 2) 
     425                        { 
     426                                f_v_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_GREEN : COLOR_GPS_PLAY_GREEN; 
     427                                f_h_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_GREEN : COLOR_GPS_PLAY_GREEN; 
     428                        } 
     429                        if ((mode_get()&MODE_MASK) == MODE_PLAY) 
     430                        { 
     431                                int lati[6]; 
     432                                memcpy((void*)lati, camera_jpeg_current_latitude(), sizeof(lati)); 
     433                                double lat000=lati[0]/(lati[1]*1.0); 
     434                                double lat001=lati[2]/(lati[3]*60.0); 
     435                                double lat002=lati[4]/(lati[5]*3600.0); 
     436                                double lat0e=lat000+lat001+lat002; 
     437 
     438                                int hei[5]; 
     439                                memcpy((void*)hei, camera_jpeg_current_height(), sizeof(hei)); 
     440                                char vBuf0[10]; 
     441                                char vBuf1[10]; 
     442                                char vBuf2[]="-----m"; 
     443                                sprintf(vBuf0, "%s",hei); 
     444                                sprintf(vBuf1, "%s",vBuf2); 
     445 
     446 
     447                                if ((int)lat0e == 0) 
     448                                { 
     449                                        f_v_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_RED : COLOR_GPS_PLAY_RED; 
     450                                        f_h_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_RED : COLOR_GPS_PLAY_RED; 
     451                                } 
     452                                else 
     453                                { 
     454                                        f_v_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_YELLOW : COLOR_GPS_PLAY_YELLOW; 
     455                                        f_h_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_YELLOW : COLOR_GPS_PLAY_YELLOW; 
     456                                } 
     457                                if ( strcmp(vBuf0, vBuf1) !=0 ) 
     458                                { 
     459                                        f_v_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_GREEN : COLOR_GPS_PLAY_GREEN; 
     460                                        f_h_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_GREEN : COLOR_GPS_PLAY_GREEN; 
     461                                } 
     462                        } 
     463 
     464 
     465 
     466                        f_v_2=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLACK : COLOR_GPS_PLAY_BLACK; 
     467                        f_h_2=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLACK : COLOR_GPS_PLAY_BLACK; 
     468 
     469                        f_v_3=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_YELLOW : COLOR_GPS_PLAY_YELLOW; 
     470                        f_h_3=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_YELLOW : COLOR_GPS_PLAY_YELLOW; 
     471 
     472                        f_v_4=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLUE : COLOR_GPS_PLAY_BLUE; 
     473                        f_h_4=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLUE : COLOR_GPS_PLAY_BLUE; 
     474 
     475                        for(pos1=0; pos1<laenge1; pos1++) 
     476                        { 
     477                                int data = bitmap[pos1]; 
     478                                if (data == 48) 
     479                                { 
     480                                        draw_pixel(o_x1+mx1, o_y1+my1, MAKE_COLOR(f_v_0, f_h_0)); 
     481                                } 
     482                                if (data == 49) 
     483                                { 
     484                                        draw_pixel(o_x1+mx1, o_y1+my1, MAKE_COLOR(f_v_1, f_h_1)); 
     485                                } 
     486                                if (data == 50) 
     487                                { 
     488                                        draw_pixel(o_x1+mx1, o_y1+my1, MAKE_COLOR(f_v_2, f_h_2)); 
     489                                } 
     490                                if (data == 51) 
     491                                { 
     492                                        draw_pixel(o_x1+mx1, o_y1+my1, MAKE_COLOR(f_v_3, f_h_3)); 
     493                                } 
     494                                if (data == 52) 
     495                                { 
     496                                        draw_pixel(o_x1+mx1, o_y1+my1, MAKE_COLOR(f_v_4, f_h_4)); 
     497                                } 
     498                                if (data == 10 || data == 13) 
     499                                { 
     500                                        mx1=0; 
     501                                        my1++; 
     502                                        pos1++; 
     503                                } 
     504                                else 
     505                                { 
     506                                        mx1++; 
     507                                } 
     508                        } 
     509                        nm=(int)conf.gps_show_symbol; 
     510                        msleep(1000); 
     511                        if (zp == 10) 
     512                        { 
     513                                zp=0; 
     514                        } 
     515                        zp++; 
     516                        if ((int)conf.gps_on_off ==0) 
     517                        { 
     518                                nm=0; 
     519                        } 
     520 
     521                } 
     522        } 
     523        anzeige_symbol=0; 
     524        ExitTask(); 
     525} 
     526 
     527void anzeige_track(){ 
     528 
     529        if ((int)conf.gps_on_off ==0) {return; } 
     530 
     531        char *bitmap; 
     532        bitmap = load_bitmap("A/CHDK/DATA/GPS_Track_1.txt"); 
     533        char *bitmap1; 
     534        bitmap1 = load_bitmap("A/CHDK/DATA/GPS_Track_2.txt"); 
     535        char *bitmap2; 
     536        bitmap2 = load_bitmap("A/CHDK/DATA/GPS_Track_3.txt"); 
     537 
     538        if(bitmap) 
     539        { 
     540                int laenge1 = strlen(bitmap); 
     541                int pos1=0; 
     542                int mx1=0; 
     543                int my1=0; 
     544                int o_x1=315; 
     545                int o_y1=0; 
     546                int nmm=0; 
     547                int zp=1; 
     548 
     549                int f_v_0; 
     550                int f_h_0; 
     551                int f_v_1; 
     552                int f_h_1; 
     553                int f_v_2; 
     554                int f_h_2; 
     555                int f_v_3; 
     556                int f_h_3; 
     557                int f_v_4; 
     558                int f_h_4; 
     559                int f_v_5; 
     560                int f_h_5; 
     561                int blink=0; 
     562                int data; 
     563 
     564                while ( nmm == 0 ) 
     565                { 
     566                        mx1=0; 
     567                        my1=0; 
     568 
     569                        f_v_0=COLOR_GPS_TRANSPARENT; 
     570                        f_h_0=COLOR_GPS_TRANSPARENT; 
     571 
     572                        f_v_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLACK : COLOR_GPS_PLAY_BLACK; 
     573                        f_h_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLACK : COLOR_GPS_PLAY_BLACK; 
     574 
     575                        f_v_2=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLUE : COLOR_GPS_PLAY_BLUE; 
     576                        f_h_2=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLUE : COLOR_GPS_PLAY_BLUE; 
     577 
     578                        f_v_3=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_YELLOW : COLOR_GPS_PLAY_YELLOW; 
     579                        f_h_3=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_YELLOW : COLOR_GPS_PLAY_YELLOW; 
     580 
     581                        f_v_4=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_RED : COLOR_GPS_PLAY_RED; 
     582                        f_h_4=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_RED : COLOR_GPS_PLAY_RED; 
     583 
     584                        f_v_5=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_GREEN : COLOR_GPS_PLAY_GREEN; 
     585                        f_h_5=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_GREEN : COLOR_GPS_PLAY_GREEN; 
     586 
     587                        for(pos1=0; pos1<laenge1; pos1++) 
     588                        { 
     589                                if ((blink==1) && (g_d_stat > 0)) 
     590                                { 
     591                                        data = bitmap1[pos1]; 
     592                                } 
     593                                else 
     594                                { 
     595                                        data = bitmap[pos1]; 
     596                                } 
     597                                if ((blink==1) && (exit_gps_navi==0) && (g_d_stat > 0)) 
     598                                { 
     599                                        data = bitmap2[pos1]; 
     600                                } 
     601                                if (data == 48) 
     602                                { 
     603                                        draw_pixel(o_x1+mx1, o_y1+my1, MAKE_COLOR(f_v_0, f_h_0)); 
     604                                } 
     605                                if (data == 49) 
     606                                { 
     607                                        draw_pixel(o_x1+mx1, o_y1+my1, MAKE_COLOR(f_v_1, f_h_1)); 
     608                                } 
     609                                if (data == 50) 
     610                                { 
     611                                        draw_pixel(o_x1+mx1, o_y1+my1, MAKE_COLOR(f_v_2, f_h_2)); 
     612                                } 
     613                                if (data == 51) 
     614                                { 
     615                                        draw_pixel(o_x1+mx1, o_y1+my1, MAKE_COLOR(f_v_3, f_h_3)); 
     616                                } 
     617                                if (data == 52) 
     618                                { 
     619                                        draw_pixel(o_x1+mx1, o_y1+my1, MAKE_COLOR(f_v_4, f_h_4)); 
     620                                } 
     621                                if (data == 53) 
     622                                { 
     623                                        draw_pixel(o_x1+mx1, o_y1+my1, MAKE_COLOR(f_v_5, f_h_5)); 
     624                                } 
     625                                if (data == 10 || data == 13) 
     626                                { 
     627                                        mx1=0; 
     628                                        my1++; 
     629                                        pos1++; 
     630                                } 
     631                                else 
     632                                { 
     633                                        mx1++; 
     634                                } 
     635                        } 
     636 
     637                        msleep(1000); 
     638                        nmm=exit_gpx_record; 
     639                        if ((int)conf.gps_on_off ==0) 
     640                        { 
     641                                nmm=0; 
     642                        } 
     643 
     644                        if (blink==0) 
     645                        { 
     646                                blink=1; 
     647                        } 
     648                        else 
     649                        { 
     650                                blink=0; 
     651                        } 
     652 
     653                } 
     654        } 
     655        ExitTask(); 
     656} 
     657 
     658void gpx_bild_ohne_signal(){ 
     659 
     660        if ((int)conf.gps_on_off ==0) {return; } 
     661 
     662        char vBuf[100]; 
     663 
     664        FILE *fd0; 
     665        char w1[20]; 
     666        char w2[30]; 
     667        char w3[10]; 
     668        int c; 
     669        int o=1, p=1, q=0; 
     670        int blo=0; 
     671        unsigned long bat; 
     672        int abbruch=0; 
     673        Taste_Funktion=1; 
     674        Taste_Taste=11; 
     675 
     676        int zoom=0; 
     677         
     678        while ( zeit_bis_ende !=0 ) 
     679        { 
     680                // Teste Akku 
     681                if ( (((zeit_bis_ende) % 60)) == 0 ) 
     682                { 
     683                        bat=get_batt_perc(); 
     684                        if (bat <= (int)conf.gps_batt) 
     685                        { 
     686                                int zba; 
     687                                for(zba=30; zba>0; zba--) 
     688                                { 
     689                                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_3)); 
     690                                        draw_txt_string(0, 8, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     691                                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_4),zba); 
     692                                        draw_txt_string(0, 9, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     693                                        if ( (((zba) % 2)) == 0 ) 
     694                                        { 
     695                                                debug_led(0); 
     696                                                if ((int)conf.gps_batt_warn == 1) 
     697                                                { 
     698                                                        play_sound(6); 
     699                                                } 
     700                                        } 
     701                                        else 
     702                                        { 
     703                                                debug_led(1); 
     704                                        } 
     705                                        msleep(1000); 
     706                                } 
     707                                bild_ohne_signal=0; 
     708                                camera_shutdown_in_a_second(); 
     709                                ExitTask(); 
     710                        } 
     711                } 
     712 
     713                // Abschaltautomatik abbrechen 
     714                if (Taste_Druck == 1) 
     715                { 
     716                        Taste_Druck=0; 
     717                        abbruch = 1; 
     718                        zeit_bis_ende = 3600; 
     719                        TurnOnBackLight(); 
     720                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_5)); 
     721                        int zba; 
     722                        for(zba=5; zba>0; zba--) 
     723                        { 
     724                                draw_txt_string(10, 7, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     725                                msleep(1000); 
     726                        } 
     727                } 
     728 
     729                if ( abbruch == 0) 
     730                { 
     731 
     732                        //LED blinken 
     733                        if (q==0) 
     734                        { 
     735                                debug_led(0); 
     736                                q=1; 
     737                        } 
     738                        else 
     739                        { 
     740                                debug_led(1); 
     741                                q=0; 
     742                        } 
     743 
     744                        // Anzeige Countdown / Zeit bis Ende in mm:ss 
     745 
     746                        int s = (int)zeit_bis_ende; 
     747                        int minuten =  s / 60; 
     748                        s = s % 60; 
     749                        int sekunden = s; 
     750 
     751                        if ( (int)conf.gps_countdown==0 ) 
     752                        { 
     753                                sprintf(vBuf, lang_str(LANG_MENU_GPS_t_6),minuten, sekunden); 
     754                        } 
     755                        else 
     756                        { 
     757                                sprintf(vBuf, " %01d:%02d",minuten, sekunden); 
     758                        } 
     759                        draw_txt_string(0, 1, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     760 
     761                        // Display einschalten wenn Countdown < 30 Sekunden 
     762 
     763                        if ((blo==1) && (zeit_bis_ende <=30)) 
     764                        { 
     765                                TurnOnBackLight(); 
     766                        } 
     767 
     768                        // Piepsen < 3 Sekunden 
     769//                      if (zeit_bis_ende <=3) 
     770//                      { 
     771//                              if ((int)conf.gps_beep_warn == 1) 
     772//                              { 
     773//                                      play_sound(6); 
     774//                              } 
     775//                      } 
     776 
     777                        // Countdown von vorne beginnen 
     778                        if ((blo==0) && (kbd_get_pressed_key() !=0)) 
     779                        { 
     780                                zeit_bis_ende=(int)conf.gps_wait_for_signal; 
     781                                o=1; 
     782                                p=1; 
     783                        } 
     784 
     785                        // Countdown von vorne beginnen und Display einschalten 
     786                        if ((blo==1) && (kbd_get_pressed_key() !=0)) 
     787                        { 
     788                                TurnOnBackLight(); 
     789//                              shooting_set_zoom(zoom); 
     790                                blo=0; 
     791                                zeit_bis_ende=(int)conf.gps_wait_for_signal; 
     792                                o=1; 
     793                                p=1; 
     794                        } 
     795 
     796                        // In Play-Modus schalten 
     797                        if ((o == (int)conf.gps_rec_play_time) && ((int)conf.gps_rec_play_set == 1)) 
     798                        { 
     799                                if ((mode_get()&MODE_MASK) == MODE_REC) 
     800                                { 
     801//                                      zoom=lens_get_zoom_point(); 
     802                                        levent_set_play(); 
     803                                } 
     804                        } 
     805 
     806                        // Hintergrundbeleuchtung abschalten 
     807                        if ((p == (int)conf.gps_play_dark_time) && ((int)conf.gps_play_dark_set == 1)) 
     808                        { 
     809                                if ((mode_get()&MODE_MASK) == MODE_PLAY) 
     810                                { 
     811                                        TurnOffBackLight(); 
     812                                        blo=1; 
     813                                } 
     814                        } 
     815                } 
     816 
     817 
     818                if ( ((((int)conf.gps_2D_3D_fix) == 1) && (g_d_stat == 1)) || \ 
     819                     ((((int)conf.gps_2D_3D_fix) == 1) && (g_d_stat == 2)) || \ 
     820                     ((((int)conf.gps_2D_3D_fix) == 2) && (g_d_stat == 2)) || \ 
     821                     ((((int)conf.gps_2D_3D_fix) == 3) && (g_d_stat == 2)) || \ 
     822                     ((((int)conf.gps_2D_3D_fix) == 3) && (g_d_stat == 1) && (zeit_bis_ende < 3)) || \ 
     823                     ((((int)conf.gps_2D_3D_fix) == 0) && (zeit_bis_ende < 3)) ) 
     824                { 
     825                        TurnOnBackLight(); 
     826                        msleep (1000); 
     827 
     828                        fd0 = fopen ( "A/GPS/Tagging/wp.tmp", "r" ); 
     829 
     830                        do 
     831                        { 
     832                                fgets (w1, 15, fd0); 
     833                                fseek (fd0, 1, SEEK_CUR); 
     834                                fgets (w2, 23, fd0); 
     835                                fseek (fd0, 1, SEEK_CUR); 
     836                                fgets (w3, 1, fd0); 
     837 
     838                                char lat[40]; 
     839                                char lon[40]; 
     840                                char hei[40]; 
     841 
     842                                char vBuf1[512]; 
     843                                char bild_name[20]; 
     844                                char wp_name[30]; 
     845                                char gpx_name[30]; 
     846                                char gpx_bild_name[20]; 
     847                                unsigned long t; 
     848                                static struct tm *ttm; 
     849                                t=time(NULL); 
     850                                ttm = localtime(&t); 
     851 
     852                                sprintf(wp_name, "A/GPS/Tagging/%04d_%02d_%02d.wp", ttm->tm_year+1900, ttm->tm_mon+1, ttm->tm_mday); 
     853                                sprintf(gpx_name, "A/GPS/Tagging/%04d_%02d_%02d.gpx", ttm->tm_year+1900, ttm->tm_mon+1, ttm->tm_mday); 
     854 
     855                                sprintf(bild_name, "%s", w1); 
     856                                sprintf(gpx_bild_name, "%s", w1); 
     857 
     858                                sprintf(vBuf1, "%s;%s;%s;%s;%s;%s", 
     859                                        bild_name, 
     860                                        formatDouble (lat, g_d_lat, 0, 7), 
     861                                        formatDouble (lon, g_d_lon, 0, 7), 
     862                                        formatDouble (hei, g_d_hei, 0, 2), 
     863                                        w2, 
     864                                        w3); 
     865 
     866                                FILE* fp = fopen(wp_name, "a"); 
     867 
     868                                if( fp ) 
     869                                { 
     870                                        fwrite(vBuf1, strlen(vBuf1), 1, fp); 
     871                                } 
     872 
     873                                fclose(fp); 
     874 
     875                                fp = fopen(gpx_name, "r"); 
     876                                if( fp == NULL) 
     877                                { 
     878                                        fp = fopen(gpx_name, "a"); 
     879                                        if( fp ) 
     880                                        { 
     881                                                sprintf(vBuf1, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); 
     882                                                fwrite(vBuf1, strlen(vBuf1), 1, fp); 
     883                                                sprintf(vBuf1, "<gpx xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" version=\"1.1\" creator=\"CHDK-DE\" xmlns=\"http://www.topografix.com/GPX/1/1\">\n"); 
     884                                                fwrite(vBuf1, strlen(vBuf1), 1, fp); 
     885                                                sprintf(vBuf1, "</gpx>"); 
     886                                                fwrite(vBuf1, strlen(vBuf1), 1, fp); 
     887                                                fclose(fp); 
     888                                        } 
     889                                } 
     890 
     891 
     892                                fp = fopen(gpx_name, "a"); 
     893                                if( fp ) 
     894                                { 
     895                                        fseek (fp, -6, SEEK_END); 
     896 
     897                                        sprintf(vBuf1, "   <wpt lat=\"%s\" lon=\"%s\">\n",formatDouble (lat, g_d_lat, 0, 7), formatDouble (lon, g_d_lon, 0, 7)); 
     898                                        fwrite(vBuf1, strlen(vBuf1), 1, fp); 
     899                                        sprintf(vBuf1, "    <ele>%s</ele>\n",formatDouble (hei, g_d_hei, 0, 2)); 
     900                                        fwrite(vBuf1, strlen(vBuf1), 1, fp); 
     901                                        sprintf(vBuf1, "    <time>%s</time>\n", w2); 
     902                                        fwrite(vBuf1, strlen(vBuf1), 1, fp); 
     903                                        sprintf(vBuf1, "    <gpst>%sT%sZ</gpst>\n", g_d_dat_gps, g_d_tim_gps); 
     904                                        fwrite(vBuf1, strlen(vBuf1), 1, fp); 
     905                                        sprintf(vBuf1, "    <temp>%i</temp>\n", (int)get_optical_temp()); 
     906                                        fwrite(vBuf1, strlen(vBuf1), 1, fp); 
     907                                        sprintf(vBuf1, "    <name>%s</name>\n", gpx_bild_name); 
     908                                        fwrite(vBuf1, strlen(vBuf1), 1, fp); 
     909                                        sprintf(vBuf1, "   </wpt>\n"); 
     910                                        fwrite(vBuf1, strlen(vBuf1), 1, fp); 
     911                                        sprintf(vBuf1, "</gpx>"); 
     912                                        fwrite(vBuf1, strlen(vBuf1), 1, fp); 
     913                                } 
     914                                fclose(fp); 
     915                        } 
     916                        while (!feof(fd0)); 
     917 
     918                        fclose (fd0); 
     919                        if ( abbruch == 0) 
     920                        { 
     921                                zeit_bis_ende=1; 
     922                        } 
     923 
     924                } 
     925 
     926                msleep(1000); 
     927                o++; 
     928                p++; 
     929                if ((int)conf.gps_on_off ==0) 
     930                { 
     931                        bild_ohne_signal=0; 
     932                        abbruch=0; 
     933                        Taste_Funktion=1; 
     934                        Taste_Taste=11; 
     935                        Taste_Druck=0; 
     936                        debug_led(0); 
     937                        o=1; 
     938                        p=1; 
     939                        q=0; 
     940                        blo=0; 
     941                        ExitTask(); 
     942                } 
     943 
     944                zeit_bis_ende--; 
     945        } 
     946         
     947        int zba, zba1; 
     948        int taste_press=0; 
     949         
     950        if (abbruch == 0)  
     951                { 
     952                        for(zba=15; zba>0; zba--) 
     953                                { 
     954                                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_4), zba); 
     955                                        draw_txt_string(0, 2, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_BLUE)); 
     956                                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_18)); 
     957                                        draw_txt_string(0, 3, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     958                                        play_sound(6); 
     959 
     960                                        for(zba1=100; zba1>0; zba1--) 
     961                                                { 
     962                                                        if (kbd_get_pressed_key() ==6) 
     963                                                                { 
     964                                                                        TurnOnBackLight(); 
     965                                                                        bild_ohne_signal=0; 
     966                                                                        abbruch=0; 
     967                                                                        Taste_Funktion=1; 
     968                                                                        Taste_Taste=11; 
     969                                                                        Taste_Druck=0; 
     970                                                                        debug_led(0); 
     971                                                                        taste_press=0; 
     972                                                                        o=1; 
     973                                                                        p=1; 
     974                                                                        q=0; 
     975                                                                        blo=0; 
     976 
     977                                                                        ExitTask(); 
     978                                                                } 
     979                                                msleep(2); 
     980                                                } 
     981                                } 
     982                        if (taste_press==0) 
     983                                { 
     984                                        camera_shutdown_in_a_second();  
     985                                } 
     986 
     987                } 
     988 
     989        TurnOnBackLight(); 
     990        bild_ohne_signal=0; 
     991        abbruch=0; 
     992        Taste_Funktion=0; 
     993        Taste_Taste=0; 
     994        Taste_Druck=0; 
     995        debug_led(0); 
     996        // Piepsen 5 Sekunden 
     997 
     998        if ((int)conf.gps_beep_warn == 1) 
     999        { 
     1000                for(zba=5; zba>0; zba--) 
     1001                { 
     1002                        play_sound(6); 
     1003                } 
     1004        } 
     1005        ExitTask(); 
     1006 
     1007} 
     1008 
     1009void wegpunkt(){ 
     1010 
     1011        if ((int)conf.gps_on_off ==0) {return; } 
     1012 
     1013        char lat[40]; 
     1014        char lon[40]; 
     1015        char hei[40]; 
     1016 
     1017        char vBuf[512]; 
     1018        char bild_name[20]; 
     1019        char wp_name[30]; 
     1020        char gpx_name[30]; 
     1021        char gpx_bild_name[20]; 
     1022 
     1023        unsigned long t; 
     1024        static struct tm *ttm; 
     1025        t=time(NULL); 
     1026        ttm = localtime(&t); 
     1027 
     1028        mkdir_if_not_exist("A/GPS"); 
     1029        mkdir_if_not_exist("A/GPS/Tagging"); 
     1030        sprintf(wp_name, "A/GPS/Tagging/%04d_%02d_%02d.wp", ttm->tm_year+1900, ttm->tm_mon+1, ttm->tm_mday); 
     1031        sprintf(gpx_name, "A/GPS/Tagging/%04d_%02d_%02d.gpx", ttm->tm_year+1900, ttm->tm_mon+1, ttm->tm_mday); 
     1032        sprintf(bild_name, "IMG_%04d.JPG", get_target_file_num()); 
     1033 
     1034        if ((g_d_stat >= ((int)conf.gps_2D_3D_fix)) || ((((int)conf.gps_2D_3D_fix) == 3) && (g_d_stat == 2))) 
     1035        { 
     1036                sprintf(vBuf, "%s;%s;%s;%s;%sT%sZ;%i\n", 
     1037                        bild_name, 
     1038                        formatDouble (lat, g_d_lat, 0, 7), 
     1039                        formatDouble (lon, g_d_lon, 0, 7), 
     1040                        formatDouble (hei, g_d_hei, 0, 2), 
     1041                        g_d_dat, g_d_tim, 
     1042                        get_optical_temp()); 
     1043 
     1044                FILE* fp = fopen(wp_name, "a"); 
     1045 
     1046                if( fp ) 
     1047                { 
     1048                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     1049                } 
     1050                fclose(fp); 
     1051 
     1052                fp = fopen(gpx_name, "r"); 
     1053                if( fp == NULL) 
     1054                { 
     1055                        fp = fopen(gpx_name, "a"); 
     1056                        if( fp ) 
     1057                        { 
     1058                                sprintf(vBuf, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); 
     1059                                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1060                                sprintf(vBuf, "<gpx xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" version=\"1.1\" creator=\"CHDK-DE\" xmlns=\"http://www.topografix.com/GPX/1/1\">\n"); 
     1061                                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1062                                sprintf(vBuf, "</gpx>"); 
     1063                                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1064                                fclose(fp); 
     1065                        } 
     1066                } 
     1067 
     1068 
     1069                sprintf(gpx_bild_name, "IMG_%04d.JPG", get_target_file_num()); 
     1070 
     1071                fp = fopen(gpx_name, "a"); 
     1072                if( fp ) 
     1073                { 
     1074                        fseek (fp, -6, SEEK_END); 
     1075 
     1076                        sprintf(vBuf, "   <wpt lat=\"%s\" lon=\"%s\">\n",formatDouble (lat, g_d_lat, 0, 7), formatDouble (lon, g_d_lon, 0, 7)); 
     1077                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     1078                        sprintf(vBuf, "    <ele>%s</ele>\n",formatDouble (hei, g_d_hei, 0, 2)); 
     1079                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     1080                        sprintf(vBuf, "    <time>%sT%sZ</time>\n", g_d_dat, g_d_tim); 
     1081                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     1082                        sprintf(vBuf, "    <gpst>%sT%sZ</gpst>\n", g_d_dat_gps, g_d_tim_gps); 
     1083                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     1084                        sprintf(vBuf, "    <temp>%i</temp>\n", (int)get_optical_temp()); 
     1085                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     1086                        sprintf(vBuf, "    <name>%s</name>\n", gpx_bild_name); 
     1087                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     1088                        sprintf(vBuf, "   </wpt>\n"); 
     1089                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     1090                        sprintf(vBuf, "</gpx>"); 
     1091                        fwrite(vBuf, strlen(vBuf), 1, fp); 
     1092                } 
     1093                fclose(fp); 
     1094        } 
     1095        else 
     1096        { 
     1097                sprintf(vBuf, "%s %sT%sZ %i\n", 
     1098                        bild_name, 
     1099                        g_d_dat, g_d_tim, 
     1100                        get_optical_temp()); 
     1101 
     1102                if (bild_ohne_signal==0) 
     1103                { 
     1104                        FILE* fp = fopen("A/GPS/Tagging/wp.tmp", "w"); 
     1105 
     1106                        if( fp ) 
     1107                        { 
     1108                                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1109                        } 
     1110                        fclose(fp); 
     1111                        bild_ohne_signal=1; 
     1112                        zeit_bis_ende=(int)conf.gps_wait_for_signal; 
     1113                        _CreateTask("BILDOHNESIGNAL", 0x19, 0x1000, gpx_bild_ohne_signal, 0); 
     1114                } 
     1115                else 
     1116                { 
     1117                        FILE* fp = fopen("A/GPS/Tagging/wp.tmp", "a"); 
     1118 
     1119                        if( fp ) 
     1120                        { 
     1121                                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1122                        } 
     1123                        fclose(fp); 
     1124                        zeit_bis_ende=(int)conf.gps_wait_for_signal; 
     1125                } 
     1126        } 
     1127} 
     1128 
     1129void init_gpx_record_task(){ 
     1130 
     1131        if ((int)conf.gps_on_off ==0) {return; } 
     1132 
     1133        _CreateTask("GPSRECORD", 0x19, 0x800, gpx_record, 0); 
     1134 
     1135        if ((int)conf.gps_track_symbol==1) 
     1136        { 
     1137                _CreateTask("TRACKSYMBOL", 0x19, 0x600, anzeige_track, 0); 
     1138        } 
     1139} 
     1140 
     1141void gpx_record(){ 
     1142 
     1143        if ((int)conf.gps_on_off ==0) {return; } 
     1144 
     1145        char lat[40]; 
     1146        char lon[40]; 
     1147        char hei[40]; 
     1148        char vBuf[512]; 
     1149        int r=0; 
     1150        unsigned long t; 
     1151        char gpx_name[17]; 
     1152        static struct tm *ttm; 
     1153        t=time(NULL); 
     1154        ttm = localtime(&t); 
     1155 
     1156        mkdir_if_not_exist("A/GPS"); 
     1157        mkdir_if_not_exist("A/GPS/Logging"); 
     1158        sprintf(gpx_name, "A/GPS/Logging/%02d_%02d-%02d_%02d.gpx", ttm->tm_mon+1, ttm->tm_mday, ttm->tm_hour, ttm->tm_min); 
     1159 
     1160        FILE* fp = fopen(gpx_name, "w"); 
     1161        if( fp ) 
     1162        { 
     1163                sprintf(vBuf, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); 
     1164                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1165                sprintf(vBuf, "<gpx xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" version=\"1.1\" creator=\"CHDK-DE\" xmlns=\"http://www.topografix.com/GPX/1/1\">\n"); 
     1166                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1167                sprintf(vBuf, " <metadata />\n"); 
     1168                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1169                sprintf(vBuf, " <trk>\n"); 
     1170                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1171                sprintf(vBuf, "  <name />\n"); 
     1172                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1173                sprintf(vBuf, "  <cmt />\n"); 
     1174                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1175                sprintf(vBuf, "  <trkseg>\n"); 
     1176                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1177                sprintf(vBuf, "  </trkseg>\n"); 
     1178                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1179                sprintf(vBuf, " </trk>\n"); 
     1180                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1181                sprintf(vBuf, "</gpx>\n"); 
     1182                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1183        } 
     1184        fclose(fp); 
     1185        int zae=1, zae_1=0, bat; 
     1186        while ( r==0 ) 
     1187        { 
     1188                if (kbd_get_pressed_key() !=0) 
     1189                { 
     1190                        TurnOnBackLight(); 
     1191                        zae_1=0; 
     1192                } 
     1193 
     1194                zae_1++; 
     1195                if ((zae_1 == (int)conf.gps_rec_play_time_1) && ((int)conf.gps_rec_play_set_1 == 1)) 
     1196                { 
     1197                        if ((mode_get()&MODE_MASK) == MODE_REC) 
     1198                        { 
     1199                                levent_set_play(); 
     1200                        } 
     1201                } 
     1202                if ((zae_1 == (int)conf.gps_play_dark_time_1) && ((int)conf.gps_play_dark_set_1 == 1)) 
     1203                { 
     1204                        if ((mode_get()&MODE_MASK) == MODE_PLAY) 
     1205                        { 
     1206                                TurnOffBackLight(); 
     1207                        } 
     1208                } 
     1209                if ( (((zae_1) % 2)) == 0 ) 
     1210                { 
     1211                        debug_led(0); 
     1212                } 
     1213                else 
     1214                { 
     1215                        debug_led(1); 
     1216                } 
     1217                if ( (((zae * (int)conf.gps_track_time) % 60)) == 0 ) 
     1218                { 
     1219                        bat=get_batt_perc(); 
     1220                        if (bat <= (int)conf.gps_batt) 
     1221                        { 
     1222                                int zba; 
     1223                                for(zba=30; zba>0; zba--) 
     1224                                { 
     1225                                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_3)); 
     1226                                        draw_txt_string(0, 8, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     1227                                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_4),zba); 
     1228                                        draw_txt_string(0, 9, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     1229                                        if ( (((zba) % 2)) == 0 ) 
     1230                                        { 
     1231                                                debug_led(0); 
     1232                                                play_sound(6); 
     1233                                        } 
     1234                                        else 
     1235                                        { 
     1236                                                debug_led(1); 
     1237                                        } 
     1238                                        msleep(1000); 
     1239                                } 
     1240                                camera_shutdown_in_a_second(); 
     1241                                ExitTask(); 
     1242                        } 
     1243                } 
     1244 
     1245                if (g_d_stat == 1 || g_d_stat == 2) 
     1246                { 
     1247                        fp = fopen(gpx_name, "a"); 
     1248                        if( fp ) 
     1249                        { 
     1250                                fseek (fp, -27, SEEK_END); 
     1251                                sprintf(vBuf, "   <trkpt lat=\"%s\" lon=\"%s\">\n",formatDouble (lat, g_d_lat, 0, 7), formatDouble (lon, g_d_lon, 0, 7)); 
     1252                                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1253                                sprintf(vBuf, "    <ele>%s</ele>\n",formatDouble (hei, g_d_hei, 0, 2)); 
     1254                                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1255                                sprintf(vBuf, "    <time>%sT%sZ</time>\n", g_d_dat, g_d_tim); 
     1256                                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1257                                sprintf(vBuf, "   </trkpt>\n"); 
     1258                                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1259                                sprintf(vBuf, "  </trkseg>\n"); 
     1260                                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1261                                sprintf(vBuf, " </trk>\n"); 
     1262                                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1263                                sprintf(vBuf, "</gpx>\n"); 
     1264                                fwrite(vBuf, strlen(vBuf), 1, fp); 
     1265                        } 
     1266                        fclose(fp); 
     1267                } 
     1268                msleep((int)conf.gps_track_time*1000); 
     1269                zae++; 
     1270                r=exit_gpx_record; 
     1271                if ((int)conf.gps_on_off ==0) 
     1272                { 
     1273                        r=1; 
     1274                } 
     1275 
     1276        } 
     1277        debug_led(0); 
     1278        ExitTask(); 
     1279 
     1280} 
     1281 
     1282void gps_navigate_home(){ 
     1283 
     1284        if ((int)conf.gps_on_off ==0) {return; } 
     1285 
     1286        char lat[40]; 
     1287        char lon[40]; 
     1288        char vBuf[512]; 
     1289        char text[2][30]; 
     1290        char home_name[30]; 
     1291        char * succ; 
     1292 
     1293        sprintf(home_name, "A/GPS/Navigation/Home.txt"); 
     1294 
     1295        FILE* fp = fopen(home_name, "r"); 
     1296        if( fp ) 
     1297        { 
     1298                fgets(text[1], 15, fp); 
     1299                fgets(text[2], 15, fp); 
     1300        } 
     1301 
     1302 
     1303        g_d_lat_nav = (strtol (text[1], &succ, 10 )) / 10000000.0; 
     1304        g_d_lon_nav = (strtol (text[2], &succ, 10 )) / 10000000.0; 
     1305 
     1306        if ((int)conf.gps_track_symbol==1) 
     1307        { 
     1308                _CreateTask("TRACKSYMBOL", 0x19, 0x600, anzeige_track, 0); 
     1309        } 
     1310 
     1311        if ((int)g_d_lat_nav != 0) 
     1312        { 
     1313                exit_gps_kompass=0; 
     1314                init_gps_kompass_task(); 
     1315                nav_home=1; 
     1316        } 
     1317        else 
     1318        { 
     1319                char vBuf[256]; 
     1320                sprintf(vBuf, lang_str(LANG_MENU_GPS_t_7)); 
     1321                draw_txt_string(0, 8, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     1322                msleep(5000); 
     1323                nav_home=0; 
     1324        } 
     1325} 
     1326 
     1327void init_gps_trackback_task(){ 
     1328 
     1329        if ((int)conf.gps_on_off ==0) {return; } 
     1330 
     1331        int lati[6]; 
     1332        memcpy((void*)lati, camera_jpeg_current_latitude(), sizeof(lati)); 
     1333        g_d_lat_nav=0.0; 
     1334        g_d_lat_nav=(lati[0]/(lati[1]*1.0)) + (lati[2]/(lati[3]*60.0)) + (lati[4]/(lati[5]*3600.0)); 
     1335 
     1336        int longi[6]; 
     1337        memcpy((void*)longi, camera_jpeg_current_longitude(), sizeof(longi)); 
     1338        g_d_lon_nav=0.0; 
     1339        g_d_lon_nav=(longi[0]/(longi[1]*1.0)) + (longi[2]/(longi[3]*60.0)) + (longi[4]/(longi[5]*3600.0)); 
     1340 
     1341        char bild[8]; 
     1342        sprintf(bild, "%s", camera_jpeg_current_filename()); 
     1343 
     1344        if ((int)g_d_lat_nav != 0) 
     1345        { 
     1346                exit_gps_kompass=0; 
     1347                init_gps_kompass_task(); 
     1348        } 
     1349        else 
     1350        { 
     1351                char vBuf[256]; 
     1352                sprintf(vBuf, lang_str(LANG_MENU_GPS_t_8), bild); 
     1353                draw_txt_string(0, 8, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     1354                msleep(5000); 
     1355        } 
     1356} 
     1357 
     1358void init_gps_kompass_task(){ 
     1359 
     1360        if ((int)conf.gps_on_off ==0) {return; } 
     1361 
     1362        _CreateTask("GPSKOMPASS", 0x19, 0x900, anzeige_kompass, 0); 
     1363} 
     1364 
     1365double gps_kurswinkel(int zaehler){ 
     1366 
     1367        if ((int)conf.gps_on_off ==0) {return 0; } 
     1368 
     1369        char vBuf[512]; 
     1370        int angle1=0; 
     1371 
     1372        soll.lat_w = g_d_lat_nav; 
     1373        soll.lon_w = g_d_lon_nav; 
     1374 
     1375        jetzt = (double) (zaehler); 
     1376        readGps                 (&gps);                                         // lese GPS (mit Rauschen) 
     1377 
     1378        georegAdd               (&georeg, jetzt, &gps);                         // füttere die Regression 
     1379        georegActual                    (&georeg, &ist);                                // lese gemittelte Position 
     1380        georegChange                    (&georeg, &speed);                              // lese gemittelte Geschwindigkeit 
     1381        geo2rect                (&speed, &mspeed, ist.lat_w);                           // konvertiere nach m/s (je N/E) 
     1382        rect2polar              (&mspeed, &pspeed);                             // konvertiere in Richtung und Geschw. 
     1383        marsch = radian2deg     (pspeed.alpha);                                 // Marschrichtung 
     1384 
     1385        geodiff                 (&ist, &soll, &delta);                          // Entfernung in Grad (N/E) 
     1386        geo2rect                (&delta, &rdelta, ist.lat_w);                           // Entfernung in m (je N/E) 
     1387        rect2polar              (&rdelta, &pdelta);                             // Entfernung in m und Grad 
     1388        peil    = radian2deg    (pdelta.alpha);                                         // Peilung zum Ziel 
     1389        winkel  = radian2deg    (pdelta.alpha-pspeed.alpha);                                    // Winkel gegenüber Marschrichtung 
     1390 
     1391        regressionAdd                   (&deltareg, jetzt, pdelta.delta);                       // füttere die Regression 
     1392 
     1393        double eta = regressionReverse (&deltareg, 0);                                          // Ankunftszeit (bei akt. geschwindigkeit) 
     1394                                                                                                                                                        // bei Entfernen vom Ziel auch in der Vergangenheit 
     1395        double rest= eta - jetzt;                                               // Restzeit = Ankunftszeit - jetzt 
     1396 
     1397        if (abs(regressionChange (&deltareg))<0.5 || rest < 5.0) rest = 0.0; 
     1398 
     1399        if (exit_gps_navi == 0) 
     1400        { 
     1401                angle1=(int)winkel; 
     1402                char anz1[40]; 
     1403                char anz2[40]; 
     1404                char anz3[40]; 
     1405                char bild[8]; 
     1406 
     1407        if (gui_get_mode()==GUI_MODE_NONE) 
     1408        { 
     1409                sprintf(vBuf, lang_str(LANG_MENU_GPS_t_9), (int)pdelta.delta); 
     1410                draw_txt_string(16, 9, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_WHITE)); 
     1411                 
     1412                int s = (int)rest; 
     1413                int stunden = s / 3600; 
     1414                s = s % 3600; 
     1415                int minuten =  s / 60; 
     1416                s = s % 60; 
     1417                int sekunden = s; 
     1418                 
     1419                sprintf(vBuf, lang_str(LANG_MENU_GPS_t_10), stunden, minuten, sekunden); 
     1420                draw_txt_string(16, 10, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_WHITE)); 
     1421 
     1422                sprintf(vBuf, lang_str(LANG_MENU_GPS_t_11), formatDouble (anz1, (pspeed.delta * 3.6), 0, 1)); 
     1423                draw_txt_string(16, 11, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_WHITE)); 
     1424                sprintf(vBuf, lang_str(LANG_MENU_GPS_t_12), (int)marsch); 
     1425                draw_txt_string(16, 12, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_WHITE)); 
     1426                sprintf(vBuf, lang_str(LANG_MENU_GPS_t_13), (int)winkel); 
     1427                draw_txt_string(16, 13, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_WHITE)); 
     1428 
     1429                if (nav_home==0) 
     1430                { 
     1431                        sprintf(bild, "%s", camera_jpeg_current_filename()); 
     1432                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_14), bild); 
     1433                        draw_txt_string(0, 1, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     1434                } 
     1435                if (nav_home==1) 
     1436                { 
     1437                        sprintf(bild, "%s", camera_jpeg_current_filename()); 
     1438                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_17), bild); 
     1439                        draw_txt_string(0, 1, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     1440                } 
     1441                 
     1442                sprintf(vBuf, lang_str(LANG_MENU_GPS_t_15), formatDouble (anz1, g_d_lat_nav, 0, 7), formatDouble (anz2, g_d_lon_nav, 0, 7)); 
     1443                draw_txt_string(0, 2, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     1444        } 
     1445                 
     1446        } 
     1447        else 
     1448        { 
     1449                angle1=(int)marsch; 
     1450                if (gui_get_mode()==GUI_MODE_NONE) 
     1451                { 
     1452                        sprintf(vBuf, lang_str(LANG_MENU_GPS_t_16), (int)angle1); 
     1453                        draw_txt_string(1, 13, vBuf, MAKE_COLOR(COLOR_GPS_TRANSPARENT, COLOR_GPS_RED)); 
     1454                } 
     1455        } 
     1456 
     1457 
     1458        return angle1; 
     1459 
     1460} 
     1461 
     1462void anzeige_kompass(){ 
     1463 
     1464        if ((int)conf.gps_on_off ==0) {return; } 
     1465 
     1466        #define BITMAP_WIDTH  61 
     1467        #define BITMAP_HEIGHT 61 
     1468 
     1469        georegInit (&georeg, (int)conf.gps_kompass_smooth, buffer1, buffer2); 
     1470        regressionInit (&deltareg, 20, buffer3); 
     1471 
     1472        char *bitmap; 
     1473        char *bitmap1; 
     1474 
     1475        double winkel=0; 
     1476        double gwinkel=0; 
     1477        double bwinkel=0; 
     1478        double w=0.0; 
     1479        double c_w; 
     1480        double s_w; 
     1481 
     1482        int rr=0; 
     1483        int n=0; 
     1484        int zaehler=0; 
     1485        int mx=0; 
     1486        int my=0; 
     1487        int m=0; 
     1488        int alter_winkel=0; 
     1489 
     1490        int offset_x = 32; 
     1491        int m_x = offset_x + 31; 
     1492        int offset_y = 150;             //128 
     1493        int m_y = offset_y + 31; 
     1494        int b_b = BITMAP_WIDTH; 
     1495 
     1496        int f_v_0=COLOR_GPS_TRANSPARENT; 
     1497        int f_h_0=COLOR_GPS_TRANSPARENT; 
     1498 
     1499        int f_v_1=COLOR_GPS_BLUE; 
     1500        int f_h_1=COLOR_GPS_BLUE; 
     1501 
     1502        int f_v_2=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_WHITE : COLOR_GPS_PLAY_WHITE; 
     1503        int f_h_2=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_WHITE : COLOR_GPS_PLAY_WHITE; 
     1504 
     1505        int f_v_3=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLACK : COLOR_GPS_PLAY_BLACK; 
     1506        int f_h_3=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLACK : COLOR_GPS_PLAY_BLACK; 
     1507 
     1508        int f_v_4=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLACK : COLOR_GPS_PLAY_BLACK; 
     1509        int f_h_4=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLACK : COLOR_GPS_PLAY_BLACK; 
     1510 
     1511        double alter_c_w=cos(0); 
     1512        double alter_s_w=sin(0); 
     1513 
     1514        bitmap = load_bitmap("A/CHDK/DATA/GPS_Pfeil.txt"); 
     1515        bitmap1 = load_bitmap("A/CHDK/DATA/GPS_Kreis.txt"); 
     1516        int laenge = strlen(bitmap); 
     1517 
     1518        while ( rr==0 ) 
     1519        { 
     1520                gwinkel=gps_kurswinkel(zaehler); 
     1521 
     1522                zaehler++; 
     1523                m=n; 
     1524 
     1525                if ((int)gwinkel != 0) {m=gwinkel; } 
     1526 
     1527                if (g_d_stat == 0 ) 
     1528                { 
     1529                        f_v_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_RED : COLOR_GPS_PLAY_RED; 
     1530                        f_h_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_RED : COLOR_GPS_PLAY_RED; 
     1531                } 
     1532                if (g_d_stat == 1 ) 
     1533                { 
     1534                        f_v_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_YELLOW : COLOR_GPS_PLAY_YELLOW; 
     1535                        f_h_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_YELLOW : COLOR_GPS_PLAY_YELLOW; 
     1536                } 
     1537                if (g_d_stat == 2 ) 
     1538                { 
     1539                        f_v_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_GREEN : COLOR_GPS_PLAY_GREEN; 
     1540                        f_h_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_GREEN : COLOR_GPS_PLAY_GREEN; 
     1541                } 
     1542                if (gui_get_mode()==GUI_MODE_NONE) 
     1543                { 
     1544                        anzeige_kompassbild (bitmap1, offset_x - 27, offset_y -14, f_v_0, f_h_0, f_v_1, f_h_1, f_v_2, f_h_2, f_v_4, f_h_4); 
     1545                } 
     1546                if (g_d_stat == 2 ) 
     1547                { 
     1548                        f_v_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLUE : COLOR_GPS_PLAY_BLUE; 
     1549                        f_h_1=((mode_get()&MODE_MASK) == MODE_REC) ? COLOR_GPS_BLUE : COLOR_GPS_PLAY_BLUE; 
     1550                } 
     1551                if (m>=0 && m<180) 
     1552                { 
     1553                        w=(180-m)*3.141592653589793/180; 
     1554                } 
     1555                if (m >=180 && m<=360) 
     1556                { 
     1557                        w=(540-m)*3.141592653589793/180; 
     1558                } 
     1559 
     1560                c_w=cos(w); 
     1561                s_w=sin(w); 
     1562                 
     1563                if (gui_get_mode()==GUI_MODE_NONE) 
     1564                { 
     1565                        anzeige_kompassnadel (alter_winkel, alter_s_w, alter_c_w, bitmap, laenge, m_x, m_y, offset_x, offset_y, f_v_0, f_h_0, f_v_0, f_h_0); 
     1566                        anzeige_kompassnadel (m, s_w, c_w, bitmap, laenge, m_x, m_y, offset_x, offset_y, f_v_1, f_h_1, f_v_3, f_h_3); 
     1567                } 
     1568                alter_winkel=m; 
     1569                alter_c_w=cos(w); 
     1570                alter_s_w=sin(w); 
     1571 
     1572                rr=exit_gps_kompass; 
     1573                if ((int)conf.gps_on_off ==0) 
     1574                { 
     1575                        rr=1; 
     1576                } 
     1577 
     1578        } 
     1579        nav_home=0; 
     1580        ExitTask(); 
     1581} 
     1582 
     1583char *load_bitmap(char *datei){ 
     1584 
     1585        if ((int)conf.gps_on_off ==0) {return 0; } 
     1586 
     1587        FILE *fd; 
     1588        char *bitmap; 
     1589        int bitmap_size; 
     1590        size_t result; 
     1591 
     1592        fd = fopen ( datei, "r" ); 
     1593 
     1594        fseek (fd, 0, SEEK_END); 
     1595        bitmap_size = ftell (fd); 
     1596        fseek (fd, 0, SEEK_SET); 
     1597 
     1598        bitmap = (char*) malloc (sizeof(char)*bitmap_size); 
     1599        result = fread (bitmap,1,bitmap_size,fd); 
     1600        fclose (fd); 
     1601 
     1602        return bitmap; 
     1603 
     1604        free(bitmap); 
     1605 
     1606} 
     1607 
     1608void anzeige_kompassnadel (int winkel, double s_w, double c_w, char *bitmap, int laenge, int m_x, int m_y, int offset_x, int offset_y, int f_v_1, int f_h_1, int f_v_2, int f_h_2){ 
     1609 
     1610        if ((int)conf.gps_on_off ==0) {return; } 
     1611 
     1612        if(bitmap) 
     1613        { 
     1614                int mx=0; 
     1615                int my=0; 
     1616                int px=0; 
     1617                int py=0; 
     1618 
     1619                int pos=0; 
     1620                int x_n; 
     1621                int y_n; 
     1622 
     1623                if (winkel==0 || winkel==360) 
     1624                { 
     1625                        s_w = 0; 
     1626                        c_w = -1; 
     1627                } 
     1628 
     1629                if (winkel==270) 
     1630                { 
     1631                        s_w = -1; 
     1632                        c_w = 0; 
     1633                } 
     1634 
     1635                for(pos=0; pos<laenge; pos++) 
     1636                { 
     1637                        int data = bitmap[pos]; 
     1638                        if (data >= 49) 
     1639                        { 
     1640                                px=offset_x+mx; 
     1641                                py=offset_y+my; 
     1642 
     1643                                x_n = m_x + Round(((c_w * (m_x - px)) + (s_w * (m_y - py))),2); 
     1644                                y_n = m_y + Round(((c_w * (m_y - py)) - (s_w * (m_x - px))),2); 
     1645 
     1646                                if (data == 49) 
     1647                                { 
     1648                                        draw_pixel(x_n, y_n, MAKE_COLOR(f_v_1, f_h_1)); 
     1649                                } 
     1650                                if (data == 50) 
     1651                                { 
     1652                                        draw_pixel(x_n, y_n, MAKE_COLOR(f_v_2, f_h_2)); 
     1653                                } 
     1654                        } 
     1655                        if (data == 10 || data == 13) 
     1656                        { 
     1657                                mx=0; 
     1658                                my++; 
     1659                                pos++; 
     1660                        } 
     1661                        else 
     1662                        { 
     1663                                mx++; 
     1664                        } 
     1665                } 
     1666 
     1667        } 
     1668} 
     1669 
     1670void anzeige_kompassbild (char *bitmap1, int o_x, int o_y, int f_v_0, int f_h_0, int f_v_1, int f_h_1, int f_v_2, int f_h_2, int f_v_4, int f_h_4){ 
     1671 
     1672        if ((int)conf.gps_on_off ==0) {return; } 
     1673 
     1674        if(bitmap1) 
     1675        { 
     1676                int laenge = strlen(bitmap1); 
     1677                int pos=0; 
     1678                int mx=0; 
     1679                int my=0; 
     1680 
     1681                for(pos=0; pos<laenge; pos++) 
     1682                { 
     1683                        int data = bitmap1[pos]; 
     1684                        if (data == 48) 
     1685                        { 
     1686                                draw_pixel(o_x+mx, o_y+my, MAKE_COLOR(f_v_0, f_h_0)); 
     1687                        } 
     1688                        if (data == 49) 
     1689                        { 
     1690                                draw_pixel(o_x+mx, o_y+my, MAKE_COLOR(f_v_1, f_h_1)); 
     1691                        } 
     1692                        if (data == 50) 
     1693                        { 
     1694                                draw_pixel(o_x+mx, o_y+my, MAKE_COLOR(f_v_2, f_h_2)); 
     1695                        } 
     1696                        if (data == 51) 
     1697                        { 
     1698                                draw_pixel(o_x+mx, o_y+my, MAKE_COLOR(f_v_4, f_h_4)); 
     1699                        } 
     1700                        if (data == 10 || data == 13) 
     1701                        { 
     1702                                mx=0; 
     1703                                my++; 
     1704                                pos++; 
     1705                        } 
     1706                        else 
     1707                        { 
     1708                                mx++; 
     1709                        } 
     1710                } 
     1711 
     1712        } 
     1713} 
     1714 
     1715#endif 
     1716 
     1717/*----------------------------------------------------------------------------------- 
     1718**      $Id: gps.c, v 1.2 2012/01/05 genie01 Exp $ 
     1719**---------------------------------------------------------------------------------*/ 
  • trunk/core/gps.h

    r1558 r1719  
     1/*----------------------------------------------------------------------------------- 
     2**      $Id: gps.h, v 1.1 2011/11/20 genie01 Exp $ 
     3**---------------------------------------------------------------------------------*/ 
    14#ifndef __CHDK_GPS_H 
    25#define __CHDK_GPS_H 
     
    1619} tGPS; 
    1720 
     21extern int _CreateTask (const char *name, int prio, int stack_size /*?*/, void *entry, long parm /*?*/); 
    1822void gps_getData(tGPS* gps); 
     23extern void GPS_UpdateData(); 
     24void gps_get_data(); 
     25void anzeige_gps(); 
     26void write_timezone(); 
     27void write_home(); 
     28void test_timezone(); 
     29void gpx_bild_ohne_signal(); 
     30void wegpunkt(); 
     31void init_gpx_record_task(); 
     32void gpx_record(); 
     33void init_gps_kompass_task(); 
     34void anzeige_kompass(); 
     35void init_gps_trackback_task(); 
     36void trackback(); 
     37char *load_bitmap(char *datei); 
     38void anzeige_kompassnadel (int winkel, double s_w, double c_w, char *bitmap, int laenge, int m_x, int m_y, int offset_x, int offset_y, int f_v_1, int f_h_1, int f_v_2, int f_h_2); 
     39void anzeige_kompassbild (char *bitmap1, int o_x, int o_y, int f_v_0, int f_h_0, int f_v_1, int f_h_1, int f_v_2, int f_h_2, int f_v_4, int f_h_4); 
     40#endif 
    1941 
    20 #endif 
     42/*----------------------------------------------------------------------------------- 
     43**      $Id: gps.h, v 1.1 2011/11/20 genie01 Exp $ 
     44**---------------------------------------------------------------------------------*/ 
  • trunk/core/gui.c

    r1693 r1719  
    124124#endif 
    125125 
     126#if CAM_HAS_ZOOM_LEVER 
     127    #define SHORTCUT_SD_SUB KEY_ZOOM_OUT 
     128    #define SHORTCUT_SD_ADD KEY_ZOOM_IN 
     129#endif 
    126130 
    127131// forward declarations 
     
    135139static void gui_draw_osd(); 
    136140 
     141#ifdef CAM_HAS_GPS 
     142int exit_gpx_record=1; 
     143int exit_gps_kompass=1; 
     144int exit_gps_navi=1; 
     145int exit_gps_data=1; 
     146 
     147extern void init_gpx_record_task(); 
     148extern void init_gps_kompass_task(); 
     149extern void init_gps_trackback_task(); 
     150extern void gps_record(int arg); 
     151extern void gps_get_data(); 
     152extern void write_timezone(); 
     153extern void write_home(); 
     154extern void gps_navigate_home(); 
     155 
     156 
     157static void gpx_start_stop(int arg); 
     158static void show_kompass(int arg); 
     159static void show_navi(int arg); 
     160 
     161static void mark_timezone(int arg); 
     162static void mark_home(int arg); 
     163static void navigate_home(int arg); 
     164 
     165extern int _CreateTask (const char *name, int prio, int stack_size /*?*/,void *entry, long parm /*?*/); 
     166 
     167#endif 
    137168static void gui_draw_splash(char* logo, int logo_size); 
    138169 
     
    190221#endif 
    191222 
     223#if CAM_REMOTE 
     224    static const char* gui_show_usb_info_enum(int change, int arg); 
     225#endif 
    192226void rinit(); 
    193227 
    194228// Menu callbacks 
    195229//------------------------------------------------------------------- 
     230void cb_autoiso_menu_change(unsigned int item); // Used from conf loader 
    196231static void cb_step_25(); 
    197232static void cb_perc(); 
     
    288323static CMenuItem autoiso_submenu_items[] = { 
    289324    MENU_ITEM   (0x5c,LANG_MENU_AUTOISO_ENABLED,            MENUITEM_BOOL,                                      &conf.autoiso_enable,       0 ), 
    290     MENU_ENUM2  (0x5f,LANG_MENU_AUTOISO_MIN_SHUTTER,            &conf.autoiso_shutter, gui_autoiso_shutter_modes ), 
     325    MENU_ENUM2  (0x5f,LANG_MENU_AUTOISO_MIN_SHUTTER,            &conf.autoiso_shutter_enum, gui_autoiso_shutter_modes ), 
    291326    MENU_ITEM   (0x5f,LANG_MENU_AUTOISO_USER_FACTOR,        MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_user_factor,      MENU_MINMAX(1, 8) ), 
    292327 
     
    294329    MENU_ITEM   (0x5f,LANG_MENU_AUTOISO_IS_FACTOR,          MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_is_factor,        MENU_MINMAX(1, 8) ), 
    295330#endif 
    296     MENU_ITEM(0x5f,LANG_MENU_AUTOISO_MAX_ISO_HI,      MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_max_iso_hi, MENU_MINMAX(20, 160) ), 
    297     MENU_ITEM(0x5f,LANG_MENU_AUTOISO_MAX_ISO_AUTO, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_max_iso_auto, MENU_MINMAX(10, 80) ), 
    298     MENU_ITEM(0x5f,LANG_MENU_AUTOISO_MIN_ISO,           MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_min_iso, MENU_MINMAX(1, 20) ), 
    299  
     331 
     332    MENU_ITEM   (0x5f,LANG_MENU_AUTOISO_MIN_ISO,            MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_min_iso,          MENU_MINMAX(1, 20) ), 
     333    MENU_ITEM   (0x5f,LANG_MENU_AUTOISO_MAX_ISO_AUTO,           MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_max_iso_auto,         MENU_MINMAX(10, 80) ), 
     334 
     335        //@tsv 
     336    MENU_ENUM2  (0x5f,LANG_MENU_AUTOISO_MIN_SHUTTER2,           &conf.autoiso2_shutter_enum, gui_autoiso2_shutter_modes ), 
     337    MENU_ITEM   (0x5f,LANG_MENU_AUTOISO_MAX_ISO2,                       MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso2_max_iso_auto,        MENU_MINMAX(10, 100) ), 
     338 
     339#if !defined(CAMERA_sx230hs) 
     340    MENU_ITEM   (0x5f,LANG_MENU_AUTOISO_MAX_ISO_HI,         MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso_max_iso_hi,               MENU_MINMAX(20, 160) ), 
     341#endif 
     342 
     343    MENU_ENUM2  (0x5f,LANG_MENU_AUTOISO_OVEREXP_EV,             &conf.overexp_ev_enum, gui_overexp_ev_modes ), 
     344    MENU_ITEM   (0x57,LANG_MENU_ZEBRA_OVER,                     MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.autoiso2_over,                        MENU_MINMAX(0, 32) ), 
     345    MENU_ITEM   (0x5f,LANG_MENU_AUTOISO_OVEREXP_THRES,          MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.overexp_threshold,            MENU_MINMAX(1, 20) ), 
    300346 
    301347    MENU_ITEM   (0x51,LANG_MENU_BACK,                       MENUITEM_UP,    0,                                                              0 ), 
    302348    {0} 
    303349}; 
    304 static CMenu autoiso_submenu = {0x2d,LANG_MENU_AUTOISO_TITLE, NULL, autoiso_submenu_items }; 
     350//static CMenu autoiso_submenu = {0x2d,LANG_MENU_AUTOISO_TITLE, NULL, autoiso_submenu_items }; 
     351static CMenu autoiso_submenu = {0x2d,LANG_MENU_AUTOISO_TITLE, cb_autoiso_menu_change, autoiso_submenu_items }; 
    305352 
    306353 
     
    334381}; 
    335382static CMenu debug_submenu = {0x2a,LANG_MENU_DEBUG_TITLE, NULL, debug_submenu_items }; 
     383#endif 
     384#ifdef CAM_HAS_GPS 
     385 
     386static CMenuItem gps_logging_items[] = { 
     387    MENU_ITEM   (0x2a,LANG_MENU_GPS_TRACK_TIME,                         MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,     &conf.gps_track_time,           MENU_MINMAX(1, 60) ), 
     388    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                                                                 0,                                                      0 ), 
     389    MENU_ITEM   (0x2a,LANG_MENU_GPS_TRACK_SYMBOL,                       MENUITEM_BOOL,                                                                          &conf.gps_track_symbol,         0 ), 
     390    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                                                                 0,                                                      0 ), 
     391    MENU_ITEM   (0x2a,LANG_MENU_GPS_REC_PLAY_SET_1,                     MENUITEM_BOOL,                                                                  &conf.gps_rec_play_set_1,       0 ), 
     392    MENU_ITEM   (0x2a,LANG_MENU_GPS_REC_PLAY_TIME_1,            MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,     &conf.gps_rec_play_time_1,      MENU_MINMAX(1, 60) ), 
     393    MENU_ITEM   (0x2a,LANG_MENU_GPS_PLAY_DARK_SET_1,            MENUITEM_BOOL,                                                                  &conf.gps_play_dark_set_1,      0 ), 
     394    MENU_ITEM   (0x2a,LANG_MENU_GPS_PLAY_DARK_TIME_1,           MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,     &conf.gps_play_dark_time_1,     MENU_MINMAX(1, 60) ), 
     395    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                                                                 0,                                                      0 ), 
     396    MENU_ITEM   (0x51,LANG_MENU_BACK,                       MENUITEM_UP,                                                        0,                                                      0 ), 
     397    {0} 
     398}; 
     399static CMenu gps_logging_submenu = {0x86,LANG_MENU_GPS_LOGGING, NULL, gps_logging_items }; 
     400 
     401static CMenuItem gps_tagging_items[] = { 
     402    MENU_ITEM   (0x5c,LANG_MENU_GPS_WAYPOINT_SAVE,          MENUITEM_BOOL,                      &conf.gps_waypoint_save,                        0 ), 
     403    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                                                                 0,                                                      0 ), 
     404    MENU_ITEM   (0x2a,LANG_MENU_GPS_WAIT_FOR_SIGNAL,            MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,     &conf.gps_wait_for_signal,      MENU_MINMAX(1, 599) ), 
     405    MENU_ITEM   (0x2a,LANG_MENU_GPS_WAIT_FOR_SIGNAL_TIME,       MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,     &conf.gps_wait_for_signal_time, MENU_MINMAX(1, 60) ), 
     406    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                                                                 0,                                                      0 ), 
     407    MENU_ITEM   (0x2a,LANG_MENU_GPS_REC_PLAY_SET,                       MENUITEM_BOOL,                                                                  &conf.gps_rec_play_set,         0 ), 
     408    MENU_ITEM   (0x2a,LANG_MENU_GPS_REC_PLAY_TIME,                      MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,     &conf.gps_rec_play_time,        MENU_MINMAX(1, 60) ), 
     409    MENU_ITEM   (0x2a,LANG_MENU_GPS_PLAY_DARK_SET,                      MENUITEM_BOOL,                                                                  &conf.gps_play_dark_set,        0 ), 
     410    MENU_ITEM   (0x2a,LANG_MENU_GPS_PLAY_DARK_TIME,                     MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,     &conf.gps_play_dark_time,       MENU_MINMAX(1, 60) ), 
     411    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                                                                 0,                                                      0 ), 
     412    MENU_ITEM   (0x5c,LANG_MENU_GPS_COUNTDOWN,                  MENUITEM_BOOL,                                                                  &conf.gps_countdown     ,               0 ), 
     413//    MENU_ITEM (0x5c,LANG_MENU_GPS_COUNTDOWN_BLINK,            MENUITEM_BOOL,                                                                  &conf.gps_countdown_blink,      0 ), 
     414    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                                                                 0,                                                      0 ), 
     415    MENU_ITEM   (0x51,LANG_MENU_BACK,                       MENUITEM_UP,                                                        0,                                                      0 ), 
     416    {0} 
     417}; 
     418static CMenu gps_tagging_submenu = {0x86,LANG_MENU_GPS_TAGGING, NULL, gps_tagging_items }; 
     419 
     420 
     421static CMenuItem gps_navigation_items[] = { 
     422    MENU_ITEM   (0x2a,LANG_MENU_GPS_KOMPASS_SMOOTH,                     MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,     &conf.gps_kompass_smooth,       MENU_MINMAX(1, 40) ), 
     423    MENU_ITEM   (0x2a,LANG_MENU_GPS_KOMPASS_TIME,                       MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,     &conf.gps_kompass_time,         MENU_MINMAX(1, 60) ), 
     424    MENU_ITEM   (0x2a,LANG_MENU_GPS_NAVI_TIME,                          MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,     &conf.gps_navi_time,            MENU_MINMAX(1, 60) ), 
     425    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                                                                 0,                                                      0 ), 
     426    MENU_ITEM   (0x2a,LANG_MENU_GPS_MARK_HOME,              MENUITEM_PROC,                      (int*)mark_home,                                        0 ), 
     427    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                                                                 0,                                                      0 ), 
     428    MENU_ITEM   (0x51,LANG_MENU_BACK,                       MENUITEM_UP,                                                        0,                                                      0 ), 
     429    {0} 
     430}; 
     431static CMenu gps_navigation_submenu = {0x86,LANG_MENU_GPS_NAVIGATION, NULL, gps_navigation_items }; 
     432 
     433 
     434static const char* gui_gps_sat_fix[] =                  { "immer", "2D", "3D", "2D/3D" }; 
     435static CMenuItem gps_values_items[] = { 
     436    MENU_ITEM   (0x2a,LANG_MENU_GPS_BATT,                                       MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,     &conf.gps_batt,                         MENU_MINMAX(0, 99) ), 
     437    MENU_ITEM   (0x2a,LANG_MENU_GPS_BATT_WARNING,                       MENUITEM_BOOL,                                                                          &conf.gps_batt_warn,            0 ), 
     438    MENU_ITEM   (0x2a,LANG_MENU_GPS_BEEP_WARNING,                       MENUITEM_BOOL,                                                                          &conf.gps_beep_warn,            0 ), 
     439    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                                                                 0,                                                      0 ), 
     440    MENU_ENUM2  (0x69,LANG_MENU_GPS_2D_3D_FIX,                          &conf.gps_2D_3D_fix,                                                            gui_gps_sat_fix ), 
     441    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                                                                 0,                                                      0 ), 
     442    MENU_ITEM   (0x2a,LANG_MENU_GPS_SYMBOL_SHOW,                        MENUITEM_BOOL,                                                                          &conf.gps_show_symbol,          0 ), 
     443    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                                                                 0,                                                      0 ), 
     444    MENU_ITEM   (0x2a,LANG_MENU_GPS_TEST_TIMEZONE,                      MENUITEM_BOOL,                                                                          &conf.gps_test_timezone,        0 ), 
     445    MENU_ITEM   (0x2a,LANG_MENU_GPS_MARK_TIMEZONE,          MENUITEM_PROC,                      (int*)mark_timezone,                            0 ), 
     446    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                         0,                                                                      0 ), 
     447    MENU_ITEM   (0x51,LANG_MENU_BACK,                       MENUITEM_UP,                                                        0,                                                      0 ), 
     448    {0} 
     449}; 
     450static CMenu gps_values_submenu = {0x86,LANG_MENU_GPS_VALUES, NULL, gps_values_items }; 
     451 
     452 
     453static CMenuItem gps_submenu_items[] = { 
     454    MENU_ITEM   (0x2a,LANG_MENU_GPS_ON_OFF,                                     MENUITEM_BOOL,                                  &conf.gps_on_off,                                       0 ), 
     455    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                         0,                                                                      0 ), 
     456    MENU_ITEM   (0x2a,LANG_MENU_GPS_KOMPASS_SHOW,           MENUITEM_PROC,                              (int*)show_kompass,                                     0 ), 
     457    MENU_ITEM   (0x2a,LANG_MENU_GPS_NAVI_SHOW,              MENUITEM_PROC,                      (int*)show_navi,                                        0 ), 
     458    MENU_ITEM   (0x2a,LANG_MENU_GPS_NAVI_HOME,              MENUITEM_PROC,                      (int*)navigate_home,                            0 ), 
     459    MENU_ITEM   (0x2a,LANG_MENU_GPS_TRACK_START,            MENUITEM_PROC,                      (int*)gpx_start_stop,                           0 ), 
     460    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                         0,                                                                      0 ), 
     461    MENU_ITEM   (0x2a,LANG_MENU_GPS_VALUES,                     MENUITEM_SUBMENU,               &gps_values_submenu,                    0 ), 
     462    MENU_ITEM   (0x2a,LANG_MENU_GPS_LOGGING,                    MENUITEM_SUBMENU,               &gps_logging_submenu,                   0 ), 
     463    MENU_ITEM   (0x2a,LANG_MENU_GPS_TAGGING,                    MENUITEM_SUBMENU,               &gps_tagging_submenu,                   0 ), 
     464    MENU_ITEM   (0x2a,LANG_MENU_GPS_NAVIGATION,                 MENUITEM_SUBMENU,               &gps_navigation_submenu,            0 ), 
     465    MENU_ITEM   (0x0 ,(int)"",                              MENUITEM_SEPARATOR,                         0,                                                                      0 ), 
     466    MENU_ITEM   (0x51,LANG_MENU_BACK,                       MENUITEM_UP,                                        0,                                  0 ), 
     467    {0} 
     468}; 
     469static CMenu gps_submenu = {0x2a,LANG_MENU_GPS, NULL, gps_submenu_items }; 
     470 
    336471#endif 
    337472 
     
    406541    MENU_ITEM   (0x5c,LANG_MENU_SPACE_SHOW_PERCENT,         MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.space_perc_show, (int)cb_space_perc ), 
    407542    MENU_ITEM   (0x5c,LANG_MENU_SPACE_SHOW_MB,              MENUITEM_BOOL|MENUITEM_ARG_CALLBACK, &conf.space_mb_show,   (int)cb_space_mb ), 
     543#if CAM_MULTIPART 
     544    MENU_ITEM   (0x5c,LANG_MENU_SHOW_PARTITION_NR,          MENUITEM_BOOL,          &conf.show_partition_nr, 0 ), 
     545#endif 
    408546    MENU_ENUM2  (0x5f,LANG_MENU_SPACE_WARN_TYPE,            &conf.space_warn_type,  gui_space_warn_type_modes ), 
    409547    MENU_ITEM   (0x58,LANG_MENU_SPACE_WARN_PERCENT,         MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,   &conf.space_perc_warn,    MENU_MINMAX(1, 99) ), 
     
    424562    MENU_ITEM   (0x5c,LANG_MENU_DOF_HYPERFOCAL_IN_MISC,     MENUITEM_BOOL,      &conf.dof_hyperfocal_in_misc,       0 ), 
    425563    MENU_ITEM   (0x5c,LANG_MENU_DOF_DEPTH_LIMIT_IN_MISC,    MENUITEM_BOOL,      &conf.dof_depth_in_misc,            0 ), 
    426 #if !CAM_DRYOS 
    427       MENU_ITEM(0x5c,LANG_MENU_DOF_DIST_FROM_LENS,           MENUITEM_BOOL,      &conf.dof_dist_from_lens, 0), 
    428 #endif 
    429564    MENU_ITEM   (0x51,LANG_MENU_BACK,                       MENUITEM_UP,        0,                                  0 ), 
    430565    {0} 
     
    601736    //MENU_ITEM(0x65,LANG_MENU_VIS_ZEBRA_UNDER,         MENUITEM_COLOR_BG,  &conf.zebra_color, 0 ),         // moved to zebra menu 
    602737    //MENU_ITEM(0x65,LANG_MENU_VIS_ZEBRA_OVER,          MENUITEM_COLOR_FG,  &conf.zebra_color, 0 ),         // moved to zebra menu 
    603     MENU_ITEM(0x65,LANG_MENU_VIS_BATT_ICON,           MENUITEM_COLOR_FG,  &conf.batt_icon_color, 0 ), 
     738    //MENU_ITEM(0x65,LANG_MENU_VIS_BATT_ICON,           MENUITEM_COLOR_FG,  &conf.batt_icon_color, 0 ), 
    604739    MENU_ITEM(0x65,LANG_MENU_VIS_SPACE_ICON,          MENUITEM_COLOR_FG,  &conf.space_color, 0 ), 
    605740    MENU_ITEM(0x65,LANG_MENU_VIS_SPACE_ICON_BKG,      MENUITEM_COLOR_BG,  &conf.space_color, 0 ), 
     
    772907#ifndef OPTIONS_AUTOSAVE 
    773908    MENU_ITEM   (0x33,LANG_MENU_MAIN_SAVE_OPTIONS,          MENUITEM_PROC,      gui_menuproc_save,  0 ), 
    774  
     909#endif 
     910#ifdef CAM_HAS_GPS 
     911    MENU_ITEM   (0x2a,LANG_MENU_GPS,                        MENUITEM_SUBMENU,   &gps_submenu,           0 ), 
    775912#endif 
    776913    {0} 
     
    780917 
    781918static int gui_user_menu_flag; 
     919 
     920static char buf[256]; 
     921 
     922//------------------------------------------------------------------- 
     923#ifdef CAM_HAS_GPS 
     924 
     925void gpx_start_stop(int arg) { 
     926    int i = 0; 
     927    while( gps_submenu_items[i].value != (int*)gpx_start_stop ) i++;    //find entry 
     928    if( gps_submenu_items[i].text == LANG_MENU_GPS_TRACK_START ) {  //toggle text 
     929        gps_submenu_items[i].text = LANG_MENU_GPS_TRACK_STOP; 
     930                exit_gpx_record = 0; 
     931                init_gpx_record_task(); 
     932 
     933    } else { 
     934        gps_submenu_items[i].text = LANG_MENU_GPS_TRACK_START; 
     935                exit_gpx_record = 1; 
     936    } 
     937} 
     938 
     939void show_kompass(int arg){ 
     940    int i = 0; 
     941    while( gps_submenu_items[i].value != (int*)show_kompass ) i++;    //find entry 
     942    if( gps_submenu_items[i].text == LANG_MENU_GPS_KOMPASS_SHOW ) {  //toggle text 
     943        gps_submenu_items[i].text = LANG_MENU_GPS_KOMPASS_HIDE; 
     944                exit_gps_kompass = 0; 
     945                init_gps_kompass_task(); 
     946 
     947    } else { 
     948        gps_submenu_items[i].text = LANG_MENU_GPS_KOMPASS_SHOW; 
     949                exit_gps_kompass = 1; 
     950    } 
     951} 
     952 
     953void show_navi(int arg){ 
     954    int i = 0; 
     955    while( gps_submenu_items[i].value != (int*)show_navi ) i++;    //find entry 
     956    if( gps_submenu_items[i].text == LANG_MENU_GPS_NAVI_SHOW ) {  //toggle text 
     957        gps_submenu_items[i].text = LANG_MENU_GPS_NAVI_HIDE; 
     958                exit_gpx_record = 0; 
     959                exit_gps_navi = 0; 
     960                exit_gps_kompass = 0; 
     961                init_gps_trackback_task(); 
     962 
     963    } else { 
     964        gps_submenu_items[i].text = LANG_MENU_GPS_NAVI_SHOW; 
     965                exit_gps_navi = 1; 
     966                exit_gps_kompass = 1; 
     967                exit_gpx_record = 1; 
     968    } 
     969} 
     970 
     971void navigate_home(int arg){ 
     972        int i = 0; 
     973    while( gps_submenu_items[i].value != (int*)navigate_home ) i++;    //find entry 
     974    if( gps_submenu_items[i].text == LANG_MENU_GPS_NAVI_HOME ) {  //toggle text 
     975        gps_submenu_items[i].text = LANG_MENU_GPS_NAVI_HOME_END; 
     976                exit_gpx_record = 0; 
     977                exit_gps_navi = 0; 
     978                exit_gps_kompass = 0; 
     979                gps_navigate_home(); 
     980 
     981    } else { 
     982        gps_submenu_items[i].text = LANG_MENU_GPS_NAVI_HOME; 
     983                exit_gps_navi = 1; 
     984                exit_gps_kompass = 1; 
     985                exit_gpx_record = 1; 
     986    } 
     987} 
     988 
     989void mark_timezone(int arg){ 
     990write_timezone(); 
     991} 
     992 
     993void mark_home(int arg){ 
     994write_home(); 
     995} 
     996 
     997#endif 
    782998 
    783999//------------------------------------------------------------------- 
     
    8401056#endif 
    8411057 
     1058void cb_autoiso_menu_change(unsigned int item) 
     1059{ 
     1060    conf.autoiso_min_shutter_numerator = shutter1_values[conf.autoiso_shutter_enum]; 
     1061    conf.autoiso2_min_shutter_numerator =  shutter2_values[conf.autoiso2_shutter_enum]; 
     1062 
     1063    conf.autoiso_max_iso_auto_real=0;   // set invalid value of real autoiso as flag 'need recalc' 
     1064} 
     1065 
    8421066/* 
    8431067common code for "enum" menu items that just take a list of string values and don't require any special setters 
     
    8651089} 
    8661090 
     1091//------------------------------------------------------------------- 
     1092#if CAM_REMOTE 
     1093    const char* gui_show_usb_info_enum(int change, int arg) { 
     1094        static const char* modes[]={ "Off", "Icon", "Text"}; 
     1095 
     1096        gui_enum_value_change(&conf.usb_info_enable,change,sizeof(modes)/sizeof(modes[0])); 
     1097 
     1098        return modes[conf.usb_info_enable]; 
     1099    } 
     1100#endif 
     1101//------------------------------------------------------------------- 
    8671102#ifdef OPT_SCRIPTING 
    8681103//------------------------------------------------------------------- 
     
    10241259// Equivalent to ALT 
    10251260    static const char* modes[]={ "Never", "Alt", "Script", "Always" }; 
    1026         gui_enum_value_change(&conf.alt_prevent_shutdown,change,sizeof(modes)/sizeof(modes[0])); 
    1027  
    1028         conf_update_prevent_shutdown(); 
    1029  
     1261 
     1262    gui_enum_value_change(&conf.alt_prevent_shutdown,change,sizeof(modes)/sizeof(modes[0])); 
     1263         
    10301264    return modes[conf.alt_prevent_shutdown]; 
    10311265} 
     
    10451279 
    10461280//------------------------------------------------------------------- 
     1281const char* gui_tv_bracket_values_enum(int change, int arg) { 
     1282    static const char* modes[]={ "Off", "1/3 Ev","2/3 Ev", "1 Ev", "1 1/3Ev", "1 2/3Ev", "2 Ev", "2 1/3Ev", "2 2/3Ev", "3 Ev", "3 1/3Ev", "3 2/3Ev", "4 Ev"}; 
     1283 
     1284    return gui_change_simple_enum(&conf.tv_bracket_value,change,modes,sizeof(modes)/sizeof(modes[0])); 
     1285} 
     1286 
    10471287const char* gui_tv_override_koef_enum(int change, int arg) { 
    10481288    static const char* modes[]={"Off", "1/100K", "1/10000", "1/1000","1/100","1/10", "1","10","100"}; 
     
    10681308    "64","50.8", "40.3", "32", "25.4","20","16", "12.7", "10","8", "6.3","5","4","3.2", "2.5","2", "1.6", "1.3", "1", "0.8", "0.6", "0.5", "0.4", "0.3", "1/4", "1/5", "1/6", "1/8", "1/10", "1/13", "1/15", "1/20", "1/25", "1/30", "1/40", "1/50", "1/60", "1/80", "1/100", "1/125", "1/160", "1/200", "1/250", "1/320", "1/400", "1/500", "1/640","1/800", "1/1000", "1/1250", "1/1600","1/2000","1/2500","1/3200","1/4000", "1/5000", "1/6400", "1/8000", "1/10000", "1/12500", "1/16000", "1/20000", "1/25000", "1/32000", "1/40000", "1/50000", "1/64000","1/80000", "1/100k"}; 
    10691309    */ 
    1070     static char buf[4]; 
    10711310 
    10721311    // XXX This array above is redundant with platform/generic/shooting.c, this should be avoided! 
     
    11251364        strcpy(buf,"Inf."); 
    11261365    else 
    1127         sprintf(buf, "%d", (int)conf.subj_dist_override_value); 
     1366        sprintf(buf, "%d", shooting_get_subject_distance_override_value()); 
    11281367    return buf;  
    11291368} 
     
    11501389const char* gui_av_override_enum(int change, int arg) 
    11511390{ 
    1152     static char buf[8]; 
    1153  
    1154     conf.av_override_value += change; 
    1155  
     1391    conf.av_override_value+=change; 
    11561392    if (conf.av_override_value<0) conf.av_override_value=shooting_get_aperture_sizes_table_size()+6; 
    11571393    else if (conf.av_override_value>shooting_get_aperture_sizes_table_size()+6) conf.av_override_value=0; 
     
    11691405#if ZOOM_OVERRIDE 
    11701406    const char* gui_zoom_override_enum(int change, int arg) { 
    1171         static char buf[3]; 
    11721407        conf.zoom_override_value+=change; 
    11731408        if (conf.zoom_override_value<0) conf.zoom_override_value=zoom_points-1; 
     
    12451480//------------------------------------------------------------------- 
    12461481#ifdef OPT_DEBUGGING 
     1482    #define TASKLIST_MAX_LINES 12 // probably as much as will fit on screen 
     1483    #define TASKLIST_NUM_TASKS 64 // should be enough ? 
     1484    static void gui_debug_draw_tasklist(void) { 
     1485    #ifndef CAM_DRYOS 
     1486        int tasklist[TASKLIST_NUM_TASKS]; // max number of tasks we will look at 
     1487        int n_tasks,n_show_tasks,show_start; 
     1488        const char *name; 
     1489        int i; 
     1490        n_tasks = task_id_list_get(tasklist,sizeof(tasklist)/sizeof(tasklist[0])); 
     1491        show_start = debug_tasklist_start; 
     1492        n_show_tasks = n_tasks - show_start; 
     1493        // auto adjust to show the last N tasks 
     1494        if(n_show_tasks < TASKLIST_MAX_LINES) { 
     1495            show_start = n_tasks - TASKLIST_MAX_LINES; 
     1496            if(show_start<0) 
     1497                show_start = 0; 
     1498             n_show_tasks = n_tasks - show_start; 
     1499        } 
     1500        else if( n_show_tasks > TASKLIST_MAX_LINES ) { 
     1501            n_show_tasks = TASKLIST_MAX_LINES; 
     1502        } 
     1503        sprintf(buf,"%d-%d of %d tasks %c",show_start,show_start+n_show_tasks,n_tasks,debug_display_direction > 0?'+':'-'); 
     1504        draw_string(64,0,buf, conf.osd_color); 
     1505        for( i = 0;  i < n_show_tasks; i++ ) { 
     1506            // TODO get full task info 
     1507            name = task_name(tasklist[show_start+i]); 
     1508            if ( !name || !*name ) { 
     1509                name = "(unknown)"; 
     1510            } 
     1511            sprintf(buf,"%10s %8X",name,tasklist[show_start+i]); 
     1512            draw_string(64,16+16*i,buf, conf.osd_color); 
     1513        } 
     1514    #endif //CAM_DRYOS 
     1515    } 
     1516 
     1517    #define DEBUG_DISPLAY_NONE 0 
     1518    #define DEBUG_DISPLAY_PROPS 1 
     1519    #define DEBUG_DISPLAY_PARAMS 2 
    12471520#ifndef CAM_DRYOS 
    1248 #define TASKLIST_MAX_LINES 12 // probably as much as will fit on screen 
    1249 #define TASKLIST_NUM_TASKS 64 // should be enough ? 
    1250 static void gui_debug_draw_tasklist(void) { 
    1251     int tasklist[TASKLIST_NUM_TASKS]; // max number of tasks we will look at 
    1252     char buf[40]; // a single line of the list 
    1253     int n_tasks,n_show_tasks,show_start; 
    1254     const char *name; 
    1255     int i; 
    1256     n_tasks = task_id_list_get(tasklist,sizeof(tasklist)/sizeof(tasklist[0])); 
    1257     show_start = debug_tasklist_start; 
    1258     n_show_tasks = n_tasks - show_start; 
    1259     // auto adjust to show the last N tasks 
    1260     if(n_show_tasks < TASKLIST_MAX_LINES) { 
    1261         show_start = n_tasks - TASKLIST_MAX_LINES; 
    1262         if(show_start<0) 
    1263             show_start = 0; 
    1264          n_show_tasks = n_tasks - show_start; 
    1265     } 
    1266     else if( n_show_tasks > TASKLIST_MAX_LINES ) { 
    1267         n_show_tasks = TASKLIST_MAX_LINES; 
    1268     } 
    1269     sprintf(buf,"%d-%d of %d tasks %c",show_start,show_start+n_show_tasks,n_tasks,debug_display_direction > 0?'+':'-'); 
    1270     draw_string(64,0,buf, conf.osd_color); 
    1271     for( i = 0;  i < n_show_tasks; i++ ) { 
    1272         // TODO get full task info 
    1273         name = task_name(tasklist[show_start+i]); 
    1274         if ( !name || !*name ) { 
    1275             name = "(unknown)"; 
    1276         } 
    1277         sprintf(buf,"%10s %8X",name,tasklist[show_start+i]); 
    1278         draw_string(64,16+16*i,buf, conf.osd_color); 
    1279     } 
    1280 } 
    1281 #endif //CAM_DRYOS 
    1282  
    1283 #define DEBUG_DISPLAY_NONE 0 
    1284 #define DEBUG_DISPLAY_PROPS 1 
    1285 #define DEBUG_DISPLAY_PARAMS 2 
     1521    #define DEBUG_DISPLAY_TASKS 3 
     1522#endif 
     1523 
     1524    static void gui_debug_shortcut(void) { 
     1525        static int lastcall = -1; 
     1526        int t=get_tick_count(); 
     1527        if ( lastcall != -1) { 
     1528            if (t-lastcall <= 400) 
     1529                debug_display_direction = -debug_display_direction; 
     1530        } 
     1531        lastcall=t; 
     1532        switch(conf.debug_shortcut_action) { 
     1533            case 1: 
     1534                dump_memory(); 
     1535            break; 
     1536            case 2: 
    12861537#ifndef CAM_DRYOS 
    1287 #define DEBUG_DISPLAY_TASKS 3 
    1288 #endif 
    1289  
    1290 static void gui_debug_shortcut(void) { 
    1291     static int lastcall = -1; 
    1292     int t=get_tick_count(); 
    1293     if ( lastcall != -1) { 
    1294         if (t-lastcall <= 400) 
    1295             debug_display_direction = -debug_display_direction; 
    1296     } 
    1297     lastcall=t; 
    1298     switch(conf.debug_shortcut_action) { 
    1299         case 1: 
    1300             dump_memory(); 
    1301         break; 
    1302         case 2: 
    1303 #ifndef CAM_DRYOS 
    1304             if(conf.debug_display == DEBUG_DISPLAY_TASKS) { 
    1305                 debug_tasklist_start += debug_display_direction*(TASKLIST_MAX_LINES-2); // a little intentional overlap 
    1306                 if(debug_tasklist_start >= TASKLIST_NUM_TASKS || debug_tasklist_start < 0) 
    1307                     debug_tasklist_start = 0; 
    1308             } 
    1309             else 
    1310 #endif 
    1311             if (conf.debug_display == DEBUG_DISPLAY_PROPS || conf.debug_display == DEBUG_DISPLAY_PARAMS) { 
    1312                 conf.debug_propcase_page += debug_display_direction*1; 
    1313                 if(conf.debug_propcase_page > 128 || conf.debug_propcase_page < 0) 
    1314                     conf.debug_propcase_page = 0; 
    1315             } 
    1316         break; 
    1317         case 3: 
    1318             gui_compare_props(1); 
    1319         break; 
    1320     } 
    1321 } 
     1538                if(conf.debug_display == DEBUG_DISPLAY_TASKS) { 
     1539                    debug_tasklist_start += debug_display_direction*(TASKLIST_MAX_LINES-2); // a little intentional overlap 
     1540                    if(debug_tasklist_start >= TASKLIST_NUM_TASKS || debug_tasklist_start < 0) 
     1541                        debug_tasklist_start = 0; 
     1542                } 
     1543                else  
     1544#endif 
     1545                if (conf.debug_display == DEBUG_DISPLAY_PROPS || conf.debug_display == DEBUG_DISPLAY_PARAMS) { 
     1546                    conf.debug_propcase_page += debug_display_direction*1; 
     1547                    if(conf.debug_propcase_page > 128 || conf.debug_propcase_page < 0)  
     1548                        conf.debug_propcase_page = 0; 
     1549                } 
     1550            break; 
     1551            case 3: 
     1552                gui_compare_props(1); 
     1553            break; 
     1554        } 
     1555    } 
    13221556 
    13231557#endif 
     
    13751609static volatile int gui_in_redraw; 
    13761610static int gui_splash, gui_splash_mode; 
    1377 static char osd_buf[32]; 
    13781611 
    13791612//------------------------------------------------------------------- 
     
    13881621    } 
    13891622    gui_splash = (conf.splash_show)?SPLASH_TIME:0; 
    1390     user_menu_restore(); 
    1391     gui_lang_init(); 
    13921623    draw_init(); 
    13931624 
     
    14531684    static int logo_size; 
    14541685    if (gui_splash) { 
    1455                 static int need_logo=1; // don't use logo ptr, since we don't want to keep re-trying 
    1456                 if(need_logo) { 
    1457                 const char *logo_name="A/CHDK/DATA/logo.dat"; 
     1686        static int need_logo=1; // don't use logo ptr, since we don't want to keep re-trying 
     1687        if(need_logo) { 
     1688#if defined(VER_CHDK) 
     1689            const char *logo_name="A/CHDK/DATA/logo.dat"; 
     1690#else   // CHDK-DE 
     1691            const char *logo_name="A/CHDK/DATA/logo_de.dat"; 
     1692#endif 
    14581693            FILE *fd; 
    14591694            struct stat st; 
    14601695            need_logo=0; 
    14611696            if (stat(logo_name,&st) == 0) { 
    1462                                 logo_size=st.st_size; 
    1463                                 logo=malloc(logo_size); 
    1464                                 if(logo) { 
    1465                                         fd = fopen(logo_name, "rb"); 
    1466                                         if(fd){ 
    1467                                                 fread(logo,1,logo_size,fd); 
    1468                                                 fclose(fd); 
    1469                                         } 
    1470                                         else { 
    1471                                                 free(logo); 
    1472                                                 logo=NULL; 
    1473                                         } 
    1474                 } 
    1475                         } 
    1476                 } 
     1697                logo_size=st.st_size; 
     1698                logo=malloc(logo_size); 
     1699                if(logo) { 
     1700                    fd = fopen(logo_name, "rb"); 
     1701                    if(fd){ 
     1702                        fread(logo,1,logo_size,fd); 
     1703                        fclose(fd); 
     1704                    } 
     1705                    else { 
     1706                        free(logo); 
     1707                        logo=NULL; 
     1708                        need_logo=1; 
     1709                    } 
     1710                } 
     1711            } 
     1712        } 
    14771713        if (gui_splash>(SPLASH_TIME-4)) { 
    14781714            gui_draw_splash(logo,logo_size); 
     
    14831719        } 
    14841720        --gui_splash; 
    1485                 if(!gui_splash) { 
    1486                         free(logo); 
    1487                 } 
     1721        if(!gui_splash) { 
     1722            free(logo); 
     1723            logo=NULL; 
     1724            need_logo=1; 
     1725        } 
    14881726    } 
    14891727} 
     
    15211759 
    15221760#ifdef CAM_DISP_ALT_TEXT 
    1523     draw_txt_string(20, 14, "<ALT>", MAKE_COLOR(COLOR_RED, COLOR_WHITE)); 
     1761    draw_string(((CAM_SCREEN_WIDTH/2)-(FONT_WIDTH*5/2)), (CAM_SCREEN_HEIGHT-FONT_HEIGHT), "<ALT>", MAKE_COLOR(COLOR_RED, COLOR_WHITE)); 
    15241762#endif 
    15251763 
     
    19592197    if (conf.debug_misc_vals_show) { 
    19602198        // show value of Memory Address selected with Memory Browser 
    1961         sprintf(osd_buf, "MEM: %#8x", (void*) (*(int*)conf.mem_view_addr_init));    // show value in Hexadecimal integer 
    1962         //sprintf(osd_buf, "MEM: %8u", (void*) (*(int*)conf.mem_view_addr_init));    // show value in Decimal integer 
    1963         draw_txt_string(28,  9, osd_buf, conf.osd_color); 
     2199        sprintf(buf, "MEM: %#8x", (void*) (*(int*)conf.mem_view_addr_init));    // show value in Hexadecimal integer 
     2200        //sprintf(buf, "MEM: %8u", (void*) (*(int*)conf.mem_view_addr_init));    // show value in Decimal integer 
     2201        draw_txt_string(28,  9, buf, conf.osd_color); 
    19642202 
    19652203        // show Autofocus status (if AF is working) 
    19662204        extern volatile long focus_busy; 
    1967         sprintf(osd_buf, "FB:  %8u", focus_busy); 
    1968         draw_txt_string(28, 10, osd_buf, conf.osd_color); 
     2205        sprintf(buf, "FB:  %8u", focus_busy); 
     2206        draw_txt_string(28, 10, buf, conf.osd_color); 
    19692207 
    19702208        // show Zoom status (if Lens is moving) 
    19712209        extern volatile long zoom_busy; 
    1972         sprintf(osd_buf, "ZB:  %8u", zoom_busy); 
    1973         draw_txt_string(28, 11, osd_buf, conf.osd_color); 
     2210        sprintf(buf, "ZB:  %8u", zoom_busy); 
     2211        draw_txt_string(28, 11, buf, conf.osd_color); 
    19742212 
    19752213        // show USB-Power status to debug remote / sync 
    1976         sprintf(osd_buf, "USB: %8u", get_usb_power(1)); 
    1977         draw_txt_string(28, 12, osd_buf, conf.osd_color); 
     2214        sprintf(buf, "USB: %8u", get_usb_power(1)); 
     2215        draw_txt_string(28, 12, buf, conf.osd_color); 
    19782216 
    19792217        /* 
    19802218        // some cameras missing zoom_status 
    1981         sprintf(osd_buf, "ZS:  %#8x", zoom_status); 
    1982         draw_txt_string(28, 13, osd_buf, conf.osd_color); 
     2219        sprintf(buf, "ZS:  %#8x", zoom_status); 
     2220        draw_txt_string(28, 13, buf, conf.osd_color); 
    19832221        */ 
    19842222 
    19852223        /* 
    1986         sprintf(osd_buf, "VP:  %#8x", vid_get_viewport_fb_d()); 
    1987         draw_txt_string(28, 14, osd_buf, conf.osd_color); 
     2224        sprintf(buf, "VP:  %#8x", vid_get_viewport_fb_d()); 
     2225        draw_txt_string(28, 14, buf, conf.osd_color); 
    19882226        */ 
    19892227 
     
    19912229        // debug keymap, KEYS_MASKx, SD_READONLY_FLAG, USB_MASK 
    19922230        extern long physw_status[3]; 
    1993         sprintf(osd_buf, "PS1: %#8x", physw_status[0]); 
    1994         draw_txt_string(28, 10, osd_buf, conf.osd_color); 
    1995  
    1996         sprintf(osd_buf, "PS2: %#8x", physw_status[1]); 
    1997         draw_txt_string(28, 11, osd_buf, conf.osd_color); 
    1998  
    1999         sprintf(osd_buf, "PS3: %#8x", physw_status[2]); 
    2000         draw_txt_string(28, 12, osd_buf, conf.osd_color); 
     2231        sprintf(buf, "PS1: %#8x", physw_status[0]); 
     2232        draw_txt_string(28, 10, buf, conf.osd_color); 
     2233 
     2234        sprintf(buf, "PS2: %#8x", physw_status[1]); 
     2235        draw_txt_string(28, 11, buf, conf.osd_color); 
     2236 
     2237        sprintf(buf, "PS3: %#8x", physw_status[2]); 
     2238        draw_txt_string(28, 12, buf, conf.osd_color); 
    20012239        */ 
    20022240 
    20032241        /* 
    20042242        long v=get_file_counter(); 
    2005         sprintf(osd_buf, "1:%03d-%04d", (v>>18)&0x3FF, (v>>4)&0x3FFF); 
    2006         sprintf(osd_buf, "1:%d, %08X", xxxx, eeee); 
     2243        sprintf(buf, "1:%03d-%04d", (v>>18)&0x3FF, (v>>4)&0x3FFF); 
     2244        sprintf(buf, "1:%d, %08X", xxxx, eeee); 
    20072245        */ 
    20082246    } 
    20092247    { 
    2010         static char sbuf[100]; 
    20112248        int r,i, p, len; 
    20122249        if (conf.debug_display == DEBUG_DISPLAY_PROPS){ 
     
    20162253                p = conf.debug_propcase_page*10+i; 
    20172254                get_property_case(p, &r, 4); 
    2018                 sprintf(sbuf, "%3d: %d              ", p, r); 
    2019                 sbuf[20]=0; 
    2020                 draw_string(64,16+16*i,sbuf, conf.osd_color); 
     2255                sprintf(buf, "%3d: %d              ", p, r); 
     2256                buf[20]=0; 
     2257                draw_string(64,16+16*i,buf, conf.osd_color); 
    20212258            } 
    20222259        } 
     
    20312268                p = conf.debug_propcase_page*10+i; 
    20322269                if (p>=get_flash_params_count()) { 
    2033                     sprintf(sbuf, "%3d: This parameter does not exists", p); 
     2270                    sprintf(buf, "%3d: This parameter does not exists", p); 
    20342271                } else  { 
    20352272                    len=FlashParamsTable[p][1]>>16; 
    20362273                    if ((len==1)||(len==2)||(len==4)){ 
    2037                         get_parameter_data(p, &r, len); 
    2038                         sprintf(sbuf, "%3d: %30d :%2d ", p, r,len); 
     2274                        get_parameter_data(p, &r, len);  
     2275                        sprintf(buf, "%3d: %30d :%2d ", p, r,len); 
    20392276                    } 
    20402277                    else { 
     
    20422279                        get_parameter_data(p, &s, count); 
    20432280                        s[count]=0; 
    2044                         sprintf(sbuf, "%3d: %30s :%2d ", p, s,len); 
     2281                        sprintf(buf, "%3d: %30s :%2d ", p, s,len); 
    20452282                    } 
    20462283                } 
    2047                 draw_string(16,16+16*i,sbuf, conf.osd_color); 
     2284                draw_string(16,16+16*i,buf, conf.osd_color); 
    20482285            } 
    20492286        } 
     
    21732410                 pressed = 1; 
    21742411             } 
    2175         } else { 
     2412        } 
     2413#if !CAM_HAS_MANUAL_FOCUS && CAM_HAS_ZOOM_LEVER && CAM_CAN_SD_OVERRIDE 
     2414        // Todo, check for AF and if its running, don't override 
     2415                else if (kbd_is_key_pressed(SHORTCUT_SD_SUB)) { 
     2416            if (!pressed) { 
     2417                            if (!(conf.override_disable==1) && shooting_can_focus() && shooting_get_common_focus_mode()) { 
     2418                                gui_subj_dist_override_value_enum(-1,0); 
     2419                                shooting_set_focus(shooting_get_subject_distance_override_value(),SET_NOW); 
     2420                //pressed = 1; 
     2421                            } 
     2422            } 
     2423        } else if (kbd_is_key_pressed(SHORTCUT_SD_ADD)) { 
     2424            if (!pressed) { 
     2425                            if (!(conf.override_disable==1) && shooting_can_focus() && shooting_get_common_focus_mode()) { 
     2426                                gui_subj_dist_override_value_enum(1,0); 
     2427                                shooting_set_focus(shooting_get_subject_distance_override_value(),SET_NOW); 
     2428                //pressed = 1; 
     2429                            } 
     2430            } 
     2431        } 
     2432#endif 
     2433                else { 
    21762434            pressed = 0; 
    21772435        } 
     
    22132471     
    22142472    if ((gui_get_mode()==GUI_MODE_NONE || gui_get_mode()==GUI_MODE_ALT) && ( 
    2215      (kbd_is_key_pressed(KEY_SHOOT_HALF) && ((conf.show_histo==SHOW_HALF)/* || (m&MODE_MASK) == MODE_PLAY*/)) || 
    2216      ((conf.show_histo==SHOW_ALWAYS)  &&  !((m&MODE_MASK) == MODE_PLAY) && (recreview_hold==0)) 
    2217     ) && 
     2473     (kbd_is_key_pressed(KEY_SHOOT_HALF) && ((conf.show_histo==SHOW_HALF)/* || (m&MODE_MASK) == MODE_PLAY*/)) ||  
     2474     ((conf.show_histo==SHOW_ALWAYS)  &&  /* !((m&MODE_MASK) == MODE_PLAY) && */ (recreview_hold==0)) 
     2475    ) &&  
    22182476    (mode_photo || (m&MODE_SHOOTING_MASK)==MODE_STITCH)) { 
    22192477        gui_osd_draw_histo(); 
     
    22492507        gui_usb_draw_osd(); 
    22502508        if(conf.show_temp>0) gui_osd_draw_temp(); 
     2509#ifdef CAM_HAS_GPS 
     2510        if (((int)conf.gps_on_off ==1) && (exit_gps_data==1)) 
     2511                { 
     2512                        _CreateTask("GPSDATA", 0x19, 0x400, gps_get_data, 0); 
     2513                        exit_gps_data=0; 
     2514                } 
     2515#endif 
    22512516        if (conf.fast_ev && !mode_video && (m&MODE_MASK) == MODE_REC ) gui_osd_draw_ev(); 
    22522517    } 
     
    22622527#if CAM_DRAW_EXPOSITION 
    22632528    if (gui_get_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) { 
    2264      strcpy(osd_buf,shooting_get_tv_str()); 
    2265      strcat(osd_buf,"\"  F"); 
    2266      strcat(osd_buf,shooting_get_av_str()); 
    2267      draw_txt_string(22-strlen(osd_buf)/2, 14, osd_buf, conf.osd_color); 
     2529     strcpy(buf,shooting_get_tv_str()); 
     2530     strcat(buf,"\"  F"); 
     2531     strcat(buf,shooting_get_av_str()); 
     2532     draw_txt_string(22-strlen(buf)/2, 14, buf, conf.osd_color); 
    22682533    } 
    22692534#endif 
     
    22812546            msg = ubasic_errstrings[UBASIC_E_UNKNOWN_ERROR]; 
    22822547        } else { 
    2283             msg = ubasic_errstrings[ubasic_error]; 
    2284         } 
    2285         sprintf(osd_buf, "uBASIC:%d %s ", ubasic_linenumber(), msg); 
    2286         draw_txt_string(0, 0, osd_buf, MAKE_COLOR(COLOR_RED, COLOR_YELLOW)); 
     2548        msg = ubasic_errstrings[ubasic_error]; 
     2549    } 
     2550    sprintf(buf, "uBASIC:%d %s ", ubasic_linenumber(), msg); 
     2551    draw_txt_string(0, 0, buf, MAKE_COLOR(COLOR_RED, COLOR_YELLOW)); 
    22872552    } 
    22882553#endif 
     
    23122577//------------------------------------------------------------------- 
    23132578void gui_show_build_info(int arg) { 
    2314     static char buf[192]; 
    23152579    static char comp[64]; 
    23162580 
     
    23232587    sprintf(comp, "UNKNOWN" ); 
    23242588#endif 
    2325     sprintf(buf, lang_str(LANG_MSG_BUILD_INFO_TEXT), HDK_VERSION, BUILD_NUMBER, __DATE__, __TIME__, PLATFORM, PLATFORMSUB, comp); 
    2326 gui_mbox_init(LANG_MSG_BUILD_INFO_TITLE, (int)buf, MBOX_FUNC_RESTORE|MBOX_TEXT_LEFT, NULL); 
     2589    sprintf(buf, lang_str(LANG_MSG_BUILD_INFO_TEXT), HDK_VERSION, BUILD_NUMBER, BUILD_SVNREV, __DATE__, __TIME__, PLATFORM, PLATFORMSUB, comp); 
     2590    gui_mbox_init(LANG_MSG_BUILD_INFO_TITLE, (int)buf, MBOX_FUNC_RESTORE|MBOX_TEXT_LEFT, NULL); 
    23272591} 
    23282592 
    23292593//------------------------------------------------------------------- 
    23302594void gui_show_memory_info(int arg) { 
    2331     static char buf[96];    // buffer size was 64, size increased for none english language 
    2332  
    23332595    sprintf(buf, lang_str(LANG_MSG_MEMORY_INFO_TEXT), core_get_free_memory(), MEMISOSIZE, &_start, &_end); 
    23342596    gui_mbox_init(LANG_MSG_MEMORY_INFO_TITLE, (int)buf, MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER, NULL); 
     
    23412603 
    23422604//------------------------------------------------------------------- 
     2605#if defined(VER_CHDK) 
     2606#define LOGO_WIDTH  149 
     2607#define LOGO_HEIGHT 84 
     2608#else 
     2609#define LOGO_WIDTH  169 
     2610#define LOGO_HEIGHT 74 
     2611#endif 
     2612 
    23432613void gui_draw_splash(char* logo, int logo_size) { 
    23442614    coord w, h, x, y; 
    23452615    static const char *text[] = { 
    2346         "CHDK Firmware '" HDK_VERSION " " BUILD_NUMBER "'" , 
     2616        "CHDK Version '" HDK_VERSION " " BUILD_NUMBER "-" BUILD_SVNREV "'" ,  
    23472617        "Build: " __DATE__ " " __TIME__ , 
    23482618        "Camera: " PLATFORM " - " PLATFORMSUB }; 
     
    23692639      int mx=0; 
    23702640      int my=0; 
    2371       int offset_x = (camera_screen.width-150)>>1; 
    2372       int offset_y = ((camera_screen.height-84)>>1) - 42; 
     2641      int offset_x = (CAM_SCREEN_WIDTH-LOGO_WIDTH)>>1; 
     2642      int offset_y = ((CAM_SCREEN_HEIGHT-LOGO_HEIGHT)>>1) - 42; 
    23732643      const color color_lookup[8] = {COLOR_BLACK, 
    23742644                                    COLOR_SPLASH_RED/*0x2E redish*/, 
     
    23862656                  draw_pixel(offset_x+mx,offset_y+my,c); 
    23872657              } 
    2388               if (mx==149){ 
     2658              if (mx==LOGO_WIDTH){ 
    23892659                  mx=0; 
    23902660                  my++; 
    23912661              }else{ 
    23922662                  mx++; 
    2393               } 
     2663              }      
    23942664          } 
    23952665      } 
  • trunk/core/gui_batt.c

    r1698 r1719  
    3838//------------------------------------------------------------------- 
    3939static void gui_batt_draw_icon () { 
    40     coord x; 
    4140    register coord xx, yy; 
    4241     
     
    4948 
    5049    // set bar color depending percent 
    51     color cl1 = (perc>50) ? icon_green[0] : (perc<=20) ? icon_red[0] : icon_yellow[0]; 
    52     color cl2 = (perc>50) ? icon_green[1] : (perc<=20) ? icon_red[1] : icon_yellow[1]; 
    53     color cl3 = (perc>50) ? icon_green[2] : (perc<=20) ? icon_red[2] : icon_yellow[2]; 
     50    color cl1 = (perc>50) ? icon_green[0] :(perc<=20) ? icon_red[0] : icon_yellow[0]; 
     51    color cl2 = (perc>50) ? icon_green[1] :(perc<=20) ? icon_red[1] : icon_yellow[1]; 
     52    color cl3 = (perc>50) ? icon_green[2] :(perc<=20) ? icon_red[2] : icon_yellow[2]; 
    5453 
    5554    // icon 
    56     draw_vline(xx, yy+5, 2, icon_grey[1]); 
    57     draw_filled_rect(xx+1, yy+4, xx+2, yy+8, MAKE_COLOR(icon_yellow[0], icon_yellow[0])); 
    58     draw_rect(xx+3, yy, xx+31, yy+12, icon_grey[1]); 
    59     draw_hline(xx+4, yy+1,  26, icon_grey[2]); 
    60     draw_hline(xx+4, yy+11, 26, icon_grey[1]); 
     55    draw_round_rect(xx,     yy+3,   xx+3,   yy+9,   MAKE_COLOR(icon_grey[1],   icon_grey[1])); 
     56    draw_rect(xx+3,         yy,     xx+31,  yy+12,  MAKE_COLOR(icon_grey[1],   icon_grey[1])); 
     57    draw_filled_rect(xx+1,  yy+4,   xx+2,   yy+8,   MAKE_COLOR(icon_yellow[0], icon_yellow[0])); 
     58    draw_filled_rect(xx+4,  yy+6,   xx+30,  yy+11,  MAKE_COLOR(icon_grey[0],   icon_grey[0])); 
     59    draw_filled_rect(xx+4,  yy+1,   xx+30,  yy+5,   MAKE_COLOR(icon_grey[2],   icon_grey[2])); 
    6160    // fill icon 
    62     draw_rect(xx+4,           yy+2,   xx+30,  yy+10,  cl1); 
    63     draw_filled_rect(xx+5,    yy+6,   xx+28-(25*perc/100),  yy+9,  MAKE_COLOR(icon_grey[1], icon_grey[1])); 
    64     draw_filled_rect(xx+5,    yy+3,   xx+28-(25*perc/100),  yy+5,   MAKE_COLOR(icon_grey[2], icon_grey[2])); 
    65     draw_filled_rect(xx+29-(25*perc/100),    yy+6,     xx+29,   yy+9,  MAKE_COLOR(cl2, cl2)); 
    66     draw_filled_rect(xx+29-(25*perc/100),    yy+3,     xx+29,   yy+5,  MAKE_COLOR(cl3, cl3)); 
     61    draw_rect(xx+4,         yy+2,   xx+30,  yy+10,  MAKE_COLOR(cl1, cl1)); 
     62    draw_filled_rect(xx+29-(25*perc/100),   yy+6,  xx+29,   yy+9,  MAKE_COLOR(cl2, cl2)); 
     63    draw_filled_rect(xx+29-(25*perc/100),   yy+3,  xx+29,   yy+5,  MAKE_COLOR(cl3, cl3)); 
    6764} 
    6865 
  • trunk/core/gui_draw.h

    r1698 r1719  
    88// Moved from gui_bench.c, gui_debug.c, gui_calendar.c, gui_reversi.c & gui_sokoban.c so it can be overridden 
    99// Default value is white in SX30 & G12 palette making white text hard to read 
    10 #define SCREEN_COLOR            0xF7 
     10#define SCREEN_COLOR                    0xF7 
    1111 
    1212//------------------------------------------------------------------- 
    1313 
    1414// Common colors that are the same in all palettes 
    15 #define COLOR_TRANSPARENT   0x00 
    16 #define COLOR_BLACK         0xFF 
     15#define COLOR_TRANSPARENT               0x00 
     16#define COLOR_BLACK                     0xFF 
    1717 
    1818//------------------------------------------------------------------- 
    1919 
    2020#if CAM_BITMAP_PALETTE==1 
    21      
     21 
    2222// Default palette used unless overridden - see list of cameras using each palette below 
    23      
    24     #define COLOR_WHITE         0x11 
    25     #define COLOR_RED           0x22 
    26     #define COLOR_GREY          0x3F 
    27     #define COLOR_GREEN         0x55 
    28     #define COLOR_BLUE_LT       0xDD 
    29     #define COLOR_BLUE          0xDF 
    30     #define COLOR_YELLOW        0xEE 
    31     #define COLOR_BG            0x44 
    32     #define COLOR_FG            COLOR_WHITE 
    33     #define COLOR_SELECTED_BG   COLOR_RED 
    34     #define COLOR_SELECTED_FG   COLOR_WHITE 
    35     #define COLOR_ALT_BG        0xD4 
    36     #define COLOR_SPLASH_RED    0x2E 
    37     #define COLOR_SPLASH_PINK   0x21 
    38     #define COLOR_SPLASH_GREY   0x1F 
    39     // colors for blended histo 
    40     #define COLOR_HISTO_R       COLOR_RED 
    41     #define COLOR_HISTO_R_PLAY  COLOR_RED 
    42     #define COLOR_HISTO_B       COLOR_BLUE 
    43     #define COLOR_HISTO_G       COLOR_GREEN 
    44     #define COLOR_HISTO_G_PLAY  COLOR_GREEN 
    45     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    46     #define COLOR_HISTO_RG      COLOR_YELLOW 
    47     #define COLOR_HISTO_RB      0x66 
    48     #define COLOR_HISTO_RB_PLAY 0xE2 
    49     #define COLOR_HISTO_B_PLAY  0xCC 
    50     #define COLOR_HISTO_BG_PLAY 0x99 
    51     #define COLOR_HISTO_RG_PLAY 0x66 
    52      
     23 
     24    #define COLOR_WHITE                 0x11 
     25    #define COLOR_RED                   0x22 
     26    #define COLOR_GREY                  0x3F 
     27    #define COLOR_GREEN                 0x55 
     28    #define COLOR_BLUE_LT               0xDD 
     29    #define COLOR_BLUE                  0xDF 
     30    #define COLOR_YELLOW                0xEE 
     31    #define COLOR_BG                    0x44 
     32    #define COLOR_FG                    COLOR_WHITE 
     33    #define COLOR_SELECTED_BG           COLOR_RED 
     34    #define COLOR_SELECTED_FG           COLOR_WHITE 
     35    #define COLOR_ALT_BG                0xD4 
     36    #define COLOR_SPLASH_RED            0x2E 
     37    #define COLOR_SPLASH_PINK           0x21 
     38    #define COLOR_SPLASH_GREY           0x1F 
     39    #define COLOR_HISTO_R               COLOR_RED 
     40    #define COLOR_HISTO_R_PLAY          COLOR_RED 
     41    #define COLOR_HISTO_B               COLOR_BLUE 
     42    #define COLOR_HISTO_G               COLOR_GREEN 
     43    #define COLOR_HISTO_G_PLAY          COLOR_GREEN 
     44    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     45    #define COLOR_HISTO_RG              COLOR_YELLOW 
     46    #define COLOR_HISTO_RB              0x66 
     47    #define COLOR_HISTO_RB_PLAY         0xE2 
     48    #define COLOR_HISTO_B_PLAY          0xCC 
     49    #define COLOR_HISTO_BG_PLAY         0x99 
     50    #define COLOR_HISTO_RG_PLAY         0x66 
     51 
    5352// Icon colors 
    5453// 3 shades of Red, Green, Yellow and Grey 
     
    8887// Used by :- G10, IXUS95_SD1200, IXUS980_SD990 
    8988 
    90     #define COLOR_WHITE         0xD3 
    91     #define COLOR_RED           0x64 
    92     #define COLOR_GREY          0x12 
    93     #define COLOR_GREEN         0xC4 
    94     #define COLOR_BLUE_LT       0x6A 
    95     #define COLOR_BLUE          0x87 
    96     #define COLOR_YELLOW        0x44 
    97     #define COLOR_BG            0x22  
    98     #define COLOR_FG            COLOR_WHITE 
    99     #define COLOR_SELECTED_BG   COLOR_RED 
    100     #define COLOR_SELECTED_FG   COLOR_WHITE 
    101     #define COLOR_ALT_BG        0x22 
    102     #define COLOR_SPLASH_RED    0x58 
    103     #define COLOR_SPLASH_PINK   0x4C 
    104     #define COLOR_SPLASH_GREY   0x16 
    105     // colors for blended histo  
     89    #define COLOR_WHITE                 0xD3 
     90    #define COLOR_RED                   0x64 
     91    #define COLOR_GREY                  0x12 
     92    #define COLOR_GREEN                 0xC4 
     93    #define COLOR_BLUE_LT               0x6A 
     94    #define COLOR_BLUE                  0x87 
     95    #define COLOR_YELLOW                0x44 
     96    #define COLOR_BG                    0x22 
     97    #define COLOR_FG                    COLOR_WHITE 
     98    #define COLOR_SELECTED_BG           COLOR_RED 
     99    #define COLOR_SELECTED_FG           COLOR_WHITE 
     100    #define COLOR_ALT_BG                0x22 
     101    #define COLOR_SPLASH_RED            0x58 
     102    #define COLOR_SPLASH_PINK           0x4C 
     103    #define COLOR_SPLASH_GREY           0x16 
    106104    // many of these probably wrong on this cam 
    107     #define COLOR_HISTO_R       COLOR_RED 
    108     #define COLOR_HISTO_R_PLAY  COLOR_RED 
    109     #define COLOR_HISTO_B       COLOR_BLUE 
    110     #define COLOR_HISTO_G       COLOR_GREEN 
    111     #define COLOR_HISTO_G_PLAY  COLOR_GREEN 
    112     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    113     #define COLOR_HISTO_RG      COLOR_YELLOW 
    114     #define COLOR_HISTO_RB      0x66 
    115     #define COLOR_HISTO_RB_PLAY 0xE2 
    116     #define COLOR_HISTO_B_PLAY  0xCC 
    117     #define COLOR_HISTO_BG_PLAY 0x99 
    118     #define COLOR_HISTO_RG_PLAY 0x66 
     105    #define COLOR_HISTO_R               COLOR_RED 
     106    #define COLOR_HISTO_R_PLAY          COLOR_RED 
     107    #define COLOR_HISTO_B               COLOR_BLUE 
     108    #define COLOR_HISTO_G               COLOR_GREEN 
     109    #define COLOR_HISTO_G_PLAY          COLOR_GREEN 
     110    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     111    #define COLOR_HISTO_RG              COLOR_YELLOW 
     112    #define COLOR_HISTO_RB              0x66 
     113    #define COLOR_HISTO_RB_PLAY         0xE2 
     114    #define COLOR_HISTO_B_PLAY          0xCC 
     115    #define COLOR_HISTO_BG_PLAY         0x99 
     116    #define COLOR_HISTO_RG_PLAY         0x66 
    119117    #undef SCREEN_COLOR 
    120     #define SCREEN_COLOR        0x15        // try for a dark color in both record and play mode 
     118    #define SCREEN_COLOR                0x15    // try for a dark color in both record and play mode 
    121119 
    122120// Icon colors 
     
    155153// Used by :- IXUS120_SD940, SX200IS 
    156154 
    157     #define COLOR_WHITE         0x01 
    158     #define COLOR_RED           0x2B 
    159     #define COLOR_GREY          0x17 
    160     #define COLOR_GREEN         0x99 
    161     #define COLOR_BLUE_LT       0x2D 
    162     #define COLOR_BLUE          0x3B 
    163     #define COLOR_YELLOW        0x9A 
    164     #define COLOR_BG            0x81 
    165     #define COLOR_FG            COLOR_WHITE 
    166     #define COLOR_SELECTED_BG   COLOR_RED 
    167     #define COLOR_SELECTED_FG   COLOR_WHITE 
    168     #define COLOR_ALT_BG        COLOR_GREY 
    169     #define COLOR_SPLASH_RED    0x29 
    170     #define COLOR_SPLASH_PINK   0x1E 
    171     #define COLOR_SPLASH_GREY   0x16 
     155    #define COLOR_WHITE                 0x01 
     156    #define COLOR_RED                   0x2B 
     157    #define COLOR_GREY                  0x17 
     158    #define COLOR_GREEN                 0x99 
     159    #define COLOR_BLUE_LT               0x2D 
     160    #define COLOR_BLUE                  0x3B 
     161    #define COLOR_YELLOW                0x9A 
     162    #define COLOR_BG                    0x81 
     163    #define COLOR_FG                    COLOR_WHITE 
     164    #define COLOR_SELECTED_BG           COLOR_RED 
     165    #define COLOR_SELECTED_FG           COLOR_WHITE 
     166    #define COLOR_ALT_BG                COLOR_GREY 
     167    #define COLOR_SPLASH_RED            0x29 
     168    #define COLOR_SPLASH_PINK           0x1E 
     169    #define COLOR_SPLASH_GREY           0x16 
    172170    // colors for blended histo 
    173     #define COLOR_HISTO_R       COLOR_RED 
    174     #define COLOR_HISTO_R_PLAY  COLOR_HISTO_R 
    175     #define COLOR_HISTO_B       COLOR_BLUE 
    176     #define COLOR_HISTO_G       COLOR_GREEN 
    177     #define COLOR_HISTO_G_PLAY  COLOR_HISTO_G 
    178     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    179     #define COLOR_HISTO_RG      COLOR_YELLOW 
    180     #define COLOR_HISTO_RB      COLOR_BLACK // there isn't purplish on this cam I guess 
    181     #define COLOR_HISTO_RB_PLAY COLOR_HISTO_RB 
    182     #define COLOR_HISTO_B_PLAY  COLOR_HISTO_B 
    183     #define COLOR_HISTO_BG_PLAY COLOR_BLUE_LT 
    184     #define COLOR_HISTO_RG_PLAY COLOR_YELLOW 
    185      
     171    #define COLOR_HISTO_R               COLOR_RED 
     172    #define COLOR_HISTO_R_PLAY          COLOR_HISTO_R 
     173    #define COLOR_HISTO_B               COLOR_BLUE 
     174    #define COLOR_HISTO_G               COLOR_GREEN 
     175    #define COLOR_HISTO_G_PLAY          COLOR_HISTO_G 
     176    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     177    #define COLOR_HISTO_RG              COLOR_YELLOW 
     178    #define COLOR_HISTO_RB              COLOR_BLACK // there isn't purplish on this cam I guess 
     179    #define COLOR_HISTO_RB_PLAY         COLOR_HISTO_RB 
     180    #define COLOR_HISTO_B_PLAY          COLOR_HISTO_B 
     181    #define COLOR_HISTO_BG_PLAY         COLOR_BLUE_LT 
     182    #define COLOR_HISTO_RG_PLAY         COLOR_YELLOW 
     183 
    186184// Icon colors 
    187185// 3 shades of Red, Green, Yellow and Grey 
     
    215213#endif 
    216214#if defined (CAMERA_ixus120_sd940) 
    217         #define COLOR_ICON_REC_RED                      0xE7 
    218         #define COLOR_ICON_REC_RED_DK           0xEA 
    219         #define COLOR_ICON_REC_RED_LT           0xE3 
    220         #define COLOR_ICON_REC_GREEN            0x7F 
    221         #define COLOR_ICON_REC_GREEN_DK         0x86 
    222         #define COLOR_ICON_REC_GREEN_LT         0x78 
    223         #define COLOR_ICON_REC_YELLOW           0x92 
    224         #define COLOR_ICON_REC_YELLOW_DK        0x87 
    225         #define COLOR_ICON_REC_YELLOW_LT        0xA9 
    226         #define COLOR_ICON_REC_GREY                     COLOR_GREY 
    227         #define COLOR_ICON_REC_GREY_DK          0x1A 
    228         #define COLOR_ICON_REC_GREY_LT          0x11 
    229          
    230         #define COLOR_ICON_PLY_RED                      0x15 
    231         #define COLOR_ICON_PLY_RED_DK           0x1E 
    232         #define COLOR_ICON_PLY_RED_LT           0x2c 
    233         #define COLOR_ICON_PLY_GREEN            0x9E 
    234         #define COLOR_ICON_PLY_GREEN_DK         0x9E 
    235         #define COLOR_ICON_PLY_GREEN_LT         0x9E 
    236         #define COLOR_ICON_PLY_YELLOW           0xCC 
    237         #define COLOR_ICON_PLY_YELLOW_DK        0xCD 
    238         #define COLOR_ICON_PLY_YELLOW_LT        0xCB 
    239         #define COLOR_ICON_PLY_GREY                     COLOR_GREY 
    240         #define COLOR_ICON_PLY_GREY_DK          0x1A 
    241         #define COLOR_ICON_PLY_GREY_LT          0x11 
     215    #define COLOR_ICON_REC_RED          0xE7 
     216    #define COLOR_ICON_REC_RED_DK       0xEA 
     217    #define COLOR_ICON_REC_RED_LT       0xE3 
     218    #define COLOR_ICON_REC_GREEN        0x7F 
     219    #define COLOR_ICON_REC_GREEN_DK     0x86 
     220    #define COLOR_ICON_REC_GREEN_LT     0x78 
     221    #define COLOR_ICON_REC_YELLOW       0x92 
     222    #define COLOR_ICON_REC_YELLOW_DK    0x87 
     223    #define COLOR_ICON_REC_YELLOW_LT    0xA9 
     224    #define COLOR_ICON_REC_GREY         COLOR_GREY 
     225    #define COLOR_ICON_REC_GREY_DK      0x1A 
     226    #define COLOR_ICON_REC_GREY_LT      0x11 
     227    #define COLOR_ICON_PLY_RED          0x15 
     228    #define COLOR_ICON_PLY_RED_DK       COLOR_SPLASH_PINK 
     229    #define COLOR_ICON_PLY_RED_LT       0x2c 
     230    #define COLOR_ICON_PLY_GREEN        0x9E 
     231    #define COLOR_ICON_PLY_GREEN_DK     0x9E 
     232    #define COLOR_ICON_PLY_GREEN_LT     0x9E 
     233    #define COLOR_ICON_PLY_YELLOW       0xCC 
     234    #define COLOR_ICON_PLY_YELLOW_DK    0xCD 
     235    #define COLOR_ICON_PLY_YELLOW_LT    0xCB 
     236    #define COLOR_ICON_PLY_GREY         COLOR_GREY 
     237    #define COLOR_ICON_PLY_GREY_DK      0x1A 
     238    #define COLOR_ICON_PLY_GREY_LT      0x11 
    242239#endif 
    243240 
     
    246243// Used by :- G11, S90, SX120IS 
    247244 
    248     #define COLOR_WHITE         0x01 
    249     #define COLOR_RED           0x2B 
    250     #define COLOR_GREY          0x17 
    251     #define COLOR_GREEN         0x99 
    252     #define COLOR_BLUE_LT       0xA9 
    253     #define COLOR_BLUE          0xA1 
    254     #define COLOR_YELLOW        0x9A 
    255     #define COLOR_BG            0x61 
    256     #define COLOR_FG            COLOR_WHITE 
    257     #define COLOR_SELECTED_BG   COLOR_RED 
    258     #define COLOR_SELECTED_FG   COLOR_WHITE 
    259     #define COLOR_ALT_BG        COLOR_GREY 
    260     #define COLOR_SPLASH_RED    0x29 
    261     #define COLOR_SPLASH_PINK   0x1E 
    262     #define COLOR_SPLASH_GREY   0x16 
    263     // colors for blended histo 
    264     #define COLOR_HISTO_R       COLOR_RED 
    265     #define COLOR_HISTO_R_PLAY  COLOR_HISTO_R 
    266     #define COLOR_HISTO_B       COLOR_BLUE 
    267     #define COLOR_HISTO_G       COLOR_GREEN 
    268     #define COLOR_HISTO_G_PLAY  COLOR_HISTO_G 
    269     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    270     #define COLOR_HISTO_RG      COLOR_YELLOW 
    271     #define COLOR_HISTO_RB      COLOR_BLACK // there isn't purplish on this cam I guess 
    272     #define COLOR_HISTO_RB_PLAY COLOR_HISTO_RB 
    273     #define COLOR_HISTO_B_PLAY  COLOR_HISTO_B 
    274     #define COLOR_HISTO_BG_PLAY COLOR_BLUE_LT 
    275     #define COLOR_HISTO_RG_PLAY COLOR_YELLOW 
    276      
     245    #define COLOR_WHITE                 0x01 
     246    #define COLOR_RED                   0x2B 
     247    #define COLOR_GREY                  0x17 
     248    #define COLOR_GREEN                 0x99 
     249    #define COLOR_BLUE_LT               0xA9 
     250    #define COLOR_BLUE                  0xA1 
     251    #define COLOR_YELLOW                0x9A 
     252    #define COLOR_BG                    0x61 
     253    #define COLOR_FG                    COLOR_WHITE 
     254    #define COLOR_SELECTED_BG           COLOR_RED 
     255    #define COLOR_SELECTED_FG           COLOR_WHITE 
     256    #define COLOR_ALT_BG                COLOR_GREY 
     257    #define COLOR_SPLASH_RED            0x29 
     258    #define COLOR_SPLASH_PINK           0x1E 
     259    #define COLOR_SPLASH_GREY           0x16 
     260    #define COLOR_HISTO_R               COLOR_RED 
     261    #define COLOR_HISTO_R_PLAY          COLOR_HISTO_R 
     262    #define COLOR_HISTO_B               COLOR_BLUE 
     263    #define COLOR_HISTO_G               COLOR_GREEN 
     264    #define COLOR_HISTO_G_PLAY          COLOR_HISTO_G 
     265    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     266    #define COLOR_HISTO_RG              COLOR_YELLOW 
     267    #define COLOR_HISTO_RB              COLOR_BLACK // there isn't purplish on this cam I guess 
     268    #define COLOR_HISTO_RB_PLAY         COLOR_HISTO_RB 
     269    #define COLOR_HISTO_B_PLAY          COLOR_HISTO_B 
     270    #define COLOR_HISTO_BG_PLAY         COLOR_BLUE_LT 
     271    #define COLOR_HISTO_RG_PLAY         COLOR_YELLOW 
     272 
    277273// Icon colors 
    278274// 3 shades of Red, Green, Yellow and Grey 
     
    310306// Used by :- D10, IXUS100_SD780 
    311307 
    312     #define COLOR_WHITE         0xD3 
    313     #define COLOR_RED           0x6A 
    314     #define COLOR_GREY          0x12 
    315     #define COLOR_GREEN         0xBF 
    316     #define COLOR_BLUE_LT       0x7C 
    317     #define COLOR_BLUE          0x90 
    318     #define COLOR_YELLOW        0x53 
    319     #define COLOR_BG            0x22 
    320     #define COLOR_FG            COLOR_WHITE 
    321     #define COLOR_SELECTED_BG   COLOR_RED 
    322     #define COLOR_SELECTED_FG   COLOR_WHITE 
    323     #define COLOR_ALT_BG        0x22 
    324     #define COLOR_SPLASH_RED    0x72 
    325     #define COLOR_SPLASH_PINK   0x5C 
    326     #define COLOR_SPLASH_GREY   0x16 
    327     #define COLOR_HISTO_R       COLOR_RED 
    328     #define COLOR_HISTO_R_PLAY  COLOR_RED 
    329     #define COLOR_HISTO_B       COLOR_BLUE 
    330     #define COLOR_HISTO_G       COLOR_GREEN 
    331     #define COLOR_HISTO_G_PLAY  COLOR_GREEN 
    332     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    333     #define COLOR_HISTO_RG      COLOR_YELLOW 
    334     #define COLOR_HISTO_RB      0x72 
    335     #define COLOR_HISTO_RB_PLAY COLOR_HISTO_RB 
    336     #define COLOR_HISTO_B_PLAY  COLOR_HISTO_B 
    337     #define COLOR_HISTO_BG_PLAY COLOR_BLUE_LT 
    338     #define COLOR_HISTO_RG_PLAY COLOR_YELLOW 
     308    #define COLOR_WHITE                 0xD3 
     309    #define COLOR_RED                   0x6A 
     310    #define COLOR_GREY                  0x12 
     311    #define COLOR_GREEN                 0xBF 
     312    #define COLOR_BLUE_LT               0x7C 
     313    #define COLOR_BLUE                  0x90 
     314    #define COLOR_YELLOW                0x53 
     315    #define COLOR_BG                    0x22 
     316    #define COLOR_FG                    COLOR_WHITE 
     317    #define COLOR_SELECTED_BG           COLOR_RED 
     318    #define COLOR_SELECTED_FG           COLOR_WHITE 
     319    #define COLOR_ALT_BG                0x22 
     320    #define COLOR_SPLASH_RED            0x72 
     321    #define COLOR_SPLASH_PINK           0x5C 
     322    #define COLOR_SPLASH_GREY           0x16 
     323    #define COLOR_HISTO_R               COLOR_RED 
     324    #define COLOR_HISTO_R_PLAY          COLOR_RED 
     325    #define COLOR_HISTO_B               COLOR_BLUE 
     326    #define COLOR_HISTO_G               COLOR_GREEN 
     327    #define COLOR_HISTO_G_PLAY          COLOR_GREEN 
     328    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     329    #define COLOR_HISTO_RG              COLOR_YELLOW 
     330    #define COLOR_HISTO_RB              0x72 
     331    #define COLOR_HISTO_RB_PLAY         COLOR_HISTO_RB 
     332    #define COLOR_HISTO_B_PLAY          COLOR_HISTO_B 
     333    #define COLOR_HISTO_BG_PLAY         COLOR_BLUE_LT 
     334    #define COLOR_HISTO_RG_PLAY         COLOR_YELLOW 
    339335    #undef SCREEN_COLOR 
    340     #define SCREEN_COLOR        0x1D 
     336    #define SCREEN_COLOR                0x1D 
    341337 
    342338#elif CAM_BITMAP_PALETTE==6 
     
    344340// Used by :- SX20 
    345341 
    346     #define COLOR_WHITE         0x01 
    347     #define COLOR_RED           0x2B 
    348     #define COLOR_GREY          0x0F 
    349     #define COLOR_GREEN         0xA9 
    350     #define COLOR_BLUE_LT       0x2D 
    351     #define COLOR_BLUE          0x3B 
    352     #define COLOR_YELLOW        0x8B 
    353     #define COLOR_BG            0xFE 
    354     #define COLOR_FG            COLOR_WHITE 
    355     #define COLOR_SELECTED_BG   COLOR_RED 
    356     #define COLOR_SELECTED_FG   COLOR_WHITE 
    357     #define COLOR_ALT_BG        COLOR_BG 
    358     #define COLOR_SPLASH_RED    COLOR_RED 
    359     #define COLOR_SPLASH_PINK   0xEA 
    360     #define COLOR_SPLASH_GREY   0x16 
    361     #define COLOR_HISTO_R       COLOR_RED 
    362     #define COLOR_HISTO_R_PLAY  COLOR_RED 
    363     #define COLOR_HISTO_B       COLOR_BLUE 
    364     #define COLOR_HISTO_G       COLOR_GREEN 
    365     #define COLOR_HISTO_G_PLAY  COLOR_GREEN 
    366     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    367     #define COLOR_HISTO_RG      COLOR_YELLOW 
    368     #define COLOR_HISTO_RB      COLOR_RED 
    369     #define COLOR_HISTO_RB_PLAY COLOR_HISTO_RB 
    370     #define COLOR_HISTO_B_PLAY  COLOR_HISTO_B 
    371     #define COLOR_HISTO_BG_PLAY COLOR_BLUE_LT 
    372     #define COLOR_HISTO_RG_PLAY COLOR_YELLOW 
    373      
     342    #define COLOR_WHITE                 0x01 
     343    #define COLOR_RED                   0x2B 
     344    #define COLOR_GREY                  0x0F 
     345    #define COLOR_GREEN                 0xA9 
     346    #define COLOR_BLUE_LT               0x2D 
     347    #define COLOR_BLUE                  0x3B 
     348    #define COLOR_YELLOW                0x8B 
     349    #define COLOR_BG                    0xFE 
     350    #define COLOR_FG                    COLOR_WHITE 
     351    #define COLOR_SELECTED_BG           COLOR_RED 
     352    #define COLOR_SELECTED_FG           COLOR_WHITE 
     353    #define COLOR_ALT_BG                COLOR_BG 
     354    #define COLOR_SPLASH_RED            COLOR_RED 
     355    #define COLOR_SPLASH_PINK           0xEA 
     356    #define COLOR_SPLASH_GREY           0x16 
     357    #define COLOR_HISTO_R               COLOR_RED 
     358    #define COLOR_HISTO_R_PLAY          COLOR_RED 
     359    #define COLOR_HISTO_B               COLOR_BLUE 
     360    #define COLOR_HISTO_G               COLOR_GREEN 
     361    #define COLOR_HISTO_G_PLAY          COLOR_GREEN 
     362    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     363    #define COLOR_HISTO_RG              COLOR_YELLOW 
     364    #define COLOR_HISTO_RB              COLOR_RED 
     365    #define COLOR_HISTO_RB_PLAY         COLOR_HISTO_RB 
     366    #define COLOR_HISTO_B_PLAY          COLOR_HISTO_B 
     367    #define COLOR_HISTO_BG_PLAY         COLOR_BLUE_LT 
     368    #define COLOR_HISTO_RG_PLAY         COLOR_YELLOW 
     369 
    374370// Icon colors 
    375371// 3 shades of Red, Green, Yellow and Grey 
     
    405401// Used by :- SX130IS 
    406402 
    407     #define COLOR_WHITE         0x01 
    408     #define COLOR_RED           0x1e 
    409     #define COLOR_GREY          0x1a 
    410     #define COLOR_GREEN         0x17 
    411     #define COLOR_BLUE_LT       0x10 
    412     #define COLOR_BLUE          0x14 
    413     #define COLOR_YELLOW        0x60 
    414     #define COLOR_BG            0x62 
    415     #define COLOR_FG            COLOR_WHITE 
    416     #define COLOR_SELECTED_BG   0x0e 
    417     #define COLOR_SELECTED_FG   COLOR_BLACK 
    418     #define COLOR_ALT_BG        COLOR_BG 
    419     #define COLOR_SPLASH_RED    COLOR_RED 
    420     #define COLOR_SPLASH_PINK   0x1e                    // Orange 
    421     #define COLOR_SPLASH_GREY   0x16 
    422     #define COLOR_HISTO_R       0x66 
    423     #define COLOR_HISTO_R_PLAY  0xA0 
    424     #define COLOR_HISTO_B       0x61 
    425     #define COLOR_HISTO_B_PLAY  0xA2 
    426     #define COLOR_HISTO_G       0x5F 
    427     #define COLOR_HISTO_G_PLAY  0xA1 
    428     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    429     #define COLOR_HISTO_RG      COLOR_YELLOW 
    430     #define COLOR_HISTO_RB      COLOR_RED 
    431     #define COLOR_HISTO_RB_PLAY COLOR_HISTO_RB 
    432     #define COLOR_HISTO_BG_PLAY COLOR_BLUE_LT 
    433     #define COLOR_HISTO_RG_PLAY 0x80 
     403    #define COLOR_WHITE                 0x01 
     404    #define COLOR_RED                   0x1e 
     405    #define COLOR_GREY                  0x1a 
     406    #define COLOR_GREEN                 0x17 
     407    #define COLOR_BLUE_LT               0x10 
     408    #define COLOR_BLUE                  0x14 
     409    #define COLOR_YELLOW                0x60 
     410    #define COLOR_BG                    0x62 
     411    #define COLOR_FG                    COLOR_WHITE 
     412    #define COLOR_SELECTED_BG           0x0e 
     413    #define COLOR_SELECTED_FG           COLOR_BLACK 
     414    #define COLOR_ALT_BG                COLOR_BG 
     415    #define COLOR_SPLASH_RED            COLOR_RED 
     416    #define COLOR_SPLASH_PINK           0x1e        // Orange 
     417    #define COLOR_SPLASH_GREY           0x16 
     418    #define COLOR_HISTO_R               0x66 
     419    #define COLOR_HISTO_R_PLAY          0xA0 
     420    #define COLOR_HISTO_B               0x61 
     421    #define COLOR_HISTO_B_PLAY          0xA2 
     422    #define COLOR_HISTO_G               0x5F 
     423    #define COLOR_HISTO_G_PLAY          0xA1 
     424    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     425    #define COLOR_HISTO_RG              COLOR_YELLOW 
     426    #define COLOR_HISTO_RB              COLOR_RED 
     427    #define COLOR_HISTO_RB_PLAY         COLOR_HISTO_RB 
     428    #define COLOR_HISTO_BG_PLAY         COLOR_BLUE_LT 
     429    #define COLOR_HISTO_RG_PLAY         0x80 
    434430    #undef SCREEN_COLOR 
    435     #define SCREEN_COLOR            0x1D 
    436      
     431    #define SCREEN_COLOR                0x1D 
     432 
    437433// Icon colors 
    438434// 3 shades of Red, Green, Yellow and Grey 
     
    470466// Used by :- A490, A495 
    471467 
    472     #define COLOR_WHITE         0x11 
    473     #define COLOR_RED           0x2F 
    474     #define COLOR_GREY          0x1F 
    475     #define COLOR_GREEN         0xFC 
    476     #define COLOR_BLUE_LT       0xEE 
    477     #define COLOR_BLUE          0xEF 
    478     #define COLOR_YELLOW        0xDD 
    479     #define COLOR_BG            0x0F 
    480     #define COLOR_FG            COLOR_WHITE 
    481     #define COLOR_SELECTED_BG   COLOR_RED 
    482     #define COLOR_SELECTED_FG   COLOR_WHITE 
    483     #define COLOR_ALT_BG        0x20 
    484     #define COLOR_SPLASH_RED    0x22 
    485     #define COLOR_SPLASH_PINK   0x24 
    486     #define COLOR_SPLASH_GREY   0x1F 
    487     // colors for blended histo 
    488     #define COLOR_HISTO_R       COLOR_RED 
    489     #define COLOR_HISTO_R_PLAY  COLOR_RED 
    490     #define COLOR_HISTO_B       COLOR_BLUE 
    491     #define COLOR_HISTO_G       COLOR_GREEN 
    492     #define COLOR_HISTO_G_PLAY  COLOR_GREEN 
    493     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    494     #define COLOR_HISTO_RG      COLOR_YELLOW 
    495     #define COLOR_HISTO_RB      0x66 
    496     #define COLOR_HISTO_RB_PLAY 0xE2 
    497     #define COLOR_HISTO_B_PLAY  0xCC 
    498     #define COLOR_HISTO_BG_PLAY 0x99 
    499     #define COLOR_HISTO_RG_PLAY 0x66 
    500      
     468    #define COLOR_WHITE                 0x11 
     469    #define COLOR_RED                   0x2F 
     470    #define COLOR_GREY                  0x1F 
     471    #define COLOR_GREEN                 0xFC 
     472    #define COLOR_BLUE_LT               0xEE 
     473    #define COLOR_BLUE                  0xEF 
     474    #define COLOR_YELLOW                0xDD 
     475    #define COLOR_BG                    0x0F 
     476    #define COLOR_FG                    COLOR_WHITE 
     477    #define COLOR_SELECTED_BG           COLOR_RED 
     478    #define COLOR_SELECTED_FG           COLOR_WHITE 
     479    #define COLOR_ALT_BG                0x20 
     480    #define COLOR_SPLASH_RED            0x22 
     481    #define COLOR_SPLASH_PINK           0x24 
     482    #define COLOR_SPLASH_GREY           0x1F 
     483    #define COLOR_HISTO_R               COLOR_RED 
     484    #define COLOR_HISTO_R_PLAY          COLOR_RED 
     485    #define COLOR_HISTO_B               COLOR_BLUE 
     486    #define COLOR_HISTO_G               COLOR_GREEN 
     487    #define COLOR_HISTO_G_PLAY          COLOR_GREEN 
     488    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     489    #define COLOR_HISTO_RG              COLOR_YELLOW 
     490    #define COLOR_HISTO_RB              0x66 
     491    #define COLOR_HISTO_RB_PLAY         0xE2 
     492    #define COLOR_HISTO_B_PLAY          0xCC 
     493    #define COLOR_HISTO_BG_PLAY         0x99 
     494    #define COLOR_HISTO_RG_PLAY         0x66 
     495 
    501496#elif CAM_BITMAP_PALETTE==9 
    502497 
    503498// Used by :- S95 
    504499 
    505     #define COLOR_WHITE         0x01 
    506     #define COLOR_RED           0x66 
    507     #define COLOR_GREY          0x6D 
    508     #define COLOR_GREEN         0x69 
    509     #define COLOR_BLUE_LT       0x68 
    510     #define COLOR_BLUE          0x67 
    511     #define COLOR_YELLOW        0x60 
    512     #define COLOR_BG            0x20 
    513     #define COLOR_FG            COLOR_WHITE 
    514     #define COLOR_SELECTED_BG   COLOR_RED 
    515     #define COLOR_SELECTED_FG   COLOR_WHITE 
    516     #define COLOR_ALT_BG        0x20 
    517     #define COLOR_SPLASH_RED    COLOR_RED 
    518     #define COLOR_SPLASH_PINK   COLOR_GREY 
    519     #define COLOR_SPLASH_GREY   0xDE 
    520     #define COLOR_HISTO_R       COLOR_RED 
    521     #define COLOR_HISTO_R_PLAY  COLOR_RED 
    522     #define COLOR_HISTO_B       COLOR_BLUE 
    523     #define COLOR_HISTO_G       COLOR_GREEN 
    524     #define COLOR_HISTO_G_PLAY  COLOR_GREEN 
    525     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    526     #define COLOR_HISTO_RG      COLOR_YELLOW 
    527     #define COLOR_HISTO_RB      COLOR_RED 
    528     #define COLOR_HISTO_RB_PLAY COLOR_HISTO_RB 
    529     #define COLOR_HISTO_B_PLAY  COLOR_HISTO_B 
    530     #define COLOR_HISTO_BG_PLAY COLOR_BLUE_LT 
    531     #define COLOR_HISTO_RG_PLAY COLOR_YELLOW 
     500    #define COLOR_WHITE                 0x01 
     501    #define COLOR_RED                   0x66 
     502    #define COLOR_GREY                  0x6D 
     503    #define COLOR_GREEN                 0x69 
     504    #define COLOR_BLUE_LT               0x68 
     505    #define COLOR_BLUE                  0x67 
     506    #define COLOR_YELLOW                0x60 
     507    #define COLOR_BG                    0x20 
     508    #define COLOR_FG                    COLOR_WHITE 
     509    #define COLOR_SELECTED_BG           COLOR_RED 
     510    #define COLOR_SELECTED_FG           COLOR_WHITE 
     511    #define COLOR_ALT_BG                0x20 
     512    #define COLOR_SPLASH_RED            COLOR_RED 
     513    #define COLOR_SPLASH_PINK           COLOR_GREY 
     514    #define COLOR_SPLASH_GREY           0xDE 
     515    #define COLOR_HISTO_R               COLOR_RED 
     516    #define COLOR_HISTO_R_PLAY          COLOR_RED 
     517    #define COLOR_HISTO_B               COLOR_BLUE 
     518    #define COLOR_HISTO_G               COLOR_GREEN 
     519    #define COLOR_HISTO_G_PLAY          COLOR_GREEN 
     520    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     521    #define COLOR_HISTO_RG              COLOR_YELLOW 
     522    #define COLOR_HISTO_RB              COLOR_RED 
     523    #define COLOR_HISTO_RB_PLAY         COLOR_HISTO_RB 
     524    #define COLOR_HISTO_B_PLAY          COLOR_HISTO_B 
     525    #define COLOR_HISTO_BG_PLAY         COLOR_BLUE_LT 
     526    #define COLOR_HISTO_RG_PLAY         COLOR_YELLOW 
    532527 
    533528#elif CAM_BITMAP_PALETTE==10 
     
    535530// Used by :- SX220HS, SX230HS, IXUS220_ELPH300HS, IXUS230_ELPH310HS 
    536531 
    537     #define COLOR_WHITE         0x01 
    538     #define COLOR_RED           0x9f 
    539     #define COLOR_GREY          0x1a 
    540     #define COLOR_GREY_LIGHT    0x0B 
    541     #define COLOR_GREY_DARK     0x19 
    542     #define COLOR_GREEN         0xa0 
    543     #define COLOR_BLUE_LT       0x96 
    544     #define COLOR_BLUE          0xa1 
    545     #define COLOR_YELLOW        0x92 
    546     #define COLOR_BG            0x4B 
    547     #define COLOR_FG            COLOR_WHITE 
    548     #define COLOR_SELECTED_BG   0x0e 
    549     #define COLOR_SELECTED_FG   COLOR_BLACK 
    550     #define COLOR_ALT_BG        COLOR_BG 
    551     #define COLOR_SPLASH_RED    COLOR_RED 
    552     #define COLOR_SPLASH_PINK   0x1e    // Orange 
    553     #define COLOR_SPLASH_GREY   0x16 
    554     #define COLOR_HISTO_R       0x6C 
    555     #define COLOR_HISTO_R_PLAY  COLOR_RED 
    556     #define COLOR_HISTO_B       0x6D 
    557     #define COLOR_HISTO_B_PLAY  COLOR_BLUE 
    558     #define COLOR_HISTO_G       0x90 
    559     #define COLOR_HISTO_G_PLAY  COLOR_GREEN 
    560     #define COLOR_HISTO_BG      0x52    //COLOR_BLUE_LT 
    561     #define COLOR_HISTO_RG      0x51    //COLOR_YELLOW 
    562     #define COLOR_HISTO_RB      0x3D    //COLOR_RED 
    563     #define COLOR_HISTO_RB_PLAY COLOR_HISTO_RB 
    564     #define COLOR_HISTO_BG_PLAY COLOR_BLUE_LT 
    565     #define COLOR_HISTO_RG_PLAY COLOR_YELLOW 
     532    #define COLOR_WHITE                 0x01 
     533    #define COLOR_RED                   0x9f 
     534    #define COLOR_GREY                  0x1a 
     535    #define COLOR_GREY_LIGHT            0x0B 
     536    #define COLOR_GREY_DARK             0x19 
     537    #define COLOR_GREEN                 0xa0 
     538    #define COLOR_BLUE_LT               0x96 
     539    #define COLOR_BLUE                  0xa1 
     540    #define COLOR_YELLOW                0x92 
     541    #define COLOR_BG                    0x4B 
     542    #define COLOR_FG                    COLOR_WHITE 
     543    #define COLOR_SELECTED_BG           0x0e 
     544    #define COLOR_SELECTED_FG           COLOR_BLACK 
     545    #define COLOR_ALT_BG                COLOR_BG 
     546    #define COLOR_SPLASH_RED            COLOR_RED 
     547    #define COLOR_SPLASH_PINK           0x1e    // Orange 
     548    #define COLOR_SPLASH_GREY           0x16 
     549    #define COLOR_HISTO_R               0x6C 
     550    #define COLOR_HISTO_R_PLAY          COLOR_RED 
     551    #define COLOR_HISTO_B               0x6D 
     552    #define COLOR_HISTO_B_PLAY          COLOR_BLUE 
     553    #define COLOR_HISTO_G               0x90 
     554    #define COLOR_HISTO_G_PLAY          COLOR_GREEN 
     555    #define COLOR_HISTO_BG              0x52    //COLOR_BLUE_LT 
     556    #define COLOR_HISTO_RG              0x51    //COLOR_YELLOW 
     557    #define COLOR_HISTO_RB              0x3D    //COLOR_RED 
     558    #define COLOR_HISTO_RB_PLAY         COLOR_HISTO_RB 
     559    #define COLOR_HISTO_BG_PLAY         COLOR_BLUE_LT 
     560    #define COLOR_HISTO_RG_PLAY         COLOR_YELLOW 
    566561    #undef SCREEN_COLOR 
    567     #define SCREEN_COLOR            0x1D 
    568      
     562    #define SCREEN_COLOR                0x1D 
     563 
    569564// Icon colors 
    570565// 3 shades of Red, Green, Yellow and Grey 
     
    602597    // pallete changes almost completely depenting on mode and if canon menu is active or not 
    603598    // playback, playback with menu, photo record mode, photo record mode with menu, ... 
    604     #define COLOR_WHITE         0x01    // always the same 
    605     #define COLOR_RED           0x1E    // always the same, bright orange (red is only available in record more without menu) 
    606     #define COLOR_GREY          0x16    // always the same 
    607     #define COLOR_GREEN         0x9F    // playback only, without menu 
    608     #define COLOR_BLUE_LT       0x0C    // playback: light brown 
    609     #define COLOR_BLUE          0x12    // playback: dark brown (almost like sh.t) 
    610     #define COLOR_YELLOW        0x90    // playback only, without menu 
    611     #define COLOR_BG            0x1D    // greyisch 
    612     #define COLOR_FG            COLOR_WHITE 
    613     #define COLOR_SELECTED_BG   COLOR_RED    // always the same, light grey 
    614     #define COLOR_SELECTED_FG   COLOR_BLACK 
    615     #define COLOR_ALT_BG        COLOR_BG 
    616     #define COLOR_SPLASH_RED    COLOR_RED 
    617     #define COLOR_SPLASH_PINK   COLOR_BLUE 
    618     #define COLOR_SPLASH_GREY   0x16    // darker grey 
    619     #define COLOR_HISTO_R       0x66    // record only, without menu 
    620     #define COLOR_HISTO_R_PLAY  COLOR_RED 
    621     #define COLOR_HISTO_B       0x3C 
    622     #define COLOR_HISTO_B_PLAY  0x50    // playback without menu dont have blue at all, bright Orange 
    623     #define COLOR_HISTO_G       0x6B 
    624     #define COLOR_HISTO_G_PLAY  COLOR_GREEN 
    625     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    626     #define COLOR_HISTO_RG      COLOR_YELLOW 
    627     #define COLOR_HISTO_RB      COLOR_RED 
    628     #define COLOR_HISTO_RB_PLAY COLOR_HISTO_RB 
    629     #define COLOR_HISTO_BG_PLAY COLOR_BLUE_LT 
    630     #define COLOR_HISTO_RG_PLAY COLOR_YELLOW 
     599    #define COLOR_WHITE                 0x01    // always the same 
     600    #define COLOR_RED                   0x1E    // always the same, bright orange (red is only available in record more without menu) 
     601    #define COLOR_GREY                  0x16    // always the same 
     602    #define COLOR_GREEN                 0x9F    // playback only, without menu 
     603    #define COLOR_BLUE_LT               0x0C    // playback: light brown 
     604    #define COLOR_BLUE                  0x12    // playback: dark brown (almost like sh.t) 
     605    #define COLOR_YELLOW                0x90    // playback only, without menu 
     606    #define COLOR_BG                    0x1D    // greyisch 
     607    #define COLOR_FG                    COLOR_WHITE 
     608    #define COLOR_SELECTED_BG           COLOR_RED    // always the same, light grey 
     609    #define COLOR_SELECTED_FG           COLOR_BLACK 
     610    #define COLOR_ALT_BG                COLOR_BG 
     611    #define COLOR_SPLASH_RED            COLOR_RED 
     612    #define COLOR_SPLASH_PINK           COLOR_BLUE 
     613    #define COLOR_SPLASH_GREY           0x16    // darker grey 
     614    // colors for blended histo 
     615    #define COLOR_HISTO_R               0x66    // record only, without menu 
     616    #define COLOR_HISTO_R_PLAY          COLOR_RED 
     617    #define COLOR_HISTO_B               0x3C 
     618    #define COLOR_HISTO_B_PLAY          0x50    // playback without menu dont have blue at all, bright Orange 
     619    #define COLOR_HISTO_G               0x6B 
     620    #define COLOR_HISTO_G_PLAY          COLOR_GREEN 
     621    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     622    #define COLOR_HISTO_RG              COLOR_YELLOW 
     623    #define COLOR_HISTO_RB              COLOR_RED 
     624    #define COLOR_HISTO_RB_PLAY         COLOR_HISTO_RB 
     625    #define COLOR_HISTO_BG_PLAY         COLOR_BLUE_LT 
     626    #define COLOR_HISTO_RG_PLAY         COLOR_YELLOW 
    631627 
    632628#elif CAM_BITMAP_PALETTE==12 
     
    634630// Used by :- A1100 
    635631 
    636     #define COLOR_WHITE         0x0A 
    637     #define COLOR_RED           0x6B 
    638     #define COLOR_GREY          0x17 
    639     #define COLOR_GREEN         0x96 
    640     #define COLOR_BLUE_LT       0x79 
    641     #define COLOR_BLUE          0x8A 
    642     #define COLOR_YELLOW        0x54 
    643     #define COLOR_BG            0x1F 
    644     #define COLOR_FG            COLOR_WHITE 
    645     #define COLOR_SELECTED_BG   COLOR_RED 
    646     #define COLOR_SELECTED_FG   COLOR_WHITE 
    647     #define COLOR_ALT_BG        0x87 
    648     #define COLOR_SPLASH_RED    0x60 
    649     #define COLOR_SPLASH_PINK   0xBD 
    650     #define COLOR_SPLASH_GREY   0x16 
     632    #define COLOR_WHITE                 0x0A 
     633    #define COLOR_RED                   0x6B 
     634    #define COLOR_GREY                  0x17 
     635    #define COLOR_GREEN                 0x96 
     636    #define COLOR_BLUE_LT               0x79 
     637    #define COLOR_BLUE                  0x8A 
     638    #define COLOR_YELLOW                0x54 
     639    #define COLOR_BG                    0x1F 
     640    #define COLOR_FG                    COLOR_WHITE 
     641    #define COLOR_SELECTED_BG           COLOR_RED 
     642    #define COLOR_SELECTED_FG           COLOR_WHITE 
     643    #define COLOR_ALT_BG                0x87 
     644    #define COLOR_SPLASH_RED            0x60 
     645    #define COLOR_SPLASH_PINK           0xBD 
     646    #define COLOR_SPLASH_GREY           0x16 
    651647    // colors for blended histo 
    652     #define COLOR_HISTO_R       COLOR_RED 
    653     #define COLOR_HISTO_R_PLAY  COLOR_RED 
    654     #define COLOR_HISTO_B       COLOR_BLUE 
    655     #define COLOR_HISTO_G       COLOR_GREEN 
    656     #define COLOR_HISTO_G_PLAY  COLOR_GREEN 
    657     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    658     #define COLOR_HISTO_RG      COLOR_YELLOW 
    659     #define COLOR_HISTO_RB      0x66 
    660     #define COLOR_HISTO_RB_PLAY 0xE2 
    661     #define COLOR_HISTO_B_PLAY  0xCC 
    662     #define COLOR_HISTO_BG_PLAY 0x99 
    663     #define COLOR_HISTO_RG_PLAY 0x66 
     648    #define COLOR_HISTO_R               COLOR_RED 
     649    #define COLOR_HISTO_R_PLAY          COLOR_RED 
     650    #define COLOR_HISTO_B               COLOR_BLUE 
     651    #define COLOR_HISTO_G               COLOR_GREEN 
     652    #define COLOR_HISTO_G_PLAY          COLOR_GREEN 
     653    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     654    #define COLOR_HISTO_RG              COLOR_YELLOW 
     655    #define COLOR_HISTO_RB              0x66 
     656    #define COLOR_HISTO_RB_PLAY         0xE2 
     657    #define COLOR_HISTO_B_PLAY          0xCC 
     658    #define COLOR_HISTO_BG_PLAY         0x99 
     659    #define COLOR_HISTO_RG_PLAY         0x66 
    664660    #undef SCREEN_COLOR 
    665     #define SCREEN_COLOR        0x1D 
     661    #define SCREEN_COLOR                0x1D 
    666662 
    667663#elif CAM_BITMAP_PALETTE==13 
     
    669665// Used by :- G12, SX30, SX40HS, IXUS310_ELPH500HS 
    670666 
    671     // Default Canon colors 
    672     #define COLOR_WHITE         0x01 
    673     #define COLOR_GREY_DK       0x1a 
    674     #define COLOR_GREY          0x16 
    675     #define COLOR_GREY_LT       0x0E 
     667    #define COLOR_WHITE                 0x01 
     668    #define COLOR_GREY_DK               0x1a 
     669    #define COLOR_GREY                  0x16 
     670    #define COLOR_GREY_LT               0x0E 
    676671    #undef SCREEN_COLOR 
    677     #define SCREEN_COLOR        0x1D 
     672    #define SCREEN_COLOR                0x1D 
    678673 
    679674    // CHDK colors loaded into these locations in the camera palette by load_chdk_palette() 
    680     #define COLOR_RED           (CHDK_COLOR_BASE+0) 
    681     #define COLOR_RED_DK        (CHDK_COLOR_BASE+1) 
    682     #define COLOR_RED_LT        (CHDK_COLOR_BASE+2) 
    683     #define COLOR_GREEN         (CHDK_COLOR_BASE+3) 
    684     #define COLOR_GREEN_DK      (CHDK_COLOR_BASE+4) 
    685     #define COLOR_GREEN_LT      (CHDK_COLOR_BASE+5) 
    686     #define COLOR_BLUE          (CHDK_COLOR_BASE+6) 
    687     #define COLOR_BLUE_DK       (CHDK_COLOR_BASE+7) 
    688     #define COLOR_BLUE_LT       (CHDK_COLOR_BASE+8) 
    689     #define COLOR_MAGENTA       (CHDK_COLOR_BASE+9) 
    690     #define COLOR_YELLOW        (CHDK_COLOR_BASE+10) 
    691     #define COLOR_YELLOW_DK     (CHDK_COLOR_BASE+11) 
    692     #define COLOR_YELLOW_LT     (CHDK_COLOR_BASE+12) 
    693  
    694     #define COLOR_CYAN          COLOR_BLUE_LT 
    695     #define COLOR_BG            COLOR_GREY_DK 
    696     #define COLOR_FG            COLOR_WHITE 
    697     #define COLOR_SELECTED_BG   COLOR_GREY_LT 
    698     #define COLOR_SELECTED_FG   COLOR_BLACK 
    699     #define COLOR_ALT_BG        COLOR_BG 
    700  
    701     #define COLOR_SPLASH_RED    COLOR_RED_DK 
    702     #define COLOR_SPLASH_PINK   COLOR_RED_LT 
    703     #define COLOR_SPLASH_GREY   COLOR_GREY_LT 
    704  
    705     #define COLOR_HISTO_R       COLOR_RED 
    706     #define COLOR_HISTO_R_PLAY  COLOR_RED 
    707     #define COLOR_HISTO_B       COLOR_BLUE 
    708     #define COLOR_HISTO_B_PLAY  COLOR_BLUE 
    709     #define COLOR_HISTO_G       COLOR_GREEN 
    710     #define COLOR_HISTO_G_PLAY  COLOR_GREEN 
    711     #define COLOR_HISTO_BG      COLOR_CYAN 
    712     #define COLOR_HISTO_BG_PLAY COLOR_CYAN 
    713     #define COLOR_HISTO_RG      COLOR_YELLOW 
    714     #define COLOR_HISTO_RG_PLAY COLOR_YELLOW 
    715     #define COLOR_HISTO_RB      COLOR_MAGENTA 
    716     #define COLOR_HISTO_RB_PLAY COLOR_MAGENTA 
     675    #define COLOR_RED                   (CHDK_COLOR_BASE+0) 
     676    #define COLOR_RED_DK                (CHDK_COLOR_BASE+1) 
     677    #define COLOR_RED_LT                (CHDK_COLOR_BASE+2) 
     678    #define COLOR_GREEN                 (CHDK_COLOR_BASE+3) 
     679    #define COLOR_GREEN_DK              (CHDK_COLOR_BASE+4) 
     680    #define COLOR_GREEN_LT              (CHDK_COLOR_BASE+5) 
     681    #define COLOR_BLUE                  (CHDK_COLOR_BASE+6) 
     682    #define COLOR_BLUE_DK               (CHDK_COLOR_BASE+7) 
     683    #define COLOR_BLUE_LT               (CHDK_COLOR_BASE+8) 
     684    #define COLOR_MAGENTA               (CHDK_COLOR_BASE+9) 
     685    #define COLOR_YELLOW                (CHDK_COLOR_BASE+10) 
     686    #define COLOR_YELLOW_DK             (CHDK_COLOR_BASE+11) 
     687    #define COLOR_YELLOW_LT             (CHDK_COLOR_BASE+12) 
     688 
     689    #define COLOR_CYAN                  COLOR_BLUE_LT 
     690    #define COLOR_BG                    COLOR_GREY_DK 
     691    #define COLOR_FG                    COLOR_WHITE 
     692    #define COLOR_SELECTED_BG           COLOR_GREY_LT 
     693    #define COLOR_SELECTED_FG           COLOR_BLACK 
     694    #define COLOR_ALT_BG                COLOR_BG 
     695    #define COLOR_SPLASH_RED            COLOR_RED_DK 
     696    #define COLOR_SPLASH_PINK           COLOR_RED_LT 
     697    #define COLOR_SPLASH_GREY           COLOR_GREY_LT 
     698    #define COLOR_HISTO_R               COLOR_RED 
     699    #define COLOR_HISTO_R_PLAY          COLOR_RED 
     700    #define COLOR_HISTO_B               COLOR_BLUE 
     701    #define COLOR_HISTO_B_PLAY          COLOR_BLUE 
     702    #define COLOR_HISTO_G               COLOR_GREEN 
     703    #define COLOR_HISTO_G_PLAY          COLOR_GREEN 
     704    #define COLOR_HISTO_BG              COLOR_CYAN 
     705    #define COLOR_HISTO_BG_PLAY         COLOR_CYAN 
     706    #define COLOR_HISTO_RG              COLOR_YELLOW 
     707    #define COLOR_HISTO_RG_PLAY         COLOR_YELLOW 
     708    #define COLOR_HISTO_RB              COLOR_MAGENTA 
     709    #define COLOR_HISTO_RB_PLAY         COLOR_MAGENTA 
    717710 
    718711// Icon colors 
     
    737730// Used by :- A3000IS 
    738731 
    739     #define COLOR_TRANSPARENT   0x00 
    740     #define COLOR_WHITE         0x01 
    741     #define COLOR_RED           0x22 
    742     #define COLOR_GREY          0xF3 
    743     #define COLOR_GREEN         0xcF 
    744     #define COLOR_BLUE_LT       0x61 
    745     #define COLOR_BLUE          0xE7 
    746     #define COLOR_YELLOW        0xDD 
    747     #define COLOR_BG            0x0F 
    748     #define COLOR_FG            COLOR_WHITE 
    749     #define COLOR_SELECTED_BG   COLOR_RED 
    750     #define COLOR_SELECTED_FG   COLOR_GREY 
    751     #define COLOR_ALT_BG        0xf0 
    752     #define COLOR_SPLASH_RED    COLOR_RED 
    753     #define COLOR_SPLASH_PINK   0x4E 
    754     #define COLOR_SPLASH_GREY   0x6F 
    755     // colors for blended histo 
    756     #define COLOR_HISTO_R       COLOR_RED 
    757     #define COLOR_HISTO_R_PLAY  COLOR_RED 
    758     #define COLOR_HISTO_B       COLOR_BLUE 
    759     #define COLOR_HISTO_G       COLOR_GREEN 
    760     #define COLOR_HISTO_G_PLAY  COLOR_GREEN 
    761     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    762     #define COLOR_HISTO_RG      COLOR_YELLOW 
    763     #define COLOR_HISTO_RB      COLOR_RED 
    764     #define COLOR_HISTO_RB_PLAY COLOR_HISTO_RB 
    765     #define COLOR_HISTO_B_PLAY  COLOR_HISTO_B 
    766     #define COLOR_HISTO_BG_PLAY COLOR_BLUE_LT 
    767     #define COLOR_HISTO_RG_PLAY COLOR_YELLOW 
     732    #define COLOR_WHITE                 0x01 
     733    #define COLOR_RED                   0x22 
     734    #define COLOR_GREY                  0xF3 
     735    #define COLOR_GREEN                 0xcF 
     736    #define COLOR_BLUE_LT               0x61 
     737    #define COLOR_BLUE                  0xE7 
     738    #define COLOR_YELLOW                0xDD 
     739    #define COLOR_BG                    0x0F 
     740    #define COLOR_FG                    COLOR_WHITE 
     741    #define COLOR_SELECTED_BG           COLOR_RED 
     742    #define COLOR_SELECTED_FG           COLOR_GREY 
     743    #define COLOR_ALT_BG                0xf0 
     744    #define COLOR_SPLASH_RED            COLOR_RED 
     745    #define COLOR_SPLASH_PINK           0x4E 
     746    #define COLOR_SPLASH_GREY           0x6F 
     747    #define COLOR_HISTO_R               COLOR_RED 
     748    #define COLOR_HISTO_R_PLAY          COLOR_RED 
     749    #define COLOR_HISTO_B               COLOR_BLUE 
     750    #define COLOR_HISTO_G               COLOR_GREEN 
     751    #define COLOR_HISTO_G_PLAY          COLOR_GREEN 
     752    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     753    #define COLOR_HISTO_RG              COLOR_YELLOW 
     754    #define COLOR_HISTO_RB              COLOR_RED 
     755    #define COLOR_HISTO_RB_PLAY         COLOR_HISTO_RB 
     756    #define COLOR_HISTO_B_PLAY          COLOR_HISTO_B 
     757    #define COLOR_HISTO_BG_PLAY         COLOR_BLUE_LT 
     758    #define COLOR_HISTO_RG_PLAY         COLOR_YELLOW 
    768759 
    769760#elif CAM_BITMAP_PALETTE==15 
     
    771762// Used by :- A3300IS 
    772763 
    773     #define COLOR_TRANS                 0x4C 
    774     #define COLOR_WHITE         0x01 
    775     #define COLOR_RED           0x6C 
    776     #define COLOR_GREY          0x1D 
    777     #define COLOR_GREEN         0x5A 
    778     #define COLOR_BLUE_LT       0x58 
    779     #define COLOR_BLUE          0x6D 
    780     #define COLOR_YELLOW        0x51 
    781     #define COLOR_BG            COLOR_TRANS 
    782     #define COLOR_FG            COLOR_WHITE 
    783     #define COLOR_SELECTED_BG   COLOR_RED 
    784     #define COLOR_SELECTED_FG   COLOR_WHITE 
    785     #define COLOR_ALT_BG        COLOR_TRANS 
    786     #define COLOR_SPLASH_RED    COLOR_RED 
    787     #define COLOR_SPLASH_PINK   COLOR_YELLOW 
    788     #define COLOR_SPLASH_GREY   COLOR_GREY 
    789     // colors for blended histo 
    790     #define COLOR_HISTO_R       COLOR_RED 
    791     #define COLOR_HISTO_R_PLAY  0x9F 
    792     #define COLOR_HISTO_B       COLOR_BLUE 
    793     #define COLOR_HISTO_G       COLOR_GREEN 
    794     #define COLOR_HISTO_G_PLAY  0xA0 
    795     #define COLOR_HISTO_BG      COLOR_BLUE_LT 
    796     #define COLOR_HISTO_RG      COLOR_YELLOW 
    797     #define COLOR_HISTO_RB      0x66 
    798     #define COLOR_HISTO_RB_PLAY 0x9F 
    799     #define COLOR_HISTO_B_PLAY  0xA1 
    800     #define COLOR_HISTO_BG_PLAY 0xA0 
    801     #define COLOR_HISTO_RG_PLAY 0x9F 
     764    #define COLOR_TRANS                 0x4C 
     765    #define COLOR_WHITE                 0x01 
     766    #define COLOR_RED                   0x6C 
     767    #define COLOR_GREY                  0x1D 
     768    #define COLOR_GREEN                 0x5A 
     769    #define COLOR_BLUE_LT               0x58 
     770    #define COLOR_BLUE                  0x6D 
     771    #define COLOR_YELLOW                0x51 
     772    #define COLOR_BG                    COLOR_TRANS 
     773    #define COLOR_FG                    COLOR_WHITE 
     774    #define COLOR_SELECTED_BG           COLOR_RED 
     775    #define COLOR_SELECTED_FG           COLOR_WHITE 
     776    #define COLOR_ALT_BG                COLOR_TRANS 
     777    #define COLOR_SPLASH_RED            COLOR_RED 
     778    #define COLOR_SPLASH_PINK           COLOR_YELLOW 
     779    #define COLOR_SPLASH_GREY           COLOR_GREY 
     780    #define COLOR_HISTO_R               COLOR_RED 
     781    #define COLOR_HISTO_R_PLAY          0x9F 
     782    #define COLOR_HISTO_B               COLOR_BLUE 
     783    #define COLOR_HISTO_G               COLOR_GREEN 
     784    #define COLOR_HISTO_G_PLAY          0xA0 
     785    #define COLOR_HISTO_BG              COLOR_BLUE_LT 
     786    #define COLOR_HISTO_RG              COLOR_YELLOW 
     787    #define COLOR_HISTO_RB              0x66 
     788    #define COLOR_HISTO_RB_PLAY         0x9F 
     789    #define COLOR_HISTO_B_PLAY          0xA1 
     790    #define COLOR_HISTO_BG_PLAY         0xA0 
     791    #define COLOR_HISTO_RG_PLAY         0x9F 
    802792    #undef SCREEN_COLOR 
    803     #define SCREEN_COLOR        0x4C 
    804  
    805 // Icon colors 
    806 // 3 shades of Red, Green, Yellow and Grey 
    807 // Separate definitions for record and playback mode 
    808 // to cater for cameras with variable palettes 
    809     // Record mode colors 
    810     #define     COLOR_ICON_REC_RED                      COLOR_RED 
    811     #define     COLOR_ICON_REC_RED_DK           COLOR_RED 
    812     #define     COLOR_ICON_REC_RED_LT           COLOR_RED 
    813     #define     COLOR_ICON_REC_GREEN            0x90 
    814     #define     COLOR_ICON_REC_GREEN_DK         COLOR_GREEN 
    815     #define     COLOR_ICON_REC_GREEN_LT         0x50 
    816     #define     COLOR_ICON_REC_YELLOW           0x6B 
    817     #define     COLOR_ICON_REC_YELLOW_DK        COLOR_YELLOW 
    818     #define     COLOR_ICON_REC_YELLOW_LT        0x6B 
    819     #define     COLOR_ICON_REC_GREY                     COLOR_GREY 
    820     #define     COLOR_ICON_REC_GREY_DK          COLOR_GREY 
    821     #define     COLOR_ICON_REC_GREY_LT          0x13 
    822     // Playback mode colors 
    823     #define     COLOR_ICON_PLY_RED                      0x9F 
    824     #define     COLOR_ICON_PLY_RED_DK           0x9F 
    825     #define     COLOR_ICON_PLY_RED_LT           0x9F 
    826     #define     COLOR_ICON_PLY_GREEN            0xA0 
    827     #define     COLOR_ICON_PLY_GREEN_DK         0xA0 
    828     #define     COLOR_ICON_PLY_GREEN_LT         0x9E 
    829     #define     COLOR_ICON_PLY_YELLOW           0x92 
    830     #define     COLOR_ICON_PLY_YELLOW_DK        0x92 
    831     #define     COLOR_ICON_PLY_YELLOW_LT        0x90 
    832     #define     COLOR_ICON_PLY_GREY                     COLOR_ICON_REC_GREY 
    833     #define     COLOR_ICON_PLY_GREY_DK          COLOR_ICON_REC_GREY_DK 
    834     #define     COLOR_ICON_PLY_GREY_LT          COLOR_ICON_REC_GREY_LT 
     793    #define SCREEN_COLOR                0x4C 
     794 
     795    // Icon colors 
     796    // 3 shades of Red, Green, Yellow and Grey 
     797    // Separate definitions for record and playback mode 
     798    // to cater for cameras with variable palettes 
     799    #define COLOR_ICON_REC_RED          COLOR_RED 
     800    #define COLOR_ICON_REC_RED_DK       COLOR_RED 
     801    #define COLOR_ICON_REC_RED_LT       COLOR_RED 
     802    #define COLOR_ICON_REC_GREEN        0x90 
     803    #define COLOR_ICON_REC_GREEN_DK     COLOR_GREEN 
     804    #define COLOR_ICON_REC_GREEN_LT     0x50 
     805    #define COLOR_ICON_REC_YELLOW       0x6B 
     806    #define COLOR_ICON_REC_YELLOW_DK    COLOR_YELLOW 
     807    #define COLOR_ICON_REC_YELLOW_LT    0x6B 
     808    #define COLOR_ICON_REC_GREY         COLOR_GREY 
     809    #define COLOR_ICON_REC_GREY_DK      COLOR_GREY 
     810    #define COLOR_ICON_REC_GREY_LT      0x13 
     811    #define COLOR_ICON_PLY_RED          0x9F 
     812    #define COLOR_ICON_PLY_RED_DK       0x9F 
     813    #define COLOR_ICON_PLY_RED_LT       0x9F 
     814    #define COLOR_ICON_PLY_GREEN        0xA0 
     815    #define COLOR_ICON_PLY_GREEN_DK     0xA0 
     816    #define COLOR_ICON_PLY_GREEN_LT     0x9E 
     817    #define COLOR_ICON_PLY_YELLOW       0x92 
     818    #define COLOR_ICON_PLY_YELLOW_DK    0x92 
     819    #define COLOR_ICON_PLY_YELLOW_LT    0x90 
     820    #define COLOR_ICON_PLY_GREY         COLOR_ICON_REC_GREY 
     821    #define COLOR_ICON_PLY_GREY_DK      COLOR_ICON_REC_GREY_DK 
     822    #define COLOR_ICON_PLY_GREY_LT      COLOR_ICON_REC_GREY_LT 
    835823 
    836824#else 
     
    842830// Separate definitions for record and playback mode 
    843831// to cater for cameras with variable palettes 
    844 #if !defined(COLOR_ICON_REC_RED)    // Record mode colors 
     832#if !defined(COLOR_ICON_REC_RED)        // Record mode colors 
    845833    #define COLOR_ICON_REC_RED          0x22 
    846834    #define COLOR_ICON_REC_RED_DK       0x2F 
     
    856844    #define COLOR_ICON_REC_GREY_LT      0x13 
    857845#endif 
    858 #if !defined(COLOR_ICON_PLY_RED)    // Playback mode colors 
     846#if !defined(COLOR_ICON_PLY_RED)        // Playback mode colors 
    859847    #define COLOR_ICON_PLY_RED          COLOR_ICON_REC_RED 
    860848    #define COLOR_ICON_PLY_RED_DK       COLOR_ICON_REC_RED_DK 
     
    871859#endif 
    872860 
    873 #define FONT_WIDTH          8 
    874 #define FONT_HEIGHT         16 
     861#define FONT_WIDTH                      8 
     862#define FONT_HEIGHT                     16 
    875863 
    876864//------------------------------------------------------------------- 
     
    921909extern void draw_ellipse(coord xc, coord yc, unsigned int a, unsigned int b, color cl); 
    922910extern void draw_filled_ellipse(coord xc, coord yc, unsigned int a, unsigned int b, color cl); 
    923      
     911 
    924912extern void draw_get_icon_colors(); 
    925913extern color icon_green[3], icon_red[3], icon_yellow[3], icon_grey[3]; 
  • trunk/core/gui_lang.h

    r1682 r1719  
    358358#define LANG_MENU_DEBUG_TASKLIST_START          273 
    359359 
    360 #define LANG_MENU_DOF_DIST_FROM_LENS            274 
     360//#define LANG_MENU_DOF_DIST_FROM_LENS            274 
    361361#define LANG_MENU_CLEAR_BRACKET_VALUES          275 
    362362 
  • trunk/core/gui_osd.c

    r1693 r1719  
    88#include "gui_lang.h" 
    99#include "gui_osd.h" 
     10#ifdef OPT_EDGEOVERLAY 
     11    #include "edgeoverlay.h" 
     12#endif 
    1013 
    1114//------------------------------------------------------------------- 
     
    274277    if (conf.override_disable == 1) gui_print_osd_state_string_chr("NO ", "OVERRIDES"); 
    275278    if (conf.flash_manual_override) gui_print_osd_state_string_chr("Flash:", "Manual Override"); 
    276     /* 
    277     draw_string(conf.mode_state_pos.x, conf.mode_state_pos.y+n, get_debug(), conf.osd_color); 
    278     n+=FONT_HEIGHT; 
    279     */ 
     279#ifdef OPT_EDGEOVERLAY 
     280    // edgeoverlay state 
     281    if (conf.edge_overlay_enable || gui_mode==GUI_MODE_OSD) { 
     282        if (edge_state_draw==0) gui_print_osd_state_string_chr("EDGE:", "LIVE"); 
     283        else if (edge_state_draw==1) gui_print_osd_state_string_chr("EDGE:", ((conf.edge_overlay_pano==0)?"FROZEN":"PANO")); 
     284    } 
     285#endif 
     286#ifdef CAM_QUALITY_OVERRIDE 
     287    // displaying the overriding picture quality if active 
     288    if (!(conf.fast_image_quality==3) || gui_mode==GUI_MODE_OSD) { 
     289        if (conf.fast_image_quality==0) gui_print_osd_state_string_chr("QUALI:", "super"); 
     290        else if (conf.fast_image_quality==1) gui_print_osd_state_string_chr("QUALI:", "fine"); 
     291        else if (conf.fast_image_quality==2) gui_print_osd_state_string_chr("QUALI:", "normal"); 
     292    } 
     293#endif 
     294 
     295/* 
     296 draw_string(conf.mode_state_pos.x, conf.mode_state_pos.y+n, get_debug(), conf.osd_color); 
     297        n+=FONT_HEIGHT;*/ 
    280298} 
    281299 
  • trunk/core/gui_space.c

    r1698 r1719  
    9090 
    9191static void gui_space_draw_icon() { 
    92     coord x; 
    9392    register coord xx, yy; 
    94     int i; 
    9593 
    9694    xx = conf.space_icon_pos.x; 
     
    10199    draw_get_icon_colors(); 
    102100 
    103     color cl1 = icon_green[1]; 
    104     color cl2 = icon_green[0]; 
     101    color cl1 = icon_green[0]; 
     102    color cl2 = icon_green[1]; 
    105103    if (((conf.space_warn_type == 0) && (perc <= conf.space_perc_warn)) || 
    106104        ((conf.space_warn_type == 1) && (GetFreeCardSpaceKb() <= conf.space_mb_warn*1024))) 
    107105    { 
    108         cl1 = icon_red[1]; 
    109         cl2 = icon_red[0]; 
     106    cl1 = icon_red[0]; 
     107    cl2 = icon_red[1]; 
    110108    }  
    111109   
     
    113111    draw_hline(xx,    yy,    30,  icon_grey[2]); 
    114112    draw_vline(xx,    yy,    12,  icon_grey[2]); 
    115     draw_vline(xx+31, yy,    18,  icon_grey[0]); 
    116     draw_line(xx+1,   yy+13, xx+5, yy+17, icon_grey[0]); 
    117     draw_hline(xx+6,  yy+18, 24,  icon_grey[0]); 
     113    draw_vline(xx+31, yy,    18,  icon_grey[1]); 
     114    draw_line(xx+1,   yy+13, xx+5, yy+17, icon_grey[1]); 
     115    draw_hline(xx+6,  yy+18, 24,  icon_grey[1]); 
    118116            
    119     draw_filled_rect(xx+1,  yy+1,   xx+30,   yy+13,  MAKE_COLOR(icon_grey[1], icon_grey[1])); 
    120     draw_filled_rect(xx+5,  yy+14,  xx+30,   yy+17,  MAKE_COLOR(icon_grey[1], icon_grey[1])); 
    121     draw_filled_rect(xx+3,  yy+14,  xx+6,    yy+15,  MAKE_COLOR(icon_grey[1], icon_grey[1])); 
     117    draw_filled_rect(xx+1,  yy+1,   xx+30,   yy+13,  MAKE_COLOR(icon_grey[0], icon_grey[0])); 
     118    draw_filled_rect(xx+5,  yy+14,  xx+30,   yy+17,  MAKE_COLOR(icon_grey[0], icon_grey[0])); 
     119    draw_filled_rect(xx+3,  yy+14,  xx+6,    yy+15,  MAKE_COLOR(icon_grey[0], icon_grey[0])); 
    122120     
    123121    draw_filled_rect(xx+2,  yy+2,   xx+6,    yy+4,   MAKE_COLOR(icon_yellow[0], icon_yellow[0])); 
     
    125123    draw_filled_rect(xx+2,  yy+9,   xx+6,    yy+10,  MAKE_COLOR(icon_yellow[0], icon_yellow[0])); 
    126124    draw_filled_rect(xx+2,  yy+12,  xx+6,    yy+13,  MAKE_COLOR(icon_yellow[0], icon_yellow[0])); 
    127     draw_filled_rect(xx+5,  yy+15,  xx+9,    yy+16,  MAKE_COLOR(icon_yellow[0], icon_yellow[0]));    
     125    draw_filled_rect(xx+5,  yy+15,  xx+9,    yy+16,  MAKE_COLOR(icon_yellow[0], icon_yellow[0])); 
    128126     
    129127    draw_hline(xx+8,  yy,    2, COLOR_TRANSPARENT); 
    130     draw_hline(xx+11, yy,    3, icon_grey[0]); 
     128    draw_hline(xx+11, yy,    3, COLOR_WHITE); 
    131129    draw_hline(xx+11, yy+18, 2, COLOR_TRANSPARENT); 
    132130 
    133131    //fill icon 
    134     draw_rect(xx+9,         yy+4,   xx+28,   yy+13,  cl1); 
    135     draw_filled_rect(xx+27-(17*perc/100),      yy+5,       xx+27,     yy+12,   MAKE_COLOR(cl2, cl2)); 
     132    draw_rect(xx+9,         yy+5,   xx+28,   yy+13,  cl1); 
     133    draw_filled_rect(xx+27-(17*perc/100),    yy+6,   xx+27,   yy+12,   MAKE_COLOR(cl2, cl2)); 
    136134} 
    137135 
    138136//------------------------------------------------------------------- 
    139137static void gui_space_draw_percent() { 
    140     space_color(); 
    141     sprintf(osd_buf, "%3d%%", perc); 
    142     osd_buf[5]=0; 
     138    unsigned short offset = 0; 
     139 
     140    space_color(); 
     141#if CAM_MULTIPART 
     142    unsigned short partition_number = get_active_partition(); 
     143    if((conf.show_partition_nr) && (get_part_count() > 1)) { 
     144        sprintf(osd_buf, "%1d:\0", partition_number); 
     145        offset=2; 
     146    } 
     147    if(is_partition_changed()) 
     148    { 
     149        sprintf(osd_buf+offset, "???\0"); 
     150    } 
     151    else 
     152#endif 
     153    { 
     154        sprintf(osd_buf+offset, "%3d%%\0", perc); 
     155    } 
    143156    draw_string(conf.space_txt_pos.x, conf.space_txt_pos.y, osd_buf, cl); 
    144157} 
     
    146159//------------------------------------------------------------------- 
    147160static void gui_space_draw_mb() { 
    148     space_color(); 
    149     unsigned int freemb=GetFreeCardSpaceKb()/1024; 
    150     if (freemb < 10000) sprintf(osd_buf, "%4dM",freemb); 
    151     else sprintf(osd_buf, "%4dG",freemb/1024);   // if 10 GiB or more free, print in GiB instead of MiB 
    152     osd_buf[5]=0; 
    153     draw_string(conf.space_txt_pos.x, conf.space_txt_pos.y, osd_buf, cl); 
     161    unsigned short offset = 0; 
     162    unsigned int freemb = GetFreeCardSpaceKb()/1024; 
     163 
     164    space_color(); 
     165#if CAM_MULTIPART 
     166    unsigned short partition_number = get_active_partition(); 
     167    if((conf.show_partition_nr) && (get_part_count() > 1)) { 
     168        sprintf(osd_buf, "%1d:\0", partition_number); 
     169        offset=2; 
     170    } 
     171    if(is_partition_changed())  { 
     172        sprintf(osd_buf+offset, "???\0"); 
     173    } 
     174    else 
     175#endif 
     176    { 
     177        if (freemb < 10000) sprintf(osd_buf+offset, "%4d%M\0",freemb); 
     178        else sprintf(osd_buf+offset, "%4d%G\0",freemb/1024);   // if 10 GiB or more free, print in GiB instead of MiB 
     179        draw_string(conf.space_txt_pos.x, conf.space_txt_pos.y, osd_buf, cl); 
     180    } 
    154181} 
    155182 
  • trunk/core/histogram.c

    r1603 r1719  
    1212//------------------------------------------------------------------- 
    1313 
     14#define HISTOGRAM_IDLE_STAGE        6 
     15 
    1416// Indexes into the various arrays for calculating the histogram channels 
    1517#define HISTO_R                     0       // Red channel 
     
    6365static float logarithmic(float x)   { return log(x); } 
    6466 
    65 void histogram_process() 
    66 { 
    67     static unsigned char *img; 
    68     static int viewport_size, viewport_width, viewport_row_offset; 
    69  
    70     register int x, i, hi; 
    71     int y, v, u, c; 
    72     float (*histogram_transform)(float); 
    73     unsigned int histo_fill[5]; 
    74     int histo_main; 
    75  
    76     // Select transform function 
    77     switch (conf.histo_mode) 
    78     { 
    79         case HISTO_MODE_LOG:  
    80             histogram_transform = logarithmic;  
    81             break; 
    82         case HISTO_MODE_LINEAR:  
    83         default: 
    84             histogram_transform = identity;  
    85             break; 
    86     } 
    87  
    88     // Select which calculated histogram channel determines magnification / scaling 
    89     if (conf.histo_layout == OSD_HISTO_LAYOUT_Y || conf.histo_layout == OSD_HISTO_LAYOUT_Y_argb) 
    90         histo_main = HISTO_Y; 
    91     else 
    92         histo_main = HISTO_RGB; 
    93  
     67static void histogram_alloc() 
     68{ 
    9469    // Allocate arrays to store counts during processing 
    9570    // Each possible value is counted so the array sizes are set to 256, then these are summed to 
     
    10479        histogram_proc[4] = histogram_proc[3] + 256; 
    10580    } 
     81} 
     82 
     83void histogram_process() 
     84{ 
     85    static unsigned char *img; 
     86    static int viewport_size, viewport_width, viewport_row_offset; 
     87 
     88    register int x, i, hi; 
     89    int y, v, u, c; 
     90    float (*histogram_transform)(float); 
     91    unsigned int histo_fill[5]; 
     92    int histo_main; 
     93 
     94    // Select transform function 
     95    switch (conf.histo_mode) 
     96    { 
     97        case HISTO_MODE_LOG:  
     98            histogram_transform = logarithmic;  
     99            break; 
     100        case HISTO_MODE_LINEAR:  
     101        default: 
     102            histogram_transform = identity;  
     103            break; 
     104    } 
     105 
     106    // Select which calculated histogram channel determines magnification / scaling 
     107    if (conf.histo_layout == OSD_HISTO_LAYOUT_Y || conf.histo_layout == OSD_HISTO_LAYOUT_Y_argb) 
     108        histo_main = HISTO_Y; 
     109    else 
     110        histo_main = HISTO_RGB; 
     111 
     112    histogram_alloc(); 
    106113 
    107114    // This function is called in the main spytask loop roughly every 20msec 
     
    395402    } 
    396403} 
     404 
     405////////////////////////////////////////////////////////////////////////////////////////////// 
     406// @tsv 
     407// Module below calculate live histogram in same way as OSD histogram 
     408// Difference from shot_histogram family is that live_histogram give answer before shot 
     409// Regular histogram_process cannot be used, because raw non-summarized 0.255 values required 
     410// This module is used in AutoISO2 mechanizm. 
     411////////////////////////////////////////////////////////////////////////////////////////////// 
     412 
     413static int* live_histogram_proc;                // Buffer int[256] for histogram 
     414static int live_histogram_overall;              // Total num of pixels in histogram 
     415static int histogram_stored_stage = -1;         // Stored value of histogram_stage (-1 = not stored yet) 
     416 
     417void live_histogram_process_quick() 
     418{ 
     419    static unsigned char *img; 
     420    int i, y, x, stage,viewport_size; 
     421 
     422    // Small hack: save space reuse common histogram buffer 
     423    // It should be big enough for int[256]. Currently it is int [5*128] 
     424    histogram_alloc(); 
     425    live_histogram_proc = (int*)histogram_proc[0]; 
     426 
     427    // Temporary turn off histogram to prevent data from destroying 
     428    if ( histogram_stored_stage >=0 ) 
     429            histogram_stored_stage = histogram_stage; 
     430    histogram_stage=HISTOGRAM_IDLE_STAGE; 
     431 
     432    img=((mode_get()&MODE_MASK) == MODE_PLAY)?vid_get_viewport_fb_d():((kbd_is_key_pressed(KEY_SHOOT_HALF))?vid_get_viewport_fb():vid_get_viewport_live_fb()); 
     433    if (img==NULL){ 
     434       img = vid_get_viewport_fb(); 
     435    } 
     436 
     437    img += vid_get_viewport_image_offset();             // offset into viewport for when image size != viewport size (e.g. 16:9 image on 4:3 LCD) 
     438//    viewport_size = vid_get_viewport_height() * vid_get_viewport_buffer_width(); 
     439    viewport_size = vid_get_viewport_height() * vid_get_viewport_byte_width() * vid_get_viewport_yscale(); 
     440 
     441    memset( live_histogram_proc, 0, sizeof(int)*256); 
     442 
     443    x = 0;      // count how many blocks we have done on the current row (to skip unused buffer space at end of each row) 
     444 
     445    viewport_size = (viewport_size<<1) + viewport_size + 1;     // quick *3 and adjust to starting from idx 1 
     446 
     447    for (i=1; i<viewport_size; i+=HISTO_STEP_SIZE*6) { 
     448       y = img[i]; 
     449       ++live_histogram_proc[y]; 
     450 
     451       // Handle case where viewport memory buffer is wider than the actual buffer. 
     452       x += HISTO_STEP_SIZE * 2;        // viewport width is measured in blocks of three bytes each even though the data is stored in six byte chunks ! 
     453       if (x == vid_get_viewport_width()) { 
     454           i += vid_get_viewport_row_offset(); 
     455           x = 0;