-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
video: add support for the Zeal 8-bit Video Card
It is now possible to use the bootloader with the Zeal 8-bit video card and the PS/2 keyboard. The standard output can now be chosen in a configuration file. Note that the UART is still enabled even if it not the standard output because it is required to receive files.
- Loading branch information
Showing
22 changed files
with
1,248 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
usage() { | ||
echo "usage: $0 output_file address_1 file_1 ... address_n file_n" >&2 | ||
exit 1 | ||
} | ||
|
||
# Check if the number of arguments is odd | ||
if [ $# -lt 3 ] || [ $(($# % 2)) -ne 1 ]; then | ||
usage | ||
fi | ||
|
||
# Create the output file | ||
output_file="$1" | ||
touch "$output_file" | ||
shift | ||
|
||
# Loop through the arguments in pairs: (address, file) | ||
while (( "$#" )); do | ||
addr="$1" | ||
file="$2" | ||
printf "0x%04x - %s\n" "$addr" "$file" | ||
dd if="$file" of="$output_file" bs=1 seek="$(($addr))" status="none" | ||
shift 2 | ||
done |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
; SPDX-FileCopyrightText: 2024 Zeal 8-bit Computer <[email protected]> | ||
; | ||
; SPDX-License-Identifier: Apache-2.0 | ||
|
||
IFNDEF CONFIG_H | ||
DEFINE CONFIG_H | ||
|
||
; When set, the UART will be used as the standard output. When not set or set to 0, the video driver will | ||
; be used. The UART driver will still be used to receive files. | ||
DEFC CONFIG_UART_AS_STDOUT = 1 | ||
|
||
; When set, the Zeal logo will be shown on screen, this takes more RAM at runtime but won't affect the | ||
; OS or program running after the bootloader as the modified tiles are saved and restored. | ||
DEFC CONFIG_VIDEO_SHOW_LOGO = 1 | ||
|
||
; When set, the hardware tester will be available in the menu. | ||
DEFC CONFIG_ENABLE_TESTER = 1 | ||
|
||
; When set, the user will be asked to press a key before returnig to the menu | ||
DEFC CONFIG_ACK_CONTINUE = 1 | ||
|
||
; Number of secodns to wait before autoboot | ||
DEFC CONFIG_AUTOBOOT_DELAY_SECONDS = 3 | ||
|
||
ENDIF ; CONFIG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
; SPDX-FileCopyrightText: 2024 Zeal 8-bit Computer <[email protected]> | ||
; | ||
; SPDX-License-Identifier: Apache-2.0 | ||
|
||
IFNDEF KEYBOARD_H | ||
DEFINE KEYBOARD_H | ||
|
||
EXTERN keyboard_get_char | ||
EXTERN keyboard_next_char | ||
EXTERN keyboard_has_char | ||
EXTERN keyboard_set_synchronous | ||
|
||
DEFC KB_IO_ADDRESS = 0xe8 | ||
|
||
DEFC KB_PRINTABLE_CNT = 0x60 | ||
DEFC KB_SPECIAL_START = 0x66 ; Between 0x60 and 0x66, nothing special | ||
DEFC KB_EXTENDED_SCAN = 0xe0 ; Extended characters such as keypad or arrows | ||
DEFC KB_RELEASE_SCAN = 0xf0 | ||
DEFC KB_RIGHT_ALT_SCAN = 0x11 | ||
DEFC KB_RIGHT_CTRL_SCAN = 0x14 | ||
DEFC KB_LEFT_SUPER_SCAN = 0x1f | ||
DEFC KB_NUMPAD_DIV_SCAN = 0x4a | ||
DEFC KB_NUMPAD_RET_SCAN = 0x5a | ||
DEFC KB_PRT_SCREEN_SCAN = 0x12 ; When Print Screen is received, the scan is 0xE0 0x12 | ||
DEFC KB_MAPPED_EXT_SCANS = 0x69 ; Extended characters which scan code is 0xE0 0x69 and above | ||
; are treated with a mapped array | ||
|
||
DEFC KB_ESC = 0x80 | ||
|
||
ENDIF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
; SPDX-FileCopyrightText: 2024 Zeal 8-bit Computer <[email protected]> | ||
; | ||
; SPDX-License-Identifier: Apache-2.0 | ||
|
||
INCLUDE "config.asm" | ||
|
||
IFNDEF STDOUT_H | ||
DEFINE STDOUT_H | ||
|
||
; It is possible to choose either the UART or video board as the standard output | ||
IF CONFIG_UART_AS_STDOUT | ||
INCLUDE "uart_h.asm" | ||
|
||
DEFC stdout_initialize = uart_initialize | ||
DEFC stdout_autoboot = uart_autoboot | ||
DEFC stdout_write = uart_send_bytes | ||
DEFC stdout_put_char = uart_send_one_byte | ||
DEFC stdout_newline = uart_newline | ||
DEFC stdin_get_char = uart_receive_one_byte | ||
DEFC stdin_has_char = uart_available_read | ||
DEFC stdin_set_synchronous = uart_disable_fifo | ||
DEFC stdout_prepare_menu = uart_clear_screen | ||
|
||
MACRO YELLOW_COLOR _ | ||
DEFM 0x1b, "[1;33m" | ||
ENDM | ||
MACRO GREEN_COLOR _ | ||
DEFM 0x1b, "[1;32m" | ||
ENDM | ||
MACRO RED_COLOR _ | ||
DEFM 0x1b, "[1;31m" | ||
ENDM | ||
|
||
MACRO END_COLOR _ | ||
DEFM 0x1b, "[0m" | ||
ENDM | ||
|
||
ELSE ; !CONFIG_UART_AS_STDOUT | ||
|
||
INCLUDE "video_h.asm" | ||
INCLUDE "keyboard_h.asm" | ||
|
||
DEFC stdout_initialize = video_initialize | ||
DEFC stdout_autoboot = video_autoboot | ||
DEFC stdout_write = video_write | ||
DEFC stdout_put_char = video_put_char | ||
DEFC stdout_newline = video_newline | ||
DEFC stdin_get_char = keyboard_next_char | ||
DEFC stdin_has_char = keyboard_has_char | ||
DEFC stdin_set_synchronous = keyboard_set_synchronous | ||
DEFC stdout_prepare_menu = video_clear_screen | ||
|
||
; Use a prefix for the colors | ||
MACRO YELLOW_COLOR _ | ||
DEFM 0xFE | ||
ENDM | ||
MACRO GREEN_COLOR _ | ||
DEFM 0xF2 | ||
ENDM | ||
MACRO RED_COLOR _ | ||
DEFM 0xF4 | ||
ENDM | ||
|
||
MACRO END_COLOR _ | ||
DEFM 0xff | ||
ENDM | ||
|
||
ENDIF | ||
|
||
|
||
MACRO PRINT_STR label | ||
ld hl, label | ||
ld bc, label ## _end - label | ||
call stdout_write | ||
ENDM | ||
|
||
MACRO PRINT_STR_UART label | ||
ld hl, label | ||
ld bc, label ## _end - label | ||
call uart_send_bytes | ||
ENDM | ||
|
||
ENDIF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.