This source file includes following definitions.
- change_video_tables
- movie_record_task
- sub_FFC453F0_my
- sub_FFD0761C_my
1
2
3
4 #include "conf.h"
5
6 int *video_quality = &conf.video_quality;
7 int *video_mode = &conf.video_mode;
8
9 long def_table[24]={0x2000, 0x38D, 0x788, 0x5800, 0x9C5, 0x14B8, 0x10000, 0x1C6A, 0x3C45, 0x8000, 0xE35, 0x1E23,
10 0x1CCD, -0x2E1, -0x579, 0x4F33, -0x7EB, -0xF0C, 0xE666, -0x170A, -0x2BC6, 0x7333, -0xB85, -0x15E3};
11
12 long table[24];
13
14 void change_video_tables(int a, int b){
15 int i;
16 for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b;
17 }
18
19 long CompressionRateTable[]={0x60, 0x5D, 0x5A, 0x57, 0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 9, 7, 6, 5, 4, 3, 2, 1};
20
21
22
23 void __attribute__((naked,noinline)) movie_record_task() {
24 asm volatile (
25 " STMFD SP!, {R2-R8,LR} \n"
26 " LDR R8, =0x32B \n"
27 " LDR R7, =0x2710 \n"
28 " LDR R4, =0x51C8 \n"
29 " MOV R6, #0 \n"
30 " MOV R5, #1 \n"
31
32 "loc_FFC4590C:\n"
33 " LDR R0, [R4, #0x18] \n"
34 " MOV R2, #0 \n"
35 " ADD R1, SP, #4 \n"
36 " BL sub_FFC1763C /*_ReceiveMessageQueue*/ \n"
37 " LDR R0, [R4, #0x20] \n"
38 " CMP R0, #0 \n"
39 " BNE loc_FFC459DC \n"
40 " LDR R0, [SP, #4] \n"
41 " LDR R1, [R0] \n"
42 " SUB R1, R1, #2 \n"
43 " CMP R1, #9 \n"
44 " ADDLS PC, PC, R1, LSL#2 \n"
45 " B loc_FFC459DC \n"
46 " B loc_FFC45990 \n"
47 " B loc_FFC459B0 \n"
48 " B loc_FFC459C0 \n"
49 " B loc_FFC459C8 \n"
50 " B loc_FFC45998 \n"
51 " B loc_FFC459D0 \n"
52 " B loc_FFC459A0 \n"
53 " B loc_FFC459DC \n"
54 " B loc_FFC459D8 \n"
55 " B loc_FFC45968 \n"
56
57 "loc_FFC45968:\n"
58 " LDR R0, =0xFFC455F0 \n"
59 " STR R6, [R4, #0x34] \n"
60 " STR R0, [R4, #0xA0] \n"
61 " LDR R0, =0xFFC45068 \n"
62 " LDR R2, =0xFFC44F84 \n"
63 " LDR R1, =0x193E8 \n"
64 " STR R6, [R4, #0x24] \n"
65 " BL sub_FFCA1774 \n"
66 " STR R5, [R4, #0x38] \n"
67 " B loc_FFC459DC \n"
68
69 "loc_FFC45990:\n"
70 " BL unlock_optical_zoom\n"
71 " BL sub_FFC456E8 \n"
72 " B loc_FFC459DC \n"
73
74 "loc_FFC45998:\n"
75 " BL sub_FFC453F0_my \n"
76 " B loc_FFC459DC \n"
77
78 "loc_FFC459A0:\n"
79 " LDR R1, [R0, #0x10] \n"
80 " LDR R0, [R0, #4] \n"
81 " BL sub_FFD09274 \n"
82 " B loc_FFC459DC \n"
83
84 "loc_FFC459B0:\n"
85 " LDR R0, [R4, #0x38] \n"
86 " CMP R0, #5 \n"
87 " STRNE R5, [R4, #0x28] \n"
88 " B loc_FFC459DC \n"
89
90 "loc_FFC459C0:\n"
91 " BL sub_FFC451F8 \n"
92 " B loc_FFC459DC \n"
93
94 "loc_FFC459C8:\n"
95 " BL sub_FFC450B4 \n"
96 " B loc_FFC459DC \n"
97
98 "loc_FFC459D0:\n"
99 " BL sub_FFC44F10 \n"
100 " B loc_FFC459DC \n"
101
102 "loc_FFC459D8:\n"
103 " BL sub_FFC45B44 \n"
104
105 "loc_FFC459DC:\n"
106 " LDR R1, [SP, #4] \n"
107 " LDR R3, =0xFFC44D78 /*'MovieRecorder.c'*/ \n"
108 " STR R6, [R1] \n"
109 " STR R8, [SP] \n"
110 " LDR R0, [R4, #0x1C] \n"
111 " MOV R2, R7 \n"
112 " BL sub_FFC0BCF8 /*_PostMessageQueueStrictly*/ \n"
113 " B loc_FFC4590C \n"
114 );
115 }
116
117
118
119 void __attribute__((naked,noinline)) sub_FFC453F0_my() {
120 asm volatile (
121 " STMFD SP!, {R4-R8,LR} \n"
122 " SUB SP, SP, #0x40 \n"
123 " MOV R6, #0 \n"
124 " LDR R5, =0x51C8 \n"
125 " MOV R4, R0 \n"
126 " STR R6, [SP, #0x30] \n"
127 " STR R6, [SP, #0x28] \n"
128 " LDR R0, [R5, #0x38] \n"
129 " MOV R8, #4 \n"
130 " CMP R0, #3 \n"
131 " STREQ R8, [R5, #0x38] \n"
132 " LDR R0, [R5, #0xA0] \n"
133 " BLX R0 \n"
134 " LDR R0, [R5, #0x38] \n"
135 " CMP R0, #4 \n"
136 " BNE loc_FFC454C8 \n"
137 " ADD R3, SP, #0x28 \n"
138 " ADD R2, SP, #0x2C \n"
139 " ADD R1, SP, #0x30 \n"
140 " ADD R0, SP, #0x34 \n"
141 " BL sub_FFD09408 \n"
142 " CMP R0, #0 \n"
143 " MOV R7, #1 \n"
144 " BNE loc_FFC4546C \n"
145 " LDR R1, [R5, #0x28] \n"
146 " CMP R1, #1 \n"
147 " BNE loc_FFC454D0 \n"
148 " LDR R1, [R5, #0x50] \n"
149 " LDR R2, [R5, #0x3C] \n"
150 " CMP R1, R2 \n"
151 " BCC loc_FFC454D0 \n"
152
153 "loc_FFC4546C:\n"
154 " CMP R0, #0x80000001 \n"
155 " STREQ R8, [R5, #0x54] \n"
156 " BEQ loc_FFC454A4 \n"
157 " CMP R0, #0x80000003 \n"
158 " STREQ R7, [R5, #0x54] \n"
159 " BEQ loc_FFC454A4 \n"
160 " CMP R0, #0x80000005 \n"
161 " MOVEQ R0, #2 \n"
162 " BEQ loc_FFC454A0 \n"
163 " CMP R0, #0x80000007 \n"
164 " STRNE R6, [R5, #0x54] \n"
165 " BNE loc_FFC454A4 \n"
166 " MOV R0, #3 \n"
167
168 "loc_FFC454A0:\n"
169 " STR R0, [R5, #0x54] \n"
170
171 "loc_FFC454A4:\n"
172 " LDR R0, =0x19418 \n"
173 " LDR R0, [R0, #8] \n"
174 " CMP R0, #0 \n"
175 " BEQ loc_FFC454BC \n"
176 " BL sub_FFC31FCC \n"
177 " B loc_FFC454C0 \n"
178
179 "loc_FFC454BC:\n"
180 " BL sub_FFC44F10 \n"
181
182 "loc_FFC454C0:\n"
183 " MOV R0, #5 \n"
184 " STR R0, [R5, #0x38] \n"
185
186 "loc_FFC454C8:\n"
187 " ADD SP, SP, #0x40 \n"
188 " LDMFD SP!, {R4-R8,PC} \n"
189
190 "loc_FFC454D0:\n"
191 " LDR LR, [SP, #0x30] \n"
192 " CMP LR, #0 \n"
193 " BEQ loc_FFC45598 \n"
194 " STR R7, [R5, #0x2C] \n"
195 " LDR R0, [R5, #0x6C] \n"
196 " LDR R1, [R4, #0x14] \n"
197 " LDR R2, [R4, #0x18] \n"
198 " LDR R12, [R4, #0xC] \n"
199 " ADD R3, SP, #0x38 \n"
200 " ADD R8, SP, #0x14 \n"
201 " STMIA R8, {R0-R3} \n"
202 " LDR R3, [R5, #0x58] \n"
203 " ADD R2, SP, #0x3C \n"
204 " ADD R8, SP, #8 \n"
205 " LDRD R0, [SP, #0x28] \n"
206 " STMIA R8, {R0,R2,R3} \n"
207 " STR R1, [SP, #4] \n"
208 " STR LR, [SP] \n"
209 " LDMIB R4, {R0,R1} \n"
210 " LDR R3, [SP, #0x34] \n"
211 " MOV R2, R12 \n"
212 " BL sub_FFCC87C4 \n"
213 " LDR R0, [R5, #0x10] \n"
214 " MOV R1, #0x3E8 \n"
215 " BL _TakeSemaphore \n"
216 " CMP R0, #9 \n"
217 " BNE loc_FFC4554C \n"
218 " BL sub_FFD099E4 \n"
219 " MOV R0, #0x90000 \n"
220 " STR R7, [R5, #0x38] \n"
221 " B loc_FFC45564 \n"
222
223 "loc_FFC4554C:\n"
224 " LDR R0, [SP, #0x38] \n"
225 " CMP R0, #0 \n"
226 " BEQ loc_FFC4556C \n"
227 " BL sub_FFD099E4 \n"
228 " MOV R0, #0xA0000 \n"
229 " STR R7, [R5, #0x38] \n"
230
231 "loc_FFC45564:\n"
232 " BL sub_FFC5BD20 /*_HardwareDefect_FW*/ \n"
233 " B loc_FFC454C8 \n"
234
235 "loc_FFC4556C:\n"
236 " BL sub_FFCC8888 \n"
237 " LDR R0, [SP, #0x34] \n"
238 " LDR R1, [SP, #0x3C] \n"
239 " BL sub_FFD0978C \n"
240 " LDR R0, [R5, #0x4C] \n"
241 " LDR R1, =0x5234 \n"
242 " ADD R0, R0, #1 \n"
243 " STR R0, [R5, #0x4C] \n"
244 " LDR R0, [SP, #0x3C] \n"
245 " MOV R2, #0 \n"
246 " BL sub_FFD0761C_my \n"
247
248 "loc_FFC45598:\n"
249 " LDR R0, [R5, #0x50] \n"
250 " ADD R0, R0, #1 \n"
251 " STR R0, [R5, #0x50] \n"
252 " LDR R1, [R5, #0x78] \n"
253 " MUL R0, R1, R0 \n"
254 " LDR R1, [R5, #0x74] \n"
255 " BL sub_FFE50550 /*__divmod_unsigned_int*/ \n"
256 " MOV R4, R0 \n"
257 " BL sub_FFD09A1C \n"
258 " LDR R1, [R5, #0x70] \n"
259 " CMP R1, R4 \n"
260 " BNE loc_FFC455D4 \n"
261 " LDR R0, [R5, #0x30] \n"
262 " CMP R0, #1 \n"
263 " BNE loc_FFC455E8 \n"
264
265 "loc_FFC455D4:\n"
266 " LDR R1, [R5, #0x84] \n"
267 " MOV R0, R4 \n"
268 " BLX R1 \n"
269 " STR R4, [R5, #0x70] \n"
270 " STR R6, [R5, #0x30] \n"
271
272 "loc_FFC455E8:\n"
273 " STR R6, [R5, #0x2C] \n"
274 " B loc_FFC454C8 \n"
275 );
276 }
277
278
279
280 void __attribute__((naked,noinline)) sub_FFD0761C_my() {
281 asm volatile (
282 " STMFD SP!, {R4-R8,LR} \n"
283 " LDR R4, =0x8404 \n"
284 " LDR LR, [R4] \n"
285 " LDR R2, [R4, #8] \n"
286 " CMP LR, #0 \n"
287 " LDRNE R3, [R4, #0xC] \n"
288 " MOV R5, R2 \n"
289 " CMPNE R3, #1 \n"
290 " MOVEQ R2, #0 \n"
291 " STREQ R0, [R4] \n"
292 " STREQ R2, [R4, #0xC] \n"
293 " BEQ loc_FFD076E8 \n"
294 " LDR R3, [R4, #4] \n"
295 " LDR R7, =table\n"
296 " LDR R7, =0xFFE6C4C0 \n"
297 " ADD R12, R3, R3, LSL#1 \n"
298 " LDR R3, [R7, R12, LSL#2] \n"
299 " ADD R6, R7, #0x30 \n"
300 " LDR R8, [R6, R12, LSL#2] \n"
301 " SUB R3, LR, R3 \n"
302 " CMP R3, #0 \n"
303 " SUB LR, LR, R8 \n"
304 " BLE loc_FFD076A4 \n"
305 " ADD R12, R7, R12, LSL#2 \n"
306 " LDR LR, [R12, #4] \n"
307 " CMP LR, R3 \n"
308 " ADDGE R2, R2, #1 \n"
309 " BGE loc_FFD07698 \n"
310 " LDR R12, [R12, #8] \n"
311 " CMP R12, R3 \n"
312 " ADDLT R2, R2, #3 \n"
313 " ADDGE R2, R2, #2 \n"
314
315 "loc_FFD07698:\n"
316 " CMP R2, #0x1A \n"
317 " MOVGE R2, #0x19 \n"
318 " B loc_FFD076D8 \n"
319
320 "loc_FFD076A4:\n"
321 " CMP LR, #0 \n"
322 " BGE loc_FFD076D8 \n"
323 " ADD R3, R6, R12, LSL#2 \n"
324 " LDR R12, [R3, #4] \n"
325 " CMP R12, LR \n"
326 " SUBLE R2, R2, #1 \n"
327 " BLE loc_FFD076D0 \n"
328 " LDR R3, [R3, #8] \n"
329 " CMP R3, LR \n"
330 " SUBGT R2, R2, #3 \n"
331 " SUBLE R2, R2, #2 \n"
332
333 "loc_FFD076D0:\n"
334 " CMP R2, #0 \n"
335 " MOVLT R2, #0 \n"
336
337 "loc_FFD076D8:\n"
338 " CMP R2, R5 \n"
339 " STRNE R2, [R4, #8] \n"
340 " MOVNE R2, #1 \n"
341 " STRNE R2, [R4, #0xC] \n"
342
343 "loc_FFD076E8:\n"
344 " LDR R2, =CompressionRateTable \n"
345 " LDR R3, [R4, #8] \n"
346 " LDR R2, [R2, R3, LSL#2] \n"
347
348 " LDR R3, =video_mode\n"
349 " LDR R3, [R3]\n"
350 " LDR R3, [R3]\n"
351 " CMP R3, #1\n"
352 " LDREQ R3, =video_quality\n"
353 " LDREQ R3, [R3]\n"
354 " LDREQ R2, [R3]\n"
355
356 " STR R2, [R1] \n"
357 " STR R0, [R4] \n"
358 " BL mute_on_zoom\n"
359 " LDMFD SP!, {R4-R8,PC} \n"
360 );
361 }