@@ -44,7 +44,7 @@ void common_hal_terminalio_terminal_construct(terminalio_terminal_obj_t *self,
44
44
}
45
45
46
46
size_t common_hal_terminalio_terminal_write (terminalio_terminal_obj_t * self , const byte * data , size_t len , int * errcode ) {
47
- #define scrnmod (x ) (((x) + (self->scroll_area->top_left_y)) % (self->scroll_area->height_in_tiles))
47
+ #define SCRNMOD (x ) (((x) + (self->scroll_area->top_left_y)) % (self->scroll_area->height_in_tiles))
48
48
49
49
// Make sure the terminal is initialized before we do anything with it.
50
50
if (self -> scroll_area == NULL ) {
@@ -201,7 +201,7 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con
201
201
if (vt_args [1 ] >= self -> scroll_area -> width_in_tiles ) {
202
202
vt_args [1 ] = self -> scroll_area -> width_in_tiles - 1 ;
203
203
}
204
- vt_args [0 ] = scrnmod (vt_args [0 ]);
204
+ vt_args [0 ] = SCRNMOD (vt_args [0 ]);
205
205
self -> cursor_x = vt_args [1 ];
206
206
self -> cursor_y = vt_args [0 ];
207
207
start_y = self -> cursor_y ;
@@ -233,7 +233,7 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con
233
233
}
234
234
#if CIRCUITPY_TERMINALIO_VT100
235
235
} else if (i [0 ] == 'M' ) {
236
- if (self -> cursor_y != scrnmod (self -> vt_scroll_top )) {
236
+ if (self -> cursor_y != SCRNMOD (self -> vt_scroll_top )) {
237
237
if (self -> cursor_y > 0 ) {
238
238
self -> cursor_y = self -> cursor_y - 1 ;
239
239
} else {
@@ -244,7 +244,7 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con
244
244
// Scroll range defined, manually move tiles to perform scroll
245
245
for (int16_t irow = self -> vt_scroll_end - 1 ; irow >= self -> vt_scroll_top ; irow -- ) {
246
246
for (int16_t icol = 0 ; icol < self -> scroll_area -> width_in_tiles ; icol ++ ) {
247
- common_hal_displayio_tilegrid_set_tile (self -> scroll_area , icol , scrnmod (irow + 1 ), common_hal_displayio_tilegrid_get_tile (self -> scroll_area , icol , scrnmod (irow )));
247
+ common_hal_displayio_tilegrid_set_tile (self -> scroll_area , icol , SCRNMOD (irow + 1 ), common_hal_displayio_tilegrid_get_tile (self -> scroll_area , icol , SCRNMOD (irow )));
248
248
}
249
249
}
250
250
for (int16_t icol = 0 ; icol < self -> scroll_area -> width_in_tiles ; icol ++ ) {
@@ -292,15 +292,15 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con
292
292
self -> cursor_y %= self -> scroll_area -> height_in_tiles ;
293
293
}
294
294
if (self -> cursor_y != start_y ) {
295
- if (((self -> cursor_y + self -> scroll_area -> height_in_tiles ) - 1 ) % self -> scroll_area -> height_in_tiles == scrnmod (self -> vt_scroll_end )) {
295
+ if (((self -> cursor_y + self -> scroll_area -> height_in_tiles ) - 1 ) % self -> scroll_area -> height_in_tiles == SCRNMOD (self -> vt_scroll_end )) {
296
296
#if CIRCUITPY_TERMINALIO_VT100
297
297
if (self -> vt_scroll_top != 0 || self -> vt_scroll_end != self -> scroll_area -> height_in_tiles ) {
298
298
// Scroll range defined, manually move tiles to perform scroll
299
- self -> cursor_y = scrnmod (self -> vt_scroll_end );
299
+ self -> cursor_y = SCRNMOD (self -> vt_scroll_end );
300
300
301
301
for (int16_t irow = self -> vt_scroll_top ; irow < self -> vt_scroll_end ; irow ++ ) {
302
302
for (int16_t icol = 0 ; icol < self -> scroll_area -> width_in_tiles ; icol ++ ) {
303
- common_hal_displayio_tilegrid_set_tile (self -> scroll_area , icol , scrnmod (irow ), common_hal_displayio_tilegrid_get_tile (self -> scroll_area , icol , scrnmod (irow + 1 )));
303
+ common_hal_displayio_tilegrid_set_tile (self -> scroll_area , icol , SCRNMOD (irow ), common_hal_displayio_tilegrid_get_tile (self -> scroll_area , icol , SCRNMOD (irow + 1 )));
304
304
}
305
305
}
306
306
}
0 commit comments