From c1a52773ac20b207a741fec53a11b464328b84e0 Mon Sep 17 00:00:00 2001 From: Willem Date: Sat, 29 Jun 2024 15:47:52 +0200 Subject: [PATCH] Added flight recorder and more boot messages. --- Makefile | 1 - README.md | 15 +++-- lib/make/mb_autoexec.mk | 50 ++++++++------- lib/make/mb_openmsx.mk | 13 ++-- lib/make/msxbuild.mk | 7 +++ lib/openmsx/share/scripts/boot_exec.tcl | 33 ++++++++++ lib/openmsx/share/scripts/boot_hdd.tcl | 2 - .../scripts/{boot_env.tcl => boot_mode.tcl} | 38 ++++------- lib/openmsx/share/scripts/fail_after.tcl | 36 ++++------- lib/openmsx/share/scripts/save_flight.tcl | 63 +++++++++++++++++++ test/ahello-m80/0module.mk | 2 +- test/ahello-sdcc/0module.mk | 2 +- test/dist-qa-dos1/0module.mk | 2 +- test/dist-qa-dos2/0module.mk | 2 +- test/dist-qa-msx1/0module.mk | 2 +- test/dist-qa-msxhub/0module.mk | 2 +- 16 files changed, 176 insertions(+), 94 deletions(-) create mode 100644 lib/openmsx/share/scripts/boot_exec.tcl rename lib/openmsx/share/scripts/{boot_env.tcl => boot_mode.tcl} (68%) create mode 100644 lib/openmsx/share/scripts/save_flight.tcl diff --git a/Makefile b/Makefile index fb21560..1ea941b 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,5 @@ BUILD_HELP += \\n\\t* clean clean: $(call mb_clean,$(PATH_BIN)) -MB_OPENMSX_PATH_BIN ?= $(PATH_BIN) include lib/make/msxbuild.mk include $(INC_TEST) diff --git a/README.md b/README.md index 6493fec..ca40fa4 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ When you want to see whats happening do a debug run; real 2m37.379s debug run with video recorder and merge to one video file; - time MB_OPENMSX_HEADLESS=off MB_OPENMSX_RECORDER=on make -s assert-all-video + time MB_OPENMSX_HEADLESS=off MB_FLIGHT_VIDEO=on make -s assert-all-video real 0m7.136s build parallel; @@ -77,17 +77,19 @@ Current set is WIP. * mb_autoexec_append_cmd * mb_autoexec_append_echo * mb_autoexec_append_rem -* mb_autoexec_append_gui_mode +* mb_autoexec_append_show_gui * mb_autoexec_append_stop_fail * mb_autoexec_append_exit * mb_autoexec_append_joyporta_mouse +* mb_autoexec_append_record_screenshot +* mb_autoexec_append_record_video * mb_autoexec_append_safe_test * mb_autoexec_append_safe_cmd * mb_autoexec_write_default -* mb_autoexec_open_gui40 -* mb_autoexec_open_gui40_mouse -* mb_autoexec_open_gui80 -* mb_autoexec_open_gui80_mouse +* mb_autoexec_show_gui40 +* mb_autoexec_show_gui40_mouse +* mb_autoexec_show_gui80 +* mb_autoexec_show_gui80_mouse * mb_autoexec_safe_cmd * mb_autoexec_safe_test * mb_msxhub_file @@ -163,6 +165,7 @@ Current set is WIP. ## Errata * Imported folders in openMSX; `cd utils;cd ..;dir` breaks, use `cd utils:cd a:\;dir` as workaround +* Saving screenshots sometimes lets openMSX segfaults * Doesn't work on windows * Missing C and mixed support * If no SDL than screenshot in fail_after doesn't work diff --git a/lib/make/mb_autoexec.mk b/lib/make/mb_autoexec.mk index c5484cd..4a07bf1 100644 --- a/lib/make/mb_autoexec.mk +++ b/lib/make/mb_autoexec.mk @@ -16,20 +16,25 @@ endef define mb_autoexec_append_rem $(call mb_autoexec_append_cmd,$(1),rem $(2)) endef -define mb_autoexec_append_gui_mode - $(call mb_autoexec_append_echo,$(1),Enabling boot GUI mode.) - $(call mb_autoexec_append_cmd,$(1),omsxctl after time 1 boot_gui_mode) +define mb_autoexec_append_show_gui + $(call mb_autoexec_append_cmd,$(1),omsxctl boot_mode_show_gui) endef define mb_autoexec_append_stop_fail - $(call mb_autoexec_append_echo,$(1),Disabling automatic failure.) $(call mb_autoexec_append_cmd,$(1),omsxctl fail_after 0) endef define mb_autoexec_append_exit - $(call mb_autoexec_append_cmd,$(1),omsxctl exit 0) + $(if $(filter on,$(MB_FLIGHT_SCREEN)),$(call mb_autoexec_append_save_screenshot,$(1))) + $(call mb_autoexec_append_cmd,$(1),omsxctl boot_exec_exit) endef define mb_autoexec_append_joyporta_mouse $(call mb_autoexec_append_cmd,$(1),omsxctl plug joyporta mouse) endef +define mb_autoexec_append_save_screenshot + $(call mb_autoexec_append_cmd,$(1),omsxctl save_flight_screenshot $(2)) +endef +define mb_autoexec_append_save_video + $(call mb_autoexec_append_cmd,$(1),omsxctl save_flight_video $(2)) +endef define mb_autoexec_append_safe_test $(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(if $(3),$(3),$(MB_AUTOEXEC_TEST_TIMEOUT)) seconds failed_test $(if $(4),$(4),$(MB_AUTOEXEC_TEST_EXITCODE))) $(call mb_autoexec_append_echo,$(1),Running test: $(2)) @@ -43,40 +48,41 @@ endef define mb_autoexec_write_default @echo === Writing autoexec.bat for $(notdir $(1)) @echo -n "" > $(1)/autoexec.bat - $(call mb_autoexec_append_cmd,$(1),omsxctl setcolor 4 000) - $(call mb_autoexec_append_cmd,$(1),omsxctl setcolor 15 777) $(if $(filter 40,$(2)),$(call mb_autoexec_append_cmd,$(1),mode 40),$(call mb_autoexec_append_cmd,$(1),mode 80)) - $(if $(filter 40,$(2)),$(call mb_autoexec_append_echo,$(1),Enabled mode 40.),$(call mb_autoexec_append_echo,$(1),Enabled mode 80.)) + $(call mb_autoexec_append_echo,$(1),==== MSXBUILD ====) + $(if $(filter 40,$(2)),$(call mb_autoexec_append_echo,$(1),Boot mode 40),$(call mb_autoexec_append_echo,$(1),Boot mode 80)) + $(if $(filter on,$(MB_FLIGHT_VIDEO)),$(call mb_autoexec_append_save_video,$(1))) + $(call mb_autoexec_append_cmd,$(1),omsxctl boot_exec_color_dark) $(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(MB_AUTOEXEC_STARTUP_TIMEOUT) seconds failed_exec $(MB_AUTOEXEC_STARTUP_EXITCODE)) $(if $(filter on,$(MB_AUTOEXEC_VERSION)),$(call mb_autoexec_append_cmd,$(1),ver)) - $(if $(filter on,$(MB_AUTOEXEC_VERSION)),$(call mb_autoexec_append_cmd,$(1),omsxctl machine_info config_name)) - $(if $(filter on,$(MB_AUTOEXEC_VERSION)),$(call mb_autoexec_append_cmd,$(1),omsxctl openmsx_info version)) $(if $(wildcard $(1)/utils),$(call mb_autoexec_append_cmd,$(1),PATH + A:\)) $(if $(wildcard $(1)/utils),$(call mb_autoexec_append_cmd,$(1),PATH + A:\UTILS)) $(if $(wildcard $(1)/utils),$(call mb_autoexec_append_cmd,$(1),PATH)) - $(call mb_autoexec_append_echo,$(1),Run msxbuild: $(notdir $(1))) + $(if $(filter on,$(MB_AUTOEXEC_VERSION)),$(call mb_autoexec_append_cmd,$(1),omsxctl boot_exec_config_info)) + $(call mb_autoexec_append_echo,$(1),Run folder $(1)) + $(call mb_autoexec_append_echo,$(1),Run target $@) endef -define _mb_autoexec_open_gui +define _mb_autoexec_show_gui $(call mb_autoexec_write_default,$(1),$(2)) $(call mb_autoexec_append_stop_fail,$(1)) - $(call mb_autoexec_append_gui_mode,$(1)) + $(call mb_autoexec_append_show_gui,$(1)) $(if $(filter mouse,$(4)),$(call mb_autoexec_append_joyporta_mouse,$(1))) - $(call mb_autoexec_append_echo,$(1),Type shutdown to stop emulation.) + $(call mb_autoexec_append_echo,$(1),Type shutdown to stop emulation) $(if $(3),$(call mb_autoexec_append_echo,$(1),Running command: $(3))) $(if $(3),$(call mb_autoexec_append_cmd,$(1),$(3))) endef -define mb_autoexec_open_gui40 - $(call _mb_autoexec_open_gui,$(1),40,$(2)) +define mb_autoexec_show_gui40 + $(call _mb_autoexec_show_gui,$(1),40,$(2)) endef -define mb_autoexec_open_gui40_mouse - $(call _mb_autoexec_open_gui,$(1),40,$(2),mouse) +define mb_autoexec_show_gui40_mouse + $(call _mb_autoexec_show_gui,$(1),40,$(2),mouse) endef -define mb_autoexec_open_gui80 - $(call _mb_autoexec_open_gui,$(1),80,$(2)) +define mb_autoexec_show_gui80 + $(call _mb_autoexec_show_gui,$(1),80,$(2)) endef -define mb_autoexec_open_gui80_mouse - $(call _mb_autoexec_open_gui,$(1),80,$(2),mouse) +define mb_autoexec_show_gui80_mouse + $(call _mb_autoexec_show_gui,$(1),80,$(2),mouse) endef define mb_autoexec_safe_cmd diff --git a/lib/make/mb_openmsx.mk b/lib/make/mb_openmsx.mk index 9d858fc..ec9b07a 100644 --- a/lib/make/mb_openmsx.mk +++ b/lib/make/mb_openmsx.mk @@ -1,5 +1,4 @@ -MB_OPENMSX_PATH_BIN ?= bin MB_OPENMSX_BOOT_TIMEOUT ?= 25 MB_OPENMSX_BOOT_OS ?= nextor MB_OPENMSX_MACHINE ?= Philips_NMS_8250 @@ -13,7 +12,6 @@ MB_OPENMSX_SCALE_FACTOR ?= 3 MB_OPENMSX_THROTTLE ?= off MB_OPENMSX_HEADLESS ?= on MB_OPENMSX_RENDERER ?= SDL -MB_OPENMSX_RECORDER ?= off MB_OPENMSX_CTLCACHE ?= $(MB_CACHE)/msxbuild/omsxctl define mb_openmsx_setup @@ -25,9 +23,11 @@ define mb_openmsx_setup $(if $(wildcard $(1)-omsx/share),,$(call mb_mkdir,$(1)-omsx/share)) $(if $(wildcard $(1)-omsx/share/settings.xml),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/share/settings.xml,$(1)-omsx/share)) $(if $(wildcard $(1)-omsx/share/scripts),,$(call mb_mkdir,$(1)-omsx/share/scripts)) - $(if $(wildcard $(1)-omsx/share/scripts/boot_env.tcl),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/share/scripts/boot_env.tcl,$(1)-omsx/share/scripts)) + $(if $(wildcard $(1)-omsx/share/scripts/boot_exec.tcl),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/share/scripts/boot_exec.tcl,$(1)-omsx/share/scripts)) $(if $(wildcard $(1)-omsx/share/scripts/boot_hdd.tcl),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/share/scripts/boot_hdd.tcl,$(1)-omsx/share/scripts)) + $(if $(wildcard $(1)-omsx/share/scripts/boot_mode.tcl),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/share/scripts/boot_mode.tcl,$(1)-omsx/share/scripts)) $(if $(wildcard $(1)-omsx/share/scripts/fail_after.tcl),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/share/scripts/fail_after.tcl,$(1)-omsx/share/scripts)) + $(if $(wildcard $(1)-omsx/share/scripts/save_flight.tcl),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/share/scripts/save_flight.tcl,$(1)-omsx/share/scripts)) $(if $(wildcard $(1)-omsx/share/scripts/omsxctl.tcl),,$(call mb_copy,$(MB_OPENMSX_CTLCACHE)/omsxctl.tcl,$(1)-omsx/share/scripts)) $(if $(wildcard $(1)-omsx/share/extensions),,$(call mb_mkdir,$(1)-omsx/share/extensions)) $(if $(wildcard $(1)-omsx/share/extensions/ide-nextor.xml),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/share/extensions/ide-nextor.xml,$(1)-omsx/share/extensions)) @@ -38,8 +38,7 @@ endef define _mb_openmsx_run @echo === openMSX Start for $(notdir $(1)) - FAIL_AFTER_BOOT=$(MB_OPENMSX_BOOT_TIMEOUT) \ - FAIL_AFTER_PATH=$(MB_OPENMSX_PATH_BIN) \ + BOOT_WATCHDOG=$(MB_OPENMSX_BOOT_TIMEOUT) \ BOOT_HDD_PATH="$(1)" \ BOOT_HDD_SIZE=$(MB_OPENMSX_HDD_SIZE) \ BOOT_HDD_IMAGE="$(1)-omsx/persistent/ide-nextor/untitled1/hd.dsk" \ @@ -48,7 +47,9 @@ define _mb_openmsx_run HEADLESS=$(MB_OPENMSX_HEADLESS) \ RENDERER=$(MB_OPENMSX_RENDERER) \ THROTTLE=$(MB_OPENMSX_THROTTLE) \ - RECORDER=$(if $(filter on,$(MB_OPENMSX_RECORDER)),msxbuild-) \ + SAVE_FLIGHT_PREFIX=$(MB_FLIGHT_PREFIX) \ + SAVE_FLIGHT_SEPERATOR=$(MB_FLIGHT_SEPERATOR) \ + SAVE_FLIGHT_RECORD_FLAG=$(MB_FLIGHT_RECORD_FLAG) \ OPENMSX_HOME="$(1)-omsx" \ $(PATH_OPENMSX)/openmsx \ -machine $(2) \ diff --git a/lib/make/msxbuild.mk b/lib/make/msxbuild.mk index ab93c25..e1c04a0 100644 --- a/lib/make/msxbuild.mk +++ b/lib/make/msxbuild.mk @@ -5,8 +5,15 @@ # Setup default tools paths PATH_SDCC ?= /usr/bin PATH_OPENMSX ?= /usr/bin + +# Fill other defaults PATH_MSXBUILD ?= $(dir $(lastword $(MAKEFILE_LIST)))../.. PATH_MSXBUILD_REAL := $(if $(realpath $(PATH_MSXBUILD)),$(realpath $(PATH_MSXBUILD)),$(PATH_MSXBUILD)) +MB_FLIGHT_SCREEN ?= off +MB_FLIGHT_VIDEO ?= off +MB_FLIGHT_PREFIX ?= msxbuild +MB_FLIGHT_SEPERATOR ?= - +MB_FLIGHT_RECORD_FLAG ?= -doublesize # OS cmds ifeq ($(OS),Windows_NT) diff --git a/lib/openmsx/share/scripts/boot_exec.tcl b/lib/openmsx/share/scripts/boot_exec.tcl new file mode 100644 index 0000000..f75783c --- /dev/null +++ b/lib/openmsx/share/scripts/boot_exec.tcl @@ -0,0 +1,33 @@ +# boot_exec -- Helper command to autoexec.bat boot scripts. +# +# Adds the following command to openMSX; +# +# 'boot_exec_exit' +# Requested delayed shutdown of openMSX. +# (as workaround for segfault when screenshot is not ready yet) +# +# 'boot_exec_color_dark' +# Sets the VDP colors to dark color tones. +# +# 'boot_exec_config_info' +# Displays machine and openMSX version on one line. +# + +proc boot_exec_exit {} { + after time 1 "exit 0" + return "Shutdown openMSX" +} + +proc boot_exec_color_dark {} { + setcolor 4 000 + setcolor 15 777 + return "Boot color dark" +} + +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 +} diff --git a/lib/openmsx/share/scripts/boot_hdd.tcl b/lib/openmsx/share/scripts/boot_hdd.tcl index 1a8a54c..43dc5e6 100644 --- a/lib/openmsx/share/scripts/boot_hdd.tcl +++ b/lib/openmsx/share/scripts/boot_hdd.tcl @@ -35,7 +35,6 @@ # The number of partitions created in the disk image, defaults to 1. # -# per default create msxdos1 compatible partition size. set boot_hdd_size 15m set boot_hdd_image hdd.dsk set boot_hdd_path_import 0 @@ -44,7 +43,6 @@ set boot_hdd_export_partition 0 set boot_hdd_export_dir \\ set boot_hdd_partitions 1 -# Parse env settings if {[info exists ::env(BOOT_HDD_SIZE)] && ([string trim $::env(BOOT_HDD_SIZE)] != "")} { set boot_hdd_size [string trim $::env(BOOT_HDD_SIZE)] } diff --git a/lib/openmsx/share/scripts/boot_env.tcl b/lib/openmsx/share/scripts/boot_mode.tcl similarity index 68% rename from lib/openmsx/share/scripts/boot_env.tcl rename to lib/openmsx/share/scripts/boot_mode.tcl index bdcc87c..5070ac2 100644 --- a/lib/openmsx/share/scripts/boot_env.tcl +++ b/lib/openmsx/share/scripts/boot_mode.tcl @@ -1,10 +1,10 @@ -# boot_env -- Sets various openMSX settings based from environment variables. +# boot_mode -- Controls the boot mode config of openMSX from environment variables. # # Typically used in automation tools which run openMSX without human interaction. # # Adds the following command to openMSX; # -# 'boot_gui_mode' +# 'boot_mode_show_gui' # Enables the renderer and throttle from the inside. # # Supported environment variables by this script; @@ -13,38 +13,34 @@ # Override video output from command line. # # RENDERER=SDL -# Select video renderer type for gui mode or in none headless mode. +# Select video renderer type for GUI mode or in none headless mode. # # SCALE_FACTOR=3 -# Override video scale factor for SDL renderer. +# Override video scale factor for the renderer. # # THROTTLE=off -# Disables msx speed emulation. +# Disables MSX speed emulation. # -# SPEED=400 -# Sets msx speed to 4x of original but only when throttle is on. -# -# RECORDER=bin/output.avi -# Enables the the video recorder. +# SPEED=333 +# Sets CPU speed to relative from normal but only when throttle is on. # -# Enabled openMSX gui from inside -proc boot_gui_mode {} { +set boot_env_renderer_type 0 + +proc boot_mode_show_gui {} { global renderer global throttle global boot_env_renderer_type if {$boot_env_renderer_type != 0} { - set renderer $boot_env_renderer_type + after time 1 "set renderer $boot_env_renderer_type" set throttle on } else { puts stderr "error: Requested boot_gui_mode but env.RENDERER is missing." exit 1 } + return "Requested GUI with $boot_env_renderer_type" } -# Globals -set boot_env_renderer_type 0 - if {[info exists ::env(RENDERER)] && ([string trim $::env(RENDERER)] != "")} { set boot_env_renderer_type [string trim $::env(RENDERER)] } @@ -76,13 +72,3 @@ if {[info exists ::env(SPEED)] && ([string trim $::env(SPEED)] != "")} { exit 1 } } - -if {[info exists ::env(RECORDER)] && ([string trim $::env(RECORDER)] != "")} { - if {[catch {after time 1 "record start -prefix [string trim $::env(RECORDER)]"} err_msg]} { - puts stderr "error: env.RECORDER value $err_msg" - exit 1 - } - after quit { - record stop - } -} diff --git a/lib/openmsx/share/scripts/fail_after.tcl b/lib/openmsx/share/scripts/fail_after.tcl index 7a8ed57..6d25e83 100644 --- a/lib/openmsx/share/scripts/fail_after.tcl +++ b/lib/openmsx/share/scripts/fail_after.tcl @@ -17,21 +17,19 @@ # # Supported environment variables by this script; # -# FAIL_AFTER_PATH=. -# Enabled automatic screenshots saving in case of failures in the supplied path. -# -# FAIL_AFTER_BOOT=30 +# BOOT_WATCHDOG=30 # Enables the boot watchdog timer which will exit openMSX after the timeout(in seconds). # To cancel this timer give an `fail_after 0` or any new fail_after command. +# (exits with status 124 see `man timeout`) # +set fail_after_prev_timer 0 +set fail_after_prev_id 0 +set fail_after_boot_timeout 0 + proc fail_after_exit {{fail_id "fail_after_exit"} {fail_code 2}} { - global fail_after_path - if {$fail_after_path != 0} { - if {[catch {screenshot $fail_after_path/$fail_id.png} err_msg]} { - puts stderr "warning: $err_msg" - } - # maybe later add; if {is_text_mode} { [get_screen] ?> $fail_after_path/$fail_id.scr } + if {[catch {screenshot -prefix $fail_id} err_msg]} { + puts stderr "warning: $err_msg" } puts stderr "error: Failure request from $fail_id" exit $fail_code @@ -43,7 +41,7 @@ proc fail_after { timeout {time_unit "time"} {fail_id "fail_after"} {fail_code 2 set msg "" if {$fail_after_prev_timer != 0} { after cancel $fail_after_prev_timer - set msg "$fail_after_prev_id: Stopped attempt." + set msg "$fail_after_prev_id: Stopped attempt" } set fail_after_prev_id $fail_id if {$time_unit != "time"} { @@ -69,19 +67,7 @@ proc fail_after_reboot_watchdog {} { } } -# Globals -set fail_after_prev_timer 0 -set fail_after_prev_id 0 -set fail_after_path 0 -set fail_after_boot_timeout 0 - -# Parse screenshot path env setting -if {[info exists ::env(FAIL_AFTER_PATH)] && ([string trim $::env(FAIL_AFTER_PATH)] != "")} { - set fail_after_path [string trim $::env(FAIL_AFTER_PATH)] -} - -# Enables boot watch dog timer when FAIL_AFTER_BOOT env has a value. (124 see `man timeout`) -if {[info exists ::env(FAIL_AFTER_BOOT)] && ([string trim $::env(FAIL_AFTER_BOOT)] != "")} { - set fail_after_boot_timeout [string trim $::env(FAIL_AFTER_BOOT)] +if {[info exists ::env(BOOT_WATCHDOG)] && ([string trim $::env(BOOT_WATCHDOG)] != "")} { + set fail_after_boot_timeout [string trim $::env(BOOT_WATCHDOG)] fail_after_reboot_watchdog } diff --git a/lib/openmsx/share/scripts/save_flight.tcl b/lib/openmsx/share/scripts/save_flight.tcl new file mode 100644 index 0000000..af559cc --- /dev/null +++ b/lib/openmsx/share/scripts/save_flight.tcl @@ -0,0 +1,63 @@ +# safe_flight -- Setup the black box flight recorder for build pipelines. +# +# Adds the following command to openMSX; +# +# 'save_flight_screenshot' +# Takes an screenshot with optional prefix parameter. +# +# 'save_flight_video' +# Starts video recording with optional prefix parameter. +# +# Supported environment variables by this script; +# +# SAVE_FLIGHT_PREFIX=msxbuild +# Gives screenshots and videos an prefix; msxbuild0001.avi +# +# SAVE_FLIGHT_SEPERATOR=- +# Gives screenshots and videos an seperator; openmsx-0001.png +# +# SAVE_FLIGHT_RECORD_FLAG=-doublesize +# Flag given to the video record command. +# + +set save_flight_prefix flight +set save_flight_seperator - +set save_flight_record_flag "" + +proc save_flight_screenshot {{prefix_id 0}} { + global save_flight_prefix + global save_flight_seperator + if {$prefix_id != 0} { + set file_prefix "$prefix_id$save_flight_seperator" + } else { + set file_prefix "$save_flight_prefix$save_flight_seperator" + } + after time 1 "screenshot -prefix $file_prefix" + return "Flight screenshot saved" +} + +proc save_flight_video {{prefix_id 0}} { + global save_flight_prefix + global save_flight_seperator + global save_flight_record_flag + if {$prefix_id != 0} { + set file_prefix "$prefix_id$save_flight_seperator" + } else { + set file_prefix "$save_flight_prefix$save_flight_seperator" + } + after quit "record stop" + after time 1 "record start $save_flight_record_flag -prefix $file_prefix" + return "Flight video started" +} + +if {[info exists ::env(SAVE_FLIGHT_PREFIX)] && ([string trim $::env(SAVE_FLIGHT_PREFIX)] != "")} { + set save_flight_prefix [string trim $::env(SAVE_FLIGHT_PREFIX)] +} + +if {[info exists ::env(SAVE_FLIGHT_SEPERATOR)] && ([string trim $::env(SAVE_FLIGHT_SEPERATOR)] != "")} { + set save_flight_seperator [string trim $::env(SAVE_FLIGHT_SEPERATOR)] +} + +if {[info exists ::env(SAVE_FLIGHT_RECORD_FLAG)] && ([string trim $::env(SAVE_FLIGHT_RECORD_FLAG)] != "")} { + set save_flight_record_flag [string trim $::env(SAVE_FLIGHT_RECORD_FLAG)] +} diff --git a/test/ahello-m80/0module.mk b/test/ahello-m80/0module.mk index 228ff34..3a5a4c6 100644 --- a/test/ahello-m80/0module.mk +++ b/test/ahello-m80/0module.mk @@ -25,7 +25,7 @@ $(TEST_AHELLO_M80)/ahello.com: $(TEST_AHELLO_M80)/ahello.hex .PHONY: test-ahello-m80-run test-ahello-m80-run: $(TEST_AHELLO_M80)/ahello.com - $(call mb_autoexec_open_gui80,$(TEST_AHELLO_M80)) + $(call mb_autoexec_show_gui80,$(TEST_AHELLO_M80)) $(call mb_openmsx_dosctl,$(TEST_AHELLO_M80)) .PHONY: test-ahello-m80-assert diff --git a/test/ahello-sdcc/0module.mk b/test/ahello-sdcc/0module.mk index eb63d46..df90a13 100644 --- a/test/ahello-sdcc/0module.mk +++ b/test/ahello-sdcc/0module.mk @@ -16,7 +16,7 @@ $(TEST_AHELLO_SDCC)/ahello.com: $(TEST_AHELLO_SDCC)/ahello.hex .PHONY: test-ahello-sdcc-run test-ahello-sdcc-run: $(TEST_AHELLO_SDCC)/ahello.com - $(call mb_autoexec_open_gui80,$(TEST_AHELLO_SDCC)) + $(call mb_autoexec_show_gui80,$(TEST_AHELLO_SDCC)) $(call mb_openmsx_dosctl,$(TEST_AHELLO_SDCC)) .PHONY: test-ahello-sdcc-assert diff --git a/test/dist-qa-dos1/0module.mk b/test/dist-qa-dos1/0module.mk index 4e5e222..3f81712 100644 --- a/test/dist-qa-dos1/0module.mk +++ b/test/dist-qa-dos1/0module.mk @@ -12,7 +12,7 @@ $(TEST_DIST_QA_DOS1)/%: bin/test/dist/% | $(TEST_DIST_QA_DOS1) $(TEST_DIST_DEPS) .PHONY: test-dist-qa-dos1-run test-dist-qa-dos1-run: | $(TEST_DIST_QA_DOS1_DEPS) - $(call mb_autoexec_open_gui80,$(TEST_DIST_QA_DOS1)) + $(call mb_autoexec_show_gui80,$(TEST_DIST_QA_DOS1)) $(call mb_openmsx_dosctl,$(TEST_DIST_QA_DOS1)) .PHONY: test-dist-qa-dos1-assert diff --git a/test/dist-qa-dos2/0module.mk b/test/dist-qa-dos2/0module.mk index b4a9fd1..b339bff 100644 --- a/test/dist-qa-dos2/0module.mk +++ b/test/dist-qa-dos2/0module.mk @@ -12,7 +12,7 @@ $(TEST_DIST_QA_DOS2)/%: bin/test/dist/% | $(TEST_DIST_QA_DOS2) $(TEST_DIST_DEPS) .PHONY: test-dist-qa-dos2-run test-dist-qa-dos2-run: | $(TEST_DIST_QA_DOS2_DEPS) - $(call mb_autoexec_open_gui80,$(TEST_DIST_QA_DOS2)) + $(call mb_autoexec_show_gui80,$(TEST_DIST_QA_DOS2)) $(call mb_openmsx_dosctl,$(TEST_DIST_QA_DOS2)) .PHONY: test-dist-qa-dos2-assert diff --git a/test/dist-qa-msx1/0module.mk b/test/dist-qa-msx1/0module.mk index 6efa573..4ae203b 100644 --- a/test/dist-qa-msx1/0module.mk +++ b/test/dist-qa-msx1/0module.mk @@ -12,7 +12,7 @@ $(TEST_DIST_QA_MSX1)/%: bin/test/dist/% | $(TEST_DIST_QA_MSX1) $(TEST_DIST_DEPS) .PHONY: test-dist-qa-msx1-run test-dist-qa-msx1-run: | $(TEST_DIST_QA_MSX1_DEPS) - $(call mb_autoexec_open_gui40,$(TEST_DIST_QA_MSX1)) + $(call mb_autoexec_show_gui40,$(TEST_DIST_QA_MSX1)) $(call mb_openmsx_dosctl,$(TEST_DIST_QA_MSX1),$(TEST_DIST_QA_MSX1_MACHINE)) .PHONY: test-dist-qa-msx1-assert diff --git a/test/dist-qa-msxhub/0module.mk b/test/dist-qa-msxhub/0module.mk index be4bb62..4a36e14 100644 --- a/test/dist-qa-msxhub/0module.mk +++ b/test/dist-qa-msxhub/0module.mk @@ -34,7 +34,7 @@ $(TEST_DIST_QA_MSXHUB)/%: bin/test/dist/% | $(TEST_DIST_QA_MSXHUB) $(TEST_DIST_D .PHONY: test-dist-qa-msxhub-run test-dist-qa-msxhub-run: | $(TEST_DIST_QA_MSXHUB_DEPS) - $(call mb_autoexec_open_gui80,$(TEST_DIST_QA_MSXHUB),dir/w utils) + $(call mb_autoexec_show_gui80,$(TEST_DIST_QA_MSXHUB),dir/w utils) $(call mb_openmsx_dosctl,$(TEST_DIST_QA_MSXHUB),$(TEST_DIST_QA_MSXHUB_MACHINE)) .PHONY: test-dist-qa-msxhub-assert