To create an obj, regardless of whether it is animated or not,
it's used a routine whose offset on ruby is 0x08000BDC (I don't work on red fire ...).
Before you can invoke this routine, you need to initialize the registers:
- R0: sprite template
- R1: x coord
- R2: y coord
- R3: subpriority
The structure of the sprites template is as follows (taken from the disassembled projects):
struct SpriteTemplate
{
u16 tileTag;
u16 paletteTag;
const struct OamData *oam;
const union AnimCmd *const *anims;
const struct SpriteFrameImage *images;
const union AffineAnimCmd *const *affineAnims;
void (*callback)(struct Sprite *);
};
To make an oam animated you will need to define the *anims offset, which must contain a table containing comands (the frames that alternate).
In a single message it is difficult to explain everything, so i recommend reading this guide:
https://gamer2020.net/?p=369
The guide was written for disassembly projects, but is also applicable to hack roms.
it's used a routine whose offset on ruby is 0x08000BDC (I don't work on red fire ...).
Before you can invoke this routine, you need to initialize the registers:
- R0: sprite template
- R1: x coord
- R2: y coord
- R3: subpriority
The structure of the sprites template is as follows (taken from the disassembled projects):
struct SpriteTemplate
{
u16 tileTag;
u16 paletteTag;
const struct OamData *oam;
const union AnimCmd *const *anims;
const struct SpriteFrameImage *images;
const union AffineAnimCmd *const *affineAnims;
void (*callback)(struct Sprite *);
};
To make an oam animated you will need to define the *anims offset, which must contain a table containing comands (the frames that alternate).
In a single message it is difficult to explain everything, so i recommend reading this guide:
https://gamer2020.net/?p=369
The guide was written for disassembly projects, but is also applicable to hack roms.