tron-room-demo: store the framebuffer in panel wire order (fixes swapped colors on HW)

The ST7789 receives pixel bytes high-byte-first, and TFT_eSprite's
pushSprite sends the sprite buffer raw — which is why the sprite's own
primitives store colors byte-swapped (drawPixel: color = color>>8 |
color<<8). RoomViewCore wrote native little-endian values instead, so
every pixel reached the panel byte-swapped: BG 0x0002 showed as green
(0x0200), the fogged floor 0x0882 as pink (0x8208) — exactly the
symptoms reported from hardware.

The core now stores pixels in panel wire order (toWire byteswap on
store, one 16-bit rotate per pixel); the emulator blit unswaps before
the 565-to-8888 expansion, so its output is pixel-identical. Also add
-O2 to the firmware env: PlatformIO's default -Os optimizes for size
and was likely a large part of the 13 fps report.
This commit is contained in:
Dejvino
2026-11-16 22:49:06 +01:00
parent 5310079870
commit 23b3c88caa
3 changed files with 25 additions and 12 deletions
+1
View File
@@ -30,5 +30,6 @@ build_flags =
-DARDUINO_USB_CDC_ON_BOOT=1
-DDISABLE_ALL_LIBRARY_WARNINGS
-DSPI_FREQUENCY=80000000
-O2
-I../../src/netdeck
-I..