root/platform/ixus130_sd1400/sub/100a/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

   1 #include "conf.h"
   2 
   3 //int *video_quality = &conf.video_quality;
   4 //int *video_mode    = &conf.video_mode;
   5 
   6 void change_video_tables(int a, int b) {
   7     //int i;
   8     //for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b;
   9 }
  10 
  11 // like other cameras
  12 void  set_quality(int *x) { // -17 highest; +12 lowest
  13     if (conf.video_mode) *x=12-((conf.video_quality-1)*(12+17)/(99-1));
  14 }
  15 
  16 // FF95A538: movie_record_task() aka. task_MovieRecord()
  17 void __attribute__((naked,noinline)) movie_record_task() { // was FF96BD30
  18   asm volatile (
  19         "PUSH   {r2, r3, r4, r5, r6, r7, r8, lr}\n"
  20         "LDR    r8, =0x000004b3\n" // was: [pc, #756]   ; ff95a838: (000004b3) 
  21         "LDR    r7, =0x00002710\n" // was: [pc, #-2500] ; ff959b84: (00002710) 
  22         "LDR    r4, =0x000063f8\n" // was: [pc, #-4008] ; ff9595a4: (000063f8) 
  23         "LDR    r6, =0x0\n" // was: "mov ..., #0"
  24         "LDR    r5, =0x1\n" // was: "mov ..., #1"
  25 "loc_FF95A550:\n"
  26         "LDR    r0, [r4, #24]\n"
  27         "LDR    r2, =0x0\n" // was: "mov ..., #0"
  28         "ADD    r1, sp, #4\n"   // 0x4
  29         "BL     sub_ff8396e4\n"
  30         "LDR    r0, [r4, #32]\n"
  31         "CMP    r0, #0\n"       // 0x0
  32         "BNE    loc_FF95A620\n"
  33         "LDR    r0, [sp, #4]\n"
  34         "LDR    r1, [r0]\n"
  35         "SUB    r1, r1, #2\n"   // 0x2
  36         "CMP    r1, #9\n"       // 0x9
  37         "ADDLS  pc, pc, r1, lsl #2\n"
  38         "B      loc_FF95A620\n"
  39         "B      loc_FF95A5D4\n" // 0 jump table start
  40         "B      loc_FF95A5F4\n"
  41         "B      loc_FF95A604\n"
  42         "B      loc_FF95A60C\n"
  43         "B      loc_FF95A5DC\n"
  44         "B      loc_FF95A614\n"
  45         "B      loc_FF95A5E4\n"
  46         "B      loc_FF95A620\n"
  47         "B      loc_FF95A61C\n"
  48         "B      loc_FF95A5AC\n" // 9
  49 "loc_FF95A5AC:\n" // jump table entry 9
  50         "LDR    r0, =0xFF95A24C\n" // was: "sub r0, pc, #872"  
  51         "STR    r6, [r4, #52]\n"
  52         "STR    r0, [r4, #164]\n"
  53 
  54         // Ixus300 has this, referenced in case 4: (what does it do?)
  55         //"ADR     R0, =0xFF96BA00\n"
  56         //"LDR     R0, =sub_ff959f88_my\n"      // +
  57         //"STR     R0, [R4,#0xAC]\n"
  58 
  59         "LDR    r0, =0xFF959854\n" // was: [pc, #-2596] ; ff959ba4: (0009668c)
  60         "LDR    r2, =0xFF959770\n" // was: [pc, #640]   ; ff95a840: (ff959854) 
  61         "LDR    r1, =0x0009668c\n" // was: [pc, #632]   ; ff95a83c: (ff959770) 
  62         "STR    r6, [r4, #0x24]\n" // 0x24
  63         "BL     sub_ff85021c\n"
  64         "STR    r5, [r4, #56]\n" // 0x38
  65         "B      loc_FF95A620\n"
  66 "loc_FF95A5D4:\n" // jump table entry 0
  67         "BL     unlock_optical_zoom\n" // added (disabled in camera.h, crashes)
  68         "BL     sub_FF95A354\n"
  69         "B      loc_FF95A620\n"
  70 "loc_FF95A5DC:\n" // jump table entry 4
  71 
  72         // Ixus300 has the next 2 lines instead of the following one: (what does it do?)
  73         //"LDR     R1, [R4,#0xAC]\n"
  74         //"BLX     R1\n"
  75 
  76         "BL     sub_FF959ECC\n"
  77         //"BL   sub_ff959f88_my\n"
  78         "B      loc_FF95A620\n"
  79 "loc_FF95A5E4:\n" // jump table entry 6
  80         "LDR    r1, [r0, #24]\n"
  81         "LDR    r0, [r0, #4]\n"
  82         "BL     sub_FFA8CB84\n"
  83         "B      loc_FF95A620\n"
  84 "loc_FF95A5F4:\n" // jump table entry 1
  85         "LDR    r0, [r4, #56]\n"
  86         "CMP    r0, #5\n"       // 0x5
  87         "STRNE  r5, [r4, #40]\n"
  88         "B      loc_FF95A620\n"
  89 "loc_FF95A604:\n" // jump table entry 2
  90         "BL     sub_FF959BC8\n"
  91         "B      loc_FF95A620\n"
  92 "loc_FF95A60C:\n" // jump table entry 3
  93         "BL     sub_FF9598A0\n"
  94         "B      loc_FF95A620\n"
  95 "loc_FF95A614:\n" // jump table entry 5
  96         "BL     sub_FF9596FC\n"
  97         "B      loc_FF95A620\n"
  98 "loc_FF95A61C:\n" // jump table entry 8
  99         "BL     sub_FF95A788\n"
 100 "loc_FF95A620:\n" // jump table entry 7, default
 101         "LDR    r1, [sp, #4]\n"
 102         "LDR    r3, =0xFF959590\n" // was [pc, #-2684]  ; ff959bb0: (ff959590)  **"MovieRecorder.c"
 103         "STR    r6, [r1]\n"
 104         "STR    r8, [sp]\n"
 105         "LDR    r0, [r4, #28]\n"
 106         "MOV    r2, r7\n"
 107         "BL     sub_FF83A038\n"
 108         "B      loc_FF95A550\n"
 109     );
 110 }
 111 /*
 112 void __attribute__((naked,noinline)) sub_ff959f88_my() { // was FF96BA00
 113   asm volatile (
 114         "PUSH   {r4, r5, r6, r7, r8, lr}\n"
 115         "SUB    sp, sp, #64\n"  // 0x40
 116         "LDR    r7, =0x0\n" // was: "mov ..., #0"
 117         "LDR    r6, =0x000063f8\n" // was: "[pc, #-2376]        ; ff959654" 
 118         "MOV    r4, r0\n"
 119         "STR    r7, [sp, #48]\n"
 120         "STR    r7, [sp, #40]\n"
 121         "LDR    r0, [r6, #56]\n"
 122         "LDR    r8, =0x4\n" // was: "mov ..., #4"
 123         "CMP    r0, #3\n"       // 0x3
 124         "STREQ  r8, [r6, #56]\n"
 125         "LDR    r0, [r6, #164]\n"
 126         "BLX    r0\n"
 127         "LDR    r0, [r6, #56]\n"
 128         "CMP    r0, #4\n"       // 0x4
 129         "BNE    loc_ff95a0f8\n"
 130         "ADD    r3, sp, #40\n"  // 0x28
 131         "ADD    r2, sp, #44\n"  // 0x2c
 132         "ADD    r1, sp, #48\n"  // 0x30
 133         "ADD    r0, sp, #52\n"  // 0x34
 134         "BL     sub_ffa8ccc4\n"
 135         "CMP    r0, #0\n"       // 0x0
 136         "LDR    r5, =0x1\n" // was: "mov ..., #1"
 137         "BNE    loc_ff95a004\n"
 138         "LDR    r1, [r6, #40]\n"
 139         "CMP    r1, #1\n"       // 0x1
 140         "BNE    loc_ff95a100\n"
 141         "LDR    r1, [r6, #92]\n"
 142         "LDR    r2, [r6, #60]\n"
 143         "CMP    r1, r2\n"
 144         "BCC    loc_ff95a100\n"
 145 "loc_ff95a004:\n"
 146         "CMP    r0, #-2147483647\n"     // 0x80000001
 147         "STREQ  r8, [r6, #96]\n"
 148         "BEQ    loc_ff95a03c\n"
 149         "CMP    r0, #-2147483645\n"     // 0x80000003
 150         "STREQ  r5, [r6, #96]\n"
 151         "BEQ    loc_ff95a03c\n"
 152         "CMP    r0, #-2147483643\n"     // 0x80000005
 153         "LDREQ  r0, =0x2\n" // was: "mov ..., #2"
 154         "BEQ    loc_ff95a038\n"
 155         "CMP    r0, #-2147483641\n"     // 0x80000007
 156         "STRNE  r7, [r6, #96]\n"
 157         "BNE    loc_ff95a03c\n"
 158         "LDR    r0, =0x3\n" // was: "mov ..., #3"
 159 "loc_ff95a038:\n"
 160         "STR    r0, [r6, #96]\n"
 161 "loc_ff95a03c:\n" // 3 refs
 162         "LDR    r0, =0x000966c0\n" // was: "[pc, #-2512]        ; ff959674" 
 163         "LDR    r0, [r0, #8]\n"
 164         "CMP    r0, #0\n"       // 0x0
 165         "BEQ    loc_ff95a054\n"
 166         "BL     sub_ff861870\n"
 167         "B      loc_ff95a058\n"
 168 "loc_ff95a054:\n"
 169         "BL     sub_ff9597ac\n"
 170 "loc_ff95a058:\n"
 171         "LDR    r0, [r4, #28]\n"
 172         "ADD    r4, sp, #24\n"  // 0x18
 173         "ADD    r3, sp, #56\n"  // 0x38
 174         "MVN    r2, #1\n"       // 0x1
 175         "LDR    r1, =0x0\n" // was: "mov ..., #0"
 176         "STM    r4, {r0, r1, r2, r3}\n"
 177         "LDR    r2, [r6, #116]\n"
 178         "LDR    r3, [r6, #120]\n"
 179         "ADD    r1, sp, #60\n"  // 0x3c
 180         "ADD    r4, sp, #8\n"   // 0x8
 181         "LDR    r0, =0x0\n" // was: "mov ..., #0"
 182         "STM    r4, {r0, r1, r2, r3}\n"
 183         "LDR    r3, =0x0\n" // was: "mov ..., #0"
 184         "LDR    r2, =0x40\n" // was: "mov ..., #64"
 185         "STRD   r2, [sp]\n"
 186         "LDR    r3, =0x000966d8\n" // was: "[pc, #2112] ; ff95a8dc" 
 187         "LDR    r2, =0x0\n" // was: "mov ..., #0"
 188         "LDR    r1, =0x0\n" // was: "mov ..., #0"
 189         "BL     sub_ffa4b708\n"
 190         "LDR    r0, [r6, #16]\n"
 191         "LDR    r1, [r6, #84]\n"
 192         "BL     sub_ff839b00\n" // eventproc_export_TakeSemaphore()
 193         "CMP    r0, #9\n"       // 0x9
 194         "BNE    loc_ff95a0c8\n"
 195 "loc_ff95a0b8:\n"
 196         "BL     sub_ffa8d198\n"
 197         "LDR    r0, =0x1\n" // was: "mov ..., #1"
 198         "STR    r5, [r6, #56]\n"
 199         "B      loc_ff95a228\n"
 200 "loc_ff95a0c8:\n"
 201         "LDR    r0, [sp, #56]\n"
 202         "CMP    r0, #0\n"       // 0x0
 203         "BEQ    loc_ff95a0e4\n"
 204 "loc_ff95a0d4:\n"
 205         "BL     sub_ffa8d198\n"
 206         "LDR    r0, =0x1\n" // was: "mov ..., #1"
 207         "STR    r5, [r6, #56]\n"
 208         "B      loc_ff95a254\n"
 209 "loc_ff95a0e4:\n"
 210         "LDR    r0, =0x1\n" // was: "mov ..., #1"
 211         "BL     sub_ffa4b7ac\n"
 212         "BL     sub_ffa4b808\n"
 213         "LDR    r0, =0x5\n" // was: "mov ..., #5"
 214         "STR    r0, [r6, #56]\n"
 215 "loc_ff95a0f8:\n" // 3 refs
 216         "ADD    sp, sp, #64\n"  // 0x40
 217         "POP    {r4, r5, r6, r7, r8, pc}\n"
 218 "loc_ff95a100:\n" // 2 refs
 219         "LDR    ip, [sp, #48]\n"
 220         "CMP    ip, #0\n"       // 0x0
 221         "BEQ    loc_ff95a2b0\n"
 222         "STR    r5, [r6, #44]\n"
 223         "LDR    r0, [r6, #92]\n"
 224         "LDR    r8, [r4, #12]\n"
 225         "CMP    r0, #0\n"       // 0x0
 226         "LDRNE  lr, [sp, #52]\n"
 227         "BNE    loc_ff95a1ac\n"
 228         "LDR    r0, [r4, #28]\n"
 229         "LDR    r1, [r4, #32]\n"
 230         "ADD    r3, sp, #56\n"  // 0x38
 231         "MVN    r2, #0\n"       // 0x0
 232         "ADD    lr, sp, #24\n"  // 0x18
 233         "STM    lr, {r0, r1, r2, r3}\n"
 234         "LDR    r0, [sp, #40]\n"
 235         "LDR    r2, [r6, #116]\n"
 236         "LDR    r3, [r6, #120]\n"
 237         "ADD    r1, sp, #60\n"  // 0x3c
 238         "ADD    lr, sp, #8\n"   // 0x8
 239         "STM    lr, {r0, r1, r2, r3}\n"
 240         "LDR    r3, [sp, #44]\n"
 241         "STR    ip, [sp]\n"
 242         "STR    r3, [sp, #4]\n"
 243         "LDMIB  r4, {r0, r1}\n"
 244         "LDR    r3, [sp, #52]\n"
 245         "MOV    r2, r8\n"
 246         "BL     sub_ffa4b708\n"
 247         "LDR    r0, [r6, #16]\n"
 248         "LDR    r1, [r6, #84]\n"
 249         "BL     sub_ff839b00\n" // eventproc_export_TakeSemaphore()
 250         "CMP    r0, #9\n"       // 0x9
 251         "BEQ    loc_ff95a0b8\n"
 252         "LDR    r0, [sp, #56]\n"
 253         "CMP    r0, #0\n"       // 0x0
 254         "BNE    loc_ff95a0d4\n"
 255         "LDR    r0, =0x1\n" // was: "mov ..., #1"
 256         "BL     sub_ffa4b7ac\n"
 257         "LDR    r0, [sp, #60]\n"
 258         "LDR    r1, [sp, #52]\n"
 259         "ADD    lr, r1, r0\n"
 260         "LDR    r1, [sp, #48]\n"
 261         "SUB    ip, r1, r0\n"
 262 "loc_ff95a1ac:\n"
 263         "LDR    r2, [r6, #88]\n"
 264         "LDR    r0, [r4, #28]\n"
 265         "LDR    r1, [r4, #32]\n"
 266         "ADD    r3, sp, #56\n"  // 0x38
 267         "STR    r0, [sp, #24]\n"
 268         "STR    r1, [sp, #28]\n"
 269         "STR    r3, [sp, #36]\n"
 270         "STR    r2, [sp, #32]\n"
 271         "LDR    r2, [r6, #116]\n"
 272         "LDR    r3, [r6, #120]\n"
 273         "LDR    r0, [sp, #40]\n"
 274         "STR    r3, [sp, #20]\n"
 275         "LDR    r3, [sp, #44]\n"
 276         "ADD    r1, sp, #60\n"  // 0x3c
 277         "STR    r2, [sp, #16]\n"
 278         "STR    r3, [sp, #4]\n"
 279         "STR    r1, [sp, #12]\n"
 280         "STR    ip, [sp]\n"
 281         "STR    r0, [sp, #8]\n"
 282         "LDMIB  r4, {r0, r1}\n"
 283         "MOV    r3, lr\n"
 284         "MOV    r2, r8\n"
 285         "BL     sub_ffa4b708\n"
 286         "LDR    r0, [r6, #16]\n"
 287         "LDR    r1, [r6, #84]\n"
 288         "BL     sub_ff839b00\n" // eventproc_export_TakeSemaphore()
 289         "CMP    r0, #9\n"       // 0x9
 290         "BNE    loc_ff95a23c\n"
 291         "BL     sub_ffa8d198\n"
 292         "LDR    r0, =0x0\n" // was: "mov ..., #0"
 293         "STR    r5, [r6, #56]\n"
 294 "loc_ff95a228:\n"
 295         "BL     sub_ffa4b7ac\n"
 296         "LDR    r0, =0xc\n" // was: "mov ..., #12"
 297         "BL     sub_ff886d0c\n"
 298         "LDR    r0, =0x90000\n" // was: "mov ..., #589824"
 299         "B      loc_ff95a264\n"
 300 "loc_ff95a23c:\n"
 301         "LDR    r0, [sp, #56]\n"
 302         "CMP    r0, #0\n"       // 0x0
 303         "BEQ    loc_ff95a278\n"
 304         "BL     sub_ffa8d198\n"
 305         "LDR    r0, =0x0\n" // was: "mov ..., #0"
 306         "STR    r5, [r6, #56]\n"
 307 "loc_ff95a254:\n"
 308         "BL     sub_ffa4b7ac\n"
 309         "LDR    r0, =0xc\n" // was: "mov ..., #12"
 310         "BL     sub_ff886d0c\n"
 311         "LDR    r0, =0xa0000\n" // was: "mov ..., #655360"
 312 "loc_ff95a264:\n"
 313         "BL     sub_ff890f40\n" // eventproc_export_HardwareDefect()
 314         "LDR    r1, [r6, #148]!\n"
 315         "LDR    r0, [r6, #12]\n"
 316         "BLX    r1\n"
 317         "B      loc_ff95a0f8\n"
 318 "loc_ff95a278:\n"
 319         "LDR    r0, =0x0\n" // was: "mov ..., #0"
 320         "BL     sub_ffa4b7ac\n"
 321         "LDR    r0, [sp, #52]\n"
 322         "LDR    r1, [sp, #60]\n"
 323         "BL     sub_ffa8cef0\n"
 324         "LDR    r0, [r6, #88]\n"
 325         "LDR    r3, =0x00006470\n" // <----
 326         "ADD    r1, r0, #1\n"   // 0x1
 327         "STR    r1, [r6, #88]\n"
 328         "STR    r3, [sp]\n"
 329         "LDR    r0, [sp, #60]\n"
 330         "SUB    r3, r3, #4\n"   // <----
 331         "LDR    r2, =0xf\n" // was: "mov ..., #15"
 332         "BL     sub_ffa8b040\n"
 333 
 334         //"LDR    r0, =0x6470-4\n" // added
 335         //"BL     set_quality\n" // added
 336 
 337 "loc_ff95a2b0:\n"
 338         "LDR    r0, [r6, #92]\n"
 339         "ADD    r0, r0, #1\n"   // 0x1
 340         "STR    r0, [r6, #92]\n"
 341         "LDR    r1, [r6, #72]\n"
 342         "MUL    r0, r1, r0\n"
 343         "LDR    r1, [r6, #68]\n"
 344         "BL     sub_ffb3b51c\n"
 345         "MOV    r4, r0\n"
 346         "BL     sub_ffa8d1d0\n"
 347         "LDR    r1, [r6, #124]\n"
 348         "CMP    r1, r4\n"
 349         "BNE    loc_ff95a2ec\n"
 350         "LDR    r0, [r6, #48]\n"
 351         "CMP    r0, #1\n"       // 0x1
 352         "BNE    loc_ff95a300\n"
 353 "loc_ff95a2ec:\n"
 354         "LDR    r1, [r6, #136]\n"
 355         "MOV    r0, r4\n"
 356         "BLX    r1\n"
 357         "STR    r4, [r6, #124]\n"
 358         "STR    r7, [r6, #48]\n"
 359 "loc_ff95a300:\n"
 360         "STR    r7, [r6, #44]\n"
 361         "B      loc_ff95a0f8\n"
 362     );
 363 }
 364 */

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