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

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