root/platform/a2500/sub/100a/capt_seq.c

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

DEFINITIONS

This source file includes following definitions.
  1. capt_seq_task
  2. sub_FF977D78_my
  3. sub_FF977BF4_my
  4. sub_FFA97130_my
  5. sub_FFA96E98_my
  6. exp_drv_task
  7. sub_FF8B85E8_my
  8. sub_FF8A6324_my

   1 /*
   2  * capt_seq.c - auto-generated by CHDK code_gen.
   3  */
   4 #include "lolevel.h"
   5 #include "platform.h"
   6 #include "core.h"
   7 
   8 //From a2500 100a, by comparison to ixus140
   9 static long *nrflag = (long*)(0xC144+0x4); // @ 0xffa96f28, 4th arg to  sub_ff9f5f68
  10 #define PAUSE_FOR_FILE_COUNTER 200  // Enable delay in capt_seq_hook_raw_here to ensure file counter is updated
  11 
  12 #include "../../../generic/capt_seq.c"
  13 
  14 /*************************************************************/
  15 //** capt_seq_task @ 0xFF87F1F4 - 0xFF87F484, length=165
  16 void __attribute__((naked,noinline)) capt_seq_task() {
  17 asm volatile (
  18 "    STMFD   SP!, {R3-R7,LR} \n"
  19 "    LDR     R5, =0x38C18 \n"
  20 "    LDR     R7, =0x3228 \n"
  21 "    MOV     R6, #0 \n"
  22 
  23 "loc_FF87F204:\n"
  24 "    LDR     R0, [R7, #4] \n"
  25 "    MOV     R2, #0 \n"
  26 "    MOV     R1, SP \n"
  27 "    BL      sub_003F7418 /*_ReceiveMessageQueue*/ \n"
  28 "    TST     R0, #1 \n"
  29 "    BEQ     loc_FF87F230 \n"
  30 "    LDR     R1, =0x475 \n"
  31 "    LDR     R0, =0xFF87ECCC /*'SsShootTask.c'*/ \n"
  32 "    BL      _DebugAssert \n"
  33 "    BL      _ExitTask \n"
  34 "    LDMFD   SP!, {R3-R7,PC} \n"
  35 
  36 "loc_FF87F230:\n"
  37 "    LDR     R0, [SP] \n"
  38 "    LDR     R1, [R0] \n"
  39 "    CMP     R1, #0x22 \n"
  40 "    ADDCC   PC, PC, R1, LSL#2 \n"
  41 "    B       loc_FF87F44C \n"
  42 "    B       loc_FF87F2CC \n"
  43 "    B       loc_FF87F2E4 \n"
  44 "    B       loc_FF87F2F0 \n"
  45 "    B       loc_FF87F304 \n"
  46 "    B       loc_FF87F2FC \n"
  47 "    B       loc_FF87F310 \n"
  48 "    B       loc_FF87F318 \n"
  49 "    B       loc_FF87F320 \n"
  50 "    B       loc_FF87F32C \n"
  51 "    B       loc_FF87F358 \n"
  52 "    B       loc_FF87F338 \n"
  53 "    B       loc_FF87F344 \n"
  54 "    B       loc_FF87F34C \n"
  55 "    B       loc_FF87F360 \n"
  56 "    B       loc_FF87F368 \n"
  57 "    B       loc_FF87F370 \n"
  58 "    B       loc_FF87F378 \n"
  59 "    B       loc_FF87F380 \n"
  60 "    B       loc_FF87F38C \n"
  61 "    B       loc_FF87F394 \n"
  62 "    B       loc_FF87F39C \n"
  63 "    B       loc_FF87F3A4 \n"
  64 "    B       loc_FF87F3AC \n"
  65 "    B       loc_FF87F3B4 \n"
  66 "    B       loc_FF87F3BC \n"
  67 "    B       loc_FF87F3C4 \n"
  68 "    B       loc_FF87F3CC \n"
  69 "    B       loc_FF87F3D4 \n"
  70 "    B       loc_FF87F3E0 \n"
  71 "    B       loc_FF87F3E8 \n"
  72 "    B       loc_FF87F3F4 \n"
  73 "    B       loc_FF87F42C \n"
  74 "    B       loc_FF87F438 \n"
  75 "    B       loc_FF87F458 \n"
  76 
  77 "loc_FF87F2CC:\n"
  78 // "    BL      shooting_expo_iso_override\n"      // To do: Check if this is needed.
  79 "    BL      sub_FF87F9B0 \n"
  80 "    BL      shooting_expo_param_override\n"    // added
  81 "    BL      sub_FF87CEA8 \n"
  82 //To do: Check if this is needed.
  83 //"    MOV     R0, #0\n"                          // added
  84 //"    STR     R0, [R5,#0x28]\n"                  // added, fixes overrides behavior at short shutter press (from S95)
  85 "    LDR     R0, [R5, #0x28] \n"
  86 "    CMP     R0, #0 \n"
  87 "    BLNE    sub_FF977D78_my \n"  // --> Patched. Old value = 0xFF977D78.
  88 "    B       loc_FF87F458 \n"
  89 
  90 "loc_FF87F2E4:\n"
  91 "    LDR     R0, [R0, #0x10] \n"
  92 "    BL      sub_FF977BF4_my \n"  // --> Patched. Old value = 0xFF977BF4.
  93 "    B       loc_FF87F458 \n"
  94 
  95 "loc_FF87F2F0:\n"
  96 "    MOV     R0, #1 \n"
  97 "    BL      sub_FF87FCD8 \n"
  98 "    B       loc_FF87F458 \n"
  99 
 100 "loc_FF87F2FC:\n"
 101 "    BL      sub_FF87F624 \n"
 102 "    B       loc_FF87F308 \n"
 103 
 104 "loc_FF87F304:\n"
 105 "    BL      sub_FF87F98C \n"
 106 
 107 "loc_FF87F308:\n"
 108 "    STR     R6, [R5, #0x28] \n"
 109 "    B       loc_FF87F458 \n"
 110 
 111 "loc_FF87F310:\n"
 112 "    BL      sub_FF87F994 \n"
 113 "    B       loc_FF87F458 \n"
 114 
 115 "loc_FF87F318:\n"
 116 "    BL      sub_FF87FBB0 \n"
 117 "    B       loc_FF87F330 \n"
 118 
 119 "loc_FF87F320:\n"
 120 "    LDR     R0, [R0, #0x10] \n"
 121 "    BL      sub_FF977E08 \n"
 122 "    B       loc_FF87F458 \n"
 123 
 124 "loc_FF87F32C:\n"
 125 "    BL      sub_FF87FC44 \n"
 126 
 127 "loc_FF87F330:\n"
 128 "    BL      sub_FF87CEA8 \n"
 129 "    B       loc_FF87F458 \n"
 130 
 131 "loc_FF87F338:\n"
 132 "    LDR     R0, [R5, #0x58] \n"
 133 "    BL      sub_FF880220 \n"
 134 "    B       loc_FF87F458 \n"
 135 
 136 "loc_FF87F344:\n"
 137 "    BL      sub_FF88062C \n"
 138 "    B       loc_FF87F458 \n"
 139 
 140 "loc_FF87F34C:\n"
 141 "    MOV     R0, #0 \n"
 142 "    BL      sub_FF880690 \n"
 143 "    B       loc_FF87F458 \n"
 144 
 145 "loc_FF87F358:\n"
 146 "    BL      sub_FF87F98C \n"
 147 "    B       loc_FF87F458 \n"
 148 
 149 "loc_FF87F360:\n"
 150 "    BL      sub_FF97710C \n"
 151 "    B       loc_FF87F458 \n"
 152 
 153 "loc_FF87F368:\n"
 154 "    BL      sub_FF977344 \n"
 155 "    B       loc_FF87F458 \n"
 156 
 157 "loc_FF87F370:\n"
 158 "    BL      sub_FF977400 \n"
 159 "    B       loc_FF87F458 \n"
 160 
 161 "loc_FF87F378:\n"
 162 "    BL      sub_FF9774D4 \n"
 163 "    B       loc_FF87F458 \n"
 164 
 165 "loc_FF87F380:\n"
 166 "    MOV     R0, #0 \n"
 167 "    BL      sub_FF977734 \n"
 168 "    B       loc_FF87F458 \n"
 169 
 170 "loc_FF87F38C:\n"
 171 "    BL      sub_FF977898 \n"
 172 "    B       loc_FF87F458 \n"
 173 
 174 "loc_FF87F394:\n"
 175 "    BL      sub_FF97792C \n"
 176 "    B       loc_FF87F458 \n"
 177 
 178 "loc_FF87F39C:\n"
 179 "    BL      sub_FF9779D4 \n"
 180 "    B       loc_FF87F458 \n"
 181 
 182 "loc_FF87F3A4:\n"
 183 "    BL      sub_FF87FE38 \n"
 184 "    B       loc_FF87F458 \n"
 185 
 186 "loc_FF87F3AC:\n"
 187 "    BL      sub_FF87FEA4 \n"
 188 "    B       loc_FF87F458 \n"
 189 
 190 "loc_FF87F3B4:\n"
 191 "    BL      sub_FF9775A4 \n"
 192 "    B       loc_FF87F458 \n"
 193 
 194 "loc_FF87F3BC:\n"
 195 "    BL      sub_FF9775E4 \n"
 196 "    B       loc_FF87F458 \n"
 197 
 198 "loc_FF87F3C4:\n"
 199 "    BL      sub_FF882AA0 \n"
 200 "    B       loc_FF87F458 \n"
 201 
 202 "loc_FF87F3CC:\n"
 203 "    BL      sub_FF882B8C \n"
 204 "    B       loc_FF87F458 \n"
 205 
 206 "loc_FF87F3D4:\n"
 207 "    LDR     R0, [R0, #0xC] \n"
 208 "    BL      sub_FF977AE4 \n"
 209 "    B       loc_FF87F458 \n"
 210 
 211 "loc_FF87F3E0:\n"
 212 "    BL      sub_FF977B54 \n"
 213 "    B       loc_FF87F458 \n"
 214 
 215 "loc_FF87F3E8:\n"
 216 "    BL      sub_FF882D18 \n"
 217 "    BL      sub_FF882BE4 \n"
 218 "    B       loc_FF87F458 \n"
 219 
 220 "loc_FF87F3F4:\n"
 221 "    MOV     R0, #1 \n"
 222 "    BL      sub_FF97857C \n"
 223 "    MOV     R0, #1 \n"
 224 "    BL      sub_FF9786A4 \n"
 225 "    LDR     R0, =0x38D18 \n"
 226 "    LDRH    R0, [R0, #0x8C] \n"
 227 "    CMP     R0, #4 \n"
 228 "    LDRNEH  R0, [R5] \n"
 229 "    SUBNE   R1, R0, #0x8000 \n"
 230 "    SUBNES  R1, R1, #0x230 \n"
 231 "    BNE     loc_FF87F458 \n"
 232 "    BL      sub_FF882B8C \n"
 233 "    BL      sub_FF883064 \n"
 234 "    B       loc_FF87F458 \n"
 235 
 236 "loc_FF87F42C:\n"
 237 "    MOV     R2, #0 \n"
 238 "    MOV     R1, #0xD \n"
 239 "    B       loc_FF87F440 \n"
 240 
 241 "loc_FF87F438:\n"
 242 "    MOV     R2, #0 \n"
 243 "    MOV     R1, #0xC \n"
 244 
 245 "loc_FF87F440:\n"
 246 "    MOV     R0, #0 \n"
 247 "    BL      sub_FF87D714 \n"
 248 "    B       loc_FF87F458 \n"
 249 
 250 "loc_FF87F44C:\n"
 251 "    LDR     R1, =0x5DA \n"
 252 "    LDR     R0, =0xFF87ECCC /*'SsShootTask.c'*/ \n"
 253 "    BL      _DebugAssert \n"
 254 
 255 "loc_FF87F458:\n"
 256 "    LDR     R0, [SP] \n"
 257 "    LDR     R1, [R0, #4] \n"
 258 "    LDR     R0, [R7] \n"
 259 "    BL      sub_003FAD9C /*_SetEventFlag*/ \n"
 260 "    LDR     R4, [SP] \n"
 261 "    LDR     R0, [R4, #8] \n"
 262 "    CMP     R0, #0 \n"
 263 "    LDREQ   R1, =0x116 \n"
 264 "    LDREQ   R0, =0xFF87ECCC /*'SsShootTask.c'*/ \n"
 265 "    BLEQ    _DebugAssert \n"
 266 "    STR     R6, [R4, #8] \n"
 267 "    B       loc_FF87F204 \n"
 268 );
 269 }
 270 
 271 /*************************************************************/
 272 //** sub_FF977D78_my @ 0xFF977D78 - 0xFF977E04, length=36
 273 void __attribute__((naked,noinline)) sub_FF977D78_my() {
 274 asm volatile (
 275 "    STMFD   SP!, {R4-R6,LR} \n"
 276 "    BL      sub_FF87E8E0 \n"
 277 "    MOV     R4, R0 \n"
 278 "    MOV     R0, #0xC \n"
 279 "    BL      sub_FF884648 \n"
 280 "    LDR     R6, =0x6FB4 \n"
 281 "    TST     R0, #1 \n"
 282 "    MOV     R5, #1 \n"
 283 "    BNE     loc_FF977E00 \n"
 284 "    BL      sub_FF87F99C \n"
 285 "    BL      sub_FF8809A4 \n"
 286 "    MOV     R1, R4 \n"
 287 "    BL      sub_FF8809FC \n"
 288 "    LDR     R0, =0x10E \n"
 289 "    MOV     R2, #4 \n"
 290 "    ADD     R1, R4, #0x30 \n"
 291 "    BL      _SetPropertyCase \n"
 292 "    MOV     R2, #4 \n"
 293 "    ADD     R1, R4, #0x34 \n"
 294 "    MOV     R0, #0x2C \n"
 295 "    BL      _SetPropertyCase \n"
 296 "    MOV     R2, #4 \n"
 297 "    ADD     R1, R4, #8 \n"
 298 "    MOV     R0, #0x3F \n"
 299 "    BL      _SetPropertyCase \n"
 300 "    BL      sub_FF978864 \n"
 301 "    MVN     R1, #0x1000 \n"
 302 "    BL      sub_003FADD0 /*_ClearEventFlag*/ \n"
 303 "    MOV     R0, R4 \n"
 304 "    BL      sub_FFA96E10 \n"
 305 "    MOV     R0, R4 \n"
 306 "    BL      sub_FFA97130_my \n"  // --> Patched. Old value = 0xFFA97130.
 307 "    TST     R0, #1 \n"
 308 "    LDMEQFD SP!, {R4-R6,PC} \n"
 309 
 310 "loc_FF977E00:\n"
 311 "    STR     R5, [R6] \n"
 312 "    LDMFD   SP!, {R4-R6,PC} \n"
 313 );
 314 }
 315 
 316 /*************************************************************/
 317 //** sub_FF977BF4_my @ 0xFF977BF4 - 0xFF977D74, length=97
 318 void __attribute__((naked,noinline)) sub_FF977BF4_my() {
 319 asm volatile (
 320 "    STMFD   SP!, {R2-R6,LR} \n"
 321 "    MOV     R5, R0 \n"
 322 "    LDR     R0, =0x6FB4 \n"
 323 "    LDR     R6, =0x38C18 \n"
 324 "    LDR     R0, [R0] \n"
 325 "    MOV     R4, #0 \n"
 326 "    CMP     R0, #0 \n"
 327 "    MOVNE   R4, #0x1D \n"
 328 "    BNE     loc_FF977D58 \n"
 329 "    LDR     R0, [R6, #0x28] \n"
 330 "    CMP     R0, #0 \n"
 331 "    BNE     loc_FF977D58 \n"
 332 "    BL      sub_FF8809A4 \n"
 333 "    MOV     R1, R5 \n"
 334 "    BL      sub_FF8809FC \n"
 335 "    LDR     R0, =0x10E \n"
 336 "    MOV     R2, #4 \n"
 337 "    ADD     R1, R5, #0x30 \n"
 338 "    BL      _SetPropertyCase \n"
 339 "    MOV     R2, #4 \n"
 340 "    ADD     R1, R5, #0x34 \n"
 341 "    MOV     R0, #0x2C \n"
 342 "    BL      _SetPropertyCase \n"
 343 "    MOV     R0, #0xC \n"
 344 "    BL      sub_FF884648 \n"
 345 "    TST     R0, #1 \n"
 346 "    BEQ     loc_FF977C68 \n"
 347 "    BL      sub_FF87D584 \n"
 348 "    MOV     R4, #1 \n"
 349 
 350 "loc_FF977C68:\n"
 351 "    TST     R4, #1 \n"
 352 "    BNE     loc_FF977D58 \n"
 353 "    BL      sub_FF978864 \n"
 354 "    MVN     R1, #0x1000 \n"
 355 "    BL      sub_003FADD0 /*_ClearEventFlag*/ \n"
 356 "    MOV     R0, R5 \n"
 357 "    BL      sub_FFA96610 \n"
 358 "    TST     R0, #1 \n"
 359 "    MOV     R4, R0 \n"
 360 "    BNE     loc_FF977D58 \n"
 361 "    BL      sub_FF87F99C \n"
 362 "    MOV     R0, R5 \n"
 363 "    BL      sub_FFA96E10 \n"
 364 "    LDR     R0, [R6, #0xA0] \n"
 365 "    CMP     R0, #0 \n"
 366 "    BEQ     loc_FF977D38 \n"
 367 // To do: Check this, there are other paths:
 368 // FF977D38 -> FFA97130
 369 "    LDR     R0, =0x38D18 \n"
 370 "    LDRH    R0, [R0, #0x8A] \n"
 371 "    CMP     R0, #3 \n"
 372 "    LDRNE   R0, [R5, #8] \n"
 373 "    CMPNE   R0, #1 \n"
 374 "    BLS     loc_FF977CDC \n"
 375 "    BL      sub_FF978864 \n"
 376 "    MOV     R3, #0xDB \n"
 377 "    STR     R3, [SP] \n"
 378 "    LDR     R2, =0x3A98 \n"
 379 "    LDR     R3, =0xFF977E9C /*'SsCaptureCtrl.c'*/ \n"
 380 "    MOV     R1, #0x1000 \n"
 381 "    BL      sub_FF8848B0 \n"
 382 
 383 "loc_FF977CDC:\n"
 384 "    MOV     R2, #4 \n"
 385 "    ADD     R1, SP, #4 \n"
 386 "    MOV     R0, #0x180 \n"
 387 "    BL      _GetPropertyCase \n"
 388 "    TST     R0, #1 \n"
 389 "    MOVNE   R1, #0xDF \n"
 390 "    LDRNE   R0, =0xFF977E9C /*'SsCaptureCtrl.c'*/ \n"
 391 "    BLNE    _DebugAssert \n"
 392 "    LDR     R0, [SP, #4] \n"
 393 "    CMP     R0, #0 \n"
 394 "    BNE     loc_FF977D18 \n"
 395 "    BL      sub_FF978864 \n"
 396 "    MOV     R1, #0x1000 \n"
 397 "    BL      sub_003FAD9C /*_SetEventFlag*/ \n"
 398 "    B       loc_FF977D38 \n"
 399 
 400 "loc_FF977D18:\n"
 401 "    BL      sub_FF978864 \n"
 402 "    MOV     R1, #0x1000 \n"
 403 "    BL      sub_003FADD0 /*_ClearEventFlag*/ \n"
 404 "    LDR     R2, =0xFF977BE0 \n"
 405 "    LDR     R0, [SP, #4] \n"
 406 "    MOV     R3, #0x1000 \n"
 407 "    MOV     R1, R2 \n"
 408 "    BL      sub_FF831E48 /*_SetTimerAfter*/ \n"
 409 
 410 "loc_FF977D38:\n"
 411 "    LDR     R0, [R6, #0xAC] \n"
 412 "    CMP     R0, #0 \n"
 413 "    MOV     R0, R5 \n"
 414 "    BEQ     loc_FF977D50 \n"
 415 "    BL      sub_FFA974E0 \n"
 416 "    B       loc_FF977D54 \n"
 417 
 418 "loc_FF977D50:\n"
 419 "    BL      sub_FFA97130_my \n"  // --> Patched. Old value = 0xFFA97130.
 420 
 421 "loc_FF977D54:\n"
 422 "    BL      capt_seq_hook_raw_here \n"         // added
 423 "    MOV     R4, R0 \n"
 424 
 425 "loc_FF977D58:\n"
 426 "    MOV     R2, R5 \n"
 427 "    MOV     R1, #1 \n"
 428 "    MOV     R0, R4 \n"
 429 "    BL      sub_FF87D714 \n"
 430 "    TST     R4, #1 \n"
 431 "    MOVEQ   R0, #0 \n"
 432 "    STREQ   R0, [R6, #0x28] \n"
 433 "    LDMFD   SP!, {R2-R6,PC} \n"
 434 );
 435 }
 436 
 437 /*************************************************************/
 438 //** sub_FFA97130_my @ 0xFFA97130 - 0xFFA971B0, length=33
 439 void __attribute__((naked,noinline)) sub_FFA97130_my() {
 440 asm volatile (
 441 "    STMFD   SP!, {R2-R8,LR} \n"
 442 "    MOV     R4, R0 \n"
 443 "    BL      sub_FFA96D8C \n"
 444 "    BL      sub_FF978358 \n"
 445 "    LDR     R8, =0x38C18 \n"
 446 "    LDR     R0, [R8, #0x180] \n"
 447 "    ADD     R5, R8, #0x100 \n"
 448 "    CMP     R0, #2 \n"
 449 "    BNE     loc_FFA9716C \n"
 450 "    LDRH    R0, [R5, #0x8A] \n"
 451 "    CMP     R0, #3 \n"
 452 "    LDRNE   R0, [R4, #8] \n"
 453 "    CMPNE   R0, #1 \n"
 454 "    MOVLS   R0, #4 \n"
 455 "    BLLS    sub_FF8FC348 \n"
 456 
 457 "loc_FFA9716C:\n"
 458 "    LDR     R0, =0x12F \n"
 459 "    MOV     R2, #4 \n"
 460 "    ADD     R1, SP, #4 \n"
 461 "    BL      _GetPropertyCase \n"
 462 "    TST     R0, #1 \n"
 463 "    MOVNE   R1, #0x170 \n"
 464 "    LDRNE   R0, =0xFFA97394 /*'SsStandardCaptureSeq.c'*/ \n"
 465 "    BLNE    _DebugAssert \n"
 466 "    LDR     R0, [SP, #4] \n"
 467 "    AND     R0, R0, #0xFF00 \n"
 468 "    CMP     R0, #0x600 \n"
 469 "    LDRNE   R0, =0xFFA96AC4 \n"
 470 "    LDREQ   R0, =0xFFA970F8 \n"
 471 "    MOVNE   R1, R4 \n"
 472 "    MOVEQ   R1, #0 \n"
 473 "    BL      sub_FF8AEB60 \n"
 474 "    MOV     R0, R4 \n"
 475 "    BL      sub_FFA96E98_my \n"  // --> Patched. Old value = 0xFFA96E98.
 476 "    LDR     PC, =0xFFA971B4 \n"  // Continue in firmware
 477 );
 478 }
 479 
 480 /*************************************************************/
 481 //** sub_FFA96E98_my @ 0xFFA96E98 - 0xFFA96F30, length=39
 482 void __attribute__((naked,noinline)) sub_FFA96E98_my() {
 483 asm volatile (
 484 "    STMFD   SP!, {R1-R7,LR} \n"
 485 "    LDR     R5, =0x38DE8 \n"
 486 "    LDR     R6, =0x38C18 \n"
 487 "    MOV     R4, R0 \n"
 488 "    LDR     R3, [R5] \n"
 489 "    LDRSH   R2, [R5, #0xC] \n"
 490 "    LDRSH   R1, [R5, #0xE] \n"
 491 "    LDR     R0, [R6, #0x88] \n"
 492 "    BL      sub_FF935D20 \n"
 493 "    MOV     R2, #2 \n"
 494 "    ADD     R1, SP, #8 \n"
 495 "    MOV     R0, #0xFA \n"
 496 "    BL      _GetPropertyCase \n"
 497 "    TST     R0, #1 \n"
 498 "    LDRNE   R1, =0x2E5 \n"
 499 "    LDRNE   R0, =0xFFA96D64 /*'SsCaptureCommon.c'*/ \n"
 500 "    BLNE    _DebugAssert \n"
 501 "    LDRSH   R0, [R5, #0xC] \n"
 502 "    LDRSH   R1, [SP, #8] \n"
 503 "    BL      sub_FF8F988C \n"
 504 "    LDR     R0, [R6, #0xE4] \n"
 505 "    CMP     R0, #0 \n"
 506 "    LDRNE   R0, =0x38D18 \n"
 507 "    LDRNEH  R0, [R0, #0x8A] \n"
 508 "    CMPNE   R0, #3 \n"
 509 "    LDRNE   R0, [R4, #8] \n"
 510 "    CMPNE   R0, #1 \n"
 511 "    BHI     loc_FFA96F30 \n"
 512 "    BL      _GetCCDTemperature \n"
 513 "    LDR     R3, =0xC144 \n"
 514 "    STRH    R0, [R4, #0xA0] \n"
 515 "    SUB     R2, R3, #4 \n"
 516 "    STRD    R2, [SP] \n"
 517 "    MOV     R1, R0 \n"
 518 "    LDRSH   R2, [R5, #0xC] \n"
 519 "    LDRH    R0, [R6, #0x5E] \n"
 520 "    ADD     R3, R3, #4 \n"
 521 "    BL      sub_FF9F5F68 \n"
 522 
 523 "loc_FFA96F30:\n"
 524 "    BL      wait_until_remote_button_is_released\n" // added
 525 "    BL      capt_seq_hook_set_nr\n"                 // added
 526 "    LDRH    R0, [R4, #0xA0] \n"
 527 "    LDR     PC, =0xFFA96F34 \n"  // Continue in firmware
 528 );
 529 }
 530 
 531 /*************************************************************/
 532 //** exp_drv_task @ 0xFF8BBB70 - 0xFF8BC200, length=421
 533 void __attribute__((naked,noinline)) exp_drv_task() {
 534 asm volatile (
 535 "    STMFD   SP!, {R4-R9,LR} \n"
 536 "    SUB     SP, SP, #0x2C \n"
 537 "    LDR     R6, =0x4110 \n"
 538 "    LDR     R7, =0xBB8 \n"
 539 "    LDR     R4, =0x57FE8 \n"
 540 "    MOV     R0, #0 \n"
 541 "    ADD     R5, SP, #0x1C \n"
 542 "    STR     R0, [SP, #0xC] \n"
 543 
 544 "loc_FF8BBB90:\n"
 545 "    LDR     R0, [R6, #0x20] \n"
 546 "    MOV     R2, #0 \n"
 547 "    ADD     R1, SP, #0x28 \n"
 548 "    BL      sub_003F7418 /*_ReceiveMessageQueue*/ \n"
 549 "    LDR     R0, [SP, #0xC] \n"
 550 "    CMP     R0, #1 \n"
 551 "    BNE     loc_FF8BBBDC \n"
 552 "    LDR     R0, [SP, #0x28] \n"
 553 "    LDR     R0, [R0] \n"
 554 "    CMP     R0, #0x14 \n"
 555 "    CMPNE   R0, #0x15 \n"
 556 "    CMPNE   R0, #0x16 \n"
 557 "    CMPNE   R0, #0x17 \n"
 558 "    BEQ     loc_FF8BBD3C \n"
 559 "    CMP     R0, #0x2A \n"
 560 "    BEQ     loc_FF8BBCC4 \n"
 561 "    ADD     R1, SP, #0xC \n"
 562 "    MOV     R0, #0 \n"
 563 "    BL      sub_FF8BBB20 \n"
 564 
 565 "loc_FF8BBBDC:\n"
 566 "    LDR     R0, [SP, #0x28] \n"
 567 "    LDR     R1, [R0] \n"
 568 "    CMP     R1, #0x30 \n"
 569 "    BNE     loc_FF8BBC08 \n"
 570 "    BL      sub_FF8BD0A4 \n"
 571 "    LDR     R0, [R6, #0x1C] \n"
 572 "    MOV     R1, #1 \n"
 573 "    BL      sub_003FAD9C /*_SetEventFlag*/ \n"
 574 "    BL      _ExitTask \n"
 575 "    ADD     SP, SP, #0x2C \n"
 576 "    LDMFD   SP!, {R4-R9,PC} \n"
 577 
 578 "loc_FF8BBC08:\n"
 579 "    CMP     R1, #0x2F \n"
 580 "    BNE     loc_FF8BBC24 \n"
 581 "    LDR     R2, [R0, #0x8C]! \n"
 582 "    LDR     R1, [R0, #4] \n"
 583 "    MOV     R0, R1 \n"
 584 "    BLX     R2 \n"
 585 "    B       loc_FF8BC1F8 \n"
 586 
 587 "loc_FF8BBC24:\n"
 588 "    CMP     R1, #0x28 \n"
 589 "    BNE     loc_FF8BBC74 \n"
 590 "    LDR     R0, [R6, #0x1C] \n"
 591 "    MOV     R1, #0x80 \n"
 592 "    BL      sub_003FADD0 /*_ClearEventFlag*/ \n"
 593 "    LDR     R0, =0xFF8B71E4 \n"
 594 "    MOV     R1, #0x80 \n"
 595 "    BL      sub_FF96D71C \n"
 596 "    LDR     R0, [R6, #0x1C] \n"
 597 "    MOV     R2, R7 \n"
 598 "    MOV     R1, #0x80 \n"
 599 "    BL      sub_003FACDC /*_WaitForAllEventFlag*/ \n"
 600 "    TST     R0, #1 \n"
 601 "    LDRNE   R1, =0x1664 \n"
 602 "    BNE     loc_FF8BBD30 \n"
 603 
 604 "loc_FF8BBC60:\n"
 605 "    LDR     R1, [SP, #0x28] \n"
 606 "    LDR     R0, [R1, #0x90] \n"
 607 "    LDR     R1, [R1, #0x8C] \n"
 608 "    BLX     R1 \n"
 609 "    B       loc_FF8BC1F8 \n"
 610 
 611 "loc_FF8BBC74:\n"
 612 "    CMP     R1, #0x29 \n"
 613 "    BNE     loc_FF8BBCBC \n"
 614 "    ADD     R1, SP, #0xC \n"
 615 "    BL      sub_FF8BBB20 \n"
 616 "    LDR     R0, [R6, #0x1C] \n"
 617 "    MOV     R1, #0x100 \n"
 618 "    BL      sub_003FADD0 /*_ClearEventFlag*/ \n"
 619 "    LDR     R0, =0xFF8B71F4 \n"
 620 "    MOV     R1, #0x100 \n"
 621 "    BL      sub_FF96D8BC \n"
 622 "    LDR     R0, [R6, #0x1C] \n"
 623 "    MOV     R2, R7 \n"
 624 "    MOV     R1, #0x100 \n"
 625 "    BL      sub_003FACDC /*_WaitForAllEventFlag*/ \n"
 626 "    TST     R0, #1 \n"
 627 "    BEQ     loc_FF8BBC60 \n"
 628 "    LDR     R1, =0x166E \n"
 629 "    B       loc_FF8BBD30 \n"
 630 
 631 "loc_FF8BBCBC:\n"
 632 "    CMP     R1, #0x2A \n"
 633 "    BNE     loc_FF8BBCD4 \n"
 634 
 635 "loc_FF8BBCC4:\n"
 636 "    LDR     R0, [SP, #0x28] \n"
 637 "    ADD     R1, SP, #0xC \n"
 638 "    BL      sub_FF8BBB20 \n"
 639 "    B       loc_FF8BBC60 \n"
 640 
 641 "loc_FF8BBCD4:\n"
 642 "    CMP     R1, #0x2D \n"
 643 "    BNE     loc_FF8BBCEC \n"
 644 "    BL      sub_FF8A65D8 \n"
 645 "    BL      sub_FF8A7394 \n"
 646 "    BL      sub_FF8A6EA8 \n"
 647 "    B       loc_FF8BBC60 \n"
 648 
 649 "loc_FF8BBCEC:\n"
 650 "    CMP     R1, #0x2E \n"
 651 "    BNE     loc_FF8BBD3C \n"
 652 "    LDR     R0, [R6, #0x1C] \n"
 653 "    MOV     R1, #4 \n"
 654 "    BL      sub_003FADD0 /*_ClearEventFlag*/ \n"
 655 "    LDR     R1, =0xFF8B7214 \n"
 656 "    LDR     R0, =0xFFFFF400 \n"
 657 "    MOV     R2, #4 \n"
 658 "    BL      sub_FF8A6028 \n"
 659 "    BL      sub_FF8A62B8 \n"
 660 "    LDR     R0, [R6, #0x1C] \n"
 661 "    MOV     R2, R7 \n"
 662 "    MOV     R1, #4 \n"
 663 "    BL      sub_003FABF8 /*_WaitForAnyEventFlag*/ \n"
 664 "    TST     R0, #1 \n"
 665 "    BEQ     loc_FF8BBC60 \n"
 666 "    LDR     R1, =0x1696 \n"
 667 
 668 "loc_FF8BBD30:\n"
 669 "    LDR     R0, =0xFF8B7978 /*'ExpDrv.c'*/ \n"
 670 "    BL      _DebugAssert \n"
 671 "    B       loc_FF8BBC60 \n"
 672 
 673 "loc_FF8BBD3C:\n"
 674 "    LDR     R0, [SP, #0x28] \n"
 675 "    MOV     R8, #1 \n"
 676 "    LDR     R1, [R0] \n"
 677 "    CMP     R1, #0x12 \n"
 678 "    CMPNE   R1, #0x13 \n"
 679 "    BNE     loc_FF8BBDA4 \n"
 680 "    LDR     R1, [R0, #0x7C] \n"
 681 "    ADD     R1, R1, R1, LSL#1 \n"
 682 "    ADD     R1, R0, R1, LSL#2 \n"
 683 "    SUB     R1, R1, #8 \n"
 684 "    LDMIA   R1, {R2,R3,R9} \n"
 685 "    STMIA   R5, {R2,R3,R9} \n"
 686 "    BL      sub_FF8B9F30 \n"
 687 "    LDR     R0, [SP, #0x28] \n"
 688 "    LDR     R1, [R0, #0x7C] \n"
 689 "    LDR     R3, [R0, #0x8C] \n"
 690 "    LDR     R2, [R0, #0x90] \n"
 691 "    ADD     R0, R0, #4 \n"
 692 "    BLX     R3 \n"
 693 "    LDR     R0, [SP, #0x28] \n"
 694 "    BL      sub_FF8BD4C4 \n"
 695 "    LDR     R0, [SP, #0x28] \n"
 696 "    LDR     R1, [R0, #0x7C] \n"
 697 "    LDR     R2, [R0, #0x98] \n"
 698 "    LDR     R3, [R0, #0x94] \n"
 699 "    B       loc_FF8BC0BC \n"
 700 
 701 "loc_FF8BBDA4:\n"
 702 "    CMP     R1, #0x14 \n"
 703 "    CMPNE   R1, #0x15 \n"
 704 "    CMPNE   R1, #0x16 \n"
 705 "    CMPNE   R1, #0x17 \n"
 706 "    BNE     loc_FF8BBE5C \n"
 707 "    ADD     R3, SP, #0xC \n"
 708 "    MOV     R2, SP \n"
 709 "    ADD     R1, SP, #0x1C \n"
 710 "    BL      sub_FF8BA194 \n"
 711 "    CMP     R0, #1 \n"
 712 "    MOV     R9, R0 \n"
 713 "    CMPNE   R9, #5 \n"
 714 "    BNE     loc_FF8BBDF8 \n"
 715 "    LDR     R0, [SP, #0x28] \n"
 716 "    MOV     R2, R9 \n"
 717 "    LDR     R1, [R0, #0x7C]! \n"
 718 "    LDR     R12, [R0, #0x10]! \n"
 719 "    LDR     R3, [R0, #4] \n"
 720 "    MOV     R0, SP \n"
 721 "    BLX     R12 \n"
 722 "    B       loc_FF8BBE30 \n"
 723 
 724 "loc_FF8BBDF8:\n"
 725 "    LDR     R0, [SP, #0x28] \n"
 726 "    CMP     R9, #2 \n"
 727 "    LDR     R3, [R0, #0x90] \n"
 728 "    CMPNE   R9, #6 \n"
 729 "    BNE     loc_FF8BBE44 \n"
 730 "    LDR     R12, [R0, #0x8C] \n"
 731 "    MOV     R2, R9 \n"
 732 "    MOV     R1, #1 \n"
 733 "    MOV     R0, SP \n"
 734 "    BLX     R12 \n"
 735 "    LDR     R0, [SP, #0x28] \n"
 736 "    MOV     R2, SP \n"
 737 "    ADD     R1, SP, #0x1C \n"
 738 "    BL      sub_FF8BB794 \n"
 739 
 740 "loc_FF8BBE30:\n"
 741 "    LDR     R0, [SP, #0x28] \n"
 742 "    LDR     R2, [SP, #0xC] \n"
 743 "    MOV     R1, R9 \n"
 744 "    BL      sub_FF8BBAC0 \n"
 745 "    B       loc_FF8BC0C4 \n"
 746 
 747 "loc_FF8BBE44:\n"
 748 "    LDR     R1, [R0, #0x7C] \n"
 749 "    LDR     R12, [R0, #0x8C] \n"
 750 "    MOV     R2, R9 \n"
 751 "    ADD     R0, R0, #4 \n"
 752 "    BLX     R12 \n"
 753 "    B       loc_FF8BC0C4 \n"
 754 
 755 "loc_FF8BBE5C:\n"
 756 "    CMP     R1, #0x24 \n"
 757 "    CMPNE   R1, #0x25 \n"
 758 "    BNE     loc_FF8BBEA8 \n"
 759 "    LDR     R1, [R0, #0x7C] \n"
 760 "    ADD     R1, R1, R1, LSL#1 \n"
 761 "    ADD     R1, R0, R1, LSL#2 \n"
 762 "    SUB     R1, R1, #8 \n"
 763 "    LDMIA   R1, {R2,R3,R9} \n"
 764 "    STMIA   R5, {R2,R3,R9} \n"
 765 "    BL      sub_FF8B8F04 \n"
 766 "    LDR     R0, [SP, #0x28] \n"
 767 "    LDR     R1, [R0, #0x7C] \n"
 768 "    LDR     R3, [R0, #0x8C] \n"
 769 "    LDR     R2, [R0, #0x90] \n"
 770 "    ADD     R0, R0, #4 \n"
 771 "    BLX     R3 \n"
 772 "    LDR     R0, [SP, #0x28] \n"
 773 "    BL      sub_FF8B9348 \n"
 774 "    B       loc_FF8BC0C4 \n"
 775 
 776 "loc_FF8BBEA8:\n"
 777 "    ADD     R1, R0, #4 \n"
 778 "    LDMIA   R1, {R2,R3,R9} \n"
 779 "    STMIA   R5, {R2,R3,R9} \n"
 780 "    LDR     R1, [R0] \n"
 781 "    CMP     R1, #0x28 \n"
 782 "    ADDCC   PC, PC, R1, LSL#2 \n"
 783 "    B       loc_FF8BC0AC \n"
 784 "    B       loc_FF8BBF64 \n"
 785 "    B       loc_FF8BBF64 \n"
 786 "    B       loc_FF8BBF6C \n"
 787 "    B       loc_FF8BBF74 \n"
 788 "    B       loc_FF8BBF74 \n"
 789 "    B       loc_FF8BBF74 \n"
 790 "    B       loc_FF8BBF64 \n"
 791 "    B       loc_FF8BBF6C \n"
 792 "    B       loc_FF8BBF74 \n"
 793 "    B       loc_FF8BBF74 \n"
 794 "    B       loc_FF8BBF8C \n"
 795 "    B       loc_FF8BBF8C \n"
 796 "    B       loc_FF8BC098 \n"
 797 "    B       loc_FF8BC0A0 \n"
 798 "    B       loc_FF8BC0A0 \n"
 799 "    B       loc_FF8BC0A0 \n"
 800 "    B       loc_FF8BC0A0 \n"
 801 "    B       loc_FF8BC0A8 \n"
 802 "    B       loc_FF8BC0AC \n"
 803 "    B       loc_FF8BC0AC \n"
 804 "    B       loc_FF8BC0AC \n"
 805 "    B       loc_FF8BC0AC \n"
 806 "    B       loc_FF8BC0AC \n"
 807 "    B       loc_FF8BC0AC \n"
 808 "    B       loc_FF8BBF7C \n"
 809 "    B       loc_FF8BBF84 \n"
 810 "    B       loc_FF8BBF84 \n"
 811 "    B       loc_FF8BBF84 \n"
 812 "    B       loc_FF8BBF98 \n"
 813 "    B       loc_FF8BBF98 \n"
 814 "    B       loc_FF8BBFA0 \n"
 815 "    B       loc_FF8BBFD8 \n"
 816 "    B       loc_FF8BC010 \n"
 817 "    B       loc_FF8BC048 \n"
 818 "    B       loc_FF8BC080 \n"
 819 "    B       loc_FF8BC080 \n"
 820 "    B       loc_FF8BC0AC \n"
 821 "    B       loc_FF8BC0AC \n"
 822 "    B       loc_FF8BC088 \n"
 823 "    B       loc_FF8BC090 \n"
 824 
 825 "loc_FF8BBF64:\n"
 826 "    BL      sub_FF8B77F8 \n"
 827 "    B       loc_FF8BC0AC \n"
 828 
 829 "loc_FF8BBF6C:\n"
 830 "    BL      sub_FF8B7AB4 \n"
 831 "    B       loc_FF8BC0AC \n"
 832 
 833 "loc_FF8BBF74:\n"
 834 "    BL      sub_FF8B7CE0 \n"
 835 "    B       loc_FF8BC0AC \n"
 836 
 837 "loc_FF8BBF7C:\n"
 838 "    BL      sub_FF8B800C \n"
 839 "    B       loc_FF8BC0AC \n"
 840 
 841 "loc_FF8BBF84:\n"
 842 "    BL      sub_FF8B8228 \n"
 843 "    B       loc_FF8BC0AC \n"
 844 
 845 "loc_FF8BBF8C:\n"
 846 "    BL      sub_FF8B85E8_my \n"  // --> Patched. Old value = 0xFF8B85E8.
 847 "    MOV     R8, #0 \n"
 848 "    B       loc_FF8BC0AC \n"
 849 
 850 "loc_FF8BBF98:\n"
 851 "    BL      sub_FF8B872C \n"
 852 "    B       loc_FF8BC0AC \n"
 853 
 854 "loc_FF8BBFA0:\n"
 855 "    LDRH    R1, [R0, #4] \n"
 856 "    STRH    R1, [SP, #0x1C] \n"
 857 "    LDRH    R1, [R4, #2] \n"
 858 "    STRH    R1, [SP, #0x1E] \n"
 859 "    LDRH    R1, [R4, #4] \n"
 860 "    STRH    R1, [SP, #0x20] \n"
 861 "    LDRH    R1, [R4, #6] \n"
 862 "    STRH    R1, [SP, #0x22] \n"
 863 "    LDRH    R1, [R0, #0xC] \n"
 864 "    STRH    R1, [SP, #0x24] \n"
 865 "    LDRH    R1, [R4, #0xA] \n"
 866 "    STRH    R1, [SP, #0x26] \n"
 867 "    BL      sub_FF8BD148 \n"
 868 "    B       loc_FF8BC0AC \n"
 869 
 870 "loc_FF8BBFD8:\n"
 871 "    LDRH    R1, [R0, #4] \n"
 872 "    STRH    R1, [SP, #0x1C] \n"
 873 "    LDRH    R1, [R4, #2] \n"
 874 "    STRH    R1, [SP, #0x1E] \n"
 875 "    LDRH    R1, [R4, #4] \n"
 876 "    STRH    R1, [SP, #0x20] \n"
 877 "    LDRH    R1, [R4, #6] \n"
 878 "    STRH    R1, [SP, #0x22] \n"
 879 "    LDRH    R1, [R4, #8] \n"
 880 "    STRH    R1, [SP, #0x24] \n"
 881 "    LDRH    R1, [R4, #0xA] \n"
 882 "    STRH    R1, [SP, #0x26] \n"
 883 "    BL      sub_FF8BD2C0 \n"
 884 "    B       loc_FF8BC0AC \n"
 885 
 886 "loc_FF8BC010:\n"
 887 "    LDRH    R1, [R4] \n"
 888 "    STRH    R1, [SP, #0x1C] \n"
 889 "    LDRH    R1, [R0, #6] \n"
 890 "    STRH    R1, [SP, #0x1E] \n"
 891 "    LDRH    R1, [R4, #4] \n"
 892 "    STRH    R1, [SP, #0x20] \n"
 893 "    LDRH    R1, [R4, #6] \n"
 894 "    STRH    R1, [SP, #0x22] \n"
 895 "    LDRH    R1, [R4, #8] \n"
 896 "    STRH    R1, [SP, #0x24] \n"
 897 "    LDRH    R1, [R4, #0xA] \n"
 898 "    STRH    R1, [SP, #0x26] \n"
 899 "    BL      sub_FF8BD378 \n"
 900 "    B       loc_FF8BC0AC \n"
 901 
 902 "loc_FF8BC048:\n"
 903 "    LDRH    R1, [R4] \n"
 904 "    STRH    R1, [SP, #0x1C] \n"
 905 "    LDRH    R1, [R4, #2] \n"
 906 "    STRH    R1, [SP, #0x1E] \n"
 907 "    LDRH    R1, [R4, #4] \n"
 908 "    STRH    R1, [SP, #0x20] \n"
 909 "    LDRH    R1, [R4, #6] \n"
 910 "    STRH    R1, [SP, #0x22] \n"
 911 "    LDRH    R1, [R0, #0xC] \n"
 912 "    STRH    R1, [SP, #0x24] \n"
 913 "    LDRH    R1, [R4, #0xA] \n"
 914 "    STRH    R1, [SP, #0x26] \n"
 915 "    BL      sub_FF8BD420 \n"
 916 "    B       loc_FF8BC0AC \n"
 917 
 918 "loc_FF8BC080:\n"
 919 "    BL      sub_FF8B8CB4 \n"
 920 "    B       loc_FF8BC0AC \n"
 921 
 922 "loc_FF8BC088:\n"
 923 "    BL      sub_FF8B944C \n"
 924 "    B       loc_FF8BC0AC \n"
 925 
 926 "loc_FF8BC090:\n"
 927 "    BL      sub_FF8B9734 \n"
 928 "    B       loc_FF8BC0AC \n"
 929 
 930 "loc_FF8BC098:\n"
 931 "    BL      sub_FF8B99F8 \n"
 932 "    B       loc_FF8BC0AC \n"
 933 
 934 "loc_FF8BC0A0:\n"
 935 "    BL      sub_FF8B9BB8 \n"
 936 "    B       loc_FF8BC0AC \n"
 937 
 938 "loc_FF8BC0A8:\n"
 939 "    BL      sub_FF8B9D24 \n"
 940 
 941 "loc_FF8BC0AC:\n"
 942 "    LDR     R0, [SP, #0x28] \n"
 943 "    LDR     R1, [R0, #0x7C] \n"
 944 "    LDR     R2, [R0, #0x90] \n"
 945 "    LDR     R3, [R0, #0x8C] \n"
 946 
 947 "loc_FF8BC0BC:\n"
 948 "    ADD     R0, R0, #4 \n"
 949 "    BLX     R3 \n"
 950 
 951 "loc_FF8BC0C4:\n"
 952 "    LDR     R0, [SP, #0x28] \n"
 953 "    LDR     R0, [R0] \n"
 954 "    CMP     R0, #0x10 \n"
 955 "    BEQ     loc_FF8BC0FC \n"
 956 "    BGT     loc_FF8BC0EC \n"
 957 "    CMP     R0, #1 \n"
 958 "    CMPNE   R0, #4 \n"
 959 "    CMPNE   R0, #0xE \n"
 960 "    BNE     loc_FF8BC130 \n"
 961 "    B       loc_FF8BC0FC \n"
 962 
 963 "loc_FF8BC0EC:\n"
 964 "    CMP     R0, #0x13 \n"
 965 "    CMPNE   R0, #0x17 \n"
 966 "    CMPNE   R0, #0x1A \n"
 967 "    BNE     loc_FF8BC130 \n"
 968 
 969 "loc_FF8BC0FC:\n"
 970 "    LDRSH   R0, [R4] \n"
 971 "    CMN     R0, #0xC00 \n"
 972 "    LDRNESH R1, [R4, #8] \n"
 973 "    CMNNE   R1, #0xC00 \n"
 974 "    STRNEH  R0, [SP, #0x1C] \n"
 975 "    STRNEH  R1, [SP, #0x24] \n"
 976 "    BNE     loc_FF8BC130 \n"
 977 "    ADD     R0, SP, #0x10 \n"
 978 "    BL      sub_FF8BD6D8 \n"
 979 "    LDRH    R0, [SP, #0x10] \n"
 980 "    STRH    R0, [SP, #0x1C] \n"
 981 "    LDRH    R0, [SP, #0x18] \n"
 982 "    STRH    R0, [SP, #0x24] \n"
 983 
 984 "loc_FF8BC130:\n"
 985 "    LDR     R0, [SP, #0x28] \n"
 986 "    CMP     R8, #1 \n"
 987 "    BNE     loc_FF8BC180 \n"
 988 "    LDR     R1, [R0, #0x7C] \n"
 989 "    MOV     R2, #0xC \n"
 990 "    ADD     R1, R1, R1, LSL#1 \n"
 991 "    ADD     R0, R0, R1, LSL#2 \n"
 992 "    SUB     R8, R0, #8 \n"
 993 "    LDR     R0, =0x57FE8 \n"
 994 "    ADD     R1, SP, #0x1C \n"
 995 "    BL      sub_003FC550 \n"
 996 "    LDR     R0, =0x57FF4 \n"
 997 "    MOV     R2, #0xC \n"
 998 "    ADD     R1, SP, #0x1C \n"
 999 "    BL      sub_003FC550 \n"
1000 "    LDR     R0, =0x58000 \n"
1001 "    MOV     R2, #0xC \n"
1002 "    MOV     R1, R8 \n"
1003 "    BL      sub_003FC550 \n"
1004 "    B       loc_FF8BC1F8 \n"
1005 
1006 "loc_FF8BC180:\n"
1007 "    LDR     R0, [R0] \n"
1008 "    MOV     R3, #1 \n"
1009 "    CMP     R0, #0xB \n"
1010 "    BNE     loc_FF8BC1C4 \n"
1011 "    MOV     R2, #0 \n"
1012 "    STRD    R2, [SP] \n"
1013 "    MOV     R2, R3 \n"
1014 "    MOV     R1, R3 \n"
1015 "    MOV     R0, #0 \n"
1016 "    BL      sub_FF8B75D8 \n"
1017 "    MOV     R3, #1 \n"
1018 "    MOV     R2, #0 \n"
1019 "    STRD    R2, [SP] \n"
1020 "    MOV     R2, R3 \n"
1021 "    MOV     R1, R3 \n"
1022 "    MOV     R0, #0 \n"
1023 "    B       loc_FF8BC1F4 \n"
1024 
1025 "loc_FF8BC1C4:\n"
1026 "    MOV     R2, #1 \n"
1027 "    STRD    R2, [SP] \n"
1028 "    MOV     R3, R2 \n"
1029 "    MOV     R1, R2 \n"
1030 "    MOV     R0, R2 \n"
1031 "    BL      sub_FF8B75D8 \n"
1032 "    MOV     R3, #1 \n"
1033 "    MOV     R2, R3 \n"
1034 "    MOV     R1, R3 \n"
1035 "    MOV     R0, R3 \n"
1036 "    STR     R3, [SP] \n"
1037 "    STR     R3, [SP, #4] \n"
1038 
1039 "loc_FF8BC1F4:\n"
1040 "    BL      sub_FF8B7744 \n"
1041 
1042 "loc_FF8BC1F8:\n"
1043 "    LDR     R0, [SP, #0x28] \n"
1044 "    BL      sub_FF8BD0A4 \n"
1045 "    B       loc_FF8BBB90 \n"
1046 );
1047 }
1048 
1049 /*************************************************************/
1050 //** sub_FF8B85E8_my @ 0xFF8B85E8 - 0xFF8B86AC, length=50
1051 void __attribute__((naked,noinline)) sub_FF8B85E8_my() {
1052 asm volatile (
1053 "    STMFD   SP!, {R4-R8,LR} \n"
1054 "    LDR     R7, =0x4110 \n"
1055 "    MOV     R4, R0 \n"
1056 "    LDR     R0, [R7, #0x1C] \n"
1057 "    MOV     R1, #0x3E \n"
1058 "    BL      sub_003FADD0 /*_ClearEventFlag*/ \n"
1059 "    MOV     R2, #0 \n"
1060 "    LDRSH   R0, [R4, #4] \n"
1061 "    MOV     R3, #1 \n"
1062 "    MOV     R1, R2 \n"
1063 "    BL      sub_FF8B727C \n"
1064 "    MOV     R6, R0 \n"
1065 "    LDRSH   R0, [R4, #6] \n"
1066 "    BL      sub_FF8B7438 \n"
1067 "    LDRSH   R0, [R4, #8] \n"
1068 "    BL      sub_FF8B7490 \n"
1069 "    LDRSH   R0, [R4, #0xA] \n"
1070 "    BL      sub_FF8B74E8 \n"
1071 "    LDRSH   R0, [R4, #0xC] \n"
1072 "    MOV     R1, #0 \n"
1073 "    BL      sub_FF8B7540 \n"
1074 "    MOV     R5, R0 \n"
1075 "    LDR     R0, [R4] \n"
1076 "    LDR     R8, =0x58000 \n"
1077 "    CMP     R0, #0xB \n"
1078 "    MOVEQ   R6, #0 \n"
1079 "    MOVEQ   R5, R6 \n"
1080 "    BEQ     loc_FF8B8680 \n"
1081 "    CMP     R6, #1 \n"
1082 "    BNE     loc_FF8B8680 \n"
1083 "    LDRSH   R0, [R4, #4] \n"
1084 "    LDR     R1, =0xFF8B71D4 \n"
1085 "    MOV     R2, #2 \n"
1086 "    BL      sub_FF96D7A0 \n"
1087 "    STRH    R0, [R4, #4] \n"
1088 "    MOV     R0, #0 \n"
1089 "    STR     R0, [R7, #0x28] \n"
1090 "    B       loc_FF8B8688 \n"
1091 
1092 "loc_FF8B8680:\n"
1093 "    LDRH    R0, [R8] \n"
1094 "    STRH    R0, [R4, #4] \n"
1095 
1096 "loc_FF8B8688:\n"
1097 "    CMP     R5, #1 \n"
1098 "    LDRNEH  R0, [R8, #8] \n"
1099 "    BNE     loc_FF8B86A4 \n"
1100 "    LDRSH   R0, [R4, #0xC] \n"
1101 "    LDR     R1, =0xFF8B7258 \n"
1102 "    MOV     R2, #0x20 \n"
1103 "    BL      sub_FF8BD104 \n"
1104 
1105 "loc_FF8B86A4:\n"
1106 "    STRH    R0, [R4, #0xC] \n"
1107 "    LDRSH   R0, [R4, #6] \n"
1108 "    BL      sub_FF8A6324_my \n"  // --> Patched. Old value = 0xFF8A6324.
1109 "    LDR     PC, =0xFF8B86B0 \n"  // Continue in firmware
1110 );
1111 }
1112 
1113 /*************************************************************/
1114 //** sub_FF8A6324_my @ 0xFF8A6324 - 0xFF8A638C, length=27
1115 void __attribute__((naked,noinline)) sub_FF8A6324_my() {
1116 asm volatile (
1117 "    STMFD   SP!, {R4-R6,LR} \n"
1118 "    LDR     R5, =0x3D54 \n"
1119 "    MOV     R4, R0 \n"
1120 "    LDR     R0, [R5, #4] \n"
1121 "    CMP     R0, #1 \n"
1122 "    MOVNE   R1, #0x154 \n"
1123 "    LDRNE   R0, =0xFF8A615C /*'Shutter.c'*/ \n"
1124 "    BLNE    _DebugAssert \n"
1125 "    CMN     R4, #0xC00 \n"
1126 "    LDREQSH R4, [R5, #2] \n"
1127 "    CMN     R4, #0xC00 \n"
1128 "    LDREQ   R1, =0x15A \n"
1129 "    LDREQ   R0, =0xFF8A615C /*'Shutter.c'*/ \n"
1130 "    STRH    R4, [R5, #2] \n"
1131 "    BLEQ    _DebugAssert \n"
1132 "    MOV     R0, R4 \n"
1133 "    BL      apex2us \n"  // --> Patched. Old value = _apex2us.
1134 "    MOV     R4, R0 \n"
1135 //"  BL      _sub_FF8FBADC \n"  // --> Nullsub call removed.
1136 "    MOV     R0, R4 \n"
1137 "    BL      sub_FF902F6C \n"
1138 "    TST     R0, #1 \n"
1139 "    LDMEQFD SP!, {R4-R6,PC} \n"
1140 "    LDMFD   SP!, {R4-R6,LR} \n"
1141 "    LDR     R1, =0x15F \n"
1142 "    LDR     R0, =0xFF8A615C /*'Shutter.c'*/ \n"
1143 "    B       _DebugAssert \n"
1144 );
1145 }

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