diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-05 16:08:45 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-05 16:08:45 -0400 |
commit | 7e037462eda6221047eefd2195539302d3b40083 (patch) | |
tree | e8c79e49485c83002a52c3fc464a8c4c66de44ad /src | |
parent | 7dfa8bbfaf995bcf1c8561a90099db5103feaa33 (diff) |
TMainTask: Add, and match `init_main_task()`
Diffstat (limited to 'src')
-rw-r--r-- | src/pso/TMainTask.cpp | 17 | ||||
-rw-r--r-- | src/pso/TObject.cpp | 9 |
2 files changed, 24 insertions, 2 deletions
diff --git a/src/pso/TMainTask.cpp b/src/pso/TMainTask.cpp index 9403ed4..6a8c2bd 100644 --- a/src/pso/TMainTask.cpp +++ b/src/pso/TMainTask.cpp @@ -1,6 +1,13 @@ +#include "pso/THeap.h" #include "pso/TMainTask.h" #include "pso/TObject.h" +static const int tl_object_count = 20; + +#define o(var, name) TObject *var; +TL_OBJECTS +#undef o + u32 some_main_task_flag = 1; u32 main_task_flags; u32 old_main_task_flags; @@ -45,6 +52,16 @@ TMainTask::~TMainTask() { this->delete_children(); } +void TMainTask::init_main_task() { + obj_heap = new THeap(0x7a000, 16); + alt_heap = new THeap(0x17000, 16); + #define o(var, dummy) \ + var = new TObject(this); \ + var->name = var##_name; + TL_OBJECTS + #undef o +} + TMainTask::TMainTask() : TObject(NULL) { name = TMainTask_name; task_flags = 0; diff --git a/src/pso/TObject.cpp b/src/pso/TObject.cpp index 4a57d0b..976214d 100644 --- a/src/pso/TObject.cpp +++ b/src/pso/TObject.cpp @@ -6,8 +6,13 @@ TMainTask main_task; TObject global_obj1; TObject global_obj2; -OBJECT_NAME(TObject) -OBJECT_NAME(TMainTask) +#define o(name) OBJECT_NAME(name) +OBJECT_NAMES +#undef o + +#define o(var, name) const char *var##_name = #name; +TL_OBJECTS +#undef o void debug_print(const char *fmt) { |