Files
PodeCaradox--GalaxyFrame/decomp/include/Game/System/FunctionAsyncExecutor.hpp
T
bigmak94andClaude Opus 5.5 4b395efe5c Add the Petari decompilation (SMGCommunity/Petari@0a5c660)
The sources of Petari (https://github.com/SMGCommunity/Petari), the
Super Mario Galaxy decompilation by the SMGCommunity, at commit
0a5c6608dc3b4c44a9aa68c2535d1793dc565f02, unchanged but for LF line
endings: LICENSE (as LICENSE-Petari.txt; CC0 1.0), include/, libs/ and
src/.  Left out: the game data Petari keeps from the original
executable, the error message archive (include/Game/System/
ErrorArchive.hpp) and two tables (src/Game/System/GalaxyID.bcsv and
StoryEvent.bcsv); GalaxyQuest's converter takes them from the player's
own disc.  The port's changes follow in the next commit, so
`git diff petari-base -- decomp` shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 01:59:38 +02:00

75 lines
1.9 KiB
C++

#pragma once
#include "Game/System/OSThreadWrapper.hpp"
#include "Game/Util/Array.hpp"
#include "Game/Util/StringUtil.hpp"
class JKRExpHeap;
class JKRUnitHeap;
namespace MR {
class FunctorBase;
}; // namespace MR
class FunctionAsyncExecInfo {
public:
FunctionAsyncExecInfo(MR::FunctorBase*, int, const char*);
~FunctionAsyncExecInfo();
void execute();
bool isSame(const char* pStr) {
return MR::strcasecmp(mName, pStr) == 0;
}
/* 0x00 */ MR::FunctorBase* mFunc;
/* 0x04 */ int mPriority;
/* 0x08 */ const char* mName;
/* 0x0C */ volatile bool mIsEnd;
/* 0x10 */ OSMessageQueue mQueue;
/* 0x30 */ OSMessage mMessage;
};
class FunctionAsyncExecutorThread : public OSThreadWrapper {
public:
FunctionAsyncExecutorThread(JKRHeap*);
virtual void* run();
/* 0x3C */ bool mIsSuspended;
/* 0x40 */ const char* mName;
};
class FunctionAsyncExecutorOnMainThread {
public:
FunctionAsyncExecutorOnMainThread(OSThread*);
void update();
/* 0x000 */ bool _0;
/* 0x004 */ OSMessageQueue mQueue;
/* 0x024 */ OSMessage mMsgArray[64];
/* 0x124 */ OSThread* mThread;
};
class FunctionAsyncExecutor {
public:
FunctionAsyncExecutor();
void update();
void start(const MR::FunctorBase&, int, const char*);
bool startOnMainThread(const MR::FunctorBase&, const char*);
void waitForEnd(const char*);
bool isEnd(const char*) const;
OSThread* getOSThread(const char*);
FunctionAsyncExecInfo* createAndAddExecInfo(const MR::FunctorBase&, int, const char*);
FunctionAsyncExecutorThread* getSuspendThread();
/* 0x000 */ FunctionAsyncExecutorThread* mThreads[2];
/* 0x008 */ FunctionAsyncExecutorOnMainThread* mMainThreadExec;
/* 0x00C */ MR::Vector< MR::FixedArray< FunctionAsyncExecInfo*, 256 > > mHolders;
/* 0x410 */ JKRUnitHeap* _410;
/* 0x414 */ JKRExpHeap* _414;
};