prime/asm/Dolphin/gx/GXTransform.s

425 lines
21 KiB
ArmAsm
Raw Normal View History

2022-04-02 21:03:04 +00:00
.include "macros.inc"
.section .sdata2
.global lbl_805AEBE8
lbl_805AEBE8:
.incbin "baserom.dol", 0x3FB488, 0x4
.global lbl_805AEBEC
lbl_805AEBEC:
.incbin "baserom.dol", 0x3FB48C, 0x4
.global lbl_805AEBF0
lbl_805AEBF0:
.incbin "baserom.dol", 0x3FB490, 0x8
2022-04-02 21:03:04 +00:00
.section .text, "ax"
.global GXSetProjection
GXSetProjection:
/* 8037C244 003791A4 80 A2 CE 08 */ lwz r5, lbl_805AEB28@sda21(r2)
/* 8037C248 003791A8 2C 04 00 01 */ cmpwi r4, 1
/* 8037C24C 003791AC 90 85 04 20 */ stw r4, 0x420(r5)
/* 8037C250 003791B0 C0 03 00 00 */ lfs f0, 0(r3)
/* 8037C254 003791B4 D0 05 04 24 */ stfs f0, 0x424(r5)
/* 8037C258 003791B8 C0 03 00 14 */ lfs f0, 0x14(r3)
/* 8037C25C 003791BC D0 05 04 2C */ stfs f0, 0x42c(r5)
/* 8037C260 003791C0 C0 03 00 28 */ lfs f0, 0x28(r3)
/* 8037C264 003791C4 D0 05 04 34 */ stfs f0, 0x434(r5)
/* 8037C268 003791C8 C0 03 00 2C */ lfs f0, 0x2c(r3)
/* 8037C26C 003791CC D0 05 04 38 */ stfs f0, 0x438(r5)
/* 8037C270 003791D0 40 82 00 18 */ bne lbl_8037C288
/* 8037C274 003791D4 C0 03 00 0C */ lfs f0, 0xc(r3)
/* 8037C278 003791D8 D0 05 04 28 */ stfs f0, 0x428(r5)
/* 8037C27C 003791DC C0 03 00 1C */ lfs f0, 0x1c(r3)
/* 8037C280 003791E0 D0 05 04 30 */ stfs f0, 0x430(r5)
/* 8037C284 003791E4 48 00 00 14 */ b lbl_8037C298
lbl_8037C288:
/* 8037C288 003791E8 C0 03 00 08 */ lfs f0, 8(r3)
/* 8037C28C 003791EC D0 05 04 28 */ stfs f0, 0x428(r5)
/* 8037C290 003791F0 C0 03 00 18 */ lfs f0, 0x18(r3)
/* 8037C294 003791F4 D0 05 04 30 */ stfs f0, 0x430(r5)
lbl_8037C298:
/* 8037C298 003791F8 38 00 00 10 */ li r0, 0x10
/* 8037C29C 003791FC 80 82 CE 08 */ lwz r4, lbl_805AEB28@sda21(r2)
/* 8037C2A0 00379200 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 8037C2A4 00379204 3C 60 00 06 */ lis r3, 0x00061020@ha
/* 8037C2A8 00379208 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 8037C2AC 0037920C 38 03 10 20 */ addi r0, r3, 0x00061020@l
/* 8037C2B0 00379210 90 05 80 00 */ stw r0, 0xCC008000@l(r5)
/* 8037C2B4 00379214 38 00 00 01 */ li r0, 1
/* 8037C2B8 00379218 C0 04 04 24 */ lfs f0, 0x424(r4)
/* 8037C2BC 0037921C D0 05 80 00 */ stfs f0, 0xCC008000@l(r5)
/* 8037C2C0 00379220 C0 04 04 28 */ lfs f0, 0x428(r4)
/* 8037C2C4 00379224 D0 05 80 00 */ stfs f0, 0xCC008000@l(r5)
/* 8037C2C8 00379228 C0 04 04 2C */ lfs f0, 0x42c(r4)
/* 8037C2CC 0037922C D0 05 80 00 */ stfs f0, 0xCC008000@l(r5)
/* 8037C2D0 00379230 C0 04 04 30 */ lfs f0, 0x430(r4)
/* 8037C2D4 00379234 D0 05 80 00 */ stfs f0, 0xCC008000@l(r5)
/* 8037C2D8 00379238 C0 04 04 34 */ lfs f0, 0x434(r4)
/* 8037C2DC 0037923C D0 05 80 00 */ stfs f0, 0xCC008000@l(r5)
/* 8037C2E0 00379240 C0 04 04 38 */ lfs f0, 0x438(r4)
/* 8037C2E4 00379244 D0 05 80 00 */ stfs f0, 0xCC008000@l(r5)
/* 8037C2E8 00379248 80 64 04 20 */ lwz r3, 0x420(r4)
/* 8037C2EC 0037924C 90 65 80 00 */ stw r3, 0xCC008000@l(r5)
/* 8037C2F0 00379250 B0 04 00 02 */ sth r0, 2(r4)
/* 8037C2F4 00379254 4E 80 00 20 */ blr
.global GXSetProjectionv
GXSetProjectionv:
/* 8037C2F8 00379258 7C 08 02 A6 */ mflr r0
/* 8037C2FC 0037925C 90 01 00 04 */ stw r0, 4(r1)
/* 8037C300 00379260 94 21 FF E8 */ stwu r1, -0x18(r1)
/* 8037C304 00379264 93 E1 00 14 */ stw r31, 0x14(r1)
/* 8037C308 00379268 7C 7F 1B 78 */ mr r31, r3
/* 8037C30C 0037926C C0 23 00 00 */ lfs f1, 0(r3)
/* 8037C310 00379270 48 00 D6 45 */ bl __cvt_fp2unsigned
/* 8037C314 00379274 80 E2 CE 08 */ lwz r7, lbl_805AEB28@sda21(r2)
/* 8037C318 00379278 3C 80 00 06 */ lis r4, 0x00061020@ha
/* 8037C31C 0037927C 38 C0 00 10 */ li r6, 0x10
/* 8037C320 00379280 90 67 04 20 */ stw r3, 0x420(r7)
/* 8037C324 00379284 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 8037C328 00379288 38 64 10 20 */ addi r3, r4, 0x00061020@l
/* 8037C32C 0037928C C0 1F 00 04 */ lfs f0, 4(r31)
/* 8037C330 00379290 38 00 00 01 */ li r0, 1
/* 8037C334 00379294 D0 07 04 24 */ stfs f0, 0x424(r7)
/* 8037C338 00379298 C0 1F 00 08 */ lfs f0, 8(r31)
/* 8037C33C 0037929C D0 07 04 28 */ stfs f0, 0x428(r7)
/* 8037C340 003792A0 C0 1F 00 0C */ lfs f0, 0xc(r31)
/* 8037C344 003792A4 D0 07 04 2C */ stfs f0, 0x42c(r7)
/* 8037C348 003792A8 C0 1F 00 10 */ lfs f0, 0x10(r31)
/* 8037C34C 003792AC D0 07 04 30 */ stfs f0, 0x430(r7)
/* 8037C350 003792B0 C0 1F 00 14 */ lfs f0, 0x14(r31)
/* 8037C354 003792B4 D0 07 04 34 */ stfs f0, 0x434(r7)
/* 8037C358 003792B8 C0 1F 00 18 */ lfs f0, 0x18(r31)
/* 8037C35C 003792BC D0 07 04 38 */ stfs f0, 0x438(r7)
/* 8037C360 003792C0 98 C5 80 00 */ stb r6, 0xCC008000@l(r5)
/* 8037C364 003792C4 90 65 80 00 */ stw r3, 0xCC008000@l(r5)
/* 8037C368 003792C8 C0 07 04 24 */ lfs f0, 0x424(r7)
/* 8037C36C 003792CC D0 05 80 00 */ stfs f0, 0xCC008000@l(r5)
/* 8037C370 003792D0 C0 07 04 28 */ lfs f0, 0x428(r7)
/* 8037C374 003792D4 D0 05 80 00 */ stfs f0, 0xCC008000@l(r5)
/* 8037C378 003792D8 C0 07 04 2C */ lfs f0, 0x42c(r7)
/* 8037C37C 003792DC D0 05 80 00 */ stfs f0, 0xCC008000@l(r5)
/* 8037C380 003792E0 C0 07 04 30 */ lfs f0, 0x430(r7)
/* 8037C384 003792E4 D0 05 80 00 */ stfs f0, 0xCC008000@l(r5)
/* 8037C388 003792E8 C0 07 04 34 */ lfs f0, 0x434(r7)
/* 8037C38C 003792EC D0 05 80 00 */ stfs f0, 0xCC008000@l(r5)
/* 8037C390 003792F0 C0 07 04 38 */ lfs f0, 0x438(r7)
/* 8037C394 003792F4 D0 05 80 00 */ stfs f0, 0xCC008000@l(r5)
/* 8037C398 003792F8 80 67 04 20 */ lwz r3, 0x420(r7)
/* 8037C39C 003792FC 90 65 80 00 */ stw r3, 0xCC008000@l(r5)
/* 8037C3A0 00379300 B0 07 00 02 */ sth r0, 2(r7)
/* 8037C3A4 00379304 80 01 00 1C */ lwz r0, 0x1c(r1)
/* 8037C3A8 00379308 83 E1 00 14 */ lwz r31, 0x14(r1)
/* 8037C3AC 0037930C 38 21 00 18 */ addi r1, r1, 0x18
/* 8037C3B0 00379310 7C 08 03 A6 */ mtlr r0
/* 8037C3B4 00379314 4E 80 00 20 */ blr
.global GXLoadPosMtxImm
GXLoadPosMtxImm:
/* 8037C3B8 00379318 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 8037C3BC 0037931C 38 00 00 10 */ li r0, 0x10
/* 8037C3C0 00379320 54 84 10 3A */ slwi r4, r4, 2
/* 8037C3C4 00379324 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 8037C3C8 00379328 64 80 00 0B */ oris r0, r4, 0xb
/* 8037C3CC 0037932C 90 05 80 00 */ stw r0, 0xCC008000@l(r5)
/* 8037C3D0 00379330 38 85 80 00 */ addi r4, r5, -32768
/* 8037C3D4 00379334 E0 A3 00 00 */ psq_l f5, 0(r3), 0, qr0
/* 8037C3D8 00379338 E0 83 00 08 */ psq_l f4, 8(r3), 0, qr0
/* 8037C3DC 0037933C E0 63 00 10 */ psq_l f3, 16(r3), 0, qr0
/* 8037C3E0 00379340 E0 43 00 18 */ psq_l f2, 24(r3), 0, qr0
/* 8037C3E4 00379344 E0 23 00 20 */ psq_l f1, 32(r3), 0, qr0
/* 8037C3E8 00379348 E0 03 00 28 */ psq_l f0, 40(r3), 0, qr0
/* 8037C3EC 0037934C F0 A4 00 00 */ psq_st f5, 0(r4), 0, qr0
/* 8037C3F0 00379350 F0 84 00 00 */ psq_st f4, 0(r4), 0, qr0
/* 8037C3F4 00379354 F0 64 00 00 */ psq_st f3, 0(r4), 0, qr0
/* 8037C3F8 00379358 F0 44 00 00 */ psq_st f2, 0(r4), 0, qr0
/* 8037C3FC 0037935C F0 24 00 00 */ psq_st f1, 0(r4), 0, qr0
/* 8037C400 00379360 F0 04 00 00 */ psq_st f0, 0(r4), 0, qr0
/* 8037C404 00379364 4E 80 00 20 */ blr
.global GXLoadNrmMtxImm
GXLoadNrmMtxImm:
/* 8037C408 00379368 1C A4 00 03 */ mulli r5, r4, 3
/* 8037C40C 0037936C 3C 80 CC 01 */ lis r4, 0xCC008000@ha
/* 8037C410 00379370 38 00 00 10 */ li r0, 0x10
/* 8037C414 00379374 38 A5 04 00 */ addi r5, r5, 0x400
/* 8037C418 00379378 98 04 80 00 */ stb r0, 0xCC008000@l(r4)
/* 8037C41C 0037937C 64 A0 00 08 */ oris r0, r5, 8
/* 8037C420 00379380 94 04 80 00 */ stwu r0, 0xCC008000@l(r4)
/* 8037C424 00379384 E0 A3 00 00 */ psq_l f5, 0(r3), 0, qr0
/* 8037C428 00379388 C0 83 00 08 */ lfs f4, 8(r3)
/* 8037C42C 0037938C E0 63 00 10 */ psq_l f3, 16(r3), 0, qr0
/* 8037C430 00379390 C0 43 00 18 */ lfs f2, 0x18(r3)
/* 8037C434 00379394 E0 23 00 20 */ psq_l f1, 32(r3), 0, qr0
/* 8037C438 00379398 C0 03 00 28 */ lfs f0, 0x28(r3)
/* 8037C43C 0037939C F0 A4 00 00 */ psq_st f5, 0(r4), 0, qr0
/* 8037C440 003793A0 D0 84 00 00 */ stfs f4, 0(r4)
/* 8037C444 003793A4 F0 64 00 00 */ psq_st f3, 0(r4), 0, qr0
/* 8037C448 003793A8 D0 44 00 00 */ stfs f2, 0(r4)
/* 8037C44C 003793AC F0 24 00 00 */ psq_st f1, 0(r4), 0, qr0
/* 8037C450 003793B0 D0 04 00 00 */ stfs f0, 0(r4)
/* 8037C454 003793B4 4E 80 00 20 */ blr
.global GXSetCurrentMtx
GXSetCurrentMtx:
/* 8037C458 003793B8 7C 08 02 A6 */ mflr r0
/* 8037C45C 003793BC 90 01 00 04 */ stw r0, 4(r1)
/* 8037C460 003793C0 94 21 FF F8 */ stwu r1, -8(r1)
/* 8037C464 003793C4 80 82 CE 08 */ lwz r4, lbl_805AEB28@sda21(r2)
/* 8037C468 003793C8 84 04 00 80 */ lwzu r0, 0x80(r4)
/* 8037C46C 003793CC 54 00 00 32 */ rlwinm r0, r0, 0, 0, 0x19
/* 8037C470 003793D0 7C 00 1B 78 */ or r0, r0, r3
/* 8037C474 003793D4 90 04 00 00 */ stw r0, 0(r4)
/* 8037C478 003793D8 38 60 00 00 */ li r3, 0
/* 8037C47C 003793DC 48 00 02 E9 */ bl __GXSetMatrixIndex
/* 8037C480 003793E0 80 01 00 0C */ lwz r0, 0xc(r1)
/* 8037C484 003793E4 38 21 00 08 */ addi r1, r1, 8
/* 8037C488 003793E8 7C 08 03 A6 */ mtlr r0
/* 8037C48C 003793EC 4E 80 00 20 */ blr
.global GXLoadTexMtxImm
GXLoadTexMtxImm:
/* 8037C490 003793F0 28 04 00 40 */ cmplwi r4, 0x40
/* 8037C494 003793F4 41 80 00 14 */ blt lbl_8037C4A8
/* 8037C498 003793F8 38 04 FF C0 */ addi r0, r4, -64
/* 8037C49C 003793FC 54 04 10 3A */ slwi r4, r0, 2
/* 8037C4A0 00379400 38 E4 05 00 */ addi r7, r4, 0x500
/* 8037C4A4 00379404 48 00 00 08 */ b lbl_8037C4AC
lbl_8037C4A8:
/* 8037C4A8 00379408 54 87 10 3A */ slwi r7, r4, 2
lbl_8037C4AC:
/* 8037C4AC 0037940C 2C 05 00 01 */ cmpwi r5, 1
/* 8037C4B0 00379410 40 82 00 0C */ bne lbl_8037C4BC
/* 8037C4B4 00379414 38 80 00 08 */ li r4, 8
/* 8037C4B8 00379418 48 00 00 08 */ b lbl_8037C4C0
lbl_8037C4BC:
/* 8037C4BC 0037941C 38 80 00 0C */ li r4, 0xc
lbl_8037C4C0:
/* 8037C4C0 00379420 38 04 FF FF */ addi r0, r4, -1
/* 8037C4C4 00379424 54 06 80 1E */ slwi r6, r0, 0x10
/* 8037C4C8 00379428 38 00 00 10 */ li r0, 0x10
/* 8037C4CC 0037942C 3C 80 CC 01 */ lis r4, 0xCC008000@ha
/* 8037C4D0 00379430 98 04 80 00 */ stb r0, 0xCC008000@l(r4)
/* 8037C4D4 00379434 7C E0 33 78 */ or r0, r7, r6
/* 8037C4D8 00379438 2C 05 00 00 */ cmpwi r5, 0
/* 8037C4DC 0037943C 90 04 80 00 */ stw r0, 0xCC008000@l(r4)
/* 8037C4E0 00379440 40 82 00 3C */ bne lbl_8037C51C
/* 8037C4E4 00379444 38 84 80 00 */ addi r4, r4, -32768
/* 8037C4E8 00379448 E0 A3 00 00 */ psq_l f5, 0(r3), 0, qr0
/* 8037C4EC 0037944C E0 83 00 08 */ psq_l f4, 8(r3), 0, qr0
/* 8037C4F0 00379450 E0 63 00 10 */ psq_l f3, 16(r3), 0, qr0
/* 8037C4F4 00379454 E0 43 00 18 */ psq_l f2, 24(r3), 0, qr0
/* 8037C4F8 00379458 E0 23 00 20 */ psq_l f1, 32(r3), 0, qr0
/* 8037C4FC 0037945C E0 03 00 28 */ psq_l f0, 40(r3), 0, qr0
/* 8037C500 00379460 F0 A4 00 00 */ psq_st f5, 0(r4), 0, qr0
/* 8037C504 00379464 F0 84 00 00 */ psq_st f4, 0(r4), 0, qr0
/* 8037C508 00379468 F0 64 00 00 */ psq_st f3, 0(r4), 0, qr0
/* 8037C50C 0037946C F0 44 00 00 */ psq_st f2, 0(r4), 0, qr0
/* 8037C510 00379470 F0 24 00 00 */ psq_st f1, 0(r4), 0, qr0
/* 8037C514 00379474 F0 04 00 00 */ psq_st f0, 0(r4), 0, qr0
/* 8037C518 00379478 4E 80 00 20 */ blr
lbl_8037C51C:
/* 8037C51C 0037947C 38 84 80 00 */ addi r4, r4, -32768
/* 8037C520 00379480 E0 63 00 00 */ psq_l f3, 0(r3), 0, qr0
/* 8037C524 00379484 E0 43 00 08 */ psq_l f2, 8(r3), 0, qr0
/* 8037C528 00379488 E0 23 00 10 */ psq_l f1, 16(r3), 0, qr0
/* 8037C52C 0037948C E0 03 00 18 */ psq_l f0, 24(r3), 0, qr0
/* 8037C530 00379490 F0 64 00 00 */ psq_st f3, 0(r4), 0, qr0
/* 8037C534 00379494 F0 44 00 00 */ psq_st f2, 0(r4), 0, qr0
/* 8037C538 00379498 F0 24 00 00 */ psq_st f1, 0(r4), 0, qr0
/* 8037C53C 0037949C F0 04 00 00 */ psq_st f0, 0(r4), 0, qr0
/* 8037C540 003794A0 4E 80 00 20 */ blr
.global GXSetViewportJitter
GXSetViewportJitter:
/* 8037C544 003794A4 7C 08 02 A6 */ mflr r0
/* 8037C548 003794A8 28 03 00 00 */ cmplwi r3, 0
/* 8037C54C 003794AC 90 01 00 04 */ stw r0, 4(r1)
/* 8037C550 003794B0 94 21 FF A0 */ stwu r1, -0x60(r1)
/* 8037C554 003794B4 DB E1 00 58 */ stfd f31, 0x58(r1)
/* 8037C558 003794B8 DB C1 00 50 */ stfd f30, 0x50(r1)
/* 8037C55C 003794BC DB A1 00 48 */ stfd f29, 0x48(r1)
/* 8037C560 003794C0 DB 81 00 40 */ stfd f28, 0x40(r1)
/* 8037C564 003794C4 DB 61 00 38 */ stfd f27, 0x38(r1)
/* 8037C568 003794C8 DB 41 00 30 */ stfd f26, 0x30(r1)
/* 8037C56C 003794CC 40 82 00 0C */ bne lbl_8037C578
/* 8037C570 003794D0 C0 02 CE C8 */ lfs f0, lbl_805AEBE8@sda21(r2)
/* 8037C574 003794D4 EC 42 00 28 */ fsubs f2, f2, f0
lbl_8037C578:
/* 8037C578 003794D8 C1 62 CE C8 */ lfs f11, lbl_805AEBE8@sda21(r2)
/* 8037C57C 003794DC FD 40 20 50 */ fneg f10, f4
/* 8037C580 003794E0 C0 02 CE D0 */ lfs f0, lbl_805AEBF0@sda21(r2)
/* 8037C584 003794E4 C1 22 CE CC */ lfs f9, lbl_805AEBEC@sda21(r2)
/* 8037C588 003794E8 EF E3 02 F2 */ fmuls f31, f3, f11
/* 8037C58C 003794EC 80 62 CE 08 */ lwz r3, lbl_805AEB28@sda21(r2)
/* 8037C590 003794F0 EC E4 02 F2 */ fmuls f7, f4, f11
/* 8037C594 003794F4 D0 23 04 3C */ stfs f1, 0x43c(r3)
/* 8037C598 003794F8 ED 01 F8 2A */ fadds f8, f1, f31
/* 8037C59C 003794FC EF C0 01 B2 */ fmuls f30, f0, f6
/* 8037C5A0 00379500 D0 43 04 40 */ stfs f2, 0x440(r3)
/* 8037C5A4 00379504 EC 22 38 2A */ fadds f1, f2, f7
/* 8037C5A8 00379508 D0 63 04 44 */ stfs f3, 0x444(r3)
/* 8037C5AC 0037950C EC 00 01 72 */ fmuls f0, f0, f5
/* 8037C5B0 00379510 EF AA 02 F2 */ fmuls f29, f10, f11
/* 8037C5B4 00379514 D0 83 04 48 */ stfs f4, 0x448(r3)
/* 8037C5B8 00379518 EF 69 40 2A */ fadds f27, f9, f8
/* 8037C5BC 0037951C D0 A3 04 4C */ stfs f5, 0x44c(r3)
/* 8037C5C0 00379520 EF 49 08 2A */ fadds f26, f9, f1
/* 8037C5C4 00379524 EF 9E 00 28 */ fsubs f28, f30, f0
/* 8037C5C8 00379528 D0 C3 04 50 */ stfs f6, 0x450(r3)
/* 8037C5CC 0037952C 88 03 04 54 */ lbz r0, 0x454(r3)
/* 8037C5D0 00379530 28 00 00 00 */ cmplwi r0, 0
/* 8037C5D4 00379534 41 82 00 10 */ beq lbl_8037C5E4
/* 8037C5D8 00379538 FC 20 28 90 */ fmr f1, f5
/* 8037C5DC 0037953C C0 43 04 58 */ lfs f2, 0x458(r3)
/* 8037C5E0 00379540 4B FF FB F1 */ bl __GXSetRange
lbl_8037C5E4:
/* 8037C5E4 00379544 38 00 00 10 */ li r0, 0x10
/* 8037C5E8 00379548 80 62 CE 08 */ lwz r3, lbl_805AEB28@sda21(r2)
/* 8037C5EC 0037954C 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 8037C5F0 00379550 3C 80 00 05 */ lis r4, 0x0005101A@ha
/* 8037C5F4 00379554 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 8037C5F8 00379558 38 04 10 1A */ addi r0, r4, 0x0005101A@l
/* 8037C5FC 0037955C 90 05 80 00 */ stw r0, 0xCC008000@l(r5)
/* 8037C600 00379560 38 00 00 01 */ li r0, 1
/* 8037C604 00379564 D3 E5 80 00 */ stfs f31, 0xCC008000@l(r5)
/* 8037C608 00379568 D3 A5 80 00 */ stfs f29, 0xCC008000@l(r5)
/* 8037C60C 0037956C D3 85 80 00 */ stfs f28, 0xCC008000@l(r5)
/* 8037C610 00379570 D3 65 80 00 */ stfs f27, 0xCC008000@l(r5)
/* 8037C614 00379574 D3 45 80 00 */ stfs f26, 0xCC008000@l(r5)
/* 8037C618 00379578 D3 C5 80 00 */ stfs f30, 0xCC008000@l(r5)
/* 8037C61C 0037957C B0 03 00 02 */ sth r0, 2(r3)
/* 8037C620 00379580 80 01 00 64 */ lwz r0, 0x64(r1)
/* 8037C624 00379584 CB E1 00 58 */ lfd f31, 0x58(r1)
/* 8037C628 00379588 CB C1 00 50 */ lfd f30, 0x50(r1)
/* 8037C62C 0037958C CB A1 00 48 */ lfd f29, 0x48(r1)
/* 8037C630 00379590 CB 81 00 40 */ lfd f28, 0x40(r1)
/* 8037C634 00379594 CB 61 00 38 */ lfd f27, 0x38(r1)
/* 8037C638 00379598 CB 41 00 30 */ lfd f26, 0x30(r1)
/* 8037C63C 0037959C 38 21 00 60 */ addi r1, r1, 0x60
/* 8037C640 003795A0 7C 08 03 A6 */ mtlr r0
/* 8037C644 003795A4 4E 80 00 20 */ blr
.global GXSetViewport
GXSetViewport:
/* 8037C648 003795A8 7C 08 02 A6 */ mflr r0
/* 8037C64C 003795AC 38 60 00 01 */ li r3, 1
/* 8037C650 003795B0 90 01 00 04 */ stw r0, 4(r1)
/* 8037C654 003795B4 94 21 FF F8 */ stwu r1, -8(r1)
/* 8037C658 003795B8 4B FF FE ED */ bl GXSetViewportJitter
/* 8037C65C 003795BC 80 01 00 0C */ lwz r0, 0xc(r1)
/* 8037C660 003795C0 38 21 00 08 */ addi r1, r1, 8
/* 8037C664 003795C4 7C 08 03 A6 */ mtlr r0
/* 8037C668 003795C8 4E 80 00 20 */ blr
.global GXSetScissor
GXSetScissor:
/* 8037C66C 003795CC 81 02 CE 08 */ lwz r8, lbl_805AEB28@sda21(r2)
/* 8037C670 003795D0 39 23 01 56 */ addi r9, r3, 0x156
/* 8037C674 003795D4 39 44 01 56 */ addi r10, r4, 0x156
/* 8037C678 003795D8 80 68 00 F8 */ lwz r3, 0xf8(r8)
/* 8037C67C 003795DC 38 05 FF FF */ addi r0, r5, -1
/* 8037C680 003795E0 55 24 60 26 */ slwi r4, r9, 0xc
/* 8037C684 003795E4 54 63 00 28 */ rlwinm r3, r3, 0, 0, 0x14
/* 8037C688 003795E8 7C 63 53 78 */ or r3, r3, r10
/* 8037C68C 003795EC 90 68 00 F8 */ stw r3, 0xf8(r8)
/* 8037C690 003795F0 38 66 FF FF */ addi r3, r6, -1
/* 8037C694 003795F4 7C CA 1A 14 */ add r6, r10, r3
/* 8037C698 003795F8 80 A8 00 F8 */ lwz r5, 0xf8(r8)
/* 8037C69C 003795FC 7C 09 02 14 */ add r0, r9, r0
/* 8037C6A0 00379600 54 A3 05 10 */ rlwinm r3, r5, 0, 0x14, 8
/* 8037C6A4 00379604 7C 63 23 78 */ or r3, r3, r4
/* 8037C6A8 00379608 90 68 00 F8 */ stw r3, 0xf8(r8)
/* 8037C6AC 0037960C 54 03 60 26 */ slwi r3, r0, 0xc
/* 8037C6B0 00379610 38 A0 00 61 */ li r5, 0x61
/* 8037C6B4 00379614 80 E8 00 FC */ lwz r7, 0xfc(r8)
/* 8037C6B8 00379618 3C 80 CC 01 */ lis r4, 0xCC008000@ha
/* 8037C6BC 0037961C 38 00 00 00 */ li r0, 0
/* 8037C6C0 00379620 54 E7 00 28 */ rlwinm r7, r7, 0, 0, 0x14
/* 8037C6C4 00379624 7C E6 33 78 */ or r6, r7, r6
/* 8037C6C8 00379628 90 C8 00 FC */ stw r6, 0xfc(r8)
/* 8037C6CC 0037962C 80 C8 00 FC */ lwz r6, 0xfc(r8)
/* 8037C6D0 00379630 54 C6 05 10 */ rlwinm r6, r6, 0, 0x14, 8
/* 8037C6D4 00379634 7C C3 1B 78 */ or r3, r6, r3
/* 8037C6D8 00379638 90 68 00 FC */ stw r3, 0xfc(r8)
/* 8037C6DC 0037963C 98 A4 80 00 */ stb r5, 0xCC008000@l(r4)
/* 8037C6E0 00379640 80 68 00 F8 */ lwz r3, 0xf8(r8)
/* 8037C6E4 00379644 90 64 80 00 */ stw r3, 0xCC008000@l(r4)
/* 8037C6E8 00379648 98 A4 80 00 */ stb r5, 0xCC008000@l(r4)
/* 8037C6EC 0037964C 80 68 00 FC */ lwz r3, 0xfc(r8)
/* 8037C6F0 00379650 90 64 80 00 */ stw r3, 0xCC008000@l(r4)
/* 8037C6F4 00379654 B0 08 00 02 */ sth r0, 2(r8)
/* 8037C6F8 00379658 4E 80 00 20 */ blr
.global GXSetScissorBoxOffset
GXSetScissorBoxOffset:
/* 8037C6FC 0037965C 38 A3 01 56 */ addi r5, r3, 0x156
/* 8037C700 00379660 80 62 CE 08 */ lwz r3, lbl_805AEB28@sda21(r2)
/* 8037C704 00379664 38 04 01 56 */ addi r0, r4, 0x156
/* 8037C708 00379668 54 A4 F8 7E */ srwi r4, r5, 1
/* 8037C70C 0037966C 54 84 05 96 */ rlwinm r4, r4, 0, 0x16, 0xb
/* 8037C710 00379670 54 00 48 2A */ rlwinm r0, r0, 9, 0, 0x15
/* 8037C714 00379674 7C 80 03 78 */ or r0, r4, r0
/* 8037C718 00379678 54 05 02 3E */ clrlwi r5, r0, 8
/* 8037C71C 0037967C 38 00 00 61 */ li r0, 0x61
/* 8037C720 00379680 3C 80 CC 01 */ lis r4, 0xCC008000@ha
/* 8037C724 00379684 98 04 80 00 */ stb r0, 0xCC008000@l(r4)
/* 8037C728 00379688 64 A5 59 00 */ oris r5, r5, 0x5900
/* 8037C72C 0037968C 38 00 00 00 */ li r0, 0
/* 8037C730 00379690 90 A4 80 00 */ stw r5, 0xCC008000@l(r4)
/* 8037C734 00379694 B0 03 00 02 */ sth r0, 2(r3)
/* 8037C738 00379698 4E 80 00 20 */ blr
.global GXSetClipMode
GXSetClipMode:
/* 8037C73C 0037969C 38 00 00 10 */ li r0, 0x10
/* 8037C740 003796A0 80 82 CE 08 */ lwz r4, lbl_805AEB28@sda21(r2)
/* 8037C744 003796A4 3C C0 CC 01 */ lis r6, 0xCC008000@ha
/* 8037C748 003796A8 98 06 80 00 */ stb r0, 0xCC008000@l(r6)
/* 8037C74C 003796AC 38 A0 10 05 */ li r5, 0x1005
/* 8037C750 003796B0 38 00 00 01 */ li r0, 1
/* 8037C754 003796B4 90 A6 80 00 */ stw r5, 0xCC008000@l(r6)
/* 8037C758 003796B8 90 66 80 00 */ stw r3, 0xCC008000@l(r6)
/* 8037C75C 003796BC B0 04 00 02 */ sth r0, 2(r4)
/* 8037C760 003796C0 4E 80 00 20 */ blr
.global __GXSetMatrixIndex
__GXSetMatrixIndex:
/* 8037C764 003796C4 2C 03 00 05 */ cmpwi r3, 5
/* 8037C768 003796C8 40 80 00 3C */ bge lbl_8037C7A4
/* 8037C76C 003796CC 38 00 00 08 */ li r0, 8
/* 8037C770 003796D0 80 82 CE 08 */ lwz r4, lbl_805AEB28@sda21(r2)
/* 8037C774 003796D4 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 8037C778 003796D8 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 8037C77C 003796DC 38 00 00 30 */ li r0, 0x30
/* 8037C780 003796E0 38 60 00 10 */ li r3, 0x10
/* 8037C784 003796E4 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 8037C788 003796E8 38 00 10 18 */ li r0, 0x1018
/* 8037C78C 003796EC 80 84 00 80 */ lwz r4, 0x80(r4)
/* 8037C790 003796F0 90 85 80 00 */ stw r4, 0xCC008000@l(r5)
/* 8037C794 003796F4 98 65 80 00 */ stb r3, 0xCC008000@l(r5)
/* 8037C798 003796F8 90 05 80 00 */ stw r0, 0xCC008000@l(r5)
/* 8037C79C 003796FC 90 85 80 00 */ stw r4, 0xCC008000@l(r5)
/* 8037C7A0 00379700 48 00 00 38 */ b lbl_8037C7D8
lbl_8037C7A4:
/* 8037C7A4 00379704 38 00 00 08 */ li r0, 8
/* 8037C7A8 00379708 80 82 CE 08 */ lwz r4, lbl_805AEB28@sda21(r2)
/* 8037C7AC 0037970C 3C A0 CC 01 */ lis r5, 0xCC008000@ha
/* 8037C7B0 00379710 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 8037C7B4 00379714 38 00 00 40 */ li r0, 0x40
/* 8037C7B8 00379718 38 60 00 10 */ li r3, 0x10
/* 8037C7BC 0037971C 98 05 80 00 */ stb r0, 0xCC008000@l(r5)
/* 8037C7C0 00379720 38 00 10 19 */ li r0, 0x1019
/* 8037C7C4 00379724 80 84 00 84 */ lwz r4, 0x84(r4)
/* 8037C7C8 00379728 90 85 80 00 */ stw r4, 0xCC008000@l(r5)
/* 8037C7CC 0037972C 98 65 80 00 */ stb r3, 0xCC008000@l(r5)
/* 8037C7D0 00379730 90 05 80 00 */ stw r0, 0xCC008000@l(r5)
/* 8037C7D4 00379734 90 85 80 00 */ stw r4, 0xCC008000@l(r5)
lbl_8037C7D8:
/* 8037C7D8 00379738 80 62 CE 08 */ lwz r3, lbl_805AEB28@sda21(r2)
/* 8037C7DC 0037973C 38 00 00 01 */ li r0, 1
/* 8037C7E0 00379740 B0 03 00 02 */ sth r0, 2(r3)
/* 8037C7E4 00379744 4E 80 00 20 */ blr