add FORMATION_ID macro

This commit is contained in:
Alex Bates 2020-10-20 07:49:40 +01:00
parent 8077a8f3cb
commit 056fbac32c
No known key found for this signature in database
GPG Key ID: 5E11C2DB78877706
3 changed files with 6 additions and 3 deletions

View File

@ -192,10 +192,10 @@ typedef struct Enemy {
typedef struct {
/* 0x00 */ s32 npcCount;
/* 0x04 */ StaticNpc* npcs;
/* 0x08 */ s32 battleID;
/* 0x08 */ FormationID formationID;
} NpcGroupList[]; // size = 0x0C
#define NPC_GROUP(npcs, battleID) { sizeof(npcs) / sizeof(StaticNpc), &npcs, battleID }
#define NPC_GROUP(npcs, formationID) { sizeof(npcs) / sizeof(StaticNpc), &npcs, formationID }
#define NPC_GROUP_LIST_END() { 0, 0, 0 }
Enemy* get_enemy(NpcId npcId);

View File

@ -10,4 +10,7 @@
#define UNK_FUN_PTR(name) void(*name)(void)
#define UNK_ARGS
typedef s32 FormationID;
#define FORMATION_ID(section, stage, index) (section << 16) + (stage << 8) + index
#endif

View File

@ -191,7 +191,7 @@ static StaticNpc goomba_npc = {
};
static NpcGroupList npc_groups = {
NPC_GROUP(goomba_npc, 0x00010003),
NPC_GROUP(goomba_npc, FORMATION_ID(1, 0, 3)),
NPC_GROUP_LIST_END(),
};