Difference between revisions of "Donkey Kong Land 2:Notes"

From Data Crystal
Jump to: navigation, search
m (Compression: Generalized the text)
m (Drawing Metasprites: Renamed this section)
Line 27: Line 27:
 
*<tt>0x1</tt>: X coordinate (signed)
 
*<tt>0x1</tt>: X coordinate (signed)
  
=== Drawing a Metasprite ===
+
=== Drawing Metasprites ===
  
 
* Each consecutive sprite forming a metasprite is drawn relative to the previous one based on the offsets defined in its [[Donkey Kong Land 2:Notes#MetaspriteLayout Structure|MetaspriteLayout]] structure.
 
* Each consecutive sprite forming a metasprite is drawn relative to the previous one based on the offsets defined in its [[Donkey Kong Land 2:Notes#MetaspriteLayout Structure|MetaspriteLayout]] structure.

Revision as of 17:01, 14 December 2014

Metasprites

0x18001: A list of 24-bit pointers (bank first, big endian) to MetaspriteSet structures. It's indexed using a metasprite set ID.

MetaspriteSet Structure

  • The first byte is the number of metasprites in the set.
  • Following that is a list of MetaspriteInfo structures- one for each metasprite in the set.
  • Following that is a list of MetaspriteLayout structures- one for each metasprite in the set.

MetaspriteInfo Structure

  • 0x0: The number of sprites used by this metasprite.
  • 0x1-2: A 16-bit pointer (big endian) to the first of the uncompressed tile patterns used by this metasprite. The pointer uses a special format (detailed below).
  • Bits 0x0-A: The address can be calculated as this value * 0x20.
  • Bits 0xB-F: The bank.

MetaspriteLayout Structure

  • A list of SignedPoint structures- one for each sprite in a metasprite- that define the locations of the sprites that compose said metasprite. Each consecutive SignedPoint is relative to the one before it.

SignedPoint Structure

  • 0x0: Y coordinate (signed)
  • 0x1: X coordinate (signed)

Drawing Metasprites

  • Each consecutive sprite forming a metasprite is drawn relative to the previous one based on the offsets defined in its MetaspriteLayout structure.
  • Only 8x16 sprites are used.
  • Tile pattern indices increase by 2 for every consecutively drawn sprite.
  • Each sprite forming the metasprite uses the same sprite palette.
  • When flipping the metasprite horizontally, negate the X offset of each sprite before adding it. Additionally, the metasprite should be drawn 7 pixels to the left.

Compression

This game uses the same compression formats as Donkey Kong Land and Donkey Kong Land III. The tables used for Huffman coding decompression can be found at the same locations as in Donkey Kong Land.

Descriptions of the compression formats can be found at Donkey Kong Land:Notes#Compression.