Files
sa2/include/animation_commands.h
T
JaceCearandOliver Bell ea91089217 Boss 8 (#145)
* Unify adding entries to GFX queue

* Match CreateSuperEggRoboZ

* Some screen shake doc

* Move Task_804AB24 into non-matching

* Match sub_804AD68

* Move sub_804AE40 into non-matching

* move sub_804B2EC into non-match

* Match sub_804B43C

* Add SWITCH_ARM_VARIANT macro

* Match sub_804B594

* Match sub_804B734

* Match sub_804B984

* Match sub_804BAC0

* Match sub_804C5B8

* Match sub_804C3AC

* Move sub_804C240 to non-matching

* Match sub_804C080

* Match sub_804BE6C

* Move sub_804BC44 into non-matching. Remove boss_8_2.c

* Match sub_8031138 by making the generated code less efficient. Yay.

* Do a pass on sub_8004E14 and move it into non-matching

* Merge sprite_2.c and sprite_3.c into sprite.c

* Match sub_8023B5C

* Progress on sub_804AE40 by Ollie

Co-authored-by: Oliver Bell <freshollie@gmail.com>

* Merge animation_commands.c into sprite.c

* gUnknown_03002794 -> gRefSpriteTables

* Replace UB_FIX -> BUG_FIX; General cleanup

* sub_8004518 -> Base10DigitsToHexNibbles

* Move animation_commands_bg.c into background.c

---------

Co-authored-by: Oliver Bell <freshollie@gmail.com>
2024-06-09 11:04:44 +02:00

123 lines
2.3 KiB
C

#ifndef GUARD_ANIMATION_COMMANDS_H
#define GUARD_ANIMATION_COMMANDS_H
#include "global.h"
#include "sprite.h"
#define AnimCommandSizeInWords(_structType) ((sizeof(_structType)) / sizeof(s32))
typedef AnimCmdResult (*AnimationCommandFunc)(void *cursor, Sprite *sprite);
typedef struct {
/* 0x00 */ s32 cmdId; // -2
// Note(Jace): This needs to be signed, since a
// negative value infers that it's using 8bit-colors
/* 0x04 */ s32 tileIndex;
/* 0x08 */ u32 numTilesToCopy;
} ACmd_GetTiles;
typedef struct {
/* 0x00 */ s32 cmdId; // -2
/* 0x04 */ s32 palId;
/* 0x06 */ u16 numColors;
/* 0x08 */ u16 insertOffset;
} ACmd_GetPalette;
typedef struct {
/* 0x00 */ s32 cmdId; // -3
/* 0x04 */ s32 offset;
} ACmd_JumpBack;
typedef struct {
/* 0x00 */ s32 cmdId; // -4
} ACmd_4;
typedef struct {
/* 0x00 */ s32 cmdId; // -5
/* 0x04 */ u16 songId;
} ACmd_PlaySoundEffect;
// TODO: param types unknown
typedef struct {
/* 0x00 */ s32 cmdId; // -6
/* 0x04 */ Hitbox hitbox;
} ACmd_Hitbox;
typedef struct {
/* 0x00 */ s32 cmdId; // -7
/* 0x04 */ u16 x;
/* 0x06 */ u16 y;
} ACmd_TranslateSprite;
typedef struct {
/* 0x00 */ s32 cmdId; // -8
/* 0x04 */ s32 unk4;
/* 0x08 */ s32 unk8;
} ACmd_8;
typedef struct {
/* 0x00 */ s32 cmdId; // -9
/* 0x04 */ AnimId animId;
/* 0x06 */ u16 variant;
} ACmd_SetIdAndVariant;
typedef struct {
/* 0x00 */ s32 cmdId; // -10
/* 0x04 */ s32 unk4;
/* 0x08 */ s32 unk8;
/* 0x0C */ s32 unkC;
} ACmd_10;
typedef struct {
/* 0x00 */ s32 cmdId; // -11
/* 0x04 */ s32 priority;
} ACmd_SetSpritePriority;
typedef struct {
/* 0x00 */ s32 cmdId; // -12
/* 0x04 */ s32 orderIndex;
} ACmd_SetOamOrder;
typedef struct {
// number of frames this will be displayed
s32 delay;
// frameId of this animation that should be displayed
s32 index;
} ACmd_ShowFrame;
typedef union {
s32 id;
ACmd_GetTiles tiles;
ACmd_GetPalette pal;
ACmd_JumpBack jump;
ACmd_4 end;
ACmd_PlaySoundEffect sfx;
ACmd_Hitbox _6;
ACmd_TranslateSprite translate;
ACmd_8 _8;
ACmd_SetIdAndVariant setAnimId;
ACmd_10 _10;
ACmd_SetSpritePriority _11;
ACmd_SetOamOrder setOamOrder;
ACmd_ShowFrame show;
} ACmd;
u32 Base10DigitsToHexNibbles(u16 num);
#endif // GUARD_ANIMATION_COMMANDS_H