This source file includes following definitions.
- filewritetask
- sub_FFC5236C_my
- sub_FFC5221C_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;
20 cam_ptp_data_chunk pdc[MAX_CHUNKS_FOR_FWT];
21 char name[32];
22 } fwt_data_struct;
23 #define CAM_HAS_COMPLETEFILEWRITE_REPLACEMENT 1
24
25 #include "../../../generic/filewrite.c"
26
27
28
29 void __attribute__((naked,noinline)) filewritetask( ) {
30 asm volatile (
31 " STMFD SP!, {R4,LR} \n"
32 " LDR R4, =0x1D47C \n"
33 " SUB SP, SP, #4 \n"
34 " B loc_FFC52458 \n"
35 "loc_FFC52434:\n"
36 " TST R3, #4 \n"
37 " BEQ loc_FFC52454 \n"
38 " LDR R0, [R4] \n"
39 " BL sub_FFC10974 \n"
40 " LDR R0, [R4] \n"
41 " MOV R1, #8 \n"
42 " BL sub_FFC107D8 \n"
43 " B loc_FFC52458 \n"
44 "loc_FFC52454:\n"
45 " BL sub_FFC5236C_my \n"
46 "loc_FFC52458:\n"
47 " MOV R1, #7 \n"
48 " LDR R0, [R4] \n"
49 " MOV R2, #0 \n"
50 " BL sub_FFC107B8 \n"
51 " CMP R0, #0 \n"
52 " MOV R1, SP \n"
53 " BEQ loc_FFC52488 \n"
54 " MOV R1, #0x268 \n"
55 " LDR R0, =0xFFC522C4 \n"
56 " ADD R1, R1, #3 \n"
57 " BL sub_FFC03B58 \n"
58 " B loc_FFC524A0 \n"
59 "loc_FFC52488:\n"
60 " LDR R0, [R4] \n"
61 " BL sub_FFC109C4 \n"
62 " LDR R3, [SP] \n"
63 " TST R3, #2 \n"
64 " MOV R1, #5 \n"
65 " BEQ loc_FFC52434 \n"
66 "loc_FFC524A0:\n"
67 " LDR R3, =0x1D480 \n"
68 " LDR R0, [R3] \n"
69 " BL sub_FFC11D68 \n"
70 " BL sub_FFC12724 \n"
71 " ADD SP, SP, #4 \n"
72 " LDMFD SP!, {R4,PC} \n"
73 " MOV PC, LR \n"
74 );
75 }
76
77 void __attribute__((naked,noinline)) sub_FFC5236C_my( ) {
78 asm volatile (
79 "loc_FFC5236C:\n"
80 " STMFD SP!, {R4,R5,LR} \n"
81 " LDR R2, =0x1D460 \n"
82 " LDRH R3, [R2] \n"
83 " SUB R3, R3, #1 \n"
84 " CMP R3, #3 \n"
85 " LDRLS PC, [PC, R3, LSL #2] \n"
86 " B loc_FFC523B8 \n"
87 " .long loc_FFC52398\n"
88 " .long loc_FFC523A8\n"
89 " .long loc_FFC523A8\n"
90 " .long loc_FFC523A8\n"
91 "loc_FFC52398:\n"
92 " LDR R0, =0x1D420 \n"
93 " BL sub_FFC5221C_my \n"
94 " MOV R4, R0 \n"
95 " B loc_FFC523BC \n"
96 "loc_FFC523A8:\n"
97 " LDR R0, =0x1D420 \n"
98 " BL sub_FFC522D0 \n"
99 " MOV R4, R0 \n"
100 " B loc_FFC523BC \n"
101 "loc_FFC523B8:\n"
102 " MOV R4, #1 \n"
103 "loc_FFC523BC:\n"
104 " CMP R4, #0 \n"
105 " MOV R1, #1 \n"
106 " LDMEQFD SP!, {R4,R5,PC} \n"
107 " LDR R3, =0x1D47C \n"
108 " LDR R0, [R3] \n"
109 " BL sub_FFC10974 \n"
110 " LDR R3, =0x1D488 \n"
111 " LDR R5, [R3] \n"
112 " LDR R1, =0x1D484 \n"
113 " LDR R12, =0x24E0 \n"
114 " MOV R3, #1 \n"
115 " MOV R2, #0 \n"
116 " CMP R5, #0 \n"
117 " STR R3, [R1] \n"
118 " MOV R0, R4 \n"
119 " STR R2, [R12] \n"
120 " LDMEQFD SP!, {R4,R5,PC} \n"
121 " MOV LR, PC \n"
122 " MOV PC, R5 \n"
123 " BL fwt_after_close\n"
124 " LDMFD SP!, {R4,R5,PC} \n"
125 );
126 }
127
128 void __attribute__((naked,noinline)) sub_FFC5221C_my( ) {
129 asm volatile (
130 "loc_FFC5221C:\n"
131 " STMFD SP!, {R4-R6,LR} \n"
132 " MOV R4, R0 \n"
133 " ADD R5, R4, #0x1C \n"
134 " MOV R0, R5 \n"
135 " BL sub_FFC51EF4 \n"
136 " LDR R0, [R4, #0x3C] \n"
137 " BL sub_FFC5B244 \n"
138 " LDR R3, [R4] \n"
139 " MOV R1, #0x600 \n"
140 " TST R3, #0x10000 \n"
141 " ADD R1, R1, #1 \n"
142 " MOV R2, #0x1B4 \n"
143 " ORRNE R1, R1, #0x8000 \n"
144 " LDR R3, [R4, #0x3C] \n"
145 " ADD R2, R2, #2 \n"
146
147
148
149
150
151 "STMFD SP!, {R1-R12,LR}\n"
152 "MOV R0, R4\n"
153 "BL filewrite_main_hook\n"
154 "BL filewrite_file_complete\n"
155 "CMP R0, #0\n"
156 "LDRNE R0, =loc_mynull\n"
157 "LDMFD SP!, {R1-R12,LR}\n"
158 "MOVEQ R0, R5\n"
159
160
161 " BL sub_FFC51FF8 \n"
162 " MOV R1, R4 \n"
163 " MOV R2, R0 \n"
164 " MOV R4, #0 \n"
165 " LDR R3, =0x1D464 \n"
166 " CMP R2, R4 \n"
167 " LDR R6, =0x1D460 \n"
168 " MOV R0, R5 \n"
169 " STR R2, [R3] \n"
170 " BGT loc_FFC5229C \n"
171 " BL sub_FFC51F08 \n"
172 " MOV R0, #0x8000001 \n"
173 " ADD R0, R0, #0x1200000 \n"
174 " BL sub_FFC4FA70 \n"
175 " MOV R0, #2 \n"
176 " LDMFD SP!, {R4-R6,PC} \n"
177 "loc_FFC5229C:\n"
178 " LDR R3, =0x1D468 \n"
179 " LDRH R0, [R6] \n"
180 " STR R4, [R3] \n"
181 " BL sub_FFC5216C \n"
182 " STRH R0, [R6] \n"
183 " MOV R0, R4 \n"
184 " LDMFD SP!, {R4-R6,PC} \n"
185
186 "loc_mynull:\n"
187 ".long 0x6c756e2f\n"
188 ".long 0x0000006c\n"
189
190 );
191 }