Previous 199869 Revisions Next

r20659 Friday 1st February, 2013 at 22:06:17 UTC by Wilbert Pol
softlist.c: Fix handling of software list entries without any datearea definition. This fixes romident crashing on the cpm set from the c64_cart list. (nw)
[src/emu]softlist.c

trunk/src/emu/softlist.c
r20658r20659
243243      }
244244   }
245245
246   if ( part->romdata == NULL )
247   {
248      /* Allocate initial space to hold the rom information */
249      swlist->rom_entries = 3;
250      part->romdata = (struct rom_entry *)pool_malloc_lib(swlist->pool, swlist->rom_entries * sizeof(struct rom_entry));
251      if ( part->romdata == NULL )
252      {
253         fatalerror("Unable to claim memory for storing a rom entry\n");
254      }
255   }
256
246257   struct rom_entry *entry = &part->romdata[swlist->current_rom_entry];
247258
248259   entry->_name = name;
r20658r20659
690701
691702                  add_software_part( swlist, name, interface );
692703
693                  /* Allocate initial space to hold the rom information */
694                  swlist->rom_entries = 3;
704                  /* Set up rom/dataarea information */
705                  swlist->rom_entries = 0;
695706                  swlist->current_rom_entry = 0;
696                  swlist->softinfo->partdata[swlist->softinfo->current_part_entry-1].romdata = (struct rom_entry *)pool_malloc_lib(swlist->pool, swlist->rom_entries * sizeof(struct rom_entry));
697                  if ( ! swlist->softinfo->partdata[swlist->softinfo->current_part_entry-1].romdata )
698                     return;
707                  swlist->softinfo->partdata[swlist->softinfo->current_part_entry-1].romdata = NULL;
699708               }
700709            }
701710            else
r20658r20659
10401049      case POS_SOFT:
10411050         if ( ! strcmp( name, "part" ) && swlist->softinfo )
10421051         {
1043            /* ROM_END */
1044            add_rom_entry( swlist, NULL, NULL, 0, 0, ROMENTRYTYPE_END );
1052            /* Was any dataarea/rom information encountered? */
1053            if ( swlist->softinfo->partdata[swlist->softinfo->current_part_entry-1].romdata != NULL )
1054            {
1055               /* If so, force a ROM_END */
1056               add_rom_entry( swlist, NULL, NULL, 0, 0, ROMENTRYTYPE_END );
1057            }
10451058            /* Add shared_info inherited from the software_info level, if any */
10461059            if ( swlist->softinfo && swlist->softinfo->shared_info )
10471060            {

Previous 199869 Revisions Next


© 1997-2024 The MAME Team