root/platform/s90/sub/101c/movie_rec.c

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

DEFINITIONS

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

   1 #include "conf.h"
   2 
   3 int *video_quality = &conf.video_quality;
   4 int *video_mode    = &conf.video_mode;
   5 
   6 void  set_quality(int *x){ // -17 highest; +12 lowest
   7  if (conf.video_mode) *x=12-((conf.video_quality-1)*(12+17)/(99-1));
   8 }
   9 
  10 
  11 void __attribute__((naked,noinline)) movie_record_task(){ 
  12  asm volatile(
  13         "STMFD   SP!, {R2-R8,LR}\n"
  14         "LDR     R7, =0x2710\n"
  15         "LDR     R4, =0x7AB0\n"
  16         "MOV     R6, #0\n"
  17         "MOV     R5, #1\n"
  18 "loc_FF961950:\n"
  19         "LDR     R0, [R4,#0x18]\n"
  20         "MOV     R2, #0\n"
  21         "ADD     R1, SP, #4\n"
  22         "BL      sub_FF8382FC    \n"
  23         "LDR     R0, [R4,#0x20]\n"
  24         "CMP     R0, #0\n"
  25         "BNE     loc_FF961A20\n"
  26         "LDR     R0, [SP,#4]\n"
  27         "LDR     R1, [R0]\n"
  28         "SUB     R1, R1, #2\n"
  29         "CMP     R1, #9\n"
  30         "ADDLS   PC, PC, R1,LSL#2\n"
  31         "B       loc_FF961A20\n"
  32 "loc_FF961984:\n"
  33         "B       loc_FF9619D4\n"
  34 "loc_FF961988:\n"
  35         "B       loc_FF9619F4\n"
  36 "loc_FF96198C:\n"
  37         "B       loc_FF961A04\n"
  38 "loc_FF961990:\n"
  39         "B       loc_FF961A0C\n"
  40 "loc_FF961994:\n"
  41         "B       loc_FF9619DC\n"
  42 "loc_FF961998:\n"
  43         "B       loc_FF961A14\n"
  44 "loc_FF96199C:\n"
  45         "B       loc_FF9619E4\n"
  46 "loc_FF9619A0:\n"
  47         "B       loc_FF961A20\n"
  48 "loc_FF9619A4:\n"
  49         "B       loc_FF961A1C\n"
  50 "loc_FF9619A8:\n"
  51         "B       loc_FF9619AC\n"
  52 "loc_FF9619AC:\n"
  53         "STR     R6, [R4,#0x34]\n"
  54         "LDR     R0, =0xFF961654\n"
  55         "LDR     R2, =0xFF960BDC\n"
  56         "LDR     R1, =0x8E094\n"
  57         "STR     R0, [R4,#0x9C]\n"
  58         "LDR     R0, =0xFF960CC0\n"
  59         "STR     R6, [R4,#0x24]\n"
  60         "BL      sub_FF84ED58\n"
  61         "STR     R5, [R4,#0x38]\n"
  62         "B       loc_FF961A20\n"
  63 "loc_FF9619D4:\n"
  64                 "BL      unlock_optical_zoom\n" //+-----> inserted to unlock the zoom
  65         "BL      sub_FF96175C\n"
  66         "B       loc_FF961A20\n"
  67 "loc_FF9619DC:\n"
  68         //"BL      sub_FF9612D4\n"
  69                 "BL      sub_FF9612D4_my\n" // ------------------------------>
  70         "B       loc_FF961A20\n"
  71 "loc_FF9619E4:\n"
  72         "LDR     R1, [R0,#0x18]\n"
  73         "LDR     R0, [R0,#4]\n"
  74         "BL      sub_FFA97054    \n"
  75         "B       loc_FF961A20\n"
  76 "loc_FF9619F4:\n"
  77         "LDR     R0, [R4,#0x38]\n"
  78         "CMP     R0, #5\n"
  79         "STRNE   R5, [R4,#0x28]\n"
  80         "B       loc_FF961A20\n"
  81 "loc_FF961A04:\n"
  82         "BL      sub_FF961020\n"
  83         "B       loc_FF961A20\n"
  84 "loc_FF961A0C:\n"
  85         "BL      sub_FF960D0C\n"
  86         "B       loc_FF961A20\n"
  87 "loc_FF961A14:\n"
  88         "BL      sub_FF960B68\n"
  89         "B       loc_FF961A20\n"
  90 "loc_FF961A1C:\n"
  91         "BL      sub_FF961B8C\n"
  92 "loc_FF961A20:\n"
  93         "LDR     R1, [SP,#4]\n"
  94         "MOV     R3, #0x460\n"
  95         "STR     R6, [R1]\n"
  96         "STR     R3, [SP]\n"
  97         "LDR     R0, [R4,#0x1C]\n"
  98         "LDR     R3, =0xFF9609C8\n"
  99         "MOV     R2, R7\n"
 100         "BL      sub_FF838C50\n"
 101         "B       loc_FF961950\n"
 102  );
 103 } 
 104 
 105 void __attribute__((naked,noinline)) sub_FF9612D4_my(){ 
 106  asm volatile(
 107         "STMFD   SP!, {R4-R8,LR}\n"
 108         "SUB     SP, SP, #0x40\n"
 109         "MOV     R7, #0\n"
 110         "LDR     R6, =0x7AB0\n"
 111         "MOV     R4, R0\n"
 112         "STR     R7, [SP,#0x30]\n"
 113         "STR     R7, [SP,#0x28]\n"
 114         "LDR     R0, [R6,#0x38]\n"
 115         "MOV     R8, #4\n"
 116         "CMP     R0, #3\n"
 117         "STREQ   R8, [R6,#0x38]\n"
 118         "LDR     R0, [R6,#0x9C]\n"
 119         "BLX     R0\n"
 120         "LDR     R0, [R6,#0x38]\n"
 121         "CMP     R0, #4\n"
 122         "BNE     loc_FF961444\n"
 123         "ADD     R3, SP, #0x28\n"
 124         "ADD     R2, SP, #0x2C\n"
 125         "ADD     R1, SP, #0x30\n"
 126         "ADD     R0, SP, #0x34\n"
 127         "BL      sub_FFA970F0    \n"
 128         "CMP     R0, #0\n"
 129         "MOV     R5, #1\n"
 130         "BNE     loc_FF961350\n"
 131         "LDR     R1, [R6,#0x28]\n"
 132         "CMP     R1, #1\n"
 133         "BNE     loc_FF96144C\n"
 134         "LDR     R1, [R6,#0x4C]\n"
 135         "LDR     R2, [R6,#0x3C]\n"
 136         "CMP     R1, R2\n"
 137         "BCC     loc_FF96144C\n"
 138 "loc_FF961350:\n"
 139         "CMP     R0, #0x80000001\n"
 140         "STREQ   R8, [R6,#0x50]\n"
 141         "BEQ     loc_FF961388\n"
 142         "CMP     R0, #0x80000003\n"
 143         "STREQ   R5, [R6,#0x50]\n"
 144         "BEQ     loc_FF961388\n"
 145         "CMP     R0, #0x80000005\n"
 146         "MOVEQ   R0, #2\n"
 147         "BEQ     loc_FF961384\n"
 148         "CMP     R0, #0x80000007\n"
 149         "STRNE   R7, [R6,#0x50]\n"
 150         "BNE     loc_FF961388\n"
 151         "MOV     R0, #3\n"
 152 "loc_FF961384:\n"
 153         "STR     R0, [R6,#0x50]\n"
 154 "loc_FF961388:\n"
 155         "LDR     R0, =0x8E0C8\n"
 156         "LDR     R0, [R0,#8]\n"
 157         "CMP     R0, #0\n"
 158         "BEQ     loc_FF9613A0\n"
 159         "BL      sub_FF8601E0\n"
 160         "B       loc_FF9613A4\n"
 161 "loc_FF9613A0:\n"
 162         "BL      sub_FF960B68    \n"
 163 "loc_FF9613A4:\n"
 164         "LDR     R0, [R4,#0x1C]\n"
 165         "ADD     R4, SP, #0x18\n"
 166         "ADD     R3, SP, #0x38\n"
 167         "MVN     R2, #1\n"
 168         "MOV     R1, #0\n"
 169         "STMIA   R4, {R0-R3}\n"
 170         "LDR     R2, [R6,#0x64]\n"
 171         "LDR     R3, [R6,#0x68]\n"
 172         "ADD     R1, SP, #0x3C\n"
 173         "ADD     R4, SP, #8\n"
 174         "MOV     R0, #0\n"
 175         "STMIA   R4, {R0-R3}\n"
 176         "MOV     R3, #0\n"
 177         "MOV     R2, #0x40\n"
 178         "STRD    R2, [SP]\n"
 179         "LDR     R3, =0x8E0E0\n"
 180         "MOV     R2, #0\n"
 181         "MOV     R1, #0\n"
 182         "BL      sub_FFA581A4\n"
 183         "LDR     R0, [R6,#0x10]\n"
 184         "MOV     R1, #0x3E8\n"
 185         "BL      sub_FF838718    \n"
 186         "CMP     R0, #9\n"
 187         "BNE     loc_FF961414\n"
 188 "loc_FF961404:\n"
 189         "BL      sub_FFA975C4\n"
 190         "MOV     R0, #1\n"
 191         "STR     R5, [R6,#0x38]\n"
 192         "B       loc_FF961574\n"
 193 "loc_FF961414:\n"
 194         "LDR     R0, [SP,#0x38]\n"
 195         "CMP     R0, #0\n"
 196         "BEQ     loc_FF961430\n"
 197 "loc_FF961420:\n"
 198         "BL      sub_FFA975C4\n"
 199         "MOV     R0, #1\n"
 200         "STR     R5, [R6,#0x38]\n"
 201         "B       loc_FF9615A0\n"
 202 "loc_FF961430:\n"
 203         "MOV     R0, #1\n"
 204         "BL      sub_FFA5824C\n"
 205         "BL      sub_FFA58288\n"
 206         "MOV     R0, #5\n"
 207         "STR     R0, [R6,#0x38]\n"
 208 "loc_FF961444:\n"
 209         "ADD     SP, SP, #0x40\n"
 210         "LDMFD   SP!, {R4-R8,PC}\n"
 211 "loc_FF96144C:\n"
 212         "LDR     R12, [SP,#0x30]\n"
 213         "CMP     R12, #0\n"
 214         "BEQ     loc_FF9615FC\n"
 215         "STR     R5, [R6,#0x2C]\n"
 216         "LDR     R0, [R6,#0x4C]\n"
 217         "LDR     R8, [R4,#0xC]\n"
 218         "CMP     R0, #0\n"
 219         "LDRNE   LR, [SP,#0x34]\n"
 220         "BNE     loc_FF9614F8\n"
 221         "LDR     R0, [R4,#0x1C]\n"
 222         "LDR     R1, [R4,#0x20]\n"
 223         "ADD     R3, SP, #0x38\n"
 224         "MVN     R2, #0\n"
 225         "ADD     LR, SP, #0x18\n"
 226         "STMIA   LR, {R0-R3}\n"
 227         "LDR     R0, [SP,#0x28]\n"
 228         "LDR     R2, [R6,#0x64]\n"
 229         "LDR     R3, [R6,#0x68]\n"
 230         "ADD     R1, SP, #0x3C\n"
 231         "ADD     LR, SP, #8\n"
 232         "STMIA   LR, {R0-R3}\n"
 233         "LDR     R3, [SP,#0x2C]\n"
 234         "STR     R12, [SP]\n"
 235         "STR     R3, [SP,#4]\n"
 236         "LDMIB   R4, {R0,R1}\n"
 237         "LDR     R3, [SP,#0x34]\n"
 238         "MOV     R2, R8\n"
 239         "BL      sub_FFA581A4\n"
 240         "LDR     R0, [R6,#0x10]\n"
 241         "MOV     R1, #0x3E8\n"
 242         "BL      sub_FF838718    \n"
 243         "CMP     R0, #9\n"
 244         "BEQ     loc_FF961404\n"
 245         "LDR     R0, [SP,#0x38]\n"
 246         "CMP     R0, #0\n"
 247         "BNE     loc_FF961420\n"
 248         "MOV     R0, #1\n"
 249         "BL      sub_FFA5824C\n"
 250         "LDR     R0, [SP,#0x3C]\n"
 251         "LDR     R1, [SP,#0x34]\n"
 252         "ADD     LR, R1, R0\n"
 253         "LDR     R1, [SP,#0x30]\n"
 254         "SUB     R12, R1, R0\n"
 255 "loc_FF9614F8:\n"
 256         "LDR     R2, [R6,#0x48]\n"
 257         "LDR     R0, [R4,#0x1C]\n"
 258         "LDR     R1, [R4,#0x20]\n"
 259         "ADD     R3, SP, #0x38\n"
 260         "STR     R0, [SP,#0x18]\n"
 261         "STR     R1, [SP,#0x1C]\n"
 262         "STR     R3, [SP,#0x24]\n"
 263         "STR     R2, [SP,#0x20]\n"
 264         "LDR     R2, [R6,#0x64]\n"
 265         "LDR     R3, [R6,#0x68]\n"
 266         "LDR     R0, [SP,#0x28]\n"
 267         "STR     R3, [SP,#0x14]\n"
 268         "LDR     R3, [SP,#0x2C]\n"
 269         "ADD     R1, SP, #0x3C\n"
 270         "STR     R2, [SP,#0x10]\n"
 271         "STR     R3, [SP,#4]\n"
 272         "STR     R1, [SP,#0xC]\n"
 273         "STR     R12, [SP]\n"
 274         "STR     R0, [SP,#8]\n"
 275         "LDMIB   R4, {R0,R1}\n"
 276         "MOV     R3, LR\n"
 277         "MOV     R2, R8\n"
 278         "BL      sub_FFA581A4\n"
 279         "LDR     R0, [R6,#0x10]\n"
 280         "MOV     R1, #0x3E8\n"
 281         "BL      sub_FF838718    \n"
 282         "CMP     R0, #9\n"
 283         "BNE     loc_FF961588\n"
 284         "BL      sub_FFA975C4\n"
 285         "MOV     R0, #0\n"
 286         "STR     R5, [R6,#0x38]\n"
 287 "loc_FF961574:\n"
 288         "BL      sub_FFA5824C\n"
 289         "MOV     R0, #0xC\n"
 290         "BL      sub_FF88754C    \n"
 291         "MOV     R0, #0x90000\n"
 292         "B       loc_FF9615B0\n"
 293 "loc_FF961588:\n"
 294         "LDR     R0, [SP,#0x38]\n"
 295         "CMP     R0, #0\n"
 296         "BEQ     loc_FF9615C4\n"
 297         "BL      sub_FFA975C4\n"
 298         "MOV     R0, #0\n"
 299         "STR     R5, [R6,#0x38]\n"
 300 "loc_FF9615A0:\n"
 301         "BL      sub_FFA5824C\n"
 302         "MOV     R0, #0xC\n"
 303         "BL      sub_FF88754C    \n"
 304         "MOV     R0, #0xA0000\n"
 305 "loc_FF9615B0:\n"
 306         "BL      sub_FF894994\n"
 307         "LDR     R1, [R6,#0x8C]!\n"
 308         "LDR     R0, [R6,#0xC]\n"
 309         "BLX     R1\n"
 310         "B       loc_FF961444\n"
 311 "loc_FF9615C4:\n"
 312         "MOV     R0, #0\n"
 313         "BL      sub_FFA5824C\n"
 314         "LDR     R0, [SP,#0x34]\n"
 315         "LDR     R1, [SP,#0x3C]\n"
 316         "BL      sub_FFA9731C    \n"
 317         "LDR     R0, [R6,#0x48]\n"
 318         "LDR     R3, =0x7B18\n"       // ---> -
 319         "ADD     R1, R0, #1\n"        //       |
 320         "STR     R1, [R6,#0x48]\n"    //       |
 321         "STR     R3, [SP]\n"          //       |
 322         "LDR     R0, [SP,#0x3C]\n"    //       |
 323         "SUB     R3, R3, #4\n"        // ---> -
 324         "MOV     R2, #0xF\n"          //       |
 325         "BL      sub_FFA955F4\n"      //       |
 326                                       //       |
 327         "LDR     R0, =0x7B18-4\n"     // -<----     // +
 328         "BL      set_quality\n"                     // +                
 329 "loc_FF9615FC:\n"
 330         "LDR     R0, [R6,#0x4C]\n"
 331         "ADD     R0, R0, #1\n"
 332         "STR     R0, [R6,#0x4C]\n"
 333         "LDR     R1, [R6,#0x74]\n"
 334         "MUL     R0, R1, R0\n"
 335         "LDR     R1, [R6,#0x70]\n"
 336         "BL      sub_FFB37448\n"
 337         "MOV     R4, R0\n"
 338         "BL      sub_FFA975FC\n"
 339         "LDR     R1, [R6,#0x6C]\n"
 340         "CMP     R1, R4\n"
 341         "BNE     loc_FF961638\n"
 342         "LDR     R0, [R6,#0x30]\n"
 343         "CMP     R0, #1\n"
 344         "BNE     loc_FF96164C\n"
 345 "loc_FF961638:\n"
 346         "LDR     R1, [R6,#0x80]\n"
 347         "MOV     R0, R4\n"
 348         "BLX     R1\n"
 349         "STR     R4, [R6,#0x6C]\n"
 350         "STR     R7, [R6,#0x30]\n"
 351 "loc_FF96164C:\n"
 352         "STR     R7, [R6,#0x2C]\n"
 353         "B       loc_FF961444\n"
 354         );
 355 };
 356 
 357 /* Values are extracted from G11 FW-Dump, but there are unused.
 358  
 359 long def_table[24]={
 360   0x2000,   0x38D,   0x788,  0x5800,  0x9C5,  0x14B8, 0x10000,  0x1C6A,  0x3C45,  0x8000, 0xE35,
 361   0x1E23,   0x1CCD, -0x2E1, -0x579,  0x4f33, -0x7EB,  -0xF0C,   0xE666, -0x170A, -0x2BC6, 0x7333,
 362   -0xB85,  -0x15E3
 363 };
 364 
 365 long table[24];
 366 long CompressionRateTable[]={0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 0x9, 0x7,
 367                                  0x6, 0x5, 4, 3, 2, 1};
 368  
 369 */ 
 370 void change_video_tables(int a, int b){
 371 #if 0
 372  int i;
 373  for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b; 
 374 #endif
 375 } 
 376 
 377 

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