paul@49 | 1 | /* |
paul@53 | 2 | * Initialisation of application-specific display configuration. This requires |
paul@53 | 3 | * the prior definition of various display properties. |
paul@49 | 4 | * |
paul@49 | 5 | * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> |
paul@49 | 6 | * |
paul@49 | 7 | * This program is free software: you can redistribute it and/or modify |
paul@49 | 8 | * it under the terms of the GNU General Public License as published by |
paul@49 | 9 | * the Free Software Foundation, either version 3 of the License, or |
paul@49 | 10 | * (at your option) any later version. |
paul@49 | 11 | * |
paul@49 | 12 | * This program is distributed in the hope that it will be useful, |
paul@49 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@49 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@49 | 15 | * GNU General Public License for more details. |
paul@49 | 16 | * |
paul@49 | 17 | * You should have received a copy of the GNU General Public License |
paul@49 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
paul@49 | 19 | */ |
paul@49 | 20 | |
paul@50 | 21 | #ifndef __DISPLAY_CONFIG_H__ |
paul@50 | 22 | #define __DISPLAY_CONFIG_H__ |
paul@49 | 23 | |
paul@49 | 24 | #include "display.h" |
paul@77 | 25 | #include "vga.h" |
paul@49 | 26 | |
paul@82 | 27 | /* Reserve enough space for a screen, plus one line to allow horizontal |
paul@82 | 28 | scrolling, since a horizontal scroll offset causes the final transfer line to |
paul@82 | 29 | exceed the screen limit. */ |
paul@82 | 30 | |
paul@82 | 31 | uint8_t framebuffer[SCREEN_SIZE + LINE_LENGTH]; |
paul@82 | 32 | |
paul@82 | 33 | |
paul@82 | 34 | |
paul@82 | 35 | /* Define a structure containing the display parameters. */ |
paul@49 | 36 | |
paul@49 | 37 | display_config_t display_config = { |
paul@50 | 38 | |
paul@50 | 39 | /* Set the reserved memory as the framebuffer. */ |
paul@50 | 40 | |
paul@49 | 41 | .framebuffer = framebuffer, |
paul@50 | 42 | .screen_start = framebuffer, |
paul@50 | 43 | .screen_limit = framebuffer + SCREEN_SIZE, |
paul@50 | 44 | |
paul@50 | 45 | /* Define screen dimensions and properties. */ |
paul@50 | 46 | |
paul@49 | 47 | .screen_size = SCREEN_SIZE, |
paul@49 | 48 | .line_length = LINE_LENGTH, |
paul@49 | 49 | .line_count = LINE_COUNT, |
paul@49 | 50 | .line_multiplier = LINE_MULTIPLIER, |
paul@49 | 51 | .cell_size = CELL_SIZE, |
paul@56 | 52 | .transfer_cell_size = TRANSFER_CELL_SIZE, |
paul@50 | 53 | |
paul@50 | 54 | /* Define display region properties. */ |
paul@50 | 55 | |
paul@53 | 56 | .hfreq_limit = HFREQ_LIMIT, |
paul@53 | 57 | .hsync_start = HSYNC_START, |
paul@53 | 58 | .hsync_end = HSYNC_END, |
paul@50 | 59 | .visible_start = VISIBLE_START, |
paul@50 | 60 | .vfp_start = VFP_START, |
paul@50 | 61 | .vsync_start = VSYNC_START, |
paul@50 | 62 | .vsync_end = VSYNC_END, |
paul@50 | 63 | |
paul@49 | 64 | }; |
paul@49 | 65 | |
paul@50 | 66 | #endif /* __DISPLAY_CONFIG_H__ */ |