This source file includes following definitions.
- spytask
- CreateTask_spytask
- debug_blink
- my_blinker
- boot
- CreateTask_my
- sub_FF0203C4_my
- sub_FF0228D4_my
- sub_FF024704_my
- sub_FF027A44_my
- sub_FF02BBC0_my
- task_Startup_my
- taskcreatePhySw_my
- fix_writable_media_flag
- init_file_modules_task
- JogDial_task_my
- init_required_fw_features
1
2
3
4 #include "lolevel.h"
5 #include "platform.h"
6 #include "core.h"
7 #include "dryos31.h"
8
9 #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
10
11 const char * const new_sa = &_end;
12
13 extern void task_CaptSeq();
14 extern void task_InitFileModules();
15 extern void task_RotaryEncoder();
16
17 extern void task_ExpDrv();
18
19
20
21
22
23 void spytask(long ua, long ub, long uc, long ud, long ue, long uf)
24 {
25 (void)ua; (void)ub; (void)uc; (void)ud; (void)ue; (void)uf;
26 core_spytask();
27 }
28
29
30
31
32 void CreateTask_spytask()
33 {
34 _CreateTask("SpyTask", 0x19, 0x2000, spytask, 0);
35 }
36
37
38
39
40 short *jog_position;
41
42 #define GREEN_LED 0xC022D1FC
43 #define AF_LED 0xC022D034
44
45
46 int debug_blink(int save_R0) {
47 int i;
48 *((volatile int *) GREEN_LED) = 0x93d800;
49 for (i=0; i<800000; i++)
50 {
51 asm volatile ( "nop\n" );
52 }
53
54 *((volatile int *) GREEN_LED) = 0x83dc00;
55 for (i=0; i<800000; i++)
56 {
57 asm volatile ( "nop\n" );
58 }
59 return save_R0;
60 };
61
62 void __attribute__((naked,noinline)) my_blinker(int n) {
63 asm volatile (
64 " STMFD SP!, {R0-R9,LR}\n"
65 );
66 int i, j;
67 for (j=0; j<n; j++)
68 {
69 *((volatile int *) GREEN_LED) = 0x93d800;
70 for (i=0; i<0x200000; i++) { asm volatile ( "nop \n" ); }
71
72 *((volatile int *) GREEN_LED) = 0x83dc00;
73 for (i=0; i<0x400000; i++) { asm volatile ( "nop \n" ); }
74 }
75 for (i=0; i<0x900000; i++) { asm volatile ( "nop \n" ); }
76 asm volatile (
77 " LDMFD SP!, {R0-R9,PC}\n"
78 );
79 }
80
81
82
83
84
85
86
87
88
89 void __attribute__((naked,noinline)) boot() {
90 asm volatile (
91 " LDR R1, =0xC0410000 \n"
92 " MOV R0, #0 \n"
93 " STR R0, [R1] \n"
94 " MOV R1, #0x78 \n"
95 " MCR p15, 0, R1, c1, c0 \n"
96 " MOV R1, #0 \n"
97 " MCR p15, 0, R1, c7, c10, 4 \n"
98 " MCR p15, 0, R1, c7, c5 \n"
99 " MCR p15, 0, R1, c7, c6 \n"
100 " MOV R0, #0x3D \n"
101 " MCR p15, 0, R0, c6, c0 \n"
102 " MOV R0, #0xC000002F \n"
103 " MCR p15, 0, R0, c6, c1 \n"
104 " MOV R0, #0x37 \n"
105 " MCR p15, 0, R0, c6, c2 \n"
106 " MOV R0, #0x40000037 \n"
107 " MCR p15, 0, R0, c6, c3 \n"
108 " MOV R0, #0x80000017 \n"
109 " MCR p15, 0, R0, c6, c4 \n"
110 " LDR R0, =0xFF00002F \n"
111 " MCR p15, 0, R0, c6, c5 \n"
112 " MOV R0, #0x34 \n"
113 " MCR p15, 0, R0, c2, c0 \n"
114 " MOV R0, #0x34 \n"
115 " MCR p15, 0, R0, c2, c0, 1 \n"
116 " MOV R0, #0x34 \n"
117 " MCR p15, 0, R0, c3, c0 \n"
118 " LDR R0, =0x3333330 \n"
119 " MCR p15, 0, R0, c5, c0, 2 \n"
120 " LDR R0, =0x3333330 \n"
121 " MCR p15, 0, R0, c5, c0, 3 \n"
122 " MRC p15, 0, R0, c1, c0 \n"
123 " ORR R0, R0, #0x1000 \n"
124 " ORR R0, R0, #4 \n"
125 " ORR R0, R0, #1 \n"
126 " MCR p15, 0, R0, c1, c0 \n"
127 " MOV R1, #0x80000006 \n"
128 " MCR p15, 0, R1, c9, c1 \n"
129 " MOV R1, #6 \n"
130 " MCR p15, 0, R1, c9, c1, 1 \n"
131 " MRC p15, 0, R1, c1, c0 \n"
132 " ORR R1, R1, #0x50000 \n"
133 " MCR p15, 0, R1, c1, c0 \n"
134 " LDR R2, =0xC0200000 \n"
135 " MOV R1, #1 \n"
136 " STR R1, [R2, #0x10C] \n"
137 " MVN R1, #0 \n"
138 " STR R1, [R2, #0xC] \n"
139 " STR R1, [R2, #0x1C] \n"
140 " STR R1, [R2, #0x2C] \n"
141 " STR R1, [R2, #0x3C] \n"
142 " STR R1, [R2, #0x4C] \n"
143 " STR R1, [R2, #0x5C] \n"
144 " STR R1, [R2, #0x6C] \n"
145 " STR R1, [R2, #0x7C] \n"
146 " STR R1, [R2, #0x8C] \n"
147 " STR R1, [R2, #0x9C] \n"
148 " STR R1, [R2, #0xAC] \n"
149 " STR R1, [R2, #0xBC] \n"
150 " STR R1, [R2, #0xCC] \n"
151 " STR R1, [R2, #0xDC] \n"
152 " STR R1, [R2, #0xEC] \n"
153 " STR R1, [R2, #0xFC] \n"
154 " LDR R1, =0xC0400008 \n"
155 " LDR R2, =0x430005 \n"
156 " STR R2, [R1] \n"
157 " MOV R1, #1 \n"
158 " LDR R2, =0xC0243100 \n"
159 " STR R2, [R1] \n"
160 " LDR R2, =0xC0242010 \n"
161 " LDR R1, [R2] \n"
162 " ORR R1, R1, #1 \n"
163 " STR R1, [R2] \n"
164 " LDR R0, =0xFF8C92E8 \n"
165 " LDR R1, =0x6B1000 \n"
166 " LDR R3, =0x6E28C6 \n"
167
168 "loc_FF02013C:\n"
169 " CMP R1, R3 \n"
170 " LDRCC R2, [R0], #4 \n"
171 " STRCC R2, [R1], #4 \n"
172 " BCC loc_FF02013C \n"
173 " LDR R0, =0xFF8B1358 \n"
174 " LDR R1, =0x1900 \n"
175 " LDR R3, =0x19890 \n"
176
177 "loc_FF020158:\n"
178 " CMP R1, R3 \n"
179 " LDRCC R2, [R0], #4 \n"
180 " STRCC R2, [R1], #4 \n"
181 " BCC loc_FF020158 \n"
182 " LDR R1, =0x2FF248 \n"
183 " MOV R2, #0 \n"
184
185 "loc_FF020170:\n"
186 " CMP R3, R1 \n"
187 " STRCC R2, [R3], #4 \n"
188 " BCC loc_FF020170 \n"
189
190
191
192
193
194 " LDR R0, =patch_CreateTask\n"
195 " LDM R0, {R1,R2}\n"
196 " LDR R0, =hook_CreateTask\n"
197 " STM R0, {R1,R2}\n"
198
199 " B sub_FF0203C4_my \n"
200
201 "patch_CreateTask:\n"
202 " LDR PC, [PC,#-0x4]\n"
203 " .long CreateTask_my\n"
204 );
205 }
206
207
208
209 void __attribute__((naked,noinline)) CreateTask_my() {
210 asm volatile (
211 " STMFD SP!, {R0}\n"
212
213
214
215 " LDR R0, =task_CaptSeq\n"
216 " CMP R0, R3\n"
217 " LDREQ R3, =capt_seq_task\n"
218 " BEQ exitHook\n"
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244 " LDR R0, =task_MovieRecord\n"
245 " CMP R0, R3\n"
246 " LDREQ R3, =movie_record_task\n"
247 " BEQ exitHook\n"
248
249
250 " LDR R0, =task_LiveImageTask\n"
251 " CMP R0, R3\n"
252 " LDREQ R3, =liveimage_task\n"
253 " BEQ exitHook\n"
254
255
256 " LDR R0, =task_InitFileModules\n"
257 " CMP R0, R3\n"
258 " LDREQ R3, =init_file_modules_task\n"
259
260 "exitHook:\n"
261
262 " LDMFD SP!, {R0}\n"
263
264 " STMFD SP!, {R1-R9,LR} \n"
265 " MOV R4, R0 \n"
266 " LDR PC, =0x006B5660 \n"
267 );
268 }
269
270
271
272 void __attribute__((naked,noinline)) sub_FF0203C4_my() {
273
274
275
276
277
278 *(int*)(0x2cf4+0x8) = (*(int*)0xc022f48c) & 0x80000 ? 0x400000 : 0x200000;
279
280 asm volatile (
281 " LDR R0, =0xFF02043C \n"
282 " MOV R1, #0 \n"
283 " LDR R3, =0xFF020474 \n"
284
285 "loc_FF0203D0:\n"
286 " CMP R0, R3 \n"
287 " LDRCC R2, [R0], #4 \n"
288 " STRCC R2, [R1], #4 \n"
289 " BCC loc_FF0203D0 \n"
290 " LDR R0, =0xFF020474 \n"
291 " MOV R1, #0x1C0 \n"
292 " LDR R3, =0xFF02065C \n"
293
294 "loc_FF0203EC:\n"
295 " CMP R0, R3 \n"
296 " LDRCC R2, [R0], #4 \n"
297 " STRCC R2, [R1], #4 \n"
298 " BCC loc_FF0203EC \n"
299 " MOV R0, #0xD2 \n"
300 " MSR CPSR_cxsf, R0 \n"
301 " MOV SP, #0x1000 \n"
302 " MOV R0, #0xD3 \n"
303 " MSR CPSR_cxsf, R0 \n"
304 " MOV SP, #0x1000 \n"
305 " LDR R0, =0x3A8 \n"
306 " LDR R2, =0xEEEEEEEE \n"
307 " MOV R3, #0x1000 \n"
308
309 "loc_FF020420:\n"
310 " CMP R0, R3 \n"
311 " STRCC R2, [R0], #4 \n"
312 " BCC loc_FF020420 \n"
313 " B sub_FF0228D4_my \n"
314 );
315 }
316
317
318
319 void __attribute__((naked,noinline)) sub_FF0228D4_my() {
320 asm volatile (
321 " LDR R1, =0x1A5C \n"
322 " STR LR, [SP, #-4]! \n"
323 " SUB SP, SP, #0x7C \n"
324 " MOV R0, #0x80000 \n"
325 " STR R0, [R1] \n"
326 " LDR R0, =0x40D42F80 \n"
327 " LDR R1, =0x1A60 \n"
328 " STR R0, [R1] \n"
329 " LDR R1, =0x1A64 \n"
330 " ADD R0, R0, #0x2000 \n"
331 " STR R0, [R1] \n"
332 " MOV R1, #0x78 \n"
333 " ADD R0, SP, #4 \n"
334 " BL sub_006DABD4 \n"
335 " MOV R0, #0xA0000 \n"
336 " STR R0, [SP, #8] \n"
337
338 #if defined(CHDK_NOT_IN_CANON_HEAP)
339 " LDR R0, =0x2FF248 \n"
340 #else
341 " LDR R0, =new_sa\n"
342 " LDR R0, [R0]\n"
343 #endif
344
345 " LDR R2, =0x56346C \n"
346 " STR R0, [SP, #0xC] \n"
347 " SUB R0, R2, R0 \n"
348 " STR R0, [SP, #0x10] \n"
349 " MOV R0, #0x22 \n"
350 " STR R0, [SP, #0x1C] \n"
351 " MOV R0, #0x98 \n"
352 " STR R0, [SP, #0x20] \n"
353 " MOV R0, #0x1E8 \n"
354 " STR R2, [SP, #0x14] \n"
355 " STR R0, [SP, #0x24] \n"
356 " LDR R1, =0x56E000 \n"
357 " MOV R0, #0xFA \n"
358 " STR R0, [SP, #0x28] \n"
359 " MOV R0, #0xB6 \n"
360 " STR R1, [SP, #4] \n"
361 " STR R0, [SP, #0x2C] \n"
362 " MOV R0, #0x85 \n"
363 " STR R0, [SP, #0x30] \n"
364 " MOV R0, #0x40 \n"
365 " STR R0, [SP, #0x34] \n"
366 " MOV R0, #4 \n"
367 " STR R0, [SP, #0x38] \n"
368 " MOV R0, #0 \n"
369 " STR R0, [SP, #0x3C] \n"
370 " MOV R0, #0x10 \n"
371 " STR R0, [SP, #0x60] \n"
372 " MOV R0, #0x1000 \n"
373 " STR R0, [SP, #0x64] \n"
374 " MOV R0, #0x100 \n"
375 " STR R0, [SP, #0x68] \n"
376 " MOV R0, #0x2000 \n"
377 " STR R1, [SP, #0x18] \n"
378 " STR R0, [SP, #0x6C] \n"
379 " LDR R1, =sub_FF024704_my \n"
380 " MOV R2, #0 \n"
381 " ADD R0, SP, #4 \n"
382 " BL sub_006B1BC8 \n"
383 " ADD SP, SP, #0x7C \n"
384 " LDR PC, [SP], #4 \n"
385 );
386 }
387
388
389
390 void __attribute__((naked,noinline)) sub_FF024704_my() {
391 asm volatile (
392 " STMFD SP!, {R4,LR} \n"
393 " LDR R4, =0xFF0247C0 /*'/_term'*/ \n"
394 " BL sub_FF020858 \n"
395 " LDR R1, =0x1A5C \n"
396 " LDR R0, =0x19F0 \n"
397 " LDR R1, [R1] \n"
398 " LDR R0, [R0] \n"
399 " ADD R1, R1, #0x10 \n"
400 " CMP R0, R1 \n"
401 " LDRCC R0, =0xFF0247D0 /*'USER_MEM size checking'*/ \n"
402 " BLCC _err_init_task \n"
403 " BL sub_FF0234E0 \n"
404 " CMP R0, #0 \n"
405 " LDRLT R0, =0xFF0247E8 /*'dmSetup'*/ \n"
406 " BLLT _err_init_task \n"
407 " BL sub_FF0224E8 \n"
408 " CMP R0, #0 \n"
409 " LDRLT R0, =0xFF0247F0 /*'termDriverInit'*/ \n"
410 " BLLT _err_init_task \n"
411 " MOV R0, R4 \n"
412 " BL sub_FF0225C8 \n"
413 " CMP R0, #0 \n"
414 " LDRLT R0, =0xFF024800 /*'termDeviceCreate'*/ \n"
415 " BLLT _err_init_task \n"
416 " MOV R0, R4 \n"
417 " BL sub_FF022100 \n"
418 " CMP R0, #0 \n"
419 " LDRLT R0, =0xFF024814 /*'stdioSetup'*/ \n"
420 " BLLT _err_init_task \n"
421 " BL sub_FF024D70 \n"
422 " CMP R0, #0 \n"
423 " LDRLT R0, =0xFF024820 /*'stdlibSetup'*/ \n"
424 " BLLT _err_init_task \n"
425 " BL sub_FF0210A8 \n"
426 " CMP R0, #0 \n"
427 " LDRLT R0, =0xFF02482C /*'extlib_setup'*/ \n"
428 " BLLT _err_init_task \n"
429 " LDMFD SP!, {R4,LR} \n"
430 " B sub_FF027A44_my \n"
431 );
432 }
433
434
435
436 void __attribute__((naked,noinline)) sub_FF027A44_my() {
437 asm volatile (
438 " STMFD SP!, {R3,LR} \n"
439 " BL sub_FF033F14 \n"
440 " BL sub_FF037D3C \n"
441 " CMP R0, #0 \n"
442 " BNE loc_FF027A68 \n"
443 " BL sub_FF02D16C /*_IsNormalCameraMode_FW*/ \n"
444 " CMP R0, #0 \n"
445 " MOVNE R0, #1 \n"
446 " BNE loc_FF027A6C \n"
447
448 "loc_FF027A68:\n"
449 " MOV R0, #0 \n"
450
451 "loc_FF027A6C:\n"
452 " BL sub_FF02BBC0_my \n"
453 " CMP R0, #0 \n"
454 " BNE loc_FF027A80 \n"
455 " BL sub_FF02B3A4 \n"
456
457 "loc_FF027A7C:\n"
458 " B loc_FF027A7C \n"
459
460 "loc_FF027A80:\n"
461 " BL sub_006B8AD0 \n"
462 " LDR R1, =0x60E000 \n"
463 " MOV R0, #0 \n"
464 " BL sub_FF03822C \n"
465 " BL sub_006B8E18 /*_EnableDispatch*/ \n"
466 " MOV R3, #0 \n"
467 " STR R3, [SP] \n"
468 " LDR R3, =task_Startup_my \n"
469 " MOV R2, #0 \n"
470 " MOV R1, #0x19 \n"
471 " LDR R0, =0xFF027AC0 /*'Startup'*/ \n"
472 " BL _CreateTask \n"
473 " MOV R0, #0 \n"
474 " LDMFD SP!, {R3,PC} \n"
475 );
476 }
477
478
479
480 void __attribute__((naked,noinline)) sub_FF02BBC0_my() {
481 asm volatile (
482 " STMFD SP!, {R2-R10,LR} \n"
483 " MOV R4, #0 \n"
484 " MOV R10, R0 \n"
485 " MOV R5, R4 \n"
486 " MOV R7, R4 \n"
487
488 " MOV R0, #0x47 \n"
489 " BL sub_FF071738 \n"
490 " MOV R6, #1 \n"
491 " BIC R8, R6, R0 \n"
492 " MOV R0, #0x48 \n"
493 " BL sub_FF071738 \n"
494 " BIC R9, R6, R0 \n"
495 " MOV R0, #0 \n"
496 " BL sub_FF073C40 \n"
497 " CMP R0, #0 \n"
498 " BEQ loc_FF02BC10 \n"
499 " MOV R0, #0x49 \n"
500 " BL sub_FF071738 \n"
501 " BIC R5, R6, R0 \n"
502
503 "loc_FF02BC10:\n"
504 " MOV R0, #1 \n"
505 " BL sub_FF073C40 \n"
506 " CMP R0, #0 \n"
507 " BEQ loc_FF02BC2C \n"
508 " MOV R0, #0x4E \n"
509 " BL sub_FF071738 \n"
510 " BIC R4, R6, R0 \n"
511
512 "loc_FF02BC2C:\n"
513 " CMP R10, #0 \n"
514 " BEQ loc_FF02BC44 \n"
515 " ORR R0, R8, R9 \n"
516 " ORR R0, R0, R5 \n"
517 " ORRS R0, R0, R4 \n"
518 " BEQ loc_FF02BC6C \n"
519
520 "loc_FF02BC44:\n"
521 " BL sub_FF037D3C \n"
522 " MOV R2, R0 \n"
523 " MOV R3, R5 \n"
524 " MOV R1, R9 \n"
525 " MOV R0, R8 \n"
526 " STR R4, [SP, #4] \n"
527 " STR R7, [SP] \n"
528
529
530 " MOV R0, #1 \n"
531
532 "loc_FF02BC6C:\n"
533 " LDMFD SP!, {R2-R10,PC} \n"
534 );
535 }
536
537
538
539 void __attribute__((naked,noinline)) task_Startup_my() {
540 asm volatile (
541 " STMFD SP!, {R4,LR} \n"
542 " BL sub_FF022C84 \n"
543 " BL sub_FF02C090 \n"
544 " BL sub_FF02B350 \n"
545
546 " BL sub_FF037F58 \n"
547
548 " BL sub_FF0380B8 \n"
549 " BL sub_FF038300 \n"
550
551 " BL sub_FF037F94 \n"
552 " BL sub_FF033E4C \n"
553 " BL sub_FF038308 \n"
554 " BL CreateTask_spytask\n"
555 " BL taskcreatePhySw_my \n"
556 " BL init_required_fw_features\n"
557 " BL sub_FF0314D8 \n"
558 " BL sub_FF0C74B4 \n"
559 " BL sub_FF028E34 \n"
560 " BL sub_FF02ACC8 \n"
561 " BL sub_FF037B24 \n"
562 " BL sub_FF02B304 \n"
563 " BL sub_FF02AC5C \n"
564
565 " BL sub_FF029C10 \n"
566 " BL sub_FF02AC18 \n"
567 " LDMFD SP!, {R4,LR} \n"
568 " B sub_FF022DD4 \n"
569 );
570 }
571
572
573
574 void __attribute__((naked,noinline)) taskcreatePhySw_my() {
575 asm volatile (
576 " STMFD SP!, {R3-R5,LR} \n"
577 " BL sub_FF036D84 \n"
578 " BL sub_FF02D0A4 /*_IsFactoryMode_FW*/ \n"
579 " CMP R0, #0 \n"
580 " BLEQ sub_FF036CEC /*_OpLog.Start_FW*/ \n"
581 " LDR R4, =0x1CA0 \n"
582 " LDR R0, [R4, #4] \n"
583 " CMP R0, #0 \n"
584 " BNE loc_FF02BAAC \n"
585 " MOV R3, #0 \n"
586 " STR R3, [SP] \n"
587 " LDR R3, =mykbd_task \n"
588 " MOV R2, #0x2000 \n"
589 " MOV R1, #0x17 \n"
590 " LDR R0, =0xFF02BC80 /*'PhySw'*/ \n"
591 " BL sub_006B7BE0 /*_CreateTaskStrictly*/ \n"
592 " STR R0, [R4, #4] \n"
593
594 "loc_FF02BAAC:\n"
595 " LDMFD SP!, {R3-R5,LR} \n"
596 " B sub_FF074BC4 \n"
597 );
598 }
599
600
601
602
603 void fix_writable_media_flag() {
604 *(int*)0x1d60 = 1;
605 }
606
607
608
609 void __attribute__((naked,noinline)) init_file_modules_task() {
610 asm volatile (
611 " STMFD SP!, {R4-R6,LR} \n"
612 " BL sub_FF0B0B54 \n"
613 " LDR R5, =0x5006 \n"
614 " MOVS R4, R0 \n"
615 " MOVNE R1, #0 \n"
616 " MOVNE R0, R5 \n"
617 " BLNE _PostLogicalEventToUI \n"
618 " BL sub_FF0B0B84 \n"
619 " BL fix_writable_media_flag\n"
620 " BL core_spytask_can_start\n"
621 " CMP R4, #0 \n"
622 " LDMNEFD SP!, {R4-R6,PC} \n"
623 " MOV R0, R5 \n"
624 " LDMFD SP!, {R4-R6,LR} \n"
625 " MOV R1, #0 \n"
626 " B _PostLogicalEventToUI \n"
627 );
628 }
629
630
631
632 void __attribute__((naked,noinline)) JogDial_task_my() {
633 asm volatile (
634 " STMFD SP!, {R4-R11,LR} \n"
635 " SUB SP, SP, #0x24 \n"
636 " BL sub_FF074C04 \n"
637 " LDR R3, =0x2D20 \n"
638 " LDR R6, =0xFF63F04C \n"
639 " MOV R0, #0 \n"
640 " ADD R11, SP, #0xC \n"
641 " ADD R9, SP, #0x10 \n"
642
643
644 " LDR R2, =jog_position \n"
645 " STR R9, [R2] \n"
646
647 " MOV R10, R0 \n"
648
649 "loc_FF0748C4:\n"
650 " ADD R1, SP, #0x18 \n"
651 " ADD R12, R1, R0, LSL#1 \n"
652 " ADD R2, SP, #0x14 \n"
653 " STRH R10, [R12] \n"
654 " ADD R12, R2, R0, LSL#1 \n"
655 " STRH R10, [R12] \n"
656 " STR R10, [R9, R0, LSL#2] \n"
657 " STR R10, [R11, R0, LSL#2] \n"
658 " ADD R0, R0, #1 \n"
659 " CMP R0, #1 \n"
660 " BLT loc_FF0748C4 \n"
661
662 "loc_FF0748F0:\n"
663 " LDR R0, =0x2D20 \n"
664 " MOV R2, #0 \n"
665 " LDR R0, [R0, #8] \n"
666 " ADD R1, SP, #4 \n"
667 " BL sub_006B849C /*_ReceiveMessageQueue*/ \n"
668 " CMP R0, #0 \n"
669 " LDRNE R2, =0x229 \n"
670 " LDRNE R1, =0xFF074B6C /*'RotaryEncoder.c'*/ \n"
671 " MOVNE R0, #0 \n"
672 " BLNE _DebugAssert \n"
673 " LDR R0, [SP, #4] \n"
674 " AND R4, R0, #0xFF \n"
675 " AND R0, R0, #0xFF00 \n"
676 " CMP R0, #0x100 \n"
677 " BEQ loc_FF074968 \n"
678 " CMP R0, #0x200 \n"
679 " BEQ loc_FF0749A0 \n"
680 " CMP R0, #0x300 \n"
681 " BNE loc_FF0748F0 \n"
682 " LDR R0, [R9, R4, LSL#2] \n"
683 " CMP R0, #0 \n"
684 " LDREQ R2, =0x296 \n"
685 " LDREQ R1, =0xFF074B6C /*'RotaryEncoder.c'*/ \n"
686 " BLEQ _DebugAssert \n"
687 " RSB R0, R4, R4, LSL#3 \n"
688 " ADD R0, R6, R0, LSL#2 \n"
689 " LDR R0, [R0, #0xC] \n"
690 " BL sub_FF02BAB4 \n"
691 " STR R10, [R9, R4, LSL#2] \n"
692 " B loc_FF0748F0 \n"
693
694 "loc_FF074968:\n"
695
696 "labelA:\n"
697 " LDR R0, =jogdial_stopped\n"
698 " LDR R0, [R0]\n"
699 " CMP R0, #1\n"
700 " BNE labelB\n"
701 " MOV R0, #40\n"
702 " BL _SleepTask\n"
703 " B labelA\n"
704 "labelB:\n"
705
706 " LDR R0, =0x2D2C \n"
707 " LDR R0, [R0, R4, LSL#2] \n"
708 " BL sub_FF025FF0 /*_CancelTimer*/ \n"
709 " LDR R2, =0xFF0747E4 \n"
710 " ORR R3, R4, #0x200 \n"
711 " MOV R1, R2 \n"
712 " MOV R0, #0x28 \n"
713 " BL sub_FF025F20 /*_SetTimerAfter*/ \n"
714 " TST R0, #1 \n"
715 " CMPNE R0, #0x15 \n"
716 " STR R0, [R11, R4, LSL#2] \n"
717 " BEQ loc_FF0748F0 \n"
718 " LDR R2, =0x23B \n"
719 " B loc_FF074B54 \n"
720
721 "loc_FF0749A0:\n"
722 " RSB R5, R4, R4, LSL#3 \n"
723 " LDR R0, [R6, R5, LSL#2] \n"
724 " LDR R1, =0xC0240000 \n"
725 " ADD R0, R1, R0, LSL#8 \n"
726 " LDR R0, [R0, #0x104] \n"
727 " MOV R1, R0, ASR#16 \n"
728 " ADD R0, SP, #0x18 \n"
729 " ADD R0, R0, R4, LSL#1 \n"
730 " STR R0, [SP, #0x20] \n"
731 " STRH R1, [R0] \n"
732 " ADD R0, SP, #0x14 \n"
733 " ADD R0, R0, R4, LSL#1 \n"
734 " STR R0, [SP, #0x1C] \n"
735 " LDRSH R3, [R0] \n"
736 " SUB R2, R1, R3 \n"
737 " CMP R2, #0 \n"
738 " BNE loc_FF074A28 \n"
739 " LDR R0, [R9, R4, LSL#2] \n"
740 " CMP R0, #0 \n"
741 " BEQ loc_FF074B10 \n"
742 " LDR R7, =0x2D2C \n"
743 " LDR R0, [R7, R4, LSL#2] \n"
744 " BL sub_FF025FF0 /*_CancelTimer*/ \n"
745 " LDR R2, =0xFF0747F0 \n"
746 " ORR R3, R4, #0x300 \n"
747 " MOV R1, R2 \n"
748 " MOV R0, #0x1F4 \n"
749 " BL sub_FF025F20 /*_SetTimerAfter*/ \n"
750 " TST R0, #1 \n"
751 " CMPNE R0, #0x15 \n"
752 " STR R0, [R7, R4, LSL#2] \n"
753 " BEQ loc_FF074B10 \n"
754 " MOV R2, #0x254 \n"
755 " B loc_FF074B04 \n"
756
757 "loc_FF074A28:\n"
758 " MOV R0, R2 \n"
759 " RSBLT R0, R0, #0 \n"
760 " MOVLE R7, #0 \n"
761 " MOVGT R7, #1 \n"
762 " CMP R0, #0xFF \n"
763 " BLS loc_FF074A68 \n"
764 " LDR R0, =0x7FFF \n"
765 " CMP R2, #0 \n"
766 " SUBLE R0, R0, R3 \n"
767 " ADDLE R0, R0, R1 \n"
768 " MVNLE R1, #0x8000 \n"
769 " SUB R0, R0, R1 \n"
770 " ADDGT R1, R0, R3 \n"
771 " MVNGT R0, #0x8000 \n"
772 " SUBGT R0, R1, R0 \n"
773 " EOR R7, R7, #1 \n"
774
775 "loc_FF074A68:\n"
776 " STR R0, [SP, #8] \n"
777 " LDR R0, [R9, R4, LSL#2] \n"
778 " CMP R0, #0 \n"
779 " ADDEQ R0, R6, R5, LSL#2 \n"
780 " LDREQ R0, [R0, #8] \n"
781 " BEQ loc_FF074AA0 \n"
782 " ADD R8, R6, R5, LSL#2 \n"
783 " ADD R1, R8, R7, LSL#2 \n"
784 " LDR R1, [R1, #0x10] \n"
785 " CMP R1, R0 \n"
786 " BEQ loc_FF074AA4 \n"
787 " LDR R0, [R8, #0xC] \n"
788 " BL sub_FF02BAB4 \n"
789 " LDR R0, [R8, #8] \n"
790
791 "loc_FF074AA0:\n"
792 " BL sub_FF02BAB4 \n"
793
794 "loc_FF074AA4:\n"
795 " ADD R0, R6, R5, LSL#2 \n"
796 " ADD R7, R0, R7, LSL#2 \n"
797 " LDR R0, [R7, #0x10] \n"
798 " LDR R1, [SP, #8] \n"
799 " BL sub_FF02BAC4 \n"
800 " LDR R0, [R7, #0x10] \n"
801 " LDR R7, =0x2D2C \n"
802 " STR R0, [R9, R4, LSL#2] \n"
803 " LDR R0, [SP, #0x20] \n"
804 " LDRH R1, [R0] \n"
805 " LDR R0, [SP, #0x1C] \n"
806 " STRH R1, [R0] \n"
807 " LDR R0, [R7, R4, LSL#2] \n"
808 " BL sub_FF025FF0 /*_CancelTimer*/ \n"
809 " LDR R2, =0xFF0747F0 \n"
810 " ORR R3, R4, #0x300 \n"
811 " MOV R1, R2 \n"
812 " MOV R0, #0x1F4 \n"
813 " BL sub_FF025F20 /*_SetTimerAfter*/ \n"
814 " TST R0, #1 \n"
815 " CMPNE R0, #0x15 \n"
816 " STR R0, [R7, R4, LSL#2] \n"
817 " BEQ loc_FF074B10 \n"
818 " LDR R2, =0x285 \n"
819
820 "loc_FF074B04:\n"
821 " LDR R1, =0xFF074B6C /*'RotaryEncoder.c'*/ \n"
822 " MOV R0, #0 \n"
823 " BL _DebugAssert \n"
824
825 "loc_FF074B10:\n"
826 " ADD R0, R6, R5, LSL#2 \n"
827 " LDR R0, [R0, #0x18] \n"
828 " CMP R0, #1 \n"
829 " BNE loc_FF074BA8 \n"
830 " LDR R0, =0x2D20 \n"
831 " LDR R0, [R0, #0x10] \n"
832 " CMP R0, #0 \n"
833 " BEQ loc_FF074BA8 \n"
834 " LDR R2, =0xFF0747E4 \n"
835 " ORR R3, R4, #0x400 \n"
836 " MOV R1, R2 \n"
837 " BL sub_FF025F20 /*_SetTimerAfter*/ \n"
838 " TST R0, #1 \n"
839 " CMPNE R0, #0x15 \n"
840 " STR R0, [R11, R4, LSL#2] \n"
841 " BEQ loc_FF0748F0 \n"
842 " MOV R2, #0x28C \n"
843
844 "loc_FF074B54:\n"
845 " LDR R1, =0xFF074B6C /*'RotaryEncoder.c'*/ \n"
846 " MOV R0, #0 \n"
847 " BL _DebugAssert \n"
848 " B loc_FF0748F0 \n"
849
850 "loc_FF074BA8:\n"
851 " LDR R0, [R6, R5, LSL#2] \n"
852 " LDR R1, =0xC0240000 \n"
853 " ADD R0, R1, R0, LSL#8 \n"
854 " STR R10, [R0, #0x100] \n"
855 " MOV R1, #1 \n"
856 " STR R1, [R0, #0x108] \n"
857 " B loc_FF0748F0 \n"
858 );
859 }
860
861
862
863
864
865 void init_required_fw_features(void) {
866 extern void _init_focus_eventflag();
867
868
869 _init_focus_eventflag();
870 }