Sprite compression (Generation I): Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 1: Line 1:
{{incomplete|needs proper analysis. The official method may also have been in the source code}}
{{incomplete|needs proper analysis. The official method may also have been in the source code}}


'''Sprite compression''' is the means in Generation I for where pure graphics data is compressed into a Pokémon or Trainer sprite. The sprite is decompressed again using [[Sprite decompression (Generation I)|the sprite decompression routine]]. While the source compressor code is not in the ROMs; there are a few rules for a compressed sprite:
'''Sprite compression''' is the means in Generation I for where pure graphics data is compressed into a Pokémon or Trainer sprite. The sprite is decompressed again using [[Sprite decompression (Generation I)|the sprite decompression routine]] and allocates use of unbanked SRAM. While the source compressor code is not in the ROMs; there are a few rules for a compressed sprite:


*The image to compress is usually a maximum of 56x56 pixels. Other Pokémon sprites can be 32x32, 40x40 or 48x48.
*The image to compress is usually a maximum of 56x56 pixels. Other Pokémon sprites can be 32x32, 40x40 or 48x48.
Line 9: Line 9:
*Unofficially, a .2bpp file can be converted into a compressed Pokémon sprite using the tool pkmncompress, and a .PNG into a compatible .2bpp file using rgbds. "Sprite import tools for RBY" can be downloaded within Evie's Google Sites backup [https://drive.google.com/drive/folders/1DAVPYay9sAuXwi4qXbDQfPU2sIDI_mXH?usp=sharing here] (based on the previous work of the GB Dev and Skeetendo communities).
*Unofficially, a .2bpp file can be converted into a compressed Pokémon sprite using the tool pkmncompress, and a .PNG into a compatible .2bpp file using rgbds. "Sprite import tools for RBY" can be downloaded within Evie's Google Sites backup [https://drive.google.com/drive/folders/1DAVPYay9sAuXwi4qXbDQfPU2sIDI_mXH?usp=sharing here] (based on the previous work of the GB Dev and Skeetendo communities).
*It is possible for the sprite to be flipped for a non-00 value in memory address 0xD0AA ([[Pokémon Red and Blue]]) or 0xD0A9 ([[Pokémon Yellow]]). The [[inverse sprites glitch]] corrupts these memory addresses, possibly leading to glitched sprites.
*It is possible for the sprite to be flipped for a non-00 value in memory address 0xD0AA ([[Pokémon Red and Blue]]) or 0xD0A9 ([[Pokémon Yellow]]). The [[inverse sprites glitch]] corrupts these memory addresses, possibly leading to glitched sprites.



Unintended compressed sprites with dimensions of 0 are known for their memory overflows, such as Yellow [[MissingNo.]]'s sprite (treated as dimensions of 256, or (256/8)=32).
Unintended compressed sprites with dimensions of 0 are known for their memory overflows, such as Yellow [[MissingNo.]]'s sprite (treated as dimensions of 256, or (256/8)=32).