early-access version 1463

This commit is contained in:
pineappleEA 2021-02-15 21:07:02 +01:00
parent 23023e6b7e
commit be16dac2a2
3 changed files with 7 additions and 14 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 1462. This is the source code for early-access 1463.
## Legal Notice ## Legal Notice

View File

@ -265,6 +265,7 @@ add_library(core STATIC
hle/service/am/applets/software_keyboard.h hle/service/am/applets/software_keyboard.h
hle/service/am/applets/web_browser.cpp hle/service/am/applets/web_browser.cpp
hle/service/am/applets/web_browser.h hle/service/am/applets/web_browser.h
hle/service/am/applets/web_types.h
hle/service/am/idle.cpp hle/service/am/idle.cpp
hle/service/am/idle.h hle/service/am/idle.h
hle/service/am/omm.cpp hle/service/am/omm.cpp

View File

@ -4,19 +4,11 @@
#pragma once #pragma once
#include <cstdint> #include <bit>
#include "common/common_types.h"
namespace Tegra::Texture::ASTC { namespace Tegra::Texture::ASTC {
/// Count the number of bits set in a number.
constexpr u32 Popcnt(u32 n) {
u32 c = 0;
for (; n; c++) {
n &= n - 1;
}
return c;
}
enum class IntegerEncoding { JustBits, Qus32, Trit }; enum class IntegerEncoding { JustBits, Qus32, Trit };
struct IntegerEncodedValue { struct IntegerEncodedValue {
@ -57,17 +49,17 @@ constexpr IntegerEncodedValue CreateEncoding(u32 maxVal) {
// Is maxVal a power of two? // Is maxVal a power of two?
if (!(check & (check - 1))) { if (!(check & (check - 1))) {
return IntegerEncodedValue(IntegerEncoding::JustBits, Popcnt(maxVal)); return IntegerEncodedValue(IntegerEncoding::JustBits, std::popcount(maxVal));
} }
// Is maxVal of the type 3*2^n - 1? // Is maxVal of the type 3*2^n - 1?
if ((check % 3 == 0) && !((check / 3) & ((check / 3) - 1))) { if ((check % 3 == 0) && !((check / 3) & ((check / 3) - 1))) {
return IntegerEncodedValue(IntegerEncoding::Trit, Popcnt(check / 3 - 1)); return IntegerEncodedValue(IntegerEncoding::Trit, std::popcount(check / 3 - 1));
} }
// Is maxVal of the type 5*2^n - 1? // Is maxVal of the type 5*2^n - 1?
if ((check % 5 == 0) && !((check / 5) & ((check / 5) - 1))) { if ((check % 5 == 0) && !((check / 5) & ((check / 5) - 1))) {
return IntegerEncodedValue(IntegerEncoding::Qus32, Popcnt(check / 5 - 1)); return IntegerEncodedValue(IntegerEncoding::Qus32, std::popcount(check / 5 - 1));
} }
// Apparently it can't be represented with a bounded integer sequence... // Apparently it can't be represented with a bounded integer sequence...