Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

EarthBound/Map Tile Animation Data: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(Create page)
 
(→‎Format: Fix up references between subentries.)
Line 17: Line 17:
Tilesets may have a variable number of tile animation entries for concurrent animations. EarthBound allocates space for up to 8 entries, but no tileset seems to use more than 6.
Tilesets may have a variable number of tile animation entries for concurrent animations. EarthBound allocates space for up to 8 entries, but no tileset seems to use more than 6.


===Num Animation Cycles===
===Num Animation Cycles<span class="anchor" id="Num_Animation_Cycles"></span>===
{{table el||len=2 bytes|loc=<tt>0x00</tt>|valrange=1-256 (<tt>0x0001-0x0100</tt>)|}}
{{table el||len=2 bytes|loc=<tt>0x00</tt>|valrange=1-256 (<tt>0x0001-0x0100</tt>)|}}


The number of different animation frames that the animation will cycle through. As EarthBound allocates space for up to 256 decompressed tile characters for animation, that is the maximum number of cycles if only one tile character is replaced on each animation cycle.
The number of different animation frames that the animation will cycle through. As EarthBound allocates space for up to 256 decompressed tile characters for animation, that is the maximum number of cycles if only one tile character is replaced on each animation cycle.


===Frame Delay===
===Frame Delay<span class="anchor" id="Frame_Delay"></span>===
{{table el||len=2 bytes|loc=<tt>0x02</tt>|valrange=<tt>0x0001-0xFFFF</tt> (~0.017s to ~18min)|}}
{{table el||len=2 bytes|loc=<tt>0x02</tt>|valrange=<tt>0x0001-0xFFFF</tt> (~0.017s to ~18min)|}}


Number of game frames to hold each animation frame before cycling to the next. As an NTSC SNES runs at approximately 60 FPS, this means the time delay can be calculated as <code>delay_in_seconds = frame_delay / 60</code>.
Number of game frames to hold each animation frame before cycling to the next. As an NTSC SNES runs at approximately 60 FPS, this means the time delay can be calculated as <code>delay_in_seconds = frame_delay / 60</code>.


===Transfer Size===
===Transfer Size<span class="anchor" id="Transfer_Size"></span>===
{{table el||len=2 bytes|loc=<tt>0x04</tt>|valrange=<tt>0x0000-0x2000</tt> (0-256 tile characters)|}}
{{table el||len=2 bytes|loc=<tt>0x04</tt>|valrange=<tt>0x0000-0x2000</tt> (0-256 tile characters)|}}


Size in bytes of the tile characters to be replaced on each animation cycle. As EarthBound allocates space for up to 256 decompressed tile characters for animation, each 32 bytes, that gives a maximum transfer size of <tt>0x2000</tt> bytes in the silly scenario where the animation consists of a single animation cycle using all available tile characters.
Size in bytes of the tile characters to be replaced on each animation cycle. As EarthBound allocates space for up to 256 decompressed tile characters for animation, each 32 bytes, that gives a maximum transfer size of <tt>0x2000</tt> bytes in the silly scenario where the animation consists of a single animation cycle using all available tile characters.


===Initial Transfer Source Offset===
===Initial Transfer Source Offset<span class="anchor" id="Initial_Transfer_Source_Offset"></span>===
{{table el||len=2 bytes|loc=<tt>0x06</tt>|valrange=<tt>0x0000-0x1FE0</tt>|}}
{{table el||len=2 bytes|loc=<tt>0x06</tt>|valrange=<tt>0x0000-0x1FE0</tt>|}}


Line 45: Line 45:
{{table el||len=2 bytes|loc=<tt>0x0A</tt>|valrange=<tt>0x0000-0xFFFF</tt>|}}
{{table el||len=2 bytes|loc=<tt>0x0A</tt>|valrange=<tt>0x0000-0xFFFF</tt>|}}


