Previous Thread
Next Thread
Print Thread
Joined: Feb 2014
Posts: 914
Likes: 72
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 914
Likes: 72
I was looking at some web pages for the Coleco Adam and saw the schematics for the daisywheel printer which piqued my curiosity.

Looking around, there was also complete source code for the 6801 program for the printer, so why not see if it could do something.

There was a nice picture of the daisywheel and I rotated the picture and got the sequence of the characters.

[Linked Image from i.imgur.com]

One character quite eluded me, it was a strange L laying on its side.

Finding a manual for the Diablo 630 Diablo_630_Printer-Terminal_Manual.PDF there is a lot of datasheet information about the different Diablo daisywheels and the plastic 96 character is a perfect match. The funky L character on its side is a "not" symbol.

[Linked Image from i.imgur.com]

note that the electrical spoke position + spoke position = 96.

In the rom for the printer, there's a complete table of ascii character to printwheel position

Code

ADAM DAISYWHEEL


          cent !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /
     FD17  02 44 46 2E 2C 2F 45 36 3C 3A 3D 2D 03 2B 05 42   .DF.,/E6<:=-.+.B

            0  1  2  3  4  5  6  7  8  9  :  ;  <  =  >  ?
     FD27  25 21 22 23 24 26 27 28 29 2A 0C 1F 39 30 32 41   %!"#$&'()*..902A

            @  A  B  C  D  E  F  G  H  I  J  K  L  M  N  O
     FD37  3E 0B 08 0A 16 0F 09 18 11 14 1D 1C 15 06 13 12   >..... .........

            P  Q  R  S  T  U  V  W  X  Y  Z  [  \  ]  ^  _
     FD47  1A 1B 0D 0E 10 17 1E 04 20 19 07 35 3F 33 40 37   ........ ..5?3@7

            `  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o
     FD57  38 54 4E 4F 4C 53 59 4A 57 55 48 5D 4D 47 52 50   8TNOLSYJWUH]MGRP

            p  q  r  s  t  u  v  w  x  y  z  {  |  }  ~ not (unicode FFE2)
     FD67  5A 5C 51 58 56 5B 49 00 4B 5E 5F 31 3B 43 34 01   Z\QXV[I.K^_1;C4.


     FD77  07 06 06 07 07 07 07 05 06 06 07 06 05 05 05 06   ................


and if I extract that table to a hexdump:

Code
02 44 46 2E 2C 2F 45 36 3C 3A 3D 2D 03 2B 05 42
25 21 22 23 24 26 27 28 29 2A 0C 1F 39 30 32 41
3E 0B 08 0A 16 0F 09 18 11 14 1D 1C 15 06 13 12
1A 1B 0D 0E 10 17 1E 04 20 19 07 35 3F 33 40 37
38 54 4E 4F 4C 53 59 4A 57 55 48 5D 4D 47 52 50
5A 5C 51 58 56 5B 49 00 4B 5E 5F 31 3B 43 34 01

and then pipe it to xxd:
Code
cat adamdaisywheel_for_xxd.txt | xxd -r -p  > adamdaisy.bin

then start up lua

Code
f = io.open("adamdaisy.bin") a = f:read("*a") f:close() print(#a)
chartab={} for i = 1,#a do chartab[a:byte(i)]=string.char(i+32-1) end 
chartab[1]="not" chartab[2]="cent"
for i,j in pairs(chartab) do print(i,j) end
io.write('{"') for i=0,#chartab,1 do io.write(chartab[i]) end io.write('"}') print()

which gives you the daisywheel table

Code
 lua
> f = io.open("adamdaisy.bin") a = f:read("*a") f:close() print(#a)
96
> chartab={} for i = 1,#a do chartab[a:byte(i)]=string.char(i+32-1) end 
> chartab[1]="not" chartab[2]="cent"
> for i,j in pairs(chartab) do print(i,j) end
1	not
2	cent
3	,
4	W
5	.
6	M
7	Z
8	B
9	F
10	C
11	A
12	:
13	R
14	S
15	E
16	T
17	H
18	O
19	N
20	I
21	L
22	D
23	U
24	G
25	Y
26	P
27	Q
28	K
29	J
30	V
31	;
32	X
33	1
34	2
35	3
36	4
37	0
38	5
39	6
40	7
41	8
42	9
43	-
44	$
45	+
46	#
47	%
48	=
49	{
50	>
51	]
52	~
53	[
54	'
55	_
56	`
57	<
58	)
59	|
60	(
61	*
62	@
63	\
64	^
65	?
66	/
67	}
68	!
69	&
70	"
71	m
72	j
73	v
74	g
75	x
76	d
77	l
78	b
79	c
80	o
81	r
82	n
83	e
84	a
85	i
86	t
87	h
88	s
89	f
90	p
91	u
92	q
93	k
94	y
95	z
0	w

