/[gxemul]/trunk/src/devices/dev_dreamcast_asic.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_asic.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_asic.c,v 1.7 2007/02/03 20:14:23 debug Exp $   *  $Id: dev_dreamcast_asic.c,v 1.9 2007/06/15 18:44:19 debug Exp $
29   *     *  
30   *  Dreamcast ASIC.   *  COMMENT: Dreamcast-specific ASIC
31   *   *
32   *  A simple device which forwards various Dreamcast device events as   *  A simple device which forwards various Dreamcast device events as
33   *  interrupts 13, 11, or 9, to the CPU.   *  interrupts 13, 11, or 9, to the CPU.
# Line 70  struct dreamcast_asic_data { Line 70  struct dreamcast_asic_data {
70    
71  DEVICE_TICK(dreamcast_asic)  DEVICE_TICK(dreamcast_asic)
72  {  {
73          struct dreamcast_asic_data *d = (struct dreamcast_asic_data *) extra;          struct dreamcast_asic_data *d = extra;
74          int i, old_asserted_13 = d->asserted_13, old_asserted_11 =          int i, old_asserted_13 = d->asserted_13, old_asserted_11 =
75              d->asserted_11, old_asserted_9 = d->asserted_9;              d->asserted_11, old_asserted_9 = d->asserted_9;
76    
# Line 110  DEVICE_TICK(dreamcast_asic) Line 110  DEVICE_TICK(dreamcast_asic)
110    
111  DEVICE_ACCESS(dreamcast_asic)  DEVICE_ACCESS(dreamcast_asic)
112  {  {
113          struct dreamcast_asic_data *d = (struct dreamcast_asic_data *) extra;          struct dreamcast_asic_data *d = extra;
114          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
115          int r;          int r;
116    
# Line 195  DEVINIT(dreamcast_asic) Line 195  DEVINIT(dreamcast_asic)
195  {  {
196          char tmpstr[300];          char tmpstr[300];
197          struct machine *machine = devinit->machine;          struct machine *machine = devinit->machine;
198          struct dreamcast_asic_data *d =          struct dreamcast_asic_data *d;
             malloc(sizeof(struct dreamcast_asic_data));  
         if (d == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
199    
200            CHECK_ALLOCATION(d = malloc(sizeof(struct dreamcast_asic_data)));
201          memset(d, 0, sizeof(struct dreamcast_asic_data));          memset(d, 0, sizeof(struct dreamcast_asic_data));
202    
203          /*  Connect to SH4 interrupt levels 13, 11, and 9:  */          /*  Connect to SH4 interrupt levels 13, 11, and 9:  */
# Line 219  DEVINIT(dreamcast_asic) Line 215  DEVINIT(dreamcast_asic)
215              SYSASIC_SIZE, dev_dreamcast_asic_access, d, DM_DEFAULT, NULL);              SYSASIC_SIZE, dev_dreamcast_asic_access, d, DM_DEFAULT, NULL);
216    
217          machine_add_tickfunction(devinit->machine, dev_dreamcast_asic_tick, d,          machine_add_tickfunction(devinit->machine, dev_dreamcast_asic_tick, d,
218              DREAMCAST_ASIC_TICK_SHIFT, 0.0);              DREAMCAST_ASIC_TICK_SHIFT);
219    
220          return 1;          return 1;
221  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26