summaryrefslogtreecommitdiff
path: root/asm/Dolphin/gx/GXTev.s
blob: 7002c3cfaab36da5820f5bfd94ce0527eb45c5dd (plain)
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
.include "macros.inc"

.section .text, "ax"  # 0x80005600 - 0x8036FBA0
.global GXSetTevOp
GXSetTevOp:
/* 800ABA08 000A8948  7C 08 02 A6 */	mflr r0
/* 800ABA0C 000A894C  38 C0 00 0A */	li r6, 0xa
/* 800ABA10 000A8950  90 01 00 04 */	stw r0, 4(r1)
/* 800ABA14 000A8954  94 21 FF E8 */	stwu r1, -0x18(r1)
/* 800ABA18 000A8958  93 E1 00 14 */	stw r31, 0x14(r1)
/* 800ABA1C 000A895C  3B E0 00 05 */	li r31, 5
/* 800ABA20 000A8960  93 C1 00 10 */	stw r30, 0x10(r1)
/* 800ABA24 000A8964  7C 7E 1B 79 */	or. r30, r3, r3
/* 800ABA28 000A8968  41 82 00 0C */	beq lbl_800ABA34
/* 800ABA2C 000A896C  38 C0 00 00 */	li r6, 0
/* 800ABA30 000A8970  3B E0 00 00 */	li r31, 0
lbl_800ABA34:
/* 800ABA34 000A8974  2C 04 00 02 */	cmpwi r4, 2
/* 800ABA38 000A8978  41 82 00 8C */	beq lbl_800ABAC4
/* 800ABA3C 000A897C  40 80 00 14 */	bge lbl_800ABA50
/* 800ABA40 000A8980  2C 04 00 00 */	cmpwi r4, 0
/* 800ABA44 000A8984  41 82 00 1C */	beq lbl_800ABA60
/* 800ABA48 000A8988  40 80 00 48 */	bge lbl_800ABA90
/* 800ABA4C 000A898C  48 00 01 10 */	b lbl_800ABB5C
lbl_800ABA50:
/* 800ABA50 000A8990  2C 04 00 04 */	cmpwi r4, 4
/* 800ABA54 000A8994  41 82 00 D8 */	beq lbl_800ABB2C
/* 800ABA58 000A8998  40 80 01 04 */	bge lbl_800ABB5C
/* 800ABA5C 000A899C  48 00 00 9C */	b lbl_800ABAF8
lbl_800ABA60:
/* 800ABA60 000A89A0  38 7E 00 00 */	addi r3, r30, 0
/* 800ABA64 000A89A4  38 80 00 0F */	li r4, 0xf
/* 800ABA68 000A89A8  38 A0 00 08 */	li r5, 8
/* 800ABA6C 000A89AC  38 E0 00 0F */	li r7, 0xf
/* 800ABA70 000A89B0  48 00 01 3D */	bl GXSetTevColorIn
/* 800ABA74 000A89B4  38 7E 00 00 */	addi r3, r30, 0
/* 800ABA78 000A89B8  38 DF 00 00 */	addi r6, r31, 0
/* 800ABA7C 000A89BC  38 80 00 07 */	li r4, 7
/* 800ABA80 000A89C0  38 A0 00 04 */	li r5, 4
/* 800ABA84 000A89C4  38 E0 00 07 */	li r7, 7
/* 800ABA88 000A89C8  48 00 01 A5 */	bl GXSetTevAlphaIn
/* 800ABA8C 000A89CC  48 00 00 D0 */	b lbl_800ABB5C
lbl_800ABA90:
/* 800ABA90 000A89D0  38 7E 00 00 */	addi r3, r30, 0
/* 800ABA94 000A89D4  38 86 00 00 */	addi r4, r6, 0
/* 800ABA98 000A89D8  38 A0 00 08 */	li r5, 8
/* 800ABA9C 000A89DC  38 C0 00 09 */	li r6, 9
/* 800ABAA0 000A89E0  38 E0 00 0F */	li r7, 0xf
/* 800ABAA4 000A89E4  48 00 01 09 */	bl GXSetTevColorIn
/* 800ABAA8 000A89E8  38 7E 00 00 */	addi r3, r30, 0
/* 800ABAAC 000A89EC  38 FF 00 00 */	addi r7, r31, 0
/* 800ABAB0 000A89F0  38 80 00 07 */	li r4, 7
/* 800ABAB4 000A89F4  38 A0 00 07 */	li r5, 7
/* 800ABAB8 000A89F8  38 C0 00 07 */	li r6, 7
/* 800ABABC 000A89FC  48 00 01 71 */	bl GXSetTevAlphaIn
/* 800ABAC0 000A8A00  48 00 00 9C */	b lbl_800ABB5C
lbl_800ABAC4:
/* 800ABAC4 000A8A04  38 7E 00 00 */	addi r3, r30, 0
/* 800ABAC8 000A8A08  38 86 00 00 */	addi r4, r6, 0
/* 800ABACC 000A8A0C  38 A0 00 0C */	li r5, 0xc
/* 800ABAD0 000A8A10  38 C0 00 08 */	li r6, 8
/* 800ABAD4 000A8A14  38 E0 00 0F */	li r7, 0xf
/* 800ABAD8 000A8A18  48 00 00 D5 */	bl GXSetTevColorIn
/* 800ABADC 000A8A1C  38 7E 00 00 */	addi r3, r30, 0
/* 800ABAE0 000A8A20  38 DF 00 00 */	addi r6, r31, 0
/* 800ABAE4 000A8A24  38 80 00 07 */	li r4, 7
/* 800ABAE8 000A8A28  38 A0 00 04 */	li r5, 4
/* 800ABAEC 000A8A2C  38 E0 00 07 */	li r7, 7
/* 800ABAF0 000A8A30  48 00 01 3D */	bl GXSetTevAlphaIn
/* 800ABAF4 000A8A34  48 00 00 68 */	b lbl_800ABB5C
lbl_800ABAF8:
/* 800ABAF8 000A8A38  38 7E 00 00 */	addi r3, r30, 0
/* 800ABAFC 000A8A3C  38 80 00 0F */	li r4, 0xf
/* 800ABB00 000A8A40  38 A0 00 0F */	li r5, 0xf
/* 800ABB04 000A8A44  38 C0 00 0F */	li r6, 0xf
/* 800ABB08 000A8A48  38 E0 00 08 */	li r7, 8
/* 800ABB0C 000A8A4C  48 00 00 A1 */	bl GXSetTevColorIn
/* 800ABB10 000A8A50  38 7E 00 00 */	addi r3, r30, 0
/* 800ABB14 000A8A54  38 80 00 07 */	li r4, 7
/* 800ABB18 000A8A58  38 A0 00 07 */	li r5, 7
/* 800ABB1C 000A8A5C  38 C0 00 07 */	li r6, 7
/* 800ABB20 000A8A60  38 E0 00 04 */	li r7, 4
/* 800ABB24 000A8A64  48 00 01 09 */	bl GXSetTevAlphaIn
/* 800ABB28 000A8A68  48 00 00 34 */	b lbl_800ABB5C
lbl_800ABB2C:
/* 800ABB2C 000A8A6C  38 7E 00 00 */	addi r3, r30, 0
/* 800ABB30 000A8A70  38 E6 00 00 */	addi r7, r6, 0
/* 800ABB34 000A8A74  38 80 00 0F */	li r4, 0xf
/* 800ABB38 000A8A78  38 A0 00 0F */	li r5, 0xf
/* 800ABB3C 000A8A7C  38 C0 00 0F */	li r6, 0xf
/* 800ABB40 000A8A80  48 00 00 6D */	bl GXSetTevColorIn
/* 800ABB44 000A8A84  38 7E 00 00 */	addi r3, r30, 0
/* 800ABB48 000A8A88  38 FF 00 00 */	addi r7, r31, 0
/* 800ABB4C 000A8A8C  38 80 00 07 */	li r4, 7
/* 800ABB50 000A8A90  38 A0 00 07 */	li r5, 7
/* 800ABB54 000A8A94  38 C0 00 07 */	li r6, 7
/* 800ABB58 000A8A98  48 00 00 D5 */	bl GXSetTevAlphaIn
lbl_800ABB5C:
/* 800ABB5C 000A8A9C  38 7E 00 00 */	addi r3, r30, 0
/* 800ABB60 000A8AA0  38 80 00 00 */	li r4, 0
/* 800ABB64 000A8AA4  38 A0 00 00 */	li r5, 0
/* 800ABB68 000A8AA8  38 C0 00 00 */	li r6, 0
/* 800ABB6C 000A8AAC  38 E0 00 01 */	li r7, 1
/* 800ABB70 000A8AB0  39 00 00 00 */	li r8, 0
/* 800ABB74 000A8AB4  48 00 01 3D */	bl GXSetTevColorOp
/* 800ABB78 000A8AB8  38 7E 00 00 */	addi r3, r30, 0
/* 800ABB7C 000A8ABC  38 80 00 00 */	li r4, 0
/* 800ABB80 000A8AC0  38 A0 00 00 */	li r5, 0
/* 800ABB84 000A8AC4  38 C0 00 00 */	li r6, 0
/* 800ABB88 000A8AC8  38 E0 00 01 */	li r7, 1
/* 800ABB8C 000A8ACC  39 00 00 00 */	li r8, 0
/* 800ABB90 000A8AD0  48 00 01 E1 */	bl GXSetTevAlphaOp
/* 800ABB94 000A8AD4  80 01 00 1C */	lwz r0, 0x1c(r1)
/* 800ABB98 000A8AD8  83 E1 00 14 */	lwz r31, 0x14(r1)
/* 800ABB9C 000A8ADC  83 C1 00 10 */	lwz r30, 0x10(r1)
/* 800ABBA0 000A8AE0  38 21 00 18 */	addi r1, r1, 0x18
/* 800ABBA4 000A8AE4  7C 08 03 A6 */	mtlr r0
/* 800ABBA8 000A8AE8  4E 80 00 20 */	blr 

