Begin CGX/CCubeMaterial; add dolphin headers from aurora

Former-commit-id: b28e24862b
This commit is contained in:
Luke Street 2022-08-30 00:05:16 -04:00
parent 00c77e6195
commit 6768dfc9b4
67 changed files with 2363 additions and 314 deletions

View File

@ -111,7 +111,8 @@ ifeq ($(VERBOSE),0)
# this set of LDFLAGS generates no warnings.
LDFLAGS := $(MAPGEN) -fp fmadd -nodefaults -w off
endif
CFLAGS_BASE = -proc gekko -nodefaults -Cpp_exceptions off -RTTI off -fp hard -fp_contract on -O4,p -maxerrors 1 -enum int -inline auto -str reuse -nosyspath -MMD $(INCLUDES)
DEFINES = -DPRIME1 -DVERSION=$(VERSION_NUM)
CFLAGS_BASE = -proc gekko -nodefaults -Cpp_exceptions off -RTTI off -fp hard -fp_contract on -O4,p -maxerrors 1 -enum int -inline auto -str reuse -nosyspath -MMD $(DEFINES) $(INCLUDES)
CFLAGS = $(CFLAGS_BASE) -use_lmw_stmw on -str reuse,pool,readonly -gccinc -inline deferred,noauto -common on
CFLAGS_RUNTIME = $(CFLAGS_BASE) -use_lmw_stmw on -str reuse,pool,readonly -gccinc -inline deferred,auto
CFLAGS_MUSYX = $(CFLAGS_BASE) -str reuse,pool,readonly

View File

@ -717,10 +717,10 @@ lbl_80345FFC:
/* 80346004 00342F64 92 A1 00 38 */ stw r21, 0x38(r1)
/* 80346008 00342F68 41 82 00 7C */ beq lbl_80346084
/* 8034600C 00342F6C 82 C1 00 3C */ lwz r22, 0x3c(r1)
/* 80346010 00342F70 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346010 00342F70 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346014 00342F74 3A 40 00 00 */ li r18, 0
/* 80346018 00342F78 80 16 00 00 */ lwz r0, 0(r22)
/* 8034601C 00342F7C 3A 83 53 EC */ addi r20, r3, lbl_805A53EC@l
/* 8034601C 00342F7C 3A 83 53 EC */ addi r20, r3, sGXState__3CGX@l
/* 80346020 00342F80 90 01 00 38 */ stw r0, 0x38(r1)
/* 80346024 00342F84 48 00 00 40 */ b lbl_80346064
lbl_80346028:
@ -756,8 +756,8 @@ lbl_80346084:
/* 80346090 00342FF0 83 64 00 00 */ lwz r27, 0(r4)
/* 80346094 00342FF4 54 00 FF FF */ rlwinm. r0, r0, 0x1f, 0x1f, 0x1f
/* 80346098 00342FF8 41 82 00 40 */ beq lbl_803460D8
/* 8034609C 00342FFC 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803460A0 00343000 3A 43 53 EC */ addi r18, r3, lbl_805A53EC@l
/* 8034609C 00342FFC 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803460A0 00343000 3A 43 53 EC */ addi r18, r3, sGXState__3CGX@l
/* 803460A4 00343004 A0 12 00 56 */ lhz r0, 0x56(r18)
/* 803460A8 00343008 28 00 00 25 */ cmplwi r0, 0x25
/* 803460AC 0034300C 41 82 00 3C */ beq lbl_803460E8
@ -905,11 +905,11 @@ lbl_8034629C:
/* 803462B8 00343218 41 81 00 08 */ bgt lbl_803462C0
/* 803462BC 0034321C 7E BC AB 78 */ mr r28, r21
lbl_803462C0:
/* 803462C0 00343220 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803462C0 00343220 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803462C4 00343224 82 C1 00 10 */ lwz r22, 0x10(r1)
/* 803462C8 00343228 3A 80 00 00 */ li r20, 0
/* 803462CC 0034322C 3A 60 00 00 */ li r19, 0
/* 803462D0 00343230 3A 43 53 EC */ addi r18, r3, lbl_805A53EC@l
/* 803462D0 00343230 3A 43 53 EC */ addi r18, r3, sGXState__3CGX@l
/* 803462D4 00343234 48 00 00 50 */ b lbl_80346324
lbl_803462D8:
/* 803462D8 00343238 7C 72 9A 14 */ add r3, r18, r19
@ -942,11 +942,11 @@ lbl_80346324:
/* 8034633C 0034329C 90 01 00 10 */ stw r0, 0x10(r1)
/* 80346340 003432A0 48 00 00 84 */ b lbl_803463C4
lbl_80346344:
/* 80346344 003432A4 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346344 003432A4 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346348 003432A8 83 93 00 00 */ lwz r28, 0(r19)
/* 8034634C 003432AC 3A 80 00 00 */ li r20, 0
/* 80346350 003432B0 3A A0 00 00 */ li r21, 0
/* 80346354 003432B4 3A 43 53 EC */ addi r18, r3, lbl_805A53EC@l
/* 80346354 003432B4 3A 43 53 EC */ addi r18, r3, sGXState__3CGX@l
/* 80346358 003432B8 48 00 00 50 */ b lbl_803463A8
lbl_8034635C:
/* 8034635C 003432BC 7C 72 AA 14 */ add r3, r18, r21
@ -1077,18 +1077,18 @@ lbl_80346510:
/* 80346524 00343484 48 00 0D 01 */ bl DoModelShadow__FUiUi
/* 80346528 00343488 3B 9C 00 01 */ addi r28, r28, 1
lbl_8034652C:
/* 8034652C 0034348C 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 8034652C 0034348C 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80346530 00343490 57 A3 06 3E */ clrlwi r3, r29, 0x18
/* 80346534 00343494 38 84 53 EC */ addi r4, r4, lbl_805A53EC@l
/* 80346534 00343494 38 84 53 EC */ addi r4, r4, sGXState__3CGX@l
/* 80346538 00343498 88 04 00 51 */ lbz r0, 0x51(r4)
/* 8034653C 0034349C 7C 00 18 40 */ cmplw r0, r3
/* 80346540 003434A0 41 82 00 0C */ beq lbl_8034654C
/* 80346544 003434A4 9B A4 00 51 */ stb r29, 0x51(r4)
/* 80346548 003434A8 48 03 4D 71 */ bl GXSetNumIndStages
lbl_8034654C:
/* 8034654C 003434AC 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 8034654C 003434AC 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346550 003434B0 80 A1 00 34 */ lwz r5, 0x34(r1)
/* 80346554 003434B4 38 83 53 EC */ addi r4, r3, lbl_805A53EC@l
/* 80346554 003434B4 38 83 53 EC */ addi r4, r3, sGXState__3CGX@l
/* 80346558 003434B8 88 04 00 50 */ lbz r0, 0x50(r4)
/* 8034655C 003434BC 54 A3 06 3E */ clrlwi r3, r5, 0x18
/* 80346560 003434C0 7C 00 18 40 */ cmplw r0, r3
@ -1096,18 +1096,18 @@ lbl_8034654C:
/* 80346568 003434C8 98 64 00 50 */ stb r3, 0x50(r4)
/* 8034656C 003434CC 48 03 56 61 */ bl GXSetNumTevStages
lbl_80346570:
/* 80346570 003434D0 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80346570 003434D0 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80346574 003434D4 57 83 06 3E */ clrlwi r3, r28, 0x18
/* 80346578 003434D8 38 84 53 EC */ addi r4, r4, lbl_805A53EC@l
/* 80346578 003434D8 38 84 53 EC */ addi r4, r4, sGXState__3CGX@l
/* 8034657C 003434DC 88 04 00 4F */ lbz r0, 0x4f(r4)
/* 80346580 003434E0 7C 03 00 40 */ cmplw r3, r0
/* 80346584 003434E4 41 82 00 0C */ beq lbl_80346590
/* 80346588 003434E8 9B 84 00 4F */ stb r28, 0x4f(r4)
/* 8034658C 003434EC 48 03 1C D9 */ bl GXSetNumTexGens
lbl_80346590:
/* 80346590 003434F0 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346590 003434F0 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346594 003434F4 57 06 06 3E */ clrlwi r6, r24, 0x18
/* 80346598 003434F8 38 A3 53 EC */ addi r5, r3, lbl_805A53EC@l
/* 80346598 003434F8 38 A3 53 EC */ addi r5, r3, sGXState__3CGX@l
/* 8034659C 003434FC 88 65 00 4D */ lbz r3, 0x4d(r5)
/* 803465A0 00343500 88 05 00 4C */ lbz r0, 0x4c(r5)
/* 803465A4 00343504 7C 86 18 50 */ subf r4, r6, r3
@ -1127,9 +1127,9 @@ lbl_803465BC:
DoPassthru__FUi:
/* 803465D0 00343530 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 803465D4 00343534 7C 08 02 A6 */ mflr r0
/* 803465D8 00343538 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 803465D8 00343538 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 803465DC 0034353C 90 01 00 14 */ stw r0, 0x14(r1)
/* 803465E0 00343540 38 04 53 EC */ addi r0, r4, lbl_805A53EC@l
/* 803465E0 00343540 38 04 53 EC */ addi r0, r4, sGXState__3CGX@l
/* 803465E4 00343544 93 E1 00 0C */ stw r31, 0xc(r1)
/* 803465E8 00343548 93 C1 00 08 */ stw r30, 8(r1)
/* 803465EC 0034354C 7C 7E 1B 78 */ mr r30, r3
@ -1227,10 +1227,10 @@ lbl_80346710:
/* 8034672C 0034368C 38 60 00 01 */ li r3, 1
lbl_80346730:
/* 80346730 00343690 54 60 0D FC */ rlwinm r0, r3, 1, 0x17, 0x1e
/* 80346734 00343694 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346734 00343694 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346738 00343698 60 00 00 01 */ ori r0, r0, 1
/* 8034673C 0034369C 7C A5 03 78 */ or r5, r5, r0
/* 80346740 003436A0 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80346740 003436A0 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80346744 003436A4 88 03 00 52 */ lbz r0, 0x52(r3)
/* 80346748 003436A8 54 A5 06 3E */ clrlwi r5, r5, 0x18
/* 8034674C 003436AC 7C 05 00 40 */ cmplw r5, r0
@ -1267,9 +1267,9 @@ HandleColorChannels__FUiUi:
/* 803467B4 00343714 41 82 01 5C */ beq lbl_80346910
/* 803467B8 00343718 28 1E 00 00 */ cmplwi r30, 0
/* 803467BC 0034371C 41 82 01 4C */ beq lbl_80346908
/* 803467C0 00343720 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803467C0 00343720 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803467C4 00343724 80 A2 CB B8 */ lwz r5, lbl_805AE8D8@sda21(r2)
/* 803467C8 00343728 3B A3 53 EC */ addi r29, r3, lbl_805A53EC@l
/* 803467C8 00343728 3B A3 53 EC */ addi r29, r3, sGXState__3CGX@l
/* 803467CC 0034372C 80 1D 00 3C */ lwz r0, 0x3c(r29)
/* 803467D0 00343730 7C 05 00 40 */ cmplw r5, r0
/* 803467D4 00343734 41 82 00 18 */ beq lbl_803467EC
@ -1290,8 +1290,8 @@ lbl_803467EC:
/* 8034680C 0034376C 48 03 32 31 */ bl GXSetChanMatColor
lbl_80346810:
/* 80346810 00343770 89 2D A9 A1 */ lbz r9, sChannel1EnableLightMask@sda21(r13)
/* 80346814 00343774 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346818 00343778 38 E3 53 EC */ addi r7, r3, lbl_805A53EC@l
/* 80346814 00343774 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346818 00343778 38 E3 53 EC */ addi r7, r3, sGXState__3CGX@l
/* 8034681C 0034377C 38 00 00 01 */ li r0, 1
/* 80346820 00343780 2C 09 00 00 */ cmpwi r9, 0
/* 80346824 00343784 A1 07 00 32 */ lhz r8, 0x32(r7)
@ -1302,10 +1302,10 @@ lbl_80346830:
/* 80346834 00343794 88 6D A8 16 */ lbz r3, mLightActive__9CGraphics@sda21(r13)
/* 80346838 00343798 88 0D A9 A0 */ lbz r0, sChannel0DisableLightMask@sda21(r13)
/* 8034683C 0034379C 51 25 1D 78 */ rlwimi r5, r9, 3, 0x15, 0x1c
/* 80346840 003437A0 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80346840 003437A0 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80346844 003437A4 60 A5 30 00 */ ori r5, r5, 0x3000
/* 80346848 003437A8 7C 60 00 78 */ andc r0, r3, r0
/* 8034684C 003437AC 38 C4 53 EC */ addi r6, r4, lbl_805A53EC@l
/* 8034684C 003437AC 38 C4 53 EC */ addi r6, r4, sGXState__3CGX@l
/* 80346850 003437B0 B0 A7 00 36 */ sth r5, 0x36(r7)
/* 80346854 003437B4 54 09 06 3F */ clrlwi. r9, r0, 0x18
/* 80346858 003437B8 7C 65 40 50 */ subf r3, r5, r8
@ -1329,9 +1329,9 @@ lbl_80346884:
/* 8034689C 003437FC B0 A6 00 34 */ sth r5, 0x34(r6)
/* 803468A0 00343800 98 06 00 4C */ stb r0, 0x4c(r6)
/* 803468A4 00343804 41 82 00 34 */ beq lbl_803468D8
/* 803468A8 00343808 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803468A8 00343808 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803468AC 0034380C 80 A2 CB BC */ lwz r5, lbl_805AE8DC@sda21(r2)
/* 803468B0 00343810 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 803468B0 00343810 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 803468B4 00343814 80 03 00 40 */ lwz r0, 0x40(r3)
/* 803468B8 00343818 7C 05 00 40 */ cmplw r5, r0
/* 803468BC 0034381C 41 82 00 4C */ beq lbl_80346908
@ -1342,8 +1342,8 @@ lbl_80346884:
/* 803468D0 00343830 48 03 31 6D */ bl GXSetChanMatColor
/* 803468D4 00343834 48 00 00 34 */ b lbl_80346908
lbl_803468D8:
/* 803468D8 00343838 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803468DC 0034383C 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 803468D8 00343838 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803468DC 0034383C 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 803468E0 00343840 80 A3 00 38 */ lwz r5, 0x38(r3)
/* 803468E4 00343844 80 03 00 40 */ lwz r0, 0x40(r3)
/* 803468E8 00343848 90 A1 00 2C */ stw r5, 0x2c(r1)
@ -1360,9 +1360,9 @@ lbl_80346908:
lbl_80346910:
/* 80346910 00343870 28 1E 00 02 */ cmplwi r30, 2
/* 80346914 00343874 40 82 00 58 */ bne lbl_8034696C
/* 80346918 00343878 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346918 00343878 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 8034691C 0034387C 80 A2 CB B8 */ lwz r5, lbl_805AE8D8@sda21(r2)
/* 80346920 00343880 3B A3 53 EC */ addi r29, r3, lbl_805A53EC@l
/* 80346920 00343880 3B A3 53 EC */ addi r29, r3, sGXState__3CGX@l
/* 80346924 00343884 80 1D 00 3C */ lwz r0, 0x3c(r29)
/* 80346928 00343888 7C 05 00 40 */ cmplw r5, r0
/* 8034692C 0034388C 41 82 00 18 */ beq lbl_80346944
@ -1383,9 +1383,9 @@ lbl_80346944:
/* 80346964 003438C4 48 03 30 D9 */ bl GXSetChanMatColor
/* 80346968 003438C8 48 00 00 30 */ b lbl_80346998
lbl_8034696C:
/* 8034696C 003438CC 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 8034696C 003438CC 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346970 003438D0 38 A0 40 00 */ li r5, 0x4000
/* 80346974 003438D4 38 C3 53 EC */ addi r6, r3, lbl_805A53EC@l
/* 80346974 003438D4 38 C3 53 EC */ addi r6, r3, sGXState__3CGX@l
/* 80346978 003438D8 A0 66 00 32 */ lhz r3, 0x32(r6)
/* 8034697C 003438DC 88 06 00 4C */ lbz r0, 0x4c(r6)
/* 80346980 003438E0 38 83 C0 00 */ addi r4, r3, -16384
@ -1398,8 +1398,8 @@ lbl_80346998:
/* 80346998 003438F8 28 1E 00 01 */ cmplwi r30, 1
/* 8034699C 003438FC 41 80 00 A8 */ blt lbl_80346A44
/* 803469A0 00343900 88 8D A8 16 */ lbz r4, mLightActive__9CGraphics@sda21(r13)
/* 803469A4 00343904 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803469A8 00343908 39 03 53 EC */ addi r8, r3, lbl_805A53EC@l
/* 803469A4 00343904 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803469A8 00343908 39 03 53 EC */ addi r8, r3, sGXState__3CGX@l
/* 803469AC 0034390C 57 E7 00 3C */ rlwinm r7, r31, 0, 0, 0x1e
/* 803469B0 00343910 2C 04 00 00 */ cmpwi r4, 0
/* 803469B4 00343914 A1 28 00 30 */ lhz r9, 0x30(r8)
@ -1407,9 +1407,9 @@ lbl_80346998:
/* 803469BC 0034391C 54 80 1D 78 */ rlwinm r0, r4, 3, 0x15, 0x1c
/* 803469C0 00343920 7F E7 03 78 */ or r7, r31, r0
lbl_803469C4:
/* 803469C4 00343924 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803469C4 00343924 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803469C8 00343928 54 80 06 3F */ clrlwi. r0, r4, 0x18
/* 803469CC 0034392C 38 C3 53 EC */ addi r6, r3, lbl_805A53EC@l
/* 803469CC 0034392C 38 C3 53 EC */ addi r6, r3, sGXState__3CGX@l
/* 803469D0 00343930 7C A7 48 50 */ subf r5, r7, r9
/* 803469D4 00343934 7C 89 38 50 */ subf r4, r9, r7
/* 803469D8 00343938 88 66 00 4C */ lbz r3, 0x4c(r6)
@ -1441,9 +1441,9 @@ lbl_80346A18:
/* 80346A3C 0034399C 48 03 30 01 */ bl GXSetChanMatColor
/* 80346A40 003439A0 48 00 00 30 */ b lbl_80346A70
lbl_80346A44:
/* 80346A44 003439A4 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346A44 003439A4 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346A48 003439A8 38 A0 40 00 */ li r5, 0x4000
/* 80346A4C 003439AC 38 C3 53 EC */ addi r6, r3, lbl_805A53EC@l
/* 80346A4C 003439AC 38 C3 53 EC */ addi r6, r3, sGXState__3CGX@l
/* 80346A50 003439B0 A0 66 00 30 */ lhz r3, 0x30(r6)
/* 80346A54 003439B4 88 06 00 4C */ lbz r0, 0x4c(r6)
/* 80346A58 003439B8 38 83 C0 00 */ addi r4, r3, -16384
@ -1478,8 +1478,8 @@ SetCurrentBlack__13CCubeMaterialCFv:
/* 80346AB8 00343A18 54 00 06 B7 */ rlwinm. r0, r0, 0, 0x1a, 0x1b
/* 80346ABC 00343A1C 83 C3 00 08 */ lwz r30, 8(r3)
/* 80346AC0 00343A20 41 82 00 40 */ beq lbl_80346B00
/* 80346AC4 00343A24 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346AC8 00343A28 3B E3 53 EC */ addi r31, r3, lbl_805A53EC@l
/* 80346AC4 00343A24 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346AC8 00343A28 3B E3 53 EC */ addi r31, r3, sGXState__3CGX@l
/* 80346ACC 00343A2C A0 1F 00 56 */ lhz r0, 0x56(r31)
/* 80346AD0 00343A30 28 00 00 21 */ cmplwi r0, 0x21
/* 80346AD4 00343A34 41 82 00 64 */ beq lbl_80346B38
@ -1494,8 +1494,8 @@ SetCurrentBlack__13CCubeMaterialCFv:
/* 80346AF8 00343A58 48 03 53 B5 */ bl GXSetBlendMode
/* 80346AFC 00343A5C 48 00 00 3C */ b lbl_80346B38
lbl_80346B00:
/* 80346B00 00343A60 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346B04 00343A64 3B E3 53 EC */ addi r31, r3, lbl_805A53EC@l
/* 80346B00 00343A60 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346B04 00343A64 3B E3 53 EC */ addi r31, r3, sGXState__3CGX@l
/* 80346B08 00343A68 A0 1F 00 56 */ lhz r0, 0x56(r31)
/* 80346B0C 00343A6C 28 00 00 05 */ cmplwi r0, 5
/* 80346B10 00343A70 41 82 00 28 */ beq lbl_80346B38
@ -1517,9 +1517,9 @@ lbl_80346B38:
/* 80346B4C 00343AAC 41 82 00 08 */ beq lbl_80346B54
/* 80346B50 00343AB0 38 E0 00 0C */ li r7, 0xc
lbl_80346B54:
/* 80346B54 00343AB4 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346B54 00343AB4 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346B58 00343AB8 54 E4 7B 20 */ rlwinm r4, r7, 0xf, 0xc, 0x10
/* 80346B5C 00343ABC 3B E3 53 EC */ addi r31, r3, lbl_805A53EC@l
/* 80346B5C 00343ABC 3B E3 53 EC */ addi r31, r3, sGXState__3CGX@l
/* 80346B60 00343AC0 80 1F 00 68 */ lwz r0, 0x68(r31)
/* 80346B64 00343AC4 60 83 3D EF */ ori r3, r4, 0x3def
/* 80346B68 00343AC8 7C 03 00 40 */ cmplw r3, r0
@ -1558,8 +1558,8 @@ lbl_80346BC8:
/* 80346BE0 00343B40 38 80 00 00 */ li r4, 0
/* 80346BE4 00343B44 48 03 4B E1 */ bl GXSetTevKAlphaSel
lbl_80346BE8:
/* 80346BE8 00343B48 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346BEC 00343B4C 38 A3 53 EC */ addi r5, r3, lbl_805A53EC@l
/* 80346BE8 00343B48 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346BEC 00343B4C 38 A3 53 EC */ addi r5, r3, sGXState__3CGX@l
/* 80346BF0 00343B50 80 65 02 28 */ lwz r3, 0x228(r5)
/* 80346BF4 00343B54 3C 03 FF E2 */ addis r0, r3, 0xffe2
/* 80346BF8 00343B58 28 00 94 01 */ cmplwi r0, 0x9401
@ -1590,8 +1590,8 @@ lbl_80346C28:
/* 80346C58 00343BB8 38 C0 00 FF */ li r6, 0xff
/* 80346C5C 00343BBC 48 03 4D 99 */ bl GXSetTevOrder
lbl_80346C60:
/* 80346C60 00343BC0 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346C64 00343BC4 38 83 53 EC */ addi r4, r3, lbl_805A53EC@l
/* 80346C60 00343BC0 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346C64 00343BC4 38 83 53 EC */ addi r4, r3, sGXState__3CGX@l
/* 80346C68 00343BC8 88 04 00 50 */ lbz r0, 0x50(r4)
/* 80346C6C 00343BCC 28 00 00 01 */ cmplwi r0, 1
/* 80346C70 00343BD0 41 82 00 14 */ beq lbl_80346C84
@ -1600,9 +1600,9 @@ lbl_80346C60:
/* 80346C7C 00343BDC 98 04 00 50 */ stb r0, 0x50(r4)
/* 80346C80 00343BE0 48 03 4F 4D */ bl GXSetNumTevStages
lbl_80346C84:
/* 80346C84 00343BE4 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346C84 00343BE4 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346C88 00343BE8 38 E0 00 00 */ li r7, 0
/* 80346C8C 00343BEC 38 C3 53 EC */ addi r6, r3, lbl_805A53EC@l
/* 80346C8C 00343BEC 38 C3 53 EC */ addi r6, r3, sGXState__3CGX@l
/* 80346C90 00343BF0 88 A6 00 4D */ lbz r5, 0x4d(r6)
/* 80346C94 00343BF4 88 06 00 4F */ lbz r0, 0x4f(r6)
/* 80346C98 00343BF8 7C 85 00 D0 */ neg r4, r5
@ -1618,8 +1618,8 @@ lbl_80346C84:
/* 80346CC0 00343C20 98 06 00 4F */ stb r0, 0x4f(r6)
/* 80346CC4 00343C24 48 03 15 A1 */ bl GXSetNumTexGens
lbl_80346CC8:
/* 80346CC8 00343C28 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346CCC 00343C2C 38 83 53 EC */ addi r4, r3, lbl_805A53EC@l
/* 80346CC8 00343C28 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346CCC 00343C2C 38 83 53 EC */ addi r4, r3, sGXState__3CGX@l
/* 80346CD0 00343C30 88 04 00 51 */ lbz r0, 0x51(r4)
/* 80346CD4 00343C34 28 00 00 00 */ cmplwi r0, 0
/* 80346CD8 00343C38 41 82 00 14 */ beq lbl_80346CEC
@ -1643,8 +1643,8 @@ EnsureTevsDirect__13CCubeMaterialFv:
/* 80346D10 00343C70 80 0D 9D 74 */ lwz r0, lbl_805A8934@sda21(r13)
/* 80346D14 00343C74 2C 00 FF FF */ cmpwi r0, -1
/* 80346D18 00343C78 41 82 00 60 */ beq lbl_80346D78
/* 80346D1C 00343C7C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346D20 00343C80 38 83 53 EC */ addi r4, r3, lbl_805A53EC@l
/* 80346D1C 00343C7C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346D20 00343C80 38 83 53 EC */ addi r4, r3, sGXState__3CGX@l
/* 80346D24 00343C84 88 04 00 51 */ lbz r0, 0x51(r4)
/* 80346D28 00343C88 28 00 00 00 */ cmplwi r0, 0
/* 80346D2C 00343C8C 41 82 00 14 */ beq lbl_80346D40
@ -1654,8 +1654,8 @@ EnsureTevsDirect__13CCubeMaterialFv:
/* 80346D3C 00343C9C 48 03 45 7D */ bl GXSetNumIndStages
lbl_80346D40:
/* 80346D40 00343CA0 80 6D 9D 74 */ lwz r3, lbl_805A8934@sda21(r13)
/* 80346D44 00343CA4 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80346D48 00343CA8 38 04 53 EC */ addi r0, r4, lbl_805A53EC@l
/* 80346D44 00343CA4 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80346D48 00343CA8 38 04 53 EC */ addi r0, r4, sGXState__3CGX@l
/* 80346D4C 00343CAC 1C 83 00 1C */ mulli r4, r3, 0x1c
/* 80346D50 00343CB0 7C 80 22 14 */ add r4, r0, r4
/* 80346D54 00343CB4 38 84 00 68 */ addi r4, r4, 0x68
@ -1692,9 +1692,9 @@ HandleReflection__13CCubeMaterialFb11_GXTexMapIDiUiUiUiUiRUiRUi:
/* 80346DBC 00343D1C 3B E0 00 00 */ li r31, 0
/* 80346DC0 00343D20 41 82 01 1C */ beq lbl_80346EDC
/* 80346DC4 00343D24 1C 9D 00 1C */ mulli r4, r29, 0x1c
/* 80346DC8 00343D28 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346DC8 00343D28 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346DCC 00343D2C 3B C0 00 06 */ li r30, 6
/* 80346DD0 00343D30 38 03 53 EC */ addi r0, r3, lbl_805A53EC@l
/* 80346DD0 00343D30 38 03 53 EC */ addi r0, r3, sGXState__3CGX@l
/* 80346DD4 00343D34 7C 60 22 14 */ add r3, r0, r4
/* 80346DD8 00343D38 3B E3 00 68 */ addi r31, r3, 0x68
/* 80346DDC 00343D3C 80 63 00 68 */ lwz r3, 0x68(r3)
@ -1781,9 +1781,9 @@ lbl_80346EE0:
/* 80346F04 00343E64 98 81 00 0E */ stb r4, 0xe(r1)
/* 80346F08 00343E68 98 81 00 0F */ stb r4, 0xf(r1)
/* 80346F0C 00343E6C 48 01 C4 91 */ bl Set__6CColorFffff
/* 80346F10 00343E70 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346F10 00343E70 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346F14 00343E74 57 64 10 3A */ slwi r4, r27, 2
/* 80346F18 00343E78 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80346F18 00343E78 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80346F1C 00343E7C 80 01 00 0C */ lwz r0, 0xc(r1)
/* 80346F20 00343E80 7C 63 22 14 */ add r3, r3, r4
/* 80346F24 00343E84 38 83 00 58 */ addi r4, r3, 0x58
@ -1797,9 +1797,9 @@ lbl_80346EE0:
/* 80346F44 00343EA4 48 03 47 A1 */ bl GXSetTevKColor
lbl_80346F48:
/* 80346F48 00343EA8 1C BD 00 1C */ mulli r5, r29, 0x1c
/* 80346F4C 00343EAC 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346F4C 00343EAC 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346F50 00343EB0 38 9B 00 0C */ addi r4, r27, 0xc
/* 80346F54 00343EB4 38 03 53 EC */ addi r0, r3, lbl_805A53EC@l
/* 80346F54 00343EB4 38 03 53 EC */ addi r0, r3, sGXState__3CGX@l
/* 80346F58 00343EB8 7C 60 2A 14 */ add r3, r0, r5
/* 80346F5C 00343EBC 38 63 00 68 */ addi r3, r3, 0x68
/* 80346F60 00343EC0 88 03 00 18 */ lbz r0, 0x18(r3)
@ -1822,9 +1822,9 @@ lbl_80346F78:
/* 80346FA0 00343F00 3B 78 00 01 */ addi r27, r24, 1
/* 80346FA4 00343F04 38 60 00 00 */ li r3, 0
/* 80346FA8 00343F08 48 03 41 FD */ bl GXSetIndTexOrder
/* 80346FAC 00343F0C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80346FAC 00343F0C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80346FB0 00343F10 57 04 10 3A */ slwi r4, r24, 2
/* 80346FB4 00343F14 38 03 53 EC */ addi r0, r3, lbl_805A53EC@l
/* 80346FB4 00343F14 38 03 53 EC */ addi r0, r3, sGXState__3CGX@l
/* 80346FB8 00343F18 7C 60 22 14 */ add r3, r0, r4
/* 80346FBC 00343F1C 38 A3 02 28 */ addi r5, r3, 0x228
/* 80346FC0 00343F20 80 63 02 28 */ lwz r3, 0x228(r3)
@ -1855,8 +1855,8 @@ lbl_80346FF8:
/* 80347020 00343F80 7C 03 E8 00 */ cmpw r3, r29
/* 80347024 00343F84 40 81 00 30 */ ble lbl_80347054
/* 80347028 00343F88 1C A3 00 1C */ mulli r5, r3, 0x1c
/* 8034702C 00343F8C 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80347030 00343F90 38 04 53 EC */ addi r0, r4, lbl_805A53EC@l
/* 8034702C 00343F8C 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80347030 00343F90 38 04 53 EC */ addi r0, r4, sGXState__3CGX@l
/* 80347034 00343F94 7C 80 2A 14 */ add r4, r0, r5
/* 80347038 00343F98 38 84 00 68 */ addi r4, r4, 0x68
/* 8034703C 00343F9C 80 04 00 10 */ lwz r0, 0x10(r4)
@ -1871,9 +1871,9 @@ lbl_80347054:
lbl_8034705C:
/* 8034705C 00343FBC 7F 1B C3 78 */ mr r27, r24
lbl_80347060:
/* 80347060 00343FC0 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80347060 00343FC0 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80347064 00343FC4 57 64 10 3A */ slwi r4, r27, 2
/* 80347068 00343FC8 38 03 53 EC */ addi r0, r3, lbl_805A53EC@l
/* 80347068 00343FC8 38 03 53 EC */ addi r0, r3, sGXState__3CGX@l
/* 8034706C 00343FCC 7C 60 22 14 */ add r3, r0, r4
/* 80347070 00343FD0 38 A3 02 28 */ addi r5, r3, 0x228
/* 80347074 00343FD4 80 63 02 28 */ lwz r3, 0x228(r3)
@ -1892,9 +1892,9 @@ lbl_80347060:
/* 803470A8 00344008 48 03 0E ED */ bl GXSetTexCoordGen2
lbl_803470AC:
/* 803470AC 0034400C 1C 9D 00 1C */ mulli r4, r29, 0x1c
/* 803470B0 00344010 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803470B0 00344010 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803470B4 00344014 57 C5 2D B4 */ rlwinm r5, r30, 5, 0x16, 0x1a
/* 803470B8 00344018 38 03 53 EC */ addi r0, r3, lbl_805A53EC@l
/* 803470B8 00344018 38 03 53 EC */ addi r0, r3, sGXState__3CGX@l
/* 803470BC 0034401C 7C 60 22 14 */ add r3, r0, r4
/* 803470C0 00344020 80 03 00 68 */ lwz r0, 0x68(r3)
/* 803470C4 00344024 60 A4 20 0F */ ori r4, r5, 0x200f
@ -1958,8 +1958,8 @@ SetTevIndWarp__3CGXF13_GXTevStageID16_GXIndTexStageIDUcUc14_GXIndTexMtxID:
lbl_80347194:
/* 80347194 003440F4 1D 23 00 1C */ mulli r9, r3, 0x1c
/* 80347198 003440F8 54 A0 06 3F */ clrlwi. r0, r5, 0x18
/* 8034719C 003440FC 3C C0 80 5A */ lis r6, lbl_805A53EC@ha
/* 803471A0 00344100 38 06 53 EC */ addi r0, r6, lbl_805A53EC@l
/* 8034719C 003440FC 3C C0 80 5A */ lis r6, sGXState__3CGX@ha
/* 803471A0 00344100 38 06 53 EC */ addi r0, r6, sGXState__3CGX@l
/* 803471A4 00344104 7C C0 4A 14 */ add r6, r0, r9
/* 803471A8 00344108 54 89 07 BE */ clrlwi r9, r4, 0x1e
/* 803471AC 0034410C 39 66 00 68 */ addi r11, r6, 0x68
@ -2057,9 +2057,9 @@ DoModelShadow__FUiUi:
/* 80347304 00344264 D0 21 00 20 */ stfs f1, 0x20(r1)
/* 80347308 00344268 D0 01 00 24 */ stfs f0, 0x24(r1)
/* 8034730C 0034426C 48 03 51 85 */ bl GXLoadTexMtxImm
/* 80347310 00344270 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80347310 00344270 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80347314 00344274 57 C4 10 3A */ slwi r4, r30, 2
/* 80347318 00344278 38 03 53 EC */ addi r0, r3, lbl_805A53EC@l
/* 80347318 00344278 38 03 53 EC */ addi r0, r3, sGXState__3CGX@l
/* 8034731C 0034427C 7C 60 22 14 */ add r3, r0, r4
/* 80347320 00344280 38 A3 02 28 */ addi r5, r3, 0x228
/* 80347324 00344284 80 63 02 28 */ lwz r3, 0x228(r3)
@ -2077,8 +2077,8 @@ DoModelShadow__FUiUi:
/* 80347354 003442B4 39 00 00 7D */ li r8, 0x7d
/* 80347358 003442B8 48 03 0C 3D */ bl GXSetTexCoordGen2
lbl_8034735C:
/* 8034735C 003442BC 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80347360 003442C0 3B E3 53 EC */ addi r31, r3, lbl_805A53EC@l
/* 8034735C 003442BC 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80347360 003442C0 3B E3 53 EC */ addi r31, r3, sGXState__3CGX@l
/* 80347364 003442C4 80 1F 00 70 */ lwz r0, 0x70(r31)
/* 80347368 003442C8 28 00 03 00 */ cmplwi r0, 0x300
/* 8034736C 003442CC 41 82 00 28 */ beq lbl_80347394
@ -2146,8 +2146,8 @@ lbl_8034742C:
/* 80347454 003443B4 38 C0 00 05 */ li r6, 5
/* 80347458 003443B8 48 03 45 9D */ bl GXSetTevOrder
lbl_8034745C:
/* 8034745C 003443BC 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80347460 003443C0 3B A3 53 EC */ addi r29, r3, lbl_805A53EC@l
/* 8034745C 003443BC 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80347460 003443C0 3B A3 53 EC */ addi r29, r3, sGXState__3CGX@l
/* 80347464 003443C4 80 1D 00 8C */ lwz r0, 0x8c(r29)
/* 80347468 003443C8 28 00 03 00 */ cmplwi r0, 0x300
/* 8034746C 003443CC 41 82 00 28 */ beq lbl_80347494
@ -2251,8 +2251,8 @@ lbl_803475CC:
/* 803475CC 0034452C 2C 00 00 03 */ cmpwi r0, 3
/* 803475D0 00344530 40 82 02 84 */ bne lbl_80347854
/* 803475D4 00344534 80 7E 00 00 */ lwz r3, 0(r30)
/* 803475D8 00344538 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 803475DC 0034453C 38 04 53 EC */ addi r0, r4, lbl_805A53EC@l
/* 803475D8 00344538 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 803475DC 0034453C 38 04 53 EC */ addi r0, r4, sGXState__3CGX@l
/* 803475E0 00344540 1C 83 00 1C */ mulli r4, r3, 0x1c
/* 803475E4 00344544 7C 7B 1B 78 */ mr r27, r3
/* 803475E8 00344548 3B 43 00 01 */ addi r26, r3, 1
@ -2340,8 +2340,8 @@ lbl_80347700:
/* 80347718 00344678 48 03 3B C9 */ bl GXSetTevDirect
lbl_8034771C:
/* 8034771C 0034467C 1C 9A 00 1C */ mulli r4, r26, 0x1c
/* 80347720 00344680 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80347724 00344684 38 03 53 EC */ addi r0, r3, lbl_805A53EC@l
/* 80347720 00344680 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80347724 00344684 38 03 53 EC */ addi r0, r3, sGXState__3CGX@l
/* 80347728 00344688 7C 60 22 14 */ add r3, r0, r4
/* 8034772C 0034468C 3B 83 00 68 */ addi r28, r3, 0x68
/* 80347730 00344690 80 63 00 68 */ lwz r3, 0x68(r3)
@ -2403,8 +2403,8 @@ lbl_803477D4:
/* 80347800 00344760 48 03 41 F5 */ bl GXSetTevOrder
lbl_80347804:
/* 80347804 00344764 80 7F 00 00 */ lwz r3, 0(r31)
/* 80347808 00344768 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 8034780C 0034476C 38 04 53 EC */ addi r0, r4, lbl_805A53EC@l
/* 80347808 00344768 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 8034780C 0034476C 38 04 53 EC */ addi r0, r4, sGXState__3CGX@l
/* 80347810 00344770 80 B9 00 04 */ lwz r5, 4(r25)
/* 80347814 00344774 54 64 10 3A */ slwi r4, r3, 2
/* 80347818 00344778 7C 80 22 14 */ add r4, r0, r4
@ -2439,8 +2439,8 @@ lbl_8034786C:
/* 80347880 003447E0 38 E3 01 8F */ addi r7, r3, 0x0007018F@l
lbl_80347884:
/* 80347884 003447E4 83 5E 00 00 */ lwz r26, 0(r30)
/* 80347888 003447E8 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 8034788C 003447EC 38 03 53 EC */ addi r0, r3, lbl_805A53EC@l
/* 80347888 003447E8 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 8034788C 003447EC 38 03 53 EC */ addi r0, r3, sGXState__3CGX@l
/* 80347890 003447F0 1C 7A 00 1C */ mulli r3, r26, 0x1c
/* 80347894 003447F4 7C 60 1A 14 */ add r3, r0, r3
/* 80347898 003447F8 3B 83 00 68 */ addi r28, r3, 0x68
@ -2493,8 +2493,8 @@ lbl_8034791C:
/* 80347948 003448A8 48 03 40 AD */ bl GXSetTevOrder
lbl_8034794C:
/* 8034794C 003448AC 80 7F 00 00 */ lwz r3, 0(r31)
/* 80347950 003448B0 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80347954 003448B4 38 04 53 EC */ addi r0, r4, lbl_805A53EC@l
/* 80347950 003448B0 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80347954 003448B4 38 04 53 EC */ addi r0, r4, sGXState__3CGX@l
/* 80347958 003448B8 80 B9 00 04 */ lwz r5, 4(r25)
/* 8034795C 003448BC 54 64 10 3A */ slwi r4, r3, 2
/* 80347960 003448C0 7C 80 22 14 */ add r4, r0, r4
@ -2980,10 +2980,10 @@ lbl_8034805C:
/* 80348068 00344FC8 4B FB FC 81 */ bl SetStandardDirectTev_Compressed__3CGXF13_GXTevStageIDUiUiUiUi
/* 8034806C 00344FCC 1C BE 00 1C */ mulli r5, r30, 0x1c
/* 80348070 00344FD0 80 DD 00 00 */ lwz r6, 0(r29)
/* 80348074 00344FD4 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80348074 00344FD4 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80348078 00344FD8 83 BF 00 10 */ lwz r29, 0x10(r31)
/* 8034807C 00344FDC 54 C4 06 3E */ clrlwi r4, r6, 0x18
/* 80348080 00344FE0 38 03 53 EC */ addi r0, r3, lbl_805A53EC@l
/* 80348080 00344FE0 38 03 53 EC */ addi r0, r3, sGXState__3CGX@l
/* 80348084 00344FE4 7C 60 2A 14 */ add r3, r0, r5
/* 80348088 00344FE8 54 C5 C6 3E */ rlwinm r5, r6, 0x18, 0x18, 0x1f
/* 8034808C 00344FEC 3B E3 00 68 */ addi r31, r3, 0x68
@ -3037,8 +3037,8 @@ SetupBlendMode__13CCubeMaterialFUiRC11CModelFlagsb:
/* 80348134 00345094 8B C4 00 00 */ lbz r30, 0(r4)
/* 80348138 00345098 7F DE 07 74 */ extsb r30, r30
/* 8034813C 0034509C 41 82 00 4C */ beq lbl_80348188
/* 80348140 003450A0 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80348144 003450A4 38 83 53 EC */ addi r4, r3, lbl_805A53EC@l
/* 80348140 003450A0 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80348144 003450A4 38 83 53 EC */ addi r4, r3, sGXState__3CGX@l
/* 80348148 003450A8 80 04 02 48 */ lwz r0, 0x248(r4)
/* 8034814C 003450AC 28 00 0A 06 */ cmplwi r0, 0xa06
/* 80348150 003450B0 41 82 00 2C */ beq lbl_8034817C
@ -3057,8 +3057,8 @@ lbl_8034817C:
/* 80348180 003450E0 3B 80 00 00 */ li r28, 0
/* 80348184 003450E4 48 00 00 48 */ b lbl_803481CC
lbl_80348188:
/* 80348188 003450E8 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 8034818C 003450EC 38 A3 53 EC */ addi r5, r3, lbl_805A53EC@l
/* 80348188 003450E8 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 8034818C 003450EC 38 A3 53 EC */ addi r5, r3, sGXState__3CGX@l
/* 80348190 003450F0 80 65 02 48 */ lwz r3, 0x248(r5)
/* 80348194 003450F4 3C 03 FF FF */ addis r0, r3, 0xffff
/* 80348198 003450F8 28 00 C8 07 */ cmplwi r0, 0xc807
@ -3089,9 +3089,9 @@ lbl_803481CC:
lbl_803481F8:
/* 803481F8 00345158 7C 1C 03 78 */ mr r28, r0
lbl_803481FC:
/* 803481FC 0034515C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803481FC 0034515C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80348200 00345160 57 A0 16 FA */ rlwinm r0, r29, 2, 0x1b, 0x1d
/* 80348204 00345164 3B E3 53 EC */ addi r31, r3, lbl_805A53EC@l
/* 80348204 00345164 3B E3 53 EC */ addi r31, r3, sGXState__3CGX@l
/* 80348208 00345168 60 1E 00 01 */ ori r30, r0, 1
/* 8034820C 0034516C A0 1F 00 56 */ lhz r0, 0x56(r31)
/* 80348210 00345170 53 9E 2E 34 */ rlwimi r30, r28, 5, 0x18, 0x1a

