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

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

DEFINITIONS

This source file includes following definitions.
  1. set_quality
  2. movie_record_task
  3. sub_FF9610C4_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_FF961740:\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_FF961810\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_FF961810\n"
  32 "loc_FF961774:\n"
  33         "B       loc_FF9617C4\n"
  34 "loc_FF961778:\n"
  35         "B       loc_FF9617E4\n"
  36 "loc_FF96177C:\n"
  37         "B       loc_FF9617F4\n"
  38 "loc_FF961780:\n"
  39         "B       loc_FF9617FC\n"
  40 "loc_FF961784:\n"
  41         "B       loc_FF9617CC\n"
  42 "loc_FF961788:\n"
  43         "B       loc_FF961804\n"
  44 "loc_FF96178C:\n"
  45         "B       loc_FF9617D4\n"
  46 "loc_FF961790:\n"
  47         "B       loc_FF961810\n"
  48 "loc_FF961794:\n"
  49         "B       loc_FF96180C\n"
  50 "loc_FF961798:\n"
  51         "B       loc_FF96179C\n"
  52 "loc_FF96179C:\n"
  53         "STR     R6, [R4,#0x34]\n"
  54         //"ADR     R0, sub_FF961444\n"
  55                 "LDR     R0, =0xFF961444\n"
  56         //"ADR     R2, sub_FF9609CC\n"
  57                 "LDR     R2, =0xFF9609CC\n"
  58         "LDR     R1, =0x8E094\n"
  59         "STR     R0, [R4,#0x9C]\n"
  60         "LDR     R0, =0xFF960AB0\n"
  61         "STR     R6, [R4,#0x24]\n"
  62         "BL      sub_FF84ED58\n"
  63         "STR     R5, [R4,#0x38]\n"
  64         "B       loc_FF961810\n"
  65 "loc_FF9617C4:\n" //; jumptable FF96176C entry 0
  66                 "BL      unlock_optical_zoom\n" //+-----> inserted to unlock the zoom
  67         "BL      sub_FF96154C\n"
  68         "B       loc_FF961810\n"
  69 "loc_FF9617CC:\n" // ; jumptable FF96176C entry 4
  70         //"BL      sub_FF9610C4\n"
  71                 "BL      sub_FF9610C4_my\n" // + ----------------->
  72         "B       loc_FF961810\n"
  73 "loc_FF9617D4:\n"
  74         "LDR     R1, [R0,#0x18]\n"
  75         "LDR     R0, [R0,#4]\n"
  76         "BL      sub_FFA96E44\n"
  77         "B       loc_FF961810\n"
  78 "loc_FF9617E4:\n"
  79         "LDR     R0, [R4,#0x38]\n"
  80         "CMP     R0, #5\n"
  81         "STRNE   R5, [R4,#0x28]\n"
  82         "B       loc_FF961810\n"
  83 "loc_FF9617F4:\n"
  84         "BL      sub_FF960E10\n"
  85         "B       loc_FF961810\n"
  86 "loc_FF9617FC:\n"
  87         "BL      sub_FF960AFC\n"
  88         "B       loc_FF961810\n"
  89 "loc_FF961804:\n"
  90         "BL      sub_FF960958\n"
  91         "B       loc_FF961810\n"
  92 "loc_FF96180C:\n"
  93         "BL      sub_FF96197C\n"
  94 "loc_FF961810:\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, =0xFF9607B8\n"
 101         "MOV     R2, R7\n"
 102         "BL      sub_FF838C50\n"
 103         "B       loc_FF961740\n"
 104  );
 105 } 
 106 
 107 void __attribute__((naked,noinline)) sub_FF9610C4_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_FF961234\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_FFA96EE0\n"
 130         "CMP     R0, #0\n"
 131         "MOV     R5, #1\n"
 132         "BNE     loc_FF961140\n"
 133         "LDR     R1, [R6,#0x28]\n"
 134         "CMP     R1, #1\n"
 135         "BNE     loc_FF96123C\n"
 136         "LDR     R1, [R6,#0x4C]\n"
 137         "LDR     R2, [R6,#0x3C]\n"
 138         "CMP     R1, R2\n"
 139         "BCC     loc_FF96123C\n"
 140 "loc_FF961140:\n"
 141         "CMP     R0, #0x80000001\n"
 142         "STREQ   R8, [R6,#0x50]\n"
 143         "BEQ     loc_FF961178\n"
 144         "CMP     R0, #0x80000003\n"
 145         "STREQ   R5, [R6,#0x50]\n"
 146         "BEQ     loc_FF961178\n"
 147         "CMP     R0, #0x80000005\n"
 148         "MOVEQ   R0, #2\n"
 149         "BEQ     loc_FF961174\n"
 150         "CMP     R0, #0x80000007\n"
 151         "STRNE   R7, [R6,#0x50]\n"
 152         "BNE     loc_FF961178\n"
 153         "MOV     R0, #3\n"
 154 "loc_FF961174:\n"
 155         "STR     R0, [R6,#0x50]\n"
 156 "loc_FF961178:\n"
 157         "LDR     R0, =0x8E0C8\n"
 158         "LDR     R0, [R0,#8]\n"
 159         "CMP     R0, #0\n"
 160         "BEQ     loc_FF961190\n"
 161         "BL      sub_FF8601E0\n"
 162         "B       loc_FF961194\n"
 163 "loc_FF961190:\n"
 164         "BL      sub_FF960958\n"
 165 "loc_FF961194:\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_FFA57F94\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_FF961204\n"
 190 "loc_FF9611F4:\n"
 191         "BL      sub_FFA973B4\n"
 192         "MOV     R0, #1\n"
 193         "STR     R5, [R6,#0x38]\n"
 194         "B       loc_FF961364\n"
 195 "loc_FF961204:\n"
 196         "LDR     R0, [SP,#0x38]\n"
 197         "CMP     R0, #0\n"
 198         "BEQ     loc_FF961220\n"
 199 "loc_FF961210:\n"
 200         "BL      sub_FFA973B4\n"
 201         "MOV     R0, #1\n"
 202         "STR     R5, [R6,#0x38]\n"
 203         "B       loc_FF961390\n"
 204 "loc_FF961220:\n"
 205         "MOV     R0, #1\n"
 206         "BL      sub_FFA5803C\n"
 207         "BL      sub_FFA58078\n"
 208         "MOV     R0, #5\n"
 209         "STR     R0, [R6,#0x38]\n"
 210 "loc_FF961234:\n"
 211         "ADD     SP, SP, #0x40\n"
 212         "LDMFD   SP!, {R4-R8,PC}\n"
 213 "loc_FF96123C:\n"
 214         "LDR     R12, [SP,#0x30]\n"
 215         "CMP     R12, #0\n"
 216         "BEQ     loc_FF9613EC\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_FF9612E8\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_FFA57F94\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_FF9611F4\n"
 247         "LDR     R0, [SP,#0x38]\n"
 248         "CMP     R0, #0\n"
 249         "BNE     loc_FF961210\n"
 250         "MOV     R0, #1\n"
 251         "BL      sub_FFA5803C\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_FF9612E8:\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_FFA57F94\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_FF961378\n"
 286         "BL      sub_FFA973B4\n"
 287         "MOV     R0, #0\n"
 288         "STR     R5, [R6,#0x38]\n"
 289 "loc_FF961364:\n"
 290         "BL      sub_FFA5803C\n"
 291         "MOV     R0, #0xC\n"
 292         "BL      sub_FF8874D0\n"
 293         "MOV     R0, #0x90000\n"
 294         "B       loc_FF9613A0\n"
 295 "loc_FF961378:\n"
 296         "LDR     R0, [SP,#0x38]\n"
 297         "CMP     R0, #0\n"
 298         "BEQ     loc_FF9613B4\n"
 299         "BL      sub_FFA973B4\n"
 300         "MOV     R0, #0\n"
 301         "STR     R5, [R6,#0x38]\n"
 302 "loc_FF961390:\n"
 303         "BL      sub_FFA5803C\n"
 304         "MOV     R0, #0xC\n"
 305         "BL      sub_FF8874D0\n"
 306         "MOV     R0, #0xA0000\n"
 307 "loc_FF9613A0:\n"
 308         "BL      sub_FF894918\n"
 309         "LDR     R1, [R6,#0x8C]!\n"
 310         "LDR     R0, [R6,#0xC]\n"
 311         "BLX     R1\n"
 312         "B       loc_FF961234\n"
 313 "loc_FF9613B4:\n"
 314         "MOV     R0, #0\n"
 315         "BL      sub_FFA5803C\n"
 316         "LDR     R0, [SP,#0x34]\n"
 317         "LDR     R1, [SP,#0x3C]\n"
 318         "BL      sub_FFA9710C\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_FFA953E4\n"      //       |
 328                                       //       |
 329         "LDR     R0, =0x7B18-4\n"     // -<----     // +
 330         "BL      set_quality\n"                     // +
 331 "loc_FF9613EC:\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_FFB37238\n"
 339         "MOV     R4, R0\n"
 340         "BL      sub_FFA973EC\n"
 341         "LDR     R1, [R6,#0x6C]\n"
 342         "CMP     R1, R4\n"
 343         "BNE     loc_FF961428\n"
 344         "LDR     R0, [R6,#0x30]\n"
 345         "CMP     R0, #1\n"
 346         "BNE     loc_FF96143C\n"
 347 "loc_FF961428:\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_FF96143C:\n"
 354         "STR     R7, [R6,#0x2C]\n"
 355         "B       loc_FF961234\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(int a, int b){
 373 #if 0
 374  int i;
 375  for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b; 
 376 #endif
 377 } 
 378 
 379 

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