msxbuild/lib/make/mb_openmsx.mk

57 lines
2 KiB
Makefile
Raw Normal View History

2020-12-23 17:14:13 +00:00
MB_OPENMSX_BOOT_TIMEOUT ?= 25
2021-07-04 00:12:48 +00:00
MB_OPENMSX_MACHINE ?= Philips_NMS_8250
MB_OPENMSX_JOYPORTA ?=
MB_OPENMSX_JOYPORTB ?=
2021-07-06 18:42:46 +00:00
MB_OPENMSX_SETTING := $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_settings.xml
2021-07-04 00:12:48 +00:00
MB_OPENMSX_EXTS ?=
MB_OPENMSX_EXTRA_MEM ?= -ext ram4mb
2020-12-23 17:14:13 +00:00
MB_OPENMSX_ARGS = \
-setting $(MB_OPENMSX_SETTING) \
-machine $(MB_OPENMSX_MACHINE) \
2021-07-04 00:12:48 +00:00
-ext slotexpander -ext ide $(MB_OPENMSX_EXTRA_MEM) $(MB_OPENMSX_EXTS) \
2021-07-06 18:42:46 +00:00
-script $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_env.tcl \
-script $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_hdd.tcl \
-script $(PATH_MSXBUILD_REAL)/lib/openmsx/fail_after.tcl \
2021-07-04 00:12:48 +00:00
-script $(MB_MSXHUB_CACHE)/OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.tcl
2020-12-23 17:14:13 +00:00
# TODO: add run flag to disable xml output like "-control stdio-boot-only"
ifeq ($(OS),Windows_NT)
2021-07-06 18:42:46 +00:00
MB_OPENMSX_CMD = $(PATH_OPENMSX)/openmsx $(MB_OPENMSX_ARGS) -control stdio < $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_stdio.xml
2020-12-23 17:14:13 +00:00
else
2021-07-06 18:42:46 +00:00
MB_OPENMSX_CMD = $(PATH_OPENMSX)/openmsx $(MB_OPENMSX_ARGS) -control stdio < $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_stdio.xml | sed -n -e 's/.*>\(.*\)<.*/\1/p' | tail -n+3
2020-12-23 17:14:13 +00:00
endif
define _mb_openmsx_run
2021-07-04 00:12:48 +00:00
@echo === Running openMSX
$(if $(wildcard $(MB_MSXHUB_CACHE)/OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.tcl),,$(call _mb_msxhub_fetch_file,$(MB_MSXHUB_API)/OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.tcl))
2020-12-23 17:14:13 +00:00
FAIL_AFTER_BOOT=$(MB_OPENMSX_BOOT_TIMEOUT) \
FAIL_AFTER_PATH=bin \
BOOT_HDD_PATH="$(1)" \
BOOT_HDD_IMAGE="$(1)/../dsk.img" \
JOYPORTA=$(MB_OPENMSX_JOYPORTA) \
JOYPORTB=$(MB_OPENMSX_JOYPORTB) \
$(MB_OPENMSX_CMD)
endef
2021-07-06 02:28:45 +00:00
2020-12-23 17:14:13 +00:00
define _mb_openmsx_run_dos
2021-07-04 00:12:48 +00:00
$(call mb_msxhub_file,$(1)/omsxctl.com,$(MB_MSXHUB_API)/OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.com)
2020-12-23 17:14:13 +00:00
$(call _mb_openmsx_run,$(1))
endef
2021-07-06 02:28:45 +00:00
2020-12-23 17:14:13 +00:00
# TODO: add msx1+allversions of dos to https://github.com/fr3nd/msxhub-packages/issues/18
#define mb_openmsx_dos1
2021-07-06 02:28:45 +00:00
# $(call mb_msxhub_get_dos1,$(1))
2020-12-23 17:14:13 +00:00
# $(call _mb_openmsx_run_dos,$(1))
#endef
2021-07-06 02:28:45 +00:00
2020-12-23 17:14:13 +00:00
define mb_openmsx_dos2
2021-07-06 02:28:45 +00:00
$(call mb_msxhub_get_dos2,$(1))
$(call _mb_openmsx_run_dos,$(1))
2020-12-23 17:14:13 +00:00
endef
2021-07-06 02:28:45 +00:00
define mb_openmsx_macro80
$(call mb_msxhub_get_macro80,$(1))
$(call mb_openmsx_dos2,$(1))
endef