25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_colorplanemask.c,v 1.13 2006/12/30 13:30:57 debug Exp $ |
* $Id: dev_colorplanemask.c,v 1.14 2007/06/15 18:44:19 debug Exp $ |
29 |
* |
* |
30 |
* Color plane mask used by DECstation 3100. |
* COMMENT: Color plane mask, used in the DECstation 3100 machine |
31 |
* |
* |
32 |
* Just a one-byte thingy, but the way things work now this has to |
* Just a one-byte thingy, but the way things work now this has to |
33 |
* be a separate device. :-/ |
* be a separate device. :-/ |
47 |
}; |
}; |
48 |
|
|
49 |
|
|
|
/* |
|
|
* dev_colorplanemask_access(): |
|
|
*/ |
|
50 |
DEVICE_ACCESS(colorplanemask) |
DEVICE_ACCESS(colorplanemask) |
51 |
{ |
{ |
52 |
struct colorplanemask_data *d = (struct colorplanemask_data *) extra; |
struct colorplanemask_data *d = extra; |
53 |
|
|
54 |
switch (relative_addr) { |
switch (relative_addr) { |
55 |
|
|
56 |
case 0x00: |
case 0x00: |
57 |
if (writeflag == MEM_WRITE) { |
if (writeflag == MEM_WRITE) { |
58 |
*d->color_plane_mask = data[0]; |
*d->color_plane_mask = data[0]; |
62 |
data[0] = *d->color_plane_mask; |
data[0] = *d->color_plane_mask; |
63 |
} |
} |
64 |
break; |
break; |
65 |
|
|
66 |
default: |
default: |
67 |
if (writeflag == MEM_WRITE) { |
if (writeflag == MEM_WRITE) { |
68 |
debug("[ colorplanemask: unimplemented write " |
debug("[ colorplanemask: unimplemented write " |
85 |
void dev_colorplanemask_init(struct memory *mem, uint64_t baseaddr, |
void dev_colorplanemask_init(struct memory *mem, uint64_t baseaddr, |
86 |
unsigned char *color_plane_mask) |
unsigned char *color_plane_mask) |
87 |
{ |
{ |
88 |
struct colorplanemask_data *d = |
struct colorplanemask_data *d; |
89 |
malloc(sizeof(struct colorplanemask_data)); |
|
90 |
if (d == NULL) { |
CHECK_ALLOCATION(d = malloc(sizeof(struct colorplanemask_data))); |
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
91 |
memset(d, 0, sizeof(struct colorplanemask_data)); |
memset(d, 0, sizeof(struct colorplanemask_data)); |
92 |
|
|
93 |
d->color_plane_mask = color_plane_mask; |
d->color_plane_mask = color_plane_mask; |
94 |
|
|
95 |
memory_device_register(mem, "colorplanemask", baseaddr, |
memory_device_register(mem, "colorplanemask", baseaddr, |