root/platform/sx60hs/sub/100b/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_fc2cf35c\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_fc2cf41c\n" // j_DebugAssert
 124 "loc_fc065de8:\n"
 125 "    ldr     r0, [sp]\n"
 126 "bl log_fwt_msg\n"
 127 "    ldr     r0, [sp]\n"
 128 "    ldr     r1, [r0]\n"
 129 "    cmp     r1, #0xd\n"
 130 "    bhs     loc_fc065dd2\n"
 131 "    tbb     [pc, r1]\n" // (jumptable r1 13 elements)
 132 "branchtable_fc065df4:\n"
 133 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 0)
 134 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 1)
 135 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 2)
 136 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 3)
 137 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 4)
 138 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 5)
 139 "    .byte((loc_fc065e36 - branchtable_fc065df4) / 2)\n" // (case 6)
 140 "    .byte((loc_fc065e3c - branchtable_fc065df4) / 2)\n" // (case 7)
 141 "    .byte((loc_fc065e02 - branchtable_fc065df4) / 2)\n" // (case 8)
 142 "    .byte((loc_fc065e14 - branchtable_fc065df4) / 2)\n" // (case 9)
 143 "    .byte((loc_fc065e30 - branchtable_fc065df4) / 2)\n" // (case 10)
 144 "    .byte((loc_fc065e08 - branchtable_fc065df4) / 2)\n" // (case 11)
 145 "    .byte((loc_fc065e0e - branchtable_fc065df4) / 2)\n" // (case 12)
 146 ".align 1\n"
 147 "loc_fc065e02:\n"   // case 8 - calls close, not seen in normal shooting
 148 "    bl      sub_fc065fb6\n"
 149 "    b       loc_fc065dd2\n"
 150 "loc_fc065e08:\n"   // case 11 - create dir, TODO not patched
 151 "    bl      sub_fc066002\n"
 152 "    b       loc_fc065dd2\n"
 153 "loc_fc065e0e:\n"   // case 12 - patch for open, main hook
 154 "    bl      sub_fc065b7c_my\n"
 155 "    b       loc_fc065dd2\n"
 156 "loc_fc065e14:\n"   // case 9 - not seen in normal shooting
 157 "    ldr     r1, [r0, #4]\n"
 158 "    movs    r2, #0\n"
 159 "    mov     r4, r0\n"
 160 "    ldr     r0, [r5, #4]\n"
 161 "    bl      _lseek\n" // -> fwt_lseek ?
 162 "    adds    r0, r0, #1\n"
 163 "    bne     loc_fc065dd2\n"
 164 "    movs    r0, #7\n"
 165 "    mov     r1, r4\n"
 166 "    str     r6, [r4, #0x14]\n"
 167 "    bl      sub_fc065b04\n"
 168 "    b       loc_fc065dd2\n"
 169 "loc_fc065e30:\n"   // case 10 - cache flush, patch for ignore write
 170 "    bl      sub_fc066056\n"
 171 "    b       loc_fc065dd2\n"
 172 "loc_fc065e36:\n"     // case 0-6  - write stage
 173 "    bl      sub_fc0660ae_my\n"
 174 "    b       loc_fc065dd2\n"
 175 "loc_fc065e3c:\n"  // case 7 - close stage
 176 "    bl      sub_fc065ca2_my\n"
 177 "    b       loc_fc065dd2\n"
 178 ".ltorg\n"
 179     );
 180 }
 181 // -s=0xfc065b7d-c=121 -f=chdk
 182 void __attribute__((naked,noinline)) sub_fc065b7c_my() {
 183 asm volatile (
 184 "    push.w  {r4, r5, r6, r7, r8, sb, lr}\n"
 185 "    mov     r4, r0\n"
 186 //hook placed here to avoid conditional branch a few instructions below (watch out for registers!)
 187 //"  mov   r0, r4\n"      //data block start, commented out as R0 is already holding what we need
 188 "    BL      filewrite_main_hook\n"
 189 "    mov     r0, r4\n"      //restore register(s)
 190 "    ldr     r0, [r0, #0x50]\n"
 191 "    sub     sp, #0x3c\n"
 192 "    lsls    r1, r0, #0x1f\n"
 193 "    bne     loc_fc065b8e\n"
 194 "    lsls    r0, r0, #0x1d\n"
 195 "    bpl     loc_fc065c7e\n"
 196 "loc_fc065b8e:\n"
 197 "    ldr     r7, =0x00024cb8\n"
 198 "    ldr     r0, [r7, #0x18]\n"
 199 "    cbz     r0, loc_fc065b96\n"
 200 "    blx     r0\n"
 201 "loc_fc065b96:\n"
 202 "    add.w   r0, r4, #0x5c\n"
 203 "    mov     r8, r0\n"
 204 "    bl      sub_fc332780\n"
 205 "    movs    r1, #0\n"
 206 "    bl      sub_fc06e672\n"
 207 "    movs    r1, #0\n"
 208 "    movs    r0, #0x47\n"
 209 "    bl      sub_fc3251ac\n"
 210 "    ldr     r0, [r4, #0x50]\n"
 211 "    lsls    r0, r0, #0x1f\n"
 212 "    beq     loc_fc065c7e\n"
 213 "    ldr     r0, [r4, #0x10]\n"
 214 "    bl      sub_fc0cb96e\n"
 215 "    ldr     r0, [r4, #0x50]\n"
 216 "    movw    r5, #0x301\n"
 217 "    lsls    r1, r0, #0x1b\n"
 218 "    bpl     loc_fc065bc8\n"
 219 "    movs    r5, #9\n"
 220 "    b       loc_fc065bce\n"
 221 "loc_fc065bc8:\n"
 222 "    lsls    r1, r0, #0x19\n"
 223 "    bpl     loc_fc065bce\n"
 224 "    movs    r5, #1\n"
 225 "loc_fc065bce:\n"
 226 "    lsls    r0, r0, #0x1a\n"
 227 "    bmi     loc_fc065bd8\n"
 228 "    ldr     r0, [r4, #0x58]\n"
 229 "    cmp     r0, #1\n"
 230 "    bne     loc_fc065bdc\n"
 231 "loc_fc065bd8:\n"
 232 "    orr     r5, r5, #0x8000\n"
 233 "loc_fc065bdc:\n"
 234 "    movw    sb, #0x1b6\n"
 235 "    ldr     r6, [r4, #0x10]\n"
 236 "    mov     r2, sb\n"
 237 "    mov     r1, r5\n"
 238 "    mov     r0, r8\n"
 239 //"    bl      sub_fc3329f6\n" // j_Open_FW
 240 "    bl      fwt_open\n" // +
 241 "    adds    r1, r0, #1\n"
 242 "    bne     loc_fc065c2a\n"
 243 "    mov     r0, r8\n"
 244 "    bl      sub_fc332d9a\n" // PrepareDirectory_0
 245 "    movs    r2, #0xf\n"
 246 "    mov     r1, r8\n"
 247 "    add     r0, sp, #4\n"
 248 "    blx     sub_fc2cf43c\n"
 249 "    movs    r0, #0\n"
 250 "    strb.w  r0, [sp, #0x13]\n"
 251 "    movw    r1, #0x41ff\n"
 252 "    str     r1, [sp, #0x24]\n"
 253 "    strd    r0, r6, [sp, #0x2c]\n"
 254 "    movs    r1, #0x10\n"
 255 "    str     r6, [sp, #0x34]\n"
 256 "    add     r0, sp, #4\n"
 257 "    str     r6, [sp, #0x38]\n"
 258 "    str     r1, [sp, #0x28]\n"
 259 "    add     r1, sp, #0x24\n"
 260 "    bl      sub_fc0fb9da\n"
 261 "    mov     r2, sb\n"
 262 "    mov     r1, r5\n"
 263 "    mov     r0, r8\n"
 264 //"    bl      sub_fc3329f6\n" // j_Open_FW this is not Open 0xfc3328fd
 265 "    bl      _Open\n" // j_Open_FW
 266 "loc_fc065c2a:\n"
 267 "    mov     r5, r0\n"
 268 "    str     r0, [r7, #4]\n"
 269 "    adds    r0, r0, #1\n"
 270 "    bne     loc_fc065c56\n"
 271 "    movs    r1, #0\n"
 272 "    movs    r0, #0x48\n"
 273 "    bl      sub_fc3251ac\n" // "DSIC:0x48,0"
 274 "    mov     r0, r8\n"
 275 "    bl      sub_fc332780\n"
 276 "    ldr     r1, [r7, #0x1c]\n"
 277 "    bl      sub_fc06e6d0\n"
 278 "    ldr     r1, [r7, #0x14]\n"
 279 "    cmp     r1, #0\n"
 280 "    beq     loc_fc065c9c\n"
 281 "    add     sp, #0x3c\n"
 282 "    ldr     r0, =0x09200001\n"
 283 "    pop.w   {r4, r5, r6, r7, r8, sb, lr}\n"
 284 "    bx      r1\n"
 285 "loc_fc065c56:\n"
 286 "    ldr     r0, =0x002013cc\n"
 287 "    movs    r2, #0x20\n"
 288 "    mov     r1, r8\n"
 289 "    blx     sub_fc2cf444\n" // j_dry_memcpy
 290 // TODO looks equivalent to elph130, not verified that it's required
 291 //mod start
 292 "    LDR R3, =current_write_ignored\n"
 293 "    LDR R3, [R3]\n"
 294 "    cbnz r3,loc_C\n" // jump over the next block
 295 //mod end
 296 "    ldr     r0, [r4, #0x50]\n"
 297 "    lsls    r0, r0, #0x18\n"
 298 "    bpl     loc_fc065c7e\n"
 299 "    ldr     r1, [r4, #0xc]\n"
 300 "    mov     r0, r5\n"
 301 "    bl      sub_fc332bb0\n"
 302 "    cbnz    r0, loc_fc065c7c\n"
 303 "    ldr     r0, =0x09200001\n"
 304 "    mov     r1, r4\n"
 305 "    adds    r0, #0x16\n"
 306 "    str     r0, [r4, #0x14]\n"
 307 "    movs    r0, #7\n"
 308 "    b       loc_fc065c94\n"
 309 "loc_fc065c7c:\n"
 310 "    b       loc_fc065c7e\n"
 311 "loc_fc065c7e:\n"
 312 "loc_C:\n"
 313 "    ldr     r0, [r4, #0x50]\n"
 314 "    lsls    r0, r0, #0x19\n"
 315 "    bmi     loc_fc065c88\n"
 316 "    ldr     r0, [r4, #4]\n"
 317 "    cbz     r0, loc_fc065c90\n"
 318 "loc_fc065c88:\n"
 319 "    movs    r0, #9\n"
 320 "    mov     r1, r4\n"
 321 "    bl      sub_fc065b04\n"
 322 "loc_fc065c90:\n"
 323 "    movs    r0, #0\n"
 324 "    mov     r1, r4\n"
 325 "loc_fc065c94:\n"
 326 "    add     sp, #0x3c\n"
 327 "    pop.w   {r4, r5, r6, r7, r8, sb, lr}\n"
 328 //"    b       loc_fc065b04\n"
 329 "    ldr     pc, =0xfc065b05\n"
 330 "loc_fc065c9c:\n"
 331 "    add     sp, #0x3c\n"
 332 "    pop.w   {r4, r5, r6, r7, r8, sb, pc}\n"
 333 ".ltorg\n"
 334     );
 335 }
 336 // message 0-6 - filewrite chunks
 337 // -s=0xfc0660af -c=65 -f=chdk
 338 void __attribute__((naked,noinline)) sub_fc0660ae_my() {
 339 asm volatile (
 340 "    push.w  {r4, r5, r6, r7, r8, sb, sl, lr}\n"
 341 "    mov     r5, r0\n"
 342 "    ldr     r0, [r0]\n"
 343 "    cmp     r0, #6\n"
 344 "    bhi     loc_fc0660c6\n"
 345 "    add.w   r0, r5, r0, lsl #3\n"
 346 "    ldrd    r7, r6, [r0, #0x18]\n"
 347 "    cbnz    r6, loc_fc0660da\n"
 348 "    b       loc_fc0660d4\n"
 349 "loc_fc0660c6:\n"
 350 "    movw    r2, #0x36d\n"
 351 "    ldr     r1, =0xfc065efc\n" //  *"dwFWrite.c"
 352 "    movs    r0, #0\n"
 353 "    blx     sub_fc2cf41c\n" // j_DebugAssert
 354 "loc_fc0660d4:\n"
 355 "    movs    r0, #7\n"
 356 "    mov     r1, r5\n"
 357 "    b       loc_fc06614a\n"
 358 "loc_fc0660da:\n"
 359 "    ldr.w   sl, =0x00024cb8\n"
 360 "    mov.w   sb, #0x1000000\n"
 361 "    mov     r4, r6\n"
 362 "loc_fc0660e4:\n"
 363 "    ldr     r0, [r5, #4]\n"
 364 "    cmp     r4, sb\n"
 365 "    mov     r1, sb\n"
 366 "    bhi     loc_fc0660ee\n"
 367 "    mov     r1, r4\n"
 368 "loc_fc0660ee:\n"
 369 "    lsls    r2, r0, #8\n"
 370 "    beq     loc_fc066100\n"
 371 "    bic     r0, r0, #0xff000000\n"
 372 "    rsb.w   r0, r0, #0x1000000\n"
 373 "    cmp     r1, r0\n"
 374 "    bls     loc_fc066100\n"
 375 "    mov     r1, r0\n"
 376 "loc_fc066100:\n"
 377 "    ldr.w   r0, [sl, #4]\n"
 378 "    mov     r8, r1\n"
 379 "    mov     r2, r1\n"
 380 "    mov     r1, r7\n"
 381 //"    bl      sub_fc332a9e\n" // j_Write_FW
 382 "    bl      fwt_write\n" // +
 383 "    ldr     r1, [r5, #4]\n"
 384 "    cmp     r8, r0\n"
 385 "    add     r1, r0\n"
 386 "    str     r1, [r5, #4]\n"
 387 "    beq     loc_fc06612a\n"
 388 "    adds    r0, r0, #1\n"
 389 "    bne     loc_fc066122\n"
 390 "    ldr     r0, =0x09200006\n"
 391 "    subs    r0, r0, #1\n"
 392 "    b       loc_fc066126\n"
 393 "loc_fc066122:\n"
 394 "    ldr     r0, =0x09200006\n"
 395 "    adds    r0, #0xf\n"
 396 "loc_fc066126:\n"
 397 "    str     r0, [r5, #0x14]\n"
 398 "    b       loc_fc0660d4\n"
 399 "loc_fc06612a:\n"
 400 "    subs    r4, r4, r0\n"
 401 "    cmp     r4, r6\n"
 402 "    add     r7, r0\n"
 403 "    blo     loc_fc066140\n"
 404 "    movw    r2, #0x398\n"
 405 "    ldr     r1, =0xfc065efc\n" //  *"dwFWrite.c"
 406 "    movs    r0, #0\n"
 407 "    blx     sub_fc2cf41c\n" // j_DebugAssert
 408 "loc_fc066140:\n"
 409 "    cmp     r4, #0\n"
 410 "    bne     loc_fc0660e4\n"
 411 "    ldr     r0, [r5]\n"
 412 "    mov     r1, r5\n"
 413 "    adds    r0, r0, #1\n"
 414 "loc_fc06614a:\n"
 415 "    pop.w   {r4, r5, r6, r7, r8, sb, sl, lr}\n"
 416 //"    b       loc_fc065b04\n"
 417 "    ldr     pc,=0xfc065b05\n"
 418 ".ltorg\n"
 419     );
 420 }
 421 // message 7 - close
 422 // -s=0xfc065ca3 -c=124 -f=chdk
 423 void __attribute__((naked,noinline)) sub_fc065ca2_my() {
 424 asm volatile (
 425 "    push    {r4, r5, r6, lr}\n"
 426 "    mov     r4, r0\n"
 427 "    ldr     r0, [r0, #0x50]\n"
 428 "    ldr     r5, =0x00024cb8\n"
 429 "    sub     sp, #0x38\n"
 430 "    lsls    r1, r0, #0x1e\n"
 431 "    bmi     loc_fc065cb6\n"
 432 "    lsls    r0, r0, #0x1c\n"
 433 "    bpl     loc_fc065db4\n"
 434 "    b       loc_fc065cf8\n"
 435 "loc_fc065cb6:\n"
 436 "    lsls    r0, r0, #0x18\n"
 437 "    bpl     loc_fc065cd4\n"
 438 "    ldrd    r1, r0, [r4, #8]\n"
 439 "    cmp     r1, r0\n"
 440 "    beq     loc_fc065cd4\n"
 441 "    ldr     r0, [r5, #4]\n"
 442 "    bl      sub_fc332bb0\n"
 443 "    cbnz    r0, loc_fc065cd0\n"
 444 "    ldr     r0, =0x09200001\n"
 445 "    adds    r0, #0x16\n"
 446 "    str     r0, [r4, #0x14]\n"
 447 "loc_fc065cd0:\n"
 448 "    ldr     r0, [r4, #8]\n"
 449 "    str     r0, [sp, #0x28]\n"
 450 "loc_fc065cd4:\n"
 451 "    ldr     r0, [r5, #4]\n"
 452 "    adds    r1, r0, #1\n"
 453 "    beq     loc_fc065cf8\n"
 454 "    ldr     r6, =0x09200001\n"
 455 "    ldr     r1, [r4, #0x58]\n"
 456 "    adds    r6, r6, #2\n"
 457 "    cmp     r1, #1\n"
 458 "    bne     loc_fc065cea\n"
 459 //mod start
 460 "    LDR R3, =current_write_ignored\n"
 461 "    LDR R3, [R3]\n"
 462 "    cbnz R3,loc_D\n" // jump over the next block
 463 //mod end
 464 "    bl      sub_fc3329fa\n"
 465 "    b       loc_fc065cee\n"
 466 "loc_fc065cea:\n"
 467 "loc_D:\n"
 468 //"    bl      sub_fc3329e4\n" // j_Close_FW
 469 "    bl      fwt_close\n" // +
 470 "loc_fc065cee:\n"
 471 "    cbz     r0, loc_fc065cf2\n"
 472 "    str     r6, [r4, #0x14]\n"
 473 "loc_fc065cf2:\n"
 474 "    mov.w   r0, #-1\n"
 475 "    str     r0, [r5, #4]\n"
 476 "loc_fc065cf8:\n"
 477 "    add.w   r6, r4, #0x5c\n"
 478 "    ldr     r0, [r4, #0x14]\n"
 479 "    lsls    r0, r0, #0x1f\n"
 480 "    bne     loc_fc065d9c\n"
 481 "    ldr     r0, [r4, #0x50]\n"
 482 "    lsls    r1, r0, #0x1f\n"
 483 "    beq     loc_fc065d24\n"
 484 "    movw    r0, #0x81ff\n"
 485 "    str     r0, [sp, #0x20]\n"
 486 "    movs    r0, #0x20\n"
 487 "    str     r0, [sp, #0x24]\n"
 488 "    ldr     r0, [r4, #4]\n"
 489 "    str     r0, [sp, #0x28]\n"
 490 "    ldr     r0, [r4, #0x10]\n"
 491 "    str     r0, [sp, #0x2c]\n"
 492 "    ldr     r0, [r4, #0x10]\n"
 493 "    str     r0, [sp, #0x30]\n"
 494 "    ldr     r0, [r4, #0x10]\n"
 495 "    str     r0, [sp, #0x34]\n"
 496 "    b       loc_fc065d46\n"
 497 "loc_fc065d24:\n"
 498 "    lsls    r0, r0, #0x1b\n"
 499 "    bpl     loc_fc065d46\n"
 500 "    add     r1, sp, #0x20\n"
 501 "    mov     r0, r6\n"
 502 "    bl      sub_fc0fb964\n"
 503 "    cbnz    r0, loc_fc065d3e\n"
 504 "    movs    r0, #0\n"
 505 "    movw    r2, #0x3ee\n"
 506 "    ldr     r1, =0xfc065efc\n" //  *"dwFWrite.c"
 507 "    blx     sub_fc2cf41c\n" // j_DebugAssert
 508 "loc_fc065d3e:\n"
 509 "    ldr     r0, [sp, #0x28]\n"
 510 "    ldr     r1, [r4, #4]\n"
 511 "    add     r0, r1\n"
 512 "    str     r0, [sp, #0x28]\n"
 513 "loc_fc065d46:\n"
 514 "    ldr     r0, [r4, #0x50]\n"
 515 "    lsls    r0, r0, #0x19\n"
 516 "    bmi     loc_fc065d54\n"
 517 "    add     r1, sp, #0x20\n"
 518 "    mov     r0, r6\n"
 519 "    bl      sub_fc0fb9da\n"
 520 "loc_fc065d54:\n"
 521 "    ldr     r0, [r4, #0x50]\n"
 522 "    lsls    r0, r0, #0x1a\n"
 523 "    bpl     loc_fc065d9c\n"
 524 "    movs    r2, #0x20\n"
 525 "    mov     r1, r6\n"
 526 "    mov     r0, sp\n"
 527 "    blx     sub_fc2cf444\n" // j_dry_memcpy
 528 "    mov     r0, sp\n"
 529 "    bl      _strlen\n"
 530 "    add     r0, sp, r0\n"
 531 "    movs    r1, #0x54\n"
 532 "    strb    r1, [r0, #-0x3]!\n"
 533 "    movs    r1, #0x4d\n"
 534 "    strb    r1, [r0, #1]\n"
 535 "    movs    r1, #0x50\n"
 536 "    strb    r1, [r0, #2]\n"
 537 "    mov     r1, sp\n"
 538 "    mov     r0, r6\n"
 539 "    bl      sub_fc0cbb46\n"
 540 "    cbnz    r0, loc_fc065d90\n"
 541 "    movs    r0, #0\n"
 542 "    movw    r2, #0x179\n"
 543 "    ldr     r1, =0xfc065efc\n" //  *"dwFWrite.c"
 544 "    blx     sub_fc2cf41c\n" // j_DebugAssert
 545 "loc_fc065d90:\n"
 546 "    mov     r0, sp\n"
 547 "    bl      sub_fc0fbccc\n"
 548 "    mov     r0, r6\n"
 549 "    bl      sub_fc0fbccc\n"
 550 "loc_fc065d9c:\n"
 551 "    movs    r1, #0\n"
 552 "    movs    r0, #0x48\n"
 553 "    bl      sub_fc3251ac\n"
 554 "    mov     r0, r6\n"
 555 "    bl      sub_fc332780\n"
 556 "    ldr     r1, [r5, #0x1c]\n"
 557 "    bl      sub_fc06e6d0\n"
 558 "    b       loc_fc065db8\n"
 559 "    b       loc_fc065db4\n"
 560 "loc_fc065db4:\n"
 561 "    ldr     r0, [r5, #0x1c]\n"
 562 "    blx     r0\n"
 563 "loc_fc065db8:\n"
 564 "    ldr     r1, [r5, #0x14]\n"
 565 "    cmp     r1, #0\n"
 566 "    beq     loc_fc065dc2\n"
 567 "    ldr     r0, [r4, #0x14]\n"
 568 "    blx     r1\n"
 569 "loc_fc065dc2:\n"
 570 "    add     sp, #0x38\n"
 571 "    pop     {r4, r5, r6, pc}\n"
 572 ".ltorg\n"
 573     );
 574 }
 575 

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