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

@ -5,11 +5,14 @@ MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_VERSION,"Print O
MB_AUTOEXEC_SHOW_PATH ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_PATH,"Print search path on boot.",$(MB_AUTOEXEC_SHOW_PATH))
MB_AUTOEXEC_SHOW_PROLOG ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_PROLOG,"Print msxbuild prolog on boot.",$(MB_AUTOEXEC_SHOW_PROLOG))
MB_AUTOEXEC_SHOW_INIT ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_INIT,"Print msxbuild init message on boot.",$(MB_AUTOEXEC_SHOW_INIT))
MB_AUTOEXEC_SHOW_CONFIG ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_CONFIG,"Print host config on boot.",$(MB_AUTOEXEC_SHOW_CONFIG))
MB_AUTOEXEC_SHOW_HOST ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_HOST,"Print host machine on boot.",$(MB_AUTOEXEC_SHOW_HOST))
MB_AUTOEXEC_SHOW_USER ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_USER,"Print host user on boot.",$(MB_AUTOEXEC_SHOW_USER))
MB_AUTOEXEC_SHOW_FOLDER ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SHOW_FOLDER,"Print host folder on boot.",$(MB_AUTOEXEC_SHOW_FOLDER))
@ -35,8 +38,15 @@ MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SAFE_CMD_TIMEOUT,"Saf
MB_AUTOEXEC_SAFE_CMD_EXITCODE ?= 1
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_SAFE_CMD_EXITCODE,"Safe command execution failure exit code.",$(MB_AUTOEXEC_SAFE_CMD_EXITCODE))
MB_AUTOEXEC_STARTUP_PROLOG ?= mb::boot MSXBUILD UID $(USER)
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_STARTUP_PROLOG,"Boot prolog user postfix.",$(MB_AUTOEXEC_STARTUP_PROLOG))
MB_AUTOEXEC_STARTUP_NOTE ?=
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_STARTUP_NOTE,"When set this startup note message is shown.",$(MB_AUTOEXEC_STARTUP_NOTE))
MB_AUTOEXEC_COLOR_FG ?= 151
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_COLOR_FG,"Default foreground color if none is given.",$(MB_AUTOEXEC_COLOR_FG))
MB_AUTOEXEC_COLOR_BG ?= 000
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_COLOR_BG,"Default background color if none if given.",$(MB_AUTOEXEC_COLOR_BG))
define mb_autoexec_append_cmd
echo "$(2)\r" >> $(1)/autoexec.bat
@ -100,22 +110,24 @@ MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_autoexec_append_safe_cmd,"Appe
define _mb_autoexec_write_preboot
$(call mb_autoexec_append_cmd,$(1),$(2)mbboot80)
$(call mb_autoexec_append_cmd,$(1),$(2)omsxctl boot_exec_color_vdp)
$(if $(filter on,$(MB_FLIGHT_VIDEO)),$(call mb_autoexec_append_save_video,$(1)))
$(call mb_autoexec_append_cmd,$(1),$(2)omsxctl boot_exec_setcolor $(if $(3),$(3),$(MB_AUTOEXEC_COLOR_FG)) $(if $(4),$(4),$(MB_AUTOEXEC_COLOR_BG)))
$(call mb_autoexec_append_cmd,$(1),$(2)omsxctl fail_after $(MB_AUTOEXEC_STARTUP_TIMEOUT) seconds err_exec $(MB_AUTOEXEC_STARTUP_EXITCODE))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_INIT)),$(call mb_autoexec_append_cmd,$(1),$(2)omsxctl boot_exec_show_init))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_VERSION)),$(call mb_autoexec_append_cmd,$(1),ver))
$(if $(wildcard $(1)/utils),$(call mb_autoexec_append_cmd,$(1),PATH + A:\UTILS))
endef
define mb_autoexec_write_default
@echo === Writing autoexec.bat for $@
@echo -n "" > $(1)/autoexec.bat
$(if $(wildcard $(1)/utils),$(call _mb_autoexec_write_preboot,$(1),utils\),$(call _mb_autoexec_write_preboot,$(1)))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_VERSION)),$(call mb_autoexec_append_cmd,$(1),ver))
$(if $(wildcard $(1)/utils),$(call mb_autoexec_append_cmd,$(1),PATH + A:\UTILS))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_PATH)),$(call mb_autoexec_append_cmd,$(1),PATH))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_PROLOG)),$(call mb_autoexec_append_echo,$(1),$(MB_AUTOEXEC_STARTUP_PROLOG)))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_CONFIG)),$(call mb_autoexec_append_cmd,$(1),omsxctl boot_exec_config_info))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_FOLDER)),$(call mb_autoexec_append_echo,$(1),mb::path $(1)))
$(if $(wildcard $(1)/utils),$(call _mb_autoexec_write_preboot,$(1),utils\,$(2),$(3)),$(call _mb_autoexec_write_preboot,$(1),,$(2),$(3)))
$(if $(MB_AUTOEXEC_STARTUP_NOTE),$(call mb_autoexec_append_echo,$(1),mb::note $(MB_AUTOEXEC_STARTUP_NOTE)))
$(if $(filter on,$(MB_FLIGHT_VIDEO)),$(call mb_autoexec_append_save_video,$(1)))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_HOST)),$(call mb_autoexec_append_cmd,$(1),omsxctl boot_exec_show_host))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_PATH)),$(call mb_autoexec_append_cmd,$(1),echo mb::path %PATH%))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_USER)),$(call mb_autoexec_append_echo,$(1),mb::user $(USER)))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_FOLDER)),$(call mb_autoexec_append_echo,$(1),mb::bath $(1)))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_TARGET)),$(call mb_autoexec_append_echo,$(1),mb::pipe $@))
endef
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_autoexec_write_default,"Write a default autoexec.bat file.","<dir>")
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_autoexec_write_default,"Write a default autoexec.bat file.","<dir> [fg-color] [bg-color]")