.global GXSetTevColorIn
GXSetTevColorIn:
/* 800ABBAC 000A8AEC  54 63 10 3A */	slwi r3, r3, 2
/* 800ABBB0 000A8AF0  80 0D 82 C8 */	lwz r0, gx@sda21(r13)
/* 800ABBB4 000A8AF4  39 23 01 30 */	addi r9, r3, 0x130
/* 800ABBB8 000A8AF8  7D 20 4A 14 */	add r9, r0, r9
/* 800ABBBC 000A8AFC  80 69 00 00 */	lwz r3, 0(r9)
/* 800ABBC0 000A8B00  54 80 60 26 */	slwi r0, r4, 0xc
/* 800ABBC4 000A8B04  54 A8 40 2E */	slwi r8, r5, 8
/* 800ABBC8 000A8B08  54 63 05 1E */	rlwinm r3, r3, 0, 0x14, 0xf
/* 800ABBCC 000A8B0C  7C 60 03 78 */	or r0, r3, r0
/* 800ABBD0 000A8B10  90 09 00 00 */	stw r0, 0(r9)
/* 800ABBD4 000A8B14  54 C4 20 36 */	slwi r4, r6, 4
/* 800ABBD8 000A8B18  38 60 00 61 */	li r3, 0x61
/* 800ABBDC 000A8B1C  80 C9 00 00 */	lwz r6, 0(r9)
/* 800ABBE0 000A8B20  3C A0 CC 01 */	lis r5, 0xCC008000@ha
/* 800ABBE4 000A8B24  38 00 00 00 */	li r0, 0
/* 800ABBE8 000A8B28  54 C6 06 26 */	rlwinm r6, r6, 0, 0x18, 0x13
/* 800ABBEC 000A8B2C  7C C6 43 78 */	or r6, r6, r8
/* 800ABBF0 000A8B30  90 C9 00 00 */	stw r6, 0(r9)
/* 800ABBF4 000A8B34  80 C9 00 00 */	lwz r6, 0(r9)
/* 800ABBF8 000A8B38  54 C6 07 2E */	rlwinm r6, r6, 0, 0x1c, 0x17
/* 800ABBFC 000A8B3C  7C C4 23 78 */	or r4, r6, r4
/* 800ABC00 000A8B40  90 89 00 00 */	stw r4, 0(r9)
/* 800ABC04 000A8B44  80 89 00 00 */	lwz r4, 0(r9)
/* 800ABC08 000A8B48  54 84 00 36 */	rlwinm r4, r4, 0, 0, 0x1b
/* 800ABC0C 000A8B4C  7C 84 3B 78 */	or r4, r4, r7
/* 800ABC10 000A8B50  90 89 00 00 */	stw r4, 0(r9)
/* 800ABC14 000A8B54  98 65 80 00 */	stb r3, 0xCC008000@l(r5)
/* 800ABC18 000A8B58  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800ABC1C 000A8B5C  80 89 00 00 */	lwz r4, 0(r9)
/* 800ABC20 000A8B60  90 85 80 00 */	stw r4, -0x8000(r5)
/* 800ABC24 000A8B64  B0 03 00 02 */	sth r0, 2(r3)
/* 800ABC28 000A8B68  4E 80 00 20 */	blr 

.global GXSetTevAlphaIn
GXSetTevAlphaIn:
/* 800ABC2C 000A8B6C  54 63 10 3A */	slwi r3, r3, 2
/* 800ABC30 000A8B70  80 0D 82 C8 */	lwz r0, gx@sda21(r13)
/* 800ABC34 000A8B74  39 23 01 70 */	addi r9, r3, 0x170
/* 800ABC38 000A8B78  7D 20 4A 14 */	add r9, r0, r9
/* 800ABC3C 000A8B7C  81 09 00 00 */	lwz r8, 0(r9)
/* 800ABC40 000A8B80  54 83 68 24 */	slwi r3, r4, 0xd
/* 800ABC44 000A8B84  54 A0 50 2A */	slwi r0, r5, 0xa
/* 800ABC48 000A8B88  55 04 04 DE */	rlwinm r4, r8, 0, 0x13, 0xf
/* 800ABC4C 000A8B8C  7C 83 1B 78 */	or r3, r4, r3
/* 800ABC50 000A8B90  90 69 00 00 */	stw r3, 0(r9)
/* 800ABC54 000A8B94  54 C6 38 30 */	slwi r6, r6, 7
/* 800ABC58 000A8B98  54 E4 20 36 */	slwi r4, r7, 4
/* 800ABC5C 000A8B9C  80 E9 00 00 */	lwz r7, 0(r9)
/* 800ABC60 000A8BA0  38 60 00 61 */	li r3, 0x61
/* 800ABC64 000A8BA4  3C A0 CC 01 */	lis r5, 0xCC008000@ha
/* 800ABC68 000A8BA8  54 E7 05 A4 */	rlwinm r7, r7, 0, 0x16, 0x12
/* 800ABC6C 000A8BAC  7C E0 03 78 */	or r0, r7, r0
/* 800ABC70 000A8BB0  90 09 00 00 */	stw r0, 0(r9)
/* 800ABC74 000A8BB4  38 00 00 00 */	li r0, 0
/* 800ABC78 000A8BB8  80 E9 00 00 */	lwz r7, 0(r9)
/* 800ABC7C 000A8BBC  54 E7 06 6A */	rlwinm r7, r7, 0, 0x19, 0x15
/* 800ABC80 000A8BC0  7C E6 33 78 */	or r6, r7, r6
/* 800ABC84 000A8BC4  90 C9 00 00 */	stw r6, 0(r9)
/* 800ABC88 000A8BC8  80 C9 00 00 */	lwz r6, 0(r9)
/* 800ABC8C 000A8BCC  54 C6 07 30 */	rlwinm r6, r6, 0, 0x1c, 0x18
/* 800ABC90 000A8BD0  7C C4 23 78 */	or r4, r6, r4
/* 800ABC94 000A8BD4  90 89 00 00 */	stw r4, 0(r9)
/* 800ABC98 000A8BD8  98 65 80 00 */	stb r3, 0xCC008000@l(r5)
/* 800ABC9C 000A8BDC  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800ABCA0 000A8BE0  80 89 00 00 */	lwz r4, 0(r9)
/* 800ABCA4 000A8BE4  90 85 80 00 */	stw r4, -0x8000(r5)
/* 800ABCA8 000A8BE8  B0 03 00 02 */	sth r0, 2(r3)
/* 800ABCAC 000A8BEC  4E 80 00 20 */	blr 

