CHDK_DE Vorschauversion  Trunk Rev. 5707
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
filewrite.c-Dateireferenz
#include "lolevel.h"
#include "platform.h"
#include "../../../generic/filewrite.c"
+ Include-Abhängigkeitsdiagramm für filewrite.c:

gehe zum Quellcode dieser Datei

Datenstrukturen

struct  cam_ptp_data_chunk
 
struct  fwt_data_struct
 

Makrodefinitionen

#define MAX_CHUNKS_FOR_FWT   7
 

Funktionen

void _LogCameraEvent (int id, const char *fmt,...)
 
void log_fwt_msg (fwt_data_struct *fwd)
 
void log_fwt_start (void)
 
void __attribute__ ((naked, noinline))
 

Makro-Dokumentation

#define MAX_CHUNKS_FOR_FWT   7

Definiert in Zeile 11 der Datei filewrite.c.

Dokumentation der Funktionen

void __attribute__ ( (naked, noinline)  )

!!

Definiert in Zeile 52 der Datei filewrite.c.

52  {
53 asm volatile (
54 " push {r2, r3, r4, r5, r6, lr}\n"
55 " ldr r5, =0x000220dc\n"
56 "loc_fc063862:\n"
57 " movs r2, #0\n"
58 " add r1, sp, #4\n"
59 " ldr r0, [r5, #0x10]\n"
60 " blx sub_fc2a15a8\n" // j_ReceiveMessageQueue
61 " cbz r0, loc_fc06387a\n"
62 " movs r0, #0\n"
63 " movw r2, #0x3f5\n"
64 " ldr r1, =0xfc0639f4\n" // *"dwFWrite.c"
65 " blx sub_fc2a1648\n" // j_DebugAssert
66 "loc_fc06387a:\n"
67 " ldr r0, [sp, #4]\n"
68 " ldr r1, [r0]\n"
69 " cmp r1, #0xd\n"
70 " bhs loc_fc063862\n"
71 " tbb [pc, r1]\n" // (jumptable r1 13 elements)
72 "branchtable_fc063886:\n"
73 " .byte((loc_fc063920 - branchtable_fc063886) / 2)\n" // (case 0)
74 " .byte((loc_fc063920 - branchtable_fc063886) / 2)\n" // (case 1)
75 " .byte((loc_fc063920 - branchtable_fc063886) / 2)\n" // (case 2)
76 " .byte((loc_fc063920 - branchtable_fc063886) / 2)\n" // (case 3)
77 " .byte((loc_fc063920 - branchtable_fc063886) / 2)\n" // (case 4)
78 " .byte((loc_fc063920 - branchtable_fc063886) / 2)\n" // (case 5)
79 " .byte((loc_fc063920 - branchtable_fc063886) / 2)\n" // (case 6)
80 " .byte((loc_fc063926 - branchtable_fc063886) / 2)\n" // (case 7)
81 " .byte((loc_fc063894 - branchtable_fc063886) / 2)\n" // (case 8)
82 " .byte((loc_fc0638be - branchtable_fc063886) / 2)\n" // (case 9)
83 " .byte((loc_fc0638de - branchtable_fc063886) / 2)\n" // (case 10)
84 " .byte((loc_fc06389a - branchtable_fc063886) / 2)\n" // (case 11)
85 " .byte((loc_fc0638b8 - branchtable_fc063886) / 2)\n" // (case 12)
86 ".align 1\n"
87 "loc_fc063894:\n" // case 8 - calls close, not seen in normal shooting
88 " bl sub_fc063a82\n"
89 " b loc_fc063862\n"
90 
91 "loc_fc06389a:\n" // case 11 - create dir, TODO not patched
92 " mov r4, r0\n"
93 " adds r0, #0x58\n"
94 " mov r6, r0\n"
95 " bl sub_fc309562\n"
96 " movs r1, #0\n"
97 " bl sub_fc06c066\n"
98 " ldr r0, [r4, #0xc]\n"
99 " bl sub_fc0a2596\n"
100 " mov r0, r6\n"
101 " bl sub_fc309c1a\n" // PrepareDirectory_0
102 " b loc_fc063908\n"
103 
104 "loc_fc0638b8:\n" // case 12 - patch for open, main hook
105 //" bl sub_fc063664\n"
106 " bl sub_fc063664_my\n" // --->>
107 " b loc_fc063862\n"
108 
109 "loc_fc0638be:\n" // case 9 - not seen in normal shooting?
110 " ldr r1, [r0, #4]\n"
111 " movs r2, #0\n"
112 " mov r4, r0\n"
113 " ldr r0, [r5, #4]\n"
114 " bl _lseek\n"
115 " adds r0, r0, #1\n"
116 " bne loc_fc063862\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_fc0635f0\n"
123 " b loc_fc063862\n"
124 
125 "loc_fc0638de:\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_fc063862\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_fc309562\n"
136 " movs r1, #0\n"
137 " bl sub_fc06c066\n"
138 " mov r0, sp\n"
139 " bl sub_fc0a25a2\n"
140 "loc_fc063908:\n"
141 " mov r0, r6\n"
142 " bl sub_fc309562\n"
143 " ldr r1, [r5, #0x1c]\n"
144 " bl sub_fc06c0c4\n"
145 " ldr r1, [r5, #0x14]\n"
146 " cmp r1, #0\n"
147 " beq loc_fc063862\n"
148 " ldr r0, [r4, #0x10]\n"
149 " blx r1\n"
150 " b loc_fc063862\n"
151 
152 "loc_fc063920:\n" // case 0-6 - write stage
153 //" bl sub_fc063ac6\n"
154 " bl sub_fc063ac6_my\n" // --->>
155 " b loc_fc063862\n"
156 
157 "loc_fc063926:\n" // case 7 - close stage
158 //" bl sub_fc063768\n"
159 " bl sub_fc063768_my\n" // --->>
160 " b loc_fc063862\n"
161 
162 ".ltorg\n"
163  );
164 }
void _LogCameraEvent ( int  id,
const char *  fmt,
  ... 
)
void log_fwt_msg ( fwt_data_struct fwd)

Definiert in Zeile 33 der Datei filewrite.c.

34 {
35  int m=fwd->unkn1;
36  _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);
37  _LogCameraEvent(0x60,"fw %s",fwd->name);
38  if(m >= 0 && m <=6) {
39  _LogCameraEvent(0x60,"fw chunk adr:0x%08x l:0x%08x",fwd->pdc[m].address,fwd->pdc[m].length);
40  }
41  _LogCameraEvent(0x60,"fw u %08x %08x %08x %08x %08x",fwd->unkn2,fwd->unkn3,fwd->unkn5,fwd->unkn6);
42 }
void log_fwt_start ( void  )

Definiert in Zeile 44 der Datei filewrite.c.

45 {
46  _LogCameraEvent(0x60,"fw start");
47 }