Created
January 15, 2024 11:07
-
-
Save RoadrunnerWMC/294b56f43ca3ed0c08d9310fa12fbe17 to your computer and use it in GitHub Desktop.
Jellybeam Spritetex (for Kamek 2.0)
This file contains hidden or 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
#include <kamek_asm.S> | |
.extern sprintf | |
.set sp, 1 | |
kmCallDef 0x80a2f238 | |
lwz r5, 4(r28) | |
srwi r5, r5, 24 | |
andi. r5, r5, 0xF | |
b GetTexFilenameForR5 | |
kmCallDef 0x80a2e9ec | |
lwz r5, -0x6a4(r24) | |
srwi r5, r5, 24 | |
andi. r5, r5, 0xF | |
b GetTexFilenameForR5 | |
GetTexFilenameForR5: | |
// obj number should be put into r5 | |
// returned filename is in r5 | |
// this makes it easy to use with dRes_c::GetResource | |
stwu sp, -0x20(sp) | |
mflr r0 | |
stw r0, 0x24(sp) | |
stw r3, 0x1C(sp) | |
stw r4, 0x18(sp) | |
stw r6, 0x14(sp) | |
stw r7, 0x10(sp) | |
stw r8, 0xC(sp) | |
stw r9, 0x8(sp) | |
lis r3, TexFilenameBuffer@h | |
ori r3, r3, TexFilenameBuffer@l | |
lis r4, TexFormatString@h | |
ori r4, r4, TexFormatString@l | |
crclr 4*cr1+eq | |
bl sprintf | |
lis r5, TexFilenameBuffer@h | |
ori r5, r5, TexFilenameBuffer@l | |
lwz r0, 0x24(sp) | |
lwz r3, 0x1C(sp) | |
lwz r4, 0x18(sp) | |
lwz r6, 0x14(sp) | |
lwz r7, 0x10(sp) | |
lwz r8, 0xC(sp) | |
lwz r9, 0x8(sp) | |
mtlr r0 | |
addi sp, sp, 0x20 | |
blr | |
TexFilenameBuffer: | |
.long 0,0,0,0 | |
TexFormatString: | |
.string "g3d/t%02d.brres" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nybble 6 controls which brres file will be loaded.
Here's a zip file containing a build (base64 -- GitHub won't let me attach it as an actual file).
Note: this only contains the code. You'll also need to edit
kurage.arc
in the same way as you would for other Newer spritetex mods (t00.brres
,t01.brres
, etc.).