root/platform/sx700hs/sub/100e/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_fc063eac_my
  5. sub_fc064314_my
  6. sub_fc063fb6_my

   1 #include "lolevel.h"
   2 #include "platform.h"
   3 
   4 //#define FILEWRITE_DEBUG_LOG 1
   5 
   6 typedef struct {
   7     unsigned int address;
   8     unsigned int length;
   9 } cam_ptp_data_chunk; //camera specific structure
  10 
  11 #define MAX_CHUNKS_FOR_JPEG 7 // filewritetask is prepared for this many chunks
  12                               // Note : corresponds to filewritetask() jump table entries 0-6
  13 /*
  14  * fwt_data_struct: defined here as it's camera dependent
  15  * unneeded members are designated with unkn
  16  * file_offset, full_size, seek_flag only needs to be defined for cameras with CAM_FILEWRITETASK_SEEK/CAM_FILEWRITETASK_MULTIPASS
  17  * pdc is always required, name is not currently used
  18  */
  19 typedef struct
  20 {
  21     int unkn1;                // 00 message number
  22     int file_offset;          // 01
  23     int maybe_full_size;      // 02 TODO doesn't seem to actually be full size for jpeg, instead round number somewhat smaller
  24     int unkn2, unkn3;         // 03, 04
  25     cam_ptp_data_chunk pdc[MAX_CHUNKS_FOR_JPEG];  // 05 - 18
  26     int maybe_seek_flag;      // 19 from sx700v100e sub_fc063eac 0x4C = 74 bytes,  74/4 = 19 words offset in fwt_data_struct
  27     int unkn5, unkn6;         // 20, 21
  28     char name[32];            // 22 from sx700hsv100e sub_fc063eac  0x58 = 88 bytes,  88/4 = 22 words offset in fwt_data_struct
  29 } fwt_data_struct;
  30 
  31 #include "../../../generic/filewrite.c"
  32 
  33 
  34 #ifdef FILEWRITE_DEBUG_LOG
  35 extern void _LogCameraEvent(int id,const char *fmt,...);
  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 // sx700v100e   -f=chdk -s=task_FileWrite -c=73
  55 // task_FileWrite 0xfc0640ad
  56 void __attribute__((naked,noinline)) filewritetask() {
  57 asm volatile (
  58 "    push    {r2, r3, r4, r5, r6, lr}\n"
  59 "    ldr     r5, =0x00021500\n"
  60 "loc_fc0640b0:\n"
  61 "    movs    r2, #0\n"
  62 "    add     r1, sp, #4\n"
  63 "    ldr     r0, [r5, #0x10]\n"
  64 "    blx     sub_fc29b34c\n" // j_ReceiveMessageQueue
  65 "    cbz     r0, loc_fc0640c8\n"
  66 "    movs    r0, #0\n"
  67 "    movw    r2, #0x3f6\n"
  68 "    ldr     r1, =0xfc064230\n" //  *"dwFWrite.c"
  69 "    blx     sub_fc29b444\n" // j_DebugAssert
  70 "loc_fc0640c8:\n"
  71 "    ldr     r0, [sp, #4]\n"
  72 "    ldr     r1, [r0]\n"
  73 "    cmp     r1, #0xd\n"
  74 "    bhs     loc_fc0640b0\n"
  75 "    tbb     [pc, r1]\n" // (jumptable r1 13 elements)
  76 "branchtable_fc0640d4:\n"
  77 "    .byte((loc_fc06416e - branchtable_fc0640d4) / 2)\n" // (case 0)
  78 "    .byte((loc_fc06416e - branchtable_fc0640d4) / 2)\n" // (case 1)
  79 "    .byte((loc_fc06416e - branchtable_fc0640d4) / 2)\n" // (case 2)
  80 "    .byte((loc_fc06416e - branchtable_fc0640d4) / 2)\n" // (case 3)
  81 "    .byte((loc_fc06416e - branchtable_fc0640d4) / 2)\n" // (case 4)
  82 "    .byte((loc_fc06416e - branchtable_fc0640d4) / 2)\n" // (case 5)
  83 "    .byte((loc_fc06416e - branchtable_fc0640d4) / 2)\n" // (case 6)
  84 "    .byte((loc_fc064174 - branchtable_fc0640d4) / 2)\n" // (case 7)
  85 "    .byte((loc_fc0640e2 - branchtable_fc0640d4) / 2)\n" // (case 8)
  86 "    .byte((loc_fc06410c - branchtable_fc0640d4) / 2)\n" // (case 9)
  87 "    .byte((loc_fc06412c - branchtable_fc0640d4) / 2)\n" // (case 10)
  88 "    .byte((loc_fc0640e8 - branchtable_fc0640d4) / 2)\n" // (case 11)
  89 "    .byte((loc_fc064106 - branchtable_fc0640d4) / 2)\n" // (case 12)
  90 ".align 1\n"
  91 "loc_fc0640e2:\n"   // case 8 -  calls close, not seen in normal shooting
  92 "    bl      sub_fc0642d0\n"
  93 "    b       loc_fc0640b0\n"
  94 "loc_fc0640e8:\n"   // case 11 - create dir, TODO not patched
  95 "    mov     r4, r0\n"
  96 "    adds    r0, #0x58\n"
  97 "    mov     r6, r0\n"
  98 "    bl      sub_fc307c12\n"
  99 "    movs    r1, #0\n"
 100 "    bl      sub_fc06c0c6\n"
 101 "    ldr     r0, [r4, #0xc]\n"
 102 "    bl      sub_fc0ba0c6\n"
 103 "    mov     r0, r6\n"
 104 "    bl      sub_fc3082ca\n" // PrepareDirectory_0
 105 "    b       loc_fc064156\n"
 106 "loc_fc064106:\n"    // case 12 - patch for open, main hook
 107 //"    bl      sub_fc063eac\n"
 108 "    bl      sub_fc063eac_my\n"         // --->>
 109 "    b       loc_fc0640b0\n"
 110 "loc_fc06410c:\n"        // case 9 - not seen in normal shooting?
 111 "    ldr     r1, [r0, #4]\n"
 112 "    movs    r2, #0\n"
 113 "    mov     r4, r0\n"
 114 "    ldr     r0, [r5, #4]\n"
 115 "    bl      _lseek\n"
 116 "    adds    r0, r0, #1\n"
 117 "    bne     loc_fc0640b0\n"
 118 "    ldr     r0, =0x09200001\n"
 119 "    mov     r1, r4\n"
 120 "    adds    r0, #0x12\n"
 121 "    str     r0, [r4, #0x10]\n"
 122 "    movs    r0, #7\n"
 123 "    bl      sub_fc063e38\n"
 124 "    b       loc_fc0640b0\n"
 125 "loc_fc06412c:\n"           // case 10 - cache flush, patch for ignore write
 126 "    mov     r4, r0\n"
 127 "    ldrsb.w r0, [r0, #0x58]\n"
 128 "    cmp     r0, #0\n"
 129 "    beq     loc_fc0640b0\n"
 130 "    strb.w  r0, [sp]\n"
 131 "    movs    r0, #0\n"
 132 "    strb.w  r0, [sp, #1]\n"
 133 "    add.w   r0, r4, #0x58\n"
 134 "    mov     r6, r0\n"
 135 "    bl      sub_fc307c12\n"
 136 "    movs    r1, #0\n"
 137 "    bl      sub_fc06c0c6\n"
 138 "    mov     r0, sp\n"
 139 "    bl      sub_fc0ba0d2\n"
 140 "loc_fc064156:\n"
 141 "    mov     r0, r6\n"
 142 "    bl      sub_fc307c12\n"
 143 "    ldr     r1, [r5, #0x1c]\n"
 144 "    bl      sub_fc06c124\n"
 145 "    ldr     r1, [r5, #0x14]\n"
 146 "    cmp     r1, #0\n"
 147 "    beq     loc_fc0640b0\n"
 148 "    ldr     r0, [r4, #0x10]\n"
 149 "    blx     r1\n"
 150 "    b       loc_fc0640b0\n"
 151 "loc_fc06416e:\n"     // case 0-6  - write stage
 152 //"    bl      sub_fc064314\n"
 153 "    bl      sub_fc064314_my\n"          // --->>
 154 "    b       loc_fc0640b0\n"
 155 "loc_fc064174:\n"                // case 7 - close stage
 156 //"    bl      sub_fc063fb6\n"
 157 "    bl      sub_fc063fb6_my\n"            // --->>
 158 "    b       loc_fc0640b0\n"
 159 
 160 ".ltorg\n"
 161     );
 162 }
 163 
 164 
 165 // message 12 - open
 166 // sx700v100e -f=chdk -s=fc063ead -c=109
 167 void __attribute__((naked,noinline)) sub_fc063eac_my() {
 168 asm volatile (
 169 "    push.w  {r4, r5, r6, r7, r8, sb, lr}\n"
 170 "    mov     r4, r0\n"
 171 
 172                                     //hook placed here to avoid conditional branch a few instructions below (watch out for registers!)
 173 //"  mov   r0, r4\n"                // data block start, commented out as R0 is already holding what we need
 174 "    BL      filewrite_main_hook\n" //
 175 "    mov     r0, r4\n"              // restore register(s)
 176 
 177 "    ldr     r0, [r0, #0x4c]\n"     // offset of maybe_seek_flag in fwt_data_struct ?
 178 "    sub     sp, #0x3c\n"
 179 "    lsls    r0, r0, #0x1f\n"
 180 "    beq     loc_fc063f92\n"
 181 "    ldr     r7, =0x00021500\n"
 182 "    ldr     r0, [r7, #0x18]\n"
 183 "    cbz     r0, loc_fc063ec2\n"
 184 "    blx     r0\n"
 185 "loc_fc063ec2:\n"
 186 "    add.w   r0, r4, #0x58\n"     // offset of filename in fwt_data_struct ?
 187 "    mov     r8, r0\n"
 188 "    bl      sub_fc307c12\n"
 189 "    movs    r1, #0\n"
 190 "    bl      sub_fc06c0c6\n"
 191 "    ldr     r0, [r4, #0xc]\n"
 192 "    bl      sub_fc0ba0c6\n"
 193 "    ldr     r0, [r4, #0x4c]\n"
 194 "    movw    r5, #0x301\n"
 195 "    lsls    r1, r0, #0x1b\n"
 196 "    bpl     loc_fc063ee6\n"
 197 "    movs    r5, #9\n"
 198 "    b       loc_fc063eec\n"
 199 "loc_fc063ee6:\n"
 200 "    lsls    r1, r0, #0x19\n"
 201 "    bpl     loc_fc063eec\n"
 202 "    movs    r5, #1\n"
 203 "loc_fc063eec:\n"
 204 "    lsls    r0, r0, #0x1a\n"
 205 "    bmi     loc_fc063ef6\n"
 206 "    ldr     r0, [r4, #0x54]\n"
 207 "    cmp     r0, #1\n"
 208 "    bne     loc_fc063efa\n"
 209 "loc_fc063ef6:\n"
 210 "    orr     r5, r5, #0x8000\n"
 211 "loc_fc063efa:\n"
 212 "    movw    sb, #0x1b6\n"
 213 "    ldr     r6, [r4, #0xc]\n"
 214 "    mov     r2, sb\n"
 215 "    mov     r1, r5\n"
 216 "    mov     r0, r8\n"
 217 
 218 //"    bl      sub_fc307f26\n" // j_Open_FW
 219 "    bl      fwt_open\n"   // +
 220 
 221 "    adds    r1, r0, #1\n"
 222 "    bne     loc_fc063f48\n"
 223 "    mov     r0, r8\n"
 224 "    bl      sub_fc3082ca\n" // PrepareDirectory_0
 225 "    movs    r2, #0xf\n"
 226 "    mov     r1, r8\n"
 227 "    add     r0, sp, #4\n"
 228 "    blx     sub_fc29b45c\n"
 229 "    movs    r0, #0\n"
 230 "    strb.w  r0, [sp, #0x13]\n"
 231 "    movw    r1, #0x41ff\n"
 232 "    str     r1, [sp, #0x24]\n"
 233 "    strd    r0, r6, [sp, #0x2c]\n"
 234 "    movs    r1, #0x10\n"
 235 "    str     r6, [sp, #0x34]\n"
 236 "    add     r0, sp, #4\n"
 237 "    str     r6, [sp, #0x38]\n"
 238 "    str     r1, [sp, #0x28]\n"
 239 "    add     r1, sp, #0x24\n"
 240 "    bl      sub_fc0e7dea\n"
 241 "    mov     r2, sb\n"
 242 "    mov     r1, r5\n"
 243 "    mov     r0, r8\n"
 244 
 245 //"    bl      sub_fc307f26\n" // j_Open_FW
 246 "    bl      _Open\n" // j_Open_FW
 247 
 248 "loc_fc063f48:\n"
 249 "    mov     r5, r0\n"
 250 "    str     r0, [r7, #4]\n"
 251 "    adds    r0, r0, #1\n"
 252 "    bne     loc_fc063f6c\n"
 253 "    mov     r0, r8\n"
 254 "    bl      sub_fc307c12\n"
 255 "    ldr     r1, [r7, #0x1c]\n"
 256 "    bl      sub_fc06c124\n"
 257 "    ldr     r1, [r7, #0x14]\n"
 258 "    cmp     r1, #0\n"
 259 "    beq     loc_fc063fb0\n"
 260 "    add     sp, #0x3c\n"
 261 "    ldr     r0, =0x09200001\n"
 262 "    pop.w   {r4, r5, r6, r7, r8, sb, lr}\n"
 263 "    bx      r1\n"
 264 "loc_fc063f6c:\n"
 265 "    ldr     r0, =0x001ba8d4\n"
 266 "    movs    r2, #0x20\n"
 267 "    mov     r1, r8\n"
 268 "    blx     sub_fc29b464\n" // j_dry_memcpy
 269 //mod start
 270 "    LDR R3, =current_write_ignored\n"
 271 "    LDR R3, [R3]\n"
 272 "    cbnz r3,loc_C\n" // jump over the next block
 273 //mod end
 274 "    ldr     r0, [r4, #0x4c]\n"
 275 "    lsls    r0, r0, #0x18\n"
 276 "    bpl     loc_fc063f92\n"
 277 "    ldr     r1, [r4, #8]\n"
 278 "    mov     r0, r5\n"
 279 "    bl      sub_fc3080e0\n"
 280 "    cbnz    r0, loc_fc063f92\n"
 281 "    ldr     r0, =0x09200001\n"
 282 "    mov     r1, r4\n"
 283 "    adds    r0, #0x16\n"
 284 "    str     r0, [r4, #0x10]\n"
 285 "    movs    r0, #7\n"
 286 "    b       loc_fc063fa8\n"
 287 "loc_fc063f92:\n"
 288 "loc_C:\n"
 289 "    ldr     r0, [r4, #0x4c]\n"
 290 "    lsls    r0, r0, #0x19\n"
 291 "    bmi     loc_fc063f9c\n"
 292 "    ldr     r0, [r4, #4]\n"
 293 "    cbz     r0, loc_fc063fa4\n"
 294 "loc_fc063f9c:\n"
 295 "    movs    r0, #9\n"
 296 "    mov     r1, r4\n"
 297 "    bl      sub_fc063e38\n"
 298 "loc_fc063fa4:\n"
 299 "    movs    r0, #0\n"
 300 "    mov     r1, r4\n"
 301 "loc_fc063fa8:\n"
 302 "    add     sp, #0x3c\n"
 303 "    pop.w   {r4, r5, r6, r7, r8, sb, lr}\n"
 304 
 305 //"    b       loc_fc063e38\n"
 306 "    ldr     pc,=0xfc063e39\n"
 307 
 308 "loc_fc063fb0:\n"
 309 "    add     sp, #0x3c\n"
 310 "    pop.w   {r4, r5, r6, r7, r8, sb, pc}\n"
 311 
 312 ".ltorg\n"
 313     );
 314 }
 315 
 316 
 317 // message 0-6 - filewrite chunks
 318 // sx700v100e  0xfc064315 64
 319 void __attribute__((naked,noinline)) sub_fc064314_my() {
 320 asm volatile (
 321 "    push.w  {r4, r5, r6, r7, r8, sb, sl, lr}\n"
 322 "    mov     r5, r0\n"
 323 "    ldr     r0, [r0]\n"
 324 "    cmp     r0, #6\n"
 325 "    bhi     loc_fc06432c\n"
 326 "    add.w   r0, r5, r0, lsl #3\n"
 327 "    ldrd    r7, r6, [r0, #0x14]\n"
 328 "    cbnz    r6, loc_fc064340\n"
 329 "    b       loc_fc06433a\n"
 330 "loc_fc06432c:\n"
 331 "    movw    r2, #0x34b\n"
 332 "    ldr     r1, =0xfc064230\n" //  *"dwFWrite.c"
 333 "    movs    r0, #0\n"
 334 "    blx     sub_fc29b444\n" // j_DebugAssert
 335 "loc_fc06433a:\n"
 336 "    movs    r0, #7\n"
 337 "    mov     r1, r5\n"
 338 "    b       loc_fc0643ae\n"
 339 "loc_fc064340:\n"
 340 "    ldr.w   sl, =0x00021500\n"
 341 "    mov.w   sb, #0x1000000\n"
 342 "    mov     r4, r6\n"
 343 "loc_fc06434a:\n"
 344 "    ldr     r0, [r5, #4]\n"
 345 "    cmp     r4, sb\n"
 346 "    mov     r1, sb\n"
 347 "    bhi     loc_fc064354\n"
 348 "    mov     r1, r4\n"
 349 "loc_fc064354:\n"
 350 "    lsls    r2, r0, #8\n"
 351 "    beq     loc_fc064366\n"
 352 "    bic     r0, r0, #0xff000000\n"
 353 "    rsb.w   r0, r0, #0x1000000\n"
 354 "    cmp     r1, r0\n"
 355 "    bls     loc_fc064366\n"
 356 "    mov     r1, r0\n"
 357 "loc_fc064366:\n"
 358 "    ldr.w   r0, [sl, #4]\n"
 359 "    mov     r8, r1\n"
 360 "    mov     r2, r1\n"
 361 "    mov     r1, r7\n"
 362 
 363 //"    bl      sub_fc307fce\n" // j_Write_FW
 364 "    bl      fwt_write\n" // +
 365 
 366 "    ldr     r1, [r5, #4]\n"
 367 "    cmp     r8, r0\n"
 368 "    add     r1, r0\n"
 369 "    str     r1, [r5, #4]\n"
 370 "    beq     loc_fc06438e\n"
 371 "    adds    r0, r0, #1\n"
 372 "    bne     loc_fc064386\n"
 373 "    ldr     r0, =0x09200005\n"
 374 "    b       loc_fc06438a\n"
 375 "loc_fc064386:\n"
 376 "    ldr     r0, =0x09200005\n"
 377 "    adds    r0, #0x10\n"
 378 "loc_fc06438a:\n"
 379 "    str     r0, [r5, #0x10]\n"
 380 "    b       loc_fc06433a\n"
 381 "loc_fc06438e:\n"
 382 "    subs    r4, r4, r0\n"
 383 "    cmp     r4, r6\n"
 384 "    add     r7, r0\n"
 385 "    blo     loc_fc0643a4\n"
 386 "    movw    r2, #0x376\n"
 387 "    ldr     r1, =0xfc064230\n" //  *"dwFWrite.c"
 388 "    movs    r0, #0\n"
 389 "    blx     sub_fc29b444\n" // j_DebugAssert
 390 "loc_fc0643a4:\n"
 391 "    cmp     r4, #0\n"
 392 "    bne     loc_fc06434a\n"
 393 "    ldr     r0, [r5]\n"
 394 "    mov     r1, r5\n"
 395 "    adds    r0, r0, #1\n"
 396 "loc_fc0643ae:\n"
 397 "    pop.w   {r4, r5, r6, r7, r8, sb, sl, lr}\n"
 398 
 399 //"    b       loc_fc063e38\n"
 400 "    ldr     pc,=0xfc063e39\n"
 401 
 402 ".ltorg\n"
 403     );
 404 }
 405 
 406 // message 7 - close
 407 // sx700hsv100e   -f=chdk -s=0xfc063fb7 -c=104
 408 void __attribute__((naked,noinline)) sub_fc063fb6_my() {
 409 asm volatile (
 410 "    push    {r4, r5, r6, lr}\n"
 411 "    mov     r4, r0\n"
 412 "    ldr     r0, [r0, #0x4c]\n"
 413 "    ldr     r5, =0x00021500\n"
 414 "    sub     sp, #0x38\n"
 415 "    lsls    r0, r0, #0x1e\n"
 416 "    bpl     loc_fc06409a\n"
 417 "    ldr     r0, [r5, #4]\n"
 418 "    adds    r1, r0, #1\n"
 419 "    beq     loc_fc063fe8\n"
 420 "    ldr     r6, =0x09200001\n"
 421 "    ldr     r1, [r4, #0x54]\n"
 422 "    adds    r6, r6, #2\n"
 423 "    cmp     r1, #1\n"
 424 "    bne     loc_fc063fda\n"
 425 //mod start
 426 "    LDR R3, =current_write_ignored\n"
 427 "    LDR R3, [R3]\n"
 428 "    cbnz R3,loc_D\n" // jump over the next block
 429 //mod end
 430 "    bl      sub_fc307f2a\n"
 431 "    b       loc_fc063fde\n"
 432 "loc_fc063fda:\n"
 433 "loc_D:\n"
 434 
 435 //"    bl      sub_fc307f28\n" // j_Close_FW
 436 "    bl      fwt_close\n" // +
 437 
 438 "loc_fc063fde:\n"
 439 "    cbz     r0, loc_fc063fe2\n"
 440 "    str     r6, [r4, #0x10]\n"
 441 "loc_fc063fe2:\n"
 442 "    mov.w   r0, #-1\n"
 443 "    str     r0, [r5, #4]\n"
 444 "loc_fc063fe8:\n"
 445 "    add.w   r6, r4, #0x58\n"
 446 "    ldr     r0, [r4, #0x10]\n"
 447 "    lsls    r0, r0, #0x1f\n"
 448 "    bne     loc_fc06408c\n"
 449 "    ldr     r0, [r4, #0x4c]\n"
 450 "    lsls    r1, r0, #0x1f\n"
 451 "    beq     loc_fc064014\n"
 452 "    movw    r0, #0x81ff\n"
 453 "    str     r0, [sp, #0x20]\n"
 454 "    movs    r0, #0x20\n"
 455 "    str     r0, [sp, #0x24]\n"
 456 "    ldr     r0, [r4, #4]\n"
 457 "    str     r0, [sp, #0x28]\n"
 458 "    ldr     r0, [r4, #0xc]\n"
 459 "    str     r0, [sp, #0x2c]\n"
 460 "    ldr     r0, [r4, #0xc]\n"
 461 "    str     r0, [sp, #0x30]\n"
 462 "    ldr     r0, [r4, #0xc]\n"
 463 "    str     r0, [sp, #0x34]\n"
 464 "    b       loc_fc064036\n"
 465 "loc_fc064014:\n"
 466 "    lsls    r0, r0, #0x1b\n"
 467 "    bpl     loc_fc064036\n"
 468 "    add     r1, sp, #0x20\n"
 469 "    mov     r0, r6\n"
 470 "    bl      sub_fc0e7d74\n"
 471 "    cbnz    r0, loc_fc06402e\n"
 472 "    movs    r0, #0\n"
 473 "    movw    r2, #0x3bd\n"
 474 "    ldr     r1, =0xfc064230\n" //  *"dwFWrite.c"
 475 "    blx     sub_fc29b444\n" // j_DebugAssert
 476 "loc_fc06402e:\n"
 477 "    ldr     r0, [sp, #0x28]\n"
 478 "    ldr     r1, [r4, #4]\n"
 479 "    add     r0, r1\n"
 480 "    str     r0, [sp, #0x28]\n"
 481 "loc_fc064036:\n"
 482 "    ldr     r0, [r4, #0x4c]\n"
 483 "    lsls    r0, r0, #0x19\n"
 484 "    bmi     loc_fc064044\n"
 485 "    add     r1, sp, #0x20\n"
 486 "    mov     r0, r6\n"
 487 "    bl      sub_fc0e7dea\n"
 488 "loc_fc064044:\n"
 489 "    ldr     r0, [r4, #0x4c]\n"
 490 "    lsls    r0, r0, #0x1a\n"
 491 "    bpl     loc_fc06408c\n"
 492 "    movs    r2, #0x20\n"
 493 "    mov     r1, r6\n"
 494 "    mov     r0, sp\n"
 495 "    blx     sub_fc29b464\n" // j_dry_memcpy
 496 "    mov     r0, sp\n"
 497 "    bl      _strlen\n"
 498 "    add     r0, sp, r0\n"
 499 "    movs    r1, #0x54\n"
 500 "    strb    r1, [r0, #-0x3]!\n"
 501 "    movs    r1, #0x4d\n"
 502 "    strb    r1, [r0, #1]\n"
 503 "    movs    r1, #0x50\n"
 504 "    strb    r1, [r0, #2]\n"
 505 "    mov     r1, sp\n"
 506 "    mov     r0, r6\n"
 507 "    bl      sub_fc0ba29e\n"
 508 "    cbnz    r0, loc_fc064080\n"
 509 "    movs    r0, #0\n"
 510 "    movw    r2, #0x167\n"
 511 "    ldr     r1, =0xfc064230\n" //  *"dwFWrite.c"
 512 "    blx     sub_fc29b444\n" // j_DebugAssert
 513 "loc_fc064080:\n"
 514 "    mov     r0, sp\n"
 515 "    bl      sub_fc0e80dc\n"
 516 "    mov     r0, r6\n"
 517 "    bl      sub_fc0e80dc\n"
 518 "loc_fc06408c:\n"
 519 "    mov     r0, r6\n"
 520 "    bl      sub_fc307c12\n"
 521 "    ldr     r1, [r5, #0x1c]\n"
 522 "    bl      sub_fc06c124\n"
 523 "    b       loc_fc06409e\n"
 524 "loc_fc06409a:\n"
 525 "    ldr     r0, [r5, #0x1c]\n"
 526 "    blx     r0\n"
 527 "loc_fc06409e:\n"
 528 "    ldr     r1, [r5, #0x14]\n"
 529 "    cmp     r1, #0\n"
 530 "    beq     loc_fc0640a8\n"
 531 "    ldr     r0, [r4, #0x10]\n"
 532 "    blx     r1\n"
 533 "loc_fc0640a8:\n"
 534 "    add     sp, #0x38\n"
 535 "    pop     {r4, r5, r6, pc}\n"
 536 
 537 ".ltorg\n"
 538     );
 539 }

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