This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SHA256 { | |
| public: | |
| using Digest = std::array<u8, 32>; | |
| SHA256() { | |
| mbedtls_sha256_init(&ctx); | |
| } | |
| SHA256(const SHA256& original) { | |
| mbedtls_sha256_clone(&ctx, &original.ctx); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <array> | |
| #include <cstdint> | |
| template <typename T, std::size_t max_count> | |
| class PoolAllocator { | |
| using Uninitialized = std::array<unsigned char, sizeof(T)>; | |
| std::array<Uninitialized, max_count> backing{}; | |
| std::array<Uninitialized*, max_count> pointer_stack{}; | |
| typename decltype(pointer_stack)::iterator stack_pointer = pointer_stack.begin(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #version 450 | |
| in vec2 tex_coord; | |
| out vec4 frag_color; | |
| layout(binding = 0) uniform sampler2D input_texure; | |
| vec4 cubic(float v) { | |
| vec4 n = vec4(1.0, 2.0, 3.0, 4.0) - v; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <limits> | |
| #include "types.hpp" | |
| namespace GBA { | |
| template <typename Storage, usize start, usize end, typename IO = Storage> | |
| class BitField { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <functional> | |
| #include "opcode.hpp" | |
| namespace GBA::CPU::DataProcessing { | |
| namespace Basic { | |
| using DataProcessingOperation = void (*)(ProcessorState& state, u32 operand_one, u32 operand_two, | |
| bool carry_in, u32& result) noexcept; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <algorithm> | |
| #include <string> | |
| class Solution { | |
| public: | |
| std::string longestPalindrome(const std::string& s) const { | |
| std::size_t longest{0}; | |
| std::string::const_iterator longest_begin, longest_end; | |
| // The search will start at the center of a potential palindrome | |
| // and work outward to find the length. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution { | |
| public: | |
| [[gnu::target("avx2")]] int reverse(int x) const { | |
| bool negative = x < 0; | |
| if (negative) { | |
| if (x == std::numeric_limits<int>::min()) | |
| return 0; | |
| x = -x; | |
| } | |
| if (x >= 10) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #version 330 | |
| in vec2 TexCoord; | |
| out vec4 FragColor; | |
| uniform sampler2D Texture; | |
| vec3 dtt = vec3(65536.0,255.0,1.0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //!DESC ScaleForce | |
| //!HOOK MAINPRESUB | |
| //!BIND HOOKED | |
| //!WIDTH OUTPUT.w | |
| //!HEIGHT OUTPUT.h | |
| //? #version 450 core | |
| #ifndef HOOKED_tex | |
| // Copy MPV built-ins for IDE | |
| #define tex1D texture |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <algorithm> | |
| #include <array> | |
| #include <bit> | |
| #include <chrono> | |
| #include <cstdint> | |
| #include <cstdlib> | |
| #include <cstring> | |
| #include <memory> | |
| #include <random> | |
| #include <string> |