Split msxhub packages and dos from openmsx launcher

This commit is contained in:
Willem Cazander 2024-06-21 20:59:04 +02:00
parent e256594b8e
commit fd0debd0fc
11 changed files with 144 additions and 66 deletions

View file

@ -65,12 +65,24 @@ Current set is WIP.
* mb_link_asm_dos = alias for mb_link_asm_0100 * mb_link_asm_dos = alias for mb_link_asm_0100
* mb_hex2com * mb_hex2com
* mb_hex2dat * mb_hex2dat
* mb_openmsx_dos2 * mb_openmsx_dosctl
* mb_openmsx_macro80
* mb_msxhub_file * mb_msxhub_file
* mb_msxhub_get_dos2 * mb_package_dos1
* mb_msxhub_get_macro80 * mb_package_dos2
* mb_assert_file_equals = note: text file only * mb_package_nextor
* mb_package_macro80
* mb_package_z80asmuk
* mb_package_popcom
* mb_package_dmphex
* mb_package_baskom
* mb_package_pmarc
* mb_package_lhpack
* mb_package_lhext
* mb_package_gunzip
* mb_package_tunzip
* mb_package_turbo
* mb_package_binldr
* mb_package_gfxage
* mb_autoexec_append_cmd * mb_autoexec_append_cmd
* mb_autoexec_append_echo * mb_autoexec_append_echo
* mb_autoexec_append_rem * mb_autoexec_append_rem

3
lib/emuctl/mouse.bat Normal file
View file

@ -0,0 +1,3 @@
rem Add mouse to openMSX
omsxctl plug joyporta mouse
omsxctl plug

2
lib/emuctl/shutdown.bat Normal file
View file

@ -0,0 +1,2 @@
rem Exit openMSX
omsxctl exit 0

2
lib/emuctl/z80.bat Normal file
View file

@ -0,0 +1,2 @@
rem Goto normal z80 speed
omsxctl set speed 100

View file

@ -2,6 +2,8 @@
MB_AUTOEXEC_BYSELF ?= true MB_AUTOEXEC_BYSELF ?= true
MB_AUTOEXEC_BYSELF_MSG ?= Generated by msxbuild Makefile MB_AUTOEXEC_BYSELF_MSG ?= Generated by msxbuild Makefile
MB_AUTOEXEC_TEXTMODE ?= 80 MB_AUTOEXEC_TEXTMODE ?= 80
MB_AUTOEXEC_TEXTCOLOR ?= 15,0,0
MB_AUTOEXEC_VERSION ?= true
MB_AUTOEXEC_STARTUP_TIMEOUT ?= 60 MB_AUTOEXEC_STARTUP_TIMEOUT ?= 60
MB_AUTOEXEC_STARTUP_EXITCODE ?= 124 MB_AUTOEXEC_STARTUP_EXITCODE ?= 124
MB_AUTOEXEC_TEST_TIMEOUT ?= 120 MB_AUTOEXEC_TEST_TIMEOUT ?= 120
@ -39,6 +41,8 @@ define mb_autoexec_write_default
$(if $(filter 40,$(MB_AUTOEXEC_TEXTMODE)),$(call mb_autoexec_append_echo,$(1),Enabled mode 40.)) $(if $(filter 40,$(MB_AUTOEXEC_TEXTMODE)),$(call mb_autoexec_append_echo,$(1),Enabled mode 40.))
$(if $(filter 80,$(MB_AUTOEXEC_TEXTMODE)),$(call mb_autoexec_append_cmd,$(1),mode 80)) $(if $(filter 80,$(MB_AUTOEXEC_TEXTMODE)),$(call mb_autoexec_append_cmd,$(1),mode 80))
$(if $(filter 80,$(MB_AUTOEXEC_TEXTMODE)),$(call mb_autoexec_append_echo,$(1),Enabled mode 80.)) $(if $(filter 80,$(MB_AUTOEXEC_TEXTMODE)),$(call mb_autoexec_append_echo,$(1),Enabled mode 80.))
$(call mb_autoexec_append_cmd,$(1),COLOR $(MB_AUTOEXEC_TEXTCOLOR))
$(if $(filter true,$(MB_AUTOEXEC_VERSION)),$(call mb_autoexec_append_cmd,$(1),ver))
endef endef
define mb_autoexec_open_gui define mb_autoexec_open_gui
@ -46,7 +50,7 @@ define mb_autoexec_open_gui
$(call mb_autoexec_write_default,$(1)) $(call mb_autoexec_write_default,$(1))
$(call mb_autoexec_append_gui_mode,$(1)) $(call mb_autoexec_append_gui_mode,$(1))
$(call mb_autoexec_append_stop_fail,$(1)) $(call mb_autoexec_append_stop_fail,$(1))
$(call mb_autoexec_append_echo,$(1),Type 'omsxctl exit' to stop emulation.) $(call mb_autoexec_append_echo,$(1),Type 'shutdown' or 'omsxctl exit' to stop emulation.)
endef endef
define mb_autoexec_open_gui_cmd define mb_autoexec_open_gui_cmd
$(call mb_autoexec_open_gui,$(1)) $(call mb_autoexec_open_gui,$(1))

