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

CGRAM: Difference between revisions

From SnesLab
Jump to: navigation, search
(→‎See Also: OAM and VRAM)
(bit 15 unused)
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''CGRAM''' (Color Generator<sup>[2]</sup> RAM) is where palettes are stored.  The SNES uses 15-bit color here.
'''CGRAM''' (Color Generator<sup>[2]</sup> RAM) is where palettes are stored for [[indirect color]].  The SNES uses 15-bit color here.  It is a total of 512 bytes and is word (not byte) addressed.  For each of the 256 color entries:
 
* bits 0 to 4 are the red intensity
* bits 5 to 9 are the green intensity
* bits 10 to 14 are the blue intensity
* bit 15 is unused, reading it returns PPU2 open bus
 
In all [[background modes]], sprites use the second half of CGRAM (addresses 80h to FFh).
 
When using CGRAM, color entries can be one of 32,768 colors from the master palette.
 
[[Direct Color]] is a technique that does not use CGRAM.


=== See Also ===
=== See Also ===
* [[OAM]]
* [[OAM]]
* [[VRAM]]
* [[VRAM]]
* [[PPU]]
* [[The Infamous Bit-Of-Confusion]]
* [[The Infamous Bit-Of-Confusion]]


=== References ===
=== References ===
# [https://archive.org/details/SNESDevManual/book1/page/n211 Appendix 17] of the official Super Nintendo development manual on CG-RAM
# [https://archive.org/details/SNESDevManual/book1/page/n211 Appendix A-17] of the official Super Nintendo development manual on CG-RAM
# https://problemkaputt.de/fullsnes.htm#snesmemorycgramaccesspalettememory
# https://problemkaputt.de/fullsnes.htm#snesmemorycgramaccesspalettememory


[[Category:Video]]
[[Category:Video]]
[[Category:Address Spaces]]
[[Category:Address Spaces]]

Latest revision as of 01:05, 29 December 2023

CGRAM (Color Generator[2] RAM) is where palettes are stored for indirect color. The SNES uses 15-bit color here. It is a total of 512 bytes and is word (not byte) addressed. For each of the 256 color entries:

  • bits 0 to 4 are the red intensity
  • bits 5 to 9 are the green intensity
  • bits 10 to 14 are the blue intensity
  • bit 15 is unused, reading it returns PPU2 open bus

In all background modes, sprites use the second half of CGRAM (addresses 80h to FFh).

When using CGRAM, color entries can be one of 32,768 colors from the master palette.

Direct Color is a technique that does not use CGRAM.

See Also

References

  1. Appendix A-17 of the official Super Nintendo development manual on CG-RAM
  2. https://problemkaputt.de/fullsnes.htm#snesmemorycgramaccesspalettememory