Previous Thread
Next Thread
Print Thread
Page 1 of 3 1 2 3
Joined: May 2008
Posts: 60
Likes: 4
W
Walker Offline OP
Member
OP Offline
Member
W
Joined: May 2008
Posts: 60
Likes: 4
Hey all,

I am still playing around with the commodore devices in MAME (esp c128 and variants)

To make my life easier while trying to debug stuff I thought why not check out if the printing capability of the c128 is working in mame...

So now to my question, I can boot up the device with the command

mame.exe c128dp -iec4 mps1200

and have it runnning with an emulated mps1200 attached, is it possible in MAME to get the print output written to a file for this combination?

I know that there is an option -printout in combination with apple2 printing, but this option does not seem to exist for the c128/c64 devices?

What would be the correct parameter for the commodore devices?


I know that printing right now in MAME is a developing target, but right now i would only need some simple text output to help me debug some things.

Joined: Mar 2001
Posts: 16,989
Likes: 84
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,989
Likes: 84
I don't think the mps1200 actually can print, but I don't know for sure.

Joined: May 2008
Posts: 60
Likes: 4
W
Walker Offline OP
Member
OP Offline
Member
W
Joined: May 2008
Posts: 60
Likes: 4
I feared you would say something like that - probably the same goes for the mps1250 as well? cry

Is there some sort of path maybe with lua to grab the data that is sent to the device and write it into a file?

Last edited by Walker; 03/12/23 06:20 PM.
Joined: Mar 2001
Posts: 16,989
Likes: 84
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,989
Likes: 84
For standard RS-232 (and I think Centronics) you can grab the data, but I don't think an equivalent device exists for Commodore IEC.

ETA: and yeah, I checked the drivers, the MPS-1200/1250 are skeletons, they don't even receive the IEC data.

Last edited by R. Belmont; 03/12/23 07:21 PM.
Joined: May 2008
Posts: 60
Likes: 4
W
Walker Offline OP
Member
OP Offline
Member
W
Joined: May 2008
Posts: 60
Likes: 4
ok,

i checked and rs232 would do for me - if there is a possibility to grab its output into a file (doesn't matter if in petsci or in ascii).

Now to stretch my luck, how do I grab that data?

Is it accessible in lua somehow ( if yes, may i ask for some sample snippet?)

Or can I dump the output in a file with some parameter (which)?

I only need the output, no bidirectional communication.

Joined: Dec 2015
Posts: 153
Likes: 4
A
AJR Offline
Senior Member
Offline
Senior Member
A
Joined: Dec 2015
Posts: 153
Likes: 4
The MPS-1200 emulation needs a lot more work on the M50734 microcontroller, some external logic glue and some emulation of the printer mechanism before it can actually print.

The OP here did prompt me to do a little more work on the M50734, including disassembling and analyzing the MPS-1200 program code. I just hooked up the part of the stepper motor controller which the MPS-1200 uses, which does not include the port output. Timer X will probably be next. The M50734's other on-chip peripherals will need to be emulated sooner or later, since the MPS-1200 uses practically all of them except for the UART (which the Kawai R-100 drum machine uses for MIDI).

1 member likes this: Walker
Joined: Nov 2004
Posts: 13
Likes: 3
S
Member
Offline
Member
S
Joined: Nov 2004
Posts: 13
Likes: 3
depending on your use case something like these should point you in the right direction, can't speak for how usable these are in commodore land

null modem to socket
mame c128dp -w -user rs232 -user:rs232:rs232 null_modem -bitb socket.localhost:5555

or a serial printer (not used one before)
mame c128dp -w -user rs232 -user:rs232:rs232 printer -printout outfile.txt

Last edited by sairuk; 03/13/23 02:32 AM.
1 member likes this: Walker
Joined: May 2008
Posts: 60
Likes: 4
W
Walker Offline OP
Member
OP Offline
Member
W
Joined: May 2008
Posts: 60
Likes: 4
thanks AJR and thanks sairuk,

the rs232 cmdline sample will definitely help me on my quest.

If I can be of any support with the printer stuff, point my nose to something I could do to help you.

And I am looking forward to see some sort of life breathed into the mps12x0 devices in MAME - the printer could be connected to nomal pc's and amiga's as well (and others with parallel and serial port) and could be useful there I guess, too.

@sairuk I i'll check how useful both commands are for me, since I use the windows version (although inside wsl crazy) I won't be able to try a socket easily to send data (though there could be something similar in windows as well mmh) but if I get some output to a file through this, my current target would be met.

Joined: May 2008
Posts: 60
Likes: 4
W
Walker Offline OP
Member
OP Offline
Member
W
Joined: May 2008
Posts: 60
Likes: 4
I am not sure if I initialised the user port rs232 correctly, maybe one of you can get a good laugh and either tell me i am completely wrong or that the device in mame currently is simply not working.

I first tried to open the device in c128 mode - no success

I followed some code sample from a script to get a file with xmodem protocol per serial connection c64 basic xmodem sample code

Code
open 2,2,0,chr$(10)+chr$(9)
?break error

the same open method snippet does produce a little more in c64 mode: (now i try to send some output after openeing it without error message)
Code
open 2,2,0,chr$(10)+chr$(9)
print#2,chr$(21):rem sending  a nak first i thought could not be too wrong
print#2,"some text sample line1"
print#2,"some more text line2"
close2

sadly this produced only the following output

|code]
hexdump -C outfile.txt
00000000 f8 f8 f8 00 f8 00 f8 f8 00 f8 f8 00 f8 f8 f8 00 |................|
00000010 00 f8 f8 f8 f8 00 f8 00 f8 f8 00 00 f8 f8 f8 f8 |................|
00000020 f8 00 f8 f8 00 00 00 f8 00 00 f8 00 f8 f8 f8 00 |................|
00000030 00 f8 00 f8 00 f8 f8 00 f8 f8 00 f8 f8 f8 00 f8 |................|
00000040 00 f8 00 f8 00 f8 f8 00 f8 00 00 f8 f8 f8 f8 f8 |................|
00000050 00 f8 f8 00 00 00 f8 00 00 f8 00 f8 f8 f8 00 00 |................|
00000060 f8 00 |..|
[/code]

