NetDeck: freeze tint stamps a checkered 8x8 sprite pattern
- replace the nonexistent draw16bppSprite_P(NULL,...) call with pushImage(bx, by, 8, 8, checkered8x8): device = TFT_eSprite::pushImage (blits into the fb sprite), emulator = new shim TFT_eSPI::pushImage blit into the host framebuffer — same signature on both backends - shim: define PROGMEM (no-op on host/ESP32, flash is memory-mapped) - pattern data fixed into a real 2px checkerboard (black / 0x1F1F teal) - E2E pixel assertions updated to the checker geometry Verified: make netdeck (both targets) + full test suite, 0 failures
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
// a much richer edge rate than a real roll on the device).
|
||||
#define EMULATOR 1
|
||||
|
||||
// Host flash is memory-mapped, so flash-resident data needs no special read
|
||||
// macro (same as on ESP32; real AVR pgm_read is not used by our sketches).
|
||||
#define PROGMEM
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
|
||||
@@ -107,6 +107,22 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// Blit a 16bpp (RGB565) image — the pattern-stamp primitive that the
|
||||
// device-side TFT_eSPI / TFT_eSprite pushImage() provides. Clipped.
|
||||
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *data)
|
||||
{
|
||||
for (int32_t j = 0; j < h; j++) {
|
||||
int32_t ty = y + j;
|
||||
if (ty < 0 || ty >= emuGfx::H) continue;
|
||||
for (int32_t i = 0; i < w; i++) {
|
||||
int32_t tx = x + i;
|
||||
if (tx < 0 || tx >= emuGfx::W) continue;
|
||||
emuGfx::fb[ty * emuGfx::W + tx] = rgb565to888(data[j * w + i]);
|
||||
}
|
||||
}
|
||||
emuGfx::dirty = true;
|
||||
}
|
||||
|
||||
void fillCircle(int32_t x0, int32_t y0, int32_t r, uint32_t c)
|
||||
{
|
||||
for (int dy = -r; dy <= r; dy++) {
|
||||
|
||||
Reference in New Issue
Block a user