mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-14 05:34:38 -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 +1,113 @@
|
||||
// ok
|
||||
#include "f/f_pc/f_pc_stdcreate_req.h"
|
||||
#include "dolphin/types.h"
|
||||
// #include "f/f_pc/f_pc_load.h"
|
||||
#include "f/f_pc/f_pc_base.h"
|
||||
#include "f/f_pc/f_pc_node.h"
|
||||
|
||||
// f_pc_node::g_fpcNd_type
|
||||
extern s32 lbl_80450D40;
|
||||
// f_pc_stdcreate_req::submethod$2261
|
||||
extern create_request_method_class lbl_803A3AF0;
|
||||
// f_pc_stdcreate_req::method$2262
|
||||
extern cPhs__Handler lbl_803A3AFC[7];
|
||||
|
||||
extern "C" {
|
||||
|
||||
extern s32 fpcLd_Load(s16);
|
||||
extern s32 fpcLd_Free(s16);
|
||||
|
||||
s32 fpcSCtRq_phase_Load(standard_create_request_class* pStdCreateReq) {
|
||||
switch (fpcLd_Load(pStdCreateReq->mLoadID)) {
|
||||
case 0:
|
||||
return cPhs_ZERO_e;
|
||||
case 4:
|
||||
return 2;
|
||||
case 5:
|
||||
default:
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
}
|
||||
|
||||
s32 fpcSCtRq_phase_CreateProcess(standard_create_request_class* pStdCreateReq) {
|
||||
fpcLy_SetCurrentLayer(pStdCreateReq->mBase.mpLayer);
|
||||
pStdCreateReq->mBase.mpRes =
|
||||
fpcBs_Create(pStdCreateReq->mLoadID, pStdCreateReq->mBase.mBsPcId, pStdCreateReq->unk_0x54);
|
||||
if (pStdCreateReq->mBase.mpRes == NULL) {
|
||||
fpcLd_Free(pStdCreateReq->mLoadID);
|
||||
return cPhs_ERROR_e;
|
||||
} else {
|
||||
pStdCreateReq->mBase.mpRes->mpCtRq = (struct create_request*)pStdCreateReq;
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
s32 fpcSCtRq_phase_SubCreateProcess(standard_create_request_class* pStdCreateReq) {
|
||||
fpcLy_SetCurrentLayer(pStdCreateReq->mBase.mpLayer);
|
||||
return fpcBs_SubCreate(pStdCreateReq->mBase.mpRes);
|
||||
}
|
||||
|
||||
s32 fpcSCtRq_phase_IsComplete(standard_create_request_class* pStdCreateReq) {
|
||||
process_node_class* procNode = (process_node_class*)pStdCreateReq->mBase.mpRes;
|
||||
if (fpcBs_Is_JustOfType(lbl_80450D40, procNode->mBase.mSubType) == 1) {
|
||||
if (fpcLy_IsCreatingMesg(&procNode->mLayer) == 1) {
|
||||
return cPhs_ZERO_e;
|
||||
}
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
s32 fpcSCtRq_phase_PostMethod(standard_create_request_class* pStdCreateReq) {
|
||||
if (pStdCreateReq->unk_0x58 != NULL &&
|
||||
pStdCreateReq->unk_0x58(pStdCreateReq->mBase.mpRes, pStdCreateReq->unk_0x5C) == 0) {
|
||||
return cPhs_ZERO_e;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
s32 fpcSCtRq_phase_Done(standard_create_request_class* pStdCreateReq) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
s32 fpcSCtRq_Handler(standard_create_request_class* pStdCreateReq) {
|
||||
s32 result = cPhs_Do(&pStdCreateReq->unk_0x48, pStdCreateReq);
|
||||
switch (result) {
|
||||
case 2:
|
||||
return fpcSCtRq_Handler(pStdCreateReq);
|
||||
case 4:
|
||||
return 4;
|
||||
case 1:
|
||||
case 5:
|
||||
default:
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
s32 fpcSCtRq_Delete(standard_create_request_class* pStdCreateReq) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 fpcSCtRq_Cancel(standard_create_request_class* pStdCreateReq) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 fpcSCtRq_Request(layer_class* param_1, s16 param_2, stdCreateFunc param_3, void* param_4,
|
||||
void* param_5) {
|
||||
if (param_2 >= 0x7FFF) {
|
||||
return -1;
|
||||
} else {
|
||||
standard_create_request_class* request =
|
||||
(standard_create_request_class*)fpcCtRq_Create(param_1, 0x60, &lbl_803A3AF0);
|
||||
if (request == NULL) {
|
||||
return -1;
|
||||
} else {
|
||||
cPhs_Set(&request->unk_0x48, lbl_803A3AFC);
|
||||
request->mLoadID = param_2;
|
||||
request->unk_0x58 = param_3;
|
||||
request->unk_0x5C = param_4;
|
||||
request->unk_0x54 = param_5;
|
||||
return request->mBase.mBsPcId;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user