{{ message }}

Instantly share code, notes, and snippets.

# merry MerryMage

Created Apr 20, 2020
 #include template #if defined(_MSC_VER) __declspec(noinline, noreturn) #elif defined(__GNUC__) [[noreturn, gnu::noinline, gnu::cold]] #endif static void assert_noinline_call(const Fn& fn) { fn();
Created Jul 21, 2019
View constructor.cpp
 #include class A { public: A() = default; static void OverridableInit() { std::printf("I am in A\n"); }
Created Jun 3, 2019
 case Type::LowShelf: if(gain >= 0) { n = 1 / (1 + k / q + k * k); a0 = (1 + sqrt(v) / q * k + v * k * k) * n; a1 = 2 * (v * k * k - 1) * n; a2 = (1 - sqrt(v) / q * k + v * k * k) * n; b1 = 2 * (k * k - 1) * n; b2 = (1 - k / q + k * k) * n; } else { n = 1 / (1 + sqrt(v) / q * k + v * k * k);
Created Jun 3, 2019
View high_shelf2.py
 import math import numpy import matplotlib.pyplot as plt def IdealH(f): T = 1. / 441000. # we use the tenfold sampling frequency OmegaU = 1. / 15e-6 OmegaL = 15. / 50. * OmegaU # Calculate filter coefficients V0 = OmegaL / OmegaU
Created Jun 3, 2019
View high_shelf.py
 import math import numpy import matplotlib.pyplot as plt def IdealH(f): T = 1. / 441000. # we use the tenfold sampling frequency OmegaU = 1. / 15e-6 OmegaL = 15. / 50. * OmegaU # Calculate filter coefficients
Created Jan 15, 2018
View signatures.cpp
 void ADR(Imm<2> immlo, Imm<19> immhi, Reg Rd); void ADRP(Imm<2> immlo, Imm<19> immhi, Reg Rd); void ADD_addsub_imm(bool sf, Imm<2> shift, Imm<12> imm12, Reg Rn, Reg Rd); void ADDS_addsub_imm(bool sf, Imm<2> shift, Imm<12> imm12, Reg Rn, Reg Rd); void SUB_addsub_imm(bool sf, Imm<2> shift, Imm<12> imm12, Reg Rn, Reg Rd); void SUBS_addsub_imm(bool sf, Imm<2> shift, Imm<12> imm12, Reg Rn, Reg Rd); void AND_log_imm(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd); void ORR_log_imm(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd); void EOR_log_imm(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd); void ANDS_log_imm(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd);
Last active Feb 11, 2018
View arm64 inst
 ld1 {v4.s}[1], [x7], #4 fadd v1.2s, v1.2s, v3.2s sshll v2.4s, v2.4h, #0 sshll v3.4s, v3.4h, #0 fmul v3.2s, v4.2s, v3.s[0] fcvtzs w12, s0, #0xf fsqrt s0, s0 frinta s0, s0 fmax d1, d1, d2 fmin d8, d0, d2
Last active Jan 8, 2021
Dumping the GBA BIOS
View post.md

# Dumping the GBA BIOS

endrift has recently written an article on a new method she discovered for dumping the GBA's BIOS, different from the MidiKey2Freq method currently used. This article is about a third method I've discovered that is different from those two.

I've been having a very recent fascination with the Game Boy Advance. The hardware is simple relative to more complex modern handhelds and the CPU is of an architecture I'm already familiar with (ARM7TDMI), making it a rather fun toy to play with. The GBA is a console where cycle counting is important. In order to learn more about the hardware, I have been reading documentation that others have produced (like Martin Korth's GBATEK) and writing small programs to test edge-cases of the hardware that I didn't quite understand. One example of this was the BIOS ROM.

### BIOS Protection

The

Last active Aug 5, 2017
View main.c
 #include #include #include #include #include #include #include u32* WRAM = (u32*)0x02000000;
Created Jul 10, 2017
Personal Notes on the Coroutines TS
View coro.md

These comments are based on n4663 (2017-03-25).

## New Expressions

Coroutines add a small number of new expressions to the language:

• co-await expression: `co_await` cast-expression