From 7aecc00919b7a94f99baefbd6780190304ac42cb Mon Sep 17 00:00:00 2001 From: Chris Pickel Date: Sun, 21 Apr 2024 01:20:16 +0900 Subject: [PATCH] Fix rectangular rgbgfx --reverse --columns (#1392) When width != height, the math was off, causing some tiles to be repeated or skipped. --- src/gfx/reverse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gfx/reverse.cpp b/src/gfx/reverse.cpp index b998d5e2..b539eb69 100644 --- a/src/gfx/reverse.cpp +++ b/src/gfx/reverse.cpp @@ -333,7 +333,7 @@ void reverse() { for (size_t ty = 0; ty < height; ++ty) { for (size_t tx = 0; tx < width; ++tx) { - size_t index = options.columnMajor ? ty + tx * width : ty * width + tx; + size_t index = options.columnMajor ? ty + tx * height : ty * width + tx; // By default, a tile is unflipped, in bank 0, and uses palette #0 uint8_t attribute = attrmap.has_value() ? (*attrmap)[index] : 0x00; bool bank = attribute & 0x08;