Menu

#426 +3 serial emulation should use serial port instead of sending output to printout.txt file.

future
open
nobody
None
5
2024-05-25
2020-02-14
No

I managed to work out some nice solution to the lack of built-in serial port emulation problem, see patch attached. It uses command line console as a terminal attached to the Speccy's built-in AY serial port (yet if printer is enabled in FUSE, output is redirected to printout.txt as before) allowing to control CP/M Plus from the UNIX command line through the CP/M console redirected to AY serial port as such:

C> device con:=sio[noxon, 4800]

Due to this bit-banging device limiation, 4800 is the reasonable speed (and it still isn't perfect).

To return to the default CP/M console:

C> device con:=crt

CP/M's terminal clients (e.g. qtplus3) also work well with this solution.

My solution can also work well with programs like Tek4010 (https://github.com/rricharz/Tek4010), screen, xterm, e.g.

$ tek4010 -b4800 -fullv -autoClear fuse -m plus3e --zxmmc --zxmmc-file cpm-zxmmc.hdf --rom-plus3e-0 $HOME/fuse/roms/mmcen3e0.rom --rom-plus3e-1 $HOME/fuse/roms/mmcen3e1.rom --rom-plus3e-2 $HOME/fuse/roms/mmcen3e2.rom --rom-plus3e-3 $HOME/fuse/roms/mmcen3e3.rom ZXCPM3A-ZPM-ZXMMC.dsk
$ screen fuse -m plus3e --zxmmc --zxmmc-file cpm-zxmmc.hdf --rom-plus3e-0 $HOME/fuse/roms/mmcen3e0.rom --rom-plus3e-1 $HOME/fuse/roms/mmcen3e1.rom --rom-plus3e-2 $HOME/fuse/roms/mmcen3e2.rom --rom-plus3e-3 $HOME/fuse/roms/mmcen3e3.rom ZXCPM3A-ZPM-ZXMMC.dsk
$ xterm -e fuse -m plus3e --zxmmc --zxmmc-file cpm-zxmmc.hdf --rom-plus3e-0 $HOME/fuse/roms/mmcen3e0.rom --rom-plus3e-1 $HOME/fuse/roms/mmcen3e1.rom --rom-plus3e-2 $HOME/fuse/roms/mmcen3e2.rom --rom-plus3e-3 $HOME/fuse/roms/mmcen3e3.rom ZXCPM3A-ZPM-ZXMMC.dsk

The Tek4010 and xterm -t -e... have both proven to be good enough for testing Udo Munk's Tektronix 4010 GSX driver and send graphic drawing commands over emulated serial line.

By creating fifo and using rs232-console (https://gitlab.com/Teuniz/rs232-console) one can redirect my solution to the real serial port device in the host machine and by using CP/M terminal clients like qtplus3 one can control foreign operating systems (be mindful when setting the -f option when starting rs232-console, it must be either hardware or none to reflect the use of DTR/CTS lines in your serial connection; when set wrong, nothing can be seen in either of communicating sides):

$ mkfifo /tmp/f
$ ./rs232-console -p ttyUSB1 -b 4800 -m 8N1 -f hardware < /tmp/f | fuse -m plus3e --zxmmc --zxmmc-file cpm-zxmmc.hdf --rom-plus3e-0 $HOME/fuse/roms/mmcen3e0.rom --rom-plus3e-1 $HOME/fuse/roms/mmcen3e1.rom --rom-plus3e-2 $HOME/fuse/roms/mmcen3e2.rom --rom-plus3e-3 $HOME/fuse/roms/mmcen3e3.rom ZXCPM3A-ZPM-ZXMMC.dsk > /tmp/f

For example, to control FreeDOS running on some remote PC, one can type in the DOS command line:

C> mode COM1: 4800,N,8,1
C> ctty COM1:

To return to the default DOS console:

C> ctty CON:
1 Attachments

Discussion

  • Vic Chwe

    Vic Chwe - 2024-05-25

    Thanks a lot for the inspiration! I have created an enhanced version which should be able to handle any arbitrary baud rate: https://sourceforge.net/p/fuse-emulator/patches/442/

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.