/[gxemul]/trunk/src/devices/dev_dreamcast_g2.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_dreamcast_g2.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_dreamcast_g2.c,v 1.4 2007/02/03 20:14:23 debug Exp $   *  $Id: dev_dreamcast_g2.c,v 1.5 2007/06/15 19:11:15 debug Exp $
29   *     *  
30   *  Dreamcast G2 bus.   *  COMMENT: Dreamcast G2 bus
31   *   *
32   *  Register offsets are from KOS, NetBSD sources, etc.   *  Register offsets are from KOS, NetBSD sources, etc.
33   *   *
# Line 93  struct dreamcast_g2_data { Line 93  struct dreamcast_g2_data {
93    
94  DEVICE_ACCESS(dreamcast_g2)  DEVICE_ACCESS(dreamcast_g2)
95  {  {
96          struct dreamcast_g2_data *d = (struct dreamcast_g2_data *) extra;          struct dreamcast_g2_data *d = extra;
97          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
98    
99          if (writeflag == MEM_WRITE)          if (writeflag == MEM_WRITE)
# Line 155  DEVICE_ACCESS(dreamcast_g2) Line 155  DEVICE_ACCESS(dreamcast_g2)
155    
156  DEVICE_ACCESS(dreamcast_g2_extdma)  DEVICE_ACCESS(dreamcast_g2_extdma)
157  {  {
158          struct dreamcast_g2_data *d = (struct dreamcast_g2_data *) extra;          struct dreamcast_g2_data *d = extra;
159          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
160          int reg = relative_addr, channel = 0;          int reg = relative_addr, channel = 0;
161    
# Line 214  DEVICE_ACCESS(dreamcast_g2_extdma) Line 214  DEVICE_ACCESS(dreamcast_g2_extdma)
214    
215  DEVICE_ACCESS(dreamcast_g2_unknown)  DEVICE_ACCESS(dreamcast_g2_unknown)
216  {  {
217          struct dreamcast_g2_data *d = (struct dreamcast_g2_data *) extra;          struct dreamcast_g2_data *d = extra;
218          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
219    
220          if (writeflag == MEM_WRITE)          if (writeflag == MEM_WRITE)
# Line 274  DEVICE_ACCESS(dreamcast_g2_unknown) Line 274  DEVICE_ACCESS(dreamcast_g2_unknown)
274  DEVINIT(dreamcast_g2)  DEVINIT(dreamcast_g2)
275  {  {
276          struct machine *machine = devinit->machine;          struct machine *machine = devinit->machine;
277          struct dreamcast_g2_data *d = malloc(sizeof(struct dreamcast_g2_data));          struct dreamcast_g2_data *d;
278          if (d == NULL) {  
279                  fprintf(stderr, "out of memory\n");          CHECK_ALLOCATION(d = malloc(sizeof(struct dreamcast_g2_data)));
                 exit(1);  
         }  
280          memset(d, 0, sizeof(struct dreamcast_g2_data));          memset(d, 0, sizeof(struct dreamcast_g2_data));
281    
282          memory_device_register(machine->memory, devinit->name,          memory_device_register(machine->memory, devinit->name,

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

  ViewVC Help
Powered by ViewVC 1.1.26