home *** CD-ROM | disk | FTP | other *** search
/ Dave Lowe: AssemPro For Development Amiga Driver / Lowe_AssemProForDevelopmentAmigaDriver.adf / Includes / devices / prtbase.i < prev    next >
Encoding:
Text File  |  1978-06-06  |  6.3 KB  |  181 lines

  1. ;*******************************************************************
  2. ;               Commodore-Amiga, Inc.                              ;
  3. ;               prtbase.i                                          ;
  4. ;*******************************************************************
  5. ;*******************************************************************
  6. ;
  7. ;  printer device data definition
  8. ;
  9. ;*******************************************************************
  10.  
  11.    IFND  DEVICES_PRTBASE_I@
  12. DEVICES_PRTBASE_I@ EQU   1
  13.  
  14.    IFND  EXEC_NODES_I@
  15.    INCLUDE  "exec/nodes.i"
  16.    ENDIF
  17.    IFND  EXEC_LISTS_I@
  18.    INCLUDE  "exec/lists.i"
  19.    ENDIF
  20.    IFND  EXEC_PORTS_I@
  21.    INCLUDE  "exec/ports.i"
  22.    ENDIF
  23.    IFND  EXEC_LIBRARIES_I@
  24.    INCLUDE  "exec/libraries.i"
  25.    ENDIF
  26.    IFND  EXEC_TASKS_I@
  27.    INCLUDE  "exec/tasks.i"
  28.    ENDIF
  29.  
  30.    IFND  DEVICES_PARALLEL_I@
  31.    INCLUDE  "devices/parallel.i"
  32.    ENDIF
  33.    IFND  DEVICES_SERIAL_I@
  34.    INCLUDE  "devices/serial.i"
  35.    ENDIF
  36.    IFND  DEVICES_TIMER_I@
  37.    INCLUDE  "devices/timer.i"
  38.    ENDIF
  39.    IFND  LIBRARIES_DOSEXTENS_I@
  40.    INCLUDE  "libraries/dosextens.i"
  41.    ENDIF
  42.    IFND  INTUITION_INTUITION_I@
  43.    INCLUDE  "intuition/intuition.i"
  44.    ENDIF
  45.  
  46.  
  47.  STRUCTURE  DeviceData,LIB_SIZE
  48.     APTR dd_Segment           ; A0 when initialized
  49.     APTR dd_ExecBase          ; A6 for exec
  50.     APTR dd_CmdVectors        ; command table for device commands
  51.     APTR dd_CmdBytes          ; bytes describing which command queue
  52.     UWORD   dd_NumCommands    ; the number of commands supported
  53.     LABEL   dd_SIZEOF
  54.  
  55.  
  56. ;------
  57. ;------ device driver private variables ------------------------------
  58. ;------
  59. du_Flags EQU   LN_PRI         ; various unit flags
  60.  
  61. ;------ IO_FLAGS
  62. ;;    BITDEF  IO,QUEUED,4       ; command is queued to be performed
  63. IOB_QUEUED = 4       ; command is queued to be performed
  64. IOF_QUEUED = 1<<4       ; command is queued to be performed
  65. ;    BITDEF  IO,CURRENT,5      ; command is being performed
  66. IOB_CURRENT = 5      ; command is being performed
  67. IOF_CURRENT = 1<<5      ; command is being performed
  68. ;    BITDEF  IO,SERVICING,6    ; command is being actively performed
  69. IOB_SERVICING = 6    ; command is being actively performed
  70. IOF_SERVICING = 1<<6    ; command is being actively performed
  71. ;    BITDEF  IO,DONE,7         ; command is done
  72. IOB_DONE = 7         ; command is done
  73. IOF_DONE = 1<<7         ; command is done
  74.  
  75. ;------ du_Flags
  76. ;    BITDEF  DU,STOPPED,0      ; commands are not to be performed
  77. DUB_STOPPED = 0      ; commands are not to be performed
  78. DUF_STOPPED = 1<<0      ; commands are not to be performed
  79.  
  80.  
  81. ;------ Constants ----------------------------------------------------
  82. P_PRIORITY  EQU         0
  83. P_STKSIZE   EQU         $800
  84.  
  85. ;------ pd_Flags ------
  86. ;   BITDEF   P,IOR0,0          ; IOR0 is in use
  87. PB_IOR0 = 0          ; IOR0 is in use
  88. PF_IOR0 = 1<<0          ; IOR0 is in use
  89. ;   BITDEF   P,IOR1,1          ; IOR1 is in use
  90. PB_IOR1 = 1          ; IOR1 is in use
  91. PF_IOR1 = 1<<1          ; IOR1 is in use
  92. ;   BITDEF   P,EXPUNGED,7      ; device to be expunged when all closed
  93. PB_EXPUNGED = 7      ; device to be expunged when all closed
  94. PF_EXPUNGED = 1<<7      ; device to be expunged when all closed
  95.  
  96.  STRUCTURE  PrinterData,dd_SIZEOF
  97.     STRUCT  pd_Unit,MP_SIZE   ; the one and only unit
  98.     BPTR pd_PrinterSegment    ; the printer specific segment
  99.     UWORD   pd_PrinterType    ; the segment printer type
  100.     APTR pd_SegmentData       ; the segment data structure
  101.     APTR pd_PrintBuf          ; the raster print buffer
  102.     APTR pd_PWrite            ; the parallel write function
  103.     APTR pd_PBothReady        ; the parallel write function's done
  104.  
  105.     IFGT IOEXTPar_SIZE-IOEXTSER_SIZE
  106.     STRUCT  pd_IOR0,IOEXTPar_SIZE   ; port I/O request 0
  107.     STRUCT  pd_IOR1,IOEXTPar_SIZE   ;   and 1 for double buffering
  108.     ENDIF
  109.  
  110.     IFLE IOEXTPar_SIZE-IOEXTSER_SIZE
  111.     STRUCT  pd_IOR0,IOEXTSER_SIZE   ; port I/O request 0
  112.     STRUCT  pd_IOR1,IOEXTSER_SIZE   ;   and 1 for double buffering
  113.     ENDIF
  114.  
  115.     STRUCT  pd_TIOR,IOTV_SIZE       ; timer I/O request
  116.     STRUCT  pd_IORPort,MP_SIZE      ;   and message reply port
  117.     STRUCT  pd_TC,TC_SIZE           ; write task
  118.     STRUCT  pd_Stk,P_STKSIZE        ;   and stack space
  119.     UBYTE   pd_Flags                ; device flags
  120.     UBYTE   pd_pad
  121.     STRUCT  pd_Preferences,pf_SIZEOF ; the latest preferences
  122.     UBYTE      pd_PWaitEnabled      ; wait function switch
  123.     LABEL   pd_SIZEOF               ; warning| this may be odd
  124.  
  125. ;    BITDEF  PPC,GFX,0
  126. PPCB_GFX = 0
  127. PPCF_GFX = 1<<0
  128. ;    BITDEF  PPC,COLOR,1
  129. PPCB_COLOR = 1
  130. PPCF_COLOR = 1<<1
  131.  
  132. PPC_BWALPHA    EQU   0
  133. PPC_BWGFX      EQU   1
  134. PPC_COLORGFX   EQU   3
  135.  
  136. PCC_BW          EQU     1
  137. PCC_YMC         EQU     2
  138. PCC_YMC_BW      EQU     3
  139. PCC_YMCB        EQU     4
  140.  
  141. PCC_4COLOR      EQU     $4      ; a flag for YMCB and BGRW
  142. PCC_ADDITIVE    EQU     $8
  143. PCC_WB          EQU     $9
  144. PCC_BGR         EQU     $a
  145. PCC_BGR_WB      EQU     $b
  146. PCC_BGRW        EQU     $c
  147.  
  148.  STRUCTURE  PrinterExtendedData,0
  149.     APTR    ped_PrinterName   ; printer name, null terminated
  150.     APTR    ped_Init          ; called after LoadSeg
  151.     APTR    ped_Expunge       ; called before UnLoadSeg
  152.     APTR    ped_Open          ; called at OpenDevice
  153.     APTR    ped_Close         ; called at CloseDevice
  154.     UBYTE   ped_PrinterClass  ; printer class
  155.     UBYTE   ped_ColorClass    ; color class
  156.     UBYTE   ped_MaxColumns    ; number of print columns available
  157.     UBYTE   ped_NumCharSets   ; number of character sets
  158.     UWORD   ped_NumRows       ; number of raster rows in a raster dump
  159.     ULONG   ped_MaxXDots      ; number of dots maximum in a raster dump
  160.     ULONG   ped_MaxYDots      ; number of dots maximum in a raster dump
  161.     UWORD   ped_XDotsInch     ; horizontal dot density
  162.     UWORD   ped_YDotsInch     ; vertical dot density
  163.     APTR    ped_Commands      ; printer text command table
  164.     APTR    ped_DoSpecial     ; special command handler
  165.     APTR    ped_Render        ; raster render function
  166.     LONG    ped_TimeoutSecs   ; good write timeout
  167. ;------ the following only exists if the segment version is 33 or greater
  168.     APTR    ped_8BitChars     ; conversion strings for the extended font
  169.     LABEL   ped_SIZEOF
  170.  
  171.  STRUCTURE  PrinterSegment,0
  172.     ULONG   ps_NextSegment    ; (actually a BPTR)
  173.     ULONG   ps_runAlert       ; MOVEQ #0,D0 : RTS
  174.     UWORD   ps_Version        ; segment version
  175.     UWORD   ps_Revision       ; segment revision
  176.     LABEL   ps_PED            ; printer extended data
  177.  
  178.    ENDIF
  179.    END
  180.