diff --git a/src/ui_sdl.c b/src/ui_sdl.c index 45be9c7..15332b6 100644 --- a/src/ui_sdl.c +++ b/src/ui_sdl.c @@ -1951,12 +1951,12 @@ void sdl_init_LCD( void ) void sdl_update_LCD( void ) { - int i; - long addr; - static int old_offset = -1; - static int old_lines = -1; - if ( display.on ) { + int i; + long addr; + static int old_offset = -1; + static int old_lines = -1; + addr = display.disp_start; if ( display.offset != old_offset ) { memset( lcd_nibbles_buffer, 0xf0, ( size_t )( ( display.lines + 1 ) * NIBS_PER_BUFFER_ROW ) ); diff --git a/src/ui_text.c b/src/ui_text.c index c1ae1d7..86270c1 100644 --- a/src/ui_text.c +++ b/src/ui_text.c @@ -340,18 +340,18 @@ static inline void ncurses_init_ui( void ) /* TODO: not specific to tui */ static inline void draw_row( long addr, int row ) { - int v; + int nibble; int line_length = NIBBLES_PER_ROW; if ( ( display.offset > 3 ) && ( row <= display.lines ) ) line_length += 2; for ( int i = 0; i < line_length; i++ ) { - v = read_nibble( addr + i ); - if ( v == lcd_nibbles_buffer[ row ][ i ] ) + nibble = read_nibble( addr + i ); + if ( nibble == lcd_nibbles_buffer[ row ][ i ] ) continue; - lcd_nibbles_buffer[ row ][ i ] = v; + lcd_nibbles_buffer[ row ][ i ] = nibble; } } @@ -401,9 +401,8 @@ void text_update_LCD( void ) addr += NIBBLES_PER_ROW; } } - } else { + } else memset( lcd_nibbles_buffer, 0xf0, sizeof( lcd_nibbles_buffer ) ); - } ncurses_draw_lcd(); }