msxbuild/lib/openmsx/share/scripts/boot_exec.tcl

56 lines
1.2 KiB
Tcl
Raw Normal View History

2024-06-30 14:13:44 +00:00
# boot_exec -- Helper commands to autoexec.bat boot scripts.
#
2024-06-30 14:13:44 +00:00
# Adds the following commands to openMSX;
#
# 'boot_exec_setcolor <vdp_fg> <vdp_bg>'
# Sets the VDP colors to defaults or supplied colors.
#
# 'boot_exec_show_host'
# Displays machine boot line message.
#
# 'boot_exec_show_init'
# Displays MSXBUILD openMSX version boot line message.
2024-06-30 14:13:44 +00:00
#
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 "777"
}
if {$vdp_bg != 0} {
set color_vdp_bg $vdp_bg
} else {
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 fg $color_vdp_fg bg $color_vdp_bg"
} else {
return "mb::boot color MSX1"
}
}
proc boot_exec_show_host {} {
set result "mb::host "
append result [machine_info config_name]
return $result
}
2024-06-30 14:13:44 +00:00
proc boot_exec_show_init {} {
set result "mb::init MSXBUILD on "
append result [openmsx_info version]
return $result
2024-06-30 14:13:44 +00:00
}
proc boot_exec_plug_porta {{plug_dev}} {
plug joyporta $plug_dev
return "mb::plug porta $plug_dev"
}
proc boot_exec_plug_portb {{plug_dev}} {
plug joyportb $plug_dev
return "mb::plug portb $plug_dev"
}