1.1 --- a/examples/vga/main.c Sun Nov 04 00:46:43 2018 +0100
1.2 +++ b/examples/vga/main.c Sun Nov 04 01:04:06 2018 +0100
1.3 @@ -312,6 +312,32 @@
1.4 }
1.5 }
1.6
1.7 +/* Set up a background. */
1.8 +
1.9 +static void setup(void)
1.10 +{
1.11 + int frame;
1.12 +
1.13 + for (frame = 0; frame < display_config.frames; frame++)
1.14 + {
1.15 + /* Obtain the frame. */
1.16 +
1.17 + select_frame(&display_config, frame, 0);
1.18 +
1.19 + /* Plot the image centred on the screen. */
1.20 +
1.21 + copy_display(&display_config, screendata, screendata_width, screendata_height,
1.22 + (display_config.line_length - screendata_width) / 2,
1.23 + (display_config.line_count - screendata_height) / 2, -1, 1);
1.24 +
1.25 + /* Write a sequence of characters. */
1.26 +
1.27 + write_chars();
1.28 + }
1.29 +
1.30 + select_frame(&display_config, 0, 0);
1.31 +}
1.32 +
1.33
1.34
1.35 /* Main program. */
1.36 @@ -362,18 +388,9 @@
1.37
1.38 interrupts_on();
1.39
1.40 - /* Plot the image centred on the screen. */
1.41 -
1.42 - copy_display(&display_config, screendata, screendata_width, screendata_height,
1.43 - (display_config.line_length - screendata_width) / 2,
1.44 - (display_config.line_count - screendata_height) / 2, -1, 1);
1.45 -
1.46 - /* Write a sequence of characters. */
1.47 -
1.48 - write_chars();
1.49 -
1.50 /* Move a sprite around on the screen with a delay between each movement. */
1.51
1.52 + setup();
1.53 animate(1 << 18);
1.54 }
1.55