This source file includes following definitions.
- filewritetask
- sub_FF33780C_my
- sub_FF337968_my
- sub_FF3373BC_my
1
2
3
4 #include "lolevel.h"
5 #include "platform.h"
6
7 typedef struct {
8 unsigned int address;
9 unsigned int length;
10 } cam_ptp_data_chunk;
11
12 #define MAX_CHUNKS_FOR_FWT 7
13
14
15
16
17
18
19 typedef struct
20 {
21 int unkn1[5];
22 cam_ptp_data_chunk pdc[MAX_CHUNKS_FOR_FWT];
23 int unkn2;
24 char name[32];
25 } fwt_data_struct;
26
27 #include "../../../generic/filewrite.c"
28
29
30
31 void __attribute__((naked,noinline)) filewritetask() {
32 asm volatile (
33 " STMFD SP!, {R1-R5,LR} \n"
34 " LDR R5, =0xF12C \n"
35
36 "loc_FF337530:\n"
37 " MOV R2, #0 \n"
38 " LDR R0, [R5, #0x10] \n"
39 " ADD R1, SP, #8 \n"
40 " BL sub_FF02B0F4 /*_ReceiveMessageQueue*/ \n"
41 " CMP R0, #0 \n"
42 " LDRNE R1, =0x33E \n"
43 " LDRNE R0, =0xFF33761C /*'dwFWrite.c'*/ \n"
44 " BLNE _DebugAssert \n"
45 " LDR R0, [SP, #8] \n"
46 " LDR R1, [R0] \n"
47 " CMP R1, #0xA \n"
48 " ADDCC PC, PC, R1, LSL#2 \n"
49 " B loc_FF337530 \n"
50 " B loc_FF337600 \n"
51 " B loc_FF337600 \n"
52 " B loc_FF337600 \n"
53 " B loc_FF337600 \n"
54 " B loc_FF337600 \n"
55 " B loc_FF337600 \n"
56 " B loc_FF337600 \n"
57 " B loc_FF337608 \n"
58 " B loc_FF33758C \n"
59 " B loc_FF3375F8 \n"
60
61 "loc_FF33758C:\n"
62 " MOV R0, #0 \n"
63 " MOV R4, R5 \n"
64 " STR R0, [SP] \n"
65
66 "loc_FF337598:\n"
67 " LDR R0, [R4, #0x10] \n"
68 " MOV R1, SP \n"
69 " BL sub_FF02B338 /*_GetNumberOfPostedMessages*/ \n"
70 " LDR R0, [SP] \n"
71 " CMP R0, #0 \n"
72 " BEQ loc_FF3375C4 \n"
73 " LDR R0, [R4, #0x10] \n"
74 " MOV R2, #0 \n"
75 " ADD R1, SP, #4 \n"
76 " BL sub_FF02B0F4 /*_ReceiveMessageQueue*/ \n"
77 " B loc_FF337598 \n"
78
79 "loc_FF3375C4:\n"
80 " LDR R0, [R4, #4] \n"
81 " CMN R0, #1 \n"
82 " BEQ loc_FF3375EC \n"
83 " BL fwt_close \n"
84 " MVN R0, #0 \n"
85 " STR R0, [R4, #4] \n"
86 " LDR R0, =0x173944 \n"
87 " BL sub_FF06A7D8 \n"
88 " MOV R1, #0 \n"
89 " BL sub_FF068A54 \n"
90
91 "loc_FF3375EC:\n"
92 " LDR R0, [R4, #0xC] \n"
93 " BL _GiveSemaphore \n"
94 " B loc_FF337530 \n"
95
96 "loc_FF3375F8:\n"
97 " BL sub_FF33780C_my \n"
98 " B loc_FF337530 \n"
99
100 "loc_FF337600:\n"
101 " BL sub_FF337968_my \n"
102 " B loc_FF337530 \n"
103
104 "loc_FF337608:\n"
105 " BL sub_FF3373BC_my \n"
106 " B loc_FF337530 \n"
107 );
108 }
109
110
111
112 void __attribute__((naked,noinline)) sub_FF33780C_my() {
113 asm volatile (
114 " STMFD SP!, {R4-R9,LR} \n"
115 " MOV R4, R0 \n"
116 " SUB SP, SP, #0x3C \n"
117 " ADD R0, R0, #0x50 \n"
118 " BL sub_FF06A7D8 \n"
119 " MOV R1, #0 \n"
120 " BL sub_FF068918 \n"
121 " LDR R0, [R4, #0xC] \n"
122 " BL sub_FF000348 \n"
123 " LDR R0, [R4, #0x4C] \n"
124 " ADD R7, R4, #0x50 \n"
125 " CMP R0, #1 \n"
126 " LDREQ R0, [R4, #8] \n"
127 " ORREQ R0, R0, #0x8000 \n"
128 " STREQ R0, [R4, #8] \n"
129 " LDR R5, [R4, #0xC] \n"
130 " LDR R8, [R4, #8] \n"
131 " BL sub_FF1D4D90 \n"
132
133 " STMFD SP!, {R4-R12,LR} \n"
134 " MOV R0, R4 \n"
135 " BL filewrite_main_hook \n"
136 " LDMFD SP!, {R4-R12,LR} \n"
137
138 " LDR R9, =0x1B6 \n"
139 " MOV R1, R8 \n"
140 " MOV R2, R9 \n"
141 " MOV R0, R7 \n"
142 " BL fwt_open \n"
143 " MOV R6, R0 \n"
144 " BL sub_FF1D4DE0 \n"
145 " CMN R6, #1 \n"
146 " MOVNE R5, R6 \n"
147 " BNE sub_FF3378E4 \n"
148 " BL sub_FF1D4D90 \n"
149 " MOV R0, R7 \n"
150 " BL sub_FF027C70 \n"
151 " MOV R2, #0xF \n"
152 " MOV R1, R7 \n"
153 " ADD R0, SP, #4 \n"
154 " BL sub_FF42FAB4 \n"
155 " MOV R0, #0 \n"
156 " LDR R1, =0x41FF \n"
157 " STRB R0, [SP, #0x13] \n"
158 " STR R1, [SP, #0x24] \n"
159 " MOV R1, #0x10 \n"
160 " STR R0, [SP, #0x2C] \n"
161 " STR R1, [SP, #0x28] \n"
162 " ADD R1, SP, #0x24 \n"
163 " ADD R0, SP, #4 \n"
164 " STR R5, [SP, #0x30] \n"
165 " STR R5, [SP, #0x34] \n"
166 " STR R5, [SP, #0x38] \n"
167 " BL sub_FF06828C \n"
168 " MOV R2, R9 \n"
169 " MOV R1, R8 \n"
170 " MOV R0, R7 \n"
171 " BL fwt_open \n"
172 " LDR PC, =0xFF3378DC \n"
173 );
174 }
175
176
177
178 void __attribute__((naked,noinline)) sub_FF337968_my() {
179 asm volatile (
180 " STMFD SP!, {R4-R10,LR} \n"
181 " MOV R5, R0 \n"
182 " LDR R0, [R0] \n"
183 " CMP R0, #6 \n"
184 " BHI loc_FF337994 \n"
185 " ADD R0, R5, R0, LSL#3 \n"
186 " LDR R8, [R0, #0x14]! \n"
187 " LDR R7, [R0, #4] \n"
188 " CMP R7, #0 \n"
189 " BNE loc_FF3379AC \n"
190 " B loc_FF3379A0 \n"
191
192 "loc_FF337994:\n"
193 " LDR R1, =0x29E \n"
194 " LDR R0, =0xFF33761C /*'dwFWrite.c'*/ \n"
195 " BL _DebugAssert \n"
196
197 "loc_FF3379A0:\n"
198 " MOV R1, R5 \n"
199 " MOV R0, #7 \n"
200 " B sub_FF337A40 \n"
201
202 "loc_FF3379AC:\n"
203 " LDR R9, =0xF12C \n"
204 " MOV R4, R7 \n"
205
206 "loc_FF3379B4:\n"
207 " LDR R0, [R5, #4] \n"
208 " CMP R4, #0x1000000 \n"
209 " MOVLS R6, R4 \n"
210 " MOVHI R6, #0x1000000 \n"
211 " BIC R1, R0, #0xFF000000 \n"
212 " CMP R1, #0 \n"
213 " BICNE R0, R0, #0xFF000000 \n"
214 " RSBNE R0, R0, #0x1000000 \n"
215 " CMPNE R6, R0 \n"
216 " MOVHI R6, R0 \n"
217 " LDR R0, [R9, #4] \n"
218 " MOV R2, R6 \n"
219 " MOV R1, R8 \n"
220 " BL fwt_write \n"
221 " LDR R1, [R5, #4] \n"
222 " CMP R6, R0 \n"
223 " ADD R1, R1, R0 \n"
224 " STR R1, [R5, #4] \n"
225 " BEQ loc_FF337A14 \n"
226 " CMN R0, #1 \n"
227 " LDRNE R0, =0x9200015 \n"
228 " LDREQ R0, =0x9200005 \n"
229 " STR R0, [R5, #0x10] \n"
230 " B loc_FF3379A0 \n"
231
232 "loc_FF337A14:\n"
233 " SUB R4, R4, R0 \n"
234 " CMP R4, R7 \n"
235 " ADD R8, R8, R0 \n"
236 " LDRCS R1, =0x2C9 \n"
237 " LDRCS R0, =0xFF33761C /*'dwFWrite.c'*/ \n"
238 " BLCS _DebugAssert \n"
239 " CMP R4, #0 \n"
240 " BNE loc_FF3379B4 \n"
241 " LDR PC, =0xFF337A34 \n"
242 );
243 }
244
245
246
247 void __attribute__((naked,noinline)) sub_FF3373BC_my() {
248 asm volatile (
249 " STMFD SP!, {R4-R6,LR} \n"
250 " LDR R5, =0xF12C \n"
251 " MOV R4, R0 \n"
252 " LDR R0, [R5, #4] \n"
253 " SUB SP, SP, #0x38 \n"
254 " CMN R0, #1 \n"
255 " BEQ sub_FF337404 \n"
256 " LDR R1, [R4, #8] \n"
257 " LDR R6, =0x9200003 \n"
258 " TST R1, #0x8000 \n"
259 " BEQ loc_FF3373F0 \n"
260
261 " LDR R3, =current_write_ignored\n"
262 " LDR R3, [R3]\n"
263 " CMP R3, #0\n"
264 " BNE loc_D\n"
265
266 " BL sub_FF027694 \n"
267 " B sub_FF3373F4 \n"
268
269 "loc_FF3373F0:\n"
270 "loc_D:\n"
271 " BL fwt_close \n"
272 " LDR PC, =0xFF3373F4 \n"
273 );
274 }