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 <cstdint> | |
#include <iostream> | |
#ifdef _MSC_VER | |
#include <intrin.h> | |
#define clz(x) __lzcnt64(x) | |
#else | |
#define clz(x) __builtin_clzll(x) | |
#endif |
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 <cstdint> | |
#include <iostream> | |
#include <optional> | |
#include <tuple> | |
#include <vector> | |
#include <thread> | |
#include <map> | |
#include <iterator> |
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 <cstdint> | |
#include <iostream> | |
#include <map> | |
#include <optional> | |
#include <tuple> | |
#include <vector> | |
using s64 = std::int64_t; | |
using Element = std::pair<s64, std::size_t>; |
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
use crate::chip8::{Chip8, Frame}; | |
use std::fs::File; | |
use std::io::Read; | |
use std::path::Path; | |
use std::sync::atomic::Ordering; | |
const INITIAL_SCALE: u32 = 8; | |
const WIDTH: usize = 64; | |
const HEIGHT: usize = 32; | |
const TEXTURE_SIZE: usize = WIDTH * HEIGHT * 4; |
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 <memory> | |
template <typename T> | |
class ValueGetter { | |
public: | |
constexpr explicit ValueGetter(const T& value) noexcept : m_value{value} { | |
} | |
constexpr const T& get() const { | |
return m_value; |
NewerOlder