This file contains 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 <cmath> | |
#include <numbers> | |
#include "circular.hpp" | |
constexpr std::size_t k_audio_buffer_max_length{ 3000 }; | |
using sample = float; | |
using audio_buffer = circular<sample, k_audio_buffer_max_length>; | |
void audio_callback_example(audio_buffer::iterator buffer_start, audio_buffer::iterator buffer_end) | |
{ |
This file contains 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
// How much of this syntax is understandable? | |
int f1(int i) | |
{ | |
return i * 5; | |
} | |
template <typename T> | |
T f2(T t1, T t2) | |
{ | |
return t1 * t2; |
This file contains 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 3 | |
emuVersion 20604 | |
rerecordCount 8737 | |
palFlag 0 | |
romFilename Tetris (USA) | |
romChecksum base64:Ww5XFVjIx5aTe5avRpVhxg== | |
guid 3888A360-71BA-CBC6-B95C-A06268666AD4 | |
fourscore 0 | |
microphone 0 | |
port0 1 |
This file contains 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
// Copyright 2022 Bryce Dixon | |
// | |
// Permission is hereby granted, free of charge, | |
// to any person obtaining a copy of this software | |
// and associated documentation files (the "Software"), | |
// to deal in the Software without restriction, | |
// including without limitation the rights to use, | |
// copy, modify, merge, publish, distribute, sublicense, | |
// and/or sell copies of the Software, and to permit | |
// persons to whom the Software is furnished to do so, |
This file contains 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
// This file is to showcase the use of the relatively new constexpr keyword to | |
// allow for processing of C-style strings at compile time. | |
// In turn, this allows for the use of C-style strings as cases in a switch | |
// statement. This is something that is typically impossible as C-style strings | |
// effectively degrade into void* in this situation as no string comparison | |
// is normally possible. | |
// An example of why this would be useful would be in an assembler or other | |
// simple language interpreter to improve interpretation time from O(n) | |
// in an if {} else if {} chain to O(log(n)). | |
// Another benefit over using enums is the lowered reliance on consistancy across |