View File

@ -31,9 +31,9 @@ lbl_805A9350:
sub_80306630:
/* 80306630 00303590 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 80306634 00303594 7C 08 02 A6 */ mflr r0
/* 80306638 00303598 3C E0 80 5A */ lis r7, lbl_805A53EC@ha
/* 80306638 00303598 3C E0 80 5A */ lis r7, sGXState__3CGX@ha
/* 8030663C 0030359C 90 01 00 24 */ stw r0, 0x24(r1)
/* 80306640 003035A0 38 E7 53 EC */ addi r7, r7, lbl_805A53EC@l
/* 80306640 003035A0 38 E7 53 EC */ addi r7, r7, sGXState__3CGX@l
/* 80306644 003035A4 BF 61 00 0C */ stmw r27, 0xc(r1)
/* 80306648 003035A8 7C 7C 1B 78 */ mr r28, r3
/* 8030664C 003035AC 7C 9D 23 78 */ mr r29, r4
@ -47,8 +47,8 @@ sub_80306630:
/* 8030666C 003035CC 98 07 00 51 */ stb r0, 0x51(r7)
/* 80306670 003035D0 48 07 4C 49 */ bl GXSetNumIndStages
lbl_80306674:
/* 80306674 003035D4 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80306678 003035D8 38 83 53 EC */ addi r4, r3, lbl_805A53EC@l
/* 80306674 003035D4 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80306678 003035D8 38 83 53 EC */ addi r4, r3, sGXState__3CGX@l
/* 8030667C 003035DC 88 04 00 50 */ lbz r0, 0x50(r4)
/* 80306680 003035E0 28 00 00 01 */ cmplwi r0, 1
/* 80306684 003035E4 41 82 00 14 */ beq lbl_80306698
@ -57,8 +57,8 @@ lbl_80306674:
/* 80306690 003035F0 98 04 00 50 */ stb r0, 0x50(r4)
/* 80306694 003035F4 48 07 55 39 */ bl GXSetNumTevStages
lbl_80306698:
/* 80306698 003035F8 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 8030669C 003035FC 38 83 53 EC */ addi r4, r3, lbl_805A53EC@l
/* 80306698 003035F8 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 8030669C 003035FC 38 83 53 EC */ addi r4, r3, sGXState__3CGX@l
/* 803066A0 00303600 88 04 00 4F */ lbz r0, 0x4f(r4)
/* 803066A4 00303604 28 00 00 01 */ cmplwi r0, 1
/* 803066A8 00303608 41 82 00 14 */ beq lbl_803066BC
@ -67,8 +67,8 @@ lbl_80306698:
/* 803066B4 00303614 98 04 00 4F */ stb r0, 0x4f(r4)
/* 803066B8 00303618 48 07 1B AD */ bl GXSetNumTexGens
lbl_803066BC:
/* 803066BC 0030361C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803066C0 00303620 38 83 53 EC */ addi r4, r3, lbl_805A53EC@l
/* 803066BC 0030361C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803066C0 00303620 38 83 53 EC */ addi r4, r3, sGXState__3CGX@l
/* 803066C4 00303624 88 04 00 52 */ lbz r0, 0x52(r4)
/* 803066C8 00303628 28 00 00 0F */ cmplwi r0, 0xf
/* 803066CC 0030362C 41 82 00 1C */ beq lbl_803066E8
@ -79,8 +79,8 @@ lbl_803066BC:
/* 803066E0 00303640 38 A0 00 01 */ li r5, 1
/* 803066E4 00303644 48 07 58 75 */ bl GXSetZMode
lbl_803066E8:
/* 803066E8 00303648 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803066EC 0030364C 3B 63 53 EC */ addi r27, r3, lbl_805A53EC@l
/* 803066E8 00303648 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803066EC 0030364C 3B 63 53 EC */ addi r27, r3, sGXState__3CGX@l
/* 803066F0 00303650 80 7B 00 7C */ lwz r3, 0x7c(r27)
/* 803066F4 00303654 3C 03 FF 01 */ addis r0, r3, 0xff01
/* 803066F8 00303658 28 00 FF FF */ cmplwi r0, 0xffff
@ -124,8 +124,8 @@ lbl_80306754:
lbl_80306788:
/* 80306788 003036E8 38 60 00 00 */ li r3, 0
/* 8030678C 003036EC 48 00 14 C5 */ bl SetStandardTevColorAlphaOp__3CGXF13_GXTevStageID
/* 80306790 003036F0 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80306794 003036F4 3B 63 53 EC */ addi r27, r3, lbl_805A53EC@l
/* 80306790 003036F0 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80306794 003036F4 3B 63 53 EC */ addi r27, r3, sGXState__3CGX@l
/* 80306798 003036F8 A0 1B 00 56 */ lhz r0, 0x56(r27)
/* 8030679C 003036FC 28 00 00 21 */ cmplwi r0, 0x21
/* 803067A0 00303700 41 82 00 28 */ beq lbl_803067C8
@ -321,9 +321,9 @@ lbl_80306A18:
lbl_80306A1C:
/* 80306A1C 0030397C 2C 1A 00 01 */ cmpwi r26, 1
/* 80306A20 00303980 41 82 00 7C */ beq lbl_80306A9C
/* 80306A24 00303984 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80306A24 00303984 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80306A28 00303988 83 7F 00 38 */ lwz r27, 0x38(r31)
/* 80306A2C 0030398C 3B C3 53 EC */ addi r30, r3, lbl_805A53EC@l
/* 80306A2C 0030398C 3B C3 53 EC */ addi r30, r3, sGXState__3CGX@l
/* 80306A30 00303990 48 00 00 64 */ b lbl_80306A94
lbl_80306A34:
/* 80306A34 00303994 80 BB 00 0C */ lwz r5, 0xc(r27)
@ -357,9 +357,9 @@ lbl_80306A94:
lbl_80306A9C:
/* 80306A9C 003039FC 2C 1A 00 00 */ cmpwi r26, 0
/* 80306AA0 00303A00 41 82 00 7C */ beq lbl_80306B1C
/* 80306AA4 00303A04 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80306AA4 00303A04 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80306AA8 00303A08 83 7F 00 3C */ lwz r27, 0x3c(r31)
/* 80306AAC 00303A0C 3B C3 53 EC */ addi r30, r3, lbl_805A53EC@l
/* 80306AAC 00303A0C 3B C3 53 EC */ addi r30, r3, sGXState__3CGX@l
/* 80306AB0 00303A10 48 00 00 64 */ b lbl_80306B14
lbl_80306AB4:
/* 80306AB4 00303A14 80 BB 00 0C */ lwz r5, 0xc(r27)
@ -757,8 +757,8 @@ lbl_80306FE8:
/* 80306FF0 00303F50 38 63 73 88 */ addi r3, r3, lbl_803D7388@l
/* 80306FF4 00303F54 54 19 08 3C */ slwi r25, r0, 1
/* 80306FF8 00303F58 48 00 0E 31 */ bl SetVtxDescv__3CGXFPC14_GXVtxDescList
/* 80306FFC 00303F5C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307000 00303F60 3A A3 53 EC */ addi r21, r3, lbl_805A53EC@l
/* 80306FFC 00303F5C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80307000 00303F60 3A A3 53 EC */ addi r21, r3, sGXState__3CGX@l
/* 80307004 00303F64 80 15 00 78 */ lwz r0, 0x78(r21)
/* 80307008 00303F68 28 00 00 00 */ cmplwi r0, 0
/* 8030700C 00303F6C 41 82 00 14 */ beq lbl_80307020
@ -767,8 +767,8 @@ lbl_80306FE8:
/* 80307018 00303F78 90 15 00 78 */ stw r0, 0x78(r21)
/* 8030701C 00303F7C 48 07 42 C5 */ bl GXSetTevDirect
lbl_80307020:
/* 80307020 00303F80 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307024 00303F84 38 83 53 EC */ addi r4, r3, lbl_805A53EC@l
/* 80307020 00303F80 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80307024 00303F84 38 83 53 EC */ addi r4, r3, sGXState__3CGX@l
/* 80307028 00303F88 88 04 00 51 */ lbz r0, 0x51(r4)
/* 8030702C 00303F8C 28 00 00 00 */ cmplwi r0, 0
/* 80307030 00303F90 41 82 00 14 */ beq lbl_80307044
@ -804,9 +804,9 @@ lbl_80307078:
/* 803070A0 00304000 39 00 00 00 */ li r8, 0
/* 803070A4 00304004 48 07 44 89 */ bl GXSetTevColorOp
lbl_803070A8:
/* 803070A8 00304008 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803070A8 00304008 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803070AC 0030400C 38 C0 00 00 */ li r6, 0
/* 803070B0 00304010 3B A3 53 EC */ addi r29, r3, lbl_805A53EC@l
/* 803070B0 00304010 3B A3 53 EC */ addi r29, r3, sGXState__3CGX@l
/* 803070B4 00304014 88 BD 00 4D */ lbz r5, 0x4d(r29)
/* 803070B8 00304018 88 1D 00 4F */ lbz r0, 0x4f(r29)
/* 803070BC 0030401C 7C 85 00 D0 */ neg r4, r5
@ -822,8 +822,8 @@ lbl_803070A8:
/* 803070E4 00304044 98 1D 00 4F */ stb r0, 0x4f(r29)
/* 803070E8 00304048 48 07 11 7D */ bl GXSetNumTexGens
lbl_803070EC:
/* 803070EC 0030404C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803070F0 00304050 3A A3 53 EC */ addi r21, r3, lbl_805A53EC@l
/* 803070EC 0030404C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803070F0 00304050 3A A3 53 EC */ addi r21, r3, sGXState__3CGX@l
/* 803070F4 00304054 A0 15 00 56 */ lhz r0, 0x56(r21)
/* 803070F8 00304058 28 00 00 05 */ cmplwi r0, 5
/* 803070FC 0030405C 41 82 00 28 */ beq lbl_80307124
@ -1084,8 +1084,8 @@ lbl_8030749C:
/* 803074A8 00304408 38 61 00 0C */ addi r3, r1, 0xc
/* 803074AC 0030440C 48 03 E9 B1 */ bl SetCurrent__13CCubeMaterialCFRC11CModelFlagsRC12CCubeSurfaceRC10CCubeModel
/* 803074B0 00304410 80 BF 00 00 */ lwz r5, 0(r31)
/* 803074B4 00304414 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803074B8 00304418 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 803074B4 00304414 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803074B8 00304418 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 803074BC 0030441C 80 85 00 1C */ lwz r4, 0x1c(r5)
/* 803074C0 00304420 88 03 00 4C */ lbz r0, 0x4c(r3)
/* 803074C4 00304424 38 64 00 4B */ addi r3, r4, 0x4b
@ -1143,8 +1143,8 @@ SetUsingPackedLightmaps__10CCubeModelCFb:
/* 80307570 003044D0 80 83 00 18 */ lwz r4, 0x18(r3)
/* 80307574 003044D4 28 04 00 00 */ cmplwi r4, 0
/* 80307578 003044D8 41 82 00 5C */ beq lbl_803075D4
/* 8030757C 003044DC 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307580 003044E0 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 8030757C 003044DC 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80307580 003044E0 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80307584 003044E4 80 03 00 10 */ lwz r0, 0x10(r3)
/* 80307588 003044E8 7C 00 20 40 */ cmplw r0, r4
/* 8030758C 003044EC 41 82 00 48 */ beq lbl_803075D4
@ -1157,8 +1157,8 @@ lbl_803075A4:
/* 803075A4 00304504 80 83 00 14 */ lwz r4, 0x14(r3)
/* 803075A8 00304508 28 04 00 00 */ cmplwi r4, 0
/* 803075AC 0030450C 41 82 00 28 */ beq lbl_803075D4
/* 803075B0 00304510 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803075B4 00304514 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 803075B0 00304510 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803075B4 00304514 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 803075B8 00304518 80 03 00 10 */ lwz r0, 0x10(r3)
/* 803075BC 0030451C 7C 00 20 40 */ cmplw r0, r4
/* 803075C0 00304520 41 82 00 14 */ beq lbl_803075D4
@ -1200,8 +1200,8 @@ SetArraysCurrent__10CCubeModelCFv:
/* 80307634 00304594 80 83 00 08 */ lwz r4, 8(r3)
/* 80307638 00304598 28 04 00 00 */ cmplwi r4, 0
/* 8030763C 0030459C 41 82 00 24 */ beq lbl_80307660
/* 80307640 003045A0 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307644 003045A4 84 03 53 EC */ lwzu r0, lbl_805A53EC@l(r3)
/* 80307640 003045A0 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80307644 003045A4 84 03 53 EC */ lwzu r0, sGXState__3CGX@l(r3)
/* 80307648 003045A8 7C 00 20 40 */ cmplw r0, r4
/* 8030764C 003045AC 41 82 00 14 */ beq lbl_80307660
/* 80307650 003045B0 90 83 00 00 */ stw r4, 0(r3)
@ -1218,8 +1218,8 @@ lbl_80307674:
/* 80307674 003045D4 80 9F 00 0C */ lwz r4, 0xc(r31)
/* 80307678 003045D8 28 04 00 00 */ cmplwi r4, 0
/* 8030767C 003045DC 41 82 00 28 */ beq lbl_803076A4
/* 80307680 003045E0 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307684 003045E4 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80307680 003045E0 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80307684 003045E4 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80307688 003045E8 80 03 00 04 */ lwz r0, 4(r3)
/* 8030768C 003045EC 7C 00 20 40 */ cmplw r0, r4
/* 80307690 003045F0 41 82 00 14 */ beq lbl_803076A4
@ -1248,8 +1248,8 @@ SetStaticArraysCurrent__10CCubeModelCFv:
/* 803076DC 0030463C 80 83 00 10 */ lwz r4, 0x10(r3)
/* 803076E0 00304640 28 04 00 00 */ cmplwi r4, 0
/* 803076E4 00304644 41 82 00 28 */ beq lbl_8030770C
/* 803076E8 00304648 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803076EC 0030464C 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 803076E8 00304648 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803076EC 0030464C 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 803076F0 00304650 80 03 00 08 */ lwz r0, 8(r3)
/* 803076F4 00304654 7C 00 20 40 */ cmplw r0, r4
/* 803076F8 00304658 41 82 00 14 */ beq lbl_8030770C
@ -1270,8 +1270,8 @@ lbl_80307724:
/* 8030772C 0030468C 41 82 00 34 */ beq lbl_80307760
/* 80307730 00304690 28 04 00 00 */ cmplwi r4, 0
/* 80307734 00304694 41 82 00 5C */ beq lbl_80307790
/* 80307738 00304698 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 8030773C 0030469C 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80307738 00304698 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 8030773C 0030469C 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80307740 003046A0 80 03 00 10 */ lwz r0, 0x10(r3)
/* 80307744 003046A4 7C 00 20 40 */ cmplw r0, r4
/* 80307748 003046A8 41 82 00 48 */ beq lbl_80307790
@ -1283,8 +1283,8 @@ lbl_80307724:
lbl_80307760:
/* 80307760 003046C0 28 1E 00 00 */ cmplwi r30, 0
/* 80307764 003046C4 41 82 00 2C */ beq lbl_80307790
/* 80307768 003046C8 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 8030776C 003046CC 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80307768 003046C8 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 8030776C 003046CC 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80307770 003046D0 80 03 00 10 */ lwz r0, 0x10(r3)
/* 80307774 003046D4 7C 00 F0 40 */ cmplw r0, r30
/* 80307778 003046D8 41 82 00 18 */ beq lbl_80307790
@ -1296,9 +1296,9 @@ lbl_80307760:
lbl_80307790:
/* 80307790 003046F0 28 1E 00 00 */ cmplwi r30, 0
/* 80307794 003046F4 41 82 00 4C */ beq lbl_803077E0
/* 80307798 003046F8 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307798 003046F8 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 8030779C 003046FC 3B A0 00 01 */ li r29, 1
/* 803077A0 00304700 3B E3 53 EC */ addi r31, r3, lbl_805A53EC@l
/* 803077A0 00304700 3B E3 53 EC */ addi r31, r3, sGXState__3CGX@l
lbl_803077A4:
/* 803077A4 00304704 28 1E 00 00 */ cmplwi r30, 0
/* 803077A8 00304708 38 7D 00 0D */ addi r3, r29, 0xd

