/[gxemul]/trunk/src/devices/dev_colorplanemask.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/devices/dev_colorplanemask.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 41 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
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. :-/
# Line 47  struct colorplanemask_data { Line 47  struct colorplanemask_data {
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];
# Line 64  DEVICE_ACCESS(colorplanemask) Line 62  DEVICE_ACCESS(colorplanemask)
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 "
# Line 86  DEVICE_ACCESS(colorplanemask) Line 85  DEVICE_ACCESS(colorplanemask)
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,

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26