root/platform/sx280hs/sub/102b/filewrite.c

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

DEFINITIONS

This source file includes following definitions.
  1. log_fwt_msg
  2. log_fwt_start
  3. filewritetask
  4. sub_fc054ea8_my
  5. sub_fc0552f8_my
  6. sub_fc054fa6_my

   1 #include "lolevel.h"
   2 #include "platform.h"
   3 
   4 // NOTE: file is based on G16 filewrite.c (including comments), struct offsets appear to match
   5 
   6 extern void _LogCameraEvent(int id,const char *fmt,...);
   7 
   8 typedef struct {
   9     unsigned int address;
  10     unsigned int length;
  11 } cam_ptp_data_chunk; //camera specific structure
  12 
  13 #define MAX_CHUNKS_FOR_JPEG 7 // filewritetask is prepared for this many chunks
  14                               // Note : corresponds to filewritetask() jump table entries 0-6
  15 /*
  16  * fwt_data_struct: defined here as it's camera dependent
  17  * unneeded members are designated with unkn
  18  * file_offset, full_size, seek_flag only needs to be defined for cameras with CAM_FILEWRITETASK_SEEK/CAM_FILEWRITETASK_MULTIPASS
  19  * pdc is always required, name is not currently used
  20  */
  21 typedef struct
  22 {
  23     int unkn1;                // 00 message number
  24     int file_offset;          // 01
  25     int maybe_full_size;      // 02 TODO doesn't seem to actually be full size for jpeg, instead round number somewhat smaller
  26     int unkn2, unkn3;         // 03, 04
  27     cam_ptp_data_chunk pdc[MAX_CHUNKS_FOR_JPEG];  // 05 - 18
  28     int maybe_seek_flag;      // 19 from sub_fc054ea8 0x4C = 74 bytes,  74/4 = 19 words offset in fwt_data_struct
  29     int unkn5, unkn6;         // 20, 21
  30     char name[32];            // 22 from sub_fc054ea8  0x58 = 88 bytes,  88/4 = 22 words offset in fwt_data_struct
  31 } fwt_data_struct;
  32 
  33 #include "../../../generic/filewrite.c"
  34 
  35 #if 0
  36 void log_fwt_msg(fwt_data_struct *fwd)
  37 {
  38     int m=fwd->unkn1;
  39     _LogCameraEvent(0x60,"fw m:%d o:0x%08x fs:0x%08x sf:0x%x",m,fwd->file_offset,fwd->maybe_full_size,fwd->maybe_seek_flag);
  40     _LogCameraEvent(0x60,"fw %s",fwd->name);
  41     if(m >= 0 && m <=6) {
  42         _LogCameraEvent(0x60,"fw chunk adr:0x%08x l:0x%08x",fwd->pdc[m].address,fwd->pdc[m].length);
  43     }
  44     _LogCameraEvent(0x60,"fw u %08x %08x %08x %08x %08x",fwd->unkn2,fwd->unkn3,fwd->unkn5,fwd->unkn6);
  45 }
  46 
  47 void log_fwt_start(void)
  48 {
  49     _LogCameraEvent(0x60,"fw start");
  50 }
  51 #endif
  52 
  53 /*************************************************************/
  54 void __attribute__((naked,noinline)) filewritetask() {
  55 asm volatile (
  56 // -f=chdk -s=task_FileWrite -c=73 -stubs PRIMARY.BIN 0xfc000000
  57 // task_FileWriteTask 0xfc05509d
  58 "    push    {r2, r3, r4, r5, r6, lr}\n"
  59 "    ldr     r5, =0x0001b294\n"
  60 "loc_fc0550a0:\n"
  61 "    movs    r2, #0\n"
  62 "    add     r1, sp, #4\n"
  63 "    ldr     r0, [r5, #0x10]\n"
  64 "    blx     sub_fc251bfc\n" // j_ReceiveMessageQueue
  65 "    cbz     r0, loc_fc0550b8\n"
  66 "    movs    r0, #0\n"
  67 "    movw    r2, #0x3ef\n"
  68 "    ldr     r1, =0xfc05522c\n" //  *"dwFWrite.c"
  69 "    blx     sub_fc251d14\n" // j_DebugAssert
  70 "loc_fc0550b8:\n"
  71 "    ldr     r0, [sp, #4]\n"
  72 "    ldr     r1, [r0]\n"
  73 "    cmp     r1, #0xd\n"
  74 "    bhs     loc_fc0550a0\n"
  75 "    tbb     [pc, r1]\n" // (jumptable r1 13 elements)
  76 "branchtable_fc0550c4:\n"
  77 "    .byte((loc_fc05515e - branchtable_fc0550c4) / 2)\n" // (case 0)
  78 "    .byte((loc_fc05515e - branchtable_fc0550c4) / 2)\n" // (case 1)
  79 "    .byte((loc_fc05515e - branchtable_fc0550c4) / 2)\n" // (case 2)
  80 "    .byte((loc_fc05515e - branchtable_fc0550c4) / 2)\n" // (case 3)
  81 "    .byte((loc_fc05515e - branchtable_fc0550c4) / 2)\n" // (case 4)
  82 "    .byte((loc_fc05515e - branchtable_fc0550c4) / 2)\n" // (case 5)
  83 "    .byte((loc_fc05515e - branchtable_fc0550c4) / 2)\n" // (case 6)
  84 "    .byte((loc_fc055164 - branchtable_fc0550c4) / 2)\n" // (case 7)
  85 "    .byte((loc_fc0550d2 - branchtable_fc0550c4) / 2)\n" // (case 8)
  86 "    .byte((loc_fc0550fc - branchtable_fc0550c4) / 2)\n" // (case 9)
  87 "    .byte((loc_fc05511c - branchtable_fc0550c4) / 2)\n" // (case 10)
  88 "    .byte((loc_fc0550d8 - branchtable_fc0550c4) / 2)\n" // (case 11)
  89 "    .byte((loc_fc0550f6 - branchtable_fc0550c4) / 2)\n" // (case 12)
  90 ".align 1\n"
  91 "loc_fc0550d2:\n"
  92 "    bl      sub_fc0552b4\n"
  93 "    b       loc_fc0550a0\n"
  94 "loc_fc0550d8:\n"
  95 "    mov     r4, r0\n"
  96 "    adds    r0, #0x58\n"
  97 "    mov     r6, r0\n"
  98 "    bl      sub_fc2a4df0\n"
  99 "    movs    r1, #0\n"
 100 "    bl      sub_fc05cd5e\n"
 101 "    ldr     r0, [r4, #0xc]\n"
 102 "    bl      sub_fc0a2b32\n"
 103 "    mov     r0, r6\n"
 104 "    bl      sub_fc2a549e\n" // PrepareDirectory_0
 105 "    b       loc_fc055146\n"
 106 "loc_fc0550f6:\n"
 107 "    bl      sub_fc054ea8_my\n" // -> ... fwt_open
 108 "    b       loc_fc0550a0\n"
 109 "loc_fc0550fc:\n"
 110 "    ldr     r1, [r0, #4]\n"
 111 "    movs    r2, #0\n"
 112 "    mov     r4, r0\n"
 113 "    ldr     r0, [r5, #4]\n"
 114 "    bl      sub_fc2a51e0\n" // Lseek_FW
 115 "    adds    r0, r0, #1\n"
 116 "    bne     loc_fc0550a0\n"
 117 "    ldr     r0, =0x09200001\n"
 118 "    mov     r1, r4\n"
 119 "    adds    r0, #0x12\n"
 120 "    str     r0, [r4, #0x10]\n"
 121 "    movs    r0, #7\n"
 122 "    bl      sub_fc054e34\n"
 123 "    b       loc_fc0550a0\n"
 124 "loc_fc05511c:\n"
 125 "    mov     r4, r0\n"
 126 "    ldrsb.w r0, [r0, #0x58]\n"
 127 "    cmp     r0, #0\n"
 128 "    beq     loc_fc0550a0\n"
 129 "    strb.w  r0, [sp]\n"
 130 "    movs    r0, #0\n"
 131 "    strb.w  r0, [sp, #1]\n"
 132 "    add.w   r0, r4, #0x58\n"
 133 "    mov     r6, r0\n"
 134 "    bl      sub_fc2a4df0\n"
 135 "    movs    r1, #0\n"
 136 "    bl      sub_fc05cd5e\n"
 137 "    mov     r0, sp\n"
 138 "    bl      sub_fc0a2b3e\n"
 139 "loc_fc055146:\n"
 140 "    mov     r0, r6\n"
 141 "    bl      sub_fc2a4df0\n"
 142 "    ldr     r1, [r5, #0x18]\n"
 143 "    bl      sub_fc05cdbc\n"
 144 "    ldr     r1, [r5, #0x14]\n"
 145 "    cmp     r1, #0\n"
 146 "    beq     loc_fc0550a0\n"
 147 "    ldr     r0, [r4, #0x10]\n"
 148 "    blx     r1\n"
 149 "    b       loc_fc0550a0\n"
 150 "loc_fc05515e:\n"
 151 "    bl      sub_fc0552f8_my\n" // -> ... fwt_write
 152 "    b       loc_fc0550a0\n"
 153 "loc_fc055164:\n"
 154 "    bl      sub_fc054fa6_my\n" // -> ... fwt_close
 155 "    b       loc_fc0550a0\n"
 156 ".ltorg\n"
 157     );
 158 }
 159 
 160 void __attribute__((naked,noinline)) sub_fc054ea8_my() {
 161 asm volatile (
 162 // open stage
 163 // -f=chdk -s=0xfc054ea9 -c=103 -stubs PRIMARY.BIN 0xfc000000
 164 "    push.w  {r4, r5, r6, r7, r8, lr}\n"
 165 "    mov     r4, r0\n"
 166 //"  mov   r0, r4\n"                // + data block start, commented out as R0 is already holding what we need
 167 "    BL      filewrite_main_hook\n" // +
 168 "    mov     r0, r4\n"              // + restore register(s)
 169 "    ldr     r0, [r0, #0x4c]\n"
 170 "    sub     sp, #0x38\n"
 171 "    lsls    r0, r0, #0x1f\n"
 172 "    beq     loc_fc054f82\n"
 173 "    add.w   r0, r4, #0x58\n"
 174 "    mov     r7, r0\n"
 175 "    bl      sub_fc2a4df0\n"
 176 "    movs    r1, #0\n"
 177 "    bl      sub_fc05cd5e\n"
 178 "    ldr     r0, [r4, #0xc]\n"
 179 "    bl      sub_fc0a2b32\n"
 180 "    ldr     r0, [r4, #0x4c]\n"
 181 "    movw    r5, #0x301\n"
 182 "    lsls    r1, r0, #0x1b\n"
 183 "    bpl     loc_fc054eda\n"
 184 "    movs    r5, #9\n"
 185 "    b       loc_fc054ee0\n"
 186 "loc_fc054eda:\n"
 187 "    lsls    r1, r0, #0x19\n"
 188 "    bpl     loc_fc054ee0\n"
 189 "    movs    r5, #1\n"
 190 "loc_fc054ee0:\n"
 191 "    lsls    r0, r0, #0x1a\n"
 192 "    bmi     loc_fc054eea\n"
 193 "    ldr     r0, [r4, #0x54]\n"
 194 "    cmp     r0, #1\n"
 195 "    bne     loc_fc054eee\n"
 196 "loc_fc054eea:\n"
 197 "    orr     r5, r5, #0x8000\n"
 198 "loc_fc054eee:\n"
 199 "    movw    r8, #0x1b6\n"
 200 "    ldr     r6, [r4, #0xc]\n"
 201 "    mov     r2, r8\n"
 202 "    mov     r1, r5\n"
 203 "    mov     r0, r7\n"
 204 //"    bl      sub_fc2a50fa\n"      // - j_Open_FW
 205 "    bl      fwt_open\n"            // +
 206 "    adds    r1, r0, #1\n"
 207 "    bne     loc_fc054f3c\n"
 208 "    mov     r0, r7\n"
 209 "    bl      sub_fc2a549e\n" // PrepareDirectory_0
 210 "    movs    r2, #0xf\n"
 211 "    mov     r1, r7\n"
 212 "    mov     r0, sp\n"
 213 "    blx     sub_fc251d34\n"
 214 "    movs    r0, #0\n"
 215 "    strb.w  r0, [sp, #0xf]\n"
 216 "    movw    r1, #0x41ff\n"
 217 "    str     r1, [sp, #0x20]\n"
 218 "    movs    r1, #0x10\n"
 219 "    str     r6, [sp, #0x30]\n"
 220 "    strd    r0, r6, [sp, #0x28]\n"
 221 "    mov     r0, sp\n"
 222 "    str     r6, [sp, #0x34]\n"
 223 "    str     r1, [sp, #0x24]\n"
 224 "    add     r1, sp, #0x20\n"
 225 "    bl      sub_fc0f2ffe\n"
 226 "    mov     r2, r8\n"
 227 "    mov     r1, r5\n"
 228 "    mov     r0, r7\n"
 229 "    bl      sub_fc2a50fa\n" // j_Open_FW
 230 "loc_fc054f3c:\n"
 231 "    ldr     r5, =0x0001b294\n"
 232 "    mov     r6, r0\n"
 233 "    str     r0, [r5, #4]\n"
 234 "    adds    r0, r0, #1\n"
 235 "    bne     loc_fc054f62\n"
 236 "    mov     r0, r7\n"
 237 "    bl      sub_fc2a4df0\n"
 238 "    ldr     r1, [r5, #0x18]\n"
 239 "    bl      sub_fc05cdbc\n"
 240 "    ldr     r1, [r5, #0x14]\n"
 241 "    cmp     r1, #0\n"
 242 "    beq     loc_fc054fa0\n"
 243 "    add     sp, #0x38\n"
 244 "    ldr     r0, =0x09200001\n"
 245 "    pop.w   {r4, r5, r6, r7, r8, lr}\n"
 246 "    bx      r1\n"
 247 "loc_fc054f62:\n"
 248 "    ldr     r0, =0x0014063c\n"
 249 "    movs    r2, #0x20\n"
 250 "    mov     r1, r7\n"
 251 "    blx     sub_fc251d3c\n" // j_dry_memcpy
 252 //mod start                                 // +
 253 "    ldr     r3, =current_write_ignored\n"  // +
 254 "    ldr     r3, [r3]\n"                    // +
 255 "    cbnz    r3, loc_fwto1\n"               // + jump over the next block
 256 //mod end                                   // +
 257 "    ldr     r0, [r4, #0x4c]\n"
 258 "    lsls    r0, r0, #0x18\n"
 259 "    bpl     loc_fc054f82\n"
 260 "    ldr     r1, [r4, #8]\n"
 261 "    mov     r0, r6\n"
 262 "    bl      sub_fc2a52b4\n"
 263 "    cbnz    r0, loc_fc054f82\n"
 264 "    movs    r0, #7\n"
 265 "    mov     r1, r4\n"
 266 "    b       loc_fc054f98\n"
 267 "loc_fc054f82:\n"
 268 "loc_fwto1:\n"                              // +
 269 "    ldr     r0, [r4, #0x4c]\n"
 270 "    lsls    r0, r0, #0x19\n"
 271 "    bmi     loc_fc054f8c\n"
 272 "    ldr     r0, [r4, #4]\n"
 273 "    cbz     r0, loc_fc054f94\n"
 274 "loc_fc054f8c:\n"
 275 "    movs    r0, #9\n"
 276 "    mov     r1, r4\n"
 277 "    bl      sub_fc054e34\n"
 278 "loc_fc054f94:\n"
 279 "    movs    r0, #0\n"
 280 "    mov     r1, r4\n"
 281 "loc_fc054f98:\n"
 282 "    add     sp, #0x38\n"
 283 "    pop.w   {r4, r5, r6, r7, r8, lr}\n"
 284 //"    b       loc_fc054e34\n"              // -
 285 "    ldr     pc, =0xfc054e34+1\n"           // +
 286 "loc_fc054fa0:\n"
 287 "    add     sp, #0x38\n"
 288 "    pop.w   {r4, r5, r6, r7, r8, pc}\n"
 289 ".ltorg\n"
 290     );
 291 }
 292 
 293 void __attribute__((naked,noinline)) sub_fc0552f8_my() {
 294 asm volatile (
 295 // write stage
 296 // -f=chdk -s=0xfc0552f9 -c=64 -stubs PRIMARY.BIN 0xfc000000
 297 "    push.w  {r4, r5, r6, r7, r8, sb, sl, lr}\n"
 298 "    mov     r5, r0\n"
 299 "    ldr     r0, [r0]\n"
 300 "    cmp     r0, #6\n"
 301 "    bhi     loc_fc055310\n"
 302 "    add.w   r0, r5, r0, lsl #3\n"
 303 "    ldrd    r7, r6, [r0, #0x14]\n"
 304 "    cbnz    r6, loc_fc055324\n"
 305 "    b       loc_fc05531e\n"
 306 "loc_fc055310:\n"
 307 "    movw    r2, #0x344\n"
 308 "    ldr     r1, =0xfc05522c\n" //  *"dwFWrite.c"
 309 "    movs    r0, #0\n"
 310 "    blx     sub_fc251d14\n" // j_DebugAssert
 311 "loc_fc05531e:\n"
 312 "    movs    r0, #7\n"
 313 "    mov     r1, r5\n"
 314 "    b       loc_fc055392\n"
 315 "loc_fc055324:\n"
 316 "    ldr.w   sl, =0x0001b294\n"
 317 "    mov.w   sb, #0x1000000\n"
 318 "    mov     r4, r6\n"
 319 "loc_fc05532e:\n"
 320 "    ldr     r0, [r5, #4]\n"
 321 "    cmp     r4, sb\n"
 322 "    mov     r1, sb\n"
 323 "    bhi     loc_fc055338\n"
 324 "    mov     r1, r4\n"
 325 "loc_fc055338:\n"
 326 "    lsls    r2, r0, #8\n"
 327 "    beq     loc_fc05534a\n"
 328 "    bic     r0, r0, #0xff000000\n"
 329 "    rsb.w   r0, r0, #0x1000000\n"
 330 "    cmp     r1, r0\n"
 331 "    bls     loc_fc05534a\n"
 332 "    mov     r1, r0\n"
 333 "loc_fc05534a:\n"
 334 "    ldr.w   r0, [sl, #4]\n"
 335 "    mov     r8, r1\n"
 336 "    mov     r2, r1\n"
 337 "    mov     r1, r7\n"
 338 //"    bl      sub_fc2a51a2\n"  // - j_Write_FW
 339 "    bl      fwt_write\n"       // +
 340 "    ldr     r1, [r5, #4]\n"
 341 "    cmp     r8, r0\n"
 342 "    add     r1, r0\n"
 343 "    str     r1, [r5, #4]\n"
 344 "    beq     loc_fc055372\n"
 345 "    adds    r0, r0, #1\n"
 346 "    bne     loc_fc05536a\n"
 347 "    ldr     r0, =0x09200005\n"
 348 "    b       loc_fc05536e\n"
 349 "loc_fc05536a:\n"
 350 "    ldr     r0, =0x09200005\n"
 351 "    adds    r0, #0x10\n"
 352 "loc_fc05536e:\n"
 353 "    str     r0, [r5, #0x10]\n"
 354 "    b       loc_fc05531e\n"
 355 "loc_fc055372:\n"
 356 "    subs    r4, r4, r0\n"
 357 "    cmp     r4, r6\n"
 358 "    add     r7, r0\n"
 359 "    blo     loc_fc055388\n"
 360 "    movw    r2, #0x36f\n"
 361 "    ldr     r1, =0xfc05522c\n" //  *"dwFWrite.c"
 362 "    movs    r0, #0\n"
 363 "    blx     sub_fc251d14\n" // j_DebugAssert
 364 "loc_fc055388:\n"
 365 "    cmp     r4, #0\n"
 366 "    bne     loc_fc05532e\n"
 367 "    ldr     r0, [r5]\n"
 368 "    mov     r1, r5\n"
 369 "    adds    r0, r0, #1\n"
 370 "loc_fc055392:\n"
 371 "    pop.w   {r4, r5, r6, r7, r8, sb, sl, lr}\n"
 372 //"    b       loc_fc054e34\n"      // -
 373 "    ldr     pc, =0xfc054e34+1\n"   // +
 374 ".ltorg\n"
 375     );
 376 }
 377 
 378 void __attribute__((naked,noinline)) sub_fc054fa6_my() {
 379 asm volatile (
 380 // close stage
 381 // -f=chdk -s=0xfc054fa7 -c=104 -stubs PRIMARY.BIN 0xfc000000
 382 "    push    {r4, r5, r6, lr}\n"
 383 "    mov     r4, r0\n"
 384 "    ldr     r0, [r0, #0x4c]\n"
 385 "    ldr     r5, =0x0001b294\n"
 386 "    sub     sp, #0x38\n"
 387 "    lsls    r0, r0, #0x1e\n"
 388 "    bpl     loc_fc05508a\n"
 389 "    ldr     r0, [r5, #4]\n"
 390 "    adds    r1, r0, #1\n"
 391 "    beq     loc_fc054fd8\n"
 392 "    ldr     r6, =0x09200001\n"
 393 "    ldr     r1, [r4, #0x54]\n"
 394 "    adds    r6, r6, #2\n"
 395 "    cmp     r1, #1\n"
 396 "    bne     loc_fc054fca\n"
 397 //mod start                                 // +
 398 "    ldr     r3, =current_write_ignored\n"  // +
 399 "    ldr     r3, [r3]\n"                    // +
 400 "    cbnz    r3, loc_fwtc1\n"               // + jump over the next block
 401 //mod end                                   // +
 402 "    bl      sub_fc2a50fe\n"
 403 "    b       loc_fc054fce\n"
 404 "loc_fc054fca:\n"
 405 "loc_fwtc1:\n"                              // +
 406 //"    bl      sub_fc2a50fc\n"              // - j_Close_FW
 407 "    bl      fwt_close\n"                   // +
 408 "loc_fc054fce:\n"
 409 "    cbz     r0, loc_fc054fd2\n"
 410 "    str     r6, [r4, #0x10]\n"
 411 "loc_fc054fd2:\n"
 412 "    mov.w   r0, #-1\n"
 413 "    str     r0, [r5, #4]\n"
 414 "loc_fc054fd8:\n"
 415 "    add.w   r6, r4, #0x58\n"
 416 "    ldr     r0, [r4, #0x10]\n"
 417 "    lsls    r0, r0, #0x1f\n"
 418 "    bne     loc_fc05507c\n"
 419 "    ldr     r0, [r4, #0x4c]\n"
 420 "    lsls    r1, r0, #0x1f\n"
 421 "    beq     loc_fc055004\n"
 422 "    movw    r0, #0x81ff\n"
 423 "    str     r0, [sp, #0x20]\n"
 424 "    movs    r0, #0x20\n"
 425 "    str     r0, [sp, #0x24]\n"
 426 "    ldr     r0, [r4, #4]\n"
 427 "    str     r0, [sp, #0x28]\n"
 428 "    ldr     r0, [r4, #0xc]\n"
 429 "    str     r0, [sp, #0x2c]\n"
 430 "    ldr     r0, [r4, #0xc]\n"
 431 "    str     r0, [sp, #0x30]\n"
 432 "    ldr     r0, [r4, #0xc]\n"
 433 "    str     r0, [sp, #0x34]\n"
 434 "    b       loc_fc055026\n"
 435 "loc_fc055004:\n"
 436 "    lsls    r0, r0, #0x1b\n"
 437 "    bpl     loc_fc055026\n"
 438 "    add     r1, sp, #0x20\n"
 439 "    mov     r0, r6\n"
 440 "    bl      sub_fc0f2f88\n"
 441 "    cbnz    r0, loc_fc05501e\n"
 442 "    movs    r0, #0\n"
 443 "    movw    r2, #0x3b6\n"
 444 "    ldr     r1, =0xfc05522c\n" //  *"dwFWrite.c"
 445 "    blx     sub_fc251d14\n" // j_DebugAssert
 446 "loc_fc05501e:\n"
 447 "    ldr     r0, [sp, #0x28]\n"
 448 "    ldr     r1, [r4, #4]\n"
 449 "    add     r0, r1\n"
 450 "    str     r0, [sp, #0x28]\n"
 451 "loc_fc055026:\n"
 452 "    ldr     r0, [r4, #0x4c]\n"
 453 "    lsls    r0, r0, #0x19\n"
 454 "    bmi     loc_fc055034\n"
 455 "    add     r1, sp, #0x20\n"
 456 "    mov     r0, r6\n"
 457 "    bl      sub_fc0f2ffe\n"
 458 "loc_fc055034:\n"
 459 "    ldr     r0, [r4, #0x4c]\n"
 460 "    lsls    r0, r0, #0x1a\n"
 461 "    bpl     loc_fc05507c\n"
 462 "    movs    r2, #0x20\n"
 463 "    mov     r1, r6\n"
 464 "    mov     r0, sp\n"
 465 "    blx     sub_fc251d3c\n" // j_dry_memcpy
 466 "    mov     r0, sp\n"
 467 "    bl      sub_fc2b7e28\n" // strlen_FW
 468 "    add     r0, sp, r0\n"
 469 "    movs    r1, #0x54\n"
 470 "    strb    r1, [r0, #-0x3]!\n"
 471 "    movs    r1, #0x4d\n"
 472 "    strb    r1, [r0, #1]\n"
 473 "    movs    r1, #0x50\n"
 474 "    strb    r1, [r0, #2]\n"
 475 "    mov     r1, sp\n"
 476 "    mov     r0, r6\n"
 477 "    bl      sub_fc0a2d0a\n"
 478 "    cbnz    r0, loc_fc055070\n"
 479 "    movs    r0, #0\n"
 480 "    movw    r2, #0x165\n"
 481 "    ldr     r1, =0xfc05522c\n" //  *"dwFWrite.c"
 482 "    blx     sub_fc251d14\n" // j_DebugAssert
 483 "loc_fc055070:\n"
 484 "    mov     r0, sp\n"
 485 "    bl      sub_fc0f32f0\n"
 486 "    mov     r0, r6\n"
 487 "    bl      sub_fc0f32f0\n"
 488 "loc_fc05507c:\n"
 489 "    mov     r0, r6\n"
 490 "    bl      sub_fc2a4df0\n"
 491 "    ldr     r1, [r5, #0x18]\n"
 492 "    bl      sub_fc05cdbc\n"
 493 "    b       loc_fc05508e\n"
 494 "loc_fc05508a:\n"
 495 "    ldr     r0, [r5, #0x18]\n"
 496 "    blx     r0\n"
 497 "loc_fc05508e:\n"
 498 "    ldr     r1, [r5, #0x14]\n"
 499 "    cmp     r1, #0\n"
 500 "    beq     loc_fc055098\n"
 501 "    ldr     r0, [r4, #0x10]\n"
 502 "    blx     r1\n"
 503 "loc_fc055098:\n"
 504 "    add     sp, #0x38\n"
 505 "    pop     {r4, r5, r6, pc}\n"
 506 ".ltorg\n"
 507     );
 508 }

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