This source file includes following definitions.
- taskHook
- CreateTask_spytask
- boot
- sub_FF810354_my
- sub_FF811178_my
- sub_FF815E34_my
- taskcreate_Startup_my
- task_Startup_my
- taskcreatePhySw_my
- init_file_modules_task
- sub_FF889464_my
- sub_FF86B730_my
- sub_FF86B364_my
- sub_FF86B060_my
- JogDial_task_my
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
14 void JogDial_task_my(void);
15
16 extern void task_CaptSeq();
17 extern void task_ExpDrv();
18 extern void task_FileWrite();
19 extern void task_InitFileModules();
20 extern void task_MovieRecord();
21 extern void task_RotaryEncoder();
22
23 void taskHook(context_t **context)
24 {
25 task_t *tcb=(task_t*)((char*)context-offsetof(task_t, context));
26
27
28 if(tcb->entry == (void*)task_CaptSeq) tcb->entry = (void*)capt_seq_task;
29 if(tcb->entry == (void*)task_InitFileModules) tcb->entry = (void*)init_file_modules_task;
30 if(tcb->entry == (void*)task_MovieRecord) tcb->entry = (void*)movie_record_task;
31 if(tcb->entry == (void*)task_ExpDrv) tcb->entry = (void*)exp_drv_task;
32 if(tcb->entry == (void*)task_FileWrite) tcb->entry = (void*)filewritetask;
33 if(tcb->entry == (void*)task_RotaryEncoder) tcb->entry = (void*)JogDial_task_my;
34 }
35
36
37
38
39 void CreateTask_spytask() {
40 _CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
41 };
42
43
44
45
46
47
48
49
50
51 void __attribute__((naked,noinline)) boot() {
52 asm volatile (
53 " LDR R1, =0xC0410000 \n"
54 " MOV R0, #0 \n"
55 " STR R0, [R1] \n"
56 " MOV R1, #0x78 \n"
57 " MCR p15, 0, R1, c1, c0 \n"
58 " MOV R1, #0 \n"
59 " MCR p15, 0, R1, c7, c10, 4 \n"
60 " MCR p15, 0, R1, c7, c5 \n"
61 " MCR p15, 0, R1, c7, c6 \n"
62 " MOV R0, #0x3D \n"
63 " MCR p15, 0, R0, c6, c0 \n"
64 " MOV R0, #0xC000002F \n"
65 " MCR p15, 0, R0, c6, c1 \n"
66 " MOV R0, #0x33 \n"
67 " MCR p15, 0, R0, c6, c2 \n"
68 " MOV R0, #0x40000033 \n"
69 " MCR p15, 0, R0, c6, c3 \n"
70 " MOV R0, #0x80000017 \n"
71 " MCR p15, 0, R0, c6, c4 \n"
72 " LDR R0, =0xFF80002D \n"
73 " MCR p15, 0, R0, c6, c5 \n"
74 " MOV R0, #0x34 \n"
75 " MCR p15, 0, R0, c2, c0 \n"
76 " MOV R0, #0x34 \n"
77 " MCR p15, 0, R0, c2, c0, 1 \n"
78 " MOV R0, #0x34 \n"
79 " MCR p15, 0, R0, c3, c0 \n"
80 " LDR R0, =0x3333330 \n"
81 " MCR p15, 0, R0, c5, c0, 2 \n"
82 " LDR R0, =0x3333330 \n"
83 " MCR p15, 0, R0, c5, c0, 3 \n"
84 " MRC p15, 0, R0, c1, c0 \n"
85 " ORR R0, R0, #0x1000 \n"
86 " ORR R0, R0, #4 \n"
87 " ORR R0, R0, #1 \n"
88 " MCR p15, 0, R0, c1, c0 \n"
89 " MOV R1, #0x80000006 \n"
90 " MCR p15, 0, R1, c9, c1 \n"
91 " MOV R1, #6 \n"
92 " MCR p15, 0, R1, c9, c1, 1 \n"
93 " MRC p15, 0, R1, c1, c0 \n"
94 " ORR R1, R1, #0x50000 \n"
95 " MCR p15, 0, R1, c1, c0 \n"
96 " LDR R2, =0xC0200000 \n"
97 " MOV R1, #1 \n"
98 " STR R1, [R2, #0x10C] \n"
99 " MOV R1, #0xFF \n"
100 " STR R1, [R2, #0xC] \n"
101 " STR R1, [R2, #0x1C] \n"
102 " STR R1, [R2, #0x2C] \n"
103 " STR R1, [R2, #0x3C] \n"
104 " STR R1, [R2, #0x4C] \n"
105 " STR R1, [R2, #0x5C] \n"
106 " STR R1, [R2, #0x6C] \n"
107 " STR R1, [R2, #0x7C] \n"
108 " STR R1, [R2, #0x8C] \n"
109 " STR R1, [R2, #0x9C] \n"
110 " STR R1, [R2, #0xAC] \n"
111 " STR R1, [R2, #0xBC] \n"
112 " STR R1, [R2, #0xCC] \n"
113 " STR R1, [R2, #0xDC] \n"
114 " STR R1, [R2, #0xEC] \n"
115 " STR R1, [R2, #0xFC] \n"
116 " LDR R1, =0xC0400008 \n"
117 " LDR R2, =0x430005 \n"
118 " STR R2, [R1] \n"
119 " MOV R1, #1 \n"
120 " LDR R2, =0xC0243100 \n"
121 " STR R2, [R1] \n"
122 " LDR R2, =0xC0242010 \n"
123 " LDR R1, [R2] \n"
124 " ORR R1, R1, #1 \n"
125 " STR R1, [R2] \n"
126 " LDR R0, =0xFFC029E4 \n"
127 " LDR R1, =0x1900 \n"
128 " LDR R3, =0x208F0 \n"
129
130 "loc_FF81013C:\n"
131 " CMP R1, R3 \n"
132 " LDRCC R2, [R0], #4 \n"
133 " STRCC R2, [R1], #4 \n"
134 " BCC loc_FF81013C \n"
135 " LDR R1, =0x153E84 \n"
136 " MOV R2, #0 \n"
137
138 "loc_FF810154:\n"
139 " CMP R3, R1 \n"
140 " STRCC R2, [R3], #4 \n"
141 " BCC loc_FF810154 \n"
142 " B sub_FF810354_my \n"
143 );
144 }
145
146
147
148 void __attribute__((naked,noinline)) sub_FF810354_my() {
149
150
151 *(int*)0x1938=(int)taskHook;
152 *(int*)0x193C=(int)taskHook;
153
154
155
156 *(int*)(0x23DC)= (*(int*)0xC0220128) & 1 ? 0x800000 : 0x400000;
157
158 asm volatile (
159 " LDR R0, =0xFF8103CC \n"
160 " MOV R1, #0 \n"
161 " LDR R3, =0xFF810404 \n"
162
163 "loc_FF810360:\n"
164 " CMP R0, R3 \n"
165 " LDRCC R2, [R0], #4 \n"
166 " STRCC R2, [R1], #4 \n"
167 " BCC loc_FF810360 \n"
168 " LDR R0, =0xFF810404 \n"
169 " MOV R1, #0x4B0 \n"
170 " LDR R3, =0xFF810618 \n"
171
172 "loc_FF81037C:\n"
173 " CMP R0, R3 \n"
174 " LDRCC R2, [R0], #4 \n"
175 " STRCC R2, [R1], #4 \n"
176 " BCC loc_FF81037C \n"
177 " MOV R0, #0xD2 \n"
178 " MSR CPSR_cxsf, R0 \n"
179 " MOV SP, #0x1000 \n"
180 " MOV R0, #0xD3 \n"
181 " MSR CPSR_cxsf, R0 \n"
182 " MOV SP, #0x1000 \n"
183 " LDR R0, =0x6C4 \n"
184 " LDR R2, =0xEEEEEEEE \n"
185 " MOV R3, #0x1000 \n"
186
187 "loc_FF8103B0:\n"
188 " CMP R0, R3 \n"
189 " STRCC R2, [R0], #4 \n"
190 " BCC loc_FF8103B0 \n"
191 " BL sub_FF811178_my \n"
192 );
193 }
194
195
196
197 void __attribute__((naked,noinline)) sub_FF811178_my() {
198 asm volatile (
199 " STR LR, [SP, #-4]! \n"
200 " SUB SP, SP, #0x74 \n"
201 " MOV R0, SP \n"
202 " MOV R1, #0x74 \n"
203 " BL sub_FFB3A7A4 \n"
204 " MOV R0, #0x53000 \n"
205 " STR R0, [SP, #4] \n"
206
207 #if defined(CHDK_NOT_IN_CANON_HEAP)
208 " LDR R0, =0x153E84 \n"
209 #else
210 " LDR R0, =new_sa\n"
211 " LDR R0, [R0]\n"
212 #endif
213
214 " LDR R2, =0x339C00 \n"
215 " LDR R1, =0x3324A8 \n"
216 " STR R0, [SP, #8] \n"
217 " SUB R0, R1, R0 \n"
218 " ADD R3, SP, #0xC \n"
219 " STR R2, [SP] \n"
220 " STMIA R3, {R0-R2} \n"
221 " MOV R0, #0x22 \n"
222 " STR R0, [SP, #0x18] \n"
223 " MOV R0, #0x68 \n"
224 " STR R0, [SP, #0x1C] \n"
225 " LDR R0, =0x19B \n"
226 " LDR R1, =sub_FF815E34_my \n"
227 " STR R0, [SP, #0x20] \n"
228 " MOV R0, #0x96 \n"
229 " STR R0, [SP, #0x24] \n"
230 " MOV R0, #0x78 \n"
231 " STR R0, [SP, #0x28] \n"
232 " MOV R0, #0x64 \n"
233 " STR R0, [SP, #0x2C] \n"
234 " MOV R0, #0 \n"
235 " STR R0, [SP, #0x30] \n"
236 " STR R0, [SP, #0x34] \n"
237 " MOV R0, #0x10 \n"
238 " STR R0, [SP, #0x5C] \n"
239 " MOV R0, #0x800 \n"
240 " STR R0, [SP, #0x60] \n"
241 " MOV R0, #0xA0 \n"
242 " STR R0, [SP, #0x64] \n"
243 " MOV R0, #0x280 \n"
244 " STR R0, [SP, #0x68] \n"
245 " MOV R0, SP \n"
246 " MOV R2, #0 \n"
247 " BL sub_FF8133E4 \n"
248 " ADD SP, SP, #0x74 \n"
249 " LDR PC, [SP], #4 \n"
250 );
251 }
252
253
254
255 void __attribute__((naked,noinline)) sub_FF815E34_my() {
256 asm volatile (
257 " STMFD SP!, {R4,LR} \n"
258 " BL sub_FF810B08 \n"
259 " BL sub_FF81A148 \n"
260 " CMP R0, #0 \n"
261 " LDRLT R0, =0xFF815F48 /*'dmSetup'*/ \n"
262 " BLLT _err_init_task \n"
263 " BL sub_FF815A70 \n"
264 " CMP R0, #0 \n"
265 " LDRLT R0, =0xFF815F50 /*'termDriverInit'*/ \n"
266 " BLLT _err_init_task \n"
267 " LDR R0, =0xFF815F60 /*'/_term'*/ \n"
268 " BL sub_FF815B58 \n"
269 " CMP R0, #0 \n"
270 " LDRLT R0, =0xFF815F68 /*'termDeviceCreate'*/ \n"
271 " BLLT _err_init_task \n"
272 " LDR R0, =0xFF815F60 /*'/_term'*/ \n"
273 " BL sub_FF813BE0 \n"
274 " CMP R0, #0 \n"
275 " LDRLT R0, =0xFF815F7C /*'stdioSetup'*/ \n"
276 " BLLT _err_init_task \n"
277 " BL sub_FF819B5C \n"
278 " CMP R0, #0 \n"
279 " LDRLT R0, =0xFF815F88 /*'stdlibSetup'*/ \n"
280 " BLLT _err_init_task \n"
281 " BL sub_FF81165C \n"
282 " CMP R0, #0 \n"
283 " LDRLT R0, =0xFF815F94 /*'armlib_setup'*/ \n"
284 " BLLT _err_init_task \n"
285 " LDMFD SP!, {R4,LR} \n"
286 " B taskcreate_Startup_my \n"
287 );
288 }
289
290
291
292 void __attribute__((naked,noinline)) taskcreate_Startup_my() {
293 asm volatile (
294 " STMFD SP!, {R3-R5,LR} \n"
295
296 " BL sub_FF83A224 \n"
297 " CMP R0, #0 \n"
298 " BNE loc_FF81F8B0 \n"
299 " LDR R4, =0xC0220000 \n"
300 " LDR R0, [R4, #0x12C] \n"
301 " TST R0, #1 \n"
302 " MOVEQ R0, #0x12C \n"
303 " BLEQ _SleepTask \n"
304 " BL sub_FF85A6E8 \n"
305 " CMP R0, #0 \n"
306 " BNE loc_FF81F8B0 \n"
307 " BL sub_FF8329DC \n"
308 " MOV R0, #0x44 \n"
309 " STR R0, [R4, #0x1C] \n"
310 " BL sub_FF832BC8 \n"
311
312 "loc_FF81F8AC:\n"
313 " B loc_FF81F8AC \n"
314
315 "loc_FF81F8B0:\n"
316
317
318 " BL sub_FF8384D4 \n"
319 " LDR R1, =0x38E000 \n"
320 " MOV R0, #0 \n"
321 " BL sub_FF83891C \n"
322 " BL sub_FF8386C8 /*_EnableDispatch*/ \n"
323 " MOV R3, #0 \n"
324 " STR R3, [SP] \n"
325 " LDR R3, =task_Startup_my \n"
326 " LDR PC, =0xFF81F8D8 \n"
327 );
328 }
329
330
331
332 void __attribute__((naked,noinline)) task_Startup_my() {
333 asm volatile (
334 " STMFD SP!, {R4,LR} \n"
335 " BL sub_FF816490 \n"
336 " BL sub_FF834440 \n"
337 " BL sub_FF832670 \n"
338
339 " BL sub_FF83A448 \n"
340
341 " BL sub_FF890C30 \n"
342 " BL sub_FF83136C \n"
343 " BL sub_FF83A478 \n"
344 " BL sub_FF837C78 \n"
345 " BL sub_FF83A5F4 \n"
346
347 " BL CreateTask_spytask\n"
348
349 " BL taskcreatePhySw_my \n"
350 " LDR PC, =0xFF81F838 \n"
351 );
352 }
353
354
355
356 void __attribute__((naked,noinline)) taskcreatePhySw_my() {
357 asm volatile (
358 " STMFD SP!, {R3-R5,LR} \n"
359 " LDR R4, =0x1C38 \n"
360 " LDR R0, [R4, #0x10] \n"
361 " CMP R0, #0 \n"
362 " BNE sub_FF833264 \n"
363 " MOV R3, #0 \n"
364 " STR R3, [SP] \n"
365 " LDR R3, =mykbd_task \n"
366 " MOV R2, #0x2000 \n"
367 " LDR PC, =0xFF833254 \n"
368 );
369 }
370
371
372
373 void __attribute__((naked,noinline)) init_file_modules_task() {
374 asm volatile (
375 " STMFD SP!, {R4-R6,LR} \n"
376 " BL sub_FF889438 \n"
377 " LDR R5, =0x5006 \n"
378 " MOVS R4, R0 \n"
379 " MOVNE R1, #0 \n"
380 " MOVNE R0, R5 \n"
381 " BLNE _PostLogicalEventToUI \n"
382 " BL sub_FF889464_my \n"
383 " BL core_spytask_can_start\n"
384 " LDR PC, =0xFF894570 \n"
385 );
386 }
387
388
389
390 void __attribute__((naked,noinline)) sub_FF889464_my() {
391 asm volatile (
392 " STMFD SP!, {R4,LR} \n"
393 " MOV R0, #3 \n"
394 " BL sub_FF86B730_my \n"
395 " LDR PC, =0xFF889470 \n"
396 );
397 }
398
399
400
401 void __attribute__((naked,noinline)) sub_FF86B730_my() {
402 asm volatile (
403 " STMFD SP!, {R4-R8,LR} \n"
404 " MOV R8, R0 \n"
405 " BL sub_FF86B6B0 \n"
406 " LDR R1, =0x49160 \n"
407 " MOV R6, R0 \n"
408 " ADD R4, R1, R0, LSL#7 \n"
409 " LDR R0, [R4, #0x6C] \n"
410 " CMP R0, #4 \n"
411 " LDREQ R1, =0x804 \n"
412 " LDREQ R0, =0xFF86B1FC /*'Mounter.c'*/ \n"
413 " BLEQ _DebugAssert \n"
414 " MOV R1, R8 \n"
415 " MOV R0, R6 \n"
416 " BL sub_FF86AF50 \n"
417 " LDR R0, [R4, #0x38] \n"
418 " BL sub_FF86BD4C \n"
419 " CMP R0, #0 \n"
420 " STREQ R0, [R4, #0x6C] \n"
421 " MOV R0, R6 \n"
422 " BL sub_FF86AFE0 \n"
423 " MOV R0, R6 \n"
424 " BL sub_FF86B364_my \n"
425 " LDR PC, =0xFF86B788 \n"
426 );
427 }
428
429
430
431 void __attribute__((naked,noinline)) sub_FF86B364_my() {
432 asm volatile (
433 " STMFD SP!, {R4-R6,LR} \n"
434 " MOV R5, R0 \n"
435 " LDR R0, =0x49160 \n"
436 " ADD R4, R0, R5, LSL#7 \n"
437 " LDR R0, [R4, #0x6C] \n"
438 " TST R0, #2 \n"
439 " MOVNE R0, #1 \n"
440 " LDMNEFD SP!, {R4-R6,PC} \n"
441 " LDR R0, [R4, #0x38] \n"
442 " MOV R1, R5 \n"
443 " BL sub_FF86B060_my \n"
444 " LDR PC, =0xFF86B390 \n"
445 );
446 }
447
448
449
450 void __attribute__((naked,noinline)) sub_FF86B060_my() {
451 asm volatile (
452 " STMFD SP!, {R4-R10,LR} \n"
453 " MOV R9, R0 \n"
454 " LDR R0, =0x49160 \n"
455 " MOV R8, #0 \n"
456 " ADD R5, R0, R1, LSL#7 \n"
457 " LDR R0, [R5, #0x3C] \n"
458 " MOV R7, #0 \n"
459 " CMP R0, #7 \n"
460 " MOV R6, #0 \n"
461 " ADDLS PC, PC, R0, LSL#2 \n"
462 " B loc_FF86B1B8 \n"
463 " B loc_FF86B0C4 \n"
464 " B loc_FF86B0AC \n"
465 " B loc_FF86B0AC \n"
466 " B loc_FF86B0AC \n"
467 " B loc_FF86B0AC \n"
468 " B loc_FF86B1B0 \n"
469 " B loc_FF86B0AC \n"
470 " B loc_FF86B0AC \n"
471
472 "loc_FF86B0AC:\n"
473 " MOV R2, #0 \n"
474 " MOV R1, #0x200 \n"
475 " MOV R0, #2 \n"
476 " BL _exmem_ualloc \n"
477 " MOVS R4, R0 \n"
478 " BNE loc_FF86B0CC \n"
479
480 "loc_FF86B0C4:\n"
481 " MOV R0, #0 \n"
482 " LDMFD SP!, {R4-R10,PC} \n"
483
484 "loc_FF86B0CC:\n"
485 " LDR R12, [R5, #0x50] \n"
486 " MOV R3, R4 \n"
487 " MOV R2, #1 \n"
488 " MOV R1, #0 \n"
489 " MOV R0, R9 \n"
490 " BLX R12 \n"
491 " CMP R0, #1 \n"
492 " BNE loc_FF86B0F8 \n"
493 " MOV R0, #2 \n"
494 " BL _exmem_ufree \n"
495 " B loc_FF86B0C4 \n"
496
497 "loc_FF86B0F8:\n"
498 " LDR R1, [R5, #0x64] \n"
499 " MOV R0, R9 \n"
500 " BLX R1 \n"
501
502 " MOV R1, R4\n"
503 " BL mbr_read_dryos\n"
504
505
506
507
508
509
510 " MOV R12, R4\n"
511 " MOV LR, R4\n"
512 " MOV R1, #1\n"
513 " B dg_sd_fat32_enter\n"
514 "dg_sd_fat32:\n"
515 " CMP R1, #4\n"
516 " BEQ dg_sd_fat32_end\n"
517 " ADD R12, R12, #0x10\n"
518 " ADD R1, R1, #1\n"
519 "dg_sd_fat32_enter:\n"
520 " LDRB R2, [R12, #0x1BE]\n"
521 " LDRB R3, [R12, #0x1C2]\n"
522 " CMP R3, #0xB\n"
523 " CMPNE R3, #0xC\n"
524 " CMPNE R3, #0x7\n"
525 " BNE dg_sd_fat32\n"
526 " CMP R2, #0x00\n"
527 " CMPNE R2, #0x80\n"
528 " BNE dg_sd_fat32\n"
529
530 " MOV R4, R12\n"
531
532 "dg_sd_fat32_end:\n"
533
534
535 " LDRB R1, [R4, #0x1C9] \n"
536 " LDRB R3, [R4, #0x1C8] \n"
537 " LDRB R12, [R4, #0x1CC] \n"
538 " MOV R1, R1, LSL#24 \n"
539 " ORR R1, R1, R3, LSL#16 \n"
540 " LDRB R3, [R4, #0x1C7] \n"
541 " LDRB R2, [R4, #0x1BE] \n"
542
543 " ORR R1, R1, R3, LSL#8 \n"
544 " LDRB R3, [R4, #0x1C6] \n"
545 " CMP R2, #0 \n"
546 " CMPNE R2, #0x80 \n"
547 " ORR R1, R1, R3 \n"
548 " LDRB R3, [R4, #0x1CD] \n"
549 " MOV R3, R3, LSL#24 \n"
550 " ORR R3, R3, R12, LSL#16 \n"
551 " LDRB R12, [R4, #0x1CB] \n"
552 " ORR R3, R3, R12, LSL#8 \n"
553 " LDRB R12, [R4, #0x1CA] \n"
554 " ORR R3, R3, R12 \n"
555
556 " LDRB R12, [LR,#0x1FE]\n"
557 " LDRB LR, [LR,#0x1FF]\n"
558 " BNE loc_FF86B184 \n"
559 " CMP R0, R1 \n"
560 " BCC loc_FF86B184 \n"
561 " ADD R2, R1, R3 \n"
562 " CMP R2, R0 \n"
563 " CMPLS R12, #0x55 \n"
564 " CMPEQ LR, #0xAA \n"
565 " MOVEQ R7, R1 \n"
566 " MOVEQ R6, R3 \n"
567 " MOVEQ R4, #1 \n"
568 " BEQ loc_FF86B188 \n"
569
570 "loc_FF86B184:\n"
571 " MOV R4, R8 \n"
572
573 "loc_FF86B188:\n"
574 " MOV R0, #2 \n"
575 " BL _exmem_ufree \n"
576 " CMP R4, #0 \n"
577 " BNE loc_FF86B1C4 \n"
578 " LDR R1, [R5, #0x64] \n"
579 " MOV R7, #0 \n"
580 " MOV R0, R9 \n"
581 " BLX R1 \n"
582 " MOV R6, R0 \n"
583 " B loc_FF86B1C4 \n"
584
585 "loc_FF86B1B0:\n"
586 " MOV R6, #0x40 \n"
587 " B loc_FF86B1C4 \n"
588
589 "loc_FF86B1B8:\n"
590 " LDR R1, =0x568 \n"
591 " LDR R0, =0xFF86B1FC /*'Mounter.c'*/ \n"
592 " BL _DebugAssert \n"
593
594 "loc_FF86B1C4:\n"
595 " STR R7, [R5, #0x44]! \n"
596 " STMIB R5, {R6,R8} \n"
597 " MOV R0, #1 \n"
598 " LDMFD SP!, {R4-R10,PC} \n"
599 );
600 }
601
602
603
604 void __attribute__((naked,noinline)) JogDial_task_my() {
605 asm volatile (
606 " STMFD SP!, {R4-R11,LR} \n"
607 " SUB SP, SP, #0x2C \n"
608 " BL sub_FF85B358 \n"
609 " LDR R1, =0x23E4 \n"
610 " LDR R8, =0xFFB40730 \n"
611 " MOV R0, #0 \n"
612 " ADD R2, SP, #0x14 \n"
613 " ADD R3, SP, #0x18 \n"
614 " ADD R10, SP, #0xC \n"
615 " ADD R9, SP, #0x10 \n"
616 " MOV R7, #0 \n"
617
618 "loc_FF85AFDC:\n"
619 " ADD R3, SP, #0x18 \n"
620 " ADD R12, R3, R0, LSL#1 \n"
621 " ADD R2, SP, #0x14 \n"
622 " STRH R7, [R12] \n"
623 " ADD R12, R2, R0, LSL#1 \n"
624 " STRH R7, [R12] \n"
625 " STR R7, [R9, R0, LSL#2] \n"
626 " STR R7, [R10, R0, LSL#2] \n"
627 " ADD R0, R0, #1 \n"
628 " CMP R0, #1 \n"
629 " BLT loc_FF85AFDC \n"
630
631 "loc_FF85B008:\n"
632 " LDR R0, =0x23E4 \n"
633 " MOV R2, #0 \n"
634 " LDR R0, [R0, #8] \n"
635 " ADD R1, SP, #4 \n"
636 " BL sub_FF837F08 /*_ReceiveMessageQueue*/ \n"
637 " TST R0, #1 \n"
638 " LDRNE R1, =0x226 \n"
639 " LDRNE R0, =0xFF85B28C /*'JogDial.c'*/ \n"
640 " BLNE _DebugAssert \n"
641 " LDR R0, [SP, #4] \n"
642 " AND R4, R0, #0xFF \n"
643 " AND R0, R0, #0xFF00 \n"
644 " CMP R0, #0x100 \n"
645 " BEQ loc_FF85B08C \n"
646 " CMP R0, #0x200 \n"
647 " BEQ loc_FF85B0C4 \n"
648 " CMP R0, #0x300 \n"
649 " BEQ loc_FF85B2D8 \n"
650 " CMP R0, #0x400 \n"
651 " BNE loc_FF85B008 \n"
652 " CMP R4, #0 \n"
653 " LDRNE R1, =0x2CA \n"
654 " LDRNE R0, =0xFF85B28C /*'JogDial.c'*/ \n"
655 " BLNE _DebugAssert \n"
656 " LDR R2, =0xFFB4071C \n"
657 " ADD R0, R4, R4, LSL#2 \n"
658 " LDR R1, [R2, R0, LSL#2] \n"
659 " STR R7, [R1] \n"
660 " MOV R1, #1 \n"
661 " ADD R0, R2, R0, LSL#2 \n"
662
663 "loc_FF85B080:\n"
664 " LDR R0, [R0, #8] \n"
665 " STR R1, [R0] \n"
666 " B loc_FF85B008 \n"
667
668 "loc_FF85B08C:\n"
669
670 "labelA:\n"
671 " LDR R0, =jogdial_stopped\n"
672 " LDR R0, [R0]\n"
673 " CMP R0, #1\n"
674 " BNE labelB\n"
675 " MOV R0, #40\n"
676 " BL _SleepTask\n"
677 " B labelA\n"
678 "labelB:\n"
679
680 " LDR R5, =0x23F4 \n"
681 " LDR R0, [R5, R4, LSL#2] \n"
682 " BL sub_FF838EA0 /*_CancelTimer*/ \n"
683 " LDR R2, =0xFF85AF3C \n"
684 " MOV R1, R2 \n"
685 " ORR R3, R4, #0x200 \n"
686 " MOV R0, #0x28 \n"
687 " BL sub_FF838DBC /*_SetTimerAfter*/ \n"
688 " TST R0, #1 \n"
689 " CMPNE R0, #0x15 \n"
690 " STR R0, [R10, R4, LSL#2] \n"
691 " BEQ loc_FF85B008 \n"
692 " LDR R1, =0x23B \n"
693 " B loc_FF85B27C \n"
694
695 "loc_FF85B0C4:\n"
696 " LDR R1, =0xFFB4071C \n"
697 " ADD R0, R4, R4, LSL#2 \n"
698 " STR R0, [SP, #0x28] \n"
699 " ADD R0, R1, R0, LSL#2 \n"
700 " STR R0, [SP, #0x24] \n"
701 " LDR R0, [R0, #4] \n"
702 " LDR R0, [R0] \n"
703 " MOV R2, R0, ASR#16 \n"
704 " ADD R0, SP, #0x18 \n"
705 " ADD R0, R0, R4, LSL#1 \n"
706 " STR R0, [SP, #0x20] \n"
707 " STRH R2, [R0] \n"
708 " ADD R0, SP, #0x14 \n"
709 " ADD R0, R0, R4, LSL#1 \n"
710 " STR R0, [SP, #0x1C] \n"
711 " LDRSH R3, [R0] \n"
712 " SUB R0, R2, R3 \n"
713 " CMP R0, #0 \n"
714 " BEQ loc_FF85B234 \n"
715 " MOV R1, R0 \n"
716 " RSBLT R0, R0, #0 \n"
717 " MOVLE R5, #0 \n"
718 " MOVGT R5, #1 \n"
719 " CMP R0, #0xFF \n"
720 " BLS loc_FF85B150 \n"
721 " CMP R1, #0 \n"
722 " RSBLE R0, R3, #0xFF \n"
723 " ADDLE R0, R0, #0x7F00 \n"
724 " ADDLE R0, R0, R2 \n"
725 " RSBGT R0, R2, #0xFF \n"
726 " ADDGT R0, R0, #0x7F00 \n"
727 " ADDGT R0, R0, R3 \n"
728 " ADD R0, R0, #0x8000 \n"
729 " ADD R0, R0, #1 \n"
730 " EOR R5, R5, #1 \n"
731
732 "loc_FF85B150:\n"
733 " STR R0, [SP, #8] \n"
734 " LDR R0, [R9, R4, LSL#2] \n"
735 " CMP R0, #0 \n"
736 " BEQ loc_FF85B1A0 \n"
737 " LDR R1, =0xFFB40714 \n"
738 " ADD R1, R1, R4, LSL#3 \n"
739 " LDR R1, [R1, R5, LSL#2] \n"
740 " CMP R1, R0 \n"
741 " BEQ loc_FF85B1BC \n"
742 " ADD R11, R4, R4, LSL#1 \n"
743 " ADD R6, R8, R11, LSL#2 \n"
744 " LDRB R0, [R6, #9] \n"
745 " CMP R0, #1 \n"
746 " LDREQ R0, [R6, #4] \n"
747 " BLEQ sub_FF8906D4 \n"
748 " LDRB R0, [R6, #8] \n"
749 " CMP R0, #1 \n"
750 " BNE loc_FF85B1BC \n"
751 " LDR R0, [R8, R11, LSL#2] \n"
752 " B loc_FF85B1B8 \n"
753
754 "loc_FF85B1A0:\n"
755 " ADD R0, R4, R4, LSL#1 \n"
756 " ADD R1, R8, R0, LSL#2 \n"
757 " LDRB R1, [R1, #8] \n"
758 " CMP R1, #1 \n"
759 " BNE loc_FF85B1BC \n"
760 " LDR R0, [R8, R0, LSL#2] \n"
761
762 "loc_FF85B1B8:\n"
763 " BL sub_FF8906D4 \n"
764
765 "loc_FF85B1BC:\n"
766 " LDR R0, =0xFFB40714 \n"
767 " LDR R1, [SP, #8] \n"
768 " ADD R6, R0, R4, LSL#3 \n"
769 " LDR R0, [R6, R5, LSL#2] \n"
770 " BL sub_FF8905E0 \n"
771 " LDR R0, [R6, R5, LSL#2] \n"
772 " STR R0, [R9, R4, LSL#2] \n"
773 " LDR R0, [SP, #0x20] \n"
774 " LDR R1, [SP, #0x1C] \n"
775 " LDRH R0, [R0] \n"
776 " STRH R0, [R1] \n"
777 " ADD R0, R4, R4, LSL#1 \n"
778 " ADD R0, R8, R0, LSL#2 \n"
779 " LDRB R0, [R0, #9] \n"
780 " CMP R0, #1 \n"
781 " BNE loc_FF85B234 \n"
782 " LDR R5, =0x23F4 \n"
783 " LDR R0, [R5, R4, LSL#2] \n"
784 " BL sub_FF838EA0 /*_CancelTimer*/ \n"
785 " LDR R2, =0xFF85AF48 \n"
786 " MOV R1, R2 \n"
787 " ORR R3, R4, #0x300 \n"
788 " MOV R0, #0x1F4 \n"
789 " BL sub_FF838DBC /*_SetTimerAfter*/ \n"
790 " TST R0, #1 \n"
791 " CMPNE R0, #0x15 \n"
792 " STR R0, [R5, R4, LSL#2] \n"
793 " LDRNE R0, =0xFF85B28C /*'JogDial.c'*/ \n"
794 " MOVNE R1, #0x2A4 \n"
795 " BLNE _DebugAssert \n"
796
797 "loc_FF85B234:\n"
798 " ADD R0, R4, R4, LSL#1 \n"
799 " ADD R0, R8, R0, LSL#2 \n"
800 " LDRB R0, [R0, #0xA] \n"
801 " CMP R0, #1 \n"
802 " BNE loc_FF85B2BC \n"
803 " LDR R0, =0x23E4 \n"
804 " LDR R0, [R0, #0xC] \n"
805 " CMP R0, #0 \n"
806 " BEQ loc_FF85B2BC \n"
807 " LDR R2, =0xFF85AF3C \n"
808 " MOV R1, R2 \n"
809 " ORR R3, R4, #0x400 \n"
810 " BL sub_FF838DBC /*_SetTimerAfter*/ \n"
811 " TST R0, #1 \n"
812 " CMPNE R0, #0x15 \n"
813 " STR R0, [R10, R4, LSL#2] \n"
814 " BEQ loc_FF85B008 \n"
815 " LDR R1, =0x2AF \n"
816
817 "loc_FF85B27C:\n"
818 " LDR R0, =0xFF85B28C /*'JogDial.c'*/ \n"
819 " BL _DebugAssert \n"
820 " B loc_FF85B008 \n"
821
822 "loc_FF85B2BC:\n"
823 " LDR R1, =0xFFB4071C \n"
824 " LDR R0, [SP, #0x28] \n"
825 " LDR R0, [R1, R0, LSL#2] \n"
826 " STR R7, [R0] \n"
827 " LDR R0, [SP, #0x24] \n"
828 " MOV R1, #1 \n"
829 " B loc_FF85B080 \n"
830
831 "loc_FF85B2D8:\n"
832 " LDR R0, [R9, R4, LSL#2] \n"
833 " CMP R0, #0 \n"
834 " MOVEQ R1, #0x2BC \n"
835 " LDREQ R0, =0xFF85B28C /*'JogDial.c'*/ \n"
836 " BLEQ _DebugAssert \n"
837 " ADD R0, R4, R4, LSL#1 \n"
838 " ADD R0, R8, R0, LSL#2 \n"
839 " LDR R0, [R0, #4] \n"
840 " BL sub_FF8906D4 \n"
841 " STR R7, [R9, R4, LSL#2] \n"
842 " B loc_FF85B008 \n"
843 );
844 }