From 67436a2e88db82702717bc8b933222a7f13a439a Mon Sep 17 00:00:00 2001 From: Jaby Date: Tue, 10 Jan 2023 21:12:41 +0100 Subject: [PATCH] Support easier read --- include/PSX/System/IOPorts/ioport.hpp | 5 +++++ include/PSX/Timer/high_res_timer.hpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/PSX/System/IOPorts/ioport.hpp b/include/PSX/System/IOPorts/ioport.hpp index 3451e1d4..567414b8 100644 --- a/include/PSX/System/IOPorts/ioport.hpp +++ b/include/PSX/System/IOPorts/ioport.hpp @@ -14,6 +14,11 @@ namespace JabyEngine { return const_cast*>(this)->value; } + template + constexpr S read(const BitRange& range) const { + return IOPort::read().get_value(range); + } + template constexpr void write_combined(const ARGS&... value) { IOPort::write(T::with(value...)); diff --git a/include/PSX/Timer/high_res_timer.hpp b/include/PSX/Timer/high_res_timer.hpp index cca49493..34ab6a91 100644 --- a/include/PSX/Timer/high_res_timer.hpp +++ b/include/PSX/Timer/high_res_timer.hpp @@ -66,7 +66,7 @@ namespace JabyEngine { ~HighResTime() = delete; static TimeStamp get_time_stamp() { - return TimeStamp(HighResTime::global_counter_10ms, Timer_IO::Counter2.value.read().get_value(Timer_IO::CounterValue::Value)); + return TimeStamp(HighResTime::global_counter_10ms, Timer_IO::Counter2.value.read(Timer_IO::CounterValue::Value)); } }; #endif //JABYENGINE_USE_HIGH_PERCISION_TIMER