Possible Project - slightly off-topic!

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
siggi
Posts: 885
Joined: Thu May 08, 2008 9:30 am
Location: Dauernheim, Germany
Contact:

Re: Possible Project - slightly off-topic!

Post by siggi » Tue May 23, 2017 4:58 pm

Maybe the Sinclair bus interface could be a simple board, having a Centrronics plug for retroprinter and a Sinclair edge connector, mapping the signals of the Centronics port (of "standard retro printer") to the signals of the Z80 bus. An additional software at retroprinter could probably emulate a sinclair printer via its Centronics connector.
My ZX81 web-server: online since 2007
http://zx81-siggi.endoftheinternet.org/index.html

RWAP
Site Admin
Posts: 1316
Joined: Thu May 08, 2008 8:42 am
Location: Stoke-on-Trent, UK
Contact:

Re: Possible Project - slightly off-topic!

Post by RWAP » Tue May 23, 2017 5:28 pm

siggi wrote:
Tue May 23, 2017 4:58 pm
Maybe the Sinclair bus interface could be a simple board, having a Centrronics plug for retroprinter and a Sinclair edge connector, mapping the signals of the Centronics port (of "standard retro printer") to the signals of the Z80 bus. An additional software at retroprinter could probably emulate a sinclair printer via its Centronics connector.
I think that would be a better option - the market is even more restricted though and does anyone know what data is sent to a ZX Printer?

User avatar
1024MAK
Posts: 2571
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Possible Project - slightly off-topic!

Post by 1024MAK » Tue May 23, 2017 6:13 pm

The ZX81 ROM / Spectrum ROM just sends the bit pattern of the pattern that it wants to print on the printer. So any interface that wants to capture this data would have to work out what, if any characters have been printed. Worse, it would have to wait until enough lines of dot data have been printed before it could "pattern match"...

