summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/pso/TMainTask.h9
-rw-r--r--src/pso/TMainTask.cpp17
-rw-r--r--src/pso/TObject.cpp9
3 files changed, 33 insertions, 2 deletions
diff --git a/include/pso/TMainTask.h b/include/pso/TMainTask.h
index 1786c71..373a982 100644
--- a/include/pso/TMainTask.h
+++ b/include/pso/TMainTask.h
@@ -19,6 +19,14 @@
old_flags = flags; \
}
+#define o(var, name) extern const char *var##_name;
+TL_OBJECTS
+#undef o
+
+#define o(var, name) extern TObject *var;
+TL_OBJECTS
+#undef o
+
class TMainTask : public TObject {
public:
u32 task_flags;
@@ -33,6 +41,7 @@ public:
void func_80228924();
void func_802289d0();
+ void init_main_task();
virtual ~TMainTask();
virtual void run_task();
virtual void func_0x10();
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) {