View file

@ -20,30 +20,3 @@ define mb_msxhub_file
$(if $(wildcard $(1)/$(call _mb_lowercase,$(notdir $(2)))),,$(call mb_copy,$(MB_MSXHUB_CACHE)/$(2),$(1)/$(call _mb_lowercase,$(notdir $(2))))) $(if $(wildcard $(1)/$(call _mb_lowercase,$(notdir $(2)))),,$(call mb_copy,$(MB_MSXHUB_CACHE)/$(2),$(1)/$(call _mb_lowercase,$(notdir $(2)))))
$(if $(filter true,$(3)),$(call mb_copy,$(MB_MSXHUB_CACHE)/$(2),$(1)/$(call _mb_lowercase,$(notdir $(2))))) $(if $(filter true,$(3)),$(call mb_copy,$(MB_MSXHUB_CACHE)/$(2),$(1)/$(call _mb_lowercase,$(notdir $(2)))))
endef endef
define mb_msxhub_get_dos1
$(call mb_msxhub_file,$(1),MSXDOS1/1.03-2/get/MSXDOS1/MSXDOS.SYS)
$(call mb_msxhub_file,$(1),MSXDOS1/1.03-2/get/MSXDOS1/COMMAND.COM)
endef
define mb_msxhub_get_dos2
$(call mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/MSXDOS2.SYS)
#$(call mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/COMMAND2.COM)
$(call mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/COMMAND2.COM)
endef
define mb_msxhub_get_nextor
$(call mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/MSXDOS2.SYS)
#$(call mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/COMMAND2.COM)
$(call mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/COMMAND2.COM)
$(call mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/NEXTOR.SYS)
$(call mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/NSYSVER.COM)
endef
define mb_msxhub_get_macro80
$(call mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/CREF80.COM)
$(call mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/L80.COM)
$(call mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/LIB80.COM)
$(call mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/M80.COM)
endef

View file

@ -1,8 +1,6 @@
MB_OPENMSX_BOOT_TIMEOUT ?= 25 MB_OPENMSX_BOOT_TIMEOUT ?= 25
MB_OPENMSX_MACHINE ?= Philips_NMS_8250 MB_OPENMSX_MACHINE ?= Philips_NMS_8250
MB_OPENMSX_JOYPORTA ?=
MB_OPENMSX_JOYPORTB ?=
MB_OPENMSX_SETTING := $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_settings.xml MB_OPENMSX_SETTING := $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_settings.xml
MB_OPENMSX_EXTS ?= MB_OPENMSX_EXTS ?=
MB_OPENMSX_EXTRA_MEM ?= -ext ram4mb MB_OPENMSX_EXTRA_MEM ?= -ext ram4mb
@ -28,34 +26,10 @@ define _mb_openmsx_run
FAIL_AFTER_PATH=bin \ FAIL_AFTER_PATH=bin \
BOOT_HDD_PATH="$(1)" \ BOOT_HDD_PATH="$(1)" \
BOOT_HDD_IMAGE="$(1)/../dsk.img" \ BOOT_HDD_IMAGE="$(1)/../dsk.img" \
JOYPORTA=$(MB_OPENMSX_JOYPORTA) \
JOYPORTB=$(MB_OPENMSX_JOYPORTB) \
$(MB_OPENMSX_CMD) $(MB_OPENMSX_CMD)
endef endef
define _mb_openmsx_run_dos define mb_openmsx_dosctl
$(call mb_msxhub_file,$(1),OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.com) $(call mb_msxhub_file,$(1),OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.com)
$(call _mb_openmsx_run,$(1)) $(call _mb_openmsx_run,$(1))
endef endef
# TODO: add msx1+allversions of dos to https://github.com/fr3nd/msxhub-packages/issues/18
#define mb_openmsx_dos1
# $(call mb_msxhub_get_dos1,$(1))
# $(call _mb_openmsx_run_dos,$(1))
#endef
define mb_openmsx_dos2
$(call mb_msxhub_get_dos2,$(1))
$(call _mb_openmsx_run_dos,$(1))
endef
define mb_openmsx_nextor
$(call mb_msxhub_get_nextor,$(1))
$(call _mb_openmsx_run_dos,$(1))
endef
define mb_openmsx_macro80
$(call mb_msxhub_get_macro80,$(1))
$(call mb_openmsx_dos2,$(1))
endef

