donut-decomp/asm/gx/GXTransform.s
2022-10-17 09:11:35 +01:00

475 lines
22 KiB
ArmAsm

.include "macros.inc"
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
.global __GXSetProjection
__GXSetProjection:
/* 80038AD0 00034910 3C 80 CC 01 */ lis r4, 0xCC008000@ha
/* 80038AD4 00034914 38 00 00 10 */ li r0, 0x10
/* 80038AD8 00034918 98 04 80 00 */ stb r0, 0xCC008000@l(r4)
/* 80038ADC 0003491C 3C 60 00 06 */ lis r3, 0x6
/* 80038AE0 00034920 38 03 10 20 */ addi r0, r3, 0x1020
/* 80038AE4 00034924 80 62 86 08 */ lwz r3, __GXData@sda21(r2)
/* 80038AE8 00034928 90 04 80 00 */ stw r0, -0x8000(r4)
/* 80038AEC 0003492C 38 A4 80 00 */ addi r5, r4, -0x8000
/* 80038AF0 00034930 E0 43 05 2C */ psq_l f2, 0x52c(r3), 0, qr0
/* 80038AF4 00034934 E0 23 05 34 */ psq_l f1, 0x534(r3), 0, qr0
/* 80038AF8 00034938 E0 03 05 3C */ psq_l f0, 0x53c(r3), 0, qr0
/* 80038AFC 0003493C F0 45 00 00 */ psq_st f2, 0x0(r5), 0, qr0
/* 80038B00 00034940 F0 25 00 00 */ psq_st f1, 0x0(r5), 0, qr0
/* 80038B04 00034944 F0 05 00 00 */ psq_st f0, 0x0(r5), 0, qr0
/* 80038B08 00034948 80 03 05 28 */ lwz r0, 0x528(r3)
/* 80038B0C 0003494C 90 04 80 00 */ stw r0, -0x8000(r4)
/* 80038B10 00034950 4E 80 00 20 */ blr
/* 80038B14 00034954 00 00 00 00 */ .4byte 0x00000000
/* 80038B18 00034958 00 00 00 00 */ .4byte 0x00000000
/* 80038B1C 0003495C 00 00 00 00 */ .4byte 0x00000000
.global GXSetProjection
GXSetProjection:
/* 80038B20 00034960 80 A2 86 08 */ lwz r5, __GXData@sda21(r2)
/* 80038B24 00034964 2C 04 00 01 */ cmpwi r4, 0x1
/* 80038B28 00034968 C0 23 00 00 */ lfs f1, 0x0(r3)
/* 80038B2C 0003496C 90 85 05 28 */ stw r4, 0x528(r5)
/* 80038B30 00034970 C0 03 00 14 */ lfs f0, 0x14(r3)
/* 80038B34 00034974 D0 25 05 2C */ stfs f1, 0x52c(r5)
/* 80038B38 00034978 C0 23 00 28 */ lfs f1, 0x28(r3)
/* 80038B3C 0003497C D0 05 05 34 */ stfs f0, 0x534(r5)
/* 80038B40 00034980 C0 03 00 2C */ lfs f0, 0x2c(r3)
/* 80038B44 00034984 D0 25 05 3C */ stfs f1, 0x53c(r5)
/* 80038B48 00034988 D0 05 05 40 */ stfs f0, 0x540(r5)
/* 80038B4C 0003498C 40 82 00 18 */ bne lbl_80038B64
/* 80038B50 00034990 C0 03 00 0C */ lfs f0, 0xc(r3)
/* 80038B54 00034994 D0 05 05 30 */ stfs f0, 0x530(r5)
/* 80038B58 00034998 C0 03 00 1C */ lfs f0, 0x1c(r3)
/* 80038B5C 0003499C D0 05 05 38 */ stfs f0, 0x538(r5)
/* 80038B60 000349A0 48 00 00 14 */ b lbl_80038B74
.global lbl_80038B64
lbl_80038B64:
/* 80038B64 000349A4 C0 03 00 08 */ lfs f0, 0x8(r3)
/* 80038B68 000349A8 D0 05 05 30 */ stfs f0, 0x530(r5)
/* 80038B6C 000349AC C0 03 00 18 */ lfs f0, 0x18(r3)
/* 80038B70 000349B0 D0 05 05 38 */ stfs f0, 0x538(r5)
.global lbl_80038B74
lbl_80038B74:
/* 80038B74 000349B4 80 05 05 FC */ lwz r0, 0x5fc(r5)
/* 80038B78 000349B8 64 00 08 00 */ oris r0, r0, 0x800
/* 80038B7C 000349BC 90 05 05 FC */ stw r0, 0x5fc(r5)
/* 80038B80 000349C0 4E 80 00 20 */ blr
/* 80038B84 000349C4 00 00 00 00 */ .4byte 0x00000000
/* 80038B88 000349C8 00 00 00 00 */ .4byte 0x00000000
/* 80038B8C 000349CC 00 00 00 00 */ .4byte 0x00000000
.global GXSetProjectionv
GXSetProjectionv:
/* 80038B90 000349D0 C0 22 87 00 */ lfs f1, "@2517"@sda21(r2)
/* 80038B94 000349D4 C0 03 00 00 */ lfs f0, 0x0(r3)
/* 80038B98 000349D8 FC 01 00 00 */ fcmpu cr0, f1, f0
/* 80038B9C 000349DC 40 82 00 0C */ bne lbl_80038BA8
/* 80038BA0 000349E0 38 00 00 00 */ li r0, 0x0
/* 80038BA4 000349E4 48 00 00 08 */ b lbl_80038BAC
.global lbl_80038BA8
lbl_80038BA8:
/* 80038BA8 000349E8 38 00 00 01 */ li r0, 0x1
.global lbl_80038BAC
lbl_80038BAC:
/* 80038BAC 000349EC 80 82 86 08 */ lwz r4, __GXData@sda21(r2)
/* 80038BB0 000349F0 90 04 05 28 */ stw r0, 0x528(r4)
/* 80038BB4 000349F4 E0 43 00 04 */ psq_l f2, 0x4(r3), 0, qr0
/* 80038BB8 000349F8 E0 23 00 0C */ psq_l f1, 0xc(r3), 0, qr0
/* 80038BBC 000349FC E0 03 00 14 */ psq_l f0, 0x14(r3), 0, qr0
/* 80038BC0 00034A00 F0 44 05 2C */ psq_st f2, 0x52c(r4), 0, qr0
/* 80038BC4 00034A04 F0 24 05 34 */ psq_st f1, 0x534(r4), 0, qr0
/* 80038BC8 00034A08 F0 04 05 3C */ psq_st f0, 0x53c(r4), 0, qr0
/* 80038BCC 00034A0C 80 04 05 FC */ lwz r0, 0x5fc(r4)
/* 80038BD0 00034A10 64 00 08 00 */ oris r0, r0, 0x800
/* 80038BD4 00034A14 90 04 05 FC */ stw r0, 0x5fc(r4)
/* 80038BD8 00034A18 4E 80 00 20 */ blr
/* 80038BDC 00034A1C 00 00 00 00 */ .4byte 0x00000000
.global GXGetProjectionv
GXGetProjectionv:
/* 80038BE0 00034A20 80 82 86 08 */ lwz r4, __GXData@sda21(r2)
/* 80038BE4 00034A24 80 04 05 28 */ lwz r0, 0x528(r4)
/* 80038BE8 00034A28 2C 00 00 00 */ cmpwi r0, 0x0
/* 80038BEC 00034A2C 41 82 00 0C */ beq lbl_80038BF8
/* 80038BF0 00034A30 C0 02 87 04 */ lfs f0, "@2518"@sda21(r2)
/* 80038BF4 00034A34 48 00 00 08 */ b lbl_80038BFC
.global lbl_80038BF8
lbl_80038BF8:
/* 80038BF8 00034A38 C0 02 87 00 */ lfs f0, "@2517"@sda21(r2)
.global lbl_80038BFC
lbl_80038BFC:
/* 80038BFC 00034A3C D0 03 00 00 */ stfs f0, 0x0(r3)
/* 80038C00 00034A40 80 82 86 08 */ lwz r4, __GXData@sda21(r2)
/* 80038C04 00034A44 E0 44 05 2C */ psq_l f2, 0x52c(r4), 0, qr0
/* 80038C08 00034A48 E0 24 05 34 */ psq_l f1, 0x534(r4), 0, qr0
/* 80038C0C 00034A4C E0 04 05 3C */ psq_l f0, 0x53c(r4), 0, qr0
/* 80038C10 00034A50 F0 43 00 04 */ psq_st f2, 0x4(r3), 0, qr0
/* 80038C14 00034A54 F0 23 00 0C */ psq_st f1, 0xc(r3), 0, qr0
/* 80038C18 00034A58 F0 03 00 14 */ psq_st f0, 0x14(r3), 0, qr0
/* 80038C1C 00034A5C 4E 80 00 20 */ blr
.global GXLoadPosMtxImm
GXLoadPosMtxImm:
/* 80038C20 00034A60 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 80038C24 00034A64 38 00 00 10 */ li r0, 0x10
/* 80038C28 00034A68 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 80038C2C 00034A6C 54 80 10 3A */ slwi r0, r4, 2
/* 80038C30 00034A70 64 00 00 0B */ oris r0, r0, 0xb
/* 80038C34 00034A74 38 85 80 00 */ addi r4, r5, -0x8000
/* 80038C38 00034A78 90 05 80 00 */ stw r0, -0x8000(r5)
/* 80038C3C 00034A7C E0 A3 00 00 */ psq_l f5, 0x0(r3), 0, qr0
/* 80038C40 00034A80 E0 83 00 08 */ psq_l f4, 0x8(r3), 0, qr0
/* 80038C44 00034A84 E0 63 00 10 */ psq_l f3, 0x10(r3), 0, qr0
/* 80038C48 00034A88 E0 43 00 18 */ psq_l f2, 0x18(r3), 0, qr0
/* 80038C4C 00034A8C E0 23 00 20 */ psq_l f1, 0x20(r3), 0, qr0
/* 80038C50 00034A90 E0 03 00 28 */ psq_l f0, 0x28(r3), 0, qr0
/* 80038C54 00034A94 F0 A4 00 00 */ psq_st f5, 0x0(r4), 0, qr0
/* 80038C58 00034A98 F0 84 00 00 */ psq_st f4, 0x0(r4), 0, qr0
/* 80038C5C 00034A9C F0 64 00 00 */ psq_st f3, 0x0(r4), 0, qr0
/* 80038C60 00034AA0 F0 44 00 00 */ psq_st f2, 0x0(r4), 0, qr0
/* 80038C64 00034AA4 F0 24 00 00 */ psq_st f1, 0x0(r4), 0, qr0
/* 80038C68 00034AA8 F0 04 00 00 */ psq_st f0, 0x0(r4), 0, qr0
/* 80038C6C 00034AAC 4E 80 00 20 */ blr
.global GXLoadPosMtxIndx
GXLoadPosMtxIndx:
/* 80038C70 00034AB0 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 80038C74 00034AB4 38 00 00 20 */ li r0, 0x20
/* 80038C78 00034AB8 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 80038C7C 00034ABC 54 86 10 3A */ slwi r6, r4, 2
/* 80038C80 00034AC0 38 00 00 0B */ li r0, 0xb
/* 80038C84 00034AC4 38 80 00 00 */ li r4, 0x0
/* 80038C88 00034AC8 50 C4 05 3E */ rlwimi r4, r6, 0, 20, 31
/* 80038C8C 00034ACC 50 04 64 26 */ rlwimi r4, r0, 12, 16, 19
/* 80038C90 00034AD0 50 64 80 1E */ rlwimi r4, r3, 16, 0, 15
/* 80038C94 00034AD4 90 85 80 00 */ stw r4, -0x8000(r5)
/* 80038C98 00034AD8 4E 80 00 20 */ blr
/* 80038C9C 00034ADC 00 00 00 00 */ .4byte 0x00000000
.global GXLoadNrmMtxImm
GXLoadNrmMtxImm:
/* 80038CA0 00034AE0 54 80 10 3A */ slwi r0, r4, 2
/* 80038CA4 00034AE4 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 80038CA8 00034AE8 7C 84 00 50 */ subf r4, r4, r0
/* 80038CAC 00034AEC 38 00 00 10 */ li r0, 0x10
/* 80038CB0 00034AF0 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 80038CB4 00034AF4 38 84 04 00 */ addi r4, r4, 0x400
/* 80038CB8 00034AF8 64 80 00 08 */ oris r0, r4, 0x8
/* 80038CBC 00034AFC 90 05 80 00 */ stw r0, -0x8000(r5)
/* 80038CC0 00034B00 38 85 80 00 */ addi r4, r5, -0x8000
/* 80038CC4 00034B04 E0 A3 00 00 */ psq_l f5, 0x0(r3), 0, qr0
/* 80038CC8 00034B08 C0 83 00 08 */ lfs f4, 0x8(r3)
/* 80038CCC 00034B0C E0 63 00 10 */ psq_l f3, 0x10(r3), 0, qr0
/* 80038CD0 00034B10 C0 43 00 18 */ lfs f2, 0x18(r3)
/* 80038CD4 00034B14 E0 23 00 20 */ psq_l f1, 0x20(r3), 0, qr0
/* 80038CD8 00034B18 C0 03 00 28 */ lfs f0, 0x28(r3)
/* 80038CDC 00034B1C F0 A4 00 00 */ psq_st f5, 0x0(r4), 0, qr0
/* 80038CE0 00034B20 D0 85 80 00 */ stfs f4, -0x8000(r5)
/* 80038CE4 00034B24 F0 64 00 00 */ psq_st f3, 0x0(r4), 0, qr0
/* 80038CE8 00034B28 D0 45 80 00 */ stfs f2, -0x8000(r5)
/* 80038CEC 00034B2C F0 24 00 00 */ psq_st f1, 0x0(r4), 0, qr0
/* 80038CF0 00034B30 D0 05 80 00 */ stfs f0, -0x8000(r5)
/* 80038CF4 00034B34 4E 80 00 20 */ blr
/* 80038CF8 00034B38 00 00 00 00 */ .4byte 0x00000000
/* 80038CFC 00034B3C 00 00 00 00 */ .4byte 0x00000000
.global GXLoadNrmMtxIndx3x3
GXLoadNrmMtxIndx3x3:
/* 80038D00 00034B40 54 80 10 3A */ slwi r0, r4, 2
/* 80038D04 00034B44 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 80038D08 00034B48 7C 84 00 50 */ subf r4, r4, r0
/* 80038D0C 00034B4C 38 C0 00 00 */ li r6, 0x0
/* 80038D10 00034B50 38 00 00 28 */ li r0, 0x28
/* 80038D14 00034B54 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 80038D18 00034B58 38 84 04 00 */ addi r4, r4, 0x400
/* 80038D1C 00034B5C 38 00 00 08 */ li r0, 0x8
/* 80038D20 00034B60 50 86 05 3E */ rlwimi r6, r4, 0, 20, 31
/* 80038D24 00034B64 50 06 64 26 */ rlwimi r6, r0, 12, 16, 19
/* 80038D28 00034B68 50 66 80 1E */ rlwimi r6, r3, 16, 0, 15
/* 80038D2C 00034B6C 90 C5 80 00 */ stw r6, -0x8000(r5)
/* 80038D30 00034B70 4E 80 00 20 */ blr
/* 80038D34 00034B74 00 00 00 00 */ .4byte 0x00000000
/* 80038D38 00034B78 00 00 00 00 */ .4byte 0x00000000
/* 80038D3C 00034B7C 00 00 00 00 */ .4byte 0x00000000
.global GXSetCurrentMtx
GXSetCurrentMtx:
/* 80038D40 00034B80 80 82 86 08 */ lwz r4, __GXData@sda21(r2)
/* 80038D44 00034B84 80 04 00 80 */ lwz r0, 0x80(r4)
/* 80038D48 00034B88 50 60 06 BE */ rlwimi r0, r3, 0, 26, 31
/* 80038D4C 00034B8C 90 04 00 80 */ stw r0, 0x80(r4)
/* 80038D50 00034B90 80 04 05 FC */ lwz r0, 0x5fc(r4)
/* 80038D54 00034B94 64 00 04 00 */ oris r0, r0, 0x400
/* 80038D58 00034B98 90 04 05 FC */ stw r0, 0x5fc(r4)
/* 80038D5C 00034B9C 4E 80 00 20 */ blr
.global GXLoadTexMtxImm
GXLoadTexMtxImm:
/* 80038D60 00034BA0 28 04 00 40 */ cmplwi r4, 0x40
/* 80038D64 00034BA4 41 80 00 14 */ blt lbl_80038D78
/* 80038D68 00034BA8 38 04 FF C0 */ addi r0, r4, -0x40
/* 80038D6C 00034BAC 54 04 10 3A */ slwi r4, r0, 2
/* 80038D70 00034BB0 38 E4 05 00 */ addi r7, r4, 0x500
/* 80038D74 00034BB4 48 00 00 08 */ b lbl_80038D7C
.global lbl_80038D78
lbl_80038D78:
/* 80038D78 00034BB8 54 87 10 3A */ slwi r7, r4, 2
.global lbl_80038D7C
lbl_80038D7C:
/* 80038D7C 00034BBC 2C 05 00 01 */ cmpwi r5, 0x1
/* 80038D80 00034BC0 40 82 00 0C */ bne lbl_80038D8C
/* 80038D84 00034BC4 38 C0 00 08 */ li r6, 0x8
/* 80038D88 00034BC8 48 00 00 08 */ b lbl_80038D90
.global lbl_80038D8C
lbl_80038D8C:
/* 80038D8C 00034BCC 38 C0 00 0C */ li r6, 0xc
.global lbl_80038D90
lbl_80038D90:
/* 80038D90 00034BD0 3C 80 CC 01 */ lis r4, 0xCC008000@ha
/* 80038D94 00034BD4 38 C6 FF FF */ addi r6, r6, -0x1
/* 80038D98 00034BD8 38 00 00 10 */ li r0, 0x10
/* 80038D9C 00034BDC 98 04 80 00 */ stb r0, 0xCC008000@l(r4)
/* 80038DA0 00034BE0 54 C0 80 1E */ slwi r0, r6, 16
/* 80038DA4 00034BE4 2C 05 00 00 */ cmpwi r5, 0x0
/* 80038DA8 00034BE8 7C E0 03 78 */ or r0, r7, r0
/* 80038DAC 00034BEC 90 04 80 00 */ stw r0, -0x8000(r4)
/* 80038DB0 00034BF0 40 82 00 3C */ bne lbl_80038DEC
/* 80038DB4 00034BF4 38 84 80 00 */ addi r4, r4, -0x8000
/* 80038DB8 00034BF8 E0 A3 00 00 */ psq_l f5, 0x0(r3), 0, qr0
/* 80038DBC 00034BFC E0 83 00 08 */ psq_l f4, 0x8(r3), 0, qr0
/* 80038DC0 00034C00 E0 63 00 10 */ psq_l f3, 0x10(r3), 0, qr0
/* 80038DC4 00034C04 E0 43 00 18 */ psq_l f2, 0x18(r3), 0, qr0
/* 80038DC8 00034C08 E0 23 00 20 */ psq_l f1, 0x20(r3), 0, qr0
/* 80038DCC 00034C0C E0 03 00 28 */ psq_l f0, 0x28(r3), 0, qr0
/* 80038DD0 00034C10 F0 A4 00 00 */ psq_st f5, 0x0(r4), 0, qr0
/* 80038DD4 00034C14 F0 84 00 00 */ psq_st f4, 0x0(r4), 0, qr0
/* 80038DD8 00034C18 F0 64 00 00 */ psq_st f3, 0x0(r4), 0, qr0
/* 80038DDC 00034C1C F0 44 00 00 */ psq_st f2, 0x0(r4), 0, qr0
/* 80038DE0 00034C20 F0 24 00 00 */ psq_st f1, 0x0(r4), 0, qr0
/* 80038DE4 00034C24 F0 04 00 00 */ psq_st f0, 0x0(r4), 0, qr0
/* 80038DE8 00034C28 4E 80 00 20 */ blr
.global lbl_80038DEC
lbl_80038DEC:
/* 80038DEC 00034C2C 38 84 80 00 */ addi r4, r4, -0x8000
/* 80038DF0 00034C30 E0 63 00 00 */ psq_l f3, 0x0(r3), 0, qr0
/* 80038DF4 00034C34 E0 43 00 08 */ psq_l f2, 0x8(r3), 0, qr0
/* 80038DF8 00034C38 E0 23 00 10 */ psq_l f1, 0x10(r3), 0, qr0
/* 80038DFC 00034C3C E0 03 00 18 */ psq_l f0, 0x18(r3), 0, qr0
/* 80038E00 00034C40 F0 64 00 00 */ psq_st f3, 0x0(r4), 0, qr0
/* 80038E04 00034C44 F0 44 00 00 */ psq_st f2, 0x0(r4), 0, qr0
/* 80038E08 00034C48 F0 24 00 00 */ psq_st f1, 0x0(r4), 0, qr0
/* 80038E0C 00034C4C F0 04 00 00 */ psq_st f0, 0x0(r4), 0, qr0
/* 80038E10 00034C50 4E 80 00 20 */ blr
/* 80038E14 00034C54 00 00 00 00 */ .4byte 0x00000000
/* 80038E18 00034C58 00 00 00 00 */ .4byte 0x00000000
/* 80038E1C 00034C5C 00 00 00 00 */ .4byte 0x00000000
.global __GXSetViewport
__GXSetViewport:
/* 80038E20 00034C60 80 C2 86 08 */ lwz r6, __GXData@sda21(r2)
/* 80038E24 00034C64 3C 60 00 05 */ lis r3, 0x5
/* 80038E28 00034C68 C0 E2 87 08 */ lfs f7, "@2519_8055E688"@sda21(r2)
/* 80038E2C 00034C6C 3C 80 CC 01 */ lis r4, 0xCC008000@ha
/* 80038E30 00034C70 C0 26 05 50 */ lfs f1, 0x550(r6)
/* 80038E34 00034C74 38 A0 00 10 */ li r5, 0x10
/* 80038E38 00034C78 C0 46 05 4C */ lfs f2, 0x54c(r6)
/* 80038E3C 00034C7C 38 03 10 1A */ addi r0, r3, 0x101a
/* 80038E40 00034C80 FC 00 08 50 */ fneg f0, f1
/* 80038E44 00034C84 C0 C6 05 44 */ lfs f6, 0x544(r6)
/* 80038E48 00034C88 ED 02 01 F2 */ fmuls f8, f2, f7
/* 80038E4C 00034C8C C0 86 05 48 */ lfs f4, 0x548(r6)
/* 80038E50 00034C90 EC A1 01 F2 */ fmuls f5, f1, f7
/* 80038E54 00034C94 C0 66 05 54 */ lfs f3, 0x554(r6)
/* 80038E58 00034C98 C0 46 05 60 */ lfs f2, 0x560(r6)
/* 80038E5C 00034C9C EC E0 01 F2 */ fmuls f7, f0, f7
/* 80038E60 00034CA0 C0 26 05 58 */ lfs f1, 0x558(r6)
/* 80038E64 00034CA4 C0 06 05 5C */ lfs f0, 0x55c(r6)
/* 80038E68 00034CA8 ED 23 00 B2 */ fmuls f9, f3, f2
/* 80038E6C 00034CAC ED 41 00 B2 */ fmuls f10, f1, f2
/* 80038E70 00034CB0 C0 42 87 0C */ lfs f2, "@2610"@sda21(r2)
/* 80038E74 00034CB4 98 A4 80 00 */ stb r5, 0xCC008000@l(r4)
/* 80038E78 00034CB8 EC 24 28 2A */ fadds f1, f4, f5
/* 80038E7C 00034CBC EC 66 40 2A */ fadds f3, f6, f8
/* 80038E80 00034CC0 90 04 80 00 */ stw r0, -0x8000(r4)
/* 80038E84 00034CC4 EC 8A 48 28 */ fsubs f4, f10, f9
/* 80038E88 00034CC8 D1 04 80 00 */ stfs f8, -0x8000(r4)
/* 80038E8C 00034CCC EC 62 18 2A */ fadds f3, f2, f3
/* 80038E90 00034CD0 EC 22 08 2A */ fadds f1, f2, f1
/* 80038E94 00034CD4 D0 E4 80 00 */ stfs f7, -0x8000(r4)
/* 80038E98 00034CD8 EC 0A 00 2A */ fadds f0, f10, f0
/* 80038E9C 00034CDC D0 84 80 00 */ stfs f4, -0x8000(r4)
/* 80038EA0 00034CE0 D0 64 80 00 */ stfs f3, -0x8000(r4)
/* 80038EA4 00034CE4 D0 24 80 00 */ stfs f1, -0x8000(r4)
/* 80038EA8 00034CE8 D0 04 80 00 */ stfs f0, -0x8000(r4)
/* 80038EAC 00034CEC 4E 80 00 20 */ blr
.global GXSetViewportJitter
GXSetViewportJitter:
/* 80038EB0 00034CF0 2C 03 00 00 */ cmpwi r3, 0x0
/* 80038EB4 00034CF4 40 82 00 0C */ bne lbl_80038EC0
/* 80038EB8 00034CF8 C0 02 87 08 */ lfs f0, "@2519_8055E688"@sda21(r2)
/* 80038EBC 00034CFC EC 42 00 28 */ fsubs f2, f2, f0
.global lbl_80038EC0
lbl_80038EC0:
/* 80038EC0 00034D00 80 62 86 08 */ lwz r3, __GXData@sda21(r2)
/* 80038EC4 00034D04 D0 23 05 44 */ stfs f1, 0x544(r3)
/* 80038EC8 00034D08 D0 43 05 48 */ stfs f2, 0x548(r3)
/* 80038ECC 00034D0C D0 63 05 4C */ stfs f3, 0x54c(r3)
/* 80038ED0 00034D10 D0 83 05 50 */ stfs f4, 0x550(r3)
/* 80038ED4 00034D14 D0 A3 05 54 */ stfs f5, 0x554(r3)
/* 80038ED8 00034D18 D0 C3 05 58 */ stfs f6, 0x558(r3)
/* 80038EDC 00034D1C 80 03 05 FC */ lwz r0, 0x5fc(r3)
/* 80038EE0 00034D20 64 00 10 00 */ oris r0, r0, 0x1000
/* 80038EE4 00034D24 90 03 05 FC */ stw r0, 0x5fc(r3)
/* 80038EE8 00034D28 4E 80 00 20 */ blr
/* 80038EEC 00034D2C 00 00 00 00 */ .4byte 0x00000000
.global GXSetViewport
GXSetViewport:
/* 80038EF0 00034D30 80 62 86 08 */ lwz r3, __GXData@sda21(r2)
/* 80038EF4 00034D34 D0 23 05 44 */ stfs f1, 0x544(r3)
/* 80038EF8 00034D38 D0 43 05 48 */ stfs f2, 0x548(r3)
/* 80038EFC 00034D3C D0 63 05 4C */ stfs f3, 0x54c(r3)
/* 80038F00 00034D40 D0 83 05 50 */ stfs f4, 0x550(r3)
/* 80038F04 00034D44 D0 A3 05 54 */ stfs f5, 0x554(r3)
/* 80038F08 00034D48 D0 C3 05 58 */ stfs f6, 0x558(r3)
/* 80038F0C 00034D4C 80 03 05 FC */ lwz r0, 0x5fc(r3)
/* 80038F10 00034D50 64 00 10 00 */ oris r0, r0, 0x1000
/* 80038F14 00034D54 90 03 05 FC */ stw r0, 0x5fc(r3)
/* 80038F18 00034D58 4E 80 00 20 */ blr
/* 80038F1C 00034D5C 00 00 00 00 */ .4byte 0x00000000
.global GXSetZScaleOffset
GXSetZScaleOffset:
/* 80038F20 00034D60 C0 62 87 10 */ lfs f3, "@2629"@sda21(r2)
/* 80038F24 00034D64 80 62 86 08 */ lwz r3, __GXData@sda21(r2)
/* 80038F28 00034D68 EC 23 00 72 */ fmuls f1, f3, f1
/* 80038F2C 00034D6C C0 02 87 04 */ lfs f0, "@2518"@sda21(r2)
/* 80038F30 00034D70 EC 43 00 B2 */ fmuls f2, f3, f2
/* 80038F34 00034D74 D0 43 05 5C */ stfs f2, 0x55c(r3)
/* 80038F38 00034D78 EC 00 08 2A */ fadds f0, f0, f1
/* 80038F3C 00034D7C D0 03 05 60 */ stfs f0, 0x560(r3)
/* 80038F40 00034D80 80 03 05 FC */ lwz r0, 0x5fc(r3)
/* 80038F44 00034D84 64 00 10 00 */ oris r0, r0, 0x1000
/* 80038F48 00034D88 90 03 05 FC */ stw r0, 0x5fc(r3)
/* 80038F4C 00034D8C 4E 80 00 20 */ blr
.global GXSetScissor
GXSetScissor:
/* 80038F50 00034D90 81 02 86 08 */ lwz r8, __GXData@sda21(r2)
/* 80038F54 00034D94 38 84 01 56 */ addi r4, r4, 0x156
/* 80038F58 00034D98 39 23 01 56 */ addi r9, r3, 0x156
/* 80038F5C 00034D9C 3C E0 CC 01 */ lis r7, 0xCC008000@ha
/* 80038F60 00034DA0 80 08 01 48 */ lwz r0, 0x148(r8)
/* 80038F64 00034DA4 50 80 05 7E */ rlwimi r0, r4, 0, 21, 31
/* 80038F68 00034DA8 51 20 62 66 */ rlwimi r0, r9, 12, 9, 19
/* 80038F6C 00034DAC 90 08 01 48 */ stw r0, 0x148(r8)
/* 80038F70 00034DB0 7C C4 32 14 */ add r6, r4, r6
/* 80038F74 00034DB4 7C 69 2A 14 */ add r3, r9, r5
/* 80038F78 00034DB8 38 06 FF FF */ addi r0, r6, -0x1
/* 80038F7C 00034DBC 80 A8 01 4C */ lwz r5, 0x14c(r8)
/* 80038F80 00034DC0 50 05 05 7E */ rlwimi r5, r0, 0, 21, 31
/* 80038F84 00034DC4 38 63 FF FF */ addi r3, r3, -0x1
/* 80038F88 00034DC8 50 65 62 66 */ rlwimi r5, r3, 12, 9, 19
/* 80038F8C 00034DCC 90 A8 01 4C */ stw r5, 0x14c(r8)
/* 80038F90 00034DD0 38 80 00 61 */ li r4, 0x61
/* 80038F94 00034DD4 38 00 00 00 */ li r0, 0x0
/* 80038F98 00034DD8 98 87 80 00 */ stb r4, 0xCC008000@l(r7)
/* 80038F9C 00034DDC 80 68 01 48 */ lwz r3, 0x148(r8)
/* 80038FA0 00034DE0 90 67 80 00 */ stw r3, -0x8000(r7)
/* 80038FA4 00034DE4 98 87 80 00 */ stb r4, -0x8000(r7)
/* 80038FA8 00034DE8 80 68 01 4C */ lwz r3, 0x14c(r8)
/* 80038FAC 00034DEC 90 67 80 00 */ stw r3, -0x8000(r7)
/* 80038FB0 00034DF0 B0 08 00 02 */ sth r0, 0x2(r8)
/* 80038FB4 00034DF4 4E 80 00 20 */ blr
/* 80038FB8 00034DF8 00 00 00 00 */ .4byte 0x00000000
/* 80038FBC 00034DFC 00 00 00 00 */ .4byte 0x00000000
.global GXSetScissorBoxOffset
GXSetScissorBoxOffset:
/* 80038FC0 00034E00 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 80038FC4 00034E04 38 00 00 61 */ li r0, 0x61
/* 80038FC8 00034E08 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 80038FCC 00034E0C 38 04 01 56 */ addi r0, r4, 0x156
/* 80038FD0 00034E10 38 63 01 56 */ addi r3, r3, 0x156
/* 80038FD4 00034E14 38 80 00 59 */ li r4, 0x59
/* 80038FD8 00034E18 38 C0 00 00 */ li r6, 0x0
/* 80038FDC 00034E1C 50 66 FD BE */ rlwimi r6, r3, 31, 22, 31
/* 80038FE0 00034E20 80 62 86 08 */ lwz r3, __GXData@sda21(r2)
/* 80038FE4 00034E24 50 06 4B 2A */ rlwimi r6, r0, 9, 12, 21
/* 80038FE8 00034E28 38 00 00 00 */ li r0, 0x0
/* 80038FEC 00034E2C 50 86 C0 0E */ rlwimi r6, r4, 24, 0, 7
/* 80038FF0 00034E30 90 C5 80 00 */ stw r6, -0x8000(r5)
/* 80038FF4 00034E34 B0 03 00 02 */ sth r0, 0x2(r3)
/* 80038FF8 00034E38 4E 80 00 20 */ blr
/* 80038FFC 00034E3C 00 00 00 00 */ .4byte 0x00000000
.global GXSetClipMode
GXSetClipMode:
/* 80039000 00034E40 3C C0 CC 01 */ lis r6, 0xCC008000@ha
/* 80039004 00034E44 38 00 00 10 */ li r0, 0x10
/* 80039008 00034E48 98 06 80 00 */ stb r0, 0xCC008000@l(r6)
/* 8003900C 00034E4C 38 A0 10 05 */ li r5, 0x1005
/* 80039010 00034E50 80 82 86 08 */ lwz r4, __GXData@sda21(r2)
/* 80039014 00034E54 38 00 00 01 */ li r0, 0x1
/* 80039018 00034E58 90 A6 80 00 */ stw r5, -0x8000(r6)
/* 8003901C 00034E5C 90 66 80 00 */ stw r3, -0x8000(r6)
/* 80039020 00034E60 B0 04 00 02 */ sth r0, 0x2(r4)
/* 80039024 00034E64 4E 80 00 20 */ blr
/* 80039028 00034E68 00 00 00 00 */ .4byte 0x00000000
/* 8003902C 00034E6C 00 00 00 00 */ .4byte 0x00000000
.global __GXSetMatrixIndex
__GXSetMatrixIndex:
/* 80039030 00034E70 2C 03 00 05 */ cmpwi r3, 0x5
/* 80039034 00034E74 40 80 00 40 */ bge lbl_80039074
/* 80039038 00034E78 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 8003903C 00034E7C 38 00 00 08 */ li r0, 0x8
/* 80039040 00034E80 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 80039044 00034E84 38 00 00 30 */ li r0, 0x30
/* 80039048 00034E88 80 C2 86 08 */ lwz r6, __GXData@sda21(r2)
/* 8003904C 00034E8C 38 60 00 10 */ li r3, 0x10
/* 80039050 00034E90 98 05 80 00 */ stb r0, -0x8000(r5)
/* 80039054 00034E94 38 00 10 18 */ li r0, 0x1018
/* 80039058 00034E98 80 86 00 80 */ lwz r4, 0x80(r6)
/* 8003905C 00034E9C 90 85 80 00 */ stw r4, -0x8000(r5)
/* 80039060 00034EA0 98 65 80 00 */ stb r3, -0x8000(r5)
/* 80039064 00034EA4 90 05 80 00 */ stw r0, -0x8000(r5)
/* 80039068 00034EA8 80 06 00 80 */ lwz r0, 0x80(r6)
/* 8003906C 00034EAC 90 05 80 00 */ stw r0, -0x8000(r5)
/* 80039070 00034EB0 48 00 00 3C */ b lbl_800390AC
.global lbl_80039074
lbl_80039074:
/* 80039074 00034EB4 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 80039078 00034EB8 38 00 00 08 */ li r0, 0x8
/* 8003907C 00034EBC 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 80039080 00034EC0 38 00 00 40 */ li r0, 0x40
/* 80039084 00034EC4 80 C2 86 08 */ lwz r6, __GXData@sda21(r2)
/* 80039088 00034EC8 38 60 00 10 */ li r3, 0x10
/* 8003908C 00034ECC 98 05 80 00 */ stb r0, -0x8000(r5)
/* 80039090 00034ED0 38 00 10 19 */ li r0, 0x1019
/* 80039094 00034ED4 80 86 00 84 */ lwz r4, 0x84(r6)
/* 80039098 00034ED8 90 85 80 00 */ stw r4, -0x8000(r5)
/* 8003909C 00034EDC 98 65 80 00 */ stb r3, -0x8000(r5)
/* 800390A0 00034EE0 90 05 80 00 */ stw r0, -0x8000(r5)
/* 800390A4 00034EE4 80 06 00 84 */ lwz r0, 0x84(r6)
/* 800390A8 00034EE8 90 05 80 00 */ stw r0, -0x8000(r5)
.global lbl_800390AC
lbl_800390AC:
/* 800390AC 00034EEC 38 00 00 01 */ li r0, 0x1
/* 800390B0 00034EF0 B0 06 00 02 */ sth r0, 0x2(r6)
/* 800390B4 00034EF4 4E 80 00 20 */ blr
/* 800390B8 00034EF8 00 00 00 00 */ .4byte 0x00000000
/* 800390BC 00034EFC 00 00 00 00 */ .4byte 0x00000000
.include "macros.inc"
.section .sdata2, "wa" # 0x8055DF80 - 0x805643C0 ; 0x00006440
.global "@2517"
"@2517":
.4byte 0
.global "@2518"
"@2518":
.4byte 0x3F800000
.global "@2519_8055E688"
"@2519_8055E688":
.4byte 0x3F000000
.global "@2610"
"@2610":
.4byte 0x43AB0000
.global "@2629"
"@2629":
.4byte 0x4B7FFFFF
.4byte 0