/[gxemul]/trunk/src/devices/dev_bt431.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_bt431.c

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

revision 18 by dpavlin, Mon Oct 8 16:19:11 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2004-2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2004-2007  Anders Gavare.  All rights reserved.
3   *   *
4   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
5   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_bt431.c,v 1.9 2005/10/26 14:37:03 debug Exp $   *  $Id: dev_bt431.c,v 1.13 2007/06/15 18:44:19 debug Exp $
29   *     *  
30   *  Brooktree 431, used by TURBOchannel graphics cards.   *  COMMENT: Brooktree BT431, used by TURBOchannel graphics cards
31   *   *
32   *  TODO.   *  TODO.
33   */   */
# Line 60  struct bt431_data { Line 60  struct bt431_data {
60  };  };
61    
62    
63  /*  DEVICE_ACCESS(bt431)
  *  dev_bt431_access():  
  */  
 int dev_bt431_access(struct cpu *cpu, struct memory *mem,  
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
64  {  {
65          struct bt431_data *d = (struct bt431_data *) extra;          struct bt431_data *d = extra;
66          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
67          int btaddr;          int btaddr;
68  #if 0  #if 0
# Line 203  on = 1; Line 198  on = 1;
198  void dev_bt431_init(struct memory *mem, uint64_t baseaddr,  void dev_bt431_init(struct memory *mem, uint64_t baseaddr,
199          struct vfb_data *vfb_data, int planes)          struct vfb_data *vfb_data, int planes)
200  {  {
201          struct bt431_data *d = malloc(sizeof(struct bt431_data));          struct bt431_data *d;
202          if (d == NULL) {  
203                  fprintf(stderr, "out of memory\n");          CHECK_ALLOCATION(d = malloc(sizeof(struct bt431_data)));
                 exit(1);  
         }  
204          memset(d, 0, sizeof(struct bt431_data));          memset(d, 0, sizeof(struct bt431_data));
205    
206          d->vfb_data     = vfb_data;          d->vfb_data     = vfb_data;
207          d->planes       = planes;          d->planes       = planes;
208          d->cursor_x     = -1;          d->cursor_x     = -1;
# Line 216  void dev_bt431_init(struct memory *mem, Line 210  void dev_bt431_init(struct memory *mem,
210          d->cursor_xsize = d->cursor_ysize = 8;  /*  anything  */          d->cursor_xsize = d->cursor_ysize = 8;  /*  anything  */
211    
212          memory_device_register(mem, "bt431", baseaddr, DEV_BT431_LENGTH,          memory_device_register(mem, "bt431", baseaddr, DEV_BT431_LENGTH,
213              dev_bt431_access, (void *)d, MEM_DEFAULT, NULL);              dev_bt431_access, (void *)d, DM_DEFAULT, NULL);
214  }  }
215    

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

  ViewVC Help
Powered by ViewVC 1.1.26