Changeset 106


Ignore:
Timestamp:
04/13/07 21:15:08 (7 years ago)
Author:
vitalyb
Message:
  • moved raw saving procedure to SpyProc? task so we are now less dependant on stack size
  • fixed Parameter id to get image number
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/main.c

    r104 r106  
    88 
    99#define FN_RAWDIR   "A/DCIM/%03dCANON" 
    10 #define FN_RAWF     (FN_RAWDIR "/" "CRW_%04d.JPG") 
     10#define FN_RAWF     (FN_RAWDIR "/" "CRW_%04d.CRW") 
    1111 
    1212static long ramdump_num; 
     
    6565} 
    6666 
    67 void core_save_raw_file() 
     67static long raw_data_available; 
     68 
     69/* called from another process */ 
     70void core_rawdata_available() 
     71{ 
     72    raw_data_available = 1; 
     73} 
     74 
     75static void process_rawsave() 
    6876{ 
    6977    int fd; 
    7078    long dirfilenum; 
    7179 
     80#if 0 
    7281    // got here second time in a row. Skip second RAW saveing. 
    7382    if (state_shooting_progress == SHOOTING_PROGRESS_PROCESSING){ 
    7483        return; 
    7584    } 
    76  
     85#endif 
    7786    state_shooting_progress = SHOOTING_PROGRESS_PROCESSING; 
    7887 
     
    91100            close(fd); 
    92101        } 
     102 
    93103        finished(); 
    94104    } 
    95  
    96105} 
    97  
    98106 
    99107 
     
    112120 
    113121    while (1){ 
     122 
     123        if (raw_data_available){ 
     124            process_rawsave(); 
     125            hook_raw_save_complete(); 
     126            raw_data_available = 0; 
     127            continue; 
     128        } 
     129 
    114130        if (((cnt++) & 3) == 0) 
    115131            gui_redraw(); 
  • trunk/include/core.h

    r104 r106  
    1111void gui_init(); 
    1212 
    13 void core_save_raw_file(); 
     13void core_rawdata_available(); 
     14 
    1415 
    1516#endif 
  • trunk/include/platform.h

    r104 r106  
    7171long hook_raw_size(); 
    7272void hook_raw_install(); 
     73void hook_raw_save_complete(); 
    7374 
    7475/******************************************************************/ 
  • trunk/platform/a610/shooting.c

    r104 r106  
    88    long dirnum, filenum; 
    99 
    10     get_parameter_data(0x2f, &tmp, 4); 
     10    tmp = get_file_next_counter(); 
    1111 
    1212    dirnum = (tmp>>18)&0x3FF; 
    13     filenum = ((tmp>>4)&0x3FFF) + 1; 
     13    filenum = ((tmp>>4)&0x3FFF); 
    1414 
    1515    if ((filenum % 100) == 0){ 
  • trunk/platform/a620/shooting.c

    r104 r106  
    88    long dirnum, filenum; 
    99 
    10     get_parameter_data(0x2f, &tmp, 4); 
     10    tmp = get_file_next_counter(); 
    1111 
    1212    dirnum = (tmp>>18)&0x3FF; 
    13     filenum = ((tmp>>4)&0x3FFF) + 1; 
     13    filenum = ((tmp>>4)&0x3FFF); 
    1414 
    1515    if ((filenum % 100) == 0){ 
  • trunk/platform/a630/shooting.c

    r104 r106  
    88    long dirnum, filenum; 
    99 
    10     get_parameter_data(0x2f, &tmp, 4); 
     10    tmp = get_file_next_counter(); 
    1111 
    1212    dirnum = (tmp>>18)&0x3FF; 
    13     filenum = ((tmp>>4)&0x3FFF) + 1; 
     13    filenum = ((tmp>>4)&0x3FFF); 
    1414 
    1515    if ((filenum % 100) == 0){ 
  • trunk/platform/a640/shooting.c

    r104 r106  
    88    long dirnum, filenum; 
    99 
    10     get_parameter_data(0x2f, &tmp, 4); 
     10    tmp = get_file_next_counter(); 
    1111 
    1212    dirnum = (tmp>>18)&0x3FF; 
    13     filenum = ((tmp>>4)&0x3FFF) + 1; 
     13    filenum = ((tmp>>4)&0x3FFF); 
    1414 
    1515    if ((filenum % 100) == 0){ 
  • trunk/platform/a710/shooting.c

    r104 r106  
    88    long dirnum, filenum; 
    99 
    10     get_parameter_data(0x2f, &tmp, 4); 
     10    tmp = get_file_next_counter(); 
    1111 
    1212    dirnum = (tmp>>18)&0x3FF; 
    13     filenum = ((tmp>>4)&0x3FFF) + 1; 
     13    filenum = ((tmp>>4)&0x3FFF); 
    1414 
    1515    if ((filenum % 100) == 0){ 
  • trunk/platform/generic/raw_hook.c

    r104 r106  
    33#include "lolevel.h" 
    44 
     5#define RAWDATA_AVAILABLE (1) 
     6#define RAWDATA_SAVED (2) 
     7 
    58static long (*prev_hhandler)(long a); 
     9static long raw_save_stage; 
     10 
    611 
    712static void myhook1(long a) 
     
    914    // only this caller allowed 
    1015    if (__builtin_return_address(0) == hook_raw_ret_addr()){ 
    11         core_save_raw_file(); 
     16        raw_save_stage = RAWDATA_AVAILABLE; 
     17        core_rawdata_available(); 
     18        while (raw_save_stage != RAWDATA_SAVED){ 
     19            _SleepTask(10); 
     20        } 
     21        raw_save_stage = 0; 
    1222    } 
    1323    prev_hhandler(a); 
     
    2737} 
    2838 
     39 
     40void hook_raw_save_complete() 
     41{ 
     42    raw_save_stage = RAWDATA_SAVED; 
     43} 
     44 
  • trunk/platform/generic/wrappers.c

    r105 r106  
    114114    return _Read(fd, buffer, nbytes); 
    115115} 
    116 int lseek (int fd, long offset, int whence) 
    117 { 
    118     return _lseek(fd, offset, whence); /* yes, it's lower-case lseek here since Lseek calls just lseek (A610) */ 
    119 } 
     116//int lseek (int fd, long offset, int whence) 
     117//{ 
     118//    return _lseek(fd, offset, whence); /* yes, it's lower-case lseek here since Lseek calls just lseek (A610) */ 
     119//} 
    120120long mkdir(const char *dirname) 
    121121{ 
Note: See TracChangeset for help on using the changeset viewer.