src/mess/machine/snescart.c
| r5797 | r5798 | |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | /* Loading data */ |
| 418 | | { |
| 419 | 418 | ROM = memory_region(image->machine, "cart"); |
| 420 | 419 | length = image_fread(image, ROM, image_length(image) - offset); |
| 421 | | } |
| 422 | 420 | |
| 423 | 421 | /* FIXME: Insert crc check here */ |
| 424 | 422 | |
| r5797 | r5798 | |
| 524 | 522 | * These are then mirrored in banks 0x40 to 0x7f, both at address 0x0000 and at address |
| 525 | 523 | * 0x8000, in banks 0x80 to 0xbf at address 0x8000 and in banks 0xc0 to 0xff, both at address |
| 526 | 524 | * 0x0000 and at address 0x8000. Notice that SDD-1 games (Star Ocean and Street Fighter Zero 2) |
| 527 | | * also use SNES_MODE_22, but we still don't support their bankswitch mechanism: the content |
| 528 | | * of banks at 0xc0 to 0xff changes according to MMC registers $4804-$4807 |
| 525 | * use SNES_MODE_22 |
| 529 | 526 | */ |
| 530 | 527 | while (read_blocks < 64 && read_blocks < total_blocks) |
| 531 | 528 | { |
| 532 | | /* Loading data */ |
| 529 | /* Loading and mirroring data */ |
| 533 | 530 | memcpy(&snes_ram[0x008000 + read_blocks * 0x10000], &ROM[0x000000 + read_blocks * 0x8000], 0x8000); |
| 534 | | /* Mirroring */ |
| 535 | | memcpy(&snes_ram[0x400000 + read_blocks * 0x10000], &snes_ram[0x8000 + read_blocks * 0x10000], 0x8000); |
| 536 | | memcpy(&snes_ram[0x408000 + read_blocks * 0x10000], &snes_ram[0x8000 + read_blocks * 0x10000], 0x8000); |
| 537 | | memcpy(&snes_ram[0x808000 + read_blocks * 0x10000], &snes_ram[0x8000 + read_blocks * 0x10000], 0x8000); |
| 538 | | memcpy(&snes_ram[0xc00000 + read_blocks * 0x10000], &snes_ram[0x8000 + read_blocks * 0x10000], 0x8000); |
| 539 | | memcpy(&snes_ram[0xc08000 + read_blocks * 0x10000], &snes_ram[0x8000 + read_blocks * 0x10000], 0x8000); |
| 531 | memcpy(&snes_ram[0x808000 + read_blocks * 0x10000], &ROM[0x000000 + read_blocks * 0x8000], 0x8000); |
| 532 | memcpy(&snes_ram[0x400000 + read_blocks * 0x10000], &ROM[0x000000 + read_blocks * 0x10000], 0x10000); |
| 533 | memcpy(&snes_ram[0xc00000 + read_blocks * 0x10000], &ROM[0x000000 + read_blocks * 0x10000], 0x10000); |
| 540 | 534 | read_blocks++; |
| 541 | 535 | } |
| 542 | 536 | /* Filling banks up to 0x3f and their mirrors */ |
| r5797 | r5798 | |
| 560 | 554 | /* LoROM carts load data in banks 0x00 to 0x7f at address 0x8000 (actually up to 0x7d, because 0x7e and |
| 561 | 555 | * 0x7f are overwritten by WRAM). Each block is also mirrored in banks 0x80 to 0xff (up to 0xff for real) |
| 562 | 556 | */ |
| 563 | | /* SuperFX games needs a different loading routine */ |
| 557 | /* SuperFX games needs this different loading routine */ |
| 564 | 558 | if(((temp_buffer[0x007fd6] >= 0x13 && temp_buffer[0x007fd6] <= 0x15) || temp_buffer[0x007fd6] == 0x1a) && (temp_buffer[0x007fd5] == 0x20)) |
| 565 | 559 | { |
| 566 | 560 | while (read_blocks < 64 && read_blocks < total_blocks) |
| r5797 | r5798 | |
| 667 | 661 | case 0x43: |
| 668 | 662 | case 0x45: |
| 669 | 663 | if (snes_r_bank1(space, 0x00ffd5) == 0x32) |
| 670 | | { |
| 671 | 664 | snes_has_addon_chip = HAS_SDD1; |
| 672 | | supported_type = 0; |
| 673 | | } |
| 674 | 665 | break; |
| 675 | 666 | |
| 676 | 667 | case 0x55: |
| r5797 | r5798 | |
| 769 | 760 | logerror( "===========\n\n" ); |
| 770 | 761 | logerror( "\tTotal blocks: %d (%dmb)\n", total_blocks, total_blocks / (snes_cart.mode & 5 ? 32 : 16) ); |
| 771 | 762 | logerror( "\tROM bank size: %s (LoROM: %d , HiROM: %d, ExHiROM: %d)\n", |
| 772 | | (snes_cart.mode == SNES_MODE_20) ? "LoROM" : ((snes_cart.mode == SNES_MODE_21) ? "HiROM" : "ExHiROM"), |
| 763 | (snes_cart.mode == SNES_MODE_20) ? "LoROM" : |
| 764 | (snes_cart.mode == SNES_MODE_21) ? "HiROM" : |
| 765 | (snes_cart.mode == SNES_MODE_22) ? "ExLoROM" : "ExHiROM", |
| 773 | 766 | valid_mode20, valid_mode21, valid_mode25); |
| 774 | 767 | logerror( "\tCompany: %s [%.2s]\n", companies[company], company_id ); |
| 775 | 768 | logerror( "\tROM ID: %.4s\n\n", rom_id ); |