APPLICATIONSDIVERS ★ DOING UP OUR DUMPS ★

Screen Dump for Epson (Computing With the Amstrad)Applications Divers
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

ROLAND WADDILOVE updates his screen dump utility

IN the March 1985 Computing with the Amstrad I showed how the screen could be dumped to the printer enabling a hard copy of both text and graphics to be produced. I must admit it is a bit primitive, so I thought it was about time for an update.

The program presented here will produce a large dump - the width of A4 paper and about naif as deep - of a Mode 0 or 1 screen. Each pen is represented by different shades of grey. The Mode 0 dump is in 16 shades and the Mode 1 dump is in four shades.

Unfortunately all printers are different and there's no standard for control codes, so I can guarantee that the dump won't work on some printers. We use Epson FX-80s here in the office and these are about as standard as you can get.

If your printer is Epson compatible there's a good chance of the program working. If it isn't you'll have to substitute different control codes in the assembly listing. Table I shows the codes used.

Program I is a Basic listing with the machine code stored in data statements. If you run this the code is stored above HIM EM which is moved down to &9FFF.

Program II is an assembly listing of the code. If you've got an assembler you can assemble it to a different address if there's a memory clash with any other utilities.

To produce a normal dump of the screen CALL &A000. This is best for graphs and charts, and draws on a white background. Some pictures will look better if drawn on a black background, so CALL & A000,1 for an inverse dump.

How does the dump work? Well it is actually fairly straightforward.

No doubt you are familiar with Basic's SYMBOL command for defining characters to print to the screen - well we can do the same with printers.

Whereas SYMBOL requires eight bytes of data and the character defined is eight pixels wide the printer can accept many bytes of data and the character can be the width of the paper.

If the codes 27,76 are sent to the printer it tells it that the following bytes aren't Ascii codes to print, but are bytes of data instead.

Unidirectional printing27,"U",1
1/36 inch paper feed27,"A”,2
Bit image mode27,"L",n MOD 256,n\256

Table I: Printer control codes used

It needs to know how many bytes to expect, so if we are going to send n bytes of data we send n MOD 256 followed by n\256 to the printer. Then we can send the data which is printed in a similar manner to a user-defined character. So if a byte of 65 was subsequently sent we wouldn't see a letter A printed, we would see a pattern of dots corresponding to binary 65 instead, 01000001. By the way, it is actually printed vertically.

X XXX
XXX X
Data 1 1232

Figure 1: The pattern and data for pen 15

At the end of the assembly listing you'll see a block of data. There are 16 rows of six bytes, numbered from 0 to 15. The dump works by scanning each row of pixels across the screen.

If a pixel colour is pen 0 the six bytes of data in row 0 are sent to the printer. If a pixel is pen 1 the data in row 1 is sent. Pen 2 is row 2, pen 3 is row 3 and so on.

So for each pixel on the screen we send six bytes of data which are then interpreted and printed as a binary pattern.

By altering the data you can alter the pattern printed, hence the shade of grey produced for each pen. Figure 1 shows the data and pattern for pen 15, the last 6 bytes of data in the table.

Since there are 160 pixels across the Mode 0 screen there are 160 x 6 or 960 bytes of data sent per scan. Unfortunately we can't tell the printer to expect 960 MOD 256 + 960\256 bytes of data since 960 MOD 256 is 192 and the Amstrad chops off bit 7, sending 64 instead.

Therefore each row of pixels is split in two so that the number of items of data to send in either section MOD 256 is less than 128. This is why you'll see the printer print about 2/3 of the row, pause slightly and then print the rest.

Since only one row of pixels is scanned at a time the paper feed is reduced so that there aren't any gaps left between lines.

A Mode 1 dump is almost identical to a Mode 0 dump, so the routine looks to see what mode it's in and then modifies itself accordingly.

A mode 2 dump is pretty similar, so I'll leave that up to you.

CWTA

★ PUBLISHER: Computing With The Amstrad
★ YEAR: 198X
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LICENCE: LISTING
★ AUTHOR: ROLAND WADDILOVE

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listings:
  » Screen  Dump  for  Epson    (Computing  with  the  Amstrad)    ENGLISHDATE: 2020-07-24
DL: 29 fois
TYPE: ZIP
SIZE: 4Ko
NOTE: 40 Cyls
.HFE: NON

  » Screen  Dump  for  Epson    (Computing  with  the  Amstrad)    ENGLISH    LISTINGDATE: 2020-07-23
DL: 58 fois
TYPE: text
SIZE: 3Ko

QUE DIT LA LOI FRANÇAISE:

L'alinéa 8 de l'article L122-5 du Code de la propriété intellectuelle explique que « Lorsque l'œuvre a été divulguée, l'auteur ne peut interdire la reproduction d'une œuvre et sa représentation effectuées à des fins de conservation ou destinées à préserver les conditions de sa consultation à des fins de recherche ou détudes privées par des particuliers, dans les locaux de l'établissement et sur des terminaux dédiés par des bibliothèques accessibles au public, par des musées ou par des services d'archives, sous réserve que ceux-ci ne recherchent aucun avantage économique ou commercial ». Pas de problème donc pour nous!

CPCrulez[Content Management System] v8.7-desktop/cache
Page créée en 119 millisecondes et consultée 646 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.