Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2013-06-20 19:54:19

80C
Banned
Registered: 2013-03-16
Post 778/1,257

R\B Battle Animations

This is a tutorial that wasn't posted in this hacking forum (and in PC), I found it by searching throught cache copies of internet.
Fortunately I've found what I was searching for.

I'm not the original author, I posted it here because this tutorial may help everyone wishes hack battle animations in R\B.

Watch the R\B Battle animation List for a complete list of animation of these.

--------------------------------------------------------------------------------
Tile Patterns 1: 1E:41FE - 46ED Tile Patterns 2: 1E:46EE - 4BDD

----------------Animations format
1E:607D - Table of pointers. There are 0xCB entries, one for each animation.
Each of these pointers points to a sequence of “special effects” and “subanimations.”
There are two types of commands that can occur in the sequence.
The first type just calls a specific ASM function (a special effect).
The second type is played by RealPlayAnimation (1E:4E53) and is a sequence of images (a subanimation). It is made up of “frame blocks”. Note that RealPlayAnimation calls a function that may call an additional ASM function depending on the animation ID (not subanimation ID) after each “frame block”.
The format here is also follows.
If byte 0 is 0xC0 or greater, then it is a special effect.
Format:
• byte 0: special effect ID (from 0xD8 to 0xFE inclusive)
• byte 1: sound ID

----------------Special effects format
There is a table for special effect functions at 1E:50DA.
Format:
• byte 0: special effect ID
• bytes 1-2: address of function
If byte 0 is less than 0xC0, then it is a sequence of images (sprites).
Format:
• byte 0
o bits 0-5: duration of each frame within subanimation (in terms of screen refreshes)
o bits 6-7: select tile pattern data
• byte 1: sound ID
• byte 2: subanimation ID

----------------Subanimations format
1E:676D - Table of pointers. These are the “subanimations”. There are 0x56 of them.
Format:
• byte 0
o bits 0-4: number of “frame blocks”
o bits 5-7: “type”
The type controls how the subanimation changes depending on whether the player or enemy attacks.
• 00: no difference between player and enemy attacking
• 01: when an enemy attacks, flip the entire battle animation layer across the screen horizontally and vertically
• 02: when an enemy attacks, flip the entire battle animation layer across the screen horizontally and translate it downwards by 40 pixels
• 03: when an enemy attacks, flip the base coordinates across the screen horizontally and vertically (this translates the image but does not mirror it)
• 04: when an enemy attacks, do the animation in reverse order
• 05: when the player attacks, flip the entire battle animation layer across the screen horizontally and translate it downwards by 40 pixels (i.e. behave as though the player is the enemy and the mode is 2)
• Values 6 and 7 are unused.
The first byte is followed by a list of subentries, the amount of which is indicated in bits 0-4 of byte 0.
Subentry Format:
• byte 0: “frame block” ID
• byte 1: Base Coordinate ID
• byte 2: mode
o 00: usual mode; normal delay and clear the animation layer after
o 02: no delay and no clearing the animation layer; this is useful for drawing bigger objects
o 03: normal delay, but no clearing the animation layer
o 04: normal delay, but no clearing the animation layer; makes this “frame block” temporary, such that the next “frame block” will overwrite it
o All other mode values are unused and behave like 00.
Frame blocks format
1E:6F74 - Table of pointers. These are the “frame blocks”. There are 0x7A of them.
Each “frame block” is a block of tiles. Subanimations consist of drawing these blocks at various screen positions in sequence. Multiple frame blocks can be combined to form larger objects if the appropriate mode is used.

----------------Frame Block Format:
The first byte is the number of tiles within the block. Each tile has a subentry.
Subentry Format:
These follow the format in OAM. Note that these values are not copied directly and may be modified before written into OAM.
• byte 0: Y offset from base coordinate of block
• byte 1: X offset from base coordinate of block
• byte 2: tile ID (0x31 (the base of the battle animation tiles) is added to this value)
• byte 3: flags
o bit 5: X flip
o bit 6: Y flip

----------------Frame block coordinates
1E:7C85 - Coordinate pairs.
These are used as base coordinates for “frame blocks”.
Format:
• byte 0: Y
• byte 1: X

Last edited by 80C (2013-06-20 19:57:01)


I left this forum.

Offline

#2 2013-06-20 19:58:00

comet
Member
Registered: 2012-04-09
Post 261/679

Offline

#3 2013-06-20 20:00:58

80C
Banned
Registered: 2013-03-16
Post 779/1,257

Re: R\B Battle Animations

was it mirrored inside the forum and I didn't noticed it?
If my is superfluous I could left only the link then.


I left this forum.

Offline

Board footer

Powered by FluxBB