View file

@ -14,7 +14,7 @@ MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_FLIGHT_SEPERATOR,"File and ind
MB_FLIGHT_RECORD_FLAG ?= -doublesize
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_FLIGHT_RECORD_FLAG,"Command parameter flag of the video recorder.",$(MB_FLIGHT_RECORD_FLAG))
MB_FLIGHT_VIDEO_NAME ?= flight-video
MB_FLIGHT_VIDEO_NAME ?= night-flight
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_FLIGHT_VIDEO_NAME,"Video file name of the final result merged video.",$(MB_FLIGHT_VIDEO_NAME))
define mb_flight_video_merge

View file

@ -1,6 +1,25 @@
MB_MSXPIPE_COLOR_FG_SAFE_CMD ?= 116
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_MSXPIPE_COLOR_FG_SAFE_CMD,"Foreground color of safe command session pipe.",$(MB_MSXPIPE_COLOR_FG_SAFE_CMD))
MB_MSXPIPE_COLOR_BG_SAFE_CMD ?= 000
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_MSXPIPE_COLOR_BG_SAFE_CMD,"Background color of safe command session pipe.",$(MB_MSXPIPE_COLOR_BG_SAFE_CMD))
MB_MSXPIPE_COLOR_FG_SAFE_TEST ?= 511
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_MSXPIPE_COLOR_FG_SAFE_TEST,"Foreground color of safe test session pipe.",$(MB_MSXPIPE_COLOR_FG_SAFE_TEST))
MB_MSXPIPE_COLOR_BG_SAFE_TEST ?= 000
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_MSXPIPE_COLOR_BG_SAFE_TEST,"Background color of safe test session pipe.",$(MB_MSXPIPE_COLOR_BG_SAFE_TEST))
MB_MSXPIPE_COLOR_FG_RUN_GUI ?= 151
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_MSXPIPE_COLOR_FG_RUN_GUI,"Foreground color of run gui session pipe.",$(MB_MSXPIPE_COLOR_FG_RUN_GUI))
MB_MSXPIPE_COLOR_BG_RUN_GUI ?= 000
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_MSXPIPE_COLOR_BG_RUN_GUI,"Background color of run gui session pipe.",$(MB_MSXPIPE_COLOR_BG_RUN_GUI))
define mb_msxpipe_safe_cmd
$(call mb_autoexec_write_default,$(1))
$(call mb_autoexec_write_default,$(1),$(MB_MSXPIPE_COLOR_FG_SAFE_CMD),$(MB_MSXPIPE_COLOR_BG_SAFE_CMD))
$(call mb_autoexec_append_safe_cmd,$(1),$(2))
$(call mb_autoexec_append_exit,$(1))
$(call mb_openmsx_dosctl,$(1),$(3))
@ -8,7 +27,7 @@ endef
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_msxpipe_safe_cmd,"Runs openMSX and safely executes one command.","<dir> <cmd> [machine]")
define mb_msxpipe_safe_test
$(call mb_autoexec_write_default,$(1))
$(call mb_autoexec_write_default,$(1),$(MB_MSXPIPE_COLOR_FG_SAFE_TEST),$(MB_MSXPIPE_COLOR_BG_SAFE_TEST))
$(call mb_autoexec_append_safe_test,$(1),$(2))
$(call mb_autoexec_append_exit,$(1))
$(call mb_openmsx_dosctl,$(1),$(3))
@ -16,7 +35,7 @@ endef
MB_DOC_HELP_FUNCTION += $(call mb_doc_function,mb_msxpipe_safe_test,"Runs openMSX and safely executes one test.","<dir> <cmd> [machine]")
define _mb_msxpipe_run_gui
$(call mb_autoexec_write_default,$(1))
$(call mb_autoexec_write_default,$(1),$(MB_MSXPIPE_COLOR_FG_RUN_GUI),$(MB_MSXPIPE_COLOR_BG_RUN_GUI))
$(call mb_autoexec_append_stop_fail,$(1))
$(call mb_autoexec_append_show_gui,$(1))
$(if $(filter mouse,$(4)),$(call mb_autoexec_append_joyporta_mouse,$(1)))

