root/platform/a2200/sub/100b/capt_seq.c

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

DEFINITIONS

This source file includes following definitions.
  1. capt_seq_task
  2. sub_FF968ED8_my
  3. exp_drv_task
  4. sub_FF8B8CE8_my
  5. sub_FF8A9BA4_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_entry.S
   9 #define NR_AUTO (0)                 // have to explictly reset value back to 0 to enable auto
  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 @ 0xFF8788F0 - 0xFF878B84, length=166
  16 void __attribute__((naked,noinline)) capt_seq_task() {
  17 asm volatile (
  18 "    STMFD   SP!, {R3-R9,LR} \n"
  19 "    LDR     R5, =0x39E7C \n"
  20 "    LDR     R7, =0x2B20 \n"
  21 "    MOV     R6, #0 \n"
  22 
  23 "loc_FF878900:\n"
  24 "    LDR     R0, [R7, #4] \n"
  25 "    MOV     R2, #0 \n"
  26 "    MOV     R1, SP \n"
  27 "    BL      sub_FF839B6C /*_ReceiveMessageQueue*/ \n"
  28 "    TST     R0, #1 \n"
  29 "    BEQ     loc_FF87892C \n"
  30 "    LDR     R1, =0x476 \n"
  31 "    LDR     R0, =0xFF878490 /*'SsShootTask.c'*/ \n"
  32 "    BL      _DebugAssert \n"
  33 "    BL      _ExitTask \n"
  34 "    LDMFD   SP!, {R3-R9,PC} \n"
  35 
  36 "loc_FF87892C:\n"
  37 "    LDR     R0, [SP] \n"
  38 "    LDR     R1, [R0] \n"
  39 "    CMP     R1, #0x20 \n"
  40 "    ADDCC   PC, PC, R1, LSL#2 \n"
  41 "    B       loc_FF878B4C \n"
  42 "    B       loc_FF8789C0 \n"
  43 "    B       loc_FF8789D8 \n"
  44 "    B       loc_FF878A04 \n"
  45 "    B       loc_FF878A18 \n"
  46 "    B       loc_FF878A10 \n"
  47 "    B       loc_FF878A24 \n"
  48 "    B       loc_FF878A2C \n"
  49 "    B       loc_FF878A34 \n"
  50 "    B       loc_FF878A50 \n"
  51 "    B       loc_FF878A78 \n"
  52 "    B       loc_FF878A5C \n"
  53 "    B       loc_FF878A68 \n"
  54 "    B       loc_FF878A70 \n"
  55 "    B       loc_FF878A80 \n"
  56 "    B       loc_FF878A88 \n"
  57 "    B       loc_FF878A90 \n"
  58 "    B       loc_FF878A98 \n"
  59 "    B       loc_FF878AA0 \n"
  60 "    B       loc_FF878AAC \n"
  61 "    B       loc_FF878AB4 \n"
  62 "    B       loc_FF878ABC \n"
  63 "    B       loc_FF878AC4 \n"
  64 "    B       loc_FF878ACC \n"
  65 "    B       loc_FF878AD8 \n"
  66 "    B       loc_FF878AE0 \n"
  67 "    B       loc_FF878AE8 \n"
  68 "    B       loc_FF878AF0 \n"
  69 "    B       loc_FF878AF8 \n"
  70 "    B       loc_FF878B00 \n"
  71 "    B       loc_FF878B08 \n"
  72 "    B       loc_FF878B14 \n"
  73 "    B       loc_FF878B58 \n"
  74 
  75 "loc_FF8789C0:\n"
  76 "    BL      shooting_expo_iso_override\n"      // added
  77 "    BL      sub_FF8790BC \n"
  78 "    BL      shooting_expo_param_override\n"    // added
  79 "    BL      sub_FF876588 \n"
  80 "    MOV     R0, #0\n"                          // added
  81 "    STR     R0, [R5,#0x28]\n"                  // added, fixes overrides behavior at short shutter press (from S95)
  82 //"  LDR     R0, [R5, #0x28] \n"  // above patch makes these three lines redundant
  83 //"  CMP     R0, #0 \n"
  84 //"  BLNE    _sub_FF968FB0 \n"
  85 "    B       loc_FF878B58 \n"
  86 
  87 "loc_FF8789D8:\n"
  88 "    LDR     R8, [R0, #0xC] \n"
  89 "    MOV     R0, R8 \n"
  90 "    BL      sub_FF968ED8_my \n"  // --> Patched. Old value = 0xFF968ED8.
  91 "    BL      capt_seq_hook_raw_here\n"
  92 "    MOV     R4, R0 \n"
  93 "    MOV     R2, R8 \n"
  94 "    MOV     R1, #1 \n"
  95 "    BL      sub_FF876B60 \n"
  96 "    TST     R4, #1 \n"
  97 "    MOVEQ   R0, R8 \n"
  98 "    BLEQ    sub_FF968A04 \n"
  99 "    B       loc_FF878B58 \n"
 100 
 101 "loc_FF878A04:\n"
 102 "    MOV     R0, #1 \n"
 103 "    BL      sub_FF87935C \n"
 104 "    B       loc_FF878B58 \n"
 105 
 106 "loc_FF878A10:\n"
 107 "    BL      sub_FF878D58 \n"
 108 "    B       loc_FF878A1C \n"
 109 
 110 "loc_FF878A18:\n"
 111 "    BL      sub_FF87909C \n"
 112 
 113 "loc_FF878A1C:\n"
 114 "    STR     R6, [R5, #0x28] \n"
 115 "    B       loc_FF878B58 \n"
 116 
 117 "loc_FF878A24:\n"
 118 "    BL      sub_FF8790A4 \n"
 119 "    B       loc_FF878B58 \n"
 120 
 121 "loc_FF878A2C:\n"
 122 "    BL      sub_FF879270 \n"
 123 "    B       loc_FF878A54 \n"
 124 
 125 "loc_FF878A34:\n"
 126 "    LDR     R4, [R0, #0xC] \n"
 127 "    MOV     R0, R4 \n"
 128 "    BL      sub_FF969004 \n"
 129 "    MOV     R2, R4 \n"
 130 "    MOV     R1, #9 \n"
 131 "    BL      sub_FF876B60 \n"
 132 "    B       loc_FF878B58 \n"
 133 
 134 "loc_FF878A50:\n"
 135 "    BL      sub_FF8792D4 \n"
 136 
 137 "loc_FF878A54:\n"
 138 "    BL      sub_FF876588 \n"
 139 "    B       loc_FF878B58 \n"
 140 
 141 "loc_FF878A5C:\n"
 142 "    LDR     R0, [R5, #0x58] \n"
 143 "    BL      sub_FF8797A0 \n"
 144 "    B       loc_FF878B58 \n"
 145 
 146 "loc_FF878A68:\n"
 147 "    BL      sub_FF879AEC \n"
 148 "    B       loc_FF878B58 \n"
 149 
 150 "loc_FF878A70:\n"
 151 "    BL      sub_FF879B50 \n"
 152 "    B       loc_FF878B58 \n"
 153 
 154 "loc_FF878A78:\n"
 155 "    BL      sub_FF87909C \n"
 156 "    B       loc_FF878B58 \n"
 157 
 158 "loc_FF878A80:\n"
 159 "    BL      sub_FF967E0C \n"
 160 "    B       loc_FF878B58 \n"
 161 
 162 "loc_FF878A88:\n"
 163 "    BL      sub_FF968018 \n"
 164 "    B       loc_FF878B58 \n"
 165 
 166 "loc_FF878A90:\n"
 167 "    BL      sub_FF9680BC \n"
 168 "    B       loc_FF878B58 \n"
 169 
 170 "loc_FF878A98:\n"
 171 "    BL      sub_FF96818C \n"
 172 "    B       loc_FF878B58 \n"
 173 
 174 "loc_FF878AA0:\n"
 175 "    MOV     R0, #0 \n"
 176 "    BL      sub_FF968394 \n"
 177 "    B       loc_FF878B58 \n"
 178 
 179 "loc_FF878AAC:\n"
 180 "    BL      sub_FF96850C \n"
 181 "    B       loc_FF878B58 \n"
 182 
 183 "loc_FF878AB4:\n"
 184 "    BL      sub_FF9685B0 \n"
 185 "    B       loc_FF878B58 \n"
 186 
 187 "loc_FF878ABC:\n"
 188 "    BL      sub_FF968690 \n"
 189 "    B       loc_FF878B58 \n"
 190 
 191 "loc_FF878AC4:\n"
 192 "    BL      sub_FF8794C8 \n"
 193 "    B       loc_FF878B58 \n"
 194 
 195 "loc_FF878ACC:\n"
 196 "    BL      sub_FF8794F4 \n"
 197 "    BL      sub_FF837B24 \n"
 198 "    B       loc_FF878B58 \n"
 199 
 200 "loc_FF878AD8:\n"
 201 "    BL      sub_FF968250 \n"
 202 "    B       loc_FF878B58 \n"
 203 
 204 "loc_FF878AE0:\n"
 205 "    BL      sub_FF968290 \n"
 206 "    B       loc_FF878B58 \n"
 207 
 208 "loc_FF878AE8:\n"
 209 "    BL      sub_FF87BDF0 \n"
 210 "    B       loc_FF878B58 \n"
 211 
 212 "loc_FF878AF0:\n"
 213 "    BL      sub_FF87BE60 \n"
 214 "    B       loc_FF878B58 \n"
 215 
 216 "loc_FF878AF8:\n"
 217 "    BL      sub_FF9687C8 \n"
 218 "    B       loc_FF878B58 \n"
 219 
 220 "loc_FF878B00:\n"
 221 "    BL      sub_FF96882C \n"
 222 "    B       loc_FF878B58 \n"
 223 
 224 "loc_FF878B08:\n"
 225 "    BL      sub_FF87BEBC \n"
 226 "    BL      sub_FF87BE7C \n"
 227 "    B       loc_FF878B58 \n"
 228 
 229 "loc_FF878B14:\n"
 230 "    MOV     R0, #1 \n"
 231 "    BL      sub_FF96977C \n"
 232 "    MOV     R0, #1 \n"
 233 "    BL      sub_FF9698A4 \n"
 234 "    LDRH    R0, [R5, #0x98] \n"
 235 "    CMP     R0, #4 \n"
 236 "    LDRNEH  R0, [R5] \n"
 237 "    SUBNE   R1, R0, #0x4200 \n"
 238 "    SUBNES  R1, R1, #0x2A \n"
 239 "    BNE     loc_FF878B58 \n"
 240 "    BL      sub_FF87BE60 \n"
 241 "    BL      sub_FF87C460 \n"
 242 "    BL      sub_FF87C2E0 \n"
 243 "    B       loc_FF878B58 \n"
 244 
 245 "loc_FF878B4C:\n"
 246 "    LDR     R1, =0x5D7 \n"
 247 "    LDR     R0, =0xFF878490 /*'SsShootTask.c'*/ \n"
 248 "    BL      _DebugAssert \n"
 249 
 250 "loc_FF878B58:\n"
 251 "    LDR     R0, [SP] \n"
 252 "    LDR     R1, [R0, #4] \n"
 253 "    LDR     R0, [R7] \n"
 254 "    BL      sub_FF8828F8 /*_SetEventFlag*/ \n"
 255 "    LDR     R4, [SP] \n"
 256 "    LDR     R0, [R4, #8] \n"
 257 "    CMP     R0, #0 \n"
 258 "    LDREQ   R0, =0xFF878490 /*'SsShootTask.c'*/ \n"
 259 "    MOVEQ   R1, #0x118 \n"
 260 "    BLEQ    _DebugAssert \n"
 261 "    STR     R6, [R4, #8] \n"
 262 "    B       loc_FF878900 \n"
 263 );
 264 }
 265 
 266 /*************************************************************/
 267 //** sub_FF968ED8_my @ 0xFF968ED8 - 0xFF968FAC, length=54
 268 void __attribute__((naked,noinline)) sub_FF968ED8_my() {
 269 asm volatile (
 270 "    STMFD   SP!, {R3-R7,LR} \n"
 271 "    LDR     R6, =0x39E7C \n"
 272 "    MOV     R5, R0 \n"
 273 "    LDR     R0, [R6, #0x28] \n"
 274 "    MOV     R4, #0 \n"
 275 "    CMP     R0, #0 \n"
 276 "    BNE     loc_FF968F08 \n"
 277 "    MOV     R0, #0xC \n"
 278 "    BL      sub_FF87D974 \n"
 279 "    TST     R0, #1 \n"
 280 "    MOVNE   R0, #1 \n"
 281 "    BNE     loc_FF968FAC \n"
 282 
 283 "loc_FF968F08:\n"
 284 "    BL      sub_FF8790AC \n"
 285 "    LDR     R0, [R6, #0x28] \n"
 286 "    CMP     R0, #0 \n"
 287 "    BNE     loc_FF968F94 \n"
 288 "    MOV     R0, R5 \n"
 289 "    BL      sub_FF968918 \n"
 290 "    TST     R0, #1 \n"
 291 "    BNE     loc_FF968FAC \n"
 292 "    MOV     R0, R5 \n"
 293 "    BL      sub_FF968BC4 \n"
 294 "    BL      sub_FF969558 \n"
 295 "    BL      wait_until_remote_button_is_released\n"    // added
 296 "    BL      capt_seq_hook_set_nr\n"                    // added
 297 "    LDRH    R1, [R6] \n"
 298 "    SUB     R0, R1, #0x8200 \n"
 299 "    SUBS    R0, R0, #0x2D \n"
 300 "    BNE     loc_FF968F84 \n"
 301 "    MOV     R4, #1 \n"
 302 "    MOV     R2, #2 \n"
 303 "    MOV     R1, SP \n"
 304 "    ADD     R0, R2, #0x15C \n"
 305 "    STR     R4, [SP] \n"
 306 "    BL      _GetPropertyCase \n"
 307 "    TST     R0, #1 \n"
 308 "    MOVNE   R1, #0xBC \n"
 309 "    LDRNE   R0, =0xFF96905C /*'SsCaptureSeq.c'*/ \n"
 310 "    BLNE    _DebugAssert \n"
 311 "    LDRH    R0, [SP] \n"
 312 "    CMP     R0, #1 \n"
 313 "    STRHI   R4, [R5, #0xD4] \n"
 314 "    BHI     loc_FF968FA4 \n"
 315 "    MOV     R0, #0 \n"
 316 "    STR     R0, [R5, #0xD4] \n"
 317 
 318 "loc_FF968F84:\n"
 319 "    MOV     R0, R5 \n"
 320 "    BL      sub_FFAAE864 \n"
 321 "    MOV     R4, R0 \n"
 322 "    B       loc_FF968FA8 \n"
 323 
 324 "loc_FF968F94:\n"
 325 "    LDR     R0, =0x69A4 \n"
 326 "    LDR     R0, [R0] \n"
 327 "    CMP     R0, #0 \n"
 328 "    BEQ     loc_FF968FA8 \n"
 329 
 330 "loc_FF968FA4:\n"
 331 "    MOV     R4, #0x1D \n"
 332 
 333 "loc_FF968FA8:\n"
 334 "    MOV     R0, R4 \n"
 335 
 336 "loc_FF968FAC:\n"
 337 "    LDMFD   SP!, {R3-R7,PC} \n"
 338 );
 339 }
 340 
 341 /*************************************************************/
 342 //** exp_drv_task @ 0xFF8BBE80 - 0xFF8BC54C, length=436
 343 void __attribute__((naked,noinline)) exp_drv_task() {
 344 asm volatile (
 345 "    STMFD   SP!, {R4-R9,LR} \n"
 346 "    SUB     SP, SP, #0x24 \n"
 347 "    LDR     R6, =0x3E38 \n"
 348 "    LDR     R7, =0xBB8 \n"
 349 "    LDR     R4, =0x55374 \n"
 350 "    MOV     R0, #0 \n"
 351 "    ADD     R5, SP, #0x14 \n"
 352 "    STR     R0, [SP, #0x10] \n"
 353 
 354 "loc_FF8BBEA0:\n"
 355 "    LDR     R0, [R6, #0x20] \n"
 356 "    MOV     R2, #0 \n"
 357 "    ADD     R1, SP, #0x20 \n"
 358 "    BL      sub_FF839B6C /*_ReceiveMessageQueue*/ \n"
 359 "    LDR     R0, [SP, #0x10] \n"
 360 "    CMP     R0, #1 \n"
 361 "    BNE     loc_FF8BBEEC \n"
 362 "    LDR     R0, [SP, #0x20] \n"
 363 "    LDR     R0, [R0] \n"
 364 "    CMP     R0, #0x14 \n"
 365 "    CMPNE   R0, #0x15 \n"
 366 "    CMPNE   R0, #0x16 \n"
 367 "    CMPNE   R0, #0x17 \n"
 368 "    BEQ     loc_FF8BC04C \n"
 369 "    CMP     R0, #0x29 \n"
 370 "    BEQ     loc_FF8BBFD4 \n"
 371 "    ADD     R1, SP, #0x10 \n"
 372 "    MOV     R0, #0 \n"
 373 "    BL      sub_FF8BBE30 \n"
 374 
 375 "loc_FF8BBEEC:\n"
 376 "    LDR     R0, [SP, #0x20] \n"
 377 "    LDR     R1, [R0] \n"
 378 "    CMP     R1, #0x2F \n"
 379 "    BNE     loc_FF8BBF18 \n"
 380 "    BL      sub_FF8BD324 \n"
 381 "    LDR     R0, [R6, #0x1C] \n"
 382 "    MOV     R1, #1 \n"
 383 "    BL      sub_FF8828F8 /*_SetEventFlag*/ \n"
 384 "    BL      _ExitTask \n"
 385 "    ADD     SP, SP, #0x24 \n"
 386 "    LDMFD   SP!, {R4-R9,PC} \n"
 387 
 388 "loc_FF8BBF18:\n"
 389 "    CMP     R1, #0x2E \n"
 390 "    BNE     loc_FF8BBF34 \n"
 391 "    LDR     R2, [R0, #0x8C]! \n"
 392 "    LDR     R1, [R0, #4] \n"
 393 "    MOV     R0, R1 \n"
 394 "    BLX     R2 \n"
 395 "    B       loc_FF8BC544 \n"
 396 
 397 "loc_FF8BBF34:\n"
 398 "    CMP     R1, #0x27 \n"
 399 "    BNE     loc_FF8BBF84 \n"
 400 "    LDR     R0, [R6, #0x1C] \n"
 401 "    MOV     R1, #0x80 \n"
 402 "    BL      sub_FF88292C /*_ClearEventFlag*/ \n"
 403 "    LDR     R0, =0xFF8B7A04 \n"
 404 "    MOV     R1, #0x80 \n"
 405 "    BL      sub_FF95ED54 \n"
 406 "    LDR     R0, [R6, #0x1C] \n"
 407 "    MOV     R2, R7 \n"
 408 "    MOV     R1, #0x80 \n"
 409 "    BL      sub_FF882838 /*_WaitForAllEventFlag*/ \n"
 410 "    TST     R0, #1 \n"
 411 "    LDRNE   R1, =0x1733 \n"
 412 "    BNE     loc_FF8BC040 \n"
 413 
 414 "loc_FF8BBF70:\n"
 415 "    LDR     R1, [SP, #0x20] \n"
 416 "    LDR     R0, [R1, #0x90] \n"
 417 "    LDR     R1, [R1, #0x8C] \n"
 418 "    BLX     R1 \n"
 419 "    B       loc_FF8BC544 \n"
 420 
 421 "loc_FF8BBF84:\n"
 422 "    CMP     R1, #0x28 \n"
 423 "    BNE     loc_FF8BBFCC \n"
 424 "    ADD     R1, SP, #0x10 \n"
 425 "    BL      sub_FF8BBE30 \n"
 426 "    LDR     R0, [R6, #0x1C] \n"
 427 "    MOV     R1, #0x100 \n"
 428 "    BL      sub_FF88292C /*_ClearEventFlag*/ \n"
 429 "    LDR     R0, =0xFF8B7A14 \n"
 430 "    MOV     R1, #0x100 \n"
 431 "    BL      sub_FF95EFE4 \n"
 432 "    LDR     R0, [R6, #0x1C] \n"
 433 "    MOV     R2, R7 \n"
 434 "    MOV     R1, #0x100 \n"
 435 "    BL      sub_FF882838 /*_WaitForAllEventFlag*/ \n"
 436 "    TST     R0, #1 \n"
 437 "    BEQ     loc_FF8BBF70 \n"
 438 "    LDR     R1, =0x173D \n"
 439 "    B       loc_FF8BC040 \n"
 440 
 441 "loc_FF8BBFCC:\n"
 442 "    CMP     R1, #0x29 \n"
 443 "    BNE     loc_FF8BBFE4 \n"
 444 
 445 "loc_FF8BBFD4:\n"
 446 "    LDR     R0, [SP, #0x20] \n"
 447 "    ADD     R1, SP, #0x10 \n"
 448 "    BL      sub_FF8BBE30 \n"
 449 "    B       loc_FF8BBF70 \n"
 450 
 451 "loc_FF8BBFE4:\n"
 452 "    CMP     R1, #0x2C \n"
 453 "    BNE     loc_FF8BBFFC \n"
 454 "    BL      sub_FF8A9E34 \n"
 455 "    BL      sub_FF8AAAB0 \n"
 456 "    BL      sub_FF8AA628 \n"
 457 "    B       loc_FF8BBF70 \n"
 458 
 459 "loc_FF8BBFFC:\n"
 460 "    CMP     R1, #0x2D \n"
 461 "    BNE     loc_FF8BC04C \n"
 462 "    LDR     R0, [R6, #0x1C] \n"
 463 "    MOV     R1, #4 \n"
 464 "    BL      sub_FF88292C /*_ClearEventFlag*/ \n"
 465 "    LDR     R1, =0xFF8B7A34 \n"
 466 "    LDR     R0, =0xFFFFF400 \n"
 467 "    MOV     R2, #4 \n"
 468 "    BL      sub_FF8A98A8 \n"
 469 "    BL      sub_FF8A9B38 \n"
 470 "    LDR     R0, [R6, #0x1C] \n"
 471 "    MOV     R2, R7 \n"
 472 "    MOV     R1, #4 \n"
 473 "    BL      sub_FF882754 /*_WaitForAnyEventFlag*/ \n"
 474 "    TST     R0, #1 \n"
 475 "    BEQ     loc_FF8BBF70 \n"
 476 "    LDR     R1, =0x1765 \n"
 477 
 478 "loc_FF8BC040:\n"
 479 "    LDR     R0, =0xFF8B8128 /*'ExpDrv.c'*/ \n"
 480 "    BL      _DebugAssert \n"
 481 "    B       loc_FF8BBF70 \n"
 482 
 483 "loc_FF8BC04C:\n"
 484 "    LDR     R0, [SP, #0x20] \n"
 485 "    MOV     R8, #1 \n"
 486 "    LDR     R1, [R0] \n"
 487 "    CMP     R1, #0x12 \n"
 488 "    CMPNE   R1, #0x13 \n"
 489 "    BNE     loc_FF8BC11C \n"
 490 "    LDR     R1, [R0, #0x7C] \n"
 491 "    ADD     R1, R1, R1, LSL#1 \n"
 492 "    ADD     R1, R0, R1, LSL#2 \n"
 493 "    SUB     R1, R1, #8 \n"
 494 "    LDMIA   R1, {R2,R3,R9} \n"
 495 "    STMIA   R5, {R2,R3,R9} \n"
 496 "    BL      sub_FF8BA49C \n"
 497 "    LDR     R0, [SP, #0x20] \n"
 498 "    LDR     R1, [R0, #0x7C] \n"
 499 "    LDR     R3, [R0, #0x8C] \n"
 500 "    LDR     R2, [R0, #0x90] \n"
 501 "    ADD     R0, R0, #4 \n"
 502 "    BLX     R3 \n"
 503 "    LDR     R0, [SP, #0x20] \n"
 504 "    BL      sub_FF8BD6C0 \n"
 505 "    LDR     R0, [SP, #0x20] \n"
 506 "    LDR     R1, [R0, #0x7C] \n"
 507 "    LDR     R2, [R0, #0x98] \n"
 508 "    LDR     R3, [R0, #0x94] \n"
 509 "    B       loc_FF8BC430 \n"
 510 
 511 "loc_FF8BC11C:\n"
 512 "    CMP     R1, #0x14 \n"
 513 "    CMPNE   R1, #0x15 \n"
 514 "    CMPNE   R1, #0x16 \n"
 515 "    CMPNE   R1, #0x17 \n"
 516 "    BNE     loc_FF8BC1D4 \n"
 517 "    ADD     R3, SP, #0x10 \n"
 518 "    ADD     R2, SP, #4 \n"
 519 "    ADD     R1, SP, #0x14 \n"
 520 "    BL      sub_FF8BA704 \n"
 521 "    CMP     R0, #1 \n"
 522 "    MOV     R9, R0 \n"
 523 "    CMPNE   R9, #5 \n"
 524 "    BNE     loc_FF8BC170 \n"
 525 "    LDR     R0, [SP, #0x20] \n"
 526 "    MOV     R2, R9 \n"
 527 "    LDR     R1, [R0, #0x7C]! \n"
 528 "    LDR     R12, [R0, #0x10]! \n"
 529 "    LDR     R3, [R0, #4] \n"
 530 "    ADD     R0, SP, #4 \n"
 531 "    BLX     R12 \n"
 532 "    B       loc_FF8BC1A8 \n"
 533 
 534 "loc_FF8BC170:\n"
 535 "    LDR     R0, [SP, #0x20] \n"
 536 "    CMP     R9, #2 \n"
 537 "    LDR     R3, [R0, #0x90] \n"
 538 "    CMPNE   R9, #6 \n"
 539 "    BNE     loc_FF8BC1BC \n"
 540 "    LDR     R12, [R0, #0x8C] \n"
 541 "    MOV     R2, R9 \n"
 542 "    MOV     R1, #1 \n"
 543 "    ADD     R0, SP, #4 \n"
 544 "    BLX     R12 \n"
 545 "    LDR     R0, [SP, #0x20] \n"
 546 "    ADD     R2, SP, #4 \n"
 547 "    ADD     R1, SP, #0x14 \n"
 548 "    BL      sub_FF8BBB7C \n"
 549 
 550 "loc_FF8BC1A8:\n"
 551 "    LDR     R0, [SP, #0x20] \n"
 552 "    LDR     R2, [SP, #0x10] \n"
 553 "    MOV     R1, R9 \n"
 554 "    BL      sub_FF8BBDD0 \n"
 555 "    B       loc_FF8BC438 \n"
 556 
 557 "loc_FF8BC1BC:\n"
 558 "    LDR     R1, [R0, #0x7C] \n"
 559 "    LDR     R12, [R0, #0x8C] \n"
 560 "    MOV     R2, R9 \n"
 561 "    ADD     R0, R0, #4 \n"
 562 "    BLX     R12 \n"
 563 "    B       loc_FF8BC438 \n"
 564 
 565 "loc_FF8BC1D4:\n"
 566 "    CMP     R1, #0x23 \n"
 567 "    CMPNE   R1, #0x24 \n"
 568 "    BNE     loc_FF8BC220 \n"
 569 "    LDR     R1, [R0, #0x7C] \n"
 570 "    ADD     R1, R1, R1, LSL#1 \n"
 571 "    ADD     R1, R0, R1, LSL#2 \n"
 572 "    SUB     R1, R1, #8 \n"
 573 "    LDMIA   R1, {R2,R3,R9} \n"
 574 "    STMIA   R5, {R2,R3,R9} \n"
 575 "    BL      sub_FF8B9514 \n"
 576 "    LDR     R0, [SP, #0x20] \n"
 577 "    LDR     R1, [R0, #0x7C] \n"
 578 "    LDR     R3, [R0, #0x8C] \n"
 579 "    LDR     R2, [R0, #0x90] \n"
 580 "    ADD     R0, R0, #4 \n"
 581 "    BLX     R3 \n"
 582 "    LDR     R0, [SP, #0x20] \n"
 583 "    BL      sub_FF8B9950 \n"
 584 "    B       loc_FF8BC438 \n"
 585 
 586 "loc_FF8BC220:\n"
 587 "    ADD     R1, R0, #4 \n"
 588 "    LDMIA   R1, {R2,R3,R9} \n"
 589 "    STMIA   R5, {R2,R3,R9} \n"
 590 "    LDR     R1, [R0] \n"
 591 "    CMP     R1, #0x27 \n"
 592 "    ADDCC   PC, PC, R1, LSL#2 \n"
 593 "    B       loc_FF8BC420 \n"
 594 "    B       loc_FF8BC2D8 \n"
 595 "    B       loc_FF8BC2D8 \n"
 596 "    B       loc_FF8BC2E0 \n"
 597 "    B       loc_FF8BC2E8 \n"
 598 "    B       loc_FF8BC2E8 \n"
 599 "    B       loc_FF8BC2E8 \n"
 600 "    B       loc_FF8BC2D8 \n"
 601 "    B       loc_FF8BC2E0 \n"
 602 "    B       loc_FF8BC2E8 \n"
 603 "    B       loc_FF8BC2E8 \n"
 604 "    B       loc_FF8BC300 \n"
 605 "    B       loc_FF8BC300 \n"
 606 "    B       loc_FF8BC40C \n"
 607 "    B       loc_FF8BC414 \n"
 608 "    B       loc_FF8BC414 \n"
 609 "    B       loc_FF8BC414 \n"
 610 "    B       loc_FF8BC414 \n"
 611 "    B       loc_FF8BC41C \n"
 612 "    B       loc_FF8BC420 \n"
 613 "    B       loc_FF8BC420 \n"
 614 "    B       loc_FF8BC420 \n"
 615 "    B       loc_FF8BC420 \n"
 616 "    B       loc_FF8BC420 \n"
 617 "    B       loc_FF8BC420 \n"
 618 "    B       loc_FF8BC2F0 \n"
 619 "    B       loc_FF8BC2F8 \n"
 620 "    B       loc_FF8BC2F8 \n"
 621 "    B       loc_FF8BC30C \n"
 622 "    B       loc_FF8BC30C \n"
 623 "    B       loc_FF8BC314 \n"
 624 "    B       loc_FF8BC34C \n"
 625 "    B       loc_FF8BC384 \n"
 626 "    B       loc_FF8BC3BC \n"
 627 "    B       loc_FF8BC3F4 \n"
 628 "    B       loc_FF8BC3F4 \n"
 629 "    B       loc_FF8BC420 \n"
 630 "    B       loc_FF8BC420 \n"
 631 "    B       loc_FF8BC3FC \n"
 632 "    B       loc_FF8BC404 \n"
 633 
 634 "loc_FF8BC2D8:\n"
 635 "    BL      sub_FF8B7FAC \n"
 636 "    B       loc_FF8BC420 \n"
 637 
 638 "loc_FF8BC2E0:\n"
 639 "    BL      sub_FF8B8250 \n"
 640 "    B       loc_FF8BC420 \n"
 641 
 642 "loc_FF8BC2E8:\n"
 643 "    BL      sub_FF8B8478 \n"
 644 "    B       loc_FF8BC420 \n"
 645 
 646 "loc_FF8BC2F0:\n"
 647 "    BL      sub_FF8B8750 \n"
 648 "    B       loc_FF8BC420 \n"
 649 
 650 "loc_FF8BC2F8:\n"
 651 "    BL      sub_FF8B8968 \n"
 652 "    B       loc_FF8BC420 \n"
 653 
 654 "loc_FF8BC300:\n"
 655 "    BL      sub_FF8B8CE8_my \n"  // --> Patched. Old value = 0xFF8B8CE8.
 656 "    MOV     R8, #0 \n"
 657 "    B       loc_FF8BC420 \n"
 658 
 659 "loc_FF8BC30C:\n"
 660 "    BL      sub_FF8B8E30 \n"
 661 "    B       loc_FF8BC420 \n"
 662 
 663 "loc_FF8BC314:\n"
 664 "    LDRH    R1, [R0, #4] \n"
 665 "    STRH    R1, [SP, #0x14] \n"
 666 "    LDRH    R1, [R4, #2] \n"
 667 "    STRH    R1, [SP, #0x16] \n"
 668 "    LDRH    R1, [R4, #4] \n"
 669 "    STRH    R1, [SP, #0x18] \n"
 670 "    LDRH    R1, [R4, #6] \n"
 671 "    STRH    R1, [SP, #0x1A] \n"
 672 "    LDRH    R1, [R0, #0xC] \n"
 673 "    STRH    R1, [SP, #0x1C] \n"
 674 "    LDRH    R1, [R4, #0xA] \n"
 675 "    STRH    R1, [SP, #0x1E] \n"
 676 "    BL      sub_FF8BD3B8 \n"
 677 "    B       loc_FF8BC420 \n"
 678 
 679 "loc_FF8BC34C:\n"
 680 "    LDRH    R1, [R0, #4] \n"
 681 "    STRH    R1, [SP, #0x14] \n"
 682 "    LDRH    R1, [R4, #2] \n"
 683 "    STRH    R1, [SP, #0x16] \n"
 684 "    LDRH    R1, [R4, #4] \n"
 685 "    STRH    R1, [SP, #0x18] \n"
 686 "    LDRH    R1, [R4, #6] \n"
 687 "    STRH    R1, [SP, #0x1A] \n"
 688 "    LDRH    R1, [R4, #8] \n"
 689 "    STRH    R1, [SP, #0x1C] \n"
 690 "    LDRH    R1, [R4, #0xA] \n"
 691 "    STRH    R1, [SP, #0x1E] \n"
 692 "    BL      sub_FF8BD4C0 \n"
 693 "    B       loc_FF8BC420 \n"
 694 
 695 "loc_FF8BC384:\n"
 696 "    LDRH    R1, [R4] \n"
 697 "    STRH    R1, [SP, #0x14] \n"
 698 "    LDRH    R1, [R0, #6] \n"
 699 "    STRH    R1, [SP, #0x16] \n"
 700 "    LDRH    R1, [R4, #4] \n"
 701 "    STRH    R1, [SP, #0x18] \n"
 702 "    LDRH    R1, [R4, #6] \n"
 703 "    STRH    R1, [SP, #0x1A] \n"
 704 "    LDRH    R1, [R4, #8] \n"
 705 "    STRH    R1, [SP, #0x1C] \n"
 706 "    LDRH    R1, [R4, #0xA] \n"
 707 "    STRH    R1, [SP, #0x1E] \n"
 708 "    BL      sub_FF8BD574 \n"
 709 "    B       loc_FF8BC420 \n"
 710 
 711 "loc_FF8BC3BC:\n"
 712 "    LDRH    R1, [R4] \n"
 713 "    STRH    R1, [SP, #0x14] \n"
 714 "    LDRH    R1, [R4, #2] \n"
 715 "    STRH    R1, [SP, #0x16] \n"
 716 "    LDRH    R1, [R4, #4] \n"
 717 "    STRH    R1, [SP, #0x18] \n"
 718 "    LDRH    R1, [R4, #6] \n"
 719 "    STRH    R1, [SP, #0x1A] \n"
 720 "    LDRH    R1, [R0, #0xC] \n"
 721 "    STRH    R1, [SP, #0x1C] \n"
 722 "    LDRH    R1, [R4, #0xA] \n"
 723 "    STRH    R1, [SP, #0x1E] \n"
 724 "    BL      sub_FF8BD61C \n"
 725 "    B       loc_FF8BC420 \n"
 726 
 727 "loc_FF8BC3F4:\n"
 728 "    BL      sub_FF8B9308 \n"
 729 "    B       loc_FF8BC420 \n"
 730 
 731 "loc_FF8BC3FC:\n"
 732 "    BL      sub_FF8B9A54 \n"
 733 "    B       loc_FF8BC420 \n"
 734 
 735 "loc_FF8BC404:\n"
 736 "    BL      sub_FF8B9CFC \n"
 737 "    B       loc_FF8BC420 \n"
 738 
 739 "loc_FF8BC40C:\n"
 740 "    BL      sub_FF8B9EDC \n"
 741 "    B       loc_FF8BC420 \n"
 742 
 743 "loc_FF8BC414:\n"
 744 "    BL      sub_FF8BA124 \n"
 745 "    B       loc_FF8BC420 \n"
 746 
 747 "loc_FF8BC41C:\n"
 748 "    BL      sub_FF8BA294 \n"
 749 
 750 "loc_FF8BC420:\n"
 751 "    LDR     R0, [SP, #0x20] \n"
 752 "    LDR     R1, [R0, #0x7C] \n"
 753 "    LDR     R2, [R0, #0x90] \n"
 754 "    LDR     R3, [R0, #0x8C] \n"
 755 
 756 "loc_FF8BC430:\n"
 757 "    ADD     R0, R0, #4 \n"
 758 "    BLX     R3 \n"
 759 
 760 "loc_FF8BC438:\n"
 761 "    LDR     R1, [SP, #0x20] \n"
 762 "    LDR     R0, [R1] \n"
 763 "    CMP     R0, #0x10 \n"
 764 "    BEQ     loc_FF8BC470 \n"
 765 "    BGT     loc_FF8BC460 \n"
 766 "    CMP     R0, #1 \n"
 767 "    CMPNE   R0, #4 \n"
 768 "    CMPNE   R0, #0xE \n"
 769 "    BNE     loc_FF8BC480 \n"
 770 "    B       loc_FF8BC470 \n"
 771 
 772 "loc_FF8BC460:\n"
 773 "    CMP     R0, #0x13 \n"
 774 "    CMPNE   R0, #0x17 \n"
 775 "    CMPNE   R0, #0x1A \n"
 776 "    BNE     loc_FF8BC480 \n"
 777 
 778 "loc_FF8BC470:\n"
 779 "    LDRH    R0, [R4] \n"
 780 "    STRH    R0, [SP, #0x14] \n"
 781 "    LDRH    R0, [R4, #8] \n"
 782 "    STRH    R0, [SP, #0x1C] \n"
 783 
 784 "loc_FF8BC480:\n"
 785 "    CMP     R8, #1 \n"
 786 "    BNE     loc_FF8BC4CC \n"
 787 "    LDR     R0, [R1, #0x7C] \n"
 788 "    MOV     R2, #0xC \n"
 789 "    ADD     R0, R0, R0, LSL#1 \n"
 790 "    ADD     R0, R1, R0, LSL#2 \n"
 791 "    SUB     R8, R0, #8 \n"
 792 "    LDR     R0, =0x55374 \n"
 793 "    ADD     R1, SP, #0x14 \n"
 794 "    BL      sub_FFB50DC0 \n"
 795 "    LDR     R0, =0x55380 \n"
 796 "    MOV     R2, #0xC \n"
 797 "    ADD     R1, SP, #0x14 \n"
 798 "    BL      sub_FFB50DC0 \n"
 799 "    LDR     R0, =0x5538C \n"
 800 "    MOV     R2, #0xC \n"
 801 "    MOV     R1, R8 \n"
 802 "    BL      sub_FFB50DC0 \n"
 803 "    B       loc_FF8BC544 \n"
 804 
 805 "loc_FF8BC4CC:\n"
 806 "    LDR     R0, [R1] \n"
 807 "    MOV     R3, #1 \n"
 808 "    CMP     R0, #0xB \n"
 809 "    BNE     loc_FF8BC510 \n"
 810 "    MOV     R2, #0 \n"
 811 "    STRD    R2, [SP] \n"
 812 "    MOV     R2, R3 \n"
 813 "    MOV     R1, R3 \n"
 814 "    MOV     R0, #0 \n"
 815 "    BL      sub_FF8B7D8C \n"
 816 "    MOV     R3, #1 \n"
 817 "    MOV     R2, #0 \n"
 818 "    STRD    R2, [SP] \n"
 819 "    MOV     R2, R3 \n"
 820 "    MOV     R1, R3 \n"
 821 "    MOV     R0, #0 \n"
 822 "    B       loc_FF8BC540 \n"
 823 
 824 "loc_FF8BC510:\n"
 825 "    MOV     R2, #1 \n"
 826 "    STRD    R2, [SP] \n"
 827 "    MOV     R3, R2 \n"
 828 "    MOV     R1, R2 \n"
 829 "    MOV     R0, R2 \n"
 830 "    BL      sub_FF8B7D8C \n"
 831 "    MOV     R3, #1 \n"
 832 "    MOV     R2, R3 \n"
 833 "    MOV     R1, R3 \n"
 834 "    MOV     R0, R3 \n"
 835 "    STR     R3, [SP] \n"
 836 "    STR     R3, [SP, #4] \n"
 837 
 838 "loc_FF8BC540:\n"
 839 "    BL      sub_FF8B7EF8 \n"
 840 
 841 "loc_FF8BC544:\n"
 842 "    LDR     R0, [SP, #0x20] \n"
 843 "    BL      sub_FF8BD324 \n"
 844 "    B       loc_FF8BBEA0 \n"
 845 );
 846 }
 847 
 848 /*************************************************************/
 849 //** sub_FF8B8CE8_my @ 0xFF8B8CE8 - 0xFF8B8DB0, length=51
 850 void __attribute__((naked,noinline)) sub_FF8B8CE8_my() {
 851 asm volatile (
 852 "    STMFD   SP!, {R4-R8,LR} \n"
 853 "    LDR     R7, =0x3E38 \n"
 854 "    MOV     R4, R0 \n"
 855 "    LDR     R0, [R7, #0x1C] \n"
 856 "    MOV     R1, #0x3E \n"
 857 "    BL      sub_FF88292C /*_ClearEventFlag*/ \n"
 858 "    MOV     R2, #0 \n"
 859 "    LDRSH   R0, [R4, #4] \n"
 860 "    MOV     R1, R2 \n"
 861 "    BL      sub_FF8B7A94 \n"
 862 "    MOV     R5, R0 \n"
 863 "    LDRSH   R0, [R4, #6] \n"
 864 "    BL      sub_FF8B7BE4 \n"
 865 "    LDRSH   R0, [R4, #8] \n"
 866 "    BL      sub_FF8B7C3C \n"
 867 "    LDRSH   R0, [R4, #0xA] \n"
 868 "    BL      sub_FF8B7C94 \n"
 869 "    LDRSH   R0, [R4, #0xC] \n"
 870 "    MOV     R1, #0 \n"
 871 "    BL      sub_FF8B7CEC \n"
 872 "    MOV     R6, R0 \n"
 873 "    LDRSH   R0, [R4, #0xE] \n"
 874 "    BL      sub_FF8BD354 \n"
 875 "    LDR     R0, [R4] \n"
 876 "    LDR     R8, =0x5538C \n"
 877 "    CMP     R0, #0xB \n"
 878 "    MOVEQ   R5, #0 \n"
 879 "    MOVEQ   R6, R5 \n"
 880 "    BEQ     loc_FF8B8D84 \n"
 881 "    CMP     R5, #1 \n"
 882 "    BNE     loc_FF8B8D84 \n"
 883 "    LDRSH   R0, [R4, #4] \n"
 884 "    LDR     R1, =0xFF8B79F4 \n"
 885 "    MOV     R2, #2 \n"
 886 "    BL      sub_FF95EEA8 \n"
 887 "    STRH    R0, [R4, #4] \n"
 888 "    MOV     R0, #0 \n"
 889 "    STR     R0, [R7, #0x28] \n"
 890 "    B       loc_FF8B8D8C \n"
 891 
 892 "loc_FF8B8D84:\n"
 893 "    LDRH    R0, [R8] \n"
 894 "    STRH    R0, [R4, #4] \n"
 895 
 896 "loc_FF8B8D8C:\n"
 897 "    CMP     R6, #1 \n"
 898 "    LDRNEH  R0, [R8, #8] \n"
 899 "    BNE     loc_FF8B8DA8 \n"
 900 "    LDRSH   R0, [R4, #0xC] \n"
 901 "    LDR     R1, =0xFF8B7A78 \n"
 902 "    MOV     R2, #0x20 \n"
 903 "    BL      sub_FF8BD374 \n"
 904 
 905 "loc_FF8B8DA8:\n"
 906 "    STRH    R0, [R4, #0xC] \n"
 907 "    LDRSH   R0, [R4, #6] \n"
 908 "    BL      sub_FF8A9BA4_my \n"  // --> Patched. Old value = 0xFF8A9BA4.
 909 "    LDR     PC, =0xFF8B8DB4 \n"  // Continue in firmware
 910 );
 911 }
 912 
 913 /*************************************************************/
 914 //** sub_FF8A9BA4_my @ 0xFF8A9BA4 - 0xFF8A9BE4, length=17
 915 void __attribute__((naked,noinline)) sub_FF8A9BA4_my() {
 916 asm volatile (
 917 "    STMFD   SP!, {R4-R6,LR} \n"
 918 "    LDR     R5, =0x3AFC \n"
 919 "    MOV     R4, R0 \n"
 920 "    LDR     R0, [R5, #4] \n"
 921 "    CMP     R0, #1 \n"
 922 "    LDRNE   R1, =0x146 \n"
 923 "    LDRNE   R0, =0xFF8A99DC /*'Shutter.c'*/ \n"
 924 "    BLNE    _DebugAssert \n"
 925 "    CMN     R4, #0xC00 \n"
 926 "    LDREQSH R4, [R5, #2] \n"
 927 "    CMN     R4, #0xC00 \n"
 928 "    MOVEQ   R1, #0x14C \n"
 929 "    LDREQ   R0, =0xFF8A99DC /*'Shutter.c'*/ \n"
 930 "    STRH    R4, [R5, #2] \n"
 931 "    BLEQ    _DebugAssert \n"
 932 "    MOV     R0, R4 \n"
 933 "    BL      apex2us \n"  // --> Patched. Old value = _apex2us.
 934 "    LDR     PC, =0xFF8A9BE8 \n"  // Continue in firmware
 935 );
 936 }

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