1.1 --- a/include/vga_display.h Tue Nov 13 00:02:15 2018 +0100
1.2 +++ b/include/vga_display.h Tue Nov 13 00:05:51 2018 +0100
1.3 @@ -50,24 +50,40 @@
1.4
1.5 /* Current scanline and pixel line. */
1.6
1.7 - uint32_t line;
1.8 + uint32_t scanline, line;
1.9 uint8_t *linedata;
1.10
1.11 + /* Separate display windows dividing the display vertically. */
1.12 +
1.13 + int window, windows, max_windows;
1.14 +
1.15 + /* A collection of line numbers ending each window. */
1.16 +
1.17 + uint32_t *window_end;
1.18 +
1.19 /* The start, limit and size of the screen are copied to this structure,
1.20 allowing the display configuration to use different values such as those
1.21 for a different display frame. */
1.22
1.23 /* Screen start address, frame limit. */
1.24
1.25 - uint8_t *screen_start, *screen_limit;
1.26 + uint8_t **screen_start, **screen_limit;
1.27
1.28 /* Screen size, used to wrap the current line pointer. */
1.29
1.30 - uint32_t screen_size;
1.31 + uint32_t *screen_size;
1.32 +
1.33 + /* General display properties defined by the collection of windows. */
1.34 +
1.35 + uint32_t line_length, line_count;
1.36
1.37 - /* General display configuration. */
1.38 + /* Number of scanlines on the display. */
1.39 +
1.40 + uint32_t scanlines;
1.41
1.42 - display_config_t *display_config;
1.43 + /* Number of scanlines per display line. */
1.44 +
1.45 + int line_multiplier; /* = scanlines / line_count */
1.46
1.47 /* Display line positions. */
1.48
1.49 @@ -85,12 +101,25 @@
1.50 This macro depends on the VGA timing constants being defined, and they are
1.51 included above.
1.52
1.53 - VGA_Display(<name>)
1.54 + VGA_Display(<name>, int windows)
1.55 */
1.56
1.57 -#define VGA_Display(NAME) \
1.58 +#define VGA_Display(NAME, WINDOWS) \
1.59 + uint32_t __##NAME##_window_end[WINDOWS]; \
1.60 + uint8_t *__##NAME##_screen_start[WINDOWS]; \
1.61 + uint8_t *__##NAME##_screen_limit[WINDOWS]; \
1.62 + uint32_t __##NAME##_screen_size[WINDOWS]; \
1.63 + \
1.64 vga_display_t NAME = { \
1.65 + .window_end = __##NAME##_window_end, \
1.66 + .screen_start = __##NAME##_screen_start, \
1.67 + .screen_limit = __##NAME##_screen_limit, \
1.68 + .screen_size = __##NAME##_screen_size, \
1.69 + .window = 0, \
1.70 + .windows = 0, \
1.71 + .max_windows = WINDOWS, \
1.72 .transfer_cell_size = TRANSFER_CELL_SIZE, \
1.73 + .scanlines = SCANLINES, \
1.74 .hfreq_limit = HFREQ_LIMIT, \
1.75 .hsync_start = HSYNC_START, \
1.76 .hsync_end = HSYNC_END, \
1.77 @@ -121,9 +150,12 @@
1.78 void vga_configure_zero_channel(int channel, int int_num, int initiating,
1.79 uint32_t output);
1.80
1.81 +void vga_update_properties(void);
1.82 +
1.83 /* Access-related operations. */
1.84
1.85 -void vga_set_frame(display_config_t *display_config);
1.86 +void vga_add_window(display_config_t *display_config);
1.87 +void vga_set_frame(display_config_t *display_config, int window);
1.88 void vga_wait_visible(void);
1.89
1.90 /* Interrupt handlers. */