{"wnotcent,W.MZBFCA:RSETHONILDUGYPQKJV;X1234056789-$+#%={>]~['_`<)|(*@\^?/}!&"mjvgxdlbcorneaithsfpuqkyz"}

and cleaning up the cent, not, \\ and \" then you have a string for the daisywheel:

Code
	const std::string m_daisywheel = "w~c,W.MZBFCA:RSETHONILDUGYPQKJV;X1234056789-$+#%={>]~['_`<)|(*@\\^?/}!&\"mjvgxdlbcorneaithsfpuqkyz";

So far, I've got the daisywheel to ascii working, the paper feed stepper (it doesn't actually use a stepper but a motor that turns with a detent sensor to track distance) and the cr stepper.



2 members like this: exidyboy, robcfg
Joined: Feb 2014
Posts: 914
Likes: 72
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 914
Likes: 72
So if I use a web browser canvas to make a png bitmap sheet of the printwheel characters, I can paste characters into the bitmap from the sheet.


Code
<canvas id="canvas" width="1920" height="1080"></canvas>

<script>
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');

size = 50
ctx.font = ' '+size+'px Courier New';
ctx.strokeStyle = 'red';

ctx.fillStyle = "white";
ctx.fillRect(0,0,1920,1080);
ctx.fillStyle="black";

// cent = 00a2
// not = 00ac
for (i=32;i<128;i++){

str = String.fromCharCode(i)

if (i==32) str = "¢"
if (i==127) str = "¬"

textMetrics = ctx.measureText(str);
width = textMetrics['actualBoundingBoxRight'] - textMetrics['actualBoundingBoxLeft']

CanvasRenderingContext2D.textAlign = "center";


ctx.fillText(str, 
      (Math.floor((i-32) % 16) ) * 32 - width / 2 + 50, 
      (size) * Math.floor((i-32)/16)+50);


boxx1 = (Math.floor((i-32) % 16) ) * 32  + 50 - 15 
boxx2 = boxx1 + 32
boxy1 = (size) * Math.floor((i-32)/16) + 15 - 3
boxy2 = boxy1 + size

ctx.beginPath();
ctx.moveTo (  boxx1, boxy1 );
ctx.lineTo (  boxx1, boxy2 );
ctx.lineTo (  boxx2, boxy2 );
ctx.stroke();

}


</script>
[Linked Image from i.imgur.com]


[Linked Image from i.imgur.com]

[Linked Image from i.imgur.com]

1 member likes this: robcfg
Joined: May 2009
Posts: 2,092
Likes: 126
J
Very Senior Member
Offline
Very Senior Member
J
Joined: May 2009
Posts: 2,092
Likes: 126
The screenshot says "This is pica type", but your render says "Thisiis pica type".

Joined: Feb 2014
Posts: 914
Likes: 72
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 914
Likes: 72
Yes, good eyes JD. I mistyped and the Adam's built-in electronic typewriter will let you backspace and "correct" your errors but it's already typed it on the page. Now I'm actually copying the whole rectangle and it would be cleared up but it doesn't actually fire the hammer on a space.

Joined: Feb 2014
Posts: 914
Likes: 72
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 914
Likes: 72
Seems to work ok




[Linked Image from i.imgur.com]


Seems to work well with smartlogo:

[Linked Image from i.imgur.com]

testing with smartbasic:

[Linked Image from i.imgur.com]

4 members like this: Waremonger, Duke, Pernod, robcfg
Joined: Feb 2014
Posts: 914
Likes: 72
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 914
Likes: 72
If you'd like to take a look:

