root/platform/sx130is/sub/101d/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. camera_jpeg_count_str
  7. vid_get_viewport_width
  8. vid_get_viewport_height
  9. _GetBatteryTemperature

   1 /*
   2 *********************
   3 SX130IS 101.c firmware
   4 **********************
   5 sikahr
   6 12-2010
   7 lib.c
   8 */
   9 
  10 #include "platform.h"
  11 
  12 char *hook_raw_image_addr()   
  13 {
  14 /*
  15 ROM:FFB102F0                 LDR     R6, =0x41F3B020  <<<<<<<<<<<<<<<
  16 ROM:FFB102F4                 LDR     R4, =0x41876740
  17 ROM:FFB102F8                 LDR     R5, =0x409A0520
  18 ROM:FFB10328                 BL      sub_FF93AC08
  19 ROM:FFB1032C                 MOV     R1, R4
  20 ROM:FFB10330                 ADR     R0, aImgVramBuffP ; "IMG VRAM BUFF   %p"
  21 ROM:FFB10334                 BL      sub_FF93AC08
  22 ROM:FFB10338                 MOV     R1, R5
  23 ROM:FFB1033C                 ADR     R0, aThumVramBuffP ; "THUM VRAM BUFF  %p"
  24 ROM:FFB10340                 BL      sub_FF93AC08
  25 ROM:FFB10344                 MOV     R1, R6
  26 ROM:FFB10348                 ADR     R0, aCrawBuffP  ; "CRAW BUFF       %p"
  27 ROM:FFB1034C                 BL      sub_FF93AC08
  28 ROM:FFB10350                 LDR     R1, =0x11CA240  <<<<<<<<<<<<<<
  29 ROM:FFB10354                 ADR     R0, aCrawBuffSizeP ; "CRAW BUFF SIZE  %p"
  30 */
  31         return (char*)(0x41F3B020);
  32 }
  33 
  34 
  35 // Live picture buffer (shoot not pressed) 
  36 void *vid_get_viewport_live_fb()
  37 {
  38 
  39 
  40     return 0x0;
  41 
  42 }
  43 
  44 
  45 
  46 
  47 void *vid_get_bitmap_fb()
  48 {
  49 /*
  50 ROM:FF9177B8 ; =============== S U B R O U T I N E =======================================
  51 ROM:FF9177B8
  52 ROM:FF9177B8 ; LOCATION: BmpDDev.c:0
  53 ROM:FF9177B8
  54 ROM:FF9177B8                 EXPORT _sub_FF9177B8__BmpDDev.c__0
  55 ROM:FF9177B8 _sub_FF9177B8__BmpDDev.c__0             ; CODE XREF: sub_FFA0D168+48p
  56 ROM:FF9177B8                 STMFD   SP!, {R4-R8,LR}
  57 ROM:FF9177BC                 LDR     R8, =0x5BA0
  58 ROM:FF9177C0                 MOV     R4, R0
  59 ROM:FF9177C4                 LDR     R0, [R8,#0x10]
  60 ROM:FF9177C8                 MOV     R5, R1
  61 ROM:FF9177CC                 CMP     R0, #1
  62 ROM:FF9177D0                 LDREQ   R1, =0x17F
  63 ROM:FF9177D4                 ADREQ   R0, aBmpddev_c  ; "BmpDDev.c"
  64 ROM:FF9177D8                 MOV     R7, R3
  65 ROM:FF9177DC                 MOV     R6, R2
  66 ROM:FF9177E0                 BLEQ    DebugAssert
  67 ROM:FF9177E4                 CMP     R4, #0
  68 ROM:FF9177E8                 CMPNE   R5, #0
  69 ROM:FF9177EC                 CMPNE   R6, #0
  70 ROM:FF9177F0                 CMPNE   R7, #0
  71 ROM:FF9177F4                 LDREQ   R1, =0x182
  72 ROM:FF9177F8                 ADREQ   R0, aBmpddev_c  ; "BmpDDev.c"
  73 ROM:FF9177FC                 BLEQ    DebugAssert
  74 ROM:FF917800                 MOV     R0, #0x2D0   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  Height  0x2D0 dec 720
  75 ROM:FF917804                 MOV     R1, #0xF0    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  Width  0xF0   dec 240
  76 ROM:FF917808                 STR     R0, [R4]
  77 ROM:FF91780C                 STR     R1, [R5]
  78 ROM:FF917810                 STR     R0, [R6]
  79 ROM:FF917814                 LDR     R0, =0x403F1000 <<<<<<<<<<<<<<<<<
  80 ROM:FF917818                 STR     R0, [R7]
  81 ROM:FF91781C                 MOV     R0, #1
  82 ROM:FF917820                 STR     R0, [R8,#0x10]
  83 ROM:FF917824                 MOV     R0, #0
  84 ROM:FF917828                 LDMFD   SP!, {R4-R8,PC}
  85 ROM:FF917828 ; End of function _sub_FF9177B8__BmpDDev.c__0
  86 ROM:FF917828
  87 ROM:FF91782C
  88 */
  89         return (void*)0x403F1000;                              
  90 }
  91 
  92 
  93 // Live picture buffer (shoot half-pressed) 
  94 void *vid_get_viewport_fb()
  95 {
  96 /*
  97 ROM:FFB0CEB8 loc_FFB0CEB8                            ; CODE XREF: sub_FFB0CE7C+28j
  98 ROM:FFB0CEB8                 MOV     R2, R7
  99 ROM:FFB0CEBC                 MOV     R1, R6
 100 ROM:FFB0CEC0                 MOV     R0, R5
 101 ROM:FFB0CEC4                 BL      sub_FF85263C
 102 ROM:FFB0CEC8                 LDR     R1, =0x40507700  <<<<<<<<<<<<<<<<<<<
 103 ROM:FFB0CECC                 LDR     R0, =0x3F480
 104 ROM:FFB0CED0                 STR     R1, [R4]
 105 ROM:FFB0CED4                 STR     R0, [R4,#4]
 106 ROM:FFB0CED8                 ADR     R0, aVramAddressP ; "VRAM Address  : %p\r"
 107 ROM:FFB0CEDC                 BL      sub_FF93AC08
 108 ROM:FFB0CEE0                 LDR     R1, [R4,#4]
 109 ROM:FFB0CEE4                 ADR     R0, aVramSize0xX ; "VRAM Size     : 0x%x\r"
 110 ROM:FFB0CEE8                 BL      sub_FF93AC08
 111 ROM:FFB0CEEC                 MOV     R0, #0
 112 ROM:FFB0CEF0                 LDMFD   SP!, {R4-R8,PC}
 113 ROM:FFB0CEF0 ; End of function sub_FFB0CE7C
 114 */
 115 
 116 
 117         return (void*)0x40507700;                              
 118 }
 119 
 120 // Histo etc. when in play mode maybe ?
 121 void *vid_get_viewport_fb_d()
 122 {
 123 
 124 /*
 125 ROM:FF872090 ; =============== S U B R O U T I N E =======================================
 126 ROM:FF872090
 127 ROM:FF872090 ; LOCATION: ImagePlayer.c:0
 128 ROM:FF872090
 129 ROM:FF872090                 EXPORT _sub_FF872090__ImagePlayer.c__0
 130 ROM:FF872090 _sub_FF872090__ImagePlayer.c__0         ; CODE XREF: _sub_FF882734__VisualHandle.c__154+1B4 p
 131 ROM:FF872090                                         ; sub_FF882908+94 p ...
 132 ROM:FF872090                 STMFD   SP!, {R1-R7,LR}
 133 ROM:FF872094                 LDR     R7, =0x2710
 134 ROM:FF872098                 LDR     R5, =0x2A70   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 135 ROM:FF87209C                 LDR     R3, =0x6CE
 136 ROM:FF8720A0                 LDR     R2, =aImageplayer_c ; "ImagePlayer.c"
 137 ROM:FF8720A4                 LDR     R0, [R5,#0x4C]
 138 ROM:FF8720A8                 MOV     R1, R7
 139 ROM:FF8720AC                 BL      sub_FF83A488
 140 ROM:FF8720B0                 MOV     R0, #1
 141 ROM:FF8720B4                 BL      sub_FF871280
 142 ROM:FF8720B8                 CMN     R0, #1
 143 ROM:FF8720BC                 BEQ     loc_FF87218C
 144 ROM:FF8720C0                 LDR     R4, =0x37A4C
 145 ROM:FF8720C4                 ADD     R1, R0, R0,LSL#2
 146 ROM:FF8720C8                 LDR     R0, [R4,R1,LSL#2]
 147 ROM:FF8720CC                 MOV     R3, #0
 148 ROM:FF8720D0                 ADR     R2, sub_FF871988
 149 ROM:FF8720D4                 ADD     R12, R4, R1,LSL#2
 150 ROM:FF8720D8                 STR     R0, [R5,#0x58]   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 151 ROM:FF8720DC                 LDR     R1, [R12,#0xC]
 152 ROM:FF8720E0                 STMEA   SP, {R1-R3}
 153 ROM:FF8720E4                 LDR     R3, [R12,#8]
 154 ROM:FF8720E8                 MOV     R2, #0
 155 ROM:FF8720EC                 MOV     R1, #0
 156 ROM:FF8720F0                 BL      _sub_FF918DA8__ImgDDev.c__6 ; LOCATION: ImgDDev.c:6
 157 ROM:FF8720F4                 TST     R0, #1
 158 ROM:FF8720F8                 LDRNE   R1, =0x6F4
 159 ROM:FF8720FC                 LDRNE   R0, =aImageplayer_c ; "ImagePlayer.c"
 160 */
 161 
 162     return (void*)(*(int*) (0x2A70+0x58));       
 163 } 
 164 
 165 char *camera_jpeg_count_str()
 166 /*
 167 ROM:FF9FF420 loc_FF9FF420                            ; CODE XREF: sub_FF9FF35C+50 j
 168 ROM:FF9FF420                 SUBS    R12, R0, #0x2700
 169 ROM:FF9FF424                 SUBCSS  R12, R12, #0xF
 170 ROM:FF9FF428                 BCC     loc_FF9FF43C
 171 ROM:FF9FF42C                 LDR     R0, =0xB33A4  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 172 ROM:FF9FF430                 ADR     R1, a9999       ; "9999"
 173 ROM:FF9FF434                 BL      eventproc_export_sprintf
 174 ROM:FF9FF438                 B       loc_FF9FF44C
 175 ROM:FF9FF43C ; ---------------------------------------------------------------------------
 176 */
 177 {
 178  return (void*)0xB33A4;
 179 }
 180 
 181 int vid_get_viewport_width()
 182 {
 183     return 360;
 184 }
 185 
 186 long vid_get_viewport_height()
 187 {
 188     return 240;
 189 }
 190 
 191 //Copied from S95 section  END
 192 
 193 /*
 194 //  NEW NEW NEW
 195 //  Need checking
 196 
 197 void JogDial_CW(void){
 198  _PostLogicalEventForNotPowerType(0x874, 2);  // RotateJogDialRight
 199 }
 200 
 201 void JogDial_CCW(void){
 202  _PostLogicalEventForNotPowerType(0x875, 2);  // RotateJogDialLeft
 203 }
 204 */ 
 205 
 206 /*
 207 Note copied from SX110 IS
 208 GetBatteryTemperature usually will get back temperature of battery compartment/batteries. GetBatteryTemperature is implemented in Canon's firmware for SX120IS.
 209 Firmware entry point is identified (0xFFC394D8) but function is not usable. Camera will crash if Canon's GetBatteryTemperature is called by CHDK.
 210 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, 
 211 this function will be implemented as specific CHDK-code. It returns always with -99 (which means -99 Celsius or -146 Fahrenheit).
 212 Original entry point in Canon's firmware is disabled (in stubs_entry.S).
 213 */
 214 
 215 int _GetBatteryTemperature()
 216 {
 217       return -99;
 218 }
 219  
 220  

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