This source file includes following definitions.
- filewritetask
- sub_FFAE0DC8_my
- sub_FFAE0F08_my
- sub_FFAE097C_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
13 #define MAX_CHUNKS_FOR_FWT 7
14
15
16
17
18
19
20 typedef struct
21 {
22 int unkn1[5];
23 cam_ptp_data_chunk pdc[MAX_CHUNKS_FOR_FWT];
24 int unkn2;
25 char name[32];
26
27 } fwt_data_struct;
28
29 #include "../../../generic/filewrite.c"
30
31
32
33 void __attribute__((naked,noinline)) filewritetask() {
34 asm volatile (
35 " STMFD SP!, {R1-R5,LR} \n"
36 " LDR R4, =0xC0C4 \n"
37
38 "loc_FFAE0AF8:\n"
39 " LDR R0, [R4, #0x10] \n"
40 " MOV R2, #0 \n"
41 " ADD R1, SP, #8 \n"
42 " BL sub_FF83A460 /*_ReceiveMessageQueue*/ \n"
43 " CMP R0, #0 \n"
44 " LDRNE R1, =0x33F \n"
45 " LDRNE R0, =0xFFAE0BE0 /*'dwFWrite.c'*/ \n"
46 " BLNE _DebugAssert \n"
47 " LDR R0, [SP, #8] \n"
48 " LDR R1, [R0] \n"
49 " CMP R1, #9 \n"
50 " ADDLS PC, PC, R1, LSL#2 \n"
51 " B loc_FFAE0AF8 \n"
52 " B loc_FFAE0BC0 \n"
53 " B loc_FFAE0BC0 \n"
54 " B loc_FFAE0BC0 \n"
55 " B loc_FFAE0BC0 \n"
56 " B loc_FFAE0BC0 \n"
57 " B loc_FFAE0BC0 \n"
58 " B loc_FFAE0BC0 \n"
59 " B loc_FFAE0BC8 \n"
60 " B loc_FFAE0B54 \n"
61 " B loc_FFAE0BB8 \n"
62
63 "loc_FFAE0B54:\n"
64 " MOV R0, #0 \n"
65 " STR R0, [SP] \n"
66
67 "loc_FFAE0B5C:\n"
68 " LDR R0, [R4, #0x10] \n"
69 " MOV R1, SP \n"
70 " BL sub_FF83A6A4 /*_GetNumberOfPostedMessages*/ \n"
71 " LDR R0, [SP] \n"
72 " CMP R0, #0 \n"
73 " BEQ loc_FFAE0B88 \n"
74 " LDR R0, [R4, #0x10] \n"
75 " MOV R2, #0 \n"
76 " ADD R1, SP, #4 \n"
77 " BL sub_FF83A460 /*_ReceiveMessageQueue*/ \n"
78 " B loc_FFAE0B5C \n"
79
80 "loc_FFAE0B88:\n"
81 " LDR R0, [R4, #4] \n"
82 " CMN R0, #1 \n"
83 " BEQ loc_FFAE0BAC \n"
84 " BL fwt_close \n"
85 " MVN R0, #0 \n"
86 " STR R0, [R4, #4] \n"
87 " LDR R0, =0xFE668 \n"
88 " BL sub_FF876B34 \n"
89 " BL sub_FF874D90 \n"
90
91 "loc_FFAE0BAC:\n"
92 " LDR R0, [R4, #0xC] \n"
93 " BL _GiveSemaphore \n"
94 " B loc_FFAE0AF8 \n"
95
96 "loc_FFAE0BB8:\n"
97 " BL sub_FFAE0DC8_my \n"
98 " B loc_FFAE0AF8 \n"
99
100 "loc_FFAE0BC0:\n"
101 " BL sub_FFAE0F08_my \n"
102 " B loc_FFAE0AF8 \n"
103
104 "loc_FFAE0BC8:\n"
105 " BL sub_FFAE097C_my \n"
106 " B loc_FFAE0AF8 \n"
107 );
108 }
109
110
111
112 void __attribute__((naked,noinline)) sub_FFAE0DC8_my() {
113 asm volatile (
114 " STMFD SP!, {R4-R8,LR} \n"
115 " MOV R4, R0 \n"
116 " ADD R0, R0, #0x50 \n"
117 " SUB SP, SP, #0x38 \n"
118 " BL sub_FF876B34 \n"
119 " MOV R1, #0 \n"
120 " BL sub_FF874D28 \n"
121 " LDR R0, [R4, #0xC] \n"
122 " BL sub_FF810338 \n"
123 " LDR R0, [R4, #0x4C] \n"
124 " LDR R8, =0x1B6 \n"
125 " CMP R0, #1 \n"
126 " LDREQ R0, [R4, #8] \n"
127 " ADD R6, R4, #0x50 \n"
128 " ORREQ R0, R0, #0x8000 \n"
129 " STREQ R0, [R4, #8] \n"
130 " LDR R7, [R4, #8] \n"
131 " LDR R5, [R4, #0xC] \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 " MOV R0, R6 \n"
139 " MOV R2, R8 \n"
140 " MOV R1, R7 \n"
141 " BL fwt_open \n"
142 " CMN R0, #1 \n"
143 " BNE sub_FFAE0E80 \n"
144 " MOV R0, R6 \n"
145 " BL sub_FF837474 \n"
146 " MOV R2, #0xF \n"
147 " MOV R1, R6 \n"
148 " MOV R0, SP \n"
149 " BL sub_FFBB3268 \n"
150 " LDR R0, =0x41FF \n"
151 " MOV R1, #0 \n"
152 " STRB R1, [SP, #0xF] \n"
153 " STR R0, [SP, #0x20] \n"
154 " MOV R0, #0x10 \n"
155 " ADD R2, SP, #0x24 \n"
156 " STMIA R2, {R0,R1,R5} \n"
157 " ADD R1, SP, #0x20 \n"
158 " MOV R0, SP \n"
159 " STR R5, [SP, #0x30] \n"
160 " STR R5, [SP, #0x34] \n"
161 " BL sub_FF874698 \n"
162 " MOV R2, R8 \n"
163 " MOV R1, R7 \n"
164 " MOV R0, R6 \n"
165 " BL fwt_open \n"
166 " LDR PC, =0xFFAE0E80 \n"
167 );
168 }
169
170
171
172 void __attribute__((naked,noinline)) sub_FFAE0F08_my() {
173 asm volatile (
174 " STMFD SP!, {R4-R10,LR} \n"
175 " MOV R5, R0 \n"
176 " LDR R0, [R0] \n"
177 " CMP R0, #6 \n"
178 " BHI loc_FFAE0F3C \n"
179 " ADD R0, R5, R0, LSL#3 \n"
180 " LDR R7, [R0, #0x14]! \n"
181 " LDR R6, [R0, #4] \n"
182 " CMP R6, #0 \n"
183 " BNE loc_FFAE0F4C \n"
184
185 "loc_FFAE0F30:\n"
186 " MOV R1, R5 \n"
187 " MOV R0, #7 \n"
188 " B sub_FFAE0FE0 \n"
189
190 "loc_FFAE0F3C:\n"
191 " LDR R1, =0x299 \n"
192 " LDR R0, =0xFFAE0BE0 /*'dwFWrite.c'*/ \n"
193 " BL _DebugAssert \n"
194 " B loc_FFAE0F30 \n"
195
196 "loc_FFAE0F4C:\n"
197 " LDR R9, =0xC0C4 \n"
198 " MOV R4, R6 \n"
199
200 "loc_FFAE0F54:\n"
201 " LDR R0, [R5, #4] \n"
202 " CMP R4, #0x1000000 \n"
203 " MOVLS R8, R4 \n"
204 " MOVHI R8, #0x1000000 \n"
205 " BIC R1, R0, #0xFF000000 \n"
206 " CMP R1, #0 \n"
207 " BICNE R0, R0, #0xFF000000 \n"
208 " RSBNE R0, R0, #0x1000000 \n"
209 " CMPNE R8, R0 \n"
210 " MOVHI R8, R0 \n"
211 " LDR R0, [R9, #4] \n"
212 " MOV R2, R8 \n"
213 " MOV R1, R7 \n"
214 " BL fwt_write \n"
215 " LDR R1, [R5, #4] \n"
216 " CMP R8, R0 \n"
217 " ADD R1, R1, R0 \n"
218 " STR R1, [R5, #4] \n"
219 " BEQ loc_FFAE0FB4 \n"
220 " CMN R0, #1 \n"
221 " LDRNE R0, =0x9200015 \n"
222 " LDREQ R0, =0x9200005 \n"
223 " STR R0, [R5, #0x10] \n"
224 " B loc_FFAE0F30 \n"
225
226 "loc_FFAE0FB4:\n"
227 " SUB R4, R4, R0 \n"
228 " CMP R4, R6 \n"
229 " ADD R7, R7, R0 \n"
230 " LDRCS R0, =0xFFAE0BE0 /*'dwFWrite.c'*/ \n"
231 " MOVCS R1, #0x2C4 \n"
232 " BLCS _DebugAssert \n"
233 " CMP R4, #0 \n"
234 " BNE loc_FFAE0F54 \n"
235 " LDR PC, =0xFFAE0FD4 \n"
236 );
237 }
238
239
240
241 void __attribute__((naked,noinline)) sub_FFAE097C_my() {
242 asm volatile (
243 " STMFD SP!, {R4-R6,LR} \n"
244 " LDR R5, =0xC0C4 \n"
245 " MOV R4, R0 \n"
246 " LDR R0, [R5, #4] \n"
247 " SUB SP, SP, #0x38 \n"
248 " CMN R0, #1 \n"
249 " BEQ sub_FFAE09C4 \n"
250 " LDR R1, [R4, #8] \n"
251 " LDR R6, =0x9200003 \n"
252 " TST R1, #0x8000 \n"
253 " BEQ loc_FFAE09B0 \n"
254
255 " LDR R3, =current_write_ignored\n"
256 " LDR R3, [R3]\n"
257 " CMP R3, #0\n"
258 " BNE loc_D\n"
259
260 " BL sub_FF873DD4 \n"
261 " B sub_FFAE09B4 \n"
262
263 "loc_FFAE09B0:\n"
264 "loc_D:\n"
265 " BL fwt_close \n"
266 " LDR PC, =0xFFAE09B4 \n"
267 );
268 }