Previous 15994 Revisions Next

r10036 Friday 14th January, 2011 at 13:20:33 UTC by Fabio Priuli
- added WARNING if loading a software with supported="partial" or "no"
- replaced a few printf with mame_printf_error
[src/emu]devimage.c romload.c romload.h softlist.c softlist.h
[src/mess/machine]nes.c snescart.c

src/emu/romload.c
r10035r10036
12871287
12881288
12891289/*-------------------------------------------------
1290    software_get_clone - retrive name string of the
1291    parent software, if any
1292 -------------------------------------------------*/
1293
1294const char *software_get_clone(char *swlist, const char *swname)
1295{
1296   software_list *software_list_ptr = software_list_open(mame_options(), swlist, FALSE, NULL);
1297
1298   if (software_list_ptr)
1299   {
1300      software_info *tmp = software_list_find(software_list_ptr, swname, NULL);
1301      return tmp->parentname;
1302   }
1303
1304   return NULL;
1305}
1306
1307/*-------------------------------------------------
13081290    load_software_part_region - load a software part
13091291
13101292    This is used by MESS when loading a piece of
r10035r10036
13541336
13551337   romdata->errorstring.reset();
13561338
1339   if (software_get_support(swlist, swname) == SOFTWARE_SUPPORTED_PARTIAL)
1340   {
1341      romdata->errorstring.catprintf("WARNING: support for software %s (in list %s) is only partial\n", swname, swlist);
1342      romdata->warnings++;
1343   }
1344   if (software_get_support(swlist, swname) == SOFTWARE_SUPPORTED_NO)
1345   {
1346      romdata->errorstring.catprintf("WARNING: support for software %s (in list %s) is only preliminary\n", swname, swlist);
1347      romdata->warnings++;
1348   }
1349   
13571350   /* loop until we hit the end */
13581351   for (region = start_region; region != NULL; region = rom_next_region(region))
13591352   {
src/emu/romload.h
r10035r10036
282282
283283file_error common_process_file_options(core_options *options, const char *location, const char *ext, const rom_entry *romp, mame_file **image_file);
284284file_error common_process_file(const char *location, bool has_crc, UINT32 crc, const rom_entry *romp, mame_file **image_file);
285const char *software_get_clone(char *swlist, const char *swname);
286285
286
287287/* ----- ROM iteration ----- */
288288
289289/* return pointer to first ROM source */
src/emu/softlist.c
r10035r10036
819819
820820
821821/*-------------------------------------------------
822    software_get_clone - retrive name string of the
823    parent software, if any
824 -------------------------------------------------*/
825
826const char *software_get_clone(char *swlist, const char *swname)
827{
828   software_list *software_list_ptr = software_list_open(mame_options(), swlist, FALSE, NULL);
829   
830   if (software_list_ptr)
831   {
832      software_info *tmp = software_list_find(software_list_ptr, swname, NULL);
833      return tmp->parentname;
834   }
835   
836   return NULL;
837}
838
839
840/*-------------------------------------------------
841    software_get_support - retrive support state of
842    the software
843 -------------------------------------------------*/
844
845UINT32 software_get_support(char *swlist, const char *swname)
846{
847   software_list *software_list_ptr = software_list_open(mame_options(), swlist, FALSE, NULL);
848   
849   if (software_list_ptr)
850   {
851      software_info *tmp = software_list_find(software_list_ptr, swname, NULL);
852      return tmp->supported;
853   }
854   
855   return 0;
856}
857
858
859/*-------------------------------------------------
822860    software_list_parse
823861-------------------------------------------------*/
824862
src/emu/softlist.h
r10035r10036
6464software_part *software_find_part(software_info *sw, const char *partname, const char *interface_);
6565software_part *software_part_next(software_part *part);
6666
67/* helpers */
68const char *software_get_clone(char *swlist, const char *swname);
69UINT32 software_get_support(char *swlist, const char *swname);
6770
6871bool load_software_part(device_image_interface *image, const char *path, software_info **sw_info, software_part **sw_part, char **full_sw_name);
6972
src/emu/devimage.c
r10035r10036
348348               software_list_close(software_list_ptr);
349349            }
350350
351            if (software_get_support(swlist, swname) == SOFTWARE_SUPPORTED_PARTIAL)
352               mame_printf_error("WARNING: support for software %s (in list %s) is only partial\n", swname, swlist);
353
354            if (software_get_support(swlist, swname) == SOFTWARE_SUPPORTED_NO)
355               mame_printf_error("WARNING: support for software %s (in list %s) is only preliminary\n", swname, swlist);
356           
351357            // check if locationtag actually contains two locations separated by '%'
352358            // (i.e. check if we are dealing with a clone in softwarelist)
353359            astring tag2, tag3, tag4(locationtag), tag5;
src/mess/machine/nes.c
r10035r10036
5050   /* Brutal hack put in as a consequence of the new memory system; we really need to fix the NES code */
5151   memory_install_readwrite_bank(space, 0x0000, 0x07ff, 0, 0x1800, "bank10");
5252
53   memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, nes_chr_r, nes_chr_w);
54   memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, nes_nt_r, nes_nt_w);
53   memory_install_readwrite8_handler(device_get_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, nes_chr_r, nes_chr_w);
54   memory_install_readwrite8_handler(device_get_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, nes_nt_r, nes_nt_w);
5555
5656   memory_set_bankptr(machine, "bank10", state->rom);
5757
r10035r10036
710710               state->prg_chunks = mapint3;
711711               state->chr_chunks = mapint4;
712712               logerror("NES.HSI info: %d %d %d %d\n", mapint1, mapint2, mapint3, mapint4);
713//                  printf("NES.HSI info: %d %d %d %d\n", mapint1, mapint2, mapint3, mapint4);
713//                  mame_printf_error("NES.HSI info: %d %d %d %d\n", mapint1, mapint2, mapint3, mapint4);
714714               goodcrcinfo = 1;
715715               state->ines20 = 0;
716716            }
r10035r10036
725725         }
726726
727727         state->hard_mirroring = (local_options & 0x01) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ;
728//          printf("%s\n", state->hard_mirroring & 0x01 ? "Vertical" : "Horizontal");
728//          mame_printf_error("%s\n", state->hard_mirroring & 0x01 ? "Vertical" : "Horizontal");
729729         state->battery = local_options & 0x02;
730730         state->trainer = local_options & 0x04;
731731         state->four_screen_vram = local_options & 0x08;
r10035r10036
930930            if (prgout)
931931            {
932932               fwrite(&state->rom[0x10000], 1, 0x4000 * state->prg_chunks, prgout);
933               printf("Created PRG chunk\n");
933               mame_printf_error("Created PRG chunk\n");
934934            }
935935
936936            fclose(prgout);
r10035r10036
940940         logerror("**\n");
941941         logerror("Mapper: %d\n", state->mapper);
942942         logerror("PRG chunks: %02x, size: %06x\n", state->prg_chunks, 0x4000 * state->prg_chunks);
943         // printf("Mapper: %d\n", state->mapper);
944         // printf("PRG chunks: %02x, size: %06x\n", state->prg_chunks, 0x4000 * state->prg_chunks);
943         // mame_printf_error("Mapper: %d\n", state->mapper);
944         // mame_printf_error("PRG chunks: %02x, size: %06x\n", state->prg_chunks, 0x4000 * state->prg_chunks);
945945
946946         /* Read in any chr chunks */
947947         if (state->chr_chunks > 0)
r10035r10036
962962            if (chrout)
963963            {
964964               fwrite(state->vrom, 1, 0x2000 * state->chr_chunks, chrout);
965               printf("Created CHR chunk\n");
965               mame_printf_error("Created CHR chunk\n");
966966            }
967967            fclose(chrout);
968968         }
r10035r10036
970970
971971         logerror("CHR chunks: %02x, size: %06x\n", state->chr_chunks, 0x2000 * state->chr_chunks);
972972         logerror("**\n");
973         // printf("CHR chunks: %02x, size: %06x\n", state->chr_chunks, 0x2000 * state->chr_chunks);
974         // printf("**\n");
973         // mame_printf_error("CHR chunks: %02x, size: %06x\n", state->chr_chunks, 0x2000 * state->chr_chunks);
974         // mame_printf_error("**\n");
975975      }
976976      else if ((magic[0] == 'U') && (magic[1] == 'N') && (magic[2] == 'I') && (magic[3] == 'F')) /* If header starts with 'UNIF' it is UNIF */
977977      {
r10035r10036
12851285            if (prgout)
12861286            {
12871287               fwrite(&state->rom[0x10000], 1, 0x4000 * state->prg_chunks, prgout);
1288               printf("Created PRG chunk\n");
1288               mame_printf_error("Created PRG chunk\n");
12891289            }
12901290
12911291            fclose(prgout);
r10035r10036
13031303            if (chrout)
13041304            {
13051305               fwrite(state->vrom, 1, 0x2000 * state->chr_chunks, chrout);
1306               printf("Created CHR chunk\n");
1306               mame_printf_error("Created CHR chunk\n");
13071307            }
13081308            fclose(chrout);
13091309         }
r10035r10036
14421442         state->vrc_ls_prg_a = nes_cart_get_line(image.get_feature("vrc2-pin3"));
14431443         state->vrc_ls_prg_b = nes_cart_get_line(image.get_feature("vrc2-pin4"));
14441444         state->vrc_ls_chr = (nes_cart_get_line(image.get_feature("vrc2-pin21")) != 10) ? 1 : 0;
1445//          printf("VRC-2, pin3: A%d, pin4: A%d, pin21: %s\n", state->vrc_ls_prg_a, state->vrc_ls_prg_b, state->vrc_ls_chr ? "NC" : "A10");
1445//          mame_printf_error("VRC-2, pin3: A%d, pin4: A%d, pin21: %s\n", state->vrc_ls_prg_a, state->vrc_ls_prg_b, state->vrc_ls_chr ? "NC" : "A10");
14461446      }
14471447
14481448      if (state->pcb_id == KONAMI_VRC4)
14491449      {
14501450         state->vrc_ls_prg_a = nes_cart_get_line(image.get_feature("vrc4-pin3"));
14511451         state->vrc_ls_prg_b = nes_cart_get_line(image.get_feature("vrc4-pin4"));
1452//          printf("VRC-4, pin3: A%d, pin4: A%d\n", state->vrc_ls_prg_a, state->vrc_ls_prg_b);
1452//          mame_printf_error("VRC-4, pin3: A%d, pin4: A%d\n", state->vrc_ls_prg_a, state->vrc_ls_prg_b);
14531453      }
14541454
14551455      if (state->pcb_id == KONAMI_VRC6)
14561456      {
14571457         state->vrc_ls_prg_a = nes_cart_get_line(image.get_feature("vrc6-pin9"));
14581458         state->vrc_ls_prg_b = nes_cart_get_line(image.get_feature("vrc6-pin10"));
1459//          printf("VRC-6, pin9: A%d, pin10: A%d\n", state->vrc_ls_prg_a, state->vrc_ls_prg_b);
1459//          mame_printf_error("VRC-6, pin9: A%d, pin10: A%d\n", state->vrc_ls_prg_a, state->vrc_ls_prg_b);
14601460      }
14611461
14621462      /* Check for other misc board variants */
r10035r10036
14831483
14841484#if 0
14851485      if (state->pcb_id == UNSUPPORTED_BOARD)
1486         printf("This board (%s) is currently not supported by MESS\n", image.get_feature("pcb"));
1487      printf("PCB Feature: %s\n", image.get_feature("pcb"));
1488      printf("PRG chunks: %d\n", state->prg_chunks);
1489      printf("CHR chunks: %d\n", state->chr_chunks);
1490      printf("VRAM: Present %s, size: %d\n", state->vram_chunks ? "Yes" : "No", vram_size);
1491      printf("NVWRAM: Present %s, size: %d\n", state->battery ? "Yes" : "No", state->battery_size);
1492      printf("WRAM:   Present %s, size: %d\n", state->prg_ram ? "Yes" : "No", state->wram_size);
1486         mame_printf_error("This board (%s) is currently not supported by MESS\n", image.get_feature("pcb"));
1487      mame_printf_error("PCB Feature: %s\n", image.get_feature("pcb"));
1488      mame_printf_error("PRG chunks: %d\n", state->prg_chunks);
1489      mame_printf_error("CHR chunks: %d\n", state->chr_chunks);
1490      mame_printf_error("VRAM: Present %s, size: %d\n", state->vram_chunks ? "Yes" : "No", vram_size);
1491      mame_printf_error("NVWRAM: Present %s, size: %d\n", state->battery ? "Yes" : "No", state->battery_size);
1492      mame_printf_error("WRAM:   Present %s, size: %d\n", state->prg_ram ? "Yes" : "No", state->wram_size);
14931493#endif
14941494   }
14951495
src/mess/machine/snescart.c
r10035r10036
573573         {
574574            state->has_addon_chip = HAS_SA1;
575575            supported_type = 0;
576            printf("This is a SA-1 type game, currently unsupported by the driver");
576            mame_printf_error("This is a SA-1 type game, currently unsupported by the driver\n");
577577         }
578578         break;
579579
r10035r10036
765765   else
766766      memcpy(ROM, image.get_software_region("rom") + offset, state->cart_size - offset);
767767
768   if (SNES_CART_DEBUG) printf("size %08X\n", state->cart_size - offset);
768   if (SNES_CART_DEBUG) mame_printf_error("size %08X\n", state->cart_size - offset);
769769
770770   /* First, look if the cart is HiROM or LoROM (and set snes_cart accordingly) */
771771   int_header_offs = snes_find_hilo_mode(image, ROM, offset, 0);
r10035r10036
824824         st_bios = 1;
825825   }
826826
827   if (SNES_CART_DEBUG) printf("mode %d\n", state->cart[0].mode);
827   if (SNES_CART_DEBUG) mame_printf_error("mode %d\n", state->cart[0].mode);
828828
829829   /* FIXME: Insert crc check here? */
830830
r10035r10036
832832   total_blocks = ((state->cart_size - offset) / (state->cart[0].mode & 0xa5 ? 0x8000 : 0x10000));
833833   read_blocks = 0;
834834
835   if (SNES_CART_DEBUG) printf("blocks %d\n", total_blocks);
835   if (SNES_CART_DEBUG) mame_printf_error("blocks %d\n", total_blocks);
836836
837837   /* Loading all the data blocks from cart, we only partially cover banks 0x00 to 0x7f. Therefore, we
838838     * have to mirror the blocks until we reach the end. E.g. for a 11Mbits image (44 blocks), we proceed
r10035r10036
978978      case SNES_MODE_ST:
979979         if (!st_bios)
980980         {
981            printf("This is a Sufami Turbo data cart and cannot be loaded for snes/snespal in MESS.\n");
982            printf("Please use snesst driver to load it, instead.\n");
981            mame_printf_error("This is a Sufami Turbo data cart and cannot be loaded for snes/snespal in MESS.\n");
982            mame_printf_error("Please use snesst driver to load it, instead.\n");
983983            return IMAGE_INIT_FAIL;
984984         }
985985         else
r10035r10036
10071007      case SNES_MODE_BSLO:
10081008      case SNES_MODE_BSHI:
10091009         /* not handled yet */
1010         printf("This is a BS-X Satellaview image: MESS does not support these yet, sorry.\n");
1010         mame_printf_error("This is a BS-X Satellaview image: MESS does not support these yet, sorry.\n");
10111011#if 0
10121012         // shall we force incompatibility of flash carts without a base unit?
10131013         if (!has_bsx_slot)
10141014         {
1015            printf("This is a BS-X flash cart and cannot be loaded in snes/snespal.\n");
1016//              printf("Please use snesbsx driver to load it, instead.\n");
1015            mame_printf_error("This is a BS-X flash cart and cannot be loaded in snes/snespal.\n");
1016//              mame_printf_error("Please use snesbsx driver to load it, instead.\n");
10171017            return IMAGE_INIT_FAIL;
10181018         }
10191019#endif
r10035r10036
11441144   else
11451145      memcpy(ROM, image.get_software_region("rom") + offset, state->cart_size - offset);
11461146
1147   if (SNES_CART_DEBUG) printf("size %08X\n", state->cart_size - offset);
1147   if (SNES_CART_DEBUG) mame_printf_error("size %08X\n", state->cart_size - offset);
11481148
11491149   /* Detect Sufami Turbo carts */
11501150   if (!memcmp(ROM, "BANDAI SFC-ADX", 14))
r10035r10036
11551155   }
11561156   else
11571157   {
1158      printf("This is not a Sufami Turbo data pack.\n");
1159      printf("This image cannot be loaded in snesst (Use snes or snespal drivers, instead).\n");
1158      mame_printf_error("This is not a Sufami Turbo data pack.\n");
1159      mame_printf_error("This image cannot be loaded in snesst (Use snes or snespal drivers, instead).\n");
11601160      return IMAGE_INIT_FAIL;
11611161   }
11621162
11631163   if (st_bios == 1)
11641164   {
1165      printf("This is the Sufami Turbo BIOS and not a Sufami Turbo data pack.\n");
1166      printf("This image cannot be loaded in snesst.\n");
1165      mame_printf_error("This is the Sufami Turbo BIOS and not a Sufami Turbo data pack.\n");
1166      mame_printf_error("This image cannot be loaded in snesst.\n");
11671167      return IMAGE_INIT_FAIL;
11681168   }
11691169
r10035r10036
11741174   read_blocks = 0;
11751175
11761176   if (SNES_CART_DEBUG)
1177      printf("blocks %d\n", total_blocks);
1177      mame_printf_error("blocks %d\n", total_blocks);
11781178
11791179   // actually load the cart
11801180   while (read_blocks < 32 && read_blocks < total_blocks)
r10035r10036
12351235   else
12361236      memcpy(ROM, image.get_software_region("rom") + offset, state->cart_size - offset);
12371237
1238   if (SNES_CART_DEBUG) printf("size %08X\n", state->cart_size - offset);
1238   if (SNES_CART_DEBUG) mame_printf_error("size %08X\n", state->cart_size - offset);
12391239
12401240   /* First, look if the cart is HiROM or LoROM (and set snes_cart accordingly) */
12411241   int_header_offs = snes_find_hilo_mode(image, ROM, offset, 0);
r10035r10036
12711271   }
12721272   else
12731273   {
1274      printf("This is not a BS-X compatible cart.\n");
1275      printf("This image cannot be loaded in the first cartslot of snesbsx.\n");
1274      mame_printf_error("This is not a BS-X compatible cart.\n");
1275      mame_printf_error("This image cannot be loaded in the first cartslot of snesbsx.\n");
12761276      return IMAGE_INIT_FAIL;
12771277   }
12781278
r10035r10036
12831283   total_blocks = (state->cart_size - offset) / 0x8000;
12841284   read_blocks = 0;
12851285
1286   if (SNES_CART_DEBUG) printf("blocks %d\n", total_blocks);
1286   if (SNES_CART_DEBUG) mame_printf_error("blocks %d\n", total_blocks);
12871287
12881288   // actually load the cart
12891289   while (read_blocks < 64 && read_blocks < total_blocks)
r10035r10036
13351335   else
13361336      memcpy(ROM, image.get_software_region("rom") + offset, state->cart_size - offset);
13371337
1338   if (SNES_CART_DEBUG) printf("size %08X\n", state->cart_size - offset);
1338   if (SNES_CART_DEBUG) mame_printf_error("size %08X\n", state->cart_size - offset);
13391339
13401340   /* First, look if the cart is HiROM or LoROM (and set snes_cart accordingly) */
13411341   int_header_offs = snes_find_hilo_mode(image, ROM, offset, 1);
r10035r10036
13571357
13581358   if (state->cart[1].mode != SNES_MODE_BSX)
13591359   {
1360      printf("This is not a BS-X flash cart.\n");
1361      printf("This image cannot be loaded in the second cartslot of snesbsx.\n");
1360      mame_printf_error("This is not a BS-X flash cart.\n");
1361      mame_printf_error("This image cannot be loaded in the second cartslot of snesbsx.\n");
13621362      return IMAGE_INIT_FAIL;
13631363   }
13641364

Previous 15994 Revisions Next


© 1998-2018 The MESS Team