root/platform/a1200/sub/100b/movie_rec.c

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

DEFINITIONS

This source file includes following definitions.
  1. change_video_tables
  2. set_quality
  3. movie_record_task
  4. movie_time
  5. sub_FF963C44_my
  6. sub_FFAA66F0_my
  7. sub_FF963FE4_my

   1 #include "conf.h"
   2 
   3 void change_video_tables(int a, int b) {}
   4 
   5 void  set_quality(int *x) { // -17 highest; +12 lowest
   6     if (conf.video_mode)
   7         *x=12-((conf.video_quality-1)*(12+17)/(99-1));
   8 }
   9 
  10 void __attribute__((naked,noinline)) movie_record_task(  ) {
  11     // FF9645BC
  12 asm volatile (
  13      "    STMFD   SP!, {R2-R10,LR} \n"
  14       "    LDR     R6, =0xFF963AEC \n"
  15 //    "    LDR     R7, =0xFF963FE4 \n"
  16       "    LDR     R7, =sub_FF963FE4_my \n" // patched
  17       "    LDR     R4, =0x6570 \n"
  18       "    LDR     R9, =0x67F \n"
  19       "    LDR     R10, =0x2710 \n"
  20       "    MOV     R8, #1 \n"
  21       "    MOV     R5, #0 \n"
  22 "loc_FF9645DC:\n"
  23       "    LDR     R0, [R4, #0x24] \n"
  24       "    MOV     R2, #0 \n"
  25       "    ADD     R1, SP, #4 \n"
  26       "    BL      sub_FF8397A4 \n"
  27       "    LDR     R0, [R4, #0x2C] \n"
  28       "    CMP     R0, #0 \n"
  29       "    LDRNE   R0, [R4, #0xC] \n"
  30       "    CMPNE   R0, #2 \n"
  31       "    LDRNE   R0, [R4, #0x44] \n"
  32       "    CMPNE   R0, #6 \n"
  33       "    BNE     loc_FF964700 \n"
  34       "    LDR     R0, [SP, #4] \n"
  35       "    LDR     R1, [R0] \n"
  36       "    SUB     R1, R1, #2 \n"
  37       "    CMP     R1, #0xB \n"
  38       "    ADDCC   PC, PC, R1, LSL #2 \n"
  39       "    B       loc_FF964700 \n"
  40       "    B       loc_FF9646B0 \n"
  41       "    B       loc_FF9646D4 \n"
  42       "    B       loc_FF9646E4 \n"
  43       "    B       loc_FF9646EC \n"
  44       "    B       loc_FF9646B8 \n"
  45       "    B       loc_FF9646F4 \n"
  46       "    B       loc_FF9646C4 \n"
  47       "    B       loc_FF964700 \n"
  48       "    B       loc_FF9646FC \n"
  49       "    B       loc_FF96467C \n"
  50       "    B       loc_FF96464C \n"
  51 "loc_FF96464C:\n"
  52       "    STR     R5, [R4, #0x40] \n"
  53       "    STR     R5, [R4, #0x30] \n"
  54       "    STR     R5, [R4, #0x34] \n"
  55       "    STRH    R5, [R4, #6] \n"
  56       "    STR     R6, [R4, #0xB4] \n"
  57       "    STR     R7, [R4, #0xCC] \n"
  58       "    LDR     R0, [R4, #0xC] \n"
  59       "    ADD     R0, R0, #1 \n"
  60       "    STR     R0, [R4, #0xC] \n"
  61       "    MOV     R0, #6 \n"
  62       "    STR     R0, [R4, #0x44] \n"
  63       "    B       loc_FF96469C \n"
  64 "loc_FF96467C:\n"
  65       "    STR     R5, [R4, #0x40] \n"
  66       "    STR     R5, [R4, #0x30] \n"
  67       "    STR     R6, [R4, #0xB4] \n"
  68       "    STR     R7, [R4, #0xCC] \n"
  69       "    LDR     R0, [R4, #0xC] \n"
  70       "    ADD     R0, R0, #1 \n"
  71       "    STR     R0, [R4, #0xC] \n"
  72       "    STR     R8, [R4, #0x44] \n"
  73 "loc_FF96469C:\n"
  74       "    LDR     R2, =0xFF963308 \n"
  75       "    LDR     R1, =0xAC448 \n"
  76       "    LDR     R0, =0xFF96341C \n"
  77       "    BL      sub_FF852804 \n"
  78       "    B       loc_FF964700 \n"
  79 "loc_FF9646B0:\n"
  80       "    BL      unlock_optical_zoom \n"      // added
  81 //    "    BL      sub_FF963C44 \n"
  82       "    BL      movie_time\n"                // added
  83 "label_A:\n"                                    //
  84       "    B       loc_FF964700 \n"
  85 "loc_FF9646B8:\n"
  86       "    LDR     R1, [R4, #0xCC] \n"
  87       "    BLX     R1 \n"
  88       "    BL      mute_on_zoom\n"                  // added
  89       "    B       loc_FF964700 \n"
  90 "loc_FF9646C4:\n"
  91       "    LDR     R1, [R0, #0x18] \n"
  92       "    LDR     R0, [R0, #4] \n"
  93       "    BL      sub_FFAA71F8 \n"         // 1.00b
  94       "    B       loc_FF964700 \n"
  95 "loc_FF9646D4:\n"
  96       "    LDR     R0, [R4, #0x44] \n"
  97       "    CMP     R0, #5 \n"
  98       "    STRNE   R8, [R4, #0x34] \n"
  99       "    B       loc_FF964700 \n"
 100 "loc_FF9646E4:\n"
 101       "    BL      sub_FF9637AC \n"
 102       "    B       loc_FF964700 \n"
 103 "loc_FF9646EC:\n"
 104       "    BL      sub_FF963468 \n"
 105       "    B       loc_FF964700 \n"
 106 "loc_FF9646F4:\n"
 107       "    BL      sub_FF963294 \n"
 108       "    B       loc_FF964700 \n"
 109 "loc_FF9646FC:\n"
 110       "    BL      sub_FF964B40 \n"
 111 "loc_FF964700:\n"
 112       "    LDR     R1, [SP, #4] \n"
 113       "    LDR     R3, =0xFF9630DC \n"
 114       "    STR     R5, [R1] \n"
 115       "    STR     R9, [SP] \n"
 116       "    LDR     R0, [R4, #0x28] \n"
 117       "    MOV     R2, R10 \n"
 118       "    BL      sub_FF83A11C \n"
 119       "    B       loc_FF9645DC \n"
 120     );
 121 }
 122 
 123 void __attribute__((naked,noinline)) movie_time()
 124 {
 125     if( (int)conf.ext_video_time == 1 )
 126     {
 127         asm volatile (
 128                 "B      sub_FF963C44_my \n"
 129                 "B      label_A\n"
 130         );
 131     }
 132     else
 133     {
 134         asm volatile (
 135                 "BL     sub_FF963C44 \n"
 136                 "B      label_A\n"
 137         );
 138     }
 139 }
 140 
 141 void __attribute__((naked,noinline)) sub_FF963C44_my(  ) {
 142 asm volatile (
 143 "    STMFD   SP!, {R2-R8,LR} \n"
 144 "    LDR     R5, =0x6570 \n"
 145 "    MOV     R0, #0 \n"
 146 "    STR     R0, [R5, #0x34] \n"
 147 "    STR     R0, [R5, #0x38] \n"
 148 "    ADD     R0, R5, #0 \n"
 149 "    LDR     R0, [R0, #0x5C] \n"
 150 "    LDRH    R1, [R5, #6] \n"
 151 "    MOV     R2, #0x3E8 \n"
 152 "    MUL     R0, R2, R0 \n"
 153 "    CMP     R1, #0 \n"
 154 "    BNE     loc_FF963C80 \n"
 155 "loc_FF963C74:\n"
 156 "    MOV     R1, #0x3E8 \n"
 157 "    BL      sub_FFB52AC4 \n"    // 1.00b
 158 "    B       loc_FF963C8C \n"
 159 "loc_FF963C80:\n"
 160 "    CMP     R1, #3 \n"
 161 "    BNE     loc_FF963C74 \n"
 162 "    MOV     R0, #1 \n"
 163 "loc_FF963C8C:\n"
 164 "    LDR     R4, =0xAC47C \n"
 165 "    STR     R0, [R5, #0x48] \n"
 166 "    LDR     R0, [R4, #8] \n"
 167 "    MOV     R6, #2 \n"
 168 "    CMP     R0, #0 \n"
 169 "    BEQ     loc_FF963CF8 \n"
 170 "    LDR     R0, [R5, #0x58] \n"
 171 "    MOV     R1, #4 \n"
 172 "    CMP     R0, #0x18 \n"
 173 "    BEQ     loc_FF963DF0 \n"
 174 "    BGT     loc_FF963CD4 \n"
 175 "    CMP     R0, #0xA \n"
 176 "    CMPNE   R0, #0xF \n"
 177 "    STREQ   R6, [R4, #0x14] \n"
 178 "    BEQ     loc_FF963CF8 \n"
 179 "    CMP     R0, #0x14 \n"
 180 "    BNE     loc_FF963CEC \n"
 181 "    B       loc_FF963DF0 \n"
 182 "loc_FF963CD4:\n"
 183 "    CMP     R0, #0x1E \n"
 184 "    BEQ     loc_FF963DF0 \n"
 185 "    CMP     R0, #0x3C \n"
 186 "    MOVEQ   R0, #8 \n"
 187 "    STREQ   R0, [R4, #0x14] \n"
 188 "    BEQ     loc_FF963CF8 \n"
 189 "loc_FF963CEC:\n"
 190 "    LDR     R1, =0x777 \n"
 191 "    LDR     R0, =0xFF9630DC \n"
 192 "    BL      sub_FF81EC88 \n"
 193 "loc_FF963CF8:\n"
 194 "    LDR     R2, =0x6572 \n"
 195 "    LDR     R0, [R5, #0x94] \n"
 196 "    MOV     R3, #2 \n"
 197 "    MOV     R1, #0xAA \n"
 198 "    BL      sub_FF88A3C4 \n"
 199 "    LDR     R2, =0x6574 \n"
 200 "    LDR     R0, [R5, #0x94] \n"
 201 "    MOV     R3, #2 \n"
 202 "    MOV     R1, #0xA9 \n"
 203 "    BL      sub_FF88A3C4 \n"
 204 "    LDR     R2, =0x65C0 \n"
 205 "    LDR     R0, [R5, #0x94] \n"
 206 "    MOV     R3, #4 \n"
 207 "    MOV     R1, #0xA2 \n"
 208 "    BL      sub_FF88A3C4 \n"
 209 "    LDR     R2, =0x65C4 \n"
 210 "    LDR     R0, [R5, #0x94] \n"
 211 "    MOV     R3, #4 \n"
 212 "    MOV     R1, #0xA3 \n"
 213 "    BL      sub_FF88A3C4 \n"
 214 "    LDR     R2, =0x6648 \n"
 215 "    MOV     R1, #0 \n"
 216 "    MOV     R0, #0xD \n"
 217 "    BL      sub_FF884930 \n"
 218 "    LDR     R0, [R5, #0x4C] \n"
 219 "    LDR     R1, =0x6648 \n"
 220 "    CMP     R0, #2 \n"
 221 "    CMPNE   R0, #3 \n"
 222 "    LDREQ   R0, =0x42546000 \n"
 223 "    LDR     R3, =0xFF963C10 \n"
 224 "    STREQ   R0, [R1] \n"
 225 "    LDRNE   R0, [R1] \n"
 226 "    LDR     R1, [R1, #4] \n"
 227 "    STR     R3, [SP] \n"
 228 "    LDR     R3, =0xAC47C \n"
 229 "    SUB     R2, R3, #0x18 \n"
 230 "    BL      sub_FFAA66F0_my \n"   // --->
 231 "    LDR     R3, [R5, #0x94] \n"
 232 "    STR     R3, [SP] \n"
 233 "    LDR     R0, [R5, #0x90] \n"
 234 "    LDRD    R2, [R5, #0xD0] \n"
 235 "    BL      sub_FFAA6A64 \n"    // 1.00b
 236 "    LDR     R0, [R5, #0x64] \n"
 237 "    LDR     R7, =0xAC464 \n"
 238 "    LDR     R3, =0x65F8 \n"
 239 "    AND     R1, R0, #0xFF \n"
 240 "    LDR     R0, [R7] \n"
 241 "    SUB     R2, R3, #4 \n"
 242 "    BL      sub_FFAA51E4 \n"    // 1.00b
 243 "    LDR     R1, [R5, #0xC] \n"
 244 "    LDR     R0, =0xFFB8FE90 \n"   // 1.00b
 245 "    CMP     R1, #2 \n"
 246 "    LDR     R1, [R5, #0x4C] \n"
 247 "    ADD     R0, R0, R1, LSL #3 \n"
 248 "    LDR     R1, [R7, #0xC] \n"
 249 "    LDR     R0, [R0, R1, LSL #2] \n"
 250 "    BNE     loc_FF963DF8 \n"
 251 "    BL      sub_FFA63714 \n"
 252 "    LDR     R0, =0xFF963BC8 \n"
 253 "    MOV     R1, #0 \n"
 254 "    BL      sub_FFA63C28 \n"
 255 "    B       loc_FF963E08 \n"
 256 "loc_FF963DF0:\n"
 257 "    STR     R1, [R4, #0x14] \n"
 258 "    B       loc_FF963CF8 \n"
 259 "loc_FF963DF8:\n"
 260 "    BL      sub_FFA62264 \n"
 261 "    LDR     R0, =0xFF963BC8 \n"
 262 "    MOV     R1, #0 \n"
 263 "    BL      sub_FFA629A0 \n"
 264 "loc_FF963E08:\n"
 265 "    LDR     R0, [R4, #8] \n"
 266 "    CMP     R0, #0 \n"
 267 "    BEQ     loc_FF963E3C \n"
 268 "    ADD     R0, SP, #4 \n"
 269 "    BL      sub_FFAA7074 \n"     // 1.00b
 270 "    LDR     R1, [R4, #0xC] \n"
 271 "    LDR     R0, [SP, #4] \n"
 272 "    BL      sub_FF860970 \n"
 273 "    ADD     R0, SP, #4 \n"
 274 "    BL      sub_FFAA7074 \n"    // 1.00b
 275 "    LDR     R1, [R4, #0xC] \n"
 276 "    LDR     R0, [SP, #4] \n"
 277 "    BL      sub_FF860970 \n"
 278 "loc_FF963E3C:\n"
 279 "    LDR     R0, =0xFF963B80 \n"
 280 "    STR     R6, [R5, #0x44]! \n"
 281 "    STR     R0, [R5, #0x70] \n"
 282 "    LDMFD   SP!, {R2-R8,PC} \n"
 283     );
 284 }
 285 
 286 void __attribute__((naked,noinline)) sub_FFAA66F0_my(  ) {
 287 asm volatile (
 288 "    STMFD   SP!, {R4-R12,LR} \n"
 289 "    MOV     R8, R0 \n"
 290 "    LDR     R0, [R2, #0x10] \n"
 291 "    MOV     R10, R1 \n"
 292 "    CMP     R0, #0 \n"
 293 "    LDR     R9, [SP, #0x28] \n"
 294 "    LDREQ   R1, =0x32A \n"
 295 "    LDREQ   R0, =0xFFAA5CE8 \n"     // 1.00b
 296 "    MOV     R5, #0 \n"
 297 "    MOV     R4, R2 \n"
 298 "    MOV     R7, R3 \n"
 299 "    MOV     R11, R5 \n"
 300 "    BLEQ    sub_FF81EC88 \n"
 301 "    LDR     R6, =0xB5D8 \n"
 302 "    LDR     R0, [R4] \n"
 303 "    LDR     R1, =0x7530 \n"
 304 "    STR     R0, [R6, #0xA0] \n"
 305 "    LDR     R0, [R4, #4] \n"
 306 "    MOV     R2, #0x1E \n"
 307 "    STR     R0, [R6, #0xA4] \n"
 308 "    LDR     R0, [R4, #0x10] \n"
 309 "    STR     R0, [R6, #0xB0] \n"
 310 "    LDR     R0, [R4, #8] \n"            // get shooting resolution ?
 311 "    CMP     R0, #8 \n"                 // check if in miniature mode
 312 "    LDREQ   R11, =0x1770 \n"
 313 "    BEQ     loc_FFAA679C \n"
 314 "    BGT     loc_FFAA6784 \n"
 315 
 316 "    CMP     R0, #0 \n"                 // comes through here if not in miniature mode
 317 "    MOVEQ   R11, R1 \n"
 318 "    BEQ     loc_FFAA679C \n"          // jumps if 640 or 320 resolution
 319 
 320 "    CMP     R0, #1 \n"                // 1280 mode starts here
 321 "    LDREQ   R11, =0x5DC0 \n"
 322 "    MOVEQ   R0, #0x18 \n"
 323 "    STREQ   R0, [R6, #0xA8] \n"
 324 "    STREQ   R11, [R6, #0xFC] \n"
 325 "    BEQ     loc_FFAA67B4 \n"           // jumps in 1280 mode
 326 "    B       loc_FFAA67A8 \n"           // error trap otherwise
 327 
 328 "loc_FFAA6784:\n"                      // miniature mode comes here - only two resolutions allowed now (1280 or 640)
 329 "    CMP     R0, #9 \n"
 330 "    LDREQ   R11, =0xBB8 \n"
 331 "    BEQ     loc_FFAA679C \n"
 332 "    CMP     R0, #0xA \n"
 333 "    BNE     loc_FFAA67A8 \n"           // jump on error
 334 "    LDR     R11, =0x5DC \n"
 335 
 336 "loc_FFAA679C:\n"                       // 640 or 320 resolution
 337 "    STR     R1, [R6, #0xFC] \n"
 338 "    STR     R2, [R6, #0xA8] \n"
 339 "    B       loc_FFAA67B4 \n"
 340 
 341 "loc_FFAA67A8:\n"
 342 "    LDR     R1, =0x35B \n"
 343 "    LDR     R0, =0xFFAA5CE8 \n"
 344 "    BL      sub_FF81EC88 \n"
 345 
 346 "loc_FFAA67B4:\n"
 347 "    LDR     R0, [R6, #0xA8] \n"
 348 //"    LDR     R1, =0xE0F \n"          // set a 1 hour time limit default ( 3599+1 = 3600 or 1 hour)
 349 "    LDR     R1, =0x383C \n"           //** patched = 4 hours
 350 "    MOV     R0, R0, LSR #1 \n"
 351 "    STR     R0, [R6, #0xAC] \n"
 352 "    LDR     R0, [R7] \n"
 353 "    STR     R0, [R6, #0xB4] \n"
 354 "    LDRH    R0, [R7, #0x10] \n"
 355 "    STR     R0, [R6, #0xB8] \n"
 356 "    LDR     R0, [R7, #4] \n"
 357 "    STRH    R0, [R6, #2] \n"
 358 "    LDR     R0, [R7, #8] \n"
 359 "    STRH    R0, [R6, #4] \n"
 360 "    LDR     R0, [R7, #0x14] \n"
 361 "    STR     R0, [R6, #0xBC] \n"
 362 "    STR     R9, [R6, #0xF8] \n"
 363 "    LDR     R0, [R6, #0xA0] \n"
 364 "    CMP     R0, #0x140 \n"            // ( = 320)
 365 "    MOVEQ   R0, #0x20000 \n"
 366 "    MOVEQ   R5, #1 \n"
 367 "    STREQ   R0, [R6, #0x80] \n"
 368 "    BEQ     loc_FFAA6900 \n"          // 320 jumps out here
 369 "    CMP     R0, #0x280 \n"             // ( = 640)
 370 "    BEQ     loc_FFAA68F4 \n"          // 640 jumps out here -->b
 371 "    CMP     R0, #0x500 \n"             // ( = 1280)
 372 "    LDREQ   R0, =0x11DA50 \n"
 373 "    MOVEQ   R5, #4 \n"
 374 "    STREQ   R0, [R6, #0x80] \n"
 375 //"    LDREQ   R0, =0x257 \n"          // = 599   ( + 1 = 600 or 10 minutes in seconds )
 376 "    LDREQ   R0, =7199 \n"             //** patched = 2 hours
 377 "    STREQ   R0, [R6, #0x4C] \n"
 378 "    BEQ     loc_FFAA6838 \n"          // 1280 jumps out here -->
 379 
 380 "    LDR     R1, =0x383 \n"
 381 "    LDR     R0, =0xFFAA5CE8 \n"
 382 "    BL      sub_FF81EC88 \n"         // error trap
 383 
 384 "loc_FFAA6838:\n"                      // 1280 comes here
 385 "    LDR     R9, [R6, #0x4C] \n"
 386 "    LDR     R1, =0x138D \n"
 387 "    MUL     R0, R9, R11 \n"
 388 "    BL      sub_FFB52AC4 \n"          // 1.00b
 389 "    ADD     R0, R0, #1 \n"
 390 "    ADD     R0, R0, R0, LSL #2 \n"
 391 "    STR     R0, [R6, #0x48] \n"
 392 "    LDR     R7, [R7, #0xC] \n"
 393 "    LDR     R1, [R4, #0xC] \n"
 394 "    MOV     R2, R7, LSR #1 \n"
 395 "    STR     R7, [R6, #0x68] \n"
 396 "    STR     R2, [R6, #0x6C] \n"
 397 "    ADD     R2, R8, #3 \n"
 398 "    BIC     R2, R2, #3 \n"
 399 "    MOV     R0, R0, LSL #2 \n"
 400 "    STR     R2, [R6, #0xC4] \n"
 401 "    ADD     R2, R2, R0 \n"
 402 "    STR     R2, [R6, #0xC8] \n"
 403 "    LDRH    R3, [R6, #4] \n"
 404 "    CMP     R1, #0 \n"
 405 "    MOVNE   R1, #1 \n"
 406 "    CMP     R3, #0 \n"
 407 "    ADD     R12, R8, R10 \n"
 408 "    ADD     R0, R0, R2 \n"
 409 "    BEQ     loc_FFAA6968 \n"
 410 "    STR     R0, [R6, #0xCC] \n"
 411 "    ADD     R0, R0, R9, LSL #3 \n"
 412 "    ADD     R0, R0, #0x1F \n"
 413 "    BIC     R0, R0, #0x1F \n"
 414 "    STR     R0, [R6, #0xD0] \n"
 415 "    LDR     R2, [R6, #0x80] \n"
 416 "    LDR     R9, =0xFA880 \n"
 417 "    ADD     R3, R0, R2 \n"
 418 "    SUB     R0, R12, R3 \n"
 419 "    RSB     R2, R7, #0 \n"
 420 "    ADD     R0, R0, R2, LSL #1 \n"
 421 "    MOV     R0, R0, LSR #0xF \n"
 422 "    MOV     R0, R0, LSL #0xF \n"
 423 "    STR     R3, [R6, #0xD4] \n"
 424 "    ADD     R8, R3, R0 \n"
 425 "    STR     R0, [R6, #0xE0] \n"
 426 "    STR     R8, [R6, #0xD8] \n"
 427 "    LDR     R11, =0xB728 \n"
 428 "    MOV     R2, #0 \n"
 429 "    ADD     R10, R9, #0x10 \n"
 430 "    STR     R8, [R6, #0xDC] \n"
 431 "    B       loc_FFAA6908 \n"
 432 
 433 "loc_FFAA68F4:\n"                       // 320 comes here
 434 "    LDR     R0, =0x7A760 \n"
 435 "    MOV     R5, #2 \n"
 436 "    STR     R0, [R6, #0x80] \n"
 437 
 438 "loc_FFAA6900:\n"                       // 640 comes here
 439 "    STR     R1, [R6, #0x4C] \n"
 440 "    B       loc_FFAA6838 \n"
 441 
 442 "loc_FFAA6908:\n"
 443 "    MLA     R0, R2, R7, R8 \n"
 444 "    ADD     R12, R9, R2, LSL #3 \n"
 445 "    ADD     R0, R0, #3 \n"
 446 "    BIC     R0, R0, #3 \n"
 447 "    STR     R0, [R11, R2, LSL #2] \n"
 448 "    MOV     R0, #0 \n"
 449 "    ADD     R6, R10, R2, LSL #3 \n"
 450 "loc_FFAA6924:\n"
 451 "    STR     R3, [R12, R0, LSL #2] \n"
 452 "    STR     R3, [R6, R0, LSL #2] \n"
 453 "    ADD     R0, R0, #1 \n"
 454 "    CMP     R0, #2 \n"
 455 "    BLT     loc_FFAA6924 \n"
 456 "    ADD     R2, R2, #1 \n"
 457 "    CMP     R2, #2 \n"
 458 "    BLT     loc_FFAA6908 \n"
 459 "    LDRH    R3, [R4, #0x14] \n"
 460 "    LDR     R2, [R4, #8] \n"
 461 "    MOV     R0, R5 \n"
 462 "    BL      sub_FF8CE114 \n"
 463 "    LDR     R1, =0xB5D8 \n"
 464 "    LDR     R2, [R1, #0x68] \n"
 465 "    ADD     R0, R0, R2 \n"
 466 "    STR     R0, [R1, #0x60] \n"
 467 "    LDMFD   SP!, {R4-R12,PC} \n"
 468 "loc_FFAA6968:\n"
 469 "    ADD     R0, R0, #0x1F \n"
 470 "    BIC     R0, R0, #0x1F \n"
 471 "    STR     R0, [R6, #0xD0] \n"
 472 "    LDR     R2, [R6, #0x80] \n"
 473 "    ADD     R0, R0, R2 \n"
 474 "    SUB     R2, R12, R0 \n"
 475 "    MOV     R2, R2, LSR #0xF \n"
 476 "    MOV     R2, R2, LSL #0xF \n"
 477 "    STR     R0, [R6, #0xD4] \n"
 478 "    ADD     R0, R0, R2 \n"
 479 "    STR     R2, [R6, #0xE0] \n"
 480 "    STR     R0, [R6, #0xD8] \n"
 481 "    LDRH    R3, [R4, #0x14] \n"
 482 "    LDR     R2, [R4, #8] \n"
 483 "    MOV     R0, R5 \n"
 484 "    BL      sub_FF8CE114 \n"
 485 "    STR     R0, [R6, #0x60] \n"
 486 "    LDMFD   SP!, {R4-R12,PC} \n"
 487     );
 488 }
 489 
 490 void __attribute__((naked,noinline)) sub_FF963FE4_my(  ) {
 491     // FF963FE4
 492 asm volatile (
 493       "    STMFD   SP!, {R4-R11,LR} \n"
 494       "    SUB     SP, SP, #0x64 \n"
 495       "    MOV     R9, #0 \n"
 496       "    LDR     R6, =0x6570 \n"
 497       "    STR     R9, [SP, #0x54] \n"
 498       "    STR     R9, [SP, #0x4C] \n"
 499       "    STR     R9, [R6, #0xB8] \n"
 500       "    STR     R9, [R6, #0xBC] \n"
 501       "    STR     R9, [R6, #0xC0] \n"
 502       "    MOV     R4, R0 \n"
 503       "    STR     R9, [R6, #0xC4] \n"
 504       "    LDR     R0, [R6, #0x44] \n"
 505       "    MOV     R11, #4 \n"
 506       "    CMP     R0, #3 \n"
 507       "    STREQ   R11, [R6, #0x44] \n"
 508       "    LDR     R0, [R6, #0xB4] \n"
 509       "    MOV     R8, R9 \n"
 510       "    MOV     R5, #1 \n"
 511       "    MOV     R7, R9 \n"
 512       "    BLX     R0 \n"
 513       "    LDR     R0, [R6, #0x44] \n"
 514       "    CMP     R0, #6 \n"
 515       "    BEQ     loc_FF964054 \n"
 516       "    LDR     R1, [R6, #0xC] \n"
 517       "    CMP     R1, #2 \n"
 518       "    BNE     loc_FF96407C \n"
 519       "    CMP     R0, #5 \n"
 520       "    BEQ     loc_FF96408C \n"
 521 "loc_FF964054:\n"
 522       "    LDR     R2, =0xFF963EB8 \n"
 523       "    LDR     R1, =0xFF963F1C \n"
 524       "    LDR     R0, =0xFF963F80 \n"
 525       "    MOV     R7, #1 \n"
 526       "    ADD     R3, SP, #0x34 \n"
 527       "    BL      sub_FF853624 \n"
 528       "    LDR     R0, [R6, #0x44] \n"
 529       "    CMP     R0, #4 \n"
 530       "    MOVNE   R5, #0 \n"
 531       "    B       loc_FF96409C \n"
 532 "loc_FF96407C:\n"
 533       "    CMP     R0, #4 \n"
 534       "    BEQ     loc_FF96409C \n"
 535       "    CMP     R1, #2 \n"
 536       "    BNE     loc_FF964094 \n"
 537 "loc_FF96408C:\n"
 538       "    MOV     R0, #0 \n"
 539       "    BL      sub_FF853630 \n"
 540 "loc_FF964094:\n"
 541       "    ADD     SP, SP, #0x64 \n"
 542       "    LDMFD   SP!, {R4-R11,PC} \n"
 543 "loc_FF96409C:\n"
 544       "    LDRH    R0, [R6, #6] \n"
 545       "    CMP     R0, #3 \n"
 546       "    BNE     loc_FF9640BC \n"
 547       "    LDR     R0, [R6, #0x6C] \n"
 548       "    LDR     R1, [R6, #0xC8] \n"
 549       "    BL      sub_FFB52AC4 \n"         // 1.00b
 550       "    CMP     R1, #0 \n"
 551       "    MOVNE   R5, #0 \n"
 552 "loc_FF9640BC:\n"
 553       "    LDR     R0, [R6, #0x44] \n"
 554       "    CMP     R0, #6 \n"
 555       "    CMPNE   R0, #1 \n"
 556       "    CMPNE   R0, #3 \n"
 557       "    BNE     loc_FF964100 \n"
 558       "    CMP     R7, #1 \n"
 559       "    CMPEQ   R5, #0 \n"
 560       "    BNE     loc_FF964100 \n"
 561       "    BL      sub_FF853628 \n"
 562       "    LDR     R0, [R6, #0x18] \n"
 563       "    MOV     R1, #0x3E8 \n"
 564       "    BL      sub_FF839BC0 \n"
 565       "    CMP     R0, #9 \n"
 566       "    BNE     loc_FF964538 \n"
 567       "    MOV     R0, #0x90000 \n"
 568       "    BL      sub_FF88F0F4 \n"
 569       "    B       loc_FF964094 \n"
 570 "loc_FF964100:\n"
 571       "    CMP     R5, #1 \n"
 572       "    MOV     R10, #1 \n"
 573       "    BNE     loc_FF964128 \n"
 574       "    ADD     R3, SP, #0x4C \n"
 575       "    ADD     R2, SP, #0x50 \n"
 576       "    ADD     R1, SP, #0x54 \n"
 577       "    ADD     R0, SP, #0x58 \n"
 578       "    BL      sub_FFAA72B8 \n"     // 1.00b
 579       "    MOVS    R9, R0 \n"
 580       "    BNE     loc_FF964144 \n"
 581 "loc_FF964128:\n"
 582       "    LDR     R0, [R6, #0x34] \n"
 583       "    CMP     R0, #1 \n"
 584       "    BNE     loc_FF9642B4 \n"
 585       "    LDR     R0, [R6, #0x6C] \n"
 586       "    LDR     R1, [R6, #0x48] \n"
 587       "    CMP     R0, R1 \n"
 588       "    BCC     loc_FF9642B4 \n"
 589 "loc_FF964144:\n"
 590       "    CMP     R9, #0x80000001 \n"
 591       "    STREQ   R11, [R6, #0x70] \n"
 592       "    BEQ     loc_FF96417C \n"
 593       "    CMP     R9, #0x80000003 \n"
 594       "    STREQ   R10, [R6, #0x70] \n"
 595       "    BEQ     loc_FF96417C \n"
 596       "    CMP     R9, #0x80000005 \n"
 597       "    MOVEQ   R0, #2 \n"
 598       "    BEQ     loc_FF964178 \n"
 599       "    CMP     R9, #0x80000007 \n"
 600       "    STRNE   R8, [R6, #0x70] \n"
 601       "    BNE     loc_FF96417C \n"
 602       "    MOV     R0, #3 \n"
 603 "loc_FF964178:\n"
 604       "    STR     R0, [R6, #0x70] \n"
 605 "loc_FF96417C:\n"
 606       "    LDR     R0, [R6, #0xC] \n"
 607       "    CMP     R0, #2 \n"
 608       "    BNE     loc_FF9641E4 \n"
 609       "    LDR     R0, =0xFF963EAC \n"
 610       "    MOV     R1, #0 \n"
 611       "    BL      sub_FFA63C28 \n"
 612       "    LDR     R2, [R6, #0x64] \n"
 613       "    ADD     R3, SP, #0x5C \n"
 614       "    STRD    R2, [SP, #0x28] \n"
 615       "    MOV     R2, #0x18 \n"
 616       "    ADD     R1, SP, #0x34 \n"
 617       "    ADD     R0, SP, #0x10 \n"
 618       "    BL      sub_FFB527A8 \n"     // 1.00b
 619       "    LDR     R1, [R6, #0x84] \n"
 620       "    LDR     R2, [R6, #0x88] \n"
 621       "    MVN     R3, #1 \n"
 622       "    ADD     R0, SP, #0x60 \n"
 623       "    STMEA   SP, {R0-R3} \n"
 624       "    MOV     R3, #0 \n"
 625       "    LDR     R0, =0xAC494 \n"
 626       "    MOV     R2, R3 \n"
 627       "    MOV     R1, #0x40 \n"
 628       "    BL      sub_FFA63B74 \n"
 629       "    B       loc_FF96423C \n"
 630 "loc_FF9641DC:\n"
 631       "    MOV     R1, #1 \n"
 632       "    B       loc_FF9644C8 \n"
 633 "loc_FF9641E4:\n"
 634       "    BL      sub_FF964C10 \n"
 635       "    LDR     R2, [R6, #0x64] \n"
 636       "    ADD     R3, SP, #0x5C \n"
 637       "    MVN     R1, #1 \n"
 638       "    MOV     R0, #0 \n"
 639       "    ADD     R5, SP, #0x1C \n"
 640       "    STMIA   R5, {R0-R3} \n"
 641       "    LDR     R3, [R4, #0x1C] \n"
 642       "    LDR     R1, [R6, #0x84] \n"
 643       "    LDR     R2, [R6, #0x88] \n"
 644       "    ADD     R0, SP, #0x60 \n"
 645       "    ADD     R4, SP, #0xC \n"
 646       "    STMIA   R4, {R0-R3} \n"
 647       "    MOV     R3, #0 \n"
 648       "    MOV     R1, #0x40 \n"
 649       "    STMEA   SP, {R1,R3} \n"
 650       "    MOV     R2, #0 \n"
 651       "    STR     R3, [SP, #8] \n"
 652       "    LDR     R3, =0xAC494 \n"
 653       "    MOV     R1, R2 \n"
 654       "    MOV     R0, R2 \n"
 655       "    BL      sub_FFA62880 \n"
 656 "loc_FF96423C:\n"
 657       "    LDR     R0, [R6, #0x18] \n"
 658       "    LDR     R1, [R6, #0x60] \n"
 659       "    BL      sub_FF839BC0 \n"
 660       "    CMP     R0, #9 \n"
 661       "    BEQ     loc_FF9641DC \n"
 662       "    LDR     R0, [SP, #0x5C] \n"
 663       "    CMP     R0, #0 \n"
 664       "    BEQ     loc_FF964264 \n"
 665 "loc_FF96425C:\n"
 666       "    MOV     R1, #1 \n"
 667       "    B       loc_FF9644E0 \n"
 668 "loc_FF964264:\n"
 669       "    LDR     R0, [R6, #0xC] \n"
 670       "    MOV     R4, #5 \n"
 671       "    CMP     R0, #2 \n"
 672       "    MOV     R0, #1 \n"
 673       "    BNE     loc_FF9642A0 \n"
 674       "    BL      sub_FFA63BE8 \n"
 675       "    BL      sub_FFA63C10 \n"
 676       "    MOV     R0, #0 \n"
 677       "    BL      sub_FF853630 \n"
 678       "    BL      sub_FF853640 \n"
 679       "    STR     R4, [R6, #0x44] \n"
 680       "    BL      sub_FF964C10 \n"
 681       "    BL      sub_FF85369C \n"
 682       "    STR     R10, [R6, #0x44] \n"
 683       "    B       loc_FF9642AC \n"
 684 "loc_FF9642A0:\n"
 685       "    BL      sub_FFA62930 \n"
 686       "    BL      sub_FFA6297C \n"
 687       "    STR     R4, [R6, #0x44] \n"
 688 "loc_FF9642AC:\n"
 689       "    STR     R8, [R6, #0x34] \n"
 690       "    B       loc_FF964094 \n"
 691 "loc_FF9642B4:\n"
 692       "    CMP     R5, #1 \n"
 693       "    BNE     loc_FF964530 \n"
 694       "    STR     R10, [R6, #0x38] \n"
 695       "    LDR     R0, [R6, #0x6C] \n"
 696       "    LDR     R11, [R4, #0xC] \n"
 697       "    CMP     R0, #0 \n"
 698       "    LDRNE   R9, [SP, #0x58] \n"
 699       "    LDRNE   R10, [SP, #0x54] \n"
 700       "    BNE     loc_FF964400 \n"
 701       "    LDR     R0, [R6, #0xC] \n"
 702       "    CMP     R0, #2 \n"
 703       "    BNE     loc_FF964358 \n"
 704       "    LDR     R0, =0xFF963EAC \n"
 705       "    MOV     R1, #0 \n"
 706       "    BL      sub_FFA63C28 \n"
 707       "    LDR     R2, [R6, #0x64] \n"
 708       "    ADD     R3, SP, #0x5C \n"
 709       "    STRD    R2, [SP, #0x28] \n"
 710       "    MOV     R2, #0x18 \n"
 711       "    ADD     R1, SP, #0x34 \n"
 712       "    ADD     R0, SP, #0x10 \n"
 713       "    BL      sub_FFB527A8 \n"         // 1.00b
 714       "    LDR     R1, [R6, #0x84] \n"
 715       "    LDR     R2, [R6, #0x88] \n"
 716       "    MVN     R3, #0 \n"
 717       "    ADD     R0, SP, #0x60 \n"
 718       "    STMEA   SP, {R0-R3} \n"
 719       "    LDR     R0, [SP, #0x58] \n"
 720       "    LDR     R1, [SP, #0x54] \n"
 721       "    LDR     R2, [SP, #0x50] \n"
 722       "    LDR     R3, [SP, #0x4C] \n"
 723       "    BL      sub_FFA63B74 \n"
 724       "    LDR     R0, [R6, #0x18] \n"
 725       "    LDR     R1, [R6, #0x60] \n"
 726       "    BL      sub_FF839BC0 \n"
 727       "    CMP     R0, #9 \n"
 728       "    BEQ     loc_FF9641DC \n"
 729       "    LDR     R0, =0xFF963BC8 \n"
 730       "    MOV     R1, #0 \n"
 731       "    BL      sub_FFA63C28 \n"
 732       "    B       loc_FF9643C0 \n"
 733 "loc_FF964358:\n"
 734       "    LDR     R0, [R4, #0x20] \n"
 735       "    LDR     R2, [R6, #0x64] \n"
 736       "    ADD     R3, SP, #0x5C \n"
 737       "    MVN     R1, #0 \n"
 738       "    ADD     R9, SP, #0x1C \n"
 739       "    STMIA   R9, {R0-R3} \n"
 740       "    LDR     R3, [R4, #0x1C] \n"
 741       "    LDR     R1, [R6, #0x84] \n"
 742       "    LDR     R2, [R6, #0x88] \n"
 743       "    ADD     R0, SP, #0x60 \n"
 744       "    ADD     R9, SP, #0xC \n"
 745       "    STMIA   R9, {R0-R3} \n"
 746       "    LDR     R1, [SP, #0x50] \n"
 747       "    LDR     R2, [SP, #0x54] \n"
 748       "    LDR     R3, [SP, #0x4C] \n"
 749       "    STMFA   SP, {R1,R3} \n"
 750       "    STR     R2, [SP] \n"
 751       "    LDMIB   R4, {R0,R1} \n"
 752       "    LDR     R3, [SP, #0x58] \n"
 753       "    MOV     R2, R11 \n"
 754       "    BL      sub_FFA62880 \n"
 755       "    LDR     R0, [R6, #0x18] \n"
 756       "    LDR     R1, [R6, #0x60] \n"
 757       "    BL      sub_FF839BC0 \n"
 758       "    CMP     R0, #9 \n"
 759       "    BEQ     loc_FF9641DC \n"
 760 "loc_FF9643C0:\n"
 761       "    LDR     R0, [SP, #0x5C] \n"
 762       "    CMP     R0, #0 \n"
 763       "    BNE     loc_FF96425C \n"
 764       "    LDR     R0, [R6, #0xC] \n"
 765       "    CMP     R0, #2 \n"
 766       "    MOV     R0, #1 \n"
 767       "    BNE     loc_FF9643E4 \n"
 768       "    BL      sub_FFA63BE8 \n"
 769       "    B       loc_FF9643E8 \n"
 770 "loc_FF9643E4:\n"
 771       "    BL      sub_FFA62930 \n"
 772 "loc_FF9643E8:\n"
 773       "    STR     R8, [R6, #0xC4] \n"
 774       "    LDR     R0, [SP, #0x60] \n"
 775       "    LDR     R1, [SP, #0x58] \n"
 776       "    ADD     R9, R1, R0 \n"
 777       "    LDR     R1, [SP, #0x54] \n"
 778       "    SUB     R10, R1, R0 \n"
 779 "loc_FF964400:\n"
 780       "    LDR     R0, [R6, #0xC] \n"
 781       "    LDR     R2, [R6, #0x64] \n"
 782       "    CMP     R0, #2 \n"
 783       "    ADD     R3, SP, #0x5C \n"
 784       "    BNE     loc_FF964458 \n"
 785       "    STRD    R2, [SP, #0x28] \n"
 786       "    MOV     R2, #0x18 \n"
 787       "    ADD     R1, SP, #0x34 \n"
 788       "    ADD     R0, SP, #0x10 \n"
 789       "    BL      sub_FFB527A8 \n"         // 1.00b
 790       "    LDR     R1, [R6, #0x84] \n"
 791       "    LDR     R2, [R6, #0x88] \n"
 792       "    LDR     R3, [R6, #0x68] \n"
 793       "    ADD     R0, SP, #0x60 \n"
 794       "    STMEA   SP, {R0-R3} \n"
 795       "    LDR     R2, [SP, #0x50] \n"
 796       "    LDR     R3, [SP, #0x4C] \n"
 797       "    MOV     R1, R10 \n"
 798       "    MOV     R0, R9 \n"
 799       "    BL      sub_FFA63B74 \n"
 800       "    BL      sub_FF853628 \n"
 801       "    B       loc_FF9644B0 \n"
 802 "loc_FF964458:\n"
 803       "    LDR     R1, [R6, #0x68] \n"
 804       "    LDR     R0, [R4, #0x20] \n"
 805       "    STR     R1, [SP, #0x20] \n"
 806       "    STR     R0, [SP, #0x1C] \n"
 807       "    STR     R2, [SP, #0x24] \n"
 808       "    STR     R3, [SP, #0x28] \n"
 809       "    LDR     R3, [R4, #0x1C] \n"
 810       "    LDR     R1, [R6, #0x84] \n"
 811       "    LDR     R2, [R6, #0x88] \n"
 812       "    ADD     R0, SP, #0x60 \n"
 813       "    STR     R2, [SP, #0x14] \n"
 814       "    LDR     R2, [SP, #0x50] \n"
 815       "    STR     R1, [SP, #0x10] \n"
 816       "    STR     R3, [SP, #0x18] \n"
 817       "    LDR     R3, [SP, #0x4C] \n"
 818       "    STR     R0, [SP, #0xC] \n"
 819       "    STMFA   SP, {R2,R3} \n"
 820       "    STR     R10, [SP] \n"
 821       "    LDMIB   R4, {R0,R1} \n"
 822       "    MOV     R3, R9 \n"
 823       "    MOV     R2, R11 \n"
 824       "    BL      sub_FFA62880 \n"
 825 "loc_FF9644B0:\n"
 826       "    LDR     R0, [R6, #0x18] \n"
 827       "    LDR     R1, [R6, #0x60] \n"
 828       "    BL      sub_FF839BC0 \n"
 829       "    CMP     R0, #9 \n"
 830       "    BNE     loc_FF9644D0 \n"
 831       "    MOV     R1, #0 \n"
 832 "loc_FF9644C8:\n"
 833       "    MOV     R0, #0x90000 \n"
 834       "    B       loc_FF9644E4 \n"
 835 "loc_FF9644D0:\n"
 836       "    LDR     R0, [SP, #0x5C] \n"
 837       "    CMP     R0, #0 \n"
 838       "    BEQ     loc_FF9644EC \n"
 839       "    MOV     R1, #0 \n"
 840 "loc_FF9644E0:\n"
 841       "    MOV     R0, #0xA0000 \n"
 842 "loc_FF9644E4:\n"
 843       "    BL      sub_FF963E4C \n"
 844       "    B       loc_FF964094 \n"
 845 "loc_FF9644EC:\n"
 846       "    LDR     R0, [R6, #0xC] \n"
 847       "    CMP     R0, #2 \n"
 848       "    MOV     R0, #0 \n"
 849       "    BNE     loc_FF964504 \n"
 850       "    BL      sub_FFA63BE8 \n"
 851       "    B       loc_FF964508 \n"
 852 "loc_FF964504:\n"
 853       "    BL      sub_FFA62930 \n"
 854 "loc_FF964508:\n"
 855       "    LDR     R0, [SP, #0x58] \n"
 856       "    LDR     R1, [SP, #0x60] \n"
 857       "    BL      sub_FFAA74DC \n"         // 1.00b
 858       "    LDR     R0, [R6, #0x68] \n"
 859       "    LDR     R3, =0x65F8 \n"          // <- 65F8
 860       "    ADD     R1, R0, #1 \n"
 861       "    STR     R1, [R6, #0x68] \n"
 862       "    LDR     R0, [SP, #0x60] \n"
 863       "    SUB     R2, R3, #4 \n"           // <-  -4
 864       "    BL      sub_FFAA52B0 \n"         // 1.00b
 865       "    LDR     R0, =0x65F4 \n"          // added, 65F8 - 4
 866       "    BL      set_quality \n"          // added
 867 "loc_FF964530:\n"
 868       "    CMP     R7, #1 \n"
 869       "    BNE     loc_FF964544 \n"
 870 "loc_FF964538:\n"
 871       "    BL      sub_FF85362C \n"
 872       "    MOV     R0, #1 \n"
 873       "    BL      sub_FF853630 \n"
 874 "loc_FF964544:\n"
 875       "    CMP     R5, #1 \n"
 876       "    LDRNEH  R0, [R6, #6] \n"
 877       "    CMPNE   R0, #3 \n"
 878       "    BNE     loc_FF964094 \n"
 879       "    LDR     R0, [R6, #0x6C] \n"
 880       "    ADD     R0, R0, #1 \n"
 881       "    STR     R0, [R6, #0x6C] \n"
 882       "    LDRH    R1, [R6, #6] \n"
 883       "    CMP     R1, #3 \n"
 884       "    LDRNE   R1, [R6, #0x54] \n"
 885       "    LDREQ   R1, =0x3E9 \n"
 886       "    MUL     R0, R1, R0 \n"
 887       "    LDRNE   R1, [R6, #0x50] \n"
 888       "    LDREQ   R1, =0x1770 \n"
 889       "    BL      sub_FFB52AC4 \n"         // 1.00b
 890       "    MOV     R4, R0 \n"
 891       "    BL      sub_FFAA7864 \n"         // 1.00b
 892       "    LDR     R0, [R6, #0x8C] \n"
 893       "    CMP     R0, R4 \n"
 894       "    BNE     loc_FF9645A0 \n"
 895       "    LDR     R0, [R6, #0x3C] \n"
 896       "    CMP     R0, #1 \n"
 897       "    BNE     loc_FF9645B4 \n"
 898 "loc_FF9645A0:\n"
 899       "    LDR     R1, [R6, #0x98] \n"
 900       "    MOV     R0, R4 \n"
 901       "    BLX     R1 \n"
 902       "    STR     R4, [R6, #0x8C] \n"
 903       "    STR     R8, [R6, #0x3C] \n"
 904 "loc_FF9645B4:\n"
 905       "    STR     R8, [R6, #0x38] \n"
 906       "    B       loc_FF964094 \n"
 907     );
 908 }

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