1.1 --- a/examples/vga/main.c Tue Nov 13 18:39:07 2018 +0100
1.2 +++ b/examples/vga/main.c Tue Nov 13 22:33:09 2018 +0100
1.3 @@ -72,16 +72,6 @@
1.4
1.5
1.6
1.7 -/* Define the relationship between source images and the screen. */
1.8 -
1.9 -#ifndef SOURCE_HEIGHT
1.10 -#define SOURCE_HEIGHT 256
1.11 -#endif
1.12 -
1.13 -#define SOURCE_YSTEP (SOURCE_HEIGHT / LINE_COUNT)
1.14 -
1.15 -
1.16 -
1.17 /* Initialise memory for a multi-frame display. */
1.18
1.19 static Display(banner_config, LINE_LENGTH, 10, 1);
1.20 @@ -94,7 +84,7 @@
1.21 extern image_t screendata;
1.22 extern image_t sprite;
1.23
1.24 -static SpriteOverwriting(scr, &screendata, &display_config, FRAME_COUNT, -1, SOURCE_YSTEP);
1.25 +static SpriteOverwriting(scr, &screendata, &display_config, FRAME_COUNT, -1);
1.26
1.27 extern uint8_t fontchars[];
1.28 extern font_range_t fontbase;
1.29 @@ -131,7 +121,7 @@
1.30 *xdir = -*xdir;
1.31 }
1.32
1.33 - if (((*ydir > 0) && (last->y < display_config.line_count - s->image->height / s->yscale - *ydir)) ||
1.34 + if (((*ydir > 0) && (last->y < display_config.line_count - s->image->height - *ydir)) ||
1.35 ((*ydir < 0) && (last->y > -*ydir)))
1.36 {
1.37 next->y = last->y + *ydir;
1.38 @@ -150,13 +140,13 @@
1.39 {
1.40 /* Stores of background details, replotted when moving the sprite. */
1.41
1.42 - Sprite(s1, &sprite, &display_config, FRAME_COUNT, 0x0c, SOURCE_YSTEP);
1.43 - Sprite(s2, &sprite, &display_config, FRAME_COUNT, 0x0c, SOURCE_YSTEP);
1.44 - Sprite(s3, &sprite, &display_config, FRAME_COUNT, 0x0c, SOURCE_YSTEP);
1.45 + Sprite(s1, &sprite, &display_config, FRAME_COUNT, 0x0c);
1.46 + Sprite(s2, &sprite, &display_config, FRAME_COUNT, 0x0c);
1.47 + Sprite(s3, &sprite, &display_config, FRAME_COUNT, 0x0c);
1.48
1.49 /* Scrolling viewport. */
1.50
1.51 - Viewport(v, &display_config, SCROLL_XSTEP, SOURCE_YSTEP, plot_screen_edge);
1.52 + Viewport(v, &display_config, SCROLL_XSTEP, 1, plot_screen_edge);
1.53
1.54 /* Reset the viewport to a well-defined state. */
1.55
1.56 @@ -206,7 +196,7 @@
1.57 is traversed by multiples of the scrolling increment. */
1.58
1.59 viewport_update_origin(&v, xdir[0] * SCROLL_XSTEP,
1.60 - ydir[0] * SOURCE_YSTEP);
1.61 + ydir[0]);
1.62
1.63 /* Update the position of the sprite being plotted. */
1.64
1.65 @@ -249,7 +239,7 @@
1.66 /* Tile the image on the screen. */
1.67
1.68 image_tile_sprite(&scr, 0, 0, display_config.line_length,
1.69 - display_config.line_count * scr.yscale,
1.70 + display_config.line_count,
1.71 0, 0);
1.72 }
1.73