root/platform/sx120is/sub/100b/lib.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. hook_raw_image_addr
  2. vid_get_viewport_live_fb
  3. vid_get_bitmap_fb
  4. vid_get_viewport_fb
  5. vid_get_viewport_fb_d
  6. vid_get_viewport_width
  7. vid_get_viewport_height
  8. camera_jpeg_count_str
  9. _GetBatteryTemperature

   1 #include "platform.h"
   2 
   3 /*
   4 note sensor size for camera.h is from 
   5 @ FFE68804
   6 0xED09F0 = 15534576
   7 15534576/12 * 8 - 10356384  ---
   8                               |
   9 @ FFE6857C                    |
  10 0xE90 and 0xADA =             |
  11 3728  *  2778   = 10356384  ---
  12 */
  13 
  14 char *hook_raw_image_addr()
  15 {
  16 // 0x4110C564 at FFC3D108 and FFC3CE4C
  17 // 0x414EF7E0 at FFE6888C and FFE687A8; search for "CRAW BUFF"
  18 // FFE687A8      LDR     R6, =0x414EF7E0
  19 // ...
  20 // FFE687F8      MOV     R1, R6
  21 // FFE687FC      ADR     R0, aCrawBuffP  ; "CRAW BUFF       %p"
  22 // 0x2b24 at FFC51140 and 0x53A4+0x18 at 0xFFC518D4
  23 //      return (char*) (*(int*)(0x2B24+0x18) ? 0x4110C564 : 0x414EF7E0);
  24         return (char*)(0x414EF7E0);     
  25 }
  26 
  27 void *vid_get_viewport_live_fb()
  28 {
  29    void **fb=(void **)0x217C; //FFC27234, look also at FFC26C8C
  30    unsigned char buff = *((unsigned char*)0x1FD0); //FFC27230, look also at FFC26C3C
  31     if (buff == 0) buff = 2;  else buff--;
  32     return fb[buff];
  33 }
  34 
  35 void *vid_get_bitmap_fb()
  36 {
  37     return (void*)0x403F1000;   // FFDE8EB0 and FFDE8C78; search for "Faexe Error"
  38 }
  39 
  40 void *vid_get_viewport_fb()
  41 {
  42     return (void*)0x40768620;   // FFE662E4 and FFE660B4; search for "VRAM Address" in DCB section
  43 }
  44 
  45 void *vid_get_viewport_fb_d()
  46 {
  47     return (void*)(*(int*)(0x2904+0x58));       // 0x2904 at FFC46988; 0x58 at FFC471EC
  48 }
  49 
  50 int vid_get_viewport_width()
  51 {
  52     return 360;
  53 }
  54 
  55 long vid_get_viewport_height()
  56 {
  57     return 240;
  58 }
  59 
  60 char *camera_jpeg_count_str()
  61 {
  62 // Found at ROM:FFD83ECC and ROM:FFD83D88 - search for "ShotsTime.c" and "9999"
  63     return (void*)0x52C6C;
  64 }
  65 
  66 
  67 /*
  68 Note copied from SX110 IS
  69 GetBatteryTemperature usually will get back temperature of battery compartment/batteries. GetBatteryTemperature is implemented in Canon's firmware for SX120IS.
  70 Firmware entry point is identified (0xFFC394D8) but function is not usable. Camera will crash if Canon's GetBatteryTemperature is called by CHDK.
  71 To avoid a crash Canon's GetBatteryTemperature must not called. As long CHDK general code do not distinguish between cameras that support or don't support GetBatteryTemperature, 
  72 this function will be implemented as specific CHDK-code. It returns always with -99 (which means -99° Celsius or -146° Fahrenheit).
  73 Original entry point in Canon's firmware is disabled (in stubs_entry.S).
  74 */
  75 
  76 int _GetBatteryTemperature()
  77 {
  78       return -99;
  79 }
  80 
  81 

/* [<][>][^][v][top][bottom][index][help] */