mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-22 02:45:07 -04:00
kernelldr: miscellaneous fixes
This commit is contained in:
parent
3c7c1fbd8a
commit
f78653d815
7 changed files with 45 additions and 42 deletions
|
@ -21,20 +21,6 @@ namespace ams::util {
|
|||
|
||||
template<char A, char B, char C, char D>
|
||||
struct FourCC {
|
||||
/* TODO: C++20 std::endian */
|
||||
static constexpr u32 Code = (static_cast<u32>(A) << 0x18) |
|
||||
(static_cast<u32>(B) << 0x10) |
|
||||
(static_cast<u32>(C) << 0x08) |
|
||||
(static_cast<u32>(D) << 0x00);
|
||||
|
||||
static constexpr const char String[] = {D, C, B, A};
|
||||
|
||||
static_assert(sizeof(Code) == 4);
|
||||
static_assert(sizeof(String) == 4);
|
||||
};
|
||||
|
||||
template<char A, char B, char C, char D>
|
||||
struct ReverseFourCC {
|
||||
/* TODO: C++20 std::endian */
|
||||
static constexpr u32 Code = (static_cast<u32>(A) << 0x00) |
|
||||
(static_cast<u32>(B) << 0x08) |
|
||||
|
@ -47,4 +33,18 @@ namespace ams::util {
|
|||
static_assert(sizeof(String) == 4);
|
||||
};
|
||||
|
||||
template<char A, char B, char C, char D>
|
||||
struct ReverseFourCC {
|
||||
/* TODO: C++20 std::endian */
|
||||
static constexpr u32 Code = (static_cast<u32>(A) << 0x18) |
|
||||
(static_cast<u32>(B) << 0x10) |
|
||||
(static_cast<u32>(C) << 0x08) |
|
||||
(static_cast<u32>(D) << 0x00);
|
||||
|
||||
static constexpr const char String[] = {D, C, B, A};
|
||||
|
||||
static_assert(sizeof(Code) == 4);
|
||||
static_assert(sizeof(String) == 4);
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue