This source file includes following definitions.
- change_video_tables
- movie_record_task
- sub_FF98565C_my
- sub_FF98650C_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[9]= {0x2000,0x38D,0x788,0x5800,0x9C5,0x14B8,0x10000,0x1C6A,0x3C45};
7 long def_table2[9]= {0x1CCD,-0x2E1,-0x579,0x4F33,-0x7EB,-0xF0C,0xE666,-0x170A,-0x2BC6};
8
9 long table1[9], table2[9];
10
11 void change_video_tables(int a, int b) {
12 int i;
13 for(i=0; i<9; i++) {
14 table1[i]=(def_table1[i]*a)/b;
15 table2[i]=(def_table2[i]*a)/b;
16 }
17 }
18
19
20 long CompressionRateTable[]= {0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 9, 7, 6, 5, 4, 3, 2, 1};
21
22
23 void __attribute__((naked,noinline)) movie_record_task() {
24 asm volatile(
25 "STMFD SP!, {R4,R5,LR}\n"
26 "SUB SP, SP, #4\n"
27 "MOV R5, SP\n"
28 "MOV R4, #0\n"
29
30 "loc_FF984E94:\n"
31 "LDR R3, =0x76324\n"
32 "MOV R2, #0\n"
33 "LDR R0, [R3]\n"
34 "MOV R1, R5\n"
35 "BL sub_FF8213F8\n"
36 "LDR R3, =0x763F8\n"
37 "LDR R2, [R3]\n"
38 "CMP R2, #0\n"
39 "BNE loc_FF984F40\n"
40 "LDR R1, [SP]\n"
41 "LDR R3, [R1]\n"
42 "SUB R3, R3, #2\n"
43 "MOV R0, R1\n"
44 "CMP R3, #9\n"
45 "LDRLS PC, [PC,R3,LSL#2]\n"
46 "B loc_FF984F44\n"
47
48 ".long loc_FF984F04\n"
49 ".long loc_FF984F1C\n"
50 ".long loc_FF984F24\n"
51 ".long loc_FF984F2C\n"
52 ".long loc_FF984F0C\n"
53 ".long loc_FF984F34\n"
54 ".long loc_FF984F14\n"
55 ".long loc_FF984F44\n"
56 ".long loc_FF984F3C\n"
57 ".long loc_FF984EFC\n"
58
59 "loc_FF984EFC:\n"
60 "BL sub_FF984FB0\n"
61 "B loc_FF984F40\n"
62
63 "loc_FF984F04:\n"
64 "BL unlock_optical_zoom\n"
65 "BL sub_FF985194\n"
66 "B loc_FF984F40\n"
67
68 "loc_FF984F0C:\n"
69
70 "BL sub_FF98565C_my\n"
71 "B loc_FF984F40\n"
72
73 "loc_FF984F14:\n"
74 "BL sub_FF985D48\n"
75 "B loc_FF984F40\n"
76
77 "loc_FF984F1C:\n"
78 "BL sub_FF98592C\n"
79 "B loc_FF984F40\n"
80
81 "loc_FF984F24:\n"
82 "BL sub_FF985EE4\n"
83 "B loc_FF984F40\n"
84
85 "loc_FF984F2C:\n"
86 "BL sub_FF986114\n"
87 "B loc_FF984F40\n"
88
89 "loc_FF984F34:\n"
90 "BL sub_FF985DD0\n"
91 "B loc_FF984F40\n"
92
93 "loc_FF984F3C:\n"
94 "BL sub_FF98597C\n"
95
96 "loc_FF984F40:\n"
97 "LDR R1, [SP]\n"
98
99 "loc_FF984F44:\n"
100 "LDR R3, =0x76328\n"
101 "STR R4, [R1]\n"
102 "LDR R0, [R3]\n"
103 "MOV R2, R4\n"
104 "BL sub_FF821810\n"
105 "B loc_FF984E94\n"
106 );
107 }
108
109
110 void __attribute__((naked,noinline)) sub_FF98565C_my() {
111 asm volatile(
112 "STMFD SP!, {R4-R11,LR}\n"
113 "LDR R5, =0x76410\n"
114 "SUB SP, SP, #0x34\n"
115 "LDR R3, [R5]\n"
116 "MOV R2, #0\n"
117 "CMP R3, #3\n"
118 "STR R2, [SP,#0x24]\n"
119 "MOV R4, R0\n"
120 "STR R2, [SP,#0x2C]\n"
121 "MOVEQ R3, #4\n"
122 "STREQ R3, [R5]\n"
123 "LDR R3, =0x764AC\n"
124 "MOV LR, PC\n"
125 "LDR PC, [R3]\n"
126 "LDR R2, [R5]\n"
127 "CMP R2, #4\n"
128 "BNE loc_FF985854\n"
129 "ADD R0, SP, #0x30\n"
130 "ADD R1, SP, #0x2C\n"
131 "ADD R2, SP, #0x28\n"
132 "ADD R3, SP, #0x24\n"
133 "BL sub_FF987180\n"
134 "CMP R0, #0\n"
135 "BNE loc_FF9856E4\n"
136 "LDR R3, =0x76400\n"
137 "LDR R2, [R3]\n"
138 "CMP R2, #1\n"
139 "BNE loc_FF9856F8\n"
140 "LDR R2, =0x7643C\n"
141 "LDR R1, =0x76414\n"
142 "LDR R12, [R2]\n"
143 "LDR R3, [R1]\n"
144 "CMP R12, R3\n"
145 "BCC loc_FF9856F8\n"
146
147 "loc_FF9856E4:\n"
148 "BL sub_FF9858A4\n"
149 "BL sub_FF985D08\n"
150 "MOV R3, #5\n"
151 "STR R3, [R5]\n"
152 "B loc_FF985854\n"
153
154 "loc_FF9856F8:\n"
155 "LDR R8, [SP,#0x2C]\n"
156 "CMP R8, #0\n"
157 "BEQ loc_FF9857D4\n"
158 "LDR R12, =0x76444\n"
159 "LDR R9, =0x76450\n"
160 "LDR R11, =0x76404\n"
161 "LDR R7, [R12]\n"
162 "ADD R5, SP, #0x24\n"
163 "LDMIA R5, {R5,LR}\n"
164 "LDR R6, [R9]\n"
165 "MOV R10, #1\n"
166 "LDMIB R4, {R0-R2}\n"
167 "LDR R3, [SP,#0x30]\n"
168 "ADD R12, SP, #0x20\n"
169 "STR R10, [R11]\n"
170 "ADD R4, SP, #0x1C\n"
171 "STMEA SP, {R8,LR}\n"
172 "STR R5, [SP,#0x8]\n"
173 "STR R12, [SP,#0xC]\n"
174 "STR R7, [SP,#0x10]\n"
175 "STR R6, [SP,#0x14]\n"
176 "STR R4, [SP,#0x18]\n"
177 "BL sub_FF8A7688\n"
178 "LDR R3, =0x7631C\n"
179 "MOV R1, #0x3E8\n"
180 "LDR R0, [R3]\n"
181 "BL sub_FF821FA4\n"
182 "CMP R0, #9\n"
183 "BNE loc_FF98577C\n"
184 "BL sub_FF987A10\n"
185 "LDR R3, =0x76410\n"
186 "LDR R0, =0xFF985644\n"
187 "B loc_FF985794\n"
188
189 "loc_FF98577C:\n"
190 "LDR R4, [SP,#0x1C]\n"
191 "CMP R4, #0\n"
192 "BEQ loc_FF9857A0\n"
193 "BL sub_FF987A10\n"
194 "LDR R3, =0x76410\n"
195 "LDR R0, =0xFF985650\n"
196
197 "loc_FF985794:\n"
198 "STR R10, [R3]\n"
199 "BL sub_FF99FA2C\n"
200 "B loc_FF985854\n"
201
202 "loc_FF9857A0:\n"
203 "BL sub_FF8A77E4\n"
204 "LDR R0, [SP,#0x30]\n"
205 "LDR R1, [SP,#0x20]\n"
206 "BL sub_FF987668\n"
207 "LDR R12, =0x76438\n"
208 "LDR R3, [R12]\n"
209 "ADD R3, R3, #1\n"
210 "LDR R0, [SP,#0x20]\n"
211 "MOV R1, R9\n"
212 "MOV R2, R4\n"
213 "STR R3, [R12]\n"
214
215 "BL sub_FF98650C_my\n"
216 "B loc_FF9857D8\n"
217
218 "loc_FF9857D4:\n"
219 "LDR R11, =0x76404\n"
220
221 "loc_FF9857D8:\n"
222 "LDR R4, =0x7643C\n"
223 "LDR R2, =0x7645C\n"
224 "LDR R3, [R4]\n"
225 "LDR R1, [R2]\n"
226 "LDR R12, =0x76458\n"
227 "ADD R3, R3, #1\n"
228 "MUL R0, R1, R3\n"
229 "LDR R1, [R12]\n"
230 "STR R3, [R4]\n"
231 "BL sub_FFB4E7F0\n"
232 "LDR R6, =0x76454\n"
233 "MOV R4, R0\n"
234 "BL sub_FF987A4C\n"
235 "LDR R3, [R6]\n"
236 "CMP R3, R4\n"
237 "BNE loc_FF98582C\n"
238 "LDR R5, =0x76408\n"
239 "LDR R3, [R5]\n"
240 "CMP R3, #1\n"
241 "BNE loc_FF98584C\n"
242 "B loc_FF985830\n"
243
244 "loc_FF98582C:\n"
245 "LDR R5, =0x76408\n"
246
247 "loc_FF985830:\n"
248 "LDR R2, =0x76490\n"
249 "MOV R0, R4\n"
250 "MOV LR, PC\n"
251 "LDR PC, [R2]\n"
252 "MOV R3, #0\n"
253 "STR R3, [R5]\n"
254 "STR R4, [R6]\n"
255
256 "loc_FF98584C:\n"
257 "MOV R3, #0\n"
258 "STR R3, [R11]\n"
259
260 "loc_FF985854:\n"
261 "ADD SP, SP, #0x34\n"
262 "LDMFD SP!, {R4-R11,PC}\n"
263 );
264 }
265
266 void __attribute__((naked,noinline)) sub_FF98650C_my() {
267 asm volatile(
268 "CMP R2, #1\n"
269 "STMFD SP!, {R4-R7,LR}\n"
270 "MOV R7, R0\n"
271 "MOV R6, R1\n"
272 "MOVEQ R3, #0x79\n"
273 "STREQ R3, [R6]\n"
274 "LDMEQFD SP!, {R4-R7,PC}\n"
275 "LDR R12, =0x764F0\n"
276 "LDR R0, [R12]\n"
277 "LDR R3, =0x764F8\n"
278 "CMP R0, #0\n"
279 "LDR R1, [R3]\n"
280 "BEQ loc_FF986554\n"
281 "LDR R2, =0x764FC\n"
282 "LDR R3, [R2]\n"
283 "CMP R3, #1\n"
284 "BNE loc_FF986568\n"
285 "B loc_FF986558\n"
286
287 "loc_FF986554:\n"
288 "LDR R2, =0x764FC\n"
289
290 "loc_FF986558:\n"
291 "MOV R3, #0\n"
292 "STR R3, [R2]\n"
293 "STR R7, [R12]\n"
294 "B loc_FF986620\n"
295
296 "loc_FF986568:\n"
297 "LDR R2, =0x764F4\n"
298 "LDR R3, [R2]\n"
299 "LDR R5, =table1\n"
300 "ADD R3, R3, R3,LSL#1\n"
301 "MOV LR, R3,LSL#2\n"
302 "LDR R2, [R5,LR]\n"
303 "LDR R4, =table2\n"
304 "RSB R12, R2, R0\n"
305 "LDR R3, [R4,LR]\n"
306 "CMP R12, #0\n"
307 "RSB R0, R3, R0\n"
308 "BLE loc_FF9865CC\n"
309 "ADD R3, R5, #4\n"
310 "LDR R2, [R3,LR]\n"
311 "CMP R2, R12\n"
312 "ADDGE R1, R1, #1\n"
313 "BGE loc_FF9865C0\n"
314 "ADD R3, R5, #8\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_FF9865C0:\n"
321
322 "CMP R1, #0x1A\n"
323
324 "MOVGE R1, #0x1A\n"
325 "B loc_FF986604\n"
326
327 "loc_FF9865CC:\n"
328 "CMP R0, #0\n"
329 "BGE loc_FF986604\n"
330 "ADD R3, R4, #4\n"
331 "LDR R2, [R3,LR]\n"
332 "CMP R2, R0\n"
333 "SUBLE R1, R1, #1\n"
334 "BLE loc_FF9865FC\n"
335 "ADD R3, R4, #8\n"
336 "LDR R2, [R3,LR]\n"
337 "CMP R2, R0\n"
338 "SUBLE R1, R1, #2\n"
339 "SUBGT R1, R1, #3\n"
340
341 "loc_FF9865FC:\n"
342 "CMP R1, #0\n"
343 "MOVLT R1, #0\n"
344
345 "loc_FF986604:\n"
346 "LDR R0, =0x764F8\n"
347 "LDR R3, [R0]\n"
348 "CMP R1, R3\n"
349 "LDRNE R2, =0x764FC\n"
350 "MOVNE R3, #1\n"
351 "STRNE R1, [R0]\n"
352 "STRNE R3, [R2]\n"
353
354 "loc_FF986620:\n"
355 "LDR R3, =0x764F8\n"
356
357 "LDR R1, =video_mode\n"
358 "LDR R0, [R3]\n"
359
360 "LDR R2, =CompressionRateTable\n"
361 "LDR R12, [R1]\n"
362 "LDR R12, [R12]\n"
363 "LDR LR, [R2,R0,LSL#2]\n"
364 "LDR R3, =0x764F0\n"
365 "CMP R12, #1\n"
366 "STR R7, [R3]\n"
367 "STR LR, [R6]\n"
368
369 "LDREQ R3, =video_quality\n"
370 "LDREQ R3, [R3]\n"
371 "LDREQ R3, [R3]\n"
372 "STREQ R3, [R6]\n"
373 "LDMFD SP!, {R4-R7,PC}\n"
374 );
375 }