diff --git a/src/display.c b/src/display.c index c28fbda6..bb7beb6a 100644 --- a/src/display.c +++ b/src/display.c @@ -698,16 +698,6 @@ static void _display_plotChar(PIXEL_TYPE *fboff, const unsigned int fbPixWidth, _plot_char80(&fboff, &src, fbPixWidth); } -#if INTERFACE_CLASSIC -void display_plotChar(const uint8_t col, const uint8_t row, const interface_colorscheme_t cs, const uint8_t c) { - assert(col < 80); - assert(row < 24); - unsigned int off = row * SCANWIDTH * FONT_HEIGHT_PIXELS + col * FONT80_WIDTH_PIXELS + _FB_OFF; - _display_plotChar(fbFull+off, SCANWIDTH, cs, c); - video_setDirty(FB_DIRTY_FLAG); -} -#endif - static void _display_plotLine(PIXEL_TYPE *fb, const unsigned int fbPixWidth, const unsigned int xAdjust, const uint8_t col, const uint8_t row, const interface_colorscheme_t cs, const char *line) { for (uint8_t x=col; *line; x++, line++) { char c = *line; @@ -717,6 +707,14 @@ static void _display_plotLine(PIXEL_TYPE *fb, const unsigned int fbPixWidth, con } #if INTERFACE_CLASSIC +void display_plotChar(const uint8_t col, const uint8_t row, const interface_colorscheme_t cs, const uint8_t c) { + assert(col < 80); + assert(row < 24); + unsigned int off = row * SCANWIDTH * FONT_HEIGHT_PIXELS + col * FONT80_WIDTH_PIXELS + _FB_OFF; + _display_plotChar(fbFull+off, SCANWIDTH, cs, c); + video_setDirty(FB_DIRTY_FLAG); +} + void display_plotLine(const uint8_t col, const uint8_t row, const interface_colorscheme_t cs, const char *message) { _display_plotLine(fbFull, /*fbPixWidth:*/SCANWIDTH, /*xAdjust:*/_FB_OFF, col, row, cs, message); video_setDirty(FB_DIRTY_FLAG); @@ -957,6 +955,11 @@ void display_flashText(void) { } PIXEL_TYPE *display_getCurrentFramebuffer(void) { +#if INTERFACE_CLASSIC + if (interface_isShowing()) { + memcpy(/*dst:*/fbDone, /*src:*/fbFull, sizeof(fbDone)); + } +#endif return fbDone; } diff --git a/src/video/glvideo.c b/src/video/glvideo.c index 7fbf0fba..174dacd1 100644 --- a/src/video/glvideo.c +++ b/src/video/glvideo.c @@ -354,8 +354,8 @@ static void glvideo_render(void) { if (wasDirty) { SCOPE_TRACE_VIDEO("glvideo texImage2D"); _HACKAROUND_GLTEXIMAGE2D_PRE(TEXTURE_ACTIVE_FRAMEBUFFER, crtModel->textureName); + void *fb = display_getCurrentFramebuffer(); // NOTE: has an INTERFACE_CLASSIC side-effect ... #if !FB_PIXELS_PASS_THRU - void *fb = display_getCurrentFramebuffer(); memcpy(/*dest:*/crtModel->texPixels, /*src:*/fb, (SCANWIDTH*SCANHEIGHT*sizeof(PIXEL_TYPE))); #endif glTexImage2D(GL_TEXTURE_2D, /*level*/0, TEX_FORMAT_INTERNAL, SCANWIDTH, SCANHEIGHT, /*border*/0, TEX_FORMAT, TEX_TYPE, crtModel->texPixels);