1.1 --- a/lib/display.c Sun Nov 04 16:14:58 2018 +0100
1.2 +++ b/lib/display.c Sun Nov 04 18:13:06 2018 +0100
1.3 @@ -153,18 +153,20 @@
1.4
1.5 /* Copying from/to the display to/from a backing store. */
1.6
1.7 -void copy_display(display_config_t *cfg, uint8_t *store, int width, int height,
1.8 +void copy_display(display_config_t *cfg, uint8_t *store,
1.9 + int width, int height, int ystep,
1.10 int x, int y, int key, int to_display)
1.11 {
1.12 - copy_display_section(cfg, store, width, height, 0, 0, width, height, x, y,
1.13 - key, to_display);
1.14 + copy_display_section(cfg, store, width, height,
1.15 + 0, 0, width, height, ystep,
1.16 + x, y, key, to_display);
1.17 }
1.18
1.19 /* Copying from/to the display to/from a backing store region. */
1.20
1.21 void copy_display_section(display_config_t *cfg, uint8_t *store,
1.22 int width, int height,
1.23 - int xstart, int ystart, int xsize, int ysize,
1.24 + int xstart, int ystart, int xsize, int ysize, int ystep,
1.25 int x, int y, int key, int to_display)
1.26 {
1.27 int sx, sy, dx, dy;
1.28 @@ -184,7 +186,7 @@
1.29
1.30 /* Perform the copying between the store and display. */
1.31
1.32 - for (sy = ystart, dy = y; (sy < ylimit) && (dy < cfg->line_count); sy++, dy++)
1.33 + for (sy = ystart, dy = y; (sy < ylimit) && (dy < cfg->line_count); sy += ystep, dy++)
1.34 {
1.35 for (sx = xstart, dx = x; (sx < xlimit) && (dx < cfg->line_length); sx++, dx++)
1.36 {
1.37 @@ -198,7 +200,7 @@
1.38 storeline[sx] = displayline[get_position(cfg, dx)];
1.39 }
1.40
1.41 - storeline += width;
1.42 + storeline += width * ystep;
1.43 displayline = wrap_screen_pointer(cfg, displayline + cfg->line_length);
1.44 }
1.45 }