mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Implement bit flipping with a lookup table
Should improve performance. This version is cooler, and also does not suffer from iteration limits
This commit is contained in:
@@ -271,8 +271,8 @@ void reverse() {
|
||||
uint8_t realY = attribute & 0x40 ? 7 - y : y;
|
||||
uint8_t bitplane0 = tileData[realY * 2], bitplane1 = tileData[realY * 2 + 1];
|
||||
if (attribute & 0x20) { // Handle horizontal flip
|
||||
bitplane0 = flip(bitplane0);
|
||||
bitplane1 = flip(bitplane1);
|
||||
bitplane0 = flipTable[bitplane0];
|
||||
bitplane1 = flipTable[bitplane1];
|
||||
}
|
||||
uint8_t *ptr = &rowPtrs[y][tx * 8 * SIZEOF_PIXEL];
|
||||
for (uint8_t x = 0; x < 8; ++x) {
|
||||
|
||||
Reference in New Issue
Block a user