Will maybe have to play with your new images, although I no longer have Photoshop installed...
Here's the face in the original size in 3 versions: With Alpha background, White and then Black.
View attachment CrazyClockFace.zip
Will maybe have to play with your new images, although I no longer have Photoshop installed...
I've been playing around with this library for a bit with thoughts on using with T41 & a 800x480 display; impressive library, excellent work.
Whilst playing with the Mars demo, I noted a fatal error within loadFalconTexture() where it assigns the Falcon mesh data (falcon_vs_1). The 'while ... mesh = mesh->next' relies upon the NULL for completion, standard stuff for running through a list, but nowhere is the final 'next' expectedly set to NULL, thus leading to unpredictable results (hard fault).
My fix was to escape on the 60'th iteration.
Impressive demo, I'll try to get a video together.
Thought this might have been related to a suspected bug I've been tracking (extmem_calloc does not zero the returned memory like a regular call to calloc should) but it's not, the copyMeshEXTMEM function in tgx doesn't assign a value to the next pointer of the final mesh.
(The bug only appears when using a Teensy 4.1 with extmem, since otherwise the mesh is accessed directly from progmem.)
Depends, if you look at other thread today on ili9488 I have hacked up one example and it runs with problems…
But you can not put both frame buffers in dmamem. Won’t fit. But one in dma and other in DTCM I.e. ram fit. And with t4.1 you can solder memory to bottom and use that
tgx::Image<tgx::RGB565> tg(???, 48, 7);
// old version (improved-drawing-primitives)
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 7 Xform: 12 Draw: 158 Update: 0 Audio: 4 Wait: 87
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 7 Xform: 12 Draw: 155 Update: 0 Audio: 4 Wait: 110
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 7 Xform: 11 Draw: 135 Update: 0 Audio: 4 Wait: 131
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 6 Xform: 10 Draw: 121 Update: 0 Audio: 4 Wait: 147
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 6 Xform: 10 Draw: 112 Update: 0 Audio: 4 Wait: 156
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 6 Xform: 9 Draw: 106 Update: 0 Audio: 4 Wait: 162
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 6 Xform: 9 Draw: 96 Update: 0 Audio: 4 Wait: 174
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 5 Xform: 8 Draw: 92 Update: 0 Audio: 4 Wait: 178
// new version, with overflow scaling
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 7 Xform: 12 Draw: 239 Update: 0 Audio: 4 Wait: 5
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 7 Xform: 12 Draw: 229 Update: 0 Audio: 4 Wait: 35
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 7 Xform: 11 Draw: 198 Update: 0 Audio: 4 Wait: 68
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 6 Xform: 10 Draw: 179 Update: 0 Audio: 4 Wait: 88
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 6 Xform: 10 Draw: 166 Update: 0 Audio: 4 Wait: 102
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 6 Xform: 9 Draw: 159 Update: 0 Audio: 4 Wait: 109
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 6 Xform: 9 Draw: 144 Update: 0 Audio: 4 Wait: 126
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 6 Xform: 8 Draw: 141 Update: 0 Audio: 4 Wait: 129
// new version, with templated shiftC
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 6 Xform: 12 Draw: 161 Update: 0 Audio: 4 Wait: 85
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 6 Xform: 12 Draw: 157 Update: 0 Audio: 4 Wait: 110
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 5 Xform: 11 Draw: 136 Update: 0 Audio: 4 Wait: 131
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 5 Xform: 10 Draw: 122 Update: 0 Audio: 4 Wait: 146
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 5 Xform: 10 Draw: 113 Update: 0 Audio: 4 Wait: 156
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 5 Xform: 9 Draw: 108 Update: 0 Audio: 4 Wait: 162
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 5 Xform: 8 Draw: 97 Update: 0 Audio: 4 Wait: 173
CLK:300 SPI:75 FPS:31 Other: 1 Clear: 5 Anim: 5 Xform: 8 Draw: 93 Update: 0 Audio: 4 Wait: 178
const uint8_t dither[4][4] = {{0, 8, 2, 10}, {12, 4, 14, 6}, {3, 11, 1, 9}, {15, 7, 13, 5}};
uint32_t* p = (uint32_t* )buffer;
for (int j = 0; j < SCREEN_HEIGHT; j++) {
// apply 4x4 ordered-dither to 1x4 pixels
RGB64 c0(c64_a), c1(c64_a), c2(c64_a), c3(c64_a);
c0.R = min(0xffff, c0.R + (dither[j & 0x3][0] << 8));
c0.G = min(0xffff, c0.G + (dither[j & 0x3][0] << 7));
c0.B = min(0xffff, c0.B + (dither[j & 0x3][0] << 8));
c1.R = min(0xffff, c1.R + (dither[j & 0x3][1] << 8));
c1.G = min(0xffff, c1.G + (dither[j & 0x3][1] << 7));
c1.B = min(0xffff, c1.B + (dither[j & 0x3][1] << 8));
c2.R = min(0xffff, c2.R + (dither[j & 0x3][2] << 8));
c2.G = min(0xffff, c2.G + (dither[j & 0x3][2] << 7));
c2.B = min(0xffff, c2.B + (dither[j & 0x3][2] << 8));
c3.R = min(0xffff, c3.R + (dither[j & 0x3][3] << 8));
c3.G = min(0xffff, c3.G + (dither[j & 0x3][3] << 7));
c3.B = min(0xffff, c3.B + (dither[j & 0x3][3] << 8));
uint32_t cc0 = (uint16_t)((RGB565)c0) | ((uint16_t)((RGB565)c1) << 16);
uint32_t cc1 = (uint16_t)((RGB565)c2) | ((uint16_t)((RGB565)c3) << 16);
static_assert(SCREEN_WIDTH % 16 == 0);
for (int l = SCREEN_WIDTH / 16; l > 0; l--) {
*(p++) = cc0; *(p++) = cc1;
*(p++) = cc0; *(p++) = cc1;
*(p++) = cc0; *(p++) = cc1;
*(p++) = cc0; *(p++) = cc1;
}
c64_a.R += dr;
c64_a.G += dg;
c64_a.B += db;
c64_a.A += da;
}
}