• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[ASM & Hex] Extracting Map Tile Animations

  • 26
    Posts
    9
    Years
    • Seen Jun 2, 2021
    Hello,

    I'm trying to extract the tile animations relative to a tileset in emerald.
    I have the animation pointer in each tileset header, but I cannot find any information about the contained data/structure and how to parse it.
    I want to create a little tool for this, sadly LU-HO's animation editor isn't open source.

    Thanks for your time!
     
    Last edited:
    Hello,

    I'm trying to extract the tile animations relative to a tileset in emerald.
    I have the animation pointer in each tileset header, but I cannot find any information about the contained data/structure and how to parse it.
    I want to create a little tool for this, sadly LU-HO's animation editor isn't open source.

    Thanks for your time!

    The animation format isn't data, it's actually a pointer to a function which is run every frame. This function edits the tile data directly in VRAM to animate the block. Lu-Ho's animation editor edits this routine to allow custom block animations, so you could disassemble the function that the editor inserts to get an idea of how this is done.
     
    Thanks, this was very helpful.

    sub_8073070 looks interesting, what is going on with the (u8 *)(BG_VRAM + 0x3f80)? How to convert that offset to an actual tileset tile position?
     
    Last edited:
    Thanks, this was very helpful.

    sub_8073070 looks interesting, what is going on with the (u8 *)(BG_VRAM + 0x3f80)? How to convert that offset to an actual tileset tile position?

    The game copies directly to the VRAM to do the animation. In the overworld, almost all of the background VRAM is used for the tilesets, which are basically the tilesets from both the primary and secondary blocksets concatenated together. The first tile in this combined tileset (which you can look at in the blockset editor in AdvanceMap) is at offset 0 in the BG VRAM.

    Code:
    QueueTilesetAnimDma(gTilesetAnimTable_General_0[v1], (u8 *)(BG_VRAM + 0x3f80), 0x80);

    In this line, a copy of 0x80 bytes is being done to the address BG_VRAM + 0x3f80. SInce tiles are 32 bytes in size (4bpp 8x8: 8 * 8 = 64 / 2 = 32), this function is copying 4 tiles to tile 0x1fc. If you look in the blockset editor in AdvanceMap, you can see that 0x1fc is the first out of 4 tiles for the flowers.
     
    Back
    Top