| 1 | #ifndef SEAD_FRAMEWORK_H_ |
|---|---|
| 2 | #define SEAD_FRAMEWORK_H_ |
| 3 | |
| 4 | // #include <framework/seadMethodTreeMgr.h> |
| 5 | #include <framework/seadTaskBase.h> |
| 6 | // #include <framework/seadTaskMgr.h> |
| 7 | // #include <gfx/seadFrameBuffer.h> |
| 8 | // #include <heap/seadArena.h> |
| 9 | // #include <heap/seadHeap.h> |
| 10 | #include <hostio/seadHostIOMgr.h> |
| 11 | #include <prim/seadDelegateEventSlot.h> |
| 12 | #include <prim/seadRuntimeTypeInfo.h> |
| 13 | #include <time/seadTickSpan.h> |
| 14 | |
| 15 | namespace sead |
| 16 | { |
| 17 | class Arena; |
| 18 | |
| 19 | class FrameBuffer; |
| 20 | class Heap; |
| 21 | class LogicalFrameBuffer; |
| 22 | class MethodTreeMgr; |
| 23 | class TaskMgr; |
| 24 | |
| 25 | class Framework : public hostio::Node |
| 26 | { |
| 27 | SEAD_RTTI_BASE(Framework) |
| 28 | |
| 29 | public: |
| 30 | struct CreateSystemTaskArg |
| 31 | { |
| 32 | CreateSystemTaskArg(); |
| 33 | |
| 34 | HostIOMgr::Parameter* hostio_parameter; |
| 35 | Heap* heap; |
| 36 | TickSpan infloop_detection_span; |
| 37 | int infloop_unk; |
| 38 | }; |
| 39 | |
| 40 | struct InitializeArg |
| 41 | { |
| 42 | InitializeArg(); |
| 43 | |
| 44 | u32 heap_size; |
| 45 | Arena* arena; |
| 46 | }; |
| 47 | |
| 48 | struct RunArg |
| 49 | { |
| 50 | RunArg(); |
| 51 | |
| 52 | u32 prepare_stack_size; |
| 53 | s32 prepare_priority; |
| 54 | }; |
| 55 | |
| 56 | enum ProcessPriority |
| 57 | { |
| 58 | cProcessPriority_Idle = 0, |
| 59 | cProcessPriority_Normal = 1, |
| 60 | cProcessPriority_High = 2, |
| 61 | cProcessPriority_RealTime = 3 |
| 62 | }; |
| 63 | |
| 64 | public: |
| 65 | Framework(); |
| 66 | virtual ~Framework(); |
| 67 | |
| 68 | virtual void run(Heap*, const TaskBase::CreateArg&, const RunArg&); |
| 69 | virtual void createSystemTasks(TaskBase*, const CreateSystemTaskArg&); |
| 70 | virtual FrameBuffer* getMethodFrameBuffer(s32) const = 0; |
| 71 | virtual LogicalFrameBuffer* getMethodLogicalFrameBuffer(s32) const; |
| 72 | virtual bool setProcessPriority(ProcessPriority); |
| 73 | virtual void reserveReset(void*); |
| 74 | virtual void initRun_(Heap*); |
| 75 | virtual void quitRun_(Heap*); |
| 76 | virtual void runImpl_(); |
| 77 | virtual MethodTreeMgr* createMethodTreeMgr_(Heap*) = 0; |
| 78 | virtual void procReset_(); |
| 79 | |
| 80 | void initialize(const InitializeArg&); |
| 81 | |
| 82 | MethodTreeMgr* getMethodTreeMgr() const { return mMethodTreeMgr; } |
| 83 | |
| 84 | typedef DelegateEvent<void*> ResetEvent; |
| 85 | |
| 86 | bool mReserveReset; |
| 87 | void* mResetParameter; |
| 88 | ResetEvent mResetEvent; |
| 89 | TaskMgr* mTaskMgr; |
| 90 | MethodTreeMgr* mMethodTreeMgr; |
| 91 | Heap* mMethodTreeMgrHeap; |
| 92 | }; |
| 93 | |
| 94 | } // namespace sead |
| 95 | |
| 96 | #endif // SEAD_FRAMEWORK_H_ |
| 97 |