msxbuild/lib/openmsx/share/scripts/boot_exec.tcl
Willem Cazander 3a471f9f45
All checks were successful
Run test asserts / Test-Asserts (push) Successful in -11s
Doc typo fix.
2024-07-01 11:58:36 +02:00

56 lines
1.4 KiB
Tcl

# boot_exec -- Helper commands to autoexec.bat boot scripts.
#
# Adds the following commands to openMSX;
#
# 'boot_exec_color_vdp <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.
#
# Supported environment variables by this script;
#
# VDP_FG=111
# Override the default vdp foreground color.
#
# VDP_BG=369
# Override the default vdp background color.
#
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
if {$vdp_fg != 0} {
set color_vdp_fg $vdp_fg
} else {
set color_vdp_fg $boot_exec_color_vdp_fg
}
if {$vdp_bg != 0} {
set color_vdp_bg $vdp_bg
} else {
set color_vdp_bg $boot_exec_color_vdp_bg
}
setcolor 15 $color_vdp_fg
setcolor 4 $color_vdp_bg
return "Boot color vdp fg $color_vdp_fg bg $color_vdp_bg"
}
proc boot_exec_config_info {} {
set result "Run machine "
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)]
}