From b1d1573702f21e3104606d6ade5f5d39ec86a33a Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Thu, 23 Jan 2025 22:02:11 +0100 Subject: restructure project --- src/status.hh | 97 ----------------------------------------------------------- 1 file changed, 97 deletions(-) delete mode 100644 src/status.hh (limited to 'src/status.hh') diff --git a/src/status.hh b/src/status.hh deleted file mode 100644 index b56be58..0000000 --- a/src/status.hh +++ /dev/null @@ -1,97 +0,0 @@ -#pragma once - -#include "nes/util/cycle_count.hh" -#include -#include - -namespace test -{ - /// System status used for comparison. - struct status - { - explicit status() = default; - - 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{}; - std::uint8_t sp{}; - std::uint8_t a{}; - std::uint8_t x{}; - std::uint8_t y{}; - std::uint8_t p{}; - bool c{}; - bool z{}; - bool i{}; - bool d{}; - bool b{}; - bool v{}; - bool n{}; - } registers{}; - - static auto equal(status const& a, status const& b) -> bool - { - if (a.cpu_cycle != b.cpu_cycle) { return false; } - if (a.ram != b.ram) { return false; } - if (a.sram != b.sram) { return false; } - if (a.registers.pc != b.registers.pc) { return false; } - if (a.registers.sp != b.registers.sp) { return false; } - if (a.registers.a != b.registers.a) { return false; } - if (a.registers.x != b.registers.x) { return false; } - if (a.registers.y != b.registers.y) { return false; } - if (a.registers.p != b.registers.p) { return false; } - if (a.registers.c != b.registers.c) { return false; } - if (a.registers.z != b.registers.z) { return false; } - if (a.registers.i != b.registers.i) { return false; } - if (a.registers.d != b.registers.d) { return false; } - if (a.registers.b != b.registers.b) { return false; } - if (a.registers.v != b.registers.v) { return false; } - if (a.registers.n != b.registers.n) { return false; } - 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