Skip to content

Commit e3c0283

Browse files
committed
Align task.h with SA3
1 parent 0ec00c9 commit e3c0283

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

include/task.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ typedef void *IwramData;
3434
#define ENABLE_TASK_LOGGING !TRUE
3535
#else
3636
#define ENABLE_TASK_LOGGING TRUE
37-
#endif // !DEBUG
37+
#endif // !DEBUG && !TAS_TESTING
3838

3939
#define CLEAR_TASK_MEMORY_ON_DESTROY TRUE
4040
#endif // PLATFORM_GBA
@@ -48,24 +48,29 @@ typedef void *IwramData;
4848
#define TASK_x0004 0x0004
4949
#define TASK_USE_EWRAM 0x0010
5050

51+
#define USE_SA2_TASK_SYSTEM ((GAME < GAME_SA3) && !defined(NON_MATCHING))
52+
5153
struct Task {
5254
/* 0x00 */ TaskPtr parent;
5355
/* 0x02 */ TaskPtr prev;
5456
/* 0x04 */ TaskPtr next;
5557
/* 0x06 */ IwramData data;
5658
#if PORTABLE
5759
u32 dataSize;
58-
#endif
60+
#endif // PORTABLE
5961
/* 0x08 */ TaskMain main;
6062
/* 0x0C */ TaskDestructor dtor;
6163
/* 0x10 */ u16 priority; // priority?
6264
/* 0x12 */ u16 flags; // 0x1 = active
6365
// 0x2 = ???
6466
// 0x10 = use ewram for struct
67+
#if USE_SA2_TASK_SYSTEM
6568
/* 0x14 */ u8 unk14;
6669
/* 0x15 */ u8 unk15;
6770
/* 0x16 */ u16 unk16;
6871
/* 0x18 */ u16 unk18;
72+
#endif // USE_SA2_TASK_SYSTEM
73+
6974
#if ENABLE_TASK_LOGGING
7075
const char *name;
7176
#endif
@@ -79,7 +84,7 @@ struct IwramNode;
7984

8085
typedef struct IwramNode *IwramNodePtr;
8186
typedef IwramNodePtr IwramNodePtr32;
82-
#endif
87+
#endif // PLATFORM_GBA
8388

8489
#define IWRAM_PTR(ptr) TASK_PTR(ptr)
8590

@@ -123,10 +128,10 @@ struct Task *TaskCreate(TaskMain taskMain, u16 structSize, u16 priority, u16 fla
123128
})
124129
#else
125130
struct Task *TaskCreate(TaskMain taskMain, u16 structSize, u16 priority, u16 flags, TaskDestructor taskDestructor);
126-
#endif
131+
#endif // ENABLE_TASK_LOGGING
127132

128133
void TaskDestroy(struct Task *);
129134
void *IwramMalloc(u16);
130135
void TasksDestroyInPriorityRange(u16, u16);
131136

132-
#endif
137+
#endif // GUARD_TASK_H

0 commit comments

Comments
 (0)