mbv: move a few things around

This commit is contained in:
2025-09-04 15:01:50 +02:00
parent dd51b5d610
commit 9edebe637b
58 changed files with 68 additions and 494 deletions

13
mbv/lib/itoa.h Normal file
View File

@@ -0,0 +1,13 @@
#pragma once
// out must be at least 8 bytes long
inline void itoa(int val, char* out) {
for (int i = 0; i < 8; i++) {
uint8_t digit = (val >> (28 - 4 * i)) & 0xf;
if (digit < 0xa) {
out[i] = '0' + digit;
} else {
out[i] = 'a' + digit - 0xa;
}
}
}