summaryrefslogtreecommitdiff
path: root/src/f_pc/f_pc_executor.cpp
blob: 5729114bd1aeea2deb00c62c813fc3e03edcdba6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//
// Generated by dtk
// Translation Unit: f_pc_executor.cpp
//

#include "f_pc/f_pc_executor.h"
#include "f_pc/f_pc_node.h"
#include "f_pc/f_pc_pause.h"
#include "f_pc/f_pc_searcher.h"

/* 8003D5B0-8003D5D0       .text fpcEx_Search__FPFPvPv_PvPv */
base_process_class* fpcEx_Search(fpcLyIt_JudgeFunc i_judgeFunc, void* i_data) {
    return (base_process_class*)fpcLyIt_AllJudge(i_judgeFunc, i_data);
}

/* 8003D5D0-8003D614       .text fpcEx_SearchByID__FUi */
base_process_class* fpcEx_SearchByID(fpc_ProcID i_id) {
    if (i_id + 2 <= 1)
        return NULL;

    return fpcEx_Search(fpcSch_JudgeByID, &i_id);
}

/* 8003D614-8003D63C       .text fpcEx_IsExist__FUi */
BOOL fpcEx_IsExist(fpc_ProcID i_id) {
    return fpcEx_SearchByID(i_id) != NULL ? TRUE : FALSE;
}

/* 8003D63C-8003D690       .text fpcEx_Execute__FP18base_process_class */
BOOL fpcEx_Execute(base_process_class* i_proc) {
    if (i_proc->mInitState != 2 || fpcPause_IsEnable(i_proc, 1) == 1)
        return FALSE;
    return fpcBs_Execute(i_proc);
}

/* 8003D690-8003D73C       .text fpcEx_ToLineQ__FP18base_process_class */
s32 fpcEx_ToLineQ(base_process_class* i_proc) {
    layer_class* pLayer = i_proc->mLyTg.mpLayer;
    base_process_class* pLayerPcNode = &pLayer->mpPcNode->base;

    if (pLayer->mLayerID == 0 || cTg_IsUse(&pLayerPcNode->mLnTg.base) == TRUE) {
        u16 listID = i_proc->mPi.mInfoCurr.mListID;
        s32 ret = fpcLnTg_ToQueue(&i_proc->mLnTg, listID);
        if (ret == 0) {
            fpcLyTg_QueueTo(&i_proc->mLyTg);
            return 0;
        }

        i_proc->mInitState = 2;
        if (fpcBs_Is_JustOfType(g_fpcNd_type, i_proc->mSubType)) {
            process_node_class* pNode = (process_node_class*)i_proc;
            fpcLyIt_OnlyHere(&pNode->mLayer, (fpcLyIt_OnlyHereFunc)fpcEx_ToLineQ, pNode);
        }

        return 1;
    }

    return 0;
}

/* 8003D73C-8003D788       .text fpcEx_ExecuteQTo__FP18base_process_class */
BOOL fpcEx_ExecuteQTo(base_process_class* i_proc) {
    BOOL ret = fpcLyTg_QueueTo(&i_proc->mLyTg);
    if (ret == TRUE) {
        i_proc->mInitState = 3;
        return TRUE;
    } else {
        return FALSE;
    }
}

/* 8003D788-8003D7E0       .text fpcEx_ToExecuteQ__FP18base_process_class */
BOOL fpcEx_ToExecuteQ(base_process_class* i_proc) {
    BOOL ret = fpcLyTg_ToQueue(&i_proc->mLyTg, i_proc->mPi.mInfoCurr.mLayer,
                              i_proc->mPi.mInfoCurr.mListID, i_proc->mPi.mInfoCurr.mListPrio);
    if (ret == TRUE) {
        fpcEx_ToLineQ(i_proc);
        return TRUE;
    } else {
        return FALSE;
    }
}

/* 8003D7E0-8003D800       .text fpcEx_Handler__FPFPvPv_i */
void fpcEx_Handler(fpcLnIt_QueueFunc i_queueFunc) {
    fpcLnIt_Queue(i_queueFunc);
}