Changeset 1814
- Timestamp:
- 04/22/12 01:32:32 (14 months ago)
- Location:
- branches/reyalp-ptp-live
- Files:
-
- 2 deleted
- 139 edited
- 14 copied
-
. (modified) (1 prop)
-
CHDK/DATA/GPS_Kreis.txt (copied) (copied from trunk/CHDK/DATA/GPS_Kreis.txt)
-
CHDK/DATA/GPS_Pfeil.txt (copied) (copied from trunk/CHDK/DATA/GPS_Pfeil.txt)
-
CHDK/DATA/GPS_Sat.txt (copied) (copied from trunk/CHDK/DATA/GPS_Sat.txt)
-
CHDK/DATA/GPS_Track_1.txt (copied) (copied from trunk/CHDK/DATA/GPS_Track_1.txt)
-
CHDK/DATA/GPS_Track_2.txt (copied) (copied from trunk/CHDK/DATA/GPS_Track_2.txt)
-
CHDK/DATA/GPS_Track_3.txt (copied) (copied from trunk/CHDK/DATA/GPS_Track_3.txt)
-
CHDK/DATA/logo.dat (deleted)
-
CHDK/LANG/english.lng (modified) (2 diffs)
-
CHDK/LANG/german.lng (modified) (1 diff)
-
CHDK/Makefile (modified) (2 diffs)
-
CHDK/logo.dat (copied) (copied from trunk/CHDK/logo.dat)
-
CHDK/logo_de.dat (copied) (copied from trunk/CHDK/logo_de.dat)
-
Makefile (modified) (3 diffs)
-
buildconf.inc (modified) (3 diffs)
-
camera_list.csv (modified) (4 diffs)
-
chdk_ver.inc (deleted)
-
core/conf.c (modified) (5 diffs)
-
core/dng.c (modified) (21 diffs)
-
core/gui.c (modified) (5 diffs)
-
core/gui_draw.c (modified) (1 diff)
-
core/gui_lang.h (modified) (1 diff)
-
core/modules.c (modified) (1 diff)
-
core/raw.c (modified) (2 diffs)
-
core/shooting.c (modified) (2 diffs)
-
include/camera.h (modified) (1 diff)
-
include/conf.h (modified) (2 diffs)
-
include/propset1.h (modified) (1 diff)
-
include/propset2.h (modified) (1 diff)
-
loader/g1x (copied) (copied from trunk/loader/g1x)
-
loader/s100 (copied) (copied from trunk/loader/s100)
-
makefile.inc (modified) (3 diffs)
-
platform/a1000/main.c (modified) (1 diff)
-
platform/a1100/main.c (modified) (1 diff)
-
platform/a2000/main.c (modified) (1 diff)
-
platform/a3000/main.c (modified) (1 diff)
-
platform/a3300/main.c (modified) (1 diff)
-
platform/a3300/sub/100a/stubs_entry.S (modified) (1 diff)
-
platform/a3300/sub/100c/stubs_entry.S (modified) (1 diff)
-
platform/a3300/sub/100d/stubs_entry.S (modified) (1 diff)
-
platform/a480/main.c (modified) (1 diff)
-
platform/a490/main.c (modified) (1 diff)
-
platform/a495/main.c (modified) (1 diff)
-
platform/a580/main.c (modified) (1 diff)
-
platform/a590/main.c (modified) (1 diff)
-
platform/a720/main.c (modified) (1 diff)
-
platform/a800/main.c (modified) (1 diff)
-
platform/a800/shooting.c (modified) (1 diff)
-
platform/a800/sub/100b (copied) (copied from trunk/platform/a800/sub/100b)
-
platform/a800/sub/100c/stubs_entry.S (modified) (1 diff)
-
platform/d10/main.c (modified) (1 diff)
-
platform/g10/main.c (modified) (1 diff)
-
platform/g11/main.c (modified) (1 diff)
-
platform/g12/main.c (modified) (1 diff)
-
platform/g12/sub/100c/stubs_entry.S (modified) (1 diff)
-
platform/g12/sub/100c/stubs_min.S (modified) (1 diff)
-
platform/g12/sub/100e/stubs_entry.S (modified) (1 diff)
-
platform/g12/sub/100e/stubs_min.S (modified) (1 diff)
-
platform/g12/sub/100f/stubs_entry.S (modified) (1 diff)
-
platform/g12/sub/100f/stubs_min.S (modified) (1 diff)
-
platform/g12/sub/100g/stubs_entry.S (modified) (1 diff)
-
platform/g12/sub/100g/stubs_min.S (modified) (1 diff)
-
platform/g1x (copied) (copied from trunk/platform/g1x)
-
platform/ixus1000_sd4500/main.c (modified) (1 diff)
-
platform/ixus1000_sd4500/platform_camera.h (modified) (1 diff)
-
platform/ixus1000_sd4500/sub/100d/stubs_entry.S (modified) (1 diff)
-
platform/ixus1000_sd4500/sub/100f/stubs_entry.S (modified) (1 diff)
-
platform/ixus1000_sd4500/sub/102b (copied) (copied from trunk/platform/ixus1000_sd4500/sub/102b)
-
platform/ixus100_sd780/main.c (modified) (1 diff)
-
platform/ixus120_sd940/main.c (modified) (1 diff)
-
platform/ixus120_sd940/platform_camera.h (modified) (1 diff)
-
platform/ixus200_sd980/main.c (modified) (1 diff)
-
platform/ixus200_sd980/platform_camera.h (modified) (1 diff)
-
platform/ixus220_elph300hs/main.c (modified) (1 diff)
-
platform/ixus220_elph300hs/sub/100c/stubs_entry.S (modified) (1 diff)
-
platform/ixus220_elph300hs/sub/101a/stubs_entry.S (modified) (1 diff)
-
platform/ixus220_elph300hs/sub/101c/stubs_entry.S (modified) (1 diff)
-
platform/ixus220_elph300hs/sub/101g/stubs_entry.S (modified) (1 diff)
-
platform/ixus230_elph310hs/main.c (modified) (1 diff)
-
platform/ixus230_elph310hs/sub/100b/stubs_entry.S (modified) (1 diff)
-
platform/ixus300_sd4000/main.c (modified) (1 diff)
-
platform/ixus300_sd4000/platform_camera.h (modified) (1 diff)
-
platform/ixus310_elph500hs/main.c (modified) (1 diff)
-
platform/ixus310_elph500hs/sub/100a/stubs_entry.S (modified) (1 diff)
-
platform/ixus310_elph500hs/sub/100a/stubs_min.S (modified) (1 diff)
-
platform/ixus310_elph500hs/sub/101a/stubs_entry.S (modified) (1 diff)
-
platform/ixus310_elph500hs/sub/101a/stubs_min.S (modified) (1 diff)
-
platform/ixus310_elph500hs/sub/101c/stubs_entry.S (modified) (1 diff)
-
platform/ixus310_elph500hs/sub/101c/stubs_min.S (modified) (1 diff)
-
platform/ixus85_sd770/main.c (modified) (1 diff)
-
platform/ixus860_sd870/main.c (modified) (1 diff)
-
platform/ixus95_sd1200/main.c (modified) (1 diff)
-
platform/ixus960_sd950/main.c (modified) (1 diff)
-
platform/ixus970_sd890/main.c (modified) (1 diff)
-
platform/ixus980_sd990/main.c (modified) (1 diff)
-
platform/s100 (copied) (copied from trunk/platform/s100)
-
platform/s95/main.c (modified) (1 diff)
-
platform/s95/sub/100e/stubs_entry.S (modified) (1 diff)
-
platform/s95/sub/100h/stubs_entry.S (modified) (1 diff)
-
platform/s95/sub/100i/stubs_entry.S (modified) (1 diff)
-
platform/s95/sub/100k/stubs_entry.S (modified) (1 diff)
-
platform/sx100is/main.c (modified) (1 diff)
-
platform/sx110is/main.c (modified) (1 diff)
-
platform/sx120is/main.c (modified) (1 diff)
-
platform/sx130is/main.c (modified) (1 diff)
-
platform/sx130is/sub/101c/stubs_entry.S (modified) (1 diff)
-
platform/sx130is/sub/101d/stubs_entry.S (modified) (1 diff)
-
platform/sx130is/sub/101f/stubs_entry.S (modified) (1 diff)
-
platform/sx150is/kbd.c (modified) (6 diffs)
-
platform/sx150is/main.c (modified) (1 diff)
-
platform/sx150is/notes.txt (modified) (1 diff)
-
platform/sx150is/platform_camera.h (modified) (1 diff)
-
platform/sx150is/sub/100a/stubs_entry.S (modified) (1 diff)
-
platform/sx220hs/kbd.c (modified) (2 diffs)
-
platform/sx220hs/main.c (modified) (1 diff)
-
platform/sx220hs/notes.txt (modified) (1 diff)
-
platform/sx220hs/platform_camera.h (modified) (1 diff)
-
platform/sx220hs/sub/100a/stubs_entry.S (modified) (1 diff)
-
platform/sx220hs/sub/100a/stubs_min.S (modified) (1 diff)
-
platform/sx220hs/sub/101a/stubs_entry.S (modified) (1 diff)
-
platform/sx220hs/sub/101a/stubs_min.S (modified) (1 diff)
-
platform/sx220hs/sub/101b/stubs_entry.S (modified) (1 diff)
-
platform/sx220hs/sub/101b/stubs_min.S (modified) (1 diff)
-
platform/sx230hs/kbd.c (modified) (3 diffs)
-
platform/sx230hs/main.c (modified) (1 diff)
-
platform/sx230hs/notes.txt (modified) (1 diff)
-
platform/sx230hs/sub/100c/stubs_entry.S (modified) (1 diff)
-
platform/sx230hs/sub/101a/stubs_entry.S (modified) (1 diff)
-
platform/sx230hs/sub/101b/stubs_entry.S (modified) (1 diff)
-
platform/sx30/kbd.c (modified) (1 diff)
-
platform/sx30/main.c (modified) (1 diff)
-
platform/sx30/platform_camera.h (modified) (1 diff)
-
platform/sx30/sub/100e/stubs_entry.S (modified) (1 diff)
-
platform/sx30/sub/100e/stubs_min.S (modified) (1 diff)
-
platform/sx30/sub/100h/stubs_entry.S (modified) (1 diff)
-
platform/sx30/sub/100h/stubs_min.S (modified) (1 diff)
-
platform/sx30/sub/100l/stubs_entry.S (modified) (1 diff)
-
platform/sx30/sub/100l/stubs_min.S (modified) (1 diff)
-
platform/sx30/sub/100n/stubs_entry.S (modified) (1 diff)
-
platform/sx30/sub/100n/stubs_min.S (modified) (1 diff)
-
platform/sx30/sub/100p/stubs_entry.S (modified) (1 diff)
-
platform/sx30/sub/100p/stubs_min.S (modified) (1 diff)
-
platform/sx40hs/kbd.c (modified) (1 diff)
-
platform/sx40hs/main.c (modified) (1 diff)
-
platform/sx40hs/platform_camera.h (modified) (1 diff)
-
platform/sx40hs/sub/100d/stubs_entry.S (modified) (1 diff)
-
platform/sx40hs/sub/100d/stubs_min.S (modified) (1 diff)
-
platform/sx40hs/sub/100f/stubs_entry.S (modified) (1 diff)
-
platform/sx40hs/sub/100f/stubs_min.S (modified) (1 diff)
-
platform/sx40hs/sub/100g/stubs_entry.S (modified) (1 diff)
-
platform/sx40hs/sub/100g/stubs_min.S (modified) (1 diff)
-
platform/sx40hs/sub/100i/stubs_entry.S (modified) (1 diff)
-
platform/sx40hs/sub/100i/stubs_min.S (modified) (1 diff)
-
tools/dancingbits.h (modified) (2 diffs)
-
tools/finsig_dryos.c (modified) (38 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/reyalp-ptp-live
-
branches/reyalp-ptp-live/CHDK/LANG/english.lng
r1720 r1814 436 436 335 "Mute during zooming" 437 437 438 336 " Bad pixel removal"438 336 "Manual bad pixel removal" 439 439 337 "Off" 440 440 338 "Averag." … … 672 672 673 673 551 "Enable script start" 674 675 552 "Disable Zoom Assist button" 676 677 553 "DNG version" -
branches/reyalp-ptp-live/CHDK/LANG/german.lng
r1720 r1814 685 685 686 686 550 "Abbruch mit [Auslöser halb]" 687 688 551 "Skript-Start an/aus" 689 690 552 "Taste Zoom-Assistent deaktivieren" 691 692 553 "DNG-Version" -
branches/reyalp-ptp-live/CHDK/Makefile
r1505 r1814 1 1 topdir=../ 2 2 include $(topdir)makefile.inc 3 4 ifndef OPT_DE_VERSION 5 LOGO=logo.dat 6 else 7 LOGO=logo_de.dat 8 endif 3 9 4 10 GENLUA=LUALIB/GEN/propset1.lua LUALIB/GEN/propset2.lua LUALIB/GEN/propset3.lua LUALIB/GEN/propset4.lua LUALIB/GEN/modelist.lua 5 11 # generate some lua files from CHDK source 6 12 all: $(GENLUA) 13 @echo "copy" $(LOGO) 14 mkdir -p $(topdir)CHDK/DATA 15 cp $(topdir)CHDK/$(LOGO) $(topdir)CHDK/DATA/$(LOGO) 7 16 8 17 LUALIB/GEN/propset1.lua: $(topdir)include/propset1.h … … 28 37 clean: 29 38 rm -f $(GENLUA) 39 rm -f $(topdir)CHDK/DATA/$(LOGO) 30 40 rm -f MODULES/*.flt 31 41 -
branches/reyalp-ptp-live/Makefile
r1813 r1814 22 22 endif 23 23 tmp:=$(shell echo "BUILD_SVNREV := $(BUILD_SVNREV)" > revision.inc) 24 25 # CHDK folder for full package 26 ZIPDIRS:=$(shell ls -R CHDK | grep CHDK/ | $(ESED) 's?:?/*?') 24 27 25 28 SUBDIRS=tools lib platform core loader CHDK … … 133 136 LANG=C echo -e "CHDK-$(VER) for $(PLATFORM) fw:$(PLATFORMSUB) build:$(BUILD_NUMBER)$(STATE) date:`date -R`" | \ 134 137 zip -9jz $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/DISKBOOT.BIN > $(DEVNULL) 135 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SYMBOLS/* > $(DEVNULL) 136 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/BOOKS/* > $(DEVNULL) 137 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/CURVES/* > $(DEVNULL) 138 ifeq ($(VER),CHDK-DE) 139 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/CURVES/ISOBoost/* > $(DEVNULL) 140 endif 141 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/DATA/* > $(DEVNULL) 142 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/FONTS/* > $(DEVNULL) 143 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/GAMES/* > $(DEVNULL) 144 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/GRIDS/* > $(DEVNULL) 145 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/LANG/* > $(DEVNULL) 146 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/LUALIB/* > $(DEVNULL) 147 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/LUALIB/GEN/* > $(DEVNULL) 148 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/* > $(DEVNULL) 149 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/EXAM/* > $(DEVNULL) 150 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/TEST/* > $(DEVNULL) 151 ifeq ($(VER),CHDK-DE) 152 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/MD/* > $(DEVNULL) 153 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/CURV/* > $(DEVNULL) 154 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/USER/* > $(DEVNULL) 155 else 156 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/EDITOR/* > $(DEVNULL) 157 endif 138 $(foreach ZIPDIR, $(ZIPDIRS), \ 139 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)$(ZIPDIR) > $(DEVNULL) ; \ 140 ) 158 141 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/syscurves.CVF > $(DEVNULL) 159 142 zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)doc/changelog.txt > $(DEVNULL) … … 163 146 zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)doc/readme.txt > $(DEVNULL) 164 147 zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)doc/readme.txt > $(DEVNULL) 165 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/MODULES/* > $(DEVNULL)166 148 zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)CHDK/MODULES/* > $(DEVNULL) 167 149 -
branches/reyalp-ptp-live/buildconf.inc
r1813 r1814 16 16 # WARNING: This is DANGEROUS. e.g. call_event_proc("EraseSectorOfRom",...) 17 17 # NOTE: the interface for this may change in the future, to support better support buffers etc 18 ifeq ($(VER),CHDK-DE) 19 OPT_LUA_CALL_NATIVE=1 20 endif 18 #OPT_LUA_CALL_NATIVE=1 21 19 22 20 # experimental - allocate memory from alternate heap. Default 2MB from EXMEM_RAMDISK … … 46 44 # for people who won't use lang files at all / not done yet 47 45 #!OPT_LANGUAGEINTERFACE=1 46 # for CHDK-DE presets without OPT_DEFAULT_LANG 47 #OPT_DE_VERSION=1 48 48 49 49 # Override the value below to compile a different default language into … … 51 51 # desired language. 52 52 # Set the value to the language file name without extension - e.g. OPT_DEFAULT_LANG=russian 53 ifeq ($(VER),CHDK-DE) 54 OPT_DEFAULT_LANG=german 55 endif 53 #OPT_DEFAULT_LANG= 56 54 57 # Default svn rev sion. Used when svnversion fail.55 # Default svn revision. Used when svnversion fail. 58 56 DEF_SVN_REF=0 -
branches/reyalp-ptp-live/camera_list.csv
r1737 r1814 44 44 a710,100a,,, 45 45 a720,100c,,, 46 a800,100b,BETA,, 46 47 a800,100c,BETA,, 47 48 d10,100a,BETA,100b, … … 56 57 g12,100f,,, 57 58 g12,100g,,, 59 g1x,100f,ALPHA,, 58 60 g7,100e,,, 59 61 g7,100g,,, … … 65 67 ixus1000_sd4500,100d,BETA,, 66 68 ixus1000_sd4500,100f,BETA,, 69 ixus1000_sd4500,102b,BETA,, 67 70 ixus100_sd780,100b,BETA,, 68 71 ixus100_sd780,100c,BETA,, … … 141 144 s95,100i,BETA,, 142 145 s95,100k,BETA,, 146 s100,100d,ALPHA,, 147 s100,100e,ALPHA,, 148 s100,101a,ALPHA,, 143 149 sx1,200h,BETA,, 144 150 sx1,201a,BETA,, -
branches/reyalp-ptp-live/core/conf.c
r1737 r1814 375 375 //CONF_INFO(224, conf.edge_overlay_zoom, CONF_DEF_VALUE, i:1, NULL), // moved to edge overlay module 376 376 CONF_INFO(225, conf.raw_cache, CONF_DEF_VALUE, i:0, NULL), 377 CONF_INFO(226, conf.dng_raw, CONF_DEF_VALUE, i: 0, conf_change_dng),377 CONF_INFO(226, conf.dng_raw, CONF_DEF_VALUE, i:1, conf_change_dng), 378 378 CONF_INFO(227, conf.flash_sync_curtain, CONF_DEF_VALUE, i:0, NULL), 379 379 CONF_INFO(228, conf.raw_timer, CONF_DEF_VALUE, i:0, NULL), … … 383 383 CONF_INFO(232, conf.flash_video_override, CONF_DEF_VALUE, i:0, NULL), 384 384 CONF_INFO(233, conf.flash_video_override_power, CONF_DEF_VALUE, i:0, NULL), 385 CONF_INFO(234, conf.raw_dng_ext, CONF_DEF_VALUE, i: 0, NULL),385 CONF_INFO(234, conf.raw_dng_ext, CONF_DEF_VALUE, i:1, NULL), 386 386 CONF_INFO(235, conf.dng_usb_ext, CONF_DEF_VALUE, i:0, conf_change_dng_ext), 387 387 CONF_INFO(236, conf.flash_manual_override, CONF_DEF_VALUE, i:0, NULL), … … 454 454 CONF_INFO(286, conf.overexp_threshold, CONF_DEF_VALUE, i:5, NULL), 455 455 CONF_INFO(287, conf.overexp_ev_enum, CONF_DEF_VALUE, i:3, conf_change_autoiso), 456 457 #if defined(CAM_ZOOM_ASSIST_BUTTON_CONTROL) 458 CONF_INFO(288, conf.zoom_assist_button_disable, CONF_DEF_VALUE, i:0, NULL), 459 #endif 460 461 CONF_INFO(289, conf.dng_version, CONF_DEF_VALUE, i:0, conf_change_dng), 456 462 }; 457 463 #define CONF_NUM (sizeof(conf_info)/sizeof(conf_info[0])) … … 472 478 case 194: conf_change_script_file(); break; 473 479 case 2: 474 case 226: conf_change_dng(); break; 480 case 226: 481 case 289: conf_change_dng(); break; 475 482 case 235: conf_change_dng_ext(); break; 476 483 case 284: conf_change_autoiso(); break; … … 514 521 void conf_change_dng(void){ 515 522 #if DNG_SUPPORT 516 if (conf.save_raw && conf.dng_raw ) {523 if (conf.save_raw && conf.dng_raw && conf.dng_version) { 517 524 if ( !module_dng_load(LIBDNG_OWNED_BY_RAW) ) 518 return;519 if (!libdng->badpixel_list_loaded_b()) libdng->load_bad_pixels_list_b("A/CHDK/badpixel.bin");520 if (!libdng->badpixel_list_loaded_b()) conf.dng_raw=0;525 return; 526 if (!libdng->badpixel_list_loaded_b()) libdng->load_bad_pixels_list_b("A/CHDK/badpixel.bin"); 527 if (!libdng->badpixel_list_loaded_b()) conf.dng_version=0; 521 528 } 522 529 else if ( libdng && libdng->load_bad_pixels_list_b ) { 523 libdng->load_bad_pixels_list_b(0); //unload badpixel.bin530 libdng->load_bad_pixels_list_b(0); //unload badpixel.bin 524 531 module_dng_unload(LIBDNG_OWNED_BY_RAW); 525 532 } -
branches/reyalp-ptp-live/core/dng.c
r1813 r1814 20 20 struct dir_entry{unsigned short tag; unsigned short type; unsigned int count; unsigned int offset;}; 21 21 22 #define T_END 023 22 #define T_BYTE 1 24 23 #define T_ASCII 2 … … 34 33 #define T_DOUBLE 12 35 34 #define T_PTR 0x100 // Stored as long/short etc in DNG header, referenced by pointer in IFD (must be pointer to int variable) 35 #define T_SKIP 0x200 // Tag value to be skipped (for marking GPS entries if camera does not have GPS) 36 36 37 37 unsigned short get_exp_program_for_exif(int exp_program); … … 48 48 const char cam_chdk_ver[] = HDK_VERSION" ver. "BUILD_NUMBER; 49 49 const int cam_Resolution[] = {180,1}; 50 int cam_AsShotNeutral[] = {1000,1000,1000,1000,1000,1000}; 50 static int cam_AsShotNeutral[] = {1000,1000,1000,1000,1000,1000}; 51 static char cam_datetime[20] = ""; // DateTimeOriginal 52 static int cam_shutter[2] = { 0, 1000000 }; // Shutter speed 53 static int cam_aperture[2] = { 0, 10 }; // Aperture 54 static int cam_apex_shutter[2] = { 0, 96 }; // Shutter speed in APEX units 55 static int cam_apex_aperture[2] = { 0, 96 }; // Aperture in APEX units 56 static int cam_exp_bias[2] = { 0, 96 }; 57 static int cam_max_av[2] = { 0, 96 }; 58 static int cam_focal_length[2] = { 0, 1000 }; 51 59 52 60 struct t_data_for_exif{ 53 short iso;54 int exp_program;55 int effective_focal_length;56 short orientation;57 short flash_mode;58 short flash_fired;59 short metering_mode;61 short iso; 62 int exp_program; 63 int effective_focal_length; 64 short orientation; 65 short flash_mode; 66 short flash_fired; 67 short metering_mode; 60 68 }; 61 69 62 70 static struct t_data_for_exif exif_data; 63 71 72 #define BE(v) ((v&0x000000FF)<<24)|((v&0x0000FF00)<<8)|((v&0x00FF0000)>>8)|((v&0xFF000000)>>24) // Convert to big_endian 73 74 static unsigned int badpixel_opcode[] = 75 { 76 // *** all values must be in big endian order 77 78 BE(1), // Count = 1 79 80 BE(4), // FixBadPixelsConstant = 4 81 BE(0x01030000), // DNG version = 1.3.0.0 82 BE(1), // Flags = 1 83 BE(8), // Opcode length = 8 bytes 84 BE(0), // Constant = 0 85 #if cam_CFAPattern == 0x02010100 86 BE(1), // BayerPhase = 1 (top left pixel is green in a green/red row) 87 #elif cam_CFAPattern == 0x01020001 88 BE(0), // BayerPhase = 0 (top left pixel is red) 89 #elif cam_CFAPattern == 0x01000201 90 BE(3), // BayerPhase = 3 (top left pixel is blue) 91 #elif cam_CFAPattern == 0x00010102 92 BE(2), // BayerPhase = 2 (top left pixel is green in a green/blue row) 93 #endif 94 }; 95 64 96 // warning: according to TIFF format specification, elements must be sorted by tag value in ascending order! 65 97 66 struct dir_entry IFD0[]={ 67 {0xFE, T_LONG, 1, 1}, // NewSubFileType: Preview Image 68 {0x100, T_LONG, 1, DNG_TH_WIDTH}, // ImageWidth 69 {0x101, T_LONG, 1, DNG_TH_HEIGHT}, // ImageLength 70 {0x102, T_SHORT, 3, (int)cam_PreviewBitsPerSample}, // BitsPerSample: 8,8,8 71 {0x103, T_SHORT, 1, 1}, // Compression: Uncompressed 72 {0x106, T_SHORT, 1, 2}, //PhotometricInterpretation: RGB 73 {0x10E, T_ASCII, 1, 0}, // ImageDescription 74 {0x10F, T_ASCII, sizeof(CAM_MAKE), (int)CAM_MAKE}, // Make 75 {0x110, T_ASCII, 32, (int)cam_name}, //Model: Filled at header generation. 76 {0x111, T_LONG, 1, 0}, //StripOffsets: Offset 77 {0x112, T_SHORT, 1, 1}, //Orientation: 1 - 0th row is top, 0th column is left 78 {0x115, T_SHORT, 1, 3}, // SamplesPerPixel: 3 79 {0x116, T_SHORT, 1, DNG_TH_HEIGHT}, //RowsPerStrip 80 {0x117, T_LONG, 1, DNG_TH_WIDTH*DNG_TH_HEIGHT*3}, // StripByteCounts = preview size 81 {0x11C, T_SHORT, 1, 1}, // PlanarConfiguration: 1 82 {0x131, T_ASCII, sizeof(cam_chdk_ver), (int)cam_chdk_ver},//Software 83 {0x132, T_ASCII, 20, 0}, // DateTime 84 {0x14A, T_LONG, 1, 0}, //SubIFDs offset 85 {0x8298, T_ASCII, 1, 0}, // Copyright 86 {0x8769, T_LONG, 1, 0}, //EXIF_IFD offset 87 {0x8825, T_LONG, 1, 0}, //GPS_IFD offset 88 {0x9216, T_BYTE, 4, 0x00000001}, // TIFF/EPStandardID: 1.0.0.0 89 {0xC612, T_BYTE, 4, 0x00000101}, //DNGVersion: 1.1.0.0 90 {0xC614, T_ASCII, 32, (int)cam_name}, //UniqueCameraModel. Filled at header generation. 91 {0xC621, T_SRATIONAL, 9, (int)&camera_sensor.color_matrix1}, 92 {0xC627, T_RATIONAL, 3, (int)cam_AnalogBalance}, 93 {0xC628, T_RATIONAL, 3, (int)cam_AsShotNeutral}, 94 {0xC62A, T_SRATIONAL, 1, (int)&camera_sensor.exposure_bias}, 95 {0xC62B, T_RATIONAL, 1, (int)cam_BaselineNoise}, 96 {0xC62C, T_RATIONAL, 1, (int)cam_BaselineSharpness}, 97 {0xC62E, T_RATIONAL, 1, (int)cam_LinearResponseLimit}, 98 {0xC630, T_RATIONAL, 4, (int)&camera_sensor.lens_info}, 99 {0xC65A, T_SHORT|T_PTR,1, (int)&camera_sensor.calibration_illuminant1}, 100 {0, T_END} 101 }; 102 103 104 struct dir_entry IFD1[]={ 105 {0xFE, T_LONG, 1, 0}, // NewSubFileType: Main Image 106 {0x100, T_LONG|T_PTR, 1, (int)&camera_sensor.raw_rowpix}, // ImageWidth 107 {0x101, T_LONG|T_PTR, 1, (int)&camera_sensor.raw_rows}, // ImageLength 108 {0x102, T_SHORT|T_PTR,1, (int)&camera_sensor.bits_per_pixel}, // BitsPerSample 109 {0x103, T_SHORT, 1, 1}, // Compression: Uncompressed 110 {0x106, T_SHORT, 1, 0x8023}, //PhotometricInterpretation: CFA 111 {0x111, T_LONG, 1, 0}, //StripOffsets: Offset 112 {0x115, T_SHORT, 1, 1}, // SamplesPerPixel: 1 113 {0x116, T_SHORT|T_PTR,1, (int)&camera_sensor.raw_rows}, //RowsPerStrip 114 {0x117, T_LONG|T_PTR, 1, (int)&camera_sensor.raw_size}, // StripByteCounts = CHDK RAW size 115 {0x11A, T_RATIONAL, 1, (int)cam_Resolution}, // XResolution 116 {0x11B, T_RATIONAL, 1, (int)cam_Resolution}, // YResolution 117 {0x11C, T_SHORT, 1, 1}, // PlanarConfiguration: 1 118 {0x128, T_SHORT, 1, 2}, // ResolutionUnit: inch 119 {0x828D, T_SHORT, 2, 0x00020002}, // CFARepeatPatternDim: Rows = 2, Cols = 2 120 {0x828E, T_BYTE|T_PTR, 4, (int)&camera_sensor.cfa_pattern}, 121 {0xC61A, T_LONG|T_PTR, 1, (int)&camera_sensor.black_level}, // BlackLevel 122 {0xC61D, T_LONG|T_PTR, 1, (int)&camera_sensor.white_level}, // WhiteLevel 123 {0xC61F, T_LONG, 2, (int)&camera_sensor.crop.origin}, 124 {0xC620, T_LONG, 2, (int)&camera_sensor.crop.size}, 125 {0xC68D, T_LONG, 4, (int)&camera_sensor.dng_active_area}, 126 {0, T_END} 127 }; 128 129 130 static int cam_shutter[2] = { 0, 1000000 }; // Shutter speed 131 static int cam_aperture[2] = { 0, 10 }; // Aperture 132 static char cam_datetime[20] = ""; // DateTimeOriginal 133 static int cam_apex_shutter[2] = { 0, 96 }; // Shutter speed in APEX units 134 static int cam_apex_aperture[2] = { 0, 96 }; // Aperture in APEX units 135 static int cam_exp_bias[2] = { 0, 96 }; 136 static int cam_max_av[2] = { 0, 96 }; 137 static int cam_focal_length[2] = { 0, 1000 }; 138 139 struct dir_entry EXIF_IFD[]={ 140 {0x829A, T_RATIONAL, 1, (int)cam_shutter}, // Shutter speed 141 {0x829D, T_RATIONAL, 1, (int)cam_aperture}, // Aperture 142 {0x8822, T_SHORT, 1, 0}, // ExposureProgram 143 {0x8827, T_SHORT|T_PTR,1, (int)&exif_data.iso}, // ISOSpeedRatings 144 {0x9000, T_UNDEFINED, 4, 0x31323230}, // ExifVersion: 2.21 145 {0x9003, T_ASCII, 20, (int)cam_datetime}, // DateTimeOriginal 146 {0x9201, T_SRATIONAL, 1, (int)cam_apex_shutter}, // ShutterSpeedValue (APEX units) 147 {0x9202, T_RATIONAL, 1, (int)cam_apex_aperture}, // ApertureValue (APEX units) 148 {0x9204, T_SRATIONAL, 1, (int)cam_exp_bias}, // ExposureBias 149 {0x9205, T_RATIONAL, 1, (int)cam_max_av}, // MaxApertureValue 150 {0x9207, T_SHORT, 1, 0}, // Metering mode 151 {0x9209, T_SHORT, 1, 0}, // Flash mode 152 {0x920A, T_RATIONAL, 1, (int)cam_focal_length}, // FocalLength 153 {0xA405, T_SHORT|T_PTR,1, (int)&exif_data.effective_focal_length}, // FocalLengthIn35mmFilm 154 {0, T_END} 98 // Index of specific entries in ifd0 below. 99 // *** warning - if entries are added or removed these should be updated *** 100 #define CAMERA_NAME_INDEX 8 // tag 0x110 101 #define THUMB_DATA_INDEX 9 // tag 0x111 102 #define ORIENTATION_INDEX 10 // tag 0x112 103 #define SUBIFDS_INDEX 17 // tag 0x14A 104 #define EXIF_IFD_INDEX 19 // tag 0x8769 105 #define GPS_IFD_INDEX 20 // tag 0x8825 106 #define DNG_VERSION_INDEX 22 // tag 0xC612 107 #define UNIQUE_CAMERA_MODEL_INDEX 23 // tag 0xC614 108 109 struct dir_entry ifd0[]={ 110 {0xFE, T_LONG, 1, 1}, // NewSubFileType: Preview Image 111 {0x100, T_LONG, 1, DNG_TH_WIDTH}, // ImageWidth 112 {0x101, T_LONG, 1, DNG_TH_HEIGHT}, // ImageLength 113 {0x102, T_SHORT, 3, (int)cam_PreviewBitsPerSample}, // BitsPerSample: 8,8,8 114 {0x103, T_SHORT, 1, 1}, // Compression: Uncompressed 115 {0x106, T_SHORT, 1, 2}, // PhotometricInterpretation: RGB 116 {0x10E, T_ASCII, 1, 0}, // ImageDescription 117 {0x10F, T_ASCII, sizeof(CAM_MAKE), (int)CAM_MAKE}, // Make 118 {0x110, T_ASCII, 32, (int)cam_name}, // Model: Filled at header generation. 119 {0x111, T_LONG, 1, 0}, // StripOffsets: Offset 120 {0x112, T_SHORT, 1, 1}, // Orientation: 1 - 0th row is top, 0th column is left 121 {0x115, T_SHORT, 1, 3}, // SamplesPerPixel: 3 122 {0x116, T_SHORT, 1, DNG_TH_HEIGHT}, // RowsPerStrip 123 {0x117, T_LONG, 1, DNG_TH_WIDTH*DNG_TH_HEIGHT*3}, // StripByteCounts = preview size 124 {0x11C, T_SHORT, 1, 1}, // PlanarConfiguration: 1 125 {0x131, T_ASCII, sizeof(cam_chdk_ver), (int)cam_chdk_ver},//Software 126 {0x132, T_ASCII, 20, (int)cam_datetime}, // DateTime 127 {0x14A, T_LONG, 1, 0}, // SubIFDs offset 128 {0x8298, T_ASCII, 1, 0}, // Copyright 129 {0x8769, T_LONG, 1, 0}, // EXIF_IFD offset 130 {0x8825, T_LONG, 1, 0}, // GPS_IFD offset 131 {0x9216, T_BYTE, 4, 0x00000001}, // TIFF/EPStandardID: 1.0.0.0 132 {0xC612, T_BYTE, 4, 0x00000301}, // DNGVersion: 1.3.0.0 133 {0xC614, T_ASCII, 32, (int)cam_name}, // UniqueCameraModel. Filled at header generation. 134 {0xC621, T_SRATIONAL, 9, (int)&camera_sensor.color_matrix1}, 135 {0xC627, T_RATIONAL, 3, (int)cam_AnalogBalance}, 136 {0xC628, T_RATIONAL, 3, (int)cam_AsShotNeutral}, 137 {0xC62A, T_SRATIONAL, 1, (int)&camera_sensor.exposure_bias}, 138 {0xC62B, T_RATIONAL, 1, (int)cam_BaselineNoise}, 139 {0xC62C, T_RATIONAL, 1, (int)cam_BaselineSharpness}, 140 {0xC62E, T_RATIONAL, 1, (int)cam_LinearResponseLimit}, 141 {0xC630, T_RATIONAL, 4, (int)&camera_sensor.lens_info}, 142 {0xC65A, T_SHORT|T_PTR,1, (int)&camera_sensor.calibration_illuminant1}, 143 }; 144 145 // Index of specific entries in ifd1 below. 146 // *** warning - if entries are added or removed these should be updated *** 147 #define RAW_DATA_INDEX 6 // tag 0x111 148 #define BADPIXEL_OPCODE_INDEX 21 // tag 0xC740 149 150 struct dir_entry ifd1[]={ 151 {0xFE, T_LONG, 1, 0}, // NewSubFileType: Main Image 152 {0x100, T_LONG|T_PTR, 1, (int)&camera_sensor.raw_rowpix}, // ImageWidth 153 {0x101, T_LONG|T_PTR, 1, (int)&camera_sensor.raw_rows}, // ImageLength 154 {0x102, T_SHORT|T_PTR,1, (int)&camera_sensor.bits_per_pixel},// BitsPerSample 155 {0x103, T_SHORT, 1, 1}, // Compression: Uncompressed 156 {0x106, T_SHORT, 1, 0x8023}, //PhotometricInterpretation: CFA 157 {0x111, T_LONG, 1, 0}, //StripOffsets: Offset 158 {0x115, T_SHORT, 1, 1}, // SamplesPerPixel: 1 159 {0x116, T_SHORT|T_PTR,1, (int)&camera_sensor.raw_rows}, //RowsPerStrip 160 {0x117, T_LONG|T_PTR, 1, (int)&camera_sensor.raw_size}, // StripByteCounts = CHDK RAW size 161 {0x11A, T_RATIONAL, 1, (int)cam_Resolution}, // XResolution 162 {0x11B, T_RATIONAL, 1, (int)cam_Resolution}, // YResolution 163 {0x11C, T_SHORT, 1, 1}, // PlanarConfiguration: 1 164 {0x128, T_SHORT, 1, 2}, // ResolutionUnit: inch 165 {0x828D, T_SHORT, 2, 0x00020002}, // CFARepeatPatternDim: Rows = 2, Cols = 2 166 {0x828E, T_BYTE|T_PTR, 4, (int)&camera_sensor.cfa_pattern}, 167 {0xC61A, T_LONG|T_PTR, 1, (int)&camera_sensor.black_level}, // BlackLevel 168 {0xC61D, T_LONG|T_PTR, 1, (int)&camera_sensor.white_level}, // WhiteLevel 169 {0xC61F, T_LONG, 2, (int)&camera_sensor.crop.origin}, 170 {0xC620, T_LONG, 2, (int)&camera_sensor.crop.size}, 171 {0xC68D, T_LONG, 4, (int)&camera_sensor.dng_active_area}, 172 {0xC740, T_UNDEFINED|T_PTR, sizeof(badpixel_opcode), (int)&badpixel_opcode}, 173 }; 174 175 // Index of specific entries in exif_ifd below. 176 // *** warning - if entries are added or removed these should be updated *** 177 #define EXPOSURE_PROGRAM_INDEX 2 // tag 0x8822 178 #define METERING_MODE_INDEX 10 // tag 0x9207 179 #define FLASH_MODE_INDEX 11 // tag 0x9209 180 181 struct dir_entry exif_ifd[]={ 182 {0x829A, T_RATIONAL, 1, (int)cam_shutter}, // Shutter speed 183 {0x829D, T_RATIONAL, 1, (int)cam_aperture}, // Aperture 184 {0x8822, T_SHORT, 1, 0}, // ExposureProgram 185 {0x8827, T_SHORT|T_PTR,1, (int)&exif_data.iso}, // ISOSpeedRatings 186 {0x9000, T_UNDEFINED, 4, 0x31323230}, // ExifVersion: 2.21 187 {0x9003, T_ASCII, 20, (int)cam_datetime}, // DateTimeOriginal 188 {0x9201, T_SRATIONAL, 1, (int)cam_apex_shutter}, // ShutterSpeedValue (APEX units) 189 {0x9202, T_RATIONAL, 1, (int)cam_apex_aperture}, // ApertureValue (APEX units) 190 {0x9204, T_SRATIONAL, 1, (int)cam_exp_bias}, // ExposureBias 191 {0x9205, T_RATIONAL, 1, (int)cam_max_av}, // MaxApertureValue 192 {0x9207, T_SHORT, 1, 0}, // Metering mode 193 {0x9209, T_SHORT, 1, 0}, // Flash mode 194 {0x920A, T_RATIONAL, 1, (int)cam_focal_length}, // FocalLength 195 {0xA405, T_SHORT|T_PTR,1, (int)&exif_data.effective_focal_length}, // FocalLengthIn35mmFilm 155 196 }; 156 197 157 198 tGPS gps_data; 158 199 159 struct dir_entry GPS_IFD[]={ 160 {0x0000, T_BYTE, 4, 0x00000302}, //GPSVersionID: 2 3 0 0 161 {0x0001, T_ASCII, 2, (int)gps_data.latitudeRef}, //North or South Latitude "N\0" or "S\0" 162 {0x0002, T_RATIONAL, 3, (int)gps_data.latitude}, //Latitude 163 {0x0003, T_ASCII, 2, (int)gps_data.longitudeRef}, //East or West Latitude "E\0" or "W\0" 164 {0x0004, T_RATIONAL, 3, (int)gps_data.longitude}, //Longitude 165 {0x0005, T_BYTE, 1, (int)gps_data.heightRef}, //AltitudeRef 166 {0x0006, T_RATIONAL, 1, (int)gps_data.height}, //Altitude 167 {0x0007, T_RATIONAL, 3, (int)gps_data.timeStamp}, //TimeStamp 168 {0x0009, T_ASCII, 2, (int)gps_data.status}, //Status 169 //{0x000A, T_ASCII, 1, 0}, //MeasureMode 170 {0x0012, T_ASCII, 7, (int)gps_data.mapDatum}, //MapDatum 7 + 1 pad byte 171 {0x001D, T_ASCII, 11, (int)gps_data.dateStamp}, //DateStamp 11 + 1 pad byte 172 {0, T_END} 173 }; 174 175 176 int get_type_size(int type){ 177 switch(type & 0xFF){ 178 case T_BYTE: 179 case T_SBYTE: 180 case T_UNDEFINED: 181 case T_ASCII: return 1; 182 case T_SHORT: 183 case T_SSHORT: return 2; 184 case T_LONG: 185 case T_SLONG: 186 case T_FLOAT: return 4; 187 case T_RATIONAL: 188 case T_SRATIONAL: 189 case T_DOUBLE: return 8; 190 default: return 0; 191 } 192 } 193 194 struct {struct dir_entry* entry; int count;} IFD_LIST[]={{IFD0,0}, {IFD1,0}, {EXIF_IFD,0}, {GPS_IFD, 0}}; 195 196 #define IFDs (sizeof(IFD_LIST)/sizeof(IFD_LIST[0])) 200 struct dir_entry gpd_ifd[]={ 201 {0x0000, T_BYTE, 4, 0x00000302}, //GPSVersionID: 2 3 0 0 202 {0x0001, T_ASCII|T_PTR, 2, (int)gps_data.latitudeRef}, //North or South Latitude "N\0" or "S\0" 203 {0x0002, T_RATIONAL, 3, (int)gps_data.latitude}, //Latitude 204 {0x0003, T_ASCII|T_PTR, 2, (int)gps_data.longitudeRef}, //East or West Latitude "E\0" or "W\0" 205 {0x0004, T_RATIONAL, 3, (int)gps_data.longitude}, //Longitude 206 {0x0005, T_BYTE|T_PTR, 1, (int)&gps_data.heightRef}, //AltitudeRef 207 {0x0006, T_RATIONAL, 1, (int)gps_data.height}, //Altitude 208 {0x0007, T_RATIONAL, 3, (int)gps_data.timeStamp}, //TimeStamp 209 {0x0009, T_ASCII|T_PTR, 2, (int)gps_data.status}, //Status 210 //{0x000A, T_ASCII, 1, 0}, //MeasureMode 211 {0x0012, T_ASCII, 7, (int)gps_data.mapDatum}, //MapDatum 7 + 1 pad byte 212 {0x001D, T_ASCII, 11, (int)gps_data.dateStamp}, //DateStamp 11 + 1 pad byte 213 }; 214 215 int get_type_size(int type) 216 { 217 switch(type & 0xFF) 218 { 219 case T_BYTE: 220 case T_SBYTE: 221 case T_UNDEFINED: 222 case T_ASCII: return 1; 223 case T_SHORT: 224 case T_SSHORT: return 2; 225 case T_LONG: 226 case T_SLONG: 227 case T_FLOAT: return 4; 228 case T_RATIONAL: 229 case T_SRATIONAL: 230 case T_DOUBLE: return 8; 231 default: return 0; 232 } 233 } 234 235 #define DIR_SIZE(ifd) (sizeof(ifd)/sizeof(ifd[0])) 236 237 struct 238 { 239 struct dir_entry* entry; 240 int count; // Number of entries to be saved 241 int entry_count; // Total number of entries 242 } ifd_list[] = 243 { 244 {ifd0, DIR_SIZE(ifd0), DIR_SIZE(ifd0)}, 245 {ifd1, DIR_SIZE(ifd1), DIR_SIZE(ifd1)}, 246 {exif_ifd, DIR_SIZE(exif_ifd), DIR_SIZE(exif_ifd)}, 247 {gpd_ifd, DIR_SIZE(gpd_ifd), DIR_SIZE(gpd_ifd)} 248 }; 197 249 198 250 #define TIFF_HDR_SIZE (8) … … 205 257 void add_to_buf(void* var, int size) 206 258 { 207 memcpy(dng_header_buf+dng_header_buf_offset,var,size); 208 dng_header_buf_offset+=size; 259 memcpy(dng_header_buf+dng_header_buf_offset,var,size); 260 dng_header_buf_offset += size; 261 } 262 263 void add_val_to_buf(int val, int size) 264 { 265 add_to_buf(&val,size); 209 266 } 210 267 211 268 void create_dng_header(){ 212 int var; 213 int i,j; 214 int extra_offset; 215 int raw_offset; 216 217 // filling EXIF fields 218 219 gps_getData(&gps_data); 220 221 for (j=0;j<IFDs;j++) { 222 for(i=0; IFD_LIST[j].entry[i].type; i++) { 223 switch (IFD_LIST[j].entry[i].tag) { 224 // For camera name string make sure the 'count' in the IFD header is correct for the string 225 case 0x110 : // CameraName 226 case 0xC614: IFD_LIST[j].entry[i].count = strlen((char*)IFD_LIST[j].entry[i].offset) + 1; break; // UniqueCameraModel 227 case 0x132 : 228 case 0x8822: IFD_LIST[j].entry[i].offset=get_exp_program_for_exif(exif_data.exp_program); break;//ExposureProgram 229 case 0x0112: IFD_LIST[j].entry[i].offset=get_orientation_for_exif(exif_data.orientation); break; //Orientation 230 case 0x9209: IFD_LIST[j].entry[i].offset=get_flash_mode_for_exif(exif_data.flash_mode, exif_data.flash_fired); break; //Flash mode 231 case 0x9207: IFD_LIST[j].entry[i].offset=get_metering_mode_for_exif(exif_data.metering_mode); break; // Metering mode 232 } 233 } 234 } 235 236 // calculating offset of RAW data and count of directories for each IFD 237 238 raw_offset=TIFF_HDR_SIZE; 239 240 for (j=0;j<IFDs;j++) { 241 IFD_LIST[j].count=0; 242 raw_offset+=6; // IFD header+footer 243 for(i=0; IFD_LIST[j].entry[i].type; i++) { 244 int size_ext; 245 IFD_LIST[j].count++; 246 raw_offset+=12; // IFD directory size 247 size_ext=get_type_size(IFD_LIST[j].entry[i].type)*IFD_LIST[j].entry[i].count; 248 if (size_ext>4) raw_offset+=size_ext+(size_ext&1); 249 } 250 } 251 252 // creating buffer for writing data 253 raw_offset=(raw_offset/512+1)*512; // exlusively for CHDK fast file writing 254 dng_header_buf_size=raw_offset; 255 dng_header_buf=umalloc(raw_offset); 256 dng_header_buf_offset=0; 257 if (!dng_header_buf) return; 258 259 // create buffer for thumbnail 260 thumbnail_buf = malloc(DNG_TH_WIDTH*DNG_TH_HEIGHT*3); 261 if (!thumbnail_buf) 262 { 263 ufree(dng_header_buf); 264 dng_header_buf = 0; 265 return; 266 } 267 268 // writing offsets for EXIF IFD and RAW data and calculating offset for extra data 269 270 extra_offset=TIFF_HDR_SIZE; 271 272 for (j=0;j<IFDs;j++) { 273 extra_offset+=6+IFD_LIST[j].count*12; // IFD header+footer 274 for(i=0; IFD_LIST[j].entry[i].type; i++) { 275 if (IFD_LIST[j].entry[i].tag==0x8769) IFD_LIST[j].entry[i].offset=TIFF_HDR_SIZE+(IFD_LIST[0].count+IFD_LIST[1].count)*12+6+6; // EXIF IFD offset 276 if (IFD_LIST[j].entry[i].tag==0x8825) IFD_LIST[j].entry[i].offset=TIFF_HDR_SIZE+(IFD_LIST[0].count+IFD_LIST[1].count+IFD_LIST[2].count)*12+6+6+6; // GPS IFD offset 277 if (IFD_LIST[j].entry[i].tag==0x14A) IFD_LIST[j].entry[i].offset=TIFF_HDR_SIZE+IFD_LIST[0].count*12+6; // SubIFDs offset 278 if (IFD_LIST[j].entry[i].tag==0x111) { 279 if (j==1) IFD_LIST[j].entry[i].offset=raw_offset+DNG_TH_WIDTH*DNG_TH_HEIGHT*3; //StripOffsets for main image 280 if (j==0) IFD_LIST[j].entry[i].offset=raw_offset; //StripOffsets for thumbnail 281 } 282 } 283 } 284 285 // TIFF file header 286 287 var=0x4949; // little endian 288 add_to_buf(&var, sizeof(short)); 289 var=42; //An arbitrary but carefully chosen number that further identifies the file as a TIFF file. 290 add_to_buf(&var, sizeof(short)); 291 var=0x8; // offset of first IFD 292 add_to_buf(&var, sizeof(int)); 293 294 295 // writing IFDs 296 297 for (j=0;j<IFDs;j++) { 298 int size_ext; 299 var=IFD_LIST[j].count; 300 add_to_buf(&var, sizeof(short)); 301 for(i=0; IFD_LIST[j].entry[i].type; i++) { 302 add_to_buf(&IFD_LIST[j].entry[i].tag, sizeof(short)); 303 unsigned short t = IFD_LIST[j].entry[i].type & 0xFF; 304 add_to_buf(&t, sizeof(short)); 305 add_to_buf(&IFD_LIST[j].entry[i].count, sizeof(int)); 306 size_ext=get_type_size(IFD_LIST[j].entry[i].type)*IFD_LIST[j].entry[i].count; 307 if (size_ext<=4) 308 { 309 if (IFD_LIST[j].entry[i].type & T_PTR) 269 int i,j; 270 int extra_offset; 271 int raw_offset; 272 273 // Set version and opcodes 274 if (conf.dng_version) 275 { 276 // If CHDK is removing bad pixels then set DNG version to 1.1 and remove opcodes 277 ifd0[DNG_VERSION_INDEX].offset = BE(0x01010000); 278 ifd1[BADPIXEL_OPCODE_INDEX].type |= T_SKIP; 279 ifd_list[1].count = DIR_SIZE(ifd1) - 1; 280 } 281 else 282 { 283 // Set DNG version to 1.3 and add bad pixel opcodes 284 ifd0[DNG_VERSION_INDEX].offset = BE(0x01030000); 285 ifd1[BADPIXEL_OPCODE_INDEX].type &= ~T_SKIP; 286 ifd_list[1].count = DIR_SIZE(ifd1); 287 } 288 289 // filling EXIF fields 290 291 int ifd_count = DIR_SIZE(ifd_list); 292 293 if (camera_info.props.gps) 294 { 295 // If camera has GPS get the GPS data 296 gps_getData(&gps_data); 297 } 298 else 299 { 300 // If no GPS then remove the GPS data from the header - assumes gps_ifd is the last one in ifd_list 301 ifd_count--; 302 ifd_list[0].count = DIR_SIZE(ifd0) - 1; // Entry 0x8825 won't be saved so don't count it 303 ifd0[GPS_IFD_INDEX].type |= T_SKIP; // mark entry so it is skipped 304 } 305 306 // Fix the counts and offsets where needed 307 308 ifd0[CAMERA_NAME_INDEX].count = ifd0[UNIQUE_CAMERA_MODEL_INDEX].count = strlen(cam_name) + 1; 309 ifd0[ORIENTATION_INDEX].offset = get_orientation_for_exif(exif_data.orientation); 310 311 exif_ifd[EXPOSURE_PROGRAM_INDEX].offset = get_exp_program_for_exif(exif_data.exp_program); 312 exif_ifd[METERING_MODE_INDEX].offset = get_metering_mode_for_exif(exif_data.metering_mode); 313 exif_ifd[FLASH_MODE_INDEX].offset = get_flash_mode_for_exif(exif_data.flash_mode, exif_data.flash_fired); 314 315 // calculating offset of RAW data and count of entries for each IFD 316 raw_offset=TIFF_HDR_SIZE; 317 318 for (j=0;j<ifd_count;j++) 319 { 320 raw_offset+=6; // IFD header+footer 321 for(i=0; i<ifd_list[j].entry_count; i++) 310 322 { 311 add_to_buf((void*)IFD_LIST[j].entry[i].offset, sizeof(int)); 323 if ((ifd_list[j].entry[i].type & T_SKIP) == 0) // Exclude skipped entries (e.g. GPS info if camera doesn't have GPS) 324 { 325 raw_offset+=12; // IFD directory entry size 326 int size_ext=get_type_size(ifd_list[j].entry[i].type)*ifd_list[j].entry[i].count; 327 if (size_ext>4) raw_offset+=size_ext+(size_ext&1); 328 } 312 329 } 313 else 330 } 331 332 // creating buffer for writing data 333 raw_offset=(raw_offset/512+1)*512; // exlusively for CHDK fast file writing 334 dng_header_buf_size=raw_offset; 335 dng_header_buf=umalloc(raw_offset); 336 dng_header_buf_offset=0; 337 if (!dng_header_buf) return; 338 339 // create buffer for thumbnail 340 thumbnail_buf = malloc(DNG_TH_WIDTH*DNG_TH_HEIGHT*3); 341 if (!thumbnail_buf) 342 { 343 ufree(dng_header_buf); 344 dng_header_buf = 0; 345 return; 346 } 347 348 // writing offsets for EXIF IFD and RAW data and calculating offset for extra data 349 350 extra_offset=TIFF_HDR_SIZE; 351 352 ifd0[SUBIFDS_INDEX].offset = TIFF_HDR_SIZE + ifd_list[0].count * 12 + 6; // SubIFDs offset 353 ifd0[EXIF_IFD_INDEX].offset = TIFF_HDR_SIZE + (ifd_list[0].count + ifd_list[1].count) * 12 + 6 + 6; // EXIF IFD offset 354 if (camera_info.props.gps) 355 ifd0[GPS_IFD_INDEX].offset = TIFF_HDR_SIZE + (ifd_list[0].count + ifd_list[1].count + ifd_list[2].count) * 12 + 6 + 6 + 6; // GPS IFD offset 356 357 ifd0[THUMB_DATA_INDEX].offset = raw_offset; //StripOffsets for thumbnail 358 ifd1[RAW_DATA_INDEX].offset = raw_offset + DNG_TH_WIDTH * DNG_TH_HEIGHT * 3; //StripOffsets for main image 359 360 for (j=0;j<ifd_count;j++) 361 { 362 extra_offset += 6 + ifd_list[j].count * 12; // IFD header+footer 363 } 364 365 // TIFF file header 366 367 add_val_to_buf(0x4949, sizeof(short)); // little endian 368 add_val_to_buf(42, sizeof(short)); // An arbitrary but carefully chosen number that further identifies the file as a TIFF file. 369 add_val_to_buf(TIFF_HDR_SIZE, sizeof(int)); // offset of first IFD 370 371 // writing IFDs 372 373 for (j=0;j<ifd_count;j++) 374 { 375 int size_ext; 376 add_val_to_buf(ifd_list[j].count, sizeof(short)); 377 for(i=0; i<ifd_list[j].entry_count; i++) 314 378 { 315 add_to_buf(&IFD_LIST[j].entry[i].offset, sizeof(int)); 379 if ((ifd_list[j].entry[i].type & T_SKIP) == 0) 380 { 381 add_val_to_buf(ifd_list[j].entry[i].tag, sizeof(short)); 382 add_val_to_buf(ifd_list[j].entry[i].type & 0xFF, sizeof(short)); 383 add_val_to_buf(ifd_list[j].entry[i].count, sizeof(int)); 384 size_ext=get_type_size(ifd_list[j].entry[i].type)*ifd_list[j].entry[i].count; 385 if (size_ext<=4) 386 { 387 if (ifd_list[j].entry[i].type & T_PTR) 388 { 389 add_to_buf((void*)ifd_list[j].entry[i].offset, sizeof(int)); 390 } 391 else 392 { 393 add_val_to_buf(ifd_list[j].entry[i].offset, sizeof(int)); 394 } 395 } 396 else 397 { 398 add_val_to_buf(extra_offset, sizeof(int)); 399 extra_offset += size_ext+(size_ext&1); 400 } 401 } 316 402 } 317 } 318 else 319 { 320 add_to_buf(&extra_offset, sizeof(int)); 321 extra_offset+=size_ext+(size_ext&1); 322 } 323 } 324 var=0; 325 add_to_buf(&var, sizeof(int)); 326 } 327 328 329 // writing extra data 330 331 for (j=0;j<IFDs;j++) { 332 int size_ext; 333 char zero=0; 334 for(i=0; IFD_LIST[j].entry[i].type; i++) { 335 size_ext=get_type_size(IFD_LIST[j].entry[i].type)*IFD_LIST[j].entry[i].count; 336 if (size_ext>4){ 337 add_to_buf((void*)IFD_LIST[j].entry[i].offset, size_ext); 338 if (size_ext&1) add_to_buf(&zero, 1); 339 } 340 } 341 } 342 343 // writing zeros to tail of dng header (just for fun) 344 for (i=dng_header_buf_offset; i<dng_header_buf_size; i++) dng_header_buf[i]=0; 403 add_val_to_buf(0, sizeof(int)); 404 } 405 406 // writing extra data 407 408 for (j=0;j<ifd_count;j++) 409 { 410 int size_ext; 411 for(i=0; i<ifd_list[j].entry_count; i++) 412 { 413 if ((ifd_list[j].entry[i].type & T_SKIP) == 0) 414 { 415 size_ext=get_type_size(ifd_list[j].entry[i].type)*ifd_list[j].entry[i].count; 416 if (size_ext>4) 417 { 418 add_to_buf((void*)ifd_list[j].entry[i].offset, size_ext); 419 if (size_ext&1) add_val_to_buf(0, 1); 420 } 421 } 422 } 423 } 424 425 // writing zeros to tail of dng header (just for fun) 426 for (i=dng_header_buf_offset; i<dng_header_buf_size; i++) dng_header_buf[i]=0; 345 427 } 346 428 … … 359 441 } 360 442 361 unsigned short get_exp_program_for_exif(int exp_program){ 362 switch(exp_program){ 363 case MODE_M: return 1; 364 case MODE_P: return 2; 365 case MODE_AV: return 3; 366 case MODE_TV: return 4; 367 default: return 0; 368 } 369 } 370 371 unsigned short get_orientation_for_exif(short orientation){ 372 switch(orientation){ 373 case 90: return 6; // Right - Top 374 case 180: return 3; // Bottom - Right 375 case 270: return 8; // Left - Bottom 376 case 0: // Top - Left 377 default : return 1; 378 } 443 unsigned short get_exp_program_for_exif(int exp_program) 444 { 445 switch(exp_program) 446 { 447 case MODE_M: return 1; 448 case MODE_P: return 2; 449 case MODE_AV: return 3; 450 case MODE_TV: return 4; 451 default: return 0; 452 } 453 } 454 455 unsigned short get_orientation_for_exif(short orientation) 456 { 457 switch(orientation) 458 { 459 case 90: return 6; // Right - Top 460 case 180: return 3; // Bottom - Right 461 case 270: return 8; // Left - Bottom 462 case 0: // Top - Left 463 default : return 1; 464 } 379 465 } 380 466 381 467 unsigned short get_flash_mode_for_exif(short mode, short fired){ 382 fired&=1; 383 switch(mode){ 384 case 0: return (3<<3)|fired; // auto 385 case 1: return (1<<3)|fired; // on 386 case 2: return (2<<3)|fired; // off 387 default: return fired; 388 }; 389 } 390 391 unsigned short get_metering_mode_for_exif(short metering_mode){ 392 switch (metering_mode){ 393 case 0: return 5; // Evaluative 394 case 1: return 3; // Spot 395 case 2: return 2; // CenterWeightedAverage 396 default: return 255; // other 397 } 468 fired&=1; 469 switch(mode) 470 { 471 case 0: return (3<<3)|fired; // auto 472 case 1: return (1<<3)|fired; // on 473 case 2: return (2<<3)|fired; // off 474 default: return fired; 475 }; 476 } 477 478 unsigned short get_metering_mode_for_exif(short metering_mode) 479 { 480 switch (metering_mode) 481 { 482 case 0: return 5; // Evaluative 483 case 1: return 3; // Spot 484 case 2: return 2; // CenterWeightedAverage 485 default: return 255; // other 486 } 398 487 } 399 488 400 489 void capture_data_for_exif(void) 401 490 { 402 short short_prop_val;403 time_t datetime;404 struct tm *ttm;405 extern volatile long shutter_open_time; // defined in platform/generic/capt_seq.c406 int wb[3];407 408 exif_data.iso=shooting_get_iso_market();409 410 // Shutter speed tags411 get_property_case(camera_info.props.tv, &short_prop_val, sizeof(short_prop_val));412 cam_shutter[0] = pow_calc( 1000000, 2, 1, -short_prop_val, 96);413 cam_apex_shutter[0] = short_prop_val;414 415 // Date & time tag (note - uses shutter speed from 'short_prop_val' code above)416 if (shutter_open_time) { datetime = shutter_open_time + pow_calc(1, 2, 1, -short_prop_val, 96); shutter_open_time=0;} // shutter closing time417 else datetime = time(NULL);418 ttm = localtime(&datetime);419 sprintf(cam_datetime, "%04d:%02d:%02d %02d:%02d:%02d", ttm->tm_year+1900, ttm->tm_mon+1, ttm->tm_mday, ttm->tm_hour, ttm->tm_min, ttm->tm_sec);420 421 get_property_case(camera_info.props.av, &short_prop_val, sizeof(short_prop_val));422 cam_aperture[0] = pow_calc( 10, 2, 1, short_prop_val, 192);423 cam_apex_aperture[0] = short_prop_val;424 425 get_property_case(camera_info.props.min_av, &short_prop_val, sizeof(short_prop_val));426 cam_max_av[0] = short_prop_val;427 428 get_property_case(camera_info.props.ev_correction_2, &short_prop_val, sizeof(short_prop_val));429 cam_exp_bias[0] = short_prop_val;430 431 exif_data.exp_program=mode_get() & MODE_SHOOTING_MASK;432 433 cam_focal_length[0] = get_focal_length(shooting_get_zoom());434 exif_data.effective_focal_length = get_effective_focal_length(shooting_get_zoom()) / 1000;435 436 get_property_case(camera_info.props.orientation_sensor, &exif_data.orientation, sizeof(exif_data.orientation));437 get_parameter_data(camera_info.params.camera_name, &cam_name, sizeof(cam_name));438 get_property_case(camera_info.props.flash_mode, &exif_data.flash_mode, sizeof(exif_data.flash_mode));439 get_property_case(camera_info.props.flash_fire, &exif_data.flash_fired, sizeof(exif_data.flash_fired));440 get_property_case(camera_info.props.metering_mode, &exif_data.metering_mode, sizeof(exif_data.metering_mode));441 442 get_property_case(camera_info.props.wb_adj, &wb, sizeof(wb));443 cam_AsShotNeutral[1]=wb[1];444 cam_AsShotNeutral[3]=wb[0];445 cam_AsShotNeutral[5]=wb[2];491 short short_prop_val; 492 time_t datetime; 493 struct tm *ttm; 494 extern volatile long shutter_open_time; // defined in platform/generic/capt_seq.c 495 int wb[3]; 496 497 exif_data.iso=shooting_get_iso_market(); 498 499 // Shutter speed tags 500 get_property_case(camera_info.props.tv, &short_prop_val, sizeof(short_prop_val)); 501 cam_shutter[0] = pow_calc( 1000000, 2, 1, -short_prop_val, 96); 502 cam_apex_shutter[0] = short_prop_val; 503 504 // Date & time tag (note - uses shutter speed from 'short_prop_val' code above) 505 if (shutter_open_time) { datetime = shutter_open_time + pow_calc(1, 2, 1, -short_prop_val, 96); shutter_open_time=0;} // shutter closing time 506 else datetime = time(NULL); 507 ttm = localtime(&datetime); 508 sprintf(cam_datetime, "%04d:%02d:%02d %02d:%02d:%02d", ttm->tm_year+1900, ttm->tm_mon+1, ttm->tm_mday, ttm->tm_hour, ttm->tm_min, ttm->tm_sec); 509 510 get_property_case(camera_info.props.av, &short_prop_val, sizeof(short_prop_val)); 511 cam_aperture[0] = pow_calc( 10, 2, 1, short_prop_val, 192); 512 cam_apex_aperture[0] = short_prop_val; 513 514 get_property_case(camera_info.props.min_av, &short_prop_val, sizeof(short_prop_val)); 515 cam_max_av[0] = short_prop_val; 516 517 get_property_case(camera_info.props.ev_correction_2, &short_prop_val, sizeof(short_prop_val)); 518 cam_exp_bias[0] = short_prop_val; 519 520 exif_data.exp_program=mode_get() & MODE_SHOOTING_MASK; 521 522 cam_focal_length[0] = get_focal_length(shooting_get_zoom()); 523 exif_data.effective_focal_length = get_effective_focal_length(shooting_get_zoom()) / 1000; 524 525 get_property_case(camera_info.props.orientation_sensor, &exif_data.orientation, sizeof(exif_data.orientation)); 526 get_parameter_data(camera_info.params.camera_name, &cam_name, sizeof(cam_name)); 527 get_property_case(camera_info.props.flash_mode, &exif_data.flash_mode, sizeof(exif_data.flash_mode)); 528 get_property_case(camera_info.props.flash_fire, &exif_data.flash_fired, sizeof(exif_data.flash_fired)); 529 get_property_case(camera_info.props.metering_mode, &exif_data.metering_mode, sizeof(exif_data.metering_mode)); 530 531 get_property_case(camera_info.props.wb_adj, &wb, sizeof(wb)); 532 cam_AsShotNeutral[1]=wb[1]; 533 cam_AsShotNeutral[3]=wb[0]; 534 cam_AsShotNeutral[5]=wb[2]; 446 535 } 447 536 448 537 //------------------------------------------------------------------- 449 538 450 void convert_dng_to_chdk_raw(char* fn){ 451 #define BUF_SIZE (32768) 452 FILE *dng, *raw; 453 int *buf; 454 int i; 455 struct STD_stat st; 456 struct utimbuf t; 457 458 if (safe_stat(fn, &st) != 0 || st.st_size<=camera_sensor.raw_size) return; 459 buf=malloc(BUF_SIZE); 460 if (buf){ 461 started(); 462 dng=fopen(fn,"rb"); 463 if (dng){ 464 fread(buf, 1, 8, dng); 465 if (buf[0]==0x2A4949 && buf[1]==8) { // chdk dng header 466 i=strlen(fn)-3; 467 if (strncmp(fn+i,"CR",2)==0) strcpy(fn+i,"WAV"); else strcpy(fn+i,"CRW"); 468 raw=fopen(fn,"w+b"); 469 if (raw){ 470 fseek(dng, st.st_size-camera_sensor.raw_size, SEEK_SET); // SEEK_END is not working? 471 for (i=0; i<camera_sensor.raw_size/BUF_SIZE; i++) { 472 fread(buf, 1, BUF_SIZE, dng); 473 reverse_bytes_order((char*)buf, BUF_SIZE); 474 fwrite(buf, 1, BUF_SIZE, raw); 475 } 476 fread(buf, 1, camera_sensor.raw_size%BUF_SIZE, dng); 477 reverse_bytes_order((char*)buf, camera_sensor.raw_size%BUF_SIZE); 478 fwrite(buf, 1, camera_sensor.raw_size%BUF_SIZE, raw); 479 fclose(raw); 480 t.actime = t.modtime = time(NULL); 481 utime(fn, &t); 482 } // if (raw) 483 } // if chdk dng header 484 fclose(dng); 485 } //if (dng) 486 free(buf); 487 finished(); 488 } //if (buf) 539 void convert_dng_to_chdk_raw(char* fn) 540 { 541 #define BUF_SIZE (32768) 542 FILE *dng, *raw; 543 int *buf; 544 int i; 545 struct STD_stat st; 546 struct utimbuf t; 547 548 if (safe_stat(fn, &st) != 0 || st.st_size<=camera_sensor.raw_size) return; 549 buf=malloc(BUF_SIZE); 550 if (buf) 551 { 552 started(); 553 dng=fopen(fn,"rb"); 554 if (dng) 555 { 556 fread(buf, 1, 8, dng); 557 if (buf[0]==0x2A4949 && buf[1]==8) 558 { // chdk dng header 559 i=strlen(fn)-3; 560 if (strncmp(fn+i,"CR",2)==0) strcpy(fn+i,"WAV"); else strcpy(fn+i,"CRW"); 561 raw=fopen(fn,"w+b"); 562 if (raw){ 563 fseek(dng, st.st_size-camera_sensor.raw_size, SEEK_SET); // SEEK_END is not working? 564 for (i=0; i<camera_sensor.raw_size/BUF_SIZE; i++) 565 { 566 fread(buf, 1, BUF_SIZE, dng); 567 reverse_bytes_order((char*)buf, BUF_SIZE); 568 fwrite(buf, 1, BUF_SIZE, raw); 569 } 570 fread(buf, 1, camera_sensor.raw_size%BUF_SIZE, dng); 571 reverse_bytes_order((char*)buf, camera_sensor.raw_size%BUF_SIZE); 572 fwrite(buf, 1, camera_sensor.raw_size%BUF_SIZE, raw); 573 fclose(raw); 574 t.actime = t.modtime = time(NULL); 575 utime(fn, &t); 576 } // if (raw) 577 } // if chdk dng header 578 fclose(dng); 579 } //if (dng) 580 free(buf); 581 finished(); 582 } //if (buf) 489 583 } 490 584 … … 494 588 static unsigned char gamma[256]; 495 589 496 void fill_gamma_buf(void) { 590 void fill_gamma_buf(void) 591 { 497 592 int i; 498 593 if (gamma[255]) return; … … 502 597 } 503 598 504 void create_thumbnail() { 599 void create_thumbnail() 600 { 505 601 register int i, j, x, y, yadj, xadj; 506 602 register char *buf = thumbnail_buf; … … 541 637 int init_badpixel_bin_flag; // contants above to count/create file, > 0 num bad pixel 542 638 543 int raw_init_badpixel_bin() { 639 int raw_init_badpixel_bin() 640 { 544 641 int count; 545 642 unsigned short c[2]; 546 643 FILE*f; 547 if(init_badpixel_bin_flag == INIT_BADPIXEL_FILE) { 644 if(init_badpixel_bin_flag == INIT_BADPIXEL_FILE) 645 { 548 646 f=fopen(PATH_BAD_TMP_BIN,"w+b"); 549 } else if (init_badpixel_bin_flag == INIT_BADPIXEL_COUNT) { 647 } 648 else if (init_badpixel_bin_flag == INIT_BADPIXEL_COUNT) 649 { 550 650 f=NULL; 551 } else { 651 } 652 else 653 { 552 654 return 0; 553 655 } … … 579 681 int binary_count=-1; 580 682 581 void load_bad_pixels_list_b(char* filename) { 683 void load_bad_pixels_list_b(char* filename) 684 { 582 685 struct STD_stat st; 583 686 long filesize; … … 585 688 FILE *fd; 586 689 587 if ( filename==0 ) 588 { unload_bad_pixels_list_b(); return; } 690 if ( filename==0 ) 691 { 692 unload_bad_pixels_list_b(); 693 return; 694 } 589 695 590 696 binary_count=-1; … … 592 698 filesize=st.st_size; 593 699 if (filesize%(2*sizeof(short)) != 0) return; 594 if (filesize == 0) { binary_count = 0; return; }// Allow empty badpixel.bin file700 if (filesize == 0) { binary_count = 0; return; } // Allow empty badpixel.bin file 595 701 ptr=malloc(filesize); 596 702 if (!ptr) return; 597 703 fd=fopen(filename, "rb"); 598 if (fd) { 704 if (fd) 705 { 599 706 fread(ptr,1, filesize,fd); 600 707 fclose(fd); … … 605 712 } 606 713 607 void unload_bad_pixels_list_b(void) { 714 void unload_bad_pixels_list_b(void) 715 { 608 716 if (binary_list) free(binary_list); 609 717 binary_list=NULL; … … 611 719 } 612 720 613 void patch_bad_pixels_b(void) { 721 void patch_bad_pixels_b(void) 722 { 614 723 int i; 615 724 short* ptr=binary_list; … … 626 735 627 736 int badpixel_list_loaded_b(void) { 628 return (binary_count >= 0) ? 1 : 0;737 return (binary_count >= 0) ? 1 : 0; 629 738 } 630 739 … … 637 746 }; 638 747 639 int badpixel_task_stack(long p) { 748 int badpixel_task_stack(long p) 749 { 640 750 static unsigned int badpix_cnt1; 641 751 642 switch(p) { 643 case BADPIX_START: 644 action_pop(); 645 646 console_clear(); 647 console_add_line("Wait please... "); 648 console_add_line("This takes a few seconds,"); 649 console_add_line("don't panic!"); 650 651 init_badpixel_bin_flag = INIT_BADPIXEL_COUNT; 652 653 shooting_set_tv96_direct(96, SET_LATER); 654 action_push(BADPIX_S1); 655 action_push(AS_SHOOT); 656 action_push_delay(3000); 657 break; 658 case BADPIX_S1: 659 action_pop(); 660 661 badpix_cnt1 = init_badpixel_bin_flag; 662 init_badpixel_bin_flag = INIT_BADPIXEL_FILE; 663 shooting_set_tv96_direct(96, SET_LATER); 664 665 action_push(BADPIX_S2); 666 action_push(AS_SHOOT); 667 break; 668 case BADPIX_S2: 669 action_pop(); 670 671 console_clear(); 672 if (badpix_cnt1 == init_badpixel_bin_flag) { 673 // TODO script asked confirmation first 674 // should sanity check bad pixel count at least, 675 // wrong buffer address could make badpixel bigger than available mem 676 char msg[32]; 677 console_add_line("badpixel.bin created."); 678 sprintf(msg, "Bad pixel count: %d", badpix_cnt1); 679 console_add_line(msg); 680 remove(PATH_BADPIXEL_BIN); 681 rename(PATH_BAD_TMP_BIN,PATH_BADPIXEL_BIN); 682 } else { 683 console_add_line("badpixel.bin failed."); 684 console_add_line("Please try again."); 685 } 686 init_badpixel_bin_flag = 0; 687 remove(PATH_BAD_TMP_BIN); 688 689 action_push_delay(3000); 690 break; 691 default: 692 action_stack_standard(p); 693 break; 752 switch(p) 753 { 754 case BADPIX_START: 755 action_pop(); 756 757 console_clear(); 758 console_add_line("Wait please... "); 759 console_add_line("This takes a few seconds,"); 760 console_add_line("don't panic!"); 761 762 init_badpixel_bin_flag = INIT_BADPIXEL_COUNT; 763 764 shooting_set_tv96_direct(96, SET_LATER); 765 action_push(BADPIX_S1); 766 action_push(AS_SHOOT); 767 action_push_delay(3000); 768 break; 769 case BADPIX_S1: 770 action_pop(); 771 772 badpix_cnt1 = init_badpixel_bin_flag; 773 init_badpixel_bin_flag = INIT_BADPIXEL_FILE; 774 shooting_set_tv96_direct(96, SET_LATER); 775 776 action_push(BADPIX_S2); 777 action_push(AS_SHOOT); 778 break; 779 case BADPIX_S2: 780 action_pop(); 781 782 console_clear(); 783 if (badpix_cnt1 == init_badpixel_bin_flag) 784 { 785 // TODO script asked confirmation first 786 // should sanity check bad pixel count at least, 787 // wrong buffer address could make badpixel bigger than available mem 788 char msg[32]; 789 console_add_line("badpixel.bin created."); 790 sprintf(msg, "Bad pixel count: %d", badpix_cnt1); 791 console_add_line(msg); 792 remove(PATH_BADPIXEL_BIN); 793 rename(PATH_BAD_TMP_BIN,PATH_BADPIXEL_BIN); 794 } 795 else 796 { 797 console_add_line("badpixel.bin failed."); 798 console_add_line("Please try again."); 799 } 800 init_badpixel_bin_flag = 0; 801 remove(PATH_BAD_TMP_BIN); 802 803 action_push_delay(3000); 804 break; 805 default: 806 action_stack_standard(p); 807 break; 694 808 } 695 809 … … 698 812 699 813 700 void create_badpixel_bin() { 701 if (!(mode_get() & MODE_REC)) { 814 void create_badpixel_bin() 815 { 816 if (!(mode_get() & MODE_REC)) 817 { 702 818 gui_mbox_init(LANG_ERROR, LANG_MSG_RECMODE_REQUIRED, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); 703 819 return; … … 713 829 void write_dng(int fd, char* rawadr, char* altrawadr, unsigned long uncachedbit) 714 830 { 715 create_dng_header();831 create_dng_header(); 716 832 717 833 if (dng_header_buf) 718 834 { 719 835 fill_gamma_buf(); 720 patch_bad_pixels_b(); 836 if (conf.dng_version) 837 patch_bad_pixels_b(); 721 838 create_thumbnail(); 722 839 write(fd, dng_header_buf, dng_header_buf_size); … … 729 846 730 847 if (rawadr == altrawadr) // If only one RAW buffer then we have to swap the bytes back 731 reverse_bytes_order2(rawadr, altrawadr, camera_sensor.raw_size);848 reverse_bytes_order2(rawadr, altrawadr, camera_sensor.raw_size); 732 849 733 850 free_dng_header(); … … 740 857 741 858 struct libdng_sym libdng = { 742 MAKE_API_VERSION(1,0),// apiver: increase major if incompatible changes made in module,743 // increase minor if compatible changes made(including extending this struct)744 745 create_badpixel_bin,746 raw_init_badpixel_bin,747 capture_data_for_exif,748 load_bad_pixels_list_b,749 badpixel_list_loaded_b,750 751 convert_dng_to_chdk_raw,752 write_dng753 };859 MAKE_API_VERSION(1,0), // apiver: increase major if incompatible changes made in module, 860 // increase minor if compatible changes made(including extending this struct) 861 862 create_badpixel_bin, 863 raw_init_badpixel_bin, 864 capture_data_for_exif, 865 load_bad_pixels_list_b, 866 badpixel_list_loaded_b, 867 868 convert_dng_to_chdk_raw, 869 write_dng 870 }; 754 871 755 872 756 873 //------------------------------------------- 757 874 void* MODULE_EXPORT_LIST[] = { 758 /* 0 */(void*)EXPORTLIST_MAGIC_NUMBER,759 /* 1 */(void*)1,760 761 &libdng762 };875 /* 0 */ (void*)EXPORTLIST_MAGIC_NUMBER, 876 /* 1 */ (void*)1, 877 878 &libdng 879 }; 763 880 764 881 //-------------------------------------------- 765 882 int _module_loader( unsigned int* chdk_export_list ) 766 883 { 767 if ( chdk_export_list[0] != EXPORTLIST_MAGIC_NUMBER )768 return 1;769 770 if ( !API_VERSION_MATCH_REQUIREMENT( camera_sensor.api_version, 1, 0 ) )771 return 1;772 if ( !API_VERSION_MATCH_REQUIREMENT( camera_info.api_version, 1, 0 ) )773 return 1;774 775 return 0;884 if ( chdk_export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 885 return 1; 886 887 if ( !API_VERSION_MATCH_REQUIREMENT( camera_sensor.api_version, 1, 0 ) ) 888 return 1; 889 if ( !API_VERSION_MATCH_REQUIREMENT( camera_info.api_version, 1, 0 ) ) 890 return 1; 891 892 return 0; 776 893 } 777 894 … … 783 900 int _module_unloader() 784 901 { 785 786 unload_bad_pixels_list_b(); 902 unload_bad_pixels_list_b(); 787 903 free_dng_header(); 788 904 return 0; … … 792 908 /******************** Module Information structure ******************/ 793 909 794 struct ModuleInfo _module_info = { MODULEINFO_V1_MAGICNUM,795 sizeof(struct ModuleInfo),796 797 ANY_CHDK_BRANCH, 0,// Requirements of CHDK version798 PLATFORMID,// Specify platform dependency799 MODULEINFO_FLAG_SYSTEM,// flag800 (int32_t)"DNG (dll)",// Module name801 1, 0,// Module version802 (int32_t)"Processing of DNG"803 };910 struct ModuleInfo _module_info = { MODULEINFO_V1_MAGICNUM, 911 sizeof(struct ModuleInfo), 912 913 ANY_CHDK_BRANCH, 0, // Requirements of CHDK version 914 PLATFORMID, // Specify platform dependency 915 MODULEINFO_FLAG_SYSTEM, // flag 916 (int32_t)"DNG (dll)", // Module name 917 1, 0, // Module version 918 (int32_t)"Processing of DNG" 919 }; 804 920 805 921 -
branches/reyalp-ptp-live/core/gui.c
r1813 r1814 237 237 #if DNG_SUPPORT 238 238 static void cb_change_dng(); 239 static const char* gui_dng_version(int change, int arg); 239 240 void gui_menuproc_badpixel_create(int arg); 240 241 #endif … … 494 495 #if CAM_ADJUSTABLE_ALT_BUTTON 495 496 MENU_ITEM(0x22,LANG_MENU_MISC_ALT_BUTTON, MENUITEM_ENUM, gui_alt_mode_button_enum, 0 ), 497 #endif 498 #if defined(CAM_ZOOM_ASSIST_BUTTON_CONTROL) 499 MENU_ITEM (0x5c,LANG_MENU_MISC_ZOOM_ASSIST, MENUITEM_BOOL, &conf.zoom_assist_button_disable, 0 ), 496 500 #endif 497 501 MENU_ITEM(0x5d,LANG_MENU_MISC_DISABLE_LCD_OFF, MENUITEM_ENUM, gui_alt_power_enum, 0 ), … … 860 864 static CMenuItem raw_submenu_items[] = { 861 865 #if DNG_SUPPORT 862 MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE,MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.save_raw, (int)cb_change_dng ),866 MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.save_raw, (int)cb_change_dng ), 863 867 #else 864 MENU_ITEM(0x5c,LANG_MENU_RAW_SAVE, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.save_raw, 0 ), 865 #endif 866 MENU_ITEM(0x59,LANG_MENU_OSD_RAW_EXCEPTIONS_PARAMS, MENUITEM_SUBMENU, &raw_exceptions_submenu, 0 ), 867 MENU_ENUM2(0x5f,LANG_MENU_RAW_NOISE_REDUCTION, &conf.raw_nr, gui_raw_nr_modes ), 868 MENU_ITEM(0x5c,LANG_MENU_RAW_FIRST_ONLY, MENUITEM_BOOL, &conf.raw_save_first_only, 0 ), 869 MENU_ITEM(0x5c,LANG_MENU_RAW_SAVE_IN_DIR, MENUITEM_BOOL, &conf.raw_in_dir, 0 ), 870 MENU_ENUM2a(0x5f,LANG_MENU_RAW_PREFIX, &conf.raw_prefix, img_prefixes, NUM_IMG_PREFIXES ), 871 MENU_ENUM2a(0x5f,LANG_MENU_RAW_EXTENSION, &conf.raw_ext, img_exts, NUM_IMG_EXTS ), 872 MENU_ENUM2a(0x5f,LANG_MENU_SUB_PREFIX, &conf.sub_batch_prefix, img_prefixes, NUM_IMG_PREFIXES ), 873 MENU_ENUM2a(0x5f,LANG_MENU_SUB_EXTENSION, &conf.sub_batch_ext, img_exts, NUM_IMG_EXTS ), 874 // MENU_ITEM(0x60,LANG_MENU_SUB_IN_DARK_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.sub_in_dark_value, MENU_MINMAX(0, 1023) ), 875 // MENU_ITEM(0x60,LANG_MENU_SUB_OUT_DARK_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.sub_out_dark_value, MENU_MINMAX(0, 1023) ), 876 MENU_ITEM(0x2a,LANG_MENU_RAW_DEVELOP, MENUITEM_PROC, gui_raw_develop, 0 ), 877 MENU_ITEM(0x5c,LANG_MENU_BAD_PIXEL_REMOVAL, MENUITEM_ENUM, gui_bad_pixel_enum, 0 ), 868 MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.save_raw, 0 ), 869 #endif 870 MENU_ITEM (0x59,LANG_MENU_OSD_RAW_EXCEPTIONS_PARAMS, MENUITEM_SUBMENU, &raw_exceptions_submenu, 0 ), 871 MENU_ENUM2 (0x5f,LANG_MENU_RAW_NOISE_REDUCTION, &conf.raw_nr, gui_raw_nr_modes ), 872 MENU_ITEM (0x5c,LANG_MENU_RAW_FIRST_ONLY, MENUITEM_BOOL, &conf.raw_save_first_only, 0 ), 873 MENU_ITEM (0x5c,LANG_MENU_RAW_SAVE_IN_DIR, MENUITEM_BOOL, &conf.raw_in_dir, 0 ), 874 MENU_ENUM2a (0x5f,LANG_MENU_RAW_PREFIX, &conf.raw_prefix, img_prefixes, NUM_IMG_PREFIXES ), 875 MENU_ENUM2a (0x5f,LANG_MENU_RAW_EXTENSION, &conf.raw_ext, img_exts, NUM_IMG_EXTS ), 876 MENU_ENUM2a (0x5f,LANG_MENU_SUB_PREFIX, &conf.sub_batch_prefix, img_prefixes, NUM_IMG_PREFIXES ), 877 MENU_ENUM2a (0x5f,LANG_MENU_SUB_EXTENSION, &conf.sub_batch_ext, img_exts, NUM_IMG_EXTS ), 878 // MENU_ITEM (0x60,LANG_MENU_SUB_IN_DARK_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.sub_in_dark_value, MENU_MINMAX(0, 1023) ), 879 // MENU_ITEM (0x60,LANG_MENU_SUB_OUT_DARK_VALUE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &conf.sub_out_dark_value, MENU_MINMAX(0, 1023) ), 880 MENU_ITEM (0x2a,LANG_MENU_RAW_DEVELOP, MENUITEM_PROC, gui_raw_develop, 0 ), 881 MENU_ITEM (0x5c,LANG_MENU_BAD_PIXEL_REMOVAL, MENUITEM_ENUM, gui_bad_pixel_enum, 0 ), 882 MENU_ITEM (0x5c,LANG_MENU_RAW_CACHED, MENUITEM_BOOL, &conf.raw_cache, 0 ), 878 883 #if DNG_SUPPORT 879 MENU_ITEM(0x5c,LANG_MENU_DNG_FORMAT, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.dng_raw , (int)cb_change_dng ), 880 MENU_ITEM(0x5c,LANG_MENU_RAW_DNG_EXT, MENUITEM_BOOL, &conf.raw_dng_ext, 0 ), 881 MENU_ITEM(0x2a,LANG_MENU_BADPIXEL_CREATE, MENUITEM_PROC, gui_menuproc_badpixel_create, 0 ), 882 #endif 883 MENU_ITEM (0x5c,LANG_MENU_RAW_CACHED, MENUITEM_BOOL, &conf.raw_cache, 0 ), 884 MENU_ITEM (0x0 ,(int)"DNG", MENUITEM_SEPARATOR, 0, 0 ), 885 MENU_ITEM (0x5c,LANG_MENU_DNG_FORMAT, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.dng_raw , (int)cb_change_dng ), 886 MENU_ITEM (0x5c,LANG_MENU_RAW_DNG_EXT, MENUITEM_BOOL, &conf.raw_dng_ext, 0 ), 887 MENU_ITEM (0x5f,LANG_MENU_DNG_VERSION, MENUITEM_ENUM, gui_dng_version, 0), 888 MENU_ITEM (0x2a,LANG_MENU_BADPIXEL_CREATE, MENUITEM_PROC, gui_menuproc_badpixel_create, 0 ), 889 #endif 884 890 MENU_ITEM (0x51,LANG_MENU_BACK, MENUITEM_UP, 0, 0 ), 885 891 {0} … … 1037 1043 #if DNG_SUPPORT 1038 1044 void cb_change_dng(){ 1039 int old=conf.dng_ raw;1045 int old=conf.dng_version; 1040 1046 conf_change_dng(); 1041 if ((old==1) && (conf.dng_ raw==0)) gui_mbox_init(LANG_ERROR, LANG_CANNOT_OPEN_BADPIXEL_FILE, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL);1047 if ((old==1) && (conf.dng_version==0)) gui_mbox_init(LANG_ERROR, LANG_CANNOT_OPEN_BADPIXEL_FILE, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); 1042 1048 } 1043 1049 1050 const char* gui_dng_version(int change, int arg) 1051 { 1052 static const char* modes[]={ "1.3", "1.1" }; 1053 1054 gui_enum_value_change(&conf.dng_version,change,sizeof(modes)/sizeof(modes[0])); 1055 cb_change_dng(); 1056 1057 return modes[conf.dng_version]; 1058 } 1059 1044 1060 void gui_menuproc_badpixel_create(int arg) { 1045 1061 // After this action module will not be unloaded until reboot … … 1225 1241 static const char* names[]={ "Print", "Display"}; 1226 1242 static const int keys[] = {KEY_PRINT, KEY_DISPLAY}; 1227 #elif defined(CAMERA_sx 220hs) || defined(CAMERA_sx230hs)1228 static const char* names[]={ " Disp+Set", "Display", "Playback", "Video"};1229 static const int keys[] = {KEY_PRINT, KEY_ DISPLAY, KEY_PLAYBACK, KEY_VIDEO};1243 #elif defined(CAMERA_sx150is) || (CAMERA_sx220hs) || defined(CAMERA_sx230hs) || defined(CAMERA_s100) 1244 static const char* names[]={ "Playback", "Video", "Display" }; 1245 static const int keys[] = {KEY_PRINT, KEY_VIDEO, KEY_DISPLAY}; 1230 1246 #elif defined(CAMERA_ixus220_elph300hs) || defined(CAMERA_ixus230_elph310hs) 1231 1247 static const char* names[]={ "Video", "Display", "Playback", "Video"}; -
branches/reyalp-ptp-live/core/gui_draw.c
r1813 r1814 13 13 //------------------------------------------------------------------- 14 14 static void draw_pixel_std(unsigned int offset, color cl) { 15 frame_buffer[0][offset] = frame_buffer[1][offset] = cl & 0xff; 15 #ifdef DRAW_ON_ACTIVE_BITMAP_BUFFER_ONLY 16 extern int active_bitmap_buffer; 17 frame_buffer[active_bitmap_buffer][offset] = cl & 0xff; 18 #else 19 frame_buffer[0][offset] = frame_buffer[1][offset] = cl & 0xff; 20 #endif 16 21 } 17 22 -
branches/reyalp-ptp-live/core/gui_lang.h
r1720 r1814 677 677 #define LANG_MENU_SCRIPT_START_ENABLE 551 678 678 679 #define GUI_LANG_ITEMS 551 679 #define LANG_MENU_MISC_ZOOM_ASSIST 552 680 681 #define LANG_MENU_DNG_VERSION 553 682 683 #define GUI_LANG_ITEMS 553 680 684 681 685 //------------------------------------------------------------------- -
branches/reyalp-ptp-live/core/modules.c
r1616 r1814 69 69 #elif CAM_SENSOR_BITS_PER_PIXEL==12 70 70 #define MODULE_NAME_RAWOP "_rawop12.flt" 71 #elif CAM_SENSOR_BITS_PER_PIXEL==14 72 #define MODULE_NAME_RAWOP "_rawop14.flt" 71 73 #else 72 74 #error define set_raw_pixel for sensor bit depth -
branches/reyalp-ptp-live/core/raw.c
r1711 r1814 212 212 case 3: addr[4] = (unsigned char)value; addr[5] = (addr[5]&0xF0) | (unsigned char)(value >> 8); break; 213 213 } 214 #elif CAM_SENSOR_BITS_PER_PIXEL==14 214 215 #else 215 216 #error define set_raw_pixel for sensor bit depth … … 239 240 case 3: return ((unsigned short)(addr[5] & 0x0F) << 8) | (addr[4]); 240 241 } 242 #elif CAM_SENSOR_BITS_PER_PIXEL==14 243 return CAM_BLACK_LEVEL; 241 244 #else 242 245 #error define get_raw_pixel for sensor bit depth -
branches/reyalp-ptp-live/core/shooting.c
r1813 r1814 333 333 int shooting_get_subject_distance_override_value() 334 334 { 335 return (conf.subj_dist_override_value < shooting_get_lens_to_focal_plane_width()?0:(conf.subj_dist_override_value - shooting_get_lens_to_focal_plane_width())); 335 if (conf.subj_dist_override_value != INFINITY_DIST) 336 return (conf.subj_dist_override_value < shooting_get_lens_to_focal_plane_width()?0:(conf.subj_dist_override_value - shooting_get_lens_to_focal_plane_width())); 337 else 338 return INFINITY_DIST; 336 339 } 337 340 … … 1074 1077 s=shooting_get_near_limit_f(v,shooting_get_min_real_aperture(),get_focal_length(lens_get_zoom_point())); 1075 1078 } 1076 if (!conf.dof_use_exif_subj_dist )1079 if (!conf.dof_use_exif_subj_dist && (s != INFINITY_DIST)) 1077 1080 s+=shooting_get_lens_to_focal_plane_width(); 1078 1081 lens_set_focus_pos(s); -
branches/reyalp-ptp-live/include/camera.h
r1813 r1814 194 194 #define CAMERA_MIN_DIST 0 // Define min distance that can be set in _MoveFocusLensToDistance (allow override - e.g. G12 min dist = 1) 195 195 #define CAMERA_MAX_DIST 65535 // Define max distance that can be set in _MoveFocusLensToDistance (allow override for superzooms - SX30/SX40) 196 197 #undef DRAW_ON_ACTIVE_BITMAP_BUFFER_ONLY // Draw pixels on active bitmap buffer only. Requires active_bitmap_buffer location in stubs_min.S or stubs_entry.S. 198 199 #undef CAM_ZOOM_ASSIST_BUTTON_CONTROL // Activate menu option to enable/disable the zoom assist button on the SX30/SX40 200 // For other cameras, requires additional support code in kbd.c (see the SX30 or SX40 version) 196 201 197 202 //---------------------------------------------------------- -
branches/reyalp-ptp-live/include/conf.h
r1720 r1814 60 60 int raw_cache; 61 61 int dng_raw; 62 int dng_version; // User selectable DNG version (0=1.3, 1=1.1) - select 1.1 for CHDK to do bad pixel removal (requires creation of badpixel.bin) 62 63 int raw_timer; 63 64 int raw_dng_ext; … … 327 328 328 329 // gen 2 USB remote 329 int remote_switch_type ;330 int remote_control_mode ;330 int remote_switch_type; 331 int remote_control_mode; 331 332 332 333 int ext_video_time; 333 334 334 int remote_enable_scripts ; // usb remote activates scripts in <ALT> mode335 int remote_enable_scripts; // usb remote activates scripts in <ALT> mode 335 336 337 #if defined(CAM_ZOOM_ASSIST_BUTTON_CONTROL) 338 int zoom_assist_button_disable; // used to disable the zoom assist button on SX30 & SX40 for people who keep accidentaly pressing it 339 #endif 340 336 341 #ifdef CAM_HAS_GPS 337 342 int gps_record; -
branches/reyalp-ptp-live/include/propset1.h
r1711 r1814 46 46 #define PROPCASE_WB_ADJ 100 47 47 #define PROPCASE_OPTICAL_ZOOM_POSITION 99 //untested ! 48 #define PROPCASE_STITCH_DIRECTION 52 // 0=left>right, 1=right>left. Some cams have more 49 #define PROPCASE_STITCH_SEQUENCE 48 // counts shots in stitch sequence, positive for left-right, negative for right-left 48 50 #endif -
branches/reyalp-ptp-live/include/propset2.h
r1711 r1814 51 51 #define PROPCASE_CONTINUOUS_AF 12 //G10 0 = Continuous AF off, 1 = Continuous AF on 52 52 #define PROPCASE_DIGITAL_ZOOM_MODE 91 //G10 Digital Zoom Mode/State 0 = off/standard, 2 = 1.7x, 3 = 2.1x 53 #define PROPCASE_STITCH_DIRECTION 233 //D10 0=left>right, 1=right>left 54 #define PROPCASE_STITCH_SEQUENCE 238 //D10 counts shots in stitch sequence, positive=left>right, negative=right>left 53 55 #endif -
branches/reyalp-ptp-live/makefile.inc
r1813 r1814 1 include $(topdir)chdk_ver.inc2 1 3 2 MEMISOSIZE="(&_end-&_start)" … … 12 11 include $(topdir)version.inc 13 12 -include $(topdir)revision.inc 13 14 ifndef OPT_DE_VERSION 15 VER=CHDK 16 else 17 VER=CHDK_DE 18 ifndef OPT_DEFAULT_LANG 19 OPT_DEFAULT_LANG=german 20 endif 21 endif 14 22 15 23 ifdef PLATFORM … … 140 148 LDFLAGS+=-L$(topdir)platform/$(PLATFORM) -L$(topdir)platform/$(PLATFORM)/sub/$(PLATFORMSUB) 141 149 142 if eq ($(VER),CHDK)150 ifndef OPT_DE_VERSION 143 151 CFLAGS+=-DVER_CHDK 144 152 else -
branches/reyalp-ptp-live/platform/a1000/main.c
r1641 r1814 28 28 } 29 29 30 static const int fl_tbl[] = {5800, 6420, 7060, 7700, 8340, 9950, 11550, 13160, 14750, 17150, 19570, 22760, 26750, 30750, 34800}; 31 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 32 #define CF_EFL 60345 30 // Focus length table in firmware @0xfffe297c 31 #define NUM_FL 8 // 0 - 7, entries in firmware 32 #define NUM_DATA 3 // 3 words each entry, first is FL 33 extern int focus_len_table[NUM_FL*NUM_DATA]; 34 35 // Conversion factor lens FL --> 35mm equiv 36 // lens 35mm CF 37 // ---- ---- -- 38 // 6.2 35 ( 35/ 6.2) * 62 = 350 (min FL) 39 // 24.8 140 (140/24.8) * 62 = 350 (max FL) 40 #define CF_EFL 350 41 #define CF_EFL_DIV 62 33 42 34 43 const int zoom_points = NUM_FL; 35 44 36 45 int get_effective_focal_length(int zp) { 37 return (CF_EFL*get_focal_length(zp))/ 10000;46 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 38 47 } 39 48 40 49 int get_focal_length(int zp) { 41 if (zp <0) return fl_tbl[0];42 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];43 else return fl_tbl[zp];50 if (zp < 0) zp = 0; 51 else if (zp >= NUM_FL) zp = NUM_FL-1; 52 return focus_len_table[zp*NUM_DATA]; 44 53 } 45 54 46 55 int get_zoom_x(int zp) { 47 if (zp<1) return 10; 48 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 49 else return fl_tbl[zp]*10/fl_tbl[0]; 56 return get_focal_length(zp)*10/focus_len_table[0]; 50 57 } 51 58 -
branches/reyalp-ptp-live/platform/a1100/main.c
r1233 r1814 29 29 } 30 30 31 static const int fl_tbl[] = {6200, 7780, 9410, 11370, 13790, 16770, 20180, 24800}; 32 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 33 #define CF_EFL 56451 //---corect 31 // Focus length table in firmware @0xfffe2a8c 32 #define NUM_FL 8 // 0 - 7, entries in firmware 33 #define NUM_DATA 3 // 3 words each entry, first is FL 34 extern int focus_len_table[NUM_FL*NUM_DATA]; 35 36 // Conversion factor lens FL --> 35mm equiv 37 // lens 35mm CF 38 // ---- ---- -- 39 // 6.2 35 ( 35/ 6.2) * 62 = 350 (min FL) 40 // 24.8 140 (140/24.8) * 62 = 350 (max FL) 41 #define CF_EFL 350 42 #define CF_EFL_DIV 62 34 43 35 44 const int zoom_points = NUM_FL; 36 45 37 46 int get_effective_focal_length(int zp) { 38 return (CF_EFL*get_focal_length(zp))/ 10000;47 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 39 48 } 40 49 41 50 int get_focal_length(int zp) { 42 if (zp <0) return fl_tbl[0];43 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];44 else return fl_tbl[zp];51 if (zp < 0) zp = 0; 52 else if (zp >= NUM_FL) zp = NUM_FL-1; 53 return focus_len_table[zp*NUM_DATA]; 45 54 } 46 55 47 56 int get_zoom_x(int zp) { 48 if (zp<1) return 10; 49 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 50 else return fl_tbl[zp]*10/fl_tbl[0]; 57 return get_focal_length(zp)*10/focus_len_table[0]; 51 58 } 52 59 -
branches/reyalp-ptp-live/platform/a2000/main.c
r847 r1814 29 29 } 30 30 31 static const int fl_tbl[] = {6400, 6800, 7600, 8800, 10500, 12300, 14100, 16100, 18500, 21200, 24000, 27100, 30700, 35100, 38400}; 32 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 31 // Focus length table in firmware @0xfffe297c 32 #define NUM_FL 15 // 0 - 14, entries in firmware 33 #define NUM_DATA 3 // 3 words each entry, first is FL 34 extern int focus_len_table[NUM_FL*NUM_DATA]; 33 35 34 // focal length range is 6.4 - 38.4 mm, 36 - 216 in 35-mm equivalent. 35 // So, CF_EFL = 36/6.4 * 1000 = 56250 or 216/38.4 * 1000 = 56250. 36 #define CF_EFL 5625 36 // Conversion factor lens FL --> 35mm equiv 37 // lens 35mm CF 38 // ---- ---- -- 39 // 6.4 36 ( 36/ 6.4) * 64 = 360 (min FL) 40 // 38.4 216 (216/38.4) * 64 = 360 (max FL) 41 #define CF_EFL 360 42 #define CF_EFL_DIV 64 37 43 38 44 const int zoom_points = NUM_FL; 39 45 40 46 int get_effective_focal_length(int zp) { 41 return (CF_EFL*get_focal_length(zp))/1000;47 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 42 48 } 43 49 44 50 int get_focal_length(int zp) { 45 if (zp <0) return fl_tbl[0];46 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];47 else return fl_tbl[zp];51 if (zp < 0) zp = 0; 52 else if (zp >= NUM_FL) zp = NUM_FL-1; 53 return focus_len_table[zp*NUM_DATA]; 48 54 } 49 55 50 56 int get_zoom_x(int zp) { 51 if (zp<1) return 10; 52 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 53 else return fl_tbl[zp]*10/fl_tbl[0]; 57 return get_focal_length(zp)*10/focus_len_table[0]; 54 58 } 55 56 59 57 60 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/a3000/main.c
r1372 r1814 26 26 } 27 27 28 //zoom position is get_parameter_data(87) 29 static const struct { 30 int zp, fl; 31 } fl_tbl[] = { 32 { 0, 6200}, 33 { 1, 7780}, 34 { 2, 9410}, 35 { 3, 11370}, 36 { 4, 13790}, 37 { 5, 16770}, 38 { 6, 20180}, 39 { 7, 24800}, 40 }; 28 // Focus length table in firmware @0xfffe29b0 29 #define NUM_FL 8 // 0 - 7, entries in firmware 30 #define NUM_DATA 3 // 3 words each entry, first is FL 31 extern int focus_len_table[NUM_FL*NUM_DATA]; 41 32 42 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 43 // A3000IS focal lenght range 6.2 - 24.8 mm (35 mm equivalent: 34.8 - 139.4 mm)(1/2.3" (7.7mm, crop 5.62) Type CCD, Scale Factor To 35 mm Equivalent: 4.6) 44 // 34.8/6.2*10000=56129 45 // 139.4/24.8*10000=56210 46 47 #define CF_EFL 56200 33 // Conversion factor lens FL --> 35mm equiv 34 // lens 35mm CF 35 // ---- ---- -- 36 // 6.2 35 ( 35/ 6.2) * 62 = 350 (min FL) 37 // 24.8 140 (140/24.8) * 62 = 350 (max FL) 38 #define CF_EFL 350 39 #define CF_EFL_DIV 62 48 40 49 41 const int zoom_points = NUM_FL; 50 42 51 43 int get_effective_focal_length(int zp) { 52 return (CF_EFL*get_focal_length(zp))/ 10000;44 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 53 45 } 54 46 55 47 int get_focal_length(int zp) { 56 int i; 57 58 if (zp<fl_tbl[0].zp) 59 return fl_tbl[0].fl; 60 else if (zp>fl_tbl[NUM_FL-1].zp) 61 return fl_tbl[NUM_FL-1].fl; 62 else 63 for (i=1; i<NUM_FL; ++i) { 64 if (zp==fl_tbl[i-1].zp) 65 return fl_tbl[i-1].fl; 66 else if (zp==fl_tbl[i].zp) 67 return fl_tbl[i].fl; 68 else if (zp<fl_tbl[i].zp) 69 return fl_tbl[i-1].fl+(zp-fl_tbl[i-1].zp)*(fl_tbl[i].fl-fl_tbl[i-1].fl)/(fl_tbl[i].zp-fl_tbl[i-1].zp); 70 } 71 return fl_tbl[NUM_FL-1].fl; 48 if (zp < 0) zp = 0; 49 else if (zp >= NUM_FL) zp = NUM_FL-1; 50 return focus_len_table[zp*NUM_DATA]; 72 51 } 73 52 74 53 int get_zoom_x(int zp) { 75 return get_focal_length(zp)*10/fl_tbl[0].fl;54 return get_focal_length(zp)*10/focus_len_table[0]; 76 55 } 77 78 56 79 57 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/a3300/main.c
r1620 r1814 28 28 } 29 29 30 // Focus length table in firmware @0xfffe2f88 31 #define NUM_FL 12 // 0 - 11, entries in firmware 32 #define NUM_DATA 3 // 3 words each entry, first is FL 33 extern int focus_len_table[NUM_FL*NUM_DATA]; 30 34 31 #define NUM_FL 12 32 extern int focus_len_table[NUM_FL*3]; 33 //a3300is 34 // Focal length range is 5.0 - 25.0 mm, 28 - 140 in 35-mm equivalent. 35 // So, CF_EFL = 28/5.0*10000=56000 or 140/25*10000=56000 36 // divide by 10 to avoid overflow in get_effective_focal_length() 37 #define CF_EFL 5600 35 // Conversion factor lens FL --> 35mm equiv 36 // lens 35mm CF 37 // ---- ---- -- 38 // 5.0 28 ( 28/ 5.0) * 50 = 280 (min FL) 39 // 25.0 140 (140/25.0) * 50 = 280 (max FL) 40 #define CF_EFL 280 41 #define CF_EFL_DIV 50 42 38 43 const int zoom_points = NUM_FL; 39 44 40 41 45 int get_effective_focal_length(int zp) { 42 return (CF_EFL*get_focal_length(zp))/10000;46 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 43 47 } 44 48 45 46 49 int get_focal_length(int zp) { 47 48 if (zp < 0) zp = 0; 49 else if (zp >= NUM_FL) zp = NUM_FL-1; 50 return focus_len_table[zp*3]; 51 50 if (zp < 0) zp = 0; 51 else if (zp >= NUM_FL) zp = NUM_FL-1; 52 return focus_len_table[zp*NUM_DATA]; 52 53 } 53 54 54 55 55 int get_zoom_x(int zp) { 56 return get_focal_length(zp)*10/focus_len_table[0]; 57 56 return get_focal_length(zp)*10/focus_len_table[0]; 58 57 } 59 60 61 58 62 59 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/a3300/sub/100a/stubs_entry.S
r1658 r1814 46 46 DEF(focus_busy ,0x000064d8) // Found @0xff960130 47 47 DEF(recreview_hold ,0x00003534) // Found @0xff89af5c 48 DEF(palette_control ,0x0000916c) // Found @0xffa06c70 49 DEF(active_palette_buffer ,0x00009174) // Found @0xffa06c74 50 DEF(palette_buffer ,0x000b477c) // Found @0xffa07028 48 51 49 52 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/a3300/sub/100c/stubs_entry.S
r1658 r1814 46 46 DEF(focus_busy ,0x000064d8) // Found @0xff960130 47 47 DEF(recreview_hold ,0x00003534) // Found @0xff89af5c 48 DEF(palette_control ,0x0000916c) // Found @0xffa06c70 49 DEF(active_palette_buffer ,0x00009174) // Found @0xffa06c74 50 DEF(palette_buffer ,0x000b477c) // Found @0xffa07028 48 51 49 52 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/a3300/sub/100d/stubs_entry.S
r1658 r1814 46 46 DEF(focus_busy ,0x000064d8) // Found @0xff960130 47 47 DEF(recreview_hold ,0x00003534) // Found @0xff89af5c 48 DEF(palette_control ,0x0000916c) // Found @0xffa06c70 49 DEF(active_palette_buffer ,0x00009174) // Found @0xffa06c74 50 DEF(palette_buffer ,0x000b477c) // Found @0xffa07028 48 51 49 52 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/a480/main.c
r884 r1814 28 28 } 29 29 30 static const int fl_tbl[] = {6600, 8060, 9840, 12050, 14800, 17550, 21600}; 31 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 32 #define CF_EFL 56481L 30 // Focus length table in firmware @0xfffe297c 31 #define NUM_FL 7 // 0 - 6, entries in firmware 32 #define NUM_DATA 3 // 3 words each entry, first is FL 33 extern int focus_len_table[NUM_FL*NUM_DATA]; 34 35 // Conversion factor lens FL --> 35mm equiv 36 // lens 35mm CF 37 // ---- ---- -- 38 // 6.6 37 ( 37/ 6.6) * 66 = 370 (min FL) 39 // 21.6 122 (122/21.6) * 66 = 372,8 (max FL) 40 #define CF_EFL 370 41 #define CF_EFL_DIV 66 33 42 34 43 const int zoom_points = NUM_FL; 35 44 36 45 int get_effective_focal_length(int zp) { 37 return (CF_EFL*get_focal_length(zp))/ 10000;46 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 38 47 } 39 48 40 49 int get_focal_length(int zp) { 41 if (zp <0) return fl_tbl[0];42 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];43 else return fl_tbl[zp];50 if (zp < 0) zp = 0; 51 else if (zp >= NUM_FL) zp = NUM_FL-1; 52 return focus_len_table[zp*NUM_DATA]; 44 53 } 45 54 46 55 int get_zoom_x(int zp) { 47 if (zp<1) return 10; 48 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 49 else return fl_tbl[zp]*10/fl_tbl[0]; 56 return get_focal_length(zp)*10/focus_len_table[0]; 50 57 } 51 52 58 53 59 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/a490/main.c
r1205 r1814 28 28 } 29 29 30 // TODO: Check focal length table 31 static const int fl_tbl[] = {6600, 8060, 9840, 12050, 14800, 17550, 21600}; 32 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 33 #define CF_EFL 56481L 30 // Focus length table in firmware @0xfffe2990 31 #define NUM_FL 7 // 0 - 6, entries in firmware 32 #define NUM_DATA 3 // 3 words each entry, first is FL 33 extern int focus_len_table[NUM_FL*NUM_DATA]; 34 35 // Conversion factor lens FL --> 35mm equiv 36 // lens 35mm CF 37 // ---- ---- -- 38 // 6.6 37 ( 37/ 6.6) * 66 = 370 (min FL) 39 // 21.6 122 (122/21.6) * 66 = 372.8 (max FL) 40 #define CF_EFL 370 41 #define CF_EFL_DIV 66 34 42 35 43 const int zoom_points = NUM_FL; 36 44 37 45 int get_effective_focal_length(int zp) { 38 return (CF_EFL*get_focal_length(zp))/ 10000;46 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 39 47 } 40 48 41 49 int get_focal_length(int zp) { 42 if (zp <0) return fl_tbl[0];43 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];44 else return fl_tbl[zp];50 if (zp < 0) zp = 0; 51 else if (zp >= NUM_FL) zp = NUM_FL-1; 52 return focus_len_table[zp*NUM_DATA]; 45 53 } 46 54 47 55 int get_zoom_x(int zp) { 48 if (zp<1) return 10; 49 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 50 else return fl_tbl[zp]*10/fl_tbl[0]; 56 return get_focal_length(zp)*10/focus_len_table[0]; 51 57 } 52 58 -
branches/reyalp-ptp-live/platform/a495/main.c
r1376 r1814 28 28 } 29 29 30 // TODO: Check focal length table 31 static const int fl_tbl[] = {6600, 8060, 9840, 12050, 14800, 17550, 21600}; 32 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 33 #define CF_EFL 56481L 30 // Focus length table in firmware @0xfffe2990 31 #define NUM_FL 7 // 0 - 6, entries in firmware 32 #define NUM_DATA 3 // 3 words each entry, first is FL 33 extern int focus_len_table[NUM_FL*NUM_DATA]; 34 35 // Conversion factor lens FL --> 35mm equiv 36 // lens 35mm CF 37 // ---- ---- -- 38 // 6.6 37 ( 37/ 6.6) * 66 = 370 (min FL) 39 // 21.6 122 (122/21.6) * 66 = 372,8 (max FL) 40 #define CF_EFL 370 41 #define CF_EFL_DIV 66 34 42 35 43 const int zoom_points = NUM_FL; 36 44 37 45 int get_effective_focal_length(int zp) { 38 return (CF_EFL*get_focal_length(zp))/ 10000;46 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 39 47 } 40 48 41 49 int get_focal_length(int zp) { 42 if (zp <0) return fl_tbl[0];43 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];44 else return fl_tbl[zp];50 if (zp < 0) zp = 0; 51 else if (zp >= NUM_FL) zp = NUM_FL-1; 52 return focus_len_table[zp*NUM_DATA]; 45 53 } 46 54 47 55 int get_zoom_x(int zp) { 48 if (zp<1) return 10; 49 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 50 else return fl_tbl[zp]*10/fl_tbl[0]; 56 return get_focal_length(zp)*10/focus_len_table[0]; 51 57 } 52 58 -
branches/reyalp-ptp-live/platform/a580/main.c
r1308 r1814 29 29 } 30 30 31 // Focus length table in firmware @0xfffe297c 32 #define NUM_FL 8 // 0 - 7, entries in firmware 33 #define NUM_DATA 3 // 3 words each entry, first is FL 34 extern int focus_len_table[NUM_FL*NUM_DATA]; 31 35 32 static const int fl_tbl[] = {5800, 6700, 8000, 10000, 12600, 15800, 19300, 23200}; 33 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 34 #define CF_EFL 60345 //OK 36 // Conversion factor lens FL --> 35mm equiv 37 // lens 35mm CF 38 // ---- ---- -- 39 // 5.8 35 ( 35/ 5.8) * 58 = 350 (min FL) 40 // 23.2 140 (140/23.2) * 58 = 350 (max FL) 41 #define CF_EFL 350 42 #define CF_EFL_DIV 58 35 43 36 44 const int zoom_points = NUM_FL; 37 45 38 46 int get_effective_focal_length(int zp) { 39 return (CF_EFL*get_focal_length(zp))/ 10000;47 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 40 48 } 41 49 42 50 int get_focal_length(int zp) { 43 if (zp <0) return fl_tbl[0];44 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];45 else return fl_tbl[zp];51 if (zp < 0) zp = 0; 52 else if (zp >= NUM_FL) zp = NUM_FL-1; 53 return focus_len_table[zp*NUM_DATA]; 46 54 } 47 55 48 56 int get_zoom_x(int zp) { 49 if (zp<1) return 10; 50 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 51 else return fl_tbl[zp]*10/fl_tbl[0]; 57 return get_focal_length(zp)*10/focus_len_table[0]; 52 58 } 53 59 -
branches/reyalp-ptp-live/platform/a590/main.c
r847 r1814 30 30 } 31 31 32 static const int fl_tbl[] = {5800, 6600, 7900, 9900, 12700, 16000, 19600, 23200}; 33 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 34 #define CF_EFL 60345 32 // Focus length table in firmware @0xfffe29ac 33 #define NUM_FL 8 // 0 - 7, entries in firmware 34 #define NUM_DATA 3 // 3 words each entry, first is FL 35 extern int focus_len_table[NUM_FL*NUM_DATA]; 36 37 // Conversion factor lens FL --> 35mm equiv 38 // lens 35mm CF 39 // ---- ---- -- 40 // 5.8 35 ( 35/ 5.8) * 58 = 350 (min FL) 41 // 23.2 140 (140/23.2) * 58 = 350 (max FL) 42 #define CF_EFL 350 43 #define CF_EFL_DIV 58 35 44 36 45 const int zoom_points = NUM_FL; 37 46 38 47 int get_effective_focal_length(int zp) { 39 return (CF_EFL*get_focal_length(zp))/ 10000;48 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 40 49 } 41 50 42 51 int get_focal_length(int zp) { 43 if (zp <0) return fl_tbl[0];44 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];45 else return fl_tbl[zp];52 if (zp < 0) zp = 0; 53 else if (zp >= NUM_FL) zp = NUM_FL-1; 54 return focus_len_table[zp*NUM_DATA]; 46 55 } 47 56 48 57 int get_zoom_x(int zp) { 49 if (zp<1) return 10; 50 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 51 else return fl_tbl[zp]*10/fl_tbl[0]; 58 return get_focal_length(zp)*10/focus_len_table[0]; 52 59 } 53 60 -
branches/reyalp-ptp-live/platform/a720/main.c
r847 r1814 29 29 } 30 30 31 // Focus length table in firmware @0xfffe299c 32 #define NUM_FL 15 // 0 - 14, entries in firmware 33 #define NUM_DATA 3 // 3 words each entry, first is FL 34 extern int focus_len_table[NUM_FL*NUM_DATA]; 31 35 32 static const int fl_tbl[] = {5800, 6420, 7060, 7700, 8340, 9950, 11550, 13160, 14750, 17150, 19570, 22760, 26750, 30750, 34800}; 33 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 34 #define CF_EFL 60345 36 // Conversion factor lens FL --> 35mm equiv 37 // lens 35mm CF 38 // ---- ---- -- 39 // 5.8 35 ( 35/ 5.8) * 58 = 350 (min FL) 40 // 34.8 210 (210/34.8) * 58 = 350 (max FL) 41 #define CF_EFL 350 42 #define CF_EFL_DIV 58 35 43 36 44 const int zoom_points = NUM_FL; 37 45 38 46 int get_effective_focal_length(int zp) { 39 return (CF_EFL*get_focal_length(zp))/ 10000;47 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 40 48 } 41 49 42 50 int get_focal_length(int zp) { 43 if (zp <0) return fl_tbl[0];44 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];45 else return fl_tbl[zp];51 if (zp < 0) zp = 0; 52 else if (zp >= NUM_FL) zp = NUM_FL-1; 53 return focus_len_table[zp*NUM_DATA]; 46 54 } 47 55 48 56 int get_zoom_x(int zp) { 49 if (zp<1) return 10; 50 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 51 else return fl_tbl[zp]*10/fl_tbl[0]; 57 return get_focal_length(zp)*10/focus_len_table[0]; 52 58 } 53 59 -
branches/reyalp-ptp-live/platform/a800/main.c
r1723 r1814 28 28 } 29 29 30 // TODO: Check focal length table 31 static const int fl_tbl[] = {6600, 8060, 9840, 12050, 14800, 21600}; 32 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 33 #define CF_EFL 56481L 30 // Focus length table in firmware @0xfffe2ee8 31 #define NUM_FL 7 // 0 - 6, entries in firmware 32 #define NUM_DATA 3 // 3 words each entry, first is FL 33 extern int focus_len_table[NUM_FL*NUM_DATA]; 34 35 // Conversion factor lens FL --> 35mm equiv 36 // lens 35mm CF 37 // ---- ---- -- 38 // 6.6 37 ( 37/ 6.6) * 66 = 370 (min FL) 39 // 21.6 122 (122/21.6) * 66 = 372.7 (max FL) 40 #define CF_EFL 370 41 #define CF_EFL_DIV 66 34 42 35 43 const int zoom_points = NUM_FL; 36 44 37 45 int get_effective_focal_length(int zp) { 38 return (CF_EFL*get_focal_length(zp))/ 10000;46 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 39 47 } 40 48 41 49 int get_focal_length(int zp) { 42 if (zp <0) return fl_tbl[0];43 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];44 else return fl_tbl[zp];50 if (zp < 0) zp = 0; 51 else if (zp >= NUM_FL) zp = NUM_FL-1; 52 return focus_len_table[zp*NUM_DATA]; 45 53 } 46 54 47 55 int get_zoom_x(int zp) { 48 if (zp<1) return 10; 49 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 50 else return fl_tbl[zp]*10/fl_tbl[0]; 56 return get_focal_length(zp)*10/focus_len_table[0]; 51 57 } 52 58 -
branches/reyalp-ptp-live/platform/a800/shooting.c
r1723 r1814 110 110 111 111 #if defined(CAM_DATE_FOLDER_NAMING) 112 void get_target_dir_name(char *out) { 112 // A800 uses date to name directory 113 void get_target_dir_name(char *out) 114 { 113 115 extern void _GetImageFolder(char*,int,int,int); 114 out[0] = 'A'; 115 _GetImageFolder(out+1,get_file_next_counter(),CAM_DATE_FOLDER_NAMING,time(NULL)); 116 out[15] = '\0'; 116 _GetImageFolder(out,get_file_next_counter(),0x400,time(NULL)); 117 117 } 118 118 #else -
branches/reyalp-ptp-live/platform/a800/sub/100c/stubs_entry.S
r1813 r1814 45 45 DEF(focus_busy ,0x0000551c) // Found @0xffd125c4 46 46 DEF(recreview_hold ,0x000030d4) // Found @0xffc78de0 47 DEF(palette_control ,0x00007810) // Found @0xffd88c44 48 DEF(active_palette_buffer ,0x00007818) // Found @0xffd88c48 49 DEF(palette_buffer ,0x00088f3c) // Found @0xffd88ff0 47 50 48 51 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/d10/main.c
r897 r1814 43 43 CF_EFL ~54800-56000 44 44 */ 45 static const int fl_tbl[] = {6200, 7200, 8300, 9700, 11600, 14300, 18600}; 46 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 47 #define CF_EFL 55400 45 46 // Focus length table in firmware @0xfffe2a8c 47 #define NUM_FL 7 // 0 - 6, entries in firmware 48 #define NUM_DATA 3 // 3 words each entry, first is FL 49 extern int focus_len_table[NUM_FL*NUM_DATA]; 50 51 // Conversion factor lens FL --> 35mm equiv 52 // lens 35mm CF 53 // ---- ---- -- 54 // 6.2 35 ( 35/ 6.2) * 62 = 350 (min FL) 55 // 18.6 105 (105/18.6) * 62 = 350 (max FL) 56 #define CF_EFL 350 57 #define CF_EFL_DIV 62 48 58 49 59 const int zoom_points = NUM_FL; 50 60 51 61 int get_effective_focal_length(int zp) { 52 return (CF_EFL*get_focal_length(zp))/ 10000;62 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 53 63 } 54 64 55 65 int get_focal_length(int zp) { 56 if (zp <0) return fl_tbl[0];57 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];58 else return fl_tbl[zp];66 if (zp < 0) zp = 0; 67 else if (zp >= NUM_FL) zp = NUM_FL-1; 68 return focus_len_table[zp*NUM_DATA]; 59 69 } 60 70 61 71 int get_zoom_x(int zp) { 62 if (zp<1) return 10; 63 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 64 else return fl_tbl[zp]*10/fl_tbl[0]; 72 return get_focal_length(zp)*10/focus_len_table[0]; 65 73 } 66 67 74 68 75 // uses NB-6L, similar specs to NB-5L, copied from sd990 below -
branches/reyalp-ptp-live/platform/g10/main.c
r1329 r1814 28 28 } 29 29 30 // G10 focus length table in firmware @ FFFE2A8C for 1.02a, 1.03b & 1.04a 31 // Note: same lens & table as G12 32 33 #define NUM_FL 14 // 0 - 13, entries in firmware (3 words each entry, first is FL) 34 extern int focus_len_table[NUM_FL*3]; 30 // Focus length table in firmware @0xfffe2a8c 31 #define NUM_FL 14 // 0 - 13, entries in firmware 32 #define NUM_DATA 3 // 3 words each entry, first is FL 33 extern int focus_len_table[NUM_FL*NUM_DATA]; 35 34 36 35 // Conversion factor lens FL --> 35mm equiv 37 36 // lens 35mm CF 38 37 // ---- ---- -- 39 // 6.1 28 ( 28/6.1) * 61 = 280 (min FL)38 // 6.1 28 ( 28/ 6.1) * 61 = 280 (min FL) 40 39 // 30.5 140 (140/30.5) * 61 = 280 (max FL) 41 42 #define CF_EFL 280 43 #define CF_EFL_DIV 61 40 #define CF_EFL 280 41 #define CF_EFL_DIV 61 44 42 45 43 const int zoom_points = NUM_FL; 46 44 47 45 int get_effective_focal_length(int zp) { 48 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV;46 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 49 47 } 50 48 51 49 int get_focal_length(int zp) { 52 if (zp < 0) zp = 0;53 else if (zp >= NUM_FL) zp = NUM_FL-1;54 return focus_len_table[zp*3];50 if (zp < 0) zp = 0; 51 else if (zp >= NUM_FL) zp = NUM_FL-1; 52 return focus_len_table[zp*NUM_DATA]; 55 53 } 56 54 57 55 int get_zoom_x(int zp) { 58 return get_focal_length(zp)*10/focus_len_table[0];56 return get_focal_length(zp)*10/focus_len_table[0]; 59 57 } 60 58 -
branches/reyalp-ptp-live/platform/g11/main.c
r1641 r1814 26 26 } 27 27 28 //zoom position is get_parameter_data(87) 29 static const struct { 30 int zp, fl; 31 } fl_tbl[] = { 32 { 0, 6100}, 33 { 1, 6800}, 34 { 2, 7400}, 35 { 3, 8100}, 36 { 4, 8900}, 37 { 5, 9800}, 38 { 6, 10800}, 39 { 7, 12100}, 40 { 8, 13800}, 41 { 9, 15700}, 42 { 10, 18100}, 43 { 11, 21500}, 44 { 12, 25000}, 45 { 13, 30500}, 46 }; 28 // Focus length table in firmware @0xfffe2a8c 29 #define NUM_FL 14 // 0 - 13, entries in firmware 30 #define NUM_DATA 3 // 3 words each entry, first is FL 31 extern int focus_len_table[NUM_FL*NUM_DATA]; 47 32 48 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 49 // G11 focal lenght range 6.1 - 30.5 mm (35 mm equivalent: 27.8 - 139.1 mm)(1/1.7" Type CCD, Scale Factor To 35 mm Equivalent: 4.6) 50 // 27,8/6,1*10000=45574 51 // 139,1/30,5*10000=45607 52 #define CF_EFL 45574 33 // Conversion factor lens FL --> 35mm equiv 34 // lens 35mm CF 35 // ---- ---- -- 36 // 6.1 28 ( 28/ 6.1) * 61 = 280 (min FL) 37 // 30.5 140 (140/30.5) * 61 = 280 (max FL) 38 #define CF_EFL 280 39 #define CF_EFL_DIV 61 53 40 54 41 const int zoom_points = NUM_FL; 55 42 56 43 int get_effective_focal_length(int zp) { 57 return (CF_EFL*get_focal_length(zp))/ 10000;44 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 58 45 } 59 46 60 47 int get_focal_length(int zp) { 61 int i; 62 63 if (zp<fl_tbl[0].zp) 64 return fl_tbl[0].fl; 65 else if (zp>fl_tbl[NUM_FL-1].zp) 66 return fl_tbl[NUM_FL-1].fl; 67 else 68 for (i=1; i<NUM_FL; ++i) { 69 if (zp==fl_tbl[i-1].zp) 70 return fl_tbl[i-1].fl; 71 else if (zp==fl_tbl[i].zp) 72 return fl_tbl[i].fl; 73 else if (zp<fl_tbl[i].zp) 74 return fl_tbl[i-1].fl+(zp-fl_tbl[i-1].zp)*(fl_tbl[i].fl-fl_tbl[i-1].fl)/(fl_tbl[i].zp-fl_tbl[i-1].zp); 75 } 76 return fl_tbl[NUM_FL-1].fl; 48 if (zp < 0) zp = 0; 49 else if (zp >= NUM_FL) zp = NUM_FL-1; 50 return focus_len_table[zp*NUM_DATA]; 77 51 } 78 52 79 53 int get_zoom_x(int zp) { 80 return get_focal_length(zp)*10/fl_tbl[0].fl;54 return get_focal_length(zp)*10/focus_len_table[0]; 81 55 } 82 83 56 84 57 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/g12/main.c
r1565 r1814 36 36 } 37 37 38 // Focus length table in firmware @ FFFE2A80 39 #define NUM_FL 14 // 0 - 13, entries in firmware (3 words each entry, first is FL) 40 extern int focus_len_table[NUM_FL*3]; 38 // Focus length table in firmware @0xfffe2a80 39 #define NUM_FL 14 // 0 - 13, entries in firmware 40 #define NUM_DATA 3 // 3 words each entry, first is FL 41 extern int focus_len_table[NUM_FL*NUM_DATA]; 41 42 42 43 // Conversion factor lens FL --> 35mm equiv 43 44 // lens 35mm CF 44 45 // ---- ---- -- 45 // 6.1 28 ( 28/6.1) * 61 = 280 (min FL)46 // 6.1 28 ( 28/ 6.1) * 61 = 280 (min FL) 46 47 // 30.5 140 (140/30.5) * 61 = 280 (max FL) 47 #define CF_EFL 28048 #define CF_EFL_DIV 6148 #define CF_EFL 280 49 #define CF_EFL_DIV 61 49 50 50 const int zoom_points = NUM_FL; // OK51 const int zoom_points = NUM_FL; 51 52 52 53 int get_effective_focal_length(int zp) { 53 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV;54 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 54 55 } 55 56 56 57 int get_focal_length(int zp) { 57 if (zp < 0) zp = 0;58 else if (zp >= NUM_FL) zp = NUM_FL-1;59 return focus_len_table[zp*3];58 if (zp < 0) zp = 0; 59 else if (zp >= NUM_FL) zp = NUM_FL-1; 60 return focus_len_table[zp*NUM_DATA]; 60 61 } 61 62 62 63 int get_zoom_x(int zp) { 63 return get_focal_length(zp)*10/focus_len_table[0];64 return get_focal_length(zp)*10/focus_len_table[0]; 64 65 } 65 66 -
branches/reyalp-ptp-live/platform/g12/sub/100c/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x000070c0) // Found @0xff97d6c8 42 42 DEF(recreview_hold ,0x00003f50) // Found @0xff8a8134 43 DEF(palette_control ,0x0000a5dc) // Found @0xffa53c24 44 DEF(active_palette_buffer ,0x0000a5e4) // Found @0xffa53c28 45 DEF(palette_buffer ,0x000bbf5c) // Found @0xffa5415c 46 DEF(bitmap_buffer ,0x0000a618) // Found @0xffa57bb4 47 DEF(active_bitmap_buffer ,0x0000a610) // Found @0xffa57bb8 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/g12/sub/100c/stubs_min.S
r1641 r1814 3 3 DEF(rear_dial_position, 0xC0240106) 4 4 DEF(front_dial_position, 0xC0240306) 5 // bitmap_buffer & acive_bitmap_buffer (1.00c)6 // 0xa610 = 0 or 1, used as index into 0xa6187 // 0xa618 = 0x404710008 // 0xa61c = 0x404b0480 = 0x40471000 + bitmap size9 DEF(active_bitmap_buffer, 0xA610) // 0xA5FC+0x14 (1.00c sub_FFA57B64 -> FFA57B68 + FFA57BB8)10 DEF(bitmap_buffer, 0xA618) // FFA57BB411 DEF(palette_control, 0xA5DC) // sub_FFA53CDC (1.00c)12 DEF(active_palette_buffer, 0xA5E4) // sub_FFA53C24 (1.00c)13 DEF(palette_buffer, 0xBBF5C) // sub_FFA54118 (1.00c)14 5 DEF(viewport_buffers, 0xFFBB822C) // 1.00c sub_FF852148 (FF85243C) 15 6 DEF(active_viewport_buffer, 0x20AC) // 1.00c sub_FF852148 (FF85214C & FF852468) -
branches/reyalp-ptp-live/platform/g12/sub/100e/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x000070c0) // Found @0xff97d6c8 42 42 DEF(recreview_hold ,0x00003f50) // Found @0xff8a8134 43 DEF(palette_control ,0x0000a5dc) // Found @0xffa53c30 44 DEF(active_palette_buffer ,0x0000a5e4) // Found @0xffa53c34 45 DEF(palette_buffer ,0x000bbf5c) // Found @0xffa54168 46 DEF(bitmap_buffer ,0x0000a618) // Found @0xffa57bc0 47 DEF(active_bitmap_buffer ,0x0000a610) // Found @0xffa57bc4 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/g12/sub/100e/stubs_min.S
r1641 r1814 3 3 DEF(rear_dial_position, 0xC0240106) 4 4 DEF(front_dial_position, 0xC0240306) 5 DEF(active_bitmap_buffer, 0xA610) // 0xA5FC+0x14 (1.00e sub_FFA57B70 -> FFA57B74 + FFA57BC4)6 DEF(bitmap_buffer, 0xA618) // FFA57BC07 DEF(palette_control, 0xA5DC) // sub_FFA53CDC (1.00c)8 DEF(active_palette_buffer, 0xA5E4) // sub_FFA53C24 (1.00c)9 DEF(palette_buffer, 0xBBF5C) // sub_FFA54118 (1.00c)10 5 DEF(viewport_buffers, 0xFFBB83DC) // 1.00c sub_FF852148 (FF85243C) 11 6 DEF(active_viewport_buffer, 0x20AC) // 1.00c sub_FF852148 (FF85214C & FF852468) -
branches/reyalp-ptp-live/platform/g12/sub/100f/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x000070c0) // Found @0xff97d6c8 42 42 DEF(recreview_hold ,0x00003f50) // Found @0xff8a8134 43 DEF(palette_control ,0x0000a5dc) // Found @0xffa53c30 44 DEF(active_palette_buffer ,0x0000a5e4) // Found @0xffa53c34 45 DEF(palette_buffer ,0x000bbf5c) // Found @0xffa54168 46 DEF(bitmap_buffer ,0x0000a618) // Found @0xffa57bc0 47 DEF(active_bitmap_buffer ,0x0000a610) // Found @0xffa57bc4 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/g12/sub/100f/stubs_min.S
r1641 r1814 3 3 DEF(rear_dial_position, 0xC0240106) 4 4 DEF(front_dial_position, 0xC0240306) 5 DEF(active_bitmap_buffer, 0xA610) // 0xA5FC+0x14 (1.00f sub_FFA57B70 -> FFA57B74 + FFA57BC4)6 DEF(bitmap_buffer, 0xA618) // FFA57BC07 DEF(palette_control, 0xA5DC) // sub_FFA53CDC (1.00c)8 DEF(active_palette_buffer, 0xA5E4) // sub_FFA53C24 (1.00c)9 DEF(palette_buffer, 0xBBF5C) // sub_FFA54118 (1.00c)10 5 DEF(viewport_buffers, 0xFFBB83CC) // 1.00c sub_FF852148 (FF85243C) 11 6 DEF(active_viewport_buffer, 0x20AC) // 1.00c sub_FF852148 (FF85214C & FF852468) -
branches/reyalp-ptp-live/platform/g12/sub/100g/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x000070c0) // Found @0xff97d6c8 42 42 DEF(recreview_hold ,0x00003f50) // Found @0xff8a8134 43 DEF(palette_control ,0x0000a5dc) // Found @0xffa53c30 44 DEF(active_palette_buffer ,0x0000a5e4) // Found @0xffa53c34 45 DEF(palette_buffer ,0x000bbf5c) // Found @0xffa54168 46 DEF(bitmap_buffer ,0x0000a618) // Found @0xffa57bc0 47 DEF(active_bitmap_buffer ,0x0000a610) // Found @0xffa57bc4 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/g12/sub/100g/stubs_min.S
r1641 r1814 3 3 DEF(rear_dial_position, 0xC0240106) 4 4 DEF(front_dial_position, 0xC0240306) 5 DEF(active_bitmap_buffer, 0xA610) // 0xA5FC+0x14 (1.00g sub_FFA57B70 -> FFA57B74 + FFA57BC4)6 DEF(bitmap_buffer, 0xA618) // FFA57BC07 DEF(palette_control, 0xA5DC) // sub_FFA53CDC (1.00c)8 DEF(active_palette_buffer, 0xA5E4) // sub_FFA53C24 (1.00c)9 DEF(palette_buffer, 0xBBF5C) // sub_FFA54118 (1.00c)10 5 DEF(viewport_buffers, 0xFFBB83B8) // 1.00c sub_FF852148 (FF85243C) 11 6 DEF(active_viewport_buffer, 0x20AC) // 1.00c sub_FF852148 (FF85214C & FF852468) -
branches/reyalp-ptp-live/platform/ixus1000_sd4500/main.c
r1385 r1814 31 31 } 32 32 33 // Focus length table in firmware @0xfffe9eac 34 #define NUM_FL 101 // 0 - 100, entries in firmware 35 #define NUM_DATA 3 // 3 words each entry, first is FL 36 extern int focus_len_table[NUM_FL*NUM_DATA]; 33 37 34 //zoom position is get_parameter_data(87) 38 // Conversion factor lens FL --> 35mm equiv 39 // lens 35mm CF 40 // ---- ---- -- 41 // 6.3 36 ( 36/ 6.3) * 63 = 360 (min FL) 42 // 63.0 360 (360/63.0) * 63 = 360 (max FL) 43 #define CF_EFL 360 44 #define CF_EFL_DIV 63 35 45 36 // Ixus 1000 576 =1 37 static const struct { 38 int zp, fl; 39 } fl_tbl[] = { 40 { 0, 6300}, 41 { 5, 5*576+6300}, 42 { 10, 10*576+6300}, 43 { 20, 20*576+6300}, 44 { 30, 30*576+6300}, 45 { 40, 40*576+6300}, 46 { 50, 50*576+6300}, 47 { 60, 60*576+6300}, 48 { 70, 70*576+6300}, 49 { 80, 80*576+6300}, 50 { 90, 90*576+6300}, 51 { 100, 63000}, 52 }; 53 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 54 55 // Focal length range is 6.3 - 63,0 mm, 36.0 - 360 in 35-mm equivalent. for Ixus 1000 HS 56 57 // Focal length range is 6.0 - 70,0 mm, 27.3 - 392 in 35-mm equivalent. for Sx210 58 // So, CF_EFL = 27.3/5.0*10000=54600 or392/70*10000=56000 59 // diff = 54600 - 54566.6 = 1400, split it 1400 / 2 = 700 60 // add to base 56000 + 700 = 56700 61 // divide by 10 to avoid overflow in get_effective_focal_length() 62 #define CF_EFL 5714 63 const int zoom_points = 100; 46 const int zoom_points = NUM_FL; 64 47 65 48 int get_effective_focal_length(int zp) { 66 return (CF_EFL*get_focal_length(zp))/1000;49 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 67 50 } 68 51 69 52 int get_focal_length(int zp) { 70 int i; 71 72 if (zp<fl_tbl[0].zp) 73 return fl_tbl[0].fl; 74 else if (zp>fl_tbl[NUM_FL-1].zp) 75 return fl_tbl[NUM_FL-1].fl; 76 else 77 for (i=1; i<NUM_FL; ++i) { 78 if (zp==fl_tbl[i-1].zp) 79 return fl_tbl[i-1].fl; 80 else if (zp==fl_tbl[i].zp) 81 return fl_tbl[i].fl; 82 else if (zp<fl_tbl[i].zp) 83 return fl_tbl[i-1].fl+(zp-fl_tbl[i-1].zp)*(fl_tbl[i].fl-fl_tbl[i-1].fl)/(fl_tbl[i].zp-fl_tbl[i-1].zp); 84 } 85 return fl_tbl[NUM_FL-1].fl; 53 if (zp < 0) zp = 0; 54 else if (zp >= NUM_FL) zp = NUM_FL-1; 55 return focus_len_table[zp*NUM_DATA]; 86 56 } 87 57 88 58 int get_zoom_x(int zp) { 89 return get_focal_length(zp)*10/fl_tbl[0].fl;59 return get_focal_length(zp)*10/focus_len_table[0]; 90 60 } 91 92 61 93 62 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/ixus1000_sd4500/platform_camera.h
r1813 r1814 37 37 38 38 #undef CAM_CAN_SD_OVER_NOT_IN_MF 39 #define CAM_USE_ZOOM_FOR_MF 1 40 #define CAM_CAN_SD_OVER_IN_AF_LOCK 1 41 39 42 #undef CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 40 43 -
branches/reyalp-ptp-live/platform/ixus1000_sd4500/sub/100d/stubs_entry.S
r1641 r1814 42 42 DEF(focus_busy ,0x00007394) // Found @0xff972b30 43 43 //DEF(recreview_hold ,0x00004294) // Found @0xff8a8800, ** != ** stubs_min = 0x000087e0 (0x86F4+0xEC) 44 DEF(palette_control ,0x0000a338) // Found @0xffa2bd68 45 DEF(active_palette_buffer ,0x0000a340) // Found @0xffa2bd6c 46 DEF(palette_buffer ,0x000b84ac) // Found @0xffa2c2a0 47 DEF(bitmap_buffer ,0x0000a374) // Found @0xffa30f50 48 DEF(active_bitmap_buffer ,0x0000a36c) // Found @0xffa30f54 44 49 45 50 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/ixus1000_sd4500/sub/100f/stubs_entry.S
r1641 r1814 42 42 DEF(focus_busy ,0x00007394) // Found @0xff972b30 43 43 //DEF(recreview_hold ,0x00004294) // Found @0xff8a8800, ** != ** stubs_min = 0x000087e8 (0x86FC+0xEC) 44 DEF(palette_control ,0x0000a340) // Found @0xffa2bd6c 45 DEF(active_palette_buffer ,0x0000a348) // Found @0xffa2bd70 46 DEF(palette_buffer ,0x000b84ac) // Found @0xffa2c2a4 47 DEF(bitmap_buffer ,0x0000a37c) // Found @0xffa30f54 48 DEF(active_bitmap_buffer ,0x0000a374) // Found @0xffa30f58 44 49 45 50 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/ixus100_sd780/main.c
r1720 r1814 66 66 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 67 67 68 //SD780 is [f/3.2 is 6mm] [f/3.5 7mm] [f/4.5 11mm] [f/5 15mm] [f/5.8 18mm] 69 //SD780 is 5.9-17.9mm f/3.2-5.8 (35mm film equivalent: 33-100mm) 70 static const int fl_tbl[] = {5900,7170,8740,10550,12490,14780,17900}; 71 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 72 #define CF_EFL 55932 68 // Focus length table in firmware @0xfffe2a8c 69 #define NUM_FL 7 // 0 - 6, entries in firmware 70 #define NUM_DATA 3 // 3 words each entry, first is FL 71 extern int focus_len_table[NUM_FL*NUM_DATA]; 72 73 // Conversion factor lens FL --> 35mm equiv 74 // lens 35mm CF 75 // ---- ---- -- 76 // 5.9 33 ( 33/ 5.9) * 59 = 330 (min FL) 77 // 17.9 100 (100/17.9) * 59 = 329.6 (max FL) 78 #define CF_EFL 330 79 #define CF_EFL_DIV 59 73 80 74 81 const int zoom_points = NUM_FL; 75 82 76 83 int get_effective_focal_length(int zp) { 77 return (CF_EFL*get_focal_length(zp))/ 10000;84 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 78 85 } 79 86 80 87 int get_focal_length(int zp) { 81 if (zp <0) return fl_tbl[0];82 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];83 else return fl_tbl[zp];88 if (zp < 0) zp = 0; 89 else if (zp >= NUM_FL) zp = NUM_FL-1; 90 return focus_len_table[zp*NUM_DATA]; 84 91 } 85 92 86 93 int get_zoom_x(int zp) { 87 if (zp<1) return 10; 88 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 89 else return fl_tbl[zp]*10/fl_tbl[0]; 94 return get_focal_length(zp)*10/focus_len_table[0]; 90 95 } 91 96 -
branches/reyalp-ptp-live/platform/ixus120_sd940/main.c
r1421 r1814 28 28 } 29 29 30 // Focus length table in firmware @0xfffe2a8c 31 #define NUM_FL 10 // 0 - 9, entries in firmware 32 #define NUM_DATA 3 // 3 words each entry, first is FL 33 extern int focus_len_table[NUM_FL*NUM_DATA]; 30 34 31 32 static const int fl_tbl[] = {5000, 6000, 7000, 8000, 9500, 10900, 12800,15000,173000,20000}; 33 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 34 // SD940 focal length range is 5 - 20 mm 35 // So, CF_EFL = 15/5*10000=30000 36 #define CF_EFL 30000 35 // Conversion factor lens FL --> 35mm equiv 36 // lens 35mm CF 37 // ---- ---- -- 38 // 5.0 28 ( 28/ 5.0) * 50 = 280 (min FL) 39 // 20.0 112 (112/20.0) * 50 = 280 (max FL) 40 #define CF_EFL 280 41 #define CF_EFL_DIV 50 37 42 38 43 const int zoom_points = NUM_FL; 39 44 40 45 int get_effective_focal_length(int zp) { 41 return (CF_EFL*get_focal_length(zp))/ 10000;46 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 42 47 } 43 48 44 49 int get_focal_length(int zp) { 45 if (zp <0) return fl_tbl[0];46 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];47 else return fl_tbl[zp];50 if (zp < 0) zp = 0; 51 else if (zp >= NUM_FL) zp = NUM_FL-1; 52 return focus_len_table[zp*NUM_DATA]; 48 53 } 49 54 50 55 int get_zoom_x(int zp) { 51 if (zp<1) return 10; 52 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 53 else return fl_tbl[zp]*10/fl_tbl[0]; 56 return get_focal_length(zp)*10/focus_len_table[0]; 54 57 } 55 58 -
branches/reyalp-ptp-live/platform/ixus120_sd940/platform_camera.h
r1711 r1814 38 38 #define CAM_UNCACHED_BIT 0x40000000 39 39 #define CAM_HAS_ND_FILTER 1 40 40 #undef CAM_HAS_ERASE_BUTTON // Camera does not have a dedicated erase button 41 41 42 #define CAM_DNG_LENS_INFO { 50,10, 200,10, 28,10, 59,10 } // See comments in camera.h 42 43 // pattern -
branches/reyalp-ptp-live/platform/ixus200_sd980/main.c
r1212 r1814 28 28 } 29 29 30 // Focus length table in firmware @0xfffe2ac8 31 #define NUM_FL 12 // 0 - 11, entries in firmware 32 #define NUM_DATA 3 // 3 words each entry, first is FL 33 extern int focus_len_table[NUM_FL*NUM_DATA]; 30 34 31 32 static const int fl_tbl[] = {4000, 5000, 6000, 7000, 8000, 9000, 11000, 13000,15000,18000,22000}; 33 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 34 // SD980 focal length range is 4 - 22 mm 35 // So, CF_EFL = 22/4*10000=55000 36 #define CF_EFL 55000 35 // Conversion factor lens FL --> 35mm equiv 36 // lens 35mm CF 37 // ---- ---- -- 38 // 4.3 24 ( 24/ 4.3) * 43 = 240 (min FL) 39 // 21.5 120 (120/21.5) * 43 = 240 (max FL) 40 #define CF_EFL 240 41 #define CF_EFL_DIV 43 37 42 38 43 const int zoom_points = NUM_FL; 39 44 40 45 int get_effective_focal_length(int zp) { 41 return (CF_EFL*get_focal_length(zp))/ 10000;46 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 42 47 } 43 48 44 49 int get_focal_length(int zp) { 45 if (zp <0) return fl_tbl[0];46 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];47 else return fl_tbl[zp];50 if (zp < 0) zp = 0; 51 else if (zp >= NUM_FL) zp = NUM_FL-1; 52 return focus_len_table[zp*NUM_DATA]; 48 53 } 49 54 50 55 int get_zoom_x(int zp) { 51 if (zp<1) return 10; 52 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 53 else return fl_tbl[zp]*10/fl_tbl[0]; 56 return get_focal_length(zp)*10/focus_len_table[0]; 54 57 } 55 58 -
branches/reyalp-ptp-live/platform/ixus200_sd980/platform_camera.h
r1711 r1814 35 35 #define CAM_BRACKETING 1 36 36 #undef CAM_VIDEO_CONTROL 37 #undef CAM_HAS_IRIS_DIAPHRAGM38 37 #define CAM_MULTIPART 1 39 38 #define CAM_HAS_JOGDIAL 1 -
branches/reyalp-ptp-live/platform/ixus220_elph300hs/main.c
r1448 r1814 30 30 31 31 // Focus length table in firmware @0xfffea288 32 #define NUM_FL 60 // 0 - 59, entries in firmware (3 words each entry, first is FL) 33 extern int focus_len_table[NUM_FL*3]; 32 #define NUM_FL 64 // 0 - 63, entries in firmware 33 #define NUM_DATA 3 // 3 words each entry, first is FL 34 extern int focus_len_table[NUM_FL*NUM_DATA]; 34 35 36 // Conversion factor lens FL --> 35mm equiv 37 // lens 35mm CF 38 // ---- ---- -- 39 // 4.3 24 ( 24/ 4.3) * 43 = 240 (min FL) 40 // 21.5 120 (120/21.5) * 43 = 240 (max FL) 41 #define CF_EFL 240 42 #define CF_EFL_DIV 43 35 43 36 // Focal length range is 4.3 - 21.5 mm, 24 - 120 in 35-mm equivalent. 37 // So, CF_EFL = 21.5/4.3*10000=50000 or 120/24*10000=50000 38 // divide by 10 to avoid overflow in get_effective_focal_length() 39 #define CF_EFL 5000 40 const int zoom_points = 60; 44 const int zoom_points = NUM_FL; 41 45 42 46 int get_effective_focal_length(int zp) { 43 return (CF_EFL*get_focal_length(zp))/1000;47 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 44 48 } 45 49 46 50 int get_focal_length(int zp) { 47 if (zp < 0) zp = 0; 48 else if (zp >= NUM_FL) zp = NUM_FL-1; 49 return focus_len_table[zp*3]; 50 51 if (zp < 0) zp = 0; 52 else if (zp >= NUM_FL) zp = NUM_FL-1; 53 return focus_len_table[zp*NUM_DATA]; 51 54 } 52 55 53 56 int get_zoom_x(int zp) { 54 return get_focal_length(zp)*10/focus_len_table[0];57 return get_focal_length(zp)*10/focus_len_table[0]; 55 58 } 56 57 59 58 60 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/ixus220_elph300hs/sub/100c/stubs_entry.S
r1813 r1814 41 41 DEF(focus_busy ,0x00006b68) // Found @0xff97af60 42 42 DEF(recreview_hold ,0x00003828) // Found @0xff8a6510 43 DEF(palette_control ,0x00009d00) // Found @0xffa32d78 44 DEF(active_palette_buffer ,0x00009d08) // Found @0xffa32d7c 45 DEF(palette_buffer ,0x000bb254) // Found @0xffa33254 46 DEF(bitmap_buffer ,0x00009d40) // Found @0xffa36ca0 47 DEF(active_bitmap_buffer ,0x00009d38) // Found @0xffa36ca4 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/ixus220_elph300hs/sub/101a/stubs_entry.S
r1813 r1814 41 41 DEF(focus_busy ,0x00006b68) // Found @0xff97af60 42 42 DEF(recreview_hold ,0x00003828) // Found @0xff8a6510 43 DEF(palette_control ,0x00009d00) // Found @0xffa32d78 44 DEF(active_palette_buffer ,0x00009d08) // Found @0xffa32d7c 45 DEF(palette_buffer ,0x000bb254) // Found @0xffa33254 46 DEF(bitmap_buffer ,0x00009d40) // Found @0xffa36ca0 47 DEF(active_bitmap_buffer ,0x00009d38) // Found @0xffa36ca4 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/ixus220_elph300hs/sub/101c/stubs_entry.S
r1813 r1814 41 41 DEF(focus_busy ,0x00006b68) // Found @0xff97af60 42 42 DEF(recreview_hold ,0x00003828) // Found @0xff8a6510 43 DEF(palette_control ,0x00009d00) // Found @0xffa32d78 44 DEF(active_palette_buffer ,0x00009d08) // Found @0xffa32d7c 45 DEF(palette_buffer ,0x000bb254) // Found @0xffa33254 46 DEF(bitmap_buffer ,0x00009d40) // Found @0xffa36ca0 47 DEF(active_bitmap_buffer ,0x00009d38) // Found @0xffa36ca4 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/ixus220_elph300hs/sub/101g/stubs_entry.S
r1813 r1814 41 41 DEF(focus_busy ,0x00006b68) // Found @0xff97af60 42 42 DEF(recreview_hold ,0x00003828) // Found @0xff8a6510 43 DEF(palette_control ,0x00009d00) // Found @0xffa32d78 44 DEF(active_palette_buffer ,0x00009d08) // Found @0xffa32d7c 45 DEF(palette_buffer ,0x000bb254) // Found @0xffa33254 46 DEF(bitmap_buffer ,0x00009d40) // Found @0xffa36ca0 47 DEF(active_bitmap_buffer ,0x00009d38) // Found @0xffa36ca4 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/ixus230_elph310hs/main.c
r1567 r1814 29 29 } 30 30 31 // Focus length table in firmware @0xFFF4ABC8 32 #define NUM_FL 127 33 extern int focus_len_table[NUM_FL*3]; 31 // Focus length table in firmware @0xfff4abc8 32 #define NUM_FL 127 // 0 - 126, entries in firmware 33 #define NUM_DATA 2 // 2 words each entry, first is FL 34 extern int focus_len_table[NUM_FL*NUM_DATA]; 34 35 36 // Conversion factor lens FL --> 35mm equiv 37 // lens 35mm CF 38 // ---- ---- -- 39 // 5.0 28 ( 28/ 5.0) * 50 = 280 (min FL) 40 // 40.0 224 (224/40.0) * 50 = 280 (max FL) 41 #define CF_EFL 280 42 #define CF_EFL_DIV 50 35 43 36 // Focal length range is 5.0 - 40.0 mm, 28 - 224 in 35-mm equivalent.37 // So, CF_EFL = 28/5*10000=56000 or 224/40*10000=5600038 // divide by 10 to avoid overflow in get_effective_focal_length()39 #define CF_EFL 560040 44 const int zoom_points = NUM_FL; 41 45 42 46 int get_effective_focal_length(int zp) { 43 return (CF_EFL*get_focal_length(zp))/1000;47 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 44 48 } 45 49 46 50 int get_focal_length(int zp) { 47 if (zp < 0) zp = 0; 48 else if (zp >= NUM_FL) zp = NUM_FL-1; 49 return focus_len_table[zp*3]; 50 51 if (zp < 0) zp = 0; 52 else if (zp >= NUM_FL) zp = NUM_FL-1; 53 return focus_len_table[zp*NUM_DATA]; 51 54 } 52 55 53 56 int get_zoom_x(int zp) { 54 return get_focal_length(zp)*10/focus_len_table[0];57 return get_focal_length(zp)*10/focus_len_table[0]; 55 58 } 56 57 59 58 60 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/ixus230_elph310hs/sub/100b/stubs_entry.S
r1658 r1814 40 40 DEF(focus_busy ,0x00006a40) // Found @0xff17aa94 41 41 DEF(recreview_hold ,0x000038ec) // Found @0xff09a5d4 42 DEF(palette_control ,0x00009a2c) // Found @0xff22fc38 43 DEF(active_palette_buffer ,0x00009a34) // Found @0xff22fc3c 44 DEF(palette_buffer ,0x000b9c80) // Found @0xff230104 45 DEF(bitmap_buffer ,0x00009a70) // Found @0xff233948 46 DEF(active_bitmap_buffer ,0x00009a68) // Found @0xff23394c 42 47 43 48 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/ixus300_sd4000/main.c
r1377 r1814 33 33 } 34 34 35 // F/2.0 - 5.3 36 // 4.9 - 18.6mm 37 static const int fl_tbl[] = {5800, 6420, 7060, 7700, 8340, 9950, 11550, 13160, 14750, 17150, 19570, 22760, 26750, 30750, 34800}; // ToDo, convert a focus position to a focal length (* 1000), http://chdk.setepontos.com/index.php?topic=5722.msg59333#msg59333 38 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 39 #define CF_EFL 60345 // ToDo, convert a camera focal length to a 35mm effective focal length, http://chdk.setepontos.com/index.php?topic=5722.msg59333#msg59333 35 // Focus length table in firmware @0xfffe9718 36 #define NUM_FL 64 // 0 - 63, entries in firmware 37 #define NUM_DATA 3 // 3 words each entry, first is FL 38 extern int focus_len_table[NUM_FL*NUM_DATA]; 39 40 // Conversion factor lens FL --> 35mm equiv 41 // lens 35mm CF 42 // ---- ---- -- 43 // 4.9 28 ( 28/ 4.9) * 49 = 280 (min FL) 44 // 18.6 105 (105/18.6) * 49 = 276.6 (max FL) 45 #define CF_EFL 280 46 #define CF_EFL_DIV 49 40 47 41 48 const int zoom_points = NUM_FL; 42 49 43 // ToDo, http://chdk.setepontos.com/index.php?topic=5722.msg59333#msg5933344 50 int get_effective_focal_length(int zp) { 45 return (CF_EFL*get_focal_length(zp))/ 10000;51 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 46 52 } 47 53 48 // ToDo49 54 int get_focal_length(int zp) { 50 if (zp <0) return fl_tbl[0];51 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];52 else return fl_tbl[zp];55 if (zp < 0) zp = 0; 56 else if (zp >= NUM_FL) zp = NUM_FL-1; 57 return focus_len_table[zp*NUM_DATA]; 53 58 } 54 59 55 // ToDo56 60 int get_zoom_x(int zp) { 57 if (zp<1) return 10; 58 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 59 else return fl_tbl[zp]*10/fl_tbl[0]; 61 return get_focal_length(zp)*10/focus_len_table[0]; 60 62 } 61 63 -
branches/reyalp-ptp-live/platform/ixus300_sd4000/platform_camera.h
r1711 r1814 56 56 57 57 #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData to get camera name 58 59 #undef DNG_BADPIXEL_VALUE_LIMIT 60 #define DNG_BADPIXEL_VALUE_LIMIT 16 // Camera sensor apparently has bad pixels with value > 0 & <=16 58 61 59 62 #define CAM_DNG_LENS_INFO { 49,10, 186,10, 20,10, 53,10 } // See comments in camera.h -
branches/reyalp-ptp-live/platform/ixus310_elph500hs/main.c
r1339 r1814 28 28 } 29 29 30 // Focus length table in firmware @ 0xFFF4A30C 31 #define NUM_FL 64 // 0 - 63, entries in firmware (3 words each entry, first is FL) 32 extern int focus_len_table[NUM_FL*3]; 30 // Focus length table in firmware @0xfff4a30c 31 #define NUM_FL 64 // 0 - 63, entries in firmware 32 #define NUM_DATA 3 // 3 words each entry, first is FL 33 extern int focus_len_table[NUM_FL*NUM_DATA]; 33 34 34 35 // Conversion factor lens FL --> 35mm equiv 35 36 // lens 35mm CF 36 37 // ---- ---- -- 37 // 4.3 24 ( 24/4.3) * 430 = 2400 (min FL)38 // 18.8 105 (105/18.8) * 43 0 = 2401.6(max FL)39 #define CF_EFL 2402 // rounded up40 #define CF_EFL_DIV 43038 // 4.3 24 ( 24/ 4.3) * 43 = 240 (min FL) 39 // 18.8 105 (105/18.8) * 43 = 240.2 (max FL) 40 #define CF_EFL 240 41 #define CF_EFL_DIV 43 41 42 42 const int zoom_points = NUM_FL; // OK43 const int zoom_points = NUM_FL; 43 44 44 45 int get_effective_focal_length(int zp) { 45 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV;46 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 46 47 } 47 48 48 49 int get_focal_length(int zp) { 49 if (zp < 0) zp = 0;50 else if (zp >= NUM_FL) zp = NUM_FL-1;51 return focus_len_table[zp*3];50 if (zp < 0) zp = 0; 51 else if (zp >= NUM_FL) zp = NUM_FL-1; 52 return focus_len_table[zp*NUM_DATA]; 52 53 } 53 54 54 55 int get_zoom_x(int zp) { 55 return get_focal_length(zp)*10/focus_len_table[0];56 return get_focal_length(zp)*10/focus_len_table[0]; 56 57 } 57 58 -
branches/reyalp-ptp-live/platform/ixus310_elph500hs/sub/100a/stubs_entry.S
r1658 r1814 42 42 DEF(focus_busy ,0x00006e70) // Found @0xff173e9c 43 43 DEF(recreview_hold ,0x0000391c) // Found @0xff098530 44 DEF(palette_control ,0x0000a424) // Found @0xff244990 45 DEF(active_palette_buffer ,0x0000a42c) // Found @0xff244994 46 DEF(palette_buffer ,0x000c7dec) // Found @0xff244e6c 47 DEF(bitmap_buffer ,0x0000a464) // Found @0xff249aec 48 DEF(active_bitmap_buffer ,0x0000a45c) // Found @0xff249af0 44 49 45 50 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/ixus310_elph500hs/sub/100a/stubs_min.S
r1641 r1814 1 1 #include "stubs_asm.h" 2 2 3 DEF(active_bitmap_buffer, 0xA45C) // 0xA448+0x14 (1.00a sub_FF249A94 -> FF249A98 + FF249AF0)4 DEF(bitmap_buffer, 0xA464) // FF249AEC (1.00a)5 DEF(palette_control, 0xA424) // sub_FF244A48 (1.00a)6 DEF(active_palette_buffer, 0xA42C) // sub_FF244990 (1.00a)7 DEF(palette_buffer, 0xC7DEC) // sub_FF244E28 (1.00a)8 3 DEF(viewport_buffers, 0xFF3D0418) // 1.00a sub_FF0435C8 (FF043978) 9 4 DEF(active_viewport_buffer, 0x2104) // 1.00a sub_FF0435C8 (FF0435CC & FF043A28) -
branches/reyalp-ptp-live/platform/ixus310_elph500hs/sub/101a/stubs_entry.S
r1658 r1814 42 42 DEF(focus_busy ,0x00006e70) // Found @0xff173e9c 43 43 DEF(recreview_hold ,0x0000391c) // Found @0xff098530 44 DEF(palette_control ,0x0000a424) // Found @0xff244990 45 DEF(active_palette_buffer ,0x0000a42c) // Found @0xff244994 46 DEF(palette_buffer ,0x000c7dec) // Found @0xff244e6c 47 DEF(bitmap_buffer ,0x0000a464) // Found @0xff249aec 48 DEF(active_bitmap_buffer ,0x0000a45c) // Found @0xff249af0 44 49 45 50 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/ixus310_elph500hs/sub/101a/stubs_min.S
r1641 r1814 1 1 #include "stubs_asm.h" 2 2 3 DEF(active_bitmap_buffer, 0xA45C) // 0xA448+0x14 (1.01a sub_FF249A94 -> FF249A98 + FF249AF0)4 DEF(bitmap_buffer, 0xA464) // FF249AEC (1.00a)5 DEF(palette_control, 0xA424) // sub_FF244A48 (1.00a)6 DEF(active_palette_buffer, 0xA42C) // sub_FF244990 (1.00a)7 DEF(palette_buffer, 0xC7DEC) // sub_FF244E28 (1.00a)8 3 DEF(viewport_buffers, 0xFF3D0418) // 1.00a sub_FF0435C8 (FF043978) 9 4 DEF(active_viewport_buffer, 0x2104) // 1.00a sub_FF0435C8 (FF0435CC & FF043A28) -
branches/reyalp-ptp-live/platform/ixus310_elph500hs/sub/101c/stubs_entry.S
r1658 r1814 42 42 DEF(focus_busy ,0x00006e70) // Found @0xff173e9c 43 43 DEF(recreview_hold ,0x0000391c) // Found @0xff098530 44 DEF(palette_control ,0x0000a424) // Found @0xff244990 45 DEF(active_palette_buffer ,0x0000a42c) // Found @0xff244994 46 DEF(palette_buffer ,0x000c7dec) // Found @0xff244e6c 47 DEF(bitmap_buffer ,0x0000a464) // Found @0xff249aec 48 DEF(active_bitmap_buffer ,0x0000a45c) // Found @0xff249af0 44 49 45 50 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/ixus310_elph500hs/sub/101c/stubs_min.S
r1449 r1814 11 11 DEF(cds_gain_value ,0x0000abd0) 12 12 13 DEF(active_bitmap_buffer, 0xA45C) // 0xA448+0x14 (1.01a sub_FF249A94 -> FF249A98 + FF249AF0)14 DEF(bitmap_buffer, 0xA464) // FF249AEC (1.00a)15 DEF(palette_control, 0xA424) // sub_FF244A48 (1.00a)16 DEF(active_palette_buffer, 0xA42C) // sub_FF244990 (1.00a)17 DEF(palette_buffer, 0xC7DEC) // sub_FF244E28 (1.00a)18 13 DEF(viewport_buffers, 0xFF3D0428) // 1.00a sub_FF0435C8 (FF043978) 19 14 DEF(active_viewport_buffer, 0x2104) // 1.00a sub_FF0435C8 (FF0435CC & FF043A28) -
branches/reyalp-ptp-live/platform/ixus85_sd770/main.c
r1376 r1814 26 26 } 27 27 28 // Focus length table in firmware @0xfffe297c 29 #define NUM_FL 7 // 0 - 6, entries in firmware 30 #define NUM_DATA 3 // 3 words each entry, first is FL 31 extern int focus_len_table[NUM_FL*NUM_DATA]; 28 32 29 static const int fl_tbl[] = {6200, 7230, 8295, 9681, 11614, 14303, 18600}; 30 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 31 #define CF_EFL 56460 33 // Conversion factor lens FL --> 35mm equiv 34 // lens 35mm CF 35 // ---- ---- -- 36 // 6.2 35 ( 35/ 6.2) * 62 = 350 (min FL) 37 // 18.6 105 (105/18.6) * 62 = 350 (max FL) 38 #define CF_EFL 350 39 #define CF_EFL_DIV 62 32 40 33 41 const int zoom_points = NUM_FL; 34 42 35 int get_effective_focal_length(int zp) 36 { 37 return (CF_EFL*get_focal_length(zp))/10000; 43 int get_effective_focal_length(int zp) { 44 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 38 45 } 39 46 40 int get_focal_length(int zp) 41 { 42 if (zp<0) { 43 return fl_tbl[0]; 44 } else if (zp>NUM_FL-1) { 45 return fl_tbl[NUM_FL-1]; 46 } else { 47 return fl_tbl[zp]; 48 } 47 int get_focal_length(int zp) { 48 if (zp < 0) zp = 0; 49 else if (zp >= NUM_FL) zp = NUM_FL-1; 50 return focus_len_table[zp*NUM_DATA]; 49 51 } 50 52 51 int get_zoom_x(int zp) 52 { 53 if (zp<1) { 54 return 10; 55 } else if (zp>NUM_FL-1) { 56 return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 57 } else { 58 return fl_tbl[zp]*10/fl_tbl[0]; 59 } 53 int get_zoom_x(int zp) { 54 return get_focal_length(zp)*10/focus_len_table[0]; 60 55 } 61 56 -
branches/reyalp-ptp-live/platform/ixus860_sd870/main.c
r847 r1814 29 29 } 30 30 31 // Focus length table in firmware @0xfffe2990 32 #define NUM_FL 8 // 0 - 7, entries in firmware 33 #define NUM_DATA 3 // 3 words each entry, first is FL 34 extern int focus_len_table[NUM_FL*NUM_DATA]; 31 35 32 static const int fl_tbl[] = {4600, 6140, 7560, 9110, 10830, 12670, 14690, 17300}; 33 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 34 #define CF_EFL 60869 36 // Conversion factor lens FL --> 35mm equiv 37 // lens 35mm CF 38 // ---- ---- -- 39 // 4.6 28 ( 28/ 4.6) * 46 = 280 (min FL) 40 // 17.3 105 (105/17.3) * 46 = 279.2 (max FL) 41 #define CF_EFL 280 42 #define CF_EFL_DIV 46 35 43 36 44 const int zoom_points = NUM_FL; 37 45 38 46 int get_effective_focal_length(int zp) { 39 return (CF_EFL*get_focal_length(zp))/ 10000;47 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 40 48 } 41 49 42 50 int get_focal_length(int zp) { 43 if (zp <0) return fl_tbl[0];44 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];45 else return fl_tbl[zp];51 if (zp < 0) zp = 0; 52 else if (zp >= NUM_FL) zp = NUM_FL-1; 53 return focus_len_table[zp*NUM_DATA]; 46 54 } 47 55 48 56 int get_zoom_x(int zp) { 49 if (zp<1) return 10; 50 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 51 else return fl_tbl[zp]*10/fl_tbl[0]; 57 return get_focal_length(zp)*10/focus_len_table[0]; 52 58 } 53 59 -
branches/reyalp-ptp-live/platform/ixus95_sd1200/main.c
r1376 r1814 67 67 #define MODESCNT (sizeof(modemap)/sizeof(modemap[0])) 68 68 69 static const int fl_tbl[] = {6200,7230,8295,9681,11614,14303,18600}; 70 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 71 #define CF_EFL 56452 69 // Focus length table in firmware @0xfffe2a8c 70 #define NUM_FL 7 // 0 - 6, entries in firmware 71 #define NUM_DATA 3 // 3 words each entry, first is FL 72 extern int focus_len_table[NUM_FL*NUM_DATA]; 73 74 // Conversion factor lens FL --> 35mm equiv 75 // lens 35mm CF 76 // ---- ---- -- 77 // 6.2 35 ( 35/ 6.2) * 62 = 350 (min FL) 78 // 18.6 105 (105/18.6) * 62 = 350 (max FL) 79 #define CF_EFL 350 80 #define CF_EFL_DIV 62 72 81 73 82 const int zoom_points = NUM_FL; 74 83 75 84 int get_effective_focal_length(int zp) { 76 return (CF_EFL*get_focal_length(zp))/ 10000;85 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 77 86 } 78 87 79 88 int get_focal_length(int zp) { 80 if (zp <0) return fl_tbl[0];81 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];82 else return fl_tbl[zp];89 if (zp < 0) zp = 0; 90 else if (zp >= NUM_FL) zp = NUM_FL-1; 91 return focus_len_table[zp*NUM_DATA]; 83 92 } 84 93 85 94 int get_zoom_x(int zp) { 86 if (zp<1) return 10; 87 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 88 else return fl_tbl[zp]*10/fl_tbl[0]; 95 return get_focal_length(zp)*10/focus_len_table[0]; 89 96 } 90 97 -
branches/reyalp-ptp-live/platform/ixus960_sd950/main.c
r847 r1814 25 25 } 26 26 27 // Focus length table in firmware @0xfffe296c 28 #define NUM_FL 8 // 0 - 7, entries in firmware 29 #define NUM_DATA 3 // 3 words each entry, first is FL 30 extern int focus_len_table[NUM_FL*NUM_DATA]; 27 31 28 static const int fl_tbl[] = {7700, 9572, 11454, 13683, 16293, 19548, 23495, 28500}; 29 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 30 #define CF_EFL 60869 32 // Conversion factor lens FL --> 35mm equiv 33 // lens 35mm CF 34 // ---- ---- -- 35 // 7.7 36 ( 36/ 7.7) * 77 = 360 (min FL) 36 // 28.5 133 (133/28.5) * 77 = 359.3 (max FL) 37 #define CF_EFL 360 38 #define CF_EFL_DIV 77 39 31 40 const int zoom_points = NUM_FL; 41 32 42 int get_effective_focal_length(int zp) { 33 return (CF_EFL*get_focal_length(zp))/10000;43 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 34 44 } 45 35 46 int get_focal_length(int zp) { 36 if (zp<0) return fl_tbl[0];37 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1];38 else return fl_tbl[zp];47 if (zp < 0) zp = 0; 48 else if (zp >= NUM_FL) zp = NUM_FL-1; 49 return focus_len_table[zp*NUM_DATA]; 39 50 } 51 40 52 int get_zoom_x(int zp) { 41 if (zp<1) return 10; 42 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 43 else return fl_tbl[zp]*10/fl_tbl[0]; 53 return get_focal_length(zp)*10/focus_len_table[0]; 44 54 } 55 45 56 #if 0 46 57 int rec_switch_state(void) { -
branches/reyalp-ptp-live/platform/ixus970_sd890/main.c
r1377 r1814 26 26 } 27 27 28 // Focus length table in firmware @0xfffe297c 29 #define NUM_FL 12 // 0 - 11, entries in firmware 30 #define NUM_DATA 3 // 3 words each entry, first is FL 31 extern int focus_len_table[NUM_FL*NUM_DATA]; 28 32 29 static const int fl_tbl[] = {6600, 7800, 9000, 10300, 11900,13500, 15400, 17700, 20400, 23700, 28000, 33000}; 30 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 31 #define CF_EFL 56060 33 // Conversion factor lens FL --> 35mm equiv 34 // lens 35mm CF 35 // ---- ---- -- 36 // 6.6 37 ( 37/ 6.6) * 66 = 370 (min FL) 37 // 33.0 185 (185/33.0) * 66 = 370 (max FL) 38 #define CF_EFL 370 39 #define CF_EFL_DIV 66 32 40 33 41 const int zoom_points = NUM_FL; 34 42 35 int get_effective_focal_length(int zp) 36 { 37 return (CF_EFL*get_focal_length(zp))/10000; 43 int get_effective_focal_length(int zp) { 44 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 38 45 } 39 46 40 int get_focal_length(int zp) 41 { 42 if (zp<0) { 43 return fl_tbl[0]; 44 } else if (zp>NUM_FL-1) { 45 return fl_tbl[NUM_FL-1]; 46 } else { 47 return fl_tbl[zp]; 48 } 47 int get_focal_length(int zp) { 48 if (zp < 0) zp = 0; 49 else if (zp >= NUM_FL) zp = NUM_FL-1; 50 return focus_len_table[zp*NUM_DATA]; 49 51 } 50 52 51 int get_zoom_x(int zp) 52 { 53 if (zp<1) { 54 return 10; 55 } else if (zp>NUM_FL-1) { 56 return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 57 } else { 58 return fl_tbl[zp]*10/fl_tbl[0]; 59 } 53 int get_zoom_x(int zp) { 54 return get_focal_length(zp)*10/focus_len_table[0]; 60 55 } 61 56 -
branches/reyalp-ptp-live/platform/ixus980_sd990/main.c
r847 r1814 29 29 } 30 30 31 // from sd950, zoom steps and sensor size same 32 static const int fl_tbl[] = {7700, 9572, 11454, 13683, 16293, 19548, 23495, 28500}; 33 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 34 // sd950 uses wrong value 35 // #define CF_EFL 60869 36 // ewavr 37 // SD990 focal length range is 7,7 - 28,5 mm, 36 - 133 in 35-mm equivalent. 38 // So, CF_EFL = 36/7.7*10000=46753 or 133/28.5*10000=46666. 39 #define CF_EFL 46710 // split the difference 31 // Focus length table in firmware @0xfffe2a8c 32 #define NUM_FL 8 // 0 - 7, entries in firmware 33 #define NUM_DATA 3 // 3 words each entry, first is FL 34 extern int focus_len_table[NUM_FL*NUM_DATA]; 35 36 // Conversion factor lens FL --> 35mm equiv 37 // lens 35mm CF 38 // ---- ---- -- 39 // 7.7 36 ( 36/ 7.7) * 77 = 360 (min FL) 40 // 28.5 133 (133/28.5) * 77 = 359.3 (max FL) //360 on 133.2mm(T) 41 #define CF_EFL 360 42 #define CF_EFL_DIV 77 40 43 41 44 const int zoom_points = NUM_FL; 42 45 43 46 int get_effective_focal_length(int zp) { 44 return (CF_EFL*get_focal_length(zp))/ 10000;47 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 45 48 } 46 49 47 50 int get_focal_length(int zp) { 48 if (zp <0) return fl_tbl[0];49 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];50 else return fl_tbl[zp];51 if (zp < 0) zp = 0; 52 else if (zp >= NUM_FL) zp = NUM_FL-1; 53 return focus_len_table[zp*NUM_DATA]; 51 54 } 52 55 53 56 int get_zoom_x(int zp) { 54 if (zp<1) return 10; 55 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 56 else return fl_tbl[zp]*10/fl_tbl[0]; 57 return get_focal_length(zp)*10/focus_len_table[0]; 57 58 } 58 59 -
branches/reyalp-ptp-live/platform/s95/main.c
r1059 r1814 26 26 } 27 27 28 // Focus length table in firmware @0xfffe2d2c 29 #define NUM_FL 10 // 0 - 9, entries in firmware 30 #define NUM_DATA 3 // 3 words each entry, first is FL 31 extern int focus_len_table[NUM_FL*NUM_DATA]; 28 32 29 //zoom position is get_parameter_data(87) 30 static const struct { 31 int zp, fl; 32 } fl_tbl[] = { 33 { 0, 6000}, 34 { 1, 6850}, 35 { 2, 7490}, 36 { 3, 8560}, 37 { 4, 9640}, 38 { 5, 10700}, 39 { 6, 12850}, 40 { 7, 14980}, 41 { 8, 18190}, 42 { 9, 22500}, 43 }; 44 45 46 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 47 // S90 focal lenght range 6.0 - 22.5 mm (35 mm equivalent: 28 - 105 mm)(1/1.7" Type CCD, Scale Factor To 35 mm Equivalent: 4.6) 48 // 28/6,0*10000=46666 49 // 105/22,5*10000=46666 50 51 #define CF_EFL 46666 33 // Conversion factor lens FL --> 35mm equiv 34 // lens 35mm CF 35 // ---- ---- -- 36 // 6.0 28 ( 28/ 6.0) * 60 = 280 (min FL) 37 // 22.5 105 (105/22.5) * 60 = 280 (max FL) 38 #define CF_EFL 280 39 #define CF_EFL_DIV 60 52 40 53 41 const int zoom_points = NUM_FL; 54 42 55 43 int get_effective_focal_length(int zp) { 56 return (CF_EFL*get_focal_length(zp))/ 10000;44 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 57 45 } 58 46 59 47 int get_focal_length(int zp) { 60 int i; 61 62 if (zp<fl_tbl[0].zp) 63 return fl_tbl[0].fl; 64 else if (zp>fl_tbl[NUM_FL-1].zp) 65 return fl_tbl[NUM_FL-1].fl; 66 else { 67 for (i=1; i<NUM_FL; ++i) { 68 if (zp==fl_tbl[i-1].zp) 69 return fl_tbl[i-1].fl; 70 else if (zp==fl_tbl[i].zp) 71 return fl_tbl[i].fl; 72 else if (zp<fl_tbl[i].zp) 73 return fl_tbl[i-1].fl+(zp-fl_tbl[i-1].zp)*(fl_tbl[i].fl-fl_tbl[i-1].fl)/(fl_tbl[i].zp-fl_tbl[i-1].zp); 74 } 75 } 76 return fl_tbl[NUM_FL-1].fl; 48 if (zp < 0) zp = 0; 49 else if (zp >= NUM_FL) zp = NUM_FL-1; 50 return focus_len_table[zp*NUM_DATA]; 77 51 } 78 52 79 53 int get_zoom_x(int zp) { 80 return get_focal_length(zp)*10/fl_tbl[0].fl;54 return get_focal_length(zp)*10/focus_len_table[0]; 81 55 } 82 83 56 84 57 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/s95/sub/100e/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x00006f30) // Found @0xff97bec4 42 42 //DEF(recreview_hold ,0x00003e14) // Found @0xff8a8648, ** != ** stubs_min = 0x0000828c (0x81f8+0x94) 43 DEF(palette_control ,0x0000a0d4) // Found @0xffa47590 44 DEF(active_palette_buffer ,0x0000a0dc) // Found @0xffa47594 45 DEF(palette_buffer ,0x000bc434) // Found @0xffa47ac8 46 DEF(bitmap_buffer ,0x0000a110) // Found @0xffa4c778 47 DEF(active_bitmap_buffer ,0x0000a108) // Found @0xffa4c77c 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/s95/sub/100h/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x00006f30) // Found @0xff97bec4 42 42 //DEF(recreview_hold ,0x00003e14) // Found @0xff8a8648, ** != ** stubs_min = 0x000082e0 (0x81f8+0xE8) 43 DEF(palette_control ,0x0000a0d4) // Found @0xffa4759c 44 DEF(active_palette_buffer ,0x0000a0dc) // Found @0xffa475a0 45 DEF(palette_buffer ,0x000bc434) // Found @0xffa47ad4 46 DEF(bitmap_buffer ,0x0000a110) // Found @0xffa4c784 47 DEF(active_bitmap_buffer ,0x0000a108) // Found @0xffa4c788 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/s95/sub/100i/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x00006f30) // Found @0xff97bec4 42 42 //DEF(recreview_hold ,0x00003e14) // Found @0xff8a8648, ** != ** stubs_min = 0x000082e0 (0x81f8+0xE8) 43 DEF(palette_control ,0x0000a0d4) // Found @0xffa4759c 44 DEF(active_palette_buffer ,0x0000a0dc) // Found @0xffa475a0 45 DEF(palette_buffer ,0x000bc434) // Found @0xffa47ad4 46 DEF(bitmap_buffer ,0x0000a110) // Found @0xffa4c784 47 DEF(active_bitmap_buffer ,0x0000a108) // Found @0xffa4c788 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/s95/sub/100k/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x00006f30) // Found @0xff97bec4 42 42 //DEF(recreview_hold ,0x00003e14) // Found @0xff8a8648, ** != ** stubs_min = 0x000082e0 (0x81f8+0xE8) 43 DEF(palette_control ,0x0000a0d4) // Found @0xffa4759c 44 DEF(active_palette_buffer ,0x0000a0dc) // Found @0xffa475a0 45 DEF(palette_buffer ,0x000bc434) // Found @0xffa47ad4 46 DEF(bitmap_buffer ,0x0000a110) // Found @0xffa4c784 47 DEF(active_bitmap_buffer ,0x0000a108) // Found @0xffa4c788 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx100is/main.c
r847 r1814 29 29 } 30 30 31 // Focus length table in firmware @0xfffe31ac 32 #define NUM_FL 23 // 0 - 22, entries in firmware 33 #define NUM_DATA 3 // 3 words each entry, first is FL 34 extern int focus_len_table[NUM_FL*NUM_DATA]; 31 35 32 static const int fl_tbl[] = {6000, 6700, 7300, 8200, 9100, 10300, 11500, 12800, 14400, 16100, 18100, 20100, 22400, 25200, 28100, 31500, 34900, 38900, 42500, 46600, 51100, 55900, 60000}; 33 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 34 #define CF_EFL 6000 36 // Conversion factor lens FL --> 35mm equiv 37 // lens 35mm CF 38 // ---- ---- -- 39 // 6.0 36 ( 36/ 6.0) * 60 = 360 (min FL) 40 // 60.0 360 (360/60.0) * 60 = 360 (max FL) 41 #define CF_EFL 360 42 #define CF_EFL_DIV 60 35 43 36 44 const int zoom_points = NUM_FL; 37 45 38 46 int get_effective_focal_length(int zp) { 39 return (CF_EFL*get_focal_length(zp))/ 1000;47 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 40 48 } 41 49 42 50 int get_focal_length(int zp) { 43 if (zp <0) return fl_tbl[0];44 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];45 else return fl_tbl[zp];51 if (zp < 0) zp = 0; 52 else if (zp >= NUM_FL) zp = NUM_FL-1; 53 return focus_len_table[zp*NUM_DATA]; 46 54 } 47 55 48 56 int get_zoom_x(int zp) { 49 if (zp<1) return 10; 50 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 51 else return fl_tbl[zp]*10/fl_tbl[0]; 57 return get_focal_length(zp)*10/focus_len_table[0]; 52 58 } 53 59 -
branches/reyalp-ptp-live/platform/sx110is/main.c
r847 r1814 29 29 } 30 30 31 // Focus length table in firmware @0xfffe31bc 32 #define NUM_FL 23 // 0 - 22, entries in firmware 33 #define NUM_DATA 3 // 3 words each entry, first is FL 34 extern int focus_len_table[NUM_FL*NUM_DATA]; 31 35 32 //fl_tbl still the same as sx100 33 static const int fl_tbl[] = {6000, 6700, 7300, 8200, 9100, 10300, 11500, 12800, 14400, 16100, 18100, 20100, 22400, 25200, 28100, 31500, 34900, 38900, 42500, 46600, 51100, 55900, 60000}; 34 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 35 //#define CF_EFL 6000 36 #define CF_EFL 5600 // 1/2.3" as sx10 36 // Conversion factor lens FL --> 35mm equiv 37 // lens 35mm CF 38 // ---- ---- -- 39 // 6.0 36 ( 36/ 6.0) * 60 = 360 (min FL) 40 // 60.0 360 (360/60.0) * 60 = 360 (max FL) 41 #define CF_EFL 360 42 #define CF_EFL_DIV 60 37 43 38 44 const int zoom_points = NUM_FL; 39 45 40 46 int get_effective_focal_length(int zp) { 41 return (CF_EFL*get_focal_length(zp))/1000;47 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 42 48 } 43 49 44 50 int get_focal_length(int zp) { 45 if (zp <0) return fl_tbl[0];46 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];47 else return fl_tbl[zp];51 if (zp < 0) zp = 0; 52 else if (zp >= NUM_FL) zp = NUM_FL-1; 53 return focus_len_table[zp*NUM_DATA]; 48 54 } 49 55 50 56 int get_zoom_x(int zp) { 51 if (zp<1) return 10; 52 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 53 else return fl_tbl[zp]*10/fl_tbl[0]; 57 return get_focal_length(zp)*10/focus_len_table[0]; 54 58 } 55 59 -
branches/reyalp-ptp-live/platform/sx120is/main.c
r1527 r1814 29 29 } 30 30 31 // from sx100 32 //fl_tbl still the same as sx100 33 static const int fl_tbl[] = {6000, 6700, 7300, 8200, 9100, 10300, 11500, 12800, 14400, 16100, 18100, 20100, 22400, 25200, 28100, 31500, 34900, 38900, 42500, 46600, 51100, 55900, 60000}; 34 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 35 //#define CF_EFL 6000 36 #define CF_EFL 5600 // 1/2.3" as sx10 31 // Focus length table in firmware @0xfffe328c 32 #define NUM_FL 23 // 0 - 22, entries in firmware 33 #define NUM_DATA 3 // 3 words each entry, first is FL 34 extern int focus_len_table[NUM_FL*NUM_DATA]; 35 36 // Conversion factor lens FL --> 35mm equiv 37 // lens 35mm CF 38 // ---- ---- -- 39 // 6.0 36 ( 36/ 6.0) * 60 = 360 (min FL) 40 // 60.0 360 (360/60.0) * 60 = 360 (max FL) 41 #define CF_EFL 360 42 #define CF_EFL_DIV 60 37 43 38 44 const int zoom_points = NUM_FL; 39 45 40 46 int get_effective_focal_length(int zp) { 41 return (CF_EFL*get_focal_length(zp))/1000;47 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 42 48 } 43 49 44 50 int get_focal_length(int zp) { 45 if (zp <0) return fl_tbl[0];46 else if (zp >NUM_FL-1) return fl_tbl[NUM_FL-1];47 else return fl_tbl[zp];51 if (zp < 0) zp = 0; 52 else if (zp >= NUM_FL) zp = NUM_FL-1; 53 return focus_len_table[zp*NUM_DATA]; 48 54 } 49 55 50 56 int get_zoom_x(int zp) { 51 if (zp<1) return 10; 52 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; 53 else return fl_tbl[zp]*10/fl_tbl[0]; 57 return get_focal_length(zp)*10/focus_len_table[0]; 54 58 } 55 56 //end sx10057 58 59 59 60 60 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/sx130is/main.c
r1161 r1814 26 26 } 27 27 28 // Focus length table in firmware @0xfffe94ec 29 #define NUM_FL 128 // 0 - 127, entries in firmware 30 #define NUM_DATA 3 // 3 words each entry, first is FL 31 extern int focus_len_table[NUM_FL*NUM_DATA]; 28 32 29 //zoom position is get_parameter_data(87) 30 static const struct { 31 int zp, fl; 32 } fl_tbl[] = { 33 { 0, 5000}, 34 { 16, 8225}, 35 { 32, 13080}, 36 { 48, 20270}, 37 { 64, 29150}, 38 { 80, 38125}, 39 { 96, 45750}, 40 { 112, 51650}, 41 { 127, 60000} 42 }; 33 // Conversion factor lens FL --> 35mm equiv 34 // lens 35mm CF 35 // ---- ---- -- 36 // 5.0 28 ( 28/ 5.0) * 50 = 280 (min FL) 37 // 60.0 336 (336/60.0) * 50 = 280 (max FL) 38 #define CF_EFL 280 39 #define CF_EFL_DIV 50 43 40 44 45 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 46 47 // SX130 focal lenght range 5.0 - 60 mm (35 mm equivalent: 28 - 336 mm)(1/2.3" Type CCD, Scale Factor To 35 mm Equivalent: 5.6) 48 // 28/5.0*100=560 49 // 336/60*100=560 50 #define CF_EFL 560 51 52 const int zoom_points = 128; 41 const int zoom_points = NUM_FL; 53 42 54 43 int get_effective_focal_length(int zp) { 55 return (CF_EFL*get_focal_length(zp))/ 100;44 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 56 45 } 57 46 58 47 int get_focal_length(int zp) { 59 int i; 60 61 if (zp<fl_tbl[0].zp) 62 return fl_tbl[0].fl; 63 else if (zp>fl_tbl[NUM_FL-1].zp) 64 return fl_tbl[NUM_FL-1].fl; 65 else { 66 for (i=1; i<NUM_FL; ++i) { 67 if (zp==fl_tbl[i-1].zp) 68 return fl_tbl[i-1].fl; 69 else if (zp==fl_tbl[i].zp) 70 return fl_tbl[i].fl; 71 else if (zp<fl_tbl[i].zp) 72 return fl_tbl[i-1].fl+(zp-fl_tbl[i-1].zp)*(fl_tbl[i].fl-fl_tbl[i-1].fl)/(fl_tbl[i].zp-fl_tbl[i-1].zp); 73 } 74 } 75 return fl_tbl[NUM_FL-1].fl; 48 if (zp < 0) zp = 0; 49 else if (zp >= NUM_FL) zp = NUM_FL-1; 50 return focus_len_table[zp*NUM_DATA]; 76 51 } 77 52 78 53 int get_zoom_x(int zp) { 79 return get_focal_length(zp)*10/fl_tbl[0].fl;54 return get_focal_length(zp)*10/focus_len_table[0]; 80 55 } 81 82 56 83 57 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/sx130is/sub/101c/stubs_entry.S
r1641 r1814 45 45 DEF(focus_busy ,0x00006978) // Found @0xff95fd2c 46 46 //DEF(recreview_hold ,0x00003a50) // Found @0xff89d940, ** != ** stubs_min = 0x000079d0 (0x78E4+0xEC) 47 DEF(palette_control ,0x00009458) // Found @0xffa093d0 48 DEF(active_palette_buffer ,0x00009460) // Found @0xffa093d4 49 DEF(palette_buffer ,0x000b3a58) // Found @0xffa0978c 47 50 48 51 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx130is/sub/101d/stubs_entry.S
r1641 r1814 45 45 DEF(focus_busy ,0x00006978) // Found @0xff95fd2c 46 46 //DEF(recreview_hold ,0x00003a50) // Found @0xff89d940, ** != ** stubs_min = 0x000079d0 (0x78E4+0xEC) 47 DEF(palette_control ,0x00009458) // Found @0xffa093d0 48 DEF(active_palette_buffer ,0x00009460) // Found @0xffa093d4 49 DEF(palette_buffer ,0x000b3a58) // Found @0xffa0978c 47 50 48 51 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx130is/sub/101f/stubs_entry.S
r1641 r1814 42 42 DEF(focus_busy ,0x00006978) // Found @0xff95fd2c 43 43 //DEF(recreview_hold ,0x00003a50) // Found @0xff89d940, ** != ** stubs_min = 0x000079d0 (0x78E4+0xEC) 44 DEF(palette_control ,0x00009458) // Found @0xffa093d0 45 DEF(active_palette_buffer ,0x00009460) // Found @0xffa093d4 46 DEF(palette_buffer ,0x000b3a58) // Found @0xffa0978c 44 47 45 48 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx150is/kbd.c
r1607 r1814 18 18 static KeyMap keymap[]; 19 19 static long last_kbd_key = 0; 20 static long alt_mode_key_mask = 0x00005000;21 static long alt_mode_key_reg = 2;22 20 23 21 volatile int jogdial_stopped=0; … … 26 24 #define KEYS_MASK0 (0x00000000) 27 25 #define KEYS_MASK1 (0x0000F000) 28 #define KEYS_MASK2 (0x00007F 00)26 #define KEYS_MASK2 (0x00007F50) 29 27 30 28 #define SD_READONLY_FLAG (0x20000) // Found @0xffb90df0, levent 0x20a … … 51 49 // always pressed if KEY_SHOOT_FULL is. --MarcusSt 52 50 { 2, KEY_VIDEO , 0x00000010 }, 53 { 2, KEY_PLAYBACK , 0x00000040 }, 51 { 2, KEY_PRINT , 0x00000040 }, // playback 52 { 2, KEY_PLAYBACK , 0x00000040 }, // alias so script can use it TODO not clear if wee need PRINT version 54 53 { 2, KEY_UP , 0x00000100 }, 55 54 { 2, KEY_DOWN , 0x00000200 }, … … 58 57 { 2, KEY_SET , 0x00001000 }, 59 58 { 2, KEY_MENU , 0x00002000 }, 60 { 2, KEY_PRINT , 0x00005000 }, // SET+DISP61 59 { 2, KEY_DISPLAY , 0x00004000 }, 62 60 { 2, KEY_ERASE , 0x00008000 }, … … 134 132 physw_status[1] = kbd_new_state[1]; 135 133 physw_status[2] = kbd_new_state[2]; 136 //physw_status[0] |= alt_mode_key_mask;137 134 jogdial_stopped=0; 138 135 } … … 162 159 } 163 160 161 // NOP 164 162 void kbd_set_alt_mode_key_mask(long key) 165 163 { 166 int i;167 for (i=0; keymap[i].hackkey; ++i) {168 if (keymap[i].hackkey == key) {169 alt_mode_key_mask = keymap[i].canonkey;170 alt_mode_key_reg = keymap[i].grp;171 return;172 }173 }174 164 } 175 165 -
branches/reyalp-ptp-live/platform/sx150is/main.c
r1415 r1814 26 26 } 27 27 28 // Focus length table in firmware @0xfffeabd8 29 #define NUM_FL 128 // 0 - 127, entries in firmware 30 #define NUM_DATA 2 // 2 words each entry, first is FL 31 extern int focus_len_table[NUM_FL*NUM_DATA]; 28 32 29 //zoom position is get_parameter_data(87) 30 static const struct { 31 int zp, fl; 32 } fl_tbl[] = { 33 { 0, 5000}, 34 { 16, 8225}, 35 { 32, 13080}, 36 { 48, 20270}, 37 { 64, 29150}, 38 { 80, 38125}, 39 { 96, 45750}, 40 { 112, 51650}, 41 { 127, 60000} 42 }; 33 // Conversion factor lens FL --> 35mm equiv 34 // lens 35mm CF 35 // ---- ---- -- 36 // 5.0 28 ( 28/ 5.0) * 50 = 280 (min FL) 37 // 60.0 336 (336/60.0) * 50 = 280 (max FL) 38 #define CF_EFL 280 39 #define CF_EFL_DIV 50 43 40 44 45 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 46 47 // SX150 focal lenght range 5.0 - 60 mm (35 mm equivalent: 28 - 336 mm)(1/2.3" Type CCD, Scale Factor To 35 mm Equivalent: 5.6) 48 // 28/5.0*100=560 49 // 336/60*100=560 50 #define CF_EFL 560 51 52 const int zoom_points = 128; 41 const int zoom_points = NUM_FL; 53 42 54 43 int get_effective_focal_length(int zp) { 55 return (CF_EFL*get_focal_length(zp))/ 100;44 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 56 45 } 57 46 58 47 int get_focal_length(int zp) { 59 int i; 60 61 if (zp<fl_tbl[0].zp) 62 return fl_tbl[0].fl; 63 else if (zp>fl_tbl[NUM_FL-1].zp) 64 return fl_tbl[NUM_FL-1].fl; 65 else { 66 for (i=1; i<NUM_FL; ++i) { 67 if (zp==fl_tbl[i-1].zp) 68 return fl_tbl[i-1].fl; 69 else if (zp==fl_tbl[i].zp) 70 return fl_tbl[i].fl; 71 else if (zp<fl_tbl[i].zp) 72 return fl_tbl[i-1].fl+(zp-fl_tbl[i-1].zp)*(fl_tbl[i].fl-fl_tbl[i-1].fl)/(fl_tbl[i].zp-fl_tbl[i-1].zp); 73 } 74 } 75 return fl_tbl[NUM_FL-1].fl; 48 if (zp < 0) zp = 0; 49 else if (zp >= NUM_FL) zp = NUM_FL-1; 50 return focus_len_table[zp*NUM_DATA]; 76 51 } 77 52 78 53 int get_zoom_x(int zp) { 79 return get_focal_length(zp)*10/fl_tbl[0].fl;54 return get_focal_length(zp)*10/focus_len_table[0]; 80 55 } 81 82 56 83 57 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/sx150is/notes.txt
r1761 r1814 3 3 * DryOS R39 Camera 4 4 --- 5 Alt shortcut: disp+set6 Note, you can hold either one and click the other 5 Alt shortcut: 6 adjustable, default is the play button. Hold for 1/2 second for original function 7 7 8 8 This camera is able to boot from FAT32 cards when the appropriate BOOTDISK string is written -
branches/reyalp-ptp-live/platform/sx150is/platform_camera.h
r1711 r1814 36 36 #undef CAM_UNCACHED_BIT 37 37 #define CAM_UNCACHED_BIT 0x40000000 38 39 #define CAM_ADJUSTABLE_ALT_BUTTON 1 38 40 39 41 #define CAM_DNG_LENS_INFO { 50,10, 600,10, 34,10, 56,10 } // See comments in camera.h -
branches/reyalp-ptp-live/platform/sx150is/sub/100a/stubs_entry.S
r1658 r1814 40 40 DEF(focus_busy ,0x00006c5c) // Found @0xff97b73c 41 41 DEF(recreview_hold ,0x00003b7c) // Found @0xff8a6484 42 DEF(palette_control ,0x00009654) // Found @0xffa29f88 43 //DEF(active_palette_buffer ,0x0000965c) // Found @0xffa29f8c, ** != ** stubs_min = 0x00009654 (0x9654) 44 //DEF(palette_buffer ,0x000baa84) // Found @0xffa2a340, stubs_min = 0x000baa84 (0xBAA84) 42 45 43 46 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx220hs/kbd.c
r1568 r1814 17 17 static KeyMap keymap[]; 18 18 static long last_kbd_key = 0; 19 20 static long alt_mode_key_mask = 0x00010800; // disp + set21 19 static int alt_mode_led=0; 22 20 extern void _GetKbdState(long*); … … 50 48 static KeyMap keymap[] = { 51 49 52 /* tiny bug: key order matters. see kbd_get_pressed_key() 53 * for example*/ 54 55 56 { 0, KEY_ZOOM_OUT , 0x00000001 }, 57 { 0, KEY_ZOOM_OUT1 , 0x00000001 }, 58 { 0, KEY_ZOOM_OUT , 0x00000002 }, 59 { 0, KEY_ZOOM_OUT3 , 0x00000002 }, 60 { 0, KEY_ZOOM_OUT , 0x00000003 }, 61 { 0, KEY_ZOOM_OUT2 , 0x00000003 }, 62 { 0, KEY_ZOOM_IN , 0x00000004 }, 63 { 0, KEY_ZOOM_IN1 , 0x00000004 }, 64 { 0, KEY_ZOOM_IN , 0x00000008 }, 65 { 0, KEY_ZOOM_IN3 , 0x00000008 }, 66 { 0, KEY_ZOOM_IN , 0x0000000C }, 67 { 0, KEY_ZOOM_IN2 , 0x0000000C }, 68 { 0, KEY_DISPLAY , 0x00000800 }, 69 { 0, KEY_UP , 0x00001000 }, 70 { 0, KEY_RIGHT , 0x00006000 }, 71 { 0, KEY_SET , 0x00010000 }, 72 { 0, KEY_PRINT , 0x00010800 }, //DISP+SET for ALT menu 73 { 0, KEY_DOWN , 0x00020000 }, 74 { 0, KEY_MENU , 0x00040000 }, 75 { 0, KEY_VIDEO , 0x00080000 }, 76 { 0, KEY_RIGHT_SOFT , 0x00002000 }, 77 { 0, KEY_UP_SOFT , 0x00000400 }, 78 { 0, KEY_DOWN_SOFT , 0x00008000 }, 79 80 { 2, KEY_LEFT_SOFT , 0x00000080 }, 81 { 2, KEY_LEFT , 0x00000100 }, 82 { 2, KEY_SHOOT_FULL , 0x00002002 }, 83 { 2, KEY_SHOOT_FULL_ONLY , 0x00000002 }, 84 { 2, KEY_SHOOT_HALF , 0x00002000 }, 85 86 { 1, KEY_PLAYBACK , 0x00200000 }, 87 88 { 0, 0, 0 } 50 /* tiny bug: key order matters. see kbd_get_pressed_key() 51 * for example*/ 52 53 { 0, KEY_ZOOM_OUT , 0x00000001 }, 54 { 0, KEY_ZOOM_OUT1 , 0x00000001 }, 55 { 0, KEY_ZOOM_OUT , 0x00000002 }, 56 { 0, KEY_ZOOM_OUT3 , 0x00000002 }, 57 { 0, KEY_ZOOM_OUT , 0x00000003 }, 58 { 0, KEY_ZOOM_OUT2 , 0x00000003 }, 59 { 0, KEY_ZOOM_IN , 0x00000004 }, 60 { 0, KEY_ZOOM_IN1 , 0x00000004 }, 61 { 0, KEY_ZOOM_IN , 0x00000008 }, 62 { 0, KEY_ZOOM_IN3 , 0x00000008 }, 63 { 0, KEY_ZOOM_IN , 0x0000000C }, 64 { 0, KEY_ZOOM_IN2 , 0x0000000C }, 65 { 0, KEY_DISPLAY , 0x00000800 }, 66 { 0, KEY_UP , 0x00001000 }, 67 { 0, KEY_RIGHT , 0x00006000 }, 68 { 0, KEY_SET , 0x00010000 }, 69 { 0, KEY_DOWN , 0x00020000 }, 70 { 0, KEY_MENU , 0x00040000 }, 71 { 0, KEY_VIDEO , 0x00080000 }, 72 // { 0, KEY_RIGHT_SOFT , 0x00002000 }, //soft keys commented out but still counted in the keymasks, seems to disable them like we want. 73 // { 0, KEY_UP_SOFT , 0x00000400 }, //if enabled can cause unintentional button presses in alt menu when rotating the jogdial really fast. 74 // { 0, KEY_DOWN_SOFT , 0x00008000 }, 75 76 { 1, KEY_PRINT , 0x00200000 }, // playback = alt button 77 { 1, KEY_PLAYBACK , 0x00200000 }, 78 79 // { 2, KEY_LEFT_SOFT , 0x00000080 }, 80 { 2, KEY_LEFT , 0x00000100 }, 81 { 2, KEY_SHOOT_FULL , 0x00002002 }, 82 { 2, KEY_SHOOT_FULL_ONLY , 0x00000002 }, 83 { 2, KEY_SHOOT_HALF , 0x00002000 }, 84 85 { 0, 0, 0 } 89 86 }; 90 87 88 // NOP 91 89 void kbd_set_alt_mode_key_mask(long key) 92 90 { 93 int i;94 for (i=0; keymap[i].hackkey; ++i) {95 if (keymap[i].hackkey == key) {96 alt_mode_key_mask = keymap[i].canonkey;97 return;98 }99 }100 91 } 101 92 -
branches/reyalp-ptp-live/platform/sx220hs/main.c
r1230 r1814 29 29 } 30 30 31 // Focus length table in firmware @FFF4A3DC //sx220. like in g12 and sx30 32 #define NUM_FL 126 // 0 - 125, entries in firmware (3 words each entry, first is FL) 33 extern int focus_len_table[NUM_FL*3]; 31 // Focus length table in firmware @FFF4A3DC 32 #define NUM_FL 126 // 0 - 125, entries in firmware 33 #define NUM_DATA 3 // 3 words each entry, first is FL 34 extern int focus_len_table[NUM_FL*NUM_DATA]; 34 35 36 // Conversion factor lens FL --> 35mm equiv 37 // lens 35mm CF 38 // ---- ---- -- 39 // 5.0 28 ( 28/ 5.0) * 50 = 280 (min FL) 40 // 70.0 392 (392/70.0) * 50 = 280 (max FL) 41 #define CF_EFL 280 42 #define CF_EFL_DIV 50 35 43 36 // Focal length range is 5.0 - 70,0 mm, 28 - 392 in 35-mm equivalent. 37 // So, CF_EFL = 28/5.0*10000=56000 or392/70*10000=56000 38 // divide by 10 to avoid overflow in get_effective_focal_length() 39 #define CF_EFL 5600 40 const int zoom_points = 126; 44 const int zoom_points = NUM_FL; 41 45 42 46 int get_effective_focal_length(int zp) { 43 return (CF_EFL*get_focal_length(zp))/1000;47 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 44 48 } 45 49 46 50 int get_focal_length(int zp) { 47 if (zp < 0) zp = 0; 48 else if (zp >= NUM_FL) zp = NUM_FL-1; 49 return focus_len_table[zp*3]; 50 51 if (zp < 0) zp = 0; 52 else if (zp >= NUM_FL) zp = NUM_FL-1; 53 return focus_len_table[zp*NUM_DATA]; 51 54 } 52 55 53 56 int get_zoom_x(int zp) { 54 return get_focal_length(zp)*10/focus_len_table[0];57 return get_focal_length(zp)*10/focus_len_table[0]; 55 58 } 56 57 59 58 60 long get_vbatt_min() -
branches/reyalp-ptp-live/platform/sx220hs/notes.txt
r1230 r1814 2 2 SX220 HS Notes 3 3 4 To enter CHDK <Alt> mode use the DISP+SETbutton.4 To enter CHDK <Alt> mode use the playback button. 5 5 6 6 Support for dual partition is not available. -
branches/reyalp-ptp-live/platform/sx220hs/platform_camera.h
r1711 r1814 110 110 #define REMOTE_SYNC_STATUS_LED 0xC0220130 // specifies an LED that turns on while camera waits for USB remote to sync 111 111 112 #define DRAW_ON_ACTIVE_BITMAP_BUFFER_ONLY 1 112 113 //---------------------------------------------------------- -
branches/reyalp-ptp-live/platform/sx220hs/sub/100a/stubs_entry.S
r1658 r1814 49 49 DEF(focus_busy ,0x00008338) // Found @0xff17c768 50 50 //DEF(recreview_hold ,0x00004d80) // Found @0xff09e130, ** != ** stubs_min = 0x000094c4 (0x93D4+0xF0) 51 DEF(palette_control ,0x0000b35c) // Found @0xff23d5a4 52 DEF(active_palette_buffer ,0x0000b364) // Found @0xff23d5a8 53 DEF(palette_buffer ,0x000cae40) // Found @0xff23da80 54 DEF(bitmap_buffer ,0x0000b39c) // Found @0xff242700 55 DEF(active_bitmap_buffer ,0x0000b394) // Found @0xff242704 51 56 52 57 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx220hs/sub/100a/stubs_min.S
r1755 r1814 6 6 DEF(palette_buffer, 0xCAE40) // loc_FF23DA3C (1.01a) 7 7 DEF(recreview_hold, 0x93D4 + 0xF0) // FF1B6640 8 DEF(enabled_refresh_physical_screen, 0x53C4 + 0x14) //changed to fix error when displaying menu, was 0x20 FF0A99C09 8 DEF(led_table, 0x258C + 0x04) // FF0557C4 -
branches/reyalp-ptp-live/platform/sx220hs/sub/101a/stubs_entry.S
r1658 r1814 49 49 DEF(focus_busy ,0x00008338) // Found @0xff17c768 50 50 //DEF(recreview_hold ,0x00004d80) // Found @0xff09e130, ** != ** stubs_min = 0x000094c4 (0x93D4+0xF0) 51 DEF(palette_control ,0x0000b35c) // Found @0xff23d5a4 52 DEF(active_palette_buffer ,0x0000b364) // Found @0xff23d5a8 53 DEF(palette_buffer ,0x000cae40) // Found @0xff23da80 54 DEF(bitmap_buffer ,0x0000b39c) // Found @0xff242700 55 DEF(active_bitmap_buffer ,0x0000b394) // Found @0xff242704 51 56 52 57 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx220hs/sub/101a/stubs_min.S
r1755 r1814 7 7 DEF(zoom_status, 0xF5A4) // ff31c404 8 8 DEF(recreview_hold, 0x93D4 + 0xF0) // FF1B6640 9 DEF(enabled_refresh_physical_screen, 0x53C4 + 0x14) //changed to fix error when displaying menu, was 0x20 FF0A99C010 9 DEF(led_table, 0x258C + 0x04) // FF0557C4 -
branches/reyalp-ptp-live/platform/sx220hs/sub/101b/stubs_entry.S
r1658 r1814 49 49 DEF(focus_busy ,0x00008338) // Found @0xff17c768 50 50 //DEF(recreview_hold ,0x00004d80) // Found @0xff09e130, ** != ** stubs_min = 0x000094c4 (0x93D4+0xF0) 51 DEF(palette_control ,0x0000b35c) // Found @0xff23d5a4 52 DEF(active_palette_buffer ,0x0000b364) // Found @0xff23d5a8 53 DEF(palette_buffer ,0x000cae40) // Found @0xff23da80 54 DEF(bitmap_buffer ,0x0000b39c) // Found @0xff242700 55 DEF(active_bitmap_buffer ,0x0000b394) // Found @0xff242704 51 56 52 57 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx220hs/sub/101b/stubs_min.S
r1755 r1814 8 8 DEF(zoom_status, 0xF5A4) // ff31c404 9 9 DEF(recreview_hold, 0x93D4 + 0xF0) // FF1B6640 10 DEF(enabled_refresh_physical_screen, 0x53C4 + 0x14) //changed to fix error when displaying menu, was 0x20 FF0A99C011 10 DEF(led_table, 0x258C + 0x04) // FF0557C4 -
branches/reyalp-ptp-live/platform/sx230hs/kbd.c
r1720 r1814 20 20 static KeyMap keymap[]; 21 21 static long last_kbd_key = 0; 22 ;23 static long alt_mode_key_mask = 0x00010800; // disp + set24 22 static int alt_mode_led=0; 25 23 extern void _GetKbdState(long*); … … 79 77 { 0, KEY_DOWN_SOFT , 0x00008000 }, 80 78 { 0, KEY_SET , 0x00010000 }, 81 { 0, KEY_PRINT , 0x00010800 }, //DISP+SET for ALT menu82 79 { 0, KEY_DOWN , 0x00020000 }, 83 80 { 0, KEY_MENU , 0x00040000 }, 84 81 { 0, KEY_VIDEO , 0x00080000 }, 82 83 { 1, KEY_PRINT , 0x00200000 }, // playback = alt button 85 84 { 1, KEY_PLAYBACK , 0x00200000 }, 85 86 86 { 2, KEY_LEFT_SOFT , 0x00000080 }, 87 87 { 2, KEY_LEFT , 0x00000100 }, … … 89 89 { 2, KEY_SHOOT_FULL_ONLY , 0x00000002 }, 90 90 { 2, KEY_SHOOT_HALF , 0x00002000 }, 91 91 92 { 0, 0, 0 } 92 93 }; 93 94 95 // NOP 94 96 void kbd_set_alt_mode_key_mask(long key) 95 97 { 96 int i; 97 for (i=0; keymap[i].hackkey; ++i) { 98 if (keymap[i].hackkey == key) { 99 alt_mode_key_mask = keymap[i].canonkey; 100 return; 101 } 102 } 103 } 98 } 99 104 100 void my_blinkk(void) { 105 101 int i; -
branches/reyalp-ptp-live/platform/sx230hs/main.c
r1331 r1814 28 28 } 29 29 30 // Focus length table in firmware @FFF4A3DC 31 #define NUM_FL 126 // 0 - 125, entries in firmware (3 words each entry, first is FL) 32 extern int focus_len_table[NUM_FL*3]; 30 // Focus length table in firmware @FFF4A3DC 31 #define NUM_FL 126 // 0 - 125, entries in firmware 32 #define NUM_DATA 3 // 3 words each entry, first is FL 33 extern int focus_len_table[NUM_FL*NUM_DATA]; 33 34 34 // Focal length range is 5.0 - 70,0 mm, 28 - 392 in 35-mm equivalent. 35 // So, CF_EFL = 28/5.0*10000=56000 or392/70*10000=56000 36 // divide by 10 to avoid overflow in get_effective_focal_length() 37 #define CF_EFL 5600 38 const int zoom_points = 126; 35 // Conversion factor lens FL --> 35mm equiv 36 // lens 35mm CF 37 // ---- ---- -- 38 // 5.0 28 ( 28/ 5.0) * 50 = 280 (min FL) 39 // 70.0 392 (392/70.0) * 50 = 280 (max FL) 40 #define CF_EFL 280 41 #define CF_EFL_DIV 50 39 42 40 //TODO 43 const int zoom_points = NUM_FL; 44 41 45 int get_effective_focal_length(int zp) { 42 return (CF_EFL*get_focal_length(zp))/1000;46 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 43 47 } 44 48 45 //TODO46 49 int get_focal_length(int zp) { 47 48 if (zp < 0) zp = 0; 49 else if (zp >= NUM_FL) zp = NUM_FL-1; 50 return focus_len_table[zp*3]; 51 /* 52 int i; 53 54 if (zp<fl_tbl[0].zp) 55 return fl_tbl[0].fl; 56 else if (zp>fl_tbl[NUM_FL-1].zp) 57 return fl_tbl[NUM_FL-1].fl; 58 else 59 for (i=1; i<NUM_FL; ++i) { 60 if (zp==fl_tbl[i-1].zp) 61 return fl_tbl[i-1].fl; 62 else if (zp==fl_tbl[i].zp) 63 return fl_tbl[i].fl; 64 else if (zp<fl_tbl[i].zp) 65 return fl_tbl[i-1].fl+(zp-fl_tbl[i-1].zp)*(fl_tbl[i].fl-fl_tbl[i-1].fl)/(fl_tbl[i].zp-fl_tbl[i-1].zp); 66 } 67 return fl_tbl[NUM_FL-1].fl; 68 */ 50 if (zp < 0) zp = 0; 51 else if (zp >= NUM_FL) zp = NUM_FL-1; 52 return focus_len_table[zp*NUM_DATA]; 69 53 } 70 54 71 //TODO72 55 int get_zoom_x(int zp) { 73 return get_focal_length(zp)*10/focus_len_table[0]; 74 //return get_focal_length(zp)*10/fl_tbl[0].fl; 56 return get_focal_length(zp)*10/focus_len_table[0]; 75 57 } 76 77 58 78 59 //TODO -
branches/reyalp-ptp-live/platform/sx230hs/notes.txt
r1326 r1814 2 2 SX230 HS Notes 3 3 4 To enter CHDK <Alt> mode use the DISP+SETbutton.4 To enter CHDK <Alt> mode use the playback button. 5 5 6 6 Support for dual partition is not available. -
branches/reyalp-ptp-live/platform/sx230hs/sub/100c/stubs_entry.S
r1658 r1814 51 51 DEF(focus_busy ,0x000083c4) // Found @0xff181c8c 52 52 //DEF(recreview_hold ,0x00004e04) // Found @0xff0a00d8, ** != ** stubs_min = 0x0000956c (0x947C+0xF0) 53 DEF(palette_control ,0x0000b440) // Found @0xff24480c 54 DEF(active_palette_buffer ,0x0000b448) // Found @0xff244810 55 DEF(palette_buffer ,0x000ceb38) // Found @0xff244ce8 56 DEF(bitmap_buffer ,0x0000b480) // Found @0xff249960 57 DEF(active_bitmap_buffer ,0x0000b478) // Found @0xff249964 53 58 54 59 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx230hs/sub/101a/stubs_entry.S
r1658 r1814 51 51 DEF(focus_busy ,0x000083c4) // Found @0xff181e44 52 52 //DEF(recreview_hold ,0x00004e04) // Found @0xff0a0170, ** != ** stubs_min = 0x0000956c (0x947C+0xF0) 53 DEF(palette_control ,0x0000b440) // Found @0xff244988 54 DEF(active_palette_buffer ,0x0000b448) // Found @0xff24498c 55 DEF(palette_buffer ,0x000ceb38) // Found @0xff244e64 56 DEF(bitmap_buffer ,0x0000b480) // Found @0xff249ae4 57 DEF(active_bitmap_buffer ,0x0000b478) // Found @0xff249ae8 53 58 54 59 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx230hs/sub/101b/stubs_entry.S
r1658 r1814 51 51 DEF(focus_busy ,0x000083c4) // Found @0xff181e44 52 52 //DEF(recreview_hold ,0x00004e04) // Found @0xff0a0170, ** != ** stubs_min = 0x0000956c (0x947C+0xF0) 53 DEF(palette_control ,0x0000b440) // Found @0xff244988 54 DEF(active_palette_buffer ,0x0000b448) // Found @0xff24498c 55 DEF(palette_buffer ,0x000ceb38) // Found @0xff244e64 56 DEF(bitmap_buffer ,0x0000b480) // Found @0xff249ae4 57 DEF(active_bitmap_buffer ,0x0000b478) // Found @0xff249ae8 53 58 54 59 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx30/kbd.c
r1568 r1814 174 174 } 175 175 176 // Disable Zoom Assist button 177 if (conf.zoom_assist_button_disable) 178 physw_status[0] |= 0x00010000; 179 176 180 //_kbd_read_keys_r2(physw_status); 177 181 -
branches/reyalp-ptp-live/platform/sx30/main.c
r1565 r1814 37 37 38 38 // Focus length table in firmware @ FFFEA5CC 39 #define NUM_FL 201 // 0 - 200, entries in firmware 40 extern int focus_len_table[NUM_FL]; 39 #define NUM_FL 201 // 0 - 200, entries in firmware 40 #define NUM_DATA 1 // 1 int value each entry 41 extern int focus_len_table[NUM_FL*NUM_DATA]; 41 42 42 43 // Conversion factor lens FL --> 35mm equiv 43 44 // lens 35mm CF 44 45 // ---- ---- -- 45 // 4.3 24 ( 24/4.3) * 43 = 240 (min FL)46 // 4.3 24 ( 24/ 4.3) * 43 = 240 (min FL) 46 47 // 150.5 840 (840/150.5) * 43 = 240 (max FL) 47 #define CF_EFL 24048 #define CF_EFL_DIV 4348 #define CF_EFL 240 49 #define CF_EFL_DIV 43 49 50 50 const int zoom_points = 201;51 const int zoom_points = NUM_FL; 51 52 52 53 int get_effective_focal_length(int zp) { 53 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV;54 return (CF_EFL*get_focal_length(zp))/CF_EFL_DIV; 54 55 } 55 56 56 57 int get_focal_length(int zp) { 57 if (zp < 0) zp = 0;58 else if (zp >= NUM_FL) zp = NUM_FL-1;59 return focus_len_table[zp];58 if (zp < 0) zp = 0; 59 else if (zp >= NUM_FL) zp = NUM_FL-1; 60 return focus_len_table[zp*NUM_DATA]; 60 61 } 61 62 62 63 int get_zoom_x(int zp) { 63 return get_focal_length(zp)*10/focus_len_table[0];64 return get_focal_length(zp)*10/focus_len_table[0]; 64 65 } 65 66 -
branches/reyalp-ptp-live/platform/sx30/platform_camera.h
r1711 r1814 127 127 #define CAMERA_MAX_DIST 9090910 // Override max subject distance 128 128 129 #define CAM_ZOOM_ASSIST_BUTTON_CONTROL 1 // Activate the menu option to allow disabling the zoom assist button 130 129 131 //---------------------------------------------------------- 130 132 -
branches/reyalp-ptp-live/platform/sx30/sub/100e/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x00007a70) // Found @0xff97df04 42 42 DEF(recreview_hold ,0x0000468c) // Found @0xff8ac610 43 DEF(palette_control ,0x0000b198) // Found @0xffa46818 44 DEF(active_palette_buffer ,0x0000b1a0) // Found @0xffa4681c 45 DEF(palette_buffer ,0x000cf9b4) // Found @0xffa46d50 46 DEF(bitmap_buffer ,0x0000b1d4) // Found @0xffa4a7a8 47 DEF(active_bitmap_buffer ,0x0000b1cc) // Found @0xffa4a7ac 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx30/sub/100e/stubs_min.S
r1641 r1814 3 3 DEF(rear_dial_position, 0xC0240106) 4 4 5 DEF(active_bitmap_buffer, 0xB1CC) // 0xB1B8+0x14 (1.00e sub_FFA4A758 -> FFA4A75C + FFA4A7AC)6 DEF(bitmap_buffer, 0xB1D4) // FFA4A7A87 DEF(palette_control, 0xB198) // sub_FFA4698C (1.00h)8 DEF(active_palette_buffer, 0xB1A0) // sub_FFA468D4 (1.00h)9 DEF(palette_buffer, 0xCF9B4) // sub_FFA46DC8 (1.00h)10 5 DEF(viewport_buffers, 0xFFB96808) // 1.00h sub_FF851C44 (FF851F2C) 11 6 DEF(active_viewport_buffer, 0x20A8) // 1.00h sub_FF851C44 (FF851C48 & FF851F58) -
branches/reyalp-ptp-live/platform/sx30/sub/100h/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x00007a74) // Found @0xff97df38 42 42 DEF(recreview_hold ,0x0000468c) // Found @0xff8ac610 43 DEF(palette_control ,0x0000b198) // Found @0xffa468d4 44 DEF(active_palette_buffer ,0x0000b1a0) // Found @0xffa468d8 45 DEF(palette_buffer ,0x000cf9b4) // Found @0xffa46e0c 46 DEF(bitmap_buffer ,0x0000b1d4) // Found @0xffa4a864 47 DEF(active_bitmap_buffer ,0x0000b1cc) // Found @0xffa4a868 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx30/sub/100h/stubs_min.S
r1641 r1814 3 3 DEF(rear_dial_position, 0xC0240106) 4 4 5 DEF(active_bitmap_buffer, 0xB1CC) // 0xB1B8+0x14 (1.00h sub_FFA4A814 -> FFA4A818 + FFA4A868)6 DEF(bitmap_buffer, 0xB1D4) // FFA4A8647 DEF(palette_control, 0xB198) // sub_FFA4698C (1.00h)8 DEF(active_palette_buffer, 0xB1A0) // sub_FFA468D4 (1.00h)9 DEF(palette_buffer, 0xCF9B4) // sub_FFA46DC8 (1.00h)10 5 DEF(viewport_buffers, 0xFFB968C4) // 1.00h sub_FF851C44 (FF851F2C) 11 6 DEF(active_viewport_buffer, 0x20A8) // 1.00h sub_FF851C44 (FF851C48 & FF851F58) -
branches/reyalp-ptp-live/platform/sx30/sub/100l/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x00007a74) // Found @0xff97df3c 42 42 DEF(recreview_hold ,0x0000468c) // Found @0xff8ac614 43 DEF(palette_control ,0x0000b198) // Found @0xffa46a7c 44 DEF(active_palette_buffer ,0x0000b1a0) // Found @0xffa46a80 45 DEF(palette_buffer ,0x000cf9b4) // Found @0xffa46fb4 46 DEF(bitmap_buffer ,0x0000b1d4) // Found @0xffa4aa0c 47 DEF(active_bitmap_buffer ,0x0000b1cc) // Found @0xffa4aa10 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx30/sub/100l/stubs_min.S
r1641 r1814 3 3 DEF(rear_dial_position, 0xC0240106) 4 4 5 DEF(active_bitmap_buffer, 0xB1CC) // 0xB1B8+0x14 (1.00l sub_FFA4A9BC -> FFA4A9C0 + FFA4AA10)6 DEF(bitmap_buffer, 0xB1D4) // FFA4AA0C7 DEF(palette_control, 0xB198) // sub_FFA4698C (1.00h)8 DEF(active_palette_buffer, 0xB1A0) // sub_FFA468D4 (1.00h)9 DEF(palette_buffer, 0xCF9B4) // sub_FFA46DC8 (1.00h)10 5 DEF(viewport_buffers, 0xFFB96A6C) // 1.00h sub_FF851C44 (FF851F2C) 11 6 DEF(active_viewport_buffer, 0x20A8) // 1.00h sub_FF851C44 (FF851C48 & FF851F58) -
branches/reyalp-ptp-live/platform/sx30/sub/100n/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x00007a74) // Found @0xff97dfc0 42 42 DEF(recreview_hold ,0x0000468c) // Found @0xff8ac614 43 DEF(palette_control ,0x0000b198) // Found @0xffa46b00 44 DEF(active_palette_buffer ,0x0000b1a0) // Found @0xffa46b04 45 DEF(palette_buffer ,0x000cf9b4) // Found @0xffa47038 46 DEF(bitmap_buffer ,0x0000b1d4) // Found @0xffa4aa90 47 DEF(active_bitmap_buffer ,0x0000b1cc) // Found @0xffa4aa94 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx30/sub/100n/stubs_min.S
r1641 r1814 3 3 DEF(rear_dial_position, 0xC0240106) 4 4 5 DEF(active_bitmap_buffer, 0xB1CC) // 0xB1B8+0x14 (1.00n sub_FFA4AA40 -> FFA4AA44 + FFA4AA94)6 DEF(bitmap_buffer, 0xB1D4) // FFA4AA907 DEF(palette_control, 0xB198) // sub_FFA4698C (1.00h)8 DEF(active_palette_buffer, 0xB1A0) // sub_FFA468D4 (1.00h)9 DEF(palette_buffer, 0xCF9B4) // sub_FFA46DC8 (1.00h)10 5 DEF(viewport_buffers, 0xFFB96AE0) // 1.00h sub_FF851C44 (FF851F2C) 11 6 DEF(active_viewport_buffer, 0x20A8) // 1.00h sub_FF851C44 (FF851C48 & FF851F58) -
branches/reyalp-ptp-live/platform/sx30/sub/100p/stubs_entry.S
r1641 r1814 41 41 DEF(focus_busy ,0x00007a74) // Found @0xff97dfc0 42 42 DEF(recreview_hold ,0x0000468c) // Found @0xff8ac614 43 DEF(palette_control ,0x0000b198) // Found @0xffa46b00 44 DEF(active_palette_buffer ,0x0000b1a0) // Found @0xffa46b04 45 DEF(palette_buffer ,0x000cf9b4) // Found @0xffa47038 46 DEF(bitmap_buffer ,0x0000b1d4) // Found @0xffa4aa90 47 DEF(active_bitmap_buffer ,0x0000b1cc) // Found @0xffa4aa94 43 48 44 49 // Values below go in 'lib.c': -
branches/reyalp-ptp-live/platform/sx30/sub/100p/stubs_min.S
r1641 r1814 3 3 DEF(rear_dial_position, 0xC0240106) 4 4 5 DEF(active_bitmap_buffer, 0xB1CC) // 0xB1B8+0x14 (1.00p sub_FFA4AA40 -> FFA4AA44 + FFA4AA94)6 DEF(bitmap