Donkey Kong Land 2/Notes: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
m (→‎Compression: Generalized the text)
m (Xkeeper moved page Donkey Kong Land 2:Notes to Donkey Kong Land 2/Notes: normalize subpages and titles)
 
(6 intermediate revisions by 2 users not shown)
Line 3: Line 3:
== Metasprites ==
== Metasprites ==


<tt>0x18001</tt>: A list of 24-bit pointers (bank first, big endian) to [[Donkey Kong Land 2:Notes#MetaspriteSet Structure|MetaspriteSet]] structures. It's indexed using a metasprite set ID.
<tt>0x18001</tt>: A list of 24-bit pointers (bank first, big endian) to [[#MetaspriteSet Structure|MetaspriteSet]] structures. It's indexed using a metasprite set ID.


=== MetaspriteSet Structure ===
=== MetaspriteSet Structure ===


*The first byte is the number of metasprites in the set.
*The first byte is the number of metasprites in the set.
*Following that is a list of [[Donkey Kong Land 2:Notes#MetaspriteInfo Structure|MetaspriteInfo]] structures- one for each metasprite in the set.
*Following that is a list of [[#MetaspriteInfo Structure|MetaspriteInfo]] structures- one for each metasprite in the set.
*Following that is a list of [[Donkey Kong Land 2:Notes#MetaspriteLayout Structure|MetaspriteLayout]] structures- one for each metasprite in the set.
*Following that is a list of [[#MetaspriteLayout Structure|MetaspriteLayout]] structures- one for each metasprite in the set.


=== MetaspriteInfo Structure ===
=== MetaspriteInfo Structure ===
Line 20: Line 20:
=== MetaspriteLayout Structure ===
=== MetaspriteLayout Structure ===


*A list of [[Donkey Kong Land 2:Notes#SignedPoint Structure|SignedPoint]] structures- one for each sprite in a metasprite- that define the locations of the sprites that compose said metasprite. Each consecutive [[Donkey Kong Land 2:Notes#SignedPoint Structure|SignedPoint]] is relative to the one before it.
*A list of [[#SignedPoint Structure|SignedPoint]] structures- one for each sprite in a metasprite- that define the locations of the sprites that compose said metasprite. Each consecutive [[#SignedPoint Structure|SignedPoint]] is relative to the one before it.


=== SignedPoint Structure ===
=== SignedPoint Structure ===


*<tt>0x0</tt>: Y coordinate (signed)
*<tt>0x0</tt>: y coordinate (signed)
*<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 [[#MetaspriteLayout Structure|MetaspriteLayout]] structure.
* Only 8x16 sprites are used.
* Only 8 x 16 sprites are used.
* Tile pattern indices increase by 2 for every consecutively drawn sprite.
* Tile pattern indices increase by 2 for every consecutively drawn sprite.
* Each sprite forming the metasprite uses the same sprite palette.
* 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.
* 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 ==
== Compression ==
Line 40: Line 40:


Descriptions of the compression formats can be found at [[Donkey Kong Land:Notes#Compression]].
Descriptions of the compression formats can be found at [[Donkey Kong Land:Notes#Compression]].
== Level Index Numbers ==
Here are the index numbers for the levels. In-game, the current level is stored in RAM address <tt>FFA6</tt>. Pointer tables, such as the ones for level maps, use this order.
00 - Mainbrace Mayhem
01 - Topsail Trouble
02 - Slime Climb
03 - Pirate Panic
04 - Gangplank Galley
05 - Rattle Battle
06 - Arctic Abyss
07 - Clapper's Cavern
08 - Black Ice Battle
09 - Kannon's Klaim
0A - Squawks's Shaft
0B - Windy Well
0C - Ghostly Grove
0D - Gusty Glade
0E - Web Woods
0F - Bramble Blast
10 - Bramble Scramble
11 - Screech's Sprint
12 - Jungle Jinx
13 - Klobber Karnage
14 - Animal Antics
15 - Target Terror
16 - Rickety Race
17 - Krazy Koaster
18 - Hothead Hop
19 - Redhot Ride
1A - Fiery Furnace
1B - Barrel Bayou
1C - Krockhead Klamber
1D - Mudhole Marsh
1E - Dungeon Danger
1F - Chain Link Chamber
20 - Toxic Tower
21 - Hornet Hole
22 - Rambi Rumble
23 - Parrot Chute Panic
24 - Lockjaw's Locker
25 - Lava Lagoon
26 - Glimmer's Galleon
27 - Krow's Nest
28 - Kleaver's Kiln
29 - King Zing Sting
2A - Kreepy Krow
2B - Stronghold Showdown
2C - Krocodile Kore
2D - K. Rool Duel
{{Internal Data|game=Donkey Kong Land 2}}

Latest revision as of 02:41, 24 January 2024

Chip tiny.png The following article is a Notes Page for Donkey Kong Land 2.

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 8 x 16 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.

Level Index Numbers

Here are the index numbers for the levels. In-game, the current level is stored in RAM address FFA6. Pointer tables, such as the ones for level maps, use this order.

00 - Mainbrace Mayhem
01 - Topsail Trouble
02 - Slime Climb
03 - Pirate Panic
04 - Gangplank Galley
05 - Rattle Battle
06 - Arctic Abyss
07 - Clapper's Cavern
08 - Black Ice Battle
09 - Kannon's Klaim
0A - Squawks's Shaft
0B - Windy Well
0C - Ghostly Grove
0D - Gusty Glade
0E - Web Woods
0F - Bramble Blast
10 - Bramble Scramble
11 - Screech's Sprint
12 - Jungle Jinx
13 - Klobber Karnage
14 - Animal Antics
15 - Target Terror
16 - Rickety Race
17 - Krazy Koaster
18 - Hothead Hop
19 - Redhot Ride
1A - Fiery Furnace
1B - Barrel Bayou
1C - Krockhead Klamber
1D - Mudhole Marsh
1E - Dungeon Danger
1F - Chain Link Chamber
20 - Toxic Tower
21 - Hornet Hole
22 - Rambi Rumble
23 - Parrot Chute Panic
24 - Lockjaw's Locker
25 - Lava Lagoon
26 - Glimmer's Galleon
27 - Krow's Nest
28 - Kleaver's Kiln
29 - King Zing Sting
2A - Kreepy Krow
2B - Stronghold Showdown
2C - Krocodile Kore
2D - K. Rool Duel