root/platform/g7x2/sub/101a/capt_seq.c

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

DEFINITIONS

This source file includes following definitions.
  1. captseq_raw_addr_init_my
  2. clear_current_raw_addr
  3. capt_seq_task
  4. sub_fc08ec20_my
  5. sub_fc08ebd4_my
  6. sub_fc08e9e6_my
  7. sub_fc0a009e_my
  8. developseq_task
  9. exp_drv_task
  10. sub_fc2f32e2_my
  11. sub_fc470d06_my

   1 
   2 #include "lolevel.h"
   3 #include "platform.h"
   4 #include "core.h"
   5 
   6 #define USE_STUBS_NRFLAG 1
   7 #define NR_AUTO (-1) // default value if NRTBL.SetDarkSubType not used is -1 (0 probalby works the same), set to enable auto
   8 
   9 #include "../../../generic/capt_seq.c"
  10 
  11 // first parameter matches active_raw_buffer
  12 // second is pointer to structure
  13 extern int _captseq_raw_addr_init(int raw_index, char **ptr);
  14 char *current_raw_addr;
  15 
  16 void captseq_raw_addr_init_my(int raw_index, char **ptr)
  17 {
  18     _captseq_raw_addr_init(raw_index, ptr);
  19     current_raw_addr = *(ptr + 0x5c/4); // @0xfc09bf88, ptr+0x5c
  20 }
  21 
  22 void clear_current_raw_addr(void)
  23 {
  24     current_raw_addr = NULL;
  25 }
  26 
  27 // capt_seq_task 0xfc0cdb9e
  28 
  29 void __attribute__((naked,noinline)) capt_seq_task() {
  30     asm volatile (
  31             //capdis -f=chdk -s=0xfc07498d -c=31 -stubs PRIMARY.BIN 0xfc000000
  32             "    push    {r3, r4, r5, r6, r7, lr}\n"
  33             "    ldr     r4, =0x00046ee4\n"
  34             "    movs    r6, #0\n"
  35             "    ldr     r5, =0x0000c368\n"
  36             "loc_fc074994:\n"
  37             "    movs    r2, #0\n"
  38             "    mov     r1, sp\n"
  39             "    ldr     r0, [r5, #8]\n"
  40             "    blx     sub_fc34d03c\n"
  41             "    lsls    r0, r0, #0x1f\n"
  42             "    beq     loc_fc0749b6\n"
  43             "    movw    r2, #0x428\n"
  44             "    ldr     r1, =0xfc07459c\n" //  *"SsShootTask.c"
  45             "    movs    r0, #0\n"
  46             "    blx     sub_fc34d24c\n"
  47             "    blx     sub_fc34d0dc\n"
  48             "    pop     {r3, r4, r5, r6, r7, pc}\n"
  49             "loc_fc0749b6:\n"
  50             "    ldr     r0, [sp]\n"
  51             "    ldr     r0, [r0]\n"
  52             "    cmp     r0, #1\n"
  53             "    beq     loc_fc0749ce\n"
  54             "    cmp     r0, #0x2b\n"
  55             "    beq     loc_fc0749ce\n"
  56             "    cmp     r0, #0x1f\n"
  57             "    beq     loc_fc0749ce\n"
  58             "    cmp     r0, #0x23\n"
  59             "    beq     loc_fc0749ce\n"
  60             "    bl      sub_fc09df5c\n"
  61             "loc_fc0749ce:\n"
  62             "    ldr     r0, [sp]\n"
  63             "    ldr     r1, [r0]\n"
  64             "    cmp     r1, #0x34\n"
  65             "    bhs     loc_fc074ab8\n"
  66 
  67             //capdis -f=chdk -s=0xfc0749e9 -c=90 -stubs PRIMARY.BIN 0xfc000000
  68             "    tbb     [pc, r1]\n" // (jumptable r1 157 elements)
  69             "branchtable_fc0749ec:\n"
  70             "    .byte((loc_fc074a20 - branchtable_fc0749ec) / 2)\n" // (case 0)
  71             "    .byte((loc_fc074a36 - branchtable_fc0749ec) / 2)\n" // (case 1)
  72             "    .byte((loc_fc074a3e - branchtable_fc0749ec) / 2)\n" // (case 2)
  73             "    .byte((loc_fc074a4c - branchtable_fc0749ec) / 2)\n" // (case 3)
  74             "    .byte((loc_fc074a46 - branchtable_fc0749ec) / 2)\n" // (case 4)
  75             "    .byte((loc_fc074a56 - branchtable_fc0749ec) / 2)\n" // (case 5)
  76             "    .byte((loc_fc074a5c - branchtable_fc0749ec) / 2)\n" // (case 6)
  77             "    .byte((loc_fc074a66 - branchtable_fc0749ec) / 2)\n" // (case 7)
  78             "    .byte((loc_fc074a6e - branchtable_fc0749ec) / 2)\n" // (case 8)
  79             "    .byte((loc_fc074a7e - branchtable_fc0749ec) / 2)\n" // (case 9)
  80             "    .byte((loc_fc074a86 - branchtable_fc0749ec) / 2)\n" // (case 10)
  81             "    .byte((loc_fc074a8c - branchtable_fc0749ec) / 2)\n" // (case 11)
  82             "    .byte((loc_fc074ba8 - branchtable_fc0749ec) / 2)\n" // (case 12)
  83             "    .byte((loc_fc074a94 - branchtable_fc0749ec) / 2)\n" // (case 13)
  84             "    .byte((loc_fc074a9a - branchtable_fc0749ec) / 2)\n" // (case 14)
  85             "    .byte((loc_fc074aa0 - branchtable_fc0749ec) / 2)\n" // (case 15)
  86             "    .byte((loc_fc074aa6 - branchtable_fc0749ec) / 2)\n" // (case 16)
  87             "    .byte((loc_fc074aac - branchtable_fc0749ec) / 2)\n" // (case 17)
  88             "    .byte((loc_fc074ba8 - branchtable_fc0749ec) / 2)\n" // (case 18)
  89             "    .byte((loc_fc074ab2 - branchtable_fc0749ec) / 2)\n" // (case 19)
  90             "    .byte((loc_fc074aba - branchtable_fc0749ec) / 2)\n" // (case 20)
  91             "    .byte((loc_fc074ac0 - branchtable_fc0749ec) / 2)\n" // (case 21)
  92             "    .byte((loc_fc074ac4 - branchtable_fc0749ec) / 2)\n" // (case 22)
  93             "    .byte((loc_fc074aca - branchtable_fc0749ec) / 2)\n" // (case 23)
  94             "    .byte((loc_fc074ad0 - branchtable_fc0749ec) / 2)\n" // (case 24)
  95             "    .byte((loc_fc074ad6 - branchtable_fc0749ec) / 2)\n" // (case 25)
  96             "    .byte((loc_fc074adc - branchtable_fc0749ec) / 2)\n" // (case 26)
  97             "    .byte((loc_fc074ae2 - branchtable_fc0749ec) / 2)\n" // (case 27)
  98             "    .byte((loc_fc074aea - branchtable_fc0749ec) / 2)\n" // (case 28)
  99             "    .byte((loc_fc074af0 - branchtable_fc0749ec) / 2)\n" // (case 29)
 100             "    .byte((loc_fc074af6 - branchtable_fc0749ec) / 2)\n" // (case 30)
 101             "    .byte((loc_fc074afa - branchtable_fc0749ec) / 2)\n" // (case 31)
 102             "    .byte((loc_fc074b02 - branchtable_fc0749ec) / 2)\n" // (case 32)
 103             "    .byte((loc_fc074b08 - branchtable_fc0749ec) / 2)\n" // (case 33)
 104             "    .byte((loc_fc074b32 - branchtable_fc0749ec) / 2)\n" // (case 34)
 105             "    .byte((loc_fc074b38 - branchtable_fc0749ec) / 2)\n" // (case 35)
 106             "    .byte((loc_fc074b3e - branchtable_fc0749ec) / 2)\n" // (case 36)
 107             "    .byte((loc_fc074b44 - branchtable_fc0749ec) / 2)\n" // (case 37)
 108             "    .byte((loc_fc074b4a - branchtable_fc0749ec) / 2)\n" // (case 38)
 109             "    .byte((loc_fc074b52 - branchtable_fc0749ec) / 2)\n" // (case 39)
 110             "    .byte((loc_fc074b58 - branchtable_fc0749ec) / 2)\n" // (case 40)
 111             "    .byte((loc_fc074ba8 - branchtable_fc0749ec) / 2)\n" // (case 41)
 112             "    .byte((loc_fc074b84 - branchtable_fc0749ec) / 2)\n" // (case 42)
 113             "    .byte((loc_fc074b8a - branchtable_fc0749ec) / 2)\n" // (case 43)
 114             "    .byte((loc_fc074b78 - branchtable_fc0749ec) / 2)\n" // (case 44)
 115             "    .byte((loc_fc074bb6 - branchtable_fc0749ec) / 2)\n" // (case 45)
 116             "    .byte((loc_fc074ba8 - branchtable_fc0749ec) / 2)\n" // (case 46)
 117             "    .byte((loc_fc074ba8 - branchtable_fc0749ec) / 2)\n" // (case 47)
 118             "    .byte((loc_fc074ba8 - branchtable_fc0749ec) / 2)\n" // (case 48)
 119             "    .byte((loc_fc074b9c - branchtable_fc0749ec) / 2)\n" // (case 49)
 120             "    .byte((loc_fc074ba2 - branchtable_fc0749ec) / 2)\n" // (case 50)
 121             "    .byte((loc_fc074b96 - branchtable_fc0749ec) / 2)\n" // (case 51)
 122             ".align 1\n"
 123             "loc_fc074a20:\n"
 124             "    ldr     r0, [r0, #0xc]\n"
 125             "    bl      sub_fc082d96\n"
 126             "    BL      clear_current_raw_addr\n"          // +
 127             "    BL      shooting_expo_param_override\n"    // +
 128             "    bl      sub_fc08fbe8\n"
 129             "    ldr     r0, [r4, #0x28]\n"
 130             "    cmp     r0, #0\n"
 131             "    beq     loc_fc074a34\n"
 132             "    bl      sub_fc08ec20_my\n"                 // -> nr?, remote hook, raw hook (quick, no half press)
 133             "loc_fc074a34:\n"
 134             "    b       loc_fc074bb6\n"
 135             "loc_fc074a36:\n"
 136             "    ldr     r0, [r0, #0x10]\n"
 137             "    bl      sub_fc08ebd4_my\n"                 // -> nr?, remote hook, raw hook
 138             "    b       loc_fc074bb6\n"
 139             "loc_fc074a3e:\n"
 140             "    movs    r0, #1\n"
 141             "    bl      sub_fc0830ca\n"
 142             "    b       loc_fc074bb6\n"
 143             "loc_fc074a46:\n"
 144             "    bl      sub_fc082aec\n"
 145             "    b       loc_fc074a52\n"
 146             "loc_fc074a4c:\n"
 147             "    ldr     r0, [r0, #0xc]\n"
 148             "    bl      sub_fc082d7e\n"
 149             "loc_fc074a52:\n"
 150             "    str     r6, [r4, #0x28]\n"
 151             "    b       loc_fc074bb6\n"
 152             "loc_fc074a56:\n"
 153             "    bl      sub_fc082d84\n"
 154             "    b       loc_fc074bb6\n"
 155             "loc_fc074a5c:\n"
 156             "    bl      sub_fc082fec\n"
 157             "    bl      sub_fc08fbe8\n"
 158             "    b       loc_fc074bb6\n"
 159             "loc_fc074a66:\n"
 160             "    ldr     r0, [r0, #0x10]\n"
 161             "    bl      sub_fc08ecce\n"
 162             "    b       loc_fc074bb6\n"
 163             "loc_fc074a6e:\n"
 164             "    bl      sub_fc08306a\n"
 165             "    bl      sub_fc08fbe8\n"
 166             "    movs    r0, #0\n"
 167             "    bl      sub_fc2d27d8\n"
 168             "    b       loc_fc074bb6\n"
 169             "loc_fc074a7e:\n"
 170             "    ldr     r0, [r4, #0x54]\n"
 171             "    bl      sub_fc083732\n"
 172             "    b       loc_fc074bb6\n"
 173             "loc_fc074a86:\n"
 174             "    bl      sub_fc0839ce\n"
 175             "    b       loc_fc074bb6\n"
 176             "loc_fc074a8c:\n"
 177             "    ldr     r0, [r0, #0xc]\n"
 178             "    bl      sub_fc083a1a\n"
 179             "    b       loc_fc074bb6\n"
 180             "loc_fc074a94:\n"
 181             "    bl      sub_fc083bfc\n"
 182             "    b       loc_fc074bb6\n"
 183             "loc_fc074a9a:\n"
 184             "    bl      sub_fc083fe4\n"
 185             "    b       loc_fc074bb6\n"
 186             "loc_fc074aa0:\n"
 187             "    bl      sub_fc08407a\n"
 188             "    b       loc_fc074bb6\n"
 189             "loc_fc074aa6:\n"
 190             "    bl      sub_fc086d00\n"
 191             "    b       loc_fc074bb6\n"
 192             "loc_fc074aac:\n"
 193             "    bl      sub_fc086ede\n"
 194             "    b       loc_fc074bb6\n"
 195             "loc_fc074ab2:\n"
 196             "    bl      sub_fc086f7c\n"
 197             "    b       loc_fc074bb6\n"
 198             "loc_fc074ab8:\n"
 199             "    b       loc_fc074ba8\n"
 200             "loc_fc074aba:\n"
 201             "    bl      sub_fc086ff8\n"
 202             "    b       loc_fc074bb6\n"
 203             "loc_fc074ac0:\n"
 204             "    movs    r0, #0\n"
 205             "    b       loc_fc074ae4\n"
 206             "loc_fc074ac4:\n"
 207             "    bl      sub_fc08719c\n"
 208             "    b       loc_fc074bb6\n"
 209             "loc_fc074aca:\n"
 210             "    bl      sub_fc0871fc\n"
 211             "    b       loc_fc074bb6\n"
 212             "loc_fc074ad0:\n"
 213             "    bl      sub_fc087200\n"
 214             "    b       loc_fc074bb6\n"
 215             "loc_fc074ad6:\n"
 216             "    bl      sub_fc087210\n"
 217             "    b       loc_fc074bb6\n"
 218             "loc_fc074adc:\n"
 219             "    bl      sub_fc08729a\n"
 220             "    b       loc_fc074bb6\n"
 221             "loc_fc074ae2:\n"
 222             "    movs    r0, #1\n"
 223             "loc_fc074ae4:\n"
 224             "    bl      sub_fc08707c\n"
 225             "    b       loc_fc074bb6\n"
 226             "loc_fc074aea:\n"
 227             "    bl      sub_fc087344\n"
 228             "    b       loc_fc074bb6\n"
 229             "loc_fc074af0:\n"
 230             "    bl      sub_fc0831ba\n"
 231             "    b       loc_fc074bb6\n"
 232             "loc_fc074af6:\n"
 233             "    movs    r0, #0\n"
 234             "    b       loc_fc074afc\n"
 235             "loc_fc074afa:\n"
 236             "    ldr     r0, [r0, #0xc]\n"
 237             "loc_fc074afc:\n"
 238             "    bl      sub_fc0831ee\n"
 239             "    b       loc_fc074bb6\n"
 240             "loc_fc074b02:\n"
 241             "    bl      sub_fc08b514\n"
 242             "    b       loc_fc074bb6\n"
 243             "loc_fc074b08:\n"
 244             "    ldr     r1, =0x00046f46\n"
 245             "    movs    r2, #2\n"
 246             "    movs    r0, #0x77\n"
 247             "    bl      sub_fc3b8322\n"
 248             "    lsls    r0, r0, #0x1f\n"
 249             "    beq     loc_fc074b24\n"
 250             "    movw    r2, #0x4ee\n"
 251             "    ldr     r1, =0xfc07459c\n" //  *"SsShootTask.c"
 252             "    movs    r0, #0\n"
 253             "    blx     sub_fc34d24c\n"
 254             "loc_fc074b24:\n"
 255             "    ldrh.w  r0, [r4, #0x62]\n"
 256             "    cmp     r0, #1\n"
 257             "    bne     loc_fc074bb6\n"
 258             "    bl      sub_fc08b50e\n"
 259             "    b       loc_fc074bb6\n"
 260             "loc_fc074b32:\n"
 261             "    bl      sub_fc08b598\n"
 262             "    b       loc_fc074bb6\n"
 263             "loc_fc074b38:\n"
 264             "    bl      sub_fc091c38\n"
 265             "    b       loc_fc074bb6\n"
 266             "loc_fc074b3e:\n"
 267             "    bl      sub_fc084504\n"
 268             "    b       loc_fc074bb6\n"
 269             "loc_fc074b44:\n"
 270             "    bl      sub_fc0845be\n"
 271             "    b       loc_fc074bb6\n"
 272             "loc_fc074b4a:\n"
 273             "    ldr     r0, [r0, #0xc]\n"
 274             "    bl      sub_fc0873f8\n"
 275             "    b       loc_fc074bb6\n"
 276             "loc_fc074b52:\n"
 277             "    bl      sub_fc08744a\n"
 278             "    b       loc_fc074bb6\n"
 279             "loc_fc074b58:\n"
 280             "    bl      sub_fc07d1ea\n"
 281             "    ldrh.w  r0, [r4, #0x19c]\n"
 282             "    cmp     r0, #4\n"
 283             "    beq     loc_fc074b6e\n"
 284             "    ldrh    r0, [r4]\n"
 285             "    sub.w   r1, r0, #0x8200\n"
 286             "    subs    r1, #0x36\n"
 287             "    bne     loc_fc074bb6\n"
 288             "loc_fc074b6e:\n"
 289             "    bl      sub_fc0845be\n"
 290             "    bl      sub_fc084a2e\n"
 291             "    b       loc_fc074bb6\n"
 292             "loc_fc074b78:\n"
 293             "    bl      sub_fc08427e\n"
 294             "    movs    r0, #1\n"
 295             "    bl      sub_fc07ce46\n"
 296             "    b       loc_fc074bb6\n"
 297             "loc_fc074b84:\n"
 298             "    movs    r2, #0\n"
 299             "    movs    r1, #0x11\n"
 300             "    b       loc_fc074b8e\n"
 301             "loc_fc074b8a:\n"
 302             "    movs    r2, #0\n"
 303             "    movs    r1, #0x10\n"
 304             "loc_fc074b8e:\n"
 305             "    movs    r0, #0\n"
 306             "    bl      sub_fc090918\n"
 307             "    b       loc_fc074bb6\n"
 308             "loc_fc074b96:\n"
 309             "    bl      sub_fc08367e\n"
 310             "    b       loc_fc074bb6\n"
 311             "loc_fc074b9c:\n"
 312             "    bl      sub_fc087cf0\n"
 313             "    b       loc_fc074bb6\n"
 314             "loc_fc074ba2:\n"
 315             "    bl      sub_fc087cf2\n"
 316             "    b       loc_fc074bb6\n"
 317             "loc_fc074ba8:\n"
 318             "    movw    r2, #0x557\n"
 319             "    ldr     r1, =0xfc07459c\n" //  *"SsShootTask.c"
 320             "    movs    r0, #0\n"
 321             "    blx     sub_fc34d24c\n"
 322             "loc_fc074bb6:\n"
 323             "    BL      capt_seq_hook_set_nr\n"    //  dark frame control
 324             "    ldr     r0, [sp]\n"
 325             "    ldr     r1, [r0, #4]\n"
 326             "    ldr     r0, [r5, #4]\n"
 327             "    blx     sub_fc34d0f4\n"
 328             "    ldr     r7, [sp]\n"
 329             "    ldr     r0, [r7, #8]\n"
 330             "    cbnz    r0, loc_fc074bd2\n"
 331             "    movs    r2, #0xff\n"
 332             "    ldr     r1, =0xfc07459c\n" //  *"SsShootTask.c"
 333             "    movs    r0, #0\n"
 334             "    blx     sub_fc34d24c\n"
 335             "loc_fc074bd2:\n"
 336             "    str     r6, [r7, #8]\n"
 337             "    b       loc_fc074994\n"
 338 ".ltorg\n"
 339     );
 340 }
 341 
 342 //fc08ec20
 343 void __attribute__((naked,noinline)) sub_fc08ec20_my() {
 344     asm volatile (
 345             //capdis -f=chdk -s=0xfc08ec21 -c=58 -stubs PRIMARY.BIN 0xfc000000
 346             "    push    {r3, r4, r5, r6, r7, lr}\n"
 347             "    bl      sub_fc0932c2\n"
 348             "    mov     r4, r0\n"
 349             "    movs    r0, #0xc\n"
 350             "    bl      sub_fc318e50\n"
 351             "    ldr     r6, =0x000156a4\n"
 352             "    lsls    r0, r0, #0x1f\n"
 353             "    mov.w   r5, #1\n"
 354             "    bne     loc_fc08ecbe\n"
 355             "    movs    r2, #2\n"
 356             "    mov     r1, sp\n"
 357             "    movw    r0, #0x112\n"
 358             "    bl      sub_fc3b8322\n"
 359             "    lsls    r0, r0, #0x1f\n"
 360             "    beq     loc_fc08ec54\n"
 361             "    movs    r0, #0\n"
 362             "    movw    r2, #0x189\n"
 363             "    ldr     r1, =0xfc08eda4\n" //  *"SsCaptureCtrl.c"
 364             "    blx     sub_fc34d24c\n"
 365             "loc_fc08ec54:\n"
 366             "    ldrsh.w r0, [sp]\n"
 367             "    bl      sub_fc0c296a\n"
 368             "    bl      sub_fc0c2702\n"
 369             "    cmp     r0, #1\n"
 370             "    bls     loc_fc08ecc2\n"
 371             "    movs    r0, #0\n"
 372             "    bl      sub_fc0c283a\n"
 373             "    bl      sub_fc0b9ef8\n"
 374             "    bl      sub_fc082d8a\n"
 375             "    bl      sub_fc09bef4\n"
 376             "    mov     r1, r4\n"
 377 //            "    bl      sub_fc09bf48\n"
 378             "    bl      captseq_raw_addr_init_my\n"
 379             "    movs    r2, #4\n"
 380             "    movw    r0, #0x118\n"
 381             "    add.w   r1, r4, #0x58\n"
 382             "    bl      sub_fc3b81ee\n"
 383             "    movs    r2, #4\n"
 384             "    movs    r0, #0x32\n"
 385             "    add.w   r1, r4, #0x5c\n"
 386             "    bl      sub_fc3b81ee\n"
 387             "    movs    r2, #4\n"
 388             "    movs    r0, #0x46\n"
 389             "    add.w   r1, r4, #8\n"
 390             "    bl      sub_fc3b81ee\n"
 391             "    bl      sub_fc0991aa\n"
 392             "    mvn     r1, #0x1000\n"
 393             "    blx     sub_fc34d1cc\n"
 394             "    mov     r0, r4\n"
 395             "    bl      sub_fc091984\n"
 396             "    mov     r0, r4\n"
 397             "    bl      sub_fc0a009e_my\n"         // -> remote hook, raw hook
 398             "    lsls    r0, r0, #0x1f\n"
 399             "    beq     loc_fc08ecc0\n"
 400             "loc_fc08ecbe:\n"
 401             "    str     r5, [r6]\n"
 402             "loc_fc08ecc0:\n"
 403             "    pop     {r3, r4, r5, r6, r7, pc}\n"
 404             "loc_fc08ecc2:\n"
 405             "    str     r5, [r6]\n"
 406             "    bl      sub_fc090634\n"
 407             "    bl      sub_fc318e90\n"
 408             "    pop     {r3, r4, r5, r6, r7, pc}\n"
 409 ".ltorg\n"
 410     );
 411 }
 412 
 413 //fc08ebd4
 414 void __attribute__((naked,noinline)) sub_fc08ebd4_my() {
 415     asm volatile (
 416             //capdis -f=chdk -s=0xfc08ebd5 -c=33 -stubs PRIMARY.BIN 0xfc000000
 417             "    push    {r4, r5, r6, lr}\n"
 418             "    ldr     r5, =0x00046ee4\n"
 419             "    mov     r6, r0\n"
 420             "    movs    r4, #0\n"
 421             "    ldr     r0, [r5, #0x28]\n"
 422             "    cbz     r0, loc_fc08ebfc\n"
 423             "    ldr     r0, =0x000156a4\n"
 424             "    ldr     r0, [r0]\n"
 425             "    cbz     r0, loc_fc08ebe8\n"
 426             "    movs    r4, #0x1d\n"
 427             "loc_fc08ebe8:\n"
 428             "    mov     r2, r6\n"
 429             "    movs    r1, #2\n"
 430             "    mov     r0, r4\n"
 431             "    bl      sub_fc090918\n"
 432             "    mov     r1, r4\n"
 433             "    mov     r0, r6\n"
 434             "    bl      sub_fc09ddb8\n"
 435             "    b       loc_fc08ec1a\n"
 436             "loc_fc08ebfc:\n"
 437             "    mov     r0, r6\n"
 438             "    bl      sub_fc08e9e6_my\n"         // Patched
 439             "    mov     r4, r0\n"
 440             "    lsls    r0, r0, #0x1f\n"
 441             "    beq     loc_fc08ec1a\n"
 442             "    movs    r1, #2\n"
 443             "    mov     r2, r6\n"
 444             "    mov     r0, r4\n"
 445             "    bl      sub_fc090918\n"
 446             "    mov     r1, r4\n"
 447             "    mov     r0, r6\n"
 448             "    bl      sub_fc09deee\n"
 449             "loc_fc08ec1a:\n"
 450             "    movs    r0, #0\n"
 451             "    str     r0, [r5, #0x28]\n"
 452             "    pop     {r4, r5, r6, pc}\n"
 453 ".ltorg\n"
 454     );
 455 }
 456 
 457 //fc08e9e6
 458 void __attribute__((naked,noinline)) sub_fc08e9e6_my() {
 459     asm volatile (
 460             //capdis -f=chdk -s=0xfc08e9e7 -c=180 -stubs PRIMARY.BIN 0xfc000000
 461             "    push.w  {r2, r3, r4, r5, r6, r7, r8, lr}\n"
 462             "    mov     r4, r0\n"
 463             "    bl      sub_fc09bef4\n"
 464             "    mov     r1, r4\n"
 465 //            "    bl      sub_fc09bf48\n"
 466             "    bl      captseq_raw_addr_init_my\n"         // Patched
 467             "    movs    r2, #4\n"
 468             "    movw    r0, #0x118\n"
 469             "    add.w   r1, r4, #0x58\n"
 470             "    bl      sub_fc3b81ee\n"
 471             "    movs    r2, #4\n"
 472             "    movs    r0, #0x32\n"
 473             "    add.w   r1, r4, #0x5c\n"
 474             "    bl      sub_fc3b81ee\n"
 475             "    ldr     r6, =0x00046ee4\n"
 476             "    ldr.w   r0, [r6, #0x104]\n"
 477             "    cbnz    r0, loc_fc08ea28\n"
 478             "    ldrh.w  r0, [r6, #0x19a]\n"
 479             "    cmp     r0, #3\n"
 480             "    beq     loc_fc08ea2e\n"
 481             "    ldr     r0, [r4, #8]\n"
 482             "    cmp     r0, #1\n"
 483             "    bhi     loc_fc08ea3e\n"
 484             "    b       loc_fc08ea2e\n"
 485             "loc_fc08ea28:\n"
 486             "    ldr     r0, [r4, #0xc]\n"
 487             "    cmp     r0, #1\n"
 488             "    bne     loc_fc08ea3e\n"
 489             "loc_fc08ea2e:\n"
 490             "    movs    r0, #0xc\n"
 491             "    bl      sub_fc318e50\n"
 492             "    lsls    r0, r0, #0x1f\n"
 493             "    beq     loc_fc08ea3e\n"
 494             "loc_fc08ea38:\n"
 495             "    bl      sub_fc090634\n"
 496             "    b       loc_fc08eb52\n"
 497             "loc_fc08ea3e:\n"
 498             "    ldr.w   r0, [r6, #0xe4]\n"
 499             "    cbz     r0, loc_fc08ea5e\n"
 500             "    ldrh.w  r0, [r6, #0x19a]\n"
 501             "    cmp     r0, #3\n"
 502             "    beq     loc_fc08ea52\n"
 503             "    ldr     r0, [r4, #8]\n"
 504             "    cmp     r0, #1\n"
 505             "    bhi     loc_fc08ea8e\n"
 506             "loc_fc08ea52:\n"
 507             "    ldr.w   r0, [r6, #0x104]\n"
 508             "    cbz     r0, loc_fc08ea5e\n"
 509             "    ldr     r0, [r4, #0xc]\n"
 510             "    cmp     r0, #1\n"
 511             "    bhi     loc_fc08ea8e\n"
 512             "loc_fc08ea5e:\n"
 513             "    movs    r2, #2\n"
 514             "    movw    r0, #0x112\n"
 515             "    add     r1, sp, #4\n"
 516             "    bl      sub_fc3b8322\n"
 517             "    lsls    r0, r0, #0x1f\n"
 518             "    beq     loc_fc08ea78\n"
 519             "    movs    r2, #0xc1\n"
 520             "    movs    r0, #0\n"
 521             "    ldr     r1, =0xfc08eda4\n" //  *"SsCaptureCtrl.c"
 522             "    blx     sub_fc34d24c\n"
 523             "loc_fc08ea78:\n"
 524             "    ldrsh.w r0, [sp, #4]\n"
 525             "    bl      sub_fc0c296a\n"
 526             "    bl      sub_fc0c2702\n"
 527             "    cmp     r0, #1\n"
 528             "    bls     loc_fc08eb4a\n"
 529             "    movs    r0, #0\n"
 530             "    bl      sub_fc0c283a\n"
 531             "loc_fc08ea8e:\n"
 532             "    ldr.w   r0, [r6, #0x1c4]\n"
 533             "    cbz     r0, loc_fc08eaa4\n"
 534             "    ldr     r0, [r4, #8]\n"
 535             "    cmp     r0, #1\n"
 536             "    beq     loc_fc08eaa4\n"
 537             "    movs    r0, #1\n"
 538             "    bl      sub_fc07ce46\n"
 539             "    lsls    r0, r0, #0x1f\n"
 540             "    bne     loc_fc08ea38\n"
 541             "loc_fc08eaa4:\n"
 542             "    mov     r0, r4\n"
 543             "    bl      sub_fc091c78\n"
 544             "    lsls    r1, r0, #0x1f\n"
 545             "    bne     loc_fc08eb54\n"
 546             "    bl      sub_fc0991aa\n"
 547             "    mvn     r1, #0x1000\n"
 548             "    blx     sub_fc34d1cc\n"
 549             "    mov     r0, r4\n"
 550             "    bl      sub_fc08f226\n"
 551             "    mov     r5, r0\n"
 552             "    lsls    r0, r0, #0x1f\n"
 553             "    bne     loc_fc08ebac\n"
 554             "    bl      sub_fc0b9ef8\n"
 555             "    bl      sub_fc082d8a\n"
 556             "    mov     r0, r4\n"
 557             "    bl      sub_fc091984\n"
 558             "    ldr.w   r0, [r6, #0x128]\n"
 559             "    cbnz    r0, loc_fc08eae8\n"
 560             "    ldrh.w  r0, [r6, #0x19a]\n"
 561             "    cmp     r0, #3\n"
 562             "    beq     loc_fc08eae8\n"
 563             "    ldr     r0, [r4, #8]\n"
 564             "    cmp     r0, #1\n"
 565             "    bhi     loc_fc08eaee\n"
 566             "loc_fc08eae8:\n"
 567             "    movs    r0, #2\n"
 568             "    bl      sub_fc089502\n"
 569             "loc_fc08eaee:\n"
 570             "    ldr.w   r0, [r6, #0xa0]\n"
 571             "    cmp     r0, #0\n"
 572             "    beq     loc_fc08eb6e\n"
 573             "    ldrh.w  r0, [r6, #0x19a]\n"
 574             "    movw    r7, #0x1000\n"
 575             "    cmp     r0, #3\n"
 576             "    beq     loc_fc08eb1e\n"
 577             "    ldr     r0, [r4, #8]\n"
 578             "    cmp     r0, #1\n"
 579             "    bls     loc_fc08eb1e\n"
 580             "    bl      sub_fc0991aa\n"
 581             "    movw    r3, #0x111\n"
 582             "    movw    r2, #0x3a98\n"
 583             "    mov     r1, r7\n"
 584             "    str     r3, [sp]\n"
 585             "    ldr     r3, =0xfc08eda4\n" //  *"SsCaptureCtrl.c"
 586             "    bl      sub_fc319008\n"
 587             "loc_fc08eb1e:\n"
 588             "    movs    r2, #4\n"
 589             "    movw    r0, #0x18a\n"
 590             "    add     r1, sp, #4\n"
 591             "    bl      sub_fc3b8322\n"
 592             "    lsls    r0, r0, #0x1f\n"
 593             "    beq     loc_fc08eb3a\n"
 594             "    movs    r0, #0\n"
 595             "    movw    r2, #0x115\n"
 596             "    ldr     r1, =0xfc08eda4\n" //  *"SsCaptureCtrl.c"
 597             "    blx     sub_fc34d24c\n"
 598             "loc_fc08eb3a:\n"
 599             "    ldr     r0, [sp, #4]\n"
 600             "    cbnz    r0, loc_fc08eb58\n"
 601             "    bl      sub_fc0991aa\n"
 602             "    mov     r1, r7\n"
 603             "    blx     sub_fc34d0f4\n"
 604             "    b       loc_fc08eb6e\n"
 605             "loc_fc08eb4a:\n"
 606             "    bl      sub_fc090634\n"
 607             "    bl      sub_fc318e90\n"
 608             "loc_fc08eb52:\n"
 609             "    movs    r0, #1\n"
 610             "loc_fc08eb54:\n"
 611             "    pop.w   {r2, r3, r4, r5, r6, r7, r8, pc}\n"
 612             "loc_fc08eb58:\n"
 613             "    bl      sub_fc0991aa\n"
 614             "    mov     r1, r7\n"
 615             "    blx     sub_fc34d1cc\n"
 616             "    ldr     r2, =0xfc08e9d5\n"
 617             "    mov     r3, r7\n"
 618             "    ldr     r0, [sp, #4]\n"
 619             "    mov     r1, r2\n"
 620             "    bl      sub_fc3ba95e\n"
 621             "loc_fc08eb6e:\n"
 622             "    ldr.w   r0, [r6, #0xa8]\n"
 623             "    cbz     r0, loc_fc08eb7c\n"
 624             "    mov     r0, r4\n"
 625             "    bl      sub_fc0a093c\n"
 626             "    b       loc_fc08ebc2\n"
 627             "loc_fc08eb7c:\n"
 628             "    ldr.w   r0, [r6, #0xac]\n"
 629             "    cbz     r0, loc_fc08eb8a\n"
 630             "    mov     r0, r4\n"
 631             "    bl      sub_fc0a05b2\n"
 632             "    b       loc_fc08ebc2\n"
 633             "loc_fc08eb8a:\n"
 634             "    ldr.w   r0, [r6, #0xb0]\n"
 635             "    cbz     r0, loc_fc08eb98\n"
 636             "    mov     r0, r4\n"
 637             "    bl      sub_fc0a0c40\n"
 638             "    b       loc_fc08ebc2\n"
 639             "loc_fc08eb98:\n"
 640             "    ldr.w   r0, [r6, #0xb4]\n"
 641             "    cbz     r0, loc_fc08ebae\n"
 642             "    ldr     r0, =0x000470e8\n"
 643             "    ldr     r0, [r0]\n"
 644             "    cbz     r0, loc_fc08ebae\n"
 645             "    mov     r0, r4\n"
 646             "    bl      sub_fc0a0f3a\n"
 647             "    b       loc_fc08ebc2\n"
 648             "loc_fc08ebac:\n"
 649             "    b       loc_fc08ebd0\n"
 650             "loc_fc08ebae:\n"
 651             "    ldr.w   r0, [r6, #0xb8]\n"
 652             "    cmp     r0, #0\n"
 653             "    mov     r0, r4\n"
 654             "    beq     loc_fc08ebbe\n"
 655             "    bl      sub_fc0a122e\n"
 656             "    b       loc_fc08ebc2\n"
 657             "loc_fc08ebbe:\n"
 658             "    bl      sub_fc0a009e_my\n"         // -> remote hook, raw hook
 659             "loc_fc08ebc2:\n"
 660             "    ldr.w   r0, [r6, #0x1c4]\n"
 661             "    cbz     r0, loc_fc08ebd0\n"
 662             "    movs    r1, #0\n"
 663             "    movs    r0, #1\n"
 664             "    bl      sub_fc07ce8c\n"
 665             "loc_fc08ebd0:\n"
 666             "    mov     r0, r5\n"
 667             "    b       loc_fc08eb54\n"
 668 ".ltorg\n"
 669     );
 670 }
 671 
 672 //fc0a009e
 673 void __attribute__((naked,noinline)) sub_fc0a009e_my() {
 674     asm volatile (
 675             //capdis -f=chdk -s=0xfc0a009f -c=249 -stubs PRIMARY.BIN 0xfc000000
 676             "    push.w  {r0, r1, r2, r3, r4, r5, r6, r7, r8, sb, sl, lr}\n"
 677             "    ldr     r7, =0x00046ee4\n"
 678             "    mov     r4, r0\n"
 679             "    ldr.w   r0, [r7, #0x164]\n"
 680             "    cbz     r0, loc_fc0a00ba\n"
 681             "    ldrh.w  r0, [r7, #0x19a]\n"
 682             "    cmp     r0, #3\n"
 683             "    beq     loc_fc0a00ba\n"
 684             "    ldr     r0, [r4, #8]\n"
 685             "    cmp     r0, #1\n"
 686             "    bhi     loc_fc0a00c4\n"
 687             "loc_fc0a00ba:\n"
 688             "    mov     r0, r4\n"
 689             "    bl      sub_fc09191a\n"
 690             "    bl      sub_fc087912\n"
 691             "loc_fc0a00c4:\n"
 692             "    ldr.w   r0, [r7, #0x9c]\n"
 693             "    cbnz    r0, loc_fc0a00e0\n"
 694             "    ldrh.w  r0, [r7, #0x19a]\n"
 695             "    cmp     r0, #3\n"
 696             "    beq     loc_fc0a00d8\n"
 697             "    ldr     r0, [r4, #8]\n"
 698             "    cmp     r0, #1\n"
 699             "    bhi     loc_fc0a00e0\n"
 700             "loc_fc0a00d8:\n"
 701             "    bl      sub_fc0831dc\n"
 702             "    bl      sub_fc0874de\n"
 703             "loc_fc0a00e0:\n"
 704             "    movs    r2, #4\n"
 705             "    movw    r0, #0x139\n"
 706             "    add     r1, sp, #0xc\n"
 707             "    bl      sub_fc3b8322\n"
 708             "    lsls    r0, r0, #0x1f\n"
 709             "    beq     loc_fc0a00fc\n"
 710             "    movs    r0, #0\n"
 711             "    movw    r2, #0x153\n"
 712             "    ldr     r1, =0xfc0a0474\n" //  *"SsStandardCaptureSeq.c"
 713             "    blx     sub_fc34d24c\n"
 714             "loc_fc0a00fc:\n"
 715             "    ldr     r0, [sp, #0xc]\n"
 716             "    ubfx    r0, r0, #8, #8\n"
 717             "    cmp     r0, #6\n"
 718             "    bne     loc_fc0a010c\n"
 719             "    ldr     r0, =0xfc0a0055\n"
 720             "    movs    r1, #0\n"
 721             "    b       loc_fc0a0110\n"
 722             "loc_fc0a010c:\n"
 723             "    ldr     r0, =0xfc09159d\n"
 724             "    mov     r1, r4\n"
 725             "loc_fc0a0110:\n"
 726             "    bl      sub_fc0ace52\n"
 727             "    movs    r2, #2\n"
 728             "    movw    r0, #0x114\n"
 729             "    add     r1, sp, #8\n"
 730             "    bl      sub_fc3b8322\n"
 731             "    lsls    r0, r0, #0x1f\n"
 732             "    beq     loc_fc0a0130\n"
 733             "    movs    r0, #0\n"
 734             "    movw    r2, #0x15c\n"
 735             "    ldr     r1, =0xfc0a0474\n" //  *"SsStandardCaptureSeq.c"
 736             "    blx     sub_fc34d24c\n"
 737             "loc_fc0a0130:\n"
 738             "    ldr.w   r0, [r7, #0x184]\n"
 739             "    cbz     r0, loc_fc0a013a\n"
 740             "    bl      sub_fc091852\n"
 741             "loc_fc0a013a:\n"
 742             "    movs    r0, #0\n"
 743             "    bl      sub_fc07ce3e\n"
 744             "    mov     r0, r4\n"
 745             "    bl      sub_fc091a4a\n"
 746             "    movs    r2, #4\n"
 747             "    movs    r0, #0x92\n"
 748             "    add     r1, sp, #4\n"
 749             "    bl      sub_fc3b8322\n"
 750             "    lsls    r0, r0, #0x1f\n"
 751             "    beq     loc_fc0a0160\n"
 752             "    movs    r0, #0\n"
 753             "    movw    r2, #0x171\n"
 754             "    ldr     r1, =0xfc0a0474\n" //  *"SsStandardCaptureSeq.c"
 755             "    blx     sub_fc34d24c\n"
 756             "loc_fc0a0160:\n"
 757             "    ldr     r1, =0x00027fe0\n"
 758             "    ldr     r0, [sp, #4]\n"
 759             "    str     r0, [r1]\n"
 760             "    bl      sub_fc07cef8\n"
 761             "    bl      sub_fc091adc\n"
 762             "    movs    r1, #0\n"
 763             "    mov     r0, r4\n"
 764             "    bl      sub_fc0a0056\n"
 765             "    mov     r6, r0\n"
 766             "    BL      wait_until_remote_button_is_released\n"    // + remote hook
 767             "    ldr     r0, [sp, #0xc]\n"
 768             "    ubfx    r0, r0, #8, #8\n"
 769             "    cmp     r0, #6\n"
 770             "    bne     loc_fc0a0186\n"
 771             "    ldr     r2, =0xfc09181d\n"
 772             "    b       loc_fc0a0188\n"
 773             "loc_fc0a0186:\n"
 774             "    ldr     r2, =0xfc091833\n"
 775             "loc_fc0a0188:\n"
 776             "    ldrh    r0, [r4, #0x18]\n"
 777             "    ldr.w   r8, =0xfffff3a0\n"
 778             "    cbz     r0, loc_fc0a0198\n"
 779             "    cmp     r0, #1\n"
 780             "    beq     loc_fc0a01ae\n"
 781             "    cmp     r0, #4\n"
 782             "    bne     loc_fc0a021c\n"
 783             "loc_fc0a0198:\n"
 784             "    str     r6, [sp]\n"
 785             "    mov     r3, r2\n"
 786             "    ldr     r1, [r4, #0x5c]\n"
 787             "    mov     r0, r4\n"
 788             "    ldr     r2, [sp, #4]\n"
 789             "    bl      sub_fc0913c4\n"
 790             "    mov     r5, r0\n"
 791             "    bl      sub_fc0feba4\n"
 792             "    b       loc_fc0a022a\n"
 793             "loc_fc0a01ae:\n"
 794             "    str     r6, [sp]\n"
 795             "    mov     r3, r2\n"
 796             "    ldr     r1, [r4, #0x5c]\n"
 797             "    mov     r0, r4\n"
 798             "    ldr     r2, [sp, #4]\n"
 799             "    bl      sub_fc091432\n"
 800             "    mov     r5, r0\n"
 801             "    ldrsh.w r0, [sp, #8]\n"
 802             "    cmp     r0, r8\n"
 803             "    beq     loc_fc0a01cc\n"
 804             "    bl      sub_fc0ace20\n"
 805             "    cbnz    r0, loc_fc0a01d6\n"
 806             "loc_fc0a01cc:\n"
 807             "    movs    r2, #1\n"
 808             "    movs    r1, #0\n"
 809             "    movs    r0, #0x45\n"
 810             "    bl      sub_fc2d4488\n"
 811             "loc_fc0a01d6:\n"
 812             "    lsls    r0, r5, #0x1f\n"
 813             "    bne     loc_fc0a022a\n"
 814             "    ldr.w   r0, [r7, #0xf8]\n"
 815             "    cbz     r0, loc_fc0a01f0\n"
 816             "    ldr     r1, [r4, #8]\n"
 817             "    ldr     r2, =0x001e3538\n"
 818             "    ldr     r0, [r4, #0x5c]\n"
 819             "    add.w   r1, r2, r1, lsl #2\n"
 820             "    str     r0, [r1, #-0x4]\n"
 821             "    b       loc_fc0a0216\n"
 822             "loc_fc0a01f0:\n"
 823             "    ldr     r0, =0xfc0a0055\n"
 824             "    movs    r1, #0\n"
 825             "    bl      sub_fc0ace52\n"
 826             "    movs    r1, #1\n"
 827             "    mov     r0, r4\n"
 828             "    bl      sub_fc0a0056\n"
 829             "    mov     r6, r0\n"
 830             "    ldr     r0, [sp, #4]\n"
 831             "    bl      sub_fc0918bc\n"
 832             "    ldr     r1, [r4, #0x5c]\n"
 833             "    mov     r3, r6\n"
 834             "    ldr     r2, [sp, #4]\n"
 835             "    mov     r0, r4\n"
 836             "    bl      sub_fc0914aa\n"
 837             "    mov     r5, r0\n"
 838             "loc_fc0a0216:\n"
 839             "    bl      sub_fc09136c\n"
 840             "    b       loc_fc0a022a\n"
 841             "loc_fc0a021c:\n"
 842             "    movs    r0, #0\n"
 843             "    movw    r2, #0x1ad\n"
 844             "    ldr     r1, =0xfc0a0474\n" //  *"SsStandardCaptureSeq.c"
 845             "    blx     sub_fc34d24c\n"
 846             "    movs    r5, #0x1d\n"
 847             "loc_fc0a022a:\n"
 848             "    ldrsh.w r0, [sp, #8]\n"
 849             "    cmp     r0, r8\n"
 850             "    beq     loc_fc0a0244\n"
 851             "    bl      sub_fc0ace20\n"
 852             "    cbz     r0, loc_fc0a0244\n"
 853             "    movs    r2, #1\n"
 854             "    movs    r1, #0\n"
 855             "    movs    r0, #0x46\n"
 856             "    bl      sub_fc2d4488\n"
 857             "    movs    r5, #1\n"
 858             "loc_fc0a0244:\n"
 859             "    bl      sub_fc091ae0\n"
 860             "    ldr.w   r8, =0xfc0a0055\n"
 861             "    lsls    r0, r5, #0x1f\n"
 862             "    bne     loc_fc0a02be\n"
 863             "    ldr.w   r0, [r7, #0x100]\n"
 864             "    cbnz    r0, loc_fc0a028a\n"
 865             "    ldr.w   r0, [r7, #0x1c4]\n"
 866             "    cbz     r0, loc_fc0a0274\n"
 867             "    ldrh.w  r0, [r7, #0x1e4]\n"
 868             "    cmp     r0, #1\n"
 869             "    bne     loc_fc0a028a\n"
 870             "    mov     r0, r4\n"
 871             "    bl      sub_fc0922ba\n"
 872             "    lsls    r0, r0, #0x1f\n"
 873             "    beq     loc_fc0a028a\n"
 874             "    movw    r2, #0x1c9\n"
 875             "    b       loc_fc0a0282\n"
 876             "loc_fc0a0274:\n"
 877             "    mov     r0, r4\n"
 878             "    bl      sub_fc0922ba\n"
 879             "    lsls    r0, r0, #0x1f\n"
 880             "    beq     loc_fc0a028a\n"
 881             "    movw    r2, #0x1cc\n"
 882             "loc_fc0a0282:\n"
 883             "    movs    r0, #0\n"
 884             "    ldr     r1, =0xfc0a0474\n" //  *"SsStandardCaptureSeq.c"
 885             "    blx     sub_fc34d24c\n"
 886             "loc_fc0a028a:\n"
 887             "    BL      capt_seq_hook_raw_here\n"      // +
 888             "    BL      clear_current_raw_addr\n"      // +
 889             "    mov     r0, r4\n"
 890             "    bl      sub_fc091acc\n"
 891             "    mov     r0, r4\n"
 892             "    bl      sub_fc091aa0\n"
 893             "    cmp     r6, r8\n"
 894             "    beq     loc_fc0a02be\n"
 895             "    bl      sub_fc0991aa\n"
 896             "    movs    r1, #4\n"
 897             "    movw    sb, #0x1dc\n"
 898             "    ldr     r3, =0xfc0a0474\n" //  *"SsStandardCaptureSeq.c"
 899             "    movw    r2, #0x3a98\n"
 900             "    str.w   sb, [sp]\n"
 901             "    bl      sub_fc319008\n"
 902             "    cbz     r0, loc_fc0a02be\n"
 903             "    movs    r0, #0\n"
 904             "    mov     r2, sb\n"
 905             "    ldr     r1, =0xfc0a0474\n" //  *"SsStandardCaptureSeq.c"
 906             "    blx     sub_fc34d24c\n"
 907             "loc_fc0a02be:\n"
 908             "    ldrh    r0, [r7]\n"
 909             "    sub.w   r1, r0, #0x4000\n"
 910             "    subs    r1, #0x44\n"
 911             "    bne     loc_fc0a02e0\n"
 912             "    bl      sub_fc0991aa\n"
 913             "    movw    r1, #0x8000\n"
 914             "    blx     sub_fc34d1cc\n"
 915             "    ldr     r0, =0xfc0a008d\n"
 916             "    movs    r1, #0\n"
 917             "    bl      sub_fc2d4b54\n"
 918             "    bl      sub_fc2d4b46\n"
 919             "loc_fc0a02e0:\n"
 920             "    ldr.w   r0, [r7, #0x184]\n"
 921             "    cbz     r0, loc_fc0a02f0\n"
 922             "    movs    r2, #1\n"
 923             "    movs    r1, #0\n"
 924             "    movs    r0, #0x46\n"
 925             "    bl      sub_fc2d4488\n"
 926             "loc_fc0a02f0:\n"
 927             "    movs    r1, #2\n"
 928             "    mov     r2, r4\n"
 929             "    mov     r0, r5\n"
 930             "    bl      sub_fc090918\n"
 931             "    ldr     r0, [r7, #0x28]\n"
 932             "    cmp     r0, #0\n"
 933             "    mov     r0, r8\n"
 934             "    beq     loc_fc0a0316\n"
 935             "    cmp     r6, r0\n"
 936             "    beq     loc_fc0a030a\n"
 937             "    movs    r1, #1\n"
 938             "    b       loc_fc0a030c\n"
 939             "loc_fc0a030a:\n"
 940             "    movs    r1, #0\n"
 941             "loc_fc0a030c:\n"
 942             "    mov     r2, r5\n"
 943             "    mov     r0, r4\n"
 944             "    bl      sub_fc09dd76\n"
 945             "    b       loc_fc0a0328\n"
 946             "loc_fc0a0316:\n"
 947             "    cmp     r6, r0\n"
 948             "    beq     loc_fc0a031e\n"
 949             "    movs    r1, #1\n"
 950             "    b       loc_fc0a0320\n"
 951             "loc_fc0a031e:\n"
 952             "    movs    r1, #0\n"
 953             "loc_fc0a0320:\n"
 954             "    mov     r2, r5\n"
 955             "    mov     r0, r4\n"
 956             "    bl      sub_fc09dd30\n"
 957             "loc_fc0a0328:\n"
 958             "    add     sp, #0x10\n"
 959             "    mov     r0, r5\n"
 960             "    pop.w   {r4, r5, r6, r7, r8, sb, sl, pc}\n"
 961 ".ltorg\n"
 962     );
 963 }
 964 
 965 // TODO:
 966 // task_DvlpSeq 0xfc091e67
 967 void __attribute__((naked,noinline)) developseq_task() {
 968     asm volatile (
 969 ".ltorg\n"
 970     );
 971 }
 972 
 973 // exp_drv_task 0xfc2f63d6
 974 void __attribute__((naked,noinline)) exp_drv_task() {
 975     asm volatile (
 976             //capdis -f=chdk -s=0xfc2f63d7 -c=258 -stubs PRIMARY.BIN 0xfc000000
 977             "    push.w  {r4, r5, r6, r7, r8, sb, sl, fp, lr}\n"
 978             "    sub     sp, #0x2c\n"
 979             "    ldr.w   sl, =0x0000e89c\n"
 980             "    ldr.w   fp, =0xfffff400\n"
 981             "    movs    r0, #0\n"
 982             "    ldr.w   r8, =0x0006ee40\n"
 983             "    movs    r4, #0x3e\n"
 984             "    add.w   sb, sp, #0x1c\n"
 985             "    str     r0, [sp, #0xc]\n"
 986             "loc_fc2f63f2:\n"
 987             "    ldr.w   r0, [sl, #0x20]\n"
 988             "    movs    r2, #0\n"
 989             "    add     r1, sp, #0x28\n"
 990             "    mov     r5, sl\n"
 991             "    blx     sub_fc34d03c\n"
 992             "    ldr     r0, [sp, #0x28]\n"
 993             "    movs    r1, #0\n"
 994             "    cmp     r4, #0x15\n"
 995             "    ldr     r0, [r0]\n"
 996             "    beq     loc_fc2f641e\n"
 997             "    cmp     r4, #0x16\n"
 998             "    beq     loc_fc2f641e\n"
 999             "    cmp     r4, #0x17\n"
1000             "    beq     loc_fc2f641e\n"
1001             "    cmp     r4, #0x18\n"
1002             "    beq     loc_fc2f641e\n"
1003             "    cmp     r4, #0x19\n"
1004             "    beq     loc_fc2f641e\n"
1005             "    cmp     r4, #0x1a\n"
1006             "    bne     loc_fc2f6440\n"
1007             "loc_fc2f641e:\n"
1008             "    cmp     r0, #0x15\n"
1009             "    beq     loc_fc2f6440\n"
1010             "    cmp     r0, #0x16\n"
1011             "    beq     loc_fc2f6440\n"
1012             "    cmp     r0, #0x17\n"
1013             "    beq     loc_fc2f6440\n"
1014             "    cmp     r0, #0x18\n"
1015             "    beq     loc_fc2f6440\n"
1016             "    cmp     r0, #0x19\n"
1017             "    beq     loc_fc2f6440\n"
1018             "    cmp     r0, #0x1a\n"
1019             "    beq     loc_fc2f6440\n"
1020             "    cmp     r0, #0x3b\n"
1021             "    beq     loc_fc2f6440\n"
1022             "    cmp     r0, #0x36\n"
1023             "    beq     loc_fc2f6440\n"
1024             "    movs    r1, #1\n"
1025             "loc_fc2f6440:\n"
1026             "    cmp     r1, #1\n"
1027             "    bne     loc_fc2f644c\n"
1028             "    movs    r0, #0\n"
1029             "    add     r1, sp, #0xc\n"
1030             "    bl      sub_fc2f6392\n"
1031             "loc_fc2f644c:\n"
1032             "    ldr     r0, [sp, #0x28]\n"
1033             "    ldr     r1, [r0]\n"
1034             "    cmp     r1, #0x3b\n"
1035             "    beq     loc_fc2f64fe\n"
1036             "    cmp     r1, #0x3e\n"
1037             "    mov     r4, r1\n"
1038             "    bne     loc_fc2f6470\n"
1039             "    bl      sub_fc2f74c4\n"
1040             "    ldr.w   r0, [sl, #0x1c]\n"
1041             "    movs    r1, #1\n"
1042             "    blx     sub_fc34d0f4\n"
1043             "    blx     sub_fc34d0dc\n"
1044             "    add     sp, #0x2c\n"
1045             "    b       sub_fc2f6116\n"
1046             "loc_fc2f6470:\n"
1047             "    cmp     r1, #0x3d\n"
1048             "    bne     loc_fc2f6482\n"
1049             "    add.w   r0, r0, #0xac\n"
1050             "    ldrd    r2, r1, [r0]\n"
1051             "    mov     r0, r1\n"
1052             "    blx     r2\n"
1053             "    b       loc_fc2f68d0\n"
1054             "loc_fc2f6482:\n"
1055             "    cmp     r1, #0x34\n"
1056             "    bne     loc_fc2f64ba\n"
1057             "    ldr     r0, [r5, #0x1c]\n"
1058             "    movs    r1, #0x80\n"
1059             "    blx     sub_fc34d1cc\n"
1060             "    ldr     r0, =0xfc2f1e65\n"
1061             "    movs    r1, #0x80\n"
1062             "    bl      sub_fc163e1a\n"
1063             "    ldr     r0, [r5, #0x1c]\n"
1064             "    movs    r1, #0x80\n"
1065             "    movw    r2, #0xbb8\n"
1066             "    blx     sub_fc34d0b4\n"
1067             "    lsls    r0, r0, #0x1f\n"
1068             "    beq     loc_fc2f64ac\n"
1069             "    movw    r2, #0x1934\n"
1070             "    b       loc_fc2f6540\n"
1071             "loc_fc2f64ac:\n"
1072             "    ldr     r1, [sp, #0x28]\n"
1073             "    add.w   r1, r1, #0xac\n"
1074             "    ldrd    r1, r0, [r1]\n"
1075             "    blx     r1\n"
1076             "    b       loc_fc2f68d0\n"
1077             "loc_fc2f64ba:\n"
1078             "    cmp     r1, #0x35\n"
1079             "    bne     loc_fc2f64ee\n"
1080             "    add     r1, sp, #0xc\n"
1081             "    bl      sub_fc2f6392\n"
1082             "    movw    r6, #0x100\n"
1083             "    ldr     r0, [r5, #0x1c]\n"
1084             "    mov     r1, r6\n"
1085             "    blx     sub_fc34d1cc\n"
1086             "    ldr     r0, =0xfc2f1e6f\n"
1087             "    mov     r1, r6\n"
1088             "    bl      sub_fc1647b8\n"
1089             "    ldr     r0, [r5, #0x1c]\n"
1090             "    movw    r2, #0xbb8\n"
1091             "    mov     r1, r6\n"
1092             "    blx     sub_fc34d0b4\n"
1093             "    lsls    r0, r0, #0x1f\n"
1094             "    beq     loc_fc2f64ac\n"
1095             "    movw    r2, #0x193e\n"
1096             "    b       loc_fc2f6540\n"
1097             "loc_fc2f64ee:\n"
1098             "    cmp     r1, #0x36\n"
1099             "    bne     loc_fc2f64fa\n"
1100             "    add     r1, sp, #0xc\n"
1101             "    bl      sub_fc2f6392\n"
1102             "    b       loc_fc2f64ac\n"
1103             "loc_fc2f64fa:\n"
1104             "    cmp     r1, #0x3b\n"
1105             "    bne     loc_fc2f650c\n"
1106             "loc_fc2f64fe:\n"
1107             "    bl      sub_fc470f8c\n"
1108             "    bl      sub_fc198d24\n"
1109             "    bl      sub_fc469dba\n"
1110             "    b       loc_fc2f64ac\n"
1111             "loc_fc2f650c:\n"
1112             "    cmp     r1, #0x3c\n"
1113             "    bne     loc_fc2f654a\n"
1114             "    ldr     r0, [r5, #0x1c]\n"
1115             "    movs    r1, #4\n"
1116             "    blx     sub_fc34d1cc\n"
1117             "    movs    r3, #1\n"
1118             "    ldr     r2, =0xfc2f1e83\n"
1119             "    movs    r1, #0\n"
1120             "    mov     r0, fp\n"
1121             "    str     r3, [sp]\n"
1122             "    movs    r3, #4\n"
1123             "    bl      sub_fc2f7514\n"
1124             "    bl      sub_fc470cac\n"
1125             "    ldr     r0, [r5, #0x1c]\n"
1126             "    movs    r1, #4\n"
1127             "    movw    r2, #0xbb8\n"
1128             "    blx     sub_fc34d214\n"
1129             "    lsls    r0, r0, #0x1f\n"
1130             "    beq     loc_fc2f64ac\n"
1131             "    movw    r2, #0x1a2d\n"
1132             "loc_fc2f6540:\n"
1133             "    ldr     r1, =0xfc2f26e0\n" //  **"ExpDrv.c"
1134             "    movs    r0, #0\n"
1135             "    blx     sub_fc34d24c\n"
1136             "    b       loc_fc2f64ac\n"
1137             "loc_fc2f654a:\n"
1138             "    movs    r6, #1\n"
1139             "    cmp     r1, #0x13\n"
1140             "    beq     loc_fc2f6554\n"
1141             "    cmp     r1, #0x14\n"
1142             "    bne     loc_fc2f6592\n"
1143             "loc_fc2f6554:\n"
1144             "    ldr.w   r1, [r0, #0x94]\n"
1145             "    mov     r5, sb\n"
1146             "    add.w   r1, r1, r1, lsl #1\n"
1147             "    add.w   r1, r0, r1, lsl #2\n"
1148             "    subs    r1, #8\n"
1149             "    ldm     r1!, {r2, r3, r7}\n"
1150             "    stm     r5!, {r2, r3, r7}\n"
1151             "    bl      sub_fc2f4ba2\n"
1152             "    ldr     r0, [sp, #0x28]\n"
1153             "    add.w   r0, r0, #0x94\n"
1154             "    ldrd    r3, r2, [r0, #0x18]\n"
1155             "    ldr     r1, [r0]\n"
1156             "    sub.w   r0, r0, #0x90\n"
1157             "    blx     r3\n"
1158             "    ldr     r0, [sp, #0x28]\n"
1159             "    bl      sub_fc2f76d2\n"
1160             "    ldr     r0, [sp, #0x28]\n"
1161             "    add.w   r0, r0, #0x94\n"
1162             "    ldr     r1, [r0]\n"
1163             "    ldrd    r3, r2, [r0, #0x20]\n"
1164             "    b       loc_fc2f67f0\n"
1165             "loc_fc2f6592:\n"
1166             "    cmp     r1, #0x15\n"
1167             "    beq     loc_fc2f65aa\n"
1168             "    cmp     r1, #0x16\n"
1169             "    beq     loc_fc2f65aa\n"
1170             "    cmp     r1, #0x17\n"
1171             "    beq     loc_fc2f65aa\n"
1172             "    cmp     r1, #0x18\n"
1173             "    beq     loc_fc2f65aa\n"
1174             "    cmp     r1, #0x19\n"
1175             "    beq     loc_fc2f65aa\n"
1176             "    cmp     r1, #0x1a\n"
1177             "    bne     loc_fc2f661c\n"
1178             "loc_fc2f65aa:\n"
1179             "    add     r3, sp, #0xc\n"
1180             "    mov     r2, sp\n"
1181             "    add     r1, sp, #0x1c\n"
1182             "    bl      sub_fc2f4d8a\n"
1183             "    cmp     r0, #1\n"
1184             "    mov     r5, r0\n"
1185             "    beq     loc_fc2f65be\n"
1186             "    cmp     r5, #5\n"
1187             "    bne     loc_fc2f65d4\n"
1188             "loc_fc2f65be:\n"
1189             "    ldr     r0, [sp, #0x28]\n"
1190             "    mov     r2, r5\n"
1191             "    add.w   r0, r0, #0x94\n"
1192             "    ldrd    r7, r3, [r0, #0x18]\n"
1193             "    ldr     r1, [r0]\n"
1194             "    sub.w   r0, r0, #0x90\n"
1195             "    blx     r7\n"
1196             "    b       loc_fc2f65fa\n"
1197             "loc_fc2f65d4:\n"
1198             "    cmp     r5, #2\n"
1199             "    beq     loc_fc2f65dc\n"
1200             "    cmp     r5, #6\n"
1201             "    bne     loc_fc2f6606\n"
1202             "loc_fc2f65dc:\n"
1203             "    ldr     r0, [sp, #0x28]\n"
1204             "    mov     r2, r5\n"
1205             "    add.w   r0, r0, #0x94\n"
1206             "    ldrd    r7, r3, [r0, #0x18]\n"
1207             "    ldr     r1, [r0]\n"
1208             "    sub.w   r0, r0, #0x90\n"
1209             "    blx     r7\n"
1210             "    ldr     r0, [sp, #0x28]\n"
1211             "    add     r1, sp, #0x1c\n"
1212             "    mov     r2, sp\n"
1213             "    bl      sub_fc2f611a\n"
1214             "loc_fc2f65fa:\n"
1215             "    ldr     r2, [sp, #0xc]\n"
1216             "    mov     r1, r5\n"
1217             "    ldr     r0, [sp, #0x28]\n"
1218             "    bl      sub_fc2f6342\n"
1219             "    b       loc_fc2f67f6\n"
1220             "loc_fc2f6606:\n"
1221             "    ldr     r0, [sp, #0x28]\n"
1222             "    mov     r2, r5\n"
1223             "    add.w   r0, r0, #0x94\n"
1224             "    ldrd    r7, r3, [r0, #0x18]\n"
1225             "    ldr     r1, [r0]\n"
1226             "    sub.w   r0, r0, #0x90\n"
1227             "    blx     r7\n"
1228             "    b       loc_fc2f67f6\n"
1229             "loc_fc2f661c:\n"
1230             "    cmp     r1, #0x2d\n"
1231             "    beq     loc_fc2f6624\n"
1232             "    cmp     r1, #0x2e\n"
1233             "    bne     loc_fc2f6656\n"
1234             "loc_fc2f6624:\n"
1235             "    ldr.w   r1, [r0, #0x94]\n"
1236             "    mov     r5, sb\n"
1237             "    add.w   r1, r1, r1, lsl #1\n"
1238             "    add.w   r1, r0, r1, lsl #2\n"
1239             "    subs    r1, #8\n"
1240             "    ldm     r1!, {r2, r3, r7}\n"
1241             "    stm     r5!, {r2, r3, r7}\n"
1242             "    bl      sub_fc2f3c50\n"
1243             "    ldr     r0, [sp, #0x28]\n"
1244             "    add.w   r0, r0, #0x94\n"
1245             "    ldrd    r3, r2, [r0, #0x18]\n"
1246             "    ldr     r1, [r0]\n"
1247             "    sub.w   r0, r0, #0x90\n"
1248             "    blx     r3\n"
1249             "    ldr     r0, [sp, #0x28]\n"
1250             "    bl      sub_fc2f4054\n"
1251             "    b       loc_fc2f67f6\n"
1252             "loc_fc2f6656:\n"
1253             "    adds    r1, r0, #4\n"
1254             "    mov     r5, sb\n"
1255             "    ldm     r1!, {r2, r3, r7}\n"
1256             "    stm     r5!, {r2, r3, r7}\n"
1257             "    ldr     r1, [r0]\n"
1258             "    cmp     r1, #0x34\n"
1259             "    bhs     loc_fc2f66cc\n"
1260 
1261             //capdis -f=chdk -s=0xfc2f6691 -c=179 -stubs PRIMARY.BIN 0xfc000000
1262             "    tbb     [pc, r1]\n" // (jumptable r1 52 elements)
1263             "branchtable_fc2f6694:\n"
1264             "    .byte((loc_fc2f66c8 - branchtable_fc2f6694) / 2)\n" // (case 0)
1265             "    .byte((loc_fc2f66c8 - branchtable_fc2f6694) / 2)\n" // (case 1)
1266             "    .byte((loc_fc2f66ce - branchtable_fc2f6694) / 2)\n" // (case 2)
1267             "    .byte((loc_fc2f66d4 - branchtable_fc2f6694) / 2)\n" // (case 3)
1268             "    .byte((loc_fc2f66d4 - branchtable_fc2f6694) / 2)\n" // (case 4)
1269             "    .byte((loc_fc2f66d4 - branchtable_fc2f6694) / 2)\n" // (case 5)
1270             "    .byte((loc_fc2f66c8 - branchtable_fc2f6694) / 2)\n" // (case 6)
1271             "    .byte((loc_fc2f66ce - branchtable_fc2f6694) / 2)\n" // (case 7)
1272             "    .byte((loc_fc2f66d4 - branchtable_fc2f6694) / 2)\n" // (case 8)
1273             "    .byte((loc_fc2f66d4 - branchtable_fc2f6694) / 2)\n" // (case 9)
1274             "    .byte((loc_fc2f66e6 - branchtable_fc2f6694) / 2)\n" // (case 10)
1275             "    .byte((loc_fc2f66e6 - branchtable_fc2f6694) / 2)\n" // (case 11)
1276             "    .byte((loc_fc2f66e6 - branchtable_fc2f6694) / 2)\n" // (case 12)
1277             "    .byte((loc_fc2f67d4 - branchtable_fc2f6694) / 2)\n" // (case 13)
1278             "    .byte((loc_fc2f67da - branchtable_fc2f6694) / 2)\n" // (case 14)
1279             "    .byte((loc_fc2f67da - branchtable_fc2f6694) / 2)\n" // (case 15)
1280             "    .byte((loc_fc2f67da - branchtable_fc2f6694) / 2)\n" // (case 16)
1281             "    .byte((loc_fc2f67da - branchtable_fc2f6694) / 2)\n" // (case 17)
1282             "    .byte((loc_fc2f67e0 - branchtable_fc2f6694) / 2)\n" // (case 18)
1283             "    .byte((loc_fc2f67e4 - branchtable_fc2f6694) / 2)\n" // (case 19)
1284             "    .byte((loc_fc2f67e4 - branchtable_fc2f6694) / 2)\n" // (case 20)
1285             "    .byte((loc_fc2f67e4 - branchtable_fc2f6694) / 2)\n" // (case 21)
1286             "    .byte((loc_fc2f67e4 - branchtable_fc2f6694) / 2)\n" // (case 22)
1287             "    .byte((loc_fc2f67e4 - branchtable_fc2f6694) / 2)\n" // (case 23)
1288             "    .byte((loc_fc2f67e4 - branchtable_fc2f6694) / 2)\n" // (case 24)
1289             "    .byte((loc_fc2f67e4 - branchtable_fc2f6694) / 2)\n" // (case 25)
1290             "    .byte((loc_fc2f67e4 - branchtable_fc2f6694) / 2)\n" // (case 26)
1291             "    .byte((loc_fc2f66da - branchtable_fc2f6694) / 2)\n" // (case 27)
1292             "    .byte((loc_fc2f66e0 - branchtable_fc2f6694) / 2)\n" // (case 28)
1293             "    .byte((loc_fc2f66e0 - branchtable_fc2f6694) / 2)\n" // (case 29)
1294             "    .byte((loc_fc2f66e0 - branchtable_fc2f6694) / 2)\n" // (case 30)
1295             "    .byte((loc_fc2f66ee - branchtable_fc2f6694) / 2)\n" // (case 31)
1296             "    .byte((loc_fc2f66ee - branchtable_fc2f6694) / 2)\n" // (case 32)
1297             "    .byte((loc_fc2f66ee - branchtable_fc2f6694) / 2)\n" // (case 33)
1298             "    .byte((loc_fc2f66ee - branchtable_fc2f6694) / 2)\n" // (case 34)
1299             "    .byte((loc_fc2f66ee - branchtable_fc2f6694) / 2)\n" // (case 35)
1300             "    .byte((loc_fc2f66ee - branchtable_fc2f6694) / 2)\n" // (case 36)
1301             "    .byte((loc_fc2f66f4 - branchtable_fc2f6694) / 2)\n" // (case 37)
1302             "    .byte((loc_fc2f6726 - branchtable_fc2f6694) / 2)\n" // (case 38)
1303             "    .byte((loc_fc2f67e4 - branchtable_fc2f6694) / 2)\n" // (case 39)
1304             "    .byte((loc_fc2f67e4 - branchtable_fc2f6694) / 2)\n" // (case 40)
1305             "    .byte((loc_fc2f675a - branchtable_fc2f6694) / 2)\n" // (case 41)
1306             "    .byte((loc_fc2f678e - branchtable_fc2f6694) / 2)\n" // (case 42)
1307             "    .byte((loc_fc2f67c2 - branchtable_fc2f6694) / 2)\n" // (case 43)
1308             "    .byte((loc_fc2f67c2 - branchtable_fc2f6694) / 2)\n" // (case 44)
1309             "    .byte((loc_fc2f67e4 - branchtable_fc2f6694) / 2)\n" // (case 45)
1310             "    .byte((loc_fc2f67e4 - branchtable_fc2f6694) / 2)\n" // (case 46)
1311             "    .byte((loc_fc2f67c8 - branchtable_fc2f6694) / 2)\n" // (case 47)
1312             "    .byte((loc_fc2f67c8 - branchtable_fc2f6694) / 2)\n" // (case 48)
1313             "    .byte((loc_fc2f67c8 - branchtable_fc2f6694) / 2)\n" // (case 49)
1314             "    .byte((loc_fc2f67ce - branchtable_fc2f6694) / 2)\n" // (case 50)
1315             "    .byte((loc_fc2f67ce - branchtable_fc2f6694) / 2)\n" // (case 51)
1316             ".align 1\n"
1317             "loc_fc2f66c8:\n"
1318             "    bl      sub_fc2f2542\n"
1319             "loc_fc2f66cc:\n"
1320             "    b       loc_fc2f67e4\n"
1321             "loc_fc2f66ce:\n"
1322             "    bl      sub_fc2f27f2\n"
1323             "    b       loc_fc2f67e4\n"
1324             "loc_fc2f66d4:\n"
1325             "    bl      sub_fc2f2a06\n"
1326             "    b       loc_fc2f67e4\n"
1327             "loc_fc2f66da:\n"
1328             "    bl      sub_fc2f2cc8\n"
1329             "    b       loc_fc2f67e4\n"
1330             "loc_fc2f66e0:\n"
1331             "    bl      sub_fc2f2e8c\n"
1332             "    b       loc_fc2f67e4\n"
1333             "loc_fc2f66e6:\n"
1334             "    bl      sub_fc2f32e2_my\n"
1335             "    movs    r6, #0\n"
1336             "    b       loc_fc2f67e4\n"
1337             "loc_fc2f66ee:\n"
1338             "    bl      sub_fc2f33dc\n"
1339             "    b       loc_fc2f67e4\n"
1340             "loc_fc2f66f4:\n"
1341             "    ldrh    r1, [r0, #4]\n"
1342             "    strh.w  r1, [sp, #0x1c]\n"
1343             "    ldrh.w  r2, [r8, #2]\n"
1344             "    strh.w  r2, [sp, #0x1e]\n"
1345             "    ldrh.w  r2, [r8, #4]\n"
1346             "    strh.w  r2, [sp, #0x20]\n"
1347             "    ldrh.w  r2, [r8, #6]\n"
1348             "    strh.w  r2, [sp, #0x22]\n"
1349             "    ldrh    r2, [r0, #0xc]\n"
1350             "    strh.w  r2, [sp, #0x24]\n"
1351             "    ldrh.w  r1, [r8, #0xa]\n"
1352             "    strh.w  r1, [sp, #0x26]\n"
1353             "    bl      sub_fc2f399e\n"
1354             "    b       loc_fc2f67e4\n"
1355             "loc_fc2f6726:\n"
1356             "    ldrh    r1, [r0, #4]\n"
1357             "    strh.w  r1, [sp, #0x1c]\n"
1358             "    ldrh.w  r2, [r8, #2]\n"
1359             "    strh.w  r2, [sp, #0x1e]\n"
1360             "    ldrh.w  r2, [r8, #4]\n"
1361             "    strh.w  r2, [sp, #0x20]\n"
1362             "    ldrh.w  r2, [r8, #6]\n"
1363             "    strh.w  r2, [sp, #0x22]\n"
1364             "    ldrh.w  r2, [r8, #8]\n"
1365             "    strh.w  r2, [sp, #0x24]\n"
1366             "    ldrh.w  r1, [r8, #0xa]\n"
1367             "    strh.w  r1, [sp, #0x26]\n"
1368             "    bl      sub_fc2f755e\n"
1369             "    b       loc_fc2f67e4\n"
1370             "loc_fc2f675a:\n"
1371             "    ldrh.w  r2, [r8]\n"
1372             "    strh.w  r2, [sp, #0x1c]\n"
1373             "    ldrh    r2, [r0, #6]\n"
1374             "    strh.w  r2, [sp, #0x1e]\n"
1375             "    ldrh.w  r2, [r8, #4]\n"
1376             "    strh.w  r2, [sp, #0x20]\n"
1377             "    ldrh.w  r2, [r8, #6]\n"
1378             "    strh.w  r2, [sp, #0x22]\n"
1379             "    ldrh.w  r2, [r8, #8]\n"
1380             "    strh.w  r2, [sp, #0x24]\n"
1381             "    ldrh.w  r1, [r8, #0xa]\n"
1382             "    strh.w  r1, [sp, #0x26]\n"
1383             "    bl      sub_fc2f75e4\n"
1384             "    b       loc_fc2f67e4\n"
1385             "loc_fc2f678e:\n"
1386             "    ldrh.w  r2, [r8]\n"
1387             "    strh.w  r2, [sp, #0x1c]\n"
1388             "    ldrh.w  r2, [r8, #2]\n"
1389             "    strh.w  r2, [sp, #0x1e]\n"
1390             "    ldrh.w  r2, [r8, #4]\n"
1391             "    strh.w  r2, [sp, #0x20]\n"
1392             "    ldrh.w  r2, [r8, #6]\n"
1393             "    strh.w  r2, [sp, #0x22]\n"
1394             "    ldrh    r2, [r0, #0xc]\n"
1395             "    strh.w  r2, [sp, #0x24]\n"
1396             "    ldrh.w  r1, [r8, #0xa]\n"
1397             "    strh.w  r1, [sp, #0x26]\n"
1398             "    bl      sub_fc2f7662\n"
1399             "    b       loc_fc2f67e4\n"
1400             "loc_fc2f67c2:\n"
1401             "    bl      sub_fc2f3a58\n"
1402             "    b       loc_fc2f67e4\n"
1403             "loc_fc2f67c8:\n"
1404             "    bl      sub_fc2f411c\n"
1405             "    b       loc_fc2f67e4\n"
1406             "loc_fc2f67ce:\n"
1407             "    bl      sub_fc2f4510\n"
1408             "    b       loc_fc2f67e4\n"
1409             "loc_fc2f67d4:\n"
1410             "    bl      sub_fc2f4756\n"
1411             "    b       loc_fc2f67e4\n"
1412             "loc_fc2f67da:\n"
1413             "    bl      sub_fc2f48bc\n"
1414             "    b       loc_fc2f67e4\n"
1415             "loc_fc2f67e0:\n"
1416             "    bl      sub_fc2f49d6\n"
1417             "loc_fc2f67e4:\n"
1418             "    ldr     r0, [sp, #0x28]\n"
1419             "    add.w   r0, r0, #0x94\n"
1420             "    ldrd    r3, r2, [r0, #0x18]\n"
1421             "    ldr     r1, [r0]\n"
1422             "loc_fc2f67f0:\n"
1423             "    sub.w   r0, r0, #0x90\n"
1424             "    blx     r3\n"
1425             "loc_fc2f67f6:\n"
1426             "    ldr     r0, [sp, #0x28]\n"
1427             "    ldr     r0, [r0]\n"
1428             "    cmp     r0, #0x11\n"
1429             "    beq     loc_fc2f681a\n"
1430             "    bgt     loc_fc2f680e\n"
1431             "    cmp     r0, #1\n"
1432             "    beq     loc_fc2f681a\n"
1433             "    cmp     r0, #4\n"
1434             "    beq     loc_fc2f681a\n"
1435             "    cmp     r0, #0xf\n"
1436             "    bne     loc_fc2f684e\n"
1437             "    b       loc_fc2f681a\n"
1438             "loc_fc2f680e:\n"
1439             "    cmp     r0, #0x14\n"
1440             "    beq     loc_fc2f681a\n"
1441             "    cmp     r0, #0x1a\n"
1442             "    beq     loc_fc2f681a\n"
1443             "    cmp     r0, #0x1d\n"
1444             "    bne     loc_fc2f684e\n"
1445             "loc_fc2f681a:\n"
1446             "    ldrsh.w r0, [r8]\n"
1447             "    mov     r1, r8\n"
1448             "    mov     r2, fp\n"
1449             "    cmp     r0, fp\n"
1450             "    beq     loc_fc2f682e\n"
1451             "    ldrsh.w r1, [r1, #8]\n"
1452             "    cmp     r1, r2\n"
1453             "    bne     loc_fc2f6846\n"
1454             "loc_fc2f682e:\n"
1455             "    add     r0, sp, #0x10\n"
1456             "    bl      sub_fc3af9b2\n"
1457             "    ldrh.w  r0, [sp, #0x10]\n"
1458             "    strh.w  r0, [sp, #0x1c]\n"
1459             "    ldrh.w  r0, [sp, #0x18]\n"
1460             "    strh.w  r0, [sp, #0x24]\n"
1461             "    b       loc_fc2f684e\n"
1462             "loc_fc2f6846:\n"
1463             "    strh.w  r0, [sp, #0x1c]\n"
1464             "    strh.w  r1, [sp, #0x24]\n"
1465             "loc_fc2f684e:\n"
1466             "    cmp     r6, #1\n"
1467             "    ldr     r0, [sp, #0x28]\n"
1468             "    bne     loc_fc2f6886\n"
1469             "    movs    r2, #0xc\n"
1470             "    ldr.w   r1, [r0, #0x94]\n"
1471             "    add.w   r1, r1, r1, lsl #1\n"
1472             "    add.w   r5, r0, r1, lsl #2\n"
1473             "    ldr     r0, =0x0006ee40\n"
1474             "    subs    r5, #8\n"
1475             "    add     r1, sp, #0x1c\n"
1476             "    blx     sub_fc34d204\n"
1477             "    ldr     r0, =0x0006ee40\n"
1478             "    movs    r2, #0xc\n"
1479             "    add     r1, sp, #0x1c\n"
1480             "    adds    r0, #0xc\n"
1481             "    blx     sub_fc34d204\n"
1482             "    ldr     r0, =0x0006ee40\n"
1483             "    movs    r2, #0xc\n"
1484             "    mov     r1, r5\n"
1485             "    adds    r0, #0x18\n"
1486             "    blx     sub_fc34d204\n"
1487             "    b       loc_fc2f68d0\n"
1488             "loc_fc2f6886:\n"
1489             "    ldr     r0, [r0]\n"
1490             "    mov.w   r3, #1\n"
1491             "    cmp     r0, #0xc\n"
1492             "    bne     loc_fc2f68b0\n"
1493             "    movs    r2, #0\n"
1494             "    mov     r1, r3\n"
1495             "    strd    r2, r3, [sp]\n"
1496             "    movs    r0, #0\n"
1497             "    mov     r2, r3\n"
1498             "    bl      sub_fc2f239a\n"
1499             "    movs    r3, #1\n"
1500             "    movs    r2, #0\n"
1501             "    mov     r1, r3\n"
1502             "    movs    r0, #0\n"
1503             "    strd    r2, r3, [sp]\n"
1504             "    mov     r2, r3\n"
1505             "    b       loc_fc2f68cc\n"
1506             "loc_fc2f68b0:\n"
1507             "    movs    r2, #1\n"
1508             "    strd    r2, r3, [sp]\n"
1509             "    mov     r3, r2\n"
1510             "    mov     r1, r2\n"
1511             "    mov     r0, r2\n"
1512             "    bl      sub_fc2f239a\n"
1513             "    movs    r3, #1\n"
1514             "    str     r3, [sp]\n"
1515             "    mov     r2, r3\n"
1516             "    mov     r1, r3\n"
1517             "    mov     r0, r3\n"
1518             "    str     r3, [sp, #4]\n"
1519             "loc_fc2f68cc:\n"
1520             "    bl      sub_fc2f24c0\n"
1521             "loc_fc2f68d0:\n"
1522             "    ldr     r0, [sp, #0x28]\n"
1523             "    bl      sub_fc2f74c4\n"
1524             "    b       loc_fc2f63f2\n"
1525 ".ltorg\n"
1526     );
1527 }
1528 
1529 //fc2f32e2
1530 void __attribute__((naked,noinline)) sub_fc2f32e2_my() {
1531 asm volatile (
1532         //capdis -f=chdk -s=0xfc2f32e3 -c=52 -jfw -stubs PRIMARY.BIN 0xfc000000
1533         "    push.w  {r4, r5, r6, r7, r8, lr}\n"
1534         "    ldr     r7, =0x0000e89c\n"
1535         "    movs    r1, #0x3e\n"
1536         "    mov     r4, r0\n"
1537         "    ldr     r0, [r7, #0x1c]\n"
1538         "    blx     sub_fc34d1cc\n"
1539         "    movs    r2, #0\n"
1540         "    ldrsh.w r0, [r4, #4]\n"
1541         "    movs    r3, #1\n"
1542         "    mov     r1, r2\n"
1543         "    bl      sub_fc2f1ec4\n"
1544         "    mov     r6, r0\n"
1545         "    ldrsh.w r0, [r4, #6]\n"
1546         "    bl      sub_fc2f205e\n"
1547         "    ldrsh.w r0, [r4, #8]\n"
1548         "    bl      sub_fc2f20a4\n"
1549         "    ldrsh.w r0, [r4, #0xa]\n"
1550         "    bl      sub_fc2f20ea\n"
1551         "    ldrsh.w r0, [r4, #0xc]\n"
1552         "    movs    r1, #0\n"
1553         "    bl      sub_fc2f2130\n"
1554         "    mov     r5, r0\n"
1555         "    ldr     r0, [r4]\n"
1556         "    ldr.w   r8, =0x0006ee58\n"
1557         "    cmp     r0, #0xc\n"
1558         "    bne     loc_fc2f3336\n"
1559         "    movs    r6, #0\n"
1560         "    mov     r5, r6\n"
1561         "    b       loc_fc2f334e\n"
1562         "loc_fc2f3336:\n"
1563         "    cmp     r6, #1\n"
1564         "    bne     loc_fc2f334e\n"
1565         "    ldrsh.w r0, [r4, #4]\n"
1566         "    movs    r2, #2\n"
1567         "    ldr     r1, =0xfc2f1e5b\n"
1568         "    bl      sub_fc16402a\n"
1569         "    strh    r0, [r4, #4]\n"
1570         "    movs    r0, #0\n"
1571         "    str     r0, [r7, #0x28]\n"
1572         "    b       loc_fc2f3354\n"
1573         "loc_fc2f334e:\n"
1574         "    ldrh.w  r0, [r8]\n"
1575         "    strh    r0, [r4, #4]\n"
1576         "loc_fc2f3354:\n"
1577         "    cmp     r5, #1\n"
1578         "    bne     loc_fc2f3366\n"
1579         "    ldrsh.w r0, [r4, #0xc]\n"
1580         "    movs    r2, #0x20\n"
1581         "    ldr     r1, =0xfc2f1eaf\n"
1582         "    bl      sub_fc2f7534\n"
1583         "    b       loc_fc2f336a\n"
1584         "loc_fc2f3366:\n"
1585         "    ldrh.w  r0, [r8, #8]\n"
1586         "loc_fc2f336a:\n"
1587         "    strh    r0, [r4, #0xc]\n"
1588         "    ldrsh.w r0, [r4, #6]\n"
1589         "    bl      sub_fc470d06_my\n"
1590         "    ldr     pc, =0xfc2f3375\n" // Continue in firmware
1591 ".ltorg\n"
1592     );
1593 }
1594 
1595 //fc470d06
1596 void __attribute__((naked,noinline)) sub_fc470d06_my() {
1597 asm volatile (
1598         //capdis -f=chdk -s=0xfc470d07 -c=35 -stubs PRIMARY.BIN 0xfc000000
1599         "    push    {r4, r5, r6, lr}\n"
1600         "    ldr     r5, =0x0000fd5c\n"
1601         "    mov     r4, r0\n"
1602         "    ldr     r0, [r5, #4]\n"
1603         "    cmp     r0, #1\n"
1604         "    beq     loc_fc470d1e\n"
1605         "    movs    r0, #0\n"
1606         "    movw    r2, #0x16b\n"
1607         "    ldr     r1, =0xfc470d68\n" //  *"Shutter.c"
1608         "    blx     sub_fc34d24c\n"
1609         "loc_fc470d1e:\n"
1610         "    ldr     r0, =0xfffff400\n"
1611         "    cmp     r4, r0\n"
1612         "    bne     loc_fc470d28\n"
1613         "    ldrsh.w r4, [r5, #2]\n"
1614         "loc_fc470d28:\n"
1615         "    strh    r4, [r5, #2]\n"
1616         "    cmp     r4, r0\n"
1617         "    bne     loc_fc470d3a\n"
1618         "    movs    r0, #0\n"
1619         "    movw    r2, #0x171\n"
1620         "    ldr     r1, =0xfc470d68\n" //  *"Shutter.c"
1621         "    blx     sub_fc34d24c\n"
1622         "loc_fc470d3a:\n"
1623         "    mov     r0, r4\n"
1624 //        "    bl      sub_fc25f5ca\n"      // -
1625         "    bl      apex2us\n"             // +
1626         "    mov     r4, r0\n"
1627         "    bl      sub_fc198752\n"
1628         "    mov     r0, r4\n"
1629         "    bl      sub_fc19a8f6\n"
1630         "    lsls    r0, r0, #0x1f\n"
1631         "    beq     loc_fc470d60\n"
1632         "    pop.w   {r4, r5, r6, lr}\n"
1633         "    movs    r0, #0\n"
1634         "    movw    r2, #0x176\n"
1635         "    ldr     r1, =0xfc470d68\n" //  *"Shutter.c"
1636         "    b.w     sub_fc34c700\n"
1637         "loc_fc470d60:\n"
1638         "    pop     {r4, r5, r6, pc}\n"
1639 ".ltorg\n"
1640     );
1641 }
1642 

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