diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-03 13:39:15 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-03 13:39:15 -0400 |
commit | a68704403ab88657d4abaad25f673bf40267931a (patch) | |
tree | c4cd8708ed841a112a8a643c78842c5eb3ab2bd9 | |
parent | 06623f2b33fc9975e52d431eaa45526899ff1b3c (diff) |
TObject, TMainTask: Make object names extern, and declare them in
`TObject.cpp`
This is to make it match the order in the original binary.
-rw-r--r-- | include/pso/TMainTask.h | 2 | ||||
-rw-r--r-- | include/pso/TObject.h | 5 | ||||
-rw-r--r-- | include/pso/macros.h | 5 | ||||
-rw-r--r-- | src/pso/TObject.cpp | 3 |
4 files changed, 10 insertions, 5 deletions
diff --git a/include/pso/TMainTask.h b/include/pso/TMainTask.h index b719e94..6a4944d 100644 --- a/include/pso/TMainTask.h +++ b/include/pso/TMainTask.h @@ -5,8 +5,6 @@ #include "pso/macros.h" #include "pso/TObject.h" -OBJECT_NAME(TMainTask) - class TMainTask : public TObject { public: u32 task_flags; diff --git a/include/pso/TObject.h b/include/pso/TObject.h index bf23b56..1594d33 100644 --- a/include/pso/TObject.h +++ b/include/pso/TObject.h @@ -5,8 +5,9 @@ #include "pso/macros.h" #include <global_types.h> - -OBJECT_NAME(TObject) +#define o(name) extern const char *name##_name; +OBJECT_NAMES +#undef o extern TMainTask main_task; extern TObject global_obj1; diff --git a/include/pso/macros.h b/include/pso/macros.h index 1a75d53..b98028f 100644 --- a/include/pso/macros.h +++ b/include/pso/macros.h @@ -1,7 +1,10 @@ #ifndef MACROS_H #define MACROS_H -#define OBJECT_NAME(name) static const char *name##_name = #name; +#define OBJECT_NAME(name) const char *name##_name = #name; +#define OBJECT_NAMES \ + o(TObject) \ + o(TMainTask) #define FOREACH_NODE(type, first, varname) for (type *varname = (type *)(first); varname != NULL; varname = (type *)(varname->next)) #define FOREACH_NODE_NODECL(type, first, varname) for (varname = (type *)(first); varname != NULL; varname = (type *)(varname->next)) diff --git a/src/pso/TObject.cpp b/src/pso/TObject.cpp index eff743b..4a57d0b 100644 --- a/src/pso/TObject.cpp +++ b/src/pso/TObject.cpp @@ -6,6 +6,9 @@ TMainTask main_task; TObject global_obj1; TObject global_obj2; +OBJECT_NAME(TObject) +OBJECT_NAME(TMainTask) + void debug_print(const char *fmt) { } |