View File

@ -8,7 +8,7 @@ lbl_ctor:
.balign 8
.lcomm lbl_80479BD0, 0xF0, 4
.comm lbl_805A53EC, 0x260, 4
.comm sGXState__3CGX, 0x260, 4
.section .sbss2, "", @nobits
.balign 8
@ -23,43 +23,43 @@ lbl_805AF4A0:
sub_80307bbc:
/* 80307BBC 00304B1C 28 03 00 00 */ cmplwi r3, 0
/* 80307BC0 00304B20 41 82 00 14 */ beq lbl_80307BD4
/* 80307BC4 00304B24 3D 20 80 5A */ lis r9, lbl_805A53EC@ha
/* 80307BC8 00304B28 39 29 53 EC */ addi r9, r9, lbl_805A53EC@l
/* 80307BC4 00304B24 3D 20 80 5A */ lis r9, sGXState__3CGX@ha
/* 80307BC8 00304B28 39 29 53 EC */ addi r9, r9, sGXState__3CGX@l
/* 80307BCC 00304B2C 88 09 00 53 */ lbz r0, 0x53(r9)
/* 80307BD0 00304B30 90 03 00 00 */ stw r0, 0(r3)
lbl_80307BD4:
/* 80307BD4 00304B34 28 04 00 00 */ cmplwi r4, 0
/* 80307BD8 00304B38 41 82 00 14 */ beq lbl_80307BEC
/* 80307BDC 00304B3C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307BE0 00304B40 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80307BDC 00304B3C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80307BE0 00304B40 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80307BE4 00304B44 C0 03 02 4C */ lfs f0, 0x24c(r3)
/* 80307BE8 00304B48 D0 04 00 00 */ stfs f0, 0(r4)
lbl_80307BEC:
/* 80307BEC 00304B4C 28 05 00 00 */ cmplwi r5, 0
/* 80307BF0 00304B50 41 82 00 14 */ beq lbl_80307C04
/* 80307BF4 00304B54 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307BF8 00304B58 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80307BF4 00304B54 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80307BF8 00304B58 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80307BFC 00304B5C C0 03 02 50 */ lfs f0, 0x250(r3)
/* 80307C00 00304B60 D0 05 00 00 */ stfs f0, 0(r5)
lbl_80307C04:
/* 80307C04 00304B64 28 06 00 00 */ cmplwi r6, 0
/* 80307C08 00304B68 41 82 00 14 */ beq lbl_80307C1C
/* 80307C0C 00304B6C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307C10 00304B70 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80307C0C 00304B6C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80307C10 00304B70 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80307C14 00304B74 C0 03 02 54 */ lfs f0, 0x254(r3)
/* 80307C18 00304B78 D0 06 00 00 */ stfs f0, 0(r6)
lbl_80307C1C:
/* 80307C1C 00304B7C 28 07 00 00 */ cmplwi r7, 0
/* 80307C20 00304B80 41 82 00 14 */ beq lbl_80307C34
/* 80307C24 00304B84 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307C28 00304B88 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80307C24 00304B84 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80307C28 00304B88 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80307C2C 00304B8C C0 03 02 58 */ lfs f0, 0x258(r3)
/* 80307C30 00304B90 D0 07 00 00 */ stfs f0, 0(r7)
lbl_80307C34:
/* 80307C34 00304B94 28 08 00 00 */ cmplwi r8, 0
/* 80307C38 00304B98 4D 82 00 20 */ beqlr
/* 80307C3C 00304B9C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307C40 00304BA0 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80307C3C 00304B9C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80307C40 00304BA0 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80307C44 00304BA4 80 03 02 5C */ lwz r0, 0x25c(r3)
/* 80307C48 00304BA8 90 08 00 00 */ stw r0, 0(r8)
/* 80307C4C 00304BAC 4E 80 00 20 */ blr
@ -72,8 +72,8 @@ SetStandardTevColorAlphaOp__3CGXF13_GXTevStageID:
/* 80307C5C 00304BBC 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80307C60 00304BC0 7C 7F 1B 78 */ mr r31, r3
/* 80307C64 00304BC4 1C 9F 00 1C */ mulli r4, r31, 0x1c
/* 80307C68 00304BC8 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307C6C 00304BCC 38 03 53 EC */ addi r0, r3, lbl_805A53EC@l
/* 80307C68 00304BC8 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80307C6C 00304BCC 38 03 53 EC */ addi r0, r3, sGXState__3CGX@l
/* 80307C70 00304BD0 7C 60 22 14 */ add r3, r0, r4
/* 80307C74 00304BD4 80 03 00 70 */ lwz r0, 0x70(r3)
/* 80307C78 00304BD8 38 E3 00 68 */ addi r7, r3, 0x68
@ -111,9 +111,9 @@ lbl_80307CD4:
SetStandardDirectTev_Compressed__3CGXF13_GXTevStageIDUiUiUiUi:
/* 80307CE8 00304C48 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 80307CEC 00304C4C 7C 08 02 A6 */ mflr r0
/* 80307CF0 00304C50 3D 00 80 5A */ lis r8, lbl_805A53EC@ha
/* 80307CF0 00304C50 3D 00 80 5A */ lis r8, sGXState__3CGX@ha
/* 80307CF4 00304C54 90 01 00 24 */ stw r0, 0x24(r1)
/* 80307CF8 00304C58 38 08 53 EC */ addi r0, r8, lbl_805A53EC@l
/* 80307CF8 00304C58 38 08 53 EC */ addi r0, r8, sGXState__3CGX@l
/* 80307CFC 00304C5C BF 41 00 08 */ stmw r26, 8(r1)
/* 80307D00 00304C60 7C 7A 1B 78 */ mr r26, r3
/* 80307D04 00304C64 1D 3A 00 1C */ mulli r9, r26, 0x1c
@ -240,10 +240,10 @@ SetIndexedPositionVtxFmt__14CFluidPlaneCPUFv:
SetAttrFmt__11CFluidPlaneF6GXAttr10GXAttrType:
/* 80307EA4 00304E04 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80307EA8 00304E08 7C 08 02 A6 */ mflr r0
/* 80307EAC 00304E0C 3C A0 80 5A */ lis r5, lbl_805A53EC@ha
/* 80307EAC 00304E0C 3C A0 80 5A */ lis r5, sGXState__3CGX@ha
/* 80307EB0 00304E10 38 C3 FF F7 */ addi r6, r3, -9
/* 80307EB4 00304E14 90 01 00 14 */ stw r0, 0x14(r1)
/* 80307EB8 00304E18 38 A5 53 EC */ addi r5, r5, lbl_805A53EC@l
/* 80307EB8 00304E18 38 A5 53 EC */ addi r5, r5, sGXState__3CGX@l
/* 80307EBC 00304E1C 54 C7 08 3C */ slwi r7, r6, 1
/* 80307EC0 00304E20 38 00 00 03 */ li r0, 3
/* 80307EC4 00304E24 80 C5 00 48 */ lwz r6, 0x48(r5)
@ -266,12 +266,12 @@ lbl_80307EEC:
SetVtxDescv_Compressed__3CGXFUi:
/* 80307EFC 00304E5C 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80307F00 00304E60 7C 08 02 A6 */ mflr r0
/* 80307F04 00304E64 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80307F04 00304E64 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80307F08 00304E68 90 01 00 14 */ stw r0, 0x14(r1)
/* 80307F0C 00304E6C 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80307F10 00304E70 7C 7F 1B 78 */ mr r31, r3
/* 80307F14 00304E74 93 C1 00 08 */ stw r30, 8(r1)
/* 80307F18 00304E78 3B C4 53 EC */ addi r30, r4, lbl_805A53EC@l
/* 80307F18 00304E78 3B C4 53 EC */ addi r30, r4, sGXState__3CGX@l
/* 80307F1C 00304E7C 80 BE 00 48 */ lwz r5, 0x48(r30)
/* 80307F20 00304E80 7C 1F 28 40 */ cmplw r31, r5
/* 80307F24 00304E84 41 82 00 7C */ beq lbl_80307FA0
@ -333,27 +333,27 @@ SetIndTexMtxSTPointFive__3CGXF14_GXIndTexMtxIDSc:
FlushState__3CGXFv:
/* 80307FE4 00304F44 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80307FE8 00304F48 7C 08 02 A6 */ mflr r0
/* 80307FEC 00304F4C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80307FEC 00304F4C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80307FF0 00304F50 90 01 00 14 */ stw r0, 0x14(r1)
/* 80307FF4 00304F54 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80307FF8 00304F58 3B E3 53 EC */ addi r31, r3, lbl_805A53EC@l
/* 80307FF8 00304F58 3B E3 53 EC */ addi r31, r3, sGXState__3CGX@l
/* 80307FFC 00304F5C 93 C1 00 08 */ stw r30, 8(r1)
/* 80308000 00304F60 88 1F 00 4C */ lbz r0, 0x4c(r31)
/* 80308004 00304F64 54 00 07 FF */ clrlwi. r0, r0, 0x1f
/* 80308008 00304F68 41 82 00 1C */ beq lbl_80308024
/* 8030800C 00304F6C 88 7F 00 4E */ lbz r3, 0x4e(r31)
/* 80308010 00304F70 48 07 1B 21 */ bl GXSetNumChans
/* 80308014 00304F74 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80308014 00304F74 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80308018 00304F78 88 1F 00 4E */ lbz r0, 0x4e(r31)
/* 8030801C 00304F7C 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 8030801C 00304F7C 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80308020 00304F80 98 03 00 4D */ stb r0, 0x4d(r3)
lbl_80308024:
/* 80308024 00304F84 88 1F 00 4C */ lbz r0, 0x4c(r31)
/* 80308028 00304F88 54 00 07 BD */ rlwinm. r0, r0, 0, 0x1e, 0x1e
/* 8030802C 00304F8C 41 82 00 40 */ beq lbl_8030806C
/* 80308030 00304F90 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80308030 00304F90 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80308034 00304F94 38 60 00 00 */ li r3, 0
/* 80308038 00304F98 3B C4 53 EC */ addi r30, r4, lbl_805A53EC@l
/* 80308038 00304F98 3B C4 53 EC */ addi r30, r4, sGXState__3CGX@l
/* 8030803C 00304F9C A0 1E 00 34 */ lhz r0, 0x34(r30)
/* 80308040 00304FA0 54 07 EE 3E */ rlwinm r7, r0, 0x1d, 0x18, 0x1f
/* 80308044 00304FA4 54 04 07 FE */ clrlwi r4, r0, 0x1f
@ -362,17 +362,17 @@ lbl_80308024:
/* 80308050 00304FB0 54 08 AF BE */ rlwinm r8, r0, 0x15, 0x1e, 0x1f
/* 80308054 00304FB4 54 09 9F BE */ rlwinm r9, r0, 0x13, 0x1e, 0x1f
/* 80308058 00304FB8 48 07 1B 1D */ bl GXSetChanCtrl
/* 8030805C 00304FBC 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 8030805C 00304FBC 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80308060 00304FC0 A0 1E 00 34 */ lhz r0, 0x34(r30)
/* 80308064 00304FC4 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80308064 00304FC4 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80308068 00304FC8 B0 03 00 30 */ sth r0, 0x30(r3)
lbl_8030806C:
/* 8030806C 00304FCC 88 1F 00 4C */ lbz r0, 0x4c(r31)
/* 80308070 00304FD0 54 00 07 7B */ rlwinm. r0, r0, 0, 0x1d, 0x1d
/* 80308074 00304FD4 41 82 00 40 */ beq lbl_803080B4
/* 80308078 00304FD8 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80308078 00304FD8 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 8030807C 00304FDC 38 60 00 01 */ li r3, 1
/* 80308080 00304FE0 3B C4 53 EC */ addi r30, r4, lbl_805A53EC@l
/* 80308080 00304FE0 3B C4 53 EC */ addi r30, r4, sGXState__3CGX@l
/* 80308084 00304FE4 A0 1E 00 36 */ lhz r0, 0x36(r30)
/* 80308088 00304FE8 54 07 EE 3E */ rlwinm r7, r0, 0x1d, 0x18, 0x1f
/* 8030808C 00304FEC 54 04 07 FE */ clrlwi r4, r0, 0x1f
@ -381,9 +381,9 @@ lbl_8030806C:
/* 80308098 00304FF8 54 08 AF BE */ rlwinm r8, r0, 0x15, 0x1e, 0x1f
/* 8030809C 00304FFC 54 09 9F BE */ rlwinm r9, r0, 0x13, 0x1e, 0x1f
/* 803080A0 00305000 48 07 1A D5 */ bl GXSetChanCtrl
/* 803080A4 00305004 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803080A4 00305004 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803080A8 00305008 A0 1E 00 36 */ lhz r0, 0x36(r30)
/* 803080AC 0030500C 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 803080AC 0030500C 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 803080B0 00305010 B0 03 00 32 */ sth r0, 0x32(r3)
lbl_803080B4:
/* 803080B4 00305014 38 00 00 00 */ li r0, 0
@ -399,8 +399,8 @@ lbl_803080B4:
sub_803080d4:
/* 803080D4 00305034 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 803080D8 00305038 7C 08 02 A6 */ mflr r0
/* 803080DC 0030503C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803080E0 00305040 34 63 53 EC */ addic. r3, r3, lbl_805A53EC@l
/* 803080DC 0030503C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803080E0 00305040 34 63 53 EC */ addic. r3, r3, sGXState__3CGX@l
/* 803080E4 00305044 90 01 00 14 */ stw r0, 0x14(r1)
/* 803080E8 00305048 41 82 00 08 */ beq lbl_803080F0
/* 803080EC 0030504C 48 00 01 B1 */ bl __ct__Q23CGX8SGXStateFv
@ -415,17 +415,17 @@ lbl_803080F0:
ResetGXStates__3CGXFv:
/* 80308104 00305064 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 80308108 00305068 7C 08 02 A6 */ mflr r0
/* 8030810C 0030506C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 8030810C 0030506C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80308110 00305070 90 01 00 24 */ stw r0, 0x24(r1)
/* 80308114 00305074 38 00 00 00 */ li r0, 0
/* 80308118 00305078 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80308118 00305078 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 8030811C 0030507C 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 80308120 00305080 93 C1 00 18 */ stw r30, 0x18(r1)
/* 80308124 00305084 90 03 00 48 */ stw r0, 0x48(r3)
/* 80308128 00305088 48 06 F6 2D */ bl GXClearVtxDesc
/* 8030812C 0030508C 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 8030812C 0030508C 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80308130 00305090 38 00 00 01 */ li r0, 1
/* 80308134 00305094 3B E3 53 EC */ addi r31, r3, lbl_805A53EC@l
/* 80308134 00305094 3B E3 53 EC */ addi r31, r3, sGXState__3CGX@l
/* 80308138 00305098 3B C0 00 00 */ li r30, 0
/* 8030813C 0030509C 90 1F 00 00 */ stw r0, 0(r31)
/* 80308140 003050A0 90 1F 00 04 */ stw r0, 4(r31)
@ -669,10 +669,10 @@ __ct__Q23CGX9STevStateFv:
SetLineWidth__3CGXFUc12_GXTexOffset:
/* 803084B8 00305418 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 803084BC 0030541C 7C 08 02 A6 */ mflr r0
/* 803084C0 00305420 3C A0 80 5A */ lis r5, lbl_805A53EC@ha
/* 803084C0 00305420 3C A0 80 5A */ lis r5, sGXState__3CGX@ha
/* 803084C4 00305424 54 86 40 2E */ slwi r6, r4, 8
/* 803084C8 00305428 90 01 00 14 */ stw r0, 0x14(r1)
/* 803084CC 0030542C 38 A5 53 EC */ addi r5, r5, lbl_805A53EC@l
/* 803084CC 0030542C 38 A5 53 EC */ addi r5, r5, sGXState__3CGX@l
/* 803084D0 00305430 50 66 06 3E */ rlwimi r6, r3, 0, 0x18, 0x1f
/* 803084D4 00305434 A0 05 00 54 */ lhz r0, 0x54(r5)
/* 803084D8 00305438 54 C6 04 3E */ clrlwi r6, r6, 0x10
@ -690,9 +690,9 @@ lbl_803084EC:
SetFog__3CGXF10_GXFogTypeffffRC8_GXColor:
/* 803084FC 0030545C 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308500 00305460 7C 08 02 A6 */ mflr r0
/* 80308504 00305464 3C A0 80 5A */ lis r5, lbl_805A53EC@ha
/* 80308504 00305464 3C A0 80 5A */ lis r5, sGXState__3CGX@ha
/* 80308508 00305468 90 01 00 14 */ stw r0, 0x14(r1)
/* 8030850C 0030546C 38 A5 53 EC */ addi r5, r5, lbl_805A53EC@l
/* 8030850C 0030546C 38 A5 53 EC */ addi r5, r5, sGXState__3CGX@l
/* 80308510 00305470 A0 05 00 56 */ lhz r0, 0x56(r5)
/* 80308514 00305474 80 84 00 00 */ lwz r4, 0(r4)
/* 80308518 00305478 54 00 06 34 */ rlwinm r0, r0, 0, 0x18, 0x1a
@ -732,7 +732,7 @@ End__3CGXFv:
Begin__3CGXF12_GXPrimitive9_GXVtxFmtUs:
/* 80308584 003054E4 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 80308588 003054E8 7C 08 02 A6 */ mflr r0
/* 8030858C 003054EC 3C C0 80 5A */ lis r6, lbl_805A53EC@ha
/* 8030858C 003054EC 3C C0 80 5A */ lis r6, sGXState__3CGX@ha
/* 80308590 003054F0 90 01 00 24 */ stw r0, 0x24(r1)
/* 80308594 003054F4 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 80308598 003054F8 7C BF 2B 78 */ mr r31, r5
@ -740,7 +740,7 @@ Begin__3CGXF12_GXPrimitive9_GXVtxFmtUs:
/* 803085A0 00305500 7C 9E 23 78 */ mr r30, r4
/* 803085A4 00305504 93 A1 00 14 */ stw r29, 0x14(r1)
/* 803085A8 00305508 7C 7D 1B 78 */ mr r29, r3
/* 803085AC 0030550C 38 66 53 EC */ addi r3, r6, lbl_805A53EC@l
/* 803085AC 0030550C 38 66 53 EC */ addi r3, r6, sGXState__3CGX@l
/* 803085B0 00305510 88 03 00 4C */ lbz r0, 0x4c(r3)
/* 803085B4 00305514 28 00 00 00 */ cmplwi r0, 0
/* 803085B8 00305518 41 82 00 08 */ beq lbl_803085C0
@ -762,13 +762,13 @@ lbl_803085C0:
CallDisplayList__3CGXFPCvUl:
/* 803085EC 0030554C 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 803085F0 00305550 7C 08 02 A6 */ mflr r0
/* 803085F4 00305554 3C A0 80 5A */ lis r5, lbl_805A53EC@ha
/* 803085F4 00305554 3C A0 80 5A */ lis r5, sGXState__3CGX@ha
/* 803085F8 00305558 90 01 00 14 */ stw r0, 0x14(r1)
/* 803085FC 0030555C 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80308600 00305560 7C 9F 23 78 */ mr r31, r4
/* 80308604 00305564 93 C1 00 08 */ stw r30, 8(r1)
/* 80308608 00305568 7C 7E 1B 78 */ mr r30, r3
/* 8030860C 0030556C 38 65 53 EC */ addi r3, r5, lbl_805A53EC@l
/* 8030860C 0030556C 38 65 53 EC */ addi r3, r5, sGXState__3CGX@l
/* 80308610 00305570 88 03 00 4C */ lbz r0, 0x4c(r3)
/* 80308614 00305574 28 00 00 00 */ cmplwi r0, 0
/* 80308618 00305578 41 82 00 08 */ beq lbl_80308620
@ -792,9 +792,9 @@ SetArray__3CGXF7_GXAttrPCvUc:
/* 80308650 003055B0 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308654 003055B4 38 03 FF F7 */ addi r0, r3, -9
/* 80308658 003055B8 41 82 00 28 */ beq lbl_80308680
/* 8030865C 003055BC 3C C0 80 5A */ lis r6, lbl_805A53EC@ha
/* 8030865C 003055BC 3C C0 80 5A */ lis r6, sGXState__3CGX@ha
/* 80308660 003055C0 54 07 10 3A */ slwi r7, r0, 2
/* 80308664 003055C4 38 C6 53 EC */ addi r6, r6, lbl_805A53EC@l
/* 80308664 003055C4 38 C6 53 EC */ addi r6, r6, sGXState__3CGX@l
/* 80308668 003055C8 7C 06 38 2E */ lwzx r0, r6, r7
/* 8030866C 003055CC 7C 00 20 40 */ cmplw r0, r4
/* 80308670 003055D0 40 82 00 08 */ bne lbl_80308678
@ -812,9 +812,9 @@ lbl_80308680:
SetNumIndStages__3CGXFUc:
/* 80308690 003055F0 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308694 003055F4 7C 08 02 A6 */ mflr r0
/* 80308698 003055F8 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80308698 003055F8 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 8030869C 003055FC 90 01 00 14 */ stw r0, 0x14(r1)
/* 803086A0 00305600 38 A4 53 EC */ addi r5, r4, lbl_805A53EC@l
/* 803086A0 00305600 38 A4 53 EC */ addi r5, r4, sGXState__3CGX@l
/* 803086A4 00305604 54 60 06 3E */ clrlwi r0, r3, 0x18
/* 803086A8 00305608 88 85 00 51 */ lbz r4, 0x51(r5)
/* 803086AC 0030560C 7C 04 00 40 */ cmplw r4, r0
@ -832,7 +832,7 @@ SetTexCoordGen__3CGXF13_GXTexCoordID13_GXTexGenType12_GXTexGenSrc9_GXTexMtxUc11_
/* 803086CC 0030562C 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 803086D0 00305630 7C 08 02 A6 */ mflr r0
/* 803086D4 00305634 3D 20 55 55 */ lis r9, 0x55555556@ha
/* 803086D8 00305638 3D 80 80 5A */ lis r12, lbl_805A53EC@ha
/* 803086D8 00305638 3D 80 80 5A */ lis r12, sGXState__3CGX@ha
/* 803086DC 0030563C 90 01 00 14 */ stw r0, 0x14(r1)
/* 803086E0 00305640 39 49 55 56 */ addi r10, r9, 0x55555556@l
/* 803086E4 00305644 38 06 FF E2 */ addi r0, r6, -30
@ -840,7 +840,7 @@ SetTexCoordGen__3CGXF13_GXTexCoordID13_GXTexGenType12_GXTexGenSrc9_GXTexMtxUc11_
/* 803086EC 0030564C 7D 4A 00 96 */ mulhw r10, r10, r0
/* 803086F0 00305650 93 E1 00 0C */ stw r31, 0xc(r1)
/* 803086F4 00305654 54 7F 10 3A */ slwi r31, r3, 2
/* 803086F8 00305658 38 0C 53 EC */ addi r0, r12, lbl_805A53EC@l
/* 803086F8 00305658 38 0C 53 EC */ addi r0, r12, sGXState__3CGX@l
/* 803086FC 0030565C 39 68 FF C0 */ addi r11, r8, -64
/* 80308700 00305660 7D 80 FA 14 */ add r12, r0, r31
/* 80308704 00305664 55 40 0F FE */ srwi r0, r10, 0x1f
@ -866,9 +866,9 @@ SetTevDirect__3CGXF13_GXTevStageID:
/* 80308744 003056A4 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308748 003056A8 7C 08 02 A6 */ mflr r0
/* 8030874C 003056AC 1C A3 00 1C */ mulli r5, r3, 0x1c
/* 80308750 003056B0 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80308750 003056B0 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80308754 003056B4 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308758 003056B8 38 04 53 EC */ addi r0, r4, lbl_805A53EC@l
/* 80308758 003056B8 38 04 53 EC */ addi r0, r4, sGXState__3CGX@l
/* 8030875C 003056BC 7C 80 2A 14 */ add r4, r0, r5
/* 80308760 003056C0 38 84 00 68 */ addi r4, r4, 0x68
/* 80308764 003056C4 80 04 00 10 */ lwz r0, 0x10(r4)
@ -888,9 +888,9 @@ SetTevIndirect__3CGXF13_GXTevStageID16_GXIndTexStageID15_GXIndTexFormat16_GXIndT
/* 8030878C 003056EC 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 80308790 003056F0 7C 08 02 A6 */ mflr r0
/* 80308794 003056F4 54 AB 17 3A */ rlwinm r11, r5, 2, 0x1c, 0x1d
/* 80308798 003056F8 3D 80 80 5A */ lis r12, lbl_805A53EC@ha
/* 80308798 003056F8 3D 80 80 5A */ lis r12, sGXState__3CGX@ha
/* 8030879C 003056FC 90 01 00 24 */ stw r0, 0x24(r1)
/* 803087A0 00305700 38 0C 53 EC */ addi r0, r12, lbl_805A53EC@l
/* 803087A0 00305700 38 0C 53 EC */ addi r0, r12, sGXState__3CGX@l
/* 803087A4 00305704 1D 83 00 1C */ mulli r12, r3, 0x1c
/* 803087A8 00305708 50 8B 07 BE */ rlwimi r11, r4, 0, 0x1e, 0x1f
/* 803087AC 0030570C 93 E1 00 1C */ stw r31, 0x1c(r1)
@ -925,10 +925,10 @@ lbl_803087FC:
SetAlphaCompare__3CGXF10_GXCompareUc10_GXAlphaOp10_GXCompareUc:
/* 80308814 00305774 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308818 00305778 7C 08 02 A6 */ mflr r0
/* 8030881C 0030577C 3D 00 80 5A */ lis r8, lbl_805A53EC@ha
/* 8030881C 0030577C 3D 00 80 5A */ lis r8, sGXState__3CGX@ha
/* 80308820 00305780 54 89 1D 78 */ rlwinm r9, r4, 3, 0x15, 0x1c
/* 80308824 00305784 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308828 00305788 39 08 53 EC */ addi r8, r8, lbl_805A53EC@l
/* 80308828 00305788 39 08 53 EC */ addi r8, r8, sGXState__3CGX@l
/* 8030882C 0030578C 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80308830 00305790 7C 7F 1B 78 */ mr r31, r3
/* 80308834 00305794 53 E9 07 7E */ rlwimi r9, r31, 0, 0x1d, 0x1f
@ -955,12 +955,12 @@ lbl_80308868:
SetZMode__3CGXFb10_GXCompareb:
/* 8030887C 003057DC 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308880 003057E0 7C 08 02 A6 */ mflr r0
/* 80308884 003057E4 3C C0 80 5A */ lis r6, lbl_805A53EC@ha
/* 80308884 003057E4 3C C0 80 5A */ lis r6, sGXState__3CGX@ha
/* 80308888 003057E8 54 63 06 3E */ clrlwi r3, r3, 0x18
/* 8030888C 003057EC 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308890 003057F0 54 A0 0D FC */ rlwinm r0, r5, 1, 0x17, 0x1e
/* 80308894 003057F4 54 87 15 BA */ rlwinm r7, r4, 2, 0x16, 0x1d
/* 80308898 003057F8 38 C6 53 EC */ addi r6, r6, lbl_805A53EC@l
/* 80308898 003057F8 38 C6 53 EC */ addi r6, r6, sGXState__3CGX@l
/* 8030889C 003057FC 7C 60 03 78 */ or r0, r3, r0
/* 803088A0 00305800 54 A5 06 3E */ clrlwi r5, r5, 0x18
/* 803088A4 00305804 7C E7 03 78 */ or r7, r7, r0
@ -983,9 +983,9 @@ SetBlendMode__3CGXF12_GXBlendMode14_GXBlendFactor14_GXBlendFactor10_GXLogicOp:
/* 803088D8 00305838 90 01 00 24 */ stw r0, 0x24(r1)
/* 803088DC 0030583C BF 41 00 08 */ stmw r26, 8(r1)
/* 803088E0 00305840 7C 7A 1B 78 */ mr r26, r3
/* 803088E4 00305844 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 803088E4 00305844 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 803088E8 00305848 7C 9B 23 78 */ mr r27, r4
/* 803088EC 0030584C 3B E3 53 EC */ addi r31, r3, lbl_805A53EC@l
/* 803088EC 0030584C 3B E3 53 EC */ addi r31, r3, sGXState__3CGX@l
/* 803088F0 00305850 54 84 16 FA */ rlwinm r4, r4, 2, 0x1b, 0x1d
/* 803088F4 00305854 7C BC 2B 78 */ mr r28, r5
/* 803088F8 00305858 7C DD 33 78 */ mr r29, r6
@ -1016,10 +1016,10 @@ SetTevOrder__3CGXF13_GXTevStageID13_GXTexCoordID11_GXTexMapID12_GXChannelID:
/* 8030894C 003058AC 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308950 003058B0 7C 08 02 A6 */ mflr r0
/* 80308954 003058B4 1D 23 00 1C */ mulli r9, r3, 0x1c
/* 80308958 003058B8 3D 00 80 5A */ lis r8, lbl_805A53EC@ha
/* 80308958 003058B8 3D 00 80 5A */ lis r8, sGXState__3CGX@ha
/* 8030895C 003058BC 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308960 003058C0 54 A7 44 2E */ rlwinm r7, r5, 8, 0x10, 0x17
/* 80308964 003058C4 38 08 53 EC */ addi r0, r8, lbl_805A53EC@l
/* 80308964 003058C4 38 08 53 EC */ addi r0, r8, sGXState__3CGX@l
/* 80308968 003058C8 7D 00 4A 14 */ add r8, r0, r9
/* 8030896C 003058CC 39 08 00 68 */ addi r8, r8, 0x68
/* 80308970 003058D0 50 87 06 3E */ rlwimi r7, r4, 0, 0x18, 0x1f
@ -1040,9 +1040,9 @@ SetTevKAlphaSel__3CGXF13_GXTevStageID15_GXTevKAlphaSel:
/* 8030899C 003058FC 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 803089A0 00305900 7C 08 02 A6 */ mflr r0
/* 803089A4 00305904 1C C3 00 1C */ mulli r6, r3, 0x1c
/* 803089A8 00305908 3C A0 80 5A */ lis r5, lbl_805A53EC@ha
/* 803089A8 00305908 3C A0 80 5A */ lis r5, sGXState__3CGX@ha
/* 803089AC 0030590C 90 01 00 14 */ stw r0, 0x14(r1)
/* 803089B0 00305910 38 05 53 EC */ addi r0, r5, lbl_805A53EC@l
/* 803089B0 00305910 38 05 53 EC */ addi r0, r5, sGXState__3CGX@l
/* 803089B4 00305914 7C A0 32 14 */ add r5, r0, r6
/* 803089B8 00305918 38 A5 00 68 */ addi r5, r5, 0x68
/* 803089BC 0030591C 88 05 00 19 */ lbz r0, 0x19(r5)
@ -1061,9 +1061,9 @@ SetTevKColorSel__3CGXF13_GXTevStageID15_GXTevKColorSel:
/* 803089E0 00305940 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 803089E4 00305944 7C 08 02 A6 */ mflr r0
/* 803089E8 00305948 1C C3 00 1C */ mulli r6, r3, 0x1c
/* 803089EC 0030594C 3C A0 80 5A */ lis r5, lbl_805A53EC@ha
/* 803089EC 0030594C 3C A0 80 5A */ lis r5, sGXState__3CGX@ha
/* 803089F0 00305950 90 01 00 14 */ stw r0, 0x14(r1)
/* 803089F4 00305954 38 05 53 EC */ addi r0, r5, lbl_805A53EC@l
/* 803089F4 00305954 38 05 53 EC */ addi r0, r5, sGXState__3CGX@l
/* 803089F8 00305958 7C A0 32 14 */ add r5, r0, r6
/* 803089FC 0030595C 38 A5 00 68 */ addi r5, r5, 0x68
/* 80308A00 00305960 88 05 00 18 */ lbz r0, 0x18(r5)
@ -1082,10 +1082,10 @@ SetTevAlphaOp_Compressed__3CGXF13_GXTevStageIDUi:
/* 80308A24 00305984 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308A28 00305988 7C 08 02 A6 */ mflr r0
/* 80308A2C 0030598C 1C C3 00 1C */ mulli r6, r3, 0x1c
/* 80308A30 00305990 3C A0 80 5A */ lis r5, lbl_805A53EC@ha
/* 80308A30 00305990 3C A0 80 5A */ lis r5, sGXState__3CGX@ha
/* 80308A34 00305994 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308A38 00305998 7C 88 23 78 */ mr r8, r4
/* 80308A3C 0030599C 38 05 53 EC */ addi r0, r5, lbl_805A53EC@l
/* 80308A3C 0030599C 38 05 53 EC */ addi r0, r5, sGXState__3CGX@l
/* 80308A40 003059A0 7C 80 32 14 */ add r4, r0, r6
/* 80308A44 003059A4 38 84 00 68 */ addi r4, r4, 0x68
/* 80308A48 003059A8 80 04 00 0C */ lwz r0, 0xc(r4)
@ -1109,10 +1109,10 @@ SetTevAlphaOp__3CGXF13_GXTevStageID8_GXTevOp10_GXTevBias11_GXTevScaleUc11_GXTevR
/* 80308A80 003059E0 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308A84 003059E4 7C 08 02 A6 */ mflr r0
/* 80308A88 003059E8 1D 43 00 1C */ mulli r10, r3, 0x1c
/* 80308A8C 003059EC 3D 20 80 5A */ lis r9, lbl_805A53EC@ha
/* 80308A8C 003059EC 3D 20 80 5A */ lis r9, sGXState__3CGX@ha
/* 80308A90 003059F0 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308A94 003059F4 54 AB 26 B6 */ rlwinm r11, r5, 4, 0x1a, 0x1b
/* 80308A98 003059F8 38 09 53 EC */ addi r0, r9, lbl_805A53EC@l
/* 80308A98 003059F8 38 09 53 EC */ addi r0, r9, sGXState__3CGX@l
/* 80308A9C 003059FC 7D 20 52 14 */ add r9, r0, r10
/* 80308AA0 00305A00 50 8B 07 3E */ rlwimi r11, r4, 0, 0x1c, 0x1f
/* 80308AA4 00305A04 80 09 00 74 */ lwz r0, 0x74(r9)
@ -1136,10 +1136,10 @@ SetTevColorOp_Compressed__3CGXF13_GXTevStageIDUi:
/* 80308ADC 00305A3C 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308AE0 00305A40 7C 08 02 A6 */ mflr r0
/* 80308AE4 00305A44 1C C3 00 1C */ mulli r6, r3, 0x1c
/* 80308AE8 00305A48 3C A0 80 5A */ lis r5, lbl_805A53EC@ha
/* 80308AE8 00305A48 3C A0 80 5A */ lis r5, sGXState__3CGX@ha
/* 80308AEC 00305A4C 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308AF0 00305A50 7C 88 23 78 */ mr r8, r4
/* 80308AF4 00305A54 38 05 53 EC */ addi r0, r5, lbl_805A53EC@l
/* 80308AF4 00305A54 38 05 53 EC */ addi r0, r5, sGXState__3CGX@l
/* 80308AF8 00305A58 7C 80 32 14 */ add r4, r0, r6
/* 80308AFC 00305A5C 38 84 00 68 */ addi r4, r4, 0x68
/* 80308B00 00305A60 80 04 00 08 */ lwz r0, 8(r4)
@ -1163,10 +1163,10 @@ SetTevColorOp__3CGXF13_GXTevStageID8_GXTevOp10_GXTevBias11_GXTevScaleUc11_GXTevR
/* 80308B38 00305A98 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308B3C 00305A9C 7C 08 02 A6 */ mflr r0
/* 80308B40 00305AA0 1D 43 00 1C */ mulli r10, r3, 0x1c
/* 80308B44 00305AA4 3D 20 80 5A */ lis r9, lbl_805A53EC@ha
/* 80308B44 00305AA4 3D 20 80 5A */ lis r9, sGXState__3CGX@ha
/* 80308B48 00305AA8 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308B4C 00305AAC 54 AB 26 B6 */ rlwinm r11, r5, 4, 0x1a, 0x1b
/* 80308B50 00305AB0 38 09 53 EC */ addi r0, r9, lbl_805A53EC@l
/* 80308B50 00305AB0 38 09 53 EC */ addi r0, r9, sGXState__3CGX@l
/* 80308B54 00305AB4 7D 20 52 14 */ add r9, r0, r10
/* 80308B58 00305AB8 50 8B 07 3E */ rlwimi r11, r4, 0, 0x1c, 0x1f
/* 80308B5C 00305ABC 80 09 00 70 */ lwz r0, 0x70(r9)
@ -1190,10 +1190,10 @@ SetTevAlphaIn__3CGXF13_GXTevStageID14_GXTevAlphaArg14_GXTevAlphaArg14_GXTevAlpha
/* 80308B94 00305AF4 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308B98 00305AF8 7C 08 02 A6 */ mflr r0
/* 80308B9C 00305AFC 1D 23 00 1C */ mulli r9, r3, 0x1c
/* 80308BA0 00305B00 3D 00 80 5A */ lis r8, lbl_805A53EC@ha
/* 80308BA0 00305B00 3D 00 80 5A */ lis r8, sGXState__3CGX@ha
/* 80308BA4 00305B04 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308BA8 00305B08 54 AA 2D B4 */ rlwinm r10, r5, 5, 0x16, 0x1a
/* 80308BAC 00305B0C 38 08 53 EC */ addi r0, r8, lbl_805A53EC@l
/* 80308BAC 00305B0C 38 08 53 EC */ addi r0, r8, sGXState__3CGX@l
/* 80308BB0 00305B10 7D 00 4A 14 */ add r8, r0, r9
/* 80308BB4 00305B14 50 8A 06 FE */ rlwimi r10, r4, 0, 0x1b, 0x1f
/* 80308BB8 00305B18 80 08 00 6C */ lwz r0, 0x6c(r8)
@ -1216,10 +1216,10 @@ SetTevColorIn__3CGXF13_GXTevStageID14_GXTevColorArg14_GXTevColorArg14_GXTevColor
/* 80308BEC 00305B4C 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308BF0 00305B50 7C 08 02 A6 */ mflr r0
/* 80308BF4 00305B54 1D 23 00 1C */ mulli r9, r3, 0x1c
/* 80308BF8 00305B58 3D 00 80 5A */ lis r8, lbl_805A53EC@ha
/* 80308BF8 00305B58 3D 00 80 5A */ lis r8, sGXState__3CGX@ha
/* 80308BFC 00305B5C 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308C00 00305B60 54 AA 2D B4 */ rlwinm r10, r5, 5, 0x16, 0x1a
/* 80308C04 00305B64 38 08 53 EC */ addi r0, r8, lbl_805A53EC@l
/* 80308C04 00305B64 38 08 53 EC */ addi r0, r8, sGXState__3CGX@l
/* 80308C08 00305B68 7D 00 4A 14 */ add r8, r0, r9
/* 80308C0C 00305B6C 50 8A 06 FE */ rlwimi r10, r4, 0, 0x1b, 0x1f
/* 80308C10 00305B70 80 08 00 68 */ lwz r0, 0x68(r8)
@ -1241,10 +1241,10 @@ lbl_80308C34:
SetTevKColor__3CGXF14_GXTevKColorIDRC8_GXColor:
/* 80308C44 00305BA4 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308C48 00305BA8 7C 08 02 A6 */ mflr r0
/* 80308C4C 00305BAC 3C A0 80 5A */ lis r5, lbl_805A53EC@ha
/* 80308C4C 00305BAC 3C A0 80 5A */ lis r5, sGXState__3CGX@ha
/* 80308C50 00305BB0 54 66 10 3A */ slwi r6, r3, 2
/* 80308C54 00305BB4 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308C58 00305BB8 38 05 53 EC */ addi r0, r5, lbl_805A53EC@l
/* 80308C58 00305BB8 38 05 53 EC */ addi r0, r5, sGXState__3CGX@l
/* 80308C5C 00305BBC 80 A4 00 00 */ lwz r5, 0(r4)
/* 80308C60 00305BC0 7C 80 32 14 */ add r4, r0, r6
/* 80308C64 00305BC4 84 04 00 58 */ lwzu r0, 0x58(r4)
@ -1264,9 +1264,9 @@ lbl_80308C80:
SetNumTevStages__3CGXFUc:
/* 80308C90 00305BF0 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308C94 00305BF4 7C 08 02 A6 */ mflr r0
/* 80308C98 00305BF8 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80308C98 00305BF8 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80308C9C 00305BFC 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308CA0 00305C00 38 A4 53 EC */ addi r5, r4, lbl_805A53EC@l
/* 80308CA0 00305C00 38 A4 53 EC */ addi r5, r4, sGXState__3CGX@l
/* 80308CA4 00305C04 54 60 06 3E */ clrlwi r0, r3, 0x18
/* 80308CA8 00305C08 88 85 00 50 */ lbz r4, 0x50(r5)
/* 80308CAC 00305C0C 7C 04 00 40 */ cmplw r4, r0
@ -1282,10 +1282,10 @@ lbl_80308CBC:
.global SetChanCtrl__3CGXFQ23CGX10EChannelIdUc11_GXColorSrc11_GXColorSrc10_GXLightID12_GXDiffuseFn9_GXAttnFn
SetChanCtrl__3CGXFQ23CGX10EChannelIdUc11_GXColorSrc11_GXColorSrc10_GXLightID12_GXDiffuseFn9_GXAttnFn:
/* 80308CCC 00305C2C 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308CD0 00305C30 3D 40 80 5A */ lis r10, lbl_805A53EC@ha
/* 80308CD0 00305C30 3D 40 80 5A */ lis r10, sGXState__3CGX@ha
/* 80308CD4 00305C34 54 6B 08 3C */ slwi r11, r3, 1
/* 80308CD8 00305C38 2C 07 00 00 */ cmpwi r7, 0
/* 80308CDC 00305C3C 38 0A 53 EC */ addi r0, r10, lbl_805A53EC@l
/* 80308CDC 00305C3C 38 0A 53 EC */ addi r0, r10, sGXState__3CGX@l
/* 80308CE0 00305C40 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80308CE4 00305C44 7D 40 5A 14 */ add r10, r0, r11
/* 80308CE8 00305C48 A3 EA 00 30 */ lhz r31, 0x30(r10)
@ -1294,13 +1294,13 @@ SetChanCtrl__3CGXFQ23CGX10EChannelIdUc11_GXColorSrc11_GXColorSrc10_GXLightID12_G
/* 80308CF4 00305C54 38 80 00 00 */ li r4, 0
lbl_80308CF8:
/* 80308CF8 00305C58 54 AB 0F BC */ rlwinm r11, r5, 1, 0x1e, 0x1e
/* 80308CFC 00305C5C 3D 40 80 5A */ lis r10, lbl_805A53EC@ha
/* 80308CFC 00305C5C 3D 40 80 5A */ lis r10, sGXState__3CGX@ha
/* 80308D00 00305C60 50 8B 07 FE */ rlwimi r11, r4, 0, 0x1f, 0x1f
/* 80308D04 00305C64 38 A3 00 01 */ addi r5, r3, 1
/* 80308D08 00305C68 50 CB 17 7A */ rlwimi r11, r6, 2, 0x1d, 0x1d
/* 80308D0C 00305C6C 38 00 00 01 */ li r0, 1
/* 80308D10 00305C70 50 EB 1D 78 */ rlwimi r11, r7, 3, 0x15, 0x1c
/* 80308D14 00305C74 39 4A 53 EC */ addi r10, r10, lbl_805A53EC@l
/* 80308D14 00305C74 39 4A 53 EC */ addi r10, r10, sGXState__3CGX@l
/* 80308D18 00305C78 51 0B 5C E8 */ rlwimi r11, r8, 0xb, 0x13, 0x14
/* 80308D1C 00305C7C 7C 00 28 30 */ slw r0, r0, r5
/* 80308D20 00305C80 7D 63 5B 78 */ mr r3, r11
@ -1323,10 +1323,10 @@ lbl_80308CF8:
SetChanMatColor__3CGXFQ23CGX10EChannelIdRC8_GXColor:
/* 80308D5C 00305CBC 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308D60 00305CC0 7C 08 02 A6 */ mflr r0
/* 80308D64 00305CC4 3C A0 80 5A */ lis r5, lbl_805A53EC@ha
/* 80308D64 00305CC4 3C A0 80 5A */ lis r5, sGXState__3CGX@ha
/* 80308D68 00305CC8 54 66 10 3A */ slwi r6, r3, 2
/* 80308D6C 00305CCC 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308D70 00305CD0 38 05 53 EC */ addi r0, r5, lbl_805A53EC@l
/* 80308D70 00305CD0 38 05 53 EC */ addi r0, r5, sGXState__3CGX@l
/* 80308D74 00305CD4 80 E4 00 00 */ lwz r7, 0(r4)
/* 80308D78 00305CD8 7C 80 32 14 */ add r4, r0, r6
/* 80308D7C 00305CDC 84 04 00 40 */ lwzu r0, 0x40(r4)
@ -1345,9 +1345,9 @@ lbl_80308D9C:
.global GetChanAmbColor__3CGXFQ23CGX10EChannelId
GetChanAmbColor__3CGXFQ23CGX10EChannelId:
/* 80308DAC 00305D0C 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80308DAC 00305D0C 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80308DB0 00305D10 54 60 10 3A */ slwi r0, r3, 2
/* 80308DB4 00305D14 38 64 53 EC */ addi r3, r4, lbl_805A53EC@l
/* 80308DB4 00305D14 38 64 53 EC */ addi r3, r4, sGXState__3CGX@l
/* 80308DB8 00305D18 7C 63 02 14 */ add r3, r3, r0
/* 80308DBC 00305D1C 80 63 00 38 */ lwz r3, 0x38(r3)
/* 80308DC0 00305D20 4E 80 00 20 */ blr
@ -1356,10 +1356,10 @@ GetChanAmbColor__3CGXFQ23CGX10EChannelId:
SetChanAmbColor__3CGXFQ23CGX10EChannelIdRC8_GXColor:
/* 80308DC4 00305D24 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308DC8 00305D28 7C 08 02 A6 */ mflr r0
/* 80308DCC 00305D2C 3C A0 80 5A */ lis r5, lbl_805A53EC@ha
/* 80308DCC 00305D2C 3C A0 80 5A */ lis r5, sGXState__3CGX@ha
/* 80308DD0 00305D30 54 66 10 3A */ slwi r6, r3, 2
/* 80308DD4 00305D34 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308DD8 00305D38 38 05 53 EC */ addi r0, r5, lbl_805A53EC@l
/* 80308DD8 00305D38 38 05 53 EC */ addi r0, r5, sGXState__3CGX@l
/* 80308DDC 00305D3C 80 E4 00 00 */ lwz r7, 0(r4)
/* 80308DE0 00305D40 7C 80 32 14 */ add r4, r0, r6
/* 80308DE4 00305D44 84 04 00 38 */ lwzu r0, 0x38(r4)
@ -1380,10 +1380,10 @@ lbl_80308E04:
SetNumTexGens__3CGXFUc:
/* 80308E14 00305D74 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308E18 00305D78 7C 08 02 A6 */ mflr r0
/* 80308E1C 00305D7C 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80308E1C 00305D7C 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80308E20 00305D80 54 65 06 3E */ clrlwi r5, r3, 0x18
/* 80308E24 00305D84 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308E28 00305D88 38 84 53 EC */ addi r4, r4, lbl_805A53EC@l
/* 80308E28 00305D88 38 84 53 EC */ addi r4, r4, sGXState__3CGX@l
/* 80308E2C 00305D8C 88 04 00 4F */ lbz r0, 0x4f(r4)
/* 80308E30 00305D90 7C 05 00 40 */ cmplw r5, r0
/* 80308E34 00305D94 41 82 00 0C */ beq lbl_80308E40
@ -1397,9 +1397,9 @@ lbl_80308E40:
.global SetNumChans__3CGXFUc
SetNumChans__3CGXFUc:
/* 80308E50 00305DB0 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 80308E50 00305DB0 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 80308E54 00305DB4 54 66 06 3E */ clrlwi r6, r3, 0x18
/* 80308E58 00305DB8 38 E4 53 EC */ addi r7, r4, lbl_805A53EC@l
/* 80308E58 00305DB8 38 E4 53 EC */ addi r7, r4, sGXState__3CGX@l
/* 80308E5C 00305DBC 88 87 00 4D */ lbz r4, 0x4d(r7)
/* 80308E60 00305DC0 88 07 00 4C */ lbz r0, 0x4c(r7)
/* 80308E64 00305DC4 7C A6 20 50 */ subf r5, r6, r4
@ -1414,9 +1414,9 @@ SetNumChans__3CGXFUc:
__sinit_CGX_cpp:
/* 80308E80 00305DE0 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80308E84 00305DE4 7C 08 02 A6 */ mflr r0
/* 80308E88 00305DE8 3C 60 80 5A */ lis r3, lbl_805A53EC@ha
/* 80308E88 00305DE8 3C 60 80 5A */ lis r3, sGXState__3CGX@ha
/* 80308E8C 00305DEC 90 01 00 14 */ stw r0, 0x14(r1)
/* 80308E90 00305DF0 38 63 53 EC */ addi r3, r3, lbl_805A53EC@l
/* 80308E90 00305DF0 38 63 53 EC */ addi r3, r3, sGXState__3CGX@l
/* 80308E94 00305DF4 4B FF F4 09 */ bl __ct__Q23CGX8SGXStateFv
/* 80308E98 00305DF8 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80308E9C 00305DFC 7C 08 03 A6 */ mtlr r0

