/[gxemul]/trunk/src/devices/dev_adb.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_adb.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_adb.c,v 1.12 2007/01/28 11:29:52 debug Exp $   *  $Id: dev_adb.c,v 1.14 2007/06/15 18:44:18 debug Exp $
29   *   *
30   *  ADB (Apple Desktop Bus) controller.   *  COMMENT: Apple Desktop Bus (ADB) controller
31   *   *
32   *  Based on intuition from reverse-engineering NetBSD/macppc source code,   *  Based on intuition from reverse-engineering NetBSD/macppc source code,
33   *  so it probably only works with that OS.   *  so it probably only works with that OS.
# Line 438  DEVICE_ACCESS(adb) Line 438  DEVICE_ACCESS(adb)
438    
439  DEVINIT(adb)  DEVINIT(adb)
440  {  {
441          struct adb_data *d = malloc(sizeof(struct adb_data));          struct adb_data *d;
442    
443          if (d == NULL) {          CHECK_ALLOCATION(d = malloc(sizeof(struct adb_data)));
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
444          memset(d, 0, sizeof(struct adb_data));          memset(d, 0, sizeof(struct adb_data));
445    
446          INTERRUPT_CONNECT(devinit->interrupt_path, d->irq);          INTERRUPT_CONNECT(devinit->interrupt_path, d->irq);
# Line 453  DEVINIT(adb) Line 450  DEVINIT(adb)
450          memory_device_register(devinit->machine->memory, devinit->name,          memory_device_register(devinit->machine->memory, devinit->name,
451              devinit->addr, DEV_ADB_LENGTH, dev_adb_access, d, DM_DEFAULT, NULL);              devinit->addr, DEV_ADB_LENGTH, dev_adb_access, d, DM_DEFAULT, NULL);
452          machine_add_tickfunction(devinit->machine, dev_adb_tick, d,          machine_add_tickfunction(devinit->machine, dev_adb_tick, d,
453              TICK_SHIFT, 0.0);              TICK_SHIFT);
454    
455          return 1;          return 1;
456  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26