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 @ 0xffb1bfd8 -> data @0xffb1c0b8 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 @ 0xffb1bfd8 -> data @0xffb1c0b8 29 } 30 31 void vid_bitmap_refresh() { 32 33 extern int full_screen_refresh; 34 extern void _LockAndRefresh(); // wrapper function for screen lock 35 extern void _UnlockAndRefresh(); // wrapper function for screen unlock 36 37 full_screen_refresh |= 3; 38 _LockAndRefresh(); 39 _UnlockAndRefresh(); 40 } 41 42 /* 43 * Note copied from SX110 IS 44 * GetBatteryTemperature usually will get back temperature of battery compartment/batteries. GetBatteryTemperature is implemented in Canon's firmware for SX120IS. 45 * Firmware entry point is identified (0xFFC394D8) but function is not usable. Camera will crash if Canon's GetBatteryTemperature is called by CHDK. 46 * 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, 47 * this function will be implemented as specific CHDK-code. It returns always with -99 (which means -99° Celsius or -146° Fahrenheit). 48 * Original entry point in Canon's firmware is disabled (in stubs_entry.S). 49 * */ 50 51 int _GetBatteryTemperature() 52 { 53 return -99; 54 }