• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
8
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:

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    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.
     
    26
    Posts
    8
    Years
    • Seen Jun 2, 2021
    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:

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    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