This source file includes following definitions.
- change_video_tables
- movie_record_task
- sub_FF990F74_my
- sub_FF991E24_my
1 #include "conf.h"
2
3 int *video_quality = &conf.video_quality;
4 int *video_mode = &conf.video_mode;
5
6 long def_table1[12]={0x2000,0x38D,0x788,0x5800,0x9C5,0x14B8,0x10000,0x1C6A,0x3C45,0x20000,0x387A,0x7813};
7
8 long def_table2[12]={0x1CCD,-0x2E1,-0x579,0x4F33,-0x7EB,-0xF0C,0xE666,-0x170A,-0x2BC6,0x1CC39,-0x2F5B,-0x59F0};
9
10 long table1[12], table2[12];
11
12 void change_video_tables(int a, int b){
13 int i;
14 for (i=0;i<12;i++) {table1[i]=(def_table1[i]*a)/b; table2[i]=(def_table2[i]*a)/b;}
15 }
16
17 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};
18
19
20 void __attribute__((naked,noinline)) movie_record_task(){
21 asm volatile(
22 "STMFD SP!, {R4,R5,LR}\n"
23 "SUB SP, SP, #4\n"
24 "MOV R5, SP\n"
25 "MOV R4, #0\n"
26 "loc_FF9907AC:\n"
27 "LDR R3, =0x770FC\n"
28 "MOV R2, #0\n"
29 "LDR R0, [R3]\n"
30 "MOV R1, R5\n"
31 "BL sub_FF8213F8\n"
32 "LDR R3, =0x771D0\n"
33 "LDR R2, [R3]\n"
34 "CMP R2, #0\n"
35 "BNE loc_FF990858\n"
36 "LDR R1, [SP]\n"
37 "LDR R3, [R1]\n"
38 "SUB R3, R3, #2\n"
39 "MOV R0, R1\n"
40 "CMP R3, #9\n"
41 "LDRLS PC, [PC,R3,LSL#2]\n"
42 "B loc_FF99085C\n"
43 ".long loc_FF99081C\n"
44 ".long loc_FF990834\n"
45 ".long loc_FF99083C\n"
46 ".long loc_FF990844\n"
47 ".long loc_FF990824\n"
48 ".long loc_FF99084C\n"
49 ".long loc_FF99082C\n"
50 ".long loc_FF99085C\n"
51 ".long loc_FF990854\n"
52 ".long loc_FF990814\n"
53 "loc_FF990814:\n"
54
55 "BL sub_FF9908C8\n"
56 "B loc_FF990858\n"
57 "loc_FF99081C:\n"
58
59 "BL unlock_optical_zoom\n"
60 "BL sub_FF990AAC\n"
61 "B loc_FF990858\n"
62 "loc_FF990824:\n"
63
64 "BL sub_FF990F74_my\n"
65 "B loc_FF990858\n"
66 "loc_FF99082C:\n"
67
68 "BL sub_FF991660\n"
69 "B loc_FF990858\n"
70 "loc_FF990834:\n"
71
72 "BL sub_FF991244\n"
73 "B loc_FF990858\n"
74 "loc_FF99083C:\n"
75
76 "BL sub_FF9917FC\n"
77 "B loc_FF990858\n"
78 "loc_FF990844:\n"
79
80 "BL sub_FF991A2C\n"
81 "B loc_FF990858\n"
82 "loc_FF99084C:\n"
83
84 "BL sub_FF9916E8\n"
85 "B loc_FF990858\n"
86 "loc_FF990854:\n"
87
88 "BL sub_FF991294\n"
89 "loc_FF990858:\n"
90
91 "LDR R1, [SP]\n"
92 "loc_FF99085C:\n"
93
94 "LDR R3, =0x77100\n"
95 "STR R4, [R1]\n"
96 "LDR R0, [R3]\n"
97 "MOV R2, R4\n"
98 "BL sub_FF821810\n"
99 "B loc_FF9907AC\n"
100 );
101 }
102
103
104 void __attribute__((naked,noinline)) sub_FF990F74_my(){
105 asm volatile(
106 "STMFD SP!, {R4-R11,LR}\n"
107 "LDR R5, =0x771E8\n"
108 "SUB SP, SP, #0x34\n"
109 "LDR R3, [R5]\n"
110 "MOV R2, #0\n"
111 "CMP R3, #3\n"
112 "STR R2, [SP,#0x24]\n"
113 "MOV R4, R0\n"
114 "STR R2, [SP,#0x2C]\n"
115 "MOVEQ R3, #4\n"
116 "STREQ R3, [R5]\n"
117 "LDR R3, =0x77284\n"
118 "MOV LR, PC\n"
119 "LDR PC, [R3]\n"
120 "LDR R2, [R5]\n"
121 "CMP R2, #4\n"
122 "BNE loc_FF99116C\n"
123 "ADD R0, SP, #0x30\n"
124 "ADD R1, SP, #0x2C\n"
125 "ADD R2, SP, #0x28\n"
126 "ADD R3, SP, #0x24\n"
127 "BL sub_FF992A98\n"
128 "CMP R0, #0\n"
129 "BNE loc_FF990FFC\n"
130 "LDR R3, =0x771D8\n"
131 "LDR R2, [R3]\n"
132 "CMP R2, #1\n"
133 "BNE loc_FF991010\n"
134 "LDR R2, =0x77214\n"
135 "LDR R1, =0x771EC\n"
136 "LDR R12, [R2]\n"
137 "LDR R3, [R1]\n"
138 "CMP R12, R3\n"
139 "BCC loc_FF991010\n"
140 "loc_FF990FFC:\n"
141 "BL sub_FF9911BC\n"
142 "BL sub_FF991620\n"
143 "MOV R3, #5\n"
144 "STR R3, [R5]\n"
145 "B loc_FF99116C\n"
146 "loc_FF991010:\n"
147
148 "LDR R8, [SP,#0x2C]\n"
149 "CMP R8, #0\n"
150 "BEQ loc_FF9910EC\n"
151 "LDR R12, =0x7721C\n"
152 "LDR R9, =0x77228\n"
153 "LDR R11, =0x771DC\n"
154 "LDR R7, [R12]\n"
155 "ADD R5, SP, #0x24\n"
156 "LDMIA R5, {R5,LR}\n"
157 "LDR R6, [R9]\n"
158 "MOV R10, #1\n"
159 "LDMIB R4, {R0-R2}\n"
160 "LDR R3, [SP,#0x30]\n"
161 "ADD R12, SP, #0x20\n"
162 "STR R10, [R11]\n"
163 "ADD R4, SP, #0x1C\n"
164 "STMEA SP, {R8,LR}\n"
165 "STR R5, [SP,#8]\n"
166 "STR R12, [SP,#0xC]\n"
167 "STR R7, [SP,#0x10]\n"
168 "STR R6, [SP,#0x14]\n"
169 "STR R4, [SP,#0x18]\n"
170 "BL sub_FF8A8CB0\n"
171 "LDR R3, =0x770F4\n"
172 "MOV R1, #0x3E8\n"
173 "LDR R0, [R3]\n"
174 "BL sub_FF821FA4\n"
175 "CMP R0, #9\n"
176 "BNE loc_FF991094\n"
177 "BL sub_FF993328\n"
178 "LDR R3, =0x771E8\n"
179 "LDR R0, =0xFF990F5C\n"
180 "B loc_FF9910AC\n"
181 "loc_FF991094:\n"
182 "LDR R4, [SP,#0x1C]\n"
183 "CMP R4, #0\n"
184 "BEQ loc_FF9910B8\n"
185 "BL sub_FF993328\n"
186 "LDR R3, =0x771E8\n"
187 "LDR R0, =0xFF990F68\n"
188 "loc_FF9910AC:\n"
189 "STR R10, [R3]\n"
190 "BL sub_FF9AD184\n"
191 "B loc_FF99116C\n"
192 "loc_FF9910B8:\n"
193 "BL sub_FF8A8E0C\n"
194 "LDR R0, [SP,#0x30]\n"
195 "LDR R1, [SP,#0x20]\n"
196 "BL sub_FF992F80\n"
197 "LDR R12, =0x77210\n"
198 "LDR R3, [R12]\n"
199 "ADD R3, R3, #1\n"
200 "LDR R0, [SP,#0x20]\n"
201 "MOV R1, R9\n"
202 "MOV R2, R4\n"
203 "STR R3, [R12]\n"
204 "BL sub_FF991E24_my\n"
205 "B loc_FF9910F0\n"
206 "loc_FF9910EC:\n"
207 "LDR R11, =0x771DC\n"
208 "loc_FF9910F0:\n"
209 "LDR R4, =0x77214\n"
210 "LDR R2, =0x77234\n"
211 "LDR R3, [R4]\n"
212 "LDR R1, [R2]\n"
213 "LDR R12, =0x77230\n"
214 "ADD R3, R3, #1\n"
215 "MUL R0, R1, R3\n"
216 "LDR R1, [R12]\n"
217 "STR R3, [R4]\n"
218 "BL sub_FFB9286C\n"
219 "LDR R6, =0x7722C\n"
220 "MOV R4, R0\n"
221 "BL sub_FF993364\n"
222 "LDR R3, [R6]\n"
223 "CMP R3, R4\n"
224 "BNE loc_FF991144\n"
225 "LDR R5, =0x771E0\n"
226 "LDR R3, [R5]\n"
227 "CMP R3, #1\n"
228 "BNE loc_FF991164\n"
229 "B loc_FF991148\n"
230 "loc_FF991144:\n"
231 "LDR R5, =0x771E0\n"
232 "loc_FF991148:\n"
233 "LDR R2, =0x77268\n"
234 "MOV R0, R4\n"
235 "MOV LR, PC\n"
236 "LDR PC, [R2]\n"
237 "MOV R3, #0\n"
238 "STR R3, [R5]\n"
239 "STR R4, [R6]\n"
240 "loc_FF991164:\n"
241 "MOV R3, #0\n"
242 "STR R3, [R11]\n"
243 "loc_FF99116C:\n"
244
245 "ADD SP, SP, #0x34\n"
246 "LDMFD SP!, {R4-R11,PC}\n"
247
248 );
249 }
250
251 void __attribute__((naked,noinline)) sub_FF991E24_my(){
252 asm volatile(
253 "CMP R2, #1\n"
254 "STMFD SP!, {R4-R7,LR}\n"
255 "MOV R7, R0\n"
256 "MOV R6, R1\n"
257 "MOVEQ R3, #0x79\n"
258 "STREQ R3, [R6]\n"
259 "LDMEQFD SP!, {R4-R7,PC}\n"
260 "LDR R12, =0x772C8\n"
261 "LDR R0, [R12]\n"
262 "LDR R3, =0x772D0\n"
263 "CMP R0, #0\n"
264 "LDR R1, [R3]\n"
265 "BEQ loc_FF991E6C\n"
266 "LDR R2, =0x772D4\n"
267 "LDR R3, [R2]\n"
268 "CMP R3, #1\n"
269 "BNE loc_FF991E80\n"
270 "B loc_FF991E70\n"
271 "loc_FF991E6C:\n"
272 "LDR R2, =0x772D4\n"
273 "loc_FF991E70:\n"
274 "MOV R3, #0\n"
275 "STR R3, [R2]\n"
276 "STR R7, [R12]\n"
277 "B loc_FF991F38\n"
278 "loc_FF991E80:\n"
279 "LDR R2, =0x772CC\n"
280 "LDR R3, [R2]\n"
281 "LDR R5, =table1\n"
282 "ADD R3, R3, R3,LSL#1\n"
283 "MOV LR, R3,LSL#2\n"
284 "LDR R2, [R5,LR]\n"
285 "LDR R4, =table2\n"
286 "RSB R12, R2, R0\n"
287 "LDR R3, [R4,LR]\n"
288 "CMP R12, #0\n"
289 "RSB R0, R3, R0\n"
290 "BLE loc_FF991EE4\n"
291 "ADD R3, R5, #4\n"
292 "LDR R2, [R3,LR]\n"
293 "CMP R2, R12\n"
294 "ADDGE R1, R1, #1\n"
295 "BGE loc_FF991ED8\n"
296 "ADD R3, R5, #8\n"
297 "LDR R2, [R3,LR]\n"
298 "CMP R2, R12\n"
299 "ADDGE R1, R1, #2\n"
300 "ADDLT R1, R1, #3\n"
301 "loc_FF991ED8:\n"
302
303
304 "CMP R1, #0x1A\n"
305 "MOVGE R1, #0x1A\n"
306
307 "B loc_FF991F1C\n"
308 "loc_FF991EE4:\n"
309 "CMP R0, #0\n"
310 "BGE loc_FF991F1C\n"
311 "ADD R3, R4, #4\n"
312 "LDR R2, [R3,LR]\n"
313 "CMP R2, R0\n"
314 "SUBLE R1, R1, #1\n"
315 "BLE loc_FF991F14\n"
316 "ADD R3, R4, #8\n"
317 "LDR R2, [R3,LR]\n"
318 "CMP R2, R0\n"
319 "SUBLE R1, R1, #2\n"
320 "SUBGT R1, R1, #3\n"
321 "loc_FF991F14:\n"
322 "CMP R1, #0\n"
323 "MOVLT R1, #0\n"
324 "loc_FF991F1C:\n"
325
326 "LDR R0, =0x772D0\n"
327 "LDR R3, [R0]\n"
328 "CMP R1, R3\n"
329 "LDRNE R2, =0x772D4\n"
330 "MOVNE R3, #1\n"
331 "STRNE R1, [R0]\n"
332 "STRNE R3, [R2]\n"
333 "loc_FF991F38:\n"
334 "LDR R3, =0x772D0\n"
335
336 "LDR R1, =video_mode\n"
337 "LDR R0, [R3]\n"
338 "LDR R2, =CompressionRateTable\n"
339 "LDR R12, [R1]\n"
340 "LDR R12, [R12]\n"
341 "LDR LR, [R2,R0,LSL#2]\n"
342 "LDR R3, =0x772C8\n"
343 "CMP R12, #1\n"
344 "STR R7, [R3]\n"
345 "STR LR, [R6]\n"
346
347
348 "LDREQ R3, =video_quality\n"
349 "LDREQ R3, [R3]\n"
350 "LDREQ R3, [R3]\n"
351
352 "STREQ R3, [R6]\n"
353 "LDMFD SP!, {R4-R7,PC}\n"
354 );
355 }
356