esp32_marauder/Display.cpp
// Function to execute hardware scroll for TFT screen
Function to execute hardware scroll for TFT screen
Function to execute hardware scroll for TFT screen
int Display::scroll_line(uint32_t color) {
  int yTemp = yStart; 
  int tfa = tteBar ? TOP_FIXED_AREA_2 : TOP_FIXED_AREA;
  yStart+=TEXT_HEIGHT;
  if (yStart >= YMAX - BOT_FIXED_AREA) {
    yStart = tfa + (yStart - YMAX + BOT_FIXED_AREA);
  }
  if( yTemp < yStart ) {
    for( int i=yTemp;i<yStart;i++ ) {
      tft.drawFastHLine( 0, i, tft.width(), TFT_BLACK ); 
      scrollAddress(i);
      delay(5);
    }
  } else {
    scrollAddress(yStart);
  }
  return  yTemp;
}
int Display :: scroll_line ( uint32_t color ) { int yTemp = yStart ; int tfa = tteBar ? TOP_FIXED_AREA_2 : TOP_FIXED_AREA ; yStart += TEXT_HEIGHT ; if ( yStart >= YMAX - BOT_FIXED_AREA ) { yStart = tfa + ( yStart - YMAX + BOT_FIXED_AREA ) ; } if ( yTemp < yStart ) { for ( int i = yTemp ; i < yStart ; i ++ ) { tft . drawFastHLine ( 0 , i , tft . width ( ) , TFT_BLACK ) ; scrollAddress ( i ) ; delay ( 5 ) ; } } else { scrollAddress ( yStart ) ; } return yTemp ; }
Function to execute hardware scroll for TFT screen
Function to execute hardware scroll for TFT screen
//Serial.println("scroll_line()"); // Store the old yStart, this is where we draw the next line // Use the record of line lengths to optimise the rectangle size we need to erase the top line // this isn't really necessary as it will eventually get overwritten // tft.fillRect(0,yStart,blank[(yStart-tfa)/TEXT_HEIGHT],TEXT_HEIGHT, color); // Change the top of the scroll area // The value must wrap around as the screen memory is a circular buffer // Now we can smooth-scroll the display // delete line before scrolling // this may be jumpy