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

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

DEFINITIONS

This source file includes following definitions.
  1. set_quality
  2. movie_record_task
  3. sub_FF9623B8_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 "loc_FF962A24:\n"
  19                "LDR     R0, [R4,#0x18]\n"
  20                "MOV     R2, #0\n"
  21                "ADD     R1, SP, #4\n"
  22                "BL      sub_FF83891C\n"
  23                "LDR     R0, [R4,#0x20]\n"
  24                "CMP     R0, #0\n"
  25                "BNE     loc_FF962AF4\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_FF962AF4\n"
  32 "loc_FF962A58:\n"
  33                "B       loc_FF962AA8\n"
  34 "loc_FF962A5C:\n"
  35                "B       loc_FF962AC8\n"
  36 "loc_FF962A60:\n"
  37                "B       loc_FF962AD8\n"
  38 "loc_FF962A64:\n"
  39                "B       loc_FF962AE0\n"
  40 "loc_FF962A68:\n"
  41                "B       loc_FF962AB0\n"
  42 "loc_FF962A6C:\n"
  43                "B       loc_FF962AE8\n"
  44 "loc_FF962A70:\n"
  45                "B       loc_FF962AB8\n"
  46 "loc_FF962A74:\n"
  47                "B       loc_FF962AF4\n"
  48 "loc_FF962A78:\n"
  49                "B       loc_FF962AF0\n"
  50 "loc_FF962A7C:\n"
  51                "B       loc_FF962A80\n"
  52 "loc_FF962A80:\n"
  53 //; jumptable FF9"2A50 entry 9
  54                "LDR     R0, =0xFF962738\n"
  55                "STR     R6, [R4,#0x34]\n"
  56                "STR     R0, [R4,#0x9C]\n"
  57                "LDR     R2, =0xFF961CC8\n"
  58                "LDR     R1, =0x8D74C\n"
  59                "LDR     R0, =0xFF961DAC\n"
  60                "STR     R6, [R4,#0x24]\n"
  61                "BL      sub_FF85046C\n"
  62                "STR     R5, [R4,#0x38]\n"
  63                "B       loc_FF962AF4\n"
  64 "loc_FF962AA8:\n"
  65 //; jumptable FF9"2A50 entry 0
  66                "BL      unlock_optical_zoom\n" //+-----> inserted to unlock the zoom
  67                "BL      sub_FF962830\n"
  68                "B       loc_FF962AF4\n"
  69 "loc_FF962AB0:\n"
  70 //; jumptable FF9"2A50 entry 4
  71                //"BL      sub_FF9623B8\n"  // -
  72                "BL      sub_FF9623B8_my\n" // + --------->
  73                "B       loc_FF962AF4\n"
  74 "loc_FF962AB8:\n"
  75 //; jumptable FF9"2A50 entry 6
  76                "LDR     R1, [R0,#0x18]\n"
  77                "LDR     R0, [R0,#4]\n"
  78                "BL      sub_FFA9C654\n"
  79                "B       loc_FF962AF4\n"
  80 "loc_FF962AC8:\n"
  81 //; jumptable FF9"2A50 entry 1
  82                "LDR     R0, [R4,#0x38]\n"
  83                "CMP     R0, #5\n"
  84                "STRNE   R5, [R4,#0x28]\n"
  85                "B       loc_FF962AF4\n"
  86 "loc_FF962AD8:\n"
  87 //; jumptable FF9"2A50 entry 2
  88                "BL      sub_FF962108\n"
  89                "B       loc_FF962AF4\n"
  90 "loc_FF962AE0:\n"
  91 //; jumptable FF9"2A50 entry 3
  92                "BL      sub_FF961DF8\n"
  93                "B       loc_FF962AF4\n"
  94 "loc_FF962AE8:\n"
  95 //; jumptable FF9"2A50 entry 5
  96                "BL      sub_FF961C54\n"
  97                "B       loc_FF962AF4\n"
  98 "loc_FF962AF0:\n"
  99 //; jumptable FF9"2A50 entry 8
 100                "BL      sub_FF962C60\n"
 101 "loc_FF962AF4:\n"
 102 //; jumptable FF9"2A50 default entry
 103 //; jumptable FF9"2A50 entry 7
 104                "LDR     R1, [SP,#4]\n"
 105                "MOV     R3, #0x460\n"
 106                "STR     R6, [R1]\n"
 107                "STR     R3, [SP]\n"
 108                "LDR     R0, [R4,#0x1C]\n"
 109                "LDR     R3, =0xFF961AB4\n"
 110                "MOV     R2, R7\n"
 111                "BL      sub_FF839270\n"
 112                "B       loc_FF962A24\n"
 113 
 114  );
 115 } 
 116 
 117 void __attribute__((naked,noinline)) sub_FF9623B8_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_FF962528\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_FFA9C6F0\n"
 140                "CMP     R0, #0\n"
 141                "MOV     R5, #1\n"
 142                "BNE     loc_FF962434\n"
 143                "LDR     R1, [R6,#0x28]\n"
 144                "CMP     R1, #1\n"
 145                "BNE     loc_FF962530\n"
 146                "LDR     R1, [R6,#0x4C]\n"
 147                "LDR     R2, [R6,#0x3C]\n"
 148                "CMP     R1, R2\n"
 149                "BCC     loc_FF962530\n"
 150 "loc_FF962434:\n"
 151                "CMP     R0, #0x80000001\n"
 152                "STREQ   R8, [R6,#0x50]\n"
 153                "BEQ     loc_FF96246C\n"
 154                "CMP     R0, #0x80000003\n"
 155                "STREQ   R5, [R6,#0x50]\n"
 156                "BEQ     loc_FF96246C\n"
 157                "CMP     R0, #0x80000005\n"
 158                "MOVEQ   R0, #2\n"
 159                "BEQ     loc_FF962468\n"
 160                "CMP     R0, #0x80000007\n"
 161                "STRNE   R7, [R6,#0x50]\n"
 162                "BNE     loc_FF96246C\n"
 163                "MOV     R0, #3\n"
 164 "loc_FF962468:\n"
 165                "STR     R0, [R6,#0x50]\n"
 166 "loc_FF96246C:\n"
 167                "LDR     R0, =0x8D780\n"
 168                "LDR     R0, [R0,#8]\n"
 169                "CMP     R0, #0\n"
 170                "BEQ     loc_FF962484\n"
 171                "BL      sub_FF862178\n"
 172                "B       loc_FF962488\n"
 173 "loc_FF962484:\n"
 174                "BL      sub_FF961C54\n"
 175 "loc_FF962488:\n"
 176                "LDR     R0, [R4,#0x1C]\n"
 177                "ADD     R4, SP, #0x18\n"
 178                "ADD     R3, SP, #0x38\n"
 179                "LDR     R2, =0xFFFFFFFE\n"
 180                "MOV     R1, #0\n"
 181                "STMIA   R4, {R0-R3}\n"
 182                "LDR     R2, [R6,#0x64]\n"
 183                "LDR     R3, [R6,#0x68]\n"
 184                "ADD     R1, SP, #0x3C\n"
 185                "ADD     R4, SP, #8\n"
 186                "MOV     R0, #0\n"
 187                "STMIA   R4, {R0-R3}\n"
 188                "MOV     R3, #0\n"
 189                "MOV     R2, #0x40\n"
 190                "STRD    R2, [SP]\n"
 191                "LDR     R3, =0x8D798\n"
 192                "MOV     R2, #0\n"
 193                "MOV     R1, #0\n"
 194                "BL      sub_FFA5EC18\n"
 195                "LDR     R0, [R6,#0x10]\n"
 196                "MOV     R1, #0x3E8\n"
 197                "BL      sub_FF838D38\n"
 198                "CMP     R0, #9\n"
 199                "BNE     loc_FF9624F8\n"
 200 "loc_FF9624E8:\n"
 201                "BL      sub_FFA9CBC4\n"
 202                "MOV     R0, #1\n"
 203                "STR     R5, [R6,#0x38]\n"
 204                "B       loc_FF962658\n"
 205 "loc_FF9624F8:\n"
 206                "LDR     R0, [SP,#0x38]\n"
 207                "CMP     R0, #0\n"
 208                "BEQ     loc_FF962514\n"
 209 "loc_FF962504:\n"
 210                "BL      sub_FFA9CBC4\n"
 211                "MOV     R0, #1\n"
 212                "STR     R5, [R6,#0x38]\n"
 213                "B       loc_FF962684\n"
 214 "loc_FF962514:\n"
 215                "MOV     R0, #1\n"
 216                "BL      sub_FFA5ECC0\n"
 217                "BL      sub_FFA5ECFC\n"
 218                "MOV     R0, #5\n"
 219                "STR     R0, [R6,#0x38]\n"
 220 "loc_FF962528:\n"
 221                "ADD     SP, SP, #0x40\n"
 222                "LDMFD   SP!, {R4-R8,PC}\n"
 223 "loc_FF962530:\n"
 224                "LDR     R12, [SP,#0x30]\n"
 225                "CMP     R12, #0\n"
 226                "BEQ     loc_FF9626E0\n"
 227                "STR     R5, [R6,#0x2C]\n"
 228                "LDR     R0, [R6,#0x4C]\n"
 229                "LDR     R8, [R4,#0xC]\n"
 230                "CMP     R0, #0\n"
 231                "LDRNE   LR, [SP,#0x34]\n"
 232                "BNE     loc_FF9625DC\n"
 233                "LDR     R0, [R4,#0x1C]\n"
 234                "LDR     R1, [R4,#0x20]\n"
 235                "ADD     R3, SP, #0x38\n"
 236                "LDR     R2, =0xFFFFFFFF\n"
 237                "ADD     LR, SP, #0x18\n"
 238                "STMIA   LR, {R0-R3}\n"
 239                "LDR     R0, [SP,#0x28]\n"
 240                "LDR     R2, [R6,#0x64]\n"
 241                "LDR     R3, [R6,#0x68]\n"
 242                "ADD     R1, SP, #0x3C\n"
 243                "ADD     LR, SP, #8\n"
 244                "STMIA   LR, {R0-R3}\n"
 245                "LDR     R3, [SP,#0x2C]\n"
 246                "STR     R12, [SP]\n"
 247                "STR     R3, [SP,#4]\n"
 248                "LDMIB   R4, {R0,R1}\n"
 249                "LDR     R3, [SP,#0x34]\n"
 250                "MOV     R2, R8\n"
 251                "BL      sub_FFA5EC18\n"
 252                "LDR     R0, [R6,#0x10]\n"
 253                "MOV     R1, #0x3E8\n"
 254                "BL      sub_FF838D38\n"
 255                "CMP     R0, #9\n"
 256                "BEQ     loc_FF9624E8\n"
 257                "LDR     R0, [SP,#0x38]\n"
 258                "CMP     R0, #0\n"
 259                "BNE     loc_FF962504\n"
 260                "MOV     R0, #1\n"
 261                "BL      sub_FFA5ECC0\n"
 262                "LDR     R0, [SP,#0x3C]\n"
 263                "LDR     R1, [SP,#0x34]\n"
 264                "ADD     LR, R1, R0\n"
 265                "LDR     R1, [SP,#0x30]\n"
 266                "SUB     R12, R1, R0\n"
 267 "loc_FF9625DC:\n"
 268                "LDR     R2, [R6,#0x48]\n"
 269                "LDR     R0, [R4,#0x1C]\n"
 270                "LDR     R1, [R4,#0x20]\n"
 271                "ADD     R3, SP, #0x38\n"
 272                "STR     R0, [SP,#0x18]\n"
 273                "STR     R1, [SP,#0x1C]\n"
 274                "STR     R3, [SP,#0x24]\n"
 275                "STR     R2, [SP,#0x20]\n"
 276                "LDR     R2, [R6,#0x64]\n"
 277                "LDR     R3, [R6,#0x68]\n"
 278                "LDR     R0, [SP,#0x28]\n"
 279                "STR     R3, [SP,#0x14]\n"
 280                "LDR     R3, [SP,#0x2C]\n"
 281                "ADD     R1, SP, #0x3C\n"
 282                "STR     R2, [SP,#0x10]\n"
 283                "STR     R3, [SP,#4]\n"
 284                "STR     R1, [SP,#0xC]\n"
 285                "STR     R12, [SP]\n"
 286                "STR     R0, [SP,#8]\n"
 287                "LDMIB   R4, {R0,R1}\n"
 288                "MOV     R3, LR\n"
 289                "MOV     R2, R8\n"
 290                "BL      sub_FFA5EC18\n"
 291                "LDR     R0, [R6,#0x10]\n"
 292                "MOV     R1, #0x3E8\n"
 293                "BL      sub_FF838D38\n"
 294                "CMP     R0, #9\n"
 295                "BNE     loc_FF96266C\n"
 296                "BL      sub_FFA9CBC4\n"
 297                "MOV     R0, #0\n"
 298                "STR     R5, [R6,#0x38]\n"
 299 "loc_FF962658:\n"
 300                "BL      sub_FFA5ECC0\n"
 301                "MOV     R0, #0xC\n"
 302                "BL      sub_FF888008\n"
 303                "MOV     R0, #0x90000\n"
 304                "B       loc_FF962694\n"
 305 "loc_FF96266C:\n"
 306                "LDR     R0, [SP,#0x38]\n"
 307                "CMP     R0, #0\n"
 308                "BEQ     loc_FF9626A8\n"
 309                "BL      sub_FFA9CBC4\n"
 310                "MOV     R0, #0\n"
 311                "STR     R5, [R6,#0x38]\n"
 312 "loc_FF962684:\n"
 313                "BL      sub_FFA5ECC0\n"
 314                "MOV     R0, #0xC\n"
 315                "BL      sub_FF888008\n"
 316                "MOV     R0, #0xA0000\n"
 317 "loc_FF962694:\n"
 318                "BL      sub_FF895510\n"
 319                "LDR     R1, [R6,#0x8C]!\n"
 320                "LDR     R0, [R6,#0xC]\n"
 321                "BLX     R1\n"
 322                "B       loc_FF962528\n"
 323 "loc_FF9626A8:\n"
 324                "MOV     R0, #0\n"
 325                "BL      sub_FFA5ECC0\n"
 326                "LDR     R0, [SP,#0x34]\n"
 327                "LDR     R1, [SP,#0x3C]\n"
 328                "BL      sub_FFA9C91C\n"
 329                "LDR     R0, [R6,#0x48]\n"
 330                "LDR     R3, =0x6DC0\n"       // ---> -
 331                "ADD     R1, R0, #1\n"        //       |
 332                "STR     R1, [R6,#0x48]\n"    //       |
 333                "STR     R3, [SP]\n"          //       |
 334                "LDR     R0, [SP,#0x3C]\n"    //       |
 335                "SUB     R3, R3, #4\n"        // ---> -
 336                "MOV     R2, #0xF\n"          //       |
 337                "BL      sub_FFA9ABF4\n"      //       |
 338                                              //       |
 339                "LDR     R0, =0x6DC0-4\n"     // -<----     // +
 340                "BL      set_quality\n"                     // +
 341 "loc_FF9626E0:\n"
 342                "LDR     R0, [R6,#0x4C]\n"
 343                "ADD     R0, R0, #1\n"
 344                "STR     R0, [R6,#0x4C]\n"
 345                "LDR     R1, [R6,#0x74]\n"
 346                "MUL     R0, R1, R0\n"
 347                "LDR     R1, [R6,#0x70]\n"
 348                "BL      sub_FFB3E37C\n"
 349                "MOV     R4, R0\n"
 350                "BL      sub_FFA9CBFC\n"
 351                "LDR     R1, [R6,#0x6C]\n"
 352                "CMP     R1, R4\n"
 353                "BNE     loc_FF96271C\n"
 354                "LDR     R0, [R6,#0x30]\n"
 355                "CMP     R0, #1\n"
 356                "BNE     loc_FF962730\n"
 357 "loc_FF96271C:\n"
 358                "LDR     R1, [R6,#0x80]\n"
 359                "MOV     R0, R4\n"
 360                "BLX     R1\n"
 361                "STR     R4, [R6,#0x6C]\n"
 362                "STR     R7, [R6,#0x30]\n"
 363 "loc_FF962730:\n"
 364                "STR     R7, [R6,#0x2C]\n"
 365                "B       loc_FF962528\n"
 366 );
 367 };
 368 
 369 /* Values are taken from G11 FW-Dump, but there are unused.
 370  
 371 long def_table[24]={
 372   0x2000,   0x38D,   0x788,  0x5800,  0x9C5,  0x14B8, 0x10000,  0x1C6A,  0x3C45,  0x8000, 0xE35,
 373   0x1E23,   0x1CCD, -0x2E1, -0x579,  0x4f33, -0x7EB,  -0xF0C,   0xE666, -0x170A, -0x2BC6, 0x7333,
 374   -0xB85,  -0x15E3
 375 };
 376 
 377 long table[24];
 378 long CompressionRateTable[]={0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 0x9, 0x7,
 379                                  0x6, 0x5, 4, 3, 2, 1};
 380  
 381 */ 
 382 void change_video_tables(int a, int b){
 383 #if 0
 384  int i;
 385  for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b; 
 386 #endif
 387 } 
 388 

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