We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

Bitplane: Difference between revisions

From SnesLab
Jump to: navigation, search
(W→‎External Links: why not sequentially)
(3bpp is not natively supported by the PPU, it is for compression)
Line 3: Line 3:
=== Motivation ===
=== Motivation ===


The SNES' planar image format allows it to easily support a bit-depth that is not a power of two: 3bpp.  In a packed format, 3bpp images would either have to:
The SNES' planar image format allows it to easily support a bit-depth (under compression, but not PPU-native) that is not a power of two: 3bpp.  In a packed format, 3bpp images would either have to:


* put two pixels into each byte (total of six bits) and waste the other two bits
* put two pixels into each byte (total of six bits) and waste the other two bits

Revision as of 03:12, 10 November 2023

A Bitplane is a 1bpp slice of an image. The bytes making up a bitplane are not stored contiguously in VRAM.

Motivation

The SNES' planar image format allows it to easily support a bit-depth (under compression, but not PPU-native) that is not a power of two: 3bpp. In a packed format, 3bpp images would either have to:

  • put two pixels into each byte (total of six bits) and waste the other two bits
  • put five pixels into each 16-bit word, and waste the Bit-Of-Confusion (which is what CGRAM does)
  • put eight pixels into each 24-bit word, which would be awkward considering the 65c816 is a 16-bit CPU and would require more code to manipulate

Bitplanes avoid these problems because adding or removing a bitplane always adds or removes exactly eight bytes, which fits nicely into an address space.

Adjacent bitplanes in a 3D stack of bitplanes (as in, bitplanes above or below, not adjacent in the tilemap) are always stored in opposite VRAM chips (because one chip stores the low bytes and the other high). Reading/Writing to both chips in parallel is presumably faster than trying to use one chip serially.

External Links