trunk/src/emu/softlist.c
| r20658 | r20659 | |
| 243 | 243 | } |
| 244 | 244 | } |
| 245 | 245 | |
| 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 | |
| 246 | 257 | struct rom_entry *entry = &part->romdata[swlist->current_rom_entry]; |
| 247 | 258 | |
| 248 | 259 | entry->_name = name; |
| r20658 | r20659 | |
| 690 | 701 | |
| 691 | 702 | add_software_part( swlist, name, interface ); |
| 692 | 703 | |
| 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; |
| 695 | 706 | 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; |
| 699 | 708 | } |
| 700 | 709 | } |
| 701 | 710 | else |
| r20658 | r20659 | |
| 1040 | 1049 | case POS_SOFT: |
| 1041 | 1050 | if ( ! strcmp( name, "part" ) && swlist->softinfo ) |
| 1042 | 1051 | { |
| 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 | } |
| 1045 | 1058 | /* Add shared_info inherited from the software_info level, if any */ |
| 1046 | 1059 | if ( swlist->softinfo && swlist->softinfo->shared_info ) |
| 1047 | 1060 | { |