View File

@ -4094,8 +4094,8 @@ lbl_800B4350:
.global update_fog__3CGXFUi
update_fog__3CGXFUi:
/* 800B4378 000B12D8 3C 80 80 5A */ lis r4, lbl_805A53EC@ha
/* 800B437C 000B12DC 38 A4 53 EC */ addi r5, r4, lbl_805A53EC@l
/* 800B4378 000B12D8 3C 80 80 5A */ lis r4, sGXState__3CGX@ha
/* 800B437C 000B12DC 38 A4 53 EC */ addi r5, r4, sGXState__3CGX@l
/* 800B4380 000B12E0 88 05 00 53 */ lbz r0, 0x53(r5)
/* 800B4384 000B12E4 28 00 00 00 */ cmplwi r0, 0
/* 800B4388 000B12E8 4D 82 00 20 */ beqlr

View File

@ -0,0 +1,19 @@
#ifndef _CCUBEMATERIAL_HPP
#define _CCUBEMATERIAL_HPP
#include "types.h"
#include "Kyoto/Graphics/CModelFlags.hpp"
#include "Kyoto/Math/CVector3f.hpp"
extern CVector3f sPlayerPosition;
class CCubeMaterial {
public:
private:
void SetupBlendMode(u32 blendFactors, const CModelFlags& flags, bool alphaTest);
static CVector3f sViewingFrom;
};
#endif

