This source file includes following definitions.
- change_video_tables
- movie_record_task
- sub_FF8598C0_my
- sub_FF9334AC_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, =0x5368 \n"
29 " MOV R6, #0 \n"
30 " MOV R5, #1 \n"
31
32 "loc_FF859E40:\n"
33 " LDR R0, [R4, #0x1C] \n"
34 " MOV R2, #0 \n"
35 " ADD R1, SP, #4 \n"
36 " BL sub_FF827E54 /*_ReceiveMessageQueue*/ \n"
37 " LDR R0, [R4, #0x24] \n"
38 " CMP R0, #0 \n"
39 " BNE loc_FF859F10 \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_FF859F10 \n"
46 " B loc_FF859EC4 \n"
47 " B loc_FF859EE4 \n"
48 " B loc_FF859EF4 \n"
49 " B loc_FF859EFC \n"
50 " B loc_FF859ECC \n"
51 " B loc_FF859F04 \n"
52 " B loc_FF859ED4 \n"
53 " B loc_FF859F10 \n"
54 " B loc_FF859F0C \n"
55 " B loc_FF859E9C \n"
56
57 "loc_FF859E9C:\n"
58 " STR R6, [R4, #0x38] \n"
59 " LDR R0, =0xFF859AFC \n"
60 " LDR R2, =0xFF85942C \n"
61 " LDR R1, =0x1979C \n"
62 " STR R0, [R4, #0xA4] \n"
63 " LDR R0, =0xFF859510 \n"
64 " STR R6, [R4, #0x28] \n"
65 " BL sub_FF8C5714 \n"
66 " STR R5, [R4, #0x3C] \n"
67 " B loc_FF859F10 \n"
68
69 "loc_FF859EC4:\n"
70 " BL unlock_optical_zoom\n"
71 " BL sub_FF859BF4 \n"
72 " B loc_FF859F10 \n"
73
74 "loc_FF859ECC:\n"
75 " BL sub_FF8598C0_my \n"
76 " B loc_FF859F10 \n"
77
78 "loc_FF859ED4:\n"
79 " LDR R1, [R0, #0x10] \n"
80 " LDR R0, [R0, #4] \n"
81 " BL sub_FF935104 \n"
82 " B loc_FF859F10 \n"
83
84 "loc_FF859EE4:\n"
85 " LDR R0, [R4, #0x3C] \n"
86 " CMP R0, #5 \n"
87 " STRNE R5, [R4, #0x2C] \n"
88 " B loc_FF859F10 \n"
89
90 "loc_FF859EF4:\n"
91 " BL sub_FF8596C4 \n"
92 " B loc_FF859F10 \n"
93
94 "loc_FF859EFC:\n"
95 " BL sub_FF85955C \n"
96 " B loc_FF859F10 \n"
97
98 "loc_FF859F04:\n"
99 " BL sub_FF8593B8 \n"
100 " B loc_FF859F10 \n"
101
102 "loc_FF859F0C:\n"
103 " BL sub_FF85A078 \n"
104
105 "loc_FF859F10:\n"
106 " LDR R1, [SP, #4] \n"
107 " LDR R3, =0xFF8591BC /*'MovieRecorder.c'*/ \n"
108 " STR R6, [R1] \n"
109 " STR R8, [SP] \n"
110 " LDR R0, [R4, #0x20] \n"
111 " MOV R2, R7 \n"
112 " BL sub_FF81BCF8 /*_PostMessageQueueStrictly*/ \n"
113 " B loc_FF859E40 \n"
114 );
115 }
116
117
118
119 void __attribute__((naked,noinline)) sub_FF8598C0_my() {
120 asm volatile (
121 " STMFD SP!, {R4-R9,LR} \n"
122 " SUB SP, SP, #0x3C \n"
123 " MOV R7, #0 \n"
124 " LDR R5, =0x5368 \n"
125 " MOV R4, R0 \n"
126 " STR R7, [SP, #0x2C] \n"
127 " STR R7, [SP, #0x24] \n"
128 " LDR R0, [R5, #0x3C] \n"
129 " MOV R8, #4 \n"
130 " CMP R0, #3 \n"
131 " STREQ R8, [R5, #0x3C] \n"
132 " LDR R0, [R5, #0xA4] \n"
133 " MOV R6, #0 \n"
134 " BLX R0 \n"
135 " LDR R0, [R5, #0x3C] \n"
136 " CMP R0, #4 \n"
137 " BNE loc_FF8599D0 \n"
138 " LDRH R0, [R5, #2] \n"
139 " MOV R9, #1 \n"
140 " CMP R0, #1 \n"
141 " BNE loc_FF85993C \n"
142 " LDRH R1, [R5, #4] \n"
143 " LDR R0, [R5, #0x4C] \n"
144 " MUL R0, R1, R0 \n"
145 " MOV R1, #0x3E8 \n"
146 " BL sub_FFAA663C /*__divmod_unsigned_int*/ \n"
147 " MOV R1, R0 \n"
148 " LDR R0, [R5, #0x54] \n"
149 " BL sub_FFAA663C /*__divmod_unsigned_int*/ \n"
150 " CMP R1, #0 \n"
151 " BNE loc_FF859958 \n"
152
153 "loc_FF85993C:\n"
154 " ADD R3, SP, #0x24 \n"
155 " ADD R2, SP, #0x28 \n"
156 " ADD R1, SP, #0x2C \n"
157 " ADD R0, SP, #0x30 \n"
158 " BL sub_FF935298 \n"
159 " MOVS R6, R0 \n"
160 " BNE loc_FF859974 \n"
161
162 "loc_FF859958:\n"
163 " LDR R0, [R5, #0x2C] \n"
164 " CMP R0, #1 \n"
165 " BNE loc_FF8599D8 \n"
166 " LDR R0, [R5, #0x54] \n"
167 " LDR R1, [R5, #0x40] \n"
168 " CMP R0, R1 \n"
169 " BCC loc_FF8599D8 \n"
170
171 "loc_FF859974:\n"
172 " CMP R6, #0x80000001 \n"
173 " STREQ R8, [R5, #0x58] \n"
174 " BEQ loc_FF8599AC \n"
175 " CMP R6, #0x80000003 \n"
176 " STREQ R9, [R5, #0x58] \n"
177 " BEQ loc_FF8599AC \n"
178 " CMP R6, #0x80000005 \n"
179 " MOVEQ R0, #2 \n"
180 " BEQ loc_FF8599A8 \n"
181 " CMP R6, #0x80000007 \n"
182 " STRNE R7, [R5, #0x58] \n"
183 " BNE loc_FF8599AC \n"
184 " MOV R0, #3 \n"
185
186 "loc_FF8599A8:\n"
187 " STR R0, [R5, #0x58] \n"
188
189 "loc_FF8599AC:\n"
190 " LDR R0, =0x197CC \n"
191 " LDR R0, [R0, #8] \n"
192 " CMP R0, #0 \n"
193 " BEQ loc_FF8599C4 \n"
194 " BL sub_FF8440F0 \n"
195 " B loc_FF8599C8 \n"
196
197 "loc_FF8599C4:\n"
198 " BL sub_FF8593B8 \n"
199
200 "loc_FF8599C8:\n"
201 " MOV R0, #5 \n"
202 " STR R0, [R5, #0x3C] \n"
203
204 "loc_FF8599D0:\n"
205 " ADD SP, SP, #0x3C \n"
206 " LDMFD SP!, {R4-R9,PC} \n"
207
208 "loc_FF8599D8:\n"
209 " LDR R12, [SP, #0x2C] \n"
210 " CMP R12, #0 \n"
211 " BEQ loc_FF859AA4 \n"
212 " STR R9, [R5, #0x30] \n"
213 " LDR R0, [R5, #0x70] \n"
214 " LDR R1, [R4, #0x14] \n"
215 " LDR R2, [R4, #0x18] \n"
216 " LDR LR, [R4, #0xC] \n"
217 " ADD R3, SP, #0x34 \n"
218 " ADD R6, SP, #0x14 \n"
219 " STMIA R6, {R0-R3} \n"
220 " LDR R0, [SP, #0x24] \n"
221 " LDR R3, [R5, #0x5C] \n"
222 " LDR R1, [SP, #0x28] \n"
223 " ADD R2, SP, #0x38 \n"
224 " ADD R6, SP, #8 \n"
225 " STMIA R6, {R0,R2,R3} \n"
226 " STR R1, [SP, #4] \n"
227 " STR R12, [SP] \n"
228 " LDMIB R4, {R0,R1} \n"
229 " LDR R3, [SP, #0x30] \n"
230 " MOV R2, LR \n"
231 " BL sub_FF8ED004 \n"
232 " LDR R0, [R5, #0x14] \n"
233 " MOV R1, #0x3E8 \n"
234 " BL _TakeSemaphore \n"
235 " CMP R0, #9 \n"
236 " BNE loc_FF859A58 \n"
237 " BL sub_FF935874 \n"
238 " MOV R0, #0x90000 \n"
239 " STR R9, [R5, #0x3C] \n"
240 " B loc_FF859A70 \n"
241
242 "loc_FF859A58:\n"
243 " LDR R0, [SP, #0x34] \n"
244 " CMP R0, #0 \n"
245 " BEQ loc_FF859A78 \n"
246 " BL sub_FF935874 \n"
247 " MOV R0, #0xA0000 \n"
248 " STR R9, [R5, #0x3C] \n"
249
250 "loc_FF859A70:\n"
251 " BL sub_FF873B30 /*_HardwareDefect_FW*/ \n"
252 " B loc_FF8599D0 \n"
253
254 "loc_FF859A78:\n"
255 " BL sub_FF8ED0C8 \n"
256 " LDR R0, [SP, #0x30] \n"
257 " LDR R1, [SP, #0x38] \n"
258 " BL sub_FF93561C \n"
259 " LDR R0, [R5, #0x50] \n"
260 " LDR R1, =0x53D8 \n"
261 " ADD R0, R0, #1 \n"
262 " STR R0, [R5, #0x50] \n"
263 " LDR R0, [SP, #0x38] \n"
264 " MOV R2, #0 \n"
265 " BL sub_FF9334AC_my \n"
266
267 "loc_FF859AA4:\n"
268 " LDR R0, [R5, #0x54] \n"
269 " ADD R0, R0, #1 \n"
270 " STR R0, [R5, #0x54] \n"
271 " LDR R1, [R5, #0x7C] \n"
272 " MUL R0, R1, R0 \n"
273 " LDR R1, [R5, #0x78] \n"
274 " BL sub_FFAA663C /*__divmod_unsigned_int*/ \n"
275 " MOV R4, R0 \n"
276 " BL sub_FF9358AC \n"
277 " LDR R1, [R5, #0x74] \n"
278 " CMP R1, R4 \n"
279 " BNE loc_FF859AE0 \n"
280 " LDR R0, [R5, #0x34] \n"
281 " CMP R0, #1 \n"
282 " BNE loc_FF859AF4 \n"
283
284 "loc_FF859AE0:\n"
285 " LDR R1, [R5, #0x88] \n"
286 " MOV R0, R4 \n"
287 " BLX R1 \n"
288 " STR R4, [R5, #0x74] \n"
289 " STR R7, [R5, #0x34] \n"
290
291 "loc_FF859AF4:\n"
292 " STR R7, [R5, #0x30] \n"
293 " B loc_FF8599D0 \n"
294 );
295 }
296
297
298
299 void __attribute__((naked,noinline)) sub_FF9334AC_my() {
300 asm volatile (
301 " STMFD SP!, {R4-R8,LR} \n"
302 " LDR R4, =0x8794 \n"
303 " LDR LR, [R4] \n"
304 " LDR R2, [R4, #8] \n"
305 " CMP LR, #0 \n"
306 " LDRNE R3, [R4, #0xC] \n"
307 " MOV R5, R2 \n"
308 " CMPNE R3, #1 \n"
309 " MOVEQ R2, #0 \n"
310 " STREQ R0, [R4] \n"
311 " STREQ R2, [R4, #0xC] \n"
312 " BEQ loc_FF933578 \n"
313 " LDR R3, [R4, #4] \n"
314 " LDR R7, =table\n"
315 " LDR R7, =0xFFAC134C \n"
316 " ADD R12, R3, R3, LSL#1 \n"
317 " LDR R3, [R7, R12, LSL#2] \n"
318 " ADD R6, R7, #0x30 \n"
319 " LDR R8, [R6, R12, LSL#2] \n"
320 " SUB R3, LR, R3 \n"
321 " CMP R3, #0 \n"
322 " SUB LR, LR, R8 \n"
323 " BLE loc_FF933534 \n"
324 " ADD R12, R7, R12, LSL#2 \n"
325 " LDR LR, [R12, #4] \n"
326 " CMP LR, R3 \n"
327 " ADDGE R2, R2, #1 \n"
328 " BGE loc_FF933528 \n"
329 " LDR R12, [R12, #8] \n"
330 " CMP R12, R3 \n"
331 " ADDLT R2, R2, #3 \n"
332 " ADDGE R2, R2, #2 \n"
333
334 "loc_FF933528:\n"
335 " CMP R2, #0x1A \n"
336 " MOVGE R2, #0x19 \n"
337 " B loc_FF933568 \n"
338
339 "loc_FF933534:\n"
340 " CMP LR, #0 \n"
341 " BGE loc_FF933568 \n"
342 " ADD R3, R6, R12, LSL#2 \n"
343 " LDR R12, [R3, #4] \n"
344 " CMP R12, LR \n"
345 " SUBLE R2, R2, #1 \n"
346 " BLE loc_FF933560 \n"
347 " LDR R3, [R3, #8] \n"
348 " CMP R3, LR \n"
349 " SUBGT R2, R2, #3 \n"
350 " SUBLE R2, R2, #2 \n"
351
352 "loc_FF933560:\n"
353 " CMP R2, #0 \n"
354 " MOVLT R2, #0 \n"
355
356 "loc_FF933568:\n"
357 " CMP R2, R5 \n"
358 " STRNE R2, [R4, #8] \n"
359 " MOVNE R2, #1 \n"
360 " STRNE R2, [R4, #0xC] \n"
361
362 "loc_FF933578:\n"
363 " LDR R2, =CompressionRateTable \n"
364 " LDR R3, [R4, #8] \n"
365 " LDR R2, [R2, R3, LSL#2] \n"
366
367 " LDR R3, =video_mode\n"
368 " LDR R3, [R3]\n"
369 " LDR R3, [R3]\n"
370 " CMP R3, #1\n"
371 " LDREQ R3, =video_quality\n"
372 " LDREQ R3, [R3]\n"
373 " LDREQ R2, [R3]\n"
374
375 " STR R2, [R1] \n"
376 " STR R0, [R4] \n"
377 " BL mute_on_zoom\n"
378 " LDMFD SP!, {R4-R8,PC} \n"
379 );
380 }