forked from rovertronic/Mario-Builder-64
-
Notifications
You must be signed in to change notification settings - Fork 0
/
asm.txt
executable file
·3744 lines (3656 loc) · 145 KB
/
asm.txt
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
build/us/src/game/rendering_graph_node.o: file format elf32-tradbigmips
Disassembly of section .text:
00000000 <Get_Screen_Coords-0x788>:
#endif
/**
* Process a master list node.
*/
static void geo_process_master_list_sub(struct GraphNodeMasterList *node) {
0: 27bdff28 addiu sp,sp,-216
4: afbf0044 sw ra,68(sp)
8: afb30040 sw s3,64(sp)
c: afb2003c sw s2,60(sp)
10: afb10038 sw s1,56(sp)
14: afb00034 sw s0,52(sp)
18: 44800000 mtc1 zero,$f0
struct DisplayListNode *currList;
s32 i;
s32 enableZBuffer = (node->node.flags & GRAPH_RENDER_Z_BUFFER) != 0;
1c: 84900002 lh s0,2(a0)
static void geo_process_master_list_sub(struct GraphNodeMasterList *node) {
20: 3c013f80 lui at,0x3f80
24: 44811000 mtc1 at,$f2
28: 00808825 move s1,a0
// @bug This is where the LookAt values should be calculated but aren't.
// As a result, environment mapping is broken on Fast3DEX2 without the
// changes below.
#ifdef F3DEX_GBI_2
Mtx lMtx;
guLookAtReflect(&lMtx, &lookAt, 0, 0, 0, /* eye */ 0, 0, 1, /* at */ 1, 0, 0 /* up */);
2c: 3c050000 lui a1,0x0
s32 enableZBuffer = (node->node.flags & GRAPH_RENDER_Z_BUFFER) != 0;
30: 32100008 andi s0,s0,0x8
guLookAtReflect(&lMtx, &lookAt, 0, 0, 0, /* eye */ 0, 0, 1, /* at */ 1, 0, 0 /* up */);
34: 44060000 mfc1 a2,$f0
38: 44070000 mfc1 a3,$f0
s32 enableZBuffer = (node->node.flags & GRAPH_RENDER_Z_BUFFER) != 0;
3c: 0010802b sltu s0,zero,s0
guLookAtReflect(&lMtx, &lookAt, 0, 0, 0, /* eye */ 0, 0, 1, /* at */ 1, 0, 0 /* up */);
40: 24a50000 addiu a1,a1,0
44: 27a40080 addiu a0,sp,128
48: e7a00028 swc1 $f0,40(sp)
4c: e7a00024 swc1 $f0,36(sp)
50: e7a00018 swc1 $f0,24(sp)
54: e7a00014 swc1 $f0,20(sp)
58: e7a00010 swc1 $f0,16(sp)
5c: e7a2001c swc1 $f2,28(sp)
60: 0c000000 jal 0 <Get_Screen_Coords-0x788>
64: e7a20020 swc1 $f2,32(sp)
#endif
if (enableZBuffer != 0) {
68: 12000011 beqz s0,b0 <Get_Screen_Coords-0x6d8>
gDPPipeSync(gDisplayListHead++);
gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER);
}
for (i = 0; i < GFX_NUM_MASTER_LISTS; i++) {
6c: 00005025 move t2,zero
if (enableZBuffer != 0) {
70: 3c060000 lui a2,0x0
74: 24c60000 addiu a2,a2,0
gDPPipeSync(gDisplayListHead++);
78: 8cc20000 lw v0,0(a2)
7c: 3c0fe700 lui t7,0xe700
gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER);
80: 3c19d9ff lui t9,0xd9ff
gDPPipeSync(gDisplayListHead++);
84: 244e0008 addiu t6,v0,8
88: acce0000 sw t6,0(a2)
8c: ac400004 sw zero,4(v0)
90: ac4f0000 sw t7,0(v0)
gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER);
94: 8cc20000 lw v0,0(a2)
98: 240e0001 li t6,1
9c: 3739ffff ori t9,t9,0xffff
a0: 24580008 addiu t8,v0,8
a4: acd80000 sw t8,0(a2)
a8: ac4e0004 sw t6,4(v0)
ac: ac590000 sw t9,0(v0)
b0: 3c060000 lui a2,0x0
for (i = 0; i < GFX_NUM_MASTER_LISTS; i++) {
b4: 02206825 move t5,s1
b8: 3c130000 lui s3,0x0
bc: 3c1fe200 lui ra,0xe200
c0: 3c081fff lui t0,0x1fff
c4: 3c07da38 lui a3,0xda38
gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER);
c8: 24c60000 addiu a2,a2,0
for (i = 0; i < GFX_NUM_MASTER_LISTS; i++) {
cc: 34e70003 ori a3,a3,0x3
d0: 3508ffff ori t0,t0,0xffff
d4: 37ff001c ori ra,ra,0x1c
d8: 26730000 addiu s3,s3,0
dc: 24110010 li s1,16
e0: 24120020 li s2,32
e4: 3c09de00 lui t1,0xde00
if ((currList = node->listHeads[i]) != NULL) {
e8: 8da50014 lw a1,20(t5)
switch (i) {
ec: 00102140 sll a0,s0,0x5
f0: 008a7821 addu t7,a0,t2
if ((currList = node->listHeads[i]) != NULL) {
f4: 10a0002d beqz a1,1ac <Get_Screen_Coords-0x5dc>
switch (i) {
f8: 3c180000 lui t8,0x0
fc: 27180000 addiu t8,t8,0
100: 1551000e bne t2,s1,13c <Get_Screen_Coords-0x64c>
104: 01f85821 addu t3,t7,t8
case 4:
gDPSetRenderMode(gDisplayListHead++, modeList->modes[i], mode5List->modes[i]);
108: 8cc20000 lw v0,0(a2)
switch (i) {
10c: 3c0e0000 lui t6,0x0
110: 25ce0000 addiu t6,t6,0
gDPSetRenderMode(gDisplayListHead++, modeList->modes[i], mode5List->modes[i]);
114: 244f0008 addiu t7,v0,8
switch (i) {
118: 008ac821 addu t9,a0,t2
gDPSetRenderMode(gDisplayListHead++, modeList->modes[i], mode5List->modes[i]);
11c: accf0000 sw t7,0(a2)
switch (i) {
120: 032e6021 addu t4,t9,t6
gDPSetRenderMode(gDisplayListHead++, modeList->modes[i], mode5List->modes[i]);
124: ac5f0000 sw ra,0(v0)
128: 8d790000 lw t9,0(t3)
12c: 8d980000 lw t8,0(t4)
130: 03197025 or t6,t8,t9
break;
134: 1000000b b 164 <Get_Screen_Coords-0x624>
gDPSetRenderMode(gDisplayListHead++, modeList->modes[i], mode5List->modes[i]);
138: ac4e0004 sw t6,4(v0)
default:
gDPSetRenderMode(gDisplayListHead++, modeList->modes[i], mode2List->modes[i]);
13c: 8cc20000 lw v0,0(a2)
140: 0264c021 addu t8,s3,a0
144: 030ac821 addu t9,t8,t2
148: 244f0008 addiu t7,v0,8
14c: accf0000 sw t7,0(a2)
150: ac5f0000 sw ra,0(v0)
154: 8d6f0000 lw t7,0(t3)
158: 8f2e0000 lw t6,0(t9)
15c: 01cfc025 or t8,t6,t7
160: ac580004 sw t8,4(v0)
break;
}
while (currList != NULL) {
164: 50a00012 beqzl a1,1b0 <Get_Screen_Coords-0x5d8>
168: 254a0004 addiu t2,t2,4
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(currList->transform),
16c: 8cc20000 lw v0,0(a2)
170: 24590008 addiu t9,v0,8
174: acd90000 sw t9,0(a2)
178: ac470000 sw a3,0(v0)
17c: 8cae0000 lw t6,0(a1)
180: 01c87824 and t7,t6,t0
184: ac4f0004 sw t7,4(v0)
G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gSPDisplayList(gDisplayListHead++, currList->displayList);
188: 8cc20000 lw v0,0(a2)
18c: 24580008 addiu t8,v0,8
190: acd80000 sw t8,0(a2)
194: ac490000 sw t1,0(v0)
198: 8cb90004 lw t9,4(a1)
19c: ac590004 sw t9,4(v0)
currList = currList->next;
1a0: 8ca50008 lw a1,8(a1)
while (currList != NULL) {
1a4: 54a0fff2 bnezl a1,170 <Get_Screen_Coords-0x618>
1a8: 8cc20000 lw v0,0(a2)
for (i = 0; i < GFX_NUM_MASTER_LISTS; i++) {
1ac: 254a0004 addiu t2,t2,4
1b0: 1552ffcd bne t2,s2,e8 <Get_Screen_Coords-0x6a0>
1b4: 25ad0004 addiu t5,t5,4
}
}
}
if (enableZBuffer != 0) {
1b8: 5200000f beqzl s0,1f8 <Get_Screen_Coords-0x590>
1bc: 8fbf0044 lw ra,68(sp)
gDPPipeSync(gDisplayListHead++);
1c0: 8cc20000 lw v0,0(a2)
1c4: 3c0fe700 lui t7,0xe700
gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER);
1c8: 3c19d9ff lui t9,0xd9ff
gDPPipeSync(gDisplayListHead++);
1cc: 244e0008 addiu t6,v0,8
1d0: acce0000 sw t6,0(a2)
1d4: ac400004 sw zero,4(v0)
1d8: ac4f0000 sw t7,0(v0)
gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER);
1dc: 8cc20000 lw v0,0(a2)
1e0: 3739fffe ori t9,t9,0xfffe
1e4: 24580008 addiu t8,v0,8
1e8: acd80000 sw t8,0(a2)
1ec: ac400004 sw zero,4(v0)
1f0: ac590000 sw t9,0(v0)
}
}
1f4: 8fbf0044 lw ra,68(sp)
1f8: 8fb00034 lw s0,52(sp)
1fc: 8fb10038 lw s1,56(sp)
200: 8fb2003c lw s2,60(sp)
204: 8fb30040 lw s3,64(sp)
208: 03e00008 jr ra
20c: 27bd00d8 addiu sp,sp,216
/**
* Appends the display list to one of the master lists based on the layer
* parameter. Look at the RenderModeContainer struct to see the corresponding
* render modes of layers.
*/
static void geo_append_display_list(void *displayList, s16 layer) {
210: 3c070000 lui a3,0x0
214: 24e70000 addiu a3,a3,0
#ifdef F3DEX_GBI_2
gSPLookAt(gDisplayListHead++, &lookAt);
218: 8ce20000 lw v0,0(a3)
static void geo_append_display_list(void *displayList, s16 layer) {
21c: 27bdffe8 addiu sp,sp,-24
220: afbf0014 sw ra,20(sp)
gSPLookAt(gDisplayListHead++, &lookAt);
224: 244e0008 addiu t6,v0,8
static void geo_append_display_list(void *displayList, s16 layer) {
228: afa40018 sw a0,24(sp)
22c: afa5001c sw a1,28(sp)
gSPLookAt(gDisplayListHead++, &lookAt);
230: acee0000 sw t6,0(a3)
234: 3c0fdc08 lui t7,0xdc08
238: 3c180000 lui t8,0x0
23c: 27180000 addiu t8,t8,0
240: 35ef000a ori t7,t7,0xa
244: ac4f0000 sw t7,0(v0)
248: ac580004 sw t8,4(v0)
24c: 8ce20000 lw v0,0(a3)
250: 3c09dc08 lui t1,0xdc08
254: 3c0a0000 lui t2,0x0
258: 24590008 addiu t9,v0,8
25c: acf90000 sw t9,0(a3)
static void geo_append_display_list(void *displayList, s16 layer) {
260: 3c080000 lui t0,0x0
gSPLookAt(gDisplayListHead++, &lookAt);
264: 254a0010 addiu t2,t2,16
268: 3529030a ori t1,t1,0x30a
static void geo_append_display_list(void *displayList, s16 layer) {
26c: 25080000 addiu t0,t0,0
gSPLookAt(gDisplayListHead++, &lookAt);
270: ac490000 sw t1,0(v0)
274: ac4a0004 sw t2,4(v0)
#endif
if (gCurGraphNodeMasterList != 0) {
278: 8d0b0000 lw t3,0(t0)
struct DisplayListNode *listNode =
27c: 2405000c li a1,12
280: 3c040000 lui a0,0x0
if (gCurGraphNodeMasterList != 0) {
284: 5160001e beqzl t3,300 <Get_Screen_Coords-0x488>
288: 8fbf0014 lw ra,20(sp)
struct DisplayListNode *listNode =
28c: 0c000000 jal 0 <Get_Screen_Coords-0x788>
290: 8c840000 lw a0,0(a0)
alloc_only_pool_alloc(gDisplayListHeap, sizeof(struct DisplayListNode));
listNode->transform = gMatStackFixed[gMatStackIndex];
294: 3c0c0000 lui t4,0x0
298: 858c0000 lh t4,0(t4)
29c: 3c0e0000 lui t6,0x0
struct DisplayListNode *listNode =
2a0: 3c080000 lui t0,0x0
listNode->transform = gMatStackFixed[gMatStackIndex];
2a4: 000c6880 sll t5,t4,0x2
2a8: 01cd7021 addu t6,t6,t5
2ac: 8dce0000 lw t6,0(t6)
struct DisplayListNode *listNode =
2b0: 25080000 addiu t0,t0,0
listNode->transform = gMatStackFixed[gMatStackIndex];
2b4: ac4e0000 sw t6,0(v0)
listNode->displayList = displayList;
2b8: 8faf0018 lw t7,24(sp)
listNode->next = 0;
2bc: ac400008 sw zero,8(v0)
listNode->displayList = displayList;
2c0: ac4f0004 sw t7,4(v0)
if (gCurGraphNodeMasterList->listHeads[layer] == 0) {
2c4: 87a4001e lh a0,30(sp)
2c8: 8d180000 lw t8,0(t0)
2cc: 00042080 sll a0,a0,0x2
2d0: 03041821 addu v1,t8,a0
2d4: 8c790014 lw t9,20(v1)
2d8: 57200004 bnezl t9,2ec <Get_Screen_Coords-0x49c>
2dc: 8c690034 lw t1,52(v1)
gCurGraphNodeMasterList->listHeads[layer] = listNode;
2e0: 10000003 b 2f0 <Get_Screen_Coords-0x498>
2e4: ac620014 sw v0,20(v1)
} else {
gCurGraphNodeMasterList->listTails[layer]->next = listNode;
2e8: 8c690034 lw t1,52(v1)
2ec: ad220008 sw v0,8(t1)
}
gCurGraphNodeMasterList->listTails[layer] = listNode;
2f0: 8d0a0000 lw t2,0(t0)
2f4: 01445821 addu t3,t2,a0
2f8: ad620034 sw v0,52(t3)
}
}
2fc: 8fbf0014 lw ra,20(sp)
300: 27bd0018 addiu sp,sp,24
304: 03e00008 jr ra
308: 00000000 nop
/**
* Process the master list node.
*/
static void geo_process_master_list(struct GraphNodeMasterList *node) {
30c: 3c060000 lui a2,0x0
310: 24c60000 addiu a2,a2,0
s32 i;
UNUSED s32 sp1C;
if (gCurGraphNodeMasterList == NULL && node->node.children != NULL) {
314: 8cce0000 lw t6,0(a2)
static void geo_process_master_list(struct GraphNodeMasterList *node) {
318: 27bdffe8 addiu sp,sp,-24
31c: afbf0014 sw ra,20(sp)
if (gCurGraphNodeMasterList == NULL && node->node.children != NULL) {
320: 15c00016 bnez t6,37c <Get_Screen_Coords-0x40c>
static void geo_process_master_list(struct GraphNodeMasterList *node) {
324: 00802825 move a1,a0
if (gCurGraphNodeMasterList == NULL && node->node.children != NULL) {
328: 8c8f0010 lw t7,16(a0)
gCurGraphNodeMasterList = node;
for (i = 0; i < GFX_NUM_MASTER_LISTS; i++) {
32c: 00001825 move v1,zero
330: 00801025 move v0,a0
if (gCurGraphNodeMasterList == NULL && node->node.children != NULL) {
334: 51e00012 beqzl t7,380 <Get_Screen_Coords-0x408>
338: 8fbf0014 lw ra,20(sp)
gCurGraphNodeMasterList = node;
33c: acc40000 sw a0,0(a2)
for (i = 0; i < GFX_NUM_MASTER_LISTS; i++) {
340: 24040008 li a0,8
344: 24630004 addiu v1,v1,4
348: ac400018 sw zero,24(v0)
34c: ac40001c sw zero,28(v0)
350: ac400020 sw zero,32(v0)
354: 24420010 addiu v0,v0,16
358: 1464fffa bne v1,a0,344 <Get_Screen_Coords-0x444>
node->listHeads[i] = NULL;
35c: ac400004 sw zero,4(v0)
}
geo_process_node_and_siblings(node->node.children);
360: 8ca40010 lw a0,16(a1)
364: 0c000000 jal 0 <Get_Screen_Coords-0x788>
368: afa50018 sw a1,24(sp)
geo_process_master_list_sub(node);
36c: 0c000000 jal 0 <Get_Screen_Coords-0x788>
geo_process_node_and_siblings(node->node.children);
370: 8fa40018 lw a0,24(sp)
gCurGraphNodeMasterList = NULL;
374: 3c010000 lui at,0x0
378: ac200000 sw zero,0(at)
}
}
37c: 8fbf0014 lw ra,20(sp)
380: 27bd0018 addiu sp,sp,24
384: 03e00008 jr ra
388: 00000000 nop
/**
* Process an orthographic projection node.
*/
static void geo_process_ortho_projection(struct GraphNodeOrthoProjection *node) {
38c: 27bdffd0 addiu sp,sp,-48
390: afbf0024 sw ra,36(sp)
394: afa40030 sw a0,48(sp)
if (node->node.children != NULL) {
398: 8c8f0010 lw t7,16(a0)
39c: 51e0004a beqzl t7,4c8 <Get_Screen_Coords-0x2c0>
3a0: 8fbf0024 lw ra,36(sp)
Mtx *mtx = alloc_display_list(sizeof(*mtx));
3a4: 0c000000 jal 0 <Get_Screen_Coords-0x788>
3a8: 24040040 li a0,64
f32 left = (gCurGraphNodeRoot->x - gCurGraphNodeRoot->width) / 2.0f * node->scale;
3ac: 3c030000 lui v1,0x0
3b0: 8c630000 lw v1,0(v1)
Mtx *mtx = alloc_display_list(sizeof(*mtx));
3b4: afa2002c sw v0,44(sp)
3b8: 3c013f00 lui at,0x3f00
f32 left = (gCurGraphNodeRoot->x - gCurGraphNodeRoot->width) / 2.0f * node->scale;
3bc: 8469001a lh t1,26(v1)
3c0: 84680016 lh t0,22(v1)
Mtx *mtx = alloc_display_list(sizeof(*mtx));
3c4: 44811000 mtc1 at,$f2
f32 left = (gCurGraphNodeRoot->x - gCurGraphNodeRoot->width) / 2.0f * node->scale;
3c8: 8fb80030 lw t8,48(sp)
3cc: 0109c823 subu t9,t0,t1
3d0: 44992000 mtc1 t9,$f4
f32 right = (gCurGraphNodeRoot->x + gCurGraphNodeRoot->width) / 2.0f * node->scale;
3d4: 01096021 addu t4,t0,t1
3d8: 448c5000 mtc1 t4,$f10
f32 left = (gCurGraphNodeRoot->x - gCurGraphNodeRoot->width) / 2.0f * node->scale;
3dc: 468021a0 cvt.s.w $f6,$f4
3e0: c7000014 lwc1 $f0,20(t8)
f32 top = (gCurGraphNodeRoot->y - gCurGraphNodeRoot->height) / 2.0f * node->scale;
3e4: 846b001c lh t3,28(v1)
3e8: 846a0018 lh t2,24(v1)
f32 bottom = (gCurGraphNodeRoot->y + gCurGraphNodeRoot->height) / 2.0f * node->scale;
guOrtho(mtx, left, right, bottom, top, -2.0f, 2.0f, 1.0f);
3ec: 3c01c000 lui at,0xc000
f32 right = (gCurGraphNodeRoot->x + gCurGraphNodeRoot->width) / 2.0f * node->scale;
3f0: 46805120 cvt.s.w $f4,$f10
f32 left = (gCurGraphNodeRoot->x - gCurGraphNodeRoot->width) / 2.0f * node->scale;
3f4: 46023202 mul.s $f8,$f6,$f2
f32 top = (gCurGraphNodeRoot->y - gCurGraphNodeRoot->height) / 2.0f * node->scale;
3f8: 014b6823 subu t5,t2,t3
f32 bottom = (gCurGraphNodeRoot->y + gCurGraphNodeRoot->height) / 2.0f * node->scale;
3fc: 014b7021 addu t6,t2,t3
guOrtho(mtx, left, right, bottom, top, -2.0f, 2.0f, 1.0f);
400: 00402025 move a0,v0
f32 left = (gCurGraphNodeRoot->x - gCurGraphNodeRoot->width) / 2.0f * node->scale;
404: 46004302 mul.s $f12,$f8,$f0
f32 top = (gCurGraphNodeRoot->y - gCurGraphNodeRoot->height) / 2.0f * node->scale;
408: 448d4000 mtc1 t5,$f8
f32 right = (gCurGraphNodeRoot->x + gCurGraphNodeRoot->width) / 2.0f * node->scale;
40c: 46022182 mul.s $f6,$f4,$f2
guOrtho(mtx, left, right, bottom, top, -2.0f, 2.0f, 1.0f);
410: 44056000 mfc1 a1,$f12
f32 top = (gCurGraphNodeRoot->y - gCurGraphNodeRoot->height) / 2.0f * node->scale;
414: 468042a0 cvt.s.w $f10,$f8
f32 right = (gCurGraphNodeRoot->x + gCurGraphNodeRoot->width) / 2.0f * node->scale;
418: 46003382 mul.s $f14,$f6,$f0
f32 bottom = (gCurGraphNodeRoot->y + gCurGraphNodeRoot->height) / 2.0f * node->scale;
41c: 448e3000 mtc1 t6,$f6
f32 top = (gCurGraphNodeRoot->y - gCurGraphNodeRoot->height) / 2.0f * node->scale;
420: 46025102 mul.s $f4,$f10,$f2
guOrtho(mtx, left, right, bottom, top, -2.0f, 2.0f, 1.0f);
424: 44067000 mfc1 a2,$f14
f32 bottom = (gCurGraphNodeRoot->y + gCurGraphNodeRoot->height) / 2.0f * node->scale;
428: 46803220 cvt.s.w $f8,$f6
f32 top = (gCurGraphNodeRoot->y - gCurGraphNodeRoot->height) / 2.0f * node->scale;
42c: 46002402 mul.s $f16,$f4,$f0
guOrtho(mtx, left, right, bottom, top, -2.0f, 2.0f, 1.0f);
430: 44812000 mtc1 at,$f4
434: 3c014000 lui at,0x4000
438: 44813000 mtc1 at,$f6
43c: 3c013f80 lui at,0x3f80
f32 bottom = (gCurGraphNodeRoot->y + gCurGraphNodeRoot->height) / 2.0f * node->scale;
440: 46024282 mul.s $f10,$f8,$f2
guOrtho(mtx, left, right, bottom, top, -2.0f, 2.0f, 1.0f);
444: 44814000 mtc1 at,$f8
448: e7b00010 swc1 $f16,16(sp)
44c: e7a40014 swc1 $f4,20(sp)
450: e7a60018 swc1 $f6,24(sp)
454: e7a8001c swc1 $f8,28(sp)
f32 bottom = (gCurGraphNodeRoot->y + gCurGraphNodeRoot->height) / 2.0f * node->scale;
458: 46005482 mul.s $f18,$f10,$f0
guOrtho(mtx, left, right, bottom, top, -2.0f, 2.0f, 1.0f);
45c: 44079000 mfc1 a3,$f18
460: 0c000000 jal 0 <Get_Screen_Coords-0x788>
464: 00000000 nop
468: 3c060000 lui a2,0x0
46c: 24c60000 addiu a2,a2,0
gSPPerspNormalize(gDisplayListHead++, 0xFFFF);
470: 8cc20000 lw v0,0(a2)
474: 3c18db0e lui t8,0xdb0e
478: 3419ffff li t9,0xffff
47c: 244f0008 addiu t7,v0,8
480: accf0000 sw t7,0(a2)
484: ac590004 sw t9,4(v0)
488: ac580000 sw t8,0(v0)
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH);
48c: 8cc20000 lw v0,0(a2)
490: 3c0dda38 lui t5,0xda38
494: 35ad0007 ori t5,t5,0x7
498: 244c0008 addiu t4,v0,8
49c: accc0000 sw t4,0(a2)
4a0: ac4d0000 sw t5,0(v0)
4a4: 8fae002c lw t6,44(sp)
4a8: 3c011fff lui at,0x1fff
4ac: 3421ffff ori at,at,0xffff
4b0: 01c17824 and t7,t6,at
4b4: ac4f0004 sw t7,4(v0)
geo_process_node_and_siblings(node->node.children);
4b8: 8fb80030 lw t8,48(sp)
4bc: 0c000000 jal 0 <Get_Screen_Coords-0x788>
4c0: 8f040010 lw a0,16(t8)
}
}
4c4: 8fbf0024 lw ra,36(sp)
4c8: 27bd0030 addiu sp,sp,48
4cc: 03e00008 jr ra
4d0: 00000000 nop
/**
* Process a perspective projection node.
*/
static void geo_process_perspective(struct GraphNodePerspective *node) {
4d4: 27bdffb8 addiu sp,sp,-72
4d8: afbf002c sw ra,44(sp)
4dc: afb00028 sw s0,40(sp)
if (node->fnNode.func != NULL) {
4e0: 8c820014 lw v0,20(a0)
static void geo_process_perspective(struct GraphNodePerspective *node) {
4e4: 00808025 move s0,a0
node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, gMatStack[gMatStackIndex]);
4e8: 02002825 move a1,s0
if (node->fnNode.func != NULL) {
4ec: 10400008 beqz v0,510 <Get_Screen_Coords-0x278>
node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, gMatStack[gMatStackIndex]);
4f0: 24040001 li a0,1
4f4: 3c0e0000 lui t6,0x0
4f8: 85ce0000 lh t6,0(t6)
4fc: 3c180000 lui t8,0x0
500: 27180000 addiu t8,t8,0
504: 000e7980 sll t7,t6,0x6
508: 0040f809 jalr v0
50c: 01f83021 addu a2,t7,t8
}
if (node->fnNode.node.children != NULL) {
510: 8e190010 lw t9,16(s0)
514: 53200055 beqzl t9,66c <Get_Screen_Coords-0x11c>
518: 8fbf002c lw ra,44(sp)
u16 perspNorm;
Mtx *mtx = alloc_display_list(sizeof(*mtx));
51c: 0c000000 jal 0 <Get_Screen_Coords-0x788>
520: 24040040 li a0,64
switch (opt_widescreen) {
524: 3c030000 lui v1,0x0
528: 90630000 lbu v1,0(v1)
Mtx *mtx = alloc_display_list(sizeof(*mtx));
52c: 00402025 move a0,v0
case 0:
aspect = 4.0f / 3.0f;
530: 3c010000 lui at,0x0
switch (opt_widescreen) {
534: 1060000a beqz v1,560 <Get_Screen_Coords-0x228>
538: 00000000 nop
53c: 24010001 li at,1
540: 1061000b beq v1,at,570 <Get_Screen_Coords-0x218>
544: 24010002 li at,2
548: 1061000e beq v1,at,584 <Get_Screen_Coords-0x204>
54c: 24010003 li at,3
550: 10610011 beq v1,at,598 <Get_Screen_Coords-0x1f0>
554: 00000000 nop
558: 10000014 b 5ac <Get_Screen_Coords-0x1dc>
55c: 86080020 lh t0,32(s0)
aspect = 4.0f / 3.0f;
560: c4240008 lwc1 $f4,8(at)
564: 3c010000 lui at,0x0
break;
568: 1000000f b 5a8 <Get_Screen_Coords-0x1e0>
aspect = 4.0f / 3.0f;
56c: e4240000 swc1 $f4,0(at)
case 1:
aspect = 16.0f / 10.0f;
570: 3c010000 lui at,0x0
574: c426000c lwc1 $f6,12(at)
578: 3c010000 lui at,0x0
break;
57c: 1000000a b 5a8 <Get_Screen_Coords-0x1e0>
aspect = 16.0f / 10.0f;
580: e4260000 swc1 $f6,0(at)
case 2:
aspect = 16.0f / 9.0f;
584: 3c010000 lui at,0x0
588: c4280010 lwc1 $f8,16(at)
58c: 3c010000 lui at,0x0
break;
590: 10000005 b 5a8 <Get_Screen_Coords-0x1e0>
aspect = 16.0f / 9.0f;
594: e4280000 swc1 $f8,0(at)
case 3:
aspect = 21.0f / 9.0f;
598: 3c010000 lui at,0x0
59c: c42a0014 lwc1 $f10,20(at)
5a0: 3c010000 lui at,0x0
5a4: e42a0000 swc1 $f10,0(at)
break;
}
guPerspective(mtx, &perspNorm, node->fov, aspect, node->near / WORLD_SCALE, node->far / WORLD_SCALE, 1.0f);
5a8: 86080020 lh t0,32(s0)
break;
5ac: 3c013f00 lui at,0x3f00
5b0: 44810000 mtc1 at,$f0
guPerspective(mtx, &perspNorm, node->fov, aspect, node->near / WORLD_SCALE, node->far / WORLD_SCALE, 1.0f);
5b4: 44888000 mtc1 t0,$f16
5b8: 8e06001c lw a2,28(s0)
5bc: 3c013f80 lui at,0x3f80
5c0: 468084a0 cvt.s.w $f18,$f16
5c4: 44818000 mtc1 at,$f16
5c8: 3c070000 lui a3,0x0
5cc: 8ce70000 lw a3,0(a3)
5d0: 27a50046 addiu a1,sp,70
5d4: 46009102 mul.s $f4,$f18,$f0
5d8: e7a40010 swc1 $f4,16(sp)
5dc: 86090022 lh t1,34(s0)
5e0: afa40040 sw a0,64(sp)
5e4: e7b00018 swc1 $f16,24(sp)
5e8: 44893000 mtc1 t1,$f6
5ec: 00000000 nop
5f0: 46803220 cvt.s.w $f8,$f6
5f4: 46004282 mul.s $f10,$f8,$f0
5f8: 0c000000 jal 0 <Get_Screen_Coords-0x788>
5fc: e7aa0014 swc1 $f10,20(sp)
600: 3c060000 lui a2,0x0
604: 24c60000 addiu a2,a2,0
gSPPerspNormalize(gDisplayListHead++, perspNorm);
608: 8cc20000 lw v0,0(a2)
60c: 3c0bdb0e lui t3,0xdb0e
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH);
610: 3c0eda38 lui t6,0xda38
gSPPerspNormalize(gDisplayListHead++, perspNorm);
614: 244a0008 addiu t2,v0,8
618: acca0000 sw t2,0(a2)
61c: ac4b0000 sw t3,0(v0)
620: 97ac0046 lhu t4,70(sp)
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH);
624: 35ce0007 ori t6,t6,0x7
628: 3c011fff lui at,0x1fff
gSPPerspNormalize(gDisplayListHead++, perspNorm);
62c: ac4c0004 sw t4,4(v0)
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH);
630: 8cc20000 lw v0,0(a2)
634: 3421ffff ori at,at,0xffff
638: 244d0008 addiu t5,v0,8
63c: accd0000 sw t5,0(a2)
640: ac4e0000 sw t6,0(v0)
644: 8faf0040 lw t7,64(sp)
648: 01e1c024 and t8,t7,at
gCurGraphNodeCamFrustum = node;
64c: 3c010000 lui at,0x0
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH);
650: ac580004 sw t8,4(v0)
gCurGraphNodeCamFrustum = node;
654: ac300000 sw s0,0(at)
geo_process_node_and_siblings(node->fnNode.node.children);
658: 0c000000 jal 0 <Get_Screen_Coords-0x788>
65c: 8e040010 lw a0,16(s0)
gCurGraphNodeCamFrustum = NULL;
660: 3c010000 lui at,0x0
664: ac200000 sw zero,0(at)
}
}
668: 8fbf002c lw ra,44(sp)
66c: 8fb00028 lw s0,40(sp)
670: 27bd0048 addiu sp,sp,72
674: 03e00008 jr ra
678: 00000000 nop
* range of this node.
*/
static void geo_process_level_of_detail(struct GraphNodeLevelOfDetail *node) {
// The fixed point Mtx type is defined as 16 longs, but it's actually 16
// shorts for the integer parts followed by 16 shorts for the fraction parts
s16 *mtx = (s16 *) gMatStackFixed[gMatStackIndex];
67c: 3c0e0000 lui t6,0x0
680: 85ce0000 lh t6,0(t6)
684: 3c020000 lui v0,0x0
static void geo_process_level_of_detail(struct GraphNodeLevelOfDetail *node) {
688: 27bdffe8 addiu sp,sp,-24
s16 *mtx = (s16 *) gMatStackFixed[gMatStackIndex];
68c: 000e7880 sll t7,t6,0x2
690: 004f1021 addu v0,v0,t7
694: 8c420000 lw v0,0(v0)
static void geo_process_level_of_detail(struct GraphNodeLevelOfDetail *node) {
698: afbf0014 sw ra,20(sp)
s16 distanceFromCam = -mtx[14]; // z-component of the translation column
if (node->minDistance <= distanceFromCam && distanceFromCam < node->maxDistance) {
69c: 84980014 lh t8,20(a0)
s16 distanceFromCam = -mtx[14]; // z-component of the translation column
6a0: 8443001c lh v1,28(v0)
6a4: 00031823 negu v1,v1
6a8: 00031c00 sll v1,v1,0x10
6ac: 00031c03 sra v1,v1,0x10
if (node->minDistance <= distanceFromCam && distanceFromCam < node->maxDistance) {
6b0: 0078082a slt at,v1,t8
6b4: 5420000b bnezl at,6e4 <Get_Screen_Coords-0xa4>
6b8: 8fbf0014 lw ra,20(sp)
6bc: 84990016 lh t9,22(a0)
6c0: 0079082a slt at,v1,t9
6c4: 50200007 beqzl at,6e4 <Get_Screen_Coords-0xa4>
6c8: 8fbf0014 lw ra,20(sp)
if (node->node.children != 0) {
6cc: 8c850010 lw a1,16(a0)
6d0: 50a00004 beqzl a1,6e4 <Get_Screen_Coords-0xa4>
6d4: 8fbf0014 lw ra,20(sp)
geo_process_node_and_siblings(node->node.children);
6d8: 0c000000 jal 0 <Get_Screen_Coords-0x788>
6dc: 00a02025 move a0,a1
}
}
}
6e0: 8fbf0014 lw ra,20(sp)
6e4: 27bd0018 addiu sp,sp,24
6e8: 03e00008 jr ra
6ec: 00000000 nop
/**
* Process a switch case node. The node's selection function is called
* if it is 0, and among the node's children, only the selected child is
* processed next.
*/
static void geo_process_switch(struct GraphNodeSwitchCase *node) {
6f0: 27bdffe0 addiu sp,sp,-32
6f4: afbf0014 sw ra,20(sp)
struct GraphNode *selectedChild = node->fnNode.node.children;
s32 i;
if (node->fnNode.func != NULL) {
6f8: 8c820014 lw v0,20(a0)
static void geo_process_switch(struct GraphNodeSwitchCase *node) {
6fc: 00802825 move a1,a0
struct GraphNode *selectedChild = node->fnNode.node.children;
700: 8c870010 lw a3,16(a0)
if (node->fnNode.func != NULL) {
704: 1040000c beqz v0,738 <Get_Screen_Coords-0x50>
node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, gMatStack[gMatStackIndex]);
708: 24040001 li a0,1
70c: 3c0e0000 lui t6,0x0
710: 85ce0000 lh t6,0(t6)
714: 3c180000 lui t8,0x0
718: 27180000 addiu t8,t8,0
71c: 000e7980 sll t7,t6,0x6
720: 01f83021 addu a2,t7,t8
724: afa50020 sw a1,32(sp)
728: 0040f809 jalr v0
72c: afa7001c sw a3,28(sp)
730: 8fa50020 lw a1,32(sp)
734: 8fa7001c lw a3,28(sp)
}
for (i = 0; selectedChild != NULL && node->selectedCase > i; i++) {
738: 10e0000b beqz a3,768 <Get_Screen_Coords-0x20>
73c: 00001025 move v0,zero
740: 84a3001e lh v1,30(a1)
744: 18600008 blez v1,768 <Get_Screen_Coords-0x20>
748: 00000000 nop
selectedChild = selectedChild->next;
74c: 8ce70008 lw a3,8(a3)
for (i = 0; selectedChild != NULL && node->selectedCase > i; i++) {
750: 24420001 addiu v0,v0,1
754: 0043082a slt at,v0,v1
758: 10e00003 beqz a3,768 <Get_Screen_Coords-0x20>
75c: 00000000 nop
760: 5420fffb bnezl at,750 <Get_Screen_Coords-0x38>
764: 8ce70008 lw a3,8(a3)
}
if (selectedChild != NULL) {
768: 50e00004 beqzl a3,77c <Get_Screen_Coords-0xc>
76c: 8fbf0014 lw ra,20(sp)
geo_process_node_and_siblings(selectedChild);
770: 0c000000 jal 0 <Get_Screen_Coords-0x788>
774: 00e02025 move a0,a3
}
}
778: 8fbf0014 lw ra,20(sp)
77c: 27bd0020 addiu sp,sp,32
780: 03e00008 jr ra
784: 00000000 nop
00000788 <Get_Screen_Coords>:
s32 screenY;
// Convert Mario's coordinates into vec3s so they can be used in mtxf_mul_vec3s
vec3f_to_vec3s(marioPos3s, gMarioState->StarRadarLocation);
788: 3c050000 lui a1,0x0
78c: 8ca50000 lw a1,0(a1)
void Get_Screen_Coords(void) {
790: 27bdffd8 addiu sp,sp,-40
794: afbf0014 sw ra,20(sp)
vec3f_to_vec3s(marioPos3s, gMarioState->StarRadarLocation);
798: 27a40020 addiu a0,sp,32
79c: 0c000000 jal 0 <Get_Screen_Coords-0x788>
7a0: 24a500b8 addiu a1,a1,184
// Transform Mario's coordinates into view frustrum
mtxf_mul_vec3s(gMatStack[gMatStackIndex], marioPos3s);
7a4: 3c0e0000 lui t6,0x0
7a8: 85ce0000 lh t6,0(t6)
7ac: 3c180000 lui t8,0x0
7b0: 27180000 addiu t8,t8,0
7b4: 000e7980 sll t7,t6,0x6
7b8: 01f82021 addu a0,t7,t8
7bc: 0c000000 jal 0 <Get_Screen_Coords-0x788>
7c0: 27a50020 addiu a1,sp,32
// Perspective divide
screenX = 2 * (0.5f - marioPos3s[0] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->width);
7c4: 87b90024 lh t9,36(sp)
7c8: 87a80020 lh t0,32(sp)
mtxf_mul_vec3s(gMatStack[gMatStackIndex], marioPos3s);
7cc: 3c013f00 lui at,0x3f00
screenX = 2 * (0.5f - marioPos3s[0] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->width);
7d0: 44992000 mtc1 t9,$f4
7d4: 44883000 mtc1 t0,$f6
7d8: 3c020000 lui v0,0x0
7dc: 46802020 cvt.s.w $f0,$f4
mtxf_mul_vec3s(gMatStack[gMatStackIndex], marioPos3s);
7e0: 44811000 mtc1 at,$f2
screenX = 2 * (0.5f - marioPos3s[0] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->width);
7e4: 8c420000 lw v0,0(v0)
mtxf_mul_vec3s(gMatStack[gMatStackIndex], marioPos3s);
7e8: 3c014000 lui at,0x4000
7ec: 44816000 mtc1 at,$f12
screenX = 2 * (0.5f - marioPos3s[0] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->width);
7f0: 46803220 cvt.s.w $f8,$f6
7f4: 8449001a lh t1,26(v0)
screenY = 2 * (0.5f - marioPos3s[1] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->height);
7f8: 87ab0022 lh t3,34(sp)
7fc: 844c001c lh t4,28(v0)
screenX = 2 * (0.5f - marioPos3s[0] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->width);
800: 44892000 mtc1 t1,$f4
if (marioPos3s[2] > 0) {
return;
804: 3c020000 lui v0,0x0
screenX = 2 * (0.5f - marioPos3s[0] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->width);
808: 46004283 div.s $f10,$f8,$f0
return;
80c: 24420000 addiu v0,v0,0
screenX = 2 * (0.5f - marioPos3s[0] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->width);
810: 468021a0 cvt.s.w $f6,$f4
814: 460a1401 sub.s $f16,$f2,$f10
818: 460c8482 mul.s $f18,$f16,$f12
screenY = 2 * (0.5f - marioPos3s[1] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->height);
81c: 448b8000 mtc1 t3,$f16
820: 00000000 nop
824: 46808120 cvt.s.w $f4,$f16
screenX = 2 * (0.5f - marioPos3s[0] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->width);
828: 46069202 mul.s $f8,$f18,$f6
screenY = 2 * (0.5f - marioPos3s[1] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->height);
82c: 46002483 div.s $f18,$f4,$f0
screenX = 2 * (0.5f - marioPos3s[0] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->width);
830: 4600428d trunc.w.s $f10,$f8
834: 44035000 mfc1 v1,$f10
screenY = 2 * (0.5f - marioPos3s[1] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->height);
838: 448c5000 mtc1 t4,$f10
83c: 00000000 nop
840: 46805420 cvt.s.w $f16,$f10
844: 46121181 sub.s $f6,$f2,$f18
848: 460c3202 mul.s $f8,$f6,$f12
void Get_Screen_Coords(void) {
84c: 00000000 nop
screenY = 2 * (0.5f - marioPos3s[1] / (f32)marioPos3s[2]) * (gCurGraphNodeRoot->height);
850: 46104102 mul.s $f4,$f8,$f16
854: 4600248d trunc.w.s $f18,$f4
858: 44049000 mfc1 a0,$f18
if (marioPos3s[2] > 0) {
85c: 1f200005 bgtz t9,874 <Get_Screen_Coords+0xec>
860: 00000000 nop
}
gMarioState->ScreenPosX = screenX;
864: 8c4e0000 lw t6,0(v0)
868: adc300d8 sw v1,216(t6)
gMarioState->ScreenPosY = screenY;
86c: 8c4f0000 lw t7,0(v0)
870: ade400d4 sw a0,212(t7)
}
874: 8fbf0014 lw ra,20(sp)
878: 27bd0028 addiu sp,sp,40
87c: 03e00008 jr ra
880: 00000000 nop
static void make_roll_matrix(Mtx *mtx, s16 angle) {
884: 27bdffa0 addiu sp,sp,-96
888: afbf0014 sw ra,20(sp)
88c: afa40060 sw a0,96(sp)
890: afa50064 sw a1,100(sp)
Mat4 temp;
mtxf_identity(temp);
894: 0c000000 jal 0 <Get_Screen_Coords-0x788>
898: 27a40020 addiu a0,sp,32
temp[0][0] = coss(angle);
89c: 97a20066 lhu v0,102(sp)
8a0: 3c010000 lui at,0x0
temp[0][1] = sins(angle);
temp[1][0] = -temp[0][1];
temp[1][1] = temp[0][0];
guMtxF2L(temp, mtx);
8a4: 27a40020 addiu a0,sp,32
temp[0][0] = coss(angle);
8a8: 00021103 sra v0,v0,0x4
8ac: 00021080 sll v0,v0,0x2
8b0: 00220821 addu at,at,v0
8b4: c4200000 lwc1 $f0,0(at)
temp[0][1] = sins(angle);
8b8: 3c010000 lui at,0x0
8bc: 00220821 addu at,at,v0
8c0: c4220000 lwc1 $f2,0(at)
guMtxF2L(temp, mtx);
8c4: 8fa50060 lw a1,96(sp)
temp[1][1] = temp[0][0];
8c8: e7a00034 swc1 $f0,52(sp)
temp[1][0] = -temp[0][1];
8cc: 46001107 neg.s $f4,$f2
guMtxF2L(temp, mtx);
8d0: e7a00020 swc1 $f0,32(sp)
temp[1][0] = -temp[0][1];
8d4: e7a40030 swc1 $f4,48(sp)
guMtxF2L(temp, mtx);
8d8: 0c000000 jal 0 <Get_Screen_Coords-0x788>
8dc: e7a20024 swc1 $f2,36(sp)
}
8e0: 8fbf0014 lw ra,20(sp)
8e4: 27bd0060 addiu sp,sp,96
8e8: 03e00008 jr ra
8ec: 00000000 nop
/**
* Process a camera node.
*/
static void geo_process_camera(struct GraphNodeCamera *node) {
8f0: 27bdff90 addiu sp,sp,-112
8f4: afb00014 sw s0,20(sp)
8f8: 00808025 move s0,a0
8fc: afbf001c sw ra,28(sp)
900: afb10018 sw s1,24(sp)
Mat4 cameraTransform;
Mtx *rollMtx = alloc_display_list(sizeof(*rollMtx));
904: 0c000000 jal 0 <Get_Screen_Coords-0x788>
908: 24040040 li a0,64
90c: afa2002c sw v0,44(sp)
Mtx *mtx = alloc_display_list(sizeof(*mtx));
910: 0c000000 jal 0 <Get_Screen_Coords-0x788>
914: 24040040 li a0,64
918: afa20028 sw v0,40(sp)
if (node->fnNode.func != NULL) {
91c: 8e030014 lw v1,20(s0)
920: 3c110000 lui s1,0x0
924: 26310000 addiu s1,s1,0
928: 10600008 beqz v1,94c <Get_Screen_Coords+0x1c4>
node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, gMatStack[gMatStackIndex]);
92c: 24040001 li a0,1
930: 862e0000 lh t6,0(s1)
934: 3c180000 lui t8,0x0
938: 27180000 addiu t8,t8,0
93c: 000e7980 sll t7,t6,0x6
940: 01f83021 addu a2,t7,t8
944: 0060f809 jalr v1
948: 02002825 move a1,s0
94c: 3c110000 lui s1,0x0
950: 26310000 addiu s1,s1,0
}
make_roll_matrix(rollMtx, node->rollScreen);
954: 8fa4002c lw a0,44(sp)
958: 0c000221 jal 884 <Get_Screen_Coords+0xfc>
95c: 8605003a lh a1,58(s0)
960: 3c080000 lui t0,0x0
964: 25080000 addiu t0,t0,0
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(rollMtx), G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH);
968: 8d030000 lw v1,0(t0)
96c: 3c09da38 lui t1,0xda38
970: 35290005 ori t1,t1,0x5
974: 24790008 addiu t9,v1,8
978: ad190000 sw t9,0(t0)
97c: ac690000 sw t1,0(v1)
980: 8faa002c lw t2,44(sp)
984: 3c011fff lui at,0x1fff
988: 3421ffff ori at,at,0xffff
98c: 01415824 and t3,t2,at
990: ac6b0004 sw t3,4(v1)
mtxf_lookat(cameraTransform, node->pos, node->focus, node->roll);
994: 86070038 lh a3,56(s0)
998: 27a40030 addiu a0,sp,48
99c: 2605001c addiu a1,s0,28
9a0: 0c000000 jal 0 <Get_Screen_Coords-0x788>
9a4: 26060028 addiu a2,s0,40
mtxf_mul(gMatStack[gMatStackIndex + 1], cameraTransform, gMatStack[gMatStackIndex]);
9a8: 862c0000 lh t4,0(s1)
9ac: 3c0e0000 lui t6,0x0
9b0: 25ce0000 addiu t6,t6,0
9b4: 000c6980 sll t5,t4,0x6
9b8: 01ae3021 addu a2,t5,t6
9bc: 24c40040 addiu a0,a2,64
9c0: 0c000000 jal 0 <Get_Screen_Coords-0x788>
9c4: 27a50030 addiu a1,sp,48
gMatStackIndex++;
9c8: 862f0000 lh t7,0(s1)
mtxf_to_mtx(mtx, gMatStack[gMatStackIndex]);
9cc: 3c0a0000 lui t2,0x0
9d0: 254a0000 addiu t2,t2,0
gMatStackIndex++;
9d4: 25f80001 addiu t8,t7,1