/[gxemul]/trunk/src/devices/dev_dreamcast_gdrom.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_gdrom.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_gdrom.c,v 1.4 2007/02/03 20:14:23 debug Exp $   *  $Id: dev_dreamcast_gdrom.c,v 1.5 2007/06/15 19:11:15 debug Exp $
29   *     *  
30   *  Dreamcast GD-ROM.   *  COMMENT: Dreamcast GD-ROM
31   *   *
32   *  TODO: This is just a dummy so far.   *  TODO: This is just a dummy so far.
33   */   */
# Line 78  struct dreamcast_gdrom_data { Line 78  struct dreamcast_gdrom_data {
78  static void alloc_data(struct dreamcast_gdrom_data *d)  static void alloc_data(struct dreamcast_gdrom_data *d)
79  {  {
80          d->data_len = d->cnt;          d->data_len = d->cnt;
81          d->data = malloc(d->data_len);  
82          if (d->data == NULL) {          CHECK_ALLOCATION(d->data = malloc(d->data_len));
                 fprintf(stderr, "GDROM alloc_data: out of memory\n");  
                 exit(1);  
         }  
83          memset(d->data, 0, d->data_len);          memset(d->data, 0, d->data_len);
84  }  }
85    
# Line 332  DEVICE_ACCESS(dreamcast_gdrom) Line 329  DEVICE_ACCESS(dreamcast_gdrom)
329    
330  DEVINIT(dreamcast_gdrom)  DEVINIT(dreamcast_gdrom)
331  {  {
332          struct machine *machine = devinit->machine;          struct dreamcast_gdrom_data *d;
333          struct dreamcast_gdrom_data *d =  
334              malloc(sizeof(struct dreamcast_gdrom_data));          CHECK_ALLOCATION(d = malloc(sizeof(struct dreamcast_gdrom_data)));
         if (d == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
335          memset(d, 0, sizeof(struct dreamcast_gdrom_data));          memset(d, 0, sizeof(struct dreamcast_gdrom_data));
336    
337          memory_device_register(machine->memory, devinit->name,          memory_device_register(devinit->machine->memory, devinit->name,
338              0x005f7000, 0x100, dev_dreamcast_gdrom_access, d,              0x005f7000, 0x100, dev_dreamcast_gdrom_access, d,
339              DM_DEFAULT, NULL);              DM_DEFAULT, NULL);
340    

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

  ViewVC Help
Powered by ViewVC 1.1.26