donut-decomp/asm/mtx/mtx44.s
2022-10-17 09:09:31 +01:00

251 lines
12 KiB
ArmAsm

.include "macros.inc"
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
.global C_MTXFrustum
C_MTXFrustum:
/* 800311B0 0002CFF0 EC 04 18 28 */ fsubs f0, f4, f3
/* 800311B4 0002CFF4 C1 22 85 D8 */ lfs f9, "@1673_8055E558"@sda21(r2)
/* 800311B8 0002CFF8 C1 62 85 D0 */ lfs f11, "@1671_8055E550"@sda21(r2)
/* 800311BC 0002CFFC ED 01 10 28 */ fsubs f8, f1, f2
/* 800311C0 0002D000 EC E6 28 28 */ fsubs f7, f6, f5
/* 800311C4 0002D004 C1 42 85 D4 */ lfs f10, "@1672"@sda21(r2)
/* 800311C8 0002D008 ED 8B 00 24 */ fdivs f12, f11, f0
/* 800311CC 0002D00C C0 02 85 DC */ lfs f0, "@1674_8055E55C"@sda21(r2)
/* 800311D0 0002D010 D0 03 00 38 */ stfs f0, 0x38(r3)
/* 800311D4 0002D014 D1 23 00 04 */ stfs f9, 0x4(r3)
/* 800311D8 0002D018 D1 23 00 0C */ stfs f9, 0xc(r3)
/* 800311DC 0002D01C D1 23 00 10 */ stfs f9, 0x10(r3)
/* 800311E0 0002D020 ED 0B 40 24 */ fdivs f8, f11, f8
/* 800311E4 0002D024 D1 23 00 1C */ stfs f9, 0x1c(r3)
/* 800311E8 0002D028 D1 23 00 20 */ stfs f9, 0x20(r3)
/* 800311EC 0002D02C D1 23 00 24 */ stfs f9, 0x24(r3)
/* 800311F0 0002D030 D1 23 00 30 */ stfs f9, 0x30(r3)
/* 800311F4 0002D034 D1 23 00 34 */ stfs f9, 0x34(r3)
/* 800311F8 0002D038 EC 01 10 2A */ fadds f0, f1, f2
/* 800311FC 0002D03C D1 23 00 3C */ stfs f9, 0x3c(r3)
/* 80031200 0002D040 EC 64 18 2A */ fadds f3, f4, f3
/* 80031204 0002D044 ED 4A 01 72 */ fmuls f10, f10, f5
/* 80031208 0002D048 EC 08 00 32 */ fmuls f0, f8, f0
/* 8003120C 0002D04C EC 4C 00 F2 */ fmuls f2, f12, f3
/* 80031210 0002D050 EC 2A 02 32 */ fmuls f1, f10, f8
/* 80031214 0002D054 D0 03 00 18 */ stfs f0, 0x18(r3)
/* 80031218 0002D058 EC C6 01 72 */ fmuls f6, f6, f5
/* 8003121C 0002D05C D0 23 00 14 */ stfs f1, 0x14(r3)
/* 80031220 0002D060 EC 8A 03 32 */ fmuls f4, f10, f12
/* 80031224 0002D064 EC 6B 38 24 */ fdivs f3, f11, f7
/* 80031228 0002D068 D0 83 00 00 */ stfs f4, 0x0(r3)
/* 8003122C 0002D06C D0 43 00 08 */ stfs f2, 0x8(r3)
/* 80031230 0002D070 FC 20 28 50 */ fneg f1, f5
/* 80031234 0002D074 FC 00 30 50 */ fneg f0, f6
/* 80031238 0002D078 EC 21 00 F2 */ fmuls f1, f1, f3
/* 8003123C 0002D07C EC 03 00 32 */ fmuls f0, f3, f0
/* 80031240 0002D080 D0 23 00 28 */ stfs f1, 0x28(r3)
/* 80031244 0002D084 D0 03 00 2C */ stfs f0, 0x2c(r3)
/* 80031248 0002D088 4E 80 00 20 */ blr
/* 8003124C 0002D08C 00 00 00 00 */ .4byte 0x00000000
.global C_MTXPerspective
C_MTXPerspective:
/* 80031250 0002D090 94 21 FF C0 */ stwu r1, -0x40(r1)
/* 80031254 0002D094 7C 08 02 A6 */ mflr r0
/* 80031258 0002D098 C0 A2 85 E0 */ lfs f5, "@1681"@sda21(r2)
/* 8003125C 0002D09C 90 01 00 44 */ stw r0, 0x44(r1)
/* 80031260 0002D0A0 EC 25 00 72 */ fmuls f1, f5, f1
/* 80031264 0002D0A4 C0 02 85 E4 */ lfs f0, "@1682_8055E564"@sda21(r2)
/* 80031268 0002D0A8 DB E1 00 30 */ stfd f31, 0x30(r1)
/* 8003126C 0002D0AC F3 E1 00 38 */ psq_st f31, 0x38(r1), 0, qr0
/* 80031270 0002D0B0 FF E0 20 90 */ fmr f31, f4
/* 80031274 0002D0B4 EC 20 00 72 */ fmuls f1, f0, f1
/* 80031278 0002D0B8 DB C1 00 20 */ stfd f30, 0x20(r1)
/* 8003127C 0002D0BC F3 C1 00 28 */ psq_st f30, 0x28(r1), 0, qr0
/* 80031280 0002D0C0 FF C0 18 90 */ fmr f30, f3
/* 80031284 0002D0C4 DB A1 00 10 */ stfd f29, 0x10(r1)
/* 80031288 0002D0C8 F3 A1 00 18 */ psq_st f29, 0x18(r1), 0, qr0
/* 8003128C 0002D0CC FF A0 10 90 */ fmr f29, f2
/* 80031290 0002D0D0 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80031294 0002D0D4 7C 7F 1B 78 */ mr r31, r3
/* 80031298 0002D0D8 4B FE 32 79 */ bl tan
/* 8003129C 0002D0DC FC 80 08 18 */ frsp f4, f1
/* 800312A0 0002D0E0 C0 62 85 D8 */ lfs f3, "@1673_8055E558"@sda21(r2)
/* 800312A4 0002D0E4 C0 A2 85 D0 */ lfs f5, "@1671_8055E550"@sda21(r2)
/* 800312A8 0002D0E8 EC 5F F0 28 */ fsubs f2, f31, f30
/* 800312AC 0002D0EC C0 02 85 DC */ lfs f0, "@1674_8055E55C"@sda21(r2)
/* 800312B0 0002D0F0 EC 3F 07 B2 */ fmuls f1, f31, f30
/* 800312B4 0002D0F4 EC C5 20 24 */ fdivs f6, f5, f4
/* 800312B8 0002D0F8 D0 1F 00 38 */ stfs f0, 0x38(r31)
/* 800312BC 0002D0FC D0 7F 00 04 */ stfs f3, 0x4(r31)
/* 800312C0 0002D100 D0 7F 00 08 */ stfs f3, 0x8(r31)
/* 800312C4 0002D104 D0 7F 00 0C */ stfs f3, 0xc(r31)
/* 800312C8 0002D108 D0 7F 00 10 */ stfs f3, 0x10(r31)
/* 800312CC 0002D10C EC A5 10 24 */ fdivs f5, f5, f2
/* 800312D0 0002D110 D0 7F 00 18 */ stfs f3, 0x18(r31)
/* 800312D4 0002D114 D0 DF 00 14 */ stfs f6, 0x14(r31)
/* 800312D8 0002D118 D0 7F 00 1C */ stfs f3, 0x1c(r31)
/* 800312DC 0002D11C D0 7F 00 20 */ stfs f3, 0x20(r31)
/* 800312E0 0002D120 D0 7F 00 24 */ stfs f3, 0x24(r31)
/* 800312E4 0002D124 EC 86 E8 24 */ fdivs f4, f6, f29
/* 800312E8 0002D128 D0 7F 00 30 */ stfs f3, 0x30(r31)
/* 800312EC 0002D12C D0 7F 00 34 */ stfs f3, 0x34(r31)
/* 800312F0 0002D130 D0 7F 00 3C */ stfs f3, 0x3c(r31)
/* 800312F4 0002D134 D0 9F 00 00 */ stfs f4, 0x0(r31)
/* 800312F8 0002D138 FC 00 08 50 */ fneg f0, f1
/* 800312FC 0002D13C FC 40 F0 50 */ fneg f2, f30
/* 80031300 0002D140 EC 05 00 32 */ fmuls f0, f5, f0
/* 80031304 0002D144 EC 22 01 72 */ fmuls f1, f2, f5
/* 80031308 0002D148 D0 1F 00 2C */ stfs f0, 0x2c(r31)
/* 8003130C 0002D14C D0 3F 00 28 */ stfs f1, 0x28(r31)
/* 80031310 0002D150 E3 E1 00 38 */ psq_l f31, 0x38(r1), 0, qr0
/* 80031314 0002D154 CB E1 00 30 */ lfd f31, 0x30(r1)
/* 80031318 0002D158 E3 C1 00 28 */ psq_l f30, 0x28(r1), 0, qr0
/* 8003131C 0002D15C CB C1 00 20 */ lfd f30, 0x20(r1)
/* 80031320 0002D160 E3 A1 00 18 */ psq_l f29, 0x18(r1), 0, qr0
/* 80031324 0002D164 CB A1 00 10 */ lfd f29, 0x10(r1)
/* 80031328 0002D168 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8003132C 0002D16C 80 01 00 44 */ lwz r0, 0x44(r1)
/* 80031330 0002D170 7C 08 03 A6 */ mtlr r0
/* 80031334 0002D174 38 21 00 40 */ addi r1, r1, 0x40
/* 80031338 0002D178 4E 80 00 20 */ blr
/* 8003133C 0002D17C 00 00 00 00 */ .4byte 0x00000000
.global C_MTXOrtho
C_MTXOrtho:
/* 80031340 0002D180 ED 64 18 28 */ fsubs f11, f4, f3
/* 80031344 0002D184 C1 02 85 D8 */ lfs f8, "@1673_8055E558"@sda21(r2)
/* 80031348 0002D188 C1 42 85 D0 */ lfs f10, "@1671_8055E550"@sda21(r2)
/* 8003134C 0002D18C EC E1 10 28 */ fsubs f7, f1, f2
/* 80031350 0002D190 EC 06 28 28 */ fsubs f0, f6, f5
/* 80031354 0002D194 C1 22 85 D4 */ lfs f9, "@1672"@sda21(r2)
/* 80031358 0002D198 ED 8A 58 24 */ fdivs f12, f10, f11
/* 8003135C 0002D19C C0 A2 85 DC */ lfs f5, "@1674_8055E55C"@sda21(r2)
/* 80031360 0002D1A0 D1 03 00 04 */ stfs f8, 0x4(r3)
/* 80031364 0002D1A4 D1 03 00 08 */ stfs f8, 0x8(r3)
/* 80031368 0002D1A8 D1 03 00 10 */ stfs f8, 0x10(r3)
/* 8003136C 0002D1AC D1 03 00 18 */ stfs f8, 0x18(r3)
/* 80031370 0002D1B0 ED 6A 38 24 */ fdivs f11, f10, f7
/* 80031374 0002D1B4 D1 03 00 20 */ stfs f8, 0x20(r3)
/* 80031378 0002D1B8 D1 03 00 24 */ stfs f8, 0x24(r3)
/* 8003137C 0002D1BC D1 03 00 30 */ stfs f8, 0x30(r3)
/* 80031380 0002D1C0 D1 03 00 34 */ stfs f8, 0x34(r3)
/* 80031384 0002D1C4 D1 03 00 38 */ stfs f8, 0x38(r3)
/* 80031388 0002D1C8 EC EA 00 24 */ fdivs f7, f10, f0
/* 8003138C 0002D1CC D1 43 00 3C */ stfs f10, 0x3c(r3)
/* 80031390 0002D1D0 FC 00 30 50 */ fneg f0, f6
/* 80031394 0002D1D4 EC 21 10 2A */ fadds f1, f1, f2
/* 80031398 0002D1D8 EC 64 18 2A */ fadds f3, f4, f3
/* 8003139C 0002D1DC EC C9 03 32 */ fmuls f6, f9, f12
/* 800313A0 0002D1E0 EC 00 01 F2 */ fmuls f0, f0, f7
/* 800313A4 0002D1E4 FC 40 18 50 */ fneg f2, f3
/* 800313A8 0002D1E8 D0 C3 00 00 */ stfs f6, 0x0(r3)
/* 800313AC 0002D1EC EC 69 02 F2 */ fmuls f3, f9, f11
/* 800313B0 0002D1F0 FC 20 08 50 */ fneg f1, f1
/* 800313B4 0002D1F4 D0 03 00 2C */ stfs f0, 0x2c(r3)
/* 800313B8 0002D1F8 EC 8C 00 B2 */ fmuls f4, f12, f2
/* 800313BC 0002D1FC D0 63 00 14 */ stfs f3, 0x14(r3)
/* 800313C0 0002D200 EC 4B 00 72 */ fmuls f2, f11, f1
/* 800313C4 0002D204 EC 25 01 F2 */ fmuls f1, f5, f7
/* 800313C8 0002D208 D0 83 00 0C */ stfs f4, 0xc(r3)
/* 800313CC 0002D20C D0 43 00 1C */ stfs f2, 0x1c(r3)
/* 800313D0 0002D210 D0 23 00 28 */ stfs f1, 0x28(r3)
/* 800313D4 0002D214 4E 80 00 20 */ blr
/* 800313D8 0002D218 00 00 00 00 */ .4byte 0x00000000
/* 800313DC 0002D21C 00 00 00 00 */ .4byte 0x00000000
.global PSMTX44Concat
PSMTX44Concat:
/* 800313E0 0002D220 E0 03 00 00 */ psq_l f0, 0x0(r3), 0, qr0
/* 800313E4 0002D224 E0 44 00 00 */ psq_l f2, 0x0(r4), 0, qr0
/* 800313E8 0002D228 10 C2 00 18 */ ps_muls0 f6, f2, f0
/* 800313EC 0002D22C E0 64 00 10 */ psq_l f3, 0x10(r4), 0, qr0
/* 800313F0 0002D230 E0 84 00 20 */ psq_l f4, 0x20(r4), 0, qr0
/* 800313F4 0002D234 10 C3 30 1E */ ps_madds1 f6, f3, f0, f6
/* 800313F8 0002D238 E0 23 00 08 */ psq_l f1, 0x8(r3), 0, qr0
/* 800313FC 0002D23C E0 A4 00 30 */ psq_l f5, 0x30(r4), 0, qr0
/* 80031400 0002D240 10 C4 30 5C */ ps_madds0 f6, f4, f1, f6
/* 80031404 0002D244 E0 03 00 10 */ psq_l f0, 0x10(r3), 0, qr0
/* 80031408 0002D248 10 C5 30 5E */ ps_madds1 f6, f5, f1, f6
/* 8003140C 0002D24C E0 23 00 18 */ psq_l f1, 0x18(r3), 0, qr0
/* 80031410 0002D250 11 02 00 18 */ ps_muls0 f8, f2, f0
/* 80031414 0002D254 11 03 40 1E */ ps_madds1 f8, f3, f0, f8
/* 80031418 0002D258 E0 03 00 20 */ psq_l f0, 0x20(r3), 0, qr0
/* 8003141C 0002D25C 11 04 40 5C */ ps_madds0 f8, f4, f1, f8
/* 80031420 0002D260 11 05 40 5E */ ps_madds1 f8, f5, f1, f8
/* 80031424 0002D264 E0 23 00 28 */ psq_l f1, 0x28(r3), 0, qr0
/* 80031428 0002D268 11 42 00 18 */ ps_muls0 f10, f2, f0
/* 8003142C 0002D26C 11 43 50 1E */ ps_madds1 f10, f3, f0, f10
/* 80031430 0002D270 E0 03 00 30 */ psq_l f0, 0x30(r3), 0, qr0
/* 80031434 0002D274 11 44 50 5C */ ps_madds0 f10, f4, f1, f10
/* 80031438 0002D278 11 45 50 5E */ ps_madds1 f10, f5, f1, f10
/* 8003143C 0002D27C E0 23 00 38 */ psq_l f1, 0x38(r3), 0, qr0
/* 80031440 0002D280 11 82 00 18 */ ps_muls0 f12, f2, f0
/* 80031444 0002D284 E0 44 00 08 */ psq_l f2, 0x8(r4), 0, qr0
/* 80031448 0002D288 11 83 60 1E */ ps_madds1 f12, f3, f0, f12
/* 8003144C 0002D28C E0 03 00 00 */ psq_l f0, 0x0(r3), 0, qr0
/* 80031450 0002D290 11 84 60 5C */ ps_madds0 f12, f4, f1, f12
/* 80031454 0002D294 E0 64 00 18 */ psq_l f3, 0x18(r4), 0, qr0
/* 80031458 0002D298 11 85 60 5E */ ps_madds1 f12, f5, f1, f12
/* 8003145C 0002D29C E0 23 00 08 */ psq_l f1, 0x8(r3), 0, qr0
/* 80031460 0002D2A0 10 E2 00 18 */ ps_muls0 f7, f2, f0
/* 80031464 0002D2A4 E0 84 00 28 */ psq_l f4, 0x28(r4), 0, qr0
/* 80031468 0002D2A8 10 E3 38 1E */ ps_madds1 f7, f3, f0, f7
/* 8003146C 0002D2AC E0 A4 00 38 */ psq_l f5, 0x38(r4), 0, qr0
/* 80031470 0002D2B0 10 E4 38 5C */ ps_madds0 f7, f4, f1, f7
/* 80031474 0002D2B4 E0 03 00 10 */ psq_l f0, 0x10(r3), 0, qr0
/* 80031478 0002D2B8 10 E5 38 5E */ ps_madds1 f7, f5, f1, f7
/* 8003147C 0002D2BC E0 23 00 18 */ psq_l f1, 0x18(r3), 0, qr0
/* 80031480 0002D2C0 11 22 00 18 */ ps_muls0 f9, f2, f0
/* 80031484 0002D2C4 F0 C5 00 00 */ psq_st f6, 0x0(r5), 0, qr0
/* 80031488 0002D2C8 11 23 48 1E */ ps_madds1 f9, f3, f0, f9
/* 8003148C 0002D2CC E0 03 00 20 */ psq_l f0, 0x20(r3), 0, qr0
/* 80031490 0002D2D0 11 24 48 5C */ ps_madds0 f9, f4, f1, f9
/* 80031494 0002D2D4 F1 05 00 10 */ psq_st f8, 0x10(r5), 0, qr0
/* 80031498 0002D2D8 11 25 48 5E */ ps_madds1 f9, f5, f1, f9
/* 8003149C 0002D2DC E0 23 00 28 */ psq_l f1, 0x28(r3), 0, qr0
/* 800314A0 0002D2E0 11 62 00 18 */ ps_muls0 f11, f2, f0
/* 800314A4 0002D2E4 F1 45 00 20 */ psq_st f10, 0x20(r5), 0, qr0
/* 800314A8 0002D2E8 11 63 58 1E */ ps_madds1 f11, f3, f0, f11
/* 800314AC 0002D2EC E0 03 00 30 */ psq_l f0, 0x30(r3), 0, qr0
/* 800314B0 0002D2F0 11 64 58 5C */ ps_madds0 f11, f4, f1, f11
/* 800314B4 0002D2F4 F1 85 00 30 */ psq_st f12, 0x30(r5), 0, qr0
/* 800314B8 0002D2F8 11 65 58 5E */ ps_madds1 f11, f5, f1, f11
/* 800314BC 0002D2FC E0 23 00 38 */ psq_l f1, 0x38(r3), 0, qr0
/* 800314C0 0002D300 11 A2 00 18 */ ps_muls0 f13, f2, f0
/* 800314C4 0002D304 F0 E5 00 08 */ psq_st f7, 0x8(r5), 0, qr0
/* 800314C8 0002D308 11 A3 68 1E */ ps_madds1 f13, f3, f0, f13
/* 800314CC 0002D30C F1 25 00 18 */ psq_st f9, 0x18(r5), 0, qr0
/* 800314D0 0002D310 11 A4 68 5C */ ps_madds0 f13, f4, f1, f13
/* 800314D4 0002D314 F1 65 00 28 */ psq_st f11, 0x28(r5), 0, qr0
/* 800314D8 0002D318 11 A5 68 5E */ ps_madds1 f13, f5, f1, f13
/* 800314DC 0002D31C F1 A5 00 38 */ psq_st f13, 0x38(r5), 0, qr0
/* 800314E0 0002D320 4E 80 00 20 */ blr
/* 800314E4 0002D324 00 00 00 00 */ .4byte 0x00000000
/* 800314E8 0002D328 00 00 00 00 */ .4byte 0x00000000
/* 800314EC 0002D32C 00 00 00 00 */ .4byte 0x00000000
.include "macros.inc"
.section .sdata2, "wa" # 0x8055DF80 - 0x805643C0 ; 0x00006440
.global "@1671_8055E550"
"@1671_8055E550":
.4byte 0x3F800000
.global "@1672"
"@1672":
.4byte 0x40000000
.global "@1673_8055E558"
"@1673_8055E558":
.4byte 0
.global "@1674_8055E55C"
"@1674_8055E55C":
.4byte 0xBF800000
.global "@1681"
"@1681":
.4byte 0x3F000000
.global "@1682_8055E564"
"@1682_8055E564":
.4byte 0x3C8EFA35