From 6512dd599d13035f6a90b2009344e02c488f5aae Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Thu, 23 Jan 2025 19:37:32 +0100 Subject: initial working version --- src/status.hh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'src/status.hh') diff --git a/src/status.hh b/src/status.hh index 705ae6e..b56be58 100644 --- a/src/status.hh +++ b/src/status.hh @@ -14,6 +14,9 @@ namespace test nes::cycle_count cpu_cycle; std::vector ram; std::vector sram; + std::vector vram; + std::vector oam; + std::vector chrrom; struct { std::uint16_t pc{}; @@ -52,4 +55,43 @@ namespace test return true; } }; + + struct memory_operation + { + enum class type + { + read_ppustatus, + read_oamdata, + read_ppudata, + write_ppuctrl, + write_ppuscroll, + write_ppumask, + write_ppuaddr, + write_ppudata, + write_oamaddr, + write_oamdata, + write_oamdma, + }; + + explicit constexpr memory_operation(type const t, std::uint8_t const v, nes::cycle_count cycles) + : t{ t } + , v{ v } + , cycles{ cycles } + { + } + + type t{}; + std::uint8_t v{}; + nes::cycle_count cycles; + }; + + constexpr auto operator==(memory_operation const a, memory_operation const b) -> bool + { + return a.t == b.t && a.v == b.v; + } + + constexpr auto operator!=(memory_operation const a, memory_operation const b) -> bool + { + return a.t != b.t || a.v != b.v; + } } // namespace test \ No newline at end of file -- cgit v1.3.1