home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 1: Collection A / 17Bit_Collection_A.iso / files / 1036.dms / 1036.adf / PrtDriver / dospecial.c < prev    next >
C/C++ Source or Header  |  1977-12-31  |  2KB  |  83 lines

  1. /* toshiba special commands */
  2.  
  3. #include <exec/types.h>
  4. #include <devices/printer.h>
  5. #include <devices/prtbase.h>
  6.  
  7. extern struct PrinterData *PD;
  8. extern struct PrinterExtendedData *PED;
  9.  
  10. DoSpecial(command,outputBuffer,vline,currentVMI,crlfFlag,Parms)
  11. register UWORD *command;
  12. register char *outputBuffer;
  13. register BYTE *vline;
  14. register BYTE *currentVMI;
  15. register BYTE *crlfFlag;
  16. register UBYTE *Parms;
  17. {
  18.     /* Aztec doesn't preserve a6... we need this in a printer driver */
  19. #asm
  20.     move.l    a6,-(sp)
  21. #endasm
  22.     int result;
  23.  
  24.     dbprintf("DoSpecial:");
  25.  
  26.     switch (*command) {
  27.  
  28.     case aRIN: 
  29.         /* start with initialization string */
  30.  
  31.         strcpy(outputBuffer,"\x1b\x1aI");
  32.  
  33.         /* set to ELITE mode on LETTER or ELITE spacing... */
  34.  
  35.         if (
  36.             (PD->pd_Preferences.PrintQuality == LETTER) ||
  37.             (PD->pd_Preferences.PrintPitch == ELITE)
  38.            )  strcat(outputBuffer,"\x1b*1");
  39.  
  40.         /* set to condensed mode if req'd */
  41.  
  42.             if (PD->pd_Preferences.PrintPitch == FINE)
  43.             strcat(outputBuffer,"\x1b[");
  44.  
  45.         /* this might look backwards but it's not */
  46.         /* the toshiba allows you to specify the spacing */
  47.         /* in 48ths of an inch, 6/48 == 1/8, 8/48 == 1/6 */
  48.  
  49.         if (PD->pd_Preferences.PrintSpacing == SIX_LPI) {
  50.             strcat(outputBuffer,"\x1b\x1e\x08");    /* 8 48ths */
  51.             *currentVMI = 36;
  52.             dbprintf(" VMI=36");
  53.         }
  54.         else {
  55.             strcat(outputBuffer,"\x1b\x1e\x06");    /* 6 48ths */
  56.             *currentVMI = 27;
  57.             dbprintf(" VMI=27");
  58.         }
  59.         dbprintf(" aRIN\n");
  60.         result = strlen(outputBuffer);
  61.         break;
  62.     
  63.  
  64.     case aVERP0:
  65.         *currentVMI=27;
  66.         dbprintf(" VMI=27\n");
  67.         break;
  68.  
  69.     case aVERP1:
  70.         *currentVMI=36;
  71.         dbprintf(" VMI=36\n");
  72.         break;
  73.  
  74.     default:
  75.         dbprintf("req:%d\n",*command);
  76.         break;
  77.     }
  78. #asm
  79.     move.l    (sp)+,a6
  80. #endasm
  81.     return(result);
  82. }
  83.