This source file includes following definitions.
- filewritetask
- sub_FFA1E860_my
- sub_FFA1E99C_my
- sub_FFA1EA98_my
1 #include "lolevel.h"
2 #include "platform.h"
3
4 typedef struct {
5 unsigned int address;
6 unsigned int length;
7 } cam_ptp_data_chunk;
8
9 #define MAX_CHUNKS_FOR_FWT 3
10
11
12
13
14
15
16
17 typedef struct
18 {
19 int unkn1, unkn2, unkn3, unkn4, unkn5;
20 cam_ptp_data_chunk pdc[MAX_CHUNKS_FOR_FWT];
21 char name[32];
22 } fwt_data_struct;
23
24 #include "../../../generic/filewrite.c"
25
26
27
28 void __attribute__((naked,noinline)) filewritetask() {
29 asm volatile (
30 " STMFD SP!, {R1-R5,LR} \n"
31 " LDR R4, =0xBF3C \n"
32 "loc_FFA1E5C8:\n"
33 " LDR R0, [R4, #0x10] \n"
34 " MOV R2, #0 \n"
35 " ADD R1, SP, #8 \n"
36 " BL sub_FF827098 \n"
37 " CMP R0, #0 \n"
38 " BNE loc_FFA1E5F8 \n"
39 " LDR R0, [SP, #8] \n"
40 " LDR R1, [R0] \n"
41 " CMP R1, #1 \n"
42 " BNE loc_FFA1E600 \n"
43 " LDR R0, [R4, #8] \n"
44 " BL sub_FF827584 \n"
45 "loc_FFA1E5F8:\n"
46 " BL sub_FF81B184 \n"
47 " LDMFD SP!, {R1-R5,PC} \n"
48 "loc_FFA1E600:\n"
49 " SUB R1, R1, #2 \n"
50 " CMP R1, #5 \n"
51 " ADDLS PC, PC, R1, LSL #2 \n"
52 " B loc_FFA1E5C8 \n"
53 " B loc_FFA1E628 \n"
54 " B loc_FFA1E68C \n"
55 " B loc_FFA1E694 \n"
56 " B loc_FFA1E694 \n"
57 " B loc_FFA1E694 \n"
58 " B loc_FFA1E69C \n"
59 "loc_FFA1E628:\n"
60 " MOV R0, #0 \n"
61 " STR R0, [SP] \n"
62 "loc_FFA1E630:\n"
63 " LDR R0, [R4, #0x10] \n"
64 " MOV R1, SP \n"
65 " BL sub_FF8272DC \n"
66 " LDR R0, [SP] \n"
67 " CMP R0, #0 \n"
68 " BEQ loc_FFA1E65C \n"
69 " LDR R0, [R4, #0x10] \n"
70 " MOV R2, #0 \n"
71 " ADD R1, SP, #4 \n"
72 " BL sub_FF827098 \n"
73 " B loc_FFA1E630 \n"
74 "loc_FFA1E65C:\n"
75 " LDR R0, [R4] \n"
76 " CMN R0, #1 \n"
77 " BEQ loc_FFA1E680 \n"
78
79 " BL fwt_close\n"
80 " MVN R0, #0 \n"
81 " STR R0, [R4] \n"
82 " LDR R0, =0xB1CF4 \n"
83 " BL sub_FF8555B0 \n"
84 " BL sub_FF853C58 \n"
85 "loc_FFA1E680:\n"
86 " LDR R0, [R4, #0xC] \n"
87 " BL sub_FF827584 \n"
88 " B loc_FFA1E5C8 \n"
89 "loc_FFA1E68C:\n"
90 " BL sub_FFA1E860_my \n"
91 " B loc_FFA1E5C8 \n"
92 "loc_FFA1E694:\n"
93 " BL sub_FFA1E99C_my \n"
94 " B loc_FFA1E5C8 \n"
95 "loc_FFA1E69C:\n"
96 " BL sub_FFA1EA98_my \n"
97 " B loc_FFA1E5C8 \n"
98 ".ltorg\n"
99 );
100 }
101
102
103 void __attribute__((naked,noinline)) sub_FFA1E860_my( ) {
104 asm volatile (
105 " STMFD SP!, {R4-R8,LR} \n"
106 " MOV R4, R0 \n"
107 " ADD R0, R0, #0x2C \n"
108 " SUB SP, SP, #0x38 \n"
109 " BL sub_FF8555B0 \n"
110 " MOV R1, #0 \n"
111 " BL sub_FF853C08 \n"
112 " LDR R0, [R4, #0xC] \n"
113 " BL sub_FF851F18 \n"
114 " LDR R7, [R4, #8] \n"
115 " LDR R8, =0x1B6 \n"
116 " ADD R6, R4, #0x2C \n"
117 " LDR R5, [R4, #0xC] \n"
118
119 "STMFD SP!, {R4-R12,LR}\n"
120 "MOV R0, R4\n"
121 "BL filewrite_main_hook\n"
122 "LDMFD SP!, {R4-R12,LR}\n"
123
124 " MOV R0, R6 \n"
125 " MOV R1, R7 \n"
126 " MOV R2, R8 \n"
127
128 " BL fwt_open\n"
129 "LDR PC, =0xFFA1E8A4\n"
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180 );
181 }
182
183
184 void __attribute__((naked,noinline)) sub_FFA1E99C_my( ) {
185 asm volatile (
186 " STMFD SP!, {R4-R10,LR} \n"
187 " MOV R4, R0 \n"
188 " LDR R0, [R0] \n"
189 " CMP R0, #4 \n"
190 " LDREQ R6, [R4, #0x18] \n"
191 " LDREQ R7, [R4, #0x14] \n"
192 " BEQ loc_FFA1E9D8 \n"
193 " CMP R0, #5 \n"
194 " LDREQ R6, [R4, #0x20] \n"
195 " LDREQ R7, [R4, #0x1C] \n"
196 " BEQ loc_FFA1E9D8 \n"
197 " CMP R0, #6 \n"
198 " BNE loc_FFA1E9EC \n"
199 " LDR R6, [R4, #0x28] \n"
200 " LDR R7, [R4, #0x24] \n"
201 "loc_FFA1E9D8:\n"
202 " CMP R6, #0 \n"
203 " BNE loc_FFA1E9FC \n"
204 "loc_FFA1E9E0:\n"
205 " MOV R1, R4 \n"
206 " MOV R0, #7 \n"
207 " B loc_FFA1EA90 \n"
208 "loc_FFA1E9EC:\n"
209 " LDR R1, =0x205 \n"
210 " LDR R0, =0xFFA1E97C \n"
211 " BL sub_FF81B1CC \n"
212 " B loc_FFA1E9E0 \n"
213 "loc_FFA1E9FC:\n"
214 " LDR R9, =0xBF3C \n"
215 " MOV R5, R6 \n"
216 "loc_FFA1EA04:\n"
217 " LDR R0, [R4, #4] \n"
218 " CMP R5, #0x1000000 \n"
219 " MOVLS R8, R5 \n"
220 " MOVHI R8, #0x1000000 \n"
221 " BIC R1, R0, #0xFF000000 \n"
222 " CMP R1, #0 \n"
223 " BICNE R0, R0, #0xFF000000 \n"
224 " RSBNE R0, R0, #0x1000000 \n"
225 " CMPNE R8, R0 \n"
226 " MOVHI R8, R0 \n"
227 " LDR R0, [R9] \n"
228 " MOV R2, R8 \n"
229 " MOV R1, R7 \n"
230
231 " BL fwt_write\n"
232 " LDR R1, [R4, #4] \n"
233 " CMP R8, R0 \n"
234 " ADD R1, R1, R0 \n"
235 " STR R1, [R4, #4] \n"
236 " BEQ loc_FFA1EA64 \n"
237 " LDR R0, =0x10B1 \n"
238 " BL sub_FF878BA8 \n"
239 " LDR R1, =0x9200005 \n"
240 " STR R1, [R4, #0x10] \n"
241 " B loc_FFA1E9E0 \n"
242 "loc_FFA1EA64:\n"
243 " SUB R5, R5, R0 \n"
244 " CMP R5, R6 \n"
245 " ADD R7, R7, R0 \n"
246 " LDRCS R0, =0xFFA1E97C \n"
247 " MOVCS R1, #0x234 \n"
248 " BLCS sub_FF81B1CC \n"
249 " CMP R5, #0 \n"
250 " BNE loc_FFA1EA04 \n"
251 " LDR R0, [R4] \n"
252 " MOV R1, R4 \n"
253 " ADD R0, R0, #1 \n"
254 "loc_FFA1EA90:\n"
255 " LDMFD SP!, {R4-R10,LR} \n"
256 " B sub_FFA1E518 \n"
257 );
258 }
259
260
261 void __attribute__((naked,noinline)) sub_FFA1EA98_my( ) {
262 asm volatile (
263 " STMFD SP!, {R4,R5,LR} \n"
264 " LDR R5, =0xBF3C \n"
265 " MOV R4, R0 \n"
266 " LDR R0, [R5] \n"
267 " SUB SP, SP, #0x1C \n"
268 " CMN R0, #1 \n"
269 " BEQ loc_FFA1EACC \n"
270
271 " BL fwt_close\n"
272 " CMP R0, #0 \n"
273 " LDRNE R0, =0x9200003 \n"
274 " STRNE R0, [R4, #0x10] \n"
275 " MVN R0, #0 \n"
276 " STR R0, [R5] \n"
277 "loc_FFA1EACC:\n"
278 "LDR PC, =0xFFA1EACC\n"
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307 );
308 }
309