diff options
Diffstat (limited to 'lib/nes/controller.cc')
| -rw-r--r-- | lib/nes/controller.cc | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/lib/nes/controller.cc b/lib/nes/controller.cc deleted file mode 100644 index d9d6946..0000000 --- a/lib/nes/controller.cc +++ /dev/null @@ -1,18 +0,0 @@ -#include "nes/controller.hh" - -namespace nes -{ - 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<std::uint8_t>(res); - } - - auto controller::write(std::uint8_t const value) -> void - { - strobing_ = value & 1; - if (strobing_) { index_ = 0; } - } -} // namespace nes
\ No newline at end of file |
