diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2024-01-05 03:37:43 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2024-01-05 18:41:15 +0100 |
commit | ee847f8ff0b1b0aec39c1b78c010bc0c08a0a613 (patch) | |
tree | 3b95cbb74be05f0ce7a007353f1f9f95e1ed3901 /src/core/hle/service/hid/irs_ring_lifo.h | |
parent | Merge pull request #12437 from ameerj/gl-amd-fixes (diff) | |
download | yuzu-ee847f8ff0b1b0aec39c1b78c010bc0c08a0a613.tar yuzu-ee847f8ff0b1b0aec39c1b78c010bc0c08a0a613.tar.gz yuzu-ee847f8ff0b1b0aec39c1b78c010bc0c08a0a613.tar.bz2 yuzu-ee847f8ff0b1b0aec39c1b78c010bc0c08a0a613.tar.lz yuzu-ee847f8ff0b1b0aec39c1b78c010bc0c08a0a613.tar.xz yuzu-ee847f8ff0b1b0aec39c1b78c010bc0c08a0a613.tar.zst yuzu-ee847f8ff0b1b0aec39c1b78c010bc0c08a0a613.zip |
Diffstat (limited to 'src/core/hle/service/hid/irs_ring_lifo.h')
-rw-r--r-- | src/core/hle/service/hid/irs_ring_lifo.h | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/core/hle/service/hid/irs_ring_lifo.h b/src/core/hle/service/hid/irs_ring_lifo.h deleted file mode 100644 index 255d1d296..000000000 --- a/src/core/hle/service/hid/irs_ring_lifo.h +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include <array> - -#include "common/common_types.h" - -namespace Service::IRS { - -template <typename State, std::size_t max_buffer_size> -struct Lifo { - s64 sampling_number{}; - s64 buffer_count{}; - std::array<State, max_buffer_size> entries{}; - - const State& ReadCurrentEntry() const { - return entries[GetBufferTail()]; - } - - const State& ReadPreviousEntry() const { - return entries[GetPreviousEntryIndex()]; - } - - s64 GetBufferTail() const { - return sampling_number % max_buffer_size; - } - - std::size_t GetPreviousEntryIndex() const { - return static_cast<size_t>((GetBufferTail() + max_buffer_size - 1) % max_buffer_size); - } - - std::size_t GetNextEntryIndex() const { - return static_cast<size_t>((GetBufferTail() + 1) % max_buffer_size); - } - - void WriteNextEntry(const State& new_state) { - if (buffer_count < static_cast<s64>(max_buffer_size)) { - buffer_count++; - } - sampling_number++; - entries[GetBufferTail()] = new_state; - } -}; - -} // namespace Service::IRS |