root/platform/ixus55_sd450/sub/100d/movie_rec.c

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

DEFINITIONS

This source file includes following definitions.
  1. change_video_tables
  2. movie_record_task
  3. sub_FF943CEC_my
  4. sub_FF944874_my

   1 #include "conf.h"
   2 
   3 int *video_quality = &conf.video_quality;
   4 int *video_mode    = &conf.video_mode;
   5 
   6 long def_table1[56]={
   7 0x10000,0xC000,0x5800, 0x2000, 0x1C6A, 0x1550,0x9C5,  0x38D,  0x3C45, 0x2D34, 0x14B8, 0x788,  0x5F60, 0x4788,
   8 0x20C9, 0xBE1, 0x8661, 0x64C9, 0x2E31, 0x10CB,0xB21A, 0x8594, 0x3D39, 0x1642, 0xE249, 0xA9B8, 0x4DC9, 0x1C48,
   9 0x117D2,0xD1DF,0x6030, 0x22F9, 0x153D5,0xFEE1,0x74D1, 0x2A79, 0x195F8,0x1307C,0x8B8D, 0x32AA, 0x1E01C,0x16817,
  10 0xA509, 0x3C01,0x2328E,0x1A5ED,0xC160, 0x4637,0x28C99,0x1E975,0xE054, 0x5190, 0x2F08B,0x2346B,0x102AF,0x5E0E
  11 };
  12 
  13 long def_table2[12]={0xE666,0xACCD,0x4F33,0x1CCD,-0x170A,-0x1148,-0x7EB,-0x2E1,-0x2BC6,-0x20D5,-0xF0C,-0x579};
  14 
  15 long table1[56], table2[12];
  16 
  17 void change_video_tables(int a, int b){
  18  int i;
  19  for (i=0;i<56;i++) table1[i]=(def_table1[i]*a)/b;
  20  for (i=0;i<12;i++) table2[i]=(def_table2[i]*a)/b;
  21 }
  22 
  23 long CompressionRateTable[]={0x60, 0x5D, 0x5A, 0x57, 0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 9, 7, 6, 5, 4, 3, 2, 1};
  24 
  25 
  26 void __attribute__((naked,noinline)) movie_record_task(){
  27  asm volatile(
  28                 "STMFD   SP!, {R4,LR}\n"
  29                 "SUB     SP, SP, #4\n"
  30                 "MOV     R4, SP\n"
  31                 "B       loc_FF9435A8\n"
  32 "loc_FF9434F8:\n"
  33                 "LDR     R3, =0x7CDA0\n"
  34                 "LDR     R2, [R3]\n"
  35                 "CMP     R2, #0\n"
  36                 "BNE     loc_FF943594\n"
  37                 "SUB     R3, R12, #1\n"
  38                 "CMP     R3, #0xA\n"
  39                 "LDRLS   PC, [PC,R3,LSL#2]\n"
  40                 "B       loc_FF943594\n"
  41                 ".long  loc_FF943544\n"
  42                 ".long  loc_FF94354C\n"
  43                 ".long  loc_FF943564\n"
  44                 ".long  loc_FF94356C\n"
  45                 ".long  loc_FF943574\n"
  46                 ".long  loc_FF943554\n"
  47                 ".long  loc_FF94357C\n"
  48                 ".long  loc_FF94355C\n"
  49                 ".long  loc_FF943594\n"
  50                 ".long  loc_FF94358C\n"
  51                 ".long  loc_FF943584\n"
  52 "loc_FF943544:\n"
  53                 "BL      sub_FF943628\n"
  54                 "B       loc_FF943590\n"
  55 "loc_FF94354C:\n"
  56                 "BL      unlock_optical_zoom\n"
  57                 "BL      sub_FF94385C\n"
  58                 "B       loc_FF943590\n"
  59 "loc_FF943554:\n"
  60                 "BL      sub_FF943CEC_my\n" // redirect --->
  61                 "B       loc_FF943590\n"
  62 "loc_FF94355C:\n"
  63                 "BL      sub_FF944140\n"
  64                 "B       loc_FF943590\n"
  65 "loc_FF943564:\n"
  66                 "BL      sub_FF943F64\n"
  67                 "B       loc_FF943590\n"
  68 "loc_FF94356C:\n"
  69                 "BL      sub_FF94434C\n"
  70                 "B       loc_FF943590\n"
  71 "loc_FF943574:\n"
  72                 "BL      sub_FF944510\n"
  73                 "B       loc_FF943590\n"
  74 "loc_FF94357C:\n"
  75                 "BL      sub_FF944200\n"
  76                 "B       loc_FF943590\n"
  77 "loc_FF943584:\n"
  78                 "BL      sub_FF9442E0\n"
  79                 "B       loc_FF943590\n"
  80 "loc_FF94358C:\n"
  81                 "BL      sub_FF943FB4\n"
  82 "loc_FF943590:\n"
  83                 "LDR     R1, [SP]\n"
  84 "loc_FF943594:\n"
  85                 "LDR     R3, =0x7CCD0\n"
  86                 "MOV     R2, #0\n"
  87                 "STR     R2, [R1]\n"
  88                 "LDR     R0, [R3]\n"
  89                 "BL      sub_FF820744\n"  // PostMessageQueue
  90 "loc_FF9435A8:\n"
  91                 "LDR     R3, =0x7CCCC\n"
  92                 "MOV     R1, R4\n"
  93                 "LDR     R0, [R3]\n"
  94                 "MOV     R2, #0\n"
  95                 "BL      sub_FF82032C\n" // ReceiveMessageQueue
  96                 "LDR     R0, [SP]\n"
  97                 "LDR     R12, [R0]\n"
  98                 "CMP     R12, #0xC\n"
  99                 "MOV     R1, R0\n"
 100                 "BNE     loc_FF9434F8\n"
 101                 "LDR     R3, =0x7CCC4\n"
 102                 "LDR     R0, [R3]\n"
 103                 "BL      sub_FF821100\n" // GiveSemaphore
 104                 "BL      sub_FF8218C8\n" // ExitTask
 105                 "ADD     SP, SP, #4\n"
 106                 "LDMFD   SP!, {R4,PC}\n"
 107  );
 108 }
 109 
 110 
 111 void __attribute__((naked,noinline)) sub_FF943CEC_my(){
 112  asm volatile(
 113                 "STMFD   SP!, {R4-R11,LR}\n"
 114                 "LDR     R5, =0x7CDBC\n"
 115                 "SUB     SP, SP, #0x34\n"
 116                 "LDR     R3, [R5]\n"
 117                 "CMP     R3, #3\n"
 118                 "MOV     R4, R0\n"
 119                 "MOVEQ   R3, #4\n"
 120                 "STREQ   R3, [R5]\n"
 121                 "LDR     R3, =0x7CE64\n"
 122                 "MOV     LR, PC\n"
 123                 "LDR     PC, [R3]\n"
 124                 "LDR     R2, [R5]\n"
 125                 "CMP     R2, #4\n"
 126                 "BNE     loc_FF943E98\n"
 127                 "ADD     R0, SP, #0x30\n"
 128                 "ADD     R1, SP, #0x2C\n"
 129                 "ADD     R2, SP, #0x28\n"
 130                 "ADD     R3, SP, #0x24\n"
 131                 "BL      sub_FF9454AC\n"
 132                 "CMP     R0, #0\n"
 133                 "BNE     loc_FF943D68\n"
 134                 "LDR     R3, =0x7CDA8\n"
 135                 "LDR     R2, [R3]\n"
 136                 "CMP     R2, #1\n"
 137                 "BNE     loc_FF943D7C\n"
 138                 "LDR     R2, =0x7CDF8\n"
 139                 "LDR     R1, =0x7CDD0\n"
 140                 "LDR     R12, [R2]\n"
 141                 "LDR     R3, [R1]\n"
 142                 "CMP     R12, R3\n"
 143                 "BCC     loc_FF943D7C\n"
 144 "loc_FF943D68:\n"
 145                 "BL      sub_FF943EDC\n"
 146                 "BL      sub_FF944110\n"
 147                 "MOV     R3, #5\n"
 148                 "STR     R3, [R5]\n"
 149                 "B       loc_FF943E98\n"
 150 "loc_FF943D7C:\n"
 151                 "LDR     R12, =0x7CE00\n"
 152                 "LDR     R11, =0x7CE0C\n"
 153                 "LDMIB   R4, {R0-R2}\n"
 154                 "LDR     R10, [R12]\n"
 155                 "LDR     R7, [R11]\n"
 156                 "LDR     R4, [SP,#0x2C]\n"
 157                 "LDR     R5, [SP,#0x28]\n"
 158                 "LDR     R6, [SP,#0x24]\n"
 159                 "LDR     R8, =0x7CDAC\n"
 160                 "LDR     R3, [SP,#0x30]\n"
 161                 "ADD     R12, SP, #0x20\n"
 162                 "ADD     LR, SP, #0x1C\n"
 163                 "MOV     R9, #1\n"
 164                 "STMEA   SP, {R4-R6,R12}\n"
 165                 "STR     R10, [SP,#0x10]\n"
 166                 "STR     R7, [SP,#0x14]\n"
 167                 "STR     LR, [SP,#0x18]\n"
 168                 "STR     R9, [R8]\n"
 169                 "BL      sub_FF895A1C\n"
 170                 "LDR     R3, =0x7CCC4\n"
 171                 "MOV     R1, #0x3E8\n"
 172                 "LDR     R0, [R3]\n"
 173                 "BL      sub_FF820F18\n" // TakeSemaphore
 174                 "CMP     R0, #9\n"
 175                 "BNE     loc_FF943DF0\n"
 176                 "BL      sub_FF945C6C\n"
 177                 "LDR     R3, =0x7CDBC\n"
 178                 "LDR     R0, =0xFF943CD4\n" // aJpegtimeout_2
 179                 "B       loc_FF943E08\n"
 180 "loc_FF943DF0:\n"
 181                 "LDR     R5, [SP,#0x1C]\n"
 182                 "CMP     R5, #0\n"
 183                 "BEQ     loc_FF943E14\n"
 184                 "BL      sub_FF945C6C\n"
 185                 "LDR     R3, =0x7CDBC\n"
 186                 "LDR     R0, =0xFF943CE0\n" // aJpegicerror_3
 187 "loc_FF943E08:\n"
 188                 "STR     R9, [R3]\n"
 189                 "BL      sub_FF957B90\n" // HardwareDefect
 190                 "B       loc_FF943E98\n"
 191 "loc_FF943E14:\n"
 192                 "BL      sub_FF895B90\n"
 193                 "LDR     R0, [SP,#0x30]\n"
 194                 "LDR     R1, [SP,#0x20]\n"
 195                 "BL      sub_FF945990\n"
 196                 "LDR     R4, =0x7CDF8\n"
 197                 "LDR     R3, [R4]\n"
 198                 "ADD     R3, R3, #1\n"
 199                 "LDR     R0, [SP,#0x20]\n"
 200                 "MOV     R1, R11\n"
 201                 "STR     R3, [R4]\n"
 202                 "MOV     R2, R5\n"
 203                 "BL      sub_FF944874_my\n"
 204                 "LDR     R3, =0x7CDE4\n"
 205                 "LDR     R4, [R4]\n"
 206                 "LDR     R1, [R3]\n"
 207                 "MOV     R0, R4\n"
 208                 "BL      sub_FFAC9B34\n" // __umodsi3
 209                 "CMP     R0, #0\n"
 210                 "BEQ     loc_FF943E74\n"
 211                 "LDR     R6, =0x7CDB0\n"
 212                 "LDR     R3, [R6]\n"
 213                 "CMP     R3, #1\n"
 214                 "BNE     loc_FF943E8C\n"
 215                 "B       loc_FF943E78\n"
 216 "loc_FF943E74:\n"
 217                 "LDR     R6, =0x7CDB0\n"
 218 "loc_FF943E78:\n"
 219                 "MOV     R0, R4\n"
 220                 "LDR     R3, =0x7CE40\n"
 221                 "MOV     LR, PC\n"
 222                 "LDR     PC, [R3]\n"
 223                 "STR     R5, [R6]\n"
 224 "loc_FF943E8C:\n"
 225                 "LDR     R2, =0x7CDAC\n"
 226                 "MOV     R3, #0\n"
 227                 "STR     R3, [R2]\n"
 228 "loc_FF943E98:\n"
 229                 "ADD     SP, SP, #0x34\n"
 230                 "LDMFD   SP!, {R4-R11,PC}\n"
 231  );
 232 }
 233 
 234 
 235 void __attribute__((naked,noinline)) sub_FF944874_my(){
 236  asm volatile(
 237                 "CMP     R2, #1\n"
 238                 "STMFD   SP!, {R4-R7,LR}\n"
 239                 "MOV     R7, R0\n"
 240                 "MOV     R6, R1\n"
 241 
 242             //    "MOVEQ   R3, #0x79\n"               // -
 243                         //    "STREQ   R3, [R6]\n"                // -
 244                 "LDREQ   R3, =CompressionRateTable\n" // +
 245                 "LDREQ   R2, [R3,#0x18]\n"            // +
 246                 "STREQ   R2, [R6]\n"                              // +
 247 
 248                 "LDMEQFD SP!, {R4-R7,PC}\n"
 249                 "LDR     R12, =0x7CE70\n"
 250                 "LDR     R0, [R12]\n"
 251                 "LDR     R3, =0x7CE78\n"
 252                 "CMP     R0, #0\n"
 253                 "LDR     R1, [R3]\n"
 254                 "BEQ     loc_FF9448BC\n"
 255                 "LDR     R2, =0x7CE7C\n"
 256                 "LDR     R3, [R2]\n"
 257                 "CMP     R3, #1\n"
 258                 "BNE     loc_FF9448D0\n"
 259                 "B       loc_FF9448C0\n"
 260 "loc_FF9448BC:\n" 
 261                 "LDR     R2, =0x7CE7C\n"
 262 "loc_FF9448C0:\n" 
 263                 "MOV     R3, #0\n"
 264                 "STR     R3, [R2]\n"
 265                 "STR     R7, [R12]\n"
 266                 "B       loc_FF944984\n"
 267 "loc_FF9448D0:\n" 
 268                 "LDR     R3, =0x7CE74\n"
 269                 "LDR     R2, [R3]\n"
 270                 "LDR     R5, =table1\n" // unk_FF944354
 271                 "MOV     LR, R2,LSL#2\n"
 272                 "LDR     R3, [R5,LR]\n"
 273                 "LDR     R4, =table2\n" // unk_FF944390
 274                 "RSB     R12, R3, R0\n"
 275                 "LDR     R2, [R4,LR]\n"
 276                 "CMP     R12, #0\n"
 277                 "RSB     R0, R2, R0\n"
 278                 "BLE     loc_FF944930\n"
 279                 "ADD     R3, R5, #0x14\n"
 280                 "LDR     R2, [R3,LR]\n"
 281                 "CMP     R2, R12\n"
 282                 "ADDGE   R1, R1, #1\n"
 283                 "BGE     loc_FF944924\n"
 284                 "ADD     R3, R5, #0x28\n"
 285                 "LDR     R2, [R3,LR]\n"
 286                 "CMP     R2, R12\n"
 287                 "ADDGE   R1, R1, #2\n"
 288                 "ADDLT   R1, R1, #3\n"
 289 "loc_FF944924:\n" 
 290            //     "CMP     R1, #0xE\n"    // -
 291            //     "MOVGE   R1, #0xE\n"    // -
 292                                 "CMP     R1, #0x1A\n"    // +
 293                 "MOVGE   R1, #0x1A\n"    // +
 294 
 295                 "B       loc_FF944968\n"
 296 "loc_FF944930:\n" 
 297                 "CMP     R0, #0\n"
 298                 "BGE     loc_FF944968\n"
 299                 "ADD     R3, R4, #0x14\n"
 300                 "LDR     R2, [R3,LR]\n"
 301                 "CMP     R2, R0\n"
 302                 "SUBLE   R1, R1, #1\n"
 303                 "BLE     loc_FF944960\n"
 304                 "ADD     R3, R4, #0x28\n"
 305                 "LDR     R2, [R3,LR]\n"
 306                 "CMP     R2, R0\n"
 307                 "SUBLE   R1, R1, #2\n"
 308                 "SUBGT   R1, R1, #3\n"
 309 "loc_FF944960:\n" 
 310                 "CMP     R1, #0\n"
 311                 "MOVLT   R1, #0\n"
 312 "loc_FF944968:\n" 
 313                 "LDR     R0, =0x7CE78\n"
 314                 "LDR     R3, [R0]\n"
 315                 "CMP     R1, R3\n"
 316                 "LDRNE   R2, =0x7CE7C\n"
 317                 "MOVNE   R3, #1\n"
 318                 "STRNE   R1, [R0]\n"
 319                 "STRNE   R3, [R2]\n"
 320 "loc_FF944984:\n" 
 321                 "LDR     R3, =0x7CE78\n"
 322            //     "LDR     R1, =0x6CF8\n"  // -
 323                         "LDR     R1, =video_mode\n"  // +
 324                 "LDR     R0, [R3]\n"
 325                 "LDR     R2, =CompressionRateTable\n" // FF9446A0
 326                 "LDR     R12, [R1]\n"
 327                 "LDR     LR, [R2,R0,LSL#2]\n"
 328                 "LDR     R3, =0x7CE70\n"
 329                 "CMP     R12, #1\n"
 330                 "STR     R7, [R3]\n"
 331                 "STR     LR, [R6]\n"
 332             //    "MOVEQ   R3, #0xB\n"   // -
 333 
 334                 "LDREQ   R3, =video_quality\n"          // +
 335                 "LDREQ   R3, [R3]\n"                    // +
 336                 "LDREQ   R3, [R3]\n"                    // +                            
 337                                 
 338                 "STREQ   R3, [R6]\n"
 339                 "LDMFD   SP!, {R4-R7,PC}\n"
 340  );
 341 }

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