Moves joyport control to autoexec.bat to control per test.
All checks were successful
Run test asserts / Test-Asserts (push) Successful in -7s

This commit is contained in:
Willem Cazander 2024-06-29 04:46:30 +02:00
parent f0f91a2c86
commit 807b32f92c
4 changed files with 14 additions and 25 deletions

View file

@ -80,11 +80,14 @@ Current set is WIP.
* mb_autoexec_append_gui_mode
* mb_autoexec_append_stop_fail
* mb_autoexec_append_exit
* mb_autoexec_append_joyporta_mouse
* 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_safe_cmd
* mb_autoexec_safe_test
* mb_msxhub_file

View file

@ -27,6 +27,9 @@ endef
define mb_autoexec_append_exit
$(call mb_autoexec_append_cmd,$(1),omsxctl exit 0)
endef
define mb_autoexec_append_joyporta_mouse
$(call mb_autoexec_append_cmd,$(1),omsxctl plug joyporta mouse)
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))
@ -58,6 +61,7 @@ define _mb_autoexec_open_gui
$(call mb_autoexec_write_default,$(1),$(2))
$(call mb_autoexec_append_stop_fail,$(1))
$(call mb_autoexec_append_gui_mode,$(1))
$(if $(filter mouse,$(4)),$(call mb_autoexec_append_joyporta_mouse,$(1)))
$(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)))
@ -65,9 +69,15 @@ endef
define mb_autoexec_open_gui40
$(call _mb_autoexec_open_gui,$(1),40,$(2))
endef
define mb_autoexec_open_gui40_mouse
$(call _mb_autoexec_open_gui,$(1),40,$(2),mouse)
endef
define mb_autoexec_open_gui80
$(call _mb_autoexec_open_gui,$(1),80,$(2))
endef
define mb_autoexec_open_gui80_mouse
$(call _mb_autoexec_open_gui,$(1),80,$(2),mouse)
endef
define mb_autoexec_safe_cmd
$(call mb_autoexec_write_default,$(1),$(3))

View file

@ -9,8 +9,6 @@ MB_OPENMSX_EXTRA_SLOT ?= -ext slotexpander
MB_OPENMSX_EXTRA_MEM ?= -ext ram4mb
MB_OPENMSX_EXTRA_HDD ?= -ext ide-nextor
MB_OPENMSX_HDD_SIZE ?= 4m
MB_OPENMSX_JOYPORTA ?=
MB_OPENMSX_JOYPORTB ?=
MB_OPENMSX_SCALE_FACTOR ?= 3
MB_OPENMSX_THROTTLE ?= off
MB_OPENMSX_RENDERER ?= off
@ -45,8 +43,6 @@ define _mb_openmsx_run
BOOT_HDD_PATH="$(1)" \
BOOT_HDD_SIZE=$(MB_OPENMSX_HDD_SIZE) \
BOOT_HDD_IMAGE="$(1)-omsx/persistent/ide-nextor/untitled1/hd.dsk" \
JOYPORTA=$(MB_OPENMSX_JOYPORTA) \
JOYPORTB=$(MB_OPENMSX_JOYPORTB) \
SCALE_FACTOR=$(MB_OPENMSX_SCALE_FACTOR) \
SPEED=$(MB_OPENMSX_SPEED) \
RENDERER=$(MB_OPENMSX_RENDERER) \

View file

@ -5,7 +5,7 @@
# Adds the following command to openMSX;
#
# 'boot_gui_mode'
# Enableds the renderer and throttle from the inside.
# Enables the renderer and throttle from the inside.
#
# Supported environment variables by this script;
#
@ -24,12 +24,6 @@
# SPEED=400
# Sets msx speed to 4x of original but only when throttle is on.
#
# JOYPORTA=mouse
# Inserts mouse in joyporta.
#
# JOYPORTB=mouse
# Inserts mouse in joyportb.
#
# RECORDER=bin/output.avi
# Enables the the video recorder.
#
@ -83,20 +77,6 @@ if {[info exists ::env(SPEED)] && ([string trim $::env(SPEED)] != "")} {
}
}
if {[info exists ::env(JOYPORTA)] && ([string trim $::env(JOYPORTA)] != "")} {
if {[catch {plug joyporta [string trim $::env(JOYPORTA)]} err_msg]} {
puts stderr "error: env.JOYPORTA value $err_msg"
exit 1
}
}
if {[info exists ::env(JOYPORTB)] && ([string trim $::env(JOYPORTB)] != "")} {
if {[catch {plug joyportb [string trim $::env(JOYPORTB)]} err_msg]} {
puts stderr "error: env.JOYPORTB value $err_msg"
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"