|
|
1.1 root 1: /* $Header: bitblt_aed.h,v 10.1 86/11/19 10:51:37 jg Exp $ */
2: /* aed.h - Defines and macros needed to support AED
3: *
4: * Author:
5: * Scott Bates
6: * Brown University
7: * IRIS, Box 1946
8: * Providence, RI 02912
9: *
10: *
11: * Copyright (c) 1986 Brown University
12: *
13: * Permission to use, copy, modify and distribute this software and its
14: * documentation for any purpose and without fee is hereby granted, provided
15: * that the above copyright notice appear in all copies, and that both
16: * that copyright notice and this permission notice appear in supporting
17: * documentation, and that the name of Brown University not be used in
18: * advertising or publicity pertaining to distribution of the software
19: * without specific, written prior permission. Brown University makes no
20: * representations about the suitability of this software for any purpose.
21: * It is provided "as-is" without express or implied warranty.
22: */
23:
24: #define AED_BM_ADDR 0xEF100000
25: #define AED_WIDTH 1024
26: #define AED_HEIGHT 800
27: #define AED_BM_SIZE (((((AED_WIDTH/8) * AED_HEIGHT) + 2047) / 2048) * 2048)
28: #define AED_COLOR ((int *)(AED_BM_ADDR + AED_BM_SIZE + 0))
29: #define AED_CMDQ_SEMA (*((int *)(AED_BM_ADDR + AED_BM_SIZE + 4)))
30: #define AED_CMDQ_INDEX (*((int *)(AED_BM_ADDR + AED_BM_SIZE + 8)))
31: #define AED_CMDQ ((struct aed_cmd *)(AED_BM_ADDR + AED_BM_SIZE + 128))
32:
33: #define AED_CMD_SIZE 64 /* size of a command on queue */
34: #define AED_MAX_CMDS ((2048 - 128) / AED_CMD_SIZE)
35:
36: /*
37: * Types of aed commands
38: */
39:
40: #define AED_ECHO_RECT 1
41: #define AED_DRAW_LINE 2
42: #define AED_SCREEN_COPY 3
43:
44: /*
45: * echo a rectangle from the simulated bitmap to the display.
46: */
47:
48: struct aed_echo_rect {
49: short origin_y;
50: short origin_x;
51: short corner_y;
52: short corner_x;
53: };
54:
55: /*
56: * draw a line
57: */
58:
59: struct aed_draw_line {
60: short from_x;
61: short from_y;
62: short to_x;
63: short to_y;
64: short rule;
65: short width;
66: short color;
67: u_short pat;
68: short patlen;
69: short top;
70: short left;
71: short bottom;
72: short right;
73: };
74:
75: /*
76: * screen to screen copy
77: */
78:
79: struct aed_screen_copy {
80: short from_x;
81: short from_y;
82: short to_x;
83: short to_y;
84: short width;
85: short height;
86: short rule;
87: };
88:
89: /*
90: * AED command struct
91: */
92:
93: struct aed_cmd {
94: long cmd;
95: union cmd_block {
96: struct aed_echo_rect echo_rect;
97: struct aed_draw_line draw_line;
98: struct aed_screen_copy screen_copy;
99: } aed_cmd_block;
100: char padding[AED_CMD_SIZE - sizeof(long) - sizeof(union cmd_block)];
101: };
102:
103: #define ECHO_RECT aed_cmd_block.echo_rect
104: #define SCREEN_COPY aed_cmd_block.screen_copy
105: #define DRAW_LINE aed_cmd_block.draw_line
106:
107: /*
108: * map bltter combination rule to AED combination rule
109: */
110:
111: static u_char aed_rules[16] = {
112: 0, 8, 4, 12, 2, 10, 6, 14,
113: 1, 9, 5, 13, 3, 11, 7, 15,
114: };
115:
116: #define AED_RULE(x_rule) (((u_short)aed_rules[x_rule]) & 0x0F)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.