|
ComSquare
|
The class containing all the registers of the PPU. More...
#include <PPU.hpp>
Public Member Functions | |
| PPU (Renderer::IRenderer &renderer) | |
| PPU (const PPU &)=delete | |
| ~PPU () override=default | |
| PPU & | operator= (const PPU &)=delete |
| uint8_t | read (uint24_t addr) override |
| Read data from the component. More... | |
| void | write (uint24_t addr, uint8_t data) override |
| Write data to this component. More... | |
| std::string | getName () const override |
| Get the name of this accessor (used for debug purpose) More... | |
| Component | getComponent () const override |
| Get the component of this accessor (used for debug purpose) More... | |
| uint24_t | getSize () const override |
| Get the size of the data. This size can be lower than the mapped data. More... | |
| virtual void | update (unsigned cycles) |
| Update the PPU of n cycles. More... | |
| uint16_t | getVramAddress () const |
| Give the Vram Address with the right Address remapping. More... | |
| std::string | getValueName (uint24_t addr) const override |
| Give the name of the Address register (used for debug) More... | |
| uint16_t | cgramRead (uint16_t addr) |
| Allow others components to read the CGRAM. More... | |
| int | getBPP (int bgNumber) const |
| get the bpp depending of the bgNumber and the Bgmode More... | |
| Vector2< int > | getCharacterSize (int bgNumber) const |
| Give the correct character size depending of the bgMode. More... | |
| uint16_t | getTileMapStartAddress (int bgNumber) const |
| Give the address where the tilemap starts. More... | |
| uint16_t | getTilesetAddress (int bgNumber) const |
| Give the address to find the correct tileset for a given x and y. More... | |
| Vector2< bool > | getBackgroundMirroring (int bgNumber) const |
| Tells if the tilemap is expanded for the x and y directions. More... | |
| void | renderMainAndSubScreen () |
| Render the Main and sub screen correctly. More... | |
| template<int levelLow, int levelHigh> | |
| void | addToMainSubScreen (Background &bg) |
| Add a bg to the sub and/or main screen. More... | |
| int | getBgMode () const |
| Get the current background Mode. More... | |
| void | updateVramReadBuffer () |
| update the Vram buffer More... | |
| Vector2< int > | getBgScroll (int bgNumber) const |
| update the Vram buffer More... | |
| const Registers & | getWriteRegisters () const |
| Allow to look the value of each write register (used by Register debugger) More... | |
Public Member Functions inherited from ComSquare::Memory::AMemory | |
| uint24_t | getRelativeAddress (uint24_t addr) const override |
| Translate an absolute address to a relative address. More... | |
| void | setMemoryRegion (uint24_t start, uint24_t end) |
| Change starting and ending points of this mapped memory. More... | |
| bool | hasMemoryAt (uint24_t addr) const override |
| Return true if this component has mapped the address. More... | |
| ~AMemory () override=default | |
| A default destructor. More... | |
Public Member Functions inherited from ComSquare::Memory::IMemory | |
| virtual | ~IMemory ()=default |
| A virtual default destructor. More... | |
Public Attributes | |
| Ram::Ram | vram |
| Rams. More... | |
| Ram::Ram | oamram |
| Ram::Ram | cgram |
Private Attributes | |
| Registers | _registers {} |
| Init ppuRegisters. More... | |
| Renderer::IRenderer & | _renderer |
| Background | _backgrounds [4] |
| Backgrounds buffers. More... | |
| std::array< std::array< uint32_t, 1024 >, 1024 > | _mainScreen |
| Main Screen buffer. More... | |
| std::array< std::array< uint8_t, 1024 >, 1024 > | _mainScreenLevelMap |
| std::array< std::array< uint8_t, 1024 >, 1024 > | _subScreenLevelMap |
| Sub Screen buffer. More... | |
| std::array< std::array< uint32_t, 1024 >, 1024 > | _subScreen |
| std::array< std::array< uint32_t, 1024 >, 1024 > | _screen |
| Final Screen buffer. More... | |
| uint16_t | _vramReadBuffer = 0 |
| Used for vram read registers (0x2139 - 0x213A) More... | |
| struct Utils::PpuState | _ppuState |
| Struct that contain all necessary vars for the use of the registers. More... | |
Additional Inherited Members | |
Protected Attributes inherited from ComSquare::Memory::AMemory | |
| uint24_t | _start = 0 |
| The starting address mapped to this component. More... | |
| uint24_t | _end = 0 |
| The last continuous address mapped to this components. For shadows, see the MemoryShadow class. More... | |
The class containing all the registers of the PPU.
|
explicit |
|
delete |
|
overridedefault |
|
inline |
Add a bg to the sub and/or main screen.
| uint16_t ComSquare::PPU::PPU::cgramRead | ( | uint16_t | addr | ) |
Allow others components to read the CGRAM.
| Vector2< bool > ComSquare::PPU::PPU::getBackgroundMirroring | ( | int | bgNumber | ) | const |
Tells if the tilemap is expanded for the x and y directions.
| int ComSquare::PPU::PPU::getBgMode | ( | ) | const |
Get the current background Mode.
| Vector2< int > ComSquare::PPU::PPU::getBgScroll | ( | int | bgNumber | ) | const |
update the Vram buffer
| int ComSquare::PPU::PPU::getBPP | ( | int | bgNumber | ) | const |
get the bpp depending of the bgNumber and the Bgmode
| Vector2< int > ComSquare::PPU::PPU::getCharacterSize | ( | int | bgNumber | ) | const |
Give the correct character size depending of the bgMode.
|
overridevirtual |
Get the component of this accessor (used for debug purpose)
Implements ComSquare::Memory::IMemory.
|
overridevirtual |
Get the name of this accessor (used for debug purpose)
Implements ComSquare::Memory::IMemory.
|
overridevirtual |
Get the size of the data. This size can be lower than the mapped data.
Implements ComSquare::Memory::IMemory.
| uint16_t ComSquare::PPU::PPU::getTileMapStartAddress | ( | int | bgNumber | ) | const |
Give the address where the tilemap starts.
| uint16_t ComSquare::PPU::PPU::getTilesetAddress | ( | int | bgNumber | ) | const |
Give the address to find the correct tileset for a given x and y.
|
overridevirtual |
Give the name of the Address register (used for debug)
Implements ComSquare::Memory::IMemory.
| uint16_t ComSquare::PPU::PPU::getVramAddress | ( | ) | const |
Give the Vram Address with the right Address remapping.
| const Registers & ComSquare::PPU::PPU::getWriteRegisters | ( | ) | const |
Allow to look the value of each write register (used by Register debugger)
|
overridevirtual |
Read data from the component.
| addr | The local address to read from (0x0 should refer to the first byte of this component). |
| This | function should thrown an InvalidAddress for address that are not mapped to the component. |
Implements ComSquare::Memory::IMemory.
| void ComSquare::PPU::PPU::renderMainAndSubScreen | ( | ) |
Render the Main and sub screen correctly.
|
virtual |
Update the PPU of n cycles.
| The | number of cycles to update. |
| void ComSquare::PPU::PPU::updateVramReadBuffer | ( | ) |
update the Vram buffer
|
overridevirtual |
Write data to this component.
| addr | The local address to write data (0x0 should refer to the first byte of this component). |
| data | The new data to write. |
| This | function should thrown an InvalidAddress for address that are not mapped to the component. |
Implements ComSquare::Memory::IMemory.
|
private |
Backgrounds buffers.
|
private |
Main Screen buffer.
|
private |
|
private |
Struct that contain all necessary vars for the use of the registers.
|
private |
Init ppuRegisters.
|
private |
|
private |
Final Screen buffer.
|
private |
|
private |
Sub Screen buffer.
|
private |
Used for vram read registers (0x2139 - 0x213A)
| Ram::Ram ComSquare::PPU::PPU::cgram |
| Ram::Ram ComSquare::PPU::PPU::oamram |
| Ram::Ram ComSquare::PPU::PPU::vram |
Rams.
1.8.17