basic ppu background rendering
This commit is contained in:
parent
f9f401c6c0
commit
aef80e42fb
21 changed files with 468 additions and 41 deletions
20
src/PPU.hpp
20
src/PPU.hpp
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include "Types.hpp"
|
||||
|
||||
class Bus;
|
||||
|
@ -43,6 +44,17 @@ union VRAMAddress
|
|||
Word Raw;
|
||||
};
|
||||
|
||||
union ShiftRegister
|
||||
{
|
||||
struct
|
||||
{
|
||||
Byte Lo;
|
||||
Byte Hi;
|
||||
};
|
||||
|
||||
Word Raw;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The PPU of the NES.
|
||||
*/
|
||||
|
@ -50,6 +62,9 @@ class PPU
|
|||
{
|
||||
friend class PPUWatcher;
|
||||
|
||||
public:
|
||||
static const std::vector<Color> colorTable;
|
||||
|
||||
public:
|
||||
PPU(Bus* bus, Screen* screen);
|
||||
|
||||
|
@ -170,6 +185,11 @@ private: // Registers
|
|||
Byte patternTableLo = 0x00;
|
||||
Byte patternTableHi = 0x00;
|
||||
|
||||
ShiftRegister loTile{ 0 };
|
||||
ShiftRegister hiTile{ 0 };
|
||||
ShiftRegister hiAttribute{ 0 };
|
||||
ShiftRegister loAttribute{ 0 };
|
||||
|
||||
private:
|
||||
ScanlineType scanlineType;
|
||||
CycleType cycleType;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue