//------------------------------------------------------------------- // int osd_visible() // conf.hide_osd = 0=Don't, 1=In Playback, 2=On Disp Press, 3=Both //------------------------------------------------------------------- int osd_visible() { if ( conf.show_osd ) { if ( conf.hide_osd == 0 ) return 1; if (!camera_info.state.is_shutter_half_press) { if (camera_info.state.mode_rec) { if ( conf.hide_osd < 2 ) return 1; #if defined(PARAM_DISPLAY_MODE1) && defined(PARAM_DISPLAY_MODE2) short disp_key_mode ; if (recreview_hold == 0) { if (shooting_get_display_mode() == 0) return 1; } else { if (conf.show_osd_in_review) { get_parameter_data(PARAM_DISPLAY_MODE2, &disp_key_mode, 2); if (disp_key_mode == 0) return 1; } } } else { if (conf.hide_osd == 2 ) { short disp_key_mode ; get_parameter_data(PARAM_DISPLAY_MODE1, &disp_key_mode, 2); if (disp_key_mode == 1) return 1; } } #else if (shooting_get_display_mode() == 0) return 1; } #endif } }
static int luaCB_get_parameter_data( lua_State* L ) { extern long* FlashParamsTable[]; unsigned size; unsigned id = luaL_checknumber( L, 1 ); unsigned val; if (id >= get_flash_params_count()) { // return nil return 0; } size = FlashParamsTable[id][1]>>16; if (size == 0) { // return nil return 0; } if (size >= 1 && size <= 4) { val = 0; get_parameter_data( id, &val, size ); lua_pushlstring( L, (char *)&val, size ); // for convenience, params that fit in a number are returned in one as a second result lua_pushnumber( L, val ); return 2; } else { char *buf = malloc(size); if(!buf) { luaL_error( L, "malloc failed in luaCB_get_parameter_data" ); } get_parameter_data( id, buf, size ); lua_pushlstring( L, buf, size ); free(buf); return 1; } }
void load_chdk_palette() { unsigned char theme; // active_palette_buffer values // 0x00:shooting, 0x04:camera modes menu, 0x0C:func menu, 0x10:playback, 0x14:shooting setup menu, 0x18:wifi menu if ( (active_palette_buffer == 0x00) || (active_palette_buffer == 0x10)) { get_parameter_data(20, &theme, 1); if (palette_buffer_ptr[active_palette_buffer+theme] !=0) { int* pal = palette_buffer_ptr[active_palette_buffer+theme] + 1; // check that palette_buffer != null and palette transparent & black colors are correct before overwriting palette) if ( (pal!=0) && (pal[CHDK_COLOR_BASE+0] != 0x3F3ADF62) && (pal[0x00]==0x00FF0000) && (pal[0xFF]==0x3F000000) ) { pal[CHDK_COLOR_BASE+0] = 0x3F3ADF62; // Red pal[CHDK_COLOR_BASE+1] = 0x3F26EA40; // Dark Red pal[CHDK_COLOR_BASE+2] = 0x3F4CD57F; // Light Red pal[CHDK_COLOR_BASE+3] = 0x3F73BFAE; // Green pal[CHDK_COLOR_BASE+4] = 0x3F4BD6CA; // Dark Green pal[CHDK_COLOR_BASE+5] = 0x3F95AB95; // Light Green pal[CHDK_COLOR_BASE+6] = 0x3F4766F0; // Blue pal[CHDK_COLOR_BASE+7] = 0x3F1250F3; // Dark Blue pal[CHDK_COLOR_BASE+8] = 0x3F7F408F; // Cyan pal[CHDK_COLOR_BASE+9] = 0x3F512D5B; // Magenta pal[CHDK_COLOR_BASE+10] = 0x3FA9A917; // Yellow pal[CHDK_COLOR_BASE+11] = 0x3F819137; // Dark Yellow pal[CHDK_COLOR_BASE+12] = 0x3FDED115; // Light Yellow pal[CHDK_COLOR_BASE+13] = 0x1F0A0000; // Transparent dark grey palette_control = 1; // note appears to be a bitmask, 2nd bit is also used for something ? vid_bitmap_refresh(); } } } }
int review_fullscreen_mode(){ char r; get_parameter_data(53, &r, 1); return r==0; }
void *vid_get_bitmap_active_palette() { unsigned char theme; get_parameter_data(20, &theme, 1); return palette_buffer_ptr[active_palette_buffer+theme] + 1; }
int postreview_fullscreen_mode(){ //from 710 added char r; get_parameter_data(54, &r, 1); return r==0; }