Changeset 1494
- Timestamp:
- 12/21/11 16:34:54 (18 months ago)
- Location:
- branches/reyalp-flt
- Files:
-
- 2 added
- 25 edited
-
core/Makefile (modified) (1 diff)
-
core/curves.c (modified) (5 diffs)
-
core/edgeoverlay.c (modified) (5 diffs)
-
core/gui_4wins.c (modified) (1 diff)
-
core/gui_bench.c (modified) (4 diffs)
-
core/gui_calendar.c (modified) (1 diff)
-
core/gui_debug.c (modified) (1 diff)
-
core/gui_draw.h (modified) (2 diffs)
-
core/gui_fselect.c (modified) (20 diffs)
-
core/gui_mastermind.c (modified) (2 diffs)
-
core/gui_read.c (modified) (2 diffs)
-
core/gui_reversi.c (modified) (2 diffs)
-
core/gui_snake.c (modified) (1 diff)
-
core/gui_sokoban.c (modified) (2 diffs)
-
core/gui_tetris.c (modified) (1 diff)
-
core/main.c (modified) (1 diff)
-
core/module_exportlist.c (modified) (9 diffs)
-
core/module_wrappers.c (added)
-
core/modules.c (modified) (2 diffs)
-
core/modules.h (modified) (1 diff)
-
core/modules/Makefile (modified) (1 diff)
-
core/modules/module_menu.c (modified) (4 diffs)
-
core/raw.h (modified) (1 diff)
-
core/raw_merge.c (modified) (2 diffs)
-
include/stdlib.h (modified) (2 diffs)
-
include/stdlib_unified.h (added)
-
tools/elf2flt/flt.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/reyalp-flt/core/Makefile
r1493 r1494 58 58 59 59 OBJS=entry.o main.o gui_draw.o gui_menu.o gui_mbox.o \ 60 gui.o kbd.o action_stack.o conf.o module_ exportlist.o \60 gui.o kbd.o action_stack.o conf.o module_wrappers.o module_exportlist.o \ 61 61 histogram.o gui_batt.o gui_space.o gui_osd.o raw.o \ 62 62 gui_usb.o gui_lang.o gui_grid.o modules.o module_load.o\ -
branches/reyalp-flt/core/curves.c
r1483 r1494 7 7 #if 1 8 8 9 #include "module_exportlist.h" 9 10 #include "curves.h" 10 11 … … 145 146 146 147 // Loop through picture rows 147 for (i=CAM_ RAW_ROWS; i;i-=2){148 for (i=CAM_CHDK_RAW_ROWS; i;i-=2){ 148 149 // Loop through picture columns 149 for (j=CAM_ RAW_ROWPIX; j; j-=8, src+=10){150 for (j=CAM_CHDK_RAW_ROWPIX; j; j-=8, src+=10){ 150 151 pixVal0=((0x3fc&(((unsigned short)(src[1]))<<2)) | (src[0] >> 6)); 151 152 pixVal1=((0x3f0&(((unsigned short)(src[0]))<<4)) | (src[3] >> 4)); … … 178 179 *(src+8) = (unsigned char) ((pixVal0)); //7 (=>0) } 179 180 } 180 for (j=CAM_ RAW_ROWPIX;j; j-=8, src+=10){181 for (j=CAM_CHDK_RAW_ROWPIX;j; j-=8, src+=10){ 181 182 pixVal0=((0x3fc&(((unsigned short)(src[1]))<<2)) | (src[0] >> 6)); 182 183 pixVal1=((0x3f0&(((unsigned short)(src[0]))<<4)) | (src[3] >> 4)); … … 241 242 242 243 // Loop through picture rows 243 for (i=CAM_ RAW_ROWS; i;i-=2){244 for (i=CAM_CHDK_RAW_ROWS; i;i-=2){ 244 245 // Loop through picture columns 245 for (j=CAM_ RAW_ROWPIX; j; j-=8, src+=10){246 for (j=CAM_CHDK_RAW_ROWPIX; j; j-=8, src+=10){ 246 247 pixVal0=((0x3fc&(((unsigned short)(src[1]))<<2)) | (src[0] >> 6)); 247 248 pixVal1=((0x3f0&(((unsigned short)(src[0]))<<4)) | (src[3] >> 4)); … … 306 307 *(src+8) = (unsigned char) ((pixVal0)); //7 (=>0) 307 308 } 308 for (j=CAM_ RAW_ROWPIX;j; j-=8, src+=10){309 for (j=CAM_CHDK_RAW_ROWPIX;j; j-=8, src+=10){ 309 310 pixVal0=((0x3fc&(((unsigned short)(src[1]))<<2)) | (src[0] >> 6)); 310 311 pixVal1=((0x3f0&(((unsigned short)(src[0]))<<4)) | (src[3] >> 4)); -
branches/reyalp-flt/core/edgeoverlay.c
r1483 r1494 7 7 #include "gui_draw.h" 8 8 #include "bitvector.h" 9 #include "module_exportlist.h" 10 9 11 10 12 // the way we save edge overlays on their own... … … 132 134 char msg[64]; 133 135 FILE *fd; 134 DIR* d;136 STD_DIR* d; 135 137 int fnum = 0; 136 138 int fr = 0; 137 139 int zoom = 0; 138 struct dirent* de;140 struct STD_dirent* de; 139 141 static struct utimbuf t; 140 142 // nothing to save? then dont save … … 149 151 150 152 // first figure out the most appropriate filename to use 151 d = opendir(EDGE_SAVE_DIR);153 d = safe_opendir(EDGE_SAVE_DIR); 152 154 if( ! d ) 153 155 { … … 155 157 } 156 158 157 while( (de = readdir(d)) )159 while( (de = safe_readdir(d)) ) 158 160 { 159 161 fr = get_edge_file_num(de->d_name); … … 179 181 draw_string(0, 0, msg, *conf_osd_color); 180 182 } 181 closedir(d);183 safe_closedir(d); 182 184 } 183 185 -
branches/reyalp-flt/core/gui_4wins.c
r1483 r1494 250 250 draw_txt_string(x, 4, lang_str(LANG_CONNECT4_HUMAN), TEXT_COLOR); 251 251 else 252 draw_txt_string(x, 4, PLATFORM, TEXT_COLOR);252 draw_txt_string(x, 4, "cam", TEXT_COLOR); 253 253 } 254 254 //------------------------------------------------------------------- -
branches/reyalp-flt/core/gui_bench.c
r1483 r1494 171 171 } 172 172 173 x = open("A/BENCH.TMP", O_WRONLY|O_CREAT, 0777);173 x = safe_open("A/BENCH.TMP", O_WRONLY|STD_O_CREAT, 0777); 174 174 if (x>=0) { 175 175 bench.disk_write_raw_bps = 0; … … 183 183 } 184 184 185 x = open("A/BENCH.TMP", O_WRONLY|O_CREAT, 0777);185 x = safe_open("A/BENCH.TMP", O_WRONLY|STD_O_CREAT, 0777); 186 186 if (x>=0) { 187 187 bench.disk_write_mem_bps = 0; … … 196 196 197 197 if (buf) { 198 x = open("A/BENCH.TMP", O_WRONLY|O_CREAT, 0777);198 x = safe_open("A/BENCH.TMP", O_WRONLY|STD_O_CREAT, 0777); 199 199 if (x>=0) { 200 200 bench.disk_write_buf_bps = 0; … … 210 210 } 211 211 212 x = open("A/BENCH.TMP", O_RDONLY, 0777);212 x = safe_open("A/BENCH.TMP", O_RDONLY, 0777); 213 213 if (x>=0) { 214 214 bench.disk_read_buf_bps = 0; -
branches/reyalp-flt/core/gui_calendar.c
r1483 r1494 120 120 need_redraw = 1; 121 121 break; 122 #if CAM_HAS_ERASE_BUTTON123 122 case KEY_ERASE: 124 #else125 123 case KEY_DISPLAY: 126 #endif127 124 calendar_goto_today(); 128 125 need_redraw = 1; -
branches/reyalp-flt/core/gui_debug.c
r1483 r1494 37 37 int i; 38 38 39 if (!(addr<=(void*)MAXRAMADDR || addr>=(void*)ROMBASEADDR)) { addr = &dummy; }; 39 // non-significant check. remove to platform independency 40 // if (!(addr<=(void*)MAXRAMADDR || addr>=(void*)ROMBASEADDR)) { addr = &dummy; }; 40 41 41 42 sprintf(buf, "0x%08X (%10u)", *((unsigned int*)addr), *((unsigned int*)addr)); -
branches/reyalp-flt/core/gui_draw.h
r1493 r1494 5 5 6 6 #include "gui.h" // for color, coord definitions 7 8 9 // Common colors that are the same in all palettes 10 #define COLOR_TRANSPARENT 0x00 11 #define COLOR_BLACK 0xFF 7 12 8 13 //------------------------------------------------------------------- … … 13 18 14 19 //------------------------------------------------------------------- 15 16 // Common colors that are the same in all palettes17 #define COLOR_TRANSPARENT 0x0018 #define COLOR_BLACK 0xFF19 20 20 21 //------------------------------------------------------------------- -
branches/reyalp-flt/core/gui_fselect.c
r1489 r1494 208 208 //------------------------------------------------------------------- 209 209 static void gui_fselect_read_dir(const char* dir) { 210 DIR *d;211 struct dirent *de;212 static struct stat st;210 STD_DIR *d; 211 struct STD_dirent *de; 212 static struct STD_stat st; 213 213 struct fitem **ptr = &head, *prev = NULL; 214 214 int i; 215 215 216 216 gui_fselect_free_data(); 217 #ifdef CAM_DRYOS_2_3_R39217 //#ifdef CAM_DRYOS_2_3_R39 218 218 if(dir[0]=='A' && dir[1]==0) 219 d = opendir("A/");219 d = safe_opendir("A/"); 220 220 else 221 d = opendir(dir); 221 d = safe_opendir(dir); 222 /* //remove for platf independedncy. looks like sequence above is safe 222 223 #else 223 d = opendir(dir);224 d = safe_opendir(dir); 224 225 #endif 226 */ 225 227 if (d) { 226 de = readdir(d);228 de = safe_readdir(d); 227 229 while (de) { 228 230 if (de->d_name[0] != 0xE5 /* deleted entry */ && (de->d_name[0]!='.' || de->d_name[1]!=0)) { … … 234 236 strcpy((*ptr)->name, de->d_name); 235 237 sprintf(buf, "%s/%s", dir, de->d_name); 236 if (s tat(buf, &st)==0) {238 if (safe_stat(buf, &st)==0) { 237 239 (*ptr)->attr=st.st_attrib; 238 240 (*ptr)->size=st.st_size; … … 249 251 } 250 252 } 251 de = readdir(d);252 } 253 closedir(d);253 de = safe_readdir(d); 254 } 255 safe_closedir(d); 254 256 } 255 257 *ptr=NULL; … … 308 310 while (strlen(current_dir) > 0) 309 311 { 310 struct stat st;312 struct STD_stat st; 311 313 // check if input 'dir' exists 312 if (s tat(current_dir,&st) == 0)314 if (safe_stat(current_dir,&st) == 0) 313 315 { 314 316 // exists - check if it is a directory or file … … 570 572 static void fselect_purge_cb(unsigned int btn) { 571 573 572 DIR *d, *d2, *d3, *d4;573 struct dirent *de, *de2, *de3, *de4;574 STD_DIR *d, *d2, *d3, *d4; 575 struct STD_dirent *de, *de2, *de3, *de4; 574 576 struct fitem *ptr, *ptr2; 575 577 char sub_dir[20], sub_dir_search[20]; … … 581 583 if (selected->name[0] == 'D' && selected->name[1] == 'C' && selected->name[2] == 'I' && selected->name[3] == 'M') { 582 584 sprintf(current_dir+strlen(current_dir), "/%s", selected->name); 583 d= opendir(current_dir);584 while ((de= readdir(d)) != NULL) {//Loop to find all Canon folders585 d=safe_opendir(current_dir); 586 while ((de=safe_readdir(d)) != NULL) {//Loop to find all Canon folders 585 587 if (de->d_name[0] != '.' && de->d_name[1] != '.') {//If item is not UpDir 586 588 sprintf(sub_dir, "%s/%s", current_dir, de->d_name); 587 d2= opendir(sub_dir);588 while ((de2= readdir(d2)) != NULL) {//Loop to find all the RAW files inside a Canon folder589 d2=safe_opendir(sub_dir); 590 while ((de2=safe_readdir(d2)) != NULL) {//Loop to find all the RAW files inside a Canon folder 589 591 if (de2->d_name[0] == 'C' || de2->d_name[9] == 'C') {//If file is RAW (Either CRW/CR2 prefix or file extension) 590 d3= opendir(current_dir);591 while ((de3= readdir(d3)) != NULL) {//Loop to find all Canon folders592 d3=safe_opendir(current_dir); 593 while ((de3=safe_readdir(d3)) != NULL) {//Loop to find all Canon folders 592 594 if (de3->d_name[0] != '.' && de3->d_name[1] != '.') {//If item is not UpDir 593 595 sprintf(sub_dir_search, "%s/%s", current_dir, de3->d_name); 594 d4= opendir(sub_dir_search);595 while ((de4= readdir(d4)) != NULL) {//Loop to find a corresponding JPG file inside a Canon folder596 d4=safe_opendir(sub_dir_search); 597 while ((de4=safe_readdir(d4)) != NULL) {//Loop to find a corresponding JPG file inside a Canon folder 596 598 if (de2->d_name[4] == de4->d_name[4] && de2->d_name[5] == de4->d_name[5] &&//If the four digits of the Canon number are the same 597 599 de2->d_name[6] == de4->d_name[6] && de2->d_name[7] == de4->d_name[7] && … … 601 603 } 602 604 } 603 closedir(d4);605 safe_closedir(d4); 604 606 } 605 607 } 606 closedir(d3);608 safe_closedir(d3); 607 609 //If no JPG found, delete RAW file 608 610 if (found == 0) { … … 617 619 } 618 620 } 619 closedir(d2);621 safe_closedir(d2); 620 622 } 621 623 } 622 closedir(d);624 safe_closedir(d); 623 625 i=strlen(current_dir); 624 626 while (current_dir[--i] != '/'); … … 628 630 else if (selected->name[3] == 'C') { 629 631 sprintf(current_dir+strlen(current_dir), "/%s", selected->name); 630 d= opendir(current_dir);631 while ((de= readdir(d)) != NULL) {//Loop to find all the RAW files inside the Canon folder632 d=safe_opendir(current_dir); 633 while ((de=safe_readdir(d)) != NULL) {//Loop to find all the RAW files inside the Canon folder 632 634 if (de->d_name[0] == 'C' || de->d_name[9] == 'C') {//If file is RAW (Either CRW/CR2 prefix or file extension) 633 d2= opendir(current_dir);634 while ((de2= readdir(d2)) != NULL) {//Loop to find a corresponding JPG file inside the Canon folder635 d2=safe_opendir(current_dir); 636 while ((de2=safe_readdir(d2)) != NULL) {//Loop to find a corresponding JPG file inside the Canon folder 635 637 if (de->d_name[4] == de2->d_name[4] && de->d_name[5] == de2->d_name[5] &&//If the four digits of the Canon number are the same 636 638 de->d_name[6] == de2->d_name[6] && de->d_name[7] == de2->d_name[7] && … … 640 642 } 641 643 } 642 closedir(d2);644 safe_closedir(d2); 643 645 //If no JPG found, delete RAW file 644 646 if (found == 0) { … … 653 655 } 654 656 } 655 closedir(d);657 safe_closedir(d); 656 658 i=strlen(current_dir); 657 659 while (current_dir[--i] != '/'); … … 691 693 //------------------------------------------------------------------- 692 694 static void fselect_delete_folder_cb(unsigned int btn) { 693 DIR *d;694 struct dirent *de;695 STD_DIR *d; 696 struct STD_dirent *de; 695 697 int i; 696 698 697 699 if (btn==MBOX_BTN_YES) { 698 700 sprintf(current_dir+strlen(current_dir), "/%s", selected->name); 699 d = opendir(current_dir);701 d = safe_opendir(current_dir); 700 702 if (d) { 701 de = readdir(d);703 de = safe_readdir(d); 702 704 while (de) { 703 705 if (de->d_name[0] != 0xE5 /* deleted entry */ && (de->d_name[0]!='.' || (de->d_name[1]!='.' && de->d_name[1]!=0) || (de->d_name[1]=='.' && de->d_name[2]!=0))) { … … 707 709 finished(); 708 710 } 709 de = readdir(d);710 } 711 closedir(d);711 de = safe_readdir(d); 712 } 713 safe_closedir(d); 712 714 } 713 715 started(); … … 817 819 gui_browser_progress_show(lang_str(LANG_FSELECT_PROGRESS_TITLE),i*100/marked_count); 818 820 sprintf(selected_file, "%s/%s", marked_dir, ptr->name); 819 fsrc = open(selected_file, O_RDONLY, 0777);821 fsrc = safe_open(selected_file, O_RDONLY, 0777); 820 822 if (fsrc>=0) { 821 823 sprintf(selected_file, "%s/%s", current_dir, ptr->name); 822 824 // trying to open for read to check if file exists 823 fdst = open(selected_file, O_RDONLY, 0777);825 fdst = safe_open(selected_file, O_RDONLY, 0777); 824 826 if (fdst<0) { 825 fdst = open(selected_file, O_WRONLY|O_CREAT, 0777);827 fdst = safe_open(selected_file, O_WRONLY|STD_O_CREAT, 0777); 826 828 if (fdst>=0) { 827 829 do { … … 923 925 buf = umalloc(MARKED_BUF_SIZE); 924 926 sprintf(selected_file, "%s/%s", current_dir, selected->name); 925 fsrc = open(selected_file, O_RDONLY, 0777);927 fsrc = safe_open(selected_file, O_RDONLY, 0777); 926 928 if (fsrc>=0) { 927 929 strcpy(selected_file,"A/DISKBOOT.BIN"); 928 fdst = open(selected_file, O_WRONLY|O_CREAT|O_TRUNC, 0777);930 fdst = safe_open(selected_file, O_WRONLY|STD_O_CREAT|STD_O_TRUNC, 0777); 929 931 if (fdst>=0) { 930 932 do { … … 1034 1036 } 1035 1037 //------------------------------------------------------------------- 1036 #if DNG_SUPPORT1038 //#if DNG_SUPPORT 1037 1039 void process_dng_to_raw_files(void){ 1038 1040 struct fitem *ptr; … … 1047 1049 sprintf(selected_file, "%s/%s", current_dir, ptr->name); 1048 1050 gui_browser_progress_show(selected_file, (i++)*100/fselect_real_marked_count()) ; 1049 convert_dng_to_chdk_raw(selected_file);1051 module_convert_dng_to_chdk_raw(selected_file); 1050 1052 } 1051 1053 } 1052 1054 else { 1053 1055 sprintf(selected_file, "%s/%s", current_dir, selected->name); 1054 convert_dng_to_chdk_raw(selected_file);1056 module_convert_dng_to_chdk_raw(selected_file); 1055 1057 } 1056 1058 gui_fselect_read_dir(current_dir); 1057 1059 } 1058 #endif1060 //#endif 1059 1061 1060 1062 //------------------------------------------------------------------- … … 1138 1140 break; 1139 1141 } 1140 #if DNG_SUPPORT1142 //#if DNG_SUPPORT 1141 1143 case MPOPUP_DNG_TO_CRW: 1142 1144 process_dng_to_raw_files(); 1143 1145 break; 1144 #endif1146 //#endif 1145 1147 } 1146 1148 gui_fselect_redraw = 2; … … 1236 1238 if(selected->size == hook_raw_size()) 1237 1239 i |= MPOPUP_RAW_DEVELOP; 1238 #if DNG_SUPPORT1240 //#if DNG_SUPPORT 1239 1241 if((fselect_marked_count()>1)||(selected->size > hook_raw_size())) 1240 1242 i |= MPOPUP_DNG_TO_CRW; 1241 #endif1243 //#endif 1242 1244 1243 1245 if (selected->name[9] == 'B' && selected->name[10] == 'I' && selected->name[11] == 'N') //If item is DCIM folder … … 1277 1279 } 1278 1280 break; 1279 #if CAM_HAS_ERASE_BUTTON1280 1281 case KEY_ERASE: 1281 #else1282 1282 case KEY_DISPLAY: 1283 #endif1284 1283 if (selected && selected->attr != 0xFF) { 1285 1284 if (selected->attr & DOS_ATTR_DIRECTORY) { -
branches/reyalp-flt/core/gui_mastermind.c
r1483 r1494 28 28 int curr_y; 29 29 int answer[4]; 30 char colors[6] = { COLOR_HISTO_R_PLAY, COLOR_HISTO_G_PLAY, COLOR_HISTO_B_PLAY, COLOR_YELLOW, COLOR_WHITE, COLOR_BLACK };30 char colors[6]; 31 31 int curr_color[4]; 32 32 int GameGo; … … 240 240 241 241 int basic_module_init() { 242 colors[0] = COLOR_HISTO_R_PLAY; 243 colors[1] = COLOR_HISTO_G_PLAY; 244 colors[2] = COLOR_HISTO_B_PLAY; 245 colors[3] = COLOR_YELLOW; 246 colors[4] = COLOR_WHITE; 247 colors[5] = COLOR_BLACK; 248 242 249 return gui_mastermind_init(); 243 250 } -
branches/reyalp-flt/core/gui_read.c
r1483 r1494 65 65 //------------------------------------------------------------------- 66 66 int gui_read_init(const char* file) { 67 static struct stat st;68 read_file = open(file, O_RDONLY, 0777);67 static struct STD_stat st; 68 read_file = safe_open(file, O_RDONLY, 0777); 69 69 if (strcmp(file, conf_reader_file)!=0) { 70 70 *conf_reader_pos = 0; … … 72 72 } 73 73 read_on_screen = 0; 74 read_file_size = (read_file>=0 && s tat((char*)file, &st)==0)?st.st_size:0;74 read_file_size = (read_file>=0 && safe_stat((char*)file, &st)==0)?st.st_size:0; 75 75 if (read_file_size<=*conf_reader_pos) { 76 76 *conf_reader_pos = 0; -
branches/reyalp-flt/core/gui_reversi.c
r1483 r1494 385 385 need_redraw = 1; 386 386 break; 387 #if CAM_HAS_ERASE_BUTTON388 387 case KEY_ERASE: 389 #else390 388 case KEY_DISPLAY: 391 #endif392 389 if (InGame) 393 390 Computer=COMPUTER_ONLY; … … 396 393 need_redraw = 1; 397 394 break; 398 #if CAM_HAS_ERASE_BUTTON399 case KEY_DISPLAY:400 gui_mbox_init(LANG_MBOX_ABOUT_TITLE, (int)"REVERSI\n(c) GrAnd, 2007", MBOX_TEXT_CENTER, NULL);401 need_redraw_all = 1;402 break;403 #endif404 395 } 405 396 } -
branches/reyalp-flt/core/gui_snake.c
r1483 r1494 320 320 321 321 break; 322 #if CAM_HAS_ERASE_BUTTON323 322 case KEY_ERASE: 324 #else325 323 case KEY_DISPLAY: 326 #endif327 324 break; 328 325 } -
branches/reyalp-flt/core/gui_sokoban.c
r1483 r1494 275 275 char *buf,*p; 276 276 FILE *fd; 277 struct stat st;278 279 if (s tat((char *)level_file_name,&st) != 0 || st.st_size==0)277 struct STD_stat st; 278 279 if (safe_stat((char *)level_file_name,&st) != 0 || st.st_size==0) 280 280 return 0; 281 281 … … 369 369 need_redraw = 1; 370 370 break; 371 #if CAM_HAS_ERASE_BUTTON372 371 case KEY_ERASE: 373 #else374 372 case KEY_DISPLAY: 375 #endif376 373 sokoban_set_level(*conf_sokoban_level); 377 374 need_redraw_all = 1; 378 375 break; 379 #if CAM_HAS_ERASE_BUTTON380 case KEY_DISPLAY:381 gui_mbox_init(LANG_MBOX_ABOUT_TITLE, (int)"SOKOBAN\n(c) GrAnd, 2007", MBOX_TEXT_CENTER, NULL);382 need_redraw = 1;383 break;384 #endif385 376 } 386 377 } -
branches/reyalp-flt/core/gui_tetris.c
r1483 r1494 121 121 { 122 122 // Check if directory exists and create it if it does not. 123 struct stat st;124 if (s tat(dirname,&st) != 0) return mkdir(dirname);123 struct STD_stat st; 124 if (safe_stat(dirname,&st) != 0) return mkdir(dirname); 125 125 return 0; // Success 126 126 } -
branches/reyalp-flt/core/main.c
r1493 r1494 217 217 draw_txt_string(2, 2, osd_buf, conf.osd_color); 218 218 #endif 219 220 // Process async module unload requests 221 module_tick_unloader(); 222 219 223 msleep(20); 220 224 } -
branches/reyalp-flt/core/module_exportlist.c
r1493 r1494 9 9 #include "platform.h" 10 10 #include "stdlib.h" 11 #include "stdlib_unified.h" 11 12 #include "keyboard.h" 12 13 … … 14 15 #include "gui_draw.h" 15 16 #include "gui_batt.h" 17 #include "gui_menu.h" 16 18 #include "gui_osd.h" 17 19 #include "gui_mbox.h" … … 25 27 #include "module_load.h" 26 28 #include "raw.h" 27 #include "dng.h"28 29 29 30 … … 54 55 int RAW_CHDK_ROWLEN = RAW_ROWLEN ; 55 56 57 58 char SCREEN__EXPORTEDSYM_COLOR = SCREEN_COLOR ; 59 char COLOR__EXPORTEDSYM_WHITE = COLOR_WHITE ; 60 char COLOR__EXPORTEDSYM_RED = COLOR_RED ; 61 char COLOR__EXPORTEDSYM_GREY = COLOR_GREY ; 62 char COLOR__EXPORTEDSYM_GREEN = COLOR_GREEN ; 63 char COLOR__EXPORTEDSYM_BLUE_LT = COLOR_BLUE_LT ; 64 char COLOR__EXPORTEDSYM_BLUE = COLOR_BLUE ; 65 char COLOR__EXPORTEDSYM_YELLOW = COLOR_YELLOW ; 66 char COLOR__EXPORTEDSYM_BG = COLOR_BG ; 67 char COLOR__EXPORTEDSYM_FG = COLOR_FG ; 68 char COLOR__EXPORTEDSYM_SELECTED_BG = COLOR_SELECTED_BG ; 69 char COLOR__EXPORTEDSYM_SELECTED_FG = COLOR_SELECTED_FG ; 70 char COLOR__EXPORTEDSYM_ALT_BG = COLOR_ALT_BG ; 71 char COLOR__EXPORTEDSYM_SPLASH_RED = COLOR_SPLASH_RED ; 72 char COLOR__EXPORTEDSYM_SPLASH_PINK = COLOR_SPLASH_PINK ; 73 char COLOR__EXPORTEDSYM_SPLASH_GREY = COLOR_SPLASH_GREY ; 74 char COLOR__EXPORTEDSYM_HISTO_R = COLOR_HISTO_R ; 75 char COLOR__EXPORTEDSYM_HISTO_R_PLAY = COLOR_HISTO_R_PLAY ; 76 char COLOR__EXPORTEDSYM_HISTO_B = COLOR_HISTO_B ; 77 char COLOR__EXPORTEDSYM_HISTO_G = COLOR_HISTO_G ; 78 char COLOR__EXPORTEDSYM_HISTO_G_PLAY = COLOR_HISTO_G_PLAY ; 79 char COLOR__EXPORTEDSYM_HISTO_BG = COLOR_HISTO_BG ; 80 char COLOR__EXPORTEDSYM_HISTO_RG = COLOR_HISTO_RG ; 81 char COLOR__EXPORTEDSYM_HISTO_RB = COLOR_HISTO_RB ; 82 char COLOR__EXPORTEDSYM_HISTO_RB_PLAY = COLOR_HISTO_RB_PLAY ; 83 char COLOR__EXPORTEDSYM_HISTO_B_PLAY = COLOR_HISTO_B_PLAY ; 84 char COLOR__EXPORTEDSYM_HISTO_BG_PLAY = COLOR_HISTO_BG_PLAY ; 85 char COLOR__EXPORTEDSYM_HISTO_RG_PLAY = COLOR_HISTO_RG_PLAY ; 86 87 short EDGE__EXPORTEDSYM_HMARGIN = EDGE_HMARGIN; 88 short CAM__EXPORTEDSYM_TS_BUTTON_BORDER = CAM_TS_BUTTON_BORDER; 89 90 56 91 /* EXPORTED_DEFINES_END */ 57 92 … … 59 94 // 1. DO NOT CHANGE ORDER AND DO NOT DELETE EXISTED ENTRIES 60 95 // 2. VARIABLE conf SHOULDN'T EXIST IN THE LIST TO KEEP ISOLATION. USE set|get_chdk_conf|get_chdk_conf_ptr INSTEAD 96 // STOPLIST: conf, open, opendir, closedir, rewinddir, readdir, stat 61 97 62 98 void* CHDK_EXPORT_LIST[] = { … … 72 108 umalloc, 73 109 ufree, 74 open,110 safe_open, 75 111 write, 76 112 lseek, … … 84 120 fread, 85 121 fwrite, 86 s tat,87 opendir,88 readdir,89 closedir,122 safe_stat, 123 safe_opendir, 124 safe_readdir, 125 safe_closedir, 90 126 91 127 get_tick_count, … … 193 229 msleep, 194 230 GetTotalCardSpaceKb, 195 convert_dng_to_chdk_raw,231 module_convert_dng_to_chdk_raw, 196 232 raw_prepare_develop, 197 233 … … 221 257 gui_menu_run_fltmodule, 222 258 259 // export palette 260 &SCREEN__EXPORTEDSYM_COLOR , 261 &COLOR__EXPORTEDSYM_WHITE , 262 &COLOR__EXPORTEDSYM_RED , 263 &COLOR__EXPORTEDSYM_GREY , 264 &COLOR__EXPORTEDSYM_GREEN , 265 &COLOR__EXPORTEDSYM_BLUE_LT , 266 &COLOR__EXPORTEDSYM_BLUE , 267 &COLOR__EXPORTEDSYM_YELLOW , 268 &COLOR__EXPORTEDSYM_BG , 269 &COLOR__EXPORTEDSYM_FG , 270 &COLOR__EXPORTEDSYM_SELECTED_BG , 271 &COLOR__EXPORTEDSYM_SELECTED_FG , 272 &COLOR__EXPORTEDSYM_ALT_BG , 273 &COLOR__EXPORTEDSYM_SPLASH_RED , 274 &COLOR__EXPORTEDSYM_SPLASH_PINK , 275 &COLOR__EXPORTEDSYM_SPLASH_GREY , 276 &COLOR__EXPORTEDSYM_HISTO_R , 277 &COLOR__EXPORTEDSYM_HISTO_R_PLAY , 278 &COLOR__EXPORTEDSYM_HISTO_B , 279 &COLOR__EXPORTEDSYM_HISTO_G , 280 &COLOR__EXPORTEDSYM_HISTO_G_PLAY , 281 &COLOR__EXPORTEDSYM_HISTO_BG , 282 &COLOR__EXPORTEDSYM_HISTO_RG , 283 &COLOR__EXPORTEDSYM_HISTO_RB , 284 &COLOR__EXPORTEDSYM_HISTO_RB_PLAY, 285 &COLOR__EXPORTEDSYM_HISTO_B_PLAY , 286 &COLOR__EXPORTEDSYM_HISTO_BG_PLAY, 287 &COLOR__EXPORTEDSYM_HISTO_RG_PLAY, 288 289 // some common required sym 290 &EDGE__EXPORTEDSYM_HMARGIN, 291 &CAM__EXPORTEDSYM_TS_BUTTON_BORDER, 292 293 // profile.flt 294 find_mnu, 295 lang_strhash31, 296 223 297 0 224 298 }; 225 226 /* debug_open,227 debug_print_int,228 debug_print,229 debug_flush,230 debug_close,231 */232 -
branches/reyalp-flt/core/modules.c
r1477 r1494 13 13 #include "conf.h" 14 14 #include "gui_draw.h" 15 #include "dng.h" 15 16 16 17 /************* DYNAMIC LIBRARY RAWOPERATION ******/ … … 242 243 } 243 244 244 245 /************* OTHER MODULES ******/ 246 247 void module_convert_dng_to_chdk_raw(char* fn) 248 { 249 #if DNG_SUPPORT 250 convert_dng_to_chdk_raw(fn); 251 #endif 252 } -
branches/reyalp-flt/core/modules.h
r1467 r1494 38 38 39 39 40 41 //-------------------------- 42 void module_convert_dng_to_chdk_raw(char* fn); 43 44 40 45 #endif -
branches/reyalp-flt/core/modules/Makefile
r1489 r1494 15 15 LDLIBS= -lgcc 16 16 LDOPTS=-nostdlib -Wl,--allow-shlib-undefined -Wl,-T,$(topdir)tools/link-boot.ld 17 LDOPTS+=-Wl,-N,-Ttext, $(MEMISOSTART)-r -Wl,-d17 LDOPTS+=-Wl,-N,-Ttext,0x0016ee30 -r -Wl,-d 18 18 19 19 OBJS=../gui_calendar.o ../gui_bench.o ../gui_4wins.o ../gui_mastermind.o ../gui_reversi.o \ -
branches/reyalp-flt/core/modules/module_menu.c
r1489 r1494 122 122 CMenu* scan_directory(const char* dir) { 123 123 124 DIR *d;125 struct dirent *de;126 static struct stat st;124 STD_DIR *d; 125 struct STD_dirent *de; 126 static struct STD_stat st; 127 127 128 128 char curdir[100]; … … 139 139 for ( iter=1; iter<=2; iter++ ) 140 140 { 141 d = opendir(curdir);141 d = safe_opendir(curdir); 142 142 if (!d) return 0; 143 143 144 144 count = 0; 145 for( de = readdir(d); de; de =readdir(d) ) {145 for( de = safe_readdir(d); de; de = safe_readdir(d) ) { 146 146 147 147 if (de->d_name[0] == 0xE5 /* deleted entry */ ) … … 155 155 156 156 sprintf(buf, "%s/%s", curdir, de->d_name); 157 if (s tat(buf, &st)!=0)157 if (safe_stat(buf, &st)!=0) 158 158 continue; 159 159 … … 213 213 } 214 214 215 closedir(d);215 safe_closedir(d); 216 216 217 217 // Iteration#1 final: allocate menuitems 218 218 if (iter==1) { 219 219 220 if ( count==0 ) { closedir(d); return 0;}220 if ( count==0 ) { safe_closedir(d); return 0;} 221 221 222 222 len = sizeof(CMenu) + sizeof(CMenuItem)*(count+2); -
branches/reyalp-flt/core/raw.h
r1035 r1494 32 32 void unpatch_bad_pixels_b(void); 33 33 int badpixel_list_loaded_b(void); 34 char* get_raw_image_addr(void);35 34 void create_badpixel_bin(); 36 35 #endif 36 char* get_raw_image_addr(void); 37 37 38 38 //------------------------------------------------------------------- -
branches/reyalp-flt/core/raw_merge.c
r1483 r1494 56 56 static struct utimbuf t; 57 57 58 struct stat st;59 60 if (s tat((char *)from,&st) != 0 || st.st_size!=hook_raw_size())58 struct STD_stat st; 59 60 if (safe_stat((char *)from,&st) != 0 || st.st_size!=hook_raw_size()) 61 61 return 0; 62 62 63 if (s tat((char *)sub,&st) != 0 || st.st_size!=hook_raw_size())63 if (safe_stat((char *)sub,&st) != 0 || st.st_size!=hook_raw_size()) 64 64 return 0; 65 65 … … 212 212 int t,src,i,j,nrow; 213 213 FILE *fbrawin=NULL,*fbrawout,*fcraw; 214 struct stat st;214 struct STD_stat st; 215 215 216 216 if (!filename) 217 217 return; 218 218 219 s tat(filename,&st);219 safe_stat(filename,&st); 220 220 if (st.st_size!=hook_raw_size()) 221 221 return; -
branches/reyalp-flt/include/stdlib.h
r1249 r1494 13 13 #define O_WRONLY 1 14 14 #define O_RDWR 2 15 16 #ifndef THIS_IS_CHDK_CORE 17 #include "stdlib_unified.h" 18 #endif 15 19 16 20 … … 86 90 #endif//CAM_DRYOS_2_3_R39 87 91 88 #endif 92 #endif //CAM_DRYOS 89 93 90 94 extern int rand(void); -
branches/reyalp-flt/tools/elf2flt/flt.h
r1488 r1494 90 90 uint32_t sizeof_struct; 91 91 uint16_t chdk_required_branch; 92 uint 16_t chdk_required_ver;92 uint32_t chdk_required_ver; 93 93 uint32_t chdk_required_platfid; 94 94 uint32_t flags;
Note: See TracChangeset
for help on using the changeset viewer.