I maybe spoke too soon about fixing the printhead since there's still some random glitching.

Here's some output from MousePaint "MOUSE.PIC" (with the x distance "scaled down" to avoid pixel gaps)

[Linked Image from i.imgur.com]

and I was always fascinated by MacPaint so I thought I'd try to get it to print, so adding a few lines to mac128.cpp:

Code
	SCC85C30(config, m_scc, C7M);
	m_scc->configure_channels(C3_7M, 0, C3_7M, 0);
	m_scc->out_int_callback().set(FUNC(mac128_state::set_scc_interrupt));

	rs232_port_device &rs232a(RS232_PORT(config, "rs232a", default_rs232_devices, nullptr));  // connects to modem port
	rs232a.rxd_handler().set(m_scc, FUNC(z80scc_device::rxa_w));
	rs232a.cts_handler().set(m_scc, FUNC(z80scc_device::ctsa_w));
	m_scc->out_txda_callback().set(rs232a, FUNC(rs232_port_device::write_txd));
	m_scc->out_dtra_callback().set(rs232a, FUNC(rs232_port_device::write_dtr));
	m_scc->out_rtsa_callback().set(rs232a, FUNC(rs232_port_device::write_rts));


	rs232_port_device &rs232b(RS232_PORT(config, "rs232b", default_rs232_devices, nullptr));  // connects to printer port
	rs232b.rxd_handler().set(m_scc, FUNC(z80scc_device::rxb_w));
	rs232b.cts_handler().set(m_scc, FUNC(z80scc_device::ctsb_w));
	m_scc->out_txdb_callback().set(rs232b, FUNC(rs232_port_device::write_txd));
	m_scc->out_dtrb_callback().set(rs232b, FUNC(rs232_port_device::write_dtr));
	m_scc->out_rtsb_callback().set(rs232b, FUNC(rs232_port_device::write_rts));

I can get it to do this:

[Linked Image from i.imgur.com]

I haven't figured out why it has the horizontal lines, but if I enable the 8th bit, it seems to not print at all.

There's still some weirdness about flow control (inverted lines possibly since it seems to hang until I toggle the printer's online status) but I'm glad to see it output something 8-)


Hmmm, I noticed that the baud rate is effectively 10204 baud coming from the scc, let's see what happens when we match the rate:

[Linked Image from i.imgur.com]


Looking at the Macintosh Hardware 1985 manual, it says the SCC clock should be 3.672000 mhz

https://archive.org/details/Macintosh_Hardware_1985_Apple/page/n13/mode/2up

[Linked Image from i.imgur.com]

Code
/*
	SCC85C30(config, m_scc, C7M);
	m_scc->configure_channels(C3_7M, 0, C3_7M, 0);
	m_scc->out_int_callback().set(FUNC(mac128_state::set_scc_interrupt));
*/

	SCC85C30(config, m_scc, 3672000);
	m_scc->configure_channels(3672000, 0, 3672000, 0);
	m_scc->out_int_callback().set(FUNC(mac128_state::set_scc_interrupt));


and putting the imagewriter's 8251a clock back to 9600 seems to work:

[Linked Image from i.imgur.com]


so I'd guess that the baud rate is around 9563 which is pretty close to 9600 (like 0.4 %)

[MAME]> print(3672000 / 16 / 9600)
23.90625
[MAME]> print(3672000 / 16 / 24)
9562.5

Last edited by Golden Child; 08/30/21 01:43 PM.