diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-01-23 23:18:42 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-01-23 23:18:42 +0100 |
| commit | bdb2114b9d2557c6700f3176128a0488a779421e (patch) | |
| tree | f578d514654056ce1817e75a6afc8ea817e3544c /lib/nes/ppu.cc | |
| parent | a8fc40d4badfd73917171b081f57b88b80bd1e69 (diff) | |
some cleanup
Diffstat (limited to 'lib/nes/ppu.cc')
| -rw-r--r-- | lib/nes/ppu.cc | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/nes/ppu.cc b/lib/nes/ppu.cc index 23a41fb..0f56c96 100644 --- a/lib/nes/ppu.cc +++ b/lib/nes/ppu.cc @@ -131,7 +131,7 @@ namespace nes { display_.switch_buffers(); status_.vblank = true; - nmi_change(); + if (control_.vblank_nmi) { cpu_.trigger_nmi(); } } if (pre_line && scanline_cycle_ == 1) { @@ -514,7 +514,7 @@ namespace nes NES_DEBUG_LOG(ppu, "PPUCTRL <- {:#2x}", value); control_.value = value; internal_.t = static_cast<std::uint16_t>((internal_.t & 0xF3FF) | ((value & 0x03) << 10)); - nmi_change(); + if (control_.vblank_nmi && status_.vblank) { cpu_.trigger_nmi(); } } } @@ -598,7 +598,6 @@ namespace nes auto ppu::write_oamdma(std::uint8_t const value) -> void { - // TODO: Do this in CPU::step instead in case there's an NMI? NES_DEBUG_LOG(ppu, "OAMDMA <- {:#2x}", value); auto addr = address{ value, 0x00 }; for (auto i = unsigned{ 0 }; i < 256; ++i) @@ -616,14 +615,6 @@ namespace nes // Helpers // ----------------------------------------------------------------------------------------------------------------- - auto ppu::nmi_change() -> void - { - if (control_.vblank_nmi && status_.vblank) - { - cpu_.trigger_nmi(); - } - } - auto ppu::sprite_height() -> unsigned { switch (control_.sprite_size) |
