This source file includes following definitions.
- change_video_tables
- set_quality
- save_original_bitrates
- modify_bitrate
- movie_record_task
- liveimage_task
- sub_FF91B824_my
- sub_FF91A2D0_my
- sub_FF91A0EC_my
1
2
3
4 #include "conf.h"
5
6 static int bitrate_multiplier = 4;
7 static int bitrate_changed = 0;
8 extern int video_target_framesize;
9 extern int video_target_framesize2;
10
11
12 static int orig_bitrate[2];
13
14 void change_video_tables(int a, int b) {
15 bitrate_multiplier = (a<<2)/b;
16 bitrate_changed = 1;
17 }
18
19
20 void set_quality(int *x){
21 if (conf.video_mode) *x=12-((conf.video_quality-1)*(12+17)/(99-1));
22 }
23
24 void save_original_bitrates() {
25 orig_bitrate[0] = video_target_framesize;
26 orig_bitrate[1] = video_target_framesize2;
27 bitrate_changed = 1;
28 }
29
30 void modify_bitrate() {
31 if (bitrate_changed) {
32 bitrate_changed = 0;
33 video_target_framesize = (orig_bitrate[0] * bitrate_multiplier) >> 2;
34 video_target_framesize2 = (orig_bitrate[1] * bitrate_multiplier) >> 2;
35 }
36 }
37
38
39
40
41 void __attribute__((naked,noinline)) movie_record_task() {
42 asm volatile (
43 " STMFD SP!, {R2-R10,LR} \n"
44 " LDR R8, =0xFF9930C4 \n"
45 " LDR R4, =0x7028 \n"
46 " LDR R9, =0x6D4 \n"
47 " LDR R10, =0x2710 \n"
48 " MVN R7, #0 \n"
49 " MOV R5, #1 \n"
50 " MOV R6, #0 \n"
51
52 "loc_FF9934D0:\n"
53 " LDR R0, [R4, #0x2C] \n"
54 " MOV R2, #0 \n"
55 " ADD R1, SP, #4 \n"
56 " BL sub_006B8458 /*_ReceiveMessageQueue*/ \n"
57 " LDR R0, [R4, #0x34] \n"
58 " CMP R0, #0 \n"
59 " LDRNE R0, [R4, #0x14] \n"
60 " CMPNE R0, #2 \n"
61 " LDRNE R0, [R4, #0x48] \n"
62 " CMPNE R0, #6 \n"
63 " BNE loc_FF993624 \n"
64 " LDR R0, [SP, #4] \n"
65 " LDR R1, [R0] \n"
66 " SUB R1, R1, #2 \n"
67 " CMP R1, #0xD \n"
68 " ADDCC PC, PC, R1, LSL#2 \n"
69 " B loc_FF993624 \n"
70 " B loc_FF993598 \n"
71 " B loc_FF9935C4 \n"
72 " B loc_FF9935D4 \n"
73 " B loc_FF9935DC \n"
74 " B loc_FF9935A0 \n"
75 " B loc_FF9935E4 \n"
76 " B loc_FF993610 \n"
77 " B loc_FF993618 \n"
78 " B loc_FF9935AC \n"
79 " B loc_FF993624 \n"
80 " B loc_FF993620 \n"
81 " B loc_FF993574 \n"
82 " B loc_FF993548 \n"
83
84 "loc_FF993548:\n"
85 " STR R6, [R4, #0x44] \n"
86 " STR R6, [R4, #0x38] \n"
87 " STR R7, [R4, #0xD0] \n"
88 " STRH R6, [R4, #8] \n"
89 " STR R8, [R4, #0xB0] \n"
90 " LDR R0, [R4, #0x14] \n"
91 " ADD R0, R0, #1 \n"
92 " STR R0, [R4, #0x14] \n"
93 " MOV R0, #6 \n"
94 " STR R0, [R4, #0x48] \n"
95 " B loc_FF993590 \n"
96
97 "loc_FF993574:\n"
98 " STR R6, [R4, #0x44] \n"
99 " STR R7, [R4, #0xD0] \n"
100 " STR R8, [R4, #0xB0] \n"
101 " LDR R0, [R4, #0x14] \n"
102 " ADD R0, R0, #1 \n"
103 " STR R0, [R4, #0x14] \n"
104 " STR R5, [R4, #0x48] \n"
105
106 "loc_FF993590:\n"
107 " STR R5, [R4, #0xC] \n"
108 " B loc_FF993624 \n"
109
110 "loc_FF993598:\n"
111 " BL sub_FF992DAC \n"
112 " BL save_original_bitrates \n"
113 " B loc_FF993624 \n"
114
115 "loc_FF9935A0:\n"
116 " LDR R1, [R4, #0xB0] \n"
117 " BLX R1 \n"
118
119 " LDR R0, =video_compression_rate \n"
120 " BL set_quality \n"
121 " BL modify_bitrate \n"
122
123 " B loc_FF993624 \n"
124
125 "loc_FF9935AC:\n"
126 " LDR R1, [R0, #0x18] \n"
127 " LDR R2, [R0, #0x28] \n"
128 " LDR R3, [R0, #0x24] \n"
129 " LDR R0, [R0, #4] \n"
130 " BL sub_FFABC0D4 \n"
131 " B loc_FF993624 \n"
132
133 "loc_FF9935C4:\n"
134 " LDR R0, [R4, #0x48] \n"
135 " CMP R0, #5 \n"
136 " STRNE R5, [R4, #0x38] \n"
137 " B loc_FF993624 \n"
138
139 "loc_FF9935D4:\n"
140 " BL sub_FF992A20 \n"
141 " B loc_FF993624 \n"
142
143 "loc_FF9935DC:\n"
144 " BL sub_FF9928E0 \n"
145 " B loc_FF993624 \n"
146
147 "loc_FF9935E4:\n"
148 " LDR R0, =0xCDF44 \n"
149 " LDR R0, [R0, #8] \n"
150 " CMP R0, #0 \n"
151 " LDRNE R2, =0xFF992800 \n"
152 " LDRNE R0, =0xFF992888 \n"
153 " MOVNE R3, #0 \n"
154 " MOVNE R1, R3 \n"
155 " BLNE sub_FF86B700 \n"
156 " MOV R0, #3 \n"
157 " STR R0, [R4, #0x48] \n"
158 " B loc_FF993624 \n"
159
160 "loc_FF993610:\n"
161 " BL sub_FF992788 \n"
162 " B loc_FF993624 \n"
163
164 "loc_FF993618:\n"
165 " BL sub_FF993EF0 \n"
166 " B loc_FF993624 \n"
167
168 "loc_FF993620:\n"
169 " BL sub_FF993E14 \n"
170
171 "loc_FF993624:\n"
172 " LDR R1, [SP, #4] \n"
173 " LDR R3, =0xFF99244C /*'MovieRecorder.c'*/ \n"
174 " STR R6, [R1] \n"
175 " STR R9, [SP] \n"
176 " LDR R0, [R4, #0x30] \n"
177 " MOV R2, R10 \n"
178 " BL sub_006B7CF4 /*_PostMessageQueueStrictly*/ \n"
179 " B loc_FF9934D0 \n"
180 );
181 }
182
183
184
185 void __attribute__((naked,noinline)) liveimage_task() {
186 asm volatile (
187 " STMFD SP!, {R3-R5,LR} \n"
188 " LDR R4, =0x5640 \n"
189
190 "loc_FF91B5C0:\n"
191 " MOV R2, #0 \n"
192 " LDR R0, [R4, #8] \n"
193 " MOV R1, SP \n"
194 " BL sub_006B8458 /*_ReceiveMessageQueue*/ \n"
195 " TST R0, #1 \n"
196 " BEQ loc_FF91B5F0 \n"
197 " MOV R2, #0x78 \n"
198 " LDR R1, =0xFF91B7F0 /*'LiveImageTask.c'*/ \n"
199 " MOV R0, #0 \n"
200 " BL _DebugAssert \n"
201 " BL _ExitTask \n"
202 " LDMFD SP!, {R3-R5,PC} \n"
203
204 "loc_FF91B5F0:\n"
205 " LDR R1, [SP] \n"
206 " LDR R0, [R1] \n"
207 " CMP R0, #0 \n"
208 " BEQ loc_FF91B624 \n"
209 " CMP R0, #1 \n"
210 " MOVEQ R1, #1 \n"
211 " BEQ loc_FF91B618 \n"
212 " CMP R0, #2 \n"
213 " BNE loc_FF91B638 \n"
214 " MOV R1, #2 \n"
215
216 "loc_FF91B618:\n"
217 " LDR R0, [R4, #0xC] \n"
218 " BL sub_006B81EC /*_SetEventFlag*/ \n"
219 " B loc_FF91B5C0 \n"
220
221 "loc_FF91B624:\n"
222 " LDR R0, [R4, #4] \n"
223 " CMP R0, #1 \n"
224 " ADDNE R0, R1, #4 \n"
225 " BLNE sub_FF91B824_my \n"
226 " B loc_FF91B5C0 \n"
227
228 "loc_FF91B638:\n"
229 " MOV R2, #0x97 \n"
230 " LDR R1, =0xFF91B7F0 /*'LiveImageTask.c'*/ \n"
231 " MOV R0, #0 \n"
232 " BL _DebugAssert \n"
233 " B loc_FF91B5C0 \n"
234 );
235 }
236
237
238
239 void __attribute__((naked,noinline)) sub_FF91B824_my() {
240 asm volatile (
241 " LDR R1, [R0] \n"
242 " CMP R1, #0x1A \n"
243 " ADDCC PC, PC, R1, LSL#2 \n"
244 " B loc_FF91B8C8 \n"
245 " B sub_FF919DB8 \n"
246 " B sub_FF919F08 \n"
247 " B loc_FF91B8C8 \n"
248 " B loc_FF91B89C \n"
249 " B sub_FF91A74C \n"
250 " B sub_FF91A948 \n"
251 " B sub_FF91ACB8 \n"
252 " B sub_FF919DB8 \n"
253 " B sub_FF91A534 \n"
254 " B loc_FF91B8C8 \n"
255 " B loc_FF91B8C8 \n"
256 " B loc_FF91B8C8 \n"
257 " B loc_FF91B89C \n"
258 " B sub_FF91B030 \n"
259 " B sub_FF91B030 \n"
260 " B loc_FF91B8C8 \n"
261 " BX LR \n"
262 " B loc_FF91B8C8 \n"
263 " B loc_FF91B8C8 \n"
264 " B loc_FF91B8C8 \n"
265 " B loc_FF91B8C8 \n"
266 " B loc_FF91B8C8 \n"
267 " B loc_FF91B8C8 \n"
268 " B loc_FF91B8C8 \n"
269 " B loc_FF91B8C8 \n"
270 " BX LR \n"
271
272 "loc_FF91B89C:\n"
273
274 " LDR R1, [R0, #0x64] \n"
275 " CMP R1, #1 \n"
276 " BNE sub_FF91A2D0_my \n"
277 " BEQ sub_FF91A0EC_my \n"
278
279 "loc_FF91B8AC:\n"
280 " B sub_FF919F08 \n"
281
282 "loc_FF91B8B0:\n"
283 " B sub_FF91A74C \n"
284
285 "loc_FF91B8B4:\n"
286 " B sub_FF919DB8 \n"
287
288 "loc_FF91B8B8:\n"
289 " B sub_FF91A948 \n"
290
291 "loc_FF91B8BC:\n"
292 " B sub_FF91A534 \n"
293
294 "loc_FF91B8C0:\n"
295 " B sub_FF91ACB8 \n"
296
297 "loc_FF91B8C4:\n"
298 " B sub_FF91B030 \n"
299
300 "loc_FF91B8C8:\n"
301 " MOV R2, #0x69 \n"
302 " LDR R1, =0xFF91B7F0 /*'LiveImageTask.c'*/ \n"
303 " MOV R0, #0 \n"
304 " B _DebugAssert \n"
305 );
306 }
307
308
309
310 void __attribute__((naked,noinline)) sub_FF91A2D0_my() {
311 asm volatile (
312
313
314 " PUSH {LR} \n"
315 " MOV LR, PC \n"
316 " LDR PC, =0xFF91A2D0 \n"
317 " LDR R0, =video_compression_rate \n"
318 " BL set_quality \n"
319 " BL modify_bitrate \n"
320 " POP {PC} \n"
321 );
322 }
323
324
325
326 void __attribute__((naked,noinline)) sub_FF91A0EC_my() {
327 asm volatile (
328
329
330 " PUSH {LR} \n"
331 " MOV LR, PC \n"
332 " LDR PC, =0xFF91A0EC \n"
333 " LDR R0, =video_compression_rate \n"
334 " BL set_quality \n"
335 " BL modify_bitrate \n"
336 " POP {PC} \n"
337 );
338 }