View File

@ -0,0 +1,103 @@
#ifndef _CGX_HPP
#define _CGX_HPP
#include "types.h"
#include "dolphin/gx.h"
class CGX {
public:
struct STevState {
u32 x0_colorInArgs;
u32 x4_alphaInArgs;
u32 x8_colorOps;
u32 xc_alphaOps;
u32 x10_indFlags;
u32 x14_tevOrderFlags;
u32 x18_kColorSel;
u32 x19_kAlphaSel;
STevState();
};
struct STexState {
u32 x0_coordGen;
STexState();
};
struct SFogParams {
f32 x0_fogStartZ;
f32 x4_fogEndZ;
f32 x8_fogNearZ;
f32 xc_fogFarZ;
GXColor x10_fogColor;
SFogParams(); /* {
x0_fogStartZ = 0.f;
x4_fogEndZ = 1.f;
x8_fogNearZ = 0.1f;
xc_fogFarZ = 1.f;
}*/
};
struct SGXState {
void* x0_arrayPtrs[12];
u16 x30_prevChanCtrls[2];
u16 x34_chanCtrls[2];
GXColor x38_chanAmbColors[2];
GXColor x40_chanMatColors[2];
u32 x48_descList;
u8 x4c_ : 5;
u8 x4c_dirtyChanCtrl : 2;
u8 x4c_numChansDirty : 1;
u8 x4d_prevNumChans;
u8 x4e_numChans;
u8 x4f_numTexGens;
u8 x50_numTevStages;
u8 x51_numIndStages;
u8 x52_zmode;
u8 x53_fogType;
u16 x54_lineWidthAndOffset;
u16 x56_blendMode;
GXColor x58_kColors[4];
STevState x68_tevStates[16];
STexState x228_texStates[8];
u32 x248_alphaCompare;
SFogParams x24c_fogParams;
SGXState();
};
enum EChannelId {
Channel0, // GX_COLOR0
Channel1, // GX_COLOR1
};
static void SetNumChans(u8 num);
static void SetNumTexGens(u8 num);
static void SetNumTevStages(u8 num);
static void SetChanAmbColor(EChannelId channel, const GXColor& color);
static void SetChanMatColor(EChannelId channel, const GXColor& color);
static void SetChanCtrl(EChannelId channel, GXBool enable, GXColorSrc ambSrc, GXColorSrc matSrc, GXLightID lights, GXDiffuseFn diffFn,
GXAttnFn attnFn);
static void SetTevKColor(GXTevKColorID id, const GXColor& color);
static void SetTevColorIn(GXTevStageID stageId, GXTevColorArg a, GXTevColorArg b, GXTevColorArg c, GXTevColorArg d);
static GXColor GetChanAmbColor(EChannelId channel);
static inline bool CompareGXColors(const GXColor& lhs, const GXColor& rhs) {
return *reinterpret_cast< const u32* >(&lhs) == *reinterpret_cast< const u32* >(&rhs);
}
static inline void CopyGXColor(GXColor& dst, const GXColor& src) {
*reinterpret_cast< u32* >(&dst) = *reinterpret_cast< const u32* >(&src);
}
static inline u32 MaskAndShiftLeft(u32 a, u32 b, u32 s) {
return (a & b) << s;
}
private:
static SGXState sGXState;
};
#endif

View File

@ -89,7 +89,7 @@ public:
CTransform4f& operator*(const CVector3f& vec);
static CTransform4f FromColumns(const CVector3f&, const CVector3f&, const CVector3f&, const CVector3f&);
static CTransform4f sIdentity;
static const CTransform4f& Identity() { return sIdentity; }
private:
CVector3f m0;
@ -98,6 +98,8 @@ private:
f32 posY;
CVector3f m2;
f32 posZ;
static CTransform4f sIdentity;
};
inline bool operator==(const CTransform4f& lhs, const CTransform4f& rhs);

View File

@ -8,10 +8,10 @@
#include "MetroidPrime/CEntity.hpp"
#include "MetroidPrime/CModelData.hpp"
#include "MetroidPrime/CModelFlags.hpp"
#include "Kyoto/Audio/CSfxHandle.hpp"
#include "Kyoto/Graphics/CColor.hpp"
#include "Kyoto/Graphics/CModelFlags.hpp"
#include "Kyoto/Math/CAABox.hpp"
#include "Kyoto/Math/CTransform4f.hpp"
#include "Kyoto/TToken.hpp"

32
include/dolphin/gx.h Normal file
View File

