summaryrefslogtreecommitdiff
path: root/lib/nes/ppu.hh
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-01-26 23:19:56 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-01-26 23:19:56 +0100
commit430a246fe81d7eab6823bf6ca4562fd1e99f2a5d (patch)
tree75c5f4e8eeeb1e5f25c866e828440e5c493bed8b /lib/nes/ppu.hh
parentd1f4b65eafe9c41ecca7bbe8026ec0a693c1ecda (diff)
refactor mappers
Diffstat (limited to 'lib/nes/ppu.hh')
-rw-r--r--lib/nes/ppu.hh9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/nes/ppu.hh b/lib/nes/ppu.hh
index 8e521c5..0301ec4 100644
--- a/lib/nes/ppu.hh
+++ b/lib/nes/ppu.hh
@@ -6,15 +6,16 @@ namespace nes
{
class address;
class cpu;
- class mapper;
+ class cartridge;
class display;
class rgb;
struct snapshot;
class ppu
{
+ static constexpr auto sprite_max_count = unsigned{ 64 };
static constexpr auto vram_size = std::size_t{ 0x800 };
- static constexpr auto oam_size = std::size_t{ 0x100 };
+ static constexpr auto oam_size = std::size_t{ sprite_max_count * 4 };
static constexpr auto palette_buffer_size = std::size_t{ 0x20 };
static constexpr auto tile_size = unsigned{ 8 };
// Writes to some registers are ignored until this clock cycle.
@@ -95,7 +96,7 @@ namespace nes
cycle_count current_cycles_;
cpu& cpu_;
- mapper& mapper_;
+ cartridge& cartridge_;
display& display_;
std::uint8_t vram_[vram_size]{};
std::uint8_t oam_[oam_size]{};
@@ -235,7 +236,7 @@ namespace nes
unsigned sprite_count_{ 0 }; // Number of evaluated sprites in sprites_.
public:
- explicit ppu(cpu&, mapper&, display&);
+ explicit ppu(cpu&, cartridge&, display&);
ppu(ppu const&) = delete;
ppu(ppu&&) = delete;