From 5959349f341a2380c0c3f41ec40a1e8e0d969d00 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Wed, 29 Jan 2025 14:49:20 +0100 Subject: refactor: move emulation logic into sys --- lib/nes/ref/controller.cc | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 lib/nes/ref/controller.cc (limited to 'lib/nes/ref/controller.cc') diff --git a/lib/nes/ref/controller.cc b/lib/nes/ref/controller.cc deleted file mode 100644 index 70d6ba2..0000000 --- a/lib/nes/ref/controller.cc +++ /dev/null @@ -1,18 +0,0 @@ -#include "nes/ref/controller.hh" - -namespace nes::ref -{ - auto controller::read() -> std::uint8_t - { - auto const res = index_ < 8 ? (pressed_.get_raw_value() >> index_) & 1 : 0; - index_ += 1; - if (strobing_) { index_ = 0; } - return static_cast(res); - } - - auto controller::write(std::uint8_t const value) -> void - { - strobing_ = value & 1; - if (strobing_) { index_ = 0; } - } -} // namespace nes::ref \ No newline at end of file -- cgit v1.3.1