This source file includes following definitions.
- change_video_tables
- movie_record_task
- sub_FF859A9C_my
- sub_FF937138_my
1 #include "conf.h"
2
3 int *video_quality = &conf.video_quality;
4 int *video_mode = &conf.video_mode;
5
6 long def_table[68] = {
7 0x2000, 0x38D, 0x788, 0xBE1, 0x10CB, 0x1642, 0x1C48, 0x22F9, 0x2A79, 0x32AA, 0x3C01, 0x4637,
8 0x5190, 0x5E0E, 0x5800, 0x9C5, 0x14B8, 0x20C9, 0x2E31, 0x3D39, 0x4DC9, 0x6030, 0x74D1, 0x8B8D,
9 0xA509, 0xC160, 0xE054, 0x102AF, 0x10000, 0x1C6A, 0x3C45, 0x5F60, 0x8661, 0xB21A, 0xE249, 0x117D2,
10 0x153D5, 0x195F8, 0x1E01C, 0x2328E, 0x28C99, 0x2F08B, 0x8000, 0xE35, 0x1E23, 0x2FB0, 0x4331, 0x590D,
11 0x7125, 0x8BE9, 0xA9EB, 0xCAFC, 0xF00E, 0x11947, 0x1464D, 0x17846, 0x1CCD, -0x2E1, -0x579, 0x4F33,
12 -0x7EB, -0xF0C, 0xE666, -0x170A, -0x2BC6, 0x7333, -0xB85, -0x15E3};
13
14 long table[68];
15
16 void change_video_tables(int a, int b) {
17 int i;
18
19 for (i=0;i<68;i++) {
20 table[i]=(def_table[i]*a)/b;
21 }
22 }
23
24 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};
25
26
27 void __attribute__((naked,noinline)) movie_record_task()
28 {
29 asm volatile (
30 "STMFD SP!, {R2-R8,LR}\n"
31 "LDR R8, =0x32B\n"
32 "LDR R7, =0x2710\n"
33 "LDR R4, =0x5390\n"
34 "MOV R6, #0\n"
35 "MOV R5, #1\n"
36
37 "loc_FF85A01C:\n"
38 "LDR R0, [R4,#0x1C]\n"
39 "MOV R2, #0\n"
40 "ADD R1, SP, #0x20-0x1C\n"
41 "BL sub_FF827D90\n"
42 "LDR R0, [R4,#0x24]\n"
43 "CMP R0, #0\n"
44 "BNE loc_FF85A0EC\n"
45 "LDR R0, [SP,#0x20-0x1C]\n"
46 "LDR R1, [R0]\n"
47 "SUB R1, R1, #2\n"
48 "CMP R1, #9\n"
49 "ADDLS PC, PC, R1,LSL#2\n"
50 "B loc_FF85A0EC\n"
51
52 "loc_FF85A050:\n"
53 "B loc_FF85A0A0\n"
54
55 "loc_FF85A054:\n"
56 "B loc_FF85A0C0\n"
57
58 "loc_FF85A058:\n"
59 "B loc_FF85A0D0\n"
60
61 "loc_FF85A05C:\n"
62 "B loc_FF85A0D8\n"
63
64 "loc_FF85A060:\n"
65 "B loc_FF85A0A8\n"
66
67 "loc_FF85A064:\n"
68 "B loc_FF85A0E0\n"
69
70 "loc_FF85A068:\n"
71 "B loc_FF85A0B0\n"
72
73 "loc_FF85A06C:\n"
74 "B loc_FF85A0EC\n"
75
76 "loc_FF85A070:\n"
77 "B loc_FF85A0E8\n"
78
79 "loc_FF85A074:\n"
80 "B loc_FF85A078\n"
81
82 "loc_FF85A078:\n"
83
84 "STR R6, [R4,#0x38]\n"
85 "LDR R0, =0xFF859CD8\n"
86 "LDR R2, =0xFF859608\n"
87 "LDR R1, =0x19B18\n"
88 "STR R0, [R4,#0xA4]\n"
89 "LDR R0, =0xFF8596EC\n"
90 "STR R6, [R4,#0x28]\n"
91 "BL sub_FF8C7F90\n"
92 "STR R5, [R4,#0x3C]\n"
93 "B loc_FF85A0EC\n"
94
95 "loc_FF85A0A0:\n"
96
97 "BL unlock_optical_zoom\n"
98 "BL sub_FF859DD0\n"
99 "B loc_FF85A0EC\n"
100
101 "loc_FF85A0A8:\n"
102
103 "BL sub_FF859A9C_my\n"
104 "B loc_FF85A0EC\n"
105
106 "loc_FF85A0B0:\n"
107
108 "LDR R1, [R0,#0x10]\n"
109 "LDR R0, [R0,#4]\n"
110 "BL sub_FF938D90\n"
111 "B loc_FF85A0EC\n"
112
113 "loc_FF85A0C0:\n"
114
115 "LDR R0, [R4,#0x3C]\n"
116 "CMP R0, #5\n"
117 "STRNE R5, [R4,#0x2C]\n"
118 "B loc_FF85A0EC\n"
119
120 "loc_FF85A0D0:\n"
121
122 "BL sub_FF8598A0\n"
123 "B loc_FF85A0EC\n"
124
125 "loc_FF85A0D8:\n"
126
127 "BL sub_FF859738\n"
128 "B loc_FF85A0EC\n"
129
130 "loc_FF85A0E0:\n"
131
132 "BL sub_FF859594\n"
133 "B loc_FF85A0EC\n"
134
135 "loc_FF85A0E8:\n"
136
137 "BL sub_FF85A254\n"
138
139 "loc_FF85A0EC:\n"
140
141
142 "LDR R1, [SP,#0x20-0x1C]\n"
143 "LDR R3, =0xFF859398\n"
144 "STR R6, [R1]\n"
145 "STR R8, [SP,#0x20-0x20]\n"
146 "LDR R0, [R4,#0x20]\n"
147 "MOV R2, R7\n"
148 "BL sub_FF81BC30\n"
149 "B loc_FF85A01C\n"
150 );
151 }
152
153 void __attribute__((naked,noinline)) sub_FF859A9C_my()
154 {
155 asm volatile (
156 "STMFD SP!, {R4-R9,LR}\n"
157 "SUB SP, SP, #0x3C\n"
158 "MOV R7, #0\n"
159 "LDR R5, =0x5390\n"
160 "MOV R4, R0\n"
161 "STR R7, [SP,#0x58-0x2C]\n"
162 "STR R7, [SP,#0x58-0x34]\n"
163 "LDR R0, [R5,#0x3C]\n"
164 "MOV R8, #4\n"
165 "CMP R0, #3\n"
166 "STREQ R8, [R5,#0x3C]\n"
167 "LDR R0, [R5,#0xA4]\n"
168 "MOV R6, #0\n"
169 "BLX R0\n"
170 "LDR R0, [R5,#0x3C]\n"
171 "CMP R0, #4\n"
172 "BNE loc_FF859BAC\n"
173 "LDRH R0, [R5,#2]\n"
174 "MOV R9, #1\n"
175 "CMP R0, #1\n"
176 "BNE loc_FF859B18\n"
177 "LDRH R1, [R5,#4]\n"
178 "LDR R0, [R5,#0x4C]\n"
179 "MUL R0, R1, R0\n"
180 "MOV R1, #0x3E8\n"
181 "BL sub_FFAAF1AC\n"
182 "MOV R1, R0\n"
183 "LDR R0, [R5,#0x54]\n"
184 "BL sub_FFAAF1AC\n"
185 "CMP R1, #0\n"
186 "BNE loc_FF859B34\n"
187
188 "loc_FF859B18:\n"
189 "ADD R3, SP, #0x58-0x34\n"
190 "ADD R2, SP, #0x58-0x30\n"
191 "ADD R1, SP, #0x58-0x2C\n"
192 "ADD R0, SP, #0x58-0x28\n"
193 "BL sub_FF938F24\n"
194 "MOVS R6, R0\n"
195 "BNE loc_FF859B50\n"
196
197 "loc_FF859B34:\n"
198 "LDR R0, [R5,#0x2C]\n"
199 "CMP R0, #1\n"
200 "BNE loc_FF859BB4\n"
201 "LDR R0, [R5,#0x54]\n"
202 "LDR R1, [R5,#0x40]\n"
203 "CMP R0, R1\n"
204 "BCC loc_FF859BB4\n"
205
206 "loc_FF859B50:\n"
207 "CMP R6, #0x80000001\n"
208 "STREQ R8, [R5,#0x58]\n"
209 "BEQ loc_FF859B88\n"
210 "CMP R6, #0x80000003\n"
211 "STREQ R9, [R5,#0x58]\n"
212 "BEQ loc_FF859B88\n"
213 "CMP R6, #0x80000005\n"
214 "MOVEQ R0, #2\n"
215 "BEQ loc_FF859B84\n"
216 "CMP R6, #0x80000007\n"
217 "STRNE R7, [R5,#0x58]\n"
218 "BNE loc_FF859B88\n"
219 "MOV R0, #3\n"
220
221 "loc_FF859B84:\n"
222 "STR R0, [R5,#0x58]\n"
223
224 "loc_FF859B88:\n"
225 "LDR R0, =0x19B48\n"
226 "LDR R0, [R0,#8]\n"
227 "CMP R0, #0\n"
228 "BEQ loc_FF859BA0\n"
229 "BL sub_FF84427C\n"
230 "B loc_FF859BA4\n"
231
232 "loc_FF859BA0:\n"
233 "BL sub_FF859594\n"
234
235 "loc_FF859BA4:\n"
236 "MOV R0, #5\n"
237 "STR R0, [R5,#0x3C]\n"
238
239 "loc_FF859BAC:\n"
240 "ADD SP, SP, #0x3C\n"
241 "LDMFD SP!, {R4-R9,PC}\n"
242
243 "loc_FF859BB4:\n"
244 "LDR R12, [SP,#0x58-0x2C]\n"
245 "CMP R12, #0\n"
246 "BEQ loc_FF859C80\n"
247 "STR R9, [R5,#0x30]\n"
248 "LDR R0, [R5,#0x70]\n"
249 "LDR R1, [R4,#0x14]\n"
250 "LDR R2, [R4,#0x18]\n"
251 "LDR LR, [R4,#0xC]\n"
252 "ADD R3, SP, #0x58-0x24\n"
253 "ADD R6, SP, #0x58-0x44\n"
254 "STMIA R6, {R0-R3}\n"
255 "LDR R0, [SP,#0x58-0x34]\n"
256 "LDR R3, [R5,#0x5C]\n"
257 "LDR R1, [SP,#0x58-0x30]\n"
258 "ADD R2, SP, #0x58-0x20\n"
259 "ADD R6, SP, #0x58-0x50\n"
260 "STMIA R6, {R0,R2,R3}\n"
261 "STR R1, [SP,#0x58-0x54]\n"
262 "STR R12, [SP,#0x58-0x58]\n"
263 "LDMIB R4, {R0,R1}\n"
264 "LDR R3, [SP,#0x58-0x28]\n"
265 "MOV R2, LR\n"
266 "BL sub_FF8EFE60\n"
267 "LDR R0, [R5,#0x14]\n"
268 "MOV R1, #0x3E8\n"
269 "BL sub_FF81B6AC\n"
270 "CMP R0, #9\n"
271 "BNE loc_FF859C34\n"
272 "BL sub_FF939500\n"
273 "MOV R0, #0x90000\n"
274 "STR R9, [R5,#0x3C]\n"
275 "B loc_FF859C4C\n"
276
277 "loc_FF859C34:\n"
278 "LDR R0, [SP,#0x58-0x24]\n"
279 "CMP R0, #0\n"
280 "BEQ loc_FF859C54\n"
281 "BL sub_FF939500\n"
282 "MOV R0, #0xA0000\n"
283 "STR R9, [R5,#0x3C]\n"
284
285 "loc_FF859C4C:\n"
286 "BL sub_FF875750\n"
287 "B loc_FF859BAC\n"
288
289 "loc_FF859C54:\n"
290 "BL sub_FF8EFF24\n"
291 "LDR R0, [SP,#0x58-0x28]\n"
292 "LDR R1, [SP,#0x58-0x20]\n"
293 "BL sub_FF9392A8\n"
294 "LDR R0, [R5,#0x50]\n"
295 "LDR R1, =0x5400\n"
296 "ADD R0, R0, #1\n"
297 "STR R0, [R5,#0x50]\n"
298 "LDR R0, [SP,#0x58-0x20]\n"
299 "MOV R2, #0\n"
300 "BL sub_FF937138_my\n"
301
302 "loc_FF859C80:\n"
303 "LDR R0, [R5,#0x54]\n"
304 "ADD R0, R0, #1\n"
305 "STR R0, [R5,#0x54]\n"
306 "LDR R1, [R5,#0x7C]\n"
307 "MUL R0, R1, R0\n"
308 "LDR R1, [R5,#0x78]\n"
309 "BL sub_FFAAF1AC\n"
310 "MOV R4, R0\n"
311 "BL sub_FF939538\n"
312 "LDR R1, [R5,#0x74]\n"
313 "CMP R1, R4\n"
314 "BNE loc_FF859CBC\n"
315 "LDR R0, [R5,#0x34]\n"
316 "CMP R0, #1\n"
317 "BNE loc_FF859CD0\n"
318
319 "loc_FF859CBC:\n"
320 "LDR R1, [R5,#0x88]\n"
321 "MOV R0, R4\n"
322 "BLX R1\n"
323 "STR R4, [R5,#0x74]\n"
324 "STR R7, [R5,#0x34]\n"
325
326 "loc_FF859CD0:\n"
327 "STR R7, [R5,#0x30]\n"
328 "B loc_FF859BAC\n"
329 );
330 }
331
332 void __attribute__((naked,noinline)) sub_FF937138_my()
333 {
334 asm volatile (
335 "STMFD SP!, {R4-R8,LR}\n"
336 "LDR R4, =0x8C44\n"
337 "LDR LR, [R4]\n"
338 "LDR R2, [R4,#8]\n"
339 "CMP LR, #0\n"
340 "LDRNE R3, [R4,#0xC]\n"
341 "MOV R5, R2\n"
342 "CMPNE R3, #1\n"
343 "MOVEQ R2, #0\n"
344 "STREQ R0, [R4]\n"
345 "STREQ R2, [R4,#0xC]\n"
346 "BEQ loc_FF937204\n"
347 "LDR R3, [R4,#4]\n"
348
349 "LDR R7, =table\n"
350 "ADD R12, R3, R3,LSL#1\n"
351 "LDR R3, [R7,R12,LSL#2]\n"
352 "ADD R6, R7, #0x30\n"
353 "LDR R8, [R6,R12,LSL#2]\n"
354 "SUB R3, LR, R3\n"
355 "CMP R3, #0\n"
356 "SUB LR, LR, R8\n"
357 "BLE loc_FF9371C0\n"
358 "ADD R12, R7, R12,LSL#2\n"
359 "LDR LR, [R12,#4]\n"
360 "CMP LR, R3\n"
361 "ADDGE R2, R2, #1\n"
362 "BGE loc_FF9371B4\n"
363 "LDR R12, [R12,#8]\n"
364 "CMP R12, R3\n"
365 "ADDLT R2, R2, #3\n"
366 "ADDGE R2, R2, #2\n"
367
368 "loc_FF9371B4:\n"
369
370
371 "CMP R2, #0x1A\n"
372 "MOVGE R2, #0x19\n"
373 "B loc_FF9371F4\n"
374
375 "loc_FF9371C0:\n"
376 "CMP LR, #0\n"
377 "BGE loc_FF9371F4\n"
378 "ADD R3, R6, R12,LSL#2\n"
379 "LDR R12, [R3,#4]\n"
380 "CMP R12, LR\n"
381 "SUBLE R2, R2, #1\n"
382 "BLE loc_FF9371EC\n"
383 "LDR R3, [R3,#8]\n"
384 "CMP R3, LR\n"
385 "SUBGT R2, R2, #3\n"
386 "SUBLE R2, R2, #2\n"
387
388 "loc_FF9371EC:\n"
389 "CMP R2, #0\n"
390 "MOVLT R2, #0\n"
391
392 "loc_FF9371F4:\n"
393 "CMP R2, R5\n"
394 "STRNE R2, [R4,#8]\n"
395 "MOVNE R2, #1\n"
396 "STRNE R2, [R4,#0xC]\n"
397
398 "loc_FF937204:\n"
399
400 "LDR R2, =CompressionRateTable\n"
401 "LDR R3, [R4,#8]\n"
402 "LDR R2, [R2,R3,LSL#2]\n"
403
404 "LDR R3, =video_mode\n"
405 "LDR R3, [R3]\n"
406 "LDR R3, [R3]\n"
407 "CMP R3, #1\n"
408 "LDREQ R3, =video_quality\n"
409 "LDREQ R3, [R3]\n"
410 "LDREQ R2, [R3]\n"
411
412 "STR R2, [R1]\n"
413 "STR R0, [R4]\n"
414 "LDMFD SP!, {R4-R8,PC}\n"
415 );
416 }