From b37a04311e33f79a2e7454a6527b40fa21b65baf Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 15 Feb 2017 20:23:31 +0100 Subject: [PATCH] tuxtxt: Fix display in 1280x720 mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/979bac14f0cf7b4ed4783215422a112a832aac8a Author: Michael Liebmann Date: 2017-02-15 (Wed, 15 Feb 2017) --- lib/libtuxtxt/tuxtxt.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index dc7d5a7c5..c20e12cf5 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -5621,7 +5621,17 @@ void CopyBB2FB() #ifdef HAVE_SPARK_HARDWARE f->blit2FB(lbb, var_screeninfo.xres, var_screeninfo.yres, 0, 0, 0, 0, true); #else - memcpy(lfb, lbb, fix_screeninfo.line_length*var_screeninfo.yres); + if ((uint32_t)stride > var_screeninfo.xres) { + fb_pixel_t *lfb_ = lfb; + fb_pixel_t *lbb_ = lbb; + for (uint32_t i1 = 0; i1 < var_screeninfo.yres; i1++) { + memcpy(lfb_, lbb_, var_screeninfo.xres * sizeof(fb_pixel_t)); + lfb_ += stride; + lbb_ += stride; + } + } + else + memcpy(lfb, lbb, fix_screeninfo.line_length*var_screeninfo.yres); #endif #endif