From 7fb982e43e88f90d4a8bbee160f03a674abf86ae Mon Sep 17 00:00:00 2001 From: entriphy <1747088+entriphy@users.noreply.github.com> Date: Thu, 18 Jul 2024 02:51:57 -0700 Subject: [PATCH] take: Decompile t_func.c --- src/take/star.c | 5 +++++ src/take/star.h | 1 + src/take/t_func.c | 30 ++++++++++++++++++++++++++++++ src/take/t_func.h | 11 +++++++++++ 4 files changed, 47 insertions(+) create mode 100644 src/take/t_func.c create mode 100644 src/take/t_func.h diff --git a/src/take/star.c b/src/take/star.c index 515d257..4c26286 100644 --- a/src/take/star.c +++ b/src/take/star.c @@ -226,3 +226,8 @@ static void DrawStarSub(sceVu0IVECTOR *Xyz, s32 px, s32 py, s32 pw, s32 ph) { sceDmaSync(pDma.Gif, 0, 0); sceDmaSend(pDma.Gif, SPR_SRC(spr2)); } + +void EraseStar(OBJWORK *pObjw) { + pObjw->stat0 = 0; + freemem((void *)pObjw->reg0); +} diff --git a/src/take/star.h b/src/take/star.h index 0959862..920c830 100644 --- a/src/take/star.h +++ b/src/take/star.h @@ -21,5 +21,6 @@ typedef struct { extern OBJWORK* SetStar(SFXOBJ *pObj); extern OBJWORK* SetPopStar(SFXOBJ *pObj); +extern void EraseStar(OBJWORK *pObjw); #endif \ No newline at end of file diff --git a/src/take/t_func.c b/src/take/t_func.c new file mode 100644 index 0000000..a5c8bdd --- /dev/null +++ b/src/take/t_func.c @@ -0,0 +1,30 @@ +#include "take/t_func.h" + +// TODO: uncomment these +FUNCTBL MainFuncTbl[] = { + // { tkMenuFuncTbl, -1 }, + // { tkViewerFuncTbl, -1 }, + // { D_00395E10, -1 }, + // { tkTitleFuncTbl, -1 } +}; + +s32 (*tkFuncTbl[])() = { + tkInit, + tkMain +}; + +s32 tkInit() { + SysGbl.nsmode++; + // No return +} + +s32 tkMain() { + s32 (**subfunctbl)() = MainFuncTbl[SysGbl.fmode].func; + if (subfunctbl != NULL) { + subfunctbl[SysGbl.smode](); + } else { + SysGbl.fmode = 0; + SysGbl.smode = 0; + } + // No return +} \ No newline at end of file diff --git a/src/take/t_func.h b/src/take/t_func.h new file mode 100644 index 0000000..fa91708 --- /dev/null +++ b/src/take/t_func.h @@ -0,0 +1,11 @@ +#ifndef TK_FUNC_H +#define TK_FUNC_H + +#include "take.h" + +extern s32 (*tkFuncTbl[])(); + +extern s32 tkInit(); +extern s32 tkMain(); + +#endif \ No newline at end of file