diff --git a/asm/sysdolphin/baselib/tev.s b/asm/sysdolphin/baselib/tev.s deleted file mode 100644 index 6a73eef700..0000000000 --- a/asm/sysdolphin/baselib/tev.s +++ /dev/null @@ -1,1311 +0,0 @@ -.include "macros.inc" -.file "tev.c" - -# 0x00000000 - 0x00000D0C -.text -.balign 4 - -.fn HSD_RenderInitAllocData, global -/* 00000000 00000040 7C 08 02 A6 */ mflr r0 -/* 00000004 00000044 3C 60 00 00 */ lis r3, render_alloc_data@ha -/* 00000008 00000048 90 01 00 04 */ stw r0, 0x4(r1) -/* 0000000C 0000004C 38 80 00 1C */ li r4, 0x1c -/* 00000010 00000050 38 A0 00 04 */ li r5, 0x4 -/* 00000014 00000054 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 00000018 00000058 93 E1 00 0C */ stw r31, 0xc(r1) -/* 0000001C 0000005C 3B E3 00 00 */ addi r31, r3, render_alloc_data@l -/* 00000020 00000060 38 7F 00 00 */ addi r3, r31, 0x0 -/* 00000024 00000064 48 00 00 01 */ bl HSD_ObjAllocInit -/* 00000028 00000068 38 7F 00 2C */ addi r3, r31, 0x2c -/* 0000002C 0000006C 38 80 00 14 */ li r4, 0x14 -/* 00000030 00000070 38 A0 00 04 */ li r5, 0x4 -/* 00000034 00000074 48 00 00 01 */ bl HSD_ObjAllocInit -/* 00000038 00000078 38 7F 00 58 */ addi r3, r31, 0x58 -/* 0000003C 0000007C 38 80 00 30 */ li r4, 0x30 -/* 00000040 00000080 38 A0 00 04 */ li r5, 0x4 -/* 00000044 00000084 48 00 00 01 */ bl HSD_ObjAllocInit -/* 00000048 00000088 80 01 00 14 */ lwz r0, 0x14(r1) -/* 0000004C 0000008C 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 00000050 00000090 38 21 00 10 */ addi r1, r1, 0x10 -/* 00000054 00000094 7C 08 03 A6 */ mtlr r0 -/* 00000058 00000098 4E 80 00 20 */ blr -.endfn HSD_RenderInitAllocData - -.fn HSD_RenderGetAllocData, global -/* 0000005C 0000009C 3C 60 00 00 */ lis r3, render_alloc_data@ha -/* 00000060 000000A0 38 63 00 00 */ addi r3, r3, render_alloc_data@l -/* 00000064 000000A4 4E 80 00 20 */ blr -.endfn HSD_RenderGetAllocData - -.fn HSD_TevRegGetAllocData, global -/* 00000068 000000A8 3C 60 00 00 */ lis r3, tevreg_alloc_data@ha -/* 0000006C 000000AC 38 63 00 00 */ addi r3, r3, tevreg_alloc_data@l -/* 00000070 000000B0 4E 80 00 20 */ blr -.endfn HSD_TevRegGetAllocData - -.fn HSD_ChanGetAllocData, global -/* 00000074 000000B4 3C 60 00 00 */ lis r3, chan_alloc_data@ha -/* 00000078 000000B8 38 63 00 00 */ addi r3, r3, chan_alloc_data@l -/* 0000007C 000000BC 4E 80 00 20 */ blr -.endfn HSD_ChanGetAllocData - -.fn HSD_SetupChannel, global -/* 00000080 000000C0 7C 08 02 A6 */ mflr r0 -/* 00000084 000000C4 90 01 00 04 */ stw r0, 0x4(r1) -/* 00000088 000000C8 94 21 FF A0 */ stwu r1, -0x60(r1) -/* 0000008C 000000CC BF 61 00 4C */ stmw r27, 0x4c(r1) -/* 00000090 000000D0 7C 7B 1B 79 */ mr. r27, r3 -/* 00000094 000000D4 3C 60 00 00 */ lis r3, TevReg@ha -/* 00000098 000000D8 3B E3 00 00 */ addi r31, r3, TevReg@l -/* 0000009C 000000DC 41 82 02 FC */ beq .L_00000398 -/* 000000A0 000000E0 80 7B 00 04 */ lwz r3, 0x4(r27) -/* 000000A4 000000E4 2C 03 00 FF */ cmpwi r3, 0xff -/* 000000A8 000000E8 40 82 00 08 */ bne .L_000000B0 -/* 000000AC 000000EC 48 00 02 EC */ b .L_00000398 -.L_000000B0: -/* 000000B0 000000F0 88 1B 00 14 */ lbz r0, 0x14(r27) -/* 000000B4 000000F4 3B 83 00 00 */ addi r28, r3, 0x0 -/* 000000B8 000000F8 54 7D 07 BE */ clrlwi r29, r3, 30 -/* 000000BC 000000FC 28 00 00 00 */ cmplwi r0, 0x0 -/* 000000C0 00000100 54 7E 07 FE */ clrlwi r30, r3, 31 -/* 000000C4 00000104 41 82 00 F0 */ beq .L_000001B4 -/* 000000C8 00000108 80 1B 00 18 */ lwz r0, 0x18(r27) -/* 000000CC 0000010C 2C 00 00 00 */ cmpwi r0, 0x0 -/* 000000D0 00000110 40 82 00 E4 */ bne .L_000001B4 -/* 000000D4 00000114 57 C0 10 3A */ slwi r0, r30, 2 -/* 000000D8 00000118 38 60 00 00 */ li r3, prev_amb_invalid@sda21 -/* 000000DC 0000011C 7C 63 02 14 */ add r3, r3, r0 -/* 000000E0 00000120 80 03 00 00 */ lwz r0, 0x0(r3) -/* 000000E4 00000124 2C 00 00 00 */ cmpwi r0, 0x0 -/* 000000E8 00000128 41 82 00 34 */ beq .L_0000011C -/* 000000EC 0000012C 38 00 00 00 */ li r0, 0x0 -/* 000000F0 00000130 90 03 00 00 */ stw r0, 0x0(r3) -/* 000000F4 00000134 38 81 00 40 */ addi r4, r1, 0x40 -/* 000000F8 00000138 38 7E 00 04 */ addi r3, r30, 0x4 -/* 000000FC 0000013C 80 1B 00 0C */ lwz r0, 0xc(r27) -/* 00000100 00000140 90 01 00 40 */ stw r0, 0x40(r1) -/* 00000104 00000144 48 00 00 01 */ bl GXSetChanAmbColor -/* 00000108 00000148 1C 7E 00 30 */ mulli r3, r30, 0x30 -/* 0000010C 0000014C 80 1B 00 0C */ lwz r0, 0xc(r27) -/* 00000110 00000150 7C 7F 1A 14 */ add r3, r31, r3 -/* 00000114 00000154 90 03 00 3C */ stw r0, 0x3c(r3) -/* 00000118 00000158 48 00 00 9C */ b .L_000001B4 -.L_0000011C: -/* 0000011C 0000015C 38 1C FF FC */ subi r0, r28, 0x4 -/* 00000120 00000160 28 00 00 01 */ cmplwi r0, 0x1 -/* 00000124 00000164 41 81 00 24 */ bgt .L_00000148 -/* 00000128 00000168 1C 1E 00 30 */ mulli r0, r30, 0x30 -/* 0000012C 0000016C 80 9B 00 0C */ lwz r4, 0xc(r27) -/* 00000130 00000170 7C 7F 02 14 */ add r3, r31, r0 -/* 00000134 00000174 80 03 00 3C */ lwz r0, 0x3c(r3) -/* 00000138 00000178 7C 04 00 40 */ cmplw r4, r0 -/* 0000013C 0000017C 41 82 00 78 */ beq .L_000001B4 -/* 00000140 00000180 90 83 00 3C */ stw r4, 0x3c(r3) -/* 00000144 00000184 48 00 00 5C */ b .L_000001A0 -.L_00000148: -/* 00000148 00000188 28 1C 00 01 */ cmplwi r28, 0x1 -/* 0000014C 0000018C 41 81 00 34 */ bgt .L_00000180 -/* 00000150 00000190 1C 1E 00 30 */ mulli r0, r30, 0x30 -/* 00000154 00000194 80 BB 00 0C */ lwz r5, 0xc(r27) -/* 00000158 00000198 7C 7F 02 14 */ add r3, r31, r0 -/* 0000015C 0000019C 38 83 00 3C */ addi r4, r3, 0x3c -/* 00000160 000001A0 80 63 00 3C */ lwz r3, 0x3c(r3) -/* 00000164 000001A4 7C A0 1A 78 */ xor r0, r5, r3 -/* 00000168 000001A8 54 00 00 2F */ clrrwi. r0, r0, 8 -/* 0000016C 000001AC 41 82 00 48 */ beq .L_000001B4 -/* 00000170 000001B0 54 A0 00 2E */ clrrwi r0, r5, 8 -/* 00000174 000001B4 50 60 06 3E */ rlwimi r0, r3, 0, 24, 31 -/* 00000178 000001B8 90 04 00 00 */ stw r0, 0x0(r4) -/* 0000017C 000001BC 48 00 00 24 */ b .L_000001A0 -.L_00000180: -/* 00000180 000001C0 1C 1E 00 30 */ mulli r0, r30, 0x30 -/* 00000184 000001C4 88 7B 00 0F */ lbz r3, 0xf(r27) -/* 00000188 000001C8 7C 9F 02 14 */ add r4, r31, r0 -/* 0000018C 000001CC 88 04 00 3F */ lbz r0, 0x3f(r4) -/* 00000190 000001D0 38 84 00 3F */ addi r4, r4, 0x3f -/* 00000194 000001D4 7C 03 00 40 */ cmplw r3, r0 -/* 00000198 000001D8 41 82 00 1C */ beq .L_000001B4 -/* 0000019C 000001DC 98 64 00 00 */ stb r3, 0x0(r4) -.L_000001A0: -/* 000001A0 000001E0 80 1B 00 0C */ lwz r0, 0xc(r27) -/* 000001A4 000001E4 38 81 00 3C */ addi r4, r1, 0x3c -/* 000001A8 000001E8 38 7C 00 00 */ addi r3, r28, 0x0 -/* 000001AC 000001EC 90 01 00 3C */ stw r0, 0x3c(r1) -/* 000001B0 000001F0 48 00 00 01 */ bl GXSetChanAmbColor -.L_000001B4: -/* 000001B4 000001F4 80 1B 00 1C */ lwz r0, 0x1c(r27) -/* 000001B8 000001F8 2C 00 00 00 */ cmpwi r0, 0x0 -/* 000001BC 000001FC 40 82 00 E4 */ bne .L_000002A0 -/* 000001C0 00000200 57 C0 10 3A */ slwi r0, r30, 2 -/* 000001C4 00000204 38 60 00 00 */ li r3, prev_mat_invalid@sda21 -/* 000001C8 00000208 7C 63 02 14 */ add r3, r3, r0 -/* 000001CC 0000020C 80 03 00 00 */ lwz r0, 0x0(r3) -/* 000001D0 00000210 2C 00 00 00 */ cmpwi r0, 0x0 -/* 000001D4 00000214 41 82 00 34 */ beq .L_00000208 -/* 000001D8 00000218 38 00 00 00 */ li r0, 0x0 -/* 000001DC 0000021C 90 03 00 00 */ stw r0, 0x0(r3) -/* 000001E0 00000220 38 81 00 38 */ addi r4, r1, 0x38 -/* 000001E4 00000224 38 7E 00 04 */ addi r3, r30, 0x4 -/* 000001E8 00000228 80 1B 00 10 */ lwz r0, 0x10(r27) -/* 000001EC 0000022C 90 01 00 38 */ stw r0, 0x38(r1) -/* 000001F0 00000230 48 00 00 01 */ bl GXSetChanMatColor -/* 000001F4 00000234 1C 7E 00 30 */ mulli r3, r30, 0x30 -/* 000001F8 00000238 80 1B 00 10 */ lwz r0, 0x10(r27) -/* 000001FC 0000023C 7C 7F 1A 14 */ add r3, r31, r3 -/* 00000200 00000240 90 03 00 40 */ stw r0, 0x40(r3) -/* 00000204 00000244 48 00 00 9C */ b .L_000002A0 -.L_00000208: -/* 00000208 00000248 38 1C FF FC */ subi r0, r28, 0x4 -/* 0000020C 0000024C 28 00 00 01 */ cmplwi r0, 0x1 -/* 00000210 00000250 41 81 00 24 */ bgt .L_00000234 -/* 00000214 00000254 1C 1E 00 30 */ mulli r0, r30, 0x30 -/* 00000218 00000258 80 9B 00 10 */ lwz r4, 0x10(r27) -/* 0000021C 0000025C 7C 7F 02 14 */ add r3, r31, r0 -/* 00000220 00000260 80 03 00 40 */ lwz r0, 0x40(r3) -/* 00000224 00000264 7C 04 00 40 */ cmplw r4, r0 -/* 00000228 00000268 41 82 00 78 */ beq .L_000002A0 -/* 0000022C 0000026C 90 83 00 40 */ stw r4, 0x40(r3) -/* 00000230 00000270 48 00 00 5C */ b .L_0000028C -.L_00000234: -/* 00000234 00000274 28 1C 00 01 */ cmplwi r28, 0x1 -/* 00000238 00000278 41 81 00 34 */ bgt .L_0000026C -/* 0000023C 0000027C 1C 1E 00 30 */ mulli r0, r30, 0x30 -/* 00000240 00000280 80 BB 00 10 */ lwz r5, 0x10(r27) -/* 00000244 00000284 7C 7F 02 14 */ add r3, r31, r0 -/* 00000248 00000288 38 83 00 40 */ addi r4, r3, 0x40 -/* 0000024C 0000028C 80 63 00 40 */ lwz r3, 0x40(r3) -/* 00000250 00000290 7C A0 1A 78 */ xor r0, r5, r3 -/* 00000254 00000294 54 00 00 2F */ clrrwi. r0, r0, 8 -/* 00000258 00000298 41 82 00 48 */ beq .L_000002A0 -/* 0000025C 0000029C 54 A0 00 2E */ clrrwi r0, r5, 8 -/* 00000260 000002A0 50 60 06 3E */ rlwimi r0, r3, 0, 24, 31 -/* 00000264 000002A4 90 04 00 00 */ stw r0, 0x0(r4) -/* 00000268 000002A8 48 00 00 24 */ b .L_0000028C -.L_0000026C: -/* 0000026C 000002AC 1C 1E 00 30 */ mulli r0, r30, 0x30 -/* 00000270 000002B0 88 7B 00 13 */ lbz r3, 0x13(r27) -/* 00000274 000002B4 7C 9F 02 14 */ add r4, r31, r0 -/* 00000278 000002B8 88 04 00 43 */ lbz r0, 0x43(r4) -/* 0000027C 000002BC 38 84 00 43 */ addi r4, r4, 0x43 -/* 00000280 000002C0 7C 03 00 40 */ cmplw r3, r0 -/* 00000284 000002C4 41 82 00 1C */ beq .L_000002A0 -/* 00000288 000002C8 98 64 00 00 */ stb r3, 0x0(r4) -.L_0000028C: -/* 0000028C 000002CC 80 1B 00 10 */ lwz r0, 0x10(r27) -/* 00000290 000002D0 38 81 00 34 */ addi r4, r1, 0x34 -/* 00000294 000002D4 38 7C 00 00 */ addi r3, r28, 0x0 -/* 00000298 000002D8 90 01 00 34 */ stw r0, 0x34(r1) -/* 0000029C 000002DC 48 00 00 01 */ bl GXSetChanMatColor -.L_000002A0: -/* 000002A0 000002E0 1F DD 00 30 */ mulli r30, r29, 0x30 -/* 000002A4 000002E4 88 9B 00 14 */ lbz r4, 0x14(r27) -/* 000002A8 000002E8 7F BF F2 14 */ add r29, r31, r30 -/* 000002AC 000002EC 8C 1D 00 44 */ lbzu r0, 0x44(r29) -/* 000002B0 000002F0 7C 04 00 40 */ cmplw r4, r0 -/* 000002B4 000002F4 40 82 00 58 */ bne .L_0000030C -/* 000002B8 000002F8 7C BF F2 14 */ add r5, r31, r30 -/* 000002BC 000002FC 80 7B 00 18 */ lwz r3, 0x18(r27) -/* 000002C0 00000300 80 05 00 48 */ lwz r0, 0x48(r5) -/* 000002C4 00000304 7C 03 00 00 */ cmpw r3, r0 -/* 000002C8 00000308 40 82 00 44 */ bne .L_0000030C -/* 000002CC 0000030C 80 7B 00 1C */ lwz r3, 0x1c(r27) -/* 000002D0 00000310 80 05 00 4C */ lwz r0, 0x4c(r5) -/* 000002D4 00000314 7C 03 00 00 */ cmpw r3, r0 -/* 000002D8 00000318 40 82 00 34 */ bne .L_0000030C -/* 000002DC 0000031C 80 7B 00 20 */ lwz r3, 0x20(r27) -/* 000002E0 00000320 80 05 00 50 */ lwz r0, 0x50(r5) -/* 000002E4 00000324 7C 03 00 00 */ cmpw r3, r0 -/* 000002E8 00000328 40 82 00 24 */ bne .L_0000030C -/* 000002EC 0000032C 80 7B 00 24 */ lwz r3, 0x24(r27) -/* 000002F0 00000330 80 05 00 54 */ lwz r0, 0x54(r5) -/* 000002F4 00000334 7C 03 00 00 */ cmpw r3, r0 -/* 000002F8 00000338 40 82 00 14 */ bne .L_0000030C -/* 000002FC 0000033C 80 7B 00 28 */ lwz r3, 0x28(r27) -/* 00000300 00000340 80 05 00 58 */ lwz r0, 0x58(r5) -/* 00000304 00000344 7C 03 00 00 */ cmpw r3, r0 -/* 00000308 00000348 41 82 00 90 */ beq .L_00000398 -.L_0000030C: -/* 0000030C 0000034C 80 BB 00 18 */ lwz r5, 0x18(r27) -/* 00000310 00000350 7F 83 E3 78 */ mr r3, r28 -/* 00000314 00000354 80 DB 00 1C */ lwz r6, 0x1c(r27) -/* 00000318 00000358 80 FB 00 20 */ lwz r7, 0x20(r27) -/* 0000031C 0000035C 81 1B 00 24 */ lwz r8, 0x24(r27) -/* 00000320 00000360 81 3B 00 28 */ lwz r9, 0x28(r27) -/* 00000324 00000364 48 00 00 01 */ bl GXSetChanCtrl -/* 00000328 00000368 88 9B 00 14 */ lbz r4, 0x14(r27) -/* 0000032C 0000036C 38 1C FF FC */ subi r0, r28, 0x4 -/* 00000330 00000370 7C 7F F2 14 */ add r3, r31, r30 -/* 00000334 00000374 98 9D 00 00 */ stb r4, 0x0(r29) -/* 00000338 00000378 28 00 00 01 */ cmplwi r0, 0x1 -/* 0000033C 0000037C 80 1B 00 18 */ lwz r0, 0x18(r27) -/* 00000340 00000380 90 03 00 48 */ stw r0, 0x48(r3) -/* 00000344 00000384 80 1B 00 1C */ lwz r0, 0x1c(r27) -/* 00000348 00000388 90 03 00 4C */ stw r0, 0x4c(r3) -/* 0000034C 0000038C 80 1B 00 20 */ lwz r0, 0x20(r27) -/* 00000350 00000390 90 03 00 50 */ stw r0, 0x50(r3) -/* 00000354 00000394 80 1B 00 24 */ lwz r0, 0x24(r27) -/* 00000358 00000398 90 03 00 54 */ stw r0, 0x54(r3) -/* 0000035C 0000039C 80 1B 00 28 */ lwz r0, 0x28(r27) -/* 00000360 000003A0 90 03 00 58 */ stw r0, 0x58(r3) -/* 00000364 000003A4 41 81 00 34 */ bgt .L_00000398 -/* 00000368 000003A8 88 1B 00 14 */ lbz r0, 0x14(r27) -/* 0000036C 000003AC 98 03 00 A4 */ stb r0, 0xa4(r3) -/* 00000370 000003B0 80 1B 00 18 */ lwz r0, 0x18(r27) -/* 00000374 000003B4 90 03 00 A8 */ stw r0, 0xa8(r3) -/* 00000378 000003B8 80 1B 00 1C */ lwz r0, 0x1c(r27) -/* 0000037C 000003BC 90 03 00 AC */ stw r0, 0xac(r3) -/* 00000380 000003C0 80 1B 00 20 */ lwz r0, 0x20(r27) -/* 00000384 000003C4 90 03 00 B0 */ stw r0, 0xb0(r3) -/* 00000388 000003C8 80 1B 00 24 */ lwz r0, 0x24(r27) -/* 0000038C 000003CC 90 03 00 B4 */ stw r0, 0xb4(r3) -/* 00000390 000003D0 80 1B 00 28 */ lwz r0, 0x28(r27) -/* 00000394 000003D4 90 03 00 B8 */ stw r0, 0xb8(r3) -.L_00000398: -/* 00000398 000003D8 BB 61 00 4C */ lmw r27, 0x4c(r1) -/* 0000039C 000003DC 80 01 00 64 */ lwz r0, 0x64(r1) -/* 000003A0 000003E0 38 21 00 60 */ addi r1, r1, 0x60 -/* 000003A4 000003E4 7C 08 03 A6 */ mtlr r0 -/* 000003A8 000003E8 4E 80 00 20 */ blr -.endfn HSD_SetupChannel - -.fn HSD_StateSetNumChans, global -/* 000003AC 000003EC 7C 08 02 A6 */ mflr r0 -/* 000003B0 000003F0 90 01 00 04 */ stw r0, 0x4(r1) -/* 000003B4 000003F4 94 21 FF F8 */ stwu r1, -0x8(r1) -/* 000003B8 000003F8 80 00 00 00 */ lwz r0, prev_num_chans@sda21(r0) -/* 000003BC 000003FC 7C 00 18 00 */ cmpw r0, r3 -/* 000003C0 00000400 41 82 00 0C */ beq .L_000003CC -/* 000003C4 00000404 54 63 06 3E */ clrlwi r3, r3, 24 -/* 000003C8 00000408 48 00 00 01 */ bl GXSetNumChans -.L_000003CC: -/* 000003CC 0000040C 80 01 00 0C */ lwz r0, 0xc(r1) -/* 000003D0 00000410 38 21 00 08 */ addi r1, r1, 0x8 -/* 000003D4 00000414 7C 08 03 A6 */ mtlr r0 -/* 000003D8 00000418 4E 80 00 20 */ blr -.endfn HSD_StateSetNumChans - -.fn HSD_SetupChannelAll, global -/* 000003DC 0000041C 7C 08 02 A6 */ mflr r0 -/* 000003E0 00000420 90 01 00 04 */ stw r0, 0x4(r1) -/* 000003E4 00000424 94 21 FF E8 */ stwu r1, -0x18(r1) -/* 000003E8 00000428 93 E1 00 14 */ stw r31, 0x14(r1) -/* 000003EC 0000042C 3B E0 00 00 */ li r31, 0x0 -/* 000003F0 00000430 93 C1 00 10 */ stw r30, 0x10(r1) -/* 000003F4 00000434 3B C3 00 00 */ addi r30, r3, 0x0 -/* 000003F8 00000438 48 00 00 24 */ b .L_0000041C -.L_000003FC: -/* 000003FC 0000043C 80 7E 00 04 */ lwz r3, 0x4(r30) -/* 00000400 00000440 48 00 00 01 */ bl HSD_Channel2Num -/* 00000404 00000444 7C 03 F8 00 */ cmpw r3, r31 -/* 00000408 00000448 40 81 00 08 */ ble .L_00000410 -/* 0000040C 0000044C 7C 7F 1B 78 */ mr r31, r3 -.L_00000410: -/* 00000410 00000450 7F C3 F3 78 */ mr r3, r30 -/* 00000414 00000454 48 00 00 01 */ bl HSD_SetupChannel -/* 00000418 00000458 83 DE 00 00 */ lwz r30, 0x0(r30) -.L_0000041C: -/* 0000041C 0000045C 28 1E 00 00 */ cmplwi r30, 0x0 -/* 00000420 00000460 40 82 FF DC */ bne .L_000003FC -/* 00000424 00000464 80 60 00 00 */ lwz r3, prev_num_chans@sda21(r0) -/* 00000428 00000468 57 E0 06 3E */ clrlwi r0, r31, 24 -/* 0000042C 0000046C 7C 03 00 00 */ cmpw r3, r0 -/* 00000430 00000470 41 82 00 0C */ beq .L_0000043C -/* 00000434 00000474 54 03 06 3E */ clrlwi r3, r0, 24 -/* 00000438 00000478 48 00 00 01 */ bl GXSetNumChans -.L_0000043C: -/* 0000043C 0000047C 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 00000440 00000480 83 E1 00 14 */ lwz r31, 0x14(r1) -/* 00000444 00000484 83 C1 00 10 */ lwz r30, 0x10(r1) -/* 00000448 00000488 38 21 00 18 */ addi r1, r1, 0x18 -/* 0000044C 0000048C 7C 08 03 A6 */ mtlr r0 -/* 00000450 00000490 4E 80 00 20 */ blr -.endfn HSD_SetupChannelAll - -.fn HSD_StateRegisterTexGen, global -/* 00000454 00000494 7C 08 02 A6 */ mflr r0 -/* 00000458 00000498 90 01 00 04 */ stw r0, 0x4(r1) -/* 0000045C 0000049C 94 21 FF F8 */ stwu r1, -0x8(r1) -/* 00000460 000004A0 48 00 00 01 */ bl HSD_TexCoordID2Num -/* 00000464 000004A4 80 00 00 00 */ lwz r0, num_tex_gens@sda21(r0) -/* 00000468 000004A8 7C 03 00 00 */ cmpw r3, r0 -/* 0000046C 000004AC 40 81 00 08 */ ble .L_00000474 -/* 00000470 000004B0 90 60 00 00 */ stw r3, num_tex_gens@sda21(r0) -.L_00000474: -/* 00000474 000004B4 80 01 00 0C */ lwz r0, 0xc(r1) -/* 00000478 000004B8 38 21 00 08 */ addi r1, r1, 0x8 -/* 0000047C 000004BC 7C 08 03 A6 */ mtlr r0 -/* 00000480 000004C0 4E 80 00 20 */ blr -.endfn HSD_StateRegisterTexGen - -.fn HSD_StateSetNumTexGens, global -/* 00000484 000004C4 7C 08 02 A6 */ mflr r0 -/* 00000488 000004C8 90 01 00 04 */ stw r0, 0x4(r1) -/* 0000048C 000004CC 94 21 FF F8 */ stwu r1, -0x8(r1) -/* 00000490 000004D0 80 00 00 00 */ lwz r0, num_tex_gens@sda21(r0) -/* 00000494 000004D4 54 03 06 3E */ clrlwi r3, r0, 24 -/* 00000498 000004D8 48 00 00 01 */ bl GXSetNumTexGens -/* 0000049C 000004DC 38 00 00 00 */ li r0, 0x0 -/* 000004A0 000004E0 90 00 00 00 */ stw r0, num_tex_gens@sda21(r0) -/* 000004A4 000004E4 80 01 00 0C */ lwz r0, 0xc(r1) -/* 000004A8 000004E8 38 21 00 08 */ addi r1, r1, 0x8 -/* 000004AC 000004EC 7C 08 03 A6 */ mtlr r0 -/* 000004B0 000004F0 4E 80 00 20 */ blr -.endfn HSD_StateSetNumTexGens - -.fn HSD_StateInitTev, global -/* 000004B4 000004F4 38 00 00 00 */ li r0, 0x0 -/* 000004B8 000004F8 90 00 00 00 */ stw r0, current_tev@sda21(r0) -/* 000004BC 000004FC 4E 80 00 20 */ blr -.endfn HSD_StateInitTev - -.fn HSD_StateGetNumTevStages, global -/* 000004C0 00000500 80 60 00 00 */ lwz r3, current_tev@sda21(r0) -/* 000004C4 00000504 4E 80 00 20 */ blr -.endfn HSD_StateGetNumTevStages - -.fn HSD_StateAssignTev, global -/* 000004C8 00000508 7C 08 02 A6 */ mflr r0 -/* 000004CC 0000050C 90 01 00 04 */ stw r0, 0x4(r1) -/* 000004D0 00000510 94 21 FF F8 */ stwu r1, -0x8(r1) -/* 000004D4 00000514 80 60 00 00 */ lwz r3, current_tev@sda21(r0) -/* 000004D8 00000518 38 03 00 01 */ addi r0, r3, 0x1 -/* 000004DC 0000051C 90 00 00 00 */ stw r0, current_tev@sda21(r0) -/* 000004E0 00000520 48 00 00 01 */ bl HSD_Index2TevStage -/* 000004E4 00000524 80 01 00 0C */ lwz r0, 0xc(r1) -/* 000004E8 00000528 38 21 00 08 */ addi r1, r1, 0x8 -/* 000004EC 0000052C 7C 08 03 A6 */ mtlr r0 -/* 000004F0 00000530 4E 80 00 20 */ blr -.endfn HSD_StateAssignTev - -.fn HSD_StateSetNumTevStages, global -/* 000004F4 00000534 7C 08 02 A6 */ mflr r0 -/* 000004F8 00000538 90 01 00 04 */ stw r0, 0x4(r1) -/* 000004FC 0000053C 94 21 FF F8 */ stwu r1, -0x8(r1) -/* 00000500 00000540 80 00 00 00 */ lwz r0, current_tev@sda21(r0) -/* 00000504 00000544 54 03 06 3E */ clrlwi r3, r0, 24 -/* 00000508 00000548 48 00 00 01 */ bl GXSetNumTevStages -/* 0000050C 0000054C 38 00 00 00 */ li r0, 0x0 -/* 00000510 00000550 90 00 00 00 */ stw r0, current_tev@sda21(r0) -/* 00000514 00000554 80 01 00 0C */ lwz r0, 0xc(r1) -/* 00000518 00000558 38 21 00 08 */ addi r1, r1, 0x8 -/* 0000051C 0000055C 7C 08 03 A6 */ mtlr r0 -/* 00000520 00000560 4E 80 00 20 */ blr -.endfn HSD_StateSetNumTevStages - -.fn HSD_SetupTevStage, global -/* 00000524 00000564 7C 08 02 A6 */ mflr r0 -/* 00000528 00000568 90 01 00 04 */ stw r0, 0x4(r1) -/* 0000052C 0000056C 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 00000530 00000570 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 00000534 00000574 7C 7F 1B 78 */ mr r31, r3 -/* 00000538 00000578 80 63 00 08 */ lwz r3, 0x8(r3) -/* 0000053C 0000057C 80 9F 00 0C */ lwz r4, 0xc(r31) -/* 00000540 00000580 80 BF 00 10 */ lwz r5, 0x10(r31) -/* 00000544 00000584 80 DF 00 14 */ lwz r6, 0x14(r31) -/* 00000548 00000588 48 00 00 01 */ bl GXSetTevOrder -/* 0000054C 0000058C 80 1F 00 04 */ lwz r0, 0x4(r31) -/* 00000550 00000590 28 00 00 00 */ cmplwi r0, 0x0 -/* 00000554 00000594 40 82 00 24 */ bne .L_00000578 -/* 00000558 00000598 80 7F 00 08 */ lwz r3, 0x8(r31) -/* 0000055C 0000059C 80 9F 00 18 */ lwz r4, 0x18(r31) -/* 00000560 000005A0 48 00 00 01 */ bl GXSetTevOp -/* 00000564 000005A4 80 7F 00 08 */ lwz r3, 0x8(r31) -/* 00000568 000005A8 38 80 00 00 */ li r4, 0x0 -/* 0000056C 000005AC 38 A0 00 00 */ li r5, 0x0 -/* 00000570 000005B0 48 00 00 01 */ bl GXSetTevSwapMode -/* 00000574 000005B4 48 00 00 94 */ b .L_00000608 -.L_00000578: -/* 00000578 000005B8 80 7F 00 08 */ lwz r3, 0x8(r31) -/* 0000057C 000005BC 80 9F 00 18 */ lwz r4, 0x18(r31) -/* 00000580 000005C0 80 BF 00 30 */ lwz r5, 0x30(r31) -/* 00000584 000005C4 80 DF 00 2C */ lwz r6, 0x2c(r31) -/* 00000588 000005C8 88 FF 00 34 */ lbz r7, 0x34(r31) -/* 0000058C 000005CC 81 1F 00 38 */ lwz r8, 0x38(r31) -/* 00000590 000005D0 48 00 00 01 */ bl GXSetTevColorOp -/* 00000594 000005D4 80 7F 00 08 */ lwz r3, 0x8(r31) -/* 00000598 000005D8 80 9F 00 1C */ lwz r4, 0x1c(r31) -/* 0000059C 000005DC 80 BF 00 20 */ lwz r5, 0x20(r31) -/* 000005A0 000005E0 80 DF 00 24 */ lwz r6, 0x24(r31) -/* 000005A4 000005E4 80 FF 00 28 */ lwz r7, 0x28(r31) -/* 000005A8 000005E8 48 00 00 01 */ bl GXSetTevColorIn -/* 000005AC 000005EC 80 7F 00 08 */ lwz r3, 0x8(r31) -/* 000005B0 000005F0 80 9F 00 3C */ lwz r4, 0x3c(r31) -/* 000005B4 000005F4 80 BF 00 54 */ lwz r5, 0x54(r31) -/* 000005B8 000005F8 80 DF 00 50 */ lwz r6, 0x50(r31) -/* 000005BC 000005FC 88 FF 00 58 */ lbz r7, 0x58(r31) -/* 000005C0 00000600 81 1F 00 5C */ lwz r8, 0x5c(r31) -/* 000005C4 00000604 48 00 00 01 */ bl GXSetTevAlphaOp -/* 000005C8 00000608 80 7F 00 08 */ lwz r3, 0x8(r31) -/* 000005CC 0000060C 80 9F 00 40 */ lwz r4, 0x40(r31) -/* 000005D0 00000610 80 BF 00 44 */ lwz r5, 0x44(r31) -/* 000005D4 00000614 80 DF 00 48 */ lwz r6, 0x48(r31) -/* 000005D8 00000618 80 FF 00 4C */ lwz r7, 0x4c(r31) -/* 000005DC 0000061C 48 00 00 01 */ bl GXSetTevAlphaIn -/* 000005E0 00000620 80 7F 00 08 */ lwz r3, 0x8(r31) -/* 000005E4 00000624 80 9F 00 64 */ lwz r4, 0x64(r31) -/* 000005E8 00000628 80 BF 00 68 */ lwz r5, 0x68(r31) -/* 000005EC 0000062C 48 00 00 01 */ bl GXSetTevSwapMode -/* 000005F0 00000630 80 7F 00 08 */ lwz r3, 0x8(r31) -/* 000005F4 00000634 80 9F 00 6C */ lwz r4, 0x6c(r31) -/* 000005F8 00000638 48 00 00 01 */ bl GXSetTevKColorSel -/* 000005FC 0000063C 80 7F 00 08 */ lwz r3, 0x8(r31) -/* 00000600 00000640 80 9F 00 70 */ lwz r4, 0x70(r31) -/* 00000604 00000644 48 00 00 01 */ bl GXSetTevKAlphaSel -.L_00000608: -/* 00000608 00000648 80 01 00 24 */ lwz r0, 0x24(r1) -/* 0000060C 0000064C 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 00000610 00000650 38 21 00 20 */ addi r1, r1, 0x20 -/* 00000614 00000654 7C 08 03 A6 */ mtlr r0 -/* 00000618 00000658 4E 80 00 20 */ blr -.endfn HSD_SetupTevStage - -.fn HSD_SetupTevStageAll, global -/* 0000061C 0000065C 7C 08 02 A6 */ mflr r0 -/* 00000620 00000660 90 01 00 04 */ stw r0, 0x4(r1) -/* 00000624 00000664 94 21 FF E8 */ stwu r1, -0x18(r1) -/* 00000628 00000668 93 E1 00 14 */ stw r31, 0x14(r1) -/* 0000062C 0000066C 3B E0 00 00 */ li r31, 0x0 -/* 00000630 00000670 93 C1 00 10 */ stw r30, 0x10(r1) -/* 00000634 00000674 3B C3 00 00 */ addi r30, r3, 0x0 -/* 00000638 00000678 48 00 00 24 */ b .L_0000065C -.L_0000063C: -/* 0000063C 0000067C 80 7E 00 08 */ lwz r3, 0x8(r30) -/* 00000640 00000680 48 00 00 01 */ bl HSD_TevStage2Num -/* 00000644 00000684 7C 03 F8 00 */ cmpw r3, r31 -/* 00000648 00000688 40 81 00 08 */ ble .L_00000650 -/* 0000064C 0000068C 7C 7F 1B 78 */ mr r31, r3 -.L_00000650: -/* 00000650 00000690 7F C3 F3 78 */ mr r3, r30 -/* 00000654 00000694 48 00 00 01 */ bl HSD_SetupTevStage -/* 00000658 00000698 83 DE 00 00 */ lwz r30, 0x0(r30) -.L_0000065C: -/* 0000065C 0000069C 28 1E 00 00 */ cmplwi r30, 0x0 -/* 00000660 000006A0 40 82 FF DC */ bne .L_0000063C -/* 00000664 000006A4 93 E0 00 00 */ stw r31, current_tev@sda21(r0) -/* 00000668 000006A8 80 00 00 00 */ lwz r0, current_tev@sda21(r0) -/* 0000066C 000006AC 54 03 06 3E */ clrlwi r3, r0, 24 -/* 00000670 000006B0 48 00 00 01 */ bl GXSetNumTevStages -/* 00000674 000006B4 38 00 00 00 */ li r0, 0x0 -/* 00000678 000006B8 90 00 00 00 */ stw r0, current_tev@sda21(r0) -/* 0000067C 000006BC 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 00000680 000006C0 83 E1 00 14 */ lwz r31, 0x14(r1) -/* 00000684 000006C4 83 C1 00 10 */ lwz r30, 0x10(r1) -/* 00000688 000006C8 38 21 00 18 */ addi r1, r1, 0x18 -/* 0000068C 000006CC 7C 08 03 A6 */ mtlr r0 -/* 00000690 000006D0 4E 80 00 20 */ blr -.endfn HSD_SetupTevStageAll - -.fn HSD_Channel2Num, global -/* 00000694 000006D4 7C 08 02 A6 */ mflr r0 -/* 00000698 000006D8 2C 03 00 04 */ cmpwi r3, 0x4 -/* 0000069C 000006DC 90 01 00 04 */ stw r0, 0x4(r1) -/* 000006A0 000006E0 94 21 FF F8 */ stwu r1, -0x8(r1) -/* 000006A4 000006E4 41 82 00 64 */ beq .L_00000708 -/* 000006A8 000006E8 40 80 00 28 */ bge .L_000006D0 -/* 000006AC 000006EC 2C 03 00 01 */ cmpwi r3, 0x1 -/* 000006B0 000006F0 41 82 00 40 */ beq .L_000006F0 -/* 000006B4 000006F4 40 80 00 10 */ bge .L_000006C4 -/* 000006B8 000006F8 2C 03 00 00 */ cmpwi r3, 0x0 -/* 000006BC 000006FC 40 80 00 2C */ bge .L_000006E8 -/* 000006C0 00000700 48 00 00 60 */ b .L_00000720 -.L_000006C4: -/* 000006C4 00000704 2C 03 00 03 */ cmpwi r3, 0x3 -/* 000006C8 00000708 40 80 00 38 */ bge .L_00000700 -/* 000006CC 0000070C 48 00 00 2C */ b .L_000006F8 -.L_000006D0: -/* 000006D0 00000710 2C 03 00 FF */ cmpwi r3, 0xff -/* 000006D4 00000714 41 82 00 44 */ beq .L_00000718 -/* 000006D8 00000718 40 80 00 48 */ bge .L_00000720 -/* 000006DC 0000071C 2C 03 00 06 */ cmpwi r3, 0x6 -/* 000006E0 00000720 40 80 00 40 */ bge .L_00000720 -/* 000006E4 00000724 48 00 00 2C */ b .L_00000710 -.L_000006E8: -/* 000006E8 00000728 38 60 00 01 */ li r3, 0x1 -/* 000006EC 0000072C 48 00 00 48 */ b .L_00000734 -.L_000006F0: -/* 000006F0 00000730 38 60 00 02 */ li r3, 0x2 -/* 000006F4 00000734 48 00 00 40 */ b .L_00000734 -.L_000006F8: -/* 000006F8 00000738 38 60 00 01 */ li r3, 0x1 -/* 000006FC 0000073C 48 00 00 38 */ b .L_00000734 -.L_00000700: -/* 00000700 00000740 38 60 00 02 */ li r3, 0x2 -/* 00000704 00000744 48 00 00 30 */ b .L_00000734 -.L_00000708: -/* 00000708 00000748 38 60 00 01 */ li r3, 0x1 -/* 0000070C 0000074C 48 00 00 28 */ b .L_00000734 -.L_00000710: -/* 00000710 00000750 38 60 00 02 */ li r3, 0x2 -/* 00000714 00000754 48 00 00 20 */ b .L_00000734 -.L_00000718: -/* 00000718 00000758 38 60 00 00 */ li r3, 0x0 -/* 0000071C 0000075C 48 00 00 18 */ b .L_00000734 -.L_00000720: -/* 00000720 00000760 38 60 00 00 */ li r3, "@124"@sda21 -/* 00000724 00000764 38 80 02 90 */ li r4, 0x290 -/* 00000728 00000768 38 A0 00 00 */ li r5, "@125"@sda21 -/* 0000072C 0000076C 48 00 00 01 */ bl __assert -/* 00000730 00000770 38 60 00 00 */ li r3, 0x0 -.L_00000734: -/* 00000734 00000774 80 01 00 0C */ lwz r0, 0xc(r1) -/* 00000738 00000778 38 21 00 08 */ addi r1, r1, 0x8 -/* 0000073C 0000077C 7C 08 03 A6 */ mtlr r0 -/* 00000740 00000780 4E 80 00 20 */ blr -.endfn HSD_Channel2Num - -.fn HSD_Index2TevStage, global -/* 00000744 00000784 7C 08 02 A6 */ mflr r0 -/* 00000748 00000788 28 03 00 0F */ cmplwi r3, 0xf -/* 0000074C 0000078C 90 01 00 04 */ stw r0, 0x4(r1) -/* 00000750 00000790 94 21 FF F8 */ stwu r1, -0x8(r1) -/* 00000754 00000794 41 81 00 9C */ bgt .L_000007F0 -/* 00000758 00000798 3C 80 00 00 */ lis r4, "@145"@ha -/* 0000075C 0000079C 38 84 00 00 */ addi r4, r4, "@145"@l -/* 00000760 000007A0 54 60 10 3A */ slwi r0, r3, 2 -/* 00000764 000007A4 7C 04 00 2E */ lwzx r0, r4, r0 -/* 00000768 000007A8 7C 09 03 A6 */ mtctr r0 -/* 0000076C 000007AC 4E 80 04 20 */ bctr -.L_00000770: -/* 00000770 000007B0 38 60 00 00 */ li r3, 0x0 -/* 00000774 000007B4 48 00 00 90 */ b .L_00000804 -.L_00000778: -/* 00000778 000007B8 38 60 00 01 */ li r3, 0x1 -/* 0000077C 000007BC 48 00 00 88 */ b .L_00000804 -.L_00000780: -/* 00000780 000007C0 38 60 00 02 */ li r3, 0x2 -/* 00000784 000007C4 48 00 00 80 */ b .L_00000804 -.L_00000788: -/* 00000788 000007C8 38 60 00 03 */ li r3, 0x3 -/* 0000078C 000007CC 48 00 00 78 */ b .L_00000804 -.L_00000790: -/* 00000790 000007D0 38 60 00 04 */ li r3, 0x4 -/* 00000794 000007D4 48 00 00 70 */ b .L_00000804 -.L_00000798: -/* 00000798 000007D8 38 60 00 05 */ li r3, 0x5 -/* 0000079C 000007DC 48 00 00 68 */ b .L_00000804 -.L_000007A0: -/* 000007A0 000007E0 38 60 00 06 */ li r3, 0x6 -/* 000007A4 000007E4 48 00 00 60 */ b .L_00000804 -.L_000007A8: -/* 000007A8 000007E8 38 60 00 07 */ li r3, 0x7 -/* 000007AC 000007EC 48 00 00 58 */ b .L_00000804 -.L_000007B0: -/* 000007B0 000007F0 38 60 00 08 */ li r3, 0x8 -/* 000007B4 000007F4 48 00 00 50 */ b .L_00000804 -.L_000007B8: -/* 000007B8 000007F8 38 60 00 09 */ li r3, 0x9 -/* 000007BC 000007FC 48 00 00 48 */ b .L_00000804 -.L_000007C0: -/* 000007C0 00000800 38 60 00 0A */ li r3, 0xa -/* 000007C4 00000804 48 00 00 40 */ b .L_00000804 -.L_000007C8: -/* 000007C8 00000808 38 60 00 0B */ li r3, 0xb -/* 000007CC 0000080C 48 00 00 38 */ b .L_00000804 -.L_000007D0: -/* 000007D0 00000810 38 60 00 0C */ li r3, 0xc -/* 000007D4 00000814 48 00 00 30 */ b .L_00000804 -.L_000007D8: -/* 000007D8 00000818 38 60 00 0D */ li r3, 0xd -/* 000007DC 0000081C 48 00 00 28 */ b .L_00000804 -.L_000007E0: -/* 000007E0 00000820 38 60 00 0E */ li r3, 0xe -/* 000007E4 00000824 48 00 00 20 */ b .L_00000804 -.L_000007E8: -/* 000007E8 00000828 38 60 00 0F */ li r3, 0xf -/* 000007EC 0000082C 48 00 00 18 */ b .L_00000804 -.L_000007F0: -/* 000007F0 00000830 38 60 00 00 */ li r3, "@124"@sda21 -/* 000007F4 00000834 38 80 02 C5 */ li r4, 0x2c5 -/* 000007F8 00000838 38 A0 00 00 */ li r5, "@125"@sda21 -/* 000007FC 0000083C 48 00 00 01 */ bl __assert -/* 00000800 00000840 38 60 00 0F */ li r3, 0xf -.L_00000804: -/* 00000804 00000844 80 01 00 0C */ lwz r0, 0xc(r1) -/* 00000808 00000848 38 21 00 08 */ addi r1, r1, 0x8 -/* 0000080C 0000084C 7C 08 03 A6 */ mtlr r0 -/* 00000810 00000850 4E 80 00 20 */ blr -.endfn HSD_Index2TevStage - -.fn HSD_TevStage2Index, global -/* 00000814 00000854 7C 08 02 A6 */ mflr r0 -/* 00000818 00000858 28 03 00 0F */ cmplwi r3, 0xf -/* 0000081C 0000085C 90 01 00 04 */ stw r0, 0x4(r1) -/* 00000820 00000860 94 21 FF F8 */ stwu r1, -0x8(r1) -/* 00000824 00000864 41 81 00 9C */ bgt .L_000008C0 -/* 00000828 00000868 3C 80 00 00 */ lis r4, "@165"@ha -/* 0000082C 0000086C 38 84 00 00 */ addi r4, r4, "@165"@l -/* 00000830 00000870 54 60 10 3A */ slwi r0, r3, 2 -/* 00000834 00000874 7C 04 00 2E */ lwzx r0, r4, r0 -/* 00000838 00000878 7C 09 03 A6 */ mtctr r0 -/* 0000083C 0000087C 4E 80 04 20 */ bctr -.L_00000840: -/* 00000840 00000880 38 60 00 00 */ li r3, 0x0 -/* 00000844 00000884 48 00 00 90 */ b .L_000008D4 -.L_00000848: -/* 00000848 00000888 38 60 00 01 */ li r3, 0x1 -/* 0000084C 0000088C 48 00 00 88 */ b .L_000008D4 -.L_00000850: -/* 00000850 00000890 38 60 00 02 */ li r3, 0x2 -/* 00000854 00000894 48 00 00 80 */ b .L_000008D4 -.L_00000858: -/* 00000858 00000898 38 60 00 03 */ li r3, 0x3 -/* 0000085C 0000089C 48 00 00 78 */ b .L_000008D4 -.L_00000860: -/* 00000860 000008A0 38 60 00 04 */ li r3, 0x4 -/* 00000864 000008A4 48 00 00 70 */ b .L_000008D4 -.L_00000868: -/* 00000868 000008A8 38 60 00 05 */ li r3, 0x5 -/* 0000086C 000008AC 48 00 00 68 */ b .L_000008D4 -.L_00000870: -/* 00000870 000008B0 38 60 00 06 */ li r3, 0x6 -/* 00000874 000008B4 48 00 00 60 */ b .L_000008D4 -.L_00000878: -/* 00000878 000008B8 38 60 00 07 */ li r3, 0x7 -/* 0000087C 000008BC 48 00 00 58 */ b .L_000008D4 -.L_00000880: -/* 00000880 000008C0 38 60 00 08 */ li r3, 0x8 -/* 00000884 000008C4 48 00 00 50 */ b .L_000008D4 -.L_00000888: -/* 00000888 000008C8 38 60 00 09 */ li r3, 0x9 -/* 0000088C 000008CC 48 00 00 48 */ b .L_000008D4 -.L_00000890: -/* 00000890 000008D0 38 60 00 0A */ li r3, 0xa -/* 00000894 000008D4 48 00 00 40 */ b .L_000008D4 -.L_00000898: -/* 00000898 000008D8 38 60 00 0B */ li r3, 0xb -/* 0000089C 000008DC 48 00 00 38 */ b .L_000008D4 -.L_000008A0: -/* 000008A0 000008E0 38 60 00 0C */ li r3, 0xc -/* 000008A4 000008E4 48 00 00 30 */ b .L_000008D4 -.L_000008A8: -/* 000008A8 000008E8 38 60 00 0D */ li r3, 0xd -/* 000008AC 000008EC 48 00 00 28 */ b .L_000008D4 -.L_000008B0: -/* 000008B0 000008F0 38 60 00 0E */ li r3, 0xe -/* 000008B4 000008F4 48 00 00 20 */ b .L_000008D4 -.L_000008B8: -/* 000008B8 000008F8 38 60 00 0F */ li r3, 0xf -/* 000008BC 000008FC 48 00 00 18 */ b .L_000008D4 -.L_000008C0: -/* 000008C0 00000900 38 60 00 00 */ li r3, "@124"@sda21 -/* 000008C4 00000904 38 80 02 FA */ li r4, 0x2fa -/* 000008C8 00000908 38 A0 00 00 */ li r5, "@125"@sda21 -/* 000008CC 0000090C 48 00 00 01 */ bl __assert -/* 000008D0 00000910 38 60 00 00 */ li r3, 0x0 -.L_000008D4: -/* 000008D4 00000914 80 01 00 0C */ lwz r0, 0xc(r1) -/* 000008D8 00000918 38 21 00 08 */ addi r1, r1, 0x8 -/* 000008DC 0000091C 7C 08 03 A6 */ mtlr r0 -/* 000008E0 00000920 4E 80 00 20 */ blr -.endfn HSD_TevStage2Index - -.fn HSD_TevStage2Num, global -/* 000008E4 00000924 7C 08 02 A6 */ mflr r0 -/* 000008E8 00000928 28 03 00 0F */ cmplwi r3, 0xf -/* 000008EC 0000092C 90 01 00 04 */ stw r0, 0x4(r1) -/* 000008F0 00000930 94 21 FF F8 */ stwu r1, -0x8(r1) -/* 000008F4 00000934 41 81 00 9C */ bgt .L_00000990 -/* 000008F8 00000938 3C 80 00 00 */ lis r4, "@185"@ha -/* 000008FC 0000093C 38 84 00 00 */ addi r4, r4, "@185"@l -/* 00000900 00000940 54 60 10 3A */ slwi r0, r3, 2 -/* 00000904 00000944 7C 04 00 2E */ lwzx r0, r4, r0 -/* 00000908 00000948 7C 09 03 A6 */ mtctr r0 -/* 0000090C 0000094C 4E 80 04 20 */ bctr -.L_00000910: -/* 00000910 00000950 38 60 00 01 */ li r3, 0x1 -/* 00000914 00000954 48 00 00 90 */ b .L_000009A4 -.L_00000918: -/* 00000918 00000958 38 60 00 02 */ li r3, 0x2 -/* 0000091C 0000095C 48 00 00 88 */ b .L_000009A4 -.L_00000920: -/* 00000920 00000960 38 60 00 03 */ li r3, 0x3 -/* 00000924 00000964 48 00 00 80 */ b .L_000009A4 -.L_00000928: -/* 00000928 00000968 38 60 00 04 */ li r3, 0x4 -/* 0000092C 0000096C 48 00 00 78 */ b .L_000009A4 -.L_00000930: -/* 00000930 00000970 38 60 00 05 */ li r3, 0x5 -/* 00000934 00000974 48 00 00 70 */ b .L_000009A4 -.L_00000938: -/* 00000938 00000978 38 60 00 06 */ li r3, 0x6 -/* 0000093C 0000097C 48 00 00 68 */ b .L_000009A4 -.L_00000940: -/* 00000940 00000980 38 60 00 07 */ li r3, 0x7 -/* 00000944 00000984 48 00 00 60 */ b .L_000009A4 -.L_00000948: -/* 00000948 00000988 38 60 00 08 */ li r3, 0x8 -/* 0000094C 0000098C 48 00 00 58 */ b .L_000009A4 -.L_00000950: -/* 00000950 00000990 38 60 00 09 */ li r3, 0x9 -/* 00000954 00000994 48 00 00 50 */ b .L_000009A4 -.L_00000958: -/* 00000958 00000998 38 60 00 0A */ li r3, 0xa -/* 0000095C 0000099C 48 00 00 48 */ b .L_000009A4 -.L_00000960: -/* 00000960 000009A0 38 60 00 0B */ li r3, 0xb -/* 00000964 000009A4 48 00 00 40 */ b .L_000009A4 -.L_00000968: -/* 00000968 000009A8 38 60 00 0C */ li r3, 0xc -/* 0000096C 000009AC 48 00 00 38 */ b .L_000009A4 -.L_00000970: -/* 00000970 000009B0 38 60 00 0D */ li r3, 0xd -/* 00000974 000009B4 48 00 00 30 */ b .L_000009A4 -.L_00000978: -/* 00000978 000009B8 38 60 00 0E */ li r3, 0xe -/* 0000097C 000009BC 48 00 00 28 */ b .L_000009A4 -.L_00000980: -/* 00000980 000009C0 38 60 00 0F */ li r3, 0xf -/* 00000984 000009C4 48 00 00 20 */ b .L_000009A4 -.L_00000988: -/* 00000988 000009C8 38 60 00 10 */ li r3, 0x10 -/* 0000098C 000009CC 48 00 00 18 */ b .L_000009A4 -.L_00000990: -/* 00000990 000009D0 38 60 00 00 */ li r3, "@124"@sda21 -/* 00000994 000009D4 38 80 03 19 */ li r4, 0x319 -/* 00000998 000009D8 38 A0 00 00 */ li r5, "@125"@sda21 -/* 0000099C 000009DC 48 00 00 01 */ bl __assert -/* 000009A0 000009E0 38 60 00 00 */ li r3, 0x0 -.L_000009A4: -/* 000009A4 000009E4 80 01 00 0C */ lwz r0, 0xc(r1) -/* 000009A8 000009E8 38 21 00 08 */ addi r1, r1, 0x8 -/* 000009AC 000009EC 7C 08 03 A6 */ mtlr r0 -/* 000009B0 000009F0 4E 80 00 20 */ blr -.endfn HSD_TevStage2Num - -.fn HSD_SetTevRegAll, global -/* 000009B4 000009F4 7C 08 02 A6 */ mflr r0 -/* 000009B8 000009F8 3C 60 00 00 */ lis r3, TevReg@ha -/* 000009BC 000009FC 90 01 00 04 */ stw r0, 0x4(r1) -/* 000009C0 00000A00 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 000009C4 00000A04 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 000009C8 00000A08 3B E1 00 08 */ addi r31, r1, 0x8 -/* 000009CC 00000A0C 93 C1 00 18 */ stw r30, 0x18(r1) -/* 000009D0 00000A10 3B C3 00 00 */ addi r30, r3, TevReg@l -/* 000009D4 00000A14 93 A1 00 14 */ stw r29, 0x14(r1) -/* 000009D8 00000A18 3B A0 00 00 */ li r29, 0x0 -.L_000009DC: -/* 000009DC 00000A1C 80 1E 00 08 */ lwz r0, 0x8(r30) -/* 000009E0 00000A20 2C 00 00 00 */ cmpwi r0, 0x0 -/* 000009E4 00000A24 41 82 00 70 */ beq .L_00000A54 -/* 000009E8 00000A28 2C 1D 00 02 */ cmpwi r29, 0x2 -/* 000009EC 00000A2C 41 82 00 34 */ beq .L_00000A20 -/* 000009F0 00000A30 40 80 00 14 */ bge .L_00000A04 -/* 000009F4 00000A34 2C 1D 00 00 */ cmpwi r29, 0x0 -/* 000009F8 00000A38 41 82 00 18 */ beq .L_00000A10 -/* 000009FC 00000A3C 40 80 00 1C */ bge .L_00000A18 -/* 00000A00 00000A40 48 00 00 30 */ b .L_00000A30 -.L_00000A04: -/* 00000A04 00000A44 2C 1D 00 04 */ cmpwi r29, 0x4 -/* 00000A08 00000A48 40 80 00 28 */ bge .L_00000A30 -/* 00000A0C 00000A4C 48 00 00 1C */ b .L_00000A28 -.L_00000A10: -/* 00000A10 00000A50 38 60 00 01 */ li r3, 0x1 -/* 00000A14 00000A54 48 00 00 20 */ b .L_00000A34 -.L_00000A18: -/* 00000A18 00000A58 38 60 00 02 */ li r3, 0x2 -/* 00000A1C 00000A5C 48 00 00 18 */ b .L_00000A34 -.L_00000A20: -/* 00000A20 00000A60 38 60 00 03 */ li r3, 0x3 -/* 00000A24 00000A64 48 00 00 10 */ b .L_00000A34 -.L_00000A28: -/* 00000A28 00000A68 38 60 00 00 */ li r3, 0x0 -/* 00000A2C 00000A6C 48 00 00 08 */ b .L_00000A34 -.L_00000A30: -/* 00000A30 00000A70 38 60 00 01 */ li r3, 0x1 -.L_00000A34: -/* 00000A34 00000A74 80 BE 00 00 */ lwz r5, 0x0(r30) -/* 00000A38 00000A78 7F E4 FB 78 */ mr r4, r31 -/* 00000A3C 00000A7C 80 1E 00 04 */ lwz r0, 0x4(r30) -/* 00000A40 00000A80 90 A1 00 08 */ stw r5, 0x8(r1) -/* 00000A44 00000A84 90 01 00 0C */ stw r0, 0xc(r1) -/* 00000A48 00000A88 48 00 00 01 */ bl GXSetTevColorS10 -/* 00000A4C 00000A8C 38 00 00 00 */ li r0, 0x0 -/* 00000A50 00000A90 90 1E 00 08 */ stw r0, 0x8(r30) -.L_00000A54: -/* 00000A54 00000A94 3B BD 00 01 */ addi r29, r29, 0x1 -/* 00000A58 00000A98 28 1D 00 04 */ cmplwi r29, 0x4 -/* 00000A5C 00000A9C 3B DE 00 0C */ addi r30, r30, 0xc -/* 00000A60 00000AA0 41 80 FF 7C */ blt .L_000009DC -/* 00000A64 00000AA4 80 01 00 24 */ lwz r0, 0x24(r1) -/* 00000A68 00000AA8 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 00000A6C 00000AAC 83 C1 00 18 */ lwz r30, 0x18(r1) -/* 00000A70 00000AB0 83 A1 00 14 */ lwz r29, 0x14(r1) -/* 00000A74 00000AB4 38 21 00 20 */ addi r1, r1, 0x20 -/* 00000A78 00000AB8 7C 08 03 A6 */ mtlr r0 -/* 00000A7C 00000ABC 4E 80 00 20 */ blr -.endfn HSD_SetTevRegAll - -.fn HSD_TexCoordID2Num, global -/* 00000A80 00000AC0 7C 08 02 A6 */ mflr r0 -/* 00000A84 00000AC4 2C 03 00 05 */ cmpwi r3, 0x5 -/* 00000A88 00000AC8 90 01 00 04 */ stw r0, 0x4(r1) -/* 00000A8C 00000ACC 94 21 FF F8 */ stwu r1, -0x8(r1) -/* 00000A90 00000AD0 41 82 00 74 */ beq .L_00000B04 -/* 00000A94 00000AD4 40 80 00 2C */ bge .L_00000AC0 -/* 00000A98 00000AD8 2C 03 00 02 */ cmpwi r3, 0x2 -/* 00000A9C 00000ADC 41 82 00 50 */ beq .L_00000AEC -/* 00000AA0 00000AE0 40 80 00 14 */ bge .L_00000AB4 -/* 00000AA4 00000AE4 2C 03 00 00 */ cmpwi r3, 0x0 -/* 00000AA8 00000AE8 41 82 00 34 */ beq .L_00000ADC -/* 00000AAC 00000AEC 40 80 00 38 */ bge .L_00000AE4 -/* 00000AB0 00000AF0 48 00 00 74 */ b .L_00000B24 -.L_00000AB4: -/* 00000AB4 00000AF4 2C 03 00 04 */ cmpwi r3, 0x4 -/* 00000AB8 00000AF8 40 80 00 44 */ bge .L_00000AFC -/* 00000ABC 00000AFC 48 00 00 38 */ b .L_00000AF4 -.L_00000AC0: -/* 00000AC0 00000B00 2C 03 00 FF */ cmpwi r3, 0xff -/* 00000AC4 00000B04 41 82 00 58 */ beq .L_00000B1C -/* 00000AC8 00000B08 40 80 00 5C */ bge .L_00000B24 -/* 00000ACC 00000B0C 2C 03 00 07 */ cmpwi r3, 0x7 -/* 00000AD0 00000B10 41 82 00 44 */ beq .L_00000B14 -/* 00000AD4 00000B14 40 80 00 50 */ bge .L_00000B24 -/* 00000AD8 00000B18 48 00 00 34 */ b .L_00000B0C -.L_00000ADC: -/* 00000ADC 00000B1C 38 60 00 01 */ li r3, 0x1 -/* 00000AE0 00000B20 48 00 00 58 */ b .L_00000B38 -.L_00000AE4: -/* 00000AE4 00000B24 38 60 00 02 */ li r3, 0x2 -/* 00000AE8 00000B28 48 00 00 50 */ b .L_00000B38 -.L_00000AEC: -/* 00000AEC 00000B2C 38 60 00 03 */ li r3, 0x3 -/* 00000AF0 00000B30 48 00 00 48 */ b .L_00000B38 -.L_00000AF4: -/* 00000AF4 00000B34 38 60 00 04 */ li r3, 0x4 -/* 00000AF8 00000B38 48 00 00 40 */ b .L_00000B38 -.L_00000AFC: -/* 00000AFC 00000B3C 38 60 00 05 */ li r3, 0x5 -/* 00000B00 00000B40 48 00 00 38 */ b .L_00000B38 -.L_00000B04: -/* 00000B04 00000B44 38 60 00 06 */ li r3, 0x6 -/* 00000B08 00000B48 48 00 00 30 */ b .L_00000B38 -.L_00000B0C: -/* 00000B0C 00000B4C 38 60 00 07 */ li r3, 0x7 -/* 00000B10 00000B50 48 00 00 28 */ b .L_00000B38 -.L_00000B14: -/* 00000B14 00000B54 38 60 00 08 */ li r3, 0x8 -/* 00000B18 00000B58 48 00 00 20 */ b .L_00000B38 -.L_00000B1C: -/* 00000B1C 00000B5C 38 60 00 00 */ li r3, 0x0 -/* 00000B20 00000B60 48 00 00 18 */ b .L_00000B38 -.L_00000B24: -/* 00000B24 00000B64 38 60 00 00 */ li r3, "@124"@sda21 -/* 00000B28 00000B68 38 80 03 F2 */ li r4, 0x3f2 -/* 00000B2C 00000B6C 38 A0 00 00 */ li r5, "@125"@sda21 -/* 00000B30 00000B70 48 00 00 01 */ bl __assert -/* 00000B34 00000B74 38 60 00 00 */ li r3, 0x0 -.L_00000B38: -/* 00000B38 00000B78 80 01 00 0C */ lwz r0, 0xc(r1) -/* 00000B3C 00000B7C 38 21 00 08 */ addi r1, r1, 0x8 -/* 00000B40 00000B80 7C 08 03 A6 */ mtlr r0 -/* 00000B44 00000B84 4E 80 00 20 */ blr -.endfn HSD_TexCoordID2Num - -.fn ChanUpdateFunc, global -/* 00000B48 00000B88 28 03 00 00 */ cmplwi r3, 0x0 -/* 00000B4C 00000B8C 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 00000B50 00000B90 41 82 01 24 */ beq .L_00000C74 -/* 00000B54 00000B94 38 04 FF FB */ subi r0, r4, 0x5 -/* 00000B58 00000B98 28 00 00 07 */ cmplwi r0, 0x7 -/* 00000B5C 00000B9C 41 81 01 18 */ bgt .L_00000C74 -/* 00000B60 00000BA0 3C 80 00 00 */ lis r4, "@229"@ha -/* 00000B64 00000BA4 38 84 00 00 */ addi r4, r4, "@229"@l -/* 00000B68 00000BA8 54 00 10 3A */ slwi r0, r0, 2 -/* 00000B6C 00000BAC 7C 04 00 2E */ lwzx r0, r4, r0 -/* 00000B70 00000BB0 7C 09 03 A6 */ mtctr r0 -/* 00000B74 00000BB4 4E 80 04 20 */ bctr -.L_00000B78: -/* 00000B78 00000BB8 C8 20 00 00 */ lfd f1, "@228"@sda21(r0) -/* 00000B7C 00000BBC C0 05 00 00 */ lfs f0, 0x0(r5) -/* 00000B80 00000BC0 FC 01 00 32 */ fmul f0, f1, f0 -/* 00000B84 00000BC4 FC 00 00 1E */ fctiwz f0, f0 -/* 00000B88 00000BC8 D8 01 00 18 */ stfd f0, 0x18(r1) -/* 00000B8C 00000BCC 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 00000B90 00000BD0 98 03 00 10 */ stb r0, 0x10(r3) -/* 00000B94 00000BD4 48 00 00 E0 */ b .L_00000C74 -.L_00000B98: -/* 00000B98 00000BD8 C8 20 00 00 */ lfd f1, "@228"@sda21(r0) -/* 00000B9C 00000BDC C0 05 00 00 */ lfs f0, 0x0(r5) -/* 00000BA0 00000BE0 FC 01 00 32 */ fmul f0, f1, f0 -/* 00000BA4 00000BE4 FC 00 00 1E */ fctiwz f0, f0 -/* 00000BA8 00000BE8 D8 01 00 18 */ stfd f0, 0x18(r1) -/* 00000BAC 00000BEC 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 00000BB0 00000BF0 98 03 00 11 */ stb r0, 0x11(r3) -/* 00000BB4 00000BF4 48 00 00 C0 */ b .L_00000C74 -.L_00000BB8: -/* 00000BB8 00000BF8 C8 20 00 00 */ lfd f1, "@228"@sda21(r0) -/* 00000BBC 00000BFC C0 05 00 00 */ lfs f0, 0x0(r5) -/* 00000BC0 00000C00 FC 01 00 32 */ fmul f0, f1, f0 -/* 00000BC4 00000C04 FC 00 00 1E */ fctiwz f0, f0 -/* 00000BC8 00000C08 D8 01 00 18 */ stfd f0, 0x18(r1) -/* 00000BCC 00000C0C 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 00000BD0 00000C10 98 03 00 12 */ stb r0, 0x12(r3) -/* 00000BD4 00000C14 48 00 00 A0 */ b .L_00000C74 -.L_00000BD8: -/* 00000BD8 00000C18 C8 20 00 00 */ lfd f1, "@228"@sda21(r0) -/* 00000BDC 00000C1C C0 05 00 00 */ lfs f0, 0x0(r5) -/* 00000BE0 00000C20 FC 01 00 32 */ fmul f0, f1, f0 -/* 00000BE4 00000C24 FC 00 00 1E */ fctiwz f0, f0 -/* 00000BE8 00000C28 D8 01 00 18 */ stfd f0, 0x18(r1) -/* 00000BEC 00000C2C 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 00000BF0 00000C30 98 03 00 13 */ stb r0, 0x13(r3) -/* 00000BF4 00000C34 48 00 00 80 */ b .L_00000C74 -.L_00000BF8: -/* 00000BF8 00000C38 C8 20 00 00 */ lfd f1, "@228"@sda21(r0) -/* 00000BFC 00000C3C C0 05 00 00 */ lfs f0, 0x0(r5) -/* 00000C00 00000C40 FC 01 00 32 */ fmul f0, f1, f0 -/* 00000C04 00000C44 FC 00 00 1E */ fctiwz f0, f0 -/* 00000C08 00000C48 D8 01 00 18 */ stfd f0, 0x18(r1) -/* 00000C0C 00000C4C 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 00000C10 00000C50 98 03 00 0C */ stb r0, 0xc(r3) -/* 00000C14 00000C54 48 00 00 60 */ b .L_00000C74 -.L_00000C18: -/* 00000C18 00000C58 C8 20 00 00 */ lfd f1, "@228"@sda21(r0) -/* 00000C1C 00000C5C C0 05 00 00 */ lfs f0, 0x0(r5) -/* 00000C20 00000C60 FC 01 00 32 */ fmul f0, f1, f0 -/* 00000C24 00000C64 FC 00 00 1E */ fctiwz f0, f0 -/* 00000C28 00000C68 D8 01 00 18 */ stfd f0, 0x18(r1) -/* 00000C2C 00000C6C 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 00000C30 00000C70 98 03 00 0D */ stb r0, 0xd(r3) -/* 00000C34 00000C74 48 00 00 40 */ b .L_00000C74 -.L_00000C38: -/* 00000C38 00000C78 C8 20 00 00 */ lfd f1, "@228"@sda21(r0) -/* 00000C3C 00000C7C C0 05 00 00 */ lfs f0, 0x0(r5) -/* 00000C40 00000C80 FC 01 00 32 */ fmul f0, f1, f0 -/* 00000C44 00000C84 FC 00 00 1E */ fctiwz f0, f0 -/* 00000C48 00000C88 D8 01 00 18 */ stfd f0, 0x18(r1) -/* 00000C4C 00000C8C 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 00000C50 00000C90 98 03 00 0E */ stb r0, 0xe(r3) -/* 00000C54 00000C94 48 00 00 20 */ b .L_00000C74 -.L_00000C58: -/* 00000C58 00000C98 C8 20 00 00 */ lfd f1, "@228"@sda21(r0) -/* 00000C5C 00000C9C C0 05 00 00 */ lfs f0, 0x0(r5) -/* 00000C60 00000CA0 FC 01 00 32 */ fmul f0, f1, f0 -/* 00000C64 00000CA4 FC 00 00 1E */ fctiwz f0, f0 -/* 00000C68 00000CA8 D8 01 00 18 */ stfd f0, 0x18(r1) -/* 00000C6C 00000CAC 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 00000C70 00000CB0 98 03 00 0F */ stb r0, 0xf(r3) -.L_00000C74: -/* 00000C74 00000CB4 38 21 00 20 */ addi r1, r1, 0x20 -/* 00000C78 00000CB8 4E 80 00 20 */ blr -.endfn ChanUpdateFunc - -.fn _HSD_StateInvalidateColorChannel, global -/* 00000C7C 00000CBC 7C 08 02 A6 */ mflr r0 -/* 00000C80 00000CC0 3C 60 00 00 */ lis r3, prev_ch@ha -/* 00000C84 00000CC4 90 01 00 04 */ stw r0, 0x4(r1) -/* 00000C88 00000CC8 3C 80 00 00 */ lis r4, invalid_prev_ch@ha -/* 00000C8C 00000CCC 38 63 00 00 */ addi r3, r3, prev_ch@l -/* 00000C90 00000CD0 94 21 FF F8 */ stwu r1, -0x8(r1) -/* 00000C94 00000CD4 38 84 00 00 */ addi r4, r4, invalid_prev_ch@l -/* 00000C98 00000CD8 38 A0 00 C0 */ li r5, 0xc0 -/* 00000C9C 00000CDC 48 00 00 01 */ bl memcpy -/* 00000CA0 00000CE0 38 A0 00 01 */ li r5, 0x1 -/* 00000CA4 00000CE4 90 A0 00 00 */ stw r5, prev_amb_invalid@sda21(r0) -/* 00000CA8 00000CE8 38 80 00 00 */ li r4, prev_amb_invalid@sda21 -/* 00000CAC 00000CEC 38 60 00 00 */ li r3, prev_mat_invalid@sda21 -/* 00000CB0 00000CF0 90 A4 00 04 */ stw r5, 0x4(r4) -/* 00000CB4 00000CF4 38 00 FF FF */ li r0, -0x1 -/* 00000CB8 00000CF8 90 A0 00 00 */ stw r5, prev_mat_invalid@sda21(r0) -/* 00000CBC 00000CFC 90 A3 00 04 */ stw r5, 0x4(r3) -/* 00000CC0 00000D00 90 00 00 00 */ stw r0, prev_num_chans@sda21(r0) -/* 00000CC4 00000D04 80 01 00 0C */ lwz r0, 0xc(r1) -/* 00000CC8 00000D08 38 21 00 08 */ addi r1, r1, 0x8 -/* 00000CCC 00000D0C 7C 08 03 A6 */ mtlr r0 -/* 00000CD0 00000D10 4E 80 00 20 */ blr -.endfn _HSD_StateInvalidateColorChannel - -.fn _HSD_StateInvalidateTevStage, global -/* 00000CD4 00000D14 38 00 00 00 */ li r0, 0x0 -/* 00000CD8 00000D18 90 00 00 00 */ stw r0, current_tev@sda21(r0) -/* 00000CDC 00000D1C 4E 80 00 20 */ blr -.endfn _HSD_StateInvalidateTevStage - -.fn _HSD_StateInvalidateTevRegister, global -/* 00000CE0 00000D20 3C 60 00 00 */ lis r3, TevReg@ha -/* 00000CE4 00000D24 38 63 00 00 */ addi r3, r3, TevReg@l -/* 00000CE8 00000D28 38 00 00 00 */ li r0, 0x0 -/* 00000CEC 00000D2C 90 03 00 08 */ stw r0, 0x8(r3) -/* 00000CF0 00000D30 90 03 00 14 */ stw r0, 0x14(r3) -/* 00000CF4 00000D34 90 03 00 20 */ stw r0, 0x20(r3) -/* 00000CF8 00000D38 90 03 00 2C */ stw r0, 0x2c(r3) -/* 00000CFC 00000D3C 4E 80 00 20 */ blr -.endfn _HSD_StateInvalidateTevRegister - -.fn _HSD_StateInvalidateTexCoordGen, global -/* 00000D00 00000D40 38 00 00 00 */ li r0, 0x0 -/* 00000D04 00000D44 90 00 00 00 */ stw r0, num_tex_gens@sda21(r0) -/* 00000D08 00000D48 4E 80 00 20 */ blr -.endfn _HSD_StateInvalidateTexCoordGen - -# 0x00000000 - 0x00000290 -.data -.balign 8 - -.obj TevReg, local - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 -.endobj TevReg - -.obj prev_ch, local - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000002 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000001 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000002 - .4byte 0x00000002 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000002 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000002 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000003 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000002 - .4byte 0x00000002 - .4byte 0x00000000 -.endobj prev_ch - -.obj "@145", local - .rel HSD_Index2TevStage, .L_00000770 - .rel HSD_Index2TevStage, .L_00000778 - .rel HSD_Index2TevStage, .L_00000780 - .rel HSD_Index2TevStage, .L_00000788 - .rel HSD_Index2TevStage, .L_00000790 - .rel HSD_Index2TevStage, .L_00000798 - .rel HSD_Index2TevStage, .L_000007A0 - .rel HSD_Index2TevStage, .L_000007A8 - .rel HSD_Index2TevStage, .L_000007B0 - .rel HSD_Index2TevStage, .L_000007B8 - .rel HSD_Index2TevStage, .L_000007C0 - .rel HSD_Index2TevStage, .L_000007C8 - .rel HSD_Index2TevStage, .L_000007D0 - .rel HSD_Index2TevStage, .L_000007D8 - .rel HSD_Index2TevStage, .L_000007E0 - .rel HSD_Index2TevStage, .L_000007E8 -.endobj "@145" - -.obj "@165", local - .rel HSD_TevStage2Index, .L_00000840 - .rel HSD_TevStage2Index, .L_00000848 - .rel HSD_TevStage2Index, .L_00000850 - .rel HSD_TevStage2Index, .L_00000858 - .rel HSD_TevStage2Index, .L_00000860 - .rel HSD_TevStage2Index, .L_00000868 - .rel HSD_TevStage2Index, .L_00000870 - .rel HSD_TevStage2Index, .L_00000878 - .rel HSD_TevStage2Index, .L_00000880 - .rel HSD_TevStage2Index, .L_00000888 - .rel HSD_TevStage2Index, .L_00000890 - .rel HSD_TevStage2Index, .L_00000898 - .rel HSD_TevStage2Index, .L_000008A0 - .rel HSD_TevStage2Index, .L_000008A8 - .rel HSD_TevStage2Index, .L_000008B0 - .rel HSD_TevStage2Index, .L_000008B8 -.endobj "@165" - -.obj "@185", local - .rel HSD_TevStage2Num, .L_00000910 - .rel HSD_TevStage2Num, .L_00000918 - .rel HSD_TevStage2Num, .L_00000920 - .rel HSD_TevStage2Num, .L_00000928 - .rel HSD_TevStage2Num, .L_00000930 - .rel HSD_TevStage2Num, .L_00000938 - .rel HSD_TevStage2Num, .L_00000940 - .rel HSD_TevStage2Num, .L_00000948 - .rel HSD_TevStage2Num, .L_00000950 - .rel HSD_TevStage2Num, .L_00000958 - .rel HSD_TevStage2Num, .L_00000960 - .rel HSD_TevStage2Num, .L_00000968 - .rel HSD_TevStage2Num, .L_00000970 - .rel HSD_TevStage2Num, .L_00000978 - .rel HSD_TevStage2Num, .L_00000980 - .rel HSD_TevStage2Num, .L_00000988 -.endobj "@185" - -.obj "@229", local - .rel ChanUpdateFunc, .L_00000B78 - .rel ChanUpdateFunc, .L_00000B98 - .rel ChanUpdateFunc, .L_00000BB8 - .rel ChanUpdateFunc, .L_00000BD8 - .rel ChanUpdateFunc, .L_00000BF8 - .rel ChanUpdateFunc, .L_00000C18 - .rel ChanUpdateFunc, .L_00000C38 - .rel ChanUpdateFunc, .L_00000C58 -.endobj "@229" - -.obj invalid_prev_ch, local - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000002 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000001 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000002 - .4byte 0x00000002 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000002 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000002 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000003 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000000 - .4byte 0x00000002 - .4byte 0x00000002 - .4byte 0x00000000 -.endobj invalid_prev_ch - -# 0x00000000 - 0x00000088 -.section .bss, "wa", @nobits -.balign 8 - -.obj render_alloc_data, global - .skip 0x2C -.endobj render_alloc_data - -.obj tevreg_alloc_data, global - .skip 0x2C -.endobj tevreg_alloc_data - -.obj chan_alloc_data, global - .skip 0x2C -.endobj chan_alloc_data - -.obj gap_08_804C087C_bss, global -.hidden gap_08_804C087C_bss - .skip 0x4 -.endobj gap_08_804C087C_bss - -# 0x00000000 - 0x00000010 -.section .sdata, "wa" -.balign 8 - -.obj "@124", local - .4byte 0x7465762E - .2byte 0x6300 -.endobj "@124" - -.obj gap_09_804D5CD6_sdata, global -.hidden gap_09_804D5CD6_sdata - .2byte 0x0000 -.endobj gap_09_804D5CD6_sdata - -.obj "@125", local - .2byte 0x3000 -.endobj "@125" - -.obj gap_09_804D5CDA_sdata, global -.hidden gap_09_804D5CDA_sdata - .4byte 0x00000000 - .2byte 0x0000 -.endobj gap_09_804D5CDA_sdata - -# 0x00000000 - 0x00000020 -.section .sbss, "wa", @nobits -.balign 8 - -.obj current_tev, local - .skip 0x4 -.endobj current_tev - -.obj num_tex_gens, local - .skip 0x4 -.endobj num_tex_gens - -.obj prev_num_chans, local - .skip 0x4 -.endobj prev_num_chans - -.obj prev_amb_invalid, local - .skip 0x8 -.endobj prev_amb_invalid - -.obj prev_mat_invalid, local - .skip 0x8 -.endobj prev_mat_invalid - -.obj gap_10_804D7614_sbss, global -.hidden gap_10_804D7614_sbss - .skip 0x4 -.endobj gap_10_804D7614_sbss - -# 0x00000000 - 0x00000008 -.section .sdata2, "a" -.balign 8 - -.obj "@228", local - .4byte 0x406FE000 - .4byte 0x00000000 -.endobj "@228" diff --git a/configure.py b/configure.py index 329ce88ebb..c9d8655783 100755 --- a/configure.py +++ b/configure.py @@ -1409,7 +1409,7 @@ def RuntimeLib(lib_name: str, objects: Objects) -> LibDict: Object(Matching, "sysdolphin/baselib/dobj.c"), Object(Matching, "sysdolphin/baselib/tobj.c"), Object(Matching, "sysdolphin/baselib/state.c"), - Object(NonMatching, "sysdolphin/baselib/tev.c"), + Object(Matching, "sysdolphin/baselib/tev.c"), Object(Matching, "sysdolphin/baselib/mobj.c"), Object(Matching, "sysdolphin/baselib/aobj.c"), Object(Matching, "sysdolphin/baselib/lobj.c"), diff --git a/obj_files.mk b/obj_files.mk index 2494998ff4..1569181f84 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -954,7 +954,7 @@ TEXT_O_FILES +=\ $(BUILD_DIR)/src/sysdolphin/baselib/dobj.c.o\ $(BUILD_DIR)/src/sysdolphin/baselib/tobj.c.o\ $(BUILD_DIR)/src/sysdolphin/baselib/state.c.o\ - $(BUILD_DIR)/asm/sysdolphin/baselib/tev.s.o\ + $(BUILD_DIR)/src/sysdolphin/baselib/tev.c.o\ $(BUILD_DIR)/src/sysdolphin/baselib/mobj.c.o\ $(BUILD_DIR)/src/sysdolphin/baselib/aobj.c.o\ $(BUILD_DIR)/src/sysdolphin/baselib/lobj.c.o\ diff --git a/src/sysdolphin/baselib/state.h b/src/sysdolphin/baselib/state.h index 0bde7af0d9..4782727aca 100644 --- a/src/sysdolphin/baselib/state.h +++ b/src/sysdolphin/baselib/state.h @@ -18,16 +18,16 @@ typedef struct HSD_Chan { struct HSD_Chan* next; - u32 chan; + GXChannelID chan; u32 flags; GXColor amb_color; GXColor mat_color; u8 enable; - u32 amb_src; - u32 mat_src; - s32 light_mask; - u32 diff_fn; - u32 attn_fn; + GXColorSrc amb_src; + GXColorSrc mat_src; + GXLightID light_mask; + GXDiffuseFn diff_fn; + GXAttnFn attn_fn; HSD_AObj* aobj; } HSD_Chan; diff --git a/src/sysdolphin/baselib/tev.c b/src/sysdolphin/baselib/tev.c index fdc3edba18..4121ce8353 100644 --- a/src/sysdolphin/baselib/tev.c +++ b/src/sysdolphin/baselib/tev.c @@ -57,13 +57,120 @@ HSD_ObjAllocData* HSD_ChanGetAllocData(void) return &chan_alloc_data; } +static bool CompareRGB(GXColor* c0, GXColor* c1) +{ + u32* d0 = (u32*) c0; + u32* d1 = (u32*) c1; + return ((*d0 ^ *d1) & 0xFFFFFF00) != 0; +} + +static bool CompareRGBA(GXColor* c0, GXColor* c1) +{ + u32* d0 = (u32*) c0; + u32* d1 = (u32*) c1; + return *d0 != *d1; +} + +static void CopyRGB(GXColor* dst, GXColor* src) +{ + u32* d = (u32*) dst; + u32* s = (u32*) src; + *d = (*d & 0xff) | (*s & 0xffffff00); +} + +static void setAmbColor(int channel, GXColor amb) +{ + GXColor* col = &amb; + GXSetChanAmbColor(channel, col); +} + +static void setMatColor(int channel, GXColor mat) +{ + GXColor* col = &mat; + GXSetChanMatColor(channel, col); +} + void HSD_SetupChannel(HSD_Chan* ch) { int idx; GXChannelID chan; int no; - NOT_IMPLEMENTED; + if (ch == NULL || ch->chan == GX_COLOR_NULL) { + return; + } + + chan = ch->chan; + idx = chan & 3; + no = chan & 1; + if (ch->enable != GX_DISABLE && ch->amb_src == GX_SRC_REG) { + if (prev_amb_invalid[no] != 0) { + prev_amb_invalid[no] = 0; + setAmbColor(no + 4, ch->amb_color); + prev_ch[no].amb_color = ch->amb_color; + } else if (chan == GX_COLOR0A0 || chan == GX_COLOR1A1) { + if (CompareRGBA(&ch->amb_color, &prev_ch[no].amb_color)) { + prev_ch[no].amb_color = ch->amb_color; + goto set_amb; + } + } else if (chan == GX_COLOR0 || chan == GX_COLOR1) { + if (CompareRGB(&ch->amb_color, &prev_ch[no].amb_color)) { + CopyRGB(&prev_ch[no].amb_color, &ch->amb_color); + goto set_amb; + } + } else if (ch->amb_color.a != prev_ch[no].amb_color.a) { + prev_ch[no].amb_color.a = ch->amb_color.a; + set_amb: + setAmbColor(chan, ch->amb_color); + } + } + + if (ch->mat_src == GX_SRC_REG) { + if (prev_mat_invalid[no] != 0) { + prev_mat_invalid[no] = 0; + setMatColor(no + 4, ch->mat_color); + prev_ch[no].mat_color = ch->mat_color; + } else if (chan == GX_COLOR0A0 || chan == GX_COLOR1A1) { + if (CompareRGBA(&ch->mat_color, &prev_ch[no].mat_color)) { + prev_ch[no].mat_color = ch->mat_color; + goto set_mat; + } + } else if (chan == GX_COLOR0 || chan == GX_COLOR1) { + if (CompareRGB(&ch->mat_color, &prev_ch[no].mat_color)) { + CopyRGB(&prev_ch[no].mat_color, &ch->mat_color); + goto set_mat; + } + } else if (ch->mat_color.a != prev_ch[no].mat_color.a) { + prev_ch[no].mat_color.a = ch->mat_color.a; + set_mat: + setMatColor(chan, ch->mat_color); + } + } + + if ((ch->enable != prev_ch[idx].enable) || + (ch->amb_src != prev_ch[idx].amb_src) || + (ch->mat_src != prev_ch[idx].mat_src) || + (ch->light_mask != prev_ch[idx].light_mask) || + (ch->diff_fn != prev_ch[idx].diff_fn) || + (ch->attn_fn != prev_ch[idx].attn_fn)) + { + GXSetChanCtrl(chan, ch->enable, ch->amb_src, ch->mat_src, + ch->light_mask, ch->diff_fn, ch->attn_fn); + prev_ch[idx].enable = ch->enable; + prev_ch[idx].amb_src = ch->amb_src; + prev_ch[idx].mat_src = ch->mat_src; + prev_ch[idx].light_mask = ch->light_mask; + prev_ch[idx].diff_fn = ch->diff_fn; + prev_ch[idx].attn_fn = ch->attn_fn; + if (chan == GX_COLOR0A0 || chan == GX_COLOR1A1) { + prev_ch[idx + 2].enable = ch->enable; + prev_ch[idx + 2].amb_src = ch->amb_src; + prev_ch[idx + 2].mat_src = ch->mat_src; + prev_ch[idx + 2].light_mask = ch->light_mask; + prev_ch[idx + 2].diff_fn = ch->diff_fn; + prev_ch[idx + 2].attn_fn = ch->attn_fn; + } + } } void HSD_StateSetNumChans(int num) @@ -155,16 +262,17 @@ void HSD_SetupTevStage(HSD_TevDesc* desc) #pragma dont_inline on void HSD_SetupTevStageAll(HSD_TevDesc* desc) { - int var_r31 = 0; - while (desc != NULL) { - int temp_r3 = HSD_TevStage2Num(desc->stage); - if (temp_r3 > var_r31) { - var_r31 = temp_r3; + int num = 0; + HSD_TevDesc* td; + + for (td = desc; td != NULL; td = td->next) { + int tmp = HSD_TevStage2Num(td->stage); + if (tmp > num) { + num = tmp; } - HSD_SetupTevStage(desc); - desc = desc->next; + HSD_SetupTevStage(td); } - current_tev = var_r31; + current_tev = num; GXSetNumTevStages(current_tev); current_tev = 0; }