kopia lustrzana https://github.com/pimoroni/pimoroni-pico
removed ram cache and access flash lut directly
rodzic
1eec6169b3
commit
51ea5034ba
|
@ -94,17 +94,6 @@ namespace pimoroni {
|
|||
void PicoGraphics_PenRGB332::scanline_convert(PenType type, conversion_callback_func callback) {
|
||||
if(type == PEN_RGB565) {
|
||||
|
||||
static RGB565 cache[256];
|
||||
for(auto i = 0u; i < 256; i++) {
|
||||
cache[i] = rgb332_to_rgb565_lut[i]; // defined in pico_graphics.hpp
|
||||
}
|
||||
|
||||
// 2ms slower, I swear!
|
||||
/*
|
||||
static RGB565 cache[256];
|
||||
memcpy(cache, rgb332_to_rgb565_lut, 256 * sizeof(RGB565));
|
||||
*/
|
||||
|
||||
// Treat our void* frame_buffer as uint8_t
|
||||
uint8_t *src = (uint8_t *)frame_buffer;
|
||||
|
||||
|
@ -112,7 +101,8 @@ namespace pimoroni {
|
|||
uint16_t row_buf[bounds.w];
|
||||
for(auto y = 0; y < bounds.h; y++) {
|
||||
for(auto x = 0; x < bounds.w; x++) {
|
||||
row_buf[x] = cache[*src];
|
||||
row_buf[x] = rgb332_to_rgb565_lut[*src];
|
||||
|
||||
src++;
|
||||
}
|
||||
// Callback to the driver with the row data
|
||||
|
|
Ładowanie…
Reference in New Issue