This source file includes following definitions.
- taskCreateHook
- boot
- sub_FF810358_my
- sub_FF8111B0_my
- sub_FF815F2C_my
- sub_FF81FD8C_my
- taskcreate_Startup_my
- task_Startup_my
- spytask
- CreateTask_spytask
- CreateTask_PhySw
- init_file_modules_task
- JogDial_task_my
1 #include "lolevel.h"
2 #include "platform.h"
3 #include "core.h"
4 #include "dryos31.h"
5
6 #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
7
8 const char * const new_sa = &_end;
9
10
11
12 void CreateTask_PhySw();
13 void CreateTask_spytask();
14 extern volatile int jogdial_stopped;
15 void JogDial_task_my(void);
16
17
18
19
20
21 extern void task_CaptSeq();
22 extern void task_InitFileModules();
23 extern void task_RotaryEncoder();
24 extern void task_MovieRecord();
25 extern void task_ExpDrv();
26
27 void taskCreateHook(context_t **context) {
28 task_t *tcb=(task_t*)((char*)context-offsetof(task_t, context));
29
30
31 if(tcb->entry == (void*)task_CaptSeq) tcb->entry = (void*)capt_seq_task;
32 if(tcb->entry == (void*)task_InitFileModules) tcb->entry = (void*)init_file_modules_task;
33 if(tcb->entry == (void*)task_RotaryEncoder) tcb->entry = (void*)JogDial_task_my;
34 if(tcb->entry == (void*)task_MovieRecord) tcb->entry = (void*)movie_record_task;
35 if(tcb->entry == (void*)task_ExpDrv) tcb->entry = (void*)exp_drv_task;
36 }
37
38
39
40
41
42
43 void __attribute__((naked,noinline)) boot()
44 {
45 asm volatile (
46 " LDR R1, =0xC0410000 \n"
47 " MOV R0, #0 \n"
48 " STR R0, [R1] \n"
49 " MOV R1, #0x78 \n"
50 " MCR p15, 0, R1, c1, c0 \n"
51 " MOV R1, #0 \n"
52 " MCR p15, 0, R1, c7, c10, 4 \n"
53 " MCR p15, 0, R1, c7, c5 \n"
54 " MCR p15, 0, R1, c7, c6 \n"
55 " MOV R0, #0x3D \n"
56 " MCR p15, 0, R0, c6, c0 \n"
57 " MOV R0, #0xC000002F \n"
58 " MCR p15, 0, R0, c6, c1 \n"
59 " MOV R0, #0x33 \n"
60 " MCR p15, 0, R0, c6, c2 \n"
61 " MOV R0, #0x40000033 \n"
62 " MCR p15, 0, R0, c6, c3 \n"
63 " MOV R0, #0x80000017 \n"
64 " MCR p15, 0, R0, c6, c4 \n"
65 " LDR R0, =0xFF80002D \n"
66 " MCR p15, 0, R0, c6, c5 \n"
67 " MOV R0, #0x34 \n"
68 " MCR p15, 0, R0, c2, c0 \n"
69 " MOV R0, #0x34 \n"
70 " MCR p15, 0, R0, c2, c0, 1 \n"
71 " MOV R0, #0x34 \n"
72 " MCR p15, 0, R0, c3, c0 \n"
73 " LDR R0, =0x3333330 \n"
74 " MCR p15, 0, R0, c5, c0, 2 \n"
75 " LDR R0, =0x3333330 \n"
76 " MCR p15, 0, R0, c5, c0, 3 \n"
77 " MRC p15, 0, R0, c1, c0 \n"
78 " ORR R0, R0, #0x1000 \n"
79 " ORR R0, R0, #4 \n"
80 " ORR R0, R0, #1 \n"
81 " MCR p15, 0, R0, c1, c0 \n"
82 " MOV R1, #0x80000006 \n"
83 " MCR p15, 0, R1, c9, c1 \n"
84 " MOV R1, #6 \n"
85 " MCR p15, 0, R1, c9, c1, 1 \n"
86 " MRC p15, 0, R1, c1, c0 \n"
87 " ORR R1, R1, #0x50000 \n"
88 " MCR p15, 0, R1, c1, c0 \n"
89 " LDR R2, =0xC0200000 \n"
90 " MOV R1, #1 \n"
91 " STR R1, [R2, #0x10C] \n"
92 " MOV R1, #0xFF \n"
93 " STR R1, [R2, #0xC] \n"
94 " STR R1, [R2, #0x1C] \n"
95 " STR R1, [R2, #0x2C] \n"
96 " STR R1, [R2, #0x3C] \n"
97 " STR R1, [R2, #0x4C] \n"
98 " STR R1, [R2, #0x5C] \n"
99 " STR R1, [R2, #0x6C] \n"
100 " STR R1, [R2, #0x7C] \n"
101 " STR R1, [R2, #0x8C] \n"
102 " STR R1, [R2, #0x9C] \n"
103 " STR R1, [R2, #0xAC] \n"
104 " STR R1, [R2, #0xBC] \n"
105 " STR R1, [R2, #0xCC] \n"
106 " STR R1, [R2, #0xDC] \n"
107 " STR R1, [R2, #0xEC] \n"
108 " STR R1, [R2, #0xFC] \n"
109 " LDR R1, =0xC0400008 \n"
110 " LDR R2, =0x430005 \n"
111 " STR R2, [R1] \n"
112 " MOV R1, #1 \n"
113 " LDR R2, =0xC0243100 \n"
114 " STR R2, [R1] \n"
115 " LDR R2, =0xC0242010 \n"
116 " LDR R1, [R2] \n"
117 " ORR R1, R1, #1 \n"
118 " STR R1, [R2] \n"
119 " LDR R0, =0xFFC73A58 \n"
120 " LDR R1, =0x1900 \n"
121 " LDR R3, =0xFA30 \n"
122 "loc_FF81013C:\n"
123 " CMP R1, R3 \n"
124 " LDRCC R2, [R0], #4 \n"
125 " STRCC R2, [R1], #4 \n"
126 " BCC loc_FF81013C \n"
127 " LDR R1, =0x175CE0 \n"
128 " MOV R2, #0 \n"
129 "loc_FF810154:\n"
130 " CMP R3, R1 \n"
131 " STRCC R2, [R3], #4 \n"
132 " BCC loc_FF810154 \n"
133
134 " B sub_FF810358_my \n"
135
136 );
137 }
138
139
140
141 void __attribute__((naked,noinline)) sub_FF810358_my() {
142
143
144 *(int*)0x1938 = (int)taskCreateHook;
145 *(int*)0x193C = (int)taskCreateHook;
146
147
148
149
150 if ((*(int*) 0xC0220114) & 1)
151 *(int*)(0x25A0) = 0x200000;
152 else
153 *(int*)(0x25A0) = 0x100000;
154
155 asm volatile (
156
157 " LDR R0, =0xFF8103D0 \n"
158 " MOV R1, #0 \n"
159 " LDR R3, =0xFF810408 \n"
160 "loc_FF810364:\n"
161 " CMP R0, R3 \n"
162 " LDRCC R2, [R0], #4 \n"
163 " STRCC R2, [R1], #4 \n"
164 " BCC loc_FF810364 \n"
165 " LDR R0, =0xFF810408 \n"
166 " MOV R1, #0x4B0 \n"
167 " LDR R3, =0xFF81061C \n"
168 "loc_FF810380:\n"
169 " CMP R0, R3 \n"
170 " LDRCC R2, [R0], #4 \n"
171 " STRCC R2, [R1], #4 \n"
172 " BCC loc_FF810380 \n"
173 " MOV R0, #0xD2 \n"
174 " MSR CPSR_cxsf, R0 \n"
175 " MOV SP, #0x1000 \n"
176 " MOV R0, #0xD3 \n"
177 " MSR CPSR_cxsf, R0 \n"
178 " MOV SP, #0x1000 \n"
179 " LDR R0, =0x6C4 \n"
180 " LDR R2, =0xEEEEEEEE \n"
181 " MOV R3, #0x1000 \n"
182 "loc_FF8103B4:\n"
183 " CMP R0, R3 \n"
184 " STRCC R2, [R0], #4 \n"
185 " BCC loc_FF8103B4 \n"
186
187 " BL sub_FF8111B0_my \n"
188 );
189 }
190
191
192 void __attribute__((naked,noinline)) sub_FF8111B0_my() {
193
194 asm volatile (
195 " STR LR, [SP, #-4]! \n"
196 " SUB SP, SP, #0x74 \n"
197 " MOV R1, #0x74 \n"
198 " MOV R0, SP \n"
199 " BL sub_FFB8BA64 \n"
200 " MOV R0, #0x57000 \n"
201 " STR R0, [SP, #4] \n"
202
203 #if defined(CHDK_NOT_IN_CANON_HEAP)
204 "LDR R0, =0x175CE0\n"
205 #else
206 "LDR R0, =new_sa\n"
207 "LDR R0, [R0]\n"
208 #endif
209
210
211 " LDR R2, =0x2EDAD0 \n"
212 " STR R0, [SP, #8] \n"
213 " SUB R0, R2, R0 \n"
214 " STR R0, [SP, #0xC] \n"
215 " MOV R0, #0x22 \n"
216 " STR R0, [SP, #0x18] \n"
217 " MOV R0, #0x68 \n"
218 " STR R0, [SP, #0x1C] \n"
219 " LDR R1, =0x2F5C00 \n"
220 " LDR R0, =0x1CD \n"
221 " STR R1, [SP] \n"
222 " STR R0, [SP, #0x20] \n"
223 " MOV R0, #0x96 \n"
224 " STR R2, [SP, #0x10] \n"
225 " STR R1, [SP, #0x14] \n"
226 " STR R0, [SP, #0x24] \n"
227 " STR R0, [SP, #0x28] \n"
228 " MOV R0, #0x64 \n"
229 " STR R0, [SP, #0x2C] \n"
230 " MOV R0, #0 \n"
231 " STR R0, [SP, #0x30] \n"
232 " STR R0, [SP, #0x34] \n"
233 " MOV R0, #0x10 \n"
234 " STR R0, [SP, #0x5C] \n"
235 " MOV R0, #0x800 \n"
236 " STR R0, [SP, #0x60] \n"
237 " MOV R0, #0xA0 \n"
238 " STR R0, [SP, #0x64] \n"
239 " MOV R0, #0x280 \n"
240 " STR R0, [SP, #0x68] \n"
241
242 " LDR R1, =sub_FF815F2C_my \n"
243
244 " B sub_FF81124C \n "
245
246 );
247
248 }
249
250
251 void __attribute__((naked,noinline)) sub_FF815F2C_my() {
252 asm volatile (
253
254 " STMFD SP!, {R4,LR} \n"
255 " BL sub_FF810B28 \n"
256 " BL sub_FF81A384 \n"
257 " CMP R0, #0 \n"
258 " LDRLT R0, =0xFF816040 \n"
259 " BLLT sub_FF816020 \n"
260 " BL sub_FF815B64 \n"
261 " CMP R0, #0 \n"
262 " LDRLT R0, =0xFF816048 \n"
263 " BLLT sub_FF816020 \n"
264 " LDR R0, =0xFF816058 \n"
265 " BL sub_FF815C4C \n"
266 " CMP R0, #0 \n"
267 " LDRLT R0, =0xFF816060 \n"
268 " BLLT sub_FF816020 \n"
269 " LDR R0, =0xFF816058 \n"
270 " BL sub_FF813CA8 \n"
271 " CMP R0, #0 \n"
272 " LDRLT R0, =0xFF816074 \n"
273 " BLLT sub_FF816020 \n"
274 " BL sub_FF819CEC \n"
275 " CMP R0, #0 \n"
276 " LDRLT R0, =0xFF816080 \n"
277 " BLLT sub_FF816020 \n"
278 " BL sub_FF811690 \n"
279 " CMP R0, #0 \n"
280 " LDRLT R0, =0xFF81608C \n"
281 " BLLT sub_FF816020 \n"
282 " LDMFD SP!, {R4,LR} \n"
283
284 " B sub_FF81FD8C_my\n"
285
286 );
287 }
288
289 void __attribute__((naked,noinline)) sub_FF81FD8C_my( ) {
290 asm volatile (
291 " STMFD SP!, {R4,LR} \n"
292
293
294 " BL taskcreate_Startup_my \n"
295 " MOV R0, #0 \n"
296 " LDMFD SP!, {R4,PC} \n"
297 );
298 }
299
300
301 void __attribute__((naked,noinline)) taskcreate_Startup_my() {
302
303 asm volatile (
304 " STMFD SP!, {R3-R9,LR} \n"
305 " MOV R6, #0 \n"
306 " BL sub_FF83C678 \n"
307 " LDR R9, =0xC0220000 \n"
308 " MOVS R7, R0 \n"
309 " MOV R8, #1 \n"
310 " BNE loc_FF81FE04 \n"
311 " BL sub_FF835C90 \n"
312 " CMP R0, #0 \n"
313 " BEQ loc_FF81FE04 \n"
314 " LDR R0, [R9, #0x118] \n"
315 " BIC R5, R8, R0 \n"
316 " LDR R0, [R9, #0x114] \n"
317 " BIC R4, R8, R0 \n"
318 " BL sub_FF83354C \n"
319 " CMP R0, #1 \n"
320 " MOVEQ R6, #1 \n"
321 " ORR R0, R4, R5 \n"
322 " ORRS R0, R0, R6 \n"
323 " BNE loc_FF81FE14 \n"
324 " BL sub_FF8338B4 \n"
325 " MOV R0, #0x44 \n"
326 " STR R0, [R9, #0x1C] \n"
327 " BL sub_FF833AA4 \n"
328 "loc_FF81FE00:\n"
329 " B loc_FF81FE00 \n"
330 "loc_FF81FE04:\n"
331 " LDR R0, [R9, #0x114] \n"
332 " BIC R4, R8, R0 \n"
333 " LDR R0, [R9, #0x118] \n"
334 " BIC R5, R8, R0 \n"
335 "loc_FF81FE14:\n"
336 " MOV R3, R6 \n"
337 " MOV R2, R7 \n"
338 " MOV R1, R5 \n"
339 " MOV R0, R4 \n"
340
341 " BL sub_FF8342C0 \n"
342 " BL sub_FF83A844 \n"
343 " LDR R1, =0x34E000 \n"
344 " MOV R0, #0 \n"
345 " BL sub_FF83ACB4 \n"
346 " BL sub_FF83AA5C \n"
347 " MOV R3, #0 \n"
348 " STR R3, [SP] \n"
349
350
351 " LDR R3, =task_Startup_my \n"
352
353 " B sub_FF81FE4C \n"
354
355 );
356 }
357
358
359 void __attribute__((naked,noinline)) task_Startup_my() {
360
361 asm volatile (
362 " STMFD SP!, {R4,LR} \n"
363 " BL sub_FF8165DC \n"
364 " BL sub_FF8353D4 \n"
365 " BL sub_FF83355C \n"
366
367 " BL sub_FF83C8AC \n"
368
369 " BL sub_FF83CA48 \n"
370 " BL sub_FF832364 \n"
371 " BL sub_FF83C8DC \n"
372 " BL sub_FF839FE8 \n"
373 " BL sub_FF83CA4C \n"
374
375
376
377 " BL CreateTask_PhySw \n"
378 " BL CreateTask_spytask \n"
379
380 " B sub_FF81FD5C \n"
381 );
382
383 }
384
385
386
387
388
389 void spytask(long ua, long ub, long uc, long ud, long ue, long uf)
390 {
391 (void)ua; (void)ub; (void)uc; (void)ud; (void)ue; (void)uf;
392 core_spytask();
393 }
394
395
396
397
398
399 void CreateTask_spytask() {
400
401 _CreateTask("SpyTask", 0x19, 0x2000, spytask, 0);
402 }
403
404
405 void __attribute__((naked,noinline)) CreateTask_PhySw() {
406
407 asm volatile (
408 " STMFD SP!, {R3-R5,LR} \n"
409 " LDR R4, =0x1C30 \n"
410 " LDR R0, [R4, #4] \n"
411 " CMP R0, #0 \n"
412 " BNE sub_FF834190 \n"
413 " MOV R3, #0 \n"
414 " STR R3, [SP] \n"
415
416
417
418 " LDR R3, =mykbd_task \n"
419 " MOV R2, #0x2000 \n"
420
421 " B sub_FF834180 \n"
422 );
423
424 }
425
426
427
428
429
430
431 void __attribute__((naked,noinline)) init_file_modules_task() {
432
433 asm volatile (
434 " STMFD SP!, {R4-R6,LR} \n"
435 " BL sub_FF89569C \n"
436 " LDR R5, =0x5006 \n"
437 " MOVS R4, R0 \n"
438 " MOVNE R1, #0 \n"
439 " MOVNE R0, R5 \n"
440 " BLNE sub_FF899828 \n"
441 " BL sub_FF8956C8 \n"
442
443 " BL core_spytask_can_start \n"
444
445 " B sub_FF89F658 \n"
446 );
447 }
448
449
450
451
452
453 void __attribute__((naked,noinline)) JogDial_task_my()
454 {
455 asm volatile (
456 " STMFD SP!, {R4-R11,LR} \n"
457 " SUB SP, SP, #0x1C \n"
458 " BL sub_FF8657B4 \n"
459 " LDR R12, =0x25AC \n"
460 " LDR R6, =0xFFB90EA0 \n"
461 " MOV R0, #0 \n"
462 " ADD R10, SP, #8 \n"
463 " ADD R9, SP, #0xC \n"
464 "loc_FF865440:\n"
465 " ADD R2, SP, #0x14 \n"
466 " MOV R1, #0 \n"
467 " ADD R4, R2, R0, LSL #1 \n"
468 " ADD R3, SP, #0x10 \n"
469 " STRH R1, [R4] \n"
470 " ADD R4, R3, R0, LSL #1 \n"
471 " STRH R1, [R4] \n"
472 " STR R1, [R9, R0, LSL #2] \n"
473 " STR R1, [R10, R0, LSL #2] \n"
474 " ADD R0, R0, #1 \n"
475 " CMP R0, #1 \n"
476 " BLT loc_FF865440 \n"
477 "loc_FF865470:\n"
478 " LDR R0, =0x25AC \n"
479 " MOV R2, #0 \n"
480 " LDR R0, [R0, #8] \n"
481 " MOV R1, SP \n"
482 " BL sub_FF83A27C \n"
483 " CMP R0, #0 \n"
484 " LDRNE R1, =0x236 \n"
485 " LDRNE R0, =0xFF8656D0 \n"
486 " BLNE sub_FF81EDBC \n"
487 " LDR R0, [SP] \n"
488 " AND R4, R0, #0xFF \n"
489 " AND R0, R0, #0xFF00 \n"
490 " CMP R0, #0x100 \n"
491 " BEQ loc_FF8654E0 \n"
492 " CMP R0, #0x200 \n"
493 " BEQ loc_FF865518 \n"
494 " CMP R0, #0x300 \n"
495 " BEQ loc_FF865718 \n"
496 " CMP R0, #0x400 \n"
497 " BNE loc_FF865470 \n"
498 " CMP R4, #0 \n"
499 " LDRNE R1, =0x2C1 \n"
500 " LDRNE R0, =0xFF8656D0 \n"
501 " BLNE sub_FF81EDBC \n"
502 " RSB R0, R4, R4, LSL #3 \n"
503 " LDR R0, [R6, R0, LSL #2] \n"
504 "loc_FF8654D8:\n"
505 " BL sub_FF865798 \n"
506 " B loc_FF865470 \n"
507 "loc_FF8654E0:\n"
508
509 "labelA: \n"
510 "LDR R0, =jogdial_stopped\n"
511 "LDR R0, [R0]\n"
512 "CMP R0, #1\n"
513 "BNE labelB\n"
514 "MOV R0, #40\n"
515 "BL _SleepTask\n"
516 "B labelA\n"
517 "labelB: \n"
518
519
520
521 " LDR R0, =0x25B8 \n"
522 " LDR R0, [R0, R4, LSL #2] \n"
523 " BL sub_FF83B228 \n"
524 " LDR R2, =0xFF86536C \n"
525 " ORR R3, R4, #0x200 \n"
526 " ADD R1, R2, #0 \n"
527 " MOV R0, #0x28 \n"
528 " BL sub_FF83B144 \n"
529 " TST R0, #1 \n"
530 " CMPNE R0, #0x15 \n"
531 " STR R0, [R10, R4, LSL #2] \n"
532 " BEQ loc_FF865470 \n"
533 " MOV R1, #0x248 \n"
534 " B loc_FF8656BC \n"
535 "loc_FF865518:\n"
536 " RSB R5, R4, R4, LSL #3 \n"
537 " LDR R0, [R6, R5, LSL #2] \n"
538 " LDR R1, =0xC0240000 \n"
539 " ADD R0, R1, R0, LSL #8 \n"
540 " LDR R0, [R0, #0x104] \n"
541 " MOV R1, R0, ASR #0x10 \n"
542 " ADD R0, SP, #0x14 \n"
543 " ADD R11, R0, R4, LSL #1 \n"
544 " ADD R0, SP, #0x10 \n"
545 " ADD R0, R0, R4, LSL #1 \n"
546 " STRH R1, [R11] \n"
547 " STR R0, [SP, #0x18] \n"
548 " LDRSH R3, [R0] \n"
549 " SUB R2, R1, R3 \n"
550 " CMP R2, #0 \n"
551 " BNE loc_FF86559C \n"
552 " LDR R0, [R9, R4, LSL #2] \n"
553 " CMP R0, #0 \n"
554 " BEQ loc_FF865678 \n"
555 " LDR R7, =0x25B8 \n"
556 " LDR R0, [R7, R4, LSL #2] \n"
557 " BL sub_FF83B228 \n"
558 " LDR R2, =0xFF865378 \n"
559 " ORR R3, R4, #0x300 \n"
560 " ADD R1, R2, #0 \n"
561 " MOV R0, #0x1F4 \n"
562 " BL sub_FF83B144 \n"
563 " TST R0, #1 \n"
564 " CMPNE R0, #0x15 \n"
565 " STR R0, [R7, R4, LSL #2] \n"
566 " BEQ loc_FF865678 \n"
567 " LDR R1, =0x261 \n"
568 " B loc_FF865670 \n"
569 "loc_FF86559C:\n"
570 " MOV R0, R2 \n"
571 " RSBLT R0, R0, #0 \n"
572 " MOVLE R7, #0 \n"
573 " MOVGT R7, #1 \n"
574 " CMP R0, #0xFF \n"
575 " BLS loc_FF8655D8 \n"
576 " LDR R0, =0x7FFF \n"
577 " CMP R2, #0 \n"
578 " SUBLE R0, R0, R3 \n"
579 " ADDLE R0, R0, R1 \n"
580 " SUBGT R0, R0, R1 \n"
581 " ADDGT R0, R0, R3 \n"
582 " MVN R1, #0x8000 \n"
583 " SUB R0, R0, R1 \n"
584 " EOR R7, R7, #1 \n"
585 "loc_FF8655D8:\n"
586 " STR R0, [SP, #4] \n"
587 " LDR R0, [R9, R4, LSL #2] \n"
588 " CMP R0, #0 \n"
589 " ADDEQ R0, R6, R5, LSL #2 \n"
590 " LDREQ R0, [R0, #8] \n"
591 " BEQ loc_FF865610 \n"
592 " ADD R8, R6, R5, LSL #2 \n"
593 " ADD R1, R8, R7, LSL #2 \n"
594 " LDR R1, [R1, #0x10] \n"
595 " CMP R1, R0 \n"
596 " BEQ loc_FF865614 \n"
597 " LDR R0, [R8, #0xC] \n"
598 " BL sub_FF8341B4 \n"
599 " LDR R0, [R8, #8] \n"
600 "loc_FF865610:\n"
601 " BL sub_FF8341B4 \n"
602 "loc_FF865614:\n"
603 " ADD R0, R6, R5, LSL #2 \n"
604 " ADD R7, R0, R7, LSL #2 \n"
605 " LDR R0, [R7, #0x10] \n"
606 " LDR R1, [SP, #4] \n"
607 " BL sub_FF8341C4 \n"
608 " LDR R0, [R7, #0x10] \n"
609 " LDR R7, =0x25B8 \n"
610 " STR R0, [R9, R4, LSL #2] \n"
611 " LDRH R1, [R11] \n"
612 " LDR R0, [SP, #0x18] \n"
613 " STRH R1, [R0] \n"
614 " LDR R0, [R7, R4, LSL #2] \n"
615 " BL sub_FF83B228 \n"
616 " LDR R2, =0xFF865378 \n"
617 " ORR R3, R4, #0x300 \n"
618 " ADD R1, R2, #0 \n"
619 " MOV R0, #0x1F4 \n"
620 " BL sub_FF83B144 \n"
621 " TST R0, #1 \n"
622 " CMPNE R0, #0x15 \n"
623 " STR R0, [R7, R4, LSL #2] \n"
624 " BEQ loc_FF865678 \n"
625 " LDR R1, =0x2A3 \n"
626 "loc_FF865670:\n"
627 " LDR R0, =0xFF8656D0 \n"
628 " BL sub_FF81EDBC \n"
629 "loc_FF865678:\n"
630 " ADD R0, R6, R5, LSL #2 \n"
631 " LDR R0, [R0, #0x18] \n"
632 " CMP R0, #1 \n"
633 " BNE loc_FF865710 \n"
634 " LDR R0, =0x25AC \n"
635 " LDR R0, [R0, #0x10] \n"
636 " CMP R0, #0 \n"
637 " BEQ loc_FF865710 \n"
638 " LDR R2, =0xFF86536C \n"
639 " ORR R3, R4, #0x400 \n"
640 " ADD R1, R2, #0 \n"
641 " BL sub_FF83B144 \n"
642 " TST R0, #1 \n"
643 " CMPNE R0, #0x15 \n"
644 " STR R0, [R10, R4, LSL #2] \n"
645 " BEQ loc_FF865470 \n"
646 " LDR R1, =0x2AA \n"
647 "loc_FF8656BC:\n"
648 " LDR R0, =0xFF8656D0 \n"
649 " BL sub_FF81EDBC \n"
650 " B loc_FF865470 \n"
651 "loc_FF865710:\n"
652 " LDR R0, [R6, R5, LSL #2] \n"
653 " B loc_FF8654D8 \n"
654 "loc_FF865718:\n"
655 " LDR R0, [R9, R4, LSL #2] \n"
656 " CMP R0, #0 \n"
657 " MOVEQ R1, #0x2B4 \n"
658 " LDREQ R0, =0xFF8656D0 \n"
659 " BLEQ sub_FF81EDBC \n"
660 " RSB R0, R4, R4, LSL #3 \n"
661 " ADD R0, R6, R0, LSL #2 \n"
662 " LDR R0, [R0, #0xC] \n"
663 " BL sub_FF8341B4 \n"
664 " MOV R0, #0 \n"
665 " STR R0, [R9, R4, LSL #2] \n"
666 " B loc_FF865470 \n"
667 );
668 }