don't click here

Sonic 2 Animated Pattern Mappings

Discussion in 'Engineering & Reverse Engineering' started by ExecByte, Jun 27, 2007.

  1. ExecByte

    ExecByte

    Member
    99
    0
    6
    Ohio
    Sonic: The Lost Worlds
    We know the format for animated patterns frames but I didn't see the format for the mappings anywhere but I think I figured it out.

    XX XX YY YY AB BB AB BB AB BB AB BB .....

    X: 16x16 block where these mappings start, multiplied by 8.
    Y: Number of 8x8 tiles to read for these mappings. Starts from 0.
    A: Palette line for 8x8 tile, multiplied by 2.
    B: 8x8 tile to read. Multiply this value by 0x20 for the VRAM location to read from.

    These 8x8 and 16x16 tiles are refered to as if they were part of the main level load block in memory. So, placing a 16x16 block that these mappings are applied to in a 128x128 block will put the animated pattern there.
     
  2. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    Mappings?

    Just use the animated tiles in the level like any other art tiles. Special mappings aren't used or needed.
     
  3. ExecByte

    ExecByte

    Member
    99
    0
    6
    Ohio
    Sonic: The Lost Worlds
    I'm talking about the animated patterns that are loaded seperatly from the levels art. They use the uncompressed art. The glowing orbs in Hidden Palace, flipping blocks in Casino Night, pulsing balls in Emerald Hill, those types of things.

    What I'm saying is I figured out how the format works for the "misc sprite mappings" at 0x40350. That's what they're called in Nemesis' guide anyway.
     
  4. Dr. Ivo

    Dr. Ivo

    Professional Reverse Engineer Tech Member
    Awesome find!
     
  5. ExecByte

    ExecByte

    Member
    99
    0
    6
    Ohio
    Sonic: The Lost Worlds
    Thanks!

    I've made some animated patterns for my hack, so I can confirm this is how it works.

    Another thing you need to know if you're making animated patterns is that in order for them to work, you need to use dynamic pattern reloading. Yea, dynamic pattern reloading isn't an entirely separate thing. You should use the dynamic pattern reloading at 3FF2C so, you'd enter 024C in the offset index at 3FCE0 for which ever level you're using it.

    In case, it wasn't clear, these mappings are 16x16 mappings. That's why each zone's 16x16 mappings have those blank blocks at the end. These are the mappings that go there in RAM.