basic ppu background rendering

This commit is contained in:
Lauchmelder 2022-03-03 17:29:56 +01:00
parent f9f401c6c0
commit aef80e42fb
No known key found for this signature in database
GPG key ID: C2403C69D78F011D
21 changed files with 468 additions and 41 deletions

View file

@ -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;