Added msxdos env vars + prompt override.
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 1s

This commit is contained in:
Willem Cazander 2024-07-03 11:52:43 +02:00
parent f4197c1a14
commit 6be8161ff4
2 changed files with 28 additions and 2 deletions

View file

@ -47,6 +47,21 @@ MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_COLOR_FG,"Default for
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_EMBED_VARIABLE ?=
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_EMBED_VARIABLE,"Embed the host env variable as msx env variable.")
MB_AUTOEXEC_TIME_FORMAT ?= 24
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_TIME_FORMAT,"The time format the msx will get set to.")
MB_AUTOEXEC_DATE_FORMAT ?= DD/MM/YY
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_DATE_FORMAT,"The time format the msx will get set to.")
MB_AUTOEXEC_PROMPT_FORMAT ?= %MB_USER%@%_CWD%$
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_PROMPT_FORMAT,"The prompt format for command 2.40 and higher.")
MB_AUTOEXEC_PROMPT_SPACE ?= on
MB_DOC_HELP_VARIABLE += $(call mb_doc_variable,MB_AUTOEXEC_PROMPT_SPACE,"When on adds an white space after the prompt format.")
define mb_autoexec_append_cmd
echo "$(2)\r" >> $(1)/autoexec.bat
@ -131,6 +146,7 @@ define _mb_autoexec_write_preboot
$(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))
$(call mb_autoexec_append_cmd,$(1),PATH + A:\;)
$(if $(wildcard $(1)/utils),$(call mb_autoexec_append_cmd,$(1),PATH + A:\UTILS))
endef
@ -142,10 +158,17 @@ define mb_autoexec_write_default
$(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 $(MB_AUTOEXEC_EMBED_VARIABLE),$(call mb_autoexec_append_cmd,$(1),set MB_$(MB_AUTOEXEC_EMBED_VARIABLE)=$($(MB_AUTOEXEC_EMBED_VARIABLE))))
$(call mb_autoexec_append_cmd,$(1),set TIME=$(MB_AUTOEXEC_TIME_FORMAT))
$(call mb_autoexec_append_cmd,$(1),set DATE=$(MB_AUTOEXEC_DATE_FORMAT))
$(call mb_autoexec_append_cmd,$(1),set MB_USER=$(USER))
$(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_USER)),$(call mb_autoexec_append_echo,$(1),mb::user %MB_USER%))
$(call mb_autoexec_append_cmd,$(1),set MB_MAKE=$@)
$(call mb_autoexec_append_cmd,$(1),set MB_MAKE_PART=$(notdir $@))
$(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 $@))
$(if $(filter on,$(MB_AUTOEXEC_SHOW_TARGET)),$(call mb_autoexec_append_echo,$(1),mb::pipe %MB_MAKE%))
$(if $(filter on,$(MB_AUTOEXEC_PROMPT_SPACE)),$(call mb_autoexec_append_cmd,$(1),set PROMPT \"$(MB_AUTOEXEC_PROMPT_FORMAT) \"),$(call mb_autoexec_append_cmd,$(1),set PROMPT \"$(MB_AUTOEXEC_PROMPT_FORMAT)\"))
endef
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

@ -5,6 +5,9 @@
# 'headless_exit'
# A normal exit of the openMSX emulator.
#
# 'headless_reset'
# Does an reset of the openMSX emulator.
#
# 'headless_show_gui'
# Enables the renderer and throttle from the inside.
#