Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
07828 Core Minor Always Dec 24, 2020, 02:51 2 days ago
Tester star2root View Status Public Platform MAME (Self-compiled)
Assigned To Resolution Open OS MacOS X
Status [?] Acknowledged Driver coco12.cpp
Version 0.224 Fixed in Version Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary MESS-specific 07828: coco, coco2, coco2b, coco3: Printing to the 4 pin serial port not working.
Description Any attempt to print to the bit banger port fails. OS9/NitrOS9 gives error 246, device not ready. BASIC simply hangs.
Steps To Reproduce Setup a printout file, type in a short BASIC program and type:
LLIST
Additional Information It seems that the input line (FF22 bit 0) is getting enabled to indicate that the printer is offline. This functionality was working some where around version 0.199.
Github Commit
Flags Verified with Original
Regression Version 0.199
Affected Sets / Systems coco, coco2, coco2b, coco3
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
9
User avatar
No.18286
star2root
Tester
Dec 24, 2020, 19:49
edited on: Dec 24, 2020, 20:37
I removed the code in the OS9 scbbp bit banger printer device driver that checks for the input signal and was able to print, so the problem is definitely that the serial 4 pin input is being set in MAME. Suffice to say, the original OS9 code woks fine on a real CoCo without removing the input pin check.
User avatar
No.18287
star2root
Tester
Dec 24, 2020, 20:41
Notes on the CoCo 4 pin serial port:

Note that pins of connector are not always used the same way! This is possible because most
everything is done in software; pins 1 and 2 are required by the hardware to be inputs, but it is up to
the program to decide how to use those inputs. While any sort of communications program should
use the RS-232 pin-out, the built-in BASIC printer routines use pin 2 (RS232 input) as "printer status" and
completely ignores pin 1. So the cable you wire up for a printer has to be different from the one you
wire up for a modem.
User avatar
No.18288
star2root
Tester
Dec 24, 2020, 22:21
On my real CoCo 3, PRINT HEX$(PEEK(&HFF22)) returns a 4, bit 0 is clear, and LLIST does not hang. On MAME, PRINT HEX$(PEEK(&HFF22)) returns a 5, and LLIST hangs if any BASIC program is present to list.
User avatar
No.18289
tlindner
Tester
Dec 24, 2020, 23:33
Color BASIC requires the RX pin low to print to a printer. OS-9 is the same. All Radio Shack printers did this, so there was never a problem on real hardware.

In MAME, the printer image device doesn't do this. I've been meaning to add a configuration for this mode, but have never gotten around to it..
User avatar
No.18290
star2root
Tester
Dec 25, 2020, 06:34
Where and how is the best way to force this line to default to low. I checked my real CoCo 3 (I haven't checked the CoCo 1 yet, but I expect the same behavior) and the input line defaults to low when nothing is connected. If MAME is supposed to emulate the hardware, then the default state of this bit (bit 0, FF22) should be zero.
User avatar
No.18360
tlindner
Tester
Jan 10, 2021, 04:41
I've submitted a PR to emulate this small aspect of Radio Shack printers. https://github.com/mamedev/mame/pull/7652
User avatar
No.18540
star2root
Tester
Mar 14, 2021, 09:16
As of version 0.229, it seems to work under OS-9 or NitrOS9, but while Disk BASIC no longer hangs, the printer output file contains random looking characters.
User avatar
No.18575
tlindner
Tester
Mar 16, 2021, 23:08
I've re-tested with the latest source and verified coco2b with BASIC, and stock OS-9 Level 1. I've also retested with coco3 with BASIC and stock OS-9 Level 2. All is working. MAME was kept at 600 bps at 8-1-N.

The problem you describe would also be caused by a mismatch in baud or protocol.
User avatar
No.18725
tlindner
Tester
2 days ago
I nominate this for closure.