Number of game frames remaining until the next animation cycle. EarthBound will decrement this each game frame, and on reaching zero, EarthBound will reset to Frame Delay (animation data offset <tt>0x02</tt>) and initiate a transfer to VRAM to replace animated tile characters.
Number of game frames remaining until the next animation cycle. EarthBound will decrement this each game frame, and on reaching zero, EarthBound will reset to [[#Frame_Delay|Frame Delay]] and initiate a transfer to VRAM to replace animated tile characters.


===Current Animation Frame===
===Current Animation Frame<span class="anchor" id="Current_Animation_Frame"></span>===
{{table el||len=2 bytes|loc=<tt>0x0C</tt>|valrange=0-256 (<tt>0x0000-0x0100</tt>)|}}
{{table el||len=2 bytes|loc=<tt>0x0C</tt>|valrange=0-256 (<tt>0x0000-0x0100</tt>)|}}


Current animation frame number. EarthBound will increment this each animation cycle, and on reaching Num Animation Cycles (animation data offset <tt>0x00</tt>), EarthBound will reset to zero and reset Current Transfer Source Offset (animation data offset <tt>0x0E</tt>) to Initial Transfer Source Offset (animation data offset <tt>0x06</tt>)
Current animation frame number. EarthBound will increment this each animation cycle, and on reaching [[#Num_Animation_Cycles|Num Animation Cycles]], EarthBound will reset to zero and reset [[#Current_Transfer_Source_Offset|Current Transfer Source Offset]] to [[#Initial_Transfer_Source_Offset|Initial Transfer Source Offset]].


===Current Transfer Source Offset===
===Current Transfer Source Offset<span class="anchor" id="Current_Transfer_Source_Offset"></span>===
{{table el||len=2 bytes|loc=<tt>0x0E</tt>|valrange=<tt>0x0000-0x2000</tt>|}}
{{table el||len=2 bytes|loc=<tt>0x0E</tt>|valrange=<tt>0x0000-0x2000</tt>|}}


Byte offset into decompressed map animation tile characters stored at <tt>$7EC000-$7EDFFF</tt> to use for the transfer source for the next animation cycle. EarthBound will increment this by Transfer Size (animation data offset <tt>0x04</tt>) after each animation cycle, and when Current Animation Frame (animation data offset <tt>0x0C</tt>) reaches Num Animation Cycles (animation data offset <tt>0x00</tt>), reset to Initial Transfer Source Offset (animation data offset <tt>0x06</tt>).
Byte offset into decompressed map animation tile characters stored at <tt>$7EC000-$7EDFFF</tt> to use for the transfer source for the next animation cycle. EarthBound will increment this by [[#Transfer_Size|Transfer Size]] after each animation cycle, and when [[#Current_Animation_Frame|Current Animation Frame]] reaches [[#Num_Animation_Cycles|Num Animation Cycles]], reset to [[#Initial_Transfer_Source_Offset|Initial Transfer Source Offset]].


[[Category:EarthBound|Map Tile Animation Data]]
[[Category:EarthBound|Map Tile Animation Data]]

Revision as of 23:11, 22 December 2023

This is a sub-page of EarthBound.

Map Tile Animation Data
Game EarthBound
Start Address 0x7E43DC
End Address 0x7E445B
# of Entries up to 8
Entry Length 16 bytes(0x10)
Total Length 128 bytes (0x80)
Back to the RAM map

Stored/cached metadata concerning tile animation for the current map tileset.

Format

Tilesets may have a variable number of tile animation entries for concurrent animations. EarthBound allocates space for up to 8 entries, but no tileset seems to use more than 6.

Num Animation Cycles

The number of different animation frames that the animation will cycle through. As EarthBound allocates space for up to 256 decompressed tile characters for animation, that is the maximum number of cycles if only one tile character is replaced on each animation cycle.

Frame Delay

Number of game frames to hold each animation frame before cycling to the next. As an NTSC SNES runs at approximately 60 FPS, this means the time delay can be calculated as delay_in_seconds = frame_delay / 60.

Transfer Size

Size in bytes of the tile characters to be replaced on each animation cycle. As EarthBound allocates space for up to 256 decompressed tile characters for animation, each 32 bytes, that gives a maximum transfer size of 0x2000 bytes in the silly scenario where the animation consists of a single animation cycle using all available tile characters.

Initial Transfer Source Offset

Byte offset into the decompressed map animation tile characters stored at $7EC000-$7EDFFF to use for the transfer source for the first animation cycle.

Transfer Destination Address

VRAM word address of the first tile character to be replaced on each animation cycle. Map tile characters occupy addresses $0000-$37FF (word addresses) of VRAM.

Frames Until Cycle

Number of game frames remaining until the next animation cycle. EarthBound will decrement this each game frame, and on reaching zero, EarthBound will reset to Frame Delay and initiate a transfer to VRAM to replace animated tile characters.

Current Animation Frame

Current animation frame number. EarthBound will increment this each animation cycle, and on reaching Num Animation Cycles, EarthBound will reset to zero and reset Current Transfer Source Offset to Initial Transfer Source Offset.

Current Transfer Source Offset

Byte offset into decompressed map animation tile characters stored at $7EC000-$7EDFFF to use for the transfer source for the next animation cycle. EarthBound will increment this by Transfer Size after each animation cycle, and when Current Animation Frame reaches Num Animation Cycles, reset to Initial Transfer Source Offset.