https://github.com/goldnchild/mame/tree/adam_printer_daisywheel

I made the javascript pass the size and origin of the characters in pixels 0,1,2,3.

If you change the width and height from 1920x1080 to 600x350 the png file is 55kb instead of 100kb.

Code
// Run the following code in a web browser to build the typesheet and right click on it and save the file as artwork/adam_printer.png

<canvas id="canvas" width="600" height="350"></canvas>

<script>
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');

size = 50
ctx.font = ' '+size+'px Courier New';

ctx.fillStyle = "white";
ctx.fillStyle = "#FFFFFE";  // #FFFFFF does not work for transpen
ctx.fillRect(0,0,1920,1080);  // need to make background white

ctx.fillStyle="black";

// cent = 00a2
// not = 00ac
for (i=32;i<128;i++)
{

    str = String.fromCharCode(i)

    if (i==32) str = "¢"
    if (i==127) str = "¬"

    textMetrics = ctx.measureText(str);
    width = textMetrics['actualBoundingBoxRight'] - textMetrics['actualBoundingBoxLeft']

    hsize = 34
    vsize = size

    x0 = 35
    y0 = 14

    x1 = (Math.floor((i-32) % 16) ) * hsize + x0
    x2 = x1 + hsize
    y1 = (Math.floor((i-32) / 16) ) * vsize + y0
    y2 = y1 + vsize

    ctx.fillText(
        str,
        x1 - width / 2 + hsize / 2,
        y1 + vsize - 15);

    drawredlines = false
    if (drawredlines)
    {
        ctx.strokeStyle = 'red';
        ctx.beginPath();
        ctx.moveTo( x1, y1 ); ctx.lineTo( x1, y2 ); ctx.lineTo( x2, y2 ); ctx.lineTo( x2, y1 ); ctx.lineTo( x1, y1 );
        ctx.stroke();
}
}

function fillstylepad(x)
{
    num = "000000" + x.toString(16); num = num.slice(num.length-6, num.length);
    ctx.fillStyle="#"+num;
}

// pass the origin in pixels 0 and 1
ctx.fillStyle = fillstylepad(x0)
ctx.fillRect(0,0,1,1)
ctx.fillStyle = fillstylepad(y0)
ctx.fillRect(1,0,1,1)
// pass the size in pixels 2 and 3
ctx.fillStyle = fillstylepad(hsize)
ctx.fillRect(2,0,1,1)
ctx.fillStyle = fillstylepad(vsize)
ctx.fillRect(3,0,1,1)

</script>

Joined: Feb 2014
Posts: 914
Likes: 72
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 914
Likes: 72
I wanted to see if I could make a typewriter driver do something with a daisywheel, and managed to find a driver on github for a brother word processor:

It needed converting to more recent mame, and I was able to get it to do something:

[Linked Image from i.imgur.com]

[Linked Image from i.imgur.com]



The daisywheel for brother printers is different from the Diablo wheel.


I was having some trouble with unicode characters in the string, I ended up just replacing them with blanks for now. That makes any unicode symbol come up as a cent symbol.

Code
	const std::string wheelstr("M:W;NIU(H)K+X*ZPSLTAY&VB=EF-C\"D?GJO_Q'R²[°]!@³§¥<±>#¼¶½$9087654231%/wjxqzydvkugfbnphlmtcoiasre.,");

	const char * wheelchars2 = "M:W;NIU(H)K+X*ZPSLTAY&VB=EF-C\"D?GJO_Q'R [ ]!@   < >#   $9087654231%/wjxqzydvkugfbnphlmtcoiasre.,";

It's not perfect, and it runs strangely slow for some reason. I still see the Check printer message upon trying to enter the Word Processor. But it's cool to see it work a little.

2 members like this: robcfg, Duke
Joined: Feb 2014
Posts: 914
Likes: 72
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 914
Likes: 72
Not really related to daisywheel printing, but I thought I'd take a look at the spectrum zx printer and managed to get it to do something:

[Linked Image from i.imgur.com]

2 members like this: ICEknight, robcfg

Link Copied to Clipboard
Who's Online Now
0 members (), 19 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,158
Posts119,911
Members5,034
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