This source file includes following definitions.
- change_video_tables
- movie_record_task
- sub_FF948AC0_my
- sub_FF949648_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 void __attribute__((naked,noinline)) movie_record_task() {
31 asm volatile (
32 " STMFD SP!, {R4,LR} \n"
33 " SUB SP, SP, #4 \n"
34 " MOV R4, SP \n"
35 " B loc_FF94837C \n"
36
37 "loc_FF9482CC:\n"
38 " LDR R3, =0x85418 \n"
39 " LDR R2, [R3] \n"
40 " CMP R2, #0 \n"
41 " BNE loc_FF948368 \n"
42 " SUB R3, R12, #1 \n"
43 " CMP R3, #0xA \n"
44 " LDRLS PC, [PC, R3, LSL#2] \n"
45 " B loc_FF948368 \n"
46 " .long loc_FF948318 \n"
47 " .long loc_FF948320 \n"
48 " .long loc_FF948338 \n"
49 " .long loc_FF948340 \n"
50 " .long loc_FF948348 \n"
51 " .long loc_FF948328 \n"
52 " .long loc_FF948350 \n"
53 " .long loc_FF948330 \n"
54 " .long loc_FF948368 \n"
55 " .long loc_FF948360 \n"
56 " .long loc_FF948358 \n"
57
58 "loc_FF948318:\n"
59 " BL sub_FF9483FC \n"
60 " B loc_FF948364 \n"
61
62 "loc_FF948320:\n"
63 " BL unlock_optical_zoom\n"
64 " BL sub_FF948630 \n"
65 " B loc_FF948364 \n"
66
67 "loc_FF948328:\n"
68 " BL sub_FF948AC0_my \n"
69 " B loc_FF948364 \n"
70
71 "loc_FF948330:\n"
72 " BL sub_FF948F14 \n"
73 " B loc_FF948364 \n"
74
75 "loc_FF948338:\n"
76 " BL sub_FF948D38 \n"
77 " B loc_FF948364 \n"
78
79 "loc_FF948340:\n"
80 " BL sub_FF949120 \n"
81 " B loc_FF948364 \n"
82
83 "loc_FF948348:\n"
84 " BL sub_FF9492E4 \n"
85 " B loc_FF948364 \n"
86
87 "loc_FF948350:\n"
88 " BL sub_FF948FD4 \n"
89 " B loc_FF948364 \n"
90
91 "loc_FF948358:\n"
92 " BL sub_FF9490B4 \n"
93 " B loc_FF948364 \n"
94
95 "loc_FF948360:\n"
96 " BL sub_FF948D88 \n"
97
98 "loc_FF948364:\n"
99 " LDR R1, [SP] \n"
100
101 "loc_FF948368:\n"
102 " LDR R3, =0x85348 \n"
103 " MOV R2, #0 \n"
104 " STR R2, [R1] \n"
105 " LDR R0, [R3] \n"
106 " BL sub_FF822FA0 /*_PostMessageQueue*/ \n"
107
108 "loc_FF94837C:\n"
109 " LDR R3, =0x85344 \n"
110 " MOV R1, R4 \n"
111 " LDR R0, [R3] \n"
112 " MOV R2, #0 \n"
113 " BL sub_FF822B88 /*_ReceiveMessageQueue*/ \n"
114 " LDR R0, [SP] \n"
115 " LDR R12, [R0] \n"
116 " CMP R12, #0xC \n"
117 " MOV R1, R0 \n"
118 " BNE loc_FF9482CC \n"
119 " LDR R3, =0x8533C \n"
120 " LDR R0, [R3] \n"
121 " BL _GiveSemaphore \n"
122 " BL _ExitTask \n"
123 " ADD SP, SP, #4 \n"
124 " LDMFD SP!, {R4,PC} \n"
125 );
126 }
127
128
129
130 void __attribute__((naked,noinline)) sub_FF948AC0_my() {
131 asm volatile (
132 " STMFD SP!, {R4-R11,LR} \n"
133 " LDR R5, =0x85434 \n"
134 " SUB SP, SP, #0x34 \n"
135 " LDR R3, [R5] \n"
136 " CMP R3, #3 \n"
137 " MOV R4, R0 \n"
138 " MOVEQ R3, #4 \n"
139 " STREQ R3, [R5] \n"
140 " LDR R3, =0x854DC \n"
141 " MOV LR, PC \n"
142 " LDR PC, [R3] \n"
143 " LDR R2, [R5] \n"
144 " CMP R2, #4 \n"
145 " BNE loc_FF948C6C \n"
146 " ADD R0, SP, #0x30 \n"
147 " ADD R1, SP, #0x2C \n"
148 " ADD R2, SP, #0x28 \n"
149 " ADD R3, SP, #0x24 \n"
150 " BL sub_FF94A280 \n"
151 " CMP R0, #0 \n"
152 " BNE loc_FF948B3C \n"
153 " LDR R3, =0x85420 \n"
154 " LDR R2, [R3] \n"
155 " CMP R2, #1 \n"
156 " BNE loc_FF948B50 \n"
157 " LDR R2, =0x85470 \n"
158 " LDR R1, =0x85448 \n"
159 " LDR R12, [R2] \n"
160 " LDR R3, [R1] \n"
161 " CMP R12, R3 \n"
162 " BCC loc_FF948B50 \n"
163
164 "loc_FF948B3C:\n"
165 " BL sub_FF948CB0 \n"
166 " BL sub_FF948EE4 \n"
167 " MOV R3, #5 \n"
168 " STR R3, [R5] \n"
169 " B loc_FF948C6C \n"
170
171 "loc_FF948B50:\n"
172 " LDR R12, =0x85478 \n"
173 " LDR R11, =0x85484 \n"
174 " LDMIB R4, {R0-R2} \n"
175 " LDR R10, [R12] \n"
176 " LDR R7, [R11] \n"
177 " LDR R4, [SP, #0x2C] \n"
178 " LDR R5, [SP, #0x28] \n"
179 " LDR R6, [SP, #0x24] \n"
180 " LDR R8, =0x85424 \n"
181 " LDR R3, [SP, #0x30] \n"
182 " ADD R12, SP, #0x20 \n"
183 " ADD LR, SP, #0x1C \n"
184 " MOV R9, #1 \n"
185 " STMEA SP, {R4-R6,R12} \n"
186 " STR R10, [SP, #0x10] \n"
187 " STR R7, [SP, #0x14] \n"
188 " STR LR, [SP, #0x18] \n"
189 " STR R9, [R8] \n"
190 " BL sub_FF89A5B8 \n"
191 " LDR R3, =0x8533C \n"
192 " MOV R1, #0x3E8 \n"
193 " LDR R0, [R3] \n"
194 " BL _TakeSemaphore \n"
195 " CMP R0, #9 \n"
196 " BNE loc_FF948BC4 \n"
197 " BL sub_FF94AA40 \n"
198 " LDR R3, =0x85434 \n"
199 " LDR R0, =0xFF948AA8 /*'JPEGTimeOut'*/ \n"
200 " B loc_FF948BDC \n"
201
202 "loc_FF948BC4:\n"
203 " LDR R5, [SP, #0x1C] \n"
204 " CMP R5, #0 \n"
205 " BEQ loc_FF948BE8 \n"
206 " BL sub_FF94AA40 \n"
207 " LDR R3, =0x85434 \n"
208 " LDR R0, =0xFF948AB4 /*'JPEGICError'*/ \n"
209
210 "loc_FF948BDC:\n"
211 " STR R9, [R3] \n"
212 " BL sub_FF95D754 /*_HardwareDefect_FW*/ \n"
213 " B loc_FF948C6C \n"
214
215 "loc_FF948BE8:\n"
216 " BL sub_FF89A72C \n"
217 " LDR R0, [SP, #0x30] \n"
218 " LDR R1, [SP, #0x20] \n"
219 " BL sub_FF94A764 \n"
220 " LDR R4, =0x85470 \n"
221 " LDR R3, [R4] \n"
222 " ADD R3, R3, #1 \n"
223 " LDR R0, [SP, #0x20] \n"
224 " MOV R1, R11 \n"
225 " STR R3, [R4] \n"
226 " MOV R2, R5 \n"
227 " BL sub_FF949648_my \n"
228 " LDR R3, =0x8545C \n"
229 " LDR R4, [R4] \n"
230 " LDR R1, [R3] \n"
231 " MOV R0, R4 \n"
232 " BL sub_FFBC3704 \n"
233 " CMP R0, #0 \n"
234 " BEQ loc_FF948C48 \n"
235 " LDR R6, =0x85428 \n"
236 " LDR R3, [R6] \n"
237 " CMP R3, #1 \n"
238 " BNE loc_FF948C60 \n"
239 " B loc_FF948C4C \n"
240
241 "loc_FF948C48:\n"
242 " LDR R6, =0x85428 \n"
243
244 "loc_FF948C4C:\n"
245 " MOV R0, R4 \n"
246 " LDR R3, =0x854B8 \n"
247 " MOV LR, PC \n"
248 " LDR PC, [R3] \n"
249 " STR R5, [R6] \n"
250
251 "loc_FF948C60:\n"
252 " LDR R2, =0x85424 \n"
253 " MOV R3, #0 \n"
254 " STR R3, [R2] \n"
255
256 "loc_FF948C6C:\n"
257 " ADD SP, SP, #0x34 \n"
258 " LDMFD SP!, {R4-R11,PC} \n"
259 );
260 }
261
262
263
264 void __attribute__((naked,noinline)) sub_FF949648_my() {
265 asm volatile (
266 " CMP R2, #1 \n"
267 " STMFD SP!, {R4-R7,LR} \n"
268 " MOV R7, R0 \n"
269 " MOV R6, R1 \n"
270
271
272 " LDREQ R3, =CompressionRateTable\n"
273 " LDREQ R2, [R3,#0x18]\n"
274 " STREQ R2, [R6]\n"
275 " LDMEQFD SP!, {R4-R7,PC} \n"
276 " LDR R12, =0x854E8 \n"
277 " LDR R0, [R12] \n"
278 " LDR R3, =0x854F0 \n"
279 " CMP R0, #0 \n"
280 " LDR R1, [R3] \n"
281 " BEQ loc_FF949690 \n"
282 " LDR R2, =0x854F4 \n"
283 " LDR R3, [R2] \n"
284 " CMP R3, #1 \n"
285 " BNE loc_FF9496A4 \n"
286 " B loc_FF949694 \n"
287
288 "loc_FF949690:\n"
289 " LDR R2, =0x854F4 \n"
290
291 "loc_FF949694:\n"
292 " MOV R3, #0 \n"
293 " STR R3, [R2] \n"
294 " STR R7, [R12] \n"
295 " B loc_FF949758 \n"
296
297 "loc_FF9496A4:\n"
298 " LDR R3, =0x854EC \n"
299 " LDR R2, [R3] \n"
300 " LDR R5, =table1 \n"
301 " MOV LR, R2, LSL#2 \n"
302 " LDR R3, [R5, LR] \n"
303 " LDR R4, =table2 \n"
304 " RSB R12, R3, R0 \n"
305 " LDR R2, [R4, LR] \n"
306 " CMP R12, #0 \n"
307 " RSB R0, R2, R0 \n"
308 " BLE loc_FF949704 \n"
309 " ADD R3, R5, #0x14 \n"
310 " LDR R2, [R3, LR] \n"
311 " CMP R2, R12 \n"
312 " ADDGE R1, R1, #1 \n"
313 " BGE loc_FF9496F8 \n"
314 " ADD R3, R5, #0x28 \n"
315 " LDR R2, [R3, LR] \n"
316 " CMP R2, R12 \n"
317 " ADDGE R1, R1, #2 \n"
318 " ADDLT R1, R1, #3 \n"
319
320 "loc_FF9496F8:\n"
321 " CMP R1, #0x1A \n"
322 " MOVGE R1, #0x1A \n"
323 " B loc_FF94973C \n"
324
325 "loc_FF949704:\n"
326 " CMP R0, #0 \n"
327 " BGE loc_FF94973C \n"
328 " ADD R3, R4, #0x14 \n"
329 " LDR R2, [R3, LR] \n"
330 " CMP R2, R0 \n"
331 " SUBLE R1, R1, #1 \n"
332 " BLE loc_FF949734 \n"
333 " ADD R3, R4, #0x28 \n"
334 " LDR R2, [R3, LR] \n"
335 " CMP R2, R0 \n"
336 " SUBLE R1, R1, #2 \n"
337 " SUBGT R1, R1, #3 \n"
338
339 "loc_FF949734:\n"
340 " CMP R1, #0 \n"
341 " MOVLT R1, #0 \n"
342
343 "loc_FF94973C:\n"
344 " LDR R0, =0x854F0 \n"
345 " LDR R3, [R0] \n"
346 " CMP R1, R3 \n"
347 " LDRNE R2, =0x854F4 \n"
348 " MOVNE R3, #1 \n"
349 " STRNE R1, [R0] \n"
350 " STRNE R3, [R2] \n"
351
352 "loc_FF949758:\n"
353 " LDR R3, =0x854F0 \n"
354 " LDR R1, =video_mode \n"
355 " LDR R0, [R3] \n"
356 " LDR R2, =CompressionRateTable \n"
357 " LDR R12, [R1] \n"
358 " LDR LR, [R2, R0, LSL#2] \n"
359 " LDR R3, =0x854E8 \n"
360 " CMP R12, #1 \n"
361 " STR R7, [R3] \n"
362 " STR LR, [R6] \n"
363
364 " LDREQ R3, =video_quality\n"
365 " LDREQ R3, [R3]\n"
366 " LDREQ R3, [R3]\n"
367
368 " MOVEQ R3, #0xB \n"
369 " STREQ R3, [R6] \n"
370 " LDMFD SP!, {R4-R7,PC} \n"
371 );
372 }