This source file includes following definitions.
- change_video_tables
- movie_record_task
- sub_FF942638_my
- sub_FF943DF8_my
- sub_FF9431C0_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_table1[56]={
10 0x10000,0xC000,0x5800, 0x2000, 0x1C6A, 0x1550,0x9C5, 0x38D, 0x3C45, 0x2D34, 0x14B8, 0x788, 0x5F60, 0x4788,
11 0x20C9, 0xBE1, 0x8661, 0x64C9, 0x2E31, 0x10CB,0xB21A, 0x8594, 0x3D39, 0x1642, 0xE249, 0xA9B8, 0x4DC9, 0x1C48,
12 0x117D2,0xD1DF,0x6030, 0x22F9, 0x153D5,0xFEE1,0x74D1, 0x2A79, 0x195F8,0x1307C,0x8B8D, 0x32AA, 0x1E01C,0x16817,
13 0xA509, 0x3C01,0x2328E,0x1A5ED,0xC160, 0x4637,0x28C99,0x1E975,0xE054, 0x5190, 0x2F08B,0x2346B,0x102AF,0x5E0E
14 };
15
16 long def_table2[12]={0xE666,0xACCD,0x4F33,0x1CCD,-0x170A,-0x1148,-0x7EB,-0x2E1,-0x2BC6,-0x20D5,-0xF0C,-0x579};
17
18 long table1[56], table2[12];
19
20 void change_video_tables(int a, int b){
21 int i;
22 for (i=0;i<56;i++) table1[i]=(def_table1[i]*a)/b;
23 for (i=0;i<12;i++) table2[i]=(def_table2[i]*a)/b;
24 }
25
26 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};
27
28
29
30
31 void __attribute__((naked,noinline)) movie_record_task() {
32 asm volatile (
33 " STMFD SP!, {R4,LR} \n"
34 " SUB SP, SP, #4 \n"
35 " MOV R4, SP \n"
36 " B loc_FF941EF4 \n"
37
38 "loc_FF941E44:\n"
39 " LDR R3, =0x7C970 \n"
40 " LDR R2, [R3] \n"
41 " CMP R2, #0 \n"
42 " BNE loc_FF941EE0 \n"
43 " SUB R3, R12, #1 \n"
44 " CMP R3, #0xA \n"
45 " LDRLS PC, [PC, R3, LSL#2] \n"
46 " B loc_FF941EE0 \n"
47 " .long loc_FF941E90 \n"
48 " .long loc_FF941E98 \n"
49 " .long loc_FF941EB0 \n"
50 " .long loc_FF941EB8 \n"
51 " .long loc_FF941EC0 \n"
52 " .long loc_FF941EA0 \n"
53 " .long loc_FF941EC8 \n"
54 " .long loc_FF941EA8 \n"
55 " .long loc_FF941EE0 \n"
56 " .long loc_FF941ED8 \n"
57 " .long loc_FF941ED0 \n"
58
59 "loc_FF941E90:\n"
60 " BL sub_FF941F74 \n"
61 " B loc_FF941EDC \n"
62
63 "loc_FF941E98:\n"
64 " BL sub_FF9421A8 \n"
65 "BL unlock_optical_zoom\n"
66 " B loc_FF941EDC \n"
67
68 "loc_FF941EA0:\n"
69 " BL sub_FF942638_my \n"
70 " B loc_FF941EDC \n"
71
72 "loc_FF941EA8:\n"
73 " BL sub_FF942A8C \n"
74 " B loc_FF941EDC \n"
75
76 "loc_FF941EB0:\n"
77 " BL sub_FF9428B0 \n"
78 " B loc_FF941EDC \n"
79
80 "loc_FF941EB8:\n"
81 " BL sub_FF942C98 \n"
82 " B loc_FF941EDC \n"
83
84 "loc_FF941EC0:\n"
85 " BL sub_FF942E5C \n"
86 " B loc_FF941EDC \n"
87
88 "loc_FF941EC8:\n"
89 " BL sub_FF942B4C \n"
90 " B loc_FF941EDC \n"
91
92 "loc_FF941ED0:\n"
93 " BL sub_FF942C2C \n"
94 " B loc_FF941EDC \n"
95
96 "loc_FF941ED8:\n"
97 " BL sub_FF942900 \n"
98
99 "loc_FF941EDC:\n"
100 " LDR R1, [SP] \n"
101
102 "loc_FF941EE0:\n"
103 " LDR R3, =0x7C8A0 \n"
104 " MOV R2, #0 \n"
105 " STR R2, [R1] \n"
106 " LDR R0, [R3] \n"
107 " BL sub_FF8218F4 /*_PostMessageQueue*/ \n"
108
109 "loc_FF941EF4:\n"
110 " LDR R3, =0x7C89C \n"
111 " MOV R1, R4 \n"
112 " LDR R0, [R3] \n"
113 " MOV R2, #0 \n"
114 " BL sub_FF8214DC /*_ReceiveMessageQueue*/ \n"
115 " LDR R0, [SP] \n"
116 " LDR R12, [R0] \n"
117 " CMP R12, #0xC \n"
118 " MOV R1, R0 \n"
119 " BNE loc_FF941E44 \n"
120 " LDR R3, =0x7C894 \n"
121 " LDR R0, [R3] \n"
122 " BL _GiveSemaphore \n"
123 " BL _ExitTask \n"
124 " ADD SP, SP, #4 \n"
125 " LDMFD SP!, {R4,PC} \n"
126 );
127 }
128
129
130
131 void __attribute__((naked,noinline)) sub_FF942638_my() {
132 asm volatile (
133 " STMFD SP!, {R4-R11,LR} \n"
134 " LDR R5, =0x7C98C \n"
135 " SUB SP, SP, #0x34 \n"
136 " LDR R3, [R5] \n"
137 " CMP R3, #3 \n"
138 " MOV R4, R0 \n"
139 " MOVEQ R3, #4 \n"
140 " STREQ R3, [R5] \n"
141 " LDR R3, =0x7CA34 \n"
142 " MOV LR, PC \n"
143 " LDR PC, [R3] \n"
144 " LDR R2, [R5] \n"
145 " CMP R2, #4 \n"
146 " BNE loc_FF9427E4 \n"
147 " ADD R0, SP, #0x30 \n"
148 " ADD R1, SP, #0x2C \n"
149 " ADD R2, SP, #0x28 \n"
150 " ADD R3, SP, #0x24 \n"
151 " BL sub_FF943DF8_my \n"
152 " CMP R0, #0 \n"
153 " BNE loc_FF9426B4 \n"
154 " LDR R3, =0x7C978 \n"
155 " LDR R2, [R3] \n"
156 " CMP R2, #1 \n"
157 " BNE loc_FF9426C8 \n"
158 " LDR R2, =0x7C9C8 \n"
159 " LDR R1, =0x7C9A0 \n"
160 " LDR R12, [R2] \n"
161 " LDR R3, [R1] \n"
162 " CMP R12, R3 \n"
163 " BCC loc_FF9426C8 \n"
164
165 "loc_FF9426B4:\n"
166 " BL sub_FF942828 \n"
167 " BL sub_FF942A5C \n"
168 " MOV R3, #5 \n"
169 " STR R3, [R5] \n"
170 " B loc_FF9427E4 \n"
171
172 "loc_FF9426C8:\n"
173 " LDR R12, =0x7C9D0 \n"
174 " LDR R11, =0x7C9DC \n"
175 " LDMIB R4, {R0-R2} \n"
176 " LDR R10, [R12] \n"
177 " LDR R7, [R11] \n"
178 " LDR R4, [SP, #0x2C] \n"
179 " LDR R5, [SP, #0x28] \n"
180 " LDR R6, [SP, #0x24] \n"
181 " LDR R8, =0x7C97C \n"
182 " LDR R3, [SP, #0x30] \n"
183 " ADD R12, SP, #0x20 \n"
184 " ADD LR, SP, #0x1C \n"
185 " MOV R9, #1 \n"
186 " STMEA SP, {R4-R6,R12} \n"
187 " STR R10, [SP, #0x10] \n"
188 " STR R7, [SP, #0x14] \n"
189 " STR LR, [SP, #0x18] \n"
190 " STR R9, [R8] \n"
191 " BL sub_FF898720 \n"
192 " LDR R3, =0x7C894 \n"
193 " MOV R1, #0x3E8 \n"
194 " LDR R0, [R3] \n"
195 " BL _TakeSemaphore \n"
196 " CMP R0, #9 \n"
197 " BNE loc_FF94273C \n"
198 " BL sub_FF9445B8 \n"
199 " LDR R3, =0x7C98C \n"
200 " LDR R0, =0xFF942620 /*'JPEGTimeOut'*/ \n"
201 " B loc_FF942754 \n"
202
203 "loc_FF94273C:\n"
204 " LDR R5, [SP, #0x1C] \n"
205 " CMP R5, #0 \n"
206 " BEQ loc_FF942760 \n"
207 " BL sub_FF9445B8 \n"
208 " LDR R3, =0x7C98C \n"
209 " LDR R0, =0xFF94262C /*'JPEGICError'*/ \n"
210
211 "loc_FF942754:\n"
212 " STR R9, [R3] \n"
213 " BL sub_FF956478 /*_HardwareDefect_FW*/ \n"
214 " B loc_FF9427E4 \n"
215
216 "loc_FF942760:\n"
217 " BL sub_FF898894 \n"
218 " LDR R0, [SP, #0x30] \n"
219 " LDR R1, [SP, #0x20] \n"
220 " BL sub_FF9442DC \n"
221 " LDR R4, =0x7C9C8 \n"
222 " LDR R3, [R4] \n"
223 " ADD R3, R3, #1 \n"
224 " LDR R0, [SP, #0x20] \n"
225 " MOV R1, R11 \n"
226 " STR R3, [R4] \n"
227 " MOV R2, R5 \n"
228 " BL sub_FF9431C0_my \n"
229 " LDR R3, =0x7C9B4 \n"
230 " LDR R4, [R4] \n"
231 " LDR R1, [R3] \n"
232 " MOV R0, R4 \n"
233 " BL sub_FFAC66FC \n"
234 " CMP R0, #0 \n"
235 " BEQ loc_FF9427C0 \n"
236 " LDR R6, =0x7C980 \n"
237 " LDR R3, [R6] \n"
238 " CMP R3, #1 \n"
239 " BNE loc_FF9427D8 \n"
240 " B loc_FF9427C4 \n"
241
242 "loc_FF9427C0:\n"
243 " LDR R6, =0x7C980 \n"
244
245 "loc_FF9427C4:\n"
246 " MOV R0, R4 \n"
247 " LDR R3, =0x7CA10 \n"
248 " MOV LR, PC \n"
249 " LDR PC, [R3] \n"
250 " STR R5, [R6] \n"
251
252 "loc_FF9427D8:\n"
253 " LDR R2, =0x7C97C \n"
254 " MOV R3, #0 \n"
255 " STR R3, [R2] \n"
256
257 "loc_FF9427E4:\n"
258 " ADD SP, SP, #0x34 \n"
259 " LDMFD SP!, {R4-R11,PC} \n"
260 ".ltorg \n"
261 );
262 }
263
264
265
266 void __attribute__((naked,noinline)) sub_FF943DF8_my() {
267 asm volatile (
268 " STMFD SP!, {R4-R11,LR} \n"
269 " LDR R5, =0x7CCDC \n"
270 " SUB SP, SP, #0x14 \n"
271 " LDR LR, [R5] \n"
272 " LDR R12, =0x7CCF4 \n"
273 " ADD LR, LR, #1 \n"
274 " LDR R4, [R12] \n"
275 " STR LR, [R5] \n"
276 " LDR R12, =0x7CD70 \n"
277 " STR R0, [SP, #0x10] \n"
278 " STR R1, [SP, #0xC] \n"
279 " STR R2, [SP, #8] \n"
280 " STR R3, [SP, #4] \n"
281 " CMP LR, R4 \n"
282 " LDR R11, [R12] \n"
283 " MOVHI R0, #0x80000001 \n"
284 " BHI loc_FF944290 \n"
285 " LDR R3, =0x7CD58 \n"
286 " MOV R0, LR \n"
287 " LDR R1, [R3] \n"
288 " BL sub_FFAC66FC \n"
289 " CMP R0, #1 \n"
290 " BNE loc_FF944018 \n"
291 " LDR R0, =0x7CD78 \n"
292 " LDR R1, =0x7CCC8 \n"
293 " LDR R3, [R0] \n"
294 " LDR R2, [R1] \n"
295 " CMP R3, R2 \n"
296 " LDREQ R3, =0x7CD74 \n"
297 " LDREQ R5, [R3] \n"
298 " MOVNE R5, R2 \n"
299 " LDR R3, =0x7CCDC \n"
300 " LDR R2, =0x7CD58 \n"
301 " LDR R0, [R3] \n"
302 " LDR R1, [R2] \n"
303 " BL sub_FFAC606C \n"
304 " LDR R3, =0x7CCD0 \n"
305 " ADD R0, R0, #1 \n"
306 " AND R0, R0, #1 \n"
307 " STR R5, [R3, R0, LSL#2] \n"
308 " LDR R3, =0x7CCC4 \n"
309 " LDR R2, [R3] \n"
310 " CMP R5, R2 \n"
311 " BHI loc_FF943EC8 \n"
312 " LDR R4, =0x7CD14 \n"
313 " LDR R3, [R4] \n"
314 " ADD R3, R5, R3 \n"
315 " ADD R3, R3, #8 \n"
316 " CMP R2, R3 \n"
317 " BCS loc_FF943ECC \n"
318
319 "loc_FF943EC0:\n"
320 " MOV R0, #0x80000003 \n"
321 " B loc_FF944290 \n"
322
323 "loc_FF943EC8:\n"
324 " LDR R4, =0x7CD14 \n"
325
326 "loc_FF943ECC:\n"
327 " LDR R3, [R4] \n"
328 " LDR R2, =0x7CD78 \n"
329 " ADD R1, R5, R3 \n"
330 " LDR R3, [R2] \n"
331 " ADD R2, R1, #8 \n"
332 " CMP R2, R3 \n"
333 " BLS loc_FF943F18 \n"
334 " LDR R2, =0x7CD74 \n"
335 " LDR R0, =0x7CCC4 \n"
336 " RSB R3, R3, R1 \n"
337 " LDR R1, [R2] \n"
338 " ADD R3, R3, #8 \n"
339 " LDR R2, [R0] \n"
340 " ADD R1, R1, R3 \n"
341 " CMP R2, R1 \n"
342 " BCC loc_FF943EC0 \n"
343 " LDR R3, =0x7CCC8 \n"
344 " STR R1, [R3] \n"
345 " B loc_FF943F20 \n"
346
347 "loc_FF943F18:\n"
348 " LDR R3, =0x7CCC8 \n"
349 " STR R2, [R3] \n"
350
351 "loc_FF943F20:\n"
352 " LDR R3, [R4] \n"
353 " LDR R12, =0x7CD28 \n"
354 " ADD R3, R3, #0x18 \n"
355 " LDR R2, [R12, #4] \n"
356 " MOV R0, R3 \n"
357 " MOV R1, #0 \n"
358 " CMP R1, R2 \n"
359 " BHI loc_FF944164 \n"
360 " BNE loc_FF943F50 \n"
361 " LDR R3, [R12] \n"
362 " CMP R0, R3 \n"
363 " BHI loc_FF944164 \n"
364
365 "loc_FF943F50:\n"
366 " LDR R4, [R4] \n"
367 " LDR LR, =0x7CD30 \n"
368 " STR R4, [SP] \n"
369 " LDR R12, =0x7CD28 \n"
370 " LDR R3, =0x7CCDC \n"
371 " LDMIA LR, {R7,R8} \n"
372 " LDMIA R12, {R5,R6} \n"
373 " LDR R10, [R3] \n"
374 " LDR R2, =0x7CD58 \n"
375 " MOV R3, R4 \n"
376 " MOV R4, #0 \n"
377 " ADDS R7, R7, R3 \n"
378 " ADC R8, R8, R4 \n"
379 " LDR R9, [R2] \n"
380 " SUBS R5, R5, R3 \n"
381 " SBC R6, R6, R4 \n"
382 " MVN R2, #0 \n"
383 " MVN R1, #0x17 \n"
384 " ADDS R5, R5, R1 \n"
385 " MOV R4, #0 \n"
386 " MOV R3, #0x18 \n"
387 " ADC R6, R6, R2 \n"
388 " ADDS R7, R7, R3 \n"
389 " ADC R8, R8, R4 \n"
390 " STMIA R12, {R5,R6} \n"
391 " SUB R0, R10, #1 \n"
392 " MOV R1, R9 \n"
393 " STMIA LR, {R7,R8} \n"
394 " BL sub_FFAC606C \n"
395 " CMP R10, #1 \n"
396 " MLA R0, R9, R0, R0 \n"
397 " BEQ loc_FF944018 \n"
398 " SUB R3, R0, #1 \n"
399 " MOV R3, R3, LSL#4 \n"
400 " ADD R4, R11, #0x10 \n"
401 " ADD R5, R11, #0x14 \n"
402 " LDR R1, [R5, R3] \n"
403 " LDR R2, [R4, R3] \n"
404 " LDR LR, =0x62773130 \n"
405 " ADD R2, R2, R1 \n"
406 " MOV R3, R0, LSL#4 \n"
407 " ADD R2, R2, #8 \n"
408 " MOV R0, #0 \n"
409 " ADD R12, R11, #0xC \n"
410 " ADD R1, R11, #8 \n"
411 " STR LR, [R1, R3] \n"
412 " STR R0, [R12, R3] \n"
413 " STR R2, [R4, R3] \n"
414 " LDR R0, [SP] \n"
415 " STR R0, [R5, R3] \n"
416
417 "loc_FF944018:\n"
418 " LDR R2, =0x7CCC8 \n"
419 " LDR R3, =0x7CD78 \n"
420 " LDR R1, [R2] \n"
421 " LDR R0, [R3] \n"
422 " ADD R3, R1, #9 \n"
423 " CMP R3, R0 \n"
424 " BLS loc_FF944054 \n"
425 " LDR R2, =0x7CD74 \n"
426 " LDR R3, [R2] \n"
427 " ADD R3, R3, R1 \n"
428 " RSB R3, R0, R3 \n"
429 " LDR R0, [SP, #0x10] \n"
430 " ADD R3, R3, #8 \n"
431 " STR R3, [R0] \n"
432 " B loc_FF944060 \n"
433
434 "loc_FF944054:\n"
435 " ADD R3, R1, #8 \n"
436 " LDR R1, [SP, #0x10] \n"
437 " STR R3, [R1] \n"
438
439 "loc_FF944060:\n"
440 " LDR R2, [SP, #0x10] \n"
441 " LDR R1, =0x7CD24 \n"
442 " LDR R3, =0x7CD78 \n"
443 " LDR R12, [R2] \n"
444 " LDR R2, [R1] \n"
445 " LDR R0, [R3] \n"
446 " ADD R3, R12, R2 \n"
447 " CMP R3, R0 \n"
448 " BLS loc_FF9440B4 \n"
449 " LDR R2, [SP, #0xC] \n"
450 " RSB R0, R12, R0 \n"
451 " STR R0, [R2] \n"
452 " LDR R2, =0x7CD74 \n"
453 " LDR R3, [R1] \n"
454 " LDR R1, [R2] \n"
455 " RSB R3, R0, R3 \n"
456 " LDR R0, [SP, #8] \n"
457 " STR R1, [R0] \n"
458 " LDR R1, [SP, #4] \n"
459 " STR R3, [R1] \n"
460 " B loc_FF9440D0 \n"
461
462 "loc_FF9440B4:\n"
463 " LDR R0, [SP, #0xC] \n"
464 " STR R2, [R0] \n"
465 " LDR R1, [SP, #4] \n"
466 " MOV R3, #0 \n"
467 " STR R3, [R1] \n"
468 " LDR R2, [SP, #8] \n"
469 " STR R3, [R2] \n"
470
471 "loc_FF9440D0:\n"
472 " LDR R0, =0x7CCC8 \n"
473 " LDR R1, =0x7CCC4 \n"
474 " LDR R3, [R0] \n"
475 " LDR R2, [R1] \n"
476 " CMP R3, R2 \n"
477 " BHI loc_FF9440FC \n"
478 " LDR R0, [SP, #0xC] \n"
479 " LDR R3, [R0] \n"
480 " ADD R3, R12, R3 \n"
481 " CMP R2, R3 \n"
482 " BCC loc_FF943EC0 \n"
483
484 "loc_FF9440FC:\n"
485 " LDR R1, [SP, #8] \n"
486 " LDR R2, [R1] \n"
487 " CMP R2, #0 \n"
488 " BEQ loc_FF944130 \n"
489 " LDR R3, =0x7CCC4 \n"
490 " LDR R1, [R3] \n"
491 " CMP R2, R1 \n"
492 " BHI loc_FF944130 \n"
493 " LDR R0, [SP, #4] \n"
494 " LDR R3, [R0] \n"
495 " ADD R3, R2, R3 \n"
496 " CMP R1, R3 \n"
497 " BCC loc_FF943EC0 \n"
498
499 "loc_FF944130:\n"
500 " LDR R3, =0x7CD24 \n"
501 " LDR R0, =0x7CD28 \n"
502 " LDR R2, [R3] \n"
503 " LDR R3, [R0, #4] \n"
504 " ADD R2, R2, #0x18 \n"
505 " MOV R1, R2 \n"
506 " MOV R2, #0 \n"
507 " CMP R2, R3 \n"
508 " BHI loc_FF944164 \n"
509 " BNE loc_FF94416C \n"
510 " LDR R3, [R0] \n"
511 " CMP R1, R3 \n"
512 " BLS loc_FF94416C \n"
513
514 "loc_FF944164:\n"
515 " MOV R0, #0x80000005 \n"
516 " B loc_FF944290 \n"
517
518 "loc_FF94416C:\n"
519 " LDR R1, =0x7CD0C \n"
520 " LDR R0, =0x7CD58 \n"
521 " LDR R3, [R1] \n"
522 " LDR R2, [R0] \n"
523 " ADD R3, R3, R2, LSL#4 \n"
524 " ADD R3, R3, R3, LSL#2 \n"
525 " LDR R12, =0x7CD28 \n"
526 " MOV R3, R3, LSL#1 \n"
527 " ADD R3, R3, #0xA0 \n"
528 " LDR R2, [R12, #4] \n"
529 " MOV R0, R3 \n"
530 " MOV R1, #0 \n"
531 " CMP R1, R2 \n"
532 " BHI loc_FF9441B4 \n"
533 " BNE loc_FF9441D8 \n"
534 " LDR R3, [R12] \n"
535 " CMP R0, R3 \n"
536 " BLS loc_FF9441D8 \n"
537
538 "loc_FF9441B4:\n"
539 " LDR R4, =0x7CD40 \n"
540 " LDR R1, [R4] \n"
541 " CMP R1, #0 \n"
542 " BNE loc_FF9441D8 \n"
543 " MOV R0, #0x3140 \n"
544 " ADD R0, R0, #8 \n"
545 " BL _PostLogicalEventToUI \n"
546 " MOV R3, #1 \n"
547 " STR R3, [R4] \n"
548
549 "loc_FF9441D8:\n"
550 " LDR R1, =0x7CD0C \n"
551 " LDR R0, =0x7CD58 \n"
552 " LDR R2, [R1] \n"
553 " LDR R3, [R0] \n"
554 " LDR R0, =0x7CD30 \n"
555 " ADD R2, R2, R3, LSL#4 \n"
556 " MVN R3, #0x9F \n"
557 " ADD R2, R2, R2, LSL#2 \n"
558 " ADD R3, R3, #0x40000000 \n"
559 " SUB R3, R3, R2, LSL#1 \n"
560 " LDR R1, [R0, #4] \n"
561 " MOV R4, R3 \n"
562 " MOV R5, #0 \n"
563 " CMP R1, R5 \n"
564 " BHI loc_FF944224 \n"
565 " BNE loc_FF944248 \n"
566 " LDR R3, [R0] \n"
567 " CMP R3, R4 \n"
568 " BLS loc_FF944248 \n"
569
570 "loc_FF944224:\n"
571 " LDR R4, =0x7CD40 \n"
572 " LDR R1, [R4] \n"
573 " CMP R1, #0 \n"
574 " BNE loc_FF944248 \n"
575 " MOV R0, #0x3140 \n"
576 " ADD R0, R0, #8 \n"
577 " BL _PostLogicalEventToUI \n"
578 " MOV R3, #1 \n"
579 " STR R3, [R4] \n"
580
581 "loc_FF944248:\n"
582 " LDR R3, =0x7CD30 \n"
583 " LDR R12, =0x7CD24 \n"
584 " LDMIA R3, {R1,R2} \n"
585 " LDR R0, [R12] \n"
586 " MOV R4, #0 \n"
587 " MOV R3, #0x18 \n"
588 " ADDS R1, R1, R0 \n"
589 " ADC R2, R2, #0 \n"
590 " ADDS R1, R1, R3 \n"
591 " ADC R2, R2, R4 \n"
592 " CMP R2, #0 \n"
593 " BHI loc_FF944284 \n"
594 " BNE loc_FF94428C \n"
595 " CMP R1, #0x40000000 \n"
596 "B loc_A \n"
597
598
599 "loc_FF944284:\n"
600 " MOV R0, #0x80000007 \n"
601 " B loc_FF944290 \n"
602
603 "loc_FF94428C:\n"
604 "loc_A: \n"
605 " MOV R0, #0 \n"
606
607 "loc_FF944290:\n"
608 " ADD SP, SP, #0x14 \n"
609 " LDMFD SP!, {R4-R11,PC} \n"
610 ".ltorg \n"
611 );
612 }
613
614
615
616 void __attribute__((naked,noinline)) sub_FF9431C0_my() {
617 asm volatile (
618 " CMP R2, #1 \n"
619 " STMFD SP!, {R4-R7,LR} \n"
620 " MOV R7, R0 \n"
621 " MOV R6, R1 \n"
622 " MOVEQ R3, #0x79 \n"
623 " STREQ R3, [R6] \n"
624 " LDMEQFD SP!, {R4-R7,PC} \n"
625 " LDR R12, =0x7CA40 \n"
626 " LDR R0, [R12] \n"
627 " LDR R3, =0x7CA48 \n"
628 " CMP R0, #0 \n"
629 " LDR R1, [R3] \n"
630 " BEQ loc_FF943208 \n"
631 " LDR R2, =0x7CA4C \n"
632 " LDR R3, [R2] \n"
633 " CMP R3, #1 \n"
634 " BNE loc_FF94321C \n"
635 " B loc_FF94320C \n"
636
637 "loc_FF943208:\n"
638 " LDR R2, =0x7CA4C \n"
639
640 "loc_FF94320C:\n"
641 " MOV R3, #0 \n"
642 " STR R3, [R2] \n"
643 " STR R7, [R12] \n"
644 " B loc_FF9432D0 \n"
645
646 "loc_FF94321C:\n"
647 " LDR R3, =0x7CA44 \n"
648 " LDR R2, [R3] \n"
649
650 "LDR R5, =table1\n"
651 " MOV LR, R2, LSL#2 \n"
652 " LDR R3, [R5, LR] \n"
653
654 "LDR R4, =table2\n"
655 " RSB R12, R3, R0 \n"
656 " LDR R2, [R4, LR] \n"
657 " CMP R12, #0 \n"
658 " RSB R0, R2, R0 \n"
659 " BLE loc_FF94327C \n"
660 " ADD R3, R5, #0x14 \n"
661 " LDR R2, [R3, LR] \n"
662 " CMP R2, R12 \n"
663 " ADDGE R1, R1, #1 \n"
664 " BGE loc_FF943270 \n"
665 " ADD R3, R5, #0x28 \n"
666 " LDR R2, [R3, LR] \n"
667 " CMP R2, R12 \n"
668 " ADDGE R1, R1, #2 \n"
669 " ADDLT R1, R1, #3 \n"
670
671 "loc_FF943270:\n"
672
673
674 "CMP R1, #0x1A\n"
675 "MOVGE R1, #0x1A\n"
676 " B loc_FF9432B4 \n"
677
678 "loc_FF94327C:\n"
679 " CMP R0, #0 \n"
680 " BGE loc_FF9432B4 \n"
681 " ADD R3, R4, #0x14 \n"
682 " LDR R2, [R3, LR] \n"
683 " CMP R2, R0 \n"
684 " SUBLE R1, R1, #1 \n"
685 " BLE loc_FF9432AC \n"
686 " ADD R3, R4, #0x28 \n"
687 " LDR R2, [R3, LR] \n"
688 " CMP R2, R0 \n"
689 " SUBLE R1, R1, #2 \n"
690 " SUBGT R1, R1, #3 \n"
691
692 "loc_FF9432AC:\n"
693 " CMP R1, #0 \n"
694 " MOVLT R1, #0 \n"
695
696 "loc_FF9432B4:\n"
697 " LDR R0, =0x7CA48 \n"
698 " LDR R3, [R0] \n"
699 " CMP R1, R3 \n"
700 " LDRNE R2, =0x7CA4C \n"
701 " MOVNE R3, #1 \n"
702 " STRNE R1, [R0] \n"
703 " STRNE R3, [R2] \n"
704
705 "loc_FF9432D0:\n"
706 " LDR R3, =0x7CA48 \n"
707
708 "LDR R1, =video_mode\n"
709 " LDR R0, [R3] \n"
710
711 "LDR R2, =CompressionRateTable\n"
712 " LDR R12, [R1] \n"
713 "LDR R12, [R12]\n"
714 " LDR LR, [R2, R0, LSL#2] \n"
715 " LDR R3, =0x7CA40 \n"
716 " CMP R12, #1 \n"
717 " STR R7, [R3] \n"
718 " STR LR, [R6] \n"
719
720 "LDREQ R3, =video_quality\n"
721 "LDREQ R3, [R3]\n"
722 "LDREQ R3, [R3]\n"
723 " STREQ R3, [R6] \n"
724 " LDMFD SP!, {R4-R7,PC} \n"
725 );
726 }