.global GXSetTevColorOp
GXSetTevColorOp:
/* 800ABCB0 000A8BF0  54 63 10 3A */	slwi r3, r3, 2
/* 800ABCB4 000A8BF4  80 0D 82 C8 */	lwz r0, gx@sda21(r13)
/* 800ABCB8 000A8BF8  38 63 01 30 */	addi r3, r3, 0x130
/* 800ABCBC 000A8BFC  7C 60 1A 14 */	add r3, r0, r3
/* 800ABCC0 000A8C00  80 03 00 00 */	lwz r0, 0(r3)
/* 800ABCC4 000A8C04  2C 04 00 01 */	cmpwi r4, 1
/* 800ABCC8 000A8C08  54 00 03 98 */	rlwinm r0, r0, 0, 0xe, 0xc
/* 800ABCCC 000A8C0C  50 80 93 5A */	rlwimi r0, r4, 0x12, 0xd, 0xd
/* 800ABCD0 000A8C10  90 03 00 00 */	stw r0, 0(r3)
/* 800ABCD4 000A8C14  41 81 00 30 */	bgt lbl_800ABD04
/* 800ABCD8 000A8C18  81 23 00 00 */	lwz r9, 0(r3)
/* 800ABCDC 000A8C1C  54 C4 A0 16 */	slwi r4, r6, 0x14
/* 800ABCE0 000A8C20  54 A0 80 1E */	slwi r0, r5, 0x10
/* 800ABCE4 000A8C24  55 25 03 12 */	rlwinm r5, r9, 0, 0xc, 9
/* 800ABCE8 000A8C28  7C A4 23 78 */	or r4, r5, r4
/* 800ABCEC 000A8C2C  90 83 00 00 */	stw r4, 0(r3)
/* 800ABCF0 000A8C30  80 83 00 00 */	lwz r4, 0(r3)
/* 800ABCF4 000A8C34  54 84 04 1A */	rlwinm r4, r4, 0, 0x10, 0xd
/* 800ABCF8 000A8C38  7C 80 03 78 */	or r0, r4, r0
/* 800ABCFC 000A8C3C  90 03 00 00 */	stw r0, 0(r3)
/* 800ABD00 000A8C40  48 00 00 24 */	b lbl_800ABD24
lbl_800ABD04:
/* 800ABD04 000A8C44  80 03 00 00 */	lwz r0, 0(r3)
/* 800ABD08 000A8C48  54 00 03 12 */	rlwinm r0, r0, 0, 0xc, 9
/* 800ABD0C 000A8C4C  50 80 9A 96 */	rlwimi r0, r4, 0x13, 0xa, 0xb
/* 800ABD10 000A8C50  90 03 00 00 */	stw r0, 0(r3)
/* 800ABD14 000A8C54  80 03 00 00 */	lwz r0, 0(r3)
/* 800ABD18 000A8C58  54 00 04 1A */	rlwinm r0, r0, 0, 0x10, 0xd
/* 800ABD1C 000A8C5C  64 00 00 03 */	oris r0, r0, 3
/* 800ABD20 000A8C60  90 03 00 00 */	stw r0, 0(r3)
lbl_800ABD24:
/* 800ABD24 000A8C64  80 83 00 00 */	lwz r4, 0(r3)
/* 800ABD28 000A8C68  54 E0 99 58 */	rlwinm r0, r7, 0x13, 5, 0xc
/* 800ABD2C 000A8C6C  55 06 B0 12 */	slwi r6, r8, 0x16
/* 800ABD30 000A8C70  54 84 03 56 */	rlwinm r4, r4, 0, 0xd, 0xb
/* 800ABD34 000A8C74  7C 80 03 78 */	or r0, r4, r0
/* 800ABD38 000A8C78  90 03 00 00 */	stw r0, 0(r3)
/* 800ABD3C 000A8C7C  38 80 00 61 */	li r4, 0x61
/* 800ABD40 000A8C80  3C A0 CC 01 */	lis r5, 0xCC008000@ha
/* 800ABD44 000A8C84  80 E3 00 00 */	lwz r7, 0(r3)
/* 800ABD48 000A8C88  38 00 00 00 */	li r0, 0
/* 800ABD4C 000A8C8C  54 E7 02 8E */	rlwinm r7, r7, 0, 0xa, 7
/* 800ABD50 000A8C90  7C E6 33 78 */	or r6, r7, r6
/* 800ABD54 000A8C94  90 C3 00 00 */	stw r6, 0(r3)
/* 800ABD58 000A8C98  98 85 80 00 */	stb r4, 0xCC008000@l(r5)
/* 800ABD5C 000A8C9C  80 8D 82 C8 */	lwz r4, gx@sda21(r13)
/* 800ABD60 000A8CA0  80 63 00 00 */	lwz r3, 0(r3)
/* 800ABD64 000A8CA4  90 65 80 00 */	stw r3, -0x8000(r5)
/* 800ABD68 000A8CA8  B0 04 00 02 */	sth r0, 2(r4)
/* 800ABD6C 000A8CAC  4E 80 00 20 */	blr 

.global GXSetTevAlphaOp
GXSetTevAlphaOp:
/* 800ABD70 000A8CB0  54 63 10 3A */	slwi r3, r3, 2
/* 800ABD74 000A8CB4  80 0D 82 C8 */	lwz r0, gx@sda21(r13)
/* 800ABD78 000A8CB8  38 63 01 70 */	addi r3, r3, 0x170
/* 800ABD7C 000A8CBC  7C 60 1A 14 */	add r3, r0, r3
/* 800ABD80 000A8CC0  80 03 00 00 */	lwz r0, 0(r3)
/* 800ABD84 000A8CC4  2C 04 00 01 */	cmpwi r4, 1
/* 800ABD88 000A8CC8  54 00 03 98 */	rlwinm r0, r0, 0, 0xe, 0xc
/* 800ABD8C 000A8CCC  50 80 93 5A */	rlwimi r0, r4, 0x12, 0xd, 0xd
/* 800ABD90 000A8CD0  90 03 00 00 */	stw r0, 0(r3)
/* 800ABD94 000A8CD4  41 81 00 30 */	bgt lbl_800ABDC4
/* 800ABD98 000A8CD8  81 23 00 00 */	lwz r9, 0(r3)
/* 800ABD9C 000A8CDC  54 C4 A0 16 */	slwi r4, r6, 0x14
/* 800ABDA0 000A8CE0  54 A0 80 1E */	slwi r0, r5, 0x10
/* 800ABDA4 000A8CE4  55 25 03 12 */	rlwinm r5, r9, 0, 0xc, 9
/* 800ABDA8 000A8CE8  7C A4 23 78 */	or r4, r5, r4
/* 800ABDAC 000A8CEC  90 83 00 00 */	stw r4, 0(r3)
/* 800ABDB0 000A8CF0  80 83 00 00 */	lwz r4, 0(r3)
/* 800ABDB4 000A8CF4  54 84 04 1A */	rlwinm r4, r4, 0, 0x10, 0xd
/* 800ABDB8 000A8CF8  7C 80 03 78 */	or r0, r4, r0
/* 800ABDBC 000A8CFC  90 03 00 00 */	stw r0, 0(r3)
/* 800ABDC0 000A8D00  48 00 00 24 */	b lbl_800ABDE4
lbl_800ABDC4:
/* 800ABDC4 000A8D04  80 03 00 00 */	lwz r0, 0(r3)
/* 800ABDC8 000A8D08  54 00 03 12 */	rlwinm r0, r0, 0, 0xc, 9
/* 800ABDCC 000A8D0C  50 80 9A 96 */	rlwimi r0, r4, 0x13, 0xa, 0xb
/* 800ABDD0 000A8D10  90 03 00 00 */	stw r0, 0(r3)
/* 800ABDD4 000A8D14  80 03 00 00 */	lwz r0, 0(r3)
/* 800ABDD8 000A8D18  54 00 04 1A */	rlwinm r0, r0, 0, 0x10, 0xd
/* 800ABDDC 000A8D1C  64 00 00 03 */	oris r0, r0, 3
/* 800ABDE0 000A8D20  90 03 00 00 */	stw r0, 0(r3)
lbl_800ABDE4:
/* 800ABDE4 000A8D24  80 83 00 00 */	lwz r4, 0(r3)
/* 800ABDE8 000A8D28  54 E0 99 58 */	rlwinm r0, r7, 0x13, 5, 0xc
/* 800ABDEC 000A8D2C  55 06 B0 12 */	slwi r6, r8, 0x16
/* 800ABDF0 000A8D30  54 84 03 56 */	rlwinm r4, r4, 0, 0xd, 0xb
/* 800ABDF4 000A8D34  7C 80 03 78 */	or r0, r4, r0
/* 800ABDF8 000A8D38  90 03 00 00 */	stw r0, 0(r3)
/* 800ABDFC 000A8D3C  38 80 00 61 */	li r4, 0x61
/* 800ABE00 000A8D40  3C A0 CC 01 */	lis r5, 0xCC008000@ha
/* 800ABE04 000A8D44  80 E3 00 00 */	lwz r7, 0(r3)
/* 800ABE08 000A8D48  38 00 00 00 */	li r0, 0
/* 800ABE0C 000A8D4C  54 E7 02 8E */	rlwinm r7, r7, 0, 0xa, 7
/* 800ABE10 000A8D50  7C E6 33 78 */	or r6, r7, r6
/* 800ABE14 000A8D54  90 C3 00 00 */	stw r6, 0(r3)
/* 800ABE18 000A8D58  98 85 80 00 */	stb r4, 0xCC008000@l(r5)
/* 800ABE1C 000A8D5C  80 8D 82 C8 */	lwz r4, gx@sda21(r13)
/* 800ABE20 000A8D60  80 63 00 00 */	lwz r3, 0(r3)
/* 800ABE24 000A8D64  90 65 80 00 */	stw r3, -0x8000(r5)
/* 800ABE28 000A8D68  B0 04 00 02 */	sth r0, 2(r4)
/* 800ABE2C 000A8D6C  4E 80 00 20 */	blr 

