mirror of
https://github.com/zeldaret/tp
synced 2026-06-09 04:40:05 -04:00
A few f_pc files (#26)
* f_pc_base, one non matching * some of f_pc_manager * f_pc_node OK * f_pc_pause partly * started node_req * more progress * most of node req * delete unused asm * node req header and param names * param renaming * header for manager * review comment struct names * fpcM_Management OK * int -> s32 * merge master * most of f_pc_create_iter * f_pc_stdcreate_req OK * f_pc_fstcreate OK * f_pc_leaf OK * f_pc_draw OK * f_pc_deletor partly * fix parameter type in f_pc_pause * review * review, use cPh enum and fix process_profile_definition struct * convert f_pc files to C * matched more functions * fix global.h * fix variable types * format * mpre Phs enum * fix merge errors * fix gamepad stopPatternedRumble * format * delete leftover files from merge * move asm to correct folder * revert f_pc from C to CPP * remove C hacks and format * format * OK
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
|
||||
#include "f/f_pc/f_pc_create_req.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#include "SComponent/c_phase.h"
|
||||
#include "f/f_pc/f_pc_base.h"
|
||||
#include "f/f_pc/f_pc_create_iter.h"
|
||||
#include "f/f_pc/f_pc_create_req.h"
|
||||
#include "f/f_pc/f_pc_deletor.h"
|
||||
#include "f/f_pc/f_pc_executor.h"
|
||||
#include "f/f_pc/f_pc_layer.h"
|
||||
@@ -11,17 +11,17 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
bool fpcCtRq_isCreatingByID(create_tag* pTag, int* pId) {
|
||||
create_request* pReq = (create_request*)(pTag->mpTagData);
|
||||
return pReq->mBsPcId == *pId;
|
||||
BOOL fpcCtRq_isCreatingByID(create_tag* pTag, s32* pId) {
|
||||
create_request* pReq = (create_request*)(pTag->mBase.mpTagData);
|
||||
return checkEqual(*pId, pReq->mBsPcId);
|
||||
}
|
||||
|
||||
bool fpcCtRq_IsCreatingByID(unsigned int id) {
|
||||
return fpcCtIt_Judge((cNdIt_JudgeFunc)fpcCtRq_isCreatingByID, &id) != NULL;
|
||||
BOOL fpcCtRq_IsCreatingByID(u32 id) {
|
||||
return fpcCtIt_Judge((cNdIt_JudgeFunc)fpcCtRq_isCreatingByID, &id) != NULL ? 1 : 0;
|
||||
}
|
||||
|
||||
void fpcCtRq_CreateQTo(create_request* pReq) {
|
||||
fpcCtTg_CreateQTo(pReq);
|
||||
fpcCtTg_CreateQTo(&pReq->mBase.mBase);
|
||||
fpcLy_CreatedMesg(pReq->mpLayer);
|
||||
fpcLy_CancelQTo(&pReq->mMtdTg);
|
||||
}
|
||||
@@ -29,73 +29,64 @@ void fpcCtRq_CreateQTo(create_request* pReq) {
|
||||
void fpcCtRq_ToCreateQ(create_request* pReq) {
|
||||
fpcLy_CreatingMesg(pReq->mpLayer);
|
||||
fpcLy_ToCancelQ(pReq->mpLayer, &pReq->mMtdTg);
|
||||
fpcCtTg_ToCreateQ(pReq);
|
||||
fpcCtTg_ToCreateQ(&pReq->mBase.mBase);
|
||||
}
|
||||
|
||||
extern void cMl_NS_free(void* pPtr);
|
||||
|
||||
#if NON_MATCHING
|
||||
bool fpcCtRq_Delete(create_request* pReq) {
|
||||
BOOL fpcCtRq_Delete(create_request* pReq) {
|
||||
fpcCtRq_CreateQTo(pReq);
|
||||
if (pReq->mpCtRqMtd != NULL) {
|
||||
// flow control
|
||||
if (fpcMtd_Method(pReq->mpCtRqMtd->mpDelete, pReq) == 0)
|
||||
return 0;
|
||||
|
||||
if (pReq->mpRes)
|
||||
if (pReq->mpCtRqMtd != NULL && fpcMtd_Method(pReq->mpCtRqMtd->mpDelete, pReq) == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
if (pReq->mpRes) {
|
||||
pReq->mpRes->mpCtRq = NULL;
|
||||
}
|
||||
cMl_NS_free(pReq);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
asm bool fpcCtRq_Delete(create_request* pReq) {
|
||||
nofralloc
|
||||
#include "f/f_pc/f_pc_create_req/asm/func_80020BA0.s"
|
||||
}
|
||||
#endif
|
||||
|
||||
bool fpcCtRq_Cancel(create_request* pReq) {
|
||||
BOOL fpcCtRq_Cancel(create_request* pReq) {
|
||||
base_process_class* pProc;
|
||||
if (pReq != NULL && !pReq->mbIsCancelling) {
|
||||
pReq->mbIsCancelling = true;
|
||||
base_process_class* pProc = pReq->mpRes;
|
||||
pReq->mbIsCancelling = TRUE;
|
||||
pProc = pReq->mpRes;
|
||||
|
||||
if (pProc != NULL && !fpcDt_Delete(pProc))
|
||||
return false;
|
||||
return FALSE;
|
||||
|
||||
if (pReq->mpCtRqMtd != NULL && !fpcMtd_Method(pReq->mpCtRqMtd->mpCancel, pReq))
|
||||
return false;
|
||||
return FALSE;
|
||||
|
||||
return fpcCtRq_Delete(pReq);
|
||||
} else {
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
int fpcCtRq_IsDoing(create_request* pReq) {
|
||||
s32 fpcCtRq_IsDoing(create_request* pReq) {
|
||||
if (pReq != NULL)
|
||||
return pReq->mbIsCreating;
|
||||
else
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool fpcCtRq_Do(create_request* pReq) {
|
||||
int ret = cPhs_COMPLEATE_e;
|
||||
BOOL fpcCtRq_Do(create_request* pReq) {
|
||||
s32 ret = cPhs_COMPLEATE_e;
|
||||
|
||||
if (pReq->mpCtRqMtd != NULL) {
|
||||
cPhs__Handler pHandler = pReq->mpCtRqMtd->mpHandler;
|
||||
if (pHandler != NULL) {
|
||||
pReq->mbIsCreating = true;
|
||||
pReq->mbIsCreating = TRUE;
|
||||
ret = pHandler(pReq);
|
||||
pReq->mbIsCreating = false;
|
||||
pReq->mbIsCreating = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
switch (ret) {
|
||||
case cPhs_COMPLEATE_e: {
|
||||
int success = fpcEx_ToExecuteQ(pReq->mpRes);
|
||||
s32 success = fpcEx_ToExecuteQ(pReq->mpRes);
|
||||
if (success == 0)
|
||||
return fpcCtRq_Cancel(pReq);
|
||||
else
|
||||
@@ -113,24 +104,22 @@ void fpcCtRq_Handler(void) {
|
||||
fpcCtIt_Method((cNdIt_MethodFunc)fpcCtRq_Do, NULL);
|
||||
}
|
||||
|
||||
extern void* cMl_NS_memalignB(int, unsigned long);
|
||||
extern int fpcBs_MakeOfId(void);
|
||||
extern void* cMl_NS_memalignB(s32, u32);
|
||||
|
||||
create_request* fpcCtRq_Create(layer_class* pLayer, unsigned long size,
|
||||
create_request_method_class* pMthd) {
|
||||
create_request* fpcCtRq_Create(layer_class* pLayer, u32 size, create_request_method_class* pMthd) {
|
||||
create_request* pReq = (create_request*)cMl_NS_memalignB(-4, size);
|
||||
|
||||
if (pReq != NULL) {
|
||||
fpcCtTg_Init(pReq, pReq);
|
||||
fpcCtTg_Init(&pReq->mBase, pReq);
|
||||
fpcMtdTg_Init(&pReq->mMtdTg, (process_method_tag_func)fpcCtRq_Cancel, pReq);
|
||||
pReq->mpLayer = pLayer;
|
||||
pReq->mpCtRqMtd = pMthd;
|
||||
pReq->mBsPcId = fpcBs_MakeOfId();
|
||||
pReq->mpRes = NULL;
|
||||
pReq->mbIsCancelling = false;
|
||||
pReq->mbIsCancelling = FALSE;
|
||||
fpcCtRq_ToCreateQ(pReq);
|
||||
}
|
||||
|
||||
return pReq;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user