meaning of c & r

This commit is contained in:
Gwenhael Le Moine 2023-09-26 11:28:48 +02:00
parent 30fd67d0f0
commit ba36e6d180
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
2 changed files with 12 additions and 13 deletions

View file

@ -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 );
}

View file

@ -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 );
}