-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathCALCLARA.MIP
2368 lines (2239 loc) · 44.3 KB
/
CALCLARA.MIP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
opt at-,w-,c+,m-
SECTION ASM
INCLUDE SPEC_PSX/GLOBAL.INC
XDEF GetBestFrame, GetLaraJointPos, GetFrames, S_SetupClutAdder, GetBoundsAccurate, snaff_current_gte_matrix_V1, DEL_CalcLaraMatrices_Normal_ASM, DEL_CalcLaraMatrices_Interpolated_ASM
XREF GetFloor, room, anims, LaraNodeUnderwater, LaraNodeAmbient, interpolated_bounds, lara_item, rcossin_tbl, GLaraShadowframe, lara_joint_matrices, lara_matrices, ScaleCurrentMatrix, Matrix, lara, items, MatrixStack
.firearms_jumptable:
dw loc_8469C
dw loc_847A4
dw loc_84870
dw loc_847A4
dw loc_849E4
dw loc_849E4
dw loc_849E4
dw loc_8469C
dw loc_8469C
jpt_83E58 dw loc_83E60
case1 dw loc_83F5C
case2 dw loc_840B0
case3 dw loc_83F5C
case4 dw loc_84204
case5 dw loc_84204
case6 dw loc_84204
case7 dw loc_83E60
case8 dw loc_83E60
InterpolateArmMatrix:
lw v1, 0xBC(t8)
lw t7, 0xB8(t8)
cfc2 t0, r13
cfc2 t2, r14
cfc2 t4, r15
cfc2 t1, r5
cfc2 t3, r6
cfc2 t5, r7
li v0, 2
beq v1, v0, loc_857A4
addu at, t0, t1
bne t7, v0, loc_857BC
li v0, 1
li v0, 4
bne v1, v0, loc_857BC
li v0, 1
loc_857A4:
sra t0, at, 1
addu t2, t3
sra t2, 1
addu t4, t5
j loc_85808
sra t4, 1
loc_857BC:
bne t7, v0, loc_857E8
subu at, t0, t1
sra t0, at, 2
addu t0, t1, t0
subu t2, t3
sra t2, 2
addu t2, t3, t2
subu t4, t5
sra t4, 2
j loc_85808
addu t4, t5, t4
loc_857E8:
sra t1, at, 2
subu t0, t1
subu t3, t2, t3
sra t3, 2
subu t2, t3
subu t5, t4, t5
sra t5, 2
subu t4, t5
loc_85808:
ctc2 t0, r5
ctc2 t2, r6
ctc2 t4, r7
setup_rotation_matrix:
lw t0, 0(a0)
lw t1, 4(a0)
lw t2, 8(a0)
lw t3, 0xC(a0)
j SetRotation
lw t4, 0x10(a0)
copy_matrix_from_scratch:
lw t0, 0(a0)
lw t1, 4(a0)
lw t2, 8(a0)
lw t3, 0xC(a0)
sw t0, 0(a1)
sw t1, 4(a1)
sw t2, 8(a1)
sw t3, 0xC(a1)
lw t4, 0x10(a0)
lw t5, 0x14(a0)
lw t6, 0x18(a0)
lw t7, 0x1C(a0)
sw t4, 0x10(a1)
sw t5, 0x14(a1)
sw t6, 0x18(a1)
jr ra
sw t7, 0x1C(a1)
mTranslateAbsXYZ:
;lw t0, MatrixStack+0x14-GP_ADDR(gp)
;lw t1, MatrixStack+0x18-GP_ADDR(gp)
;lw t2, MatrixStack+0x1C-GP_ADDR(gp)
la t2, MatrixStack
lw t0, 0x14(t2)
lw t1, 0x18(t2)
lw t2, 0x1C(t2)
ctc2 zero, r5
ctc2 zero, r6
ctc2 zero, r7
sub a0, t0
sub a1, t1
j mTranslateXYZ
sub a2, t2
Hardcore_mTranslateXYZ:
lw a0, 0(a2)
lw a1, 4(a2)
lw a2, 8(a2)
mTranslateXYZ:
bgez a1, loc_84B5C
sra t4, a1, 15
negu a1, a1
sra t4, a1, 15
andi a1, 0x7FFF
negu t4, t4
j loc_84B60
negu a1, a1
loc_84B5C:
andi a1, 0x7FFF
loc_84B60:
bgez a2, loc_84B80
sra t5, a2, 15
negu a2, a2
sra t5, a2, 15
andi a2, 0x7FFF
negu t5, t5
j loc_84B84
negu a2, a2
loc_84B80:
andi a2, 0x7FFF
loc_84B84:
bgez a0, loc_84BA4
sra t3, a0, 15
negu a0, a0
sra t3, a0, 15
andi a0, 0x7FFF
negu t3, t3
j loc_84BA8
negu a0, a0
loc_84BA4:
andi a0, 0x7FFF
loc_84BA8:
mtc2 t3, r9
mtc2 t4, r10
mtc2 t5, r11
nop
nop
cop2 0x41E012
mfc2 t3, r25
mfc2 t4, r26
mtc2 a0, r9
mtc2 a1, r10
mtc2 a2, r11
mfc2 t5, r27
nop
nop
cop2 0x498012
bgez t3, loc_84BEC
sll t0, t3, 3
negu t3, t3
sll t3, 3
negu t0, t3
loc_84BEC:
bgez t4, loc_84C00
sll t1, t4, 3
negu t4, t4
sll t4, 3
negu t1, t4
loc_84C00:
bgez t5, loc_84C14
sll t2, t5, 3
negu t5, t5
sll t5, 3
negu t2, t5
loc_84C14:
mfc2 t3, r25
mfc2 t4, r26
mfc2 t5, r27
addu t0, t3
addu t1, t4
addu t2, t5
ctc2 t0, r5
ctc2 t1, r6
ctc2 t2, r7
jr ra
nop
mRotSuperPackedYXZ:
lw a2, 0x24(t8)
beqz a1, loc_84C6C
loc_84C48:
lhu v0, 0(a2)
addi a1, -1
andi at, v0, 0xC000
bnez at, loc_84C60
addi a2, 2
addi a2, 2
loc_84C60:
bnez a1, loc_84C48
nop
lhu v0, 0(a2)
loc_84C6C:
addi a2, 2
srl at, v0, 14
beqz at, loc_84CAC
addi at, -1
sw a2, 0x24(t8)
beqz at, loc_84CA0
addi at, -1
beqz at, loc_84C98
andi a0, v0, 0xFFF
j mRotZ
sll a0, 4
loc_84C98:
j mRotY
sll a0, 4
loc_84CA0:
andi a0, v0, 0xFFF
j mRotX
sll a0, 4
loc_84CAC:
lhu at, 0(a2)
addi a2, 2
sw a2, 0x24(t8)
sll v0, 16
or v0, at
move v1, ra
sra a0, v0, 4
jal mRotY
andi a0, 0xFFC0
sra a0, v0, 14
jal mRotX
andi a0, 0xFFC0
andi a0, v0, 0x3FF
sll a0, 6
j mRotZ
move ra, v1
;mRotPackedYXZ: Not used?
mRotX:
srl a0, 2
andi a0, 0x3FFC
bnez a0, loc_84D04
add t0, s2, a0
jr ra
nop
loc_84D04:
lw t5, 0(t0)
lui t7, 0xFFFF
and t6, t7, t5
mtc2 t6, r0
mtc2 t5, r1
cfc2 t0, r0
cfc2 t1, r1
cfc2 t3, r3
cop2 0x486012
srl t6, t5, 16
sll t5, 16
neg t5, t5
mtc2 t5, r2
mtc2 t6, r3
andi t0, 0xFFFF
and t1, t7
andi t3, 0xFFFF
mfc2 t4, r25
mfc2 t2, r26
mfc2 t5, r27
cop2 0x48E012
sll t4, 16
or t0, t4
andi t2, 0xFFFF
sll t5, 16
or t3, t5
mfc2 t5, r25
mfc2 t6, r26
mfc2 t4, r27
andi t5, 0xFFFF
or t1, t5
sll t6, 16
j SetRotation
or t2, t6
mRotY:
srl a0, 2
andi a0, 0x3FFC
bnez a0, loc_84DA4
add t0, s2, a0
jr ra
nop
loc_84DA4:
lw t5, 0(t0)
lui t7, 0xFFFF
srl t6, t5, 16
andi t5, 0xFFFF
neg t2, t5
mtc2 t6, r0
mtc2 t2, r1
cfc2 t0, r0
cfc2 t2, r2
cfc2 t3, r3
cop2 0x486012
mtc2 t5, r2
mtc2 t6, r3
and t0, t7
andi t2, 0xFFFF
and t3, t7
mfc2 t4, r25
mfc2 t1, r26
mfc2 t5, r27
cop2 0x48E012
andi t4, 0xFFFF
or t0, t4
sll t1, 16
andi t5, 0xFFFF
or t3, t5
mfc2 t5, r25
mfc2 t6, r26
mfc2 t4, r27
andi t5, 0xFFFF
or t1, t5
sll t6, 16
j SetRotation
or t2, t6
mRotYXZ:
move v0, ra
jal mRotY
nop
jal mRotX
move a0, a1
move a0, a2
move ra, v0
mRotZ:
srl a0, 2
andi a0, 0x3FFC
bnez a0, loc_84E5C
add t0, s2, a0
jr ra
nop
loc_84E5C:
lw t0, 0(t0)
lui t7, 0xFFFF
srl t1, t0, 16
sll t2, t0, 16
or t1, t2
mtc2 t1, r0
mtc2 zero, r1
cfc2 t1, r1
cfc2 t2, r2
cfc2 t4, r4
cop2 0x486012
and t3, t0, t7
andi t0, 0xFFFF
neg t0, t0
andi t0, 0xFFFF
or t0, t3
mtc2 t0, r2
mtc2 zero, r3
andi t1, 0xFFFF
mfc2 t0, r25
mfc2 t5, r26
mfc2 t3, r27
cop2 0x48E012
and t2, t7
andi t0, 0xFFFF
sll t5, 16
or t1, t5
andi t3, 0xFFFF
mfc2 t5, r25
mfc2 t6, r26
mfc2 a0, r27
sll t5, 16
or t0, t5
andi t6, 0xFFFF
or t2, t6
sll a0, 16
j SetRotation
or t3, a0
DEL_stash_both_matrices:
cfc2 t0, r8
cfc2 t1, r9
cfc2 t2, r10
cfc2 t3, r11
sw t0, 0xE0(t8)
sw t1, 0xE4(t8)
sw t2, 0xE8(t8)
sw t3, 0xEC(t8)
cfc2 t4, r12
cfc2 t5, r13
cfc2 t6, r14
cfc2 t7, r15
sw t4, 0xF0(t8)
sw t5, 0xF4(t8)
sw t6, 0xF8(t8)
sw t7, 0xFC(t8)
snaff_current_gte_matrix_V1:
cfc2 t0, r0
cfc2 t1, r1
cfc2 t2, r2
cfc2 t3, r3
sw t0, 0(a0)
sw t1, 4(a0)
sw t2, 8(a0)
sw t3, 0xC(a0)
cfc2 t4, r4
cfc2 t5, r5
cfc2 t6, r6
cfc2 t7, r7
sw t4, 0x10(a0)
sw t5, 0x14(a0)
sw t6, 0x18(a0)
jr ra
sw t7, 0x1C(a0)
DEL_restore_both_matrices:
lw t0, 0xE0(t8)
lw t1, 0xE4(t8)
lw t2, 0xE8(t8)
lw t3, 0xEC(t8)
ctc2 t0, r8
ctc2 t1, r9
ctc2 t2, r10
ctc2 t3, r11
lw t4, 0xF0(t8)
lw t5, 0xF4(t8)
lw t6, 0xF8(t8)
lw t7, 0xFC(t8)
ctc2 t4, r12
ctc2 t5, r13
ctc2 t6, r14
ctc2 t7, r15
mLoadMatrix:
lw t5, 0x14(a0)
lw t6, 0x18(a0)
lw t7, 0x1C(a0)
lw t0, 0(a0)
lw t1, 4(a0)
lw t2, 8(a0)
lw t3, 0xC(a0)
lw t4, 0x10(a0)
ctc2 t5, r5
ctc2 t6, r6
ctc2 t7, r7
SetRotation:
ctc2 t0, r0
ctc2 t1, r1
ctc2 t2, r2
ctc2 t3, r3
ctc2 t4, r4
jr ra
nop
iRotX:
srl a0, 2
andi a0, 0x3FFC
bnez a0, loc_85018
add t0, s2, a0
jr ra
nop
loc_85018:
lw t5, 0(t0)
lui t7, 0xFFFF
and t6, t7, t5
mtc2 t6, r0
mtc2 t5, r1
cfc2 t0, r8
cfc2 t1, r9
cfc2 t3, r11
cop2 0x4A6012
srl t6, t5, 16
sll t5, 16
neg t5, t5
mtc2 t5, r2
mtc2 t6, r3
andi t0, 0xFFFF
and t1, t7
andi t3, 0xFFFF
mfc2 t4, r25
mfc2 t2, r26
mfc2 t5, r27
cop2 0x4AE012
sll t4, 16
or t0, t4
andi t2, 0xFFFF
sll t5, 16
or t3, t5
mfc2 t5, r25
mfc2 t6, r26
mfc2 t4, r27
andi t5, 0xFFFF
or t1, t5
sll t6, 16
j SetRotation_I
or t2, t6
iRotY:
srl a0, 2
andi a0, 0x3FFC
bnez a0, loc_850B8
add t0, s2, a0
jr ra
nop
loc_850B8:
lw t5, 0(t0)
lui t7, 0xFFFF
srl t6, t5, 16
andi t5, 0xFFFF
neg t2, t5
mtc2 t6, r0
mtc2 t2, r1
cfc2 t0, r8
cfc2 t2, r10
cfc2 t3, r11
cop2 0x4A6012
mtc2 t5, r2
mtc2 t6, r3
and t0, t7
andi t2, 0xFFFF
and t3, t7
mfc2 t4, r25
mfc2 t1, r26
mfc2 t5, r27
cop2 0x4AE012
andi t4, 0xFFFF
or t0, t4
sll t1, 16
andi t5, 0xFFFF
or t3, t5
mfc2 t5, r25
mfc2 t6, r26
mfc2 t4, r27
andi t5, 0xFFFF
or t1, t5
sll t6, 16
j SetRotation_I
or t2, t6
iRotYXZ:
move v0, ra
jal iRotY
nop
jal iRotX
move a0, a1
move ra, v0
move a0, a2
iRotZ:
srl a0, 2
andi a0, 0x3FFC
bnez a0, loc_85170
add t0, s2, a0
jr ra
nop
loc_85170:
lw t0, 0(t0)
lui t7, 0xFFFF
srl t1, t0, 16
sll t2, t0, 16
or t1, t2
mtc2 t1, r0
mtc2 zero, r1
cfc2 t1, r9
cfc2 t2, r10
cfc2 t4, r12
cop2 0x4A6012
and t3, t0, t7
andi t0, 0xFFFF
neg t0, t0
andi t0, 0xFFFF
or t0, t3
mtc2 t0, r2
mtc2 zero, r3
andi t1, 0xFFFF
mfc2 t0, r25
mfc2 t5, r26
mfc2 t3, r27
cop2 0x4AE012
and t2, t7
andi t0, 0xFFFF
sll t5, 16
or t1, t5
andi t3, 0xFFFF
mfc2 t5, r25
mfc2 t6, r26
mfc2 t7, r27
sll t5, 16
or t0, t5
andi t6, 0xFFFF
or t2, t6
sll t7, 16
or t3, t7
loc_85204:
ctc2 t0, r8
ctc2 t1, r9
ctc2 t2, r10
ctc2 t3, r11
ctc2 t4, r12
jr ra
nop
SetRotation_I:
ctc2 t0, r8
ctc2 t1, r9
ctc2 t2, r10
ctc2 t3, r11
ctc2 t4, r12
jr ra
nop
iRotSuperPackedYXZ:
lw a2, 0x28(t8)
beqz a1, loc_8524C
loc_85228:
lhu v0, 0(a2)
addi a1, -1
andi at, v0, 0xC000
bnez at, loc_85240
addi a2, 2
addi a2, 2
loc_85240:
bnez a1, loc_85228
nop
lhu v0, 0(a2)
loc_8524C:
addi a2, 2
srl at, v0, 14
beqz at, loc_8528C
addi at, -1
sw a2, 0x28(t8)
beqz at, loc_85280
addi at, -1
beqz at, loc_85278
andi a0, v0, 0xFFF
j iRotZ
sll a0, 4
loc_85278:
j iRotY
sll a0, 4
loc_85280:
andi a0, v0, 0xFFF
j iRotX
sll a0, 4
loc_8528C:
lhu at, 0(a2)
addi a2, 2
sw a2, 0x28(t8)
sll a2, v0, 16
or a2, at
move a1, ra
srl a0, a2, 4
jal iRotY
andi a0, 0xFFC0
srl a0, a2, 14
jal iRotX
andi a0, 0xFFC0
sll a0, a2, 6
andi a0, 0xFFC0
j iRotZ
move ra, a1
iRotPackedYXZ:;TODO cannot find ASM**********************************************************
jr ra
nop
Hardcore_iTranslateXYZ:
lw a0, 0(a2)
lw a1, 4(a2)
lw a2, 8(a2)
iTranslateXYZ:
move t6, ra
move a3, a0
sw a1, 0x180(t8)
jal mTranslateXYZ
sw a2, 0x184(t8)
move ra, t6
lw a1, 0x180(t8)
lw a2, 0x184(t8)
iTranslateXYZ2:
bgez a3, loc_85318
sra t0, a3, 15
negu a3, a3
sra t0, a3, 15
andi a3, 0x7FFF
negu t0, t0
j loc_8531C
negu a3, a3
loc_85318:
andi a3, 0x7FFF
loc_8531C:
bgez a1, loc_8533C
sra t1, a1, 15
negu a1, a1
sra t1, a1, 15
andi a1, 0x7FFF
negu t1, t1
j loc_85340
negu a1, a1
loc_8533C:
andi a1, 0x7FFF
loc_85340:
bgez a2, loc_85360
sra t2, a2, 15
negu a2, a2
sra t2, a2, 15
andi a2, 0x7FFF
negu t2, t2
j loc_85364
negu a2, a2
loc_85360:
andi a2, 0x7FFF
loc_85364:
mtc2 t0, r9
mtc2 t1, r10
mtc2 t2, r11
nop
nop
cop2 0x43E012
mfc2 t6, r25
mtc2 a3, r9
mtc2 a1, r10
mtc2 a2, r11
mfc2 t7, r26
mfc2 v0, r27
cop2 0x4BE012
bgez t6, loc_853A8
sll t3, t6, 3
negu t6, t6
sll t6, 3
negu t3, t6
loc_853A8:
bgez t7, loc_853BC
sll t4, t7, 3
negu t7, t7
sll t7, 3
negu t4, t7
loc_853BC:
bgez v0, loc_853D0
sll t5, v0, 3
negu v0, v0
sll v0, 3
negu t5, v0
loc_853D0:
mfc2 t6, r25
mfc2 t7, r26
mfc2 v0, r27
addu t3, t6
addu t4, t7
addu t5, v0
cfc2 t0, r13
cfc2 t1, r14
cfc2 t2, r15
addu t0, t3
addu t1, t4
addu t2, t5
ctc2 t0, r13
ctc2 t1, r14
ctc2 t2, r15
jr ra
nop
InterpolateMatrix:
cfc2 t0, r2
cfc2 t1, r3
cfc2 t2, r4
cfc2 t3, r10
cfc2 t4, r11
cfc2 t5, r12
sw t0, 0x168(t8)
sw t1, 0x16C(t8)
sw t2, 0x170(t8)
sw t3, 0x148(t8)
sw t4, 0x14C(t8)
sw t5, 0x150(t8)
lw v1, 0xBC(t8)
lw t7, 0xB8(t8)
li v0, 2
cfc2 t6, r0
cfc2 t3, r1
cfc2 a3, r8
cfc2 t2, r9
sra t1, t6, 16
sll t6, 16
sra t6, 16
sra t5, t3, 16
sll t3, 16
sra t3, 16
sra t0, a3, 16
sll a3, 16
sra a3, 16
sra t4, t2, 16
sll t2, 16
beq v1, v0, loc_854A8
sra t2, 16
bne t7, v0, loc_8556C
li v0, 1
li v0, 4
bne v1, v0, loc_8556C
li v0, 1
loc_854A8:
addu t0, t1
sra t0, 1
addu a3, t6
sra a3, 1
addu t2, t3
sra t2, 1
addu t4, t5
sra t4, 1
sh a3, 0(a0)
sh t0, 2(a0)
sh t2, 4(a0)
sh t4, 6(a0)
lh a3, 0x148(t8)
lh t6, 0x168(t8)
lh t0, 0x14A(t8)
lh t1, 0x16A(t8)
addu a3, t6
sra a3, 1
addu t0, t1
sra t0, 1
lh t2, 0x14C(t8)
lh t3, 0x16C(t8)
lh t4, 0x14E(t8)
lh t5, 0x16E(t8)
addu t2, t3
sra t2, 1
addu t4, t5
sra t4, 1
sh a3, 8(a0)
sh t0, 0xA(a0)
sh t2, 0xC(a0)
sh t4, 0xE(a0)
lh a3, 0x150(t8)
lh t6, 0x170(t8)
cfc2 t0, r13
cfc2 t1, r5
addu a3, t6
sra a3, 1
addu t0, t1
sra t0, 1
cfc2 t2, r14
cfc2 t3, r6
cfc2 t4, r15
cfc2 t5, r7
addu t2, t3
sra t2, 1
addu t4, t5
j loc_85750
sra t4, 1
loc_8556C:
bne t7, v0, loc_85664
subu at, t0, t1
sra t0, at, 2
addu t0, t1, t0
subu a3, t6
sra a3, 2
addu a3, t6, a3
subu t2, t3
sra t2, 2
addu t2, t3, t2
subu t4, t5
sra t4, 2
addu t4, t5, t4
sh a3, 0(a0)
sh t0, 2(a0)
sh t2, 4(a0)
sh t4, 6(a0)
lh a3, 0x148(t8)
lh t6, 0x168(t8)
lh t0, 0x14A(t8)
lh t1, 0x16A(t8)
subu a3, t6
sra a3, 2
addu a3, t6, a3
subu t0, t1
sra t0, 2
addu t0, t1, t0
lh t2, 0x14C(t8)
lh t3, 0x16C(t8)
lh t4, 0x14E(t8)
lh t5, 0x16E(t8)
subu t2, t3
sra t2, 2
addu t2, t3, t2
subu t4, t5
sra t4, 2
addu t4, t5, t4
sh a3, 8(a0)
sh t0, 0xA(a0)
sh t2, 0xC(a0)
sh t4, 0xE(a0)
lh a3, 0x150(t8)
lh t6, 0x170(t8)
cfc2 t0, r13
cfc2 t1, r5
subu a3, t6
sra a3, 2
addu a3, t6, a3
subu t0, t1
sra t0, 2
addu t0, t1, t0
cfc2 t2, r14
cfc2 t3, r6
cfc2 t4, r15
cfc2 t5, r7
subu t2, t3
sra t2, 2
addu t2, t3, t2
subu t4, t5
sra t4, 2
j loc_85750
addu t4, t5, t4
loc_85664:
sra t1, at, 2
subu t0, t1
subu t6, a3, t6
sra t6, 2
subu a3, t6
subu t3, t2, t3
sra t3, 2
subu t2, t3
subu t5, t4, t5
sra t5, 2
subu t4, t5
sh a3, 0(a0)
sh t0, 2(a0)
sh t2, 4(a0)
sh t4, 6(a0)
lh a3, 0x148(t8)
lh t6, 0x168(t8)
lh t0, 0x14A(t8)