102
lib/make/mb_packages.mk Normal file
View file

@ -0,0 +1,102 @@
# MSXHUB fetch package files functions
define mb_package_emuctl
$(call mb_copy,$(PATH_MSXBUILD)/lib/emuctl/mouse.bat,$(1))
$(call mb_copy,$(PATH_MSXBUILD)/lib/emuctl/shutdown.bat,$(1))
$(call mb_copy,$(PATH_MSXBUILD)/lib/emuctl/z80.bat,$(1))
endef
#
# Operating System
#
define mb_package_dos1
$(call mb_msxhub_file,$(1),MSXDOS1/1.03-2/get/MSXDOS1/MSXDOS.SYS)
$(call mb_msxhub_file,$(1),MSXDOS1/1.03-2/get/MSXDOS1/COMMAND.COM)
endef
define mb_package_dos2
$(call mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/MSXDOS2.SYS)
$(call mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/COMMAND2.COM)
endef
# TODO: remove MSXDOS2.SYS...
define mb_package_nextor
$(call mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/MSXDOS2.SYS)
$(call mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/NEXTOR.SYS)
$(call mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/COMMAND2.COM)
endef
#
# Compilers
#
define mb_package_macro80
$(call mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/CREF80.COM)
$(call mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/L80.COM)
$(call mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/LIB80.COM)
$(call mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/M80.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/HEXTOCOM.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/HEXTOBIN.COM)
endef
define mb_package_z80asmuk
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/BINTOASM.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/DUMP.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/HEXTOCOM.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/PRL.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/PRNTOSYM.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/RSX.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/ZSM.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/ZSMPP.COM)
$(call mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/HEXTOBIN.COM)
endef
#
# Compressors
#
define mb_package_pmarc
$(call mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMARC.COM)
$(call mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMCAT.COM)
$(call mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMEXE2.COM)
$(call mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMEXT.COM)
$(call mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMSET.COM)
$(call mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMSFX2.COM)
endef
define mb_package_lhpack
$(call mb_msxhub_file,$(1),LHPACK/1.00-1/get/LHPACK/lhpack.com)
endef
define mb_package_lhext
$(call mb_msxhub_file,$(1),LHEXT/1.34-2/get/LHEXT/lhext.com)
endef
define mb_package_gunzip
$(call mb_msxhub_file,$(1),GUNZIP/1.1-1/get/GUNZIP/gunzip.com)
endef
define mb_package_tunzip
$(call mb_msxhub_file,$(1),TUNZIP/0.91-1/get/TUNZIP/tunzip.com)
endef
define mb_package_popcom
$(call mb_msxhub_file,$(1),POPCOM/1.00-2/get/POPCOM/popcom.com)
endef
#
# Tools
#
define mb_package_turbo
$(call mb_msxhub_file,$(1),TURBO/2.1-1/get/TURBO/turbo.com)
endef
define mb_package_baskom
$(call mb_msxhub_file,$(1),BASKOM/1.0-1/get/BASKOM/baskom.com)
endef
define mb_package_binldr
$(call mb_msxhub_file,$(1),BINLDR/1.0.2-1/get/BINLDR/BINLDR.COM)
endef
define mb_package_dmphex
$(call mb_msxhub_file,$(1),DMPHEX/1.00-1/get/DMPHEX/dmphex.com)
endef
#
# Graphics editors
#
define mb_package_gfxage
$(call mb_msxhub_file,$(1),GFXAGE/0.99-1/get/GFXAGE/gfxage.com)
endef