Not easy :(

So I think it would be better to use a short program which would output ASCII codes. Easy on the Spectrum. The ZX81 version would need to translate the ZX81 character set to ASCII though.

The interface would not have to be fully Centronics compatible. Just need 8 data lines (8 bit latch maybe), a strobe, and maybe able to detect the busy signal from the "printer".

Or use a suitable PIO chip.

Mark

User avatar
siggi
Posts: 885
Joined: Thu May 08, 2008 9:30 am
Location: Dauernheim, Germany
Contact:

Re: Possible Project - slightly off-topic!

Post by siggi » Tue May 23, 2017 7:07 pm

The sinclair printer driver sends the pixel pattern of the characters to the printer: 1 bit for "burning" a pixel, one bit for enabling the motor, 1 bit for paper feed and 1 bit for full/half speed of the printer head. And it reads the status of the printer back (switched off, not connected, and 1 bit for head position steps). Thus the data stream sent by the ZX81 must be processed in real-time!

A text or ZX81 graphic char line (e. g. within the 32 byte printer buffer) is printed as 8 lines of 32 x 8 pixel per line (exactly like the patterns on screen).
Thus the Sinclair printer can also be used for printing HIRES (unlimited number of lines, 256 pixel (or even more???) per line.
The retroprinter could capture that data stream and write it for example into a BMP-file. Thus all Sinclair characters (graphic chars) could be shown (as graphics), not only ASCII chars.

There are printer drivers, written by ZXteam members, which do the same on Centronics "graphic printers": convert the text (and ZX81 graphic chars) into a bitmap graphics (n x 8 lines x 256 pixels/line), which is printed on standard printers as bitmap graphics.

If each bit of the sinclair bitmap is "translated" into "big "pixels of the printer bitmap (e. g. 1 Sinclair pixel -> 8x8 printer pixel), the size of the "picture" printed on the printer can be increased.

Regards
Siggi
My ZX81 web-server: online since 2007
http://zx81-siggi.endoftheinternet.org/index.html

User avatar
siggi
Posts: 885
Joined: Thu May 08, 2008 9:30 am
Location: Dauernheim, Germany
Contact:

Re: Possible Project - slightly off-topic!

Post by siggi » Tue May 23, 2017 7:32 pm

1024MAK wrote:
Tue May 23, 2017 6:13 pm
The ZX81 ROM / Spectrum ROM just sends the bit pattern of the pattern that it wants to print on the printer. So any interface that wants to capture this data would have to work out what, if any characters have been printed. Worse, it would have to wait until enough lines of dot data have been printed before it could "pattern match"...

Not easy :(
To do a "pattern matching" of a "clean" 8x8 pixel pattern is quite easy. Even a ZX81 could do that :mrgreen:
So I think it would be better to use a short program which would output ASCII codes. Easy on the Spectrum. The ZX81 version would need to translate the ZX81 character set to ASCII though.
To use this with standard PRINT/COPY/LLIST commands on a ZX81, a patched ROM would be necessary. OK, I have such a patched ROM, but no one else :mrgreen:
The interface would not have to be fully Centronics compatible. Just need 8 data lines (8 bit latch maybe), a strobe, and maybe able to detect the busy signal from the "printer".

Or use a suitable PIO chip.
The electronics implementing the Centronics interface of the retroprinter has enough and compatible (TTL logic) signals, which could be reused for that ....

Siggi
My ZX81 web-server: online since 2007
http://zx81-siggi.endoftheinternet.org/index.html

User avatar
siggi
Posts: 885
Joined: Thu May 08, 2008 9:30 am
Location: Dauernheim, Germany
Contact:

Re: Possible Project - slightly off-topic!

Post by siggi » Tue May 23, 2017 7:50 pm

I once made an interface to drive a printer (having a long cable to the ZX81), which buffers the signals (see attached PDF).
My Seikosha printer is connected to connector SV1.

The following signals are outputs of the ZX81 and should be connected to inputs on the Centronics interface of retroprinter:
/CS ( = A2 OR /IORQ), /WR, /RD, D1, D2, D7

This signals are read by the ZX81 and should come from (tristate) outputs of the Centronics interface of retroprinter:
D0 and D6

Regards
Siggi
Sinclair-Printer-IF.pdf
(9.22 KiB) Downloaded 81 times
Please note: ST1 is NOT a ZX81 bus connector! I use a ECB-Bus connector in this ZX81, using that printer driver card.
Last edited by siggi on Wed May 24, 2017 11:25 am, edited 1 time in total.
My ZX81 web-server: online since 2007
http://zx81-siggi.endoftheinternet.org/index.html

User avatar
1024MAK
Posts: 2571
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Possible Project - slightly off-topic!

Post by 1024MAK » Tue May 23, 2017 8:24 pm

Converting the bit patterns to a BMP picture file is fair enough. No problem with that :D

The issue I expect with a pattern matching system to convert back to ASCII, is such a interface may not always reliably convert the "printer" output on a ZX Spectrum to ASCII, as it may get confused by a screen copy (with various graphics), or if a program redefined the character set.

It should however work okay if using just using the normal character set.

Mark

RWAP
Site Admin
Posts: 1316
Joined: Thu May 08, 2008 8:42 am
Location: Stoke-on-Trent, UK
Contact:

Re: Possible Project - slightly off-topic!

Post by RWAP » Tue May 23, 2017 8:44 pm

If someone wants to add support they can edit the public domain version of the conversion software - www.github.com/RWAP/PrinterToPDF

If you look at the source code, you will see that it currently interprets Epson printer codes to create a bitmap, which is then converted to a PDF ready for printing (or storage)

It would be nice to be able to generate a mixed PDF containing both text and graphics, but this is not particularly easy based on Epson control codes, and certainly not when trying to take account of the various Epson character tables which are available in ESC/P2 printers.

The current version could quite easily be adapted to work with the scheme described above as provided to a ZX Printer, but it would be much harder to try and convert the bitmap image offered by the Spectrum or ZX81 into actual characters. The idea of the interface is to print to a connected modern printer, so that is not strictly necessary, unless you want to capture the text for some other reason....

kkkllleee
Posts: 3
Joined: Mon Jun 12, 2017 7:05 am

Re: Possible Project - slightly off-topic!

Post by kkkllleee » Mon Jun 12, 2017 7:19 am

Hi, I saw that you were mentioning the character set. Are any of you familiar with the Unicode standard? http://unicode.org/standard/WhatIsUnicode.html I'm working on a proposal to add unencoded semi-graphics that the ZX80 and the ZX81 use: https://en.wikipedia.org/wiki/ZX80_character_set In the code chart it gives references to their Unicode equivalent, but characters 10, 11, 138 and 139 are missing. My question is if the ZX community would benefit from such an encoding and in what way? I'm also really interested in anybody who holds files encoded on such machines which includes the relevant characters.

Thanks in advance.

Post Reply