each level—excluding level 0 (null)—is further divided by 18 shades (from 18 = 128 / 7 non-null levels), which remains 2 extra shades for level 0: 0 for transparent and 1 for black.
the resulting color for each shade is then its corresponding slice of its level's output range starting from the top.
for example, for level 1 (R) with an output range of [0, 255], shade 0 is 3, shade 1 is 17, shade 2 is 31, ... shade 18 is 255.
128-bit bitmap system: 11-bit by 11-bit plus 7-bit color.
the range [0, 127] of the 7-bit color is divided into 8 levels [0, 7], each level being a different combination of R, G, B, and null: null, R, G, B, RG, RB, GB, and RGB.
since we're converting the 7-bit color into a 3-channel 8-bit color vector, each level has a different output range, each divided by the 18 shades: level 1, 2, and 3 with [0, 255], level 4, 5, and 6 with [0, 65025], and
level 7 with [0, 16581375].
so this shall be the encoding for all input. code before it should just translate input sources into the encoding, and code after it shall be oblivious to before it.
for game input, i want a unifying encoding for all controller buttons, keyboard keys, even mouse buttons and motions with a single encoding.
essentially, 8 bits for index/direction/key/button and 8 bits for state/magnitude/pressure/displacement.
this principle applies to mouse motion too. the motions of a mouse moving towards a particular direction can be encoded as a keyboard key or controller button. this is especially obvious when compared to a controller trigger button or hall effect keyboards.
i'm not a fan of `QueryPerformanceCounter`.
i've used `SYSTEM_HYPERVISOR_USER_SHARED_DATA` to translate `RDTSCP` into a standard time, but Microsoft's docs regarding `RDTSCP` is scary.
instead of using the decimal system for timing (e.g., 1000 for milliseconds)—which means using division and multiplication instructions—i'm using a base-2 system (e.g., 1024 for "milliseconds") to use cheap math, such as bit shifts.
i had it working with GCC, but debugging (-g) is broken.
i definitely see the value of having a builtin debugger embedded in the program itself rather than an external once.
i attempted to completely eliminate the need for functions in C via inline/embedded functions within the main function, with very minimal assembly, while being able to define variables, types, constants, and other symbols once locally around the relevant code.
i ended up encountering annoying compiler bugs and gimmicks from GCC and Clang, especially with explicit register variables.
Clang doesn't support local explicit register variables, and GCC's is broken, plus its debug info (-g).
ultimately, i went back to assembly.