root/platform/ixus120_sd940/sub/102c/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_FF93CFDC_my

   1 #include "conf.h"
   2 
   3 
   4 /*----------------------------------------------------------------------
   5         change_video_tables()
   6 -----------------------------------------------------------------------*/
   7 void change_video_tables(__attribute__ ((unused))int a, __attribute__ ((unused))int b) {}
   8 
   9 /*----------------------------------------------------------------------
  10         set_quality()
  11 -----------------------------------------------------------------------*/
  12 // from sx10, not sure if the values are right, seems to work
  13 void  set_quality(int *x){ // -17 highest; +12 lowest
  14         if (conf.video_mode)
  15                 *x=12-((conf.video_quality-1)*(12+17)/(99-1));
  16 }
  17 
  18 
  19 /*----------------------------------------------------------------------
  20         movie_record_task()
  21 -----------------------------------------------------------------------*/
  22 void __attribute__((naked,noinline)) movie_record_task()
  23 {       asm volatile(
  24 "               STMFD   SP!, {R2-R8,LR} \n"
  25 "               LDR     R7, =0x2710 \n"
  26 "               LDR     R4, =0x6228 \n"
  27 "               MOV     R6, #0 \n"
  28 "               MOV     R5, #1 \n"
  29 "loc_FF93D65C: \n"
  30 "               LDR     R0, [R4,#0x18] \n"
  31 "               MOV     R2, #0 \n"
  32 "               ADD     R1, SP, #0x04 \n"
  33 "               BL      sub_FF837DC8 \n"
  34 "               LDR     R0, [R4,#0x20] \n"
  35 "               CMP     R0, #0 \n"
  36 "               BNE     loc_FF93D72C \n"
  37 "               LDR     R0, [SP,#0x04] \n"
  38 "               LDR     R1, [R0] \n"
  39 "               SUB     R1, R1, #2 \n"
  40 "               CMP     R1, #9 \n"
  41 "               ADDLS   PC, PC, R1,LSL#2 \n"
  42 "               B       loc_FF93D72C \n"
  43 "loc_FF93D690: \n"
  44 "               B       loc_FF93D6E0 \n"
  45 "loc_FF93D694: \n"
  46 "               B       loc_FF93D700 \n"
  47 "loc_FF93D698: \n"
  48 "               B       loc_FF93D710 \n"
  49 "loc_FF93D69C: \n"
  50 "               B       loc_FF93D718 \n"
  51 "loc_FF93D6A0: \n"
  52 "               B       loc_FF93D6E8 \n"
  53 "loc_FF93D6A4: \n"
  54 "               B       loc_FF93D720 \n"
  55 "loc_FF93D6A8: \n"
  56 "               B       loc_FF93D6F0 \n"
  57 "loc_FF93D6AC: \n"
  58 "               B       loc_FF93D72C \n"
  59 "loc_FF93D6B0: \n"
  60 "               B       loc_FF93D728 \n"
  61 "loc_FF93D6B4: \n"
  62 "               B       loc_FF93D6B8 \n"
  63 
  64 "loc_FF93D6B8: \n"
  65 // jumptable FF93D688 entry 9
  66 "               LDR     R0, =0xFF93D35C \n"                             // nullsub_229
  67 "               STR     R6, [R4,#0x34] \n"
  68 "               STR     R0, [R4,#0x9C] \n"
  69 "               LDR     R2, =0xFF93C890 \n"
  70 "               LDR     R1, =0x67F58 \n"
  71 "               LDR     R0, =0xFF93C974 \n"
  72 "               STR     R6, [R4,#0x24] \n"
  73 "               BL      sub_FF8D9F28 \n"
  74 "               STR     R5, [R4,#0x38] \n"
  75 "               B       loc_FF93D72C \n"
  76 
  77 "loc_FF93D6E0: \n"   // jumptable FF93D688 entry 0
  78 "               BL     unlock_optical_zoom \n"          // patched
  79 "               BL      sub_FF93D464 \n"
  80 "               B       loc_FF93D72C \n"
  81 
  82 "loc_FF93D6E8: \n"  // jumptable FF93D688 entry 4
  83 //"             BL      sub_FF93CFDC \n"
  84 "               BL      sub_FF93CFDC_my \n"                             // patched
  85 "               B       loc_FF93D72C \n"
  86 
  87 "loc_FF93D6F0: \n"  // jumptable FF93D688 entry 6
  88 "               LDR     R1, [R0,#0x18] \n"
  89 "               LDR     R0, [R0,#4] \n"
  90 "               BL      sub_FFA63B44 \n"
  91 "               B       loc_FF93D72C \n"
  92 
  93 "loc_FF93D700: \n"  // jumptable FF93D688 entry 1
  94 "               LDR     R0, [R4,#0x38] \n"
  95 "               CMP     R0, #5 \n"
  96 "               STRNE   R5, [R4,#0x28] \n"
  97 "               B       loc_FF93D72C \n"
  98 
  99 "loc_FF93D710: \n" // jumptable FF93D688 entry 2
 100 "               BL      sub_FF93CCDC \n"
 101 "               B       loc_FF93D72C \n"
 102 
 103 "loc_FF93D718: \n"  // jumptable FF93D688 entry 3
 104 "               BL      sub_FF93C9C0 \n"
 105 "               B       loc_FF93D72C \n"
 106 
 107 "loc_FF93D720: \n"  // jumptable FF93D688 entry 5
 108 "               BL      sub_FF93C81C \n"
 109 "               B       loc_FF93D72C \n"
 110 
 111 "loc_FF93D728: \n"  // jumptable FF93D688 entry 8
 112 "               BL      sub_FF93D898 \n"
 113 
 114 "loc_FF93D72C: \n"  // jumptable FF93D688 default entry
 115 "               LDR     R1, [SP,#0x04] \n"
 116 "               MOV     R3, #0x460 \n"
 117 "               STR     R6, [R1] \n"
 118 "               STR     R3, [SP] \n"
 119 "               LDR     R0, [R4,#0x1C] \n"
 120 "               LDR     R3, =0xFF93C67C \n"                     // aMovierecorder_
 121 "               MOV     R2, R7 \n"
 122 "               BL      sub_FF83871C \n"
 123 "               B       loc_FF93D65C \n"
 124         );
 125 }
 126 
 127 
 128 /*----------------------------------------------------------------------
 129         sub_FF93CFDC_my()
 130 -----------------------------------------------------------------------*/
 131 void __attribute__((naked,noinline)) sub_FF93CFDC_my()
 132 {   asm volatile(
 133 "               STMFD   SP!, {R4-R8,LR} \n"
 134 "               SUB     SP, SP, #0x40 \n"
 135 "               MOV     R7, #0 \n"
 136 "               LDR     R6, =0x6228 \n"
 137 "               MOV     R4, R0 \n"
 138 "               STR     R7, [SP,#0x30] \n"
 139 "               STR     R7, [SP,#0x28] \n"
 140 "               LDR     R0, [R6,#0x38] \n"
 141 "               MOV     R8, #4 \n"
 142 "               CMP     R0, #3 \n"
 143 "               STREQ   R8, [R6,#0x38] \n"
 144 "               LDR     R0, [R6,#0x9C] \n"
 145 "               BLX     R0 \n"
 146 "               LDR     R0, [R6,#0x38] \n"
 147 "               CMP     R0, #4 \n"
 148 "               BNE     loc_FF93D14C \n"
 149 "               ADD     R3, SP, #0x28 \n"
 150 "               ADD     R2, SP, #0x2C \n"
 151 "               ADD     R1, SP, #0x30 \n"
 152 "               ADD     R0, SP, #0x34 \n"
 153 "               BL      sub_FFA63BE0 \n"
 154 "               CMP     R0, #0 \n"
 155 "               MOV     R5, #1 \n"
 156 "               BNE     loc_FF93D058 \n"
 157 "               LDR     R1, [R6,#0x28] \n"
 158 "               CMP     R1, #1 \n"
 159 "               BNE     loc_FF93D154 \n"
 160 "               LDR     R1, [R6,#0x4C] \n"
 161 "               LDR     R2, [R6,#0x3C] \n"
 162 "               CMP     R1, R2 \n"
 163 "               BCC     loc_FF93D154 \n"
 164 "loc_FF93D058: \n"
 165 "               CMP     R0, #0x80000001 \n"
 166 "               STREQ   R8, [R6,#0x50] \n"
 167 "               BEQ     loc_FF93D090 \n"
 168 "               CMP     R0, #0x80000003 \n"
 169 "               STREQ   R5, [R6,#0x50] \n"
 170 "               BEQ     loc_FF93D090 \n"
 171 "               CMP     R0, #0x80000005 \n"
 172 "               MOVEQ   R0, #2 \n"
 173 "               BEQ     loc_FF93D08C \n"
 174 "               CMP     R0, #0x80000007 \n"
 175 "               STRNE   R7, [R6,#0x50] \n"
 176 "               BNE     loc_FF93D090 \n"
 177 "               MOV     R0, #3 \n"
 178 "loc_FF93D08C: \n"
 179 "               STR     R0, [R6,#0x50] \n"
 180 "loc_FF93D090: \n"
 181 "               LDR     R0, =0x67F8C \n"
 182 "               LDR     R0, [R0,#8] \n"
 183 "               CMP     R0, #0 \n"
 184 "               BEQ     loc_FF93D0A8 \n"
 185 "               BL      sub_FF85A840 \n"
 186 "               B       loc_FF93D0AC \n"
 187 "loc_FF93D0A8: \n"
 188 "               BL      sub_FF93C81C \n"
 189 "loc_FF93D0AC: \n"
 190 "               LDR     R0, [R4,#0x1C] \n"
 191 "               ADD     R4, SP, #0x18 \n"
 192 "               ADD     R3, SP, #0x38 \n"
 193 "               MVN     R2, #1 \n"
 194 "               MOV     R1, #0 \n"
 195 "               STMIA   R4, {R0-R3} \n"
 196 "               LDR     R2, [R6,#0x64] \n"
 197 "               LDR     R3, [R6,#0x68] \n"
 198 "               ADD     R1, SP, #0x3c \n"
 199 "               ADD     R4, SP, #0x08 \n"
 200 "               MOV     R0, #0 \n"
 201 "               STMIA   R4, {R0-R3} \n"
 202 "               MOV     R3, #0 \n"
 203 "               MOV     R2, #0x40 \n"
 204 "               STRD    R2, [SP] \n"
 205 "               LDR     R3, =0x67FA4 \n"
 206 "               MOV     R2, #0 \n"
 207 "               MOV     R1, #0 \n"
 208 "               BL      sub_FFA28068 \n"
 209 "               LDR     R0, [R6,#0x10] \n"
 210 "               MOV     R1, #0x3E8 \n"
 211 "               BL      sub_FF8381E4 \n"                        // eventproc_export_TakeSemaphore
 212 "               CMP     R0, #9 \n"
 213 "               BNE     loc_FF93D11C \n"
 214 "loc_FF93D10C: \n"
 215 "               BL      sub_FFA640B4 \n"
 216 "               MOV     R0, #1 \n"
 217 "               STR     R5, [R6,#0x38] \n"
 218 "               B       loc_FF93D27C \n"
 219 "loc_FF93D11C: \n"
 220 "               LDR     R0, [SP,#0x38] \n"
 221 "               CMP     R0, #0 \n"
 222 "               BEQ     loc_FF93D138 \n"
 223 "loc_FF93D128: \n"
 224 "               BL      sub_FFA640B4 \n"
 225 "               MOV     R0, #1 \n"
 226 "               STR     R5, [R6,#0x38] \n"
 227 "               B       loc_FF93D2A8 \n"
 228 "loc_FF93D138: \n"
 229 "               MOV     R0, #1 \n"
 230 "               BL      sub_FFA28110 \n"
 231 "               BL      sub_FFA2814C \n"
 232 "               MOV     R0, #5 \n"
 233 "               STR     R0, [R6,#0x38] \n"
 234 "loc_FF93D14C: \n"
 235 "               ADD     SP, SP, #0x40 \n"
 236 "               LDMFD   SP!, {R4-R8,PC} \n"
 237 "loc_FF93D154: \n"
 238 "               LDR     R12, [SP,#0x30] \n"
 239 "               CMP     R12, #0 \n"
 240 "               BEQ     loc_FF93D304 \n"
 241 "               STR     R5, [R6,#0x2C] \n"
 242 "               LDR     R0, [R6,#0x4C] \n"
 243 "               LDR     R8, [R4,#0xC] \n"
 244 "               CMP     R0, #0 \n"
 245 "               LDRNE   LR, [SP,#0x34] \n"
 246 "               BNE     loc_FF93D200 \n"
 247 "               LDR     R0, [R4,#0x1C] \n"
 248 "               LDR     R1, [R4,#0x20] \n"
 249 "               ADD     R3, SP, #0x38 \n"
 250 "               MVN     R2, #0 \n"
 251 "               ADD     LR, SP, #0x18 \n"
 252 "               STMIA   LR, {R0-R3} \n"
 253 "               LDR     R0, [SP,#0x28] \n"
 254 "               LDR     R2, [R6,#0x64] \n"
 255 "               LDR     R3, [R6,#0x68] \n"
 256 "               ADD     R1, SP, #0x3c \n"
 257 "               ADD     LR, SP, #0x08 \n"
 258 "               STMIA   LR, {R0-R3} \n"
 259 "               LDR     R3, [SP,#0x2C] \n"
 260 "               STR     R12, [SP] \n"
 261 "               STR     R3, [SP,#0x04] \n"
 262 "               LDMIB   R4, {R0,R1} \n"
 263 "               LDR     R3, [SP,#0x34] \n"
 264 "               MOV     R2, R8 \n"
 265 "               BL      sub_FFA28068 \n"
 266 "               LDR     R0, [R6,#0x10] \n"
 267 "               MOV     R1, #0x3E8 \n"
 268 "               BL      sub_FF8381E4 \n"                        // eventproc_export_TakeSemaphore
 269 "               CMP     R0, #9 \n"
 270 "               BEQ     loc_FF93D10C \n"
 271 "               LDR     R0, [SP,#0x38] \n"
 272 "               CMP     R0, #0 \n"
 273 "               BNE     loc_FF93D128 \n"
 274 "               MOV     R0, #1 \n"
 275 "               BL      sub_FFA28110 \n"
 276 "               LDR     R0, [SP,#0x3C] \n"
 277 "               LDR     R1, [SP,#0x34] \n"
 278 "               ADD     LR, R1, R0 \n"
 279 "               LDR     R1, [SP,#0x30] \n"
 280 "               SUB     R12, R1, R0 \n"
 281 "loc_FF93D200: \n"
 282 "               LDR     R2, [R6,#0x48] \n"
 283 "               LDR     R0, [R4,#0x1C] \n"
 284 "               LDR     R1, [R4,#0x20] \n"
 285 "               ADD     R3, SP, #0x38 \n"
 286 "               STR     R0, [SP,#0x18] \n"
 287 "               STR     R1, [SP,#0x1C] \n"
 288 "               STR     R3, [SP,#0x24] \n"
 289 "               STR     R2, [SP,#0x20] \n"
 290 "               LDR     R2, [R6,#0x64] \n"
 291 "               LDR     R3, [R6,#0x68] \n"
 292 "               LDR     R0, [SP,#0x28] \n"
 293 "               STR     R3, [SP,#0x14] \n"
 294 "               LDR     R3, [SP,#0x2C] \n"
 295 "               ADD     R1, SP, #0x3C \n"
 296 "               STR     R2, [SP,#0x10] \n"
 297 "               STR     R3, [SP,#0x04] \n"
 298 "               STR     R1, [SP,#0x0C] \n"
 299 "               STR     R12, [SP] \n"
 300 "               STR     R0, [SP,#0x08] \n"
 301 "               LDMIB   R4, {R0,R1} \n"
 302 "               MOV     R3, LR \n"
 303 "               MOV     R2, R8 \n"
 304 "               BL      sub_FFA28068 \n"
 305 "               LDR     R0, [R6,#0x10] \n"
 306 "               MOV     R1, #0x3E8 \n"
 307 "               BL      sub_FF8381E4 \n"                        // eventproc_export_TakeSemaphore
 308 "               CMP     R0, #9 \n"
 309 "               BNE     loc_FF93D290 \n"
 310 "               BL      sub_FFA640B4 \n"
 311 "               MOV     R0, #0 \n"
 312 "               STR     R5, [R6,#0x38] \n"
 313 "loc_FF93D27C: \n"
 314 "               BL      sub_FFA28110 \n"
 315 "               MOV     R0, #0xC \n"
 316 "               BL      sub_FF87F3CC \n"
 317 "               MOV     R0, #0x90000 \n"
 318 "               B       loc_FF93D2B8 \n"
 319 "loc_FF93D290: \n"
 320 "               LDR     R0, [SP,#0x38] \n"
 321 "               CMP     R0, #0 \n"
 322 "               BEQ     loc_FF93D2CC \n"
 323 "               BL      sub_FFA640B4 \n"
 324 "               MOV     R0, #0 \n"
 325 "               STR     R5, [R6,#0x38] \n"
 326 " \n"
 327 "loc_FF93D2A8: \n"
 328 "               BL      sub_FFA28110 \n"
 329 "               MOV     R0, #0xC \n"
 330 "               BL      sub_FF87F3CC \n"
 331 "               MOV     R0, #0xA0000 \n"
 332 " \n"
 333 "loc_FF93D2B8: \n"
 334 "               BL      sub_FF88ACFC \n"                        // eventproc_export_HardwareDefect
 335 "               LDR     R1, [R6,#0x8C]! \n"
 336 "               LDR     R0, [R6,#0xC] \n"
 337 "               BLX     R1 \n"
 338 "               B       loc_FF93D14C \n"
 339 "loc_FF93D2CC: \n"
 340 "               MOV     R0, #0 \n"
 341 "               BL      sub_FFA28110 \n"
 342 "               LDR     R0, [SP,#0x34] \n"
 343 "               LDR     R1, [SP,#0x3C] \n"
 344 "               BL      sub_FFA63E0C \n"
 345 "               LDR     R0, [R6,#0x48] \n"
 346 "               LDR     R3, =0x6290 \n"                         // 6290
 347 "               ADD     R1, R0, #1 \n"
 348 "               STR     R1, [R6,#0x48] \n"
 349 "               STR     R3, [SP] \n"
 350 "               LDR     R0, [SP,#0x3C] \n"
 351 "               SUB     R3, R3, #4 \n"                          // 4
 352 "               MOV     R2, #0xF \n"
 353 "               BL      sub_FFA61F90 \n"
 354 
 355 "               LDR     R0, =0x6290-4 \n"                       // 6290 - 4
 356 "               BL      set_quality \n"                         // added
 357 
 358 "loc_FF93D304: \n"
 359 "               LDR     R0, [R6,#0x4C] \n"
 360 "               ADD     R0, R0, #1 \n"
 361 "               STR     R0, [R6,#0x4C] \n"
 362 "               LDR     R1, [R6,#0x74] \n"
 363 "               MUL     R0, R1, R0 \n"
 364 "               LDR     R1, [R6,#0x70] \n"
 365 "               BL      sub_FFB092E8 \n"
 366 "               MOV     R4, R0 \n"
 367 "               BL      sub_FFA640EC \n"
 368 "               LDR     R1, [R6,#0x6C] \n"
 369 "               CMP     R1, R4 \n"
 370 "               BNE     loc_FF93D340 \n"
 371 "               LDR     R0, [R6,#0x30] \n"
 372 "               CMP     R0, #1 \n"
 373 "               BNE     loc_FF93D354 \n"
 374 "loc_FF93D340: \n"
 375 "               LDR     R1, [R6,#0x80] \n"
 376 "               MOV     R0, R4 \n"
 377 "               BLX     R1 \n"
 378 "               STR     R4, [R6,#0x6C] \n"
 379 "               STR     R7, [R6,#0x30] \n"
 380 "loc_FF93D354: \n"
 381 "               STR     R7, [R6,#0x2C] \n"
 382 "               B       loc_FF93D14C \n"
 383         );
 384 }

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