1.1 --- a/lib/vga_display.c Sat Nov 10 21:39:51 2018 +0100
1.2 +++ b/lib/vga_display.c Sat Nov 10 22:11:32 2018 +0100
1.3 @@ -17,7 +17,6 @@
1.4 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1.5 */
1.6
1.7 -#include "pic32_c.h"
1.8 #include "init.h"
1.9 #include "vga_display.h"
1.10
1.11 @@ -25,7 +24,7 @@
1.12
1.13 /* Display state. */
1.14
1.15 -vga_display_t vga_display;
1.16 +VGA_Display(vga_display);
1.17
1.18 /* Pixel data. */
1.19
1.20 @@ -79,7 +78,7 @@
1.21
1.22 /* The timers have no prescaling (0). */
1.23
1.24 - timer_init(line_timer, 0, display_config->hfreq_limit);
1.25 + timer_init(line_timer, 0, vga_display.hfreq_limit);
1.26
1.27 /* Enable interrupt requests when the CPU needs to perform the transfer, as
1.28 opposed to the DMA channels doing so. */
1.29 @@ -183,7 +182,7 @@
1.30 dma_set_interrupt(channel, int_num, 1);
1.31
1.32 dma_set_destination(channel, HW_PHYSICAL(output), 1);
1.33 - dma_set_cell(channel, vga_display.display_config->transfer_cell_size);
1.34 + dma_set_cell(channel, vga_display.transfer_cell_size);
1.35 }
1.36
1.37 void vga_configure_zero_channel(int channel, int int_num, int initiating,
1.38 @@ -230,8 +229,8 @@
1.39 channel and is handled to drive the display state machine. */
1.40
1.41 oc_init(hsync_unit, 0b101, vga_display.line_timer);
1.42 - oc_set_pulse(hsync_unit, vga_display.display_config->hsync_end);
1.43 - oc_set_pulse_end(hsync_unit, vga_display.display_config->hsync_start);
1.44 + oc_set_pulse(hsync_unit, vga_display.hsync_end);
1.45 + oc_set_pulse_end(hsync_unit, vga_display.hsync_start);
1.46 oc_init_interrupt(hsync_unit, 7, 3);
1.47 oc_on(hsync_unit);
1.48
1.49 @@ -341,7 +340,7 @@
1.50
1.51 void vbp_active(void)
1.52 {
1.53 - if (vga_display.line < vga_display.display_config->visible_start)
1.54 + if (vga_display.line < vga_display.visible_start)
1.55 return;
1.56
1.57 /* Enter the visible region. */
1.58 @@ -362,7 +361,7 @@
1.59 {
1.60 display_config_t *cfg = vga_display.display_config;
1.61
1.62 - if (vga_display.line < cfg->vfp_start)
1.63 + if (vga_display.line < vga_display.vfp_start)
1.64 {
1.65 /* Update the line address and handle wraparound. */
1.66
1.67 @@ -393,7 +392,7 @@
1.68
1.69 void vfp_active(void)
1.70 {
1.71 - if (vga_display.line < vga_display.display_config->vsync_start)
1.72 + if (vga_display.line < vga_display.vsync_start)
1.73 return;
1.74
1.75 /* Enter the vertical sync region. */
1.76 @@ -409,7 +408,7 @@
1.77
1.78 void vsync_active(void)
1.79 {
1.80 - if (vga_display.line < vga_display.display_config->vsync_end)
1.81 + if (vga_display.line < vga_display.vsync_end)
1.82 return;
1.83
1.84 /* Start again at the top of the display. */