trunk/src/mess/drivers/snes.c
| r21884 | r21885 | |
| 1395 | 1395 | SLOT_INTERFACE_INTERNAL("lorom_20col", SNS_LOROM_20COL) |
| 1396 | 1396 | SLOT_INTERFACE_INTERNAL("lorom_pija", SNS_LOROM_BANANA) // not working yet |
| 1397 | 1397 | SLOT_INTERFACE_INTERNAL("lorom_bugs", SNS_LOROM_BUGSLIFE) // not working yet |
| 1398 | // legacy slots to support DSPx games from fullpath |
| 1399 | SLOT_INTERFACE_INTERNAL("lorom_dsp1leg", SNS_LOROM_NECDSP1_LEG) |
| 1400 | SLOT_INTERFACE_INTERNAL("lorom_dsp1bleg",SNS_LOROM_NECDSP1B_LEG) |
| 1401 | SLOT_INTERFACE_INTERNAL("lorom_dsp2leg", SNS_LOROM_NECDSP2_LEG) |
| 1402 | SLOT_INTERFACE_INTERNAL("lorom_dsp3leg", SNS_LOROM_NECDSP3_LEG) |
| 1403 | SLOT_INTERFACE_INTERNAL("lorom_dsp4leg", SNS_LOROM_NECDSP4_LEG) |
| 1404 | SLOT_INTERFACE_INTERNAL("hirom_dsp1leg", SNS_HIROM_NECDSP1_LEG) |
| 1405 | SLOT_INTERFACE_INTERNAL("lorom_st10leg", SNS_LOROM_SETA10_LEG) |
| 1406 | SLOT_INTERFACE_INTERNAL("lorom_st11leg", SNS_LOROM_SETA11_LEG) |
| 1398 | 1407 | SLOT_INTERFACE_END |
| 1399 | 1408 | |
| 1400 | | |
| 1401 | | |
| 1402 | 1409 | static MACHINE_START( snes_console ) |
| 1403 | 1410 | { |
| 1404 | 1411 | snes_console_state *state = machine.driver_data<snes_console_state>(); |
| r21884 | r21885 | |
| 1517 | 1524 | state->m_io_read = write8_delegate(FUNC(snes_console_state::snes_input_read),state); |
| 1518 | 1525 | state->m_oldjoy1_read = read8_delegate(FUNC(snes_console_state::snes_oldjoy1_read),state); |
| 1519 | 1526 | state->m_oldjoy2_read = read8_delegate(FUNC(snes_console_state::snes_oldjoy2_read),state); |
| 1520 | | |
| 1521 | | // if trying to load a game requiring add-on CPU dump from fullpath, |
| 1522 | | // warn the user, disable the CPU in slot & switch back to base type |
| 1523 | | if (!state->m_cartslot->m_cart->get_addon_bios_size()) |
| 1524 | | { |
| 1525 | | switch (state->m_type) |
| 1526 | | { |
| 1527 | | case SNES_DSP: |
| 1528 | | case SNES_DSP_2MB: |
| 1529 | | case SNES_DSP4: |
| 1530 | | case SNES_ST010: |
| 1531 | | case SNES_ST011: |
| 1532 | | mame_printf_error("This type of cart requires the dump of on-cart CPU.\nPlease either load it from softlist or use snes_add driver.\n"); |
| 1533 | | state->m_cartslot->snes_stop_addon_cpu("dsp"); |
| 1534 | | state->m_type = SNES_MODE20; |
| 1535 | | break; |
| 1536 | | case SNES_DSP_MODE21: |
| 1537 | | mame_printf_error("This type of cart requires the dump of on-cart CPU.\nPlease either load it from softlist or use snes_add driver.\n"); |
| 1538 | | state->m_cartslot->snes_stop_addon_cpu("dsp"); |
| 1539 | | state->m_type = SNES_MODE21; |
| 1540 | | break; |
| 1541 | | case SNES_ST018: |
| 1542 | | case SNES_CX4: |
| 1543 | | // we don't emulate the CPU for these yet... |
| 1544 | | break; |
| 1545 | | } |
| 1546 | | } |
| 1547 | 1527 | } |
| 1548 | 1528 | |
| 1549 | 1529 | |
| r21884 | r21885 | |
| 1588 | 1568 | MACHINE_CONFIG_END |
| 1589 | 1569 | |
| 1590 | 1570 | |
| 1591 | | static MACHINE_RESET( snes_addon ) |
| 1592 | | { |
| 1593 | | snes_console_state *state = machine.driver_data<snes_console_state>(); |
| 1594 | | UINT8 *ROM = state->memregion("addons")->base(); |
| 1595 | 1571 | |
| 1596 | | MACHINE_RESET_CALL(snes); |
| 1597 | | |
| 1598 | | state->m_io_read = write8_delegate(FUNC(snes_console_state::snes_input_read),state); |
| 1599 | | state->m_oldjoy1_read = read8_delegate(FUNC(snes_console_state::snes_oldjoy1_read),state); |
| 1600 | | state->m_oldjoy2_read = read8_delegate(FUNC(snes_console_state::snes_oldjoy2_read),state); |
| 1601 | | |
| 1602 | | // if trying to load a game requiring add-on CPU dump from fullpath, load |
| 1603 | | // such a dump from the BIOS (hacky workaround to support legacy sfc dumps) |
| 1604 | | switch (state->m_cartslot->get_addon()) |
| 1605 | | { |
| 1606 | | case ADDON_DSP1: |
| 1607 | | state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x2800); |
| 1608 | | memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_DSP1_OFFSET, 0x2800); |
| 1609 | | break; |
| 1610 | | case ADDON_DSP1B: |
| 1611 | | state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x2800); |
| 1612 | | memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_DSP1B_OFFSET, 0x2800); |
| 1613 | | break; |
| 1614 | | case ADDON_DSP2: |
| 1615 | | state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x2800); |
| 1616 | | memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_DSP2_OFFSET, 0x2800); |
| 1617 | | break; |
| 1618 | | case ADDON_DSP3: |
| 1619 | | state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x2800); |
| 1620 | | memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_DSP3_OFFSET, 0x2800); |
| 1621 | | break; |
| 1622 | | case ADDON_DSP4: |
| 1623 | | state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x2800); |
| 1624 | | memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_DSP4_OFFSET, 0x2800); |
| 1625 | | break; |
| 1626 | | case ADDON_ST010: |
| 1627 | | state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x11000); |
| 1628 | | memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_ST10_OFFSET, 0x11000); |
| 1629 | | break; |
| 1630 | | case ADDON_ST011: |
| 1631 | | state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x11000); |
| 1632 | | memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_ST11_OFFSET, 0x11000); |
| 1633 | | break; |
| 1634 | | case ADDON_CX4: |
| 1635 | | state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x00c00); |
| 1636 | | memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_CX4_OFFSET, 0x00c00); |
| 1637 | | break; |
| 1638 | | case ADDON_ST018: |
| 1639 | | state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x28000); |
| 1640 | | memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_ST18_OFFSET1, 0x20000); |
| 1641 | | memcpy(state->m_cartslot->m_cart->get_addon_bios_base() + 0x20000, ROM + SNES_ST18_OFFSET2, 0x8000); |
| 1642 | | break; |
| 1643 | | default: |
| 1644 | | break; |
| 1645 | | } |
| 1646 | | } |
| 1647 | | |
| 1648 | | |
| 1649 | | static MACHINE_CONFIG_DERIVED( snes_add, snes ) |
| 1650 | | MCFG_MACHINE_RESET( snes_addon ) |
| 1651 | | MACHINE_CONFIG_END |
| 1652 | | |
| 1653 | | static MACHINE_CONFIG_DERIVED( snesp_add, snespal ) |
| 1654 | | MCFG_MACHINE_RESET( snes_addon ) |
| 1655 | | MACHINE_CONFIG_END |
| 1656 | | |
| 1657 | | |
| 1658 | 1572 | /************************************* |
| 1659 | 1573 | * |
| 1660 | 1574 | * ROM definition(s) |
| r21884 | r21885 | |
| 1668 | 1582 | ROM_LOAD( "spc700.rom", 0, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) /* boot rom */ |
| 1669 | 1583 | ROM_END |
| 1670 | 1584 | |
| 1671 | | ROM_START( snes_add ) |
| 1672 | | ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) |
| 1673 | | |
| 1674 | | ROM_REGION( 0x100, "sound_ipl", 0 ) /* IPL ROM */ |
| 1675 | | ROM_LOAD( "spc700.rom", 0, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) /* boot rom */ |
| 1676 | | |
| 1677 | | ROM_REGION( 0x60000, "addons", 0 ) /* add-on chip ROMs (DSP, SFX, etc) */ |
| 1678 | | ROM_LOAD( "dsp1.bin", SNES_DSP1_OFFSET, 0x02800, CRC(2838f9f5) SHA1(0a03ccb1fd2bea91151c745a4d1f217ae784f889) ) |
| 1679 | | ROM_LOAD( "dsp1b.bin", SNES_DSP1B_OFFSET, 0x02800, CRC(453557e0) SHA1(3a218b0e4572a8eba6d0121b17fdac9529609220) ) |
| 1680 | | ROM_LOAD( "dsp2.bin", SNES_DSP2_OFFSET, 0x02800, CRC(8e9fbd9b) SHA1(06dd9fcb118d18f6bbe234e013cb8780e06d6e63) ) |
| 1681 | | ROM_LOAD( "dsp3.bin", SNES_DSP3_OFFSET, 0x02800, CRC(6b86728a) SHA1(1b133741fad810eb7320c21ecfdd427d25a46da1) ) |
| 1682 | | ROM_LOAD( "dsp4.bin", SNES_DSP4_OFFSET, 0x02800, CRC(ce0c7783) SHA1(76fd25f7dc26c3b3f7868a3aa78c7684068713e5) ) |
| 1683 | | ROM_LOAD( "st010.bin", SNES_ST10_OFFSET, 0x11000, CRC(aa11ee2d) SHA1(cc1984e989cb94e3dcbb5f99e085b5414e18a017) ) |
| 1684 | | ROM_LOAD( "st011.bin", SNES_ST11_OFFSET, 0x11000, CRC(34d2952c) SHA1(1375b8c1efc8cae4962b57dfe22f6b78e1ddacc8) ) |
| 1685 | | ROM_LOAD( "cx4.bin", SNES_CX4_OFFSET, 0x00c00, CRC(b6e76a6a) SHA1(a002f4efba42775a31185d443f3ed1790b0e949a) ) |
| 1686 | | ROM_LOAD( "st018_0xf3.bin", SNES_ST18_OFFSET1, 0x20000, CRC(f73d5e10) SHA1(388e3721b94cd074d6ba0eca8616523d2118a6c3) ) |
| 1687 | | ROM_LOAD( "st018_0xf4.bin", SNES_ST18_OFFSET2, 0x08000, CRC(b5255459) SHA1(b19c0f8f207d62fdabf4bf71442826063bccc626) ) |
| 1688 | | ROM_END |
| 1689 | | |
| 1690 | 1585 | #define rom_snespal rom_snes |
| 1691 | | #define rom_snesp_add rom_snes_add |
| 1692 | 1586 | |
| 1693 | 1587 | /************************************* |
| 1694 | 1588 | * |
| r21884 | r21885 | |
| 1699 | 1593 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 1700 | 1594 | CONS( 1989, snes, 0, 0, snes, snes, driver_device, 0, "Nintendo", "Super Nintendo Entertainment System / Super Famicom (NTSC)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 1701 | 1595 | CONS( 1991, snespal, snes, 0, snespal, snes, driver_device, 0, "Nintendo", "Super Nintendo Entertainment System (PAL)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 1702 | | |
| 1703 | | // legacy drivers to allow loading old .sfc files of DSPx/CX4/ST0xx games without the add-on chip dump (add-on dumps directly in the BIOS) |
| 1704 | | CONS( 1989, snes_add, snes, 0, snes_add, snes, driver_device, 0, "Nintendo", "Super Nintendo Entertainment System / Super Famicom (NTSC, w/add-on CPUs)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_UNOFFICIAL) |
| 1705 | | CONS( 1991, snesp_add, snes, 0, snesp_add, snes, driver_device, 0, "Nintendo", "Super Nintendo Entertainment System (PAL, w/add-on CPUs)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_UNOFFICIAL) |
trunk/src/mess/machine/sns_slot.c
| r21884 | r21885 | |
| 21 | 21 | subslots (e.g. BS-X compatible ones), that need to write to subslot (NV)RAM independently |
| 22 | 22 | to accesses to their own (NV)RAM. |
| 23 | 23 | |
| 24 | | In order to support legacy dumps of games with add-on NEC & Seta DSPs, CX4 and Seta ST018, |
| 25 | | we use not only m_type to identify the correct slot device to be used (for this DSP1B, DSP2 and |
| 26 | | DSP3 are the same), but also a m_addon variable that snes_add driver uses to load CPU dump from |
| 27 | | the system BIOS (for this DSP1B, DSP2 and DSP3 are not the same). |
| 24 | Notes about add-on detection and handling (useful for future addition of st018, cx4, etc.) |
| 25 | =============================================================================================== |
| 26 | When loading from softlist, m_type would be enough to take care of add-on chips, because |
| 27 | the ones needing a CPU dump have it in the zipfile. However, to support these games also |
| 28 | from fullpath, both with files having DSP data appended to the .sfc and with older dumps |
| 29 | missing DSP data, a second variable is present in the SNES slot: m_addon. |
| 30 | From fullpath, support works as follows |
| 31 | - get_default_card_software needs to decide whether to use the main devices or the legacy |
| 32 | ones containing DSP dump as device roms, so it gets m_type as the main device should be |
| 33 | used and if m_addon is ADDON_DSP* or ADDON_ST*, then it checks if the DSP data is appended |
| 34 | or if m_type has to be switched to legacy type |
| 35 | - call_load needs to detect faulty dumps too, to alloc m_addon_bios and copy the data from |
| 36 | the correct place, so if m_addon is ADDON_DSP* or ADDON_ST* it checks whether DSP data is |
| 37 | appended or not: if it is, this data is copied to m_addon_bios; if not, then we are in |
| 38 | the legacy device case and data is copied from the device rom |
| 39 | After the cart has been loaded and emulation has started, only m_type is needed to later |
| 40 | handlers installation and cart accesses |
| 28 | 41 | |
| 42 | Also notice that, from softlist, DSP1, 1B, 2, 3 are treated as the same device, because they |
| 43 | all have the same I/O and the only difference (i.e. the DSP data) comes from the zipfile itself. |
| 44 | OTOH, to support faulty dumps missing DSP content, we need separate legacy devices... |
| 29 | 45 | |
| 46 | |
| 30 | 47 | ***********************************************************************************************************/ |
| 31 | 48 | |
| 32 | 49 | |
| r21884 | r21885 | |
| 265 | 282 | // Sufami Turbo carts |
| 266 | 283 | { SNES_STROM, "strom"}, |
| 267 | 284 | // pirate carts |
| 268 | | { SNES_POKEMON, "lorom_poke"}, |
| 269 | | { SNES_TEKKEN2, "lorom_tekken2"}, |
| 270 | | { SNES_SOULBLAD, "lorom_sbld"}, |
| 271 | | { SNES_MCPIR1, "lorom_mcpir1"}, |
| 272 | | { SNES_MCPIR2, "lorom_mcpir2"}, |
| 273 | | { SNES_20COL, "lorom_20col"}, |
| 274 | | { SNES_BANANA, "lorom_pija"}, // wip |
| 275 | | { SNES_BUGS, "lorom_bugs"} // wip |
| 285 | { SNES_POKEMON, "lorom_poke"}, |
| 286 | { SNES_TEKKEN2, "lorom_tekken2"}, |
| 287 | { SNES_SOULBLAD, "lorom_sbld"}, |
| 288 | { SNES_MCPIR1, "lorom_mcpir1"}, |
| 289 | { SNES_MCPIR2, "lorom_mcpir2"}, |
| 290 | { SNES_20COL, "lorom_20col"}, |
| 291 | { SNES_BANANA, "lorom_pija"}, // wip |
| 292 | { SNES_BUGS, "lorom_bugs"}, // wip |
| 293 | // legacy slots to support DSPx games from fullpath |
| 294 | { SNES_DSP1_LEG, "lorom_dsp1leg"}, |
| 295 | { SNES_DSP1B_LEG, "lorom_dsp1bleg"}, |
| 296 | { SNES_DSP2_LEG, "lorom_dsp2leg"}, |
| 297 | { SNES_DSP3_LEG, "lorom_dsp3leg"}, |
| 298 | { SNES_DSP4_LEG, "lorom_dsp4leg"}, |
| 299 | { SNES_DSP1_MODE21_LEG, "hirom_dsp1leg"}, |
| 300 | { SNES_ST010_LEG, "lorom_st10leg"}, |
| 301 | { SNES_ST011_LEG, "lorom_st11leg"} |
| 276 | 302 | }; |
| 277 | 303 | |
| 278 | 304 | static int sns_get_pcb_id(const char *slot) |
| r21884 | r21885 | |
| 643 | 669 | } |
| 644 | 670 | |
| 645 | 671 | if (software_entry() == NULL) |
| 646 | | setup_appended_addon(); |
| 672 | setup_addon_from_fullpath(); |
| 647 | 673 | |
| 648 | 674 | setup_nvram(); |
| 649 | 675 | |
| r21884 | r21885 | |
| 697 | 723 | } |
| 698 | 724 | |
| 699 | 725 | |
| 700 | | void base_sns_cart_slot_device::setup_appended_addon() |
| 726 | void base_sns_cart_slot_device::setup_addon_from_fullpath() |
| 701 | 727 | { |
| 702 | 728 | // if we already have an add-on bios or if no addon has been detected, we have nothing to do |
| 703 | 729 | if (m_cart->get_addon_bios_size() || m_addon == ADDON_NONE) |
| r21884 | r21885 | |
| 782 | 808 | } |
| 783 | 809 | break; |
| 784 | 810 | } |
| 811 | |
| 812 | // otherwise, we need to use the legacy versions including DSP dump in device romset |
| 813 | if (!m_cart->get_addon_bios_size()) |
| 814 | { |
| 815 | astring region(m_cart->device().tag(), ":addon"); |
| 816 | UINT8 *ROM = NULL; |
| 817 | |
| 818 | switch (m_addon) |
| 819 | { |
| 820 | case ADDON_DSP1: |
| 821 | ROM = machine().root_device().memregion(region)->base(); |
| 822 | m_cart->addon_bios_alloc(machine(), 0x2800); |
| 823 | memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); |
| 824 | break; |
| 825 | case ADDON_DSP1B: |
| 826 | ROM = machine().root_device().memregion(region)->base(); |
| 827 | m_cart->addon_bios_alloc(machine(), 0x2800); |
| 828 | memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); |
| 829 | break; |
| 830 | case ADDON_DSP2: |
| 831 | ROM = machine().root_device().memregion(region)->base(); |
| 832 | m_cart->addon_bios_alloc(machine(), 0x2800); |
| 833 | memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); |
| 834 | break; |
| 835 | case ADDON_DSP3: |
| 836 | ROM = machine().root_device().memregion(region)->base(); |
| 837 | m_cart->addon_bios_alloc(machine(), 0x2800); |
| 838 | memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); |
| 839 | break; |
| 840 | case ADDON_DSP4: |
| 841 | ROM = machine().root_device().memregion(region)->base(); |
| 842 | m_cart->addon_bios_alloc(machine(), 0x2800); |
| 843 | memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); |
| 844 | break; |
| 845 | case ADDON_ST010: |
| 846 | ROM = machine().root_device().memregion(region)->base(); |
| 847 | m_cart->addon_bios_alloc(machine(), 0x11000); |
| 848 | memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000); |
| 849 | break; |
| 850 | case ADDON_ST011: |
| 851 | ROM = machine().root_device().memregion(region)->base(); |
| 852 | m_cart->addon_bios_alloc(machine(), 0x11000); |
| 853 | memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000); |
| 854 | break; |
| 855 | } |
| 856 | } |
| 857 | |
| 785 | 858 | } |
| 786 | 859 | |
| 787 | 860 | void base_sns_cart_slot_device::setup_nvram() |
| r21884 | r21885 | |
| 959 | 1032 | offset = snes_skip_header(ROM, len); |
| 960 | 1033 | |
| 961 | 1034 | get_cart_type_addon(ROM + offset, len - offset, type, addon); |
| 1035 | // here we're from fullpath, so check if it's a DSP game which needs legacy device (i.e. it has no appended DSP dump) |
| 1036 | switch (addon) |
| 1037 | { |
| 1038 | case ADDON_DSP1: |
| 1039 | if ((len & 0x7fff) != 0x2800 && (len & 0x7fff) != 0x2000) |
| 1040 | { |
| 1041 | if (type == SNES_DSP_MODE21) |
| 1042 | type = SNES_DSP1_MODE21_LEG; |
| 1043 | else |
| 1044 | type = SNES_DSP1_LEG; |
| 1045 | } |
| 1046 | break; |
| 1047 | case ADDON_DSP1B: |
| 1048 | if ((len & 0x7fff) != 0x2800 && (len & 0x7fff) != 0x2000) |
| 1049 | type = SNES_DSP1B_LEG; |
| 1050 | break; |
| 1051 | case ADDON_DSP2: |
| 1052 | if ((len & 0x7fff) != 0x2800 && (len & 0x7fff) != 0x2000) |
| 1053 | type = SNES_DSP2_LEG; |
| 1054 | break; |
| 1055 | case ADDON_DSP3: |
| 1056 | if ((len & 0x7fff) != 0x2800 && (len & 0x7fff) != 0x2000) |
| 1057 | type = SNES_DSP3_LEG; |
| 1058 | break; |
| 1059 | case ADDON_DSP4: |
| 1060 | if ((len & 0x7fff) != 0x2800 && (len & 0x7fff) != 0x2000) |
| 1061 | type = SNES_DSP4_LEG; |
| 1062 | break; |
| 1063 | case ADDON_ST010: |
| 1064 | if ((len & 0x3ffff) != 0x11000 && (len & 0xffff) != 0xd000) |
| 1065 | type = SNES_ST010_LEG; |
| 1066 | break; |
| 1067 | case ADDON_ST011: |
| 1068 | if ((len & 0x3ffff) != 0x11000 && (len & 0xffff) != 0xd000) |
| 1069 | type = SNES_ST011_LEG; |
| 1070 | break; |
| 1071 | } |
| 1072 | |
| 962 | 1073 | slot_string = sns_get_slot(type); |
| 963 | 1074 | |
| 964 | 1075 | global_free(ROM); |
| r21884 | r21885 | |
| 1037 | 1148 | |
| 1038 | 1149 | |
| 1039 | 1150 | /*------------------------------------------------- |
| 1040 | | snes_stop_addon_cpu |
| 1041 | | -------------------------------------------------*/ |
| 1042 | | |
| 1043 | | void base_sns_cart_slot_device::snes_stop_addon_cpu(const char *cputag) |
| 1044 | | { |
| 1045 | | astring cpu(m_cart->device().tag(), ":", cputag); |
| 1046 | | if (m_cart && machine().device(cpu)) |
| 1047 | | machine().device(cpu.cstr())->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
| 1048 | | } |
| 1049 | | |
| 1050 | | /*------------------------------------------------- |
| 1051 | 1151 | Internal header logging |
| 1052 | 1152 | -------------------------------------------------*/ |
| 1053 | 1153 | |
trunk/src/mess/machine/sns_upd.c
| r21884 | r21885 | |
| 22 | 22 | const device_type SNS_LOROM_SETA11 = &device_creator<sns_rom_seta11dsp_device>; |
| 23 | 23 | |
| 24 | 24 | |
| 25 | sns_rom20_necdsp_device::sns_rom20_necdsp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) |
| 26 | : sns_rom_device(mconfig, type, name, tag, owner, clock), |
| 27 | m_upd7725(*this, "dsp") |
| 28 | { |
| 29 | } |
| 30 | |
| 25 | 31 | sns_rom20_necdsp_device::sns_rom20_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 26 | 32 | : sns_rom_device(mconfig, SNS_LOROM_NECDSP, "SNES Cart (LoROM) + NEC DSP", tag, owner, clock), |
| 27 | 33 | m_upd7725(*this, "dsp") |
| 28 | 34 | { |
| 29 | 35 | } |
| 30 | 36 | |
| 37 | sns_rom21_necdsp_device::sns_rom21_necdsp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) |
| 38 | : sns_rom21_device(mconfig, type, name, tag, owner, clock), |
| 39 | m_upd7725(*this, "dsp") |
| 40 | { |
| 41 | } |
| 42 | |
| 31 | 43 | sns_rom21_necdsp_device::sns_rom21_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 32 | 44 | : sns_rom21_device(mconfig, SNS_HIROM_NECDSP, "SNES Cart (HiROM) + NEC DSP", tag, owner, clock), |
| 33 | 45 | m_upd7725(*this, "dsp") |
| r21884 | r21885 | |
| 326 | 338 | { |
| 327 | 339 | return MACHINE_CONFIG_NAME( snes_st011 ); |
| 328 | 340 | } |
| 341 | |
| 342 | |
| 343 | |
| 344 | |
| 345 | // Legacy versions including DSP dump roms, in order to support faulty dumps missing DSP data... |
| 346 | |
| 347 | const device_type SNS_LOROM_NECDSP1_LEG = &device_creator<sns_rom20_necdsp1_legacy_device>; |
| 348 | const device_type SNS_LOROM_NECDSP1B_LEG = &device_creator<sns_rom20_necdsp1b_legacy_device>; |
| 349 | const device_type SNS_LOROM_NECDSP2_LEG = &device_creator<sns_rom20_necdsp2_legacy_device>; |
| 350 | const device_type SNS_LOROM_NECDSP3_LEG = &device_creator<sns_rom20_necdsp3_legacy_device>; |
| 351 | const device_type SNS_LOROM_NECDSP4_LEG = &device_creator<sns_rom20_necdsp4_legacy_device>; |
| 352 | const device_type SNS_HIROM_NECDSP1_LEG = &device_creator<sns_rom21_necdsp1_legacy_device>; |
| 353 | const device_type SNS_LOROM_SETA10_LEG = &device_creator<sns_rom_seta10dsp_legacy_device>; |
| 354 | const device_type SNS_LOROM_SETA11_LEG = &device_creator<sns_rom_seta11dsp_legacy_device>; |
| 355 | |
| 356 | |
| 357 | sns_rom20_necdsp1_legacy_device::sns_rom20_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 358 | : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP1_LEG, "SNES Cart (LoROM) + NEC DSP1 Legacy", tag, owner, clock) |
| 359 | { |
| 360 | } |
| 361 | |
| 362 | sns_rom20_necdsp1b_legacy_device::sns_rom20_necdsp1b_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 363 | : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP1B_LEG, "SNES Cart (LoROM) + NEC DSP1B Legacy", tag, owner, clock) |
| 364 | { |
| 365 | } |
| 366 | |
| 367 | sns_rom20_necdsp2_legacy_device::sns_rom20_necdsp2_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 368 | : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP2_LEG, "SNES Cart (LoROM) + NEC DSP2 Legacy", tag, owner, clock) |
| 369 | { |
| 370 | } |
| 371 | |
| 372 | sns_rom20_necdsp3_legacy_device::sns_rom20_necdsp3_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 373 | : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP3_LEG, "SNES Cart (LoROM) + NEC DSP3 Legacy", tag, owner, clock) |
| 374 | { |
| 375 | } |
| 376 | |
| 377 | sns_rom20_necdsp4_legacy_device::sns_rom20_necdsp4_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 378 | : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP4_LEG, "SNES Cart (LoROM) + NEC DSP4 Legacy", tag, owner, clock) |
| 379 | { |
| 380 | } |
| 381 | |
| 382 | sns_rom21_necdsp1_legacy_device::sns_rom21_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 383 | : sns_rom21_necdsp_device(mconfig, SNS_HIROM_NECDSP1_LEG, "SNES Cart (HiROM) + NEC DSP1 Legacy", tag, owner, clock) |
| 384 | { |
| 385 | } |
| 386 | |
| 387 | sns_rom_seta10dsp_legacy_device::sns_rom_seta10dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 388 | : sns_rom_setadsp_device(mconfig, SNS_LOROM_SETA10_LEG, "SNES Cart (LoROM) + Seta ST010 DSP Legacy", tag, owner, clock) |
| 389 | { |
| 390 | } |
| 391 | |
| 392 | sns_rom_seta11dsp_legacy_device::sns_rom_seta11dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 393 | : sns_rom_setadsp_device(mconfig, SNS_LOROM_SETA11_LEG, "SNES Cart (LoROM) + Seta ST011 DSP Legacy", tag, owner, clock) |
| 394 | { |
| 395 | } |
| 396 | |
| 397 | |
| 398 | machine_config_constructor sns_rom20_necdsp1_legacy_device::device_mconfig_additions() const |
| 399 | { |
| 400 | return MACHINE_CONFIG_NAME( snes_dsp_lorom ); |
| 401 | } |
| 402 | |
| 403 | machine_config_constructor sns_rom20_necdsp1b_legacy_device::device_mconfig_additions() const |
| 404 | { |
| 405 | return MACHINE_CONFIG_NAME( snes_dsp_lorom ); |
| 406 | } |
| 407 | |
| 408 | machine_config_constructor sns_rom20_necdsp2_legacy_device::device_mconfig_additions() const |
| 409 | { |
| 410 | return MACHINE_CONFIG_NAME( snes_dsp_lorom ); |
| 411 | } |
| 412 | |
| 413 | machine_config_constructor sns_rom20_necdsp3_legacy_device::device_mconfig_additions() const |
| 414 | { |
| 415 | return MACHINE_CONFIG_NAME( snes_dsp_lorom ); |
| 416 | } |
| 417 | |
| 418 | machine_config_constructor sns_rom20_necdsp4_legacy_device::device_mconfig_additions() const |
| 419 | { |
| 420 | return MACHINE_CONFIG_NAME( snes_dsp_lorom ); |
| 421 | } |
| 422 | |
| 423 | machine_config_constructor sns_rom21_necdsp1_legacy_device::device_mconfig_additions() const |
| 424 | { |
| 425 | return MACHINE_CONFIG_NAME( snes_dsp_hirom ); |
| 426 | } |
| 427 | |
| 428 | machine_config_constructor sns_rom_seta10dsp_legacy_device::device_mconfig_additions() const |
| 429 | { |
| 430 | return MACHINE_CONFIG_NAME( snes_st010 ); |
| 431 | } |
| 432 | |
| 433 | machine_config_constructor sns_rom_seta11dsp_legacy_device::device_mconfig_additions() const |
| 434 | { |
| 435 | return MACHINE_CONFIG_NAME( snes_st011 ); |
| 436 | } |
| 437 | |
| 438 | |
| 439 | ROM_START( snes_dsp1 ) |
| 440 | ROM_REGION(0x2800, "addon", 0) |
| 441 | ROM_LOAD( "dsp1.bin", 0, 0x02800, CRC(2838f9f5) SHA1(0a03ccb1fd2bea91151c745a4d1f217ae784f889) ) |
| 442 | ROM_END |
| 443 | |
| 444 | ROM_START( snes_dsp1b ) |
| 445 | ROM_REGION(0x2800, "addon", 0) |
| 446 | ROM_LOAD( "dsp1b.bin", 0, 0x02800, CRC(453557e0) SHA1(3a218b0e4572a8eba6d0121b17fdac9529609220) ) |
| 447 | ROM_END |
| 448 | |
| 449 | ROM_START( snes_dsp2 ) |
| 450 | ROM_REGION(0x2800, "addon", 0) |
| 451 | ROM_LOAD( "dsp2.bin", 0, 0x02800, CRC(8e9fbd9b) SHA1(06dd9fcb118d18f6bbe234e013cb8780e06d6e63) ) |
| 452 | ROM_END |
| 453 | |
| 454 | ROM_START( snes_dsp3 ) |
| 455 | ROM_REGION(0x2800, "addon", 0) |
| 456 | ROM_LOAD( "dsp3.bin", 0, 0x02800, CRC(6b86728a) SHA1(1b133741fad810eb7320c21ecfdd427d25a46da1) ) |
| 457 | ROM_END |
| 458 | |
| 459 | ROM_START( snes_dsp4 ) |
| 460 | ROM_REGION(0x2800, "addon", 0) |
| 461 | ROM_LOAD( "dsp4.bin", 0, 0x02800, CRC(ce0c7783) SHA1(76fd25f7dc26c3b3f7868a3aa78c7684068713e5) ) |
| 462 | ROM_END |
| 463 | |
| 464 | ROM_START( snes_st010 ) |
| 465 | ROM_REGION(0x11000, "addon", 0) |
| 466 | ROM_LOAD( "st010.bin", 0, 0x11000, CRC(aa11ee2d) SHA1(cc1984e989cb94e3dcbb5f99e085b5414e18a017) ) |
| 467 | ROM_END |
| 468 | |
| 469 | ROM_START( snes_st011 ) |
| 470 | ROM_REGION(0x11000, "addon", 0) |
| 471 | ROM_LOAD( "st011.bin", 0, 0x11000, CRC(34d2952c) SHA1(1375b8c1efc8cae4962b57dfe22f6b78e1ddacc8) ) |
| 472 | ROM_END |
| 473 | |
| 474 | const rom_entry *sns_rom20_necdsp1_legacy_device::device_rom_region() const |
| 475 | { |
| 476 | return ROM_NAME( snes_dsp1 ); |
| 477 | } |
| 478 | |
| 479 | const rom_entry *sns_rom20_necdsp1b_legacy_device::device_rom_region() const |
| 480 | { |
| 481 | return ROM_NAME( snes_dsp1b ); |
| 482 | } |
| 483 | |
| 484 | const rom_entry *sns_rom20_necdsp2_legacy_device::device_rom_region() const |
| 485 | { |
| 486 | return ROM_NAME( snes_dsp2 ); |
| 487 | } |
| 488 | |
| 489 | const rom_entry *sns_rom20_necdsp3_legacy_device::device_rom_region() const |
| 490 | { |
| 491 | return ROM_NAME( snes_dsp3 ); |
| 492 | } |
| 493 | |
| 494 | const rom_entry *sns_rom20_necdsp4_legacy_device::device_rom_region() const |
| 495 | { |
| 496 | return ROM_NAME( snes_dsp4 ); |
| 497 | } |
| 498 | |
| 499 | const rom_entry *sns_rom21_necdsp1_legacy_device::device_rom_region() const |
| 500 | { |
| 501 | return ROM_NAME( snes_dsp1 ); |
| 502 | } |
| 503 | |
| 504 | const rom_entry *sns_rom_seta10dsp_legacy_device::device_rom_region() const |
| 505 | { |
| 506 | return ROM_NAME( snes_st010 ); |
| 507 | } |
| 508 | |
| 509 | const rom_entry *sns_rom_seta11dsp_legacy_device::device_rom_region() const |
| 510 | { |
| 511 | return ROM_NAME( snes_st011 ); |
| 512 | } |
| 513 | |
trunk/src/mess/machine/sns_upd.h
| r21884 | r21885 | |
| 12 | 12 | { |
| 13 | 13 | public: |
| 14 | 14 | // construction/destruction |
| 15 | sns_rom20_necdsp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 15 | 16 | sns_rom20_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 16 | 17 | |
| 17 | 18 | // device-level overrides |
| r21884 | r21885 | |
| 35 | 36 | { |
| 36 | 37 | public: |
| 37 | 38 | // construction/destruction |
| 39 | sns_rom21_necdsp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 38 | 40 | sns_rom21_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 39 | 41 | |
| 40 | 42 | // device-level overrides |
| r21884 | r21885 | |
| 74 | 76 | virtual DECLARE_READ16_MEMBER(setadsp_data_r); |
| 75 | 77 | }; |
| 76 | 78 | |
| 77 | | // ======================> sns_rom_seta10_device |
| 79 | // ======================> sns_rom_seta10dsp_device |
| 78 | 80 | |
| 79 | 81 | class sns_rom_seta10dsp_device : public sns_rom_setadsp_device |
| 80 | 82 | { |
| r21884 | r21885 | |
| 87 | 89 | virtual machine_config_constructor device_mconfig_additions() const; |
| 88 | 90 | }; |
| 89 | 91 | |
| 90 | | // ======================> sns_rom_seta11_device [Faster CPU than ST010] |
| 92 | // ======================> sns_rom_seta11dsp_device [Faster CPU than ST010] |
| 91 | 93 | |
| 92 | 94 | class sns_rom_seta11dsp_device : public sns_rom_setadsp_device |
| 93 | 95 | { |
| r21884 | r21885 | |
| 107 | 109 | extern const device_type SNS_LOROM_SETA10; |
| 108 | 110 | extern const device_type SNS_LOROM_SETA11; |
| 109 | 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | // Devices including DSP dumps to support faulty .sfc dumps missing DSP data |
| 116 | |
| 117 | class sns_rom20_necdsp1_legacy_device : public sns_rom20_necdsp_device |
| 118 | { |
| 119 | public: |
| 120 | // construction/destruction |
| 121 | sns_rom20_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 122 | |
| 123 | // device-level overrides |
| 124 | virtual void device_config_complete() { m_shortname = "dsp1leg"; } |
| 125 | virtual machine_config_constructor device_mconfig_additions() const; |
| 126 | virtual const rom_entry *device_rom_region() const; |
| 127 | }; |
| 128 | |
| 129 | class sns_rom20_necdsp1b_legacy_device : public sns_rom20_necdsp_device |
| 130 | { |
| 131 | public: |
| 132 | // construction/destruction |
| 133 | sns_rom20_necdsp1b_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 134 | |
| 135 | // device-level overrides |
| 136 | virtual void device_config_complete() { m_shortname = "dsp1bleg"; } |
| 137 | virtual machine_config_constructor device_mconfig_additions() const; |
| 138 | virtual const rom_entry *device_rom_region() const; |
| 139 | }; |
| 140 | |
| 141 | class sns_rom20_necdsp2_legacy_device : public sns_rom20_necdsp_device |
| 142 | { |
| 143 | public: |
| 144 | // construction/destruction |
| 145 | sns_rom20_necdsp2_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 146 | |
| 147 | // device-level overrides |
| 148 | virtual void device_config_complete() { m_shortname = "dsp2leg"; } |
| 149 | virtual machine_config_constructor device_mconfig_additions() const; |
| 150 | virtual const rom_entry *device_rom_region() const; |
| 151 | }; |
| 152 | |
| 153 | class sns_rom20_necdsp3_legacy_device : public sns_rom20_necdsp_device |
| 154 | { |
| 155 | public: |
| 156 | // construction/destruction |
| 157 | sns_rom20_necdsp3_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 158 | |
| 159 | // device-level overrides |
| 160 | virtual void device_config_complete() { m_shortname = "dsp3leg"; } |
| 161 | virtual machine_config_constructor device_mconfig_additions() const; |
| 162 | virtual const rom_entry *device_rom_region() const; |
| 163 | }; |
| 164 | |
| 165 | class sns_rom20_necdsp4_legacy_device : public sns_rom20_necdsp_device |
| 166 | { |
| 167 | public: |
| 168 | // construction/destruction |
| 169 | sns_rom20_necdsp4_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 170 | |
| 171 | // device-level overrides |
| 172 | virtual void device_config_complete() { m_shortname = "dsp4leg"; } |
| 173 | virtual machine_config_constructor device_mconfig_additions() const; |
| 174 | virtual const rom_entry *device_rom_region() const; |
| 175 | }; |
| 176 | |
| 177 | class sns_rom21_necdsp1_legacy_device : public sns_rom21_necdsp_device |
| 178 | { |
| 179 | public: |
| 180 | // construction/destruction |
| 181 | sns_rom21_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 182 | |
| 183 | // device-level overrides |
| 184 | virtual void device_config_complete() { m_shortname = "dsp1leg_hi"; } |
| 185 | virtual machine_config_constructor device_mconfig_additions() const; |
| 186 | virtual const rom_entry *device_rom_region() const; |
| 187 | }; |
| 188 | |
| 189 | class sns_rom_seta10dsp_legacy_device : public sns_rom_setadsp_device |
| 190 | { |
| 191 | public: |
| 192 | // construction/destruction |
| 193 | sns_rom_seta10dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 194 | |
| 195 | // device-level overrides |
| 196 | virtual void device_config_complete() { m_shortname = "seta10leg"; } |
| 197 | virtual machine_config_constructor device_mconfig_additions() const; |
| 198 | virtual const rom_entry *device_rom_region() const; |
| 199 | }; |
| 200 | |
| 201 | class sns_rom_seta11dsp_legacy_device : public sns_rom_setadsp_device |
| 202 | { |
| 203 | public: |
| 204 | // construction/destruction |
| 205 | sns_rom_seta11dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 206 | |
| 207 | // device-level overrides |
| 208 | virtual void device_config_complete() { m_shortname = "seta11leg"; } |
| 209 | virtual machine_config_constructor device_mconfig_additions() const; |
| 210 | virtual const rom_entry *device_rom_region() const; |
| 211 | }; |
| 212 | |
| 213 | extern const device_type SNS_LOROM_NECDSP1_LEG; |
| 214 | extern const device_type SNS_LOROM_NECDSP1B_LEG; |
| 215 | extern const device_type SNS_LOROM_NECDSP2_LEG; |
| 216 | extern const device_type SNS_LOROM_NECDSP3_LEG; |
| 217 | extern const device_type SNS_LOROM_NECDSP4_LEG; |
| 218 | extern const device_type SNS_HIROM_NECDSP1_LEG; |
| 219 | extern const device_type SNS_LOROM_SETA10_LEG; |
| 220 | extern const device_type SNS_LOROM_SETA11_LEG; |
| 221 | |
| 110 | 222 | #endif |