Users browsing this thread: 1 Guest(s)
Help with animation frame data

#1
Posts: 12
Threads: 9
Thanks Received: 1
Thanks Given: 5
Joined: Dec 2018
Reputation: 0
Status
Sneak
The Battle Animation Frame Data table (D10141) holds information about which 16x16 tiles any battle animation is going to use, in the form of frames.

Let's take a look at the frame data for the Flail animation (D104B3):

02 0C 12 0D 02 04 12 05 22 06 02 02 12 03 12 0E 22 4C

Each 16x16 tile is made out of two bytes. First byte is the tile's position in the frame and the second one is it's index in the current tile formation (Flail uses a tile formation located at D20940).

Here's a diagram of what these bytes look like, in their order:

[Image: g17Ak2s.png]

As we can see, there are 4 frames being used. Two for the Flail in different positions and two for the swipe effect. Also, the second frame uses 3 tiles (6 bytes), and all the other frames uses 2 tiles (4 bytes). That means that the amount of tiles used in any frame varies. The problem though, is... where is this data at? Where do I find how many tiles is each frame going to use in each animation? I've been messing around with these battle animations for many hours right now, and I still couldn't find this piece of information.  Kappa!
  Find
Quote  

#2
Posts: 178
Threads: 2
Thanks Received: 23
Thanks Given: 4
Joined: Apr 2015
Reputation: 18
Status
None
The animation frames are stored sequentially, so one frame ends when it reaches the beginning of the next frame. Following your example, the frame pointers for the flail animation are at D4/E072:

Code:
B3 04 B7 04 BD 04 C1 04 C5 04

So the first frame is D1/04B3 through D1/04B6, the second frame is D1/04B7 through D1/04BC, etc.

Another way to terminate a frame is by including the 2-byte value FF FF.

If you want to see this in a disassembly, the subroutine for loading a frame is at C1/9F61 for BG1 threads and C1/A0C6 for sprite threads (the data is stored the same way for both BG1 and sprites, they just get loaded differently).
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite