diff --git a/src/ui_sdl.c b/src/ui_sdl.c index e0e3a7b..9e647d3 100644 --- a/src/ui_sdl.c +++ b/src/ui_sdl.c @@ -61,7 +61,6 @@ typedef struct sdl_keypad_t { typedef struct sdl_button_t { const char* name; short pressed; - /* short extra; */ int code; int x, y; @@ -1712,19 +1711,19 @@ static void SDLDrawSerialDevices() stringColor( sdlwindow, 10, 240, text, 0xffffffff ); } -static inline void draw_nibble( int c, int r, int val ) +static inline void draw_nibble( int col, int row, int val ) { int x, y; - x = ( c * 4 ); // x: start in pixels + x = ( col * 4 ); // x: start in pixels - if ( r <= display.lines ) + if ( row <= display.lines ) x -= 2 * display.offset; - y = r; // y: start in pixels + y = row; // y: start in pixels val &= 0x0f; - if ( val != lcd_buffer[ r ][ c ] ) { - lcd_buffer[ r ][ c ] = val; + if ( val != lcd_buffer[ row ][ col ] ) { + lcd_buffer[ row ][ col ] = val; SDLDrawNibble( x, y, val ); } diff --git a/src/ui_text.c b/src/ui_text.c index 0f96e64..d332dec 100644 --- a/src/ui_text.c +++ b/src/ui_text.c @@ -210,17 +210,17 @@ static inline void tui_draw_nibble( int nx, int ny, int val ) } } -static inline void draw_nibble( int c, int r, int val ) +static inline void draw_nibble( int col, int row, int val ) { - int x = ( c * 4 ), // x: start in pixels, - y = r; // y: start in pixels + int x = ( col * 4 ), // x: start in pixels, + y = row; // y: start in pixels - if ( r <= display.lines ) + if ( row <= display.lines ) x -= 2 * display.offset; val &= 0x0f; - if ( val != lcd_buffer[ r ][ c ] ) { - lcd_buffer[ r ][ c ] = val; + if ( val != lcd_buffer[ row ][ col ] ) { + lcd_buffer[ row ][ col ] = val; tui_draw_nibble( x, y, val ); }