msxbuild/lib/openmsx/share/scripts/boot_exec.tcl
Willem Cazander f4197c1a14
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 2s
Improved plug support and added plug result messages.
2024-07-03 00:38:25 +02:00

56 lines
1.2 KiB
Tcl

# boot_exec -- Helper commands to autoexec.bat boot scripts.
#
# 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.
#
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
}
proc boot_exec_show_init {} {
set result "mb::init MSXBUILD on "
append result [openmsx_info version]
return $result
}
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"
}