run.sh net: the per-device interface selection must PERSIST (an empty cfg dir produces no tap); -networkprovider alone does not choose one

This commit is contained in:
SDD committed 2026-10-16 16:54:08 +03:00
1 parent b356553825
commit b65d9ef670
1 file changed
+9 -6
+9 -6
View File
@@ -92,13 +92,16 @@ case "$MODE" in
# the crash-work configuration: skip + tablet (already the default) + the LANCE
# attached to a host tap.
#
# A PRIVATE cfg directory is essential. MAME stores the network provider PER
# DEVICE in cfg/<game>.cfg, and a saved value wins over -networkprovider -- a
# stale interface="-1" (i.e. "none") means no tap is ever opened, silently, with
# no verbose output. Refresh it each run so a stale saved interface cannot
# reappear. It needs the tap to exist and be owned by your user.
# A private cfg directory keeps the harness's network choice out of your
# ~/.mame, but note it must PERSIST: MAME stores the provider PER DEVICE in
# cfg/<game>.cfg, and -networkprovider only says which module may be used --
# it does NOT choose an interface. With nothing saved, a network device
# defaults to "none" and no tap is ever opened (verified: an empty cfg dir
# produces no tap). So choose it ONCE via MAME's UI while running this mode:
# Tab -> Network Devices -> the LANCE -> taptun
# That selection is saved here and reused on every later `net` run.
CFGDIR="$HERE/cfg-net"
rm -rf "$CFGDIR"; mkdir -p "$CFGDIR"
mkdir -p "$CFGDIR"
exec env VT1200_SKIP_LEVEL1=1 \
"$MAME" vt1200 "${COMMON[@]}" -cfg_directory "$CFGDIR" \
-networkprovider taptun -window "$@"