OXYGENHUB
◆ main openmsx / doc / plotter.md
15.4 KiB · Markdown · last changed chore(): initial commit 1 month ago renderedsource blame history raw
1
# Plotter information
2
3
## Sony PRN-C41(D) / General PCP-5501 / Toshiba HX-P570
4
This information is copied from the original Sony manual and some parts are from the Creative Greetings software manual. The Sony plotter was release with Plotter (Creative Greetings) software. Also some add on graphics are released for this software, see also: https://www.generation-msx.nl/group/sony-plotter-series/97/
5
6
### Control Characters
7
8
| Name            | Code                | Functions                                                                                   |
9
|-----------------|--------------------|---------------------------------------------------------------------------------------------|
10
| Carriage return | ODH                 | When DIP switch 4 is ON: pen moves to top of the next line. OFF: pen moves to top of the line. |
11
| Line feed       | OAH                 | Feeds a line.                                                                               |
12
| Back space      | 08H                 | Moves pen one character space back (ignored at the top of the line).                        |
13
| Line up         | OBH                 | Feeds paper to the previous line.                                                           |
14
| Graphic mode    | 1BH+"#"             | Sets the plotter printer in the graphic mode.                                               |
15
| Scale set       | 12H+"0"−"15"        | Sets the size of characters (0 is the smallest size).                                       |
16
| Color set       | 1BH+"C"+"0"−"3"     | Sets the pen color (0: black, 1: blue, 2: green, 3: red).                                   |
17
| Top of form     | OCH                 | Feeds paper 297 mm (11 3/4​ inches) down from the printing start position.                    |
18
| Text mode       | 1BH+"$"             | Sets the plotter printer in the text mode.                                                  |
19
20
### Graphic Mode Instruction Codes Table
21
22
| Category                  | Command                                         | Function                                                                 | Remarks / Examples                                                                                       |
23
|---------------------------|-------------------------------------------------|--------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|
24
| Pen Point Position        | A (All initialize)                              | Moves pen to the leftmost position, sets it as the origin, and sets the plotter printer to text mode.     | Commands I, H, A, and F can be followed by another command without inserting any characters.              |
25
|                           | F (New line)                                   | Moves the pen to the top of the next line.                             |  LPRINT "HD100,0"                                                                                                        |
26
|                           | H (Home)                            | Moves the pen to the origin without drawing a line.|   Draws a line from the origin to (100,0)                                                                                                       |
27
|                         | I (Initialize)                                 | Sets the current pen position as the origin (the intersection of the x and y axes) |                                                                                                          |
28
| Printing Design / Drawing | Cn (n=0−3) (Color change)                      | Sets the color (0:black, 1:blue, 2:green, 3:red).                      | Commands C, S, Q, and L can be followed by another command by inserting a comma between them.             |
29
|                           | Ln (n=0−15) (Line type)                        | Selects solid (n=0,15) or broken lines (n=1−14). Higher n means rougher broken line. |                                                                                                          |
30
|                           | Qn (n=0−3) (Alpha rotate)                      | Sets the direction of characters to be printed out (0, 1, 2, 3).        |                                                                                                          |
31
|                           | Sn (n=0−15) (Scale set)                        | Sets the size of characters to be printed out.                          |                                                                                                          |
32
|                           | D x1, y1. x2, y2... (Draw)                     | Draws a line from current position to (x1,y1), then to (x2,y2), etc..   | Other commands cannot be followed by another command. Use separate LPRINT statements for sequence.        |
33
|                           | J $\Delta x1, \Delta y1, \Delta x2, \Delta y2...$ (Relative draw) | Draws a line from the current position Δx1 horizontally and Δy1 vertically, then Δx2 and Δy2, etc.. | The pen can be moved up to +2047 and −2048 steps in the vertical directions with commands J and R. If exceeded, the printer is reset. |
34
|                           | M x, y (Move)                                  | Moves the pen to position (x,y).                                        |                                                                                                          |
35
|                           | R $\Delta x, \Delta y$ (Relative move)         | Moves the pen Δx horizontally and Δy vertically.                        |                                                                                                          |
36
| Character Print           | P chrs. (Print)                                | Prints out characters.                                                  | Any spaces specified after the commands are ignored.                                                      |
37
38
39
### Paper size and Plotting Area
40
41
| Size | Description | Dimensions (mm) | Plotting Area (mm) |
42
|------|-------------|------------------|---------------------|
43
| Card | Picture postcard size | 150x100 | about 90x60 |
44
| Roll | The roll paper that comes with the plotter | 114 (width) | about 110x80 |
45
| A5 | The size of a page in this book | 210x148 | about 140x95 |
46
| B5 | Notebook paper size | 257x182 | about 180x120 |
47
| A4 | Typing paper size | 296x210 | about 210x140 |
48
49
### Graphics printing area
50
|direction/paper size|100mm (Card) | 114 mm (Roll) | A5 | B5 | A4 |
51
|---|---|---|---|---|---|
52
|x-direction| 410 steps (82mm) | 480 steps (96mm) | 650 steps (130mm) | 820 steps (164mm) | 960 steps (192mm) |
53
|+y-direction| 30 steps (6mm) | - | 30 steps (6mm) | 30 steps (6mm) | 30 steps (6mm)|
54
|-y-direction| 601 steps (120.2mm) | - | 919 steps (183.8mm) | 1149 steps (229.8mm) | 1354 steps (270.8mm)|
55
56
57
58
### Print functions:
59
|Function|Description|
60
|---|---|
61
|Print system|Ball point pen print, 4 colors rotary system|
62
|Driving system|Hybrid x-y plotter|
63
|Graphics print speed|x, y: 57 mm/sec|
64
|Resolution|0.2mm/step|
65
|Character types|252 types|
66
|Character size|0.8 x 1.2 mm to 12.8x19.2mm (16 sizes)|
67
|Number of characters to a line|Max 160 characters (paper size: A4 with minimum character size)|
68
|Character pitch|2.4mm|
69
|Character direction| 4 directions |
70
|Colors| 4 colors (black, blue, green, red)|
71
|Sign| MSX specification Character code |
72
|Precision of repeated printing| less than 0.2mm|
73
|Precision of distance | less +- 1.0% in x and y axes|
74
75
When printing the test page, it prints 80 characters per line on real A4 paper.
76
77
### PRN-C41 27C32 ROM contents
78
79
The dumped European ROM is a 4 KiB 27C32 EPROM.
80
The byte layout matches a plotter vector-font ROM:
81
82
| Address range | Contents |
83
|---|---|
84
| `$0000-$000f` | Small unidentified header / lookup constants. |
85
| `$0010-$010f` | 256-byte monotonic lookup table with values `$02-$0f`; likely scale, spacing, acceleration, or vector timing related. |
86
| `$0110-$020f` | 256-entry glyph offset table. Each byte is the low byte of a glyph record address; the high byte increments whenever the offsets wrap. |
87
| `$0210-$0f9e` | 256 variable-length glyph/vector records, aligned with MSX character codes. Each record ends in a command byte with bit 7 set. |
88
| `$0f9f-$0fff` | Erased/unused EPROM padding (`$ff`). |
89
90
91
The glyph records use chain-code vector commands. Bit 7 marks the final command
92
byte in a glyph record. In the lower 7 bits, bits 6..4 encode vector length as
93
`value + 1`, bit 3 is the pen state (`0` = move, `1` = draw), and bits 2..0
94
select one of eight compass directions. For manual-oriented rendering the ROM
95
X axis must be mirrored: direction code `0` is north, `1` appears north-east,
96
..., and `7` appears north-west on the rendered sheet. The records line up with
97
the plotter character codes, so `$20` is space and `$41` is `A`. Glyphs
98
`$00-$1f` are present too; these are the alternate characters printed with
99
`CHR$(1)` followed by `$40-$5f` as shown in the service-manual character table.
100
For example, glyph `A` uses pen-up move commands (`02`, `10`, `13`) and visible
101
draw commands (`38`, `19`, `1B`, `3C`, `3E`); after the X-axis mirror used for
102
rendering, the `3E` crossbar is a 7-step westward draw that visually stops at
103
the vertical stroke.
104
105
### Dip Switches
106
The printer has four dip switches, which are by factory default all off.
107
108
Switch 1 and 2 are not connected at all according to the service manual.
109
110
Switch 3 is only connected on the Japanese model and selects between JIS and SHIFT-JIS. It is short circuited on non-Japanese models (so GND is on the pin to the chip that makes the selection).
111
112
Switch 4 is called CR/CR,LF. It selects the function of the carriage return code (ODH) in the plotter printer text mode. When it is set to:
113
- ON: the pen position is set to the beginning of the next line.
114
- OFF: the pen position is set to the beginning of the line.
115
116
You may have to set the DIP switches according to your software. Refer to the operating instructions of the software.
117
118
### Buttons
119
The printer has 4 buttons:
120
121
| Button | Function |
122
|---|---|
123
| Reset | Press to reset the plotter printer into the power on status. This button is useful to reset the plotter printer when the printing operation is interrupted. Refer to the software's manual for how to interrupt the printing operation. |
124
| Change Color | Press this button to turn the pen holder and change the printed out characters color. |
125
| Feed | Press this button to feed the paper. |
126
| Feed Back | Press this button to feed the paper back. |
127
128
129
## Examples from Sony PRN-C41 manual
130
131
### All Characters
132
```
133
300 'All Character Font
134
310 LPRINT
135
320 LPRINT CHR$(27);"#"
136
330 LPRINT "S1": LPRINT "A"
137
340 K=0
138
350 FOR J=64 TO 95
139
355 IF (K MOD 16)=0 THEN LPRINT CHR$(27);"C";(K\16) MOD 4
140
360 LPRINT CHR$(1);CHR$(J);
141
370 K=K+1: NEXT J
142
380 FOR J=32 TO 255
143
385 IF (K MOD 16)=0 THEN LPRINT CHR$(27);"C";(K\16) MOD 4
144
390 LPRINT CHR$(J);
145
400 K=K+1: NEXT J
146
410 LPRINT
147
```
148
149
### Squares
150
```
151
100 ' initial Square
152
105 LPRINT
153
110 LPRINT CHR$(27);"#"
154
120 FOR I = 0 TO 3
155
130 LPRINT "C";I
156
140 FOR J=1 TO 2
157
150 LPRINT "J 0,-30,30,0,0,30,-30,0"
158
160 NEXT J
159
170 LPRINT "R42,0"
160
180 NEXT I
161
190 LPRINT "R 0,-30":LPRINT"C0"
162
200 LPRINT "A"
163
```
164
165
### Vertical line
166
```
167
1000 'Vertical Line
168
1005 LPRINT
169
1010 LPRINT CHR$(27);"#"
170
1020 LPRINT "D0,-100"
171
1030 LPRINT "A"
172
```
173
174
### Horizontal line
175
```
176
2000 'Horizontal Line
177
2005 LPRINT
178
2010 LPRINT CHR$(27);"#"
179
2020 LPRINT "D160,0"
180
2030 LPRINT "A"
181
```
182
183
### Oblique line
184
```
185
3000 'Oblique Line
186
3005 LPRINT
187
3010 LPRINT CHR$(27);"#"
188
3020 LPRINT "D100,-100"
189
3030 LPRINT "A"
190
```
191
192
### Square and diagonal
193
```
194
4000 'Square and Oblique Line
195
4005 LPRINT
196
4010 LPRINT CHR$(27);"#"
197
4020 LPRINT "J 0,-160,160,0,0,160,-160,0, 160,-160"
198
4030 LPRINT "A"
199
```
200
201
### Circle
202
```
203
5000 'Circle
204
5005 LPRINT
205
5010 LPRINT CHR$(27);"#"
206
5020 LPRINT "R125,-125"
207
5030 LPRINT "I"
208
5040 LPRINT "M80,0"
209
5050 P=3.14159
210
5060 A=1:B=1
211
5070 FOR R=0 TO 360 STEP 5
212
5080 S=R/180*P
213
5090 SI=INT(SIN(A*S)*80)
214
5100 CO=INT(COS(B*S)*80)
215
5110 LPRINT "D";CO;",";SI
216
5120 NEXT
217
5130 LPRINT "R 0,-125"
218
5140 LPRINT "A"
219
```
220
221
### Doted line
222
```
223
7000 'Doted Line
224
7005 LPRINT
225
7020 LPRINT CHR$(27);"#"
226
7030 LPRINT "C0,L1"
227
7040 LPRINT "J160,0":LPRINT "P Black"
228
7050 LPRINT "R-232,-20"
229
7060 LPRINT "C1,L5"
230
7070 LPRINT "J160,0":LPRINT "P Blue "
231
7080 LPRINT "R-232,-20"
232
7090 LPRINT "C2,L9"
233
7100 LPRINT "J160,0":LPRINT "P Green"
234
7110 LPRINT "R-232,-20"
235
7120 LPRINT "C3,L13"
236
7130 LPRINT "J160,0":LPRINT "P Red  "
237
7140 LPRINT "R-232,-20"
238
7150 LPRINT "C0,L0"
239
7160 LPRINT "A"
240
```
241
242
### Scale Change
243
```
244
8000 'Scale Change"
245
8005 LPRINT
246
8010 LPRINT CHR$(27);"#"
247
8020 FOR I=0 TO 10
248
8030 LPRINT "S";I:LPRINT"PA"
249
8040 NEXT I
250
8050 LPRINT "F"
251
8060 FOR I=11 TO 15
252
8070 LPRINT "S";I:LPRINT"PA"
253
8080 NEXT I
254
8085 LPRINT "S1"
255
8090 LPRINT "A"
256
```
257
258
### Rotate characters
259
```
260
9000 'Rotate
261
9005 LPRINT
262
9010 LPRINT CHR$(27);"#"
263
9020 LPRINT "S9"
264
9030 LPRINT "M80,-100"
265
9040 FOR I=0 TO 3
266
9050 LPRINT "Q";I
267
9060 LPRINT "PA"
268
9070 NEXT I
269
9075 LPRINT "S1"
270
9080 LPRINT "A"
271
```
272
273
### Check pattern
274
```
275
700 'Check
276
710 LPRINT
277
720 LPRINT CHR$(27)+"#"
278
730 LPRINT "I":C=0
279
740 FOR I=1 TO 20
280
750 LPRINT "C";C
281
760 IF I MOD 5=0 THEN C=C+1
282
770 IF C>3 THEN C=0
283
780 LPRINT "J198,0"
284
790 LPRINT "R0,-5"
285
800 LPRINT "J-198,0"
286
810 LPRINT "R0,-5"
287
820 NEXT
288
830 LPRINT "R0,5"
289
840 FOR I=1 TO 20
290
850 LPRINT "C";C
291
860 IF I MOD 5=0 THEN C=C+1
292
870 IF C>3 THEN C=0
293
880 LPRINT "J0,198"
294
890 LPRINT "R5,0"
295
900 LPRINT "J0,-198"
296
910 LPRINT "R5,-0"
297
920 NEXT
298
930 LPRINT "A"
299
```
300
301
### Sinus Curve
302
```
303
10 LPRINT:LPRINT CHR$(&H1B)+"#"
304
20 LPRINT "S1"
305
30 LPRINT "C2"
306
40 LPRINT "P*** SIN CURVE ***"
307
50 LPRINT "F"
308
60 LPRINT "C0"
309
70 LPRINT "R10,0"
310
80 LPRINT "J0,-300"
311
90 LPRINT "R0,150"
312
100 LPRINT "I"
313
110 LPRINT "J450,0"
314
120 LPRINT "H"
315
130 LPRINT "C3"
316
140 FOR J=0 TO 360 STEP 90
317
150 LPRINT "M";J-15;",";-20
318
160 LPRINT "P";J
319
170 NEXT
320
180 LPRINT "H"
321
190 LPRINT "C1"
322
200 FOR X=0 TO 360 STEP 10
323
210 I=X*3.14/180
324
220 Y=SIN(I)*100
325
230 LPRINT "D";X;",";Y
326
240 NEXT X
327
250 LPRINT "H"
328
260 LPRINT "A"
329
270 END
330
```
331
332
### F command rotation bounds test
333
Exercises the F (new line) command in each rotation (Q0..Q3). Each rotation
334
starts near the "far" edge of its feed direction and then fires `P B` + `F`
335
in a loop to push the pen toward the opposite edge. With correct bounds
336
handling the glyphs pile up at the paper edge; without it they walk off
337
the paper.
338
339
Expected edges: rot 1 clamps at X=0, rot 2 at Y=30, rot 3 at X=960; rot 0
340
still flushes to a new page.
341
```
342
10 ' Test F (new line) bounds for each rotation
343
110 LPRINT:LPRINT CHR$(&H1B);"#"
344
120 LPRINT "S2"
345
140 ' --- Rotation 1: feeds X-, start near right edge ---
346
150 LPRINT "H"
347
160 LPRINT "M900,-100"
348
170 LPRINT "Q1"
349
180 FOR I=1 TO 50
350
190 LPRINT "PB"
351
200 LPRINT "F"
352
210 NEXT I
353
230 ' --- Rotation 2: feeds Y+, start near bottom ---
354
240 LPRINT "H"
355
250 LPRINT "M100,-1300"
356
260 LPRINT "Q2"
357
270 FOR I=1 TO 80
358
280 LPRINT "PB"
359
290 LPRINT "F"
360
300 NEXT I
361
320 ' --- Rotation 3: feeds X+, start near left edge ---
362
330 LPRINT "H"
363
340 LPRINT "M50,-200"
364
350 LPRINT "Q3"
365
360 FOR I=1 TO 50
366
370 LPRINT "PB"
367
380 LPRINT "F"
368
390 NEXT I
369
410 ' --- Rotation 0 sanity check: should flush to a new page ---
370
420 LPRINT "H"
371
430 LPRINT "Q0"
372
440 FOR I=1 TO 80
373
450 LPRINT "PB"
374
460 LPRINT "F"
375
470 NEXT I
376
490 LPRINT "A"
377
500 END
378
```
379
380
## Daewoo DPL-400 / Talent DPL-400 (not emulated yet)
381
The command set is almost the same as the Sony PRN-C41(D), but there are some differences. The manual is available, but there is no software that supports this plotter.
382
383
384
## National CF-2311 / Panasonic KX-08P (not emulated yet)
385
No documentation is available for this plotter at the moment. National did release some software for this plotter, but without the manual it is hard to say how it works.