-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minitel2: fix modem and periinfo default configurations #13160
base: master
Are you sure you want to change the base?
Conversation
This commit matches the parameters used by the default ROM.
src/mame/philips/minitel_2_rpic.cpp
Outdated
RS232_PORT(config, m_modem, default_rs232_devices, nullptr); | ||
m_modem->rxd_handler().set_inputline(m_maincpu, MCS51_INT1_LINE).invert(); | ||
m_modem->set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(m_modem)); | ||
m_modem->set_option_device_input_defaults("null_modem", DEVICE_INPUT_DEFAULTS_NAME(m_modem)); | ||
|
||
RS232_PORT(config, m_serport, default_rs232_devices, nullptr); | ||
m_serport->rxd_handler().set(FUNC(minitel_state::serial_rxd)); | ||
m_serport->set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(m_serport)); | ||
m_serport->set_option_device_input_defaults("null_modem", DEVICE_INPUT_DEFAULTS_NAME(m_serport)); | ||
|
||
lineconnected = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a bit of confusion here:
- why you changed
m_serport
DEVICE_INPUT_DEFAULTS_NAME
if the plan is to change defaults form_modem
instead? - Can have multiple
set_option_device_input_defaults
attached to the same port cfr.mame/src/mame/cybiko/cybiko.cpp
Lines 395 to 399 in 0817083
// serial debug port RS232_PORT(config, m_debug_serial, default_rs232_devices, nullptr); m_debug_serial->set_option_device_input_defaults("null_modem", DEVICE_INPUT_DEFAULTS_NAME(debug_serial)); m_debug_serial->set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(debug_serial)); m_debug_serial->set_option_device_input_defaults("pty", DEVICE_INPUT_DEFAULTS_NAME(debug_serial)); m_modem
/m_serport
input naming on its own is ambiguous, i.e. the INPUT_PORTS definition shouldn't be the same name as the device it uses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The device has two serial ports, one is actually a modem connected to the phone line and the other one ("peri-informatique" port) is a serial port for connecting local devices such as printers and card readers. Conceptually, the Minitel itself is very simple, it just forwards data from one port to the other, while also displaying it [in reality it's a bit more complicated, because the firmware can interpret some control sequences].
The modem port is asymmetric, 1200 baud 7E1 downstream and 75 baud 7E1 upstream. The peripheral port is 1200 baud 7E1 symmetric (by default, it can go up to 9600 baud if configured to do so).
That said...
- why you changed m_serport DEVICE_INPUT_DEFAULTS_NAME if the plan is to change defaults for m_modem instead?
This PR is actually two fixes in one: 1) make null_modem
work for the modem port 2) make the peripheral port work too. The m_serport
changes are for the latter.
- Can have multiple set_option_device_input_defaults attached to the same port
Thanks, I've re-added the old terminal
configuration, so we can keep both. While attaching a terminal is not the typical usage of this device (which is itself a terminal), I guess it can still be useful for quick tests.
- m_modem / m_serport input naming on its own is ambiguous, i.e. the INPUT_PORTS definition shouldn't be the same name as the device it uses.
Keeping in mind that the two ports have different baud rates, I'm open to suggestions for renaming them. :)
I've tested the command line given at the top of the
minitel_2_rpic.cpp
file (-modem null_modem -bitb socket.127.0.0.1:20000
) and it didn't work (transferred data was corrupted), because the correct serial parameters are set forterminal
. This commit makes them apply tonull_modem
instead, so that the documented command line actually works.While at it, I've also changed the parameters for the second serial port (
periinfo
) to match the Minitel's defaults and verified that it actually works, despite the comment at the top of the file stating the opposite.These are all the test command lines I've successfully validated, to test that the two Minitel serial ports (
modem
andperiinfo
) work, both in isolation and together. I've used minipavi.fr as the test service to connect to.Test n.1: Connecting to a Minitel service through the modem port
Run in two different terminals:
socat tcp-listen:20000,fork system:'"set -x; IFS= read -d S; echo -n \"Connecting...\"; exec nc go.minipavi.fr 516"'
./mame -window minitel2 -modem null_modem -bitb socket.127.0.0.1:20000
Then power on the Minitel (F10) and start the connection (F8).
Notes:
IFS= read -d S
: waits for theConnexion ou déconnexion modem
message ("\x13S"
), emitted when the emulated Minitel modem pretends to start detecting the carrier frequency.Test n.2: Connecting to a Minitel service through the serial port
Run in two different terminals:
socat tcp-listen:20000,fork system:'"set -x; IFS= read -d r; IFS= read -d r; sleep 3; echo -en \"\\e\\x39\\x68\"; sleep 3; echo -en \"\\e\\x39\\x67\\e\\x3b\\x60\\x58\\x52Connecting...\"; exec nc go.minipavi.fr 516"'
./mame -window minitel2 -periinfo null_modem -bitb socket.127.0.0.1:20000
Then just power on the Minitel (F10), the socat command above will do the rest to put the Minitel in the right mode and start the connection.
Notes:
IFS= read -d r
(twice) : wait for the secondPassage en veille ou sortie de veille
message ("\x13r"
, emitted by the Minitel when powered on)\e\x39\x68
(calledPRO1 CONNEXION
in the manual): tells the Minitel to connect themodem
port.\e\x39\x67
(calledPRO1 DECONNEXION
in the manual): tells the Minitel to disconnect themodem
port.modem
port at all, we just sendPRO1 CONNEXION
followed byPRO1 DECONNEXION
to make it leave the initial address book screen and enter the mode that displays incoming data.\e\x3b\x60\x58\x52
->PRO3 OFF
to disable local echoTest n.3: Both ports at the same time
Run in three different terminals:
socat tcp-listen:20000,fork stdio
socat tcp-listen:20001,fork stdio
./mame -window minitel2 -modem null_modem -bitb1 socket.127.0.0.1:20000 -periinfo null_modem -bitb2 socket.127.0.0.1:20001
Then power on the Minitel (F10), start the connection (F8) and notice how everything typed into one port is echoed on the other one, like on a real Minitel.