.global GXSetTevColor
GXSetTevColor:
/* 800ABE30 000A8D70  88 04 00 03 */	lbz r0, 3(r4)
/* 800ABE34 000A8D74  54 68 08 3C */	slwi r8, r3, 1
/* 800ABE38 000A8D78  88 A4 00 00 */	lbz r5, 0(r4)
/* 800ABE3C 000A8D7C  38 E8 00 E0 */	addi r7, r8, 0xe0
/* 800ABE40 000A8D80  54 09 60 26 */	slwi r9, r0, 0xc
/* 800ABE44 000A8D84  50 A9 06 3E */	rlwimi r9, r5, 0, 0x18, 0x1f
/* 800ABE48 000A8D88  89 44 00 02 */	lbz r10, 2(r4)
/* 800ABE4C 000A8D8C  88 C4 00 01 */	lbz r6, 1(r4)
/* 800ABE50 000A8D90  54 E7 C0 0E */	slwi r7, r7, 0x18
/* 800ABE54 000A8D94  38 A0 00 61 */	li r5, 0x61
/* 800ABE58 000A8D98  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800ABE5C 000A8D9C  3C 80 CC 01 */	lis r4, 0xCC008000@ha
/* 800ABE60 000A8DA0  98 A4 80 00 */	stb r5, 0xCC008000@l(r4)
/* 800ABE64 000A8DA4  51 27 03 3E */	rlwimi r7, r9, 0, 0xc, 0x1f
/* 800ABE68 000A8DA8  38 08 00 E1 */	addi r0, r8, 0xe1
/* 800ABE6C 000A8DAC  90 E4 80 00 */	stw r7, -0x8000(r4)
/* 800ABE70 000A8DB0  54 C7 60 26 */	slwi r7, r6, 0xc
/* 800ABE74 000A8DB4  54 06 C0 0E */	slwi r6, r0, 0x18
/* 800ABE78 000A8DB8  51 47 06 3E */	rlwimi r7, r10, 0, 0x18, 0x1f
/* 800ABE7C 000A8DBC  98 A4 80 00 */	stb r5, -0x8000(r4)
/* 800ABE80 000A8DC0  50 E6 03 3E */	rlwimi r6, r7, 0, 0xc, 0x1f
/* 800ABE84 000A8DC4  90 C4 80 00 */	stw r6, -0x8000(r4)
/* 800ABE88 000A8DC8  38 00 00 00 */	li r0, 0
/* 800ABE8C 000A8DCC  98 A4 80 00 */	stb r5, -0x8000(r4)
/* 800ABE90 000A8DD0  90 C4 80 00 */	stw r6, -0x8000(r4)
/* 800ABE94 000A8DD4  98 A4 80 00 */	stb r5, -0x8000(r4)
/* 800ABE98 000A8DD8  90 C4 80 00 */	stw r6, -0x8000(r4)
/* 800ABE9C 000A8DDC  B0 03 00 02 */	sth r0, 2(r3)
/* 800ABEA0 000A8DE0  4E 80 00 20 */	blr 

.global GXSetTevColorS10
GXSetTevColorS10:
/* 800ABEA4 000A8DE4  A8 04 00 06 */	lha r0, 6(r4)
/* 800ABEA8 000A8DE8  54 69 08 3C */	slwi r9, r3, 1
/* 800ABEAC 000A8DEC  A8 A4 00 00 */	lha r5, 0(r4)
/* 800ABEB0 000A8DF0  39 09 00 E0 */	addi r8, r9, 0xe0
/* 800ABEB4 000A8DF4  54 0A 62 66 */	rlwinm r10, r0, 0xc, 9, 0x13
/* 800ABEB8 000A8DF8  50 AA 05 7E */	rlwimi r10, r5, 0, 0x15, 0x1f
/* 800ABEBC 000A8DFC  A8 E4 00 04 */	lha r7, 4(r4)
/* 800ABEC0 000A8E00  A8 C4 00 02 */	lha r6, 2(r4)
/* 800ABEC4 000A8E04  55 08 C0 0E */	slwi r8, r8, 0x18
/* 800ABEC8 000A8E08  38 A0 00 61 */	li r5, 0x61
/* 800ABECC 000A8E0C  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800ABED0 000A8E10  3C 80 CC 01 */	lis r4, 0xCC008000@ha
/* 800ABED4 000A8E14  98 A4 80 00 */	stb r5, 0xCC008000@l(r4)
/* 800ABED8 000A8E18  51 48 02 7E */	rlwimi r8, r10, 0, 9, 0x1f
/* 800ABEDC 000A8E1C  38 09 00 E1 */	addi r0, r9, 0xe1
/* 800ABEE0 000A8E20  91 04 80 00 */	stw r8, -0x8000(r4)
/* 800ABEE4 000A8E24  54 C8 62 66 */	rlwinm r8, r6, 0xc, 9, 0x13
/* 800ABEE8 000A8E28  54 06 C0 0E */	slwi r6, r0, 0x18
/* 800ABEEC 000A8E2C  50 E8 05 7E */	rlwimi r8, r7, 0, 0x15, 0x1f
/* 800ABEF0 000A8E30  98 A4 80 00 */	stb r5, -0x8000(r4)
/* 800ABEF4 000A8E34  51 06 02 7E */	rlwimi r6, r8, 0, 9, 0x1f
/* 800ABEF8 000A8E38  90 C4 80 00 */	stw r6, -0x8000(r4)
/* 800ABEFC 000A8E3C  38 00 00 00 */	li r0, 0
/* 800ABF00 000A8E40  98 A4 80 00 */	stb r5, -0x8000(r4)
/* 800ABF04 000A8E44  90 C4 80 00 */	stw r6, -0x8000(r4)
/* 800ABF08 000A8E48  98 A4 80 00 */	stb r5, -0x8000(r4)
/* 800ABF0C 000A8E4C  90 C4 80 00 */	stw r6, -0x8000(r4)
/* 800ABF10 000A8E50  B0 03 00 02 */	sth r0, 2(r3)
/* 800ABF14 000A8E54  4E 80 00 20 */	blr 

