ComSquare
Namespaces | Classes | Functions
ComSquare::PPU::Utils Namespace Reference

Namespaces

 Debug
 

Classes

struct  PpuState
 Struct to save all specific variables needed for the registers (prev values for example) More...
 
union  TileData
 Used to parse easily VRAM Tile information. More...
 

Functions

uint32_t CGRAMColorToRGBA (uint16_t CGRAMColor)
 Transform SNES color code BGR to uint32_t RGBA. More...
 
uint8_t to8Bit (int color)
 Transform CGRAM color data to 8bits. More...
 
template<std::size_t DEST_SIZE_Y, std::size_t DEST_SIZE_X, std::size_t SRC_SIZE_Y, std::size_t SRC_SIZE_X>
void merge2DArray (std::array< std::array< uint32_t, DEST_SIZE_X >, DEST_SIZE_Y > &bufferDest, const std::array< std::array< uint32_t, SRC_SIZE_X >, SRC_SIZE_Y > &bufferSrc, const Vector2< int > &offset)
 
template<std::size_t SRC_SIZE_Y, std::size_t SRC_SIZE_X>
void VFlipArray (std::array< std::array< uint32_t, SRC_SIZE_X >, SRC_SIZE_Y > &array, const Vector2< int > &size, const Vector2< int > &offset={0, 0})
 
template<std::size_t SRC_SIZE_Y, std::size_t SRC_SIZE_X>
void HFlipArray (std::array< std::array< uint32_t, SRC_SIZE_X >, SRC_SIZE_Y > &array, const Vector2< int > &size, const Vector2< int > &offset={0, 0})
 
template<std::size_t DEST_SIZE_X, std::size_t DEST_SIZE_Y, std::size_t SRC_SIZE_X, std::size_t SRC_SIZE_Y>
static void addBuffer (std::array< std::array< uint32_t, DEST_SIZE_Y >, DEST_SIZE_X > &bufferDest, const std::array< std::array< uint32_t, SRC_SIZE_Y >, SRC_SIZE_X > &bufferSrc)
 Add a bg buffer to another buffer. More...
 

Function Documentation

◆ addBuffer()

template<std::size_t DEST_SIZE_X, std::size_t DEST_SIZE_Y, std::size_t SRC_SIZE_X, std::size_t SRC_SIZE_Y>
static void ComSquare::PPU::Utils::addBuffer ( std::array< std::array< uint32_t, DEST_SIZE_Y >, DEST_SIZE_X > &  bufferDest,
const std::array< std::array< uint32_t, SRC_SIZE_Y >, SRC_SIZE_X > &  bufferSrc 
)
static

Add a bg buffer to another buffer.

◆ CGRAMColorToRGBA()

uint32_t ComSquare::PPU::Utils::CGRAMColorToRGBA ( uint16_t  CGRAMColor)

Transform SNES color code BGR to uint32_t RGBA.

Parameters
CGRAMColorThe color of the CGRAM
Returns
The CGRAM color to RGBA format

◆ HFlipArray()

template<std::size_t SRC_SIZE_Y, std::size_t SRC_SIZE_X>
void ComSquare::PPU::Utils::HFlipArray ( std::array< std::array< uint32_t, SRC_SIZE_X >, SRC_SIZE_Y > &  array,
const Vector2< int > &  size,
const Vector2< int > &  offset = {0, 0} 
)

◆ merge2DArray()

template<std::size_t DEST_SIZE_Y, std::size_t DEST_SIZE_X, std::size_t SRC_SIZE_Y, std::size_t SRC_SIZE_X>
void ComSquare::PPU::Utils::merge2DArray ( std::array< std::array< uint32_t, DEST_SIZE_X >, DEST_SIZE_Y > &  bufferDest,
const std::array< std::array< uint32_t, SRC_SIZE_X >, SRC_SIZE_Y > &  bufferSrc,
const Vector2< int > &  offset 
)

◆ to8Bit()

uint8_t ComSquare::PPU::Utils::to8Bit ( int  color)
inline

Transform CGRAM color data to 8bits.

Note
Used with b, g and r values
Returns
The 8 bit value of the color

◆ VFlipArray()

template<std::size_t SRC_SIZE_Y, std::size_t SRC_SIZE_X>
void ComSquare::PPU::Utils::VFlipArray ( std::array< std::array< uint32_t, SRC_SIZE_X >, SRC_SIZE_Y > &  array,
const Vector2< int > &  size,
const Vector2< int > &  offset = {0, 0} 
)