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

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

DEFINITIONS

This source file includes following definitions.
  1. set_quality
  2. movie_record_task
  3. sub_FF961118_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_FF961794:\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_FF961864\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_FF961864\n"
  32 "loc_FF9617C8:\n"
  33         "B       loc_FF961818\n"
  34 "loc_FF9617CC:\n"
  35         "B       loc_FF961838\n"
  36 "loc_FF9617D0:\n"
  37         "B       loc_FF961848\n"
  38 "loc_FF9617D4:\n"
  39         "B       loc_FF961850\n"
  40 "loc_FF9617D8:\n"
  41         "B       loc_FF961820\n"
  42 "loc_FF9617DC:\n"
  43         "B       loc_FF961858\n"
  44 "loc_FF9617E0:\n"
  45         "B       loc_FF961828\n"
  46 "loc_FF9617E4:\n"
  47         "B       loc_FF961864\n"
  48 "loc_FF9617E8:\n"
  49         "B       loc_FF961860\n"
  50 "loc_FF9617EC:\n"
  51         "B       loc_FF9617F0\n"
  52 "loc_FF9617F0:\n" //  ; jumptable FF9617C0 entry 9
  53         "STR     R6, [R4,#0x34]\n"
  54         //"ADR     R0, sub_FF961498\n"
  55                 "LDR     R0, =0xFF961498\n"
  56         //"ADR     R2, sub_FF960A20\n"
  57                 "LDR     R2, =0xFF960A20\n"
  58         "LDR     R1, =0x8E094\n"
  59         "STR     R0, [R4,#0x9C]\n"
  60         "LDR     R0, =0xFF960B04\n"
  61         "STR     R6, [R4,#0x24]\n"
  62         "BL      sub_FF84ED58\n"
  63         "STR     R5, [R4,#0x38]\n"
  64         "B       loc_FF961864\n"
  65 "loc_FF961818:\n" // ; jumptable FF9617C0 entry 0
  66                 "BL      unlock_optical_zoom\n" //+-----> inserted to unlock the zoom
  67         "BL      sub_FF9615A0\n"
  68         "B       loc_FF961864\n"
  69 "loc_FF961820:\n" // ; jumptable FF9617C0 entry 4
  70         //"BL      sub_FF961118\n"
  71                 "BL      sub_FF961118_my\n" // +----------------->
  72         "B       loc_FF961864\n"
  73 "loc_FF961828:\n" // ; jumptable FF9617C0 entry 6
  74         "LDR     R1, [R0,#0x18]\n"
  75         "LDR     R0, [R0,#4]\n"
  76         "BL      sub_FFA96E98    \n"
  77         "B       loc_FF961864\n"
  78 "loc_FF961838:\n" //; jumptable FF9617C0 entry 1
  79         "LDR     R0, [R4,#0x38]\n"
  80         "CMP     R0, #5\n"
  81         "STRNE   R5, [R4,#0x28]\n"
  82         "B       loc_FF961864\n"
  83 "loc_FF961848:\n"
  84         "BL      sub_FF960E64\n"
  85         "B       loc_FF961864\n"
  86 "loc_FF961850:\n"
  87         "BL      sub_FF960B50\n"
  88         "B       loc_FF961864\n"
  89 "loc_FF961858:\n"
  90         "BL      sub_FF9609AC\n"
  91         "B       loc_FF961864\n"
  92 "loc_FF961860:\n"
  93         "BL      sub_FF9619D0\n"
  94 "loc_FF961864:\n"
  95         "LDR     R1, [SP,#4]\n"
  96         "MOV     R3, #0x460\n"
  97         "STR     R6, [R1]\n"
  98         "STR     R3, [SP]\n"
  99         "LDR     R0, [R4,#0x1C]\n"
 100         "LDR     R3, =0xFF96080C\n"
 101         "MOV     R2, R7\n"
 102         "BL      sub_FF838C50\n"
 103         "B       loc_FF961794\n"
 104  );
 105 } 
 106 
 107 void __attribute__((naked,noinline)) sub_FF961118_my(){ 
 108  asm volatile(
 109         "STMFD   SP!, {R4-R8,LR}\n"
 110         "SUB     SP, SP, #0x40\n"
 111         "MOV     R7, #0\n"
 112         "LDR     R6, =0x7AB0\n"
 113         "MOV     R4, R0\n"
 114         "STR     R7, [SP,#0x30]\n"
 115         "STR     R7, [SP,#0x28]\n"
 116         "LDR     R0, [R6,#0x38]\n"
 117         "MOV     R8, #4\n"
 118         "CMP     R0, #3\n"
 119         "STREQ   R8, [R6,#0x38]\n"
 120         "LDR     R0, [R6,#0x9C]\n"
 121         "BLX     R0\n"
 122         "LDR     R0, [R6,#0x38]\n"
 123         "CMP     R0, #4\n"
 124         "BNE     loc_FF961288\n"
 125         "ADD     R3, SP, #0x28\n"
 126         "ADD     R2, SP, #0x2C\n"
 127         "ADD     R1, SP, #0x30\n"
 128         "ADD     R0, SP, #0x34\n"
 129         "BL      sub_FFA96F34    \n"
 130         "CMP     R0, #0\n"
 131         "MOV     R5, #1\n"
 132         "BNE     loc_FF961194\n"
 133         "LDR     R1, [R6,#0x28]\n"
 134         "CMP     R1, #1\n"
 135         "BNE     loc_FF961290\n"
 136         "LDR     R1, [R6,#0x4C]\n"
 137         "LDR     R2, [R6,#0x3C]\n"
 138         "CMP     R1, R2\n"
 139         "BCC     loc_FF961290\n"
 140 "loc_FF961194:\n"
 141         "CMP     R0, #0x80000001\n"
 142         "STREQ   R8, [R6,#0x50]\n"
 143         "BEQ     loc_FF9611CC\n"
 144         "CMP     R0, #0x80000003\n"
 145         "STREQ   R5, [R6,#0x50]\n"
 146         "BEQ     loc_FF9611CC\n"
 147         "CMP     R0, #0x80000005\n"
 148         "MOVEQ   R0, #2\n"
 149         "BEQ     loc_FF9611C8\n"
 150         "CMP     R0, #0x80000007\n"
 151         "STRNE   R7, [R6,#0x50]\n"
 152         "BNE     loc_FF9611CC\n"
 153         "MOV     R0, #3\n"
 154 "loc_FF9611C8:\n"
 155         "STR     R0, [R6,#0x50]\n"
 156 "loc_FF9611CC:\n"
 157         "LDR     R0, =0x8E0C8\n"
 158         "LDR     R0, [R0,#8]\n"
 159         "CMP     R0, #0\n"
 160         "BEQ     loc_FF9611E4\n"
 161         "BL      sub_FF8601E0\n"
 162         "B       loc_FF9611E8\n"
 163 "loc_FF9611E4:\n"
 164         "BL      sub_FF9609AC    \n"
 165 "loc_FF9611E8:\n"
 166         "LDR     R0, [R4,#0x1C]\n"
 167         "ADD     R4, SP, #0x18\n"
 168         "ADD     R3, SP, #0x38\n"
 169         "MVN     R2, #1\n"
 170         "MOV     R1, #0\n"
 171         "STMIA   R4, {R0-R3}\n"
 172         "LDR     R2, [R6,#0x64]\n"
 173         "LDR     R3, [R6,#0x68]\n"
 174         "ADD     R1, SP, #0x3C\n"
 175         "ADD     R4, SP, #8\n"
 176         "MOV     R0, #0\n"
 177         "STMIA   R4, {R0-R3}\n"
 178         "MOV     R3, #0\n"
 179         "MOV     R2, #0x40\n"
 180         "STRD    R2, [SP]\n"
 181         "LDR     R3, =0x8E0E0\n"
 182         "MOV     R2, #0\n"
 183         "MOV     R1, #0\n"
 184         "BL      sub_FFA57FE8\n"
 185         "LDR     R0, [R6,#0x10]\n"
 186         "MOV     R1, #0x3E8\n"
 187         "BL      sub_FF838718    \n"
 188         "CMP     R0, #9\n"
 189         "BNE     loc_FF961258\n"
 190 "loc_FF961248:\n"
 191         "BL      sub_FFA97408\n"
 192         "MOV     R0, #1\n"
 193         "STR     R5, [R6,#0x38]\n"
 194         "B       loc_FF9613B8\n"
 195 "loc_FF961258:\n"
 196         "LDR     R0, [SP,#0x38]\n"
 197         "CMP     R0, #0\n"
 198         "BEQ     loc_FF961274\n"
 199 "loc_FF961264:\n"
 200         "BL      sub_FFA97408\n"
 201         "MOV     R0, #1\n"
 202         "STR     R5, [R6,#0x38]\n"
 203         "B       loc_FF9613E4\n"
 204 "loc_FF961274:\n"
 205         "MOV     R0, #1\n"
 206         "BL      sub_FFA58090\n"
 207         "BL      sub_FFA580CC\n"
 208         "MOV     R0, #5\n"
 209         "STR     R0, [R6,#0x38]\n"
 210 "loc_FF961288:\n"
 211         "ADD     SP, SP, #0x40\n"
 212         "LDMFD   SP!, {R4-R8,PC}\n"
 213 "loc_FF961290:\n"
 214         "LDR     R12, [SP,#0x30]\n"
 215         "CMP     R12, #0\n"
 216         "BEQ     loc_FF961440\n"
 217         "STR     R5, [R6,#0x2C]\n"
 218         "LDR     R0, [R6,#0x4C]\n"
 219         "LDR     R8, [R4,#0xC]\n"
 220         "CMP     R0, #0\n"
 221         "LDRNE   LR, [SP,#0x34]\n"
 222         "BNE     loc_FF96133C\n"
 223         "LDR     R0, [R4,#0x1C]\n"
 224         "LDR     R1, [R4,#0x20]\n"
 225         "ADD     R3, SP, #0x38\n"
 226         "MVN     R2, #0\n"
 227         "ADD     LR, SP, #0x18\n"
 228         "STMIA   LR, {R0-R3}\n"
 229         "LDR     R0, [SP,#0x28]\n"
 230         "LDR     R2, [R6,#0x64]\n"
 231         "LDR     R3, [R6,#0x68]\n"
 232         "ADD     R1, SP, #0x3C\n"
 233         "ADD     LR, SP, #8\n"
 234         "STMIA   LR, {R0-R3}\n"
 235         "LDR     R3, [SP,#0x2C]\n"
 236         "STR     R12, [SP]\n"
 237         "STR     R3, [SP,#4]\n"
 238         "LDMIB   R4, {R0,R1}\n"
 239         "LDR     R3, [SP,#0x34]\n"
 240         "MOV     R2, R8\n"
 241         "BL      sub_FFA57FE8\n"
 242         "LDR     R0, [R6,#0x10]\n"
 243         "MOV     R1, #0x3E8\n"
 244         "BL      sub_FF838718    \n"
 245         "CMP     R0, #9\n"
 246         "BEQ     loc_FF961248\n"
 247         "LDR     R0, [SP,#0x38]\n"
 248         "CMP     R0, #0\n"
 249         "BNE     loc_FF961264\n"
 250         "MOV     R0, #1\n"
 251         "BL      sub_FFA58090\n"
 252         "LDR     R0, [SP,#0x3C]\n"
 253         "LDR     R1, [SP,#0x34]\n"
 254         "ADD     LR, R1, R0\n"
 255         "LDR     R1, [SP,#0x30]\n"
 256         "SUB     R12, R1, R0\n"
 257 "loc_FF96133C:\n"
 258         "LDR     R2, [R6,#0x48]\n"
 259         "LDR     R0, [R4,#0x1C]\n"
 260         "LDR     R1, [R4,#0x20]\n"
 261         "ADD     R3, SP, #0x38\n"
 262         "STR     R0, [SP,#0x18]\n"
 263         "STR     R1, [SP,#0x1C]\n"
 264         "STR     R3, [SP,#0x24]\n"
 265         "STR     R2, [SP,#0x20]\n"
 266         "LDR     R2, [R6,#0x64]\n"
 267         "LDR     R3, [R6,#0x68]\n"
 268         "LDR     R0, [SP,#0x28]\n"
 269         "STR     R3, [SP,#0x14]\n"
 270         "LDR     R3, [SP,#0x2C]\n"
 271         "ADD     R1, SP, #0x3C\n"
 272         "STR     R2, [SP,#0x10]\n"
 273         "STR     R3, [SP,#4]\n"
 274         "STR     R1, [SP,#0xC]\n"
 275         "STR     R12, [SP]\n"
 276         "STR     R0, [SP,#8]\n"
 277         "LDMIB   R4, {R0,R1}\n"
 278         "MOV     R3, LR\n"
 279         "MOV     R2, R8\n"
 280         "BL      sub_FFA57FE8\n"
 281         "LDR     R0, [R6,#0x10]\n"
 282         "MOV     R1, #0x3E8\n"
 283         "BL      sub_FF838718    \n"
 284         "CMP     R0, #9\n"
 285         "BNE     loc_FF9613CC\n"
 286         "BL      sub_FFA97408\n"
 287         "MOV     R0, #0\n"
 288         "STR     R5, [R6,#0x38]\n"
 289 "loc_FF9613B8:\n"
 290         "BL      sub_FFA58090\n"
 291         "MOV     R0, #0xC\n"
 292         "BL      sub_FF8874FC    \n"
 293         "MOV     R0, #0x90000\n"
 294         "B       loc_FF9613F4\n"
 295 "loc_FF9613CC:\n"
 296         "LDR     R0, [SP,#0x38]\n"
 297         "CMP     R0, #0\n"
 298         "BEQ     loc_FF961408\n"
 299         "BL      sub_FFA97408\n"
 300         "MOV     R0, #0\n"
 301         "STR     R5, [R6,#0x38]\n"
 302 "loc_FF9613E4:\n"
 303         "BL      sub_FFA58090\n"
 304         "MOV     R0, #0xC\n"
 305         "BL      sub_FF8874FC    \n"
 306         "MOV     R0, #0xA0000\n"
 307 "loc_FF9613F4:\n"
 308         "BL      sub_FF894944\n"
 309         "LDR     R1, [R6,#0x8C]!\n"
 310         "LDR     R0, [R6,#0xC]\n"
 311         "BLX     R1\n"
 312         "B       loc_FF961288\n"
 313 "loc_FF961408:\n"
 314         "MOV     R0, #0\n"
 315         "BL      sub_FFA58090\n"
 316         "LDR     R0, [SP,#0x34]\n"
 317         "LDR     R1, [SP,#0x3C]\n"
 318         "BL      sub_FFA97160    \n"
 319         "LDR     R0, [R6,#0x48]\n"
 320         "LDR     R3, =0x7B18\n"       // ---> -
 321         "ADD     R1, R0, #1\n"        //       |
 322         "STR     R1, [R6,#0x48]\n"    //       |
 323         "STR     R3, [SP]\n"          //       |
 324         "LDR     R0, [SP,#0x3C]\n"    //       |
 325         "SUB     R3, R3, #4\n"        // ---> -
 326         "MOV     R2, #0xF\n"          //       |
 327         "BL      sub_FFA95438\n"      //       |
 328                                       //       |
 329         "LDR     R0, =0x7B18-4\n"     // -<----     // +
 330         "BL      set_quality\n"                     // +
 331 "loc_FF961440:\n"
 332         "LDR     R0, [R6,#0x4C]\n"
 333         "ADD     R0, R0, #1\n"
 334         "STR     R0, [R6,#0x4C]\n"
 335         "LDR     R1, [R6,#0x74]\n"
 336         "MUL     R0, R1, R0\n"
 337         "LDR     R1, [R6,#0x70]\n"
 338         "BL      sub_FFB3728C\n"
 339         "MOV     R4, R0\n"
 340         "BL      sub_FFA97440\n"
 341         "LDR     R1, [R6,#0x6C]\n"
 342         "CMP     R1, R4\n"
 343         "BNE     loc_FF96147C\n"
 344         "LDR     R0, [R6,#0x30]\n"
 345         "CMP     R0, #1\n"
 346         "BNE     loc_FF961490\n"
 347 "loc_FF96147C:\n"
 348         "LDR     R1, [R6,#0x80]\n"
 349         "MOV     R0, R4\n"
 350         "BLX     R1\n"
 351         "STR     R4, [R6,#0x6C]\n"
 352         "STR     R7, [R6,#0x30]\n"
 353 "loc_FF961490:\n"
 354         "STR     R7, [R6,#0x2C]\n"
 355         "B       loc_FF961288\n"
 356         );
 357 };
 358 
 359 /* Values are extracted from G11 FW-Dump, but there are unused.
 360  
 361 long def_table[24]={
 362   0x2000,   0x38D,   0x788,  0x5800,  0x9C5,  0x14B8, 0x10000,  0x1C6A,  0x3C45,  0x8000, 0xE35,
 363   0x1E23,   0x1CCD, -0x2E1, -0x579,  0x4f33, -0x7EB,  -0xF0C,   0xE666, -0x170A, -0x2BC6, 0x7333,
 364   -0xB85,  -0x15E3
 365 };
 366 
 367 long table[24];
 368 long CompressionRateTable[]={0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 0x9, 0x7,
 369                                  0x6, 0x5, 4, 3, 2, 1};
 370  
 371 */ 
 372 void change_video_tables(__attribute__ ((unused))int a, __attribute__ ((unused))int b){
 373 //  int i;
 374 //  for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b; 
 375 } 
 376 
 377 

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