root/platform/g11/sub/100l/movie_rec.c

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

DEFINITIONS

This source file includes following definitions.
  1. set_quality
  2. movie_record_task
  3. sub_FF962658_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, =0x6D58\n"
  16                "MOV     R6, #0\n"
  17                "MOV     R5, #1\n"
  18 
  19 "loc_FF962CC4:\n"
  20                "LDR     R0, [R4,#0x18]\n"
  21                "MOV     R2, #0\n"
  22                "ADD     R1, SP, #4\n"
  23                "BL      sub_FF83894C\n"
  24                "LDR     R0, [R4,#0x20]\n"
  25                "CMP     R0, #0\n"
  26                "BNE     loc_FF962D94\n"
  27                "LDR     R0, [SP,#4]\n"
  28                "LDR     R1, [R0]\n"
  29                "SUB     R1, R1, #2\n"
  30                "CMP     R1, #9\n"
  31                "ADDLS   PC, PC, R1,LSL#2\n"
  32                "B       loc_FF962D94\n"
  33 "loc_FF962CF8:\n"
  34                "B       loc_FF962D48\n"
  35 "loc_FF962CFC:\n"
  36                "B       loc_FF962D68\n"
  37 "loc_FF962D00:\n"
  38                "B       loc_FF962D78\n"
  39 "loc_FF962D04:\n"
  40                "B       loc_FF962D80\n"
  41 "loc_FF962D08:\n"
  42                "B       loc_FF962D50\n"
  43 "loc_FF962D0C:\n"
  44                "B       loc_FF962D88\n"
  45 "loc_FF962D10:\n"
  46                "B       loc_FF962D58\n"
  47 "loc_FF962D14:\n"
  48                "B       loc_FF962D94\n"
  49 "loc_FF962D18:\n"
  50                "B       loc_FF962D90\n"
  51 "loc_FF962D1C:\n"
  52                "B       loc_FF962D20\n"
  53 "loc_FF962D20:\n"
  54 //; jumptable FF9"2CF0 entry 9
  55                "LDR     R0, =0xFF9629D8\n"
  56                "STR     R6, [R4,#0x34]\n"
  57                "STR     R0, [R4,#0x9C]\n"
  58                "LDR     R2, =0xFF961F68\n"
  59                "LDR     R1, =0x8D74C\n"
  60                "LDR     R0, =0xFF96204C\n"
  61                "STR     R6, [R4,#0x24]\n"
  62                "BL      sub_FF85049C\n"
  63                "STR     R5, [R4,#0x38]\n"
  64                "B       loc_FF962D94\n"
  65 "loc_FF962D48:\n"
  66 //; jumptable FF9"2CF0 entry 0            ; LOCATION: MovieRecorder.c:0
  67                "BL      unlock_optical_zoom\n" //+-----> inserted to unlock the zoom
  68                "BL      sub_FF962AD0\n"
  69                "B       loc_FF962D94\n"
  70 "loc_FF962D50:\n"
  71 //; jumptable FF9"2CF0 entry 4
  72                //"BL      sub_FF962658\n"
  73                            "BL      sub_FF962658_my\n" // +-------------->
  74                "B       loc_FF962D94\n"
  75 "loc_FF962D58:\n"
  76 //; jumptable FF9"2CF0 entry 6
  77                "LDR     R1, [R0,#0x18]\n"
  78                "LDR     R0, [R0,#4]\n"
  79                "BL      sub_FFA9C914\n"
  80                "B       loc_FF962D94\n"
  81 "loc_FF962D68:\n"
  82 //; jumptable FF9"2CF0 entry 1
  83                "LDR     R0, [R4,#0x38]\n"
  84                "CMP     R0, #5\n"
  85                "STRNE   R5, [R4,#0x28]\n"
  86                "B       loc_FF962D94\n"
  87 "loc_FF962D78:\n"
  88 //; jumptable FF9"2CF0 entry 2            ; LOCATION: MovieRecorder.c:2144
  89                "BL      sub_FF9623A8\n"
  90                "B       loc_FF962D94\n"
  91 "loc_FF962D80:\n"
  92 //; jumptable FF9"2CF0 entry 3            ; LOCATION: MovieRecorder.c:0
  93                "BL      sub_FF962098\n"
  94                "B       loc_FF962D94\n"
  95 "loc_FF962D88:\n"
  96 //; jumptable FF9"2CF0 entry 5            ; LOCATION: MovieRecorder.c:100
  97                "BL      sub_FF961EF4\n"
  98                "B       loc_FF962D94\n"
  99 "loc_FF962D90:\n"
 100 //; jumptable FF9"2CF0 entry 8            ; LOCATION: MovieRecorder.c:1744
 101                "BL      sub_FF962F00\n"
 102 "loc_FF962D94:\n"
 103 //; jumptable FF9"2CF0 default entry
 104 //; jumptable FF9"2CF0 entry 7
 105                "LDR     R1, [SP,#4]\n"
 106                "MOV     R3, #0x460\n"
 107                "STR     R6, [R1]\n"
 108                "STR     R3, [SP]\n"
 109                "LDR     R0, [R4,#0x1C]\n"
 110                "LDR     R3, =0xFF961D54\n"
 111                "MOV     R2, R7\n"
 112                "BL      sub_FF8392A0\n"
 113                "B       loc_FF962CC4\n"
 114  );
 115 } 
 116 
 117 void __attribute__((naked,noinline)) sub_FF962658_my(){ 
 118  asm volatile(
 119                "STMFD   SP!, {R4-R8,LR}\n"
 120                "SUB     SP, SP, #0x40\n"
 121                "MOV     R7, #0\n"
 122                "LDR     R6, =0x6D58\n"
 123                "MOV     R4, R0\n"
 124                "STR     R7, [SP,#0x30]\n"
 125                "STR     R7, [SP,#0x28]\n"
 126                "LDR     R0, [R6,#0x38]\n"
 127                "MOV     R8, #4\n"
 128                "CMP     R0, #3\n"
 129                "STREQ   R8, [R6,#0x38]\n"
 130                "LDR     R0, [R6,#0x9C]\n"
 131                "BLX     R0\n"
 132                "LDR     R0, [R6,#0x38]\n"
 133                "CMP     R0, #4\n"
 134                "BNE     loc_FF9627C8\n"
 135                "ADD     R3, SP, #0x28\n"
 136                "ADD     R2, SP, #0x2C\n"
 137                "ADD     R1, SP, #0x30\n"
 138                "ADD     R0, SP, #0x34\n"
 139                "BL      sub_FFA9C9B0\n"
 140                "CMP     R0, #0\n"
 141                "MOV     R5, #1\n"
 142                "BNE     loc_FF9626D4\n"
 143                "LDR     R1, [R6,#0x28]\n"
 144                "CMP     R1, #1\n"
 145                "BNE     loc_FF9627D0\n"
 146                "LDR     R1, [R6,#0x4C]\n"
 147                "LDR     R2, [R6,#0x3C]\n"
 148                "CMP     R1, R2\n"
 149                "BCC     loc_FF9627D0\n"
 150 "loc_FF9626D4:\n"
 151                "CMP     R0, #0x80000001\n"
 152                "STREQ   R8, [R6,#0x50]\n"
 153                "BEQ     loc_FF96270C\n"
 154                "CMP     R0, #0x80000003\n"
 155                "STREQ   R5, [R6,#0x50]\n"
 156                "BEQ     loc_FF96270C\n"
 157                "CMP     R0, #0x80000005\n"
 158                "MOVEQ   R0, #2\n"
 159                "BEQ     loc_FF962708\n"
 160                "CMP     R0, #0x80000007\n"
 161                "STRNE   R7, [R6,#0x50]\n"
 162                "BNE     loc_FF96270C\n"
 163                "MOV     R0, #3\n"
 164 
 165 "loc_FF962708:\n"
 166                "STR     R0, [R6,#0x50]\n"
 167 "loc_FF96270C:\n"
 168                "LDR     R0, =0x8D780\n"
 169                "LDR     R0, [R0,#8]\n"
 170                "CMP     R0, #0\n"
 171                "BEQ     loc_FF962724\n"
 172                "BL      sub_FF8621C8\n"
 173                "B       loc_FF962728\n"
 174 "loc_FF962724:\n"
 175                "BL      sub_FF961EF4\n"
 176 "loc_FF962728:\n"
 177                "LDR     R0, [R4,#0x1C]\n"
 178                "ADD     R4, SP, #0x18\n"
 179                "ADD     R3, SP, #0x38\n"
 180                //"MOV     R2, 0xFFFFFFFE\n"
 181                 "LDR    R2, =0xFFFFFFFE\n"
 182                "MOV     R1, #0\n"
 183                "STMIA   R4, {R0-R3}\n"
 184                "LDR     R2, [R6,#0x64]\n"
 185                "LDR     R3, [R6,#0x68]\n"
 186                "ADD     R1, SP, #0x3C\n"
 187                "ADD     R4, SP, #8\n"
 188                "MOV     R0, #0\n"
 189                "STMIA   R4, {R0-R3}\n"
 190                "MOV     R3, #0\n"
 191                "MOV     R2, #0x40\n"
 192                "STRD    R2, [SP]\n"
 193                "LDR     R3, =0x8D798\n"
 194                "MOV     R2, #0\n"
 195                "MOV     R1, #0\n"
 196                "BL      sub_FFA5EED8\n"
 197                "LDR     R0, [R6,#0x10]\n"
 198                "MOV     R1, #0x3E8\n"
 199                "BL      sub_FF838D68\n"
 200                "CMP     R0, #9\n"
 201                "BNE     loc_FF962798\n"
 202 "loc_FF962788:\n"
 203                "BL      sub_FFA9CE84\n"
 204                "MOV     R0, #1\n"
 205                "STR     R5, [R6,#0x38]\n"
 206                "B       loc_FF9628F8\n"
 207 "loc_FF962798:\n"
 208                "LDR     R0, [SP,#0x38]\n"
 209                "CMP     R0, #0\n"
 210                "BEQ     loc_FF9627B4\n"
 211 "loc_FF9627A4:\n"
 212                "BL      sub_FFA9CE84\n"
 213                "MOV     R0, #1\n"
 214                "STR     R5, [R6,#0x38]\n"
 215                "B       loc_FF962924\n"
 216 "loc_FF9627B4:\n"
 217                "MOV     R0, #1\n"
 218                "BL      sub_FFA5EF80\n"
 219                "BL      sub_FFA5EFBC\n"
 220                "MOV     R0, #5\n"
 221                "STR     R0, [R6,#0x38]\n"
 222 "loc_FF9627C8:\n"
 223                "ADD     SP, SP, #0x40\n"
 224                "LDMFD   SP!, {R4-R8,PC}\n"
 225 "loc_FF9627D0:\n"
 226                "LDR     R12, [SP,#0x30]\n"
 227                "CMP     R12, #0\n"
 228                "BEQ     loc_FF962980\n"
 229                "STR     R5, [R6,#0x2C]\n"
 230                "LDR     R0, [R6,#0x4C]\n"
 231                "LDR     R8, [R4,#0xC]\n"
 232                "CMP     R0, #0\n"
 233                "LDRNE   LR, [SP,#0x34]\n"
 234                "BNE     loc_FF96287C\n"
 235                "LDR     R0, [R4,#0x1C]\n"
 236                "LDR     R1, [R4,#0x20]\n"
 237                "ADD     R3, SP, #0x38\n"
 238                //"MOV     R2, 0xFFFFFFFF\n"
 239               "LDR     R2, =0xFFFFFFFF\n"
 240                "ADD     LR, SP, #0x18\n"
 241                "STMIA   LR, {R0-R3}\n"
 242                "LDR     R0, [SP,#0x28]\n"
 243                "LDR     R2, [R6,#0x64]\n"
 244                "LDR     R3, [R6,#0x68]\n"
 245                "ADD     R1, SP, #0x3C\n"
 246                "ADD     LR, SP, #8\n"
 247                "STMIA   LR, {R0-R3}\n"
 248                "LDR     R3, [SP,#0x2C]\n"
 249                "STR     R12, [SP]\n"
 250                "STR     R3, [SP,#4]\n"
 251                "LDMIB   R4, {R0,R1}\n"
 252                "LDR     R3, [SP,#0x34]\n"
 253                "MOV     R2, R8\n"
 254                "BL      sub_FFA5EED8\n"
 255                "LDR     R0, [R6,#0x10]\n"
 256                "MOV     R1, #0x3E8\n"
 257                "BL      sub_FF838D68\n"
 258                "CMP     R0, #9\n"
 259                "BEQ     loc_FF962788\n"
 260                "LDR     R0, [SP,#0x38]\n"
 261                "CMP     R0, #0\n"
 262                "BNE     loc_FF9627A4\n"
 263                "MOV     R0, #1\n"
 264                "BL      sub_FFA5EF80\n"
 265                "LDR     R0, [SP,#0x3C]\n"
 266                "LDR     R1, [SP,#0x34]\n"
 267                "ADD     LR, R1, R0\n"
 268                "LDR     R1, [SP,#0x30]\n"
 269                "SUB     R12, R1, R0\n"
 270 "loc_FF96287C:\n"
 271                "LDR     R2, [R6,#0x48]\n"
 272                "LDR     R0, [R4,#0x1C]\n"
 273                "LDR     R1, [R4,#0x20]\n"
 274                "ADD     R3, SP, #0x38\n"
 275                "STR     R0, [SP,#0x18]\n"
 276                "STR     R1, [SP,#0x1C]\n"
 277                "STR     R3, [SP,#0x24]\n"
 278                "STR     R2, [SP,#0x20]\n"
 279                "LDR     R2, [R6,#0x64]\n"
 280                "LDR     R3, [R6,#0x68]\n"
 281                "LDR     R0, [SP,#0x28]\n"
 282                "STR     R3, [SP,#0x14]\n"
 283                "LDR     R3, [SP,#0x2C]\n"
 284                "ADD     R1, SP, #0x3C\n"
 285                "STR     R2, [SP,#0x10]\n"
 286                "STR     R3, [SP,#4]\n"
 287                "STR     R1, [SP,#0xC]\n"
 288                "STR     R12, [SP]\n"
 289                "STR     R0, [SP,#8]\n"
 290                "LDMIB   R4, {R0,R1}\n"
 291                "MOV     R3, LR\n"
 292                "MOV     R2, R8\n"
 293                "BL      sub_FFA5EED8\n"
 294                "LDR     R0, [R6,#0x10]\n"
 295                "MOV     R1, #0x3E8\n"
 296                "BL      sub_FF838D68\n"
 297                "CMP     R0, #9\n"
 298                "BNE     loc_FF96290C\n"
 299                "BL      sub_FFA9CE84\n"
 300                "MOV     R0, #0\n"
 301                "STR     R5, [R6,#0x38]\n"
 302 "loc_FF9628F8:\n"
 303                "BL      sub_FFA5EF80\n"
 304                "MOV     R0, #0xC\n"
 305                "BL      sub_FF888128\n"
 306                "MOV     R0, #0x90000\n"
 307                "B       loc_FF962934\n"
 308 "loc_FF96290C:\n"
 309                "LDR     R0, [SP,#0x38]\n"
 310                "CMP     R0, #0\n"
 311                "BEQ     loc_FF962948\n"
 312                "BL      sub_FFA9CE84\n"
 313                "MOV     R0, #0\n"
 314                "STR     R5, [R6,#0x38]\n"
 315 "loc_FF962924:\n"
 316                "BL      sub_FFA5EF80\n"
 317                "MOV     R0, #0xC\n"
 318                "BL      sub_FF888128\n"
 319                "MOV     R0, #0xA0000\n"
 320 "loc_FF962934:\n"
 321                "BL      sub_FF895630\n"
 322                "LDR     R1, [R6,#0x8C]!\n"
 323                "LDR     R0, [R6,#0xC]\n"
 324                "BLX     R1\n"
 325                "B       loc_FF9627C8\n"
 326 "loc_FF962948:\n"
 327                "MOV     R0, #0\n"
 328                "BL      sub_FFA5EF80\n"
 329                "LDR     R0, [SP,#0x34]\n"
 330                "LDR     R1, [SP,#0x3C]\n"
 331                "BL      sub_FFA9CBDC\n" //__MovWriter.c__0
 332                "LDR     R0, [R6,#0x48]\n"
 333                "LDR     R3, =0x6DC0\n"          // ---> -
 334                "ADD     R1, R0, #1\n"           //       |
 335                "STR     R1, [R6,#0x48]\n"       //       |
 336                "STR     R3, [SP]\n"                     //       |
 337                "LDR     R0, [SP,#0x3C]\n"       //       |
 338                "SUB     R3, R3, #4\n"           // ---> -
 339                "MOV     R2, #0xF\n"                     //       |
 340                "BL      sub_FFA9AEB4\n"     //       |
 341                                                                                         //       |
 342                "LDR     R0, =0x6DC0-4\n"    // -<----     // +
 343                "BL      set_quality\n"                    // +                                                                                  
 344 "loc_FF962980:\n"
 345                "LDR     R0, [R6,#0x4C]\n"
 346                "ADD     R0, R0, #1\n"
 347                "STR     R0, [R6,#0x4C]\n"
 348                "LDR     R1, [R6,#0x74]\n"
 349                "MUL     R0, R1, R0\n"
 350                "LDR     R1, [R6,#0x70]\n"
 351                "BL      sub_FFB3E63C\n"
 352                "MOV     R4, R0\n"
 353                "BL      sub_FFA9CEBC\n"
 354                "LDR     R1, [R6,#0x6C]\n"
 355                "CMP     R1, R4\n"
 356                "BNE     loc_FF9629BC\n"
 357                "LDR     R0, [R6,#0x30]\n"
 358                "CMP     R0, #1\n"
 359                "BNE     loc_FF9629D0\n"
 360 "loc_FF9629BC:\n"
 361                "LDR     R1, [R6,#0x80]\n"
 362                "MOV     R0, R4\n"
 363                "BLX     R1\n"
 364                "STR     R4, [R6,#0x6C]\n"
 365                "STR     R7, [R6,#0x30]\n"
 366 "loc_FF9629D0:\n"
 367                "STR     R7, [R6,#0x2C]\n"
 368                "B       loc_FF9627C8\n"
 369         );
 370 };
 371 
 372 /* Values are extracted from G11 FW-Dump, but there are unused.
 373  
 374 long def_table[24]={
 375   0x2000,   0x38D,   0x788,  0x5800,  0x9C5,  0x14B8, 0x10000,  0x1C6A,  0x3C45,  0x8000, 0xE35,
 376   0x1E23,   0x1CCD, -0x2E1, -0x579,  0x4f33, -0x7EB,  -0xF0C,   0xE666, -0x170A, -0x2BC6, 0x7333,
 377   -0xB85,  -0x15E3
 378 };
 379 
 380 long table[24];
 381 long CompressionRateTable[]={0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 0x9, 0x7,
 382                                  0x6, 0x5, 4, 3, 2, 1};
 383  
 384 */ 
 385 void change_video_tables(int a, int b){
 386 #if 0
 387  int i;
 388  for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b; 
 389 #endif
 390 } 
 391 
 392 

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