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

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

DEFINITIONS

This source file includes following definitions.
  1. capt_seq_task
  2. sub_FF99AA5C_my
  3. sub_FF99A7E8_my
  4. sub_FFAD7C94_my
  5. sub_FF99A51C_my
  6. exp_drv_task
  7. sub_FF8D7914_my
  8. sub_FF8C3364_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 #define USE_STUBS_NRFLAG 1 // see stubs_min.S
   9 
  10 #define NR_AUTO (0)
  11 
  12 //#define PAUSE_FOR_FILE_COUNTER 1000  // Enable delay in capt_seq_hook_raw_here to ensure file counter is updated
  13 
  14 #include "../../../generic/capt_seq.c"
  15 
  16 /*************************************************************/
  17 //** capt_seq_task @ 0xFF88CA84 - 0xFF88CD50, length=180
  18 void __attribute__((naked,noinline)) capt_seq_task() {
  19 asm volatile (
  20 "    STMFD   SP!, {R3-R7,LR} \n"
  21 "    LDR     R5, =0x1CD88 \n"
  22 "    LDR     R7, =0x34F0 \n"
  23 "    MOV     R6, #0 \n"
  24 
  25 "loc_FF88CA94:\n"
  26 "    LDR     R0, [R7, #4] \n"
  27 "    MOV     R2, #0 \n"
  28 "    MOV     R1, SP \n"
  29 "    BL      sub_FF829E30 /*_ReceiveMessageQueue*/ \n"
  30 "    TST     R0, #1 \n"
  31 "    BEQ     loc_FF88CAC4 \n"
  32 "    LDR     R2, =0x443 \n"
  33 "    LDR     R1, =0xFF88C3F8 /*'SsShootTask.c'*/ \n"
  34 "    MOV     R0, #0 \n"
  35 "    BL      _DebugAssert \n"
  36 "    BL      _ExitTask \n"
  37 "    LDMFD   SP!, {R3-R7,PC} \n"
  38 
  39 "loc_FF88CAC4:\n"
  40 "    LDR     R0, [SP] \n"
  41 "    LDR     R0, [R0] \n"
  42 "    CMP     R0, #1 \n"
  43 "    CMPNE   R0, #0x23 \n"
  44 "    CMPNE   R0, #0x19 \n"
  45 "    BLNE    sub_FF99BB58 \n"
  46 "    LDR     R0, [SP] \n"
  47 "    LDR     R1, [R0] \n"
  48 "    CMP     R1, #0x25 \n"
  49 "    ADDCC   PC, PC, R1, LSL#2 \n"
  50 "    B       loc_FF88CD14 \n"
  51 "    B       loc_FF88CB84 \n"
  52 "    B       loc_FF88CB9C \n"
  53 "    B       loc_FF88CBA8 \n"
  54 "    B       loc_FF88CBBC \n"
  55 "    B       loc_FF88CBB4 \n"
  56 "    B       loc_FF88CBC8 \n"
  57 "    B       loc_FF88CBD0 \n"
  58 "    B       loc_FF88CBD8 \n"
  59 "    B       loc_FF88CBE4 \n"
  60 "    B       loc_FF88CC10 \n"
  61 "    B       loc_FF88CBF0 \n"
  62 "    B       loc_FF88CBFC \n"
  63 "    B       loc_FF88CC04 \n"
  64 "    B       loc_FF88CC18 \n"
  65 "    B       loc_FF88CC20 \n"
  66 "    B       loc_FF88CC28 \n"
  67 "    B       loc_FF88CC30 \n"
  68 "    B       loc_FF88CC38 \n"
  69 "    B       loc_FF88CC44 \n"
  70 "    B       loc_FF88CC4C \n"
  71 "    B       loc_FF88CC54 \n"
  72 "    B       loc_FF88CC5C \n"
  73 "    B       loc_FF88CC64 \n"
  74 "    B       loc_FF88CC6C \n"
  75 "    B       loc_FF88CC74 \n"
  76 "    B       loc_FF88CC7C \n"
  77 "    B       loc_FF88CC88 \n"
  78 "    B       loc_FF88CC90 \n"
  79 "    B       loc_FF88CC98 \n"
  80 "    B       loc_FF88CCA0 \n"
  81 "    B       loc_FF88CCA8 \n"
  82 "    B       loc_FF88CCB4 \n"
  83 "    B       loc_FF88CCBC \n"
  84 "    B       loc_FF88CCC8 \n"
  85 "    B       loc_FF88CCF4 \n"
  86 "    B       loc_FF88CD00 \n"
  87 "    B       loc_FF88CD24 \n"
  88 
  89 "loc_FF88CB84:\n"
  90 "    BL      sub_FF88D2AC \n"
  91 "    BL      shooting_expo_param_override\n"    // added
  92 "    BL      sub_FF88A030 \n"
  93 //To do: Check if this is needed.
  94 //"    MOV     R0, #0\n"                          // added
  95 //"    STR     R0, [R5,#0x28]\n"                  // added, fixes overrides behavior at short shutter press (from S95)
  96 "    LDR     R0, [R5, #0x28] \n"
  97 "    CMP     R0, #0 \n"
  98 "    BLNE    sub_FF99AA5C_my \n"  // --> Patched. Old value = 0xFF99AA5C.
  99 "    B       loc_FF88CD24 \n"
 100 
 101 "loc_FF88CB9C:\n"
 102 "    LDR     R0, [R0, #0x10] \n"
 103 "    BL      sub_FF99A7E8_my \n"  // --> Patched. Old value = 0xFF99A7E8.
 104 "    B       loc_FF88CD24 \n"
 105 
 106 "loc_FF88CBA8:\n"
 107 "    MOV     R0, #1 \n"
 108 "    BL      sub_FF88D604 \n"
 109 "    B       loc_FF88CD24 \n"
 110 
 111 "loc_FF88CBB4:\n"
 112 "    BL      sub_FF88CEF8 \n"
 113 "    B       loc_FF88CBC0 \n"
 114 
 115 "loc_FF88CBBC:\n"
 116 "    BL      sub_FF88D288 \n"
 117 
 118 "loc_FF88CBC0:\n"
 119 "    STR     R6, [R5, #0x28] \n"
 120 "    B       loc_FF88CD24 \n"
 121 
 122 "loc_FF88CBC8:\n"
 123 "    BL      sub_FF88D290 \n"
 124 "    B       loc_FF88CD24 \n"
 125 
 126 "loc_FF88CBD0:\n"
 127 "    BL      sub_FF88D4C8 \n"
 128 "    B       loc_FF88CBE8 \n"
 129 
 130 "loc_FF88CBD8:\n"
 131 "    LDR     R0, [R0, #0x10] \n"
 132 "    BL      sub_FF99AB78 \n"
 133 "    B       loc_FF88CD24 \n"
 134 
 135 "loc_FF88CBE4:\n"
 136 "    BL      sub_FF88D55C \n"
 137 
 138 "loc_FF88CBE8:\n"
 139 "    BL      sub_FF88A030 \n"
 140 "    B       loc_FF88CD24 \n"
 141 
 142 "loc_FF88CBF0:\n"
 143 "    LDR     R0, [R5, #0x54] \n"
 144 "    BL      sub_FF88DBB8 \n"
 145 "    B       loc_FF88CD24 \n"
 146 
 147 "loc_FF88CBFC:\n"
 148 "    BL      sub_FF88DFF8 \n"
 149 "    B       loc_FF88CD24 \n"
 150 
 151 "loc_FF88CC04:\n"
 152 "    LDR     R0, [R0, #0xC] \n"
 153 "    BL      sub_FF88E060 \n"
 154 "    B       loc_FF88CD24 \n"
 155 
 156 "loc_FF88CC10:\n"
 157 "    BL      sub_FF88D288 \n"
 158 "    B       loc_FF88CD24 \n"
 159 
 160 "loc_FF88CC18:\n"
 161 "    BL      sub_FF9992C0 \n"
 162 "    B       loc_FF88CD24 \n"
 163 
 164 "loc_FF88CC20:\n"
 165 "    BL      sub_FF9994F8 \n"
 166 "    B       loc_FF88CD24 \n"
 167 
 168 "loc_FF88CC28:\n"
 169 "    BL      sub_FF9995B4 \n"
 170 "    B       loc_FF88CD24 \n"
 171 
 172 "loc_FF88CC30:\n"
 173 "    BL      sub_FF99968C \n"
 174 "    B       loc_FF88CD24 \n"
 175 
 176 "loc_FF88CC38:\n"
 177 "    MOV     R0, #0 \n"
 178 "    BL      sub_FF9998F4 \n"
 179 "    B       loc_FF88CD24 \n"
 180 
 181 "loc_FF88CC44:\n"
 182 "    BL      sub_FF999A54 \n"
 183 "    B       loc_FF88CD24 \n"
 184 
 185 "loc_FF88CC4C:\n"
 186 "    BL      sub_FF893AC8 \n"
 187 "    B       loc_FF88CD24 \n"
 188 
 189 "loc_FF88CC54:\n"
 190 "    BL      sub_FF893AD4 \n"
 191 "    B       loc_FF88CD24 \n"
 192 
 193 "loc_FF88CC5C:\n"
 194 "    BL      sub_FF999AF0 \n"
 195 "    B       loc_FF88CD24 \n"
 196 
 197 "loc_FF88CC64:\n"
 198 "    BL      sub_FF999B9C \n"
 199 "    B       loc_FF88CD24 \n"
 200 
 201 "loc_FF88CC6C:\n"
 202 "    BL      sub_FF88D74C \n"
 203 "    B       loc_FF88CD24 \n"
 204 
 205 "loc_FF88CC74:\n"
 206 "    MOV     R0, #0 \n"
 207 "    B       loc_FF88CC80 \n"
 208 
 209 "loc_FF88CC7C:\n"
 210 "    LDR     R0, [R0, #0xC] \n"
 211 
 212 "loc_FF88CC80:\n"
 213 "    BL      sub_FF88D7D4 \n"
 214 "    B       loc_FF88CD24 \n"
 215 
 216 "loc_FF88CC88:\n"
 217 "    BL      sub_FF99975C \n"
 218 "    B       loc_FF88CD24 \n"
 219 
 220 "loc_FF88CC90:\n"
 221 "    BL      sub_FF99979C \n"
 222 "    B       loc_FF88CD24 \n"
 223 
 224 "loc_FF88CC98:\n"
 225 "    BL      sub_FF8905A0 \n"
 226 "    B       loc_FF88CD24 \n"
 227 
 228 "loc_FF88CCA0:\n"
 229 "    BL      sub_FF890690 \n"
 230 "    B       loc_FF88CD24 \n"
 231 
 232 "loc_FF88CCA8:\n"
 233 "    LDR     R0, [R0, #0xC] \n"
 234 "    BL      sub_FF999CAC \n"
 235 "    B       loc_FF88CD24 \n"
 236 
 237 "loc_FF88CCB4:\n"
 238 "    BL      sub_FF999D34 \n"
 239 "    B       loc_FF88CD24 \n"
 240 
 241 "loc_FF88CCBC:\n"
 242 "    BL      sub_FF890820 \n"
 243 "    BL      sub_FF8906E8 \n"
 244 "    B       loc_FF88CD24 \n"
 245 
 246 "loc_FF88CCC8:\n"
 247 "    BL      sub_FF892778 \n"
 248 "    LDR     R0, =0x1CE88 \n"
 249 "    LDRH    R0, [R0, #0x9C] \n"
 250 "    CMP     R0, #4 \n"
 251 "    LDRNEH  R0, [R5] \n"
 252 "    SUBNE   R1, R0, #0x8200 \n"
 253 "    SUBNES  R1, R1, #0x36 \n"
 254 "    BNE     loc_FF88CD24 \n"
 255 "    BL      sub_FF890690 \n"
 256 "    BL      sub_FF890BB8 \n"
 257 "    B       loc_FF88CD24 \n"
 258 
 259 "loc_FF88CCF4:\n"
 260 "    MOV     R2, #0 \n"
 261 "    MOV     R1, #0x11 \n"
 262 "    B       loc_FF88CD08 \n"
 263 
 264 "loc_FF88CD00:\n"
 265 "    MOV     R2, #0 \n"
 266 "    MOV     R1, #0x10 \n"
 267 
 268 "loc_FF88CD08:\n"
 269 "    MOV     R0, #0 \n"
 270 "    BL      sub_FF88AB48 \n"
 271 "    B       loc_FF88CD24 \n"
 272 
 273 "loc_FF88CD14:\n"
 274 "    LDR     R2, =0x57B \n"
 275 "    LDR     R1, =0xFF88C3F8 /*'SsShootTask.c'*/ \n"
 276 "    MOV     R0, #0 \n"
 277 "    BL      _DebugAssert \n"
 278 
 279 "loc_FF88CD24:\n"
 280 "    LDR     R0, [SP] \n"
 281 "    LDR     R1, [R0, #4] \n"
 282 "    LDR     R0, [R7] \n"
 283 "    BL      sub_FF829BC4 /*_SetEventFlag*/ \n"
 284 "    LDR     R4, [SP] \n"
 285 "    LDR     R0, [R4, #8] \n"
 286 "    CMP     R0, #0 \n"
 287 "    LDREQ   R1, =0xFF88C3F8 /*'SsShootTask.c'*/ \n"
 288 "    MOVEQ   R2, #0x124 \n"
 289 "    BLEQ    _DebugAssert \n"
 290 "    STR     R6, [R4, #8] \n"
 291 "    B       loc_FF88CA94 \n"
 292 );
 293 }
 294 
 295 /*************************************************************/
 296 //** sub_FF99AA5C_my @ 0xFF99AA5C - 0xFF99AB40, length=58
 297 void __attribute__((naked,noinline)) sub_FF99AA5C_my() {
 298 asm volatile (
 299 "    STMFD   SP!, {R3-R7,LR} \n"
 300 "    BL      sub_FF88C004 \n"
 301 "    MOV     R4, R0 \n"
 302 "    MOV     R0, #0xC \n"
 303 "    BL      sub_FF892098 \n"
 304 "    LDR     R6, =0x7598 \n"
 305 "    TST     R0, #1 \n"
 306 "    MOV     R5, #1 \n"
 307 "    BNE     loc_FF99AB30 \n"
 308 "    BL      sub_FF8920F4 \n"
 309 "    TST     R0, #1 \n"
 310 "    BNE     loc_FF99AB30 \n"
 311 "    MOV     R2, #2 \n"
 312 "    MOV     R1, SP \n"
 313 "    ADD     R0, R5, #0x108 \n"
 314 "    BL      _GetPropertyCase \n"
 315 "    TST     R0, #1 \n"
 316 "    ADDNE   R2, R5, #0x174 \n"
 317 "    LDRNE   R1, =0xFF99AB58 /*'SsCaptureCtrl.c'*/ \n"
 318 "    MOVNE   R0, #0 \n"
 319 "    BLNE    _DebugAssert \n"
 320 "    LDRSH   R0, [SP] \n"
 321 "    BL      sub_FF82CB64 \n"
 322 "    BL      sub_FF82C980 \n"
 323 "    CMP     R0, #1 \n"
 324 "    BLS     loc_FF99AB38 \n"
 325 "    MOV     R0, #0 \n"
 326 "    BL      sub_FF82CAD8 \n"
 327 "    BL      sub_FF88D298 \n"
 328 "    BL      sub_FF88E388 \n"
 329 "    MOV     R1, R4 \n"
 330 "    BL      sub_FF88E3E4 \n"
 331 "    LDR     R0, =0x10E \n"
 332 "    MOV     R2, #4 \n"
 333 "    ADD     R1, R4, #0x30 \n"
 334 "    BL      _SetPropertyCase \n"
 335 "    MOV     R2, #4 \n"
 336 "    ADD     R1, R4, #0x34 \n"
 337 "    MOV     R0, #0x2C \n"
 338 "    BL      _SetPropertyCase \n"
 339 "    MOV     R2, #4 \n"
 340 "    ADD     R1, R4, #8 \n"
 341 "    MOV     R0, #0x3F \n"
 342 "    BL      _SetPropertyCase \n"
 343 "    BL      sub_FF99B344 \n"
 344 "    MVN     R1, #0x1000 \n"
 345 "    BL      sub_FF829C0C /*_ClearEventFlag*/ \n"
 346 "    MOV     R0, R4 \n"
 347 "    BL      sub_FF99A48C \n"
 348 "    MOV     R0, R4 \n"
 349 "    BL      sub_FFAD7C94_my \n"  // --> Patched. Old value = 0xFFAD7C94.
 350 "    TST     R0, #1 \n"
 351 "    BEQ     loc_FF99AB34 \n"
 352 
 353 "loc_FF99AB30:\n"
 354 "    STR     R5, [R6] \n"
 355 
 356 "loc_FF99AB34:\n"
 357 "    LDMFD   SP!, {R3-R7,PC} \n"
 358 
 359 "loc_FF99AB38:\n"
 360 "    BL      sub_FF88A928 \n"
 361 "    BL      sub_FF892150 \n"
 362 "    LDMFD   SP!, {R3-R7,PC} \n"
 363 );
 364 }
 365 
 366 /*************************************************************/
 367 //** sub_FF99A7E8_my @ 0xFF99A7E8 - 0xFF99AA2C, length=146
 368 void __attribute__((naked,noinline)) sub_FF99A7E8_my() {
 369 asm volatile (
 370 "    STMFD   SP!, {R2-R8,LR} \n"
 371 "    LDR     R7, =0x1CD88 \n"
 372 "    MOV     R5, R0 \n"
 373 "    LDR     R0, [R7, #0x28] \n"
 374 "    MOV     R4, #0 \n"
 375 "    CMP     R0, #0 \n"
 376 "    BEQ     loc_FF99A834 \n"
 377 "    LDR     R0, =0x7598 \n"
 378 "    MOV     R2, R5 \n"
 379 "    LDR     R0, [R0] \n"
 380 "    MOV     R1, #2 \n"
 381 "    CMP     R0, #0 \n"
 382 "    MOVNE   R4, #0x1D \n"
 383 "    MOV     R0, R4 \n"
 384 "    BL      sub_FF88AB48 \n"
 385 "    MOV     R1, R4 \n"
 386 "    MOV     R0, R5 \n"
 387 "    BL      sub_FF99B8E0 \n"
 388 "    B       sub_FF99AA50 \n"
 389 
 390 "loc_FF99A834:\n"
 391 "    BL      sub_FF88E388 \n"
 392 "    MOV     R1, R5 \n"
 393 "    BL      sub_FF88E3E4 \n"
 394 "    LDR     R0, =0x10E \n"
 395 "    MOV     R2, #4 \n"
 396 "    ADD     R1, R5, #0x30 \n"
 397 "    BL      _SetPropertyCase \n"
 398 "    MOV     R2, #4 \n"
 399 "    ADD     R1, R5, #0x34 \n"
 400 "    MOV     R0, #0x2C \n"
 401 "    BL      _SetPropertyCase \n"
 402 "    LDR     R0, [R7, #0x104] \n"
 403 "    LDR     R6, =0x1CE88 \n"
 404 "    CMP     R0, #0 \n"
 405 "    BNE     loc_FF99A888 \n"
 406 "    LDRH    R0, [R6, #0x9A] \n"
 407 "    CMP     R0, #3 \n"
 408 "    LDRNE   R0, [R5, #8] \n"
 409 "    CMPNE   R0, #1 \n"
 410 "    BHI     loc_FF99A8B8 \n"
 411 "    B       loc_FF99A894 \n"
 412 
 413 "loc_FF99A888:\n"
 414 "    LDR     R0, [R5, #0xC] \n"
 415 "    CMP     R0, #1 \n"
 416 "    BNE     loc_FF99A8B8 \n"
 417 
 418 "loc_FF99A894:\n"
 419 "    MOV     R0, #0xC \n"
 420 "    BL      sub_FF892098 \n"
 421 "    TST     R0, #1 \n"
 422 "    BNE     loc_FF99A8B0 \n"
 423 "    BL      sub_FF8920F4 \n"
 424 "    TST     R0, #1 \n"
 425 "    BEQ     loc_FF99A8B8 \n"
 426 
 427 "loc_FF99A8B0:\n"
 428 "    BL      sub_FF88A928 \n"
 429 "    MOV     R4, #1 \n"
 430 
 431 "loc_FF99A8B8:\n"
 432 "    TST     R4, #1 \n"
 433 "    BNE     sub_FF99AA34 \n"
 434 "    LDR     R0, [R7, #0xE4] \n"
 435 "    CMP     R0, #0 \n"
 436 "    BEQ     loc_FF99A8F4 \n"
 437 "    LDRH    R0, [R6, #0x9A] \n"
 438 "    CMP     R0, #3 \n"
 439 "    LDRNE   R0, [R5, #8] \n"
 440 "    CMPNE   R0, #1 \n"
 441 "    BHI     loc_FF99A94C \n"
 442 "    LDR     R0, [R7, #0x104] \n"
 443 "    CMP     R0, #0 \n"
 444 "    LDRNE   R0, [R5, #0xC] \n"
 445 "    CMPNE   R0, #1 \n"
 446 "    BHI     loc_FF99A94C \n"
 447 
 448 "loc_FF99A8F4:\n"
 449 "    LDR     R0, =0x109 \n"
 450 "    MOV     R2, #2 \n"
 451 "    ADD     R1, SP, #4 \n"
 452 "    BL      _GetPropertyCase \n"
 453 "    TST     R0, #1 \n"
 454 "    MOVNE   R2, #0xCA \n"
 455 "    LDRNE   R1, =0xFF99AB58 /*'SsCaptureCtrl.c'*/ \n"
 456 "    MOVNE   R0, #0 \n"
 457 "    BLNE    _DebugAssert \n"
 458 "    LDRSH   R0, [SP, #4] \n"
 459 "    BL      sub_FF82CB64 \n"
 460 "    BL      sub_FF82C980 \n"
 461 "    CMP     R0, #1 \n"
 462 "    BLS     loc_FF99A938 \n"
 463 "    MOV     R0, #0 \n"
 464 "    BL      sub_FF82CAD8 \n"
 465 "    B       loc_FF99A94C \n"
 466 
 467 "loc_FF99A938:\n"
 468 "    BL      sub_FF88A928 \n"
 469 "    BL      sub_FF892150 \n"
 470 "    MOV     R4, #1 \n"
 471 "    CMP     R4, #0 \n"
 472 "    BNE     sub_FF99AA34 \n"
 473 
 474 "loc_FF99A94C:\n"
 475 "    BL      sub_FF99B344 \n"
 476 "    MVN     R1, #0x1000 \n"
 477 "    BL      sub_FF829C0C /*_ClearEventFlag*/ \n"
 478 "    MOV     R0, R5 \n"
 479 "    BL      sub_FFAD78EC \n"
 480 "    TST     R0, #1 \n"
 481 "    MOV     R4, R0 \n"
 482 "    BNE     sub_FF99AA34 \n"
 483 "    BL      sub_FF88D298 \n"
 484 "    MOV     R0, R5 \n"
 485 "    BL      sub_FF99A48C \n"
 486 "    LDR     R0, [R7, #0xA0] \n"
 487 "    CMP     R0, #0 \n"
 488 "    BEQ     loc_FF99AA14 \n"
 489 "    LDRH    R0, [R6, #0x9A] \n"
 490 "    CMP     R0, #3 \n"
 491 "    LDRNE   R0, [R5, #8] \n"
 492 "    CMPNE   R0, #1 \n"
 493 "    BLS     loc_FF99A9B4 \n"
 494 "    BL      sub_FF99B344 \n"
 495 "    LDR     R3, =0x11A \n"
 496 "    LDR     R2, =0x3A98 \n"
 497 "    STR     R3, [SP] \n"
 498 "    LDR     R3, =0xFF99AB58 /*'SsCaptureCtrl.c'*/ \n"
 499 "    MOV     R1, #0x1000 \n"
 500 "    BL      sub_FF89237C \n"
 501 
 502 "loc_FF99A9B4:\n"
 503 "    MOV     R2, #4 \n"
 504 "    ADD     R1, SP, #4 \n"
 505 "    MOV     R0, #0x180 \n"
 506 "    BL      _GetPropertyCase \n"
 507 "    TST     R0, #1 \n"
 508 "    LDRNE   R2, =0x11E \n"
 509 "    LDRNE   R1, =0xFF99AB58 /*'SsCaptureCtrl.c'*/ \n"
 510 "    MOVNE   R0, #0 \n"
 511 "    BLNE    _DebugAssert \n"
 512 "    LDR     R0, [SP, #4] \n"
 513 "    CMP     R0, #0 \n"
 514 "    BNE     loc_FF99A9F4 \n"
 515 "    BL      sub_FF99B344 \n"
 516 "    MOV     R1, #0x1000 \n"
 517 "    BL      sub_FF829BC4 /*_SetEventFlag*/ \n"
 518 "    B       loc_FF99AA14 \n"
 519 
 520 "loc_FF99A9F4:\n"
 521 "    BL      sub_FF99B344 \n"
 522 "    MOV     R1, #0x1000 \n"
 523 "    BL      sub_FF829C0C /*_ClearEventFlag*/ \n"
 524 "    LDR     R2, =0xFF99A7D4 \n"
 525 "    LDR     R0, [SP, #4] \n"
 526 "    MOV     R3, #0x1000 \n"
 527 "    MOV     R1, R2 \n"
 528 "    BL      sub_FF826A9C /*_SetTimerAfter*/ \n"
 529 
 530 "loc_FF99AA14:\n"
 531 "    LDR     R0, [R7, #0xAC] \n"
 532 "    CMP     R0, #0 \n"
 533 "    MOV     R0, R5 \n"
 534 "    BEQ     loc_FF99AA2C \n"
 535 "    BL      sub_FFAD80B0 \n"
 536 "    B       sub_FF99AA50 \n"
 537 
 538 "loc_FF99AA2C:\n"
 539 "    BL      sub_FFAD7C94_my \n"  // --> Patched. Old value = 0xFFAD7C94.
 540 "    LDR     PC, =0xFF99AA30 \n"  // Continue in firmware
 541 );
 542 }
 543 
 544 /*************************************************************/
 545 //** sub_FFAD7C94_my @ 0xFFAD7C94 - 0xFFAD7F18, length=162
 546 void __attribute__((naked,noinline)) sub_FFAD7C94_my() {
 547 asm volatile (
 548 "    STMFD   SP!, {R2-R10,LR} \n"
 549 "    MOV     R4, R0 \n"
 550 "    BL      sub_FF99A3F4 \n"
 551 "    BL      sub_FF99B1A0 \n"
 552 "    LDR     R7, =0x1CD88 \n"
 553 "    LDR     R0, [R7, #0x190] \n"
 554 "    CMP     R0, #2 \n"
 555 "    BNE     loc_FFAD7CD0 \n"
 556 "    ADD     R0, R7, #0x100 \n"
 557 "    LDRH    R0, [R0, #0x9A] \n"
 558 "    CMP     R0, #3 \n"
 559 "    LDRNE   R0, [R4, #8] \n"
 560 "    CMPNE   R0, #1 \n"
 561 "    MOVLS   R0, #4 \n"
 562 "    BLLS    sub_FF90CF8C \n"
 563 
 564 "loc_FFAD7CD0:\n"
 565 "    LDR     R0, =0x12F \n"
 566 "    MOV     R2, #4 \n"
 567 "    ADD     R1, SP, #4 \n"
 568 "    BL      _GetPropertyCase \n"
 569 "    TST     R0, #1 \n"
 570 "    LDRNE   R2, =0x191 \n"
 571 "    LDRNE   R1, =0xFFAD7F40 /*'SsStandardCaptureSeq.c'*/ \n"
 572 "    MOVNE   R0, #0 \n"
 573 "    BLNE    _DebugAssert \n"
 574 "    LDR     R0, [SP, #4] \n"
 575 "    AND     R0, R0, #0xFF00 \n"
 576 "    CMP     R0, #0x600 \n"
 577 "    LDRNE   R0, =0xFF99A090 \n"
 578 "    LDREQ   R0, =0xFFAD7C10 \n"
 579 "    MOVNE   R1, R4 \n"
 580 "    MOVEQ   R1, #0 \n"
 581 "    BL      sub_FF8CC134 \n"
 582 "    LDR     R0, [R7, #0x184] \n"
 583 "    CMP     R0, #0 \n"
 584 "    BLNE    sub_FF99A2E0 \n"
 585 "    MOV     R0, #0 \n"
 586 //"  BL      _sub_FF88F668 \n"  // --> Nullsub call removed.
 587 "    MOV     R0, R4 \n"
 588 "    BL      sub_FF99A51C_my \n"  // --> Patched. Old value = 0xFF99A51C.
 589 "    LDR     R1, =0xCA1C \n"
 590 "    MOV     R2, #4 \n"
 591 "    MOV     R0, #0x8A \n"
 592 "    BL      _GetPropertyCase \n"
 593 "    TST     R0, #1 \n"
 594 "    LDRNE   R2, =0x1A5 \n"
 595 "    LDRNE   R1, =0xFFAD7F40 /*'SsStandardCaptureSeq.c'*/ \n"
 596 "    MOVNE   R0, #0 \n"
 597 "    BLNE    _DebugAssert \n"
 598 "    BL      sub_FF88F818 \n"
 599 "    BL      sub_FF87F79C \n"
 600 "    MOV     R1, #0 \n"
 601 "    MOV     R0, R4 \n"
 602 "    BL      sub_FFAD7C14 \n"
 603 "    MOV     R6, R0 \n"
 604 "    LDR     R0, [SP, #4] \n"
 605 "    LDR     R8, =0xCA1C \n"
 606 "    AND     R0, R0, #0xFF00 \n"
 607 "    CMP     R0, #0x600 \n"
 608 "    LDRH    R0, [R4, #0x18] \n"
 609 "    LDRNE   R2, =0xFF99A2C8 \n"
 610 "    LDREQ   R2, =0xFF99A23C \n"
 611 "    CMP     R0, #0 \n"
 612 "    BEQ     loc_FFAD7DA0 \n"
 613 "    CMP     R0, #1 \n"
 614 "    BEQ     loc_FFAD7DC4 \n"
 615 "    CMP     R0, #4 \n"
 616 "    BNE     loc_FFAD7E38 \n"
 617 
 618 "loc_FFAD7DA0:\n"
 619 "    STR     R6, [SP] \n"
 620 "    MOV     R3, R2 \n"
 621 "    LDR     R1, [R4, #0x34] \n"
 622 "    LDR     R2, [R8] \n"
 623 "    MOV     R0, R4 \n"
 624 "    BL      sub_FF999E38 \n"
 625 "    MOV     R5, R0 \n"
 626 "    BL      sub_FF8C8A5C \n"
 627 "    B       loc_FFAD7E4C \n"
 628 
 629 "loc_FFAD7DC4:\n"
 630 "    STR     R6, [SP] \n"
 631 "    MOV     R3, R2 \n"
 632 "    LDR     R1, [R4, #0x34] \n"
 633 "    LDR     R2, [R8] \n"
 634 "    MOV     R0, R4 \n"
 635 "    BL      sub_FF999EC4 \n"
 636 "    MOV     R5, R0 \n"
 637 "    MOV     R1, #0 \n"
 638 "    MOV     R0, #0x45 \n"
 639 "    BL      sub_FF833F7C \n"
 640 "    TST     R5, #1 \n"
 641 "    BNE     loc_FFAD7E4C \n"
 642 "    LDR     R0, =0xFFAD7C10 \n"
 643 "    MOV     R1, #0 \n"
 644 "    BL      sub_FF8CC134 \n"
 645 "    MOV     R1, #1 \n"
 646 "    MOV     R0, R4 \n"
 647 "    BL      sub_FFAD7C14 \n"
 648 "    MOV     R6, R0 \n"
 649 "    LDR     R0, [R8] \n"
 650 "    BL      sub_FF99A378 \n"
 651 "    LDR     R1, [R4, #0x34] \n"
 652 "    LDR     R2, [R8] \n"
 653 "    MOV     R3, R6 \n"
 654 "    MOV     R0, R4 \n"
 655 "    BL      sub_FF999F5C \n"
 656 "    MOV     R5, R0 \n"
 657 "    BL      sub_FF999DC0 \n"
 658 "    B       loc_FFAD7E4C \n"
 659 
 660 "loc_FFAD7E38:\n"
 661 "    MOV     R2, #0x1D8 \n"
 662 "    LDR     R1, =0xFFAD7F40 /*'SsStandardCaptureSeq.c'*/ \n"
 663 "    MOV     R0, #0 \n"
 664 "    BL      _DebugAssert \n"
 665 "    MOV     R5, #0x1D \n"
 666 
 667 "loc_FFAD7E4C:\n"
 668 "    BL      sub_FF87F7B4 \n"
 669 "    LDR     R8, =0xFFAD7C10 \n"
 670 "    TST     R5, #1 \n"
 671 "    BNE     loc_FFAD7ECC \n"
 672 "    LDR     R0, [R7, #0x100] \n"
 673 "    CMP     R0, #0 \n"
 674 "    BNE     loc_FFAD7E84 \n"
 675 "    MOV     R0, R4 \n"
 676 "    BL      sub_FF99C0E4 \n"
 677 "    TST     R0, #1 \n"
 678 "    LDRNE   R2, =0x1FD \n"
 679 "    LDRNE   R1, =0xFFAD7F40 /*'SsStandardCaptureSeq.c'*/ \n"
 680 "    MOVNE   R0, #0 \n"
 681 "    BLNE    _DebugAssert \n"
 682 "    BL      capt_seq_hook_raw_here \n"         // added
 683 
 684 "loc_FFAD7E84:\n"
 685 "    MOV     R0, R4 \n"
 686 "    BL      sub_FF99A604 \n"
 687 "    MOV     R0, R4 \n"
 688 "    BL      sub_FF99A5BC \n"
 689 "    CMP     R6, R8 \n"
 690 "    BEQ     loc_FFAD7ECC \n"
 691 "    BL      sub_FF99B344 \n"
 692 "    LDR     R9, =0x20A \n"
 693 "    LDR     R2, =0x3A98 \n"
 694 "    LDR     R3, =0xFFAD7F40 /*'SsStandardCaptureSeq.c'*/ \n"
 695 "    MOV     R1, #4 \n"
 696 "    STR     R9, [SP] \n"
 697 "    BL      sub_FF89237C \n"
 698 "    CMP     R0, #0 \n"
 699 "    MOVNE   R2, R9 \n"
 700 "    LDRNE   R1, =0xFFAD7F40 /*'SsStandardCaptureSeq.c'*/ \n"
 701 "    MOVNE   R0, #0 \n"
 702 "    BLNE    _DebugAssert \n"
 703 
 704 "loc_FFAD7ECC:\n"
 705 "    MOV     R2, R4 \n"
 706 "    MOV     R1, #2 \n"
 707 "    MOV     R0, R5 \n"
 708 "    BL      sub_FF88AB48 \n"
 709 "    LDR     R0, [R7, #0x28] \n"
 710 "    CMP     R0, #0 \n"
 711 "    BEQ     loc_FFAD7F00 \n"
 712 "    SUBS    R1, R6, R8 \n"
 713 "    MOVNE   R1, #1 \n"
 714 "    MOV     R2, R5 \n"
 715 "    MOV     R0, R4 \n"
 716 "    BL      sub_FF99B878 \n"
 717 "    B       loc_FFAD7F14 \n"
 718 
 719 "loc_FFAD7F00:\n"
 720 "    SUBS    R1, R6, R8 \n"
 721 "    MOVNE   R1, #1 \n"
 722 "    MOV     R2, R5 \n"
 723 "    MOV     R0, R4 \n"
 724 "    BL      sub_FF99B80C \n"
 725 
 726 "loc_FFAD7F14:\n"
 727 "    MOV     R0, R5 \n"
 728 "    LDMFD   SP!, {R2-R10,PC} \n"
 729 "    .ltorg\n"         // added
 730 );
 731 }
 732 
 733 /*************************************************************/
 734 //** sub_FF99A51C_my @ 0xFF99A51C - 0xFF99A55C, length=17
 735 void __attribute__((naked,noinline)) sub_FF99A51C_my() {
 736 asm volatile (
 737 "    STMFD   SP!, {R4-R6,LR} \n"
 738 "    MOV     R4, R0 \n"
 739 "    LDR     R0, =0x1CD88 \n"
 740 "    LDR     R5, =0x7590 \n"
 741 "    LDR     R0, [R0, #0xF4] \n"
 742 "    CMP     R0, #0 \n"
 743 "    LDRNE   R0, =0x1CE88 \n"
 744 "    LDRNEH  R0, [R0, #0x9A] \n"
 745 "    CMPNE   R0, #3 \n"
 746 "    LDRNE   R0, [R4, #8] \n"
 747 "    CMPNE   R0, #1 \n"
 748 "    BHI     loc_FF99A55C \n"
 749 "    LDR     R1, [R4, #0x1C] \n"
 750 "    MOV     R0, #0 \n"
 751 "    BL      sub_FFA29B24 \n"
 752 "    STR     R0, [R5] \n"
 753 
 754 "loc_FF99A55C:\n"
 755 "    BL      wait_until_remote_button_is_released\n" // added
 756 "    BL      capt_seq_hook_set_nr\n"                 // added
 757 "    LDR     R0, [R4, #0x20] \n"
 758 "    LDR     PC, =0xFF99A560 \n"  // Continue in firmware
 759 );
 760 }
 761 
 762 /*************************************************************/
 763 //** exp_drv_task @ 0xFF8DB0B0 - 0xFF8DB74C, length=424
 764 void __attribute__((naked,noinline)) exp_drv_task() {
 765 asm volatile (
 766 "    STMFD   SP!, {R4-R9,LR} \n"
 767 "    SUB     SP, SP, #0x2C \n"
 768 "    LDR     R6, =0x43DC \n"
 769 "    LDR     R7, =0xBB8 \n"
 770 "    LDR     R4, =0x5BE18 \n"
 771 "    MOV     R0, #0 \n"
 772 "    ADD     R5, SP, #0x1C \n"
 773 "    STR     R0, [SP, #0xC] \n"
 774 
 775 "loc_FF8DB0D0:\n"
 776 "    LDR     R0, [R6, #0x20] \n"
 777 "    MOV     R2, #0 \n"
 778 "    ADD     R1, SP, #0x28 \n"
 779 "    BL      sub_FF829E30 /*_ReceiveMessageQueue*/ \n"
 780 "    LDR     R0, [SP, #0xC] \n"
 781 "    CMP     R0, #1 \n"
 782 "    BNE     loc_FF8DB120 \n"
 783 "    LDR     R0, [SP, #0x28] \n"
 784 "    LDR     R0, [R0] \n"
 785 "    CMP     R0, #0x14 \n"
 786 "    CMPNE   R0, #0x15 \n"
 787 "    CMPNE   R0, #0x16 \n"
 788 "    CMPNE   R0, #0x17 \n"
 789 "    CMPNE   R0, #0x18 \n"
 790 "    BEQ     loc_FF8DB284 \n"
 791 "    CMP     R0, #0x2E \n"
 792 "    BEQ     loc_FF8DB208 \n"
 793 "    ADD     R1, SP, #0xC \n"
 794 "    MOV     R0, #0 \n"
 795 "    BL      sub_FF8DB050 \n"
 796 
 797 "loc_FF8DB120:\n"
 798 "    LDR     R0, [SP, #0x28] \n"
 799 "    LDR     R1, [R0] \n"
 800 "    CMP     R1, #0x34 \n"
 801 "    BNE     loc_FF8DB14C \n"
 802 "    BL      sub_FF8DC8F0 \n"
 803 "    LDR     R0, [R6, #0x1C] \n"
 804 "    MOV     R1, #1 \n"
 805 "    BL      sub_FF829BC4 /*_SetEventFlag*/ \n"
 806 "    BL      _ExitTask \n"
 807 "    ADD     SP, SP, #0x2C \n"
 808 "    LDMFD   SP!, {R4-R9,PC} \n"
 809 
 810 "loc_FF8DB14C:\n"
 811 "    CMP     R1, #0x33 \n"
 812 "    BNE     loc_FF8DB168 \n"
 813 "    LDR     R2, [R0, #0xAC]! \n"
 814 "    LDR     R1, [R0, #4] \n"
 815 "    MOV     R0, R1 \n"
 816 "    BLX     R2 \n"
 817 "    B       loc_FF8DB744 \n"
 818 
 819 "loc_FF8DB168:\n"
 820 "    CMP     R1, #0x2C \n"
 821 "    BNE     loc_FF8DB1B8 \n"
 822 "    LDR     R0, [R6, #0x1C] \n"
 823 "    MOV     R1, #0x80 \n"
 824 "    BL      sub_FF829C0C /*_ClearEventFlag*/ \n"
 825 "    LDR     R0, =0xFF8D6454 \n"
 826 "    MOV     R1, #0x80 \n"
 827 "    BL      sub_FF887A8C \n"
 828 "    LDR     R0, [R6, #0x1C] \n"
 829 "    MOV     R2, R7 \n"
 830 "    MOV     R1, #0x80 \n"
 831 "    BL      sub_FF829AF8 /*_WaitForAllEventFlag*/ \n"
 832 "    TST     R0, #1 \n"
 833 "    LDRNE   R2, =0x1798 \n"
 834 "    BNE     loc_FF8DB274 \n"
 835 
 836 "loc_FF8DB1A4:\n"
 837 "    LDR     R1, [SP, #0x28] \n"
 838 "    LDR     R0, [R1, #0xB0] \n"
 839 "    LDR     R1, [R1, #0xAC] \n"
 840 "    BLX     R1 \n"
 841 "    B       loc_FF8DB744 \n"
 842 
 843 "loc_FF8DB1B8:\n"
 844 "    CMP     R1, #0x2D \n"
 845 "    BNE     loc_FF8DB200 \n"
 846 "    ADD     R1, SP, #0xC \n"
 847 "    BL      sub_FF8DB050 \n"
 848 "    LDR     R0, [R6, #0x1C] \n"
 849 "    MOV     R1, #0x100 \n"
 850 "    BL      sub_FF829C0C /*_ClearEventFlag*/ \n"
 851 "    LDR     R0, =0xFF8D6464 \n"
 852 "    MOV     R1, #0x100 \n"
 853 "    BL      sub_FF887CA4 \n"
 854 "    LDR     R0, [R6, #0x1C] \n"
 855 "    MOV     R2, R7 \n"
 856 "    MOV     R1, #0x100 \n"
 857 "    BL      sub_FF829AF8 /*_WaitForAllEventFlag*/ \n"
 858 "    TST     R0, #1 \n"
 859 "    BEQ     loc_FF8DB1A4 \n"
 860 "    LDR     R2, =0x17A2 \n"
 861 "    B       loc_FF8DB274 \n"
 862 
 863 "loc_FF8DB200:\n"
 864 "    CMP     R1, #0x2E \n"
 865 "    BNE     loc_FF8DB218 \n"
 866 
 867 "loc_FF8DB208:\n"
 868 "    LDR     R0, [SP, #0x28] \n"
 869 "    ADD     R1, SP, #0xC \n"
 870 "    BL      sub_FF8DB050 \n"
 871 "    B       loc_FF8DB1A4 \n"
 872 
 873 "loc_FF8DB218:\n"
 874 "    CMP     R1, #0x31 \n"
 875 "    BNE     loc_FF8DB230 \n"
 876 "    BL      sub_FF8C3658 \n"
 877 "    BL      sub_FF8C44D0 \n"
 878 "    BL      sub_FF8C3FB0 \n"
 879 "    B       loc_FF8DB1A4 \n"
 880 
 881 "loc_FF8DB230:\n"
 882 "    CMP     R1, #0x32 \n"
 883 "    BNE     loc_FF8DB284 \n"
 884 "    LDR     R0, [R6, #0x1C] \n"
 885 "    MOV     R1, #4 \n"
 886 "    BL      sub_FF829C0C /*_ClearEventFlag*/ \n"
 887 "    LDR     R1, =0xFF8D6484 \n"
 888 "    LDR     R0, =0xFFFFF400 \n"
 889 "    MOV     R2, #4 \n"
 890 "    BL      sub_FF8DC954 \n"
 891 "    BL      sub_FF8C32EC \n"
 892 "    LDR     R0, [R6, #0x1C] \n"
 893 "    MOV     R2, R7 \n"
 894 "    MOV     R1, #4 \n"
 895 "    BL      sub_FF829A0C /*_WaitForAnyEventFlag*/ \n"
 896 "    TST     R0, #1 \n"
 897 "    BEQ     loc_FF8DB1A4 \n"
 898 "    LDR     R2, =0x17DA \n"
 899 
 900 "loc_FF8DB274:\n"
 901 "    LDR     R1, =0xFF8D6C20 /*'ExpDrv.c'*/ \n"
 902 "    MOV     R0, #0 \n"
 903 "    BL      _DebugAssert \n"
 904 "    B       loc_FF8DB1A4 \n"
 905 
 906 "loc_FF8DB284:\n"
 907 "    LDR     R0, [SP, #0x28] \n"
 908 "    MOV     R8, #1 \n"
 909 "    LDR     R1, [R0] \n"
 910 "    CMP     R1, #0x12 \n"
 911 "    CMPNE   R1, #0x13 \n"
 912 "    BNE     loc_FF8DB2EC \n"
 913 "    LDR     R1, [R0, #0x94] \n"
 914 "    ADD     R1, R1, R1, LSL#1 \n"
 915 "    ADD     R1, R0, R1, LSL#2 \n"
 916 "    SUB     R1, R1, #8 \n"
 917 "    LDMIA   R1, {R2,R3,R9} \n"
 918 "    STMIA   R5, {R2,R3,R9} \n"
 919 "    BL      sub_FF8D949C \n"
 920 "    LDR     R0, [SP, #0x28] \n"
 921 "    LDR     R1, [R0, #0x94] \n"
 922 "    LDR     R3, [R0, #0xAC] \n"
 923 "    LDR     R2, [R0, #0xB0] \n"
 924 "    ADD     R0, R0, #4 \n"
 925 "    BLX     R3 \n"
 926 "    LDR     R0, [SP, #0x28] \n"
 927 "    BL      sub_FF8DCC3C \n"
 928 "    LDR     R0, [SP, #0x28] \n"
 929 "    LDR     R1, [R0, #0x94] \n"
 930 "    LDR     R2, [R0, #0xB8] \n"
 931 "    LDR     R3, [R0, #0xB4] \n"
 932 "    B       loc_FF8DB608 \n"
 933 
 934 "loc_FF8DB2EC:\n"
 935 "    CMP     R1, #0x14 \n"
 936 "    CMPNE   R1, #0x15 \n"
 937 "    CMPNE   R1, #0x16 \n"
 938 "    CMPNE   R1, #0x17 \n"
 939 "    CMPNE   R1, #0x18 \n"
 940 "    BNE     loc_FF8DB398 \n"
 941 "    ADD     R3, SP, #0xC \n"
 942 "    MOV     R2, SP \n"
 943 "    ADD     R1, SP, #0x1C \n"
 944 "    BL      sub_FF8D970C \n"
 945 "    CMP     R0, #1 \n"
 946 "    MOV     R9, R0 \n"
 947 "    CMPNE   R9, #5 \n"
 948 "    BNE     loc_FF8DB344 \n"
 949 "    LDR     R0, [SP, #0x28] \n"
 950 "    MOV     R2, R9 \n"
 951 "    LDR     R1, [R0, #0x94] \n"
 952 "    LDR     R12, [R0, #0xAC] \n"
 953 "    LDR     R3, [R0, #0xB0] \n"
 954 "    ADD     R0, R0, #4 \n"
 955 "    BLX     R12 \n"
 956 "    B       loc_FF8DB37C \n"
 957 
 958 "loc_FF8DB344:\n"
 959 "    LDR     R0, [SP, #0x28] \n"
 960 "    CMP     R9, #2 \n"
 961 "    LDR     R1, [R0, #0x94] \n"
 962 "    LDR     R12, [R0, #0xAC] \n"
 963 "    LDR     R3, [R0, #0xB0] \n"
 964 "    CMPNE   R9, #6 \n"
 965 "    MOV     R2, R9 \n"
 966 "    ADD     R0, R0, #4 \n"
 967 "    BNE     loc_FF8DB390 \n"
 968 "    BLX     R12 \n"
 969 "    LDR     R0, [SP, #0x28] \n"
 970 "    MOV     R2, SP \n"
 971 "    ADD     R1, SP, #0x1C \n"
 972 "    BL      sub_FF8DAD5C \n"
 973 
 974 "loc_FF8DB37C:\n"
 975 "    LDR     R0, [SP, #0x28] \n"
 976 "    LDR     R2, [SP, #0xC] \n"
 977 "    MOV     R1, R9 \n"
 978 "    BL      sub_FF8DAFE0 \n"
 979 "    B       loc_FF8DB610 \n"
 980 
 981 "loc_FF8DB390:\n"
 982 "    BLX     R12 \n"
 983 "    B       loc_FF8DB610 \n"
 984 
 985 "loc_FF8DB398:\n"
 986 "    CMP     R1, #0x28 \n"
 987 "    CMPNE   R1, #0x29 \n"
 988 "    BNE     loc_FF8DB3E4 \n"
 989 "    LDR     R1, [R0, #0x94] \n"
 990 "    ADD     R1, R1, R1, LSL#1 \n"
 991 "    ADD     R1, R0, R1, LSL#2 \n"
 992 "    SUB     R1, R1, #8 \n"
 993 "    LDMIA   R1, {R2,R3,R9} \n"
 994 "    STMIA   R5, {R2,R3,R9} \n"
 995 "    BL      sub_FF8D83C8 \n"
 996 "    LDR     R0, [SP, #0x28] \n"
 997 "    LDR     R1, [R0, #0x94] \n"
 998 "    LDR     R3, [R0, #0xAC] \n"
 999 "    LDR     R2, [R0, #0xB0] \n"
1000 "    ADD     R0, R0, #4 \n"
1001 "    BLX     R3 \n"
1002 "    LDR     R0, [SP, #0x28] \n"
1003 "    BL      sub_FF8D8818 \n"
1004 "    B       loc_FF8DB610 \n"
1005 
1006 "loc_FF8DB3E4:\n"
1007 "    ADD     R1, R0, #4 \n"
1008 "    LDMIA   R1, {R2,R3,R9} \n"
1009 "    STMIA   R5, {R2,R3,R9} \n"
1010 "    LDR     R1, [R0] \n"
1011 "    CMP     R1, #0x2C \n"
1012 "    ADDCC   PC, PC, R1, LSL#2 \n"
1013 "    B       loc_FF8DB5F8 \n"
1014 "    B       loc_FF8DB4B0 \n"
1015 "    B       loc_FF8DB4B0 \n"
1016 "    B       loc_FF8DB4B8 \n"
1017 "    B       loc_FF8DB4C0 \n"
1018 "    B       loc_FF8DB4C0 \n"
1019 "    B       loc_FF8DB4C0 \n"
1020 "    B       loc_FF8DB4B0 \n"
1021 "    B       loc_FF8DB4B8 \n"
1022 "    B       loc_FF8DB4C0 \n"
1023 "    B       loc_FF8DB4C0 \n"
1024 "    B       loc_FF8DB4D8 \n"
1025 "    B       loc_FF8DB4D8 \n"
1026 "    B       loc_FF8DB5E4 \n"
1027 "    B       loc_FF8DB5EC \n"
1028 "    B       loc_FF8DB5EC \n"
1029 "    B       loc_FF8DB5EC \n"
1030 "    B       loc_FF8DB5EC \n"
1031 "    B       loc_FF8DB5F4 \n"
1032 "    B       loc_FF8DB5F8 \n"
1033 "    B       loc_FF8DB5F8 \n"
1034 "    B       loc_FF8DB5F8 \n"
1035 "    B       loc_FF8DB5F8 \n"
1036 "    B       loc_FF8DB5F8 \n"
1037 "    B       loc_FF8DB5F8 \n"
1038 "    B       loc_FF8DB5F8 \n"
1039 "    B       loc_FF8DB4C8 \n"
1040 "    B       loc_FF8DB4D0 \n"
1041 "    B       loc_FF8DB4D0 \n"
1042 "    B       loc_FF8DB4D0 \n"
1043 "    B       loc_FF8DB4E4 \n"
1044 "    B       loc_FF8DB4E4 \n"
1045 "    B       loc_FF8DB4E4 \n"
1046 "    B       loc_FF8DB4EC \n"
1047 "    B       loc_FF8DB524 \n"
1048 "    B       loc_FF8DB5F8 \n"
1049 "    B       loc_FF8DB5F8 \n"
1050 "    B       loc_FF8DB55C \n"
1051 "    B       loc_FF8DB594 \n"
1052 "    B       loc_FF8DB5CC \n"
1053 "    B       loc_FF8DB5CC \n"
1054 "    B       loc_FF8DB5F8 \n"
1055 "    B       loc_FF8DB5F8 \n"
1056 "    B       loc_FF8DB5D4 \n"
1057 "    B       loc_FF8DB5DC \n"
1058 
1059 "loc_FF8DB4B0:\n"
1060 "    BL      sub_FF8D6AA0 \n"
1061 "    B       loc_FF8DB5F8 \n"
1062 
1063 "loc_FF8DB4B8:\n"
1064 "    BL      sub_FF8D6D6C \n"
1065 "    B       loc_FF8DB5F8 \n"
1066 
1067 "loc_FF8DB4C0:\n"
1068 "    BL      sub_FF8D6FAC \n"
1069 "    B       loc_FF8DB5F8 \n"
1070 
1071 "loc_FF8DB4C8:\n"
1072 "    BL      sub_FF8D72F4 \n"
1073 "    B       loc_FF8DB5F8 \n"
1074 
1075 "loc_FF8DB4D0:\n"
1076 "    BL      sub_FF8D7524 \n"
1077 "    B       loc_FF8DB5F8 \n"
1078 
1079 "loc_FF8DB4D8:\n"
1080 "    BL      sub_FF8D7914_my \n"  // --> Patched. Old value = 0xFF8D7914.
1081 "    MOV     R8, #0 \n"
1082 "    B       loc_FF8DB5F8 \n"
1083 
1084 "loc_FF8DB4E4:\n"
1085 "    BL      sub_FF8D7AE8 \n"
1086 "    B       loc_FF8DB5F8 \n"
1087 
1088 "loc_FF8DB4EC:\n"
1089 "    LDRH    R1, [R0, #4] \n"
1090 "    STRH    R1, [SP, #0x1C] \n"
1091 "    LDRH    R1, [R4, #2] \n"
1092 "    STRH    R1, [SP, #0x1E] \n"
1093 "    LDRH    R1, [R4, #4] \n"
1094 "    STRH    R1, [SP, #0x20] \n"
1095 "    LDRH    R1, [R4, #6] \n"
1096 "    STRH    R1, [SP, #0x22] \n"
1097 "    LDRH    R1, [R0, #0xC] \n"
1098 "    STRH    R1, [SP, #0x24] \n"
1099 "    LDRH    R1, [R4, #0xA] \n"
1100 "    STRH    R1, [SP, #0x26] \n"
1101 "    BL      sub_FF8D8050 \n"
1102 "    B       loc_FF8DB5F8 \n"
1103 
1104 "loc_FF8DB524:\n"
1105 "    LDRH    R1, [R0, #4] \n"
1106 "    STRH    R1, [SP, #0x1C] \n"
1107 "    LDRH    R1, [R4, #2] \n"
1108 "    STRH    R1, [SP, #0x1E] \n"
1109 "    LDRH    R1, [R4, #4] \n"
1110 "    STRH    R1, [SP, #0x20] \n"
1111 "    LDRH    R1, [R4, #6] \n"
1112 "    STRH    R1, [SP, #0x22] \n"
1113 "    LDRH    R1, [R4, #8] \n"
1114 "    STRH    R1, [SP, #0x24] \n"
1115 "    LDRH    R1, [R4, #0xA] \n"
1116 "    STRH    R1, [SP, #0x26] \n"
1117 "    BL      sub_FF8DC9B4 \n"
1118 "    B       loc_FF8DB5F8 \n"
1119 
1120 "loc_FF8DB55C:\n"
1121 "    LDRH    R1, [R4] \n"
1122 "    STRH    R1, [SP, #0x1C] \n"
1123 "    LDRH    R1, [R0, #6] \n"
1124 "    STRH    R1, [SP, #0x1E] \n"
1125 "    LDRH    R1, [R4, #4] \n"
1126 "    STRH    R1, [SP, #0x20] \n"
1127 "    LDRH    R1, [R4, #6] \n"
1128 "    STRH    R1, [SP, #0x22] \n"
1129 "    LDRH    R1, [R4, #8] \n"
1130 "    STRH    R1, [SP, #0x24] \n"
1131 "    LDRH    R1, [R4, #0xA] \n"
1132 "    STRH    R1, [SP, #0x26] \n"
1133 "    BL      sub_FF8DCAE8 \n"
1134 "    B       loc_FF8DB5F8 \n"
1135 
1136 "loc_FF8DB594:\n"
1137 "    LDRH    R1, [R4] \n"
1138 "    STRH    R1, [SP, #0x1C] \n"
1139 "    LDRH    R1, [R4, #2] \n"
1140 "    STRH    R1, [SP, #0x1E] \n"
1141 "    LDRH    R1, [R4, #4] \n"
1142 "    STRH    R1, [SP, #0x20] \n"
1143 "    LDRH    R1, [R4, #6] \n"
1144 "    STRH    R1, [SP, #0x22] \n"
1145 "    LDRH    R1, [R0, #0xC] \n"
1146 "    STRH    R1, [SP, #0x24] \n"
1147 "    LDRH    R1, [R4, #0xA] \n"
1148 "    STRH    R1, [SP, #0x26] \n"
1149 "    BL      sub_FF8DCB94 \n"
1150 "    B       loc_FF8DB5F8 \n"
1151 
1152 "loc_FF8DB5CC:\n"
1153 "    BL      sub_FF8D8164 \n"
1154 "    B       loc_FF8DB5F8 \n"
1155 
1156 "loc_FF8DB5D4:\n"
1157 "    BL      sub_FF8D8930 \n"
1158 "    B       loc_FF8DB5F8 \n"
1159 
1160 "loc_FF8DB5DC:\n"
1161 "    BL      sub_FF8D8CC8 \n"
1162 "    B       loc_FF8DB5F8 \n"
1163 
1164 "loc_FF8DB5E4:\n"
1165 "    BL      sub_FF8D8F38 \n"
1166 "    B       loc_FF8DB5F8 \n"
1167 
1168 "loc_FF8DB5EC:\n"
1169 "    BL      sub_FF8D9104 \n"
1170 "    B       loc_FF8DB5F8 \n"
1171 
1172 "loc_FF8DB5F4:\n"
1173 "    BL      sub_FF8D927C \n"
1174 
1175 "loc_FF8DB5F8:\n"
1176 "    LDR     R0, [SP, #0x28] \n"
1177 "    LDR     R1, [R0, #0x94] \n"
1178 "    LDR     R2, [R0, #0xB0] \n"
1179 "    LDR     R3, [R0, #0xAC] \n"
1180 
1181 "loc_FF8DB608:\n"
1182 "    ADD     R0, R0, #4 \n"
1183 "    BLX     R3 \n"
1184 
1185 "loc_FF8DB610:\n"
1186 "    LDR     R0, [SP, #0x28] \n"
1187 "    LDR     R0, [R0] \n"
1188 "    CMP     R0, #0x10 \n"
1189 "    BEQ     loc_FF8DB648 \n"
1190 "    BGT     loc_FF8DB638 \n"
1191 "    CMP     R0, #1 \n"
1192 "    CMPNE   R0, #4 \n"
1193 "    CMPNE   R0, #0xE \n"
1194 "    BNE     loc_FF8DB67C \n"
1195 "    B       loc_FF8DB648 \n"
1196 
1197 "loc_FF8DB638:\n"
1198 "    CMP     R0, #0x13 \n"
1199 "    CMPNE   R0, #0x18 \n"
1200 "    CMPNE   R0, #0x1B \n"
1201 "    BNE     loc_FF8DB67C \n"
1202 
1203 "loc_FF8DB648:\n"
1204 "    LDRSH   R0, [R4] \n"
1205 "    CMN     R0, #0xC00 \n"
1206 "    LDRNESH R1, [R4, #8] \n"
1207 "    CMNNE   R1, #0xC00 \n"
1208 "    STRNEH  R0, [SP, #0x1C] \n"
1209 "    STRNEH  R1, [SP, #0x24] \n"
1210 "    BNE     loc_FF8DB67C \n"
1211 "    ADD     R0, SP, #0x10 \n"
1212 "    BL      sub_FF8DCE6C \n"
1213 "    LDRH    R0, [SP, #0x10] \n"
1214 "    STRH    R0, [SP, #0x1C] \n"
1215 "    LDRH    R0, [SP, #0x18] \n"
1216 "    STRH    R0, [SP, #0x24] \n"
1217 
1218 "loc_FF8DB67C:\n"
1219 "    LDR     R0, [SP, #0x28] \n"
1220 "    CMP     R8, #1 \n"
1221 "    BNE     loc_FF8DB6CC \n"
1222 "    LDR     R1, [R0, #0x94] \n"
1223 "    MOV     R2, #0xC \n"
1224 "    ADD     R1, R1, R1, LSL#1 \n"
1225 "    ADD     R0, R0, R1, LSL#2 \n"
1226 "    SUB     R8, R0, #8 \n"
1227 "    LDR     R0, =0x5BE18 \n"
1228 "    ADD     R1, SP, #0x1C \n"
1229 "    BL      sub_006BA828 \n"
1230 "    LDR     R0, =0x5BE24 \n"
1231 "    MOV     R2, #0xC \n"
1232 "    ADD     R1, SP, #0x1C \n"
1233 "    BL      sub_006BA828 \n"
1234 "    LDR     R0, =0x5BE30 \n"
1235 "    MOV     R2, #0xC \n"
1236 "    MOV     R1, R8 \n"
1237 "    BL      sub_006BA828 \n"
1238 "    B       loc_FF8DB744 \n"
1239 
1240 "loc_FF8DB6CC:\n"
1241 "    LDR     R0, [R0] \n"
1242 "    MOV     R3, #1 \n"
1243 "    CMP     R0, #0xB \n"
1244 "    BNE     loc_FF8DB710 \n"
1245 "    MOV     R2, #0 \n"
1246 "    STRD    R2, [SP] \n"
1247 "    MOV     R2, R3 \n"
1248 "    MOV     R1, R3 \n"
1249 "    MOV     R0, #0 \n"
1250 "    BL      sub_FF8D686C \n"
1251 "    MOV     R3, #1 \n"
1252 "    MOV     R2, #0 \n"
1253 "    STRD    R2, [SP] \n"
1254 "    MOV     R2, R3 \n"
1255 "    MOV     R1, R3 \n"
1256 "    MOV     R0, #0 \n"
1257 "    B       loc_FF8DB740 \n"
1258 
1259 "loc_FF8DB710:\n"
1260 "    MOV     R2, #1 \n"
1261 "    STRD    R2, [SP] \n"
1262 "    MOV     R3, R2 \n"
1263 "    MOV     R1, R2 \n"
1264 "    MOV     R0, R2 \n"
1265 "    BL      sub_FF8D686C \n"
1266 "    MOV     R3, #1 \n"
1267 "    MOV     R2, R3 \n"
1268 "    MOV     R1, R3 \n"
1269 "    MOV     R0, R3 \n"
1270 "    STR     R3, [SP] \n"
1271 "    STR     R3, [SP, #4] \n"
1272 
1273 "loc_FF8DB740:\n"
1274 "    BL      sub_FF8D69E8 \n"
1275 
1276 "loc_FF8DB744:\n"
1277 "    LDR     R0, [SP, #0x28] \n"
1278 "    BL      sub_FF8DC8F0 \n"
1279 "    B       loc_FF8DB0D0 \n"
1280 );
1281 }
1282 
1283 /*************************************************************/
1284 //** sub_FF8D7914_my @ 0xFF8D7914 - 0xFF8D79D8, length=50
1285 void __attribute__((naked,noinline)) sub_FF8D7914_my() {
1286 asm volatile (
1287 "    STMFD   SP!, {R4-R8,LR} \n"
1288 "    LDR     R7, =0x43DC \n"
1289 "    MOV     R4, R0 \n"
1290 "    LDR     R0, [R7, #0x1C] \n"
1291 "    MOV     R1, #0x3E \n"
1292 "    BL      sub_FF829C0C /*_ClearEventFlag*/ \n"
1293 "    MOV     R2, #0 \n"
1294 "    LDRSH   R0, [R4, #4] \n"
1295 "    MOV     R3, #1 \n"
1296 "    MOV     R1, R2 \n"
1297 "    BL      sub_FF8D64EC \n"
1298 "    MOV     R6, R0 \n"
1299 "    LDRSH   R0, [R4, #6] \n"
1300 "    BL      sub_FF8D66CC \n"
1301 "    LDRSH   R0, [R4, #8] \n"
1302 "    BL      sub_FF8D6724 \n"
1303 "    LDRSH   R0, [R4, #0xA] \n"
1304 "    BL      sub_FF8D677C \n"
1305 "    LDRSH   R0, [R4, #0xC] \n"
1306 "    MOV     R1, #0 \n"
1307 "    BL      sub_FF8D67D4 \n"
1308 "    MOV     R5, R0 \n"
1309 "    LDR     R0, [R4] \n"
1310 "    LDR     R8, =0x5BE30 \n"
1311 "    CMP     R0, #0xB \n"
1312 "    MOVEQ   R6, #0 \n"
1313 "    MOVEQ   R5, R6 \n"
1314 "    BEQ     loc_FF8D79AC \n"
1315 "    CMP     R6, #1 \n"
1316 "    BNE     loc_FF8D79AC \n"
1317 "    LDRSH   R0, [R4, #4] \n"
1318 "    LDR     R1, =0xFF8D6444 \n"
1319 "    MOV     R2, #2 \n"
1320 "    BL      sub_FF887B18 \n"
1321 "    STRH    R0, [R4, #4] \n"
1322 "    MOV     R0, #0 \n"
1323 "    STR     R0, [R7, #0x28] \n"
1324 "    B       loc_FF8D79B4 \n"
1325 
1326 "loc_FF8D79AC:\n"
1327 "    LDRH    R0, [R8] \n"
1328 "    STRH    R0, [R4, #4] \n"
1329 
1330 "loc_FF8D79B4:\n"
1331 "    CMP     R5, #1 \n"
1332 "    LDRNEH  R0, [R8, #8] \n"
1333 "    BNE     loc_FF8D79D0 \n"
1334 "    LDRSH   R0, [R4, #0xC] \n"
1335 "    LDR     R1, =0xFF8D64C8 \n"
1336 "    MOV     R2, #0x20 \n"
1337 "    BL      sub_FF8DC970 \n"
1338 
1339 "loc_FF8D79D0:\n"
1340 "    STRH    R0, [R4, #0xC] \n"
1341 "    LDRSH   R0, [R4, #6] \n"
1342 "    BL      sub_FF8C3364_my \n"  // --> Patched. Old value = 0xFF8C3364.
1343 "    LDR     PC, =0xFF8D79DC \n"  // Continue in firmware
1344 );
1345 }
1346 
1347 /*************************************************************/
1348 //** sub_FF8C3364_my @ 0xFF8C3364 - 0xFF8C33D8, length=30
1349 void __attribute__((naked,noinline)) sub_FF8C3364_my() {
1350 asm volatile (
1351 "    STMFD   SP!, {R4-R6,LR} \n"
1352 "    LDR     R5, =0x3FBC \n"
1353 "    MOV     R4, R0 \n"
1354 "    LDR     R0, [R5, #4] \n"
1355 "    CMP     R0, #1 \n"
1356 "    LDRNE   R2, =0x16B \n"
1357 "    LDRNE   R1, =0xFF8C3108 /*'Shutter.c'*/ \n"
1358 "    MOVNE   R0, #0 \n"
1359 "    BLNE    _DebugAssert \n"
1360 "    CMN     R4, #0xC00 \n"
1361 "    LDREQSH R4, [R5, #2] \n"
1362 "    CMN     R4, #0xC00 \n"
1363 "    LDREQ   R2, =0x171 \n"
1364 "    LDREQ   R1, =0xFF8C3108 /*'Shutter.c'*/ \n"
1365 "    MOVEQ   R0, #0 \n"
1366 "    STRH    R4, [R5, #2] \n"
1367 "    BLEQ    _DebugAssert \n"
1368 "    MOV     R0, R4 \n"
1369 "    BL      apex2us \n"  // --> Patched. Old value = _apex2us.
1370 "    MOV     R4, R0 \n"
1371 //"  BL      _sub_FF90C5D4 \n"  // --> Nullsub call removed.
1372 "    MOV     R0, R4 \n"
1373 "    BL      sub_FF90F658 \n"
1374 "    TST     R0, #1 \n"
1375 "    LDMEQFD SP!, {R4-R6,PC} \n"
1376 "    LDMFD   SP!, {R4-R6,LR} \n"
1377 "    LDR     R2, =0x176 \n"
1378 "    LDR     R1, =0xFF8C3108 /*'Shutter.c'*/ \n"
1379 "    MOV     R0, #0 \n"
1380 "    B       _DebugAssert \n"
1381 );
1382 }

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