.global GXSetTevKColor
GXSetTevKColor:
/* 800ABF18 000A8E58  88 04 00 03 */	lbz r0, 3(r4)
/* 800ABF1C 000A8E5C  54 65 08 3C */	slwi r5, r3, 1
/* 800ABF20 000A8E60  88 C4 00 00 */	lbz r6, 0(r4)
/* 800ABF24 000A8E64  38 E5 00 E0 */	addi r7, r5, 0xe0
/* 800ABF28 000A8E68  54 00 60 26 */	slwi r0, r0, 0xc
/* 800ABF2C 000A8E6C  50 C0 06 3E */	rlwimi r0, r6, 0, 0x18, 0x1f
/* 800ABF30 000A8E70  88 C4 00 01 */	lbz r6, 1(r4)
/* 800ABF34 000A8E74  89 24 00 02 */	lbz r9, 2(r4)
/* 800ABF38 000A8E78  54 00 03 0E */	rlwinm r0, r0, 0, 0xc, 7
/* 800ABF3C 000A8E7C  64 08 00 80 */	oris r8, r0, 0x80
/* 800ABF40 000A8E80  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800ABF44 000A8E84  54 E7 C0 0E */	slwi r7, r7, 0x18
/* 800ABF48 000A8E88  38 00 00 61 */	li r0, 0x61
/* 800ABF4C 000A8E8C  3C 80 CC 01 */	lis r4, 0xCC008000@ha
/* 800ABF50 000A8E90  54 C6 60 26 */	slwi r6, r6, 0xc
/* 800ABF54 000A8E94  98 04 80 00 */	stb r0, 0xCC008000@l(r4)
/* 800ABF58 000A8E98  51 07 02 3E */	rlwimi r7, r8, 0, 8, 0x1f
/* 800ABF5C 000A8E9C  90 E4 80 00 */	stw r7, -0x8000(r4)
/* 800ABF60 000A8EA0  51 26 06 3E */	rlwimi r6, r9, 0, 0x18, 0x1f
/* 800ABF64 000A8EA4  38 A5 00 E1 */	addi r5, r5, 0xe1
/* 800ABF68 000A8EA8  98 04 80 00 */	stb r0, -0x8000(r4)
/* 800ABF6C 000A8EAC  54 C0 03 0E */	rlwinm r0, r6, 0, 0xc, 7
/* 800ABF70 000A8EB0  64 06 00 80 */	oris r6, r0, 0x80
/* 800ABF74 000A8EB4  54 A0 C0 0E */	slwi r0, r5, 0x18
/* 800ABF78 000A8EB8  50 C0 02 3E */	rlwimi r0, r6, 0, 8, 0x1f
/* 800ABF7C 000A8EBC  90 04 80 00 */	stw r0, -0x8000(r4)
/* 800ABF80 000A8EC0  38 00 00 00 */	li r0, 0
/* 800ABF84 000A8EC4  B0 03 00 02 */	sth r0, 2(r3)
/* 800ABF88 000A8EC8  4E 80 00 20 */	blr 

.global GXSetTevKColorSel
GXSetTevKColorSel:
/* 800ABF8C 000A8ECC  7C 65 0E 70 */	srawi r5, r3, 1
/* 800ABF90 000A8ED0  80 CD 82 C8 */	lwz r6, gx@sda21(r13)
/* 800ABF94 000A8ED4  54 60 07 FF */	clrlwi. r0, r3, 0x1f
/* 800ABF98 000A8ED8  54 A3 10 3A */	slwi r3, r5, 2
/* 800ABF9C 000A8EDC  38 E3 01 B0 */	addi r7, r3, 0x1b0
/* 800ABFA0 000A8EE0  7C E6 3A 14 */	add r7, r6, r7
/* 800ABFA4 000A8EE4  41 82 00 1C */	beq lbl_800ABFC0
/* 800ABFA8 000A8EE8  80 67 00 00 */	lwz r3, 0(r7)
/* 800ABFAC 000A8EEC  54 80 70 22 */	slwi r0, r4, 0xe
/* 800ABFB0 000A8EF0  54 63 04 98 */	rlwinm r3, r3, 0, 0x12, 0xc
/* 800ABFB4 000A8EF4  7C 60 03 78 */	or r0, r3, r0
/* 800ABFB8 000A8EF8  90 07 00 00 */	stw r0, 0(r7)
/* 800ABFBC 000A8EFC  48 00 00 18 */	b lbl_800ABFD4
lbl_800ABFC0:
/* 800ABFC0 000A8F00  80 67 00 00 */	lwz r3, 0(r7)
/* 800ABFC4 000A8F04  54 80 20 36 */	slwi r0, r4, 4
/* 800ABFC8 000A8F08  54 63 07 2C */	rlwinm r3, r3, 0, 0x1c, 0x16
/* 800ABFCC 000A8F0C  7C 60 03 78 */	or r0, r3, r0
/* 800ABFD0 000A8F10  90 07 00 00 */	stw r0, 0(r7)
lbl_800ABFD4:
/* 800ABFD4 000A8F14  38 00 00 61 */	li r0, 0x61
/* 800ABFD8 000A8F18  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800ABFDC 000A8F1C  3C A0 CC 01 */	lis r5, 0xCC008000@ha
/* 800ABFE0 000A8F20  98 05 80 00 */	stb r0, 0xCC008000@l(r5)
/* 800ABFE4 000A8F24  38 00 00 00 */	li r0, 0
/* 800ABFE8 000A8F28  80 87 00 00 */	lwz r4, 0(r7)
/* 800ABFEC 000A8F2C  90 85 80 00 */	stw r4, -0x8000(r5)
/* 800ABFF0 000A8F30  B0 03 00 02 */	sth r0, 2(r3)
/* 800ABFF4 000A8F34  4E 80 00 20 */	blr 

.global GXSetTevKAlphaSel
GXSetTevKAlphaSel:
/* 800ABFF8 000A8F38  7C 65 0E 70 */	srawi r5, r3, 1
/* 800ABFFC 000A8F3C  80 CD 82 C8 */	lwz r6, gx@sda21(r13)
/* 800AC000 000A8F40  54 60 07 FF */	clrlwi. r0, r3, 0x1f
/* 800AC004 000A8F44  54 A3 10 3A */	slwi r3, r5, 2
/* 800AC008 000A8F48  38 E3 01 B0 */	addi r7, r3, 0x1b0
/* 800AC00C 000A8F4C  7C E6 3A 14 */	add r7, r6, r7
/* 800AC010 000A8F50  41 82 00 1C */	beq lbl_800AC02C
/* 800AC014 000A8F54  80 67 00 00 */	lwz r3, 0(r7)
/* 800AC018 000A8F58  54 80 98 18 */	slwi r0, r4, 0x13
/* 800AC01C 000A8F5C  54 63 03 4E */	rlwinm r3, r3, 0, 0xd, 7
/* 800AC020 000A8F60  7C 60 03 78 */	or r0, r3, r0
/* 800AC024 000A8F64  90 07 00 00 */	stw r0, 0(r7)
/* 800AC028 000A8F68  48 00 00 18 */	b lbl_800AC040
lbl_800AC02C:
/* 800AC02C 000A8F6C  80 67 00 00 */	lwz r3, 0(r7)
/* 800AC030 000A8F70  54 80 48 2C */	slwi r0, r4, 9
/* 800AC034 000A8F74  54 63 05 E2 */	rlwinm r3, r3, 0, 0x17, 0x11
/* 800AC038 000A8F78  7C 60 03 78 */	or r0, r3, r0
/* 800AC03C 000A8F7C  90 07 00 00 */	stw r0, 0(r7)
lbl_800AC040:
/* 800AC040 000A8F80  38 00 00 61 */	li r0, 0x61
/* 800AC044 000A8F84  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800AC048 000A8F88  3C A0 CC 01 */	lis r5, 0xCC008000@ha
/* 800AC04C 000A8F8C  98 05 80 00 */	stb r0, 0xCC008000@l(r5)
/* 800AC050 000A8F90  38 00 00 00 */	li r0, 0
/* 800AC054 000A8F94  80 87 00 00 */	lwz r4, 0(r7)
/* 800AC058 000A8F98  90 85 80 00 */	stw r4, -0x8000(r5)
/* 800AC05C 000A8F9C  B0 03 00 02 */	sth r0, 2(r3)
/* 800AC060 000A8FA0  4E 80 00 20 */	blr 

