root/platform/sx60hs/sub/100c/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_fc065b7c_my
  5. sub_fc0660ae_my
  6. sub_fc065ca2_my

   1 #include "lolevel.h"
   2 #include "platform.h"
   3 // all of this copied and adjusted from g7x coding by reyalp
   4 extern void _LogCameraEvent(int id,const char *fmt,...);
   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                               // 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
  18  * name is not currently used
  19  */
  20 typedef struct
  21 {
  22     int unkn1; // message number
  23     int file_offset;
  24     int maybe_full_size; // TODO doesn't seem to actually be full size for jpeg, instead round number somewhat smaller
  25     int unkn2, unkn3;
  26     int unkn4;
  27     cam_ptp_data_chunk pdc[MAX_CHUNKS_FOR_JPEG];
  28     int maybe_seek_flag;      // from fc06b0cc 0x50, not clear if ever used to indicate seek. 0x3 raw, 0x83 jpeg, 0x200 CacheFlush, 0x100 create dir
  29     int unkn5, unkn6;
  30     char name[32];      //from fc06b0cc offset from start 0x5c = 92 bytes = 23 words
  31 } fwt_data_struct;
  32 
  33 /*
  34 g7x observed message sequences
  35 canon raw + jpeg
  36 CR2
  37 12 full_size = 0x010dad6d (actual size), seek_flag = 0x3
  38  0 chunk 0-0x9aa00
  39  1 chunk 0x9aa00-0x010dad6d
  40  2 chunk 0-0
  41  7 close
  42 JPEG
  43 12 full_size = 32b200 (actual size = 0x35bbae), seek_flag = 0x83
  44  0 chunk 0-0x35bbae
  45  1 chunk 0-0
  46  7 close
  47 10 seek_flag = 0x200, name = A/CacheFlush
  48 
  49 single jpeg only, high detail scene
  50 12 full_size = 0x00c41400 (actual size = 0xCD0F69) seek_flag = 0x83
  51  0 0-0xcd0f69
  52  1 0-0
  53  7 close
  54 10 seek_flag = 0x200, name = A/CacheFlush
  55 
  56 continuous jpeg
  57 shot 1
  58 12 full_size = 0x369000 (actual 0x39af87) seek_flag = 0x83
  59  0 chunk 0-0x39af87
  60  1 chunk 0-0
  61  7 close
  62 shot 2
  63 12 full_size=0x00369200 (acutal 0x39b022) seek_flag = 0x83
  64  0 chunk 0-39b022
  65  1 chunk 0-0
  66  7 close
  67 10 seek_flag = 0x200, name = A/CacheFlush
  68 10 seek_flag = 0x200, name = A/CacheFlush
  69 (really twice, no obvious difference in params)
  70 
  71 canon raw only
  72 12 full_size = 0x010dce4a (actual size) seek_flag 3
  73  0 chunk 0-0x87200
  74  1 chunk 0x87200-0x010dce4a
  75  2 0-0
  76  7 close
  77 10 seek_flag = 0x200, name = A/CacheFlush
  78 
  79 new directory
  80 11 seek_flag = 0x100
  81 before m 12 for shot, after raw hook in capt_seq but before
  82 spytask calls remotecap_raw_available due to sleep loops
  83 
  84 bypassing PrepareDirectory_0 seems to cause hang on switch to play mode
  85 */
  86 
  87 #include "../../../generic/filewrite.c"
  88 
  89 void log_fwt_msg(fwt_data_struct *fwd)
  90 {
  91     int m=fwd->unkn1;
  92     _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);
  93     _LogCameraEvent(0x60,"fw %s",fwd->name);
  94     if(m >= 0 && m <=6) {
  95         _LogCameraEvent(0x60,"fw chunk adr:0x%08x l:0x%08x",fwd->pdc[m].address,fwd->pdc[m].length);
  96     }
  97     _LogCameraEvent(0x60,"fw u %08x %08x %08x %08x %08x %08x",fwd->unkn2,fwd->unkn3,fwd->unkn4,fwd->unkn5,fwd->unkn6);
  98 }
  99 
 100 void log_fwt_start(void)
 101 {
 102     _LogCameraEvent(0x60,"fw start");
 103 }
 104 /*************************************************************/
 105 // // task_FileWrite 0xfc065dc7  -s=task_FileWrite -c=43 -f=chdk
 106 void __attribute__((naked,noinline)) filewritetask() {
 107 asm volatile (
 108 // task_FileWrite 0xfc065dc7
 109 "    push    {r3, r4, r5, r6, r7, lr}\n"
 110 "    ldr     r6, =0x09200001\n"
 111 "    movw    r7, #0x428\n"
 112 "    ldr     r5, =0x00024cb8\n"
 113 "    adds    r6, #0x12\n"
 114 "loc_fc065dd2:\n"
 115 "    mov     r1, sp\n"
 116 "    movs    r2, #0\n"
 117 "    ldr     r0, [r5, #0x10]\n"
 118 "    blx     sub_fc2cf34c\n" // j_ReceiveMessageQueue
 119 "    cbz     r0, loc_fc065de8\n"
 120 "    movs    r0, #0\n"
 121 "    mov     r2, r7\n"
 122 "    ldr     r1, =0xfc065efc\n" //  *"dwFWrite.c"
 123 "    blx     sub_fc2cf40c\n" // j_DebugAssert
 124 "loc_fc065de8:\n"
 125 "    ldr     r0, [sp]\n"
 126 "    ldr     r1, [r0]\n"
 127 "    cmp     r1, #0xd\n"
 128 "    bhs     loc_fc065dd2\n"
 129 "    tbb     [pc, r1]\n" // (jumptable r1 13 elements)
 130 "branchtable_fc065df4:\n"
 131 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 0)
 132 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 1)
 133 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 2)
 134 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 3)
 135 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 4)
 136 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 5)
 137 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 6)
 138 "    .byte((loc_fc065e3c - branchtable_fc065df4) / 2)\n" // (case 7)
 139 "    .byte((loc_fc065e02 - branchtable_fc065df4) / 2)\n" // (case 8)
 140 "    .byte((loc_fc065e14 - branchtable_fc065df4) / 2)\n" // (case 9)
 141 "    .byte((loc_fc065e30 - branchtable_fc065df4) / 2)\n" // (case 10)
 142 "    .byte((loc_fc065e08 - branchtable_fc065df4) / 2)\n" // (case 11)
 143 "    .byte((loc_fc065e0e - branchtable_fc065df4) / 2)\n" // (case 12)
 144 ".align 1\n"
 145 "loc_fc065e02:\n"   // case 8 - calls close, not seen in normal shooting
 146 "    bl      sub_fc065fb6\n"
 147 "    b       loc_fc065dd2\n"
 148 "loc_fc065e08:\n"   // case 11 - create dir, TODO not patched
 149 "    bl      sub_fc066002\n"
 150 "    b       loc_fc065dd2\n"
 151 "loc_fc065e0e:\n"   // case 12 - patch for open, main hook
 152 "    bl      sub_fc065b7c_my\n"
 153 "    b       loc_fc065dd2\n"
 154 "loc_fc065e14:\n"   // case 9 - not seen in normal shooting
 155 "    ldr     r1, [r0, #4]\n"
 156 "    movs    r2, #0\n"
 157 "    mov     r4, r0\n"
 158 "    ldr     r0, [r5, #4]\n"
 159 "    bl      _lseek\n" // -> fwt_lseek ?
 160 "    adds    r0, r0, #1\n"
 161 "    bne     loc_fc065dd2\n"
 162 "    movs    r0, #7\n"
 163 "    mov     r1, r4\n"
 164 "    str     r6, [r4, #0x14]\n"
 165 "    bl      sub_fc065b04\n"
 166 "    b       loc_fc065dd2\n"
 167 "loc_fc065e30:\n"   // case 10 - cache flush, patch for ignore write
 168 "    bl      sub_fc066056\n"
 169 "    b       loc_fc065dd2\n"
 170 "loc_fc065e36:\n"     // case 0-6  - write stage
 171 "    bl      sub_fc0660ae_my\n"
 172 "    b       loc_fc065dd2\n"
 173 "loc_fc065e3c:\n"  // case 7 - close stage
 174 "    bl      sub_fc065ca2_my\n"
 175 "    b       loc_fc065dd2\n"
 176 ".ltorg\n"
 177     );
 178 }
 179 // -s=0xfc065b7d-c=121 -f=chdk
 180 void __attribute__((naked,noinline)) sub_fc065b7c_my() {
 181 asm volatile (
 182 "    push.w  {r4, r5, r6, r7, r8, sb, lr}\n"
 183 "    mov     r4, r0\n"
 184 //hook placed here to avoid conditional branch a few instructions below (watch out for registers!)
 185 //"  mov   r0, r4\n"      //data block start, commented out as R0 is already holding what we need
 186 "    BL      filewrite_main_hook\n"
 187 "    mov     r0, r4\n"      //restore register(s)
 188 "    ldr     r0, [r0, #0x50]\n"
 189 "    sub     sp, #0x3c\n"
 190 "    lsls    r1, r0, #0x1f\n"
 191 "    bne     loc_fc065b8e\n"
 192 "    lsls    r0, r0, #0x1d\n"
 193 "    bpl     loc_fc065c7e\n"
 194 "loc_fc065b8e:\n"
 195 "    ldr     r7, =0x00024cb8\n"
 196 "    ldr     r0, [r7, #0x18]\n"
 197 "    cbz     r0, loc_fc065b96\n"
 198 "    blx     r0\n"
 199 "loc_fc065b96:\n"
 200 "    add.w   r0, r4, #0x5c\n"
 201 "    mov     r8, r0\n"
 202 "    bl      sub_fc332770\n"
 203 "    movs    r1, #0\n"
 204 "    bl      sub_fc06e672\n"
 205 "    movs    r1, #0\n"
 206 "    movs    r0, #0x47\n"
 207 "    bl      sub_fc32519c\n"
 208 "    ldr     r0, [r4, #0x50]\n"
 209 "    lsls    r0, r0, #0x1f\n"
 210 "    beq     loc_fc065c7e\n"
 211 "    ldr     r0, [r4, #0x10]\n"
 212 "    bl      sub_fc0cb96e\n"
 213 "    ldr     r0, [r4, #0x50]\n"
 214 "    movw    r5, #0x301\n"
 215 "    lsls    r1, r0, #0x1b\n"
 216 "    bpl     loc_fc065bc8\n"
 217 "    movs    r5, #9\n"
 218 "    b       loc_fc065bce\n"
 219 "loc_fc065bc8:\n"
 220 "    lsls    r1, r0, #0x19\n"
 221 "    bpl     loc_fc065bce\n"
 222 "    movs    r5, #1\n"
 223 "loc_fc065bce:\n"
 224 "    lsls    r0, r0, #0x1a\n"
 225 "    bmi     loc_fc065bd8\n"
 226 "    ldr     r0, [r4, #0x58]\n"
 227 "    cmp     r0, #1\n"
 228 "    bne     loc_fc065bdc\n"
 229 "loc_fc065bd8:\n"
 230 "    orr     r5, r5, #0x8000\n"
 231 "loc_fc065bdc:\n"
 232 "    movw    sb, #0x1b6\n"
 233 "    ldr     r6, [r4, #0x10]\n"
 234 "    mov     r2, sb\n"
 235 "    mov     r1, r5\n"
 236 "    mov     r0, r8\n"
 237 //"    bl      sub_fc3329e6\n" // j_Open_FW
 238 "    bl      fwt_open\n" // +
 239 "    adds    r1, r0, #1\n"
 240 "    bne     loc_fc065c2a\n"
 241 "    mov     r0, r8\n"
 242 "    bl      sub_fc332d8a\n" // PrepareDirectory_0
 243 "    movs    r2, #0xf\n"
 244 "    mov     r1, r8\n"
 245 "    add     r0, sp, #4\n"
 246 "    blx     sub_fc2cf42c\n"
 247 "    movs    r0, #0\n"
 248 "    strb.w  r0, [sp, #0x13]\n"
 249 "    movw    r1, #0x41ff\n"
 250 "    str     r1, [sp, #0x24]\n"
 251 "    strd    r0, r6, [sp, #0x2c]\n"
 252 "    movs    r1, #0x10\n"
 253 "    str     r6, [sp, #0x34]\n"
 254 "    add     r0, sp, #4\n"
 255 "    str     r6, [sp, #0x38]\n"
 256 "    str     r1, [sp, #0x28]\n"
 257 "    add     r1, sp, #0x24\n"
 258 "    bl      sub_fc0fb9da\n"
 259 "    mov     r2, sb\n"
 260 "    mov     r1, r5\n"
 261 "    mov     r0, r8\n"
 262 //"    bl      sub_fc3329e6\n" // j_Open_FW
 263 "    bl      _Open\n" // j_Open_FW
 264 "loc_fc065c2a:\n"
 265 "    mov     r5, r0\n"
 266 "    str     r0, [r7, #4]\n"
 267 "    adds    r0, r0, #1\n"
 268 "    bne     loc_fc065c56\n"
 269 "    movs    r1, #0\n"
 270 "    movs    r0, #0x48\n"
 271 "    bl      sub_fc32519c\n" // "DSIC:0x48,0"
 272 "    mov     r0, r8\n"
 273 "    bl      sub_fc332770\n"
 274 "    ldr     r1, [r7, #0x1c]\n"
 275 "    bl      sub_fc06e6d0\n"
 276 "    ldr     r1, [r7, #0x14]\n"
 277 "    cmp     r1, #0\n"
 278 "    beq     loc_fc065c9c\n"
 279 "    add     sp, #0x3c\n"
 280 "    ldr     r0, =0x09200001\n"
 281 "    pop.w   {r4, r5, r6, r7, r8, sb, lr}\n"
 282 "    bx      r1\n"
 283 "loc_fc065c56:\n"
 284 "    ldr     r0, =0x002013cc\n"
 285 "    movs    r2, #0x20\n"
 286 "    mov     r1, r8\n"
 287 "    blx     sub_fc2cf434\n" // j_dry_memcpy
 288 // TODO looks equivalent to elph130, not verified that it's required
 289 //mod start
 290 "    LDR R3, =current_write_ignored\n"
 291 "    LDR R3, [R3]\n"
 292 "    cbnz r3,loc_C\n" // jump over the next block
 293 //mod end
 294 "    ldr     r0, [r4, #0x50]\n"
 295 "    lsls    r0, r0, #0x18\n"
 296 "    bpl     loc_fc065c7e\n"
 297 "    ldr     r1, [r4, #0xc]\n"
 298 "    mov     r0, r5\n"
 299 "    bl      sub_fc332ba0\n"
 300 "    cbnz    r0, loc_fc065c7c\n"
 301 "    ldr     r0, =0x09200001\n"
 302 "    mov     r1, r4\n"
 303 "    adds    r0, #0x16\n"
 304 "    str     r0, [r4, #0x14]\n"
 305 "    movs    r0, #7\n"
 306 "    b       loc_fc065c94\n"
 307 "loc_fc065c7c:\n"
 308 "    b       loc_fc065c7e\n"
 309 "loc_fc065c7e:\n"
 310 "loc_C:\n"
 311 "    ldr     r0, [r4, #0x50]\n"
 312 "    lsls    r0, r0, #0x19\n"
 313 "    bmi     loc_fc065c88\n"
 314 "    ldr     r0, [r4, #4]\n"
 315 "    cbz     r0, loc_fc065c90\n"
 316 "loc_fc065c88:\n"
 317 "    movs    r0, #9\n"
 318 "    mov     r1, r4\n"
 319 "    bl      sub_fc065b04\n"
 320 "loc_fc065c90:\n"
 321 "    movs    r0, #0\n"
 322 "    mov     r1, r4\n"
 323 "loc_fc065c94:\n"
 324 "    add     sp, #0x3c\n"
 325 "    pop.w   {r4, r5, r6, r7, r8, sb, lr}\n"
 326 //"    b       loc_fc065b04\n"
 327 "    ldr     pc, =0xfc065b05\n"
 328 "loc_fc065c9c:\n"
 329 "    add     sp, #0x3c\n"
 330 "    pop.w   {r4, r5, r6, r7, r8, sb, pc}\n"
 331 ".ltorg\n"
 332     );
 333 }
 334 // message 0-6 - filewrite chunks
 335 // -s=0xfc0660af -c=65 -f=chdk
 336 void __attribute__((naked,noinline)) sub_fc0660ae_my() {
 337 asm volatile (
 338 "    push.w  {r4, r5, r6, r7, r8, sb, sl, lr}\n"
 339 "    mov     r5, r0\n"
 340 "    ldr     r0, [r0]\n"
 341 "    cmp     r0, #6\n"
 342 "    bhi     loc_fc0660c6\n"
 343 "    add.w   r0, r5, r0, lsl #3\n"
 344 "    ldrd    r7, r6, [r0, #0x18]\n"
 345 "    cbnz    r6, loc_fc0660da\n"
 346 "    b       loc_fc0660d4\n"
 347 "loc_fc0660c6:\n"
 348 "    movw    r2, #0x36d\n"
 349 "    ldr     r1, =0xfc065efc\n" //  *"dwFWrite.c"
 350 "    movs    r0, #0\n"
 351 "    blx     sub_fc2cf40c\n" // j_DebugAssert
 352 "loc_fc0660d4:\n"
 353 "    movs    r0, #7\n"
 354 "    mov     r1, r5\n"
 355 "    b       loc_fc06614a\n"
 356 "loc_fc0660da:\n"
 357 "    ldr.w   sl, =0x00024cb8\n"
 358 "    mov.w   sb, #0x1000000\n"
 359 "    mov     r4, r6\n"
 360 "loc_fc0660e4:\n"
 361 "    ldr     r0, [r5, #4]\n"
 362 "    cmp     r4, sb\n"
 363 "    mov     r1, sb\n"
 364 "    bhi     loc_fc0660ee\n"
 365 "    mov     r1, r4\n"
 366 "loc_fc0660ee:\n"
 367 "    lsls    r2, r0, #8\n"
 368 "    beq     loc_fc066100\n"
 369 "    bic     r0, r0, #0xff000000\n"
 370 "    rsb.w   r0, r0, #0x1000000\n"
 371 "    cmp     r1, r0\n"
 372 "    bls     loc_fc066100\n"
 373 "    mov     r1, r0\n"
 374 "loc_fc066100:\n"
 375 "    ldr.w   r0, [sl, #4]\n"
 376 "    mov     r8, r1\n"
 377 "    mov     r2, r1\n"
 378 "    mov     r1, r7\n"
 379 //"    bl      sub_fc332a8e\n" // j_Write_FW
 380 "    bl      fwt_write\n" // +
 381 "    ldr     r1, [r5, #4]\n"
 382 "    cmp     r8, r0\n"
 383 "    add     r1, r0\n"
 384 "    str     r1, [r5, #4]\n"
 385 "    beq     loc_fc06612a\n"
 386 "    adds    r0, r0, #1\n"
 387 "    bne     loc_fc066122\n"
 388 "    ldr     r0, =0x09200006\n"
 389 "    subs    r0, r0, #1\n"
 390 "    b       loc_fc066126\n"
 391 "loc_fc066122:\n"
 392 "    ldr     r0, =0x09200006\n"
 393 "    adds    r0, #0xf\n"
 394 "loc_fc066126:\n"
 395 "    str     r0, [r5, #0x14]\n"
 396 "    b       loc_fc0660d4\n"
 397 "loc_fc06612a:\n"
 398 "    subs    r4, r4, r0\n"
 399 "    cmp     r4, r6\n"
 400 "    add     r7, r0\n"
 401 "    blo     loc_fc066140\n"
 402 "    movw    r2, #0x398\n"
 403 "    ldr     r1, =0xfc065efc\n" //  *"dwFWrite.c"
 404 "    movs    r0, #0\n"
 405 "    blx     sub_fc2cf40c\n" // j_DebugAssert
 406 "loc_fc066140:\n"
 407 "    cmp     r4, #0\n"
 408 "    bne     loc_fc0660e4\n"
 409 "    ldr     r0, [r5]\n"
 410 "    mov     r1, r5\n"
 411 "    adds    r0, r0, #1\n"
 412 "loc_fc06614a:\n"
 413 "    pop.w   {r4, r5, r6, r7, r8, sb, sl, lr}\n"
 414 //"    b       loc_fc065b04\n"
 415 "    ldr     pc,=0xfc065b05\n"
 416 ".ltorg\n"
 417     );
 418 }
 419 // message 7 - close
 420 // -s=0xfc065ca3 -c=124 -f=chdk
 421 void __attribute__((naked,noinline)) sub_fc065ca2_my() {
 422 asm volatile (
 423 "    push    {r4, r5, r6, lr}\n"
 424 "    mov     r4, r0\n"
 425 "    ldr     r0, [r0, #0x50]\n"
 426 "    ldr     r5, =0x00024cb8\n"
 427 "    sub     sp, #0x38\n"
 428 "    lsls    r1, r0, #0x1e\n"
 429 "    bmi     loc_fc065cb6\n"
 430 "    lsls    r0, r0, #0x1c\n"
 431 "    bpl     loc_fc065db4\n"
 432 "    b       loc_fc065cf8\n"
 433 "loc_fc065cb6:\n"
 434 "    lsls    r0, r0, #0x18\n"
 435 "    bpl     loc_fc065cd4\n"
 436 "    ldrd    r1, r0, [r4, #8]\n"
 437 "    cmp     r1, r0\n"
 438 "    beq     loc_fc065cd4\n"
 439 "    ldr     r0, [r5, #4]\n"
 440 "    bl      sub_fc332ba0\n"
 441 "    cbnz    r0, loc_fc065cd0\n"
 442 "    ldr     r0, =0x09200001\n"
 443 "    adds    r0, #0x16\n"
 444 "    str     r0, [r4, #0x14]\n"
 445 "loc_fc065cd0:\n"
 446 "    ldr     r0, [r4, #8]\n"
 447 "    str     r0, [sp, #0x28]\n"
 448 "loc_fc065cd4:\n"
 449 "    ldr     r0, [r5, #4]\n"
 450 "    adds    r1, r0, #1\n"
 451 "    beq     loc_fc065cf8\n"
 452 "    ldr     r6, =0x09200001\n"
 453 "    ldr     r1, [r4, #0x58]\n"
 454 "    adds    r6, r6, #2\n"
 455 "    cmp     r1, #1\n"
 456 "    bne     loc_fc065cea\n"
 457 //mod start
 458 "    LDR R3, =current_write_ignored\n"
 459 "    LDR R3, [R3]\n"
 460 "    cbnz R3,loc_D\n" // jump over the next block
 461 //mod end
 462 "    bl      sub_fc3329ea\n"
 463 "    b       loc_fc065cee\n"
 464 "loc_fc065cea:\n"
 465 "loc_D:\n"
 466 //"    bl      sub_fc3329e8\n" // j_Close_FW
 467 "    bl      fwt_close\n" // +
 468 "loc_fc065cee:\n"
 469 "    cbz     r0, loc_fc065cf2\n"
 470 "    str     r6, [r4, #0x14]\n"
 471 "loc_fc065cf2:\n"
 472 "    mov.w   r0, #-1\n"
 473 "    str     r0, [r5, #4]\n"
 474 "loc_fc065cf8:\n"
 475 "    add.w   r6, r4, #0x5c\n"
 476 "    ldr     r0, [r4, #0x14]\n"
 477 "    lsls    r0, r0, #0x1f\n"
 478 "    bne     loc_fc065d9c\n"
 479 "    ldr     r0, [r4, #0x50]\n"
 480 "    lsls    r1, r0, #0x1f\n"
 481 "    beq     loc_fc065d24\n"
 482 "    movw    r0, #0x81ff\n"
 483 "    str     r0, [sp, #0x20]\n"
 484 "    movs    r0, #0x20\n"
 485 "    str     r0, [sp, #0x24]\n"
 486 "    ldr     r0, [r4, #4]\n"
 487 "    str     r0, [sp, #0x28]\n"
 488 "    ldr     r0, [r4, #0x10]\n"
 489 "    str     r0, [sp, #0x2c]\n"
 490 "    ldr     r0, [r4, #0x10]\n"
 491 "    str     r0, [sp, #0x30]\n"
 492 "    ldr     r0, [r4, #0x10]\n"
 493 "    str     r0, [sp, #0x34]\n"
 494 "    b       loc_fc065d46\n"
 495 "loc_fc065d24:\n"
 496 "    lsls    r0, r0, #0x1b\n"
 497 "    bpl     loc_fc065d46\n"
 498 "    add     r1, sp, #0x20\n"
 499 "    mov     r0, r6\n"
 500 "    bl      sub_fc0fb964\n"
 501 "    cbnz    r0, loc_fc065d3e\n"
 502 "    movs    r0, #0\n"
 503 "    movw    r2, #0x3ee\n"
 504 "    ldr     r1, =0xfc065efc\n" //  *"dwFWrite.c"
 505 "    blx     sub_fc2cf40c\n" // j_DebugAssert
 506 "loc_fc065d3e:\n"
 507 "    ldr     r0, [sp, #0x28]\n"
 508 "    ldr     r1, [r4, #4]\n"
 509 "    add     r0, r1\n"
 510 "    str     r0, [sp, #0x28]\n"
 511 "loc_fc065d46:\n"
 512 "    ldr     r0, [r4, #0x50]\n"
 513 "    lsls    r0, r0, #0x19\n"
 514 "    bmi     loc_fc065d54\n"
 515 "    add     r1, sp, #0x20\n"
 516 "    mov     r0, r6\n"
 517 "    bl      sub_fc0fb9da\n"
 518 "loc_fc065d54:\n"
 519 "    ldr     r0, [r4, #0x50]\n"
 520 "    lsls    r0, r0, #0x1a\n"
 521 "    bpl     loc_fc065d9c\n"
 522 "    movs    r2, #0x20\n"
 523 "    mov     r1, r6\n"
 524 "    mov     r0, sp\n"
 525 "    blx     sub_fc2cf434\n" // j_dry_memcpy
 526 "    mov     r0, sp\n"
 527 "    bl      _strlen\n"
 528 "    add     r0, sp, r0\n"
 529 "    movs    r1, #0x54\n"
 530 "    strb    r1, [r0, #-0x3]!\n"
 531 "    movs    r1, #0x4d\n"
 532 "    strb    r1, [r0, #1]\n"
 533 "    movs    r1, #0x50\n"
 534 "    strb    r1, [r0, #2]\n"
 535 "    mov     r1, sp\n"
 536 "    mov     r0, r6\n"
 537 "    bl      sub_fc0cbb46\n"
 538 "    cbnz    r0, loc_fc065d90\n"
 539 "    movs    r0, #0\n"
 540 "    movw    r2, #0x179\n"
 541 "    ldr     r1, =0xfc065efc\n" //  *"dwFWrite.c"
 542 "    blx     sub_fc2cf40c\n" // j_DebugAssert
 543 "loc_fc065d90:\n"
 544 "    mov     r0, sp\n"
 545 "    bl      sub_fc0fbccc\n"
 546 "    mov     r0, r6\n"
 547 "    bl      sub_fc0fbccc\n"
 548 "loc_fc065d9c:\n"
 549 "    movs    r1, #0\n"
 550 "    movs    r0, #0x48\n"
 551 "    bl      sub_fc32519c\n"
 552 "    mov     r0, r6\n"
 553 "    bl      sub_fc332770\n"
 554 "    ldr     r1, [r5, #0x1c]\n"
 555 "    bl      sub_fc06e6d0\n"
 556 "    b       loc_fc065db8\n"
 557 "    b       loc_fc065db4\n"
 558 "loc_fc065db4:\n"
 559 "    ldr     r0, [r5, #0x1c]\n"
 560 "    blx     r0\n"
 561 "loc_fc065db8:\n"
 562 "    ldr     r1, [r5, #0x14]\n"
 563 "    cmp     r1, #0\n"
 564 "    beq     loc_fc065dc2\n"
 565 "    ldr     r0, [r4, #0x14]\n"
 566 "    blx     r1\n"
 567 "loc_fc065dc2:\n"
 568 "    add     sp, #0x38\n"
 569 "    pop     {r4, r5, r6, pc}\n"
 570 ".ltorg\n"
 571     );
 572 }

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