home *** CD-ROM | disk | FTP | other *** search
- { Diese Grafik-Hardcopy-Routine basiert auf Turbo-Pascal mit Grafik-Tool und
- ersetzt HARDCOPY in KERNEL1.SYS. Sie ist fuer die Kombination CPC 6128/
- Riteman F+ angepasst, kippt das Monitorbild um 90 Grad, rueckt es in die
- Mitte einer DIN A4-Seite und beruecksichtigt den Mangel des CPC 6128,
- nur 7 Datenbits an den Drucker zu schicken (aus 8 Bits werden 2 mal
- 4 Bits).
-
- Parameter 1 (inverse): true: Der Ausdruck erfolgt invers
- false: Der Ausdruck erfolgt normal
- Parameter 2 (leer): true: Der Stauchung in Y-Richtung wird durch
- ein Leerpixel ($0) entgegengewirkt
- false: Das aktuelle Pixel wird zweimal gedruckt
- Parameter 3 (mode):
- Der Riteman F+ bietet 7 Modi:
- 0: einfache Dichte 480 Punkte/Zoll
- 1: doppelte Dichte 960 "
- 2: doppelte Dichte und
- doppelte Geschwindigkeit 960 "
- 3: vierfache Dichte 1920 "
- 4: CRT Grafik 640 "
- 5: Plotter Grafik 576 "
- 6: CRT Grafik 720 "
- Von den 7 Moeglichkeiten kommt Modus 5 dem Monitorbild am naechsten.
-
- Musteraufrufe: HardCopy(false, false, 5) --> Doppeldruck
- HardCopy(false, true, 5) --> Leerpixel }
-
- PROCEDURE hardcopy (inverse, leer: BOOLEAN; mode: BYTE);
-
- VAR i, j, top, x1: INTEGER;
- PrintByte, FuellByte: BYTE;
-
- {----------------------------------------------------------------------------}
- { folgende Variablen sowie die Prozedur 'System' und die Funktion 'PD' sind
- n u r notwendig, wenn keine Toolbox zur Verfuegung steht! }
-
- VAR systc: ARRAY[0..5] OF BYTE;
- akku, h, l, d, e, b, c: BYTE;
- hl: INTEGER ABSOLUTE l;
- de: INTEGER ABSOLUTE e;
- bc: INTEGER ABSOLUTE c;
-
-
- PROCEDURE System (address: INTEGER);
-
- BEGIN
- systc[0] := $cd; systc[1] := $5a; systc[2] := $fc;
- systc[3] := Lo(address); systc[4] := Hi(address); systc[5] := $c9;
- InLine($3a/akku/$ed/$4b/bc/$ed/$5b/de/$2a/hl/$cd/systc/
- $32/akku/$ed/$43/bc/$ed/$53/de/$22/hl);
- END;
-
-
- FUNCTION PD (x, y: INTEGER): BOOLEAN;
-
- BEGIN
- hl := (199-y) Shl 1; de := x;
- System($bbf0);
- PD := akku <> 0;
- END;
-
- {----------------------------------------------------------------------------}
- { die eigentliche Hardcopy-Routine: }
-
- PROCEDURE DoLine (top: INTEGER);
-
-
- FUNCTION ConstructByte (j, i: INTEGER): BYTE;
-
- CONST Bits: ARRAY[0..3] OF BYTE = (8, 4, 2, 1);
- VAR CByte, k: BYTE;
-
- BEGIN
- i := i Shl 2; CByte := 0;
- FOR k := 0 TO top DO
- IF PD(i+k,j) THEN
- CByte := CByte OR Bits[k];
- ConstructByte := CByte;
- END;
-
-
- BEGIN { DoLine }
- FOR j := 199 DOWNTO 0 DO
- BEGIN
- CASE j OF
- 199, 136, 73: Write(lst, #$1B#$2A, Chr(mode), #$7E#$00);
- 10: Write(lst, #$1B#$2A, Chr(mode), #$16#$00);
- END;
- PrintByte := ConstructByte(j, i);
- IF inverse THEN
- BEGIN
- PrintByte := NOT PrintByte;
- PrintByte := PrintByte AND 15; { linkes Halbbyte auf Null }
- FuellByte := 15;
- END
- ELSE
- FuellByte := 0;
- IF leer THEN
- Write(lst, Chr(PrintByte), Chr(FuellByte))
- ELSE
- Write(lst, Chr(PrintByte), Chr(PrintByte));
- END;
- Write(lst, #$1B#$4A, Chr(11), #$0D);
- END;
-
-
- BEGIN { HardCopy }
- Write(lst, #$1B#$43#$00, Chr(12)); { Seitenlaenge = 12 Zoll }
- FOR x1 := 1 TO 11 DO
- WriteLn(lst);
- top := 3;
- Write(lst, #$1B#$33, CHR(11)); { Einstellung auf 11/216 Zoll }
- FOR i := 0 TO 159 DO
- BEGIN
- Write(lst, ' ':13);
- DoLine(3);
- END;
- WriteLn(lst, #$1B#$32); { zurueckstellen auf 1/6 Zoll }
- Write(lst, #$0C); { Vorschub auf die naechste Seite }
- END; { HardCopy }