root/platform/g10/sub/103b/movie_rec.c

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

DEFINITIONS

This source file includes following definitions.
  1. change_video_tables
  2. set_quality
  3. movie_record_task
  4. sub_FF8625C8_my

   1 /*
   2  * movie_rec.c - auto-generated by CHDK code_gen.
   3  */
   4 #include "conf.h"
   5 
   6 void change_video_tables(int a, int b){
   7 }
   8 
   9 void  set_quality(int *x){ // -17 highest; +12 lowest
  10  if (conf.video_mode) *x=12-((conf.video_quality-1)*(12+17)/(99-1));
  11 }
  12 
  13 /*************************************************************/
  14 //** movie_record_task @ 0xFF862C0C - 0xFF862D10, length=66
  15 void __attribute__((naked,noinline)) movie_record_task() {
  16 asm volatile (
  17 "    STMFD   SP!, {R2-R8,LR} \n"
  18 "    LDR     R7, =0x2710 \n"
  19 "    LDR     R4, =0x53E0 \n"
  20 "    MOV     R6, #0 \n"
  21 "    MOV     R5, #1 \n"
  22 
  23 "loc_FF862C20:\n"
  24 "    LDR     R0, [R4, #0x18] \n"
  25 "    MOV     R2, #0 \n"
  26 "    ADD     R1, SP, #4 \n"
  27 "    BL      sub_FF827D30 /*_ReceiveMessageQueue*/ \n"
  28 "    LDR     R0, [R4, #0x20] \n"
  29 "    CMP     R0, #0 \n"
  30 "    BNE     loc_FF862CF0 \n"
  31 "    LDR     R0, [SP, #4] \n"
  32 "    LDR     R1, [R0] \n"
  33 "    SUB     R1, R1, #2 \n"
  34 "    CMP     R1, #9 \n"
  35 "    ADDLS   PC, PC, R1, LSL#2 \n"
  36 "    B       loc_FF862CF0 \n"
  37 "    B       loc_FF862CA4 \n"
  38 "    B       loc_FF862CC4 \n"
  39 "    B       loc_FF862CD4 \n"
  40 "    B       loc_FF862CDC \n"
  41 "    B       loc_FF862CAC \n"
  42 "    B       loc_FF862CE4 \n"
  43 "    B       loc_FF862CB4 \n"
  44 "    B       loc_FF862CF0 \n"
  45 "    B       loc_FF862CEC \n"
  46 "    B       loc_FF862C7C \n"
  47 
  48 "loc_FF862C7C:\n"
  49 "    LDR     R0, =0xFF862924 \n"
  50 "    STR     R6, [R4, #0x34] \n"
  51 "    STR     R0, [R4, #0x9C] \n"
  52 "    LDR     R0, =0xFF861FF4 \n"
  53 "    LDR     R2, =0xFF861F10 \n"
  54 "    LDR     R1, =0x1B800 \n"
  55 "    STR     R6, [R4, #0x24] \n"
  56 "    BL      sub_FF83C7A8 \n"
  57 "    STR     R5, [R4, #0x38] \n"
  58 "    B       loc_FF862CF0 \n"
  59 
  60 "loc_FF862CA4:\n"
  61 "    BL      unlock_optical_zoom\n"     // added to unlock the zoom
  62 "    BL      sub_FF862A1C \n"
  63 "    B       loc_FF862CF0 \n"
  64 
  65 "loc_FF862CAC:\n"
  66 "    BL      sub_FF8625C8_my \n"  // --> Patched. Old value = 0xFF8625C8.
  67 "    B       loc_FF862CF0 \n"
  68 
  69 "loc_FF862CB4:\n"
  70 "    LDR     R1, [R0, #0x10] \n"
  71 "    LDR     R0, [R0, #4] \n"
  72 "    BL      sub_FF942C0C \n"
  73 "    B       loc_FF862CF0 \n"
  74 
  75 "loc_FF862CC4:\n"
  76 "    LDR     R0, [R4, #0x38] \n"
  77 "    CMP     R0, #5 \n"
  78 "    STRNE   R5, [R4, #0x28] \n"
  79 "    B       loc_FF862CF0 \n"
  80 
  81 "loc_FF862CD4:\n"
  82 "    BL      sub_FF8622E8 \n"
  83 "    B       loc_FF862CF0 \n"
  84 
  85 "loc_FF862CDC:\n"
  86 "    BL      sub_FF862040 \n"
  87 "    B       loc_FF862CF0 \n"
  88 
  89 "loc_FF862CE4:\n"
  90 "    BL      sub_FF861E9C \n"
  91 "    B       loc_FF862CF0 \n"
  92 
  93 "loc_FF862CEC:\n"
  94 "    BL      sub_FF862E5C \n"
  95 
  96 "loc_FF862CF0:\n"
  97 "    LDR     R1, [SP, #4] \n"
  98 "    MOV     R3, #0x430 \n"
  99 "    STR     R6, [R1] \n"
 100 "    STR     R3, [SP] \n"
 101 "    LDR     R0, [R4, #0x1C] \n"
 102 "    LDR     R3, =0xFF861D00 /*'MovieRecorder.c'*/ \n"
 103 "    MOV     R2, R7 \n"
 104 "    BL      sub_FF828684 /*_PostMessageQueueStrictly*/ \n"
 105 "    B       loc_FF862C20 \n"
 106 );
 107 }
 108 
 109 /*************************************************************/
 110 //** sub_FF8625C8_my @ 0xFF8625C8 - 0xFF862920, length=215
 111 void __attribute__((naked,noinline)) sub_FF8625C8_my() {
 112 asm volatile (
 113 "    STMFD   SP!, {R4-R9,LR} \n"
 114 "    SUB     SP, SP, #0x44 \n"
 115 "    MOV     R7, #0 \n"
 116 "    LDR     R6, =0x53E0 \n"
 117 "    MOV     R4, R0 \n"
 118 "    STR     R7, [SP, #0x34] \n"
 119 "    STR     R7, [SP, #0x2C] \n"
 120 "    LDR     R0, [R6, #0x38] \n"
 121 "    MOV     R8, #4 \n"
 122 "    CMP     R0, #3 \n"
 123 "    STREQ   R8, [R6, #0x38] \n"
 124 "    LDR     R0, [R6, #0x9C] \n"
 125 "    BLX     R0 \n"
 126 "    LDR     R0, [R6, #0x38] \n"
 127 "    CMP     R0, #4 \n"
 128 "    BNE     loc_FF862718 \n"
 129 "    ADD     R3, SP, #0x2C \n"
 130 "    ADD     R2, SP, #0x30 \n"
 131 "    ADD     R1, SP, #0x34 \n"
 132 "    ADD     R0, SP, #0x38 \n"
 133 "    BL      sub_FF942CA8 \n"
 134 "    CMP     R0, #0 \n"
 135 "    MOV     R5, #1 \n"
 136 "    BNE     loc_FF862644 \n"
 137 "    LDR     R1, [R6, #0x28] \n"
 138 "    CMP     R1, #1 \n"
 139 "    BNE     loc_FF86272C \n"
 140 "    LDR     R1, [R6, #0x4C] \n"
 141 "    LDR     R2, [R6, #0x3C] \n"
 142 "    CMP     R1, R2 \n"
 143 "    BCC     loc_FF86272C \n"
 144 
 145 "loc_FF862644:\n"
 146 "    CMP     R0, #0x80000001 \n"
 147 "    STREQ   R8, [R6, #0x50] \n"
 148 "    BEQ     loc_FF86267C \n"
 149 "    CMP     R0, #0x80000003 \n"
 150 "    STREQ   R5, [R6, #0x50] \n"
 151 "    BEQ     loc_FF86267C \n"
 152 "    CMP     R0, #0x80000005 \n"
 153 "    MOVEQ   R0, #2 \n"
 154 "    BEQ     loc_FF862678 \n"
 155 "    CMP     R0, #0x80000007 \n"
 156 "    STRNE   R7, [R6, #0x50] \n"
 157 "    BNE     loc_FF86267C \n"
 158 "    MOV     R0, #3 \n"
 159 
 160 "loc_FF862678:\n"
 161 "    STR     R0, [R6, #0x50] \n"
 162 
 163 "loc_FF86267C:\n"
 164 "    LDR     R0, =0x1B834 \n"
 165 "    LDR     R0, [R0, #8] \n"
 166 "    CMP     R0, #0 \n"
 167 "    BEQ     loc_FF862694 \n"
 168 "    BL      sub_FF84CAA8 \n"
 169 "    B       loc_FF862698 \n"
 170 
 171 "loc_FF862694:\n"
 172 "    BL      sub_FF861E9C \n"
 173 
 174 "loc_FF862698:\n"
 175 "    LDR     R0, [R4, #0x14] \n"
 176 "    LDR     R1, [R4, #0x18] \n"
 177 "    ADD     R3, SP, #0x3C \n"
 178 "    MVN     R2, #1 \n"
 179 "    ADD     R7, SP, #0x18 \n"
 180 "    STMIA   R7, {R0-R3} \n"
 181 "    LDR     R2, [R6, #0x64] \n"
 182 "    LDR     R3, [R6, #0x68] \n"
 183 "    MOV     R0, #0 \n"
 184 "    ADD     R1, SP, #0x40 \n"
 185 "    ADD     R7, SP, #8 \n"
 186 "    STMIA   R7, {R0-R3} \n"
 187 "    MOV     R3, #0 \n"
 188 "    MOV     R2, #0x40 \n"
 189 "    STRD    R2, [SP] \n"
 190 "    LDMIB   R4, {R0,R1} \n"
 191 "    LDR     R3, =0x1B84C \n"
 192 "    MOV     R2, R9 \n"
 193 "    BL      sub_FF8FE9D4 \n"
 194 "    LDR     R0, [R6, #0x10] \n"
 195 "    MOV     R1, #0x3E8 \n"
 196 "    BL      _TakeSemaphore \n"
 197 "    CMP     R0, #9 \n"
 198 "    BEQ     loc_FF8627B0 \n"
 199 "    LDR     R0, [SP, #0x3C] \n"
 200 "    CMP     R0, #0 \n"
 201 "    BNE     loc_FF8627CC \n"
 202 "    MOV     R0, #1 \n"
 203 "    BL      sub_FF8FEA7C \n"
 204 "    BL      sub_FF8FEAB8 \n"
 205 "    MOV     R0, #5 \n"
 206 "    STR     R0, [R6, #0x38] \n"
 207 
 208 "loc_FF862718:\n"
 209 "    ADD     SP, SP, #0x44 \n"
 210 "    LDMFD   SP!, {R4-R9,PC} \n"
 211 
 212 "loc_FF862720:\n"
 213 "    BL      sub_FF87F1C4 /*_HardwareDefect_FW*/ \n"
 214 "    MOV     R0, #1 \n"
 215 "    B       loc_FF86286C \n"
 216 
 217 "loc_FF86272C:\n"
 218 "    LDR     R12, [SP, #0x34] \n"
 219 "    CMP     R12, #0 \n"
 220 "    BEQ     loc_FF8628CC \n"
 221 "    STR     R5, [R6, #0x2C] \n"
 222 "    LDR     R0, [R6, #0x4C] \n"
 223 "    LDR     R8, [R4, #0xC] \n"
 224 "    CMP     R0, #0 \n"
 225 "    LDRNE   LR, [SP, #0x38] \n"
 226 "    BNE     loc_FF8627F8 \n"
 227 "    LDR     R0, [R4, #0x14] \n"
 228 "    LDR     R1, [R4, #0x18] \n"
 229 "    ADD     R3, SP, #0x3C \n"
 230 "    MVN     R2, #0 \n"
 231 "    ADD     R9, SP, #0x18 \n"
 232 "    STMIA   R9, {R0-R3} \n"
 233 "    LDR     R0, [SP, #0x2C] \n"
 234 "    LDR     R2, [R6, #0x64] \n"
 235 "    LDR     R3, [R6, #0x68] \n"
 236 "    ADD     R1, SP, #0x40 \n"
 237 "    ADD     R9, SP, #8 \n"
 238 "    STMIA   R9, {R0-R3} \n"
 239 "    LDR     R3, [SP, #0x30] \n"
 240 "    STR     R12, [SP] \n"
 241 "    STR     R3, [SP, #4] \n"
 242 "    LDMIB   R4, {R0,R1} \n"
 243 "    LDR     R3, [SP, #0x38] \n"
 244 "    MOV     R2, R8 \n"
 245 "    BL      sub_FF8FE9D4 \n"
 246 "    LDR     R0, [R6, #0x10] \n"
 247 "    MOV     R1, #0x3E8 \n"
 248 "    BL      _TakeSemaphore \n"
 249 "    CMP     R0, #9 \n"
 250 "    BNE     loc_FF8627C0 \n"
 251 
 252 "loc_FF8627B0:\n"
 253 "    BL      sub_FF943174 \n"
 254 "    MOV     R0, #0x90000 \n"
 255 "    STR     R5, [R6, #0x38] \n"
 256 "    B       loc_FF862720 \n"
 257 
 258 "loc_FF8627C0:\n"
 259 "    LDR     R0, [SP, #0x3C] \n"
 260 "    CMP     R0, #0 \n"
 261 "    BEQ     loc_FF8627DC \n"
 262 
 263 "loc_FF8627CC:\n"
 264 "    BL      sub_FF943174 \n"
 265 "    MOV     R0, #0xA0000 \n"
 266 "    STR     R5, [R6, #0x38] \n"
 267 "    B       loc_FF862720 \n"
 268 
 269 "loc_FF8627DC:\n"
 270 "    MOV     R0, #1 \n"
 271 "    BL      sub_FF8FEA7C \n"
 272 "    LDR     R0, [SP, #0x40] \n"
 273 "    LDR     R1, [SP, #0x38] \n"
 274 "    ADD     LR, R1, R0 \n"
 275 "    LDR     R1, [SP, #0x34] \n"
 276 "    SUB     R12, R1, R0 \n"
 277 
 278 "loc_FF8627F8:\n"
 279 "    LDR     R0, [R4, #0x14] \n"
 280 "    LDR     R2, [R6, #0x48] \n"
 281 "    LDR     R1, [R4, #0x18] \n"
 282 "    ADD     R3, SP, #0x3C \n"
 283 "    ADD     R9, SP, #0x18 \n"
 284 "    STMIA   R9, {R0-R3} \n"
 285 "    LDR     R0, [SP, #0x2C] \n"
 286 "    LDR     R2, [R6, #0x64] \n"
 287 "    LDR     R3, [R6, #0x68] \n"
 288 "    ADD     R1, SP, #0x40 \n"
 289 "    ADD     R9, SP, #8 \n"
 290 "    STMIA   R9, {R0-R3} \n"
 291 "    LDR     R3, [SP, #0x30] \n"
 292 "    STR     R12, [SP] \n"
 293 "    STR     R3, [SP, #4] \n"
 294 "    LDMIB   R4, {R0,R1} \n"
 295 "    MOV     R3, LR \n"
 296 "    MOV     R2, R8 \n"
 297 "    BL      sub_FF8FE9D4 \n"
 298 "    LDR     R0, [R6, #0x10] \n"
 299 "    MOV     R1, #0x3E8 \n"
 300 "    BL      _TakeSemaphore \n"
 301 "    CMP     R0, #9 \n"
 302 "    BNE     loc_FF862874 \n"
 303 "    BL      sub_FF943174 \n"
 304 "    MOV     R0, #0x90000 \n"
 305 "    STR     R5, [R6, #0x38] \n"
 306 "    BL      sub_FF87F1C4 /*_HardwareDefect_FW*/ \n"
 307 "    MOV     R0, #0 \n"
 308 
 309 "loc_FF86286C:\n"
 310 "    BL      sub_FF8FEA7C \n"
 311 "    B       loc_FF862718 \n"
 312 
 313 "loc_FF862874:\n"
 314 "    LDR     R0, [SP, #0x3C] \n"
 315 "    CMP     R0, #0 \n"
 316 "    BEQ     loc_FF862894 \n"
 317 "    BL      sub_FF943174 \n"
 318 "    MOV     R0, #0xA0000 \n"
 319 "    STR     R5, [R6, #0x38] \n"
 320 "    BL      sub_FF87F1C4 /*_HardwareDefect_FW*/ \n"
 321 "    B       loc_FF862718 \n"
 322 
 323 "loc_FF862894:\n"
 324 "    MOV     R0, #0 \n"
 325 "    BL      sub_FF8FEA7C \n"
 326 "    LDR     R0, [SP, #0x38] \n"
 327 "    LDR     R1, [SP, #0x40] \n"
 328 "    BL      sub_FF942ED0 \n"
 329 "    LDR     R0, [R6, #0x48] \n"
 330 "    LDR     R3, =0x5448 \n"
 331 "    ADD     R1, R0, #1 \n"
 332 "    STR     R1, [R6, #0x48] \n"
 333 "    STR     R3, [SP] \n"
 334 "    LDR     R0, [SP, #0x40] \n"
 335 "    SUB     R3, R3, #4 \n"
 336 "    MOV     R2, #0xF \n"
 337 "    BL      sub_FF9411CC \n"
 338 "    LDR     R0, =video_compression_rate\n" //added
 339 "    BL      set_quality\n"                 //added
 340 
 341 "loc_FF8628CC:\n"
 342 "    LDR     R0, [R6, #0x4C] \n"
 343 "    ADD     R0, R0, #1 \n"
 344 "    STR     R0, [R6, #0x4C] \n"
 345 "    LDR     R1, [R6, #0x74] \n"
 346 "    MUL     R0, R1, R0 \n"
 347 "    LDR     R1, [R6, #0x70] \n"
 348 "    BL      sub_FFB07534 /*__divmod_unsigned_int*/ \n"
 349 "    MOV     R4, R0 \n"
 350 "    BL      sub_FF9431AC \n"
 351 "    LDR     R1, [R6, #0x6C] \n"
 352 "    CMP     R1, R4 \n"
 353 "    BNE     loc_FF862908 \n"
 354 "    LDR     R0, [R6, #0x30] \n"
 355 "    CMP     R0, #1 \n"
 356 "    BNE     loc_FF86291C \n"
 357 
 358 "loc_FF862908:\n"
 359 "    LDR     R1, [R6, #0x80] \n"
 360 "    MOV     R0, R4 \n"
 361 "    BLX     R1 \n"
 362 "    STR     R4, [R6, #0x6C] \n"
 363 "    STR     R7, [R6, #0x30] \n"
 364 
 365 "loc_FF86291C:\n"
 366 "    STR     R7, [R6, #0x2C] \n"
 367 "    B       loc_FF862718 \n"
 368 );
 369 }

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