This source file includes following definitions.
- filewritetask
- sub_FF34A648_my
- sub_FF34A7E8_my
- sub_FF34A708_my
- sub_FF34A1F8_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, =0xFEA4 \n"
35
36 "loc_FF34A36C:\n"
37 " MOV R2, #0 \n"
38 " LDR R0, [R5, #0x10] \n"
39 " ADD R1, SP, #8 \n"
40 " BL sub_FF029EA8 /*_ReceiveMessageQueue*/ \n"
41 " CMP R0, #0 \n"
42 " LDRNE R1, =0x35B \n"
43 " LDRNE R0, =0xFF34A45C /*'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_FF34A36C \n"
50 " B loc_FF34A43C \n"
51 " B loc_FF34A43C \n"
52 " B loc_FF34A43C \n"
53 " B loc_FF34A43C \n"
54 " B loc_FF34A43C \n"
55 " B loc_FF34A43C \n"
56 " B loc_FF34A43C \n"
57 " B loc_FF34A444 \n"
58 " B loc_FF34A3C8 \n"
59 " B loc_FF34A434 \n"
60
61 "loc_FF34A3C8:\n"
62 " MOV R0, #0 \n"
63 " MOV R4, R5 \n"
64 " STR R0, [SP] \n"
65
66 "loc_FF34A3D4:\n"
67 " LDR R0, [R4, #0x10] \n"
68 " MOV R1, SP \n"
69 " BL sub_FF02A0EC /*_GetNumberOfPostedMessages*/ \n"
70 " LDR R0, [SP] \n"
71 " CMP R0, #0 \n"
72 " BEQ loc_FF34A400 \n"
73 " LDR R0, [R4, #0x10] \n"
74 " MOV R2, #0 \n"
75 " ADD R1, SP, #4 \n"
76 " BL sub_FF029EA8 /*_ReceiveMessageQueue*/ \n"
77 " B loc_FF34A3D4 \n"
78
79 "loc_FF34A400:\n"
80 " LDR R0, [R4, #4] \n"
81 " CMN R0, #1 \n"
82 " BEQ loc_FF34A428 \n"
83 " BL fwt_close \n"
84 " MVN R0, #0 \n"
85 " STR R0, [R4, #4] \n"
86 " LDR R0, =0x162874 \n"
87 " BL sub_FF06CD84 \n"
88 " MOV R1, #0 \n"
89 " BL sub_FF06B000 \n"
90
91 "loc_FF34A428:\n"
92 " LDR R0, [R4, #0xC] \n"
93 " BL _GiveSemaphore \n"
94 " B loc_FF34A36C \n"
95
96 "loc_FF34A434:\n"
97 " BL sub_FF34A648_my \n"
98 " B loc_FF34A36C \n"
99
100 "loc_FF34A43C:\n"
101 " BL sub_FF34A708_my \n"
102 " B loc_FF34A36C \n"
103
104 "loc_FF34A444:\n"
105 " BL sub_FF34A1F8_my \n"
106 " B loc_FF34A36C \n"
107 );
108 }
109
110
111
112 void __attribute__((naked,noinline)) sub_FF34A648_my() {
113 asm volatile (
114 " STMFD SP!, {R4-R6,LR} \n"
115 " MOV R4, R0 \n"
116 " ADD R0, R0, #0x50 \n"
117 " BL sub_FF06CD84 \n"
118 " MOV R1, #0 \n"
119 " BL sub_FF06AEC4 \n"
120 " LDR R0, [R4, #0xC] \n"
121 " BL sub_FF000348 \n"
122 " LDR R0, [R4, #0x4C] \n"
123 " LDR R2, =0x1B6 \n"
124 " CMP R0, #1 \n"
125 " LDREQ R0, [R4, #8] \n"
126 " ORREQ R0, R0, #0x8000 \n"
127 " STREQ R0, [R4, #8] \n"
128
129 " STMFD SP!, {R2-R12,LR} \n"
130 " MOV R0, R4 \n"
131 " BL filewrite_main_hook \n"
132 " LDMFD SP!, {R2-R12,LR} \n"
133
134 " LDR R1, [R4, #8] \n"
135 " LDR R3, [R4, #0xC] \n"
136 " ADD R0, R4, #0x50 \n"
137 " BL sub_FF34A7E8_my \n"
138 " LDR PC, =0xFF34A690 \n"
139 );
140 }
141
142
143
144 void __attribute__((naked,noinline)) sub_FF34A7E8_my() {
145 asm volatile (
146 " STMFD SP!, {R4-R10,LR} \n"
147 " SUB SP, SP, #0x38 \n"
148 " MOV R7, R0 \n"
149 " MOV R8, R1 \n"
150 " MOV R9, R2 \n"
151 " MOV R5, R3 \n"
152 " BL sub_FF205A78 /*_PTM_GetWorkingCaptureMode_FW*/ \n"
153 " AND R0, R0, #0x7F \n"
154 " CMP R0, #8 \n"
155 " CMPNE R0, #0x22 \n"
156 " MOV R6, #0 \n"
157 " MOVEQ R4, #1 \n"
158 " MOVNE R4, R6 \n"
159 " CMP R4, #1 \n"
160 " BLEQ sub_FF1D0BAC \n"
161 " MOV R2, R9 \n"
162 " MOV R1, R8 \n"
163 " MOV R0, R7 \n"
164 " BL fwt_open \n"
165 " CMP R4, #1 \n"
166 " MOV R10, R0 \n"
167 " BLEQ sub_FF1D0BFC \n"
168 " CMN R10, #1 \n"
169 " MOVNE R0, R10 \n"
170 " BNE loc_FF34A8BC \n"
171 " CMP R4, #1 \n"
172 " BLEQ sub_FF1D0BAC \n"
173 " MOV R0, R7 \n"
174 " BL sub_FF026AE4 \n"
175 " MOV R2, #0xF \n"
176 " MOV R1, R7 \n"
177 " MOV R0, SP \n"
178 " BL sub_FF45F020 \n"
179 " LDR R0, =0x41FF \n"
180 " STRB R6, [SP, #0xF] \n"
181 " STR R0, [SP, #0x20] \n"
182 " MOV R0, #0x10 \n"
183 " STR R0, [SP, #0x24] \n"
184 " ADD R1, SP, #0x20 \n"
185 " MOV R0, SP \n"
186 " STR R6, [SP, #0x28] \n"
187 " STR R5, [SP, #0x2C] \n"
188 " STR R5, [SP, #0x30] \n"
189 " STR R5, [SP, #0x34] \n"
190 " BL sub_FF06A838 \n"
191 " MOV R2, R9 \n"
192 " MOV R1, R8 \n"
193 " MOV R0, R7 \n"
194 " BL fwt_open \n"
195 " CMP R4, #1 \n"
196 " MOV R5, R0 \n"
197 " BLEQ sub_FF1D0BFC \n"
198 " MOV R0, R5 \n"
199
200 "loc_FF34A8BC:\n"
201 " ADD SP, SP, #0x38 \n"
202 " LDMFD SP!, {R4-R10,PC} \n"
203 );
204 }
205
206
207
208 void __attribute__((naked,noinline)) sub_FF34A708_my() {
209 asm volatile (
210 " STMFD SP!, {R4-R10,LR} \n"
211 " MOV R5, R0 \n"
212 " LDR R0, [R0] \n"
213 " CMP R0, #6 \n"
214 " BHI loc_FF34A734 \n"
215 " ADD R0, R5, R0, LSL#3 \n"
216 " LDR R8, [R0, #0x14]! \n"
217 " LDR R7, [R0, #4] \n"
218 " CMP R7, #0 \n"
219 " BNE loc_FF34A74C \n"
220 " B loc_FF34A740 \n"
221
222 "loc_FF34A734:\n"
223 " LDR R1, =0x2BB \n"
224 " LDR R0, =0xFF34A45C /*'dwFWrite.c'*/ \n"
225 " BL _DebugAssert \n"
226
227 "loc_FF34A740:\n"
228 " MOV R1, R5 \n"
229 " MOV R0, #7 \n"
230 " B sub_FF34A7E0 \n"
231
232 "loc_FF34A74C:\n"
233 " LDR R9, =0xFEA4 \n"
234 " MOV R4, R7 \n"
235
236 "loc_FF34A754:\n"
237 " LDR R0, [R5, #4] \n"
238 " CMP R4, #0x1000000 \n"
239 " MOVLS R6, R4 \n"
240 " MOVHI R6, #0x1000000 \n"
241 " BIC R1, R0, #0xFF000000 \n"
242 " CMP R1, #0 \n"
243 " BICNE R0, R0, #0xFF000000 \n"
244 " RSBNE R0, R0, #0x1000000 \n"
245 " CMPNE R6, R0 \n"
246 " MOVHI R6, R0 \n"
247 " LDR R0, [R9, #4] \n"
248 " MOV R2, R6 \n"
249 " MOV R1, R8 \n"
250 " BL fwt_write \n"
251 " LDR R1, [R5, #4] \n"
252 " CMP R6, R0 \n"
253 " ADD R1, R1, R0 \n"
254 " STR R1, [R5, #4] \n"
255 " BEQ loc_FF34A7B4 \n"
256 " CMN R0, #1 \n"
257 " LDRNE R0, =0x9200015 \n"
258 " LDREQ R0, =0x9200005 \n"
259 " STR R0, [R5, #0x10] \n"
260 " B loc_FF34A740 \n"
261
262 "loc_FF34A7B4:\n"
263 " SUB R4, R4, R0 \n"
264 " CMP R4, R7 \n"
265 " LDRCS R1, =0x2E6 \n"
266 " ADD R8, R8, R0 \n"
267 " LDRCS R0, =0xFF34A45C /*'dwFWrite.c'*/ \n"
268 " BLCS _DebugAssert \n"
269 " CMP R4, #0 \n"
270 " BNE loc_FF34A754 \n"
271 " LDR PC, =0xFF34A7D4 \n"
272 );
273 }
274
275
276
277 void __attribute__((naked,noinline)) sub_FF34A1F8_my() {
278 asm volatile (
279 " STMFD SP!, {R4-R6,LR} \n"
280 " LDR R5, =0xFEA4 \n"
281 " MOV R4, R0 \n"
282 " LDR R0, [R5, #4] \n"
283 " SUB SP, SP, #0x38 \n"
284 " CMN R0, #1 \n"
285 " BEQ sub_FF34A240 \n"
286 " LDR R1, [R4, #8] \n"
287 " LDR R6, =0x9200003 \n"
288 " TST R1, #0x8000 \n"
289 " BEQ loc_FF34A22C \n"
290
291 " LDR R3, =current_write_ignored\n"
292 " LDR R3, [R3]\n"
293 " CMP R3, #0\n"
294 " BNE loc_D\n"
295
296 " BL sub_FF026508 \n"
297 " B sub_FF34A230 \n"
298
299 "loc_FF34A22C:\n"
300 "loc_D:\n"
301 " BL fwt_close \n"
302 " LDR PC, =0xFF34A230 \n"
303 );
304 }