Cleaned machine boot messages.
All checks were successful
Run test asserts / Test-Asserts (push) Successful in -7s

This commit is contained in:
Willem Cazander 2024-06-28 19:04:15 +02:00
parent dc8b8a535e
commit 2896fa31bf
4 changed files with 59 additions and 32 deletions

View file

@ -1,11 +1,20 @@
# boot_env -- Sets various openMSX settings based from environment variables.
#
# Typically used in automation tools which run openMSX without human interaction.
#
# Adds the following command to openMSX;
#
# 'boot_gui_mode'
# Enableds the renderer and throttle from the inside.
#
# Supported environment variables by this script;
#
# RENDERER=SDL
# RENDERER=on|off
# Override video output from command line.
#
# RENDERER_TYPE=SDL
# Select video renderer type.
#
# SCALE_FACTOR=3
# Override video scale factor for SDL renderer.
#
@ -25,8 +34,26 @@
# Enables the the video recorder.
#
if {[info exists ::env(RENDERER)] && ([string trim $::env(RENDERER)] != "")} {
if {[catch {set renderer [string trim $::env(RENDERER)]} err_msg]} {
# Enabled openMSX gui from inside
proc boot_gui_mode {} {
global renderer
global throttle
global boot_env_renderer_type
if {$boot_env_renderer_type != 0} {
set renderer $boot_env_renderer_type
set throttle on
}
}
# Globals
set boot_env_renderer_type 0
if {[info exists ::env(RENDERER_TYPE)] && ([string trim $::env(RENDERER_TYPE)] != "")} {
set boot_env_renderer_type [string trim $::env(RENDERER_TYPE)]
}
if {[info exists ::env(RENDERER)] && ([string trim $::env(RENDERER)] == "on")} {
if {[catch {set renderer $boot_env_renderer_type} err_msg]} {
puts stderr "error: env.RENDERER value $err_msg"
exit 1
}