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

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

DEFINITIONS

This source file includes following definitions.
  1. vid_get_bitmap_fb
  2. vid_get_viewport_fb_d
  3. camera_jpeg_count_str
  4. get_flash_params_count
  5. hook_raw_image_addr
  6. hook_alt_raw_image_addr
  7. vid_bitmap_refresh
  8. _GetBatteryTemperature

   1 #include "platform.h"
   2 
   3 // autofound in stubs_entry.S
   4 
   5 void *vid_get_bitmap_fb()        { return (void*)0x403f1000; }             // Found @0xff85b414
   6 void *vid_get_viewport_fb_d()    { return (void*)(*(int*)(0x2970+0x58)); } // Found @0xff870968 & 0xff8709a0
   7 char *camera_jpeg_count_str()    { return (char*)0x000b3b14; }             // Found @0xff9f76c4
   8 int  get_flash_params_count(void) { return 0xa0; }                          // Found @0xff98e87c
   9 
  10 
  11 char *hook_raw_image_addr() {
  12 
  13         // if (*((int*)(0x2B68 + 0xC)) != 0)
  14         //      return (char*) 0x46000000;
  15         // else
  16         //      return (char*) 0x421316C0;
  17 
  18     return (char*)  0x41BDED00; //  instruction @ 0xffb1bfcc  -> data @0xFFB1C0AC
  19 }
  20 
  21 char *hook_alt_raw_image_addr() {
  22 
  23         // if (*((int*)(0x2B68 + 0xC)) != 0)
  24         //      return (char*) 0x46000000;
  25         // else
  26         //      return (char*) 0x421316C0;
  27 
  28     return (char*)  0x41BDED00; //  instruction @ 0xffb1bfcc  -> data @0xFFB1C0AC
  29 }
  30 
  31 
  32 void vid_bitmap_refresh() {
  33 
  34     extern int full_screen_refresh;
  35     extern void _LockAndRefresh();      // wrapper function for screen lock
  36     extern void _UnlockAndRefresh();    // wrapper function for screen unlock
  37 
  38     full_screen_refresh |= 3;
  39     _LockAndRefresh();
  40     _UnlockAndRefresh();
  41 }
  42 
  43 /*
  44  * Note copied from SX110 IS
  45  * GetBatteryTemperature usually will get back temperature of battery compartment/batteries. GetBatteryTemperature is implemented in Canon's firmware for SX120IS.
  46  * Firmware entry point is identified (0xFFC394D8) but function is not usable. Camera will crash if Canon's GetBatteryTemperature is called by CHDK.
  47  * 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,
  48  * this function will be implemented as specific CHDK-code. It returns always with -99 (which means -99° Celsius or -146° Fahrenheit).
  49  * Original entry point in Canon's firmware is disabled (in stubs_entry.S).
  50  * */
  51 
  52 int _GetBatteryTemperature()
  53 {
  54       return -99;
  55 }

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