.global GXSetTevSwapMode
GXSetTevSwapMode:
/* 800AC064 000A8FA4  54 63 10 3A */	slwi r3, r3, 2
/* 800AC068 000A8FA8  80 0D 82 C8 */	lwz r0, gx@sda21(r13)
/* 800AC06C 000A8FAC  38 E3 01 70 */	addi r7, r3, 0x170
/* 800AC070 000A8FB0  7C E0 3A 14 */	add r7, r0, r7
/* 800AC074 000A8FB4  80 07 00 00 */	lwz r0, 0(r7)
/* 800AC078 000A8FB8  54 A6 10 3A */	slwi r6, r5, 2
/* 800AC07C 000A8FBC  38 60 00 61 */	li r3, 0x61
/* 800AC080 000A8FC0  54 00 00 3A */	rlwinm r0, r0, 0, 0, 0x1d
/* 800AC084 000A8FC4  7C 00 23 78 */	or r0, r0, r4
/* 800AC088 000A8FC8  90 07 00 00 */	stw r0, 0(r7)
/* 800AC08C 000A8FCC  3C A0 CC 01 */	lis r5, 0xCC008000@ha
/* 800AC090 000A8FD0  38 00 00 00 */	li r0, 0
/* 800AC094 000A8FD4  80 87 00 00 */	lwz r4, 0(r7)
/* 800AC098 000A8FD8  54 84 07 B6 */	rlwinm r4, r4, 0, 0x1e, 0x1b
/* 800AC09C 000A8FDC  7C 84 33 78 */	or r4, r4, r6
/* 800AC0A0 000A8FE0  90 87 00 00 */	stw r4, 0(r7)
/* 800AC0A4 000A8FE4  98 65 80 00 */	stb r3, 0xCC008000@l(r5)
/* 800AC0A8 000A8FE8  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800AC0AC 000A8FEC  80 87 00 00 */	lwz r4, 0(r7)
/* 800AC0B0 000A8FF0  90 85 80 00 */	stw r4, -0x8000(r5)
/* 800AC0B4 000A8FF4  B0 03 00 02 */	sth r0, 2(r3)
/* 800AC0B8 000A8FF8  4E 80 00 20 */	blr 

.global GXSetTevSwapModeTable
GXSetTevSwapModeTable:
/* 800AC0BC 000A8FFC  54 69 08 3C */	slwi r9, r3, 1
/* 800AC0C0 000A9000  80 0D 82 C8 */	lwz r0, gx@sda21(r13)
/* 800AC0C4 000A9004  54 63 18 38 */	slwi r3, r3, 3
/* 800AC0C8 000A9008  39 63 01 B0 */	addi r11, r3, 0x1b0
/* 800AC0CC 000A900C  7D 60 5A 14 */	add r11, r0, r11
/* 800AC0D0 000A9010  81 0B 00 00 */	lwz r8, 0(r11)
/* 800AC0D4 000A9014  38 09 00 01 */	addi r0, r9, 1
/* 800AC0D8 000A9018  54 03 10 3A */	slwi r3, r0, 2
/* 800AC0DC 000A901C  55 00 00 3A */	rlwinm r0, r8, 0, 0, 0x1d
/* 800AC0E0 000A9020  7C 00 23 78 */	or r0, r0, r4
/* 800AC0E4 000A9024  90 0B 00 00 */	stw r0, 0(r11)
/* 800AC0E8 000A9028  54 A0 10 3A */	slwi r0, r5, 2
/* 800AC0EC 000A902C  39 20 00 61 */	li r9, 0x61
/* 800AC0F0 000A9030  80 8B 00 00 */	lwz r4, 0(r11)
/* 800AC0F4 000A9034  3D 00 CC 01 */	lis r8, 0xCC008000@ha
/* 800AC0F8 000A9038  39 43 01 B0 */	addi r10, r3, 0x1b0
/* 800AC0FC 000A903C  54 83 07 B6 */	rlwinm r3, r4, 0, 0x1e, 0x1b
/* 800AC100 000A9040  7C 60 03 78 */	or r0, r3, r0
/* 800AC104 000A9044  90 0B 00 00 */	stw r0, 0(r11)
/* 800AC108 000A9048  54 E3 10 3A */	slwi r3, r7, 2
/* 800AC10C 000A904C  38 00 00 00 */	li r0, 0
/* 800AC110 000A9050  99 28 80 00 */	stb r9, 0xCC008000@l(r8)
/* 800AC114 000A9054  80 8D 82 C8 */	lwz r4, gx@sda21(r13)
/* 800AC118 000A9058  80 AB 00 00 */	lwz r5, 0(r11)
/* 800AC11C 000A905C  7D 44 52 14 */	add r10, r4, r10
/* 800AC120 000A9060  90 A8 80 00 */	stw r5, -0x8000(r8)
/* 800AC124 000A9064  80 8A 00 00 */	lwz r4, 0(r10)
/* 800AC128 000A9068  54 84 00 3A */	rlwinm r4, r4, 0, 0, 0x1d
/* 800AC12C 000A906C  7C 84 33 78 */	or r4, r4, r6
/* 800AC130 000A9070  90 8A 00 00 */	stw r4, 0(r10)
/* 800AC134 000A9074  80 8A 00 00 */	lwz r4, 0(r10)
/* 800AC138 000A9078  54 84 07 B6 */	rlwinm r4, r4, 0, 0x1e, 0x1b
/* 800AC13C 000A907C  7C 83 1B 78 */	or r3, r4, r3
/* 800AC140 000A9080  90 6A 00 00 */	stw r3, 0(r10)
/* 800AC144 000A9084  99 28 80 00 */	stb r9, -0x8000(r8)
/* 800AC148 000A9088  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800AC14C 000A908C  80 8A 00 00 */	lwz r4, 0(r10)
/* 800AC150 000A9090  90 88 80 00 */	stw r4, -0x8000(r8)
/* 800AC154 000A9094  B0 03 00 02 */	sth r0, 2(r3)
/* 800AC158 000A9098  4E 80 00 20 */	blr 

.global GXSetAlphaCompare
GXSetAlphaCompare:
/* 800AC15C 000A909C  54 E7 44 2E */	rlwinm r7, r7, 8, 0x10, 0x17
/* 800AC160 000A90A0  81 0D 82 C8 */	lwz r8, gx@sda21(r13)
/* 800AC164 000A90A4  50 87 06 3E */	rlwimi r7, r4, 0, 0x18, 0x1f
/* 800AC168 000A90A8  54 60 80 1E */	slwi r0, r3, 0x10
/* 800AC16C 000A90AC  50 E0 04 3E */	rlwimi r0, r7, 0, 0x10, 0x1f
/* 800AC170 000A90B0  54 03 03 52 */	rlwinm r3, r0, 0, 0xd, 9
/* 800AC174 000A90B4  54 C0 98 18 */	slwi r0, r6, 0x13
/* 800AC178 000A90B8  7C 60 03 78 */	or r0, r3, r0
/* 800AC17C 000A90BC  54 03 02 8E */	rlwinm r3, r0, 0, 0xa, 7
/* 800AC180 000A90C0  54 A0 B0 12 */	slwi r0, r5, 0x16
/* 800AC184 000A90C4  7C 60 03 78 */	or r0, r3, r0
/* 800AC188 000A90C8  54 04 02 3E */	clrlwi r4, r0, 8
/* 800AC18C 000A90CC  38 00 00 61 */	li r0, 0x61
/* 800AC190 000A90D0  3C 60 CC 01 */	lis r3, 0xCC008000@ha
/* 800AC194 000A90D4  98 03 80 00 */	stb r0, 0xCC008000@l(r3)
/* 800AC198 000A90D8  64 84 F3 00 */	oris r4, r4, 0xf300
/* 800AC19C 000A90DC  38 00 00 00 */	li r0, 0
/* 800AC1A0 000A90E0  90 83 80 00 */	stw r4, -0x8000(r3)
/* 800AC1A4 000A90E4  B0 08 00 02 */	sth r0, 2(r8)
/* 800AC1A8 000A90E8  4E 80 00 20 */	blr 

