mirror of
https://github.com/zeldaret/tp
synced 2026-08-04 01:03:47 -04:00
Jsystem work (#399)
* Almost match JASBasicInst * JASDrumSet OK * Some JAudio2 struct adjustment * Match JKRHeap::callAllDisposer * JAISe OK * Fix setAutoDelete * JAISound OK * Match a few functions in linklist * Few matches in d_a_e_ym * JUTTexture OK * Work on JUTGamePad * Import JUTResource * Work on JUTResFont::getFontCode
This commit is contained in:
@@ -479,7 +479,7 @@ asm ResFONT* JUTResFont::getResFont() const {
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm u16 JUTResFont::getFontType() const {
|
||||
asm int JUTResFont::getFontType() const {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JUtility/JUTCacheFont/getFontType__10JUTResFontCFv.s"
|
||||
}
|
||||
|
||||
@@ -227,11 +227,11 @@ u32 JUTGamePad::read() {
|
||||
u32 m_stick = mPadMStick[i].update(mPadStatus[i].stick_x, mPadStatus[i].stick_y,
|
||||
sStickMode, WS_MAIN_STICK, mPadButton[i].mButton)
|
||||
<< 0x18;
|
||||
u32 s_stick = mPadSStick[i].update(mPadStatus[i].substick_x, mPadStatus[i].substick_y,
|
||||
u32 s_stick = (mPadSStick[i].update(mPadStatus[i].substick_x, mPadStatus[i].substick_y,
|
||||
sStickMode, WS_SUB_STICK, mPadButton[i].mButton)
|
||||
<< 0x10;
|
||||
u32 tmp = m_stick | s_stick;
|
||||
mPadButton[i].update(&mPadStatus[i], tmp);
|
||||
<< 0x10);
|
||||
m_stick |= s_stick;
|
||||
mPadButton[i].update(&mPadStatus[i], m_stick);
|
||||
} else if (mPadStatus[i].error == -1) {
|
||||
u32 m_stick = mPadMStick[i].update(0, 0, sStickMode, WS_MAIN_STICK, 0);
|
||||
u32 s_stick = mPadSStick[i].update(0, 0, sStickMode, WS_SUB_STICK, 0);
|
||||
@@ -258,7 +258,8 @@ u32 JUTGamePad::read() {
|
||||
u32 s_stick = pad->mSubStick.update(status.substick_x, status.substick_y, sStickMode,
|
||||
WS_SUB_STICK, pad->mButton.mButton)
|
||||
<< 0x10;
|
||||
pad->mButton.update(&status, m_stick | s_stick);
|
||||
m_stick |= s_stick;
|
||||
pad->mButton.update(&status, m_stick);
|
||||
} else {
|
||||
if (pad->mPortNum == -1) {
|
||||
pad->assign();
|
||||
@@ -639,24 +640,56 @@ void JUTGamePad::CRumble::stopMotor(int portNo, bool stop) {
|
||||
}
|
||||
|
||||
/* 802E16F8-802E1720 2DC038 0028+00 1/1 0/0 0/0 .text getNumBit__FPUci */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm u8 getNumBit(u8* param_0, int param_1) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JUtility/JUTGamePad/getNumBit__FPUci.s"
|
||||
static bool getNumBit(u8* arr, int bitNo) {
|
||||
u8 bit = (arr[bitNo >> 3] & (0x80 >> (bitNo & 7)));
|
||||
return bit != 0;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 802E1720-802E18A4 2DC060 0184+00 1/1 0/0 0/0 .text update__Q210JUTGamePad7CRumbleFs */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void JUTGamePad::CRumble::update(s16 param_0) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JUtility/JUTGamePad/update__Q210JUTGamePad7CRumbleFs.s"
|
||||
void JUTGamePad::CRumble::update(s16 portNo) {
|
||||
if (isEnabledPort(portNo) == false) {
|
||||
field_0x0 = 0;
|
||||
field_0x4 = 0;
|
||||
field_0x8 = NULL;
|
||||
field_0xc = 0;
|
||||
field_0x10 = NULL;
|
||||
}
|
||||
|
||||
if (field_0x4 == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (field_0x0 >= field_0x4) {
|
||||
stopMotor(portNo, true);
|
||||
field_0x4 = 0;
|
||||
} else if (field_0xc == 0) {
|
||||
if (mStatus[portNo] == 0) {
|
||||
startMotor(portNo);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
u32 temp = (field_0x0 / field_0xc);
|
||||
bool numBit = getNumBit(field_0x8, field_0x0 - temp * field_0xc);
|
||||
u8 status = mStatus[portNo] != false;
|
||||
if (numBit && !status) {
|
||||
startMotor(portNo);
|
||||
} else if (!numBit) {
|
||||
bool bit = false;
|
||||
if (field_0x10) {
|
||||
u32 temp = (field_0x0 / field_0xc);
|
||||
bit = getNumBit(field_0x10, field_0x0 - temp * field_0xc);
|
||||
}
|
||||
|
||||
if (status) {
|
||||
stopMotor(portNo, bit);
|
||||
} else if (bit) {
|
||||
stopMotor(portNo, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
field_0x0++;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 802E18A4-802E18CC 2DC1E4 0028+00 1/1 0/0 0/0 .text
|
||||
* triggerPatternedRumble__Q210JUTGamePad7CRumbleFUl */
|
||||
@@ -669,16 +702,22 @@ void JUTGamePad::CRumble::triggerPatternedRumble(u32 param_0) {
|
||||
|
||||
/* 802E18CC-802E1948 2DC20C 007C+00 0/0 2/2 0/0 .text
|
||||
* startPatternedRumble__Q210JUTGamePad7CRumbleFPvQ310JUTGamePad7CRumble7ERumbleUl */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void JUTGamePad::CRumble::startPatternedRumble(void* param_0,
|
||||
JUTGamePad::CRumble::ERumble param_1,
|
||||
u32 param_2) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JUtility/JUTGamePad/startPatternedRumble__Q210JUTGamePad7CRumbleFPvQ310JUTGamePad7CRumble7ERumbleUl.s"
|
||||
void JUTGamePad::CRumble::startPatternedRumble(void* param_0, JUTGamePad::CRumble::ERumble param_1,
|
||||
u32 param_2) {
|
||||
field_0xc = ((*(u8*)param_0) << 8) + *((u8*)param_0 + 1);
|
||||
field_0x8 = (u8*)param_0 + 2;
|
||||
switch (param_1) {
|
||||
case JUTGamePad::CRumble::VAL_0:
|
||||
triggerPatternedRumble(field_0xc);
|
||||
break;
|
||||
case JUTGamePad::CRumble::VAL_1:
|
||||
triggerPatternedRumble(-1);
|
||||
break;
|
||||
case JUTGamePad::CRumble::VAL_2:
|
||||
triggerPatternedRumble(param_2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 802E1948-802E1978 2DC288 0030+00 1/1 3/3 0/0 .text
|
||||
* stopPatternedRumble__Q210JUTGamePad7CRumbleFs */
|
||||
@@ -689,6 +728,16 @@ void JUTGamePad::CRumble::stopPatternedRumble(s16 port) {
|
||||
|
||||
/* 802E1978-802E199C 2DC2B8 0024+00 0/0 1/1 0/0 .text
|
||||
* stopPatternedRumbleAtThePeriod__Q210JUTGamePad7CRumbleFv */
|
||||
// r4 += (r5 - 1) is broken to r4 += r5 and r4 += 1
|
||||
#ifdef NONMATCHING
|
||||
void JUTGamePad::CRumble::stopPatternedRumbleAtThePeriod() {
|
||||
u32 r5 = field_0xc;
|
||||
u32 r4 = field_0x0;
|
||||
r4 += (r5 - 1);
|
||||
u32 temp = r4 / r5;
|
||||
field_0x4 = r4 - temp * r5;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
@@ -697,6 +746,7 @@ asm void JUTGamePad::CRumble::stopPatternedRumbleAtThePeriod() {
|
||||
#include "asm/JSystem/JUtility/JUTGamePad/stopPatternedRumbleAtThePeriod__Q210JUTGamePad7CRumbleFv.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 802E199C-802E19D8 2DC2DC 003C+00 1/1 1/1 0/0 .text getGamePad__10JUTGamePadFi */
|
||||
JUTGamePad* JUTGamePad::getGamePad(int padNo) {
|
||||
|
||||
@@ -493,30 +493,27 @@ static const u16 halftofull[95] = {
|
||||
|
||||
/* 802DFDD8-802DFF60 2DA718 0188+00 2/2 0/0 0/0 .text getFontCode__10JUTResFontCFi */
|
||||
#ifdef NONMATCHING
|
||||
// still many issues
|
||||
// regalloc
|
||||
int JUTResFont::getFontCode(int param_0) const {
|
||||
int ret = mInf1Ptr->width;
|
||||
int ret = mInf1Ptr->defaultCode;
|
||||
if ((getFontType() == 2) && (mMaxCode >= 0x8000U) && (param_0 >= 0x20) && (param_0 < 0x7FU)) {
|
||||
param_0 = halftofull[param_0 - 32];
|
||||
}
|
||||
int j = 0;
|
||||
for (int i = mMap1BlockNum; i > 0; j++, i--) {
|
||||
if ((mpMapBlocks[j]->endCode <= param_0) && (param_0 <= mpMapBlocks[j]->numEntries)) {
|
||||
ResFONT::MAP1* temp_r4 = mpMapBlocks[j];
|
||||
if (temp_r4->startCode == 0) {
|
||||
ret = param_0 - temp_r4->endCode;
|
||||
for (int i = 0; i < mMap1BlockNum; i++) {
|
||||
if ((mpMapBlocks[i]->startCode <= param_0) && (param_0 <= mpMapBlocks[i]->endCode)) {
|
||||
if (mpMapBlocks[i]->mappingMethod == 0) {
|
||||
ret = param_0 - mpMapBlocks[i]->endCode;
|
||||
break;
|
||||
} else if (temp_r4->startCode == 2) {
|
||||
ret = *(&mpMapBlocks[j]->mLeading + ((param_0 - mpMapBlocks[j]->endCode)));
|
||||
} else if (mpMapBlocks[i]->mappingMethod == 2) {
|
||||
ret = *(&mpMapBlocks[i]->mLeading + ((param_0 - mpMapBlocks[i]->endCode)));
|
||||
break;
|
||||
} else if (temp_r4->startCode == 3) {
|
||||
u16* leading_temp = &temp_r4->mLeading;
|
||||
} else if (mpMapBlocks[i]->mappingMethod == 3) {
|
||||
u16* leading_temp = &mpMapBlocks[i]->mLeading;
|
||||
int phi_r5 = 0;
|
||||
int phi_r6_2 = temp_r4->numEntries - 1;
|
||||
int phi_r6_2 = mpMapBlocks[i]->numEntries - 1;
|
||||
|
||||
while (phi_r6_2 >= phi_r5) {
|
||||
u32 temp_r3 = phi_r6_2 + phi_r5;
|
||||
int temp_r7 = (int)((temp_r3 >> 0x1FU) + phi_r6_2 + phi_r5) >> 1;
|
||||
int temp_r7 = (phi_r6_2 + phi_r5) / 2;
|
||||
|
||||
if (param_0 < leading_temp[temp_r7 * 2]) {
|
||||
phi_r6_2 = temp_r7 - 1;
|
||||
@@ -531,10 +528,10 @@ int JUTResFont::getFontCode(int param_0) const {
|
||||
ret = leading_temp[temp_r7 * 2 + 1];
|
||||
break;
|
||||
}
|
||||
} else if (temp_r4->startCode == 1) {
|
||||
} else if (mpMapBlocks[i]->mappingMethod == 1) {
|
||||
u16* phi_r5_2 = NULL;
|
||||
if (temp_r4->numEntries == 1) {
|
||||
phi_r5_2 = &temp_r4->mLeading;
|
||||
if (mpMapBlocks[i]->numEntries == 1) {
|
||||
phi_r5_2 = &mpMapBlocks[i]->mLeading;
|
||||
}
|
||||
ret = convertSjis(param_0, phi_r5_2);
|
||||
break;
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
|
||||
#include "JSystem/JUtility/JUTResource.h"
|
||||
#include "JSystem/JKernel/JKRFileLoader.h"
|
||||
#include "dol2asm.h"
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
#include "JSystem/JSupport/JSUInputStream.h"
|
||||
#include "MSL_C/MSL_Common/Src/string.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
@@ -16,57 +18,64 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void getResource__15JUTResReferenceFP14JSUInputStreamUlP10JKRArchive();
|
||||
extern "C" void getResource__15JUTResReferenceFPCvUlP10JKRArchive();
|
||||
extern "C" void getResource__15JUTResReferenceFUlP10JKRArchive();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
SECTION_INIT void memcpy();
|
||||
extern "C" void getGlbResource__13JKRFileLoaderFPCc();
|
||||
extern "C" void getGlbResource__13JKRFileLoaderFPCcP13JKRFileLoader();
|
||||
extern "C" void getGlbResource__10JKRArchiveFUlPCcP10JKRArchive();
|
||||
extern "C" void read__14JSUInputStreamFPvl();
|
||||
extern "C" void _savegpr_28();
|
||||
extern "C" void _savegpr_29();
|
||||
extern "C" void _restgpr_28();
|
||||
extern "C" void _restgpr_29();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 802DE078-802DE120 2D89B8 00A8+00 0/0 1/1 0/0 .text
|
||||
* getResource__15JUTResReferenceFP14JSUInputStreamUlP10JKRArchive */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void* JUTResReference::getResource(JSUInputStream* param_0, u32 param_1, JKRArchive* param_2) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JUtility/JUTResource/getResource__15JUTResReferenceFP14JSUInputStreamUlP10JKRArchive.s"
|
||||
void *JUTResReference::getResource(JSUInputStream *stream, u32 resType, JKRArchive *archive) {
|
||||
stream->read(&mType, 1);
|
||||
stream->read(&mNameLength, 1);
|
||||
stream->read(&mName, mNameLength);
|
||||
|
||||
if (mType == RESTYPE_Unk2 || mType == RESTYPE_Unk3 || mType == RESTYPE_Unk4)
|
||||
{
|
||||
mName[mNameLength] = 0;
|
||||
}
|
||||
|
||||
return getResource(resType, archive);
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 802DE120-802DE1BC 2D8A60 009C+00 0/0 2/2 0/0 .text
|
||||
* getResource__15JUTResReferenceFPCvUlP10JKRArchive */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void* JUTResReference::getResource(void const* param_0, u32 param_1, JKRArchive* param_2) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JUtility/JUTResource/getResource__15JUTResReferenceFPCvUlP10JKRArchive.s"
|
||||
|
||||
void *JUTResReference::getResource(const void *data, u32 resType, JKRArchive *archive) {
|
||||
mType = *(u8*)data;
|
||||
mNameLength = *((u8*)data + 1);
|
||||
|
||||
if (mNameLength != 0) {
|
||||
memcpy(&mName, &((u8 *)data)[2], mNameLength);
|
||||
}
|
||||
|
||||
if (mType == RESTYPE_Unk2 || mType == RESTYPE_Unk3 || mType == RESTYPE_Unk4) {
|
||||
mName[mNameLength] = 0;
|
||||
}
|
||||
|
||||
return getResource(resType, archive);
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 802DE1BC-802DE234 2D8AFC 0078+00 2/2 0/0 0/0 .text
|
||||
* getResource__15JUTResReferenceFUlP10JKRArchive */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void* JUTResReference::getResource(u32 param_0, JKRArchive* param_1) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JUtility/JUTResource/getResource__15JUTResReferenceFUlP10JKRArchive.s"
|
||||
void *JUTResReference::getResource(u32 resType, JKRArchive *archive) {
|
||||
void *res = NULL;
|
||||
switch (mType) {
|
||||
case RESTYPE_Unk1:
|
||||
break;
|
||||
case RESTYPE_Unk2:
|
||||
res = JKRArchive::getGlbResource(resType, mName, archive);
|
||||
break;
|
||||
case RESTYPE_Unk3:
|
||||
res = JKRFileLoader::getGlbResource(mName, archive);
|
||||
break;
|
||||
case RESTYPE_Unk4:
|
||||
res = JKRFileLoader::getGlbResource(mName);
|
||||
break;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "JSystem/JUtility/JUTTexture.h"
|
||||
#include "JSystem/JUtility/JUTPalette.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/gx/GX.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
@@ -13,28 +12,10 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __dt__10JUTTextureFv();
|
||||
extern "C" void storeTIMG__10JUTTextureFPC7ResTIMGUc();
|
||||
extern "C" void storeTIMG__10JUTTextureFPC7ResTIMGP10JUTPalette();
|
||||
extern "C" void storeTIMG__10JUTTextureFPC7ResTIMGP10JUTPalette7_GXTlut();
|
||||
extern "C" void attachPalette__10JUTTextureFP10JUTPalette();
|
||||
extern "C" void init__10JUTTextureFv();
|
||||
extern "C" void initTexObj__10JUTTextureFv();
|
||||
extern "C" void initTexObj__10JUTTextureF7_GXTlut();
|
||||
extern "C" void load__10JUTTextureF11_GXTexMapID();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void* __nw__FUl();
|
||||
extern "C" void __dl__FPv();
|
||||
extern "C" void __dla__FPv();
|
||||
extern "C" void storeTLUT__10JUTPaletteF7_GXTlut10_GXTlutFmt15JUTTransparencyUsPv();
|
||||
extern "C" void load__10JUTPaletteFv();
|
||||
extern "C" void _savegpr_29();
|
||||
extern "C" void _restgpr_29();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
@@ -50,7 +31,6 @@ JUTTexture::~JUTTexture() {
|
||||
}
|
||||
|
||||
/* 802DE2A8-802DE44C 2D8BE8 01A4+00 0/0 18/18 0/0 .text storeTIMG__10JUTTextureFPC7ResTIMGUc */
|
||||
#ifdef NONMATCHING
|
||||
void JUTTexture::storeTIMG(ResTIMG const* param_0, u8 param_1) {
|
||||
_GXTlut tlut;
|
||||
|
||||
@@ -72,41 +52,29 @@ void JUTTexture::storeTIMG(ResTIMG const* param_0, u8 param_1) {
|
||||
mMaxLOD = (s8)mTexInfo->maxLOD;
|
||||
mLODBias = mTexInfo->LODBias;
|
||||
|
||||
ResTIMG* tmp = (ResTIMG*)mTexInfo;
|
||||
|
||||
if (mTexInfo->numColors == 0) {
|
||||
initTexObj();
|
||||
} else {
|
||||
if (mTexInfo->numColors > 0x100) {
|
||||
tlut = (_GXTlut)param_1;
|
||||
tlut = (_GXTlut)((param_1 % 4) + GX_BIGTLUT0);
|
||||
} else {
|
||||
tlut = (_GXTlut)((param_1 & 3) + GX_BIGTLUT0);
|
||||
tlut = (_GXTlut)param_1;
|
||||
}
|
||||
|
||||
if (mEmbPalette == NULL || !getEmbPaletteDelFlag()) {
|
||||
mEmbPalette = new JUTPalette(tlut, (_GXTlutFmt)tmp->colorFormat,
|
||||
(JUTTransparency)tmp->alphaEnabled, tmp->numColors,
|
||||
(void*)(tmp->format + tmp->paletteOffset));
|
||||
mEmbPalette = new JUTPalette(tlut, (_GXTlutFmt)mTexInfo->colorFormat,
|
||||
(JUTTransparency)mTexInfo->alphaEnabled, mTexInfo->numColors,
|
||||
(void*)(&mTexInfo->format + mTexInfo->paletteOffset));
|
||||
mFlags = mFlags & 1 | 2;
|
||||
} else {
|
||||
mEmbPalette->storeTLUT(tlut, (_GXTlutFmt)tmp->colorFormat,
|
||||
(JUTTransparency)tmp->alphaEnabled, tmp->numColors,
|
||||
(void*)(tmp->format + tmp->paletteOffset));
|
||||
mEmbPalette->storeTLUT(tlut, (_GXTlutFmt)mTexInfo->colorFormat,
|
||||
(JUTTransparency)mTexInfo->alphaEnabled, mTexInfo->numColors,
|
||||
(void*)(&mTexInfo->format + mTexInfo->paletteOffset));
|
||||
}
|
||||
attachPalette(mEmbPalette);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void JUTTexture::storeTIMG(ResTIMG const* param_0, u8 param_1) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JUtility/JUTTexture/storeTIMG__10JUTTextureFPC7ResTIMGUc.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 802DE44C-802DE480 2D8D8C 0034+00 0/0 6/6 0/0 .text
|
||||
* storeTIMG__10JUTTextureFPC7ResTIMGP10JUTPalette */
|
||||
@@ -123,14 +91,45 @@ void JUTTexture::storeTIMG(ResTIMG const* param_0, JUTPalette* param_1) {
|
||||
|
||||
/* 802DE480-802DE5B0 2D8DC0 0130+00 1/1 3/3 0/0 .text
|
||||
* storeTIMG__10JUTTextureFPC7ResTIMGP10JUTPalette7_GXTlut */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void JUTTexture::storeTIMG(ResTIMG const* param_0, JUTPalette* param_1, _GXTlut param_2) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JUtility/JUTTexture/storeTIMG__10JUTTextureFPC7ResTIMGP10JUTPalette7_GXTlut.s"
|
||||
void JUTTexture::storeTIMG(ResTIMG const* param_0, JUTPalette* param_1, _GXTlut param_2) {
|
||||
_GXTlut type;
|
||||
|
||||
if (param_0 == NULL) {
|
||||
return;
|
||||
}
|
||||
mTexInfo = param_0;
|
||||
mTexData = ((u8*)mTexInfo) + mTexInfo->imageOffset;
|
||||
if (mTexInfo->imageOffset == 0) {
|
||||
mTexData = ((u8*)mTexInfo) + sizeof(ResTIMG);
|
||||
}
|
||||
if (getEmbPaletteDelFlag()) {
|
||||
delete mEmbPalette;
|
||||
}
|
||||
mEmbPalette = param_1;
|
||||
setEmbPaletteDelFlag(false);
|
||||
field_0x2c = NULL;
|
||||
if (param_1 != NULL) {
|
||||
mTlutName = param_2;
|
||||
if (param_2 != param_1->getTlutName()) {
|
||||
u8 format = param_1->getFormat();
|
||||
u8 transperancy = param_1->getTransparency();
|
||||
u16 numColors = param_1->getNumColors();
|
||||
ResTLUT* colorTable = param_1->getColorTable();
|
||||
param_1->storeTLUT(param_2, (_GXTlutFmt)format,
|
||||
(JUTTransparency)transperancy,
|
||||
numColors, colorTable);
|
||||
}
|
||||
}
|
||||
|
||||
mWrapS = mTexInfo->wrapS;
|
||||
mWrapT = mTexInfo->wrapT;
|
||||
mMinFilter = mTexInfo->minFilter;
|
||||
mMagFilter = mTexInfo->magFilter;
|
||||
mMinLOD = mTexInfo->minLOD;
|
||||
mMaxLOD = mTexInfo->maxLOD;
|
||||
mLODBias = mTexInfo->LODBias;
|
||||
init();
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 802DE5B0-802DE608 2D8EF0 0058+00 1/1 7/7 0/0 .text attachPalette__10JUTTextureFP10JUTPalette */
|
||||
void JUTTexture::attachPalette(JUTPalette* param_0) {
|
||||
@@ -159,58 +158,43 @@ void JUTTexture::init() {
|
||||
}
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80455FD8-80455FDC 0045D8 0004+00 2/2 0/0 0/0 .sdata2 @453 */
|
||||
SECTION_SDATA2 static f32 lit_453 = 0.125f;
|
||||
|
||||
/* 80455FDC-80455FE0 0045DC 0004+00 2/2 0/0 0/0 .sdata2 @454 */
|
||||
SECTION_SDATA2 static f32 lit_454 = 100.0f;
|
||||
|
||||
/* 80455FE0-80455FE8 0045E0 0008+00 2/2 0/0 0/0 .sdata2 @456 */
|
||||
SECTION_SDATA2 static f64 lit_456 = 4503599627370496.0 /* cast u32 to float */;
|
||||
|
||||
/* 80455FE8-80455FF0 0045E8 0008+00 2/2 0/0 0/0 .sdata2 @459 */
|
||||
SECTION_SDATA2 static f64 lit_459 = 4503601774854144.0 /* cast s32 to float */;
|
||||
|
||||
/* 802DE658-802DE744 2D8F98 00EC+00 2/2 0/0 0/0 .text initTexObj__10JUTTextureFv */
|
||||
#ifdef NONMATCHING
|
||||
void JUTTexture::initTexObj() {
|
||||
int offset;
|
||||
|
||||
if (mTexInfo->mipmapEnabled) {
|
||||
offset = mTexInfo->imageOffset;
|
||||
GXBool mipmapEnabled;
|
||||
if (mTexInfo->mipmapEnabled != 0) {
|
||||
mipmapEnabled = 1;
|
||||
} else {
|
||||
offset = 0x20;
|
||||
mipmapEnabled = 0;
|
||||
}
|
||||
|
||||
GXInitTexObj(&mTexObj, &mTexInfo + offset, mTexInfo->width, mTexInfo->height,
|
||||
(GXTexFmt)mTexInfo->format, (GXTexWrapMode)mTexInfo->wrapS,
|
||||
(GXTexWrapMode)mTexInfo->wrapT, mTexInfo->mipmapEnabled);
|
||||
GXInitTexObjLOD(&mTexObj, (GXTexFilter)mTexInfo->minFilter, (GXTexFilter)mTexInfo->magFilter,
|
||||
mTexInfo->minLOD, mTexInfo->maxLOD, mTexInfo->LODBias, mTexInfo->biasClamp,
|
||||
u8* image = ((u8*)mTexInfo);
|
||||
image += (mTexInfo->imageOffset ? mTexInfo->imageOffset : 0x20);
|
||||
GXInitTexObj(&mTexObj, image, mTexInfo->width, mTexInfo->height,
|
||||
(GXTexFmt)mTexInfo->format, (GXTexWrapMode)mWrapS,
|
||||
(GXTexWrapMode)mWrapT, mipmapEnabled);
|
||||
GXInitTexObjLOD(&mTexObj, (GXTexFilter)mMinFilter, (GXTexFilter)mMagFilter,
|
||||
mMinLOD / 8.0f, mMaxLOD / 8.0f, mLODBias / 100.0f, mTexInfo->biasClamp,
|
||||
mTexInfo->doEdgeLOD, (GXAnisotropy)mTexInfo->maxAnisotropy);
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void JUTTexture::initTexObj() {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JUtility/JUTTexture/initTexObj__10JUTTextureFv.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 802DE744-802DE840 2D9084 00FC+00 2/2 0/0 0/0 .text initTexObj__10JUTTextureF7_GXTlut
|
||||
*/
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void JUTTexture::initTexObj(_GXTlut param_0) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JUtility/JUTTexture/initTexObj__10JUTTextureF7_GXTlut.s"
|
||||
void JUTTexture::initTexObj(_GXTlut param_0) {
|
||||
GXBool mipmapEnabled;
|
||||
if (mTexInfo->mipmapEnabled != 0) {
|
||||
mipmapEnabled = 1;
|
||||
} else {
|
||||
mipmapEnabled = 0;
|
||||
}
|
||||
mTlutName = param_0;
|
||||
u8* image = ((u8*)mTexInfo);
|
||||
image += (mTexInfo->imageOffset ? mTexInfo->imageOffset : 0x20);
|
||||
GXInitTexObjCI(&mTexObj, image, mTexInfo->width, mTexInfo->height,
|
||||
(GXCITexFmt)mTexInfo->format, (GXTexWrapMode)mWrapS,
|
||||
(GXTexWrapMode)mWrapT, mipmapEnabled, param_0);
|
||||
GXInitTexObjLOD(&mTexObj, (GXTexFilter)mMinFilter, (GXTexFilter)mMagFilter,
|
||||
mMinLOD / 8.0f, mMaxLOD / 8.0f, mLODBias / 100.0f, mTexInfo->biasClamp,
|
||||
mTexInfo->doEdgeLOD, (GXAnisotropy)mTexInfo->maxAnisotropy);
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 802DE840-802DE890 2D9180 0050+00 0/0 14/14 0/0 .text load__10JUTTextureF11_GXTexMapID
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user