mirror of
https://github.com/zeldaret/tp
synced 2026-07-09 14:55:32 -04:00
committed by
GitHub
parent
b8bd1bbab1
commit
4e622b873f
@@ -47,7 +47,7 @@ int fpcEx_ToLineQ(base_process_class *pProc)
|
||||
base_process_class *pLayerPcNode = pLayer->mpPcNode;
|
||||
|
||||
if (pLayer->mLayerID == 0 || cTg_IsUse(&pLayerPcNode->mLnTg) == true) {
|
||||
int ret = fpcLnTg_ToQueue(&pProc->mLnTg, pProc->mPi.b.mListID);
|
||||
int ret = fpcLnTg_ToQueue(&pProc->mLnTg, pProc->mPi.mInfoCurr.mListID);
|
||||
if (ret == 0) {
|
||||
fpcLyTg_QueueTo(&pProc->mLyTg);
|
||||
return 0;
|
||||
@@ -78,7 +78,7 @@ int fpcEx_ExecuteQTo(base_process_class *pProc)
|
||||
|
||||
int fpcEx_ToExecuteQ(base_process_class *pProc)
|
||||
{
|
||||
int ret = fpcLyTg_ToQueue(&pProc->mLyTg, pProc->mPi.b.mLayer, pProc->mPi.b.mListID, pProc->mPi.b.mListPrio);
|
||||
int ret = fpcLyTg_ToQueue(&pProc->mLyTg, pProc->mPi.mInfoCurr.mLayer, pProc->mPi.mInfoCurr.mListID, pProc->mPi.mInfoCurr.mListPrio);
|
||||
if (ret == 1) {
|
||||
fpcEx_ToLineQ(pProc);
|
||||
return 1;
|
||||
|
||||
@@ -22,8 +22,8 @@ void fpcLy_CancelQTo(process_method_tag_class *pMthd) {
|
||||
fpcMtdTg_MethodQTo(pMthd);
|
||||
}
|
||||
|
||||
void fpcLy_ToCancelQ(layer_class *pLayer, process_method_tag_class *pMthd) {
|
||||
fpcMtdTg_ToMethodQ(&pLayer->mCancelList, pMthd);
|
||||
int fpcLy_ToCancelQ(layer_class *pLayer, process_method_tag_class *pMthd) {
|
||||
return fpcMtdTg_ToMethodQ(&pLayer->mCancelList, pMthd);
|
||||
}
|
||||
|
||||
bool fpcLy_CancelMethod(process_method_tag_class *pLayer) {
|
||||
|
||||
@@ -11,9 +11,9 @@ int fpcMtdTg_Do(process_method_tag_class *pMthd)
|
||||
return pMthd->mpFunc(pMthd->mpMthdData);
|
||||
}
|
||||
|
||||
void fpcMtdTg_ToMethodQ(node_list_class *pList, process_method_tag_class *pMthd)
|
||||
int fpcMtdTg_ToMethodQ(node_list_class *pList, process_method_tag_class *pMthd)
|
||||
{
|
||||
cTg_Addition(pList, pMthd);
|
||||
return cTg_Addition(pList, pMthd);
|
||||
}
|
||||
|
||||
void fpcMtdTg_MethodQTo(process_method_tag_class *pMthd)
|
||||
|
||||
@@ -1 +1,68 @@
|
||||
// ok
|
||||
|
||||
#include "f/f_pc/f_pc_pause.h"
|
||||
#include "f/f_pc/f_pc_base.h"
|
||||
#include "f/f_pc/f_pc_layer_iter.h"
|
||||
#include "f/f_pc/f_pc_node.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
// f_pc_node::g_fpcNd_type
|
||||
extern int lbl_80450D40;
|
||||
|
||||
#if NON_MATCHING
|
||||
bool fpcPause_IsEnable(void *pProcess, u8 flag)
|
||||
{
|
||||
base_process_class *pProc = (base_process_class *) pProcess;
|
||||
// extra addic/subfe?
|
||||
return (pProc->mPauseFlag & flag) == flag;
|
||||
}
|
||||
#else
|
||||
asm bool fpcPause_IsEnable(void *pProcess, u8 flag)
|
||||
{
|
||||
nofralloc
|
||||
/* 80023844 00020784 54 84 06 3E */ clrlwi r4, r4, 0x18
|
||||
/* 80023848 00020788 88 03 00 0B */ lbz r0, 0xb(r3)
|
||||
/* 8002384C 0002078C 7C 80 00 38 */ and r0, r4, r0
|
||||
/* 80023850 00020790 7C 64 00 50 */ subf r3, r4, r0
|
||||
/* 80023854 00020794 30 03 FF FF */ addic r0, r3, -1
|
||||
/* 80023858 00020798 7C 00 19 10 */ subfe r0, r0, r3
|
||||
/* 8002385C 0002079C 7C 00 00 34 */ cntlzw r0, r0
|
||||
/* 80023860 000207A0 54 03 D9 7E */ srwi r3, r0, 5
|
||||
/* 80023864 000207A4 4E 80 00 20 */ blr
|
||||
}
|
||||
#endif
|
||||
|
||||
int fpcPause_Enable(void *pProcess, u8 flag)
|
||||
{
|
||||
base_process_class *pProc = (base_process_class *) pProcess;
|
||||
pProc->mPauseFlag |= flag;
|
||||
|
||||
if (fpcBs_Is_JustOfType(lbl_80450D40, pProc->mSubType)) {
|
||||
process_node_class *pNode = (process_node_class *) pProc;
|
||||
fpcLyIt_OnlyHere(&pNode->mLayer, (cNdIt_MethodFunc)fpcPause_Enable, (void*) (flag & 0xFF));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
// According to symbols, they used u8 instead of u32, but I can't get a match with u8 here. This is the best I got...
|
||||
int fpcPause_Disable(void *pProcess, u32 flag)
|
||||
{
|
||||
base_process_class *pProc = (base_process_class *) pProcess;
|
||||
pProc->mPauseFlag &= (0xFF - flag) & 0xFF;
|
||||
|
||||
if (fpcBs_Is_JustOfType(lbl_80450D40, pProc->mSubType)) {
|
||||
process_node_class *pNode = (process_node_class *) pProc;
|
||||
fpcLyIt_OnlyHere(&pNode->mLayer, (cNdIt_MethodFunc)fpcPause_Disable, (void*) (flag & 0xFF));
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void fpcPause_Init(void *pProcess)
|
||||
{
|
||||
base_process_class *pProc = (base_process_class *) pProcess;
|
||||
pProc->mPauseFlag = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1 +1,147 @@
|
||||
// ok
|
||||
|
||||
#include "f/f_pc/f_pc_priority.h"
|
||||
#include "f/f_pc/f_pc_layer.h"
|
||||
#include "f/f_pc/f_pc_layer_tag.h"
|
||||
#include "f/f_pc/f_pc_base.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
// f_pc_priority::crear$2186
|
||||
extern process_priority_queue_info lbl_804505E8;
|
||||
|
||||
// f_pc_priority::l_fpcPi_Queue
|
||||
extern node_list_class lbl_803F4E58;
|
||||
|
||||
int fpcPi_IsInQueue(process_priority_class *pPi)
|
||||
{
|
||||
return cTg_IsUse(pPi);
|
||||
}
|
||||
|
||||
int fpcPi_QueueTo(process_priority_class *pPi)
|
||||
{
|
||||
cTg_SingleCut(pPi);
|
||||
fpcLy_CancelQTo(&pPi->mMtdTag);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int fpcPi_ToQueue(process_priority_class *pPi)
|
||||
{
|
||||
u32 layer = pPi->mInfoQ.mLayer;
|
||||
|
||||
if (cTg_Addition(&lbl_803F4E58, pPi)) {
|
||||
if (layer != 0xFFFFFFFD) {
|
||||
layer_class *pLayer = fpcLy_Layer(layer);
|
||||
|
||||
if (!fpcLy_ToCancelQ(pLayer, &pPi->mMtdTag)) {
|
||||
cTg_SingleCut(pPi);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
process_priority_class * fpcPi_GetFromQueue(void)
|
||||
{
|
||||
process_priority_class *pPi = (process_priority_class *) cTg_GetFirst(&lbl_803F4E58);
|
||||
|
||||
if (pPi != NULL) {
|
||||
base_process_class *pProc = (base_process_class *) pPi->mpTagData;
|
||||
process_priority_class *pProcPi = &pProc->mPi;
|
||||
fpcLy_CancelQTo(&pProcPi->mMtdTag);
|
||||
return pProcPi;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int fpcPi_Delete(process_priority_class *pPi)
|
||||
{
|
||||
fpcPi_QueueTo(pPi);
|
||||
pPi->mInfoQ = lbl_804505E8;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int fpcPi_IsNormal(unsigned int layer, unsigned short listID, unsigned short priority)
|
||||
{
|
||||
if ((layer < 0xFFFFFFFE) && (listID < 0xFFFE) && (priority < 0xFFFE))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fpcPi_Change(process_priority_class *pPi, unsigned int layer, unsigned short listID, unsigned short priority)
|
||||
{
|
||||
base_process_class *pProc = (base_process_class *) pPi->mpTagData;
|
||||
int changed = 0;
|
||||
|
||||
if (pProc->mInitState == 3)
|
||||
return 0;
|
||||
|
||||
if (!fpcPi_IsNormal(layer, listID, priority))
|
||||
return 0;
|
||||
|
||||
pPi->mInfoQ = pPi->mInfoCurr;
|
||||
|
||||
if (layer != 0xFFFFFFFD && pPi->mInfoCurr.mLayer != layer) {
|
||||
pPi->mInfoQ.mLayer = layer;
|
||||
changed = 1;
|
||||
}
|
||||
|
||||
if (listID != 0xFFFD && pPi->mInfoCurr.mListID != listID) {
|
||||
pPi->mInfoQ.mListID = listID;
|
||||
changed = 1;
|
||||
}
|
||||
|
||||
if (priority != 0xFFFD && pPi->mInfoCurr.mListPrio != priority) {
|
||||
pPi->mInfoQ.mListPrio = priority;
|
||||
changed = 1;
|
||||
}
|
||||
|
||||
if (pProc->mInitState == 0 || pProc->mInitState == 1) {
|
||||
pPi->mInfoCurr = pPi->mInfoQ;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (changed == 1)
|
||||
return fpcPi_ToQueue(pPi);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fpcPi_Handler(void)
|
||||
{
|
||||
while (process_priority_class *pPi = fpcPi_GetFromQueue()) {
|
||||
base_process_class *pProc = (base_process_class *) pPi->mpTagData;
|
||||
layer_management_tag_class *pLayerTag = &pProc->mLyTg;
|
||||
line_tag *pLineTag = &pProc->mLnTg;
|
||||
if (fpcLyTg_Move(pLayerTag, pPi->mInfoQ.mLayer, pPi->mInfoQ.mListID, pPi->mInfoQ.mListPrio) == 1) {
|
||||
fpcLnTg_Move(pLineTag, pPi->mInfoCurr.mListID);
|
||||
pPi->mInfoCurr = pPi->mInfoQ;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int fpcPi_Init(process_priority_class *pPi, void *pUserData, unsigned int layer, unsigned short listID, unsigned short priority)
|
||||
{
|
||||
if (!fpcPi_IsNormal(layer, listID, priority))
|
||||
return 0;
|
||||
|
||||
pPi->mInfoQ.mLayer = layer;
|
||||
pPi->mInfoQ.mListID = listID;
|
||||
pPi->mInfoQ.mListPrio = priority;
|
||||
pPi->mInfoCurr = pPi->mInfoQ;
|
||||
cTg_Create(pPi, pUserData);
|
||||
fpcMtdTg_Init(&pPi->mMtdTag, (process_method_tag_func) fpcPi_Delete, pPi);
|
||||
return 1;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user