This source file includes following definitions.
- set_quality
- change_video_tables
- movie_record_task
- sub_FF985B84_my
1 #include "conf.h"
2
3 int *video_quality = &conf.video_quality;
4 int *video_mode = &conf.video_mode;
5
6
7
8
9
10 void set_quality (int *x)
11 {
12 if (conf.video_mode)
13 *x = 12 - ((conf.video_quality-1) * (12+17) / (99-1));
14 }
15
16
17
18
19
20 void change_video_tables(__attribute__ ((unused))int a, __attribute__ ((unused))int b) {}
21
22
23
24
25
26 void __attribute__((naked,noinline)) movie_record_task()
27 {
28 asm volatile (
29 " STMFD SP!, {R2-R8,LR} \n"
30
31 " LDR R8, =0x2710 \n"
32 " LDR R4, =0x7128 \n"
33 " MOV R7, #1 \n"
34 " LDR R6, =0xFF98611C \n"
35 " MOV R5, #0 \n"
36 "loc_FF986444:\n"
37 " LDR R0, [R4, #0x24] \n"
38 " MOV R2, #0 \n"
39 " ADD R1, SP, #4 \n"
40 " BL sub_FF83A2F8 \n"
41 " LDR R0, [R4, #0x2C] \n"
42 " CMP R0, #0 \n"
43 " LDRNE R0, [R4, #0xC] \n"
44 " CMPNE R0, #2 \n"
45 " LDRNE R0, [R4, #0x44] \n"
46 " CMPNE R0, #6 \n"
47 " BNE loc_FF98655C \n"
48 " LDR R0, [SP, #4] \n"
49 " LDR R1, [R0] \n"
50 " SUB R1, R1, #2 \n"
51 " CMP R1, #0xA \n"
52 " ADDLS PC, PC, R1, LSL #2 \n"
53 " B loc_FF98655C \n"
54 " B loc_FF986510 \n"
55 " B loc_FF986530 \n"
56 " B loc_FF986540 \n"
57 " B loc_FF986548 \n"
58 " B loc_FF986518 \n"
59 " B loc_FF986550 \n"
60 " B loc_FF986520 \n"
61 " B loc_FF98655C \n"
62 " B loc_FF986558 \n"
63 " B loc_FF9864E0 \n"
64 " B loc_FF9864B4 \n"
65
66 "loc_FF9864B4:\n"
67 " STR R5, [R4, #0x40] \n"
68 " STR R5, [R4, #0x30] \n"
69 " STR R5, [R4, #0x34] \n"
70 " STRH R5, [R4, #6] \n"
71 " STR R6, [R4, #0xB4] \n"
72 " LDR R0, [R4, #0xC] \n"
73 " ADD R0, R0, #1 \n"
74 " STR R0, [R4, #0xC] \n"
75 " MOV R0, #6 \n"
76 " STR R0, [R4, #0x44] \n"
77 " B loc_FF9864FC \n"
78
79 "loc_FF9864E0:\n"
80 " STR R5, [R4, #0x40] \n"
81 " STR R5, [R4, #0x30] \n"
82 " STR R6, [R4, #0xB4] \n"
83 " LDR R0, [R4, #0xC] \n"
84 " ADD R0, R0, #1 \n"
85 " STR R0, [R4, #0xC] \n"
86 " STR R7, [R4, #0x44] \n"
87 "loc_FF9864FC:\n"
88 " LDR R2, =0xFF985334 \n"
89 " LDR R1, =0xB45D0 \n"
90
91
92 " LDR R0, =0xFF985430 \n"
93
94 " BL sub_FF8530D0 \n"
95 " B loc_FF98655C \n"
96
97 "loc_FF986510:\n"
98 " BL unlock_optical_zoom\n"
99 " BL sub_FF986244 \n"
100 " B loc_FF98655C \n"
101
102 "loc_FF986518:\n"
103
104 " BL sub_FF985B84_my \n"
105 " B loc_FF98655C \n"
106
107 "loc_FF986520:\n"
108 " LDR R1, [R0, #0x18] \n"
109 " LDR R0, [R0, #4] \n"
110 " BL sub_FFAF2B4C \n"
111 " B loc_FF98655C \n"
112
113 "loc_FF986530:\n"
114 " LDR R0, [R4, #0x44] \n"
115 " CMP R0, #5 \n"
116 " STRNE R7, [R4, #0x34] \n"
117 " B loc_FF98655C \n"
118
119 "loc_FF986540:\n"
120 " BL sub_FF9857CC \n"
121 " B loc_FF98655C \n"
122
123 "loc_FF986548:\n"
124 " BL sub_FF98547C \n"
125 " B loc_FF98655C \n"
126
127 "loc_FF986550:\n"
128 " BL sub_FF9852C0 \n"
129 " B loc_FF98655C \n"
130
131 "loc_FF986558:\n"
132 " BL sub_FF98698C \n"
133
134 "loc_FF98655C:\n"
135 " LDR R1, [SP, #4] \n"
136 " MOV R3, #0x5F0 \n"
137 " STR R5, [R1] \n"
138 " STR R3, [SP] \n"
139 " LDR R0, [R4, #0x28] \n"
140 " LDR R3, =0xFF985124 \n"
141 " MOV R2, R8 \n"
142 " BL sub_FF83AC4C \n"
143 " B loc_FF986444 \n"
144 );
145 }
146
147
148
149
150 void __attribute__((naked,noinline)) sub_FF985B84_my()
151 {
152 asm volatile (
153 " STMFD SP!, {R4-R11,LR} \n"
154 " SUB SP, SP, #0x64 \n"
155 " MOV R8, #0 \n"
156 " LDR R6, =0x7128 \n"
157 " MOV R4, R0 \n"
158 " STR R8, [SP, #0x54] \n"
159 " STR R8, [SP, #0x4C] \n"
160 " LDR R0, [R6, #0x44] \n"
161 " MOV R11, #4 \n"
162 " CMP R0, #3 \n"
163 " STREQ R11, [R6, #0x44] \n"
164 " LDR R0, [R6, #0xB4] \n"
165 " MOV R9, #0 \n"
166 " MOV R7, #0 \n"
167 " MOV R5, #1 \n"
168 " BLX R0 \n"
169 " LDR R0, [R6, #0x44] \n"
170 " CMP R0, #6 \n"
171 " BEQ loc_FF985BE4 \n"
172 " LDR R1, [R6, #0xC] \n"
173 " CMP R1, #2 \n"
174 " BNE loc_FF985C04 \n"
175 " CMP R0, #5 \n"
176 " BEQ loc_FF985C7C \n"
177 "loc_FF985BE4:\n"
178 " LDR R1, =0x7F2 \n"
179 " MOV R7, #1 \n"
180 " LDR R0, =0xFF985124 \n"
181 " BL sub_FF81EB78 \n"
182 " LDR R0, [R6, #0x44] \n"
183 " CMP R0, #4 \n"
184 " MOVNE R5, #0 \n"
185 " B loc_FF985C0C \n"
186 "loc_FF985C04:\n"
187 " CMP R0, #4 \n"
188 " BNE loc_FF985C7C \n"
189 "loc_FF985C0C:\n"
190 " LDRH R0, [R6, #6] \n"
191 " CMP R0, #1 \n"
192 " LDREQ R1, =0x809 \n"
193 " LDREQ R0, =0xFF985124 \n"
194 " BLEQ sub_FF81EB78 \n"
195 " LDRH R0, [R6, #6] \n"
196 " CMP R0, #3 \n"
197 " BNE loc_FF985C40 \n"
198 " LDR R0, [R6, #0x6C] \n"
199 " LDR R1, [R6, #0xB8] \n"
200 " BL sub_FFBA18B4 \n"
201 " CMP R1, #0 \n"
202 " MOVNE R5, #0 \n"
203 "loc_FF985C40:\n"
204 " LDR R0, [R6, #0x44] \n"
205 " CMP R0, #6 \n"
206 " CMPNE R0, #1 \n"
207 " CMPNE R0, #3 \n"
208 " BNE loc_FF985C84 \n"
209 " CMP R7, #1 \n"
210 " CMPEQ R5, #0 \n"
211 " BNE loc_FF985C84 \n"
212 " LDR R0, [R6, #0x18] \n"
213 " MOV R1, #0x3E8 \n"
214 " BL sub_FF83A714 \n"
215 " CMP R0, #9 \n"
216 " BNE loc_FF9860A4 \n"
217 " MOV R0, #0x90000 \n"
218 " BL sub_FF89D31C \n"
219 "loc_FF985C7C:\n"
220 " ADD SP, SP, #0x64 \n"
221 " LDMFD SP!, {R4-R11,PC} \n"
222 "loc_FF985C84:\n"
223 " CMP R5, #1 \n"
224 " MOV R10, #1 \n"
225 " BNE loc_FF985CAC \n"
226 " ADD R3, SP, #0x4C \n"
227 " ADD R2, SP, #0x50 \n"
228 " ADD R1, SP, #0x54 \n"
229 " ADD R0, SP, #0x58 \n"
230 " BL sub_FFAF2C0C \n"
231 " MOVS R9, R0 \n"
232 " BNE loc_FF985CC8 \n"
233 "loc_FF985CAC:\n"
234 " LDR R0, [R6, #0x34] \n"
235 " CMP R0, #1 \n"
236 " BNE loc_FF985E24 \n"
237 " LDR R0, [R6, #0x6C] \n"
238 " LDR R1, [R6, #0x48] \n"
239 " CMP R0, R1 \n"
240 " BCC loc_FF985E24 \n"
241 "loc_FF985CC8:\n"
242 " CMP R9, #0x80000001 \n"
243 " STREQ R11, [R6, #0x70] \n"
244 " BEQ loc_FF985D00 \n"
245 " CMP R9, #0x80000003 \n"
246 " STREQ R10, [R6, #0x70] \n"
247 " BEQ loc_FF985D00 \n"
248 " CMP R9, #0x80000005 \n"
249 " MOVEQ R0, #2 \n"
250 " BEQ loc_FF985CFC \n"
251 " CMP R9, #0x80000007 \n"
252 " STRNE R8, [R6, #0x70] \n"
253 " BNE loc_FF985D00 \n"
254 " MOV R0, #3 \n"
255 "loc_FF985CFC:\n"
256 " STR R0, [R6, #0x70] \n"
257 "loc_FF985D00:\n"
258 " LDR R0, [R6, #0xC] \n"
259 " CMP R0, #2 \n"
260 " BNE loc_FF985D68 \n"
261 " MOV R1, #0 \n"
262 " LDR R0, =0xFF985B78 \n"
263 " BL sub_FFAAD410 \n"
264 " LDR R2, [R6, #0x64] \n"
265 " ADD R3, SP, #0x5C \n"
266 " STRD R2, [SP, #0x28] \n"
267 " MOV R2, #0x18 \n"
268 " ADD R1, SP, #0x34 \n"
269 " ADD R0, SP, #0x10 \n"
270 " BL sub_FFB9F254 \n"
271 " LDR R1, [R6, #0x84] \n"
272 " LDR R2, [R6, #0x88] \n"
273 " MVN R3, #1 \n"
274 " ADD R0, SP, #0x60 \n"
275 " STMEA SP, {R0-R3} \n"
276 " LDR R0, =0xB4618 \n"
277 " MOV R3, #0 \n"
278 " MOV R2, #0 \n"
279 " MOV R1, #0x40 \n"
280 " BL sub_FFAAD368 \n"
281 " B loc_FF985DBC \n"
282 "loc_FF985D60:\n"
283 " MOV R1, #1 \n"
284 " B loc_FF986030 \n"
285 "loc_FF985D68:\n"
286 " BL loc_FF986A38 \n"
287 " LDR R2, [R6, #0x64] \n"
288 " ADD R3, SP, #0x5C \n"
289 " MVN R1, #1 \n"
290 " MOV R0, #0 \n"
291 " ADD R5, SP, #0x1C \n"
292 " STMIA R5, {R0-R3} \n"
293 " LDR R3, [R4, #0x1C] \n"
294 " LDR R1, [R6, #0x84] \n"
295 " LDR R2, [R6, #0x88] \n"
296 " ADD R4, SP, #0xC \n"
297 " ADD R0, SP, #0x60 \n"
298 " STMIA R4, {R0-R3} \n"
299 " MOV R3, #0 \n"
300 " MOV R1, #0x40 \n"
301 " MOV R2, #0 \n"
302 " STMEA SP, {R1-R3} \n"
303 " LDR R3, =0xB4618 \n"
304 " MOV R1, #0 \n"
305 " MOV R0, #0 \n"
306 " BL sub_FFAAC1D8 \n"
307 "loc_FF985DBC:\n"
308 " LDR R0, [R6, #0x18] \n"
309 " LDR R1, [R6, #0x60] \n"
310 " BL sub_FF83A714 \n"
311 " CMP R0, #9 \n"
312 " BEQ loc_FF985D60 \n"
313 " LDR R0, [SP, #0x5C] \n"
314 " CMP R0, #0 \n"
315 " BEQ loc_FF985DE4 \n"
316 "loc_FF985DDC:\n"
317 " MOV R1, #1 \n"
318 " B loc_FF986048 \n"
319 "loc_FF985DE4:\n"
320 " LDR R0, [R6, #0xC] \n"
321 " MOV R4, #5 \n"
322 " CMP R0, #2 \n"
323 " MOV R0, #1 \n"
324 " BNE loc_FF985E10 \n"
325 " BL sub_FFAAD3D0 \n"
326 " BL sub_FFAAD3F8 \n"
327 " STR R4, [R6, #0x44] \n"
328 " BL loc_FF986A38 \n"
329 " STR R10, [R6, #0x44] \n"
330 " B loc_FF985E1C \n"
331 "loc_FF985E10:\n"
332 " BL sub_FFAAC28C \n"
333 " BL sub_FFAAC2EC \n"
334 " STR R4, [R6, #0x44] \n"
335 "loc_FF985E1C:\n"
336 " STR R8, [R6, #0x34] \n"
337 " B loc_FF985C7C \n"
338 "loc_FF985E24:\n"
339 " CMP R5, #1 \n"
340 " BNE loc_FF9860A4 \n"
341 " STR R10, [R6, #0x38] \n"
342 " LDR R0, [R6, #0x6C] \n"
343 " LDR R11, [R4, #0xC] \n"
344 " CMP R0, #0 \n"
345 " LDRNE R9, [SP, #0x58] \n"
346 " LDRNE R10, [SP, #0x54] \n"
347 " BNE loc_FF985F6C \n"
348 " LDR R0, [R6, #0xC] \n"
349 " CMP R0, #2 \n"
350 " BNE loc_FF985EC8 \n"
351 " MOV R1, #0 \n"
352 " LDR R0, =0xFF985B78 \n"
353 " BL sub_FFAAD410 \n"
354 " LDR R2, [R6, #0x64] \n"
355 " ADD R3, SP, #0x5C \n"
356 " STRD R2, [SP, #0x28] \n"
357 " MOV R2, #0x18 \n"
358 " ADD R1, SP, #0x34 \n"
359 " ADD R0, SP, #0x10 \n"
360 " BL sub_FFB9F254 \n"
361 " LDR R1, [R6, #0x84] \n"
362 " LDR R2, [R6, #0x88] \n"
363 " MVN R3, #0 \n"
364 " ADD R0, SP, #0x60 \n"
365 " STMEA SP, {R0-R3} \n"
366 " LDR R0, [SP, #0x58] \n"
367 " LDR R1, [SP, #0x54] \n"
368 " LDR R2, [SP, #0x50] \n"
369 " LDR R3, [SP, #0x4C] \n"
370 " BL sub_FFAAD368 \n"
371 " LDR R0, [R6, #0x18] \n"
372 " LDR R1, [R6, #0x60] \n"
373 " BL sub_FF83A714 \n"
374 " CMP R0, #9 \n"
375 " BEQ loc_FF985D60 \n"
376 " MOV R1, #0 \n"
377 " LDR R0, =0xFF985B6C \n"
378 " BL sub_FFAAD410 \n"
379 " B loc_FF985F30 \n"
380 "loc_FF985EC8:\n"
381 " LDR R0, [R4, #0x20] \n"
382 " LDR R2, [R6, #0x64] \n"
383 " ADD R3, SP, #0x5C \n"
384 " MVN R1, #0 \n"
385 " ADD R9, SP, #0x1C \n"
386 " STMIA R9, {R0-R3} \n"
387 " LDR R3, [R4, #0x1C] \n"
388 " LDR R1, [R6, #0x84] \n"
389 " LDR R2, [R6, #0x88] \n"
390 " ADD R0, SP, #0x60 \n"
391 " ADD R9, SP, #0xC \n"
392 " STMIA R9, {R0-R3} \n"
393 " LDR R1, [SP, #0x50] \n"
394 " LDR R2, [SP, #0x54] \n"
395 " LDR R3, [SP, #0x4C] \n"
396 " STMFA SP, {R1,R3} \n"
397 " STR R2, [SP] \n"
398 " LDMIB R4, {R0,R1} \n"
399 " LDR R3, [SP, #0x58] \n"
400 " MOV R2, R11 \n"
401 " BL sub_FFAAC1D8 \n"
402 " LDR R0, [R6, #0x18] \n"
403 " LDR R1, [R6, #0x60] \n"
404 " BL sub_FF83A714 \n"
405 " CMP R0, #9 \n"
406 " BEQ loc_FF985D60 \n"
407 "loc_FF985F30:\n"
408 " LDR R0, [SP, #0x5C] \n"
409 " CMP R0, #0 \n"
410 " BNE loc_FF985DDC \n"
411 " LDR R0, [R6, #0xC] \n"
412 " CMP R0, #2 \n"
413 " MOV R0, #1 \n"
414 " BNE loc_FF985F54 \n"
415 " BL sub_FFAAD3D0 \n"
416 " B loc_FF985F58 \n"
417 "loc_FF985F54:\n"
418 " BL sub_FFAAC28C \n"
419 "loc_FF985F58:\n"
420 " LDR R0, [SP, #0x60] \n"
421 " LDR R1, [SP, #0x58] \n"
422 " ADD R9, R1, R0 \n"
423 " LDR R1, [SP, #0x54] \n"
424 " SUB R10, R1, R0 \n"
425 "loc_FF985F6C:\n"
426 " LDR R0, [R6, #0xC] \n"
427 " LDR R2, [R6, #0x64] \n"
428 " CMP R0, #2 \n"
429 " ADD R3, SP, #0x5C \n"
430 " BNE loc_FF985FC0 \n"
431 " STRD R2, [SP, #0x28] \n"
432 " MOV R2, #0x18 \n"
433 " ADD R1, SP, #0x34 \n"
434 " ADD R0, SP, #0x10 \n"
435 " BL sub_FFB9F254 \n"
436 " LDR R1, [R6, #0x84] \n"
437 " LDR R2, [R6, #0x88] \n"
438 " LDR R3, [R6, #0x68] \n"
439 " ADD R0, SP, #0x60 \n"
440 " STMEA SP, {R0-R3} \n"
441 " LDR R2, [SP, #0x50] \n"
442 " LDR R3, [SP, #0x4C] \n"
443 " MOV R1, R10 \n"
444 " MOV R0, R9 \n"
445 " BL sub_FFAAD368 \n"
446 " B loc_FF986018 \n"
447 "loc_FF985FC0:\n"
448 " LDR R1, [R6, #0x68] \n"
449 " LDR R0, [R4, #0x20] \n"
450 " STR R1, [SP, #0x20] \n"
451 " STR R0, [SP, #0x1C] \n"
452 " STR R2, [SP, #0x24] \n"
453 " STR R3, [SP, #0x28] \n"
454 " LDR R3, [R4, #0x1C] \n"
455 " LDR R1, [R6, #0x84] \n"
456 " LDR R2, [R6, #0x88] \n"
457 " ADD R0, SP, #0x60 \n"
458 " STR R2, [SP, #0x14] \n"
459 " LDR R2, [SP, #0x50] \n"
460 " STR R1, [SP, #0x10] \n"
461 " STR R3, [SP, #0x18] \n"
462 " LDR R3, [SP, #0x4C] \n"
463 " STR R0, [SP, #0xC] \n"
464 " STMFA SP, {R2,R3} \n"
465 " STR R10, [SP] \n"
466 " LDMIB R4, {R0,R1} \n"
467 " MOV R3, R9 \n"
468 " MOV R2, R11 \n"
469 " BL sub_FFAAC1D8 \n"
470 "loc_FF986018:\n"
471 " LDR R0, [R6, #0x18] \n"
472 " LDR R1, [R6, #0x60] \n"
473 " BL sub_FF83A714 \n"
474 " CMP R0, #9 \n"
475 " BNE loc_FF986038 \n"
476 " MOV R1, #0 \n"
477 "loc_FF986030:\n"
478 " MOV R0, #0x90000 \n"
479 " B loc_FF98604C \n"
480 "loc_FF986038:\n"
481 " LDR R0, [SP, #0x5C] \n"
482 " CMP R0, #0 \n"
483 " BEQ loc_FF986054 \n"
484 " MOV R1, #0 \n"
485 "loc_FF986048:\n"
486 " MOV R0, #0xA0000 \n"
487 "loc_FF98604C:\n"
488 " BL sub_FF985B0C \n"
489 " B loc_FF985C7C \n"
490 "loc_FF986054:\n"
491 " LDR R0, [R6, #0xC] \n"
492 " CMP R0, #2 \n"
493 " MOV R0, #0 \n"
494 " BNE loc_FF98606C \n"
495 " BL sub_FFAAD3D0 \n"
496 " B loc_FF986070 \n"
497 "loc_FF98606C:\n"
498 " BL sub_FFAAC28C \n"
499 "loc_FF986070:\n"
500 " LDR R0, [SP, #0x58] \n"
501 " LDR R1, [SP, #0x60] \n"
502 " BL sub_FFAF2E44 \n"
503 " LDR R0, [R6, #0x68] \n"
504 " LDR R3, =0x71B0 \n"
505 " ADD R1, R0, #1 \n"
506 " STR R1, [R6, #0x68] \n"
507 " STR R3, [SP] \n"
508 " LDR R0, [R6, #0x64] \n"
509 " SUB R3, R3, #4 \n"
510 " AND R2, R0, #0xFF \n"
511 " LDR R0, [SP, #0x60] \n"
512 " BL sub_FFAF098C \n"
513 " LDR R0, =0x71AC \n"
514 " BL set_quality \n"
515 "loc_FF9860A4:\n"
516 " CMP R5, #1 \n"
517 " LDRNEH R0, [R6, #6] \n"
518 " CMPNE R0, #3 \n"
519 " BNE loc_FF985C7C \n"
520 " LDR R0, [R6, #0x6C] \n"
521 " ADD R0, R0, #1 \n"
522 " STR R0, [R6, #0x6C] \n"
523 " LDRH R1, [R6, #6] \n"
524 " CMP R1, #3 \n"
525 " LDRNE R1, [R6, #0x54] \n"
526 " LDREQ R1, =0x3E9 \n"
527 " MUL R0, R1, R0 \n"
528 " LDREQ R1, =0x1770 \n"
529 " LDRNE R1, [R6, #0x50] \n"
530 " BL sub_FFBA18B4 \n"
531 " MOV R4, R0 \n"
532 " BL sub_FFAF31C0 \n"
533 " LDR R0, [R6, #0x8C] \n"
534 " CMP R0, R4 \n"
535 " BNE loc_FF986100 \n"
536 " LDR R0, [R6, #0x3C] \n"
537 " CMP R0, #1 \n"
538 " BNE loc_FF986114 \n"
539 "loc_FF986100:\n"
540 " LDR R1, [R6, #0x98] \n"
541 " MOV R0, R4 \n"
542 " BLX R1 \n"
543 " STR R4, [R6, #0x8C] \n"
544 " STR R8, [R6, #0x3C] \n"
545 "loc_FF986114:\n"
546 " STR R8, [R6, #0x38] \n"
547 " B loc_FF985C7C \n"
548
549 "loc_FF986A38: \n"
550 " B sub_FF986A38 \n"
551 );
552 }