1.1 --- a/examples/vga/main.c Sat Nov 03 14:05:05 2018 +0100
1.2 +++ b/examples/vga/main.c Sun Nov 04 00:43:20 2018 +0100
1.3 @@ -164,6 +164,7 @@
1.4 x, y, 0x8c, 1);
1.5
1.6 wait(delay);
1.7 + vga_wait_visible();
1.8
1.9 /* Copy to the display from the store, restoring the original
1.10 background. */
1.11 @@ -335,7 +336,7 @@
1.12
1.13 /* Move a sprite around on the screen with a delay between each movement. */
1.14
1.15 - animate(1 << 21);
1.16 + animate(1 << 18);
1.17 }
1.18
1.19
2.1 --- a/include/vga_display.h Sat Nov 03 14:05:05 2018 +0100
2.2 +++ b/include/vga_display.h Sun Nov 04 00:43:20 2018 +0100
2.3 @@ -84,6 +84,10 @@
2.4 void vga_configure_zero_channel(int channel, int int_num, int initiating,
2.5 uint32_t output);
2.6
2.7 +/* Access-related operations. */
2.8 +
2.9 +void vga_wait_visible(void);
2.10 +
2.11 /* Interrupt handlers. */
2.12
2.13 void vga_interrupt_handler(void);
3.1 --- a/lib/vga_display.c Sat Nov 03 14:05:05 2018 +0100
3.2 +++ b/lib/vga_display.c Sun Nov 04 00:43:20 2018 +0100
3.3 @@ -243,6 +243,16 @@
3.4
3.5
3.6
3.7 +/* Wait for the visible region to be completed. */
3.8 +
3.9 +void vga_wait_visible(void)
3.10 +{
3.11 + while (((volatile void (*)()) vga_display.state_handler) == visible_active)
3.12 + __asm__ __volatile__("wait");
3.13 +}
3.14 +
3.15 +
3.16 +
3.17 /* Display state machine interrupt handler. */
3.18
3.19 void vga_interrupt_handler(void)