Implement preliminary version of "reverse" feature

Not hooked to all RGBGFX flags yet, but good enough for most use cases
(and as a base for future development, should I need to `reset --hard`.)

TODOs marked appropriately.
This commit is contained in:
ISSOtm
2022-03-27 20:21:00 +02:00
committed by Eldred Habert
parent 843022772b
commit cc27169ecd
9 changed files with 428 additions and 18 deletions

View File

@@ -552,14 +552,6 @@ static void outputPalettes(std::vector<Palette> const &palettes) {
}
}
static uint8_t flip(uint8_t byte) {
// To flip all the bits, we'll flip both nibbles, then each nibble half, etc.
byte = (byte & 0x0F) << 4 | (byte & 0xF0) >> 4;
byte = (byte & 0x33) << 2 | (byte & 0xCC) >> 2;
byte = (byte & 0x55) << 1 | (byte & 0xAA) >> 1;
return byte;
}
class TileData {
std::array<uint8_t, 16> _data;
// The hash is a bit lax: it's the XOR of all lines, and every other nibble is identical