|
|
1.1 root 1: ;----------------------------Module-Header------------------------------;
2: ; Module Name: ROPTABLE.inc
3: ;
4: ; Raster operation code templates for BitBLT.
5: ;
6: ; Copyright (c) 1988 - 1992 Microsoft Corporation
7: ;
8: ; This file defines the code templates for all raster operations which
9: ; BitBLT supports.
10: ;
11: ; This file is part of a set that makes up the Windows BitBLT function
12: ; at driver-level.
13: ;-----------------------------------------------------------------------;
14:
15:
16: ROPDEF macro lbl,ne,whocares
17: ROP&ne=(offset lbl)-(offset roptable) ;;Start with offset
18: irpc x,lbl
19: ROP&ne = ROP&ne AND (NOT NEGATE_NEEDED)
20: ifidn <n>,<&&x>
21: ROP&ne = ROP&ne OR NEGATE_NEEDED ;;Show negate needed
22: endif
23: ifidn <P>,<&&x>
24: ROP&ne = ROP&ne OR PATTERN_PRESENT ;;Show pattern present
25: endif
26: ifidn <S>,<&&x>
27: ROP&ne = ROP&ne OR SOURCE_PRESENT ;;Show source needed
28: endif
29: endm
30: ROPDEF1 ROP&ne,%((offset $)-(offset lbl))
31: endm
32:
33:
34: ROPDEF1 macro lbl,len
35: lbl = lbl OR (ROPLen&len SHL 10) ;;Set size index
36: endm
37:
38:
39: public roptable
40: roptable label word
41: errn$ roptable ;Must be at offset 0
42: Sn:
43: ROPDEF Sn,0033,0008
44:
45:
46: errn$ roptable ;Must be at offset 0
47:
48: dw ROP0000,ROP0001,ROP0002,ROP0003
49: dw ROP0004,ROP0005,ROP0006,ROP0007
50: dw ROP0008,ROP0009,ROP000A,ROP000B
51: dw ROP000C,ROP000D,ROP000E,ROP000F
52: dw ROP0010,ROP0011,ROP0012,ROP0013
53: dw ROP0014,ROP0015,ROP0016,ROP0017
54: dw ROP0018,ROP0019,ROP001A,ROP001B
55: dw ROP001C,ROP001D,ROP001E,ROP001F
56: dw ROP0020,ROP0021,ROP0022,ROP0023
57: dw ROP0024,ROP0025,ROP0026,ROP0027
58: dw ROP0028,ROP0029,ROP002A,ROP002B
59: dw ROP002C,ROP002D,ROP002E,ROP002F
60: dw ROP0030,ROP0031,ROP0032,ROP0033
61: dw ROP0034,ROP0035,ROP0036,ROP0037
62: dw ROP0038,ROP0039,ROP003A,ROP003B
63: dw ROP003C,ROP003D,ROP003E,ROP003F
64: dw ROP0040,ROP0041,ROP0042,ROP0043
65: dw ROP0044,ROP0045,ROP0046,ROP0047
66: dw ROP0048,ROP0049,ROP004A,ROP004B
67: dw ROP004C,ROP004D,ROP004E,ROP004F
68: dw ROP0050,ROP0051,ROP0052,ROP0053
69: dw ROP0054,ROP0055,ROP0056,ROP0057
70: dw ROP0058,ROP0059,ROP005A,ROP005B
71: dw ROP005C,ROP005D,ROP005E,ROP005F
72: dw ROP0060,ROP0061,ROP0062,ROP0063
73: dw ROP0064,ROP0065,ROP0066,ROP0067
74: dw ROP0068,ROP0069,ROP006A,ROP006B
75: dw ROP006C,ROP006D,ROP006E,ROP006F
76: dw ROP0070,ROP0071,ROP0072,ROP0073
77: dw ROP0074,ROP0075,ROP0076,ROP0077
78: dw ROP0078,ROP0079,ROP007A,ROP007B
79: dw ROP007C,ROP007D,ROP007E,ROP007F
80:
81: errn$ roptable,-256 ;Must be 256 bytes afterwards
82: db 0,2,4,6,8,10,12,14
83:
84:
85:
86:
87:
88: ;-----------------------------------------------------------------
89: ; The actual raster operation templates follow.
90: ;
91: ; Entry: AL = Source byte
92: ; DH = Pattern Bytes
93: ; ES:DI --> Destination byte
94: ;
95: ; Exit: AL = Result
96: ; DH = Pattern Bytes
97: ; DI --> Destination byte
98: ; AH IS possibly the destination byte
99: ;
100: ; Us AL,AH,DH,DL
101: ;-----------------------------------------------------------------
102:
103:
104: DDx:
105: xor al,al
106: ROPDEF DDx,0000,0042
107:
108:
109: DPna:
110: Pn:
111: mov al,dh
112: ROPDEF Pn,000F,0001
113: not al
114: PDSanon:
115: and al,[edi]
116: ROPDEF DPna,000A,0329
117: PSnon:
118: not al
119: DPSona:
120: PSon:
121: or al,dh
122: ROPDEF PDSanon,0008,0F08
123: ROPDEF PSon,0003,00AA
124: ROPDEF PSnon,000C,0324
125: PDSnaon:
126: not al
127: PDSaon:
128: and al,[edi]
129: ROPDEF DPSona,0002,0C89
130: or al,dh
131: ROPDEF PDSnaon,000D,0B25
132: ROPDEF PDSaon,0007,02C5
133:
134:
135: DPon:
136: mov al,dh
137: PDSonon:
138: or al,[edi]
139: ROPDEF DPon,0005,00A9
140: DPSnoon:
141: not al
142: DPSoon:
143: or al,dh
144: ROPDEF PDSonon,000E,08A5
145: DSon:
146: PDSona:
147: or al,[edi]
148: ROPDEF DPSnoon,0004,0C88
149: ROPDEF DPSoon,0001,0289
150: ROPDEF DSon,0011,00A6
151: not al
152: and al,dh
153: ROPDEF PDSona,0010,0C85
154:
155:
156: SDPxnon:
157: mov ah,[edi]
158: xor ah,dh
159: not ah
160: or al,ah
161: ROPDEF SDPxnon,0012,0868
162:
163:
164: SSPxDSxaxn:
165: mov dl,al
166: SPxDSxa:
167: mov ah,dh
168: xor ah,al
169: xor al,[edi]
170: and al,ah
171: ROPDEF SPxDSxa,0024,0D55
172: xor al,dl
173: ROPDEF SSPxDSxaxn,0017,1D54
174:
175:
176: PSDPSanaxx:
177: SDPSanaxn:
178: mov dl,al
179: and al,dh
180: DSna:
181: not al
182: and al,[edi]
183: ROPDEF DSna,0022,0326
184: xor al,dl
185: ROPDEF SDPSanaxn,0019,1CC8
186: xor al,dh
187: ROPDEF PSDPSanaxx,0016,5CCA
188:
189:
190: PDSPanaxn:
191: DPSana:
192: and al,dh
193: PDSnaxn:
194: not al
195: and al,[edi]
196: ROPDEF DPSana,002A,0CC9
197: xor al,dh
198: ROPDEF PDSnaxn,002D,060A
199: ROPDEF PDSPanaxn,0025,1CC5
200:
201:
202:
203:
204: DPSaon:
205: PDSPaox:
206: and al,dh
207: PDSox:
208: or al,[edi]
209: ROPDEF DPSaon,0015,02C9
210: xor al,dh
211: ROPDEF PDSox,001E,01A5
212: ROPDEF PDSPaox,001A,06C5
213:
214:
215: SDPSxaxn:
216: mov dl,al
217: DPSxa:
218: xor al,dh
219: and al,[edi]
220: ROPDEF DPSxa,0028,0369
221: xor al,dl
222: ROPDEF SDPSxaxn,001B,0768
223:
224:
225: DSPDxaxn:
226: mov ah,[edi]
227: mov dl,ah
228: xor dl,dh
229: and al,dl
230: xor al,ah
231: ROPDEF DSPDxaxn,001D,0766
232:
233:
234: DPSnaa:
235: PSna:
236: not al
237: DPSaan:
238: and al,dh
239: ROPDEF PSna,0030,032A
240: and al,[edi]
241: ROPDEF DPSnaa,0020,0F09
242: ROPDEF DPSaan,007F,03C9
243:
244:
245: PSDnaon:
246: mov ah,[edi]
247: not ah
248: and al,ah
249: or al,dh
250: ROPDEF PSDnaon,000B,0B2A
251:
252:
253: SPDnaon:
254: mov ah,[edi]
255: not ah
256: and ah,dh
257: or al,ah
258: ROPDEF SPDnaon,0023,0B24
259:
260:
261: PDSPxaxn:
262: xor al,dh
263: and al,[edi]
264: xor al,dh
265: ROPDEF PDSPxaxn,0027,1868
266:
267:
268: SDPSaox:
269: PSDPSaoxxn:
270: mov dl,al
271: and al,dh
272: or al,[edi]
273: xor al,dl
274: ROPDEF SDPSaox,0026,06C8
275: xor al,dh
276: ROPDEF PSDPSaoxxn,0029,16CA
277:
278:
279: SSPxPDxaxn:
280: mov dl,al
281: SPxPDxa:
282: mov ah,[edi]
283: xor ah,dh
284: xor al,dh
285: and al,ah
286: ROPDEF SPxPDxa,0018,0D59
287: xor al,dl
288: ROPDEF SSPxPDxaxn,002B,1D58
289:
290:
291: DSPDSoaxxn:
292: SPDSoax:
293: mov dl,al
294: PDSoan:
295: mov ah,[edi]
296: or al,ah
297: and al,dh
298: ROPDEF PDSoan,001F,0385
299: xor al,dl
300: ROPDEF SPDSoax,002C,0784
301: xor al,ah
302: ROPDEF DSPDSoaxxn,0079,1786
303:
304:
305:
306:
307: PSDPxox:
308: SDPxon:
309: mov ah,[edi]
310: xor ah,dh
311: or al,ah
312: ROPDEF SDPxon,0021,0248
313: xor al,dh
314: ROPDEF PSDPxox,002E,064A
315:
316:
317: PSDnoan:
318: mov ah,[edi]
319: not ah
320: or al,ah
321: PSan:
322: and al,dh
323: ROPDEF PSan,003F,00EA
324: ROPDEF PSDnoan,002F,0E2A
325:
326:
327: SDPnaon:
328: mov ah,dh
329: not ah
330: and ah,[edi]
331: or al,ah
332: ROPDEF SDPnaon,0031,0B28
333:
334:
335: SDPaon:
336: PSDPaox:
337: mov ah,[edi]
338: and ah,dh
339: or al,ah
340: ROPDEF SDPaon,0013,02C8
341: xor al,dh
342: ROPDEF PSDPaox,001C,06CA
343:
344:
345:
346: SDPSoox:
347: mov dl,al
348: or al,dh
349: or al,[edi]
350: xor al,dl
351: ROPDEF SDPSoox,0032,0688
352:
353:
354: SPDSaox:
355: mov dl,al
356: and al,[edi]
357: or al,dh
358: xor al,dl
359: ROPDEF SPDSaox,0034,06C4
360:
361:
362: DPSDxaxn:
363: mov ah,[edi]
364: xor al,ah
365: and al,dh
366: xor al,ah
367: ROPDEF DPSDxaxn,0035,1864
368:
369:
370: SDPox:
371: mov ah,[edi]
372: or ah,dh
373: xor al,ah
374: ROPDEF SDPox,0036,01A8
375:
376:
377: PSDPoax:
378: SDPoan:
379: mov ah,[edi]
380: or ah,dh
381: and al,ah
382: ROPDEF SDPoan,0037,0388
383: PSx:
384: xor al,dh
385: ROPDEF PSx,003C,004A
386: ROPDEF PSDPoax,0038,078A
387:
388:
389: SPDnox:
390: mov ah,[edi]
391: not ah
392: or ah,dh
393: xor al,ah
394: ROPDEF SPDnox,0039,0604
395:
396:
397: SPDSxox:
398: mov dl,al
399: PDSxon:
400: xor al,[edi]
401: or al,dh
402: ROPDEF PDSxon,0009,0245
403: xor al,dl
404: ROPDEF SPDSxox,003A,0644
405:
406:
407: SPDnoan:
408: mov ah,[edi]
409: not ah
410: or ah,dh
411: and al,ah
412: ROPDEF SPDnoan,003B,0E24
413:
414:
415: SPDSonox:
416: mov dl,al
417: or al,[edi]
418: not al
419: or al,dh
420: xor al,dl
421: ROPDEF SPDSonox,003D,18A4
422:
423:
424: DPSxnan:
425: xor al,dh
426: SPDSnaox:
427: mov dl,al ;(wasted for DPSxnan)
428: not al
429: and al,[edi]
430: ROPDEF DPSxnan,007D,0C69
431: or al,dh
432: xor al,dl
433: ROPDEF SPDSnaox,003E,1B24
434:
435:
436: SPDSanaxn:
437: mov dl,al
438: PDSana:
439: DSan:
440: and al,[edi]
441: ROPDEF DSan,0077,00E6
442: not al
443: and al,dh
444: ROPDEF PDSana,0070,0CC5
445: xor al,dl
446: ROPDEF SPDSanaxn,0043,1CC4
447:
448:
449: PSDPxaxn:
450: SDPxa:
451: mov ah,[edi]
452: xor ah,dh
453: and al,ah
454: ROPDEF SDPxa,0048,0368
455: xor al,dh
456: ROPDEF PSDPxaxn,0047,076A
457:
458:
459: DSPDaox:
460: PDSPDaoxxn:
461: mov ah,[edi]
462: mov dl,ah
463: and dl,dh
464: or al,dl
465: xor al,ah
466: ROPDEF DSPDaox,0046,06C6
467: xor al,dh
468: ROPDEF PDSPDaoxxn,0049,16C5
469:
470: DPSDoax:
471: mov ah,[edi]
472: or al,ah
473: and al,dh
474: xor al,ah
475: ROPDEF DPSDoax,004A,0789
476:
477:
478: DPSanon:
479: and al,dh
480: PDSnox:
481: DSnon:
482: not al
483: or al,[edi]
484: ROPDEF DPSanon,0040,0F0A
485: ROPDEF DSnon,0044,0328
486: xor al,dh
487: ROPDEF PDSnox,004B,0605
488:
489:
490: SDPana:
491: mov ah,[edi]
492: and ah,dh
493: not ah
494: and al,ah
495: ROPDEF SDPana,004C,0CC8
496:
497:
498: SSPxDSxoxn:
499: mov dl,al
500: SPxDSxo:
501: mov ah,al
502: xor ah,dh
503: xor al,[edi]
504: or al,ah
505: ROPDEF SPxDSxo,007E,0955
506: xor al,dl
507: ROPDEF SSPxDSxoxn,004D,1954
508:
509:
510: PDSPxox:
511: DPSxon:
512: xor al,dh
513: or al,[edi]
514: ROPDEF DPSxon,0041,0249
515: xor al,dh
516: ROPDEF PDSPxox,004E,0645
517:
518:
519: PDna:
520: Dn:
521: mov al,[edi]
522: ROPDEF Dn,0055,0009
523: not al
524: and al,dh
525: ROPDEF PDna,0050,0325
526:
527:
528: DPSDaox:
529: mov ah,[edi]
530: and al,ah
531: or al,dh
532: xor al,ah
533: ROPDEF DPSDaox,0052,06C9
534:
535:
536: SPDSxaxn:
537: mov dl,al
538: PDSxa:
539: xor al,[edi]
540: and al,dh
541: ROPDEF PDSxa,0060,0365
542: xor al,dl
543: ROPDEF SPDSxaxn,0053,0764
544:
545:
546: DPx:
547: mov al,dh
548: PDSxnon:
549: xor al,[edi]
550: ROPDEF DPx,005A,0049
551: DPSnoan:
552: not al
553: PDSPoax:
554: DPSoan:
555: or al,dh
556: ROPDEF PDSxnon,0006,0865
557: PDSax:
558: and al,[edi]
559: ROPDEF DPSnoan,005D,0E29
560: ROPDEF DPSoan,0057,0389
561: xor al,dh
562: ROPDEF PDSPoax,0058,0785
563: ROPDEF PDSax,0078,01E5
564:
565:
566: DPSnox:
567: not al
568: DPSox:
569: or al,dh
570: PDSxnan:
571: xor al,[edi]
572: ROPDEF DPSox,0056,01A9
573: ROPDEF DPSnox,0059,0609
574: not al
575: and al,dh
576: ROPDEF PDSxnan,006F,0C65
577:
578:
579: DPSDonox:
580: mov ah,[edi]
581: or al,ah
582: not al
583: or al,dh
584: xor al,ah
585: ROPDEF DPSDonox,005B,18A9
586:
587:
588: DPSDxox:
589: mov ah,[edi]
590: xor al,ah
591: or al,dh
592: xor al,ah
593: ROPDEF DPSDxox,005C,0649
594:
595:
596: DSPnaon:
597: PDSPnaox:
598: mov ah,dh
599: not ah
600: and al,ah
601: or al,[edi]
602: ROPDEF DSPnaon,0051,0B26
603: xor al,dh
604: ROPDEF PDSPnaox,005E,1B29
605:
606:
607: DPan:
608: mov al,dh
609: and al,[edi]
610: ROPDEF DPan,005F,00E9
611:
612:
613: DSPDSaoxxn:
614: mov dl,al
615: mov ah,[edi]
616: and al,ah
617: or al,dh
618: xor al,dl
619: xor al,ah
620: ROPDEF DSPDSaoxxn,0061,16C6
621:
622:
623: SDPnox:
624: mov ah,dh
625: not ah
626: or ah,[edi]
627: xor al,ah
628: ROPDEF SDPnox,0063,0608
629:
630:
631: DPSnaxn:
632: not al
633: DPSax:
634: and al,dh
635: DSx:
636: PDSxxn:
637: xor al,[edi]
638: ROPDEF DSx,0066,0046
639: ROPDEF DPSax,006A,01E9
640: ROPDEF DPSnaxn,0065,0606
641: xor al,dh
642: ROPDEF PDSxxn,0069,0145
643:
644:
645: SDPSonox:
646: PSDPSonoxxn:
647: mov dl,al
648: DPSonon:
649: or al,dh
650: not al
651: or al,[edi]
652: ROPDEF DPSonon,0054,08A9
653: xor al,dl
654: ROPDEF SDPSonox,0067,18A8
655: xor al,dh
656: ROPDEF PSDPSonoxxn,0068,58A6
657:
658:
659: SDPSoax:
660: PSDPSoaxxn:
661: mov dl,al
662: or al,dh
663: and al,[edi]
664: xor al,dl
665: ROPDEF SDPSoax,0064,0788
666: xor al,dh
667: ROPDEF PSDPSoaxxn,006B,178A
668:
669:
670: SDPax:
671: mov ah,[edi]
672: and ah,dh
673: xor al,ah
674: ROPDEF SDPax,006C,01E8
675:
676:
677: DSPDoax:
678: PDSPDoaxxn:
679: mov ah,[edi]
680: mov dl,ah
681: or ah,dh
682: and al,ah
683: xor al,dl
684: ROPDEF DSPDoax,0062,0786
685: xor al,dh
686: ROPDEF PDSPDoaxxn,006D,1785
687:
688:
689: SDPSnoax:
690: mov dl,al
691: not al
692: or al,dh
693: and al,[edi]
694: xor al,dl
695: ROPDEF SDPSnoax,006E,1E28
696:
697:
698: SSDxPDxaxn:
699: mov dl,al
700: SDxPDxa:
701: mov ah,[edi]
702: xor al,ah
703: xor ah,dh
704: and al,ah
705: ROPDEF SDxPDxa,0042,0D5D
706: xor al,dl
707: ROPDEF SSDxPDxaxn,0071,1D5C
708:
709:
710: SDPSxox:
711: mov dl,al
712: xor al,dh
713: or al,[edi]
714: xor al,dl
715: ROPDEF SDPSxox,0072,0648
716:
717:
718: SDPnoan:
719: mov ah,dh
720: not ah
721: or ah,[edi]
722: and al,ah
723: ROPDEF SDPnoan,0073,0E28
724:
725:
726: DSPDxox:
727: mov ah,[edi]
728: mov dl,ah
729: xor ah,dh
730: or al,ah
731: xor al,dl
732: ROPDEF DSPDxox,0074,0646
733:
734:
735: SDPSnaox:
736: mov dl,al
737: DPSnaon:
738: not al
739: and al,dh
740: or al,[edi]
741: ROPDEF DPSnaon,0045,0B29
742: xor al,dl
743: ROPDEF SDPSnaox,0076,1B28
744:
745:
746: DSPnoan:
747: PDSPnoax:
748: mov ah,dh
749: not ah
750: or al,ah
751: and al,[edi]
752: ROPDEF DSPnoan,0075,0E26
753: DPSxnon:
754: xor al,dh
755: ROPDEF PDSPnoax,007A,1E29
756: PDSnoan:
757: SPDSnoax:
758: mov dl,al ;(wasted for DPSxnon)
759: not al
760: or al,[edi]
761: ROPDEF DPSxnon,0014,0869
762: and al,dh
763: ROPDEF PDSnoan,004F,0E25
764: xor al,dl
765: ROPDEF SPDSnoax,007C,1E24
766:
767: SDPxnan:
768: mov ah,[edi]
769: xor ah,dh
770: not ah
771: and al,ah
772: ROPDEF SDPxnan,007B,0C68
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.