#include <Background.hpp>
|
| template<int levelLow, int levelHigh, std::size_t DEST_SIZE_X, std::size_t DEST_SIZE_Y> |
| static void | mergeBackgroundBuffer (std::array< std::array< uint32_t, DEST_SIZE_Y >, DEST_SIZE_X > &bufferDest, std::array< std::array< unsigned char, DEST_SIZE_Y >, DEST_SIZE_X > &pixelDestinationLevelMap, const Background &backgroundSrc) |
| | Add a bg buffer to another buffer. More...
|
| |
◆ Background() [1/2]
| ComSquare::PPU::Background::Background |
( |
PPU & |
_ppu, |
|
|
int |
backgroundNumber |
|
) |
| |
◆ Background() [2/2]
| ComSquare::PPU::Background::Background |
( |
const Background & |
| ) |
|
|
default |
◆ ~Background()
| ComSquare::PPU::Background::~Background |
( |
| ) |
|
|
default |
◆ _drawBasicTileMap()
| void ComSquare::PPU::Background::_drawBasicTileMap |
( |
uint16_t |
baseAddress, |
|
|
Vector2< int > |
offset |
|
) |
| |
|
private |
draw a tileMap 32x32 starting at baseAddress
- Parameters
-
| baseAddress | The starting address of the tileMap |
| offset | The offset of the tile map (ranging from 0 to 1) |
◆ _drawTile()
| void ComSquare::PPU::Background::_drawTile |
( |
uint16_t |
data, |
|
|
Vector2< int > |
indexOffset |
|
) |
| |
|
private |
Draw a tile on the screen at x y pos.
- Parameters
-
| data | The VRAM value to be interpreted as a Utils::TileData |
| indexOffset | The index offset of the Tile (ranging from 0 to 63) |
◆ _drawTileFromMemoryToTileBuffer()
| void ComSquare::PPU::Background::_drawTileFromMemoryToTileBuffer |
( |
const union Utils::TileData & |
tileData | ) |
|
|
private |
Draw the tile to the tile Buffer.
- Parameters
-
| tileData | The tile data to use to render the tile |
◆ getBgNumber()
| int ComSquare::PPU::Background::getBgNumber |
( |
| ) |
const |
Get the BackGround Number.
- Returns
- the current Background number
◆ isPriorityPixel()
| bool ComSquare::PPU::Background::isPriorityPixel |
( |
int |
x, |
|
|
int |
y |
|
) |
| const |
Tells if a pixel has high priority.
◆ mergeBackgroundBuffer()
template<int levelLow, int levelHigh, std::size_t DEST_SIZE_X, std::size_t DEST_SIZE_Y>
| static void ComSquare::PPU::Background::mergeBackgroundBuffer |
( |
std::array< std::array< uint32_t, DEST_SIZE_Y >, DEST_SIZE_X > & |
bufferDest, |
|
|
std::array< std::array< unsigned char, DEST_SIZE_Y >, DEST_SIZE_X > & |
pixelDestinationLevelMap, |
|
|
const Background & |
backgroundSrc |
|
) |
| |
|
inlinestatic |
Add a bg buffer to another buffer.
- Template Parameters
-
| levelLow | The priority of a low priority pixel (working like z-index CSS property) |
| levelHigh | The priority of a high priority pixel (working like z-index CSS property) |
| DEST_SIZE_X | The Horizontal array size |
| DEST_SIZE_Y | The Vertical array size |
- Parameters
-
| bufferDest | The destination buffer (buffer that will be written on) |
| pixelDestinationLevelMap | The destination buffer level map to use as reference and will be updated if a pixel has an higher level than the actual one |
| backgroundSrc | The Background to use as a source |
◆ operator=()
Delete assignment operator.
◆ renderBackground()
| void ComSquare::PPU::Background::renderBackground |
( |
| ) |
|
Render a background on his internal buffer.
◆ setBpp()
| void ComSquare::PPU::Background::setBpp |
( |
int |
bpp | ) |
|
Set the bpp (bits per pixels) of the Background @info The bpp can be 2, 4 or 8 (7 can be possible when BgMode is 7)
◆ setCharacterSize()
| void ComSquare::PPU::Background::setCharacterSize |
( |
Vector2< int > |
size | ) |
|
Set the character Size.
- Parameters
-
| size | The character size (8x8, 16x16, 16x8, 8x16) |
◆ setTileMapMirroring()
| void ComSquare::PPU::Background::setTileMapMirroring |
( |
Vector2< bool > |
tileMaps | ) |
|
setter for private variable _tileMaps
- Parameters
-
| tileMaps | The tileMaps to set |
◆ setTileMapStartAddress()
| void ComSquare::PPU::Background::setTileMapStartAddress |
( |
uint16_t |
address | ) |
|
Set the tileMap start address.
- Parameters
-
| address | TileMap start address |
◆ setTilesetAddress()
| void ComSquare::PPU::Background::setTilesetAddress |
( |
uint16_t |
address | ) |
|
Set the tileset address of the background.
◆ _bgNumber
| int ComSquare::PPU::Background::_bgNumber |
|
private |
The bg number (used to get the corresponding scroll)
◆ _bpp
| int ComSquare::PPU::Background::_bpp |
|
private |
The number of bits per pixels to currently look for each pixel.
◆ _cgram
| Ram::Ram& ComSquare::PPU::Background::_cgram |
|
private |
◆ _characterNbPixels
| Vector2<int> ComSquare::PPU::Background::_characterNbPixels |
|
private |
The number of pixels of a character (x: width, y: height)
◆ _directColor
| bool ComSquare::PPU::Background::_directColor |
|
private |
PPU official direct color mode.
◆ _highRes
| bool ComSquare::PPU::Background::_highRes |
|
private |
PPU offical highRes mode.
◆ _ppu
| PPU& ComSquare::PPU::Background::_ppu |
|
private |
the ppu used to get registers values (ex: bg scroll)
◆ _tileBuffer
| std::array<std::array<uint32_t, 16>, 16> ComSquare::PPU::Background::_tileBuffer |
|
private |
Buffer if we have tiles that are more than 8x8.
◆ _tileMapMirroring
| Vector2<bool> ComSquare::PPU::Background::_tileMapMirroring |
|
private |
The tilemap configuration nb of tileMap vertically and horizontally.
- Note
- members are set to true if the tilemap is expended in their direction
◆ _tileMapStartAddress
| uint16_t ComSquare::PPU::Background::_tileMapStartAddress |
|
private |
The first address of the tilemap data.
◆ _tileRenderer
Class that actually render a tile.
◆ _tilesetAddress
| uint16_t ComSquare::PPU::Background::_tilesetAddress |
|
private |
The first address for tileset data.
◆ _vram
| Ram::Ram& ComSquare::PPU::Background::_vram |
|
private |
◆ backgroundSize
| Vector2<unsigned> ComSquare::PPU::Background::backgroundSize |
The size of the background (x, y)
◆ buffer
| std::array<std::array<uint32_t, 1024>, 1024> ComSquare::PPU::Background::buffer |
The output buffer (pixels are written on it)
◆ NbCharacterHeight
| constexpr int ComSquare::PPU::Background::NbCharacterHeight = 32 |
|
staticconstexprprivate |
The number of character a TileMap has in height.
◆ NbCharacterWidth
| constexpr int ComSquare::PPU::Background::NbCharacterWidth = 32 |
|
staticconstexprprivate |
The number of character a TileMap has in width.
◆ NbTilePerRow
| constexpr unsigned ComSquare::PPU::Background::NbTilePerRow = 16 |
|
staticconstexprprivate |
The number of rows in one line of VRAM.
- Note
- If you're lost by this description, open a tile viewer in an emulator, and set the number of tiles in width to 16 graphics
◆ TileMapByteSize
| constexpr unsigned short ComSquare::PPU::Background::TileMapByteSize = 0x800 |
|
staticconstexprprivate |
The size of a TileMap in memory.
◆ tilesPriority
| std::array<std::array<bool, 64>, 64> ComSquare::PPU::Background::tilesPriority |
The buffer of tile priority level.
The documentation for this class was generated from the following files: