From a07a1169424b98858d341c41c061cb75a0ce57f1 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 8 Aug 2021 18:22:52 -0400 Subject: [PATCH] fbcon_scroll: only defined on linux --- src/lib/linux.c | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/lib/linux.c b/src/lib/linux.c index 27b63723f..8abae66c9 100644 --- a/src/lib/linux.c +++ b/src/lib/linux.c @@ -1,25 +1,6 @@ #include "linux.h" #include "internal.h" -void fbcon_scroll(const struct ncpile* p, tinfo* ti, int rows){ - if(ti->cellpixy){ - return; - } - int totalrows = ti->cellpixy * p->dimy; - int srows = rows * ti->cellpixy; // number of lines being scrolled - uint8_t* targ = ti->linux_fbuffer; - uint8_t* src = ti->linux_fbuffer + srows * ti->cellpixx * p->dimx * 4; - for(int r = 0 ; r < totalrows - srows ; ++r){ - memcpy(targ, src, ti->cellpixx * p->dimx * 4); - targ += ti->cellpixx * p->dimx * 4; - src += ti->cellpixx * p->dimx * 4; - } - for(int r = totalrows - srows ; r < totalrows ; ++r){ - memset(targ, 0, ti->cellpixx * p->dimx * 4); - targ += ti->cellpixx * p->dimx * 4; - } -} - // auxvecs for framebuffer are 1B each for s->cellpxx * s->cellpxy elements, // and store the original alpha value. int fbcon_wipe(sprixel* s, int ycell, int xcell){ @@ -211,6 +192,25 @@ int fbcon_draw(const tinfo* ti, const struct ncpile *p, sprixel* s, fbuf* f, int return wrote; } +void fbcon_scroll(const struct ncpile* p, tinfo* ti, int rows){ + if(ti->cellpixy){ + return; + } + int totalrows = ti->cellpixy * p->dimy; + int srows = rows * ti->cellpixy; // number of lines being scrolled + uint8_t* targ = ti->linux_fbuffer; + uint8_t* src = ti->linux_fbuffer + srows * ti->cellpixx * p->dimx * 4; + for(int r = 0 ; r < totalrows - srows ; ++r){ + memcpy(targ, src, ti->cellpixx * p->dimx * 4); + targ += ti->cellpixx * p->dimx * 4; + src += ti->cellpixx * p->dimx * 4; + } + for(int r = totalrows - srows ; r < totalrows ; ++r){ + memset(targ, 0, ti->cellpixx * p->dimx * 4); + targ += ti->cellpixx * p->dimx * 4; + } +} + // each row is a contiguous set of bits, starting at the msb static inline size_t row_bytes(const struct console_font_op* cfo){ @@ -698,6 +698,12 @@ int fbcon_draw(const tinfo* ti, const struct ncpile *p, sprixel* s, fbuf* f, int return 0; } +void fbcon_scroll(const struct ncpile* p, tinfo* ti, int rows){ + (void)p; + (void)ti; + (void)rows; +} + int get_linux_fb_pixelgeom(tinfo* ti, unsigned* ypix, unsigned *xpix){ (void)ti; (void)ypix;