This source file includes following definitions.
- change_video_tables
- movie_record_task
- sub_FF862904_my
- sub_FF95BA54_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_table[68]={
10 0x2000, 0x38D, 0x788, 0xBE1, 0x10CB, 0x1642, 0x1C48, 0x22F9, 0x2A79, 0x32AA, 0x3C01, 0x4637,
11 0x5190, 0x5E0E, 0x5800, 0x9C5, 0x14B8, 0x20C9, 0x2E31, 0x3D39, 0x4DC9, 0x6030, 0x74D1, 0x8B8D,
12 0xA509, 0xC160, 0xE054, 0x102AF, 0x10000, 0x1C6A, 0x3C45, 0x5F60, 0x8661, 0xB21A, 0xE249, 0x117D2,
13 0x153D5, 0x195F8, 0x1E01C, 0x2328E, 0x28C99, 0x2F08B, 0x8000, 0xE35, 0x1E23, 0x2FB0, 0x4331, 0x590D,
14 0x7125, 0x8BE9, 0xA9EB, 0xCAFC, 0xF00E, 0x11947, 0x1464D, 0x17846, 0x1CCD, -0x2E1, -0x579, 0x4F33,
15 -0x7EB, -0xF0C, 0xE666, -0x170A, -0x2BC6, 0x7333, -0xB85, -0x15E3};
16
17 long table[68];
18
19 void change_video_tables(int a, int b){
20 int i;
21 for (i=0;i<68;i++) table[i]=(def_table[i]*a)/b;
22 }
23
24 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};
25
26
27
28 void __attribute__((naked,noinline)) movie_record_task() {
29 asm volatile (
30 " STMFD SP!, {R3-R7,LR} \n"
31 " LDR R4, =0x5868 \n"
32 " MOV R6, #0 \n"
33 " MOV R5, #1 \n"
34
35 "loc_FF862E58:\n"
36 " LDR R0, [R4, #0x18] \n"
37 " MOV R2, #0 \n"
38 " MOV R1, SP \n"
39 " BL sub_FF82A4F8 /*_ReceiveMessageQueue*/ \n"
40 " LDR R0, [R4, #0xAC] \n"
41 " MOV R1, #0 \n"
42 " BL _TakeSemaphore \n"
43 " LDR R0, [R4, #0x20] \n"
44 " CMP R0, #0 \n"
45 " BNE loc_FF862F34 \n"
46 " LDR R0, [SP] \n"
47 " LDR R1, [R0] \n"
48 " SUB R1, R1, #2 \n"
49 " CMP R1, #9 \n"
50 " ADDLS PC, PC, R1, LSL#2 \n"
51 " B loc_FF862F34 \n"
52 " B loc_FF862EF0 \n"
53 " B loc_FF862F08 \n"
54 " B loc_FF862F18 \n"
55 " B loc_FF862F20 \n"
56 " B loc_FF862EF8 \n"
57 " B loc_FF862F28 \n"
58 " B loc_FF862F00 \n"
59 " B loc_FF862F34 \n"
60 " B loc_FF862F30 \n"
61 " B loc_FF862EC0 \n"
62
63 "loc_FF862EC0:\n"
64 " LDR R0, =0xFF862AC8 \n"
65 " STR R6, [R4, #0x34] \n"
66 " STR R0, [R4, #0xA0] \n"
67 " LDR R0, =0xFF86201C \n"
68 " LDR R2, =0xFF862020 \n"
69 " STR R0, [R4, #0xA4] \n"
70 " LDR R1, =0x1A990 \n"
71 " LDR R0, =0xFF862124 \n"
72 " STR R6, [R4, #0x24] \n"
73 " BL sub_FF84082C \n"
74 " STR R5, [R4, #0x38] \n"
75 " B loc_FF862F34 \n"
76
77 "loc_FF862EF0:\n"
78
79 " BL sub_FF862BF0 \n"
80 " B loc_FF862F34 \n"
81
82 "loc_FF862EF8:\n"
83 " BL sub_FF862904_my \n"
84 " B loc_FF862F34 \n"
85
86 "loc_FF862F00:\n"
87 " BL sub_FF86328C \n"
88 " B loc_FF862F34 \n"
89
90 "loc_FF862F08:\n"
91 " LDR R0, [R4, #0x38] \n"
92 " CMP R0, #5 \n"
93 " STRNE R5, [R4, #0x28] \n"
94 " B loc_FF862F44 \n"
95
96 "loc_FF862F18:\n"
97 " BL sub_FF86274C \n"
98 " B loc_FF862F34 \n"
99
100 "loc_FF862F20:\n"
101 " BL sub_FF862608 \n"
102 " B loc_FF862F34 \n"
103
104 "loc_FF862F28:\n"
105 " BL sub_FF861FA8 \n"
106 " B loc_FF862F34 \n"
107
108 "loc_FF862F30:\n"
109 " BL sub_FF8631B0 \n"
110
111 "loc_FF862F34:\n"
112 " LDR R0, [SP] \n"
113 " LDR R1, [R0] \n"
114 " CMP R1, #9 \n"
115 " BLEQ sub_FF862498 \n"
116
117 "loc_FF862F44:\n"
118 " LDR R1, [SP] \n"
119 " MOV R2, #0 \n"
120 " STR R6, [R1] \n"
121 " LDR R0, [R4, #0x1C] \n"
122 " BL sub_FF82A620 /*_PostMessageQueue*/ \n"
123 " LDR R0, [R4, #0xAC] \n"
124 " BL _GiveSemaphore \n"
125 " B loc_FF862E58 \n"
126 );
127 }
128
129
130
131 void __attribute__((naked,noinline)) sub_FF862904_my() {
132 asm volatile (
133 " STMFD SP!, {R4-R7,LR} \n"
134 " SUB SP, SP, #0x3C \n"
135 " MOV R6, #0 \n"
136 " LDR R5, =0x5868 \n"
137 " MOV R4, R0 \n"
138 " STR R6, [SP, #0x2C] \n"
139 " STR R6, [SP, #0x24] \n"
140 " LDR R0, [R5, #0x38] \n"
141 " CMP R0, #3 \n"
142 " MOVEQ R0, #4 \n"
143 " STREQ R0, [R5, #0x38] \n"
144 " LDR R0, [R5, #0xA0] \n"
145 " BLX R0 \n"
146 " LDR R0, [R5, #0x38] \n"
147 " CMP R0, #4 \n"
148 " BNE loc_FF86298C \n"
149 " ADD R3, SP, #0x24 \n"
150 " ADD R2, SP, #0x28 \n"
151 " ADD R1, SP, #0x2C \n"
152 " ADD R0, SP, #0x30 \n"
153 " BL sub_FF95D950 \n"
154 " CMP R0, #0 \n"
155 " BNE loc_FF86297C \n"
156 " LDR R1, [R5, #0x28] \n"
157 " CMP R1, #1 \n"
158 " BNE loc_FF862994 \n"
159 " LDR R1, [R5, #0x50] \n"
160 " LDR R2, [R5, #0x3C] \n"
161 " CMP R1, R2 \n"
162 " BCC loc_FF862994 \n"
163
164 "loc_FF86297C:\n"
165 " BL sub_FF862164 \n"
166 " BL sub_FF8630A0 \n"
167 " MOV R0, #5 \n"
168 " STR R0, [R5, #0x38] \n"
169
170 "loc_FF86298C:\n"
171 " ADD SP, SP, #0x3C \n"
172 " LDMFD SP!, {R4-R7,PC} \n"
173
174 "loc_FF862994:\n"
175 " LDR LR, [SP, #0x2C] \n"
176 " CMP LR, #0 \n"
177 " BEQ loc_FF862A70 \n"
178 " MOV R7, #1 \n"
179 " STR R7, [R5, #0x2C] \n"
180 " LDR R1, [R4, #0x14] \n"
181 " LDR R2, [R4, #0x18] \n"
182 " LDR R12, [R4, #0xC] \n"
183 " LDR R0, [R5, #0x6C] \n"
184 " ADD R3, SP, #0x34 \n"
185 " STR R0, [SP, #0x14] \n"
186 " STR R2, [SP, #0x1C] \n"
187 " STR R1, [SP, #0x18] \n"
188 " STR R3, [SP, #0x20] \n"
189 " LDR R3, [R5, #0x58] \n"
190 " LDR R0, [SP, #0x24] \n"
191 " LDR R1, [SP, #0x28] \n"
192 " ADD R2, SP, #0x38 \n"
193 " STR R2, [SP, #0xC] \n"
194 " STR R3, [SP, #0x10] \n"
195 " STR R0, [SP, #8] \n"
196 " STR LR, [SP] \n"
197 " STR R1, [SP, #4] \n"
198 " LDMIB R4, {R0,R1} \n"
199 " LDR R3, [SP, #0x30] \n"
200 " MOV R2, R12 \n"
201 " BL sub_FF918360 \n"
202 " LDR R0, [R5, #0x10] \n"
203 " MOV R1, #0x3E8 \n"
204 " BL _TakeSemaphore \n"
205 " CMP R0, #9 \n"
206 " BNE loc_FF862A24 \n"
207 " BL sub_FF95DEEC \n"
208 " LDR R0, =0xFF8625D4 /*'JPEGTimeOut'*/ \n"
209 " STR R7, [R5, #0x38] \n"
210 " B loc_FF862A3C \n"
211
212 "loc_FF862A24:\n"
213 " LDR R0, [SP, #0x34] \n"
214 " CMP R0, #0 \n"
215 " BEQ loc_FF862A44 \n"
216 " BL sub_FF95DEEC \n"
217 " LDR R0, =0xFF8625E0 /*'JPEGICError'*/ \n"
218 " STR R7, [R5, #0x38] \n"
219
220 "loc_FF862A3C:\n"
221 " BL sub_FF878128 /*_HardwareDefect_FW*/ \n"
222 " B loc_FF86298C \n"
223
224 "loc_FF862A44:\n"
225 " BL sub_FF918424 \n"
226 " LDR R0, [SP, #0x30] \n"
227 " LDR R1, [SP, #0x38] \n"
228 " BL sub_FF95DC94 \n"
229 " LDR R0, [R5, #0x4C] \n"
230 " LDR R1, =0x58D4 \n"
231 " ADD R0, R0, #1 \n"
232 " STR R0, [R5, #0x4C] \n"
233 " LDR R0, [SP, #0x38] \n"
234 " MOV R2, #0 \n"
235 " BL sub_FF95BA54_my \n"
236
237 "loc_FF862A70:\n"
238 " LDR R0, [R5, #0x50] \n"
239 " ADD R0, R0, #1 \n"
240 " STR R0, [R5, #0x50] \n"
241 " LDR R1, [R5, #0x78] \n"
242 " MUL R0, R1, R0 \n"
243 " LDR R1, [R5, #0x74] \n"
244 " BL sub_FFA944C0 /*__divmod_unsigned_int*/ \n"
245 " MOV R4, R0 \n"
246 " BL sub_FF95DF1C \n"
247 " LDR R1, [R5, #0x70] \n"
248 " CMP R1, R4 \n"
249 " BNE loc_FF862AAC \n"
250 " LDR R0, [R5, #0x30] \n"
251 " CMP R0, #1 \n"
252 " BNE loc_FF862AC0 \n"
253
254 "loc_FF862AAC:\n"
255 " LDR R1, [R5, #0x84] \n"
256 " MOV R0, R4 \n"
257 " BLX R1 \n"
258 " STR R4, [R5, #0x70] \n"
259 " STR R6, [R5, #0x30] \n"
260
261 "loc_FF862AC0:\n"
262 " STR R6, [R5, #0x2C] \n"
263 " B loc_FF86298C \n"
264 " BX LR \n"
265 );
266 }
267
268
269
270 void __attribute__((naked,noinline)) sub_FF95BA54_my() {
271 asm volatile (
272 " STMFD SP!, {R4-R9,LR} \n"
273 " LDR R4, =0xB50C \n"
274 " LDR R12, [R4] \n"
275 " LDR R2, [R4, #8] \n"
276 " CMP R12, #0 \n"
277 " LDRNE R3, [R4, #0xC] \n"
278 " MOV R5, R2 \n"
279 " CMPNE R3, #1 \n"
280 " MOVEQ R2, #0 \n"
281 " STREQ R0, [R4] \n"
282 " STREQ R2, [R4, #0xC] \n"
283 " BEQ loc_FF95BB24 \n"
284 " LDR LR, [R4, #4] \n"
285 " LDR R8, =0xFFABA280 \n"
286 " LDR R7, =table\n"
287 " RSB R6, LR, LR, LSL#3 \n"
288 " LDR R3, [R8, R6, LSL#3] \n"
289 " ADD LR, LR, LR, LSL#1 \n"
290 " ADD R7, R8, #0xE0 \n"
291 " LDR R9, [R7, LR, LSL#2] \n"
292 " SUB R3, R12, R3 \n"
293 " CMP R3, #0 \n"
294 " SUB R12, R12, R9 \n"
295 " BLE loc_FF95BAE0 \n"
296 " ADD R12, R8, R6, LSL#3 \n"
297 " LDR LR, [R12, #4] \n"
298 " CMP LR, R3 \n"
299 " ADDGE R2, R2, #1 \n"
300 " BGE loc_FF95BAD4 \n"
301 " LDR R12, [R12, #8] \n"
302 " CMP R12, R3 \n"
303 " ADDLT R2, R2, #3 \n"
304 " ADDGE R2, R2, #2 \n"
305
306 "loc_FF95BAD4:\n"
307 " CMP R2, #0x1A \n"
308 " MOVGE R2, #0x19 \n"
309 " B loc_FF95BB14 \n"
310
311 "loc_FF95BAE0:\n"
312 " CMP R12, #0 \n"
313 " BGE loc_FF95BB14 \n"
314 " ADD R3, R7, LR, LSL#2 \n"
315 " LDR LR, [R3, #4] \n"
316 " CMP LR, R12 \n"
317 " SUBLE R2, R2, #1 \n"
318 " BLE loc_FF95BB0C \n"
319 " LDR R3, [R3, #8] \n"
320 " CMP R3, R12 \n"
321 " SUBGT R2, R2, #3 \n"
322 " SUBLE R2, R2, #2 \n"
323
324 "loc_FF95BB0C:\n"
325 " CMP R2, #0 \n"
326 " MOVLT R2, #0 \n"
327
328 "loc_FF95BB14:\n"
329 " CMP R2, R5 \n"
330 " STRNE R2, [R4, #8] \n"
331 " MOVNE R2, #1 \n"
332 " STRNE R2, [R4, #0xC] \n"
333
334 "loc_FF95BB24:\n"
335 " LDR R2, =CompressionRateTable \n"
336 " LDR R3, [R4, #8] \n"
337 " LDR R2, [R2, R3, LSL#2] \n"
338
339 " LDR R3, =video_mode\n"
340 " LDR R3, [R3]\n"
341 " LDR R3, [R3]\n"
342 " CMP R3, #1\n"
343 " LDREQ R3, =video_quality\n"
344 " LDREQ R3, [R3]\n"
345 " LDREQ R2, [R3]\n"
346
347 " STR R2, [R1] \n"
348 " STR R0, [R4] \n"
349
350 " LDMFD SP!, {R4-R9,PC} \n"
351 );
352 }