1.1 --- a/include/display.h Sat Nov 10 19:20:13 2018 +0100
1.2 +++ b/include/display.h Sat Nov 10 21:30:09 2018 +0100
1.3 @@ -94,11 +94,39 @@
1.4
1.5
1.6
1.7 +/* Initialise a display. */
1.8 +
1.9 +#define Display(NAME, WIDTH, HEIGHT, FRAMES) \
1.10 + uint8_t __##NAME##_framebuffer[(WIDTH) * (HEIGHT + 1) * (FRAMES)]; \
1.11 + uint8_t *__##NAME##_screen_starts[FRAMES]; \
1.12 + display_config_t NAME = { \
1.13 + .framebuffer=__##NAME##_framebuffer, \
1.14 + .screen_starts=__##NAME##_screen_starts, \
1.15 + \
1.16 + .line_length=WIDTH, \
1.17 + .line_count=HEIGHT, \
1.18 + .screen_size=(WIDTH) * (HEIGHT), \
1.19 + .total_lines=(HEIGHT + 1) * (FRAMES), \
1.20 + .frame=0, \
1.21 + .frames=FRAMES, \
1.22 + .max_frames=FRAMES, \
1.23 + \
1.24 + .scanlines = SCANLINES, \
1.25 + .line_channels = LINE_CHANNELS, \
1.26 + .cell_size = CELL_SIZE, \
1.27 + .transfer_cell_size = TRANSFER_CELL_SIZE, \
1.28 + \
1.29 + .hfreq_limit = HFREQ_LIMIT, \
1.30 + .hsync_start = HSYNC_START, \
1.31 + .hsync_end = HSYNC_END, \
1.32 + .visible_start = VISIBLE_START, \
1.33 + .vfp_start = VFP_START, \
1.34 + .vsync_start = VSYNC_START, \
1.35 + .vsync_end = VSYNC_END};
1.36 +
1.37 /* Configuration functions. */
1.38
1.39 -void init_display(display_config_t *cfg, uint8_t *framebuffer,
1.40 - uint32_t line_length, uint32_t line_count,
1.41 - int frames, uint8_t **screen_starts);
1.42 +void init_display(display_config_t *cfg);
1.43
1.44 void init_display_properties(display_config_t *cfg);
1.45