@@ -44,7 +44,7 @@ void common_hal_terminalio_terminal_construct(terminalio_terminal_obj_t *self,
4444}
4545
4646size_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))
4848
4949 // Make sure the terminal is initialized before we do anything with it.
5050 if (self -> scroll_area == NULL ) {
@@ -201,7 +201,7 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con
201201 if (vt_args [1 ] >= self -> scroll_area -> width_in_tiles ) {
202202 vt_args [1 ] = self -> scroll_area -> width_in_tiles - 1 ;
203203 }
204- vt_args [0 ] = scrnmod (vt_args [0 ]);
204+ vt_args [0 ] = SCRNMOD (vt_args [0 ]);
205205 self -> cursor_x = vt_args [1 ];
206206 self -> cursor_y = vt_args [0 ];
207207 start_y = self -> cursor_y ;
@@ -233,7 +233,7 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con
233233 }
234234 #if CIRCUITPY_TERMINALIO_VT100
235235 } 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 )) {
237237 if (self -> cursor_y > 0 ) {
238238 self -> cursor_y = self -> cursor_y - 1 ;
239239 } else {
@@ -244,7 +244,7 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con
244244 // Scroll range defined, manually move tiles to perform scroll
245245 for (int16_t irow = self -> vt_scroll_end - 1 ; irow >= self -> vt_scroll_top ; irow -- ) {
246246 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 )));
248248 }
249249 }
250250 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
292292 self -> cursor_y %= self -> scroll_area -> height_in_tiles ;
293293 }
294294 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 )) {
296296 #if CIRCUITPY_TERMINALIO_VT100
297297 if (self -> vt_scroll_top != 0 || self -> vt_scroll_end != self -> scroll_area -> height_in_tiles ) {
298298 // 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 );
300300
301301 for (int16_t irow = self -> vt_scroll_top ; irow < self -> vt_scroll_end ; irow ++ ) {
302302 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 )));
304304 }
305305 }
306306 }
0 commit comments