@ -0,0 +1,32 @@
#ifndef DOLPHIN_GX_H
#define DOLPHIN_GX_H
#ifdef __cplusplus
extern "C" {
#endif
#include <dolphin/gx/GXBump.h>
#include <dolphin/gx/GXCommandList.h>
#include <dolphin/gx/GXCull.h>
#include <dolphin/gx/GXDispList.h>
#include <dolphin/gx/GXDraw.h>
#include <dolphin/gx/GXExtra.h>
#include <dolphin/gx/GXFifo.h>
#include <dolphin/gx/GXFrameBuffer.h>
#include <dolphin/gx/GXGeometry.h>
#include <dolphin/gx/GXGet.h>
#include <dolphin/gx/GXLighting.h>
#include <dolphin/gx/GXManage.h>
#include <dolphin/gx/GXPerf.h>
#include <dolphin/gx/GXPixel.h>
#include <dolphin/gx/GXStruct.h>
#include <dolphin/gx/GXTev.h>
#include <dolphin/gx/GXTexture.h>
#include <dolphin/gx/GXTransform.h>
#include <dolphin/gx/GXVert.h>
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,28 @@
#ifndef DOLPHIN_GXBUMP_H
#define DOLPHIN_GXBUMP_H
#include <dolphin/gx/GXEnum.h>
#ifdef __cplusplus
extern "C" {
#endif
void GXSetTevDirect(GXTevStageID tev_stage);
void GXSetNumIndStages(u8 nIndStages);
#ifdef TARGET_PC
void GXSetIndTexMtx(GXIndTexMtxID mtx_sel, const void* offset, s8 scale_exp);
#else
void GXSetIndTexMtx(GXIndTexMtxID mtx_sel, f32 offset[2][3], s8 scale_exp);
#endif
void GXSetIndTexOrder(GXIndTexStageID ind_stage, GXTexCoordID tex_coord, GXTexMapID tex_map);
void GXSetTevIndirect(GXTevStageID tev_stage, GXIndTexStageID ind_stage, GXIndTexFormat format,
GXIndTexBiasSel bias_sel, GXIndTexMtxID matrix_sel, GXIndTexWrap wrap_s, GXIndTexWrap wrap_t,
GXBool add_prev, GXBool ind_lod, GXIndTexAlphaSel alpha_sel);
void GXSetTevIndWarp(GXTevStageID tev_stage, GXIndTexStageID ind_stage, GXBool signed_offsets, GXBool replace_mode,
GXIndTexMtxID matrix_sel);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,35 @@
#ifndef DOLPHIN_GXCOMMANDLIST_H
#define DOLPHIN_GXCOMMANDLIST_H
#ifdef __cplusplus
extern "C" {
#endif
#define GX_NOP 0x00
#define GX_DRAW_QUADS 0x80
#define GX_DRAW_TRIANGLES 0x90
#define GX_DRAW_TRIANGLE_STRIP 0x98
#define GX_DRAW_TRIANGLE_FAN 0xA0
#define GX_DRAW_LINES 0xA8
#define GX_DRAW_LINE_STRIP 0xB0
#define GX_DRAW_POINTS 0xB8
#define GX_LOAD_BP_REG 0x61
#define GX_LOAD_CP_REG 0x08
#define GX_LOAD_XF_REG 0x10
#define GX_LOAD_INDX_A 0x20
#define GX_LOAD_INDX_B 0x28
#define GX_LOAD_INDX_C 0x30
#define GX_LOAD_INDX_D 0x38
#define GX_CMD_CALL_DL 0x40
#define GX_CMD_INVL_VC 0x48
#define GX_OPCODE_MASK 0xF8
#define GX_VAT_MASK 0x07
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,18 @@
#ifndef DOLPHIN_GXCULL_H
#define DOLPHIN_GXCULL_H
#include <dolphin/types.h>
#ifdef __cplusplus
extern "C" {
#endif
void GXSetScissor(u32 left, u32 top, u32 wd, u32 ht);
void GXSetCullMode(GXCullMode mode);
void GXSetCoPlanar(GXBool enable);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,18 @@
#ifndef DOLPHIN_GXDISPLIST_H
#define DOLPHIN_GXDISPLIST_H
#include <dolphin/types.h>
#ifdef __cplusplus
extern "C" {
#endif
void GXBeginDisplayList(void* list, u32 size);
u32 GXEndDisplayList(void);
void GXCallDisplayList(const void* list, u32 nbytes);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,16 @@
#ifndef DOLPHIN_GXDRAW_H
#define DOLPHIN_GXDRAW_H
#include <dolphin/types.h>
#ifdef __cplusplus
extern "C" {
#endif
void GXDrawSphere(u8 numMajor, u8 numMinor);
#ifdef __cplusplus
}
#endif
#endif

785
include/dolphin/gx/GXEnum.h Normal file
View File

@ -0,0 +1,785 @@
#ifndef DOLPHIN_GXENUM_H
#define DOLPHIN_GXENUM_H
#include <dolphin/types.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef TARGET_PC
#include <stdbool.h>
typedef bool GXBool;
#else
typedef u8 GXBool;
#endif
#define GX_FALSE ((GXBool)0)
#define GX_TRUE ((GXBool)1)
#define GX_ENABLE ((GXBool)1)
#define GX_DISABLE ((GXBool)0)
typedef enum _GXProjectionType {
GX_PERSPECTIVE,
GX_ORTHOGRAPHIC,
} GXProjectionType;
typedef enum _GXCompare {
GX_NEVER,
GX_LESS,
GX_EQUAL,
GX_LEQUAL,
GX_GREATER,
GX_NEQUAL,
GX_GEQUAL,
GX_ALWAYS,
} GXCompare;
typedef enum _GXAlphaOp {
GX_AOP_AND,
GX_AOP_OR,
GX_AOP_XOR,
GX_AOP_XNOR,
GX_MAX_ALPHAOP,
} GXAlphaOp;
typedef enum _GXZFmt16 {
GX_ZC_LINEAR,
GX_ZC_NEAR,
GX_ZC_MID,
GX_ZC_FAR,
} GXZFmt16;
typedef enum _GXGamma {
GX_GM_1_0,
GX_GM_1_7,
GX_GM_2_2,
} GXGamma;
typedef enum _GXPixelFmt {
GX_PF_RGB8_Z24,
GX_PF_RGBA6_Z24,
GX_PF_RGB565_Z16,
GX_PF_Z24,
GX_PF_Y8,
GX_PF_U8,
GX_PF_V8,
GX_PF_YUV420,
} GXPixelFmt;
typedef enum _GXPrimitive {
GX_QUADS = 0x80,
GX_TRIANGLES = 0x90,
GX_TRIANGLESTRIP = 0x98,
GX_TRIANGLEFAN = 0xA0,
GX_LINES = 0xA8,
GX_LINESTRIP = 0xB0,
GX_POINTS = 0xB8,
} GXPrimitive;
typedef enum _GXVtxFmt {
GX_VTXFMT0,
GX_VTXFMT1,
GX_VTXFMT2,
GX_VTXFMT3,
GX_VTXFMT4,
GX_VTXFMT5,
GX_VTXFMT6,
GX_VTXFMT7,
GX_MAX_VTXFMT,
} GXVtxFmt;
typedef enum _GXAttr {
GX_VA_PNMTXIDX,
GX_VA_TEX0MTXIDX,
GX_VA_TEX1MTXIDX,
GX_VA_TEX2MTXIDX,
GX_VA_TEX3MTXIDX,
GX_VA_TEX4MTXIDX,
GX_VA_TEX5MTXIDX,
GX_VA_TEX6MTXIDX,
GX_VA_TEX7MTXIDX,
GX_VA_POS,
GX_VA_NRM,
GX_VA_CLR0,
GX_VA_CLR1,
GX_VA_TEX0,
GX_VA_TEX1,
GX_VA_TEX2,
GX_VA_TEX3,
GX_VA_TEX4,
GX_VA_TEX5,
GX_VA_TEX6,
GX_VA_TEX7,
GX_POS_MTX_ARRAY,
GX_NRM_MTX_ARRAY,
GX_TEX_MTX_ARRAY,
GX_LIGHT_ARRAY,
GX_VA_NBT,
GX_VA_MAX_ATTR,
GX_VA_NULL = 0xFF,
} GXAttr;
typedef enum _GXAttrType {
GX_NONE,
GX_DIRECT,
GX_INDEX8,
GX_INDEX16,
} GXAttrType;
#define _GX_TF_CTF 0x20
#define _GX_TF_ZTF 0x10
typedef enum _GXTexFmt {
GX_TF_I4 = 0x0,
GX_TF_I8 = 0x1,
GX_TF_IA4 = 0x2,
GX_TF_IA8 = 0x3,
GX_TF_RGB565 = 0x4,
GX_TF_RGB5A3 = 0x5,
GX_TF_RGBA8 = 0x6,
GX_TF_CMPR = 0xE,
GX_CTF_R4 = 0x0 | _GX_TF_CTF,
GX_CTF_RA4 = 0x2 | _GX_TF_CTF,
GX_CTF_RA8 = 0x3 | _GX_TF_CTF,
GX_CTF_YUVA8 = 0x6 | _GX_TF_CTF,
GX_CTF_A8 = 0x7 | _GX_TF_CTF,
GX_CTF_R8 = 0x8 | _GX_TF_CTF,
GX_CTF_G8 = 0x9 | _GX_TF_CTF,
GX_CTF_B8 = 0xA | _GX_TF_CTF,
GX_CTF_RG8 = 0xB | _GX_TF_CTF,
GX_CTF_GB8 = 0xC | _GX_TF_CTF,
GX_TF_Z8 = 0x1 | _GX_TF_ZTF,
GX_TF_Z16 = 0x3 | _GX_TF_ZTF,
GX_TF_Z24X8 = 0x6 | _GX_TF_ZTF,
GX_CTF_Z4 = 0x0 | _GX_TF_ZTF | _GX_TF_CTF,
GX_CTF_Z8M = 0x9 | _GX_TF_ZTF | _GX_TF_CTF,
GX_CTF_Z8L = 0xA | _GX_TF_ZTF | _GX_TF_CTF,
GX_CTF_Z16L = 0xC | _GX_TF_ZTF | _GX_TF_CTF,
GX_TF_A8 = GX_CTF_A8,
} GXTexFmt;
typedef enum _GXCITexFmt {
GX_TF_C4 = 0x8,
GX_TF_C8 = 0x9,
GX_TF_C14X2 = 0xa,
} GXCITexFmt;
typedef enum _GXTexWrapMode {
GX_CLAMP,
GX_REPEAT,
GX_MIRROR,
GX_MAX_TEXWRAPMODE,
} GXTexWrapMode;
typedef enum _GXTexFilter {
GX_NEAR,
GX_LINEAR,
GX_NEAR_MIP_NEAR,
GX_LIN_MIP_NEAR,
GX_NEAR_MIP_LIN,
GX_LIN_MIP_LIN,
} GXTexFilter;
typedef enum _GXAnisotropy {
GX_ANISO_1,
GX_ANISO_2,
GX_ANISO_4,
GX_MAX_ANISOTROPY,
} GXAnisotropy;
typedef enum _GXTexMapID {
GX_TEXMAP0,
GX_TEXMAP1,
GX_TEXMAP2,
GX_TEXMAP3,
GX_TEXMAP4,
GX_TEXMAP5,
GX_TEXMAP6,
GX_TEXMAP7,
GX_MAX_TEXMAP,
GX_TEXMAP_NULL = 0xFF,
GX_TEX_DISABLE = 0x100,
} GXTexMapID;
typedef enum _GXTexCoordID {
GX_TEXCOORD0,
GX_TEXCOORD1,
GX_TEXCOORD2,
GX_TEXCOORD3,
GX_TEXCOORD4,
GX_TEXCOORD5,
GX_TEXCOORD6,
GX_TEXCOORD7,
GX_MAX_TEXCOORD,
GX_TEXCOORD_NULL = 0xFF,
} GXTexCoordID;
typedef enum _GXTevStageID {
GX_TEVSTAGE0,
GX_TEVSTAGE1,
GX_TEVSTAGE2,
GX_TEVSTAGE3,
GX_TEVSTAGE4,
GX_TEVSTAGE5,
GX_TEVSTAGE6,
GX_TEVSTAGE7,
GX_TEVSTAGE8,
GX_TEVSTAGE9,
GX_TEVSTAGE10,
GX_TEVSTAGE11,
GX_TEVSTAGE12,
GX_TEVSTAGE13,
GX_TEVSTAGE14,
GX_TEVSTAGE15,
GX_MAX_TEVSTAGE,
} GXTevStageID;
typedef enum _GXTevMode {
GX_MODULATE,
GX_DECAL,
GX_BLEND,
GX_REPLACE,
GX_PASSCLR,
} GXTevMode;
typedef enum _GXTexMtxType {
GX_MTX3x4,
GX_MTX2x4,
} GXTexMtxType;
typedef enum _GXTexGenType {
GX_TG_MTX3x4,
GX_TG_MTX2x4,
GX_TG_BUMP0,
GX_TG_BUMP1,
GX_TG_BUMP2,
GX_TG_BUMP3,
GX_TG_BUMP4,
GX_TG_BUMP5,
GX_TG_BUMP6,
GX_TG_BUMP7,
GX_TG_SRTG,
} GXTexGenType;
typedef enum _GXPosNrmMtx {
GX_PNMTX0 = 0,
GX_PNMTX1 = 3,
GX_PNMTX2 = 6,
GX_PNMTX3 = 9,
GX_PNMTX4 = 12,
GX_PNMTX5 = 15,
GX_PNMTX6 = 18,
GX_PNMTX7 = 21,
GX_PNMTX8 = 24,
GX_PNMTX9 = 27,
} GXPosNrmMtx;
typedef enum _GXTexMtx {
GX_TEXMTX0 = 30,
GX_TEXMTX1 = 33,
GX_TEXMTX2 = 36,
GX_TEXMTX3 = 39,
GX_TEXMTX4 = 42,
GX_TEXMTX5 = 45,
GX_TEXMTX6 = 48,
GX_TEXMTX7 = 51,
GX_TEXMTX8 = 54,
GX_TEXMTX9 = 57,
GX_IDENTITY = 60,
} GXTexMtx;
typedef enum _GXChannelID {
GX_COLOR0,
GX_COLOR1,
GX_ALPHA0,
GX_ALPHA1,
GX_COLOR0A0,
GX_COLOR1A1,
GX_COLOR_ZERO,
GX_ALPHA_BUMP,
GX_ALPHA_BUMPN,
GX_COLOR_NULL = 0xFF,
} GXChannelID;
typedef enum _GXTexGenSrc {
GX_TG_POS,
GX_TG_NRM,
GX_TG_BINRM,
GX_TG_TANGENT,
GX_TG_TEX0,
GX_TG_TEX1,
GX_TG_TEX2,
GX_TG_TEX3,
GX_TG_TEX4,
GX_TG_TEX5,
GX_TG_TEX6,
GX_TG_TEX7,
GX_TG_TEXCOORD0,
GX_TG_TEXCOORD1,
GX_TG_TEXCOORD2,
GX_TG_TEXCOORD3,
GX_TG_TEXCOORD4,
GX_TG_TEXCOORD5,
GX_TG_TEXCOORD6,
GX_TG_COLOR0,
GX_TG_COLOR1,
GX_MAX_TEXGENSRC,
} GXTexGenSrc;
typedef enum _GXBlendMode {
GX_BM_NONE,
GX_BM_BLEND,
GX_BM_LOGIC,
GX_BM_SUBTRACT,
GX_MAX_BLENDMODE,
} GXBlendMode;
typedef enum _GXBlendFactor {
GX_BL_ZERO,
GX_BL_ONE,
GX_BL_SRCCLR,
GX_BL_INVSRCCLR,
GX_BL_SRCALPHA,
GX_BL_INVSRCALPHA,
GX_BL_DSTALPHA,
GX_BL_INVDSTALPHA,
GX_BL_DSTCLR = GX_BL_SRCCLR,
GX_BL_INVDSTCLR = GX_BL_INVSRCCLR,
} GXBlendFactor;
typedef enum _GXLogicOp {
GX_LO_CLEAR,
GX_LO_AND,
GX_LO_REVAND,
GX_LO_COPY,
GX_LO_INVAND,
GX_LO_NOOP,
GX_LO_XOR,
GX_LO_OR,
GX_LO_NOR,
GX_LO_EQUIV,
GX_LO_INV,
GX_LO_REVOR,
GX_LO_INVCOPY,
GX_LO_INVOR,
GX_LO_NAND,
GX_LO_SET,
} GXLogicOp;
typedef enum _GXCompCnt {
GX_POS_XY = 0,
GX_POS_XYZ = 1,
GX_NRM_XYZ = 0,
GX_NRM_NBT = 1,
GX_NRM_NBT3 = 2,
GX_CLR_RGB = 0,
GX_CLR_RGBA = 1,
GX_TEX_S = 0,
GX_TEX_ST = 1,
} GXCompCnt;
typedef enum _GXCompType {
GX_U8 = 0,
GX_S8 = 1,
GX_U16 = 2,
GX_S16 = 3,
GX_F32 = 4,
GX_RGB565 = 0,
GX_RGB8 = 1,
GX_RGBX8 = 2,
GX_RGBA4 = 3,
GX_RGBA6 = 4,
GX_RGBA8 = 5,
} GXCompType;
typedef enum _GXPTTexMtx {
GX_PTTEXMTX0 = 64,
GX_PTTEXMTX1 = 67,
GX_PTTEXMTX2 = 70,
GX_PTTEXMTX3 = 73,
GX_PTTEXMTX4 = 76,
GX_PTTEXMTX5 = 79,
GX_PTTEXMTX6 = 82,
GX_PTTEXMTX7 = 85,
GX_PTTEXMTX8 = 88,
GX_PTTEXMTX9 = 91,
GX_PTTEXMTX10 = 94,
GX_PTTEXMTX11 = 97,
GX_PTTEXMTX12 = 100,
GX_PTTEXMTX13 = 103,
GX_PTTEXMTX14 = 106,
GX_PTTEXMTX15 = 109,
GX_PTTEXMTX16 = 112,
GX_PTTEXMTX17 = 115,
GX_PTTEXMTX18 = 118,
GX_PTTEXMTX19 = 121,
GX_PTIDENTITY = 125,
} GXPTTexMtx;
typedef enum _GXTevRegID {
GX_TEVPREV,
GX_TEVREG0,
GX_TEVREG1,
GX_TEVREG2,
GX_MAX_TEVREG,
} GXTevRegID;
typedef enum _GXDiffuseFn {
GX_DF_NONE,
GX_DF_SIGN,
GX_DF_CLAMP,
} GXDiffuseFn;
typedef enum _GXColorSrc {
GX_SRC_REG,
GX_SRC_VTX,
} GXColorSrc;
typedef enum _GXAttnFn {
GX_AF_SPEC,
GX_AF_SPOT,
GX_AF_NONE,
} GXAttnFn;
typedef enum _GXLightID {
GX_LIGHT0 = 0x001,
GX_LIGHT1 = 0x002,
GX_LIGHT2 = 0x004,
GX_LIGHT3 = 0x008,
GX_LIGHT4 = 0x010,
GX_LIGHT5 = 0x020,
GX_LIGHT6 = 0x040,
GX_LIGHT7 = 0x080,
GX_MAX_LIGHT = 0x100,
GX_LIGHT_NULL = 0,
} GXLightID;
typedef enum _GXTexOffset {
GX_TO_ZERO,
GX_TO_SIXTEENTH,
GX_TO_EIGHTH,
GX_TO_FOURTH,
GX_TO_HALF,
GX_TO_ONE,
GX_MAX_TEXOFFSET,
} GXTexOffset;
typedef enum _GXSpotFn {
GX_SP_OFF,
GX_SP_FLAT,
GX_SP_COS,
GX_SP_COS2,
GX_SP_SHARP,
GX_SP_RING1,
GX_SP_RING2,
} GXSpotFn;
typedef enum _GXDistAttnFn {
GX_DA_OFF,
GX_DA_GENTLE,
GX_DA_MEDIUM,
GX_DA_STEEP,
} GXDistAttnFn;
typedef enum _GXCullMode {
GX_CULL_NONE,
GX_CULL_FRONT,
GX_CULL_BACK,
GX_CULL_ALL,
} GXCullMode;
typedef enum _GXTevSwapSel {
GX_TEV_SWAP0 = 0,
GX_TEV_SWAP1,
GX_TEV_SWAP2,
GX_TEV_SWAP3,
GX_MAX_TEVSWAP,
} GXTevSwapSel;
typedef enum _GXTevColorChan {
GX_CH_RED = 0,
GX_CH_GREEN,
GX_CH_BLUE,
GX_CH_ALPHA,
} GXTevColorChan;
typedef enum _GXFogType {
GX_FOG_NONE = 0,
GX_FOG_PERSP_LIN = 2,
GX_FOG_PERSP_EXP = 4,
GX_FOG_PERSP_EXP2 = 5,
GX_FOG_PERSP_REVEXP = 6,
GX_FOG_PERSP_REVEXP2 = 7,
GX_FOG_ORTHO_LIN = 10,
GX_FOG_ORTHO_EXP = 12,
GX_FOG_ORTHO_EXP2 = 13,
GX_FOG_ORTHO_REVEXP = 14,
GX_FOG_ORTHO_REVEXP2 = 15,
GX_FOG_LIN = GX_FOG_PERSP_LIN,
GX_FOG_EXP = GX_FOG_PERSP_EXP,
GX_FOG_EXP2 = GX_FOG_PERSP_EXP2,
GX_FOG_REVEXP = GX_FOG_PERSP_REVEXP,
GX_FOG_REVEXP2 = GX_FOG_PERSP_REVEXP2,
} GXFogType;
typedef enum _GXTevColorArg {
GX_CC_CPREV,
GX_CC_APREV,
GX_CC_C0,
GX_CC_A0,
GX_CC_C1,
GX_CC_A1,
GX_CC_C2,
GX_CC_A2,
GX_CC_TEXC,
GX_CC_TEXA,
GX_CC_RASC,
GX_CC_RASA,
GX_CC_ONE,
GX_CC_HALF,
GX_CC_KONST,
GX_CC_ZERO,
} GXTevColorArg;
typedef enum _GXTevAlphaArg {
GX_CA_APREV,
GX_CA_A0,
GX_CA_A1,
GX_CA_A2,
GX_CA_TEXA,
GX_CA_RASA,
GX_CA_KONST,
GX_CA_ZERO,
} GXTevAlphaArg;
typedef enum _GXTevOp {
GX_TEV_ADD = 0,
GX_TEV_SUB = 1,
GX_TEV_COMP_R8_GT = 8,
GX_TEV_COMP_R8_EQ = 9,
GX_TEV_COMP_GR16_GT = 10,
GX_TEV_COMP_GR16_EQ = 11,
GX_TEV_COMP_BGR24_GT = 12,
GX_TEV_COMP_BGR24_EQ = 13,
GX_TEV_COMP_RGB8_GT = 14,
GX_TEV_COMP_RGB8_EQ = 15,
GX_TEV_COMP_A8_GT = GX_TEV_COMP_RGB8_GT,
GX_TEV_COMP_A8_EQ = GX_TEV_COMP_RGB8_EQ,
} GXTevOp;
typedef enum _GXTevBias {
GX_TB_ZERO,
GX_TB_ADDHALF,
GX_TB_SUBHALF,
GX_MAX_TEVBIAS,
} GXTevBias;
typedef enum _GXTevScale {
GX_CS_SCALE_1,
GX_CS_SCALE_2,
GX_CS_SCALE_4,
GX_CS_DIVIDE_2,
GX_MAX_TEVSCALE,
} GXTevScale;
typedef enum _GXTevKColorSel {
GX_TEV_KCSEL_8_8 = 0x00,
GX_TEV_KCSEL_7_8 = 0x01,
GX_TEV_KCSEL_6_8 = 0x02,
GX_TEV_KCSEL_5_8 = 0x03,
GX_TEV_KCSEL_4_8 = 0x04,
GX_TEV_KCSEL_3_8 = 0x05,
GX_TEV_KCSEL_2_8 = 0x06,
GX_TEV_KCSEL_1_8 = 0x07,
GX_TEV_KCSEL_1 = GX_TEV_KCSEL_8_8,
GX_TEV_KCSEL_3_4 = GX_TEV_KCSEL_6_8,
GX_TEV_KCSEL_1_2 = GX_TEV_KCSEL_4_8,
GX_TEV_KCSEL_1_4 = GX_TEV_KCSEL_2_8,
GX_TEV_KCSEL_K0 = 0x0C,
GX_TEV_KCSEL_K1 = 0x0D,
GX_TEV_KCSEL_K2 = 0x0E,
GX_TEV_KCSEL_K3 = 0x0F,
GX_TEV_KCSEL_K0_R = 0x10,
GX_TEV_KCSEL_K1_R = 0x11,
GX_TEV_KCSEL_K2_R = 0x12,
GX_TEV_KCSEL_K3_R = 0x13,
GX_TEV_KCSEL_K0_G = 0x14,
GX_TEV_KCSEL_K1_G = 0x15,
GX_TEV_KCSEL_K2_G = 0x16,
GX_TEV_KCSEL_K3_G = 0x17,
GX_TEV_KCSEL_K0_B = 0x18,
GX_TEV_KCSEL_K1_B = 0x19,
GX_TEV_KCSEL_K2_B = 0x1A,
GX_TEV_KCSEL_K3_B = 0x1B,
GX_TEV_KCSEL_K0_A = 0x1C,
GX_TEV_KCSEL_K1_A = 0x1D,
GX_TEV_KCSEL_K2_A = 0x1E,
GX_TEV_KCSEL_K3_A = 0x1F,
} GXTevKColorSel;
typedef enum _GXTevKAlphaSel {
GX_TEV_KASEL_8_8 = 0x00,
GX_TEV_KASEL_7_8 = 0x01,
GX_TEV_KASEL_6_8 = 0x02,
GX_TEV_KASEL_5_8 = 0x03,
GX_TEV_KASEL_4_8 = 0x04,
GX_TEV_KASEL_3_8 = 0x05,
GX_TEV_KASEL_2_8 = 0x06,
GX_TEV_KASEL_1_8 = 0x07,
GX_TEV_KASEL_1 = GX_TEV_KASEL_8_8,
GX_TEV_KASEL_3_4 = GX_TEV_KASEL_6_8,
GX_TEV_KASEL_1_2 = GX_TEV_KASEL_4_8,
GX_TEV_KASEL_1_4 = GX_TEV_KASEL_2_8,
GX_TEV_KASEL_K0_R = 0x10,
GX_TEV_KASEL_K1_R = 0x11,
GX_TEV_KASEL_K2_R = 0x12,
GX_TEV_KASEL_K3_R = 0x13,
GX_TEV_KASEL_K0_G = 0x14,
GX_TEV_KASEL_K1_G = 0x15,
GX_TEV_KASEL_K2_G = 0x16,
GX_TEV_KASEL_K3_G = 0x17,
GX_TEV_KASEL_K0_B = 0x18,
GX_TEV_KASEL_K1_B = 0x19,
GX_TEV_KASEL_K2_B = 0x1A,
GX_TEV_KASEL_K3_B = 0x1B,
GX_TEV_KASEL_K0_A = 0x1C,
GX_TEV_KASEL_K1_A = 0x1D,
GX_TEV_KASEL_K2_A = 0x1E,
GX_TEV_KASEL_K3_A = 0x1F,
} GXTevKAlphaSel;
typedef enum _GXTevKColorID {
GX_KCOLOR0 = 0,
GX_KCOLOR1,
GX_KCOLOR2,
GX_KCOLOR3,
GX_MAX_KCOLOR,
} GXTevKColorID;
typedef enum _GXZTexOp {
GX_ZT_DISABLE,
GX_ZT_ADD,
GX_ZT_REPLACE,
GX_MAX_ZTEXOP,
} GXZTexOp;
typedef enum _GXIndTexFormat {
GX_ITF_8,
GX_ITF_5,
GX_ITF_4,
GX_ITF_3,
GX_MAX_ITFORMAT,
} GXIndTexFormat;
typedef enum _GXIndTexBiasSel {
GX_ITB_NONE,
GX_ITB_S,
GX_ITB_T,
GX_ITB_ST,
GX_ITB_U,
GX_ITB_SU,
GX_ITB_TU,
GX_ITB_STU,
GX_MAX_ITBIAS,
} GXIndTexBiasSel;
typedef enum _GXIndTexAlphaSel {
GX_ITBA_OFF,
GX_ITBA_S,
GX_ITBA_T,
GX_ITBA_U,
GX_MAX_ITBALPHA,
} GXIndTexAlphaSel;
typedef enum _GXIndTexMtxID {
GX_ITM_OFF,
GX_ITM_0,
GX_ITM_1,
GX_ITM_2,
GX_ITM_S0 = 5,
GX_ITM_S1,
GX_ITM_S2,
GX_ITM_T0 = 9,
GX_ITM_T1,
GX_ITM_T2,
} GXIndTexMtxID;
typedef enum _GXIndTexWrap {
GX_ITW_OFF,
GX_ITW_256,
GX_ITW_128,
GX_ITW_64,
GX_ITW_32,
GX_ITW_16,
GX_ITW_0,
GX_MAX_ITWRAP,
} GXIndTexWrap;
typedef enum _GXIndTexStageID {
GX_INDTEXSTAGE0,
GX_INDTEXSTAGE1,
GX_INDTEXSTAGE2,
GX_INDTEXSTAGE3,
GX_MAX_INDTEXSTAGE,
} GXIndTexStageID;
typedef enum _GXIndTexScale {
GX_ITS_1,
GX_ITS_2,
GX_ITS_4,
GX_ITS_8,
GX_ITS_16,
GX_ITS_32,
GX_ITS_64,
GX_ITS_128,
GX_ITS_256,
GX_MAX_ITSCALE,
} GXIndTexScale;
typedef enum _GXClipMode {
GX_CLIP_ENABLE = 0,
GX_CLIP_DISABLE = 1,
} GXClipMode;
typedef enum _GXTlut {
GX_TLUT0 = 0,
GX_TLUT1 = 1,
GX_TLUT2 = 2,
GX_TLUT3 = 3,
GX_TLUT4 = 4,
GX_TLUT5 = 5,
GX_TLUT6 = 6,
GX_TLUT7 = 7,
GX_TLUT8 = 8,
GX_TLUT9 = 9,
GX_TLUT10 = 10,
GX_TLUT11 = 11,
GX_TLUT12 = 12,
GX_TLUT13 = 13,
GX_TLUT14 = 14,
GX_TLUT15 = 15,
GX_BIGTLUT0 = 16,
GX_BIGTLUT1 = 17,
GX_BIGTLUT2 = 18,
GX_BIGTLUT3 = 19,
} GXTlut;
typedef enum _GXTlutFmt {
GX_TL_IA8,
GX_TL_RGB565,
GX_TL_RGB5A3,
GX_MAX_TLUTFMT,
} GXTlutFmt;
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,34 @@
#ifndef DOLPHIN_GXEXTRA_H
#define DOLPHIN_GXEXTRA_H
// Extra types for PC
#ifdef TARGET_PC
#include <dolphin/gx/GXStruct.h>
#include <dolphin/types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
float r;
float g;
float b;
float a;
} GXColorF32;
typedef enum {
GX_TF_R8_PC = 0x60,
GX_TF_RGBA8_PC = 0x61,
} GXPCTexFmt;
void GXDestroyTexObj(GXTexObj* obj);
void GXDestroyTlutObj(GXTlutObj* obj);
void GXColor4f32(float r, float g, float b, float a);
#ifdef __cplusplus
}
#endif
#endif
#endif

View File

@ -0,0 +1,31 @@
#ifndef DOLPHIN_GXFIFO_H
#define DOLPHIN_GXFIFO_H
#include <dolphin/gx/GXEnum.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
u8 pad[128];
} GXFifoObj;
void GXInitFifoBase(GXFifoObj* fifo, void* base, u32 size);
void GXInitFifoPtrs(GXFifoObj* fifo, void* readPtr, void* writePtr);
void GXGetFifoPtrs(GXFifoObj* fifo, void** readPtr, void** writePtr);
GXFifoObj* GXGetCPUFifo(void);
GXFifoObj* GXGetGPFifo(void);
void GXSetCPUFifo(GXFifoObj* fifo);
void GXSetGPFifo(GXFifoObj* fifo);
void GXSaveCPUFifo(GXFifoObj* fifo);
void GXGetFifoStatus(GXFifoObj* fifo, GXBool* overhi, GXBool* underlow, u32* fifoCount, GXBool* cpu_write,
GXBool* gp_read, GXBool* fifowrap);
void GXGetGPStatus(GXBool* overhi, GXBool* underlow, GXBool* readIdle, GXBool* cmdIdle, GXBool* brkpt);
void GXInitFifoLimits(GXFifoObj* fifo, u32 hiWaterMark, u32 loWaterMark);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,30 @@
#ifndef DOLPHIN_GXFRAMEBUFFER_H
#define DOLPHIN_GXFRAMEBUFFER_H
#include <dolphin/gx/GXEnum.h>
#include <dolphin/gx/GXStruct.h>
#ifdef __cplusplus
extern "C" {
#endif
#define GX_MAX_Z24 0x00FFFFFF
void GXSetCopyClear(GXColor clear_clr, u32 clear_z);
void GXAdjustForOverscan(GXRenderModeObj* rmin, GXRenderModeObj* rmout, u16 hor, u16 ver);
void GXCopyDisp(void* dest, GXBool clear);
void GXSetDispCopyGamma(GXGamma gamma);
void GXSetDispCopySrc(u16 left, u16 top, u16 wd, u16 ht);
void GXSetDispCopyDst(u16 wd, u16 ht);
u32 GXSetDispCopyYScale(f32 vscale);
void GXSetCopyFilter(GXBool aa, u8 sample_pattern[12][2], GXBool vf, u8 vfilter[7]);
void GXSetPixelFmt(GXPixelFmt pix_fmt, GXZFmt16 z_fmt);
void GXSetTexCopySrc(u16 left, u16 top, u16 wd, u16 ht);
void GXSetTexCopyDst(u16 wd, u16 ht, GXTexFmt fmt, GXBool mipmap);
void GXCopyTex(void* dest, GXBool clear);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,36 @@
#ifndef DOLPHIN_GXGEOMETRY_H
#define DOLPHIN_GXGEOMETRY_H
#include <dolphin/gx/GXEnum.h>
#ifdef __cplusplus
extern "C" {
#endif
void GXSetVtxDesc(GXAttr attr, GXAttrType type);
void GXSetVtxDescv(GXVtxDescList* list);
void GXClearVtxDesc(void);
void GXSetVtxAttrFmt(GXVtxFmt vtxfmt, GXAttr attr, GXCompCnt cnt, GXCompType type, u8 frac);
void GXSetNumTexGens(u8 nTexGens);
void GXBegin(GXPrimitive type, GXVtxFmt vtxfmt, u16 nverts);
void GXSetTexCoordGen2(GXTexCoordID dst_coord, GXTexGenType func, GXTexGenSrc src_param, u32 mtx, GXBool normalize,
u32 postmtx);
void GXSetLineWidth(u8 width, GXTexOffset texOffsets);
void GXSetPointSize(u8 pointSize, GXTexOffset texOffsets);
void GXEnableTexOffsets(GXTexCoordID coord, GXBool line_enable, GXBool point_enable);
#ifdef TARGET_PC
void GXSetArray(GXAttr attr, const void* data, u32 size, u8 stride);
#else
void GXSetArray(GXAttr attr, const void* data, u8 stride);
#endif
void GXInvalidateVtxCache(void);
static inline void GXSetTexCoordGen(GXTexCoordID dst_coord, GXTexGenType func, GXTexGenSrc src_param, u32 mtx) {
GXSetTexCoordGen2(dst_coord, func, src_param, mtx, GX_FALSE, GX_PTIDENTITY);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,27 @@
#ifndef DOLPHIN_GXGET_H
#define DOLPHIN_GXGET_H
#include <dolphin/gx/GXEnum.h>
#include <dolphin/gx/GXStruct.h>
#ifdef __cplusplus
extern "C" {
#endif
GXBool GXGetTexObjMipMap(GXTexObj* tex_obj);
GXTexFmt GXGetTexObjFmt(GXTexObj* tex_obj);
u16 GXGetTexObjHeight(GXTexObj* tex_obj);
u16 GXGetTexObjWidth(GXTexObj* tex_obj);
GXTexWrapMode GXGetTexObjWrapS(GXTexObj* tex_obj);
GXTexWrapMode GXGetTexObjWrapT(GXTexObj* tex_obj);
void* GXGetTexObjData(GXTexObj* tex_obj);
void GXGetProjectionv(f32* p);
void GXGetLightPos(GXLightObj* lt_obj, f32* x, f32* y, f32* z);
void GXGetLightColor(GXLightObj* lt_obj, GXColor* color);
void GXGetVtxAttrFmt(GXVtxFmt idx, GXAttr attr, GXCompCnt* compCnt, GXCompType* compType, u8* shift);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,31 @@
#ifndef DOLPHIN_GXLIGHTING_H
#define DOLPHIN_GXLIGHTING_H
#include <dolphin/gx/GXEnum.h>
#include <dolphin/gx/GXStruct.h>
#ifdef __cplusplus
extern "C" {
#endif
void GXSetNumChans(u8 nChans);
void GXSetChanCtrl(GXChannelID chan, GXBool enable, GXColorSrc amb_src, GXColorSrc mat_src, u32 light_mask,
GXDiffuseFn diff_fn, GXAttnFn attn_fn);
void GXSetChanAmbColor(GXChannelID chan, GXColor amb_color);
void GXSetChanMatColor(GXChannelID chan, GXColor mat_color);
void GXInitLightSpot(GXLightObj* lt_obj, f32 cutoff, GXSpotFn spot_func);
void GXInitLightDistAttn(GXLightObj* lt_obj, f32 ref_distance, f32 ref_brightness, GXDistAttnFn dist_func);
void GXInitLightPos(GXLightObj* lt_obj, f32 x, f32 y, f32 z);
void GXInitLightDir(GXLightObj* lt_obj, f32 nx, f32 ny, f32 nz);
void GXInitLightColor(GXLightObj* lt_obj, GXColor color);
void GXInitLightAttn(GXLightObj* lt_obj, f32 a0, f32 a1, f32 a2, f32 k0, f32 k1, f32 k2);
void GXInitLightAttnA(GXLightObj* lt_obj, f32 a0, f32 a1, f32 a2);
void GXInitLightAttnK(GXLightObj* lt_obj, f32 k0, f32 k1, f32 k2);
void GXLoadLightObjImm(GXLightObj* lt_obj, GXLightID light);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,23 @@
#ifndef DOLPHIN_GXMANAGE_H
#define DOLPHIN_GXMANAGE_H
#include <dolphin/gx/GXFifo.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*GXDrawDoneCallback)(void);
GXFifoObj* GXInit(void* base, u32 size);
GXDrawDoneCallback GXSetDrawDoneCallback(GXDrawDoneCallback cb);
void GXDrawDone(void);
void GXSetDrawDone(void);
void GXFlush(void);
void GXPixModeSync(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,16 @@
#ifndef DOLPHIN_GXPERF_H
#define DOLPHIN_GXPERF_H
#include <dolphin/types.h>
#ifdef __cplusplus
extern "C" {
#endif
void GXReadXfRasMetric(u32* xf_wait_in, u32* xf_wait_out, u32* ras_busy, u32* clocks);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,28 @@
#ifndef DOLPHIN_GXPIXEL_H
#define DOLPHIN_GXPIXEL_H
#include <dolphin/gx/GXEnum.h>
#ifdef __cplusplus
extern "C" {
#endif
void GXSetFog(GXFogType type, f32 startz, f32 endz, f32 nearz, f32 farz, GXColor color);
void GXSetFogColor(GXColor color);
// ? GXSetFogRangeAdj();
void GXSetBlendMode(GXBlendMode type, GXBlendFactor src_factor, GXBlendFactor dst_factor, GXLogicOp op);
void GXSetColorUpdate(GXBool update_enable);
void GXSetAlphaUpdate(GXBool update_enable);
void GXSetZMode(GXBool compare_enable, GXCompare func, GXBool update_enable);
void GXSetZCompLoc(GXBool before_tex);
void GXSetPixelFmt(GXPixelFmt pix_fmt, GXZFmt16 z_fmt);
void GXSetDither(GXBool dither);
void GXSetDstAlpha(GXBool enable, u8 alpha);
// ? GXSetFieldMask();
// ? GXSetFieldMode();
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,100 @@
#ifndef DOLPHIN_GXSTRUCT_H
#define DOLPHIN_GXSTRUCT_H
#include <dolphin/types.h>
#include <dolphin/gx/GXEnum.h>
#ifdef __cplusplus
extern "C" {
#endif
#define VI_TVMODE(format, interlace) (((format) << 2) + (interlace))
#define VI_INTERLACE 0
#define VI_NON_INTERLACE 1
#define VI_PROGRESSIVE 2
#define VI_NTSC 0
#define VI_PAL 1
#define VI_MPAL 2
#define VI_DEBUG 3
#define VI_DEBUG_PAL 4
#define VI_EURGB60 5
typedef enum {
VI_TVMODE_NTSC_INT = VI_TVMODE(VI_NTSC, VI_INTERLACE),
VI_TVMODE_NTSC_DS = VI_TVMODE(VI_NTSC, VI_NON_INTERLACE),
VI_TVMODE_NTSC_PROG = VI_TVMODE(VI_NTSC, VI_PROGRESSIVE),
VI_TVMODE_PAL_INT = VI_TVMODE(VI_PAL, VI_INTERLACE),
VI_TVMODE_PAL_DS = VI_TVMODE(VI_PAL, VI_NON_INTERLACE),
VI_TVMODE_EURGB60_INT = VI_TVMODE(VI_EURGB60, VI_INTERLACE),
VI_TVMODE_EURGB60_DS = VI_TVMODE(VI_EURGB60, VI_NON_INTERLACE),
VI_TVMODE_MPAL_INT = VI_TVMODE(VI_MPAL, VI_INTERLACE),
VI_TVMODE_MPAL_DS = VI_TVMODE(VI_MPAL, VI_NON_INTERLACE),
VI_TVMODE_DEBUG_INT = VI_TVMODE(VI_DEBUG, VI_INTERLACE),
VI_TVMODE_DEBUG_PAL_INT = VI_TVMODE(VI_DEBUG_PAL, VI_INTERLACE),
VI_TVMODE_DEBUG_PAL_DS = VI_TVMODE(VI_DEBUG_PAL, VI_NON_INTERLACE)
} VITVMode;
typedef enum { VI_XFBMODE_SF = 0, VI_XFBMODE_DF } VIXFBMode;
typedef struct _GXRenderModeObj {
/*0x00*/ VITVMode viTVmode;
/*0x04*/ u16 fbWidth;
/*0x06*/ u16 efbHeight;
/*0x08*/ u16 xfbHeight;
/*0x0A*/ u16 viXOrigin;
/*0x0C*/ u16 viYOrigin;
/*0x0E*/ u16 viWidth;
/*0x10*/ u16 viHeight;
/*0x14*/ VIXFBMode xFBmode;
/*0x18*/ u8 field_rendering;
u8 aa;
u8 sample_pattern[12][2];
u8 vfilter[7];
} GXRenderModeObj;
typedef struct _GXColor {
u8 r;
u8 g;
u8 b;
u8 a;
} GXColor;
typedef struct _GXTexObj {
#ifdef TARGET_PC
u32 dummy[22];
#else
u32 dummy[8];
#endif
} GXTexObj;
typedef struct _GXTlutObj {
#ifdef TARGET_PC
u32 dummy[4];
#else
u32 dummy[3];
#endif
} GXTlutObj;
typedef struct _GXLightObj {
u32 dummy[16];
} GXLightObj;
typedef struct _GXVtxDescList {
GXAttr attr;
GXAttrType type;
} GXVtxDescList;
typedef struct _GXColorS10 {
s16 r;
s16 g;
s16 b;
s16 a;
} GXColorS10;
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,35 @@
#ifndef DOLPHIN_GXTEV_H
#define DOLPHIN_GXTEV_H
#include <dolphin/gx/GXEnum.h>
#include <dolphin/gx/GXStruct.h>
#ifdef __cplusplus
extern "C" {
#endif
void GXSetTevOp(GXTevStageID id, GXTevMode mode);
void GXSetTevColorIn(GXTevStageID stage, GXTevColorArg a, GXTevColorArg b, GXTevColorArg c, GXTevColorArg d);
void GXSetTevAlphaIn(GXTevStageID stage, GXTevAlphaArg a, GXTevAlphaArg b, GXTevAlphaArg c, GXTevAlphaArg d);
void GXSetTevColorOp(GXTevStageID stage, GXTevOp op, GXTevBias bias, GXTevScale scale, GXBool clamp,
GXTevRegID out_reg);
void GXSetTevAlphaOp(GXTevStageID stage, GXTevOp op, GXTevBias bias, GXTevScale scale, GXBool clamp,
GXTevRegID out_reg);
void GXSetTevColor(GXTevRegID id, GXColor color);
void GXSetTevColorS10(GXTevRegID id, GXColorS10 color);
void GXSetTevKColor(GXTevKColorID id, GXColor color);
void GXSetTevKColorSel(GXTevStageID stage, GXTevKColorSel sel);
void GXSetTevKAlphaSel(GXTevStageID stage, GXTevKAlphaSel sel);
void GXSetTevSwapMode(GXTevStageID stage, GXTevSwapSel ras_sel, GXTevSwapSel tex_sel);
void GXSetTevSwapModeTable(GXTevSwapSel table, GXTevColorChan red, GXTevColorChan green, GXTevColorChan blue,
GXTevColorChan alpha);
void GXSetAlphaCompare(GXCompare comp0, u8 ref0, GXAlphaOp op, GXCompare comp1, u8 ref1);
void GXSetZTexture(GXZTexOp op, GXTexFmt fmt, u32 bias);
void GXSetTevOrder(GXTevStageID stage, GXTexCoordID coord, GXTexMapID map, GXChannelID color);
void GXSetNumTevStages(u8 nStages);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,29 @@
#ifndef DOLPHIN_GXTEXTURE_H
#define DOLPHIN_GXTEXTURE_H
#include <dolphin/gx/GXEnum.h>
#include <dolphin/gx/GXStruct.h>
#ifdef __cplusplus
extern "C" {
#endif
void GXInitTexObj(GXTexObj* obj, const void* data, u16 width, u16 height, u32 format, GXTexWrapMode wrapS,
GXTexWrapMode wrapT, GXBool mipmap);
void GXInitTexObjCI(GXTexObj* obj, const void* data, u16 width, u16 height, GXCITexFmt format, GXTexWrapMode wrapS,
GXTexWrapMode wrapT, GXBool mipmap, u32 tlut);
void GXInitTexObjData(GXTexObj* obj, const void* data);
void GXInitTexObjLOD(GXTexObj* obj, GXTexFilter min_filt, GXTexFilter mag_filt, f32 min_lod, f32 max_lod, f32 lod_bias,
GXBool bias_clamp, GXBool do_edge_lod, GXAnisotropy max_aniso);
void GXLoadTexObj(GXTexObj* obj, GXTexMapID id);
u32 GXGetTexBufferSize(u16 width, u16 height, u32 format, GXBool mipmap, u8 max_lod);
void GXInvalidateTexAll();
void GXInitTexObjWrapMode(GXTexObj* obj, GXTexWrapMode s, GXTexWrapMode t);
void GXInitTlutObj(GXTlutObj* obj, const void* data, GXTlutFmt format, u16 entries);
void GXLoadTlut(const GXTlutObj* obj, GXTlut idx);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,33 @@
#ifndef DOLPHIN_GXTRANSFORM_H
#define DOLPHIN_GXTRANSFORM_H
#include <dolphin/gx/GXEnum.h>
#ifdef __cplusplus
extern "C" {
#endif
#define GX_PROJECTION_SZ 7
#ifdef TARGET_PC
void GXSetProjection(const void* mtx, GXProjectionType type);
void GXLoadPosMtxImm(const void* mtx, u32 id);
void GXLoadNrmMtxImm(const void* mtx, u32 id);
void GXLoadTexMtxImm(const void* mtx, u32 id, GXTexMtxType type);
#else
void GXSetProjection(f32 mtx[4][4], GXProjectionType type);
void GXLoadPosMtxImm(f32 mtx[3][4], u32 id);
void GXLoadNrmMtxImm(f32 mtx[3][4], u32 id);
void GXLoadTexMtxImm(f32 mtx[][4], u32 id, GXTexMtxType type);
#endif
void GXSetViewport(f32 left, f32 top, f32 wd, f32 ht, f32 nearz, f32 farz);
void GXSetCurrentMtx(u32 id);
void GXSetViewportJitter(f32 left, f32 top, f32 wd, f32 ht, f32 nearz, f32 farz, u32 field);
void GXSetScissorBoxOffset(s32 x_off, s32 y_off);
void GXSetClipMode(GXClipMode mode);
#ifdef __cplusplus
}
#endif
#endif

132
include/dolphin/gx/GXVert.h Normal file
View File

@ -0,0 +1,132 @@
#ifndef DOLPHIN_GXVERT_H
#define DOLPHIN_GXVERT_H
#include <dolphin/types.h>
#ifdef __cplusplus
extern "C" {
#endif
#define GXFIFO_ADDR 0xCC008000
typedef union {
u8 u8;
u16 u16;
u32 u32;
u64 u64;
s8 s8;
s16 s16;
s32 s32;
s64 s64;
f32 f32;
f64 f64;
} PPCWGPipe;
#ifdef __MWERKS__
volatile PPCWGPipe GXWGFifo : GXFIFO_ADDR;
#else
#define GXWGFifo (*(volatile PPCWGPipe*)GXFIFO_ADDR)
#endif
#ifdef TARGET_PC
void GXPosition3f32(f32 x, f32 y, f32 z);
void GXPosition3u16(u16 x, u16 y, u16 z);
void GXPosition3s16(s16 x, s16 y, s16 z);
void GXPosition3u8(u8 x, u8 y, u8 z);
void GXPosition3s8(s8 x, s8 y, s8 z);
void GXPosition2f32(f32 x, f32 y);
void GXPosition2u16(u16 x, u16 y);
void GXPosition2s16(s16 x, s16 y);
void GXPosition2u8(u8 x, u8 y);
void GXPosition2s8(s8 x, s8 y);
void GXPosition1x16(u16 index);
void GXPosition1x8(u8 index);
void GXNormal3f32(f32 x, f32 y, f32 z);
void GXNormal3s16(s16 x, s16 y, s16 z);
void GXNormal3s8(s8 x, s8 y, s8 z);
void GXNormal1x16(u16 index);
void GXNormal1x8(u8 index);
void GXColor4u8(u8 r, u8 g, u8 b, u8 a);
void GXColor3u8(u8 r, u8 g, u8 b);
void GXColor1u32(u32 clr);
void GXColor1u16(u16 clr);
void GXColor1x16(u16 index);
void GXColor1x8(u8 index);
void GXTexCoord2f32(f32 s, f32 t);
void GXTexCoord2u16(u16 s, u16 t);
void GXTexCoord2s16(s16 s, s16 t);
void GXTexCoord2u8(u8 s, u8 t);
void GXTexCoord2s8(s8 s, s8 t);
void GXTexCoord1f32(f32 s, f32 t);
void GXTexCoord1u16(u16 s, u16 t);
void GXTexCoord1s16(s16 s, s16 t);
void GXTexCoord1u8(u8 s, u8 t);
void GXTexCoord1s8(s8 s, s8 t);
void GXTexCoord1x16(u16 index);
void GXTexCoord1x8(u8 index);
extern void GXEnd(void);
#else
static inline void GXPosition2f32(const f32 x, const f32 y) {
GXWGFifo.f32 = x;
GXWGFifo.f32 = y;
}
static inline void GXPosition3s16(const s16 x, const s16 y, const s16 z) {
GXWGFifo.s16 = x;
GXWGFifo.s16 = y;
GXWGFifo.s16 = z;
}
static inline void GXPosition3f32(const f32 x, const f32 y, const f32 z) {
GXWGFifo.f32 = x;
GXWGFifo.f32 = y;
GXWGFifo.f32 = z;
}
static inline void GXNormal3f32(const f32 x, const f32 y, const f32 z) {
GXWGFifo.f32 = x;
GXWGFifo.f32 = y;
GXWGFifo.f32 = z;
}
static inline void GXColor4u8(const u8 r, const u8 g, const u8 b, const u8 a) {
GXWGFifo.u8 = r;
GXWGFifo.u8 = g;
GXWGFifo.u8 = b;
GXWGFifo.u8 = a;
}
static inline void GXTexCoord2s16(const s16 u, const s16 v) {
GXWGFifo.s16 = u;
GXWGFifo.s16 = v;
}
static inline void GXTexCoord2f32(const f32 u, const f32 v) {
GXWGFifo.f32 = u;
GXWGFifo.f32 = v;
}
static inline void GXEnd(void) {}
#endif
#ifdef __cplusplus
}
#endif
#endif

115
include/dolphin/pad.h Normal file
View File

@ -0,0 +1,115 @@
#ifndef DOLPHIN_PAD_H
#define DOLPHIN_PAD_H
#include <dolphin/types.h>
#define PAD_CHAN0 0
#define PAD_CHAN1 1
#define PAD_CHAN2 2
#define PAD_CHAN3 3
#define PAD_CHANMAX 4
#define PAD_MOTOR_STOP 0
#define PAD_MOTOR_RUMBLE 1
#define PAD_MOTOR_STOP_HARD 2
#define PAD_ERR_NONE 0
#define PAD_ERR_NO_CONTROLLER -1
#define PAD_ERR_NOT_READY -2
#define PAD_ERR_TRANSFER -3
#define PAD_BUTTON_LEFT 0x0001
#define PAD_BUTTON_RIGHT 0x0002
#define PAD_BUTTON_DOWN 0x0004
#define PAD_BUTTON_UP 0x0008
#define PAD_TRIGGER_Z 0x0010
#define PAD_TRIGGER_R 0x0020
#define PAD_TRIGGER_L 0x0040
#define PAD_BUTTON_A 0x0100
#define PAD_BUTTON_B 0x0200
#define PAD_BUTTON_X 0x0400
#define PAD_BUTTON_Y 0x0800
#define PAD_BUTTON_MENU 0x1000
#define PAD_BUTTON_START 0x1000
#define PAD_CHAN0_BIT 0x80000000
#define PAD_CHAN1_BIT 0x40000000
#define PAD_CHAN2_BIT 0x20000000
#define PAD_CHAN3_BIT 0x10000000
#define PADButtonDown(buttonLast, button) (((buttonLast) ^ (button)) & (button))
#define PADButtonUp(buttonLast, button) (((buttonLast) ^ (button)) & (buttonLast))
#ifdef __cplusplus
extern "C" {
#endif
typedef struct PADStatus {
u16 button;
s8 stickX;
s8 stickY;
s8 substickX;
s8 substickY;
u8 triggerL;
u8 triggerR;
u8 analogA;
u8 analogB;
s8 err;
} PADStatus;
BOOL PADInit();
u32 PADRead(PADStatus* status);
BOOL PADReset(u32 mask);
BOOL PADRecalibrate(u32 mask);
void PADClamp(PADStatus* status);
void PADClampCircle(PADStatus* status);
void PADControlMotor(s32 chan, u32 cmd);
void PADSetSpec(u32 spec);
void PADControlAllMotors(const u32* cmdArr);
void PADSetAnalogMode(u32 mode);
#ifdef TARGET_PC
/* New API to facilitate controller interactions */
typedef struct PADDeadZones {
bool emulateTriggers;
bool useDeadzones;
u16 stickDeadZone;
u16 substickDeadZone;
u16 leftTriggerActivationZone;
u16 rightTriggerActivationZone;
} PADDeadZones;
typedef u16 PADButton;
typedef struct PADButtonMapping {
u32 nativeButton;
PADButton padButton;
} PADButtonMapping;
/* Returns the total number of controllers */
u32 PADCount();
/* Returns the controller name for the given index into the controller map */
const char* PADGetNameForControllerIndex(u32 idx);
void PADSetPortForIndex(u32 index, s32 port);
s32 PADGetIndexForPort(u32 port);
void PADGetVidPid(u32 port, u32* vid, u32* pid);
void PADClearPort(u32 port);
const char* PADGetName(u32 port);
void PADSetButtonMapping(u32 port, PADButtonMapping mapping);
void PADSetAllButtonMappings(u32 port, PADButtonMapping buttons[12]);
PADButtonMapping* PADGetButtonMappings(u32 port, u32* buttonCount);
void PADSerializeMappings();
PADDeadZones* PADGetDeadZones(u32 port);
const char* PADGetButtonName(PADButton);
const char* PADGetNativeButtonName(u32 button);
/* Returns any pressed native button */
s32 PADGetNativeButtonPressed(u32 port);
void PADRestoreDefaultMapping(u32 port);
void PADBlockInput(bool block);
#endif
#ifdef __cplusplus
}
#endif
#endif

72
include/dolphin/si.h Normal file
View File

@ -0,0 +1,72 @@
#ifndef DOLPHIN_SI_H
#define DOLPHIN_SI_H
#include <dolphin/types.h>
#define SI_CHAN0 0
#define SI_CHAN1 1
#define SI_CHAN2 2
#define SI_CHAN3 3
#define SI_MAX_CHAN 4
#define SI_CHAN0_BIT 0x80000000
#define SI_CHAN1_BIT 0x40000000
#define SI_CHAN2_BIT 0x20000000
#define SI_CHAN3_BIT 0x10000000
#define SI_CHAN_BIT(chn) (SI_CHAN0_BIT >> (chn))
#define SI_ERROR_UNDER_RUN 0x0001
#define SI_ERROR_OVER_RUN 0x0002
#define SI_ERROR_COLLISION 0x0004
#define SI_ERROR_NO_RESPONSE 0x0008
#define SI_ERROR_WRST 0x0010
#define SI_ERROR_RDST 0x0020
#define SI_ERROR_UNKNOWN 0x0040
#define SI_ERROR_BUSY 0x0080
#define SI_TYPE_MASK 0x18000000u
#define SI_TYPE_N64 0x00000000u
#define SI_TYPE_DOLPHIN 0x08000000u
#define SI_TYPE_GC SI_TYPE_DOLPHIN
// GameCube specific
#define SI_GC_WIRELESS 0x80000000u
#define SI_GC_NOMOTOR 0x20000000u // no rumble motor
#define SI_GC_STANDARD 0x01000000u // dolphin standard controller
// WaveBird specific
#define SI_WIRELESS_RECEIVED 0x40000000u // 0: no wireless unit
#define SI_WIRELESS_IR 0x04000000u // 0: IR 1: RF
#define SI_WIRELESS_STATE 0x02000000u // 0: variable 1: fixed
#define SI_WIRELESS_ORIGIN 0x00200000u // 0: invalid 1: valid
#define SI_WIRELESS_FIX_ID 0x00100000u // 0: not fixed 1: fixed
#define SI_WIRELESS_TYPE 0x000f0000u
#define SI_WIRELESS_LITE_MASK 0x000c0000u // 0: normal 1: lite controller
#define SI_WIRELESS_LITE 0x00040000u // 0: normal 1: lite controller
#define SI_WIRELESS_CONT_MASK 0x00080000u // 0: non-controller 1: non-controller
#define SI_WIRELESS_CONT 0x00000000u
#define SI_WIRELESS_ID 0x00c0ff00u
#define SI_WIRELESS_TYPE_ID (SI_WIRELESS_TYPE | SI_WIRELESS_ID)
#define SI_N64_CONTROLLER (SI_TYPE_N64 | 0x05000000)
#define SI_N64_MIC (SI_TYPE_N64 | 0x00010000)
#define SI_N64_KEYBOARD (SI_TYPE_N64 | 0x00020000)
#define SI_N64_MOUSE (SI_TYPE_N64 | 0x02000000)
#define SI_GBA (SI_TYPE_N64 | 0x00040000)
#define SI_GC_CONTROLLER (SI_TYPE_GC | SI_GC_STANDARD)
#define SI_GC_RECEIVER (SI_TYPE_GC | SI_GC_WIRELESS)
#define SI_GC_WAVEBIRD (SI_TYPE_GC | SI_GC_WIRELESS | SI_GC_STANDARD | SI_WIRELESS_STATE | SI_WIRELESS_FIX_ID)
#define SI_GC_KEYBOARD (SI_TYPE_GC | 0x00200000)
#define SI_GC_STEERING (SI_TYPE_GC | 0x00000000)
#ifdef __cplusplus
extern "C" {
#endif
u32 SIProbe(s32 chan);
#ifdef __cplusplus
}
#endif
#endif

83
include/dolphin/types.h Normal file
View File

@ -0,0 +1,83 @@
#ifndef DOLPHIN_TYPES_H
#define DOLPHIN_TYPES_H
#ifdef TARGET_PC
#include <stdint.h>
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
#else
typedef signed char s8;
typedef signed short int s16;
typedef signed int s32;
typedef signed long long int s64;
typedef unsigned char u8;
typedef unsigned short int u16;
typedef unsigned int u32;
typedef unsigned long long int u64;
#endif
typedef volatile u8 vu8;
typedef volatile u16 vu16;
typedef volatile u32 vu32;
typedef volatile u64 vu64;
typedef volatile s8 vs8;
typedef volatile s16 vs16;
typedef volatile s32 vs32;
typedef volatile s64 vs64;
typedef float f32;
typedef double f64;
typedef volatile f32 vf32;
typedef volatile f64 vf64;
#if defined(TARGET_PC) && !defined(_WIN32)
#include <stdbool.h>
typedef bool BOOL;
#ifndef FALSE
#define FALSE false
#endif
#ifndef TRUE
#define TRUE true
#endif
#else
typedef int BOOL;
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#endif
#ifdef TARGET_PC
#include <stddef.h>
#else
#ifndef NULL
#define NULL 0
#endif
#endif
#ifndef __cplusplus
#ifndef nullptr
#define nullptr NULL
#endif
#endif
#ifndef ATTRIBUTE_ALIGN
#if defined(__MWERKS__) || defined(__GNUC__)
#define ATTRIBUTE_ALIGN(num) __attribute__((aligned(num)))
#elif defined(_MSC_VER)
#define ATTRIBUTE_ALIGN(num)
#else
#error unknown compiler
#endif
#endif
#endif

29
include/dolphin/vi.h Normal file
View File

@ -0,0 +1,29 @@
#ifndef DOLPHIN_VI_H
#define DOLPHIN_VI_H
#include <dolphin/gx/GXStruct.h>
#include <dolphin/vifuncs.h>
#ifdef __cplusplus
extern "C" {
#endif
void VIInit(void);
void VIConfigure(GXRenderModeObj *rm);
void VIFlush(void);
u32 VIGetTvFormat(void);
void VISetNextFrameBuffer(void *fb);
void VIWaitForRetrace(void);
void VISetBlack(BOOL black);
#ifdef TARGET_PC
void VISetWindowTitle(const char* title);
void VISetWindowFullscreen(bool fullscreen);
bool VIGetWindowFullscreen();
#endif
#ifdef __cplusplus
}
#endif
#endif

16
include/dolphin/vifuncs.h Normal file
View File

@ -0,0 +1,16 @@
#ifndef DOLPHIN_VIFUNCS_H
#define DOLPHIN_VIFUNCS_H
#include <dolphin/types.h>
#ifdef __cplusplus
extern "C" {
#endif
u32 VIGetNextField(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -12,10 +12,10 @@ typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;
typedef char s8;
typedef short s16;
typedef int s32;
typedef long long s64;
typedef signed char s8;
typedef signed short s16;
typedef signed int s32;
typedef signed long long s64;
typedef volatile u8 vu8;
typedef volatile u16 vu16;
@ -50,16 +50,12 @@ typedef void* unkptr;
#define override
#endif
#ifndef BOOL
#ifdef __cplusplus
#define BOOL bool
#define TRUE true
#define FALSE false
#else
#define BOOL u8
typedef int BOOL;
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef ATTRIBUTE_ALIGN

View File

@ -0,0 +1,11 @@
#include "Kyoto/Graphics/CCubeMaterial.hpp"
#include "Kyoto/Math/CTransform4f.hpp"
CVector3f sPlayerPosition;
CVector3f CCubeMaterial::sViewingFrom;
static CTransform4f sTextureProjectionTransform = CTransform4f::Identity();
void CCubeMaterial::SetupBlendMode(u32 blendFactors, const CModelFlags& flags, bool alphaTest) {
}

View File

@ -0,0 +1,73 @@
#include "Kyoto/Graphics/CGX.hpp"
CGX::SGXState CGX::sGXState;
void CGX::SetNumChans(u8 num) {
sGXState.x4e_numChans = num;
sGXState.x4c_numChansDirty = sGXState.x4e_numChans != sGXState.x4d_prevNumChans;
}
void CGX::SetNumTexGens(u8 num) {
if (num != sGXState.x4f_numTexGens) {
sGXState.x4f_numTexGens = num;
GXSetNumTexGens(num);
}
}
void CGX::SetChanAmbColor(EChannelId channel, const GXColor& color) {
if (!CompareGXColors(color, sGXState.x38_chanAmbColors[channel])) {
CopyGXColor(sGXState.x38_chanAmbColors[channel], color);
GXSetChanAmbColor(static_cast< GXChannelID >(GX_COLOR0A0 + channel), color);
}
}
GXColor CGX::GetChanAmbColor(EChannelId channel) { return sGXState.x38_chanAmbColors[channel]; }
void CGX::SetChanMatColor(EChannelId channel, const GXColor& color) {
if (!CompareGXColors(color, sGXState.x40_chanMatColors[channel])) {
CopyGXColor(sGXState.x40_chanMatColors[channel], color);
GXSetChanMatColor(static_cast< GXChannelID >(GX_COLOR0A0 + channel), color);
}
}
// TODO non-matching
void CGX::SetChanCtrl(EChannelId channel, GXBool enable, GXColorSrc ambSrc, GXColorSrc matSrc, GXLightID lights, GXDiffuseFn diffFn,
GXAttnFn attnFn) {
u16 flags = (lights == GX_LIGHT_NULL ? 0 : enable) & 1 | (ambSrc & 1) << 1 | (matSrc & 1) << 2 | (lights & 0xFF) << 3 |
(diffFn & 3) << 11 | (attnFn & 3) << 13;
sGXState.x34_chanCtrls[channel] = flags;
sGXState.x4c_dirtyChanCtrl = (((sGXState.x34_chanCtrls[channel] != sGXState.x30_prevChanCtrls[channel]) & 1) << channel) &
(sGXState.x4c_dirtyChanCtrl & ~(1 << channel));
// if (channel == Channel0) {
// sGXState.x4c_dirtyChanCtrl0 = (sGXState.x34_chanCtrls[channel] != sGXState.x30_prevChanCtrls[channel]);
// } else {
// sGXState.x4c_dirtyChanCtrl1 = (sGXState.x34_chanCtrls[channel] != sGXState.x30_prevChanCtrls[channel]);
// }
}
void CGX::SetNumTevStages(u8 num) {
if (sGXState.x50_numTevStages != num) {
sGXState.x50_numTevStages = num;
GXSetNumTevStages(num);
}
}
void CGX::SetTevKColor(GXTevKColorID id, const GXColor& color) {
if (!CompareGXColors(sGXState.x58_kColors[id], color)) {
CopyGXColor(sGXState.x58_kColors[id], color);
GXSetTevKColor(id, color);
}
}
// TODO non-matching
void CGX::SetTevColorIn(GXTevStageID stageId, GXTevColorArg a, GXTevColorArg b, GXTevColorArg c, GXTevColorArg d) {
u32 ma = MaskAndShiftLeft(a, 0x1F, 0);
u32 mb = MaskAndShiftLeft(b, 0x1F, 5);
u32 mc = MaskAndShiftLeft(c, 0x1F, 10);
u32 md = MaskAndShiftLeft(d, 0x1F, 15);
u32 flags = ma | mb | mc | md;
if (flags != sGXState.x68_tevStates[stageId].x0_colorInArgs) {
sGXState.x68_tevStates[stageId].x0_colorInArgs = flags;
GXSetTevColorIn(stageId, a, b, c, d);
}
}

View File

@ -64,7 +64,7 @@ double x;
#endif
{
double z, p, q, r, w, s, c, df;
_INT32 hx, ix; /*- cc 020130 -*/
_INT32 hx, ix;
hx = __HI(x);
ix = hx & 0x7fffffff;
if (ix >= 0x3ff00000) { /* |x| >= 1 */

View File

@ -71,7 +71,7 @@ double x;
#endif
{
double t, w, p, q, c, r, s;
_INT32 hx, ix; /*- cc 020130 -*/
_INT32 hx, ix;
hx = __HI(x);
ix = hx & 0x7fffffff;
if (ix >= 0x3ff00000) { /* |x|>= 1 */

View File

@ -59,8 +59,8 @@ double y, x;
#endif
{
double z;
_INT32 k, m, hx, hy, ix, iy; /*- cc 020130 -*/
_UINT32 lx, ly; /*- cc 020130 -*/
_INT32 k, m, hx, hy, ix, iy;
_UINT32 lx, ly;
hx = __HI(x);
ix = hx & 0x7fffffff;

View File

@ -114,8 +114,8 @@ double x;
#endif
{
double y, hi, lo, c, t;
_INT32 k, xsb; /*- cc 020130 -*/
_UINT32 hx; /*- cc 020130 -*/
_INT32 k, xsb;
_UINT32 hx;
hx = __HI(x); /* high word of x */
xsb = (hx >> 31) & 1; /* sign bit of x */

View File

@ -37,8 +37,8 @@ double __ieee754_fmod(x, y)
double x, y;
#endif
{
_INT32 n, hx, hy, hz, ix, iy, sx, i; /*- cc 020130 -*/
_UINT32 lx, ly, lz; /*- cc 020130 -*/
_INT32 n, hx, hy, hz, ix, iy, sx, i;
_UINT32 lx, ly, lz;
hx = __HI(x); /* high word of x */
lx = __LO(x); /* low word of x */
@ -56,7 +56,7 @@ double x, y;
if ((hx < hy) || (lx < ly))
return x; /* |x|<|y| return x */
if (lx == ly)
return Zero[(_UINT32)sx >> 31]; /* |x|=|y| return x*0*/ /*- cc 020130 -*/
return Zero[(_UINT32)sx >> 31]; /* |x|=|y| return x*0*/
}
/* determine ix = ilogb(x) */
@ -121,7 +121,7 @@ double x, y;
lx = lx + lx;
} else {
if ((hz | lz) == 0) /* return sign(x)*0 */
return Zero[(_UINT32)sx >> 31]; /*- cc 020130 -*/
return Zero[(_UINT32)sx >> 31];
hx = hz + hz + (lz >> 31);
lx = lz + lz;
}
@ -137,7 +137,7 @@ double x, y;
/* convert back to floating value and restore the sign */
if ((hx | lx) == 0) /* return sign(x)*0 */
return Zero[(_UINT32)sx >> 31]; /*- cc 020130 -*/
return Zero[(_UINT32)sx >> 31];
while (hx < 0x00100000) { /* normalize x */
hx = hx + hx + (lx >> 31);
lx = lx + lx;
@ -150,7 +150,7 @@ double x, y;
} else { /* subnormal output */
n = -1022 - iy;
if (n <= 20) {
lx = (lx >> n) | ((_UINT32)hx << (32 - n)); /*- cc 020130 -*/
lx = (lx >> n) | ((_UINT32)hx << (32 - n));
hx >>= n;
} else if (n <= 31) {
lx = (hx << (32 - n)) | (lx >> n);

View File

@ -89,8 +89,8 @@ double x;
#endif
{
double hfsq, f, s, z, R, w, t1, t2, dk;
_INT32 k, hx, i, j; /*- cc 020130 -*/
_UINT32 lx; /*- cc 020130 -*/
_INT32 k, hx, i, j;
_UINT32 lx;
hx = __HI(x); /* high word of x */
lx = __LO(x); /* low word of x */

View File

@ -111,9 +111,9 @@ double x, y;
{
double z, ax, z_h, z_l, p_h, p_l;
double y1, t1, t2, r, s, t, u, v, w;
_INT32 i, j, k, yisint, n; /*- cc 020130 -*/
_INT32 hx, hy, ix, iy; /*- cc 020130 -*/
_UINT32 lx, ly; /*- cc 020130 -*/
_INT32 i, j, k, yisint, n;
_INT32 hx, hy, ix, iy;
_UINT32 lx, ly;
hx = __HI(x);
lx = __LO(x);

View File

@ -73,15 +73,15 @@ static double
pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
#ifdef __STDC__
_INT32 __ieee754_rem_pio2(double x, double* y) /*- cc 020130 -*/
_INT32 __ieee754_rem_pio2(double x, double* y)
#else
_INT32 __ieee754_rem_pio2(x, y) /*- cc 020130 -*/
_INT32 __ieee754_rem_pio2(x, y)
double x, y[];
#endif
{
double z, w, t, r, fn;
double tx[3];
_INT32 e0, i, j, nx, n, ix, hx; /*- cc 020130 -*/
_INT32 e0, i, j, nx, n, ix, hx;
hx = __HI(x); /* high word of x */
ix = hx & 0x7fffffff;
@ -118,7 +118,7 @@ double x, y[];
}
if (ix <= 0x413921fb) { /* |x| ~<= 2^19*(pi/2), medium size */
t = fabs(x);
n = (_INT32)(t * invpio2 + half); /*- cc 020130 -*/
n = (_INT32)(t * invpio2 + half);
fn = (double)n;
r = t - fn * pio2_1;
w = fn * pio2_1t; /* 1st round good to 85 bit */
@ -164,7 +164,7 @@ double x, y[];
e0 = (ix >> 20) - 1046; /* e0 = ilogb(z)-23; */
__HI(z) = ix - (e0 << 20);
for (i = 0; i < 2; i++) {
tx[i] = (double)((_INT32)(z)); /*- cc 020130 -*/
tx[i] = (double)((_INT32)(z));
z = (z - tx[i]) * two24;
}
tx[2] = z;

View File

@ -17,11 +17,11 @@
#define _IEEE_LIBM
#if __option(little_endian)
#define __HIp(x) *(1 + (_INT32*)x) /*- cc 020130 -*/
#define __LOp(x) *(_INT32*)x /*- cc 020130 -*/
#define __HIp(x) *(1 + (_INT32*)x)
#define __LOp(x) *(_INT32*)x
#else
#define __HIp(x) *(_INT32*)x /*- cc 020130 -*/
#define __LOp(x) *(1 + (_INT32*)x) /*- cc 020130 -*/
#define __HIp(x) *(_INT32*)x
#define __LOp(x) *(1 + (_INT32*)x)
#endif
#ifdef __STDC__

View File

@ -128,9 +128,9 @@
#include "fdlibm.h"
#ifdef __STDC__
static const _INT32 init_jk[] = {2, 3, 4, 6}; /* initial value for jk */ /*- cc 020130 -*/
static const _INT32 init_jk[] = {2, 3, 4, 6}; /* initial value for jk */
#else
static _INT32 init_jk[] = {2, 3, 4, 6}; /*- cc 020130 -*/
static _INT32 init_jk[] = {2, 3, 4, 6};
#endif
#ifdef __STDC__
@ -158,15 +158,15 @@ static double
twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */
#ifdef __STDC__
_INT32 __kernel_rem_pio2(double* x, double* y, _INT32 e0, _INT32 nx, _INT32 prec, const _INT32* ipio2) /*- cc 020130 -*/
_INT32 __kernel_rem_pio2(double* x, double* y, _INT32 e0, _INT32 nx, _INT32 prec, const _INT32* ipio2)
#else
_INT32 __kernel_rem_pio2(x, y, e0, nx, prec, ipio2) /*- cc 020130 -*/
_INT32 __kernel_rem_pio2(x, y, e0, nx, prec, ipio2)
double x[], y[];
_INT32 e0, nx, prec;
_INT32 ipio2[]; /*- cc 020130 -*/
_INT32 ipio2[];
#endif
{
_INT32 jz, jx, jv, jp, jk, carry, n, iq[20], i, j, k, m, q0, ih; /*- cc 020130 -*/
_INT32 jz, jx, jv, jp, jk, carry, n, iq[20], i, j, k, m, q0, ih;
double z, fw, f[20], fq[20], q[20];
/* initialize jk*/
@ -197,15 +197,15 @@ _INT32 ipio2[]; /*- cc 020130 -*/
recompute:
/* distill q[] into iq[] reversingly */
for (i = 0, j = jz, z = q[jz]; j > 0; i++, j--) {
fw = (double)((_INT32)(twon24 * z)); /*- cc 020130 -*/
iq[i] = (_INT32)(z - two24 * fw); /*- cc 020130 -*/
fw = (double)((_INT32)(twon24 * z));
iq[i] = (_INT32)(z - two24 * fw);
z = q[j - 1] + fw;
}
/* compute n */
z = scalbn(z, q0); /* actual value of z */
z -= 8.0 * floor(z * 0.125); /* trim off integer >= 8 */
n = (_INT32)z; /*- cc 020130 -*/
n = (_INT32)z;
z -= (double)n;
ih = 0;
if (q0 > 0) { /* need iq[jz-1] to determine n */
@ -279,13 +279,13 @@ recompute:
} else { /* break z into 24-bit if necessary */
z = scalbn(z, -q0);
if (z >= two24) {
fw = (double)((_INT32)(twon24 * z)); /*- cc 020130 -*/
iq[jz] = (_INT32)(z - two24 * fw); /*- cc 020130 -*/
fw = (double)((_INT32)(twon24 * z));
iq[jz] = (_INT32)(z - two24 * fw);
jz += 1;
q0 += 24;
iq[jz] = (_INT32)fw; /*- cc 020130 -*/
iq[jz] = (_INT32)fw;
} else
iq[jz] = (_INT32)z; /*- cc 020130 -*/
iq[jz] = (_INT32)z;
}
/* convert integer "bit" chunk to floating-point value */

View File

@ -71,20 +71,20 @@ static double
};
#ifdef __STDC__
double __kernel_tan(double x, double y, _INT32 iy) /*- cc 020130 -*/
double __kernel_tan(double x, double y, _INT32 iy)
#else
double __kernel_tan(x, y, iy)
double x, y;
_INT32 iy; /*- cc 020130 -*/
_INT32 iy;
#endif
{
double z, r, v, w, s;
_INT32 ix, hx; /*- cc 020130 -*/
_INT32 ix, hx;
hx = __HI(x); /* high word of x */
ix = hx & 0x7fffffff; /* high word of |x| */
if (ix < 0x3e300000) /* x < 2**-28 */
{
if ((_INT32)x == 0) { /* generate inexact */ /*- cc 020130 -*/
if ((_INT32)x == 0) { /* generate inexact */
if (((ix | __LO(x)) | (iy + 1)) == 0)
return one / fabs(x);
else

View File

@ -1,6 +1,6 @@
#include "mem_funcs.h"
// #pragma ANSI_strict off
#pragma ANSI_strict off
#define cps ((unsigned char*)src)
#define cpd ((unsigned char*)dst)
@ -51,8 +51,11 @@ void __copy_longs_aligned(void* dst, const void* src, unsigned long n) {
cps = ((unsigned char*)(lps + 1)) - 1;
cpd = ((unsigned char*)(lpd + 1)) - 1;
// TODO longlong required to match?
#ifdef PRIME1
n &= 3ULL;
#else
n &= 3;
#endif
if (n)
do
@ -99,8 +102,11 @@ void __copy_longs_rev_aligned(void* dst, const void* src, unsigned long n) {
*--lpd = *--lps;
while (--i);
// TODO longlong required to match?
#ifdef PRIME1
n &= 3ULL;
#else
n &= 3;
#endif
if (n)
do
@ -156,8 +162,11 @@ void __copy_longs_unaligned(void* dst, const void* src, unsigned long n) {
cps = ((unsigned char*)(lps + 1)) - 1;
cpd = ((unsigned char*)(lpd + 1)) - 1;
// TODO longlong required to match?
#ifdef PRIME1
n &= 3ULL;
#else
n &= 3;
#endif
if (n) {
cps -= 4 - src_offset;
@ -209,8 +218,11 @@ void __copy_longs_rev_unaligned(void* dst, const void* src, unsigned long n) {
*--lpd = (v2 << left_shift) | (v1 >> right_shift);
}
// TODO longlong required to match?
#ifdef PRIME1
n &= 3ULL;
#else
n &= 3;
#endif
if (n) {
cps += src_offset;

View File

@ -89,7 +89,7 @@ double x;
#endif
{
double w, s1, s2, z;
_INT32 ix, hx, id; /*- cc 020130 -*/
_INT32 ix, hx, id;
hx = __HI(x);
ix = hx & 0x7fffffff;

View File

@ -17,7 +17,7 @@ static const double two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x0000000
big = 1.0e+300, tiny = 1.0e-300;
double ldexp(double x, int n) {
_INT32 k, hx, lx; /*- cc 020130 -*/
_INT32 k, hx, lx;
if (!isfinite(x) || x == 0.0)
return x;

View File

@ -35,8 +35,8 @@ double modf(x, iptr)
double x, *iptr;
#endif
{
_INT32 i0, i1, j0; /*- cc 020130 -*/
_UINT32 i; /*- cc 020130 -*/
_INT32 i0, i1, j0;
_UINT32 i;
i0 = __HI(x); /* high x */
i1 = __LO(x); /* low x */
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff; /* exponent of x */
@ -64,7 +64,7 @@ double x, *iptr;
__LO(x) = 0; /* return +-0 */
return x;
} else { /* fraction part in low x */
i = ((_UINT32)(0xffffffff)) >> (j0 - 20); /*- cc 020130 -*/
i = ((_UINT32)(0xffffffff)) >> (j0 - 20);
if ((i1 & i) == 0) { /* x is integral */
*iptr = x;
__HI(x) &= 0x80000000;

View File

@ -26,8 +26,8 @@ double nextafter(x, y)
double x, y;
#endif
{
_INT32 hx, hy, ix, iy; /*- cc 020130 -*/
_UINT32 lx, ly; /*- cc 020130 -*/
_INT32 hx, hy, ix, iy;
_UINT32 lx, ly;
hx = __HI(x); /* high word of x */
lx = __LO(x); /* low word of x */

View File

@ -50,7 +50,7 @@ double x;
#endif
{
double y[2], z = 0.0;
_INT32 n, ix; /*- cc 020130 -*/
_INT32 n, ix;
/* High word of x. */
ix = __HI(x);