home *** CD-ROM | disk | FTP | other *** search
- unit AmigaPrinter;
-
- INTERFACE
- uses Exec, AmigaDOS, Graphics, Input, Intuition, Parallel, Serial, Timer;
-
-
- type
- pDeviceData = ^tDeviceData;
- tDeviceData = record
- dd_Device: tLibrary;
- dd_Segment: pointer;
- dd_ExecBase: pointer;
- dd_CmdVectors: pointer;
- dd_CmdBytes: pointer;
- dd_NumCommands: word;
- end;
-
- pPrinterSegment = ^tPrinterSegment;
- pPrinterData = ^tPrinterData;
- tPrinterData = record
- pd_Device: tDeviceData;
- pd_Unit: tMsgPort;
- pd_PrinterSegment: BPTR;
- pd_PrinterType: word;
- pd_SegmentData: pPrinterSegment;
- pd_PrintBuf: pbyte;
- pd_PWrite: pointer;
- pd_PBothReady: pointer;
- case integer of
- 0: (
- pd_PIOR0: tIOExtPar;
- pd_PIOR1: tIOExtPar;
- );
- 1: (
- pd_SIOR0: tIOExtSer;
- pd_SIOR1: tIOExtSer;
- pd_TIOR: ttimerequest;
- pd_IORPort: tMsgPort;
- pd_TC: tTask;
- pd_OldStk: array [0..2047] of byte;
- pd_Flags: byte;
- pd_pad: byte;
- pd_Preferences: tPreferences;
- pd_PWaitEnabled: byte;
- pd_Flags1: byte;
- pd_Stk: array [0..4095] of byte;
- );
- end;
-
- pPrinterExtendedData = ^tPrinterExtendedData;
- tPrinterExtendedData = record
- ped_PrinterName: pbyte;
- ped_Init: pointer;
- ped_Expunge: pointer;
- ped_Open: pointer;
- ped_Close: pointer;
- ped_PrinterClass: byte;
- ped_ColorClass: byte;
- ped_MaxColumns: byte;
- ped_NumCharSets: byte;
- ped_NumRows: word;
- ped_MaxXDots: long;
- ped_MaxYDots: long;
- ped_XDotsInch: word;
- ped_YDotsInch: word;
- ped_Commands: pppbyte;
- ped_DoSpecial: pointer;
- ped_Render: pointer;
- ped_TimeoutSecs: longint;
- ped_8BitChars: ppbyte;
- ped_PrintMode: longint;
- ped_ConvFunc: pointer;
- end;
-
- pIOPrtCmdReq = ^tIOPrtCmdReq;
- tIOPrtCmdReq = record
- io_Message: tMessage;
- io_Device: pDevice;
- io_Unit: pUnit;
- io_Command: word;
- io_Flags: byte;
- io_Error: shortint;
- io_PrtCommand: word;
- io_Parm0: byte;
- io_Parm1: byte;
- io_Parm2: byte;
- io_Parm3: byte;
- end;
-
- tPrinterSegment = record
- ps_NextSegment: long;
- ps_runAlert: long;
- ps_Version: word;
- ps_Revision: word;
- ps_PED: tPrinterExtendedData;
- end;
-
- pcolorEntry = ^tcolorEntry;
- tcolorEntry = record
- case integer of
- 0: (
- colorLong: long;
- );
- 1: (
- colorByte: array [0..3] of byte;
- );
- 2: (
- colorSByte: array [0..3] of shortint;
- );
- end;
-
- pIODRPReq = ^tIODRPReq;
- tIODRPReq = record
- io_Message: tMessage;
- io_Device: pDevice;
- io_Unit: pUnit;
- io_Command: word;
- io_Flags: byte;
- io_Error: shortint;
- io_RastPort: pRastPort;
- io_ColorMap: pColorMap;
- io_Modes: long;
- io_SrcX: word;
- io_SrcY: word;
- io_SrcWidth: word;
- io_SrcHeight: word;
- io_DestCols: longint;
- io_DestRows: longint;
- io_Special: word;
- end;
-
- pPrtInfo = ^tPrtInfo;
- tPrtInfo = record
- pi_render: pointer;
- pi_rp: pRastPort;
- pi_temprp: pRastPort;
- pi_RowBuf: pword;
- pi_HamBuf: pword;
- pi_ColorMap: pcolorEntry;
- pi_ColorInt: pcolorEntry;
- pi_HamInt: pcolorEntry;
- pi_Dest1Int: pcolorEntry;
- pi_Dest2Int: pcolorEntry;
- pi_ScaleX: pword;
- pi_ScaleXAlt: pword;
- pi_dmatrix: pbyte;
- pi_TopBuf: pword;
- pi_BotBuf: pword;
- pi_RowBufSize: word;
- pi_HamBufSize: word;
- pi_ColorMapSize: word;
- pi_ColorIntSize: word;
- pi_HamIntSize: word;
- pi_Dest1IntSize: word;
- pi_Dest2IntSize: word;
- pi_ScaleXSize: word;
- pi_ScaleXAltSize: word;
- pi_PrefsFlags: word;
- pi_special: long;
- pi_xstart: word;
- pi_ystart: word;
- pi_width: word;
- pi_height: word;
- pi_pc: long;
- pi_pr: long;
- pi_ymult: word;
- pi_ymod: word;
- pi_ety: integer;
- pi_xpos: word;
- pi_threshold: word;
- pi_tempwidth: word;
- pi_flags: word;
- end;
-
-
-
- const
- PCC_YMCB = 4;
- aSTBM = $40;
- aCAM = $42;
- PCMWHITE = 3;
- P_BUFSIZE = $100;
- SPECIAL_FULLCOLS = 4;
- PCC_BGRW = $C;
- aSBC = $D;
- aSLRM = $41;
- SPECIAL_FRACROWS = $20;
- PPCB_GFX = 0;
- aSLPP = $39;
- aIND = 2;
- aSFC = $C;
- PDERR_DIMENSIONOVFLOW = 5;
- PPCF_GFX = 1;
- PCMBLUE = 0;
- aNEL = 3;
- aPLD = $21;
- PCMCYAN = 2;
- aBMS = $3F;
- aFNT10 = $2C;
- PCC_BGR = $A;
- PRD_QUERY = $C;
- PDERR_TOOKCONTROL = 8;
- P_STKSIZE = $1000;
- PPC_BWALPHA = 0;
- PPC_COLORGFX = 3;
- aTBCALL = $49;
- PCMMAGENTA = 1;
- aRIN = 1;
- aRAW = $4C;
- SPECIAL_MILCOLS = 1;
- aSGR22 = $B;
- aSGR23 = 7;
- aLMS = $3C;
- aSGR24 = 9;
- PRD_DUMPRPORT = $B;
- aRIS = 0;
- aHTS = $43;
- SPECIAL_FULLROWS = 8;
- aPLU = $20;
- aSHORP0 = $E;
- aRMS = $3D;
- SPECIAL_NOFORMFEED = $800;
- aSHORP1 = $10;
- PCC_YMC = 2;
- PCC_4COLOR = 4;
- aSHORP2 = $F;
- aTMS = $3E;
- SPECIAL_DENSITYMASK = $700;
- aSHORP3 = $12;
- PDERR_INTERNALMEMORY = 6;
- PCMRED = 2;
- aSHORP4 = $11;
- PDERR_BADDIMENSION = 4;
- aSHORP5 = $14;
- aSHORP6 = $13;
- aPERF0 = $3B;
- aTBSALL = $4A;
- aTSS = $30;
- PRD_RAWWRITE = 9;
- SPECIAL_ASPECT = $80;
- P_OLDSTKSIZE = $800;
- aVTS = $44;
- SPECIAL_CENTER = $40;
- aEXTEND = $4B;
- aRI = 4;
- SPECIAL_NOPRINT = $2000;
- PDERR_INVERTHAM = 3;
- SPECIAL_DIMENSIONSMASK = $BF;
- PPC_COLORALPHA = 2;
- SPECIAL_MILROWS = 2;
- aDEN1 = $1A;
- aVERP0 = $37;
- PDERR_NOERR = 0;
- PCC_BW = 1;
- PCC_WB = 9;
- aDEN2 = $19;
- aVERP1 = $38;
- aTBC0 = $45;
- aDEN3 = $18;
- aTBC1 = $47;
- aDEN4 = $17;
- SPECIAL_TRUSTME = $1000;
- aDEN5 = $16;
- aPROP0 = $2F;
- aTBC3 = $46;
- aDEN6 = $15;
- aPROP1 = $2E;
- aTBC4 = $48;
- aPROP2 = $2D;
- PPCB_COLOR = 1;
- PPCF_COLOR = 2;
- PCMBLACK = 3;
- PCC_BGR_WB = $B;
- P_SAFESIZE = $80;
- PRD_PRTCOMMAND = $A;
- aFNT0 = $22;
- aFNT1 = $23;
- aJFY0 = $34;
- aFNT2 = $24;
- aJFY1 = $36;
- aFNT3 = $25;
- aSGR0 = 5;
- aFNT4 = $26;
- aJFY3 = $35;
- PDERR_BUFFERMEMORY = 7;
- aSGR1 = $A;
- aFNT5 = $27;
- aFNT6 = $28;
- aJFY5 = $31;
- aSGR3 = 6;
- aFNT7 = $29;
- aJFY6 = $33;
- aSGR4 = 8;
- aFNT8 = $2A;
- aJFY7 = $32;
- aFNT9 = $2B;
- PCC_YMC_BW = 3;
- SPECIAL_FRACCOLS = $10;
- PCC_ADDITIVE = 8;
- PCMGREEN = 1;
- SPECIAL_DENSITY1 = $100;
- PDERR_CANCEL = 1;
- SPECIAL_DENSITY2 = $200;
- SPECIAL_DENSITY3 = $300;
- aSUS0 = $1F;
- SPECIAL_DENSITY4 = $400;
- aSUS1 = $1C;
- SPECIAL_DENSITY5 = $500;
- PCMYELLOW = 0;
- aSUS2 = $1B;
- aPERF = $3A;
- SPECIAL_DENSITY6 = $600;
- aSUS3 = $1E;
- SPECIAL_DENSITY7 = $700;
- aSUS4 = $1D;
- PDERR_NOTGRAPHICS = 2;
- PPC_BWGFX = 1;
- PCC_MULTI_PASS = $10;
-
-
- IMPLEMENTATION
- end.
-