From fd3c6ed326d7cd06ba7d3f9cd5d7f2155bbb2fef Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 23 Apr 2022 14:43:04 -0700 Subject: [PATCH] J3DTevs: patchTexNo_PtrToIdx --- .../J3DShape/J3DLoadArrayBasePtr__F7_GXAttrPv.s | 17 ----------------- .../J3DGraphBase/J3DShape/J3DLoadCPCmd__FUcUl.s | 7 ------- .../J3DTevs/patchTexNo_PtrToIdx__FUlRCUs.s | 10 ---------- libs/JSystem/J3DGraphBase/J3DTevs.cpp | 12 ++++-------- 4 files changed, 4 insertions(+), 42 deletions(-) delete mode 100644 asm/JSystem/J3DGraphBase/J3DShape/J3DLoadArrayBasePtr__F7_GXAttrPv.s delete mode 100644 asm/JSystem/J3DGraphBase/J3DShape/J3DLoadCPCmd__FUcUl.s delete mode 100644 asm/JSystem/J3DGraphBase/J3DTevs/patchTexNo_PtrToIdx__FUlRCUs.s diff --git a/asm/JSystem/J3DGraphBase/J3DShape/J3DLoadArrayBasePtr__F7_GXAttrPv.s b/asm/JSystem/J3DGraphBase/J3DShape/J3DLoadArrayBasePtr__F7_GXAttrPv.s deleted file mode 100644 index 3b3e689d06c..00000000000 --- a/asm/JSystem/J3DGraphBase/J3DShape/J3DLoadArrayBasePtr__F7_GXAttrPv.s +++ /dev/null @@ -1,17 +0,0 @@ -lbl_80314EB0: -/* 80314EB0 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80314EB4 7C 08 02 A6 */ mflr r0 -/* 80314EB8 90 01 00 14 */ stw r0, 0x14(r1) -/* 80314EBC 2C 03 00 19 */ cmpwi r3, 0x19 -/* 80314EC0 38 A0 00 01 */ li r5, 1 -/* 80314EC4 41 82 00 08 */ beq lbl_80314ECC -/* 80314EC8 38 A3 FF F7 */ addi r5, r3, -9 -lbl_80314ECC: -/* 80314ECC 38 05 00 A0 */ addi r0, r5, 0xa0 -/* 80314ED0 54 03 06 3E */ clrlwi r3, r0, 0x18 -/* 80314ED4 54 84 00 7E */ clrlwi r4, r4, 1 -/* 80314ED8 4B FF FF C1 */ bl J3DLoadCPCmd__FUcUl -/* 80314EDC 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80314EE0 7C 08 03 A6 */ mtlr r0 -/* 80314EE4 38 21 00 10 */ addi r1, r1, 0x10 -/* 80314EE8 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphBase/J3DShape/J3DLoadCPCmd__FUcUl.s b/asm/JSystem/J3DGraphBase/J3DShape/J3DLoadCPCmd__FUcUl.s deleted file mode 100644 index 3b756fb2734..00000000000 --- a/asm/JSystem/J3DGraphBase/J3DShape/J3DLoadCPCmd__FUcUl.s +++ /dev/null @@ -1,7 +0,0 @@ -lbl_80314E98: -/* 80314E98 38 00 00 08 */ li r0, 8 -/* 80314E9C 3C A0 CC 01 */ lis r5, 0xCC01 /* 0xCC008000@ha */ -/* 80314EA0 98 05 80 00 */ stb r0, 0x8000(r5) /* 0xCC008000@l */ -/* 80314EA4 98 65 80 00 */ stb r3, -0x8000(r5) -/* 80314EA8 90 85 80 00 */ stw r4, -0x8000(r5) -/* 80314EAC 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphBase/J3DTevs/patchTexNo_PtrToIdx__FUlRCUs.s b/asm/JSystem/J3DGraphBase/J3DTevs/patchTexNo_PtrToIdx__FUlRCUs.s deleted file mode 100644 index d126658902f..00000000000 --- a/asm/JSystem/J3DGraphBase/J3DTevs/patchTexNo_PtrToIdx__FUlRCUs.s +++ /dev/null @@ -1,10 +0,0 @@ -lbl_8032413C: -/* 8032413C 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80324140 7C 08 02 A6 */ mflr r0 -/* 80324144 90 01 00 14 */ stw r0, 0x14(r1) -/* 80324148 A0 84 00 00 */ lhz r4, 0(r4) -/* 8032414C 4B FE A5 C1 */ bl J3DGDSetTexImgPtrRaw__F11_GXTexMapIDUl -/* 80324150 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80324154 7C 08 03 A6 */ mtlr r0 -/* 80324158 38 21 00 10 */ addi r1, r1, 0x10 -/* 8032415C 4E 80 00 20 */ blr diff --git a/libs/JSystem/J3DGraphBase/J3DTevs.cpp b/libs/JSystem/J3DGraphBase/J3DTevs.cpp index 22d969426bd..2e41b6273af 100644 --- a/libs/JSystem/J3DGraphBase/J3DTevs.cpp +++ b/libs/JSystem/J3DGraphBase/J3DTevs.cpp @@ -73,6 +73,8 @@ extern "C" extern u16 j3dDefaultZModeID[1 + 1 /* padding */]; // External References: // +extern void J3DGDSetTexImgPtrRaw(_GXTexMapID param_0, u32 param_1); + extern "C" void J3DGDSetLightAttn__F10_GXLightIDffffff(); extern "C" void J3DGDSetLightColor__F10_GXLightID8_GXColor(); extern "C" void J3DGDSetLightPos__F10_GXLightIDfff(); @@ -82,7 +84,6 @@ extern "C" void J3DGDSetTexLookupMode__F11_GXTexMapID14_GXTexWrapMode14_GXTexWrapMode12_GXTexFilter12_GXTexFilterfffUcUc13_GXAnisotropy(); extern "C" void J3DGDSetTexImgAttr__F11_GXTexMapIDUsUs9_GXTexFmt(); extern "C" void J3DGDSetTexImgPtr__F11_GXTexMapIDPv(); -extern "C" void J3DGDSetTexImgPtrRaw__F11_GXTexMapIDUl(); extern "C" void J3DGDSetTexTlut__F11_GXTexMapIDUl10_GXTlutFmt(); extern "C" void J3DGDLoadTlut__FPvUl11_GXTlutSize(); extern "C" void J3DGetTextureMtx__FRC17J3DTextureSRTInfoRC3VecPA4_f(); @@ -261,14 +262,9 @@ asm void loadTexNo(u32 param_0, u16 const& param_1) { #pragma pop /* 8032413C-80324160 31EA7C 0024+00 0/0 2/2 0/0 .text patchTexNo_PtrToIdx__FUlRCUs */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void patchTexNo_PtrToIdx(u32 param_0, u16 const& param_1) { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DTevs/patchTexNo_PtrToIdx__FUlRCUs.s" +void patchTexNo_PtrToIdx(u32 texID, u16 const& idx) { + J3DGDSetTexImgPtrRaw((GXTexMapID) texID, idx); } -#pragma pop /* 80324160-80324194 31EAA0 0034+00 0/0 2/2 0/0 .text loadNBTScale__FR11J3DNBTScale */ #pragma push