This source file includes following definitions.
- MovieRecord_Task_my
- sub_FFC46174_my
- sub_FFD0947C_my
- change_video_tables
1
2
3
4
5 void __attribute__((naked,noinline)) MovieRecord_Task_my( ) {
6 asm volatile (
7 "STMFD SP!, {R2-R8,LR}\n"
8 "LDR R8, =0x32B\n"
9 "LDR R7, =0x2710\n"
10 "LDR R4, =0x5178\n"
11 "MOV R6, #0\n"
12 "MOV R5, #1\n"
13 "loc_FFC46690:\n"
14 "LDR R0, [R4, #0x18]\n"
15 "MOV R2, #0\n"
16 "ADD R1, SP, #4\n"
17 "BL sub_FFC1764C\n"
18 "LDR R0, [R4, #0x20]\n"
19 "CMP R0, #0\n"
20 "BNE loc_FFC46760\n"
21 "LDR R0, [SP, #4]\n"
22 "LDR R1, [R0]\n"
23 "SUB R1, R1, #2\n"
24 "CMP R1, #9\n"
25 "ADDLS PC, PC, R1, LSL #2\n"
26 "B loc_FFC46760\n"
27 "B loc_FFC46714\n"
28 "B loc_FFC46734\n"
29 "B loc_FFC46744\n"
30 "B loc_FFC4674C\n"
31 "B loc_FFC4671C\n"
32 "B loc_FFC46754\n"
33 "B loc_FFC46724\n"
34 "B loc_FFC46760\n"
35 "B loc_FFC4675C\n"
36 "B loc_FFC466EC\n"
37 "loc_FFC466EC:\n"
38 "LDR R0, =0xFFC46374\n"
39 "STR R6, [R4, #0x34]\n"
40 "STR R0, [R4, #0xA0]\n"
41 "LDR R0, =0xFFC45DEC\n"
42 "LDR R2, =0xFFC45D08\n"
43 "LDR R1, =0x180AC\n"
44 "STR R6, [R4, #0x24]\n"
45 "BL sub_FFCA2C98\n"
46 "STR R5, [R4, #0x38]\n"
47 "B loc_FFC46760\n"
48 "loc_FFC46714:\n"
49 "BL unlock_optical_zoom\n"
50 "BL sub_FFC4646C\n"
51 "B loc_FFC46760\n"
52 "loc_FFC4671C:\n"
53
54 "BL sub_FFC46174_my\n"
55 "B loc_FFC46760\n"
56 "loc_FFC46724:\n"
57 "LDR R1, [R0, #0x10]\n"
58 "LDR R0, [R0, #4]\n"
59 "BL sub_FFD0B0D4\n"
60 "B loc_FFC46760\n"
61 "loc_FFC46734:\n"
62 "LDR R0, [R4, #0x38]\n"
63 "CMP R0, #5\n"
64 "STRNE R5, [R4, #0x28]\n"
65 "B loc_FFC46760\n"
66 "loc_FFC46744:\n"
67 "BL sub_FFC45F7C\n"
68 "B loc_FFC46760\n"
69 "loc_FFC4674C:\n"
70 "BL sub_FFC45E38\n"
71 "B loc_FFC46760\n"
72 "loc_FFC46754:\n"
73 "BL sub_FFC45C94\n"
74 "B loc_FFC46760\n"
75 "loc_FFC4675C:\n"
76 "BL sub_FFC468C8\n"
77 "loc_FFC46760:\n"
78 "LDR R1, [SP, #4]\n"
79 "LDR R3, =0xFFC45AFC\n"
80 "STR R6, [R1]\n"
81 "STR R8, [SP]\n"
82 "LDR R0, [R4, #0x1C]\n"
83 "MOV R2, R7\n"
84 "BL sub_FFC0BCF8\n"
85 "B loc_FFC46690\n"
86 );
87 }
88
89
90
91
92 void __attribute__((naked,noinline)) sub_FFC46174_my() {
93 asm volatile (
94 "STMFD SP!, {R4-R8,LR}\n"
95 "SUB SP, SP, #0x40\n"
96 "MOV R6, #0\n"
97 "LDR R5, =0x5178\n"
98 "MOV R4, R0\n"
99 "STR R6, [SP, #0x30]\n"
100 "STR R6, [SP, #0x28]\n"
101 "LDR R0, [R5, #0x38]\n"
102 "MOV R8, #4\n"
103 "CMP R0, #3\n"
104 "STREQ R8, [R5, #0x38]\n"
105 "LDR R0, [R5, #0xA0]\n"
106 "BLX R0\n"
107 "LDR R0, [R5, #0x38]\n"
108 "CMP R0, #4\n"
109 "BNE loc_FFC4624C\n"
110 "ADD R3, SP, #0x28\n"
111 "ADD R2, SP, #0x2C\n"
112 "ADD R1, SP, #0x30\n"
113 "ADD R0, SP, #0x34\n"
114 "BL sub_FFD0B268\n"
115 "CMP R0, #0\n"
116 "MOV R7, #1\n"
117 "BNE loc_FFC461F0\n"
118 "LDR R1, [R5, #0x28]\n"
119 "CMP R1, #1\n"
120 "BNE loc_FFC46254\n"
121 "LDR R1, [R5, #0x50]\n"
122 "LDR R2, [R5, #0x3C]\n"
123 "CMP R1, R2\n"
124 "BCC loc_FFC46254\n"
125 "loc_FFC461F0:\n"
126 "CMP R0, #0x80000001\n"
127 "STREQ R8, [R5, #0x54]\n"
128 "BEQ loc_FFC46228\n"
129 "CMP R0, #0x80000003\n"
130 "STREQ R7, [R5, #0x54]\n"
131 "BEQ loc_FFC46228\n"
132 "CMP R0, #0x80000005\n"
133 "MOVEQ R0, #2\n"
134 "BEQ loc_FFC46224\n"
135 "CMP R0, #0x80000007\n"
136 "STRNE R6, [R5, #0x54]\n"
137 "BNE loc_FFC46228\n"
138 "MOV R0, #3\n"
139 "loc_FFC46224:\n"
140 "STR R0, [R5, #0x54]\n"
141 "loc_FFC46228:\n"
142 "LDR R0, =0x180DC\n"
143 "LDR R0, [R0, #8]\n"
144 "CMP R0, #0\n"
145 "BEQ loc_FFC46240\n"
146 "BL sub_FFC32918\n"
147 "B loc_FFC46244\n"
148 "loc_FFC46240:\n"
149 "BL sub_FFC45C94\n"
150 "loc_FFC46244:\n"
151 "MOV R0, #5\n"
152 "STR R0, [R5, #0x38]\n"
153 "loc_FFC4624C:\n"
154 "ADD SP, SP, #0x40\n"
155 "LDMFD SP!, {R4-R8,PC}\n"
156 "loc_FFC46254:\n"
157 "LDR LR, [SP, #0x30]\n"
158 "CMP LR, #0\n"
159 "BEQ loc_FFC4631C\n"
160 "STR R7, [R5, #0x2C]\n"
161 "LDR R0, [R5, #0x6C]\n"
162 "LDR R1, [R4, #0x14]\n"
163 "LDR R2, [R4, #0x18]\n"
164 "LDR R12, [R4, #0xC]\n"
165 "ADD R3, SP, #0x38\n"
166 "ADD R8, SP, #0x14\n"
167 "STMIA R8, {R0-R3}\n"
168 "LDR R3, [R5, #0x58]\n"
169 "ADD R2, SP, #0x3C\n"
170 "ADD R8, SP, #8\n"
171 "LDRD R0, [SP, #0x28]\n"
172 "STMIA R8, {R0,R2,R3}\n"
173 "STR R1, [SP, #4]\n"
174 "STR LR, [SP]\n"
175 "LDMIB R4, {R0,R1}\n"
176 "LDR R3, [SP, #0x34]\n"
177 "MOV R2, R12\n"
178 "BL sub_FFCC99E4\n"
179 "LDR R0, [R5, #0x10]\n"
180 "MOV R1, #0x3E8\n"
181 "BL _TakeSemaphore \n"
182 "CMP R0, #9\n"
183 "BNE loc_FFC462D0\n"
184 "BL sub_FFD0B844\n"
185 "MOV R0, #0x90000\n"
186 "STR R7, [R5, #0x38]\n"
187 "B loc_FFC462E8\n"
188 "loc_FFC462D0:\n"
189 "LDR R0, [SP, #0x38]\n"
190 "CMP R0, #0\n"
191 "BEQ loc_FFC462F0\n"
192 "BL sub_FFD0B844\n"
193 "MOV R0, #0xA0000\n"
194 "STR R7, [R5, #0x38]\n"
195 "loc_FFC462E8:\n"
196 "BL sub_FFC5CAA4\n"
197 "B loc_FFC4624C\n"
198 "loc_FFC462F0:\n"
199 "BL sub_FFCC9AA8\n"
200 "LDR R0, [SP, #0x34]\n"
201 "LDR R1, [SP, #0x3C]\n"
202 "BL sub_FFD0B5EC\n"
203 "LDR R0, [R5, #0x4C]\n"
204 "LDR R1, =0x51E4\n"
205 "ADD R0, R0, #1\n"
206 "STR R0, [R5, #0x4C]\n"
207 "LDR R0, [SP, #0x3C]\n"
208 "MOV R2, #0\n"
209
210 "BL sub_FFD0947C_my\n"
211 "loc_FFC4631C:\n"
212 "LDR R0, [R5, #0x50]\n"
213 "ADD R0, R0, #1\n"
214 "STR R0, [R5, #0x50]\n"
215 "LDR R1, [R5, #0x78]\n"
216 "MUL R0, R1, R0\n"
217 "LDR R1, [R5, #0x74]\n"
218 "BL sub_FFE5A61C\n"
219 "MOV R4, R0\n"
220 "BL sub_FFD0B87C\n"
221 "LDR R1, [R5, #0x70]\n"
222 "CMP R1, R4\n"
223 "BNE loc_FFC46358\n"
224 "LDR R0, [R5, #0x30]\n"
225 "CMP R0, #1\n"
226 "BNE loc_FFC4636C\n"
227 "loc_FFC46358:\n"
228 "LDR R1, [R5, #0x84]\n"
229 "MOV R0, R4\n"
230 "BLX R1\n"
231 "STR R4, [R5, #0x70]\n"
232 "STR R6, [R5, #0x30]\n"
233 "loc_FFC4636C:\n"
234 "STR R6, [R5, #0x2C]\n"
235 "B loc_FFC4624C\n"
236 );
237 }
238
239
240
241
242 void __attribute__((naked,noinline)) sub_FFD0947C_my( ) {
243 asm volatile (
244 "STMFD SP!, {R4-R8,LR}\n"
245 "LDR R4, =0x7F7C\n"
246 "LDR LR, [R4]\n"
247 "LDR R2, [R4, #8]\n"
248 "CMP LR, #0\n"
249 "LDRNE R3, [R4, #0xC]\n"
250 "MOV R5, R2\n"
251 "CMPNE R3, #1\n"
252 "MOVEQ R2, #0\n"
253 "STREQ R0, [R4]\n"
254 "STREQ R2, [R4, #0xC]\n"
255 "BEQ loc_FFD09548\n"
256 "LDR R3, [R4, #4]\n"
257
258 "LDR R7, =table\n"
259 "ADD R12, R3, R3, LSL #1\n"
260 "LDR R3, [R7, R12, LSL #2]\n"
261 "ADD R6, R7, #0x30\n"
262 "LDR R8, [R6, R12, LSL #2]\n"
263 "SUB R3, LR, R3\n"
264 "CMP R3, #0\n"
265 "SUB LR, LR, R8\n"
266 "BLE loc_FFD09504\n"
267 "ADD R12, R7, R12, LSL #2\n"
268 "LDR LR, [R12, #4]\n"
269 "CMP LR, R3\n"
270 "ADDGE R2, R2, #1\n"
271 "BGE loc_FFD094F8\n"
272 "LDR R12, [R12, #8]\n"
273 "CMP R12, R3\n"
274 "ADDLT R2, R2, #3\n"
275 "ADDGE R2, R2, #2\n"
276 "loc_FFD094F8:\n"
277
278
279 "CMP R2, #0x1A\n"
280 "MOVGE R2, #0x19\n"
281 "B loc_FFD09538\n"
282 "loc_FFD09504:\n"
283 "CMP LR, #0\n"
284 "BGE loc_FFD09538\n"
285 "ADD R3, R6, R12, LSL #2\n"
286 "LDR R12, [R3, #4]\n"
287 "CMP R12, LR\n"
288 "SUBLE R2, R2, #1\n"
289 "BLE loc_FFD09530\n"
290 "LDR R3, [R3, #8]\n"
291 "CMP R3, LR\n"
292 "SUBGT R2, R2, #3\n"
293 "SUBLE R2, R2, #2\n"
294 "loc_FFD09530:\n"
295 "CMP R2, #0\n"
296 "MOVLT R2, #0\n"
297 "loc_FFD09538:\n"
298 "CMP R2, R5\n"
299 "STRNE R2, [R4, #8]\n"
300 "MOVNE R2, #1\n"
301 "STRNE R2, [R4, #0xC]\n"
302 "loc_FFD09548:\n"
303
304 "LDR R2, =CompressionRateTable\n"
305 "LDR R3, [R4, #8]\n"
306 "LDR R2, [R2, R3, LSL #2]\n"
307
308 "LDR R3, =video_mode\n"
309 "LDR R3, [R3]\n"
310 "LDR R3, [R3]\n"
311 "CMP R3, #1\n"
312 "LDREQ R3, =video_quality\n"
313 "LDREQ R3, [R3]\n"
314 "LDREQ R2, [R3]\n"
315
316 "STR R2, [R1]\n"
317 "STR R0, [R4]\n"
318 "BL mute_on_zoom\n"
319 "LDMFD SP!, {R4-R8,PC}\n"
320 );
321 }
322
323 #include "conf.h"
324
325 int *video_quality = &conf.video_quality;
326 int *video_mode = &conf.video_mode;
327
328 long def_table[24]={0x2000, 0x38D, 0x788, 0x5800, 0x9C5, 0x14B8, 0x10000, 0x1C6A, 0x3C45, 0x8000, 0xE35, 0x1E23,
329 0x1CCD, -0x2E1, -0x579, 0x4F33, -0x7EB, -0xF0C, 0xE666, -0x170A, -0x2BC6, 0x7333, -0xB85, -0x15E3};
330
331 long table[24];
332
333 void change_video_tables(int a, int b){
334 int i;
335 for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b;
336 }
337
338 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};