1.1 --- a/include/display.h Sat Nov 10 21:39:51 2018 +0100
1.2 +++ b/include/display.h Sat Nov 10 22:11:32 2018 +0100
1.3 @@ -21,6 +21,7 @@
1.4 #define __DISPLAY_H__
1.5
1.6 #include <stdint.h>
1.7 +#include "vga.h"
1.8
1.9
1.10
1.11 @@ -78,27 +79,20 @@
1.12
1.13 uint32_t cell_size;
1.14
1.15 - /* DMA transfer sizes. */
1.16 -
1.17 - uint32_t transfer_cell_size;
1.18 -
1.19 - /* Display line positions. */
1.20 -
1.21 - uint32_t hfreq_limit, hsync_start, hsync_end;
1.22 -
1.23 - /* Display region scanline positions. */
1.24 -
1.25 - uint32_t visible_start, vfp_start, vsync_start, vsync_end;
1.26 -
1.27 } display_config_t;
1.28
1.29
1.30
1.31 -/* Initialise a display. */
1.32 +/* Initialise a display. This macro depends on certain VGA constants being
1.33 + defined, and they are included above.
1.34 +
1.35 + Display(<name>, int width, int height, int frames)
1.36 +*/
1.37
1.38 #define Display(NAME, WIDTH, HEIGHT, FRAMES) \
1.39 uint8_t __##NAME##_framebuffer[(WIDTH) * (HEIGHT + 1) * (FRAMES)]; \
1.40 uint8_t *__##NAME##_screen_starts[FRAMES]; \
1.41 + \
1.42 display_config_t NAME = { \
1.43 .framebuffer=__##NAME##_framebuffer, \
1.44 .screen_starts=__##NAME##_screen_starts, \
1.45 @@ -113,16 +107,7 @@
1.46 \
1.47 .scanlines = SCANLINES, \
1.48 .line_channels = LINE_CHANNELS, \
1.49 - .cell_size = CELL_SIZE, \
1.50 - .transfer_cell_size = TRANSFER_CELL_SIZE, \
1.51 - \
1.52 - .hfreq_limit = HFREQ_LIMIT, \
1.53 - .hsync_start = HSYNC_START, \
1.54 - .hsync_end = HSYNC_END, \
1.55 - .visible_start = VISIBLE_START, \
1.56 - .vfp_start = VFP_START, \
1.57 - .vsync_start = VSYNC_START, \
1.58 - .vsync_end = VSYNC_END};
1.59 + .cell_size = CELL_SIZE};
1.60
1.61 /* Configuration functions. */
1.62