.global GXSetZTexture
GXSetZTexture:
/* 800AC1AC 000A90EC  2C 04 00 13 */	cmpwi r4, 0x13
/* 800AC1B0 000A90F0  54 A0 02 3E */	clrlwi r0, r5, 8
/* 800AC1B4 000A90F4  64 07 F4 00 */	oris r7, r0, 0xf400
/* 800AC1B8 000A90F8  41 82 00 28 */	beq lbl_800AC1E0
/* 800AC1BC 000A90FC  40 80 00 10 */	bge lbl_800AC1CC
/* 800AC1C0 000A9100  2C 04 00 11 */	cmpwi r4, 0x11
/* 800AC1C4 000A9104  41 82 00 14 */	beq lbl_800AC1D8
/* 800AC1C8 000A9108  48 00 00 28 */	b lbl_800AC1F0
lbl_800AC1CC:
/* 800AC1CC 000A910C  2C 04 00 16 */	cmpwi r4, 0x16
/* 800AC1D0 000A9110  41 82 00 18 */	beq lbl_800AC1E8
/* 800AC1D4 000A9114  48 00 00 1C */	b lbl_800AC1F0
lbl_800AC1D8:
/* 800AC1D8 000A9118  38 C0 00 00 */	li r6, 0
/* 800AC1DC 000A911C  48 00 00 18 */	b lbl_800AC1F4
lbl_800AC1E0:
/* 800AC1E0 000A9120  38 C0 00 01 */	li r6, 1
/* 800AC1E4 000A9124  48 00 00 10 */	b lbl_800AC1F4
lbl_800AC1E8:
/* 800AC1E8 000A9128  38 C0 00 02 */	li r6, 2
/* 800AC1EC 000A912C  48 00 00 08 */	b lbl_800AC1F4
lbl_800AC1F0:
/* 800AC1F0 000A9130  38 C0 00 02 */	li r6, 2
lbl_800AC1F4:
/* 800AC1F4 000A9134  38 00 00 61 */	li r0, 0x61
/* 800AC1F8 000A9138  80 8D 82 C8 */	lwz r4, gx@sda21(r13)
/* 800AC1FC 000A913C  3C A0 CC 01 */	lis r5, 0xCC008000@ha
/* 800AC200 000A9140  98 05 80 00 */	stb r0, 0xCC008000@l(r5)
/* 800AC204 000A9144  54 C6 07 B6 */	rlwinm r6, r6, 0, 0x1e, 0x1b
/* 800AC208 000A9148  54 63 10 3A */	slwi r3, r3, 2
/* 800AC20C 000A914C  90 E5 80 00 */	stw r7, -0x8000(r5)
/* 800AC210 000A9150  7C C3 1B 78 */	or r3, r6, r3
/* 800AC214 000A9154  54 63 02 3E */	clrlwi r3, r3, 8
/* 800AC218 000A9158  98 05 80 00 */	stb r0, -0x8000(r5)
/* 800AC21C 000A915C  64 63 F5 00 */	oris r3, r3, 0xf500
/* 800AC220 000A9160  38 00 00 00 */	li r0, 0
/* 800AC224 000A9164  90 65 80 00 */	stw r3, -0x8000(r5)
/* 800AC228 000A9168  B0 04 00 02 */	sth r0, 2(r4)
/* 800AC22C 000A916C  4E 80 00 20 */	blr 

