Small fixed and added color options for different things.
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 3s

This commit is contained in:
Willem Cazander 2024-07-02 22:56:17 +02:00
parent 0ed79edd77
commit 93cb9fd5d6
8 changed files with 71 additions and 58 deletions

View file

@ -2,58 +2,44 @@
#
# Adds the following commands to openMSX;
#
# 'boot_exec_color_vdp <vdp_fg> <vdp_bg>'
# 'boot_exec_setcolor <vdp_fg> <vdp_bg>'
# Sets the VDP colors to defaults or supplied colors.
#
# 'boot_exec_config_info'
# Displays machine and openMSX version on one line.
# 'boot_exec_show_host'
# Displays machine boot line message.
#
# Supported environment variables by this script;
#
# VDP_FG=111
# Override the default vdp foreground color.
#
# VDP_BG=369
# Override the default vdp background color.
# 'boot_exec_show_init'
# Displays MSXBUILD openMSX version boot line message.
#
set boot_exec_color_vdp_fg "777"
set boot_exec_color_vdp_bg "000"
proc boot_exec_color_vdp {{vdp_fg 0} {vdp_bg 0}} {
global boot_exec_color_vdp_fg
global boot_exec_color_vdp_bg
proc boot_exec_setcolor {{vdp_fg 0} {vdp_bg 0}} {
if {$vdp_fg != 0} {
set color_vdp_fg $vdp_fg
} else {
set color_vdp_fg $boot_exec_color_vdp_fg
set color_vdp_fg "777"
}
if {$vdp_bg != 0} {
set color_vdp_bg $vdp_bg
} else {
set color_vdp_bg $boot_exec_color_vdp_bg
set color_vdp_bg "000"
}
if {([vdpreg 8] != 0) || ([vdpreg 16] != 0)} {
setcolor 15 $color_vdp_fg
setcolor 4 $color_vdp_bg
return "mb::boot color vdp fg $color_vdp_fg bg $color_vdp_bg"
return "mb::boot color fg $color_vdp_fg bg $color_vdp_bg"
} else {
return "mb::boot color MSX1"
}
}
proc boot_exec_config_info {} {
proc boot_exec_show_host {} {
set result "mb::host "
append result [machine_info config_name]
append result " on "
append result [openmsx_info version]
return $result
}
if {[info exists ::env(VDP_FG)] && ([string trim $::env(VDP_FG)] != "")} {
set boot_exec_color_vdp_fg [string trim $::env(VDP_FG)]
}
if {[info exists ::env(VDP_BG)] && ([string trim $::env(VDP_BG)] != "")} {
set boot_exec_color_vdp_bg [string trim $::env(VDP_BG)]
proc boot_exec_show_init {} {
set result "mb::init MSXBUILD on "
append result [openmsx_info version]
return $result
}