Previous Thread
Next Thread
Print Thread
Page 75 of 80 1 2 73 74 75 76 77 79 80
Joined: Feb 2014
Posts: 1,102
Likes: 173
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,102
Likes: 173
I hooked up the dtr of the 8251 to the dsr of the rs232 and that seemed to help with the flow control issues since it should only send data when the device is ready.
Code
m_uart->dtr_handler().set(FUNC(apple_imagewriter_printer_device::dtr_handler));

...

void dtr_handler(uint8_t data) 
{
	output_dsr(data);
}


Giving print shop a try, looks like I need to adjust the margins a little.

[Linked Image from i.imgur.com]

1 member likes this: R. Belmont
Joined: Feb 2014
Posts: 1,102
Likes: 173
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,102
Likes: 173
The easiest solution to horizontal centering seemed to be raising the page width from 8.5 to 9 inches.

It should be trivial to emulate the 15 inch imagewriter by just setting the page width to 15 inches. The width seems to depend on the position of the carriage return switch on the right side of the printer.

[Linked Image from i.imgur.com]

Joined: Mar 2001
Posts: 17,217
Likes: 234
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,217
Likes: 234
That's a hack though, there's no 9 inch wide ImageWriter. Can you fix the position of the carriage return switch to make it work at 8.5?

Joined: Feb 2014
Posts: 1,102
Likes: 173
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,102
Likes: 173
There's a ON1102 photo interrupter "home detector" on the left side and a carriage return position switch on the right side.

Sure, we can keep it at 8.5.

For printshop, if I set the left edge to be -32 pixels it will fit neatly centered within the borders. (I think that's what it was when I was experimenting.) However, negative offsets mean that normal text gets started off the left side page so you lose the first couple of characters.

So you could have a config option to set the left edge offset.

Joined: Feb 2014
Posts: 1,102
Likes: 173
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,102
Likes: 173
Thought I'd set the paper width to 15 inches and try the printographer since it allows you to enter a custom page width.
Cat picture from utility city printed at 3x magnification.

According to a webpage: "At first, the only Apple software that supported the wide carriage model was MacProject. Very few third-party applications initially supported it; most could print only as if there was 8.5-inch paper in the printer."

[Linked Image from i.imgur.com]

I was thinking what would be cool is to be able to adjust the paper offset in real-time to do centering, that'd be fun to try.

Joined: Feb 2014
Posts: 1,102
Likes: 173
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,102
Likes: 173
I don't know exactly how the dtr is supposed to connect up, but when I tried the ct486, it didn't seem to work right.

Sadly, the windows driver will only do 96x72 dpi.

void dtr_handler(uint8_t data)
{
// output_dsr(data);
output_cts(data);
}

so after trying output_cts it seemed to work better:

[Linked Image from i.imgur.com]

from the command line only, can do a

mode com2 9600 n 8 1 r

(need the r at the end to automatically retry)

dir windows > com2

[Linked Image from i.imgur.com]

Joined: Feb 2014
Posts: 1,102
Likes: 173
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,102
Likes: 173
Trying Printing from DeluxePaint on the IIgs:

[Linked Image from i.imgur.com]

Seems to work fine printing on "Fast":

[Linked Image from i.imgur.com]

But obviously there's something wrong with printing on "Standard" or "Best", probably with the pin firing code. You can see the right edge of the characters though.

[Linked Image from i.imgur.com]

Joined: Feb 2014
Posts: 1,102
Likes: 173
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,102
Likes: 173
After trying to get the imagewriter to fire the pins in a "simple" way which didn't work properly, why not try to hook up a 74123 according to the schematic.

It wouldn't fire at all until I got the right values for the R and C which didn't appear on the sams schematic correctly, but were specified on the apple schematic as .022uF, 18K ohms, and 1000PF, 10K ohms:

Code
	TTL74123(config, m_pulse1, 10000, 1000e-12);     // second stage (hooked up to 1 section of 74123)
	m_pulse1->set_connection_type(TTL74123_NOT_GROUNDED_NO_DIODE);
	m_pulse1->set_clear_pin_value(1);  // not clear
	m_pulse1->set_b_pin_value(1);
	m_pulse1->out_cb().set(FUNC(apple_imagewriter_printer_device::pulse1_out_handler));

	TTL74123(config, m_pulse2, 18000, .022E-6);  // first stage  (hooked up to 2 section of 74123)
	m_pulse2->set_connection_type(TTL74123_GROUNDED);
	m_pulse2->out_cb().set(FUNC(apple_imagewriter_printer_device::pulse2_out_handler));
	m_pulse2->set_clear_pin_value(1);

[Linked Image from i.imgur.com]

[Linked Image from i.imgur.com]

Now 2gs beagle write will print on Standard/Best:

[Linked Image from i.imgur.com]

1 member likes this: R. Belmont
Joined: Mar 2001
Posts: 17,217
Likes: 234
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,217
Likes: 234
Do things the right way and everything just works. Nice smile

Joined: Feb 2014
Posts: 1,102
Likes: 173
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,102
Likes: 173
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.
Page 75 of 80 1 2 73 74 75 76 77 79 80

Link Copied to Clipboard
Who's Online Now
2 members (Dodg, 1 invisible), 305 guests, and 6 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,320
Posts121,944
Members5,074
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