.global GXSetTevOrder
GXSetTevOrder:
/* 800AC230 000A9170  7C 67 0E 70 */	srawi r7, r3, 1
/* 800AC234 000A9174  81 2D 82 C8 */	lwz r9, gx@sda21(r13)
/* 800AC238 000A9178  54 AA 06 2C */	rlwinm r10, r5, 0, 0x18, 0x16
/* 800AC23C 000A917C  7C E7 01 94 */	addze r7, r7
/* 800AC240 000A9180  54 60 10 3A */	slwi r0, r3, 2
/* 800AC244 000A9184  7D 09 02 14 */	add r8, r9, r0
/* 800AC248 000A9188  54 E7 10 3A */	slwi r7, r7, 2
/* 800AC24C 000A918C  90 A8 04 9C */	stw r5, 0x49c(r8)
/* 800AC250 000A9190  38 E7 01 00 */	addi r7, r7, 0x100
/* 800AC254 000A9194  28 0A 00 08 */	cmplwi r10, 8
/* 800AC258 000A9198  38 0A 00 00 */	addi r0, r10, 0
/* 800AC25C 000A919C  7C E9 3A 14 */	add r7, r9, r7
/* 800AC260 000A91A0  41 80 00 0C */	blt lbl_800AC26C
/* 800AC264 000A91A4  39 20 00 00 */	li r9, 0
/* 800AC268 000A91A8  48 00 00 08 */	b lbl_800AC270
lbl_800AC26C:
/* 800AC26C 000A91AC  7C 09 03 78 */	mr r9, r0
lbl_800AC270:
/* 800AC270 000A91B0  2C 04 00 08 */	cmpwi r4, 8
/* 800AC274 000A91B4  41 80 00 28 */	blt lbl_800AC29C
/* 800AC278 000A91B8  80 8D 82 C8 */	lwz r4, gx@sda21(r13)
/* 800AC27C 000A91BC  38 00 00 01 */	li r0, 1
/* 800AC280 000A91C0  7C 00 18 30 */	slw r0, r0, r3
/* 800AC284 000A91C4  81 04 04 E0 */	lwz r8, 0x4e0(r4)
/* 800AC288 000A91C8  39 44 04 E0 */	addi r10, r4, 0x4e0
/* 800AC28C 000A91CC  38 80 00 00 */	li r4, 0
/* 800AC290 000A91D0  7D 00 00 78 */	andc r0, r8, r0
/* 800AC294 000A91D4  90 0A 00 00 */	stw r0, 0(r10)
/* 800AC298 000A91D8  48 00 00 20 */	b lbl_800AC2B8
lbl_800AC29C:
/* 800AC29C 000A91DC  81 0D 82 C8 */	lwz r8, gx@sda21(r13)
/* 800AC2A0 000A91E0  38 00 00 01 */	li r0, 1
/* 800AC2A4 000A91E4  7C 00 18 30 */	slw r0, r0, r3
/* 800AC2A8 000A91E8  39 48 04 E0 */	addi r10, r8, 0x4e0
/* 800AC2AC 000A91EC  81 08 04 E0 */	lwz r8, 0x4e0(r8)
/* 800AC2B0 000A91F0  7D 00 03 78 */	or r0, r8, r0
/* 800AC2B4 000A91F4  90 0A 00 00 */	stw r0, 0(r10)
lbl_800AC2B8:
/* 800AC2B8 000A91F8  54 60 07 FF */	clrlwi. r0, r3, 0x1f
/* 800AC2BC 000A91FC  41 82 00 94 */	beq lbl_800AC350
/* 800AC2C0 000A9200  81 07 00 00 */	lwz r8, 0(r7)
/* 800AC2C4 000A9204  55 23 60 26 */	slwi r3, r9, 0xc
/* 800AC2C8 000A9208  54 80 78 20 */	slwi r0, r4, 0xf
/* 800AC2CC 000A920C  55 04 05 20 */	rlwinm r4, r8, 0, 0x14, 0x10
/* 800AC2D0 000A9210  7C 83 1B 78 */	or r3, r4, r3
/* 800AC2D4 000A9214  90 67 00 00 */	stw r3, 0(r7)
/* 800AC2D8 000A9218  2C 06 00 FF */	cmpwi r6, 0xff
/* 800AC2DC 000A921C  80 67 00 00 */	lwz r3, 0(r7)
/* 800AC2E0 000A9220  54 63 04 5A */	rlwinm r3, r3, 0, 0x11, 0xd
/* 800AC2E4 000A9224  7C 60 03 78 */	or r0, r3, r0
/* 800AC2E8 000A9228  90 07 00 00 */	stw r0, 0(r7)
/* 800AC2EC 000A922C  40 82 00 0C */	bne lbl_800AC2F8
/* 800AC2F0 000A9230  38 00 00 07 */	li r0, 7
/* 800AC2F4 000A9234  48 00 00 18 */	b lbl_800AC30C
lbl_800AC2F8:
/* 800AC2F8 000A9238  3C 60 80 3B */	lis r3, c2r$71@ha
/* 800AC2FC 000A923C  54 C4 10 3A */	slwi r4, r6, 2
/* 800AC300 000A9240  38 03 1B 10 */	addi r0, r3, c2r$71@l
/* 800AC304 000A9244  7C 60 22 14 */	add r3, r0, r4
/* 800AC308 000A9248  80 03 00 00 */	lwz r0, 0(r3)
lbl_800AC30C:
/* 800AC30C 000A924C  80 67 00 00 */	lwz r3, 0(r7)
/* 800AC310 000A9250  54 00 98 18 */	slwi r0, r0, 0x13
/* 800AC314 000A9254  2C 05 00 FF */	cmpwi r5, 0xff
/* 800AC318 000A9258  54 63 03 52 */	rlwinm r3, r3, 0, 0xd, 9
/* 800AC31C 000A925C  7C 60 03 78 */	or r0, r3, r0
/* 800AC320 000A9260  90 07 00 00 */	stw r0, 0(r7)
/* 800AC324 000A9264  38 80 00 00 */	li r4, 0
/* 800AC328 000A9268  41 82 00 10 */	beq lbl_800AC338
/* 800AC32C 000A926C  54 A0 05 EF */	rlwinm. r0, r5, 0, 0x17, 0x17
/* 800AC330 000A9270  40 82 00 08 */	bne lbl_800AC338
/* 800AC334 000A9274  38 80 00 01 */	li r4, 1
lbl_800AC338:
/* 800AC338 000A9278  80 67 00 00 */	lwz r3, 0(r7)
/* 800AC33C 000A927C  54 80 90 1A */	slwi r0, r4, 0x12
/* 800AC340 000A9280  54 63 03 98 */	rlwinm r3, r3, 0, 0xe, 0xc
/* 800AC344 000A9284  7C 60 03 78 */	or r0, r3, r0
/* 800AC348 000A9288  90 07 00 00 */	stw r0, 0(r7)
/* 800AC34C 000A928C  48 00 00 8C */	b lbl_800AC3D8
lbl_800AC350:
/* 800AC350 000A9290  80 67 00 00 */	lwz r3, 0(r7)
/* 800AC354 000A9294  54 80 18 38 */	slwi r0, r4, 3
/* 800AC358 000A9298  2C 06 00 FF */	cmpwi r6, 0xff
/* 800AC35C 000A929C  54 63 00 38 */	rlwinm r3, r3, 0, 0, 0x1c
/* 800AC360 000A92A0  7C 63 4B 78 */	or r3, r3, r9
/* 800AC364 000A92A4  90 67 00 00 */	stw r3, 0(r7)
/* 800AC368 000A92A8  80 67 00 00 */	lwz r3, 0(r7)
/* 800AC36C 000A92AC  54 63 07 72 */	rlwinm r3, r3, 0, 0x1d, 0x19
/* 800AC370 000A92B0  7C 60 03 78 */	or r0, r3, r0
/* 800AC374 000A92B4  90 07 00 00 */	stw r0, 0(r7)
/* 800AC378 000A92B8  40 82 00 0C */	bne lbl_800AC384
/* 800AC37C 000A92BC  38 00 00 07 */	li r0, 7
/* 800AC380 000A92C0  48 00 00 18 */	b lbl_800AC398
lbl_800AC384:
/* 800AC384 000A92C4  3C 60 80 3B */	lis r3, c2r$71@ha
/* 800AC388 000A92C8  54 C4 10 3A */	slwi r4, r6, 2
/* 800AC38C 000A92CC  38 03 1B 10 */	addi r0, r3, c2r$71@l
/* 800AC390 000A92D0  7C 60 22 14 */	add r3, r0, r4
/* 800AC394 000A92D4  80 03 00 00 */	lwz r0, 0(r3)
lbl_800AC398:
/* 800AC398 000A92D8  80 67 00 00 */	lwz r3, 0(r7)
/* 800AC39C 000A92DC  54 00 38 30 */	slwi r0, r0, 7
/* 800AC3A0 000A92E0  2C 05 00 FF */	cmpwi r5, 0xff
/* 800AC3A4 000A92E4  54 63 06 6A */	rlwinm r3, r3, 0, 0x19, 0x15
/* 800AC3A8 000A92E8  7C 60 03 78 */	or r0, r3, r0
/* 800AC3AC 000A92EC  90 07 00 00 */	stw r0, 0(r7)
/* 800AC3B0 000A92F0  38 80 00 00 */	li r4, 0
/* 800AC3B4 000A92F4  41 82 00 10 */	beq lbl_800AC3C4
/* 800AC3B8 000A92F8  54 A0 05 EF */	rlwinm. r0, r5, 0, 0x17, 0x17
/* 800AC3BC 000A92FC  40 82 00 08 */	bne lbl_800AC3C4
/* 800AC3C0 000A9300  38 80 00 01 */	li r4, 1
lbl_800AC3C4:
/* 800AC3C4 000A9304  80 67 00 00 */	lwz r3, 0(r7)
/* 800AC3C8 000A9308  54 80 30 32 */	slwi r0, r4, 6
/* 800AC3CC 000A930C  54 63 06 B0 */	rlwinm r3, r3, 0, 0x1a, 0x18
/* 800AC3D0 000A9310  7C 60 03 78 */	or r0, r3, r0
/* 800AC3D4 000A9314  90 07 00 00 */	stw r0, 0(r7)
lbl_800AC3D8:
/* 800AC3D8 000A9318  38 00 00 61 */	li r0, 0x61
/* 800AC3DC 000A931C  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800AC3E0 000A9320  3C A0 CC 01 */	lis r5, 0xCC008000@ha
/* 800AC3E4 000A9324  98 05 80 00 */	stb r0, 0xCC008000@l(r5)
/* 800AC3E8 000A9328  38 00 00 00 */	li r0, 0
/* 800AC3EC 000A932C  80 87 00 00 */	lwz r4, 0(r7)
/* 800AC3F0 000A9330  90 85 80 00 */	stw r4, -0x8000(r5)
/* 800AC3F4 000A9334  B0 03 00 02 */	sth r0, 2(r3)
/* 800AC3F8 000A9338  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800AC3FC 000A933C  80 03 04 F4 */	lwz r0, 0x4f4(r3)
/* 800AC400 000A9340  60 00 00 01 */	ori r0, r0, 1
/* 800AC404 000A9344  90 03 04 F4 */	stw r0, 0x4f4(r3)
/* 800AC408 000A9348  4E 80 00 20 */	blr 

.global GXSetNumTevStages
GXSetNumTevStages:
/* 800AC40C 000A934C  54 63 06 3E */	clrlwi r3, r3, 0x18
/* 800AC410 000A9350  80 8D 82 C8 */	lwz r4, gx@sda21(r13)
/* 800AC414 000A9354  38 03 FF FF */	addi r0, r3, -1
/* 800AC418 000A9358  84 64 02 04 */	lwzu r3, 0x204(r4)
/* 800AC41C 000A935C  54 00 50 2A */	slwi r0, r0, 0xa
/* 800AC420 000A9360  54 63 05 A2 */	rlwinm r3, r3, 0, 0x16, 0x11
/* 800AC424 000A9364  7C 60 03 78 */	or r0, r3, r0
/* 800AC428 000A9368  90 04 00 00 */	stw r0, 0(r4)
/* 800AC42C 000A936C  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800AC430 000A9370  80 03 04 F4 */	lwz r0, 0x4f4(r3)
/* 800AC434 000A9374  60 00 00 04 */	ori r0, r0, 4
/* 800AC438 000A9378  90 03 04 F4 */	stw r0, 0x4f4(r3)
/* 800AC43C 000A937C  4E 80 00 20 */	blr 

.section .data, "wa"  # 0x803A8380 - 0x803E6000
    .balign 8
c2r$71:
	.4byte 0
	.4byte 0x00000001
	.4byte 0
	.4byte 0x00000001
	.4byte 0
	.4byte 0x00000001
	.4byte 0x00000007
	.4byte 0x00000005
	.4byte 0x00000006
	.4byte 0