Skip to content

Commit

Permalink
take: Decompile t_func.c
Browse files Browse the repository at this point in the history
  • Loading branch information
entriphy committed Jul 18, 2024
1 parent 5d69639 commit 7fb982e
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/take/star.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
1 change: 1 addition & 0 deletions src/take/star.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ typedef struct {

extern OBJWORK* SetStar(SFXOBJ *pObj);
extern OBJWORK* SetPopStar(SFXOBJ *pObj);
extern void EraseStar(OBJWORK *pObjw);

#endif
30 changes: 30 additions & 0 deletions src/take/t_func.c
Original file line number Diff line number Diff line change
@@ -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
}
11 changes: 11 additions & 0 deletions src/take/t_func.h
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7fb982e

Please sign in to comment.