{"id":659,"date":"2020-10-03T17:27:01","date_gmt":"2020-10-03T17:27:01","guid":{"rendered":"http:\/\/tlindner.macmess.org\/?page_id=659"},"modified":"2024-03-08T18:25:13","modified_gmt":"2024-03-08T18:25:13","slug":"color-computer-serial-and-mame-walk-into-a-bar","status":"publish","type":"page","link":"https:\/\/tlindner.macmess.org\/?page_id=659","title":{"rendered":"Color Computer, Serial and MAME walk into a Bar\u2026"},"content":{"rendered":"<p>This article is to help people understand using serial ports in MAME. It uses the Color Computer drivers as a real example of the many possibilities.<\/p>\n<p>The Color Computer has a built in serial port. It is commonly referred to as the bit banger. It is located on the back of the computer and labeled serial. It has three lines and ground. TX, RX, and Ready. All of the signals are under the direct control of the CPU. There is no UART on this port.<\/p>\n<p>In MAME this port is called rs232. It is a MAME slot device and can be discovered by using the listslots command line switch.<\/p>\n<pre>$ .\/mame64 coco2b -listslots\nSYSTEM           SLOT NAME        SLOT OPTIONS     SLOT DEVICE NAME\n---------------- ---------------- ---------------- ----------------------------\ncoco2b           rs232            dec_loopback     RS232 Loopback (DEC 12-15336-00)\n                                  ie15             IE15 Terminal\n                                  keyboard         Serial Keyboard\n                                  loopback         RS232 Loopback\n                                  null_modem       RS232 Null Modem\n                                  printer          Serial Printer\n                                  pty              Pseudo terminal\n                                  sunkbd           Sun Keyboard Adaptor\n                                  swtpc8212        SWTPC8212 Terminal\n                                  terminal         Serial Terminal\n<\/pre>\n<p>The slot options are devices that can be attached to the serial port. There are two that let you connect emulated devices to the outside world. Null_moden and pty. In this article we will be discussing null_modem.<\/p>\n<p>Let us attach a null_modem to the CoCo and see how that affects the media options available:<\/p>\n<pre>$ .\/mame64 coco2b -rs232 null_modem -listmedia\nSYSTEM           MEDIA NAME       (brief)    IMAGE FILE EXTENSIONS SUPPORTED\n---------------- --------------------------- -------------------------------\ncoco2b           cassette         (cass)     .wav  .cas  \n                 bitbanger        (bitb)     .     \n                 cartridge        (cart)     .ccc  .rom  \n                 floppydisk1      (flop1)    .dmk  .jvc  .dsk  .vdk  .sdf  .os9  .d77  .d88  .1dd  .dfi  .hfe  .imd  .ipf  .mfi  .mfm  .td0  .cqm  .cqi  \n                 floppydisk2      (flop2)    .dmk  .jvc  .dsk  .vdk  .sdf  .os9  .d77  .d88  .1dd  .dfi  .hfe  .imd  .ipf  .mfi  .mfm  .td0  .cqm  .cqi  \n                 harddisk1        (hard1)    .vhd  \n                 harddisk2        (hard2)    .vhd\n<\/pre>\n<p>A new media name has been made available: bitbanger (bitb). One way to use this media is to attach a file. Everything sent to the serial port will be copied to the file. But there is a special file name used to enable internet sockets: socket dot.<\/p>\n<p>For example:<\/p>\n<pre> $ .\/mame64 coco2b -rs232 null_modem -bitb socket.localhost:6809\n<\/pre>\n<p>This will cause MAME to try to connect to local host on port 6809. If it fails, MAME will opening a listening socket on 6809. Either way it is bi-directional.<\/p>\n<p>Of course &#8216;localhost&#8217; can be substituted to any fully qualified domain name on the internet.<\/p>\n<h1>Baud Rates and other Settings<\/h1>\n<p>When a serial program is running on the Color Computer and it sends data to the serial port it is fully in charge of the rate it uses. Unfortunately, there is no way for MAME to know what this rate it. So it must be told.<\/p>\n<p><a href=\"http:\/\/tlindner.macmess.org\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-03-at-10.25.28-AM.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tlindner.macmess.org\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-03-at-10.25.28-AM-300x237.png\" alt=\"Screen Shot 2020-10-03 at 10.25.28 AM\" width=\"300\" height=\"237\" class=\"alignnone size-medium wp-image-668\" srcset=\"https:\/\/tlindner.macmess.org\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-03-at-10.25.28-AM-300x237.png 300w, https:\/\/tlindner.macmess.org\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-03-at-10.25.28-AM-1024x809.png 1024w, https:\/\/tlindner.macmess.org\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-03-at-10.25.28-AM-379x300.png 379w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>In MAME go to the user interface menu and selection machine configuration. There you will see all the rate and other communication settings. They must match what the software is generating.<\/p>\n<h1> Expansion Port<\/h1>\n<p>The Color Computer has an expansion port on the side that accepts cartridges. Of course there are serial cartridges available.<\/p>\n<p>Here is the command line that will display the available slots devices for the expansion port:<\/p>\n<pre>$ .\/mame64 coco2b -listslots\nSYSTEM           SLOT NAME        SLOT OPTIONS     SLOT DEVICE NAME\n---------------- ---------------- ---------------- ----------------------------\n                 ext              banked_16k       CoCo Program PAK (Banked)\n                                  cc2hdb1          CoCo2 HDB-DOS\n                                  cc3hdb1          CoCo3 HDB-DOS\n                                  ccpsg            CoCo PSG\n                                  cd6809_fdc       Codimex CD-6809 Disk BASIC (1986)\n                                  cp450_fdc        Prol\u00f3gica CP-450 BASIC Disco V. 1.0 (1984)\n                                  dcmodem          CoCo Direct Connect Modem PAK\n                                  fdc              CoCo FDC\n                                  fdcv11           CoCo FDC v1.1\n                                  games_master     CoCo Games Master Cartridge\n                                  multi            CoCo Multi-Pak Interface\n                                  orch90           CoCo Orch-90 PAK\n                                  pak              CoCo Program PAK\n                                  ram              Disto 1024K RAM Cartridge\n                                  rs232            CoCo Deluxe RS-232 PAK\n                                  ssc              CoCo S\/SC PAK\n<\/pre>\n<p>Of the ones listed, the serial devices are: rs232 and dcmodem.\nThe command to attach an RS232 cartridge to the expansion port is:<\/p>\n<pre>$ .\/mame64 coco2b -ext rs232 -listslots\nSYSTEM           SLOT NAME        SLOT OPTIONS     SLOT DEVICE NAME\n---------------- ---------------- ---------------- ----------------------------\ncoco2b           rs232            dec_loopback     RS232 Loopback (DEC 12-15336-00)\n                                  ie15             IE15 Terminal\n                                  keyboard         Serial Keyboard\n                                  loopback         RS232 Loopback\n                                  null_modem       RS232 Null Modem\n                                  printer          Serial Printer\n                                  pty              Pseudo terminal\n                                  sunkbd           Sun Keyboard Adaptor\n                                  swtpc8212        SWTPC8212 Terminal\n                                  terminal         Serial Terminal\n\n                 ext:rs232:port   dec_loopback     RS232 Loopback (DEC 12-15336-00)\n                                  ie15             IE15 Terminal\n                                  keyboard         Serial Keyboard\n                                  loopback         RS232 Loopback\n                                  null_modem       RS232 Null Modem\n                                  printer          Serial Printer\n                                  pty              Pseudo terminal\n                                  sunkbd           Sun Keyboard Adaptor\n                                  swtpc8212        SWTPC8212 Terminal\n                                  terminal         Serial Terminal\n<\/pre>\n<p>You will now see there are two serial ports available. Each can have their own null_modem devices attached:<\/p>\n<pre>$ .\/mame64 coco2b -rs232 null_modem -ext rs232 -ext:rs232:port null_modem -listmedia\nSYSTEM           MEDIA NAME       (brief)    IMAGE FILE EXTENSIONS SUPPORTED\n---------------- --------------------------- -------------------------------\ncoco2b           cassette         (cass)     .wav  .cas  \n                 bitbanger1       (bitb1)    .     \n                 cartridge        (cart)     .ccc  .rom  \n                 bitbanger2       (bitb2)    .     \n                 harddisk1        (hard1)    .vhd  \n                 harddisk2        (hard2)    .vhd\n<\/pre>\n<p>When this is done you will now see two bitbanger media attachments points available. Each could have a socket dot &#8216;fake&#8217; file to direct it to the outside world.<\/p>\n<h1>Multi-Pak<\/h1>\n<p>Attaching a serial cartridge to the expansion port means you can not have disk drives as well. Radio Shack&#8217;s answer to this problem was the Multi-Pak interface. It allowed four cartridges to be attached to the expansion port at a single time. They were all connected at the same time with some limitations. Here are some example commands to use serial cards with the Multi-Pak.<\/p>\n<pre>$ .\/mame64 coco2b -ext multi -ext:multi:slot3 rs232 ext:multi:slot3:rs232:port null_modem<\/pre>\n<p>This will start a coco2b driver with a Multi-Pak, Floppy disk in slot 4 (the default) and a RS232 pal in slot 3. There will be a bitb1 and bitb2 media attachment points.\nIt is worth noting the serial interrupt is a switch signal in the Multi-Pak. This means the interrupt will only make it to the CoCo if the switch is set to the slot that the RS232 cartridge resides in.<\/p>","protected":false},"excerpt":{"rendered":"<p>This article is to help people understand using serial ports in MAME. It uses the Color Computer drivers as a real example of the many possibilities. The Color Computer has a built in serial port. It is commonly referred to &hellip; <a href=\"https:\/\/tlindner.macmess.org\/?page_id=659\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-659","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/tlindner.macmess.org\/index.php?rest_route=\/wp\/v2\/pages\/659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tlindner.macmess.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tlindner.macmess.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tlindner.macmess.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tlindner.macmess.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=659"}],"version-history":[{"count":14,"href":"https:\/\/tlindner.macmess.org\/index.php?rest_route=\/wp\/v2\/pages\/659\/revisions"}],"predecessor-version":[{"id":1015,"href":"https:\/\/tlindner.macmess.org\/index.php?rest_route=\/wp\/v2\/pages\/659\/revisions\/1015"}],"wp:attachment":[{"href":"https:\/\/tlindner.macmess.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}