Skip to content

Commit

Permalink
Add GX_InitTlutObjData
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Feb 26, 2024
1 parent ae64694 commit e70b5d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gc/ogc/gx.h
Original file line number Diff line number Diff line change
Expand Up @@ -4596,6 +4596,8 @@ void GX_PreloadEntireTexture(const GXTexObj *obj,const GXTexRegion *region);
*/
void GX_InitTlutObj(GXTlutObj *obj,void *lut,u8 fmt,u16 entries);

void GX_InitTlutObjData(GXTlutObj *obj,void *lut);

/*!
* \fn void GX_InitTlutRegion(GXTlutRegion *region,u32 tmem_addr,u8 tlut_sz)
* \brief Initializes a Texture Look-Up Table (TLUT) region object.
Expand Down
6 changes: 6 additions & 0 deletions libogc/gx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3491,6 +3491,12 @@ void GX_InitTlutObj(GXTlutObj *obj,void *lut,u8 fmt,u16 entries)
ptr->tlut_nentries = entries;
}

void GX_InitTlutObjData(GXTlutObj *obj,void *lut)
{
struct __gx_tlutobj *ptr = (struct __gx_tlutobj*)obj;
ptr->tlut_maddr = (ptr->tlut_maddr&~0x00ffffff)|(_SHIFTR(MEM_VIRTUAL_TO_PHYSICAL(lut),5,24));
}

void GX_GetTlutObjAll(const GXTlutObj *obj,void **lut,u8 *fmt,u16 *entries)
{
const struct __gx_tlutobj *ptr = (const struct __gx_tlutobj*)obj;
Expand Down

0 comments on commit e70b5d1

Please sign in to comment.