DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen RC700 "Piccolo"

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RegneCentralen RC700 "Piccolo"

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦7c93c192d⟧ TextFile

    Length: 4736 (0x1280)
    Types: TextFile
    Names: »PRINTER.PAS«

Derivation

└─⟦29e35ddf2⟧ Bits:30003931/CCPM_Tegn.imd Disketter indleveret af Steffen Jensen (Piccolo/Piccoline)
    └─⟦this⟧ »PRINTER.PAS« 

TextFile

procedure l_set(printernr: integer);
begin
  reg.dx:=printernr; reg.cx:=160; swint(224,reg);
end;

function piccoline:boolean;

var
  mxcasette            : array(.1..16.) of char;
  
begin
  for n:=1 to 8 do mxcasette(.n.):='0';
  mxcasette(.9.):='M';
  mxcasette(.10.):='X';
  mxcasette(.11.):='c';
  mxcasette(.12.):='a';
  mxcasette(.13.):='s';
  mxcasette(.14.):='s';
  mxcasette(.15.):=' ';
  mxcasette(.16.):=' ';
  reg.dx:=ofs(mxcasette);
  reg.ds:=seg(mxcasette);
  reg.cx:=135;
  swint(224,reg);
  if reg.ax=0 then piccoline:=true else piccoline:=false;
end;

function printerstatus_ok:boolean;
var
  printer       : text;
  iofejl        : integer;       

begin
  assign(printer,'lst:');
  (*$I-*) reset(printer) (*$I+*);
  iofejl:=iores;
  close(printer);
  if iofejl<>0 then printerstatus_ok:=false else printerstatus_ok:=true;
end;

procedure reserver_printer;

begin
  reg.ax:=41+256;swint($28,reg);
 end;

procedure frigiv_printer;

begin
  reg.ax:=41+512;swint($28,reg);
end;
 
procedure harddump;

var
  scr_xaddr          : array(.0..740.) of integer;
  scr_yaddr          : array(.0..400.) of integer;
  k1,gr_maxxx,tmax,smax,
  txt_maxx,txt_maxy,a,b,
  xmax,ymax          : integer;
  init_ch            : string(.6.);
  gr_str             : string(.4.);
  ii,jj,kk,scr_segm  : integer;    

function get_pixel_config(var xmax,ymax:integer):integer;

const
    xios_int         = $28;
    xios_get_conf    = 4;
var
    screen_type      : ^integer;

begin
    reg.ax :=xios_get_conf;
    swint(xios_int,reg);
    screen_type :=ptr(reg.es,reg.si+18);
    if screen_type^ and 2 = 2 then
      begin (* rc partner *)
        k1:=2;
        xmax:=719;
        ymax:=348;
        gr_maxxx:=704;
        get_pixel_config :=$0F000;
        if piccoline then get_pixel_config:=$0D000;
      end
     else
      begin (* piccoline *)
      k1:=2;
      xmax:=559;
      ymax := 255;
      gr_maxxx:=512;
      get_pixel_config := $0D000;
      end;
end;



begin
   reserver_printer;
   scr_segm:=get_pixel_config(xmax,ymax);
   a:=-gr_maxxx;b:=0;
   for ii:=0 to xmax do begin
     if (ii mod 16)=0 then a:=a+gr_maxxx;
     if (ii mod 8)=0 then if b=1 then b:=0 else b:=1;
     scr_xaddr(.ii.):=a+b;
   end;
   for ii:=0 to ymax do scr_yaddr(.ymax-ii.):=(ii*2);
   if skaerm22khz then txt_maxx:=89 else txt_maxx:=69;
   txt_maxy:=24;
   smax:=(ymax+1)*k1;
   case printertype of
   603,604:begin
             if not skaerm22khz then writeln(lst,chr(27)+'L'+'012');  (*venstre margen*)
             writeln(lst,chr(27)+'T16'+chr(27)+'>'+chr(27)+'E');  (*16/144 lpt - uni-direc - 12 tpt*)
             str(smax:4,gr_str);   (*bit image graphics - antal byte der skal skrives sådan *)
             for ii:=1 to 4 do if gr_str(.ii.)=' ' then gr_str(.ii.):='0';
             init_ch:=chr(27)+'S'+gr_str; tmax:=txt_maxx;
             for ii:=0 to txt_maxx do begin
               write(lst,init_ch);
               for jj:=ymax downto 0 do
                 for kk:=1 to k1 do
                 write(lst,chr(mem(.scr_segm:scr_yaddr(.jj.)+scr_xaddr(.(tmax-ii)*8.).)));
                 writeln(lst);
             end;
             writeln(lst,chr(27)+'c1');
           end;
   606:begin
         writeln(lst,chr(27)+'T16'+chr(27)+'>'+chr(27)+'E');  (*16/144 lpt - uni-direc - 12 tpt*)
         if ymax=255 then init_ch:=chr(27)+'K'+'00'+'01'
                            else init_ch:=chr(27)+'K'+'93'+'01';
         tmax:=txt_maxx;
         for ii:=0 to txt_maxx do begin
           write(lst,init_ch);
           for jj:=ymax downto 0 do
             for kk:=1 to k1 do
             write(lst,chr(mem(.scr_segm:scr_yaddr(.jj.)+scr_xaddr(.(tmax-ii)*8.).)));
             writeln(lst);
         end;
          (* forlad grafikmode ? *)
       end;
   602,605,607,608,609: begin
          writeln(lst,@28);(* 72 dots pr inch *) 
          writeln(lst,chr(27)+chr(45));(* unidirection *)
          init_ch:=chr(3)+chr(14);
          tmax:=txt_maxx;
           write(lst,chr(3));(* sæt grafik mode *)
          for ii:=0 to txt_maxx do 
            begin
            for jj:=ymax-1 downto 0 do
              for kk:=1 to k1 do
              write(lst,chr(mem(.scr_segm:scr_yaddr(.jj.)+scr_xaddr(.(tmax-ii)*8.).)));
              write(lst,init_ch);(*14/144 linefeed og CR*)
            end;
            writeln(lst,@3@2); (* luk grafik mode *)
            writeln(lst,chr(24));(* cancel *)
        end;
        otherwise

    end;
frigiv_printer;
end;   
«eof»