View file

@ -32,10 +32,6 @@ MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_OPENMSX_HEADLESS,"Controls if
MB_OPENMSX_RENDERER ?= SDLGL-PP
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_OPENMSX_RENDERER,"The gui renderer used to display the window head with.",$(MB_OPENMSX_RENDERER))
MB_OPENMSX_VDP_FG ?= 151
MB_OPENMSX_VDP_BG ?= 000
define mb_openmsx_setup
$(if $(wildcard $(1)-omsx),,$(call mb_mkdir,$(1)-omsx))
$(if $(wildcard $(1)-omsx/stdio.xml),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/stdio.xml,$(1)-omsx))
@ -70,8 +66,6 @@ define _mb_openmsx_run
NF_PREFIX=$(MB_FLIGHT_PREFIX) \
NF_SEPERATOR=$(MB_FLIGHT_SEPERATOR) \
NF_RECORD_FLAG=$(MB_FLIGHT_RECORD_FLAG) \
VDP_FG=$(MB_OPENMSX_VDP_FG) \
VDP_BG=$(MB_OPENMSX_VDP_BG) \
OPENMSX_HOME="$(1)-omsx" \
$(PATH_OPENMSX)/openmsx \
-machine $(2) \

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
}

View file

@ -1,10 +1,11 @@
DIST_QA_MSX1_MACHINE ?= Canon_V-20
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,DIST_QA_MSX1_MACHINE,"The machine to run the $(DIST_QA_MSX1_MOD) module.",$(DIST_QA_MSX1_MACHINE))
DIST_QA_MSX1_MOD := dist-qa-msx1
DIST_QA_MSX1_SRC := $(PATH_SRC)/$(DIST_QA_MSX1_MOD)
DIST_QA_MSX1_BIN := $(PATH_BIN)/$(DIST_QA_MSX1_MOD)
DIST_QA_MSX1_DEPS := $(subst dist,$(DIST_QA_MSX1_MOD),$(DIST_DEPS))
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,DIST_QA_MSX1_MACHINE,"The machine to run the $(DIST_QA_MSX1_MOD) module.",$(DIST_QA_MSX1_MACHINE))
$(DIST_QA_MSX1_BIN): | $(PATH_BIN)/@prepare
$(call mb_mkdir,$(DIST_QA_MSX1_BIN))

View file

@ -1,10 +1,11 @@
DIST_QA_MSXHUB_MACHINE ?= Boosted_MSX2+_JP
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,DIST_QA_MSXHUB_MACHINE,"The machine to run the $(DIST_QA_MSXHUB_MOD) module.",$(DIST_QA_MSXHUB_MACHINE))
DIST_QA_MSXHUB_MOD := dist-qa-msxhub
DIST_QA_MSXHUB_SRC := $(PATH_SRC)/$(DIST_QA_MSXHUB_MOD)
DIST_QA_MSXHUB_BIN := $(PATH_BIN)/$(DIST_QA_MSXHUB_MOD)
DIST_QA_MSXHUB_DEPS := $(subst dist,$(DIST_QA_MSXHUB_MOD),$(DIST_DEPS))
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,DIST_QA_MSXHUB_MACHINE,"The machine to run the $(DIST_QA_MSXHUB_MOD) module.",$(DIST_QA_MSXHUB_MACHINE))
$(DIST_QA_MSXHUB_BIN): | $(PATH_BIN)/@prepare
$(call mb_mkdir,$(DIST_QA_MSXHUB_BIN))

View file

@ -12,7 +12,7 @@ copy /T NFBSSHOT.MAC NFBSSHOT.BAK
dir/w utils
copy /T NFBSSHOT.BAK NFBSSHOT.MAC
echo === Running make
omsxctl fail_after 300 seconds failed_make 1
omsxctl fail_after 300 seconds err_make 1
echo "dir" > build1.bat
make NFBSSHOT.MF /x > build2.bat
echo === Concat shutdown
@ -27,5 +27,5 @@ concat build1.bat + build2.bat + build3.bat + build4.bat buildrun.bat
echo === Final script
type buildrun.bat
echo === Running build
omsxctl fail_after 300 seconds failed_build 1
omsxctl fail_after 300 seconds err_build 1
buildrun