Changeset 1888


Ignore:
Timestamp:
05/31/12 05:17:09 (13 months ago)
Author:
reyalp
Message:

Merged revision(s) 1886-1887 from trunk:
sx200 improvements from adamb in http://chdk.setepontos.com/index.php?topic=650.msg85859#msg85859

  • vid_bitmap_refresh() from ixus870_sd880, gives less flicker than original one.
  • custom palette (philmoz), so CAM_BITMAP_PALETTE changed from 3 to 13.
Location:
branches/release-1_0
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/release-1_0

  • branches/release-1_0/core/gui_draw.h

    r1859 r1888  
    151151#elif CAM_BITMAP_PALETTE==3 
    152152 
    153 // Used by :- IXUS120_SD940, SX200IS 
     153// Used by :- IXUS120_SD940 
    154154 
    155155    #define COLOR_WHITE                 0x01 
     
    181181    #define COLOR_HISTO_BG_PLAY         COLOR_BLUE_LT 
    182182    #define COLOR_HISTO_RG_PLAY         COLOR_YELLOW 
    183      
    184 #if defined (CAMERA_sx200is) 
    185     #undef SCREEN_COLOR 
    186     #define SCREEN_COLOR                0x15    // try for a dark color in both record and play mode 
    187 #endif 
    188183 
    189184// Icon colors 
     
    191186// Separate definitions for record and playback mode 
    192187// to cater for cameras with variable palettes 
    193 #if defined (CAMERA_sx200is) 
    194     #define COLOR_ICON_REC_RED          0x2C 
    195     #define COLOR_ICON_REC_RED_DK       0x2C 
    196     #define COLOR_ICON_REC_RED_LT       0x20 
    197     #define COLOR_ICON_REC_GREEN        0x68 
    198     #define COLOR_ICON_REC_GREEN_DK     0x68 
    199     #define COLOR_ICON_REC_GREEN_LT     0x60 
    200     #define COLOR_ICON_REC_YELLOW       0x8F 
    201     #define COLOR_ICON_REC_YELLOW_DK    0x93 
    202     #define COLOR_ICON_REC_YELLOW_LT    0x87 
    203     #define COLOR_ICON_REC_GREY         COLOR_GREY 
    204     #define COLOR_ICON_REC_GREY_DK      0x15 
    205     #define COLOR_ICON_REC_GREY_LT      0x10 
    206     #define COLOR_ICON_PLY_RED          COLOR_ICON_REC_RED 
    207     #define COLOR_ICON_PLY_RED_DK       COLOR_ICON_REC_RED_DK 
    208     #define COLOR_ICON_PLY_RED_LT       COLOR_ICON_REC_RED_LT 
    209     #define COLOR_ICON_PLY_GREEN        0xA0 
    210     #define COLOR_ICON_PLY_GREEN_DK     0xA0 
    211     #define COLOR_ICON_PLY_GREEN_LT     0xA0 
    212     #define COLOR_ICON_PLY_YELLOW       0x6A 
    213     #define COLOR_ICON_PLY_YELLOW_DK    0x6C 
    214     #define COLOR_ICON_PLY_YELLOW_LT    0x66 
    215     #define COLOR_ICON_PLY_GREY         COLOR_ICON_REC_GREY 
    216     #define COLOR_ICON_PLY_GREY_DK      COLOR_ICON_REC_GREY_DK 
    217     #define COLOR_ICON_PLY_GREY_LT      COLOR_ICON_REC_GREY_LT 
    218 #endif 
    219188#if defined (CAMERA_ixus120_sd940) 
    220189    #define COLOR_ICON_REC_RED          0xE7 
     
    668637#elif CAM_BITMAP_PALETTE==13 
    669638 
    670 // Used by :- G12, SX30, SX40HS, IXUS310_ELPH500HS 
     639// Used by :- G12, SX30, SX40HS, IXUS310_ELPH500HS, SX200IS 
    671640 
    672641    #define COLOR_WHITE                 0x01 
  • branches/release-1_0/platform/sx200is/lib.c

    r1640 r1888  
    22#include "lolevel.h" 
    33 
     4//from ixus870_sd880 
    45void vid_bitmap_refresh() 
    56{ 
    6  extern int enabled_refresh_physical_screen; 
    7  enabled_refresh_physical_screen=1; 
    8  _RefreshPhysicalScreen(1); 
     7 extern int enabled_refresh_physical_screen; // screen lock counter 
     8 int old_val = enabled_refresh_physical_screen; 
     9 if ( old_val == 0 ) 
     10 { 
     11   _ScreenLock(); // make sure code is called at least once 
     12 } else { 
     13   enabled_refresh_physical_screen=1; // forces actual redraw 
     14 } 
     15 _RefreshPhysicalScreen(1); // unlock/refresh 
     16 
     17 // restore original situation 
     18 if ( old_val > 0 ) 
     19 { 
     20   _ScreenLock(); 
     21   enabled_refresh_physical_screen = old_val; 
     22 } 
    923} 
    1024 
     
    4963 _PostLogicalEventForNotPowerType(0x875, 1);  // RotateJogDialLeft 
    5064} 
     65 
     66void *vid_get_bitmap_active_palette() 
     67{ 
     68    extern int active_palette_buffer; 
     69    extern char* palette_buffer[]; 
     70    return (palette_buffer[active_palette_buffer]+0xC); 
     71} 
     72// Function to load CHDK custom colors into active Canon palette 
     73void load_chdk_palette() 
     74{ 
     75    extern int active_palette_buffer; 
     76    // Only load for the standard record and playback palettes 
     77    if ((active_palette_buffer == 0) || (active_palette_buffer == 2)) 
     78    { 
     79        int *pal = (int*)vid_get_bitmap_active_palette(); 
     80        if (pal[CHDK_COLOR_BASE+0] != 0x33ADF62) 
     81        { 
     82            pal[CHDK_COLOR_BASE+0]  = 0x33ADF62;  // Red 
     83            pal[CHDK_COLOR_BASE+1]  = 0x326EA40;  // Dark Red 
     84            pal[CHDK_COLOR_BASE+2]  = 0x34CD57F;  // Light Red 
     85            pal[CHDK_COLOR_BASE+3]  = 0x373BFAE;  // Green 
     86            pal[CHDK_COLOR_BASE+4]  = 0x34BD6CA;  // Dark Green 
     87            pal[CHDK_COLOR_BASE+5]  = 0x395AB95;  // Light Green 
     88            pal[CHDK_COLOR_BASE+6]  = 0x34766F0;  // Blue 
     89            pal[CHDK_COLOR_BASE+7]  = 0x31250F3;  // Dark Blue 
     90            pal[CHDK_COLOR_BASE+8]  = 0x37F408F;  // Cyan 
     91            pal[CHDK_COLOR_BASE+9]  = 0x3512D5B;  // Magenta 
     92            pal[CHDK_COLOR_BASE+10] = 0x3A9A917;  // Yellow 
     93            pal[CHDK_COLOR_BASE+11] = 0x3819137;  // Dark Yellow 
     94            pal[CHDK_COLOR_BASE+12] = 0x3DED115;  // Light Yellow 
     95 
     96            extern char palette_control; 
     97            palette_control = 1; 
     98            vid_bitmap_refresh(); 
     99        } 
     100    } 
     101} 
  • branches/release-1_0/platform/sx200is/platform_camera.h

    r1859 r1888  
    6464    #define CAM_EXT_TV_RANGE            1 
    6565    #undef  CAM_BITMAP_PALETTE 
    66     #define CAM_BITMAP_PALETTE              3 
     66    #define CAM_BITMAP_PALETTE              13 
     67    #define CAM_LOAD_CUSTOM_COLORS          1   // Enable loading CHDK colors into the camera palette memory/hardware 
     68    #define CHDK_COLOR_BASE                 0xD0// Start color index for CHDK colors loaded into camera palette. 
    6769    #undef  CAM_HAS_ERASE_BUTTON 
    6870    #define CAM_SHOW_OSD_IN_SHOOT_MENU      1 
  • branches/release-1_0/platform/sx200is/sub/100c/stubs_entry_2.S

    r1637 r1888  
    1616NHSTUB(PostLEDMessage,              0xFF847470) 
    1717NHSTUB(platformsub_kbd_fetch_data,  0xFF848340) 
     18 
     19// Palette 
     20NHSTUB(ScreenLock,                0xFF9D4F28) 
  • branches/release-1_0/platform/sx200is/sub/100c/stubs_min.S

    r1637 r1888  
    44DEF(enabled_refresh_physical_screen,    0x8e04 + 0x30)  //found at FF9D4918 and FF9D4F38 
    55DEF(led_table,                          0x24AC + 0x04)  // found at FF847374 
     6DEF(palette_buffer,                 0x15B5A0) // ref by 0x8D9C, sub_FF9CFC10 
     7DEF(active_palette_buffer,            0x8D8C) // sub_FF9CFE34 
     8DEF(palette_control,                  0x8D88) // sub_FF9CFE34 
Note: See TracChangeset for help on using the changeset viewer.