Auto animation: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
m (1 revision: Import from wikkii)
mNo edit summary
Line 5: Line 5:
Auto-animation is a tile attribute for [[sprites]] and a special feature of the GPU used to animate loops.
Auto-animation is a tile attribute for [[sprites]] and a special feature of the GPU used to animate loops.


An internal 8bit counter is automatically decremented each frame. When it underflows, it is reloaded with the last value written to it, which comes from REG_HBLANKCNT ($3C0006). This sets the speed of the animation.
An internal 8bit counter is automatically decremented each frame. When it underflows, it is reloaded with the last value written to it, which comes from {{Reg|REG_HBLANKCNT}}. This sets the speed of the animation.


Another internal 3bit counter is incremented each time the frame counter underflows. Those 3 bits can only be read in bits 2~0 of REG_HBLANKCNT.
Another internal 3bit counter is incremented each time the frame counter underflows. Those 3 bits can only be read in bits 2~0 of REG_HBLANKCNT.

Revision as of 01:03, 14 August 2012

TODO: Make an English version of this

(Information from Charles MacDonald)

Auto-animation is a tile attribute for sprites and a special feature of the GPU used to animate loops.

An internal 8bit counter is automatically decremented each frame. When it underflows, it is reloaded with the last value written to it, which comes from REG_HBLANKCNT. This sets the speed of the animation.

Another internal 3bit counter is incremented each time the frame counter underflows. Those 3 bits can only be read in bits 2~0 of REG_HBLANKCNT.

When auto-animation is disabled (bit 3 of REG_HBLANKCNT set), the frame counter and animation counter continue to function. However tiles displayed are shown as if their animation mode select bits were reset to zero (so the tile number specified is the tile shown).

These bits can be set in each tile's attribute word (odd bytes of SCB1):

Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Palette ?Tile number MSBs3bit Auto-anim2bit Auto-animVertical flipHorizontal flip

Bit 3 has priority.

Depending on the animation period (4 or 8 frames), the tile number specified in SCB1 has the lower 2 or 3 bits replaced with those of the animation counter.