This source file includes following definitions.
- filewritetask
- sub_FF8666C0_my
- sub_FF86656C_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 3
13
14
15
16
17
18
19
20 typedef struct
21 {
22 int unkn1;
23 cam_ptp_data_chunk pdc[MAX_CHUNKS_FOR_FWT];
24 char name[32];
25 } fwt_data_struct;
26 #define CAM_HAS_COMPLETEFILEWRITE_REPLACEMENT 1
27
28 #include "../../../generic/filewrite.c"
29
30
31
32 void __attribute__((naked,noinline)) filewritetask() {
33 asm volatile (
34 " STMFD SP!, {R4,LR} \n"
35 " LDR R4, =0x1CB44 \n"
36 " SUB SP, SP, #4 \n"
37 " B loc_FF8667AC \n"
38
39 "loc_FF866788:\n"
40 " TST R3, #4 \n"
41 " BEQ loc_FF8667A8 \n"
42 " LDR R0, [R4] \n"
43 " BL sub_FF81FDEC /*_ClearEventFlag*/ \n"
44 " LDR R0, [R4] \n"
45 " MOV R1, #8 \n"
46 " BL sub_FF81FC50 /*_SetEventFlag*/ \n"
47 " B loc_FF8667AC \n"
48
49 "loc_FF8667A8:\n"
50 " BL sub_FF8666C0_my \n"
51
52 "loc_FF8667AC:\n"
53 " MOV R1, #7 \n"
54 " LDR R0, [R4] \n"
55 " MOV R2, #0 \n"
56 " BL sub_FF81FC30 /*_WaitForAnyEventFlag*/ \n"
57 " CMP R0, #0 \n"
58 " MOV R1, SP \n"
59 " BEQ loc_FF8667D8 \n"
60 " LDR R0, =0xFF866614 /*'dwFWrite.c'*/ \n"
61 " MOV R1, #0x274 \n"
62 " BL _DebugAssert \n"
63 " B loc_FF8667F0 \n"
64
65 "loc_FF8667D8:\n"
66 " LDR R0, [R4] \n"
67 " BL sub_FF81FE3C /*_GetEventFlagValue*/ \n"
68 " LDR R3, [SP] \n"
69 " TST R3, #2 \n"
70 " MOV R1, #5 \n"
71 " BEQ loc_FF866788 \n"
72
73 "loc_FF8667F0:\n"
74 " LDR R3, =0x1CB48 \n"
75 " LDR R0, [R3] \n"
76 " BL _GiveSemaphore \n"
77 " BL _ExitTask \n"
78 " ADD SP, SP, #4 \n"
79 " LDMFD SP!, {R4,PC} \n"
80 );
81 }
82
83
84
85 void __attribute__((naked,noinline)) sub_FF8666C0_my() {
86 asm volatile (
87 " STMFD SP!, {R4,R5,LR} \n"
88 " LDR R2, =0x1CB28 \n"
89 " LDRH R3, [R2] \n"
90 " SUB R3, R3, #1 \n"
91 " CMP R3, #3 \n"
92 " LDRLS PC, [PC, R3, LSL#2] \n"
93 " B loc_FF86670C \n"
94 " .long loc_FF8666EC \n"
95 " .long loc_FF8666FC \n"
96 " .long loc_FF8666FC \n"
97 " .long loc_FF8666FC \n"
98
99 "loc_FF8666EC:\n"
100 " LDR R0, =0x1CAE8 \n"
101 " BL sub_FF86656C_my \n"
102 " MOV R4, R0 \n"
103 " B loc_FF866710 \n"
104
105 "loc_FF8666FC:\n"
106 " LDR R0, =0x1CAE8 \n"
107 " BL sub_FF866620 \n"
108 " MOV R4, R0 \n"
109 " B loc_FF866710 \n"
110
111 "loc_FF86670C:\n"
112 " MOV R4, #1 \n"
113
114 "loc_FF866710:\n"
115 " CMP R4, #0 \n"
116 " MOV R1, #1 \n"
117 " LDMEQFD SP!, {R4,R5,PC} \n"
118 " LDR R3, =0x1CB44 \n"
119 " LDR R0, [R3] \n"
120 " BL sub_FF81FDEC /*_ClearEventFlag*/ \n"
121 " LDR R3, =0x1CB50 \n"
122 " LDR R5, [R3] \n"
123 " LDR R1, =0x1CB4C \n"
124 " LDR R12, =0x27EC \n"
125 " MOV R3, #1 \n"
126 " MOV R2, #0 \n"
127 " CMP R5, #0 \n"
128 " STR R3, [R1] \n"
129 " MOV R0, R4 \n"
130 " STR R2, [R12] \n"
131 " LDMEQFD SP!, {R4,R5,PC} \n"
132 " MOV LR, PC \n"
133 " MOV PC, R5 \n"
134 " BL fwt_after_close\n"
135 " LDMFD SP!, {R4,R5,PC} \n"
136 );
137 }
138
139
140
141 void __attribute__((naked,noinline)) sub_FF86656C_my() {
142 asm volatile (
143 " STMFD SP!, {R4-R6,LR} \n"
144 " MOV R4, R0 \n"
145 " ADD R5, R4, #0x1C \n"
146 " MOV R0, R5 \n"
147 " BL sub_FF866244 \n"
148 " LDR R0, [R4, #0x3C] \n"
149 " BL sub_FF86EF8C \n"
150 " LDR R3, [R4] \n"
151 " MOV R1, #0x600 \n"
152 " TST R3, #0x10000 \n"
153 " ADD R1, R1, #1 \n"
154 " MOV R2, #0x1B4 \n"
155 " ORRNE R1, R1, #0x8000 \n"
156 " LDR R3, [R4, #0x3C] \n"
157 " ADD R2, R2, #2 \n"
158
159
160
161
162
163 " STMFD SP!, {R1-R12,LR}\n"
164 " MOV R0, R4\n"
165 " BL filewrite_main_hook\n"
166 " BL filewrite_file_complete\n"
167 " CMP R0, #0\n"
168 " LDRNE R0, =loc_mynull\n"
169 " LDMFD SP!, {R1-R12,LR}\n"
170 " MOVEQ R0, R5\n"
171
172
173 " BL sub_FF866348 \n"
174 " MOV R1, R4 \n"
175 " MOV R2, R0 \n"
176 " MOV R4, #0 \n"
177 " LDR R3, =0x1CB2C \n"
178 " CMP R2, R4 \n"
179 " LDR R6, =0x1CB28 \n"
180 " MOV R0, R5 \n"
181 " STR R2, [R3] \n"
182 " BGT loc_FF8665EC \n"
183 " BL sub_FF866258 \n"
184 " MOV R0, #0x8000001 \n"
185 " ADD R0, R0, #0x1200000 \n"
186 " BL sub_FF863DBC \n"
187 " MOV R0, #2 \n"
188 " LDMFD SP!, {R4-R6,PC} \n"
189
190 "loc_FF8665EC:\n"
191 " LDR R3, =0x1CB30 \n"
192 " LDRH R0, [R6] \n"
193 " STR R4, [R3] \n"
194 " BL sub_FF8664BC \n"
195 " STRH R0, [R6] \n"
196 " MOV R0, R4 \n"
197 " LDMFD SP!, {R4-R6,PC} \n"
198
199 "loc_mynull:\n"
200 ".asciz \"/null\" \n"
201
202 );
203 }