Vendor Teakra, make emulator own DSP RAM and add DSP RAM to fastmem (#806)

* DSP: Own DSP RAM and add it to fastmem

* Vendor Teakra

* Add MacOS support to fastmem

* Fix MacOS fastmem paths

* Fix iOS build
This commit is contained in:
wheremyfoodat
2025-08-22 02:12:21 +03:00
committed by GitHub
parent ff100dc5ac
commit 78002be334
132 changed files with 37774 additions and 15 deletions

26
third_party/teakra/src/bit.h vendored Normal file
View File

@@ -0,0 +1,26 @@
#pragma once
#include <limits>
#include <type_traits>
#ifdef _MSC_VER
#include <intrin.h>
#endif
namespace std20 {
// A simple (and not very correct) implementation of C++20's std::log2p1
template <class T>
constexpr T log2p1(T x) noexcept {
static_assert(std::is_integral_v<T> && std::is_unsigned_v<T>);
if (x == 0)
return 0;
#ifdef _MSC_VER
unsigned long index = 0;
_BitScanReverse64(&index, x);
return static_cast<T>(index) + 1;
#else
return static_cast<T>(std::numeric_limits<unsigned long long>::digits - __builtin_clzll(x));
#endif
}
} // namespace std20