summaryrefslogtreecommitdiff
path: root/lib/nes/sys/ppu.cc
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-06 19:54:38 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-06 19:54:38 +0100
commit64ebfde8bcd6408e3b6925624e8680c314db6efc (patch)
treeb969314f909f7f16ef5acc63f90dca317a40850a /lib/nes/sys/ppu.cc
parentd060e3a50c987d10799ccc739bdbf9d7d7a13c10 (diff)
get rid of nasty stdlib
Diffstat (limited to 'lib/nes/sys/ppu.cc')
-rw-r--r--lib/nes/sys/ppu.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/nes/sys/ppu.cc b/lib/nes/sys/ppu.cc
index 2419030..ce145d5 100644
--- a/lib/nes/sys/ppu.cc
+++ b/lib/nes/sys/ppu.cc
@@ -6,6 +6,7 @@
#include "nes/common/display.hh"
#include "nes/common/rgb.hh"
#include "nes/common/debug.hh"
+#include "nes/common/utils.hh"
namespace nes::sys
{
@@ -16,11 +17,13 @@ namespace nes::sys
{
}
+#ifdef NES_ENABLE_SNAPSHOTS
auto ppu::build_snapshot(snapshot& snapshot) -> void
{
snapshot.vram = std::vector(std::begin(vram_), std::end(vram_));
snapshot.oam = std::vector(std::begin(oam_), std::end(oam_));
}
+#endif
auto ppu::step() -> void
{
@@ -291,7 +294,7 @@ namespace nes::sys
{
for (auto i = u32{ 0 }; i < tile_size / 2; ++i)
{
- std::swap(res.colors[i], res.colors[tile_size - 1 - i]);
+ swap(res.colors[i], res.colors[tile_size - 1 - i]);
}
}
@@ -382,7 +385,7 @@ namespace nes::sys
if (addr % 0x4000 <= address{ 0x3EFF })
{
- std::swap(res, ppudata_read_buffer_);
+ swap(res, ppudata_read_buffer_);
}
else
{