diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-02-01 01:14:03 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-02-01 01:14:03 +0100 |
| commit | 9ca793417149cbaa7b5f4b7797bc929e6e191f28 (patch) | |
| tree | 3f067cad3fe7e606e5e9ea1dd8079874de3f048c /lib/nes/sys/controller.cc | |
| parent | 1d5f5482f91391a6dfee9ec0e7cb0a22ee5f0464 (diff) | |
use custom integer types
Diffstat (limited to 'lib/nes/sys/controller.cc')
| -rw-r--r-- | lib/nes/sys/controller.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/nes/sys/controller.cc b/lib/nes/sys/controller.cc index 92dd897..d653f44 100644 --- a/lib/nes/sys/controller.cc +++ b/lib/nes/sys/controller.cc @@ -2,15 +2,15 @@ namespace nes::sys { - auto controller::read() -> std::uint8_t + auto controller::read() -> u8 { 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); + return static_cast<u8>(res); } - auto controller::write(std::uint8_t const value) -> void + auto controller::write(u8 const value) -> void { strobing_ = value & 1; if (strobing_) { index_ = 0; } |
