-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Match TexUtil.s up to regswap & stack frame size
Figuring out the precise set of inlines which will result in the correct stack size and register allocation will have to wait until we figure out more details about J3DModelData
- Loading branch information
Showing
4 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef RESTIMG_HPP | ||
#define RESTIMG_HPP | ||
|
||
#include <dolphin/types.h> | ||
|
||
struct ResTIMG | ||
{ | ||
char unk0[0xc]; | ||
u32 mPaletteOffset; | ||
char unk10[0xc]; | ||
u32 mImageDataOffset; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <JSystem/J3DModel.hpp> | ||
#include <JSystem/JUTNameTab.hpp> | ||
#include <dolphin/os.h> | ||
#include <functions.h> | ||
|
||
|
||
void SMS_ChangeTextureAll( | ||
J3DModelData *param_1, | ||
const char *param_2, | ||
const ResTIMG ¶m_3) | ||
|
||
{ | ||
char trash[0x18]; | ||
for (u16 i = 0; i < param_1->unkAC->unk0; i = i + 1) { | ||
if (strcmp((char*)param_2,(char*)param_1->unkA8->getName(i)) == 0) { | ||
J3DModelData::UnknownStruct* us = param_1->unkAC; | ||
us->unk4[i] = param_3; | ||
|
||
// TODO: these are most likely an inlined call, figure it out | ||
{ | ||
ResTIMG* ptr = us->unk4 + i; | ||
ptr->mImageDataOffset = ptr->mImageDataOffset + (u32)¶m_3 - (u32)ptr; | ||
} | ||
{ | ||
ResTIMG* ptr = us->unk4 + i; | ||
ptr->mPaletteOffset = ptr->mPaletteOffset + (u32)¶m_3 - (u32)ptr; | ||
} | ||
DCFlushRange(param_1->unkAC->unk4 + i, 0x20); | ||
} | ||
} | ||
} | ||
|