Exemplo n.º 1
0
static void mx_dump_memory(void *img){
    char fn[36];
    int fd, i;
    static int cnt=0;

    started();
    mkdir("A/MD");

        do {
            cnt++;
            sprintf(fn, "A/MD/%04d.FB", cnt);
            fd = open(fn, O_RDONLY, 0777);

            if(fd>=0){
                close(fd);
            }
        } while(fd>=0);


		sprintf(fn, "A/MD/%04d.FB", cnt );
		fd = open(fn, O_WRONLY|O_CREAT, 0777);
		if (fd) {
	    write(fd, img, camera_screen.width*vid_get_viewport_height()*3);
	    close(fd);
		}
  vid_bitmap_refresh();
  finished();

}
Exemplo n.º 2
0
Arquivo: lib.c Projeto: c10ud/CHDK
void load_chdk_palette()
{
    extern int active_palette_buffer;
    // Only load for the standard record and playback palettes
    if ((active_palette_buffer == 0) || (active_palette_buffer == 5))
    {
        int *pal = (int*)vid_get_bitmap_active_palette();
        if (pal[CHDK_COLOR_BASE+0] != 0x3F3ADF62)
        {
            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

            extern char palette_control;
            palette_control = 1;
            vid_bitmap_refresh();
        }
    }
}
Exemplo n.º 3
0
// TODO void load_chdk_palette(), palette_control not found
// Function to load CHDK custom colors into active Canon palette
void load_chdk_palette()
{
    extern int active_palette_buffer;
    // Only load for the standard record and playback palettes
    // 0 = rec, 4 = func menu, 5 = playback, 6 = menu (play or rec), 
    if ((active_palette_buffer == 0) || (active_palette_buffer == 5) || (active_palette_buffer == 4))
    {
        int *pal = (int*)vid_get_bitmap_active_palette();
        if (pal[CHDK_COLOR_BASE+0] != 0x33ADF62)
        {
            pal[CHDK_COLOR_BASE+0]  = 0x33ADF62;  // Red
            pal[CHDK_COLOR_BASE+1]  = 0x326EA40;  // Dark Red
            pal[CHDK_COLOR_BASE+2]  = 0x34CD57F;  // Light Red
            pal[CHDK_COLOR_BASE+3]  = 0x373BFAE;  // Green
            pal[CHDK_COLOR_BASE+4]  = 0x34BD6CA;  // Dark Green
            pal[CHDK_COLOR_BASE+5]  = 0x395AB95;  // Light Green
            pal[CHDK_COLOR_BASE+6]  = 0x34766F0;  // Blue
            pal[CHDK_COLOR_BASE+7]  = 0x31250F3;  // Dark Blue
            pal[CHDK_COLOR_BASE+8]  = 0x37F408F;  // Cyan
            pal[CHDK_COLOR_BASE+9]  = 0x3512D5B;  // Magenta
            pal[CHDK_COLOR_BASE+10] = 0x3A9A917;  // Yellow
            pal[CHDK_COLOR_BASE+11] = 0x3819137;  // Dark Yellow
            pal[CHDK_COLOR_BASE+12] = 0x3DED115;  // Light Yellow

            extern char palette_control;
            palette_control = 1; // note appears to be a bitmask, bit 2 is also used
            vid_bitmap_refresh();
        }
    }
}
Exemplo n.º 4
0
void dump_memory()
{
    int fd;
    static int cnt=1;
    static char fn[32];


    started();
    mkdir("A/DCIM");
    mkdir("A/DCIM/100CANON");
    sprintf(fn, "A/DCIM/100CANON/CRW_%04d.JPG", cnt++);
    fd = open(fn, O_WRONLY|O_CREAT, 0777);
    if (fd) {
#ifdef CAMERA_ixus65_sd630 // Zero is not readable on ixus65!
        write(fd, (int*)0xFFFF0000, 4);
        write(fd, (int*)4, 0x1900-4);
#else
        write(fd, (void*)0, 0x1900);
#endif
        write(fd, (void*)0x1900, 32*1024*1024-0x1900);
        close(fd);
    }
    vid_bitmap_refresh();
    finished();
}
Exemplo n.º 5
0
// Restore CANON_OSD
//-------------------------------------------------------------------
void draw_restore()
{
    vid_bitmap_refresh();

    draw_set_guard();
#ifdef CAM_TOUCHSCREEN_UI
    redraw_buttons = 1;
#endif
}
Exemplo n.º 6
0
void script_end()
{
    script_print_screen_end();
    if( L ) {
      lua_script_reset( L );
    }
    else {
      ubasic_end();
    }
	md_close_motion_detector();
	shot_histogram_set(0);
    if (conf.alt_prevent_shutdown != ALT_PREVENT_SHUTDOWN_NO) {
        disable_shutdown();
    }
    kbd_key_release_all();
    state_kbd_script_run = 0;
    vid_bitmap_refresh();
}
Exemplo n.º 7
0
void dump_memory()
{
    int fd;
    static int cnt=1;
    static char fn[32];

    // zero size means all RAM
    if (conf.memdmp_size == 0) conf.memdmp_size = (unsigned int)camera_info.maxramaddr + 1;
    // enforce RAM area
    if ((unsigned int)conf.memdmp_start > (unsigned int)camera_info.maxramaddr)
        conf.memdmp_start = 0;
    if ( (unsigned int)conf.memdmp_start + (unsigned int)conf.memdmp_size > ((unsigned int)camera_info.maxramaddr+1) )
        conf.memdmp_size = (unsigned int)camera_info.maxramaddr + 1 - (unsigned int)conf.memdmp_start;

    started();
    // try to avoid hanging the camera
    if ( !is_video_recording() ) {
        mkdir("A/DCIM");
        mkdir("A/DCIM/100CANON");
        fd = 0;
        do {
            sprintf(fn, "A/DCIM/100CANON/CRW_%04d.JPG", cnt++);
            if (stat(fn,0) != 0) {
                fd = open(fn, O_WRONLY|O_CREAT, 0777);
                break;
            }
        } while(cnt<9999);
        if (fd) {
            if ( conf.memdmp_start == 0 ) {
                long val0 = *((long*)(0|CAM_UNCACHED_BIT));
                write(fd, &val0, 4);
                if  (conf.memdmp_size > 4) {
                    write(fd, (void*)4, conf.memdmp_size - 4);
                }
            }
            else {
                write(fd, (void*)conf.memdmp_start, conf.memdmp_size);
            }
            close(fd);
        }
        vid_bitmap_refresh();
    }
    finished();
}
Exemplo n.º 8
0
Arquivo: lib.c Projeto: de-wolff/CHDK
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();
            }
        }
    }
}