From 3ae44eaab38694fcb03fd130cf46795d0370aaac Mon Sep 17 00:00:00 2001 From: Willem Date: Tue, 1 Jan 2019 23:22:52 +0100 Subject: [PATCH] update makefiles --- Makefile | 48 ++++++++++++++++++++++++++++++++++--- build/env.inc.mk | 14 +++++++++++ build/local.inc.mk-template | 4 ++++ build/openmsx-settings.xml | 10 ++++++++ src/dist-run/autoexec.bat | 18 +++++--------- src/domelib/autoexec.bat | 7 ++++++ src/gfx/autoexec.bat | 4 +--- 7 files changed, 87 insertions(+), 18 deletions(-) create mode 100644 build/openmsx-settings.xml create mode 100644 src/domelib/autoexec.bat diff --git a/Makefile b/Makefile index 1027997..0e0570d 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Single top level makefile # -rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) +rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) MODULES := $(call rwildcard, src, */0module.mk) MODULES_LIB := $(call rwildcard, src, */0module.lib.mk) @@ -23,6 +23,7 @@ test: .PHONY: clean clean: @echo === Cleaning + $(RM) .openmsx.cnt; @test $(PATH_BIN) && $(RM) -r $(PATH_BIN); @@ -45,12 +46,53 @@ define mod_link_asm_dos @echo === Link module asm dos. $(SDCC) $(SDCC_FLAG_CPU) --no-std-crt0 --code-loc 0x0100 -o $(1) $(2) endef +define mod_link_asm_4000 + @echo === Link module asm 0x4000. + $(SDCC) $(SDCC_FLAG_CPU) --no-std-crt0 --code-loc 0x4000 -o $(1) $(2) +endef +define mod_link_asm_8000 + @echo === Link module asm 0x8000. + $(SDCC) $(SDCC_FLAG_CPU) --no-std-crt0 --code-loc 0x8000 -o $(1) $(2) +endef #-l$(LIBASM_LINK) define mod_hex2com @echo === Convert to binary cd $(dir $(1)) && $(H2B) -e com $(notdir $(1)); @sha1sum $(2); - @echo === Done $(notdir $(2)) + @echo === Done $(notdir $(2)) +endef +define mod_hex2dat + @echo === Convert to binary + cd $(dir $(1)) && $(H2B) -e dat $(notdir $(1)); + @sha1sum $(2); + @echo === Done $(notdir $(2)) +endef + +#-diska $(1) +define run_openmsx + echo "." >> .openmsx.cnt; + FAIL_AFTER_BOOT=$(OPENMSX_BOOT_TIMEOUT) \ + FAIL_AFTER_PATH=bin \ + BOOT_HDD_PATH="$(1)" \ + BOOT_HDD_IMAGE="$(1)/../dsk.img" \ + RENDERER=None \ + THROTTLE=off \ + SPEED=333 \ + JOYPORTA=mouse \ + $(OPENMSX) -setting $(realpath build/openmsx-settings.xml) -machine $(OPENMSX_MACHINE) $(OPENMSX_ARGS) +endef +define run_openmsx_tools + cp build/tools/* $(1); + $(call run_openmsx, $(1)) +endef +define run_openmsx_dos1 + @echo === Run openmsx_dos1 + cp build/msxdos1/* $(1); + $(call run_openmsx_tools, $(1)) +endef +define run_openmsx_dos2 + @echo === Run openmsx_dos2 + cp build/msxdos2/* $(1); + $(call run_openmsx_tools, $(1)) endef - \ No newline at end of file diff --git a/build/env.inc.mk b/build/env.inc.mk index bfb6738..f0b0205 100644 --- a/build/env.inc.mk +++ b/build/env.inc.mk @@ -4,6 +4,7 @@ PATH_SRC ?= src PATH_BIN ?= bin PATH_HEX2BIN ?= /usr/bin PATH_SDCC ?= /usr/bin +PATH_OPENMSX ?= /usr/bin PATH_CURRENT ?= $(dir $(lastword $(MAKEFILE_LIST))) # Build tools @@ -11,12 +12,25 @@ H2B ?= $(PATH_HEX2BIN)/hex2bin SDCC ?= $(PATH_SDCC)/sdcc SDASM ?= $(PATH_SDCC)/sdasz80 SDAR ?= $(PATH_SDCC)/sdar +OPENMSX ?= $(PATH_OPENMSX)/openmsx SDCC_FLAG_CPU ?= -mz80 SDCC_FLAG_LD ?= --nostdinc SDASM_FLAGS ?= -g -l -c -o SDAR_FLAGS ?= -rc +# + +OPENMSX_BOOT_TIMEOUT ?= 25 +OPENMSX_MACHINE ?= Philips_NMS_8250 +OPENMSX_ARGS ?= \ + -ext ram4mb \ + -ext ide \ + -script $(PATH_OPENMSX_SRC)/Contrib/msxbuild/boot_env.tcl \ + -script $(PATH_OPENMSX_SRC)/Contrib/msxbuild/boot_hdd.tcl \ + -script $(PATH_OPENMSX_SRC)/Contrib/msxbuild/fail_after.tcl \ + -script $(PATH_OPENMSX_SRC)/Contrib/omsxctl/omsxctl.tcl + # OS cmds ifeq ($(OS),Windows_NT) RM = del /F /Q diff --git a/build/local.inc.mk-template b/build/local.inc.mk-template index 95ff77d..4fc51bf 100644 --- a/build/local.inc.mk-template +++ b/build/local.inc.mk-template @@ -7,3 +7,7 @@ #PATH_SDCC ?= /usr/bin #PATH_HEX2BIN ?= /usr/bin + +#PATH_OPENMSX ?= /opt/openMSX/bin/ + +#PATH_OPENMSX_SRC ?= /usr/local/src/openMSX \ No newline at end of file diff --git a/build/openmsx-settings.xml b/build/openmsx-settings.xml new file mode 100644 index 0000000..e2b859e --- /dev/null +++ b/build/openmsx-settings.xml @@ -0,0 +1,10 @@ + + + + false + 999 + none + 3 + + + diff --git a/src/dist-run/autoexec.bat b/src/dist-run/autoexec.bat index 2fbd29b..d73ccd9 100644 --- a/src/dist-run/autoexec.bat +++ b/src/dist-run/autoexec.bat @@ -1,16 +1,10 @@ mode 80 -echo === Boot watchdog timeout -omsxctl set boot_wdt -echo === Disable boot watchdog -omsxctl set boot_wdt 0 echo === Set fail_after -omsxctl fail_after 3000 -echo === Plug mouse -omsxctl plug joyporta mouse -echo === Set speed -omsxctl set speed 350 -echo === Enable speed throttling +omsxctl fail_after 300 realtime dist_run 4 +echo === Set renderer +omsxctl set renderer SDL +echo === Enable throttling omsxctl set throttle on echo === Start program -init -omsxctl exit +init +//omsxctl exit diff --git a/src/domelib/autoexec.bat b/src/domelib/autoexec.bat new file mode 100644 index 0000000..15981fb --- /dev/null +++ b/src/domelib/autoexec.bat @@ -0,0 +1,7 @@ +mode 80 +echo === Set new fail watchdog +omsxctl fail_after 120 +echo === Start program +makelib +echo === End program +omsxctl exit diff --git a/src/gfx/autoexec.bat b/src/gfx/autoexec.bat index aeeccab..029da0e 100644 --- a/src/gfx/autoexec.bat +++ b/src/gfx/autoexec.bat @@ -1,6 +1,4 @@ mode 80 -echo === Disable boot watchdog -omsxctl set boot_wdt off echo === Test fail_after -omsxctl fail_after 60 +omsxctl fail_after 300 seconds build_gfx echo === Start program