so my first guess was that 2400 baud setting was not a good starting point, but doing the same with 50 baud only changed the output to zero bytes in the output.


So either I am doing something completely wrong, or my brain is broken or the null modem on c128 simply is broken code right now?

will try this experiment on c64 device now.

update test reszlt file with c64p device
Code
hexdump -C out64.txt
00000000  78 78 78 00 f8 80 78 f8  80 78 f8 80 78 78 78 80  |xxx...x..x..xxx.|
00000010  00 78 78 78 78 80 78 00  78 78 80 00 78 78 78 78  |.xxxx.x.xx..xxxx|
00000020  78 00 78 78 80 00 80 78  80 80 78 80 78 78 78 00  |x.xx...x..x.xxx.|
00000030  80 78 00 78 78 00 78 00  78 00 78 78 78 00 78 00  |.x.xx.x.x.xxx.x.|
00000040  78 80 78 80 80 78 78 78  78 78 80 78 f8 80 78 80  |x.x..xxxxx.x..x.|
00000050  78 80 78 78 78 78 80 80  78 f8 80 78 00 78 78 78  |x.xxxx..x..x.xxx|
00000060  78 80 78 78 78 78 78 78  78 80 f8 78 78 00        |x.xxxxxxx..xx.|

I am diving now into the rs232 Mame source in hope of getting an idea how to get better results, maybe one of you got an idea?

maybe I got a correct bitstream and i only have to translate it back into single bytes of petsci?

Last edited by Walker; 03/13/23 07:12 PM.
Joined: Feb 2014
Posts: 927
Likes: 75
G
Senior Member
Offline
Senior Member
G
Joined: Feb 2014
Posts: 927
Likes: 75
you might try to set a different baud rate possibly? (match the baud rate with the bitbang settings in the ui machine configuration?)

Last edited by Golden Child; 03/13/23 08:33 PM.
1 member likes this: sairuk
Page 1 of 3 1 2 3

Link Copied to Clipboard
Who's Online Now
4 members (box, Pernod, 2 invisible), 22 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,171
Posts120,123
Members5,039
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com