View file

@ -14,5 +14,6 @@ PATH_MSXBUILD_REAL := $(if $(realpath $(PATH_MSXBUILD)),$(realpath $(PATH_MSXBUI
include $(PATH_MSXBUILD)/lib/make/mb_base.mk include $(PATH_MSXBUILD)/lib/make/mb_base.mk
include $(PATH_MSXBUILD)/lib/make/mb_autoexec.mk include $(PATH_MSXBUILD)/lib/make/mb_autoexec.mk
include $(PATH_MSXBUILD)/lib/make/mb_msxhub.mk include $(PATH_MSXBUILD)/lib/make/mb_msxhub.mk
include $(PATH_MSXBUILD)/lib/make/mb_packages.mk
include $(PATH_MSXBUILD)/lib/make/mb_openmsx.mk include $(PATH_MSXBUILD)/lib/make/mb_openmsx.mk
include $(PATH_MSXBUILD)/lib/make/mb_build.mk include $(PATH_MSXBUILD)/lib/make/mb_build.mk

View file

@ -4,17 +4,20 @@ BUILD_HELP += \\n\\t* $(TEST_AHELLO_M80)/ahello.com\\n\\t* test-ahello-m8
$(TEST_AHELLO_M80): $(TEST_AHELLO_M80):
$(call mb_mkdir,$(TEST_AHELLO_M80)) $(call mb_mkdir,$(TEST_AHELLO_M80))
$(call mb_package_emuctl,$(TEST_AHELLO_M80))
$(call mb_package_macro80,$(TEST_AHELLO_M80))
$(call mb_package_nextor,$(TEST_AHELLO_M80))
$(TEST_AHELLO_M80)/%.mac: test/ahello-m80/%.mac | $(TEST_AHELLO_M80) $(TEST_AHELLO_M80)/%.mac: test/ahello-m80/%.mac | $(TEST_AHELLO_M80)
$(call mb_unix2dos,$<,$@) $(call mb_unix2dos,$<,$@)
$(TEST_AHELLO_M80)/ahello.rel: $(TEST_AHELLO_M80)/ahello.mac $(TEST_AHELLO_M80)/ahello.rel: $(TEST_AHELLO_M80)/ahello.mac
$(call mb_autoexec_cmd,$(TEST_AHELLO_M80),m80 =ahello/Z) $(call mb_autoexec_cmd,$(TEST_AHELLO_M80),m80 =ahello/Z)
$(call mb_openmsx_macro80,$(TEST_AHELLO_M80)) $(call mb_openmsx_dosctl,$(TEST_AHELLO_M80))
$(TEST_AHELLO_M80)/ahello.hex: $(TEST_AHELLO_M80)/ahello.rel $(TEST_AHELLO_M80)/ahello.hex: $(TEST_AHELLO_M80)/ahello.rel
$(call mb_autoexec_cmd,$(TEST_AHELLO_M80),l80 ahello$(MB_COMMA)ahello/N/X/Y/E) $(call mb_autoexec_cmd,$(TEST_AHELLO_M80),l80 ahello$(MB_COMMA)ahello/N/X/Y/E)
$(call mb_openmsx_macro80,$(TEST_AHELLO_M80)) $(call mb_openmsx_dosctl,$(TEST_AHELLO_M80))
$(TEST_AHELLO_M80)/ahello.com: $(TEST_AHELLO_M80)/ahello.hex $(TEST_AHELLO_M80)/ahello.com: $(TEST_AHELLO_M80)/ahello.hex
$(call mb_hex2com,$(TEST_AHELLO_M80)/ahello.hex,$(TEST_AHELLO_M80)/ahello.com) $(call mb_hex2com,$(TEST_AHELLO_M80)/ahello.hex,$(TEST_AHELLO_M80)/ahello.com)
@ -22,11 +25,11 @@ $(TEST_AHELLO_M80)/ahello.com: $(TEST_AHELLO_M80)/ahello.hex
.PHONY: test-ahello-m80-run .PHONY: test-ahello-m80-run
test-ahello-m80-run: $(TEST_AHELLO_M80)/ahello.com test-ahello-m80-run: $(TEST_AHELLO_M80)/ahello.com
$(call mb_autoexec_open_gui,$(TEST_AHELLO_M80)) $(call mb_autoexec_open_gui,$(TEST_AHELLO_M80))
$(call mb_openmsx_macro80,$(TEST_AHELLO_M80)) $(call mb_openmsx_dosctl,$(TEST_AHELLO_M80))
.PHONY: test-ahello-m80-assert .PHONY: test-ahello-m80-assert
test-ahello-m80-assert: $(TEST_AHELLO_M80)/ahello.com test-ahello-m80-assert: $(TEST_AHELLO_M80)/ahello.com
$(call mb_delete,$(TEST_AHELLO_M80)/test.out) $(call mb_delete,$(TEST_AHELLO_M80)/test.out)
$(call mb_autoexec_cmd_test,$(TEST_AHELLO_M80),ahello > test.out) $(call mb_autoexec_cmd_test,$(TEST_AHELLO_M80),ahello > test.out)
$(call mb_openmsx_macro80,$(TEST_AHELLO_M80)) $(call mb_openmsx_dosctl,$(TEST_AHELLO_M80))
grep "M80: Hello world..." $(TEST_AHELLO_M80)/test.out grep "M80: Hello world..." $(TEST_AHELLO_M80)/test.out

View file

@ -4,6 +4,8 @@ BUILD_HELP += \\n\\t* $(TEST_AHELLO_SDCC)/ahello.com\\n\\t* test-ahello-s
$(TEST_AHELLO_SDCC): $(TEST_AHELLO_SDCC):
$(call mb_mkdir,$(TEST_AHELLO_SDCC)) $(call mb_mkdir,$(TEST_AHELLO_SDCC))
$(call mb_package_emuctl,$(TEST_AHELLO_SDCC))
$(call mb_package_nextor,$(TEST_AHELLO_SDCC))
$(TEST_AHELLO_SDCC)/%.rel: test/ahello-sdcc/%.asm | $(TEST_AHELLO_SDCC) $(TEST_AHELLO_SDCC)/%.rel: test/ahello-sdcc/%.asm | $(TEST_AHELLO_SDCC)
$(call mb_compile_asm,$@,$<) $(call mb_compile_asm,$@,$<)
@ -17,11 +19,11 @@ $(TEST_AHELLO_SDCC)/ahello.com: $(TEST_AHELLO_SDCC)/ahello.hex
.PHONY: test-ahello-sdcc-run .PHONY: test-ahello-sdcc-run
test-ahello-sdcc-run: $(TEST_AHELLO_SDCC)/ahello.com test-ahello-sdcc-run: $(TEST_AHELLO_SDCC)/ahello.com
$(call mb_autoexec_open_gui,$(TEST_AHELLO_SDCC)) $(call mb_autoexec_open_gui,$(TEST_AHELLO_SDCC))
$(call mb_openmsx_dos2,$(TEST_AHELLO_SDCC)) $(call mb_openmsx_dosctl,$(TEST_AHELLO_SDCC))
.PHONY: test-ahello-sdcc-assert .PHONY: test-ahello-sdcc-assert
test-ahello-sdcc-assert: $(TEST_AHELLO_SDCC)/ahello.com test-ahello-sdcc-assert: $(TEST_AHELLO_SDCC)/ahello.com
$(call mb_delete,$(TEST_AHELLO_SDCC)/test.out) $(call mb_delete,$(TEST_AHELLO_SDCC)/test.out)
$(call mb_autoexec_cmd_test,$(TEST_AHELLO_SDCC),ahello > test.out) $(call mb_autoexec_cmd_test,$(TEST_AHELLO_SDCC),ahello > test.out)
$(call mb_openmsx_dos2,$(TEST_AHELLO_SDCC)) $(call mb_openmsx_dosctl,$(TEST_AHELLO_SDCC))
grep "SDCC: Hello world..." $(TEST_AHELLO_SDCC)/test.out grep "SDCC: Hello world..." $(TEST_AHELLO_SDCC)/test.out