2 * Copyright (C) 2012, The AROS Development Team. All rights reserved.
3 * Author: Jason S. McMullan <jason.mcmullan@gmail.com>
5 * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1
8 #ifndef AROS_PRINTERTAG_H
9 #define AROS_PRINTERTAG_H
11 #include <devices/prtbase.h>
13 /* .text tag that helps identify this as a printer driver.
14 * by convention, this is a 'return' instruction
17 #define AROS_PRINTER_MAGIC 0x70004e75 /* m68k's moveq #0,%d0, rts */
18 #elif defined(__i386__)
19 #define AROS_PRINTER_MAGIC 0x90c3c031 /* xor %eax,%eax, ret, nop */
20 #elif defined(__x86_64__)
21 #define AROS_PRINTER_MAGIC 0xccc3c031 /* xor %eax,%eax, retq, int3 */
22 #elif defined(__arm__)
23 #define AROS_PRINTER_MAGIC 0xe12fff1e /* bx lr */
24 #elif defined(__ppc__)
25 #define AROS_PRINTER_MAGIC 0x4e800020 /* blr */
27 #error AROS_PRINTER_MAGIC is not defined for your architecture
30 #define AROS_PRINTER_TAG(PED, version, revision, ped...) \
31 __section(".tag.printer") __used static struct { \
35 struct PrinterExtendedData pmh_PED; \
37 .pmh_Magic
= AROS_PRINTER_MAGIC
, \
38 .pmh_Version
= (version
), \
39 .pmh_Revision
= (revision
), \
40 .pmh_PED
= { ped
} }; \
41 struct PrinterExtendedData
*PED
= &__pmh
.pmh_PED
;
43 /* 'status' codes sent to the ped_Render() routine
46 /* PRS_INIT - Initialize page for printing
48 * ct - pointer to IODRPReq
50 * y - height in pixels
54 /* PRS_TRANSFER - Render page row
56 * ct - pointer to PrtInfo
58 * y - row # (0 to height-1)
60 #define PRS_TRANSFER 1
62 /* PRS_FLUSH - Send data to the printer
65 * y - # of rows to send (1 to NumRows)
69 /* PRS_CLEAR - Clear and Init buffer
76 /* PRS_CLOSE - Close down graphics operation,
77 * and go back to text mode
79 * x - io_Special flag from IODRPReq
84 /* PRS_PREINIT - Pre-Master initialization
85 * ct - NULL or pointer to IODRPReq
86 * x - io_Special flag from IODRPReq
91 /* PRS_UNKNOWN - Something that AOS 3.9 sends, unknown?
98 /* PRS_CONVERT - Transfer colormap/BGR line to printer
99 * ct - UBYTE * to an array of entries
100 * x - # of entries in the array
101 * y - 0 if ct is a union colorEntry *, 1 if ct is a BGR pixel line
103 #define PRS_CONVERT 8
105 /* PRS_CORRECT - Color correct a colormap/BGR line
106 * ct - UBYTE * to an array of entries
107 * x - # of entries in the array
108 * y - 0 if ct is a union colorEntry *, 1 if ct is a BGR pixel line
110 #define PRS_CORRECT 9
113 #endif /* AROS_PRINTERTAG_H */