diff --git a/src/mess/drivers/snes.c b/src/mess/drivers/snes.c index 3a8936a5a0a..4d5d4b78422 100644 --- a/src/mess/drivers/snes.c +++ b/src/mess/drivers/snes.c @@ -1395,10 +1395,17 @@ static SLOT_INTERFACE_START(snes_cart) SLOT_INTERFACE_INTERNAL("lorom_20col", SNS_LOROM_20COL) SLOT_INTERFACE_INTERNAL("lorom_pija", SNS_LOROM_BANANA) // not working yet SLOT_INTERFACE_INTERNAL("lorom_bugs", SNS_LOROM_BUGSLIFE) // not working yet + // legacy slots to support DSPx games from fullpath + SLOT_INTERFACE_INTERNAL("lorom_dsp1leg", SNS_LOROM_NECDSP1_LEG) + SLOT_INTERFACE_INTERNAL("lorom_dsp1bleg",SNS_LOROM_NECDSP1B_LEG) + SLOT_INTERFACE_INTERNAL("lorom_dsp2leg", SNS_LOROM_NECDSP2_LEG) + SLOT_INTERFACE_INTERNAL("lorom_dsp3leg", SNS_LOROM_NECDSP3_LEG) + SLOT_INTERFACE_INTERNAL("lorom_dsp4leg", SNS_LOROM_NECDSP4_LEG) + SLOT_INTERFACE_INTERNAL("hirom_dsp1leg", SNS_HIROM_NECDSP1_LEG) + SLOT_INTERFACE_INTERNAL("lorom_st10leg", SNS_LOROM_SETA10_LEG) + SLOT_INTERFACE_INTERNAL("lorom_st11leg", SNS_LOROM_SETA11_LEG) SLOT_INTERFACE_END - - static MACHINE_START( snes_console ) { snes_console_state *state = machine.driver_data(); @@ -1517,33 +1524,6 @@ static MACHINE_RESET( snes_console ) state->m_io_read = write8_delegate(FUNC(snes_console_state::snes_input_read),state); state->m_oldjoy1_read = read8_delegate(FUNC(snes_console_state::snes_oldjoy1_read),state); state->m_oldjoy2_read = read8_delegate(FUNC(snes_console_state::snes_oldjoy2_read),state); - - // if trying to load a game requiring add-on CPU dump from fullpath, - // warn the user, disable the CPU in slot & switch back to base type - if (!state->m_cartslot->m_cart->get_addon_bios_size()) - { - switch (state->m_type) - { - case SNES_DSP: - case SNES_DSP_2MB: - case SNES_DSP4: - case SNES_ST010: - case SNES_ST011: - 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"); - state->m_cartslot->snes_stop_addon_cpu("dsp"); - state->m_type = SNES_MODE20; - break; - case SNES_DSP_MODE21: - 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"); - state->m_cartslot->snes_stop_addon_cpu("dsp"); - state->m_type = SNES_MODE21; - break; - case SNES_ST018: - case SNES_CX4: - // we don't emulate the CPU for these yet... - break; - } - } } @@ -1588,72 +1568,6 @@ static MACHINE_CONFIG_DERIVED( snespal, snes ) MACHINE_CONFIG_END -static MACHINE_RESET( snes_addon ) -{ - snes_console_state *state = machine.driver_data(); - UINT8 *ROM = state->memregion("addons")->base(); - - MACHINE_RESET_CALL(snes); - - state->m_io_read = write8_delegate(FUNC(snes_console_state::snes_input_read),state); - state->m_oldjoy1_read = read8_delegate(FUNC(snes_console_state::snes_oldjoy1_read),state); - state->m_oldjoy2_read = read8_delegate(FUNC(snes_console_state::snes_oldjoy2_read),state); - - // if trying to load a game requiring add-on CPU dump from fullpath, load - // such a dump from the BIOS (hacky workaround to support legacy sfc dumps) - switch (state->m_cartslot->get_addon()) - { - case ADDON_DSP1: - state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x2800); - memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_DSP1_OFFSET, 0x2800); - break; - case ADDON_DSP1B: - state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x2800); - memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_DSP1B_OFFSET, 0x2800); - break; - case ADDON_DSP2: - state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x2800); - memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_DSP2_OFFSET, 0x2800); - break; - case ADDON_DSP3: - state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x2800); - memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_DSP3_OFFSET, 0x2800); - break; - case ADDON_DSP4: - state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x2800); - memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_DSP4_OFFSET, 0x2800); - break; - case ADDON_ST010: - state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x11000); - memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_ST10_OFFSET, 0x11000); - break; - case ADDON_ST011: - state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x11000); - memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_ST11_OFFSET, 0x11000); - break; - case ADDON_CX4: - state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x00c00); - memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_CX4_OFFSET, 0x00c00); - break; - case ADDON_ST018: - state->m_cartslot->m_cart->addon_bios_alloc(machine, 0x28000); - memcpy(state->m_cartslot->m_cart->get_addon_bios_base(), ROM + SNES_ST18_OFFSET1, 0x20000); - memcpy(state->m_cartslot->m_cart->get_addon_bios_base() + 0x20000, ROM + SNES_ST18_OFFSET2, 0x8000); - break; - default: - break; - } -} - - -static MACHINE_CONFIG_DERIVED( snes_add, snes ) - MCFG_MACHINE_RESET( snes_addon ) -MACHINE_CONFIG_END - -static MACHINE_CONFIG_DERIVED( snesp_add, snespal ) - MCFG_MACHINE_RESET( snes_addon ) -MACHINE_CONFIG_END - /************************************* * @@ -1668,27 +1582,7 @@ ROM_START( snes ) ROM_LOAD( "spc700.rom", 0, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) /* boot rom */ ROM_END -ROM_START( snes_add ) - ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) - - ROM_REGION( 0x100, "sound_ipl", 0 ) /* IPL ROM */ - ROM_LOAD( "spc700.rom", 0, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) /* boot rom */ - - ROM_REGION( 0x60000, "addons", 0 ) /* add-on chip ROMs (DSP, SFX, etc) */ - ROM_LOAD( "dsp1.bin", SNES_DSP1_OFFSET, 0x02800, CRC(2838f9f5) SHA1(0a03ccb1fd2bea91151c745a4d1f217ae784f889) ) - ROM_LOAD( "dsp1b.bin", SNES_DSP1B_OFFSET, 0x02800, CRC(453557e0) SHA1(3a218b0e4572a8eba6d0121b17fdac9529609220) ) - ROM_LOAD( "dsp2.bin", SNES_DSP2_OFFSET, 0x02800, CRC(8e9fbd9b) SHA1(06dd9fcb118d18f6bbe234e013cb8780e06d6e63) ) - ROM_LOAD( "dsp3.bin", SNES_DSP3_OFFSET, 0x02800, CRC(6b86728a) SHA1(1b133741fad810eb7320c21ecfdd427d25a46da1) ) - ROM_LOAD( "dsp4.bin", SNES_DSP4_OFFSET, 0x02800, CRC(ce0c7783) SHA1(76fd25f7dc26c3b3f7868a3aa78c7684068713e5) ) - ROM_LOAD( "st010.bin", SNES_ST10_OFFSET, 0x11000, CRC(aa11ee2d) SHA1(cc1984e989cb94e3dcbb5f99e085b5414e18a017) ) - ROM_LOAD( "st011.bin", SNES_ST11_OFFSET, 0x11000, CRC(34d2952c) SHA1(1375b8c1efc8cae4962b57dfe22f6b78e1ddacc8) ) - ROM_LOAD( "cx4.bin", SNES_CX4_OFFSET, 0x00c00, CRC(b6e76a6a) SHA1(a002f4efba42775a31185d443f3ed1790b0e949a) ) - ROM_LOAD( "st018_0xf3.bin", SNES_ST18_OFFSET1, 0x20000, CRC(f73d5e10) SHA1(388e3721b94cd074d6ba0eca8616523d2118a6c3) ) - ROM_LOAD( "st018_0xf4.bin", SNES_ST18_OFFSET2, 0x08000, CRC(b5255459) SHA1(b19c0f8f207d62fdabf4bf71442826063bccc626) ) -ROM_END - #define rom_snespal rom_snes -#define rom_snesp_add rom_snes_add /************************************* * @@ -1699,7 +1593,3 @@ ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ CONS( 1989, snes, 0, 0, snes, snes, driver_device, 0, "Nintendo", "Super Nintendo Entertainment System / Super Famicom (NTSC)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) CONS( 1991, snespal, snes, 0, snespal, snes, driver_device, 0, "Nintendo", "Super Nintendo Entertainment System (PAL)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) - -// 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) -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) -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) diff --git a/src/mess/machine/gb_slot.c b/src/mess/machine/gb_slot.c index 3261d70a418..122c9425536 100644 --- a/src/mess/machine/gb_slot.c +++ b/src/mess/machine/gb_slot.c @@ -188,7 +188,7 @@ void base_gb_cart_slot_device::device_config_complete() //------------------------------------------------- -// MD PCB +// GB PCB //------------------------------------------------- diff --git a/src/mess/machine/sns_slot.c b/src/mess/machine/sns_slot.c index fc43d311511..7a47da01a06 100644 --- a/src/mess/machine/sns_slot.c +++ b/src/mess/machine/sns_slot.c @@ -21,10 +21,27 @@ subslots (e.g. BS-X compatible ones), that need to write to subslot (NV)RAM independently to accesses to their own (NV)RAM. - In order to support legacy dumps of games with add-on NEC & Seta DSPs, CX4 and Seta ST018, - we use not only m_type to identify the correct slot device to be used (for this DSP1B, DSP2 and - DSP3 are the same), but also a m_addon variable that snes_add driver uses to load CPU dump from - the system BIOS (for this DSP1B, DSP2 and DSP3 are not the same). + Notes about add-on detection and handling (useful for future addition of st018, cx4, etc.) + =============================================================================================== + When loading from softlist, m_type would be enough to take care of add-on chips, because + the ones needing a CPU dump have it in the zipfile. However, to support these games also + from fullpath, both with files having DSP data appended to the .sfc and with older dumps + missing DSP data, a second variable is present in the SNES slot: m_addon. + From fullpath, support works as follows + - get_default_card_software needs to decide whether to use the main devices or the legacy + ones containing DSP dump as device roms, so it gets m_type as the main device should be + used and if m_addon is ADDON_DSP* or ADDON_ST*, then it checks if the DSP data is appended + or if m_type has to be switched to legacy type + - call_load needs to detect faulty dumps too, to alloc m_addon_bios and copy the data from + the correct place, so if m_addon is ADDON_DSP* or ADDON_ST* it checks whether DSP data is + appended or not: if it is, this data is copied to m_addon_bios; if not, then we are in + the legacy device case and data is copied from the device rom + After the cart has been loaded and emulation has started, only m_type is needed to later + handlers installation and cart accesses + + Also notice that, from softlist, DSP1, 1B, 2, 3 are treated as the same device, because they + all have the same I/O and the only difference (i.e. the DSP data) comes from the zipfile itself. + OTOH, to support faulty dumps missing DSP content, we need separate legacy devices... ***********************************************************************************************************/ @@ -265,14 +282,23 @@ static const sns_slot slot_list[] = // Sufami Turbo carts { SNES_STROM, "strom"}, // pirate carts - { SNES_POKEMON, "lorom_poke"}, - { SNES_TEKKEN2, "lorom_tekken2"}, - { SNES_SOULBLAD, "lorom_sbld"}, - { SNES_MCPIR1, "lorom_mcpir1"}, - { SNES_MCPIR2, "lorom_mcpir2"}, - { SNES_20COL, "lorom_20col"}, - { SNES_BANANA, "lorom_pija"}, // wip - { SNES_BUGS, "lorom_bugs"} // wip + { SNES_POKEMON, "lorom_poke"}, + { SNES_TEKKEN2, "lorom_tekken2"}, + { SNES_SOULBLAD, "lorom_sbld"}, + { SNES_MCPIR1, "lorom_mcpir1"}, + { SNES_MCPIR2, "lorom_mcpir2"}, + { SNES_20COL, "lorom_20col"}, + { SNES_BANANA, "lorom_pija"}, // wip + { SNES_BUGS, "lorom_bugs"}, // wip + // legacy slots to support DSPx games from fullpath + { SNES_DSP1_LEG, "lorom_dsp1leg"}, + { SNES_DSP1B_LEG, "lorom_dsp1bleg"}, + { SNES_DSP2_LEG, "lorom_dsp2leg"}, + { SNES_DSP3_LEG, "lorom_dsp3leg"}, + { SNES_DSP4_LEG, "lorom_dsp4leg"}, + { SNES_DSP1_MODE21_LEG, "hirom_dsp1leg"}, + { SNES_ST010_LEG, "lorom_st10leg"}, + { SNES_ST011_LEG, "lorom_st11leg"} }; static int sns_get_pcb_id(const char *slot) @@ -643,7 +669,7 @@ bool base_sns_cart_slot_device::call_load() } if (software_entry() == NULL) - setup_appended_addon(); + setup_addon_from_fullpath(); setup_nvram(); @@ -697,7 +723,7 @@ void base_sns_cart_slot_device::call_unload() } -void base_sns_cart_slot_device::setup_appended_addon() +void base_sns_cart_slot_device::setup_addon_from_fullpath() { // if we already have an add-on bios or if no addon has been detected, we have nothing to do if (m_cart->get_addon_bios_size() || m_addon == ADDON_NONE) @@ -782,6 +808,53 @@ void base_sns_cart_slot_device::setup_appended_addon() } break; } + + // otherwise, we need to use the legacy versions including DSP dump in device romset + if (!m_cart->get_addon_bios_size()) + { + astring region(m_cart->device().tag(), ":addon"); + UINT8 *ROM = NULL; + + switch (m_addon) + { + case ADDON_DSP1: + ROM = machine().root_device().memregion(region)->base(); + m_cart->addon_bios_alloc(machine(), 0x2800); + memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); + break; + case ADDON_DSP1B: + ROM = machine().root_device().memregion(region)->base(); + m_cart->addon_bios_alloc(machine(), 0x2800); + memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); + break; + case ADDON_DSP2: + ROM = machine().root_device().memregion(region)->base(); + m_cart->addon_bios_alloc(machine(), 0x2800); + memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); + break; + case ADDON_DSP3: + ROM = machine().root_device().memregion(region)->base(); + m_cart->addon_bios_alloc(machine(), 0x2800); + memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); + break; + case ADDON_DSP4: + ROM = machine().root_device().memregion(region)->base(); + m_cart->addon_bios_alloc(machine(), 0x2800); + memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800); + break; + case ADDON_ST010: + ROM = machine().root_device().memregion(region)->base(); + m_cart->addon_bios_alloc(machine(), 0x11000); + memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000); + break; + case ADDON_ST011: + ROM = machine().root_device().memregion(region)->base(); + m_cart->addon_bios_alloc(machine(), 0x11000); + memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000); + break; + } + } + } void base_sns_cart_slot_device::setup_nvram() @@ -959,6 +1032,44 @@ const char * base_sns_cart_slot_device::get_default_card_software(const machine_ offset = snes_skip_header(ROM, len); get_cart_type_addon(ROM + offset, len - offset, type, addon); + // 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) + switch (addon) + { + case ADDON_DSP1: + if ((len & 0x7fff) != 0x2800 && (len & 0x7fff) != 0x2000) + { + if (type == SNES_DSP_MODE21) + type = SNES_DSP1_MODE21_LEG; + else + type = SNES_DSP1_LEG; + } + break; + case ADDON_DSP1B: + if ((len & 0x7fff) != 0x2800 && (len & 0x7fff) != 0x2000) + type = SNES_DSP1B_LEG; + break; + case ADDON_DSP2: + if ((len & 0x7fff) != 0x2800 && (len & 0x7fff) != 0x2000) + type = SNES_DSP2_LEG; + break; + case ADDON_DSP3: + if ((len & 0x7fff) != 0x2800 && (len & 0x7fff) != 0x2000) + type = SNES_DSP3_LEG; + break; + case ADDON_DSP4: + if ((len & 0x7fff) != 0x2800 && (len & 0x7fff) != 0x2000) + type = SNES_DSP4_LEG; + break; + case ADDON_ST010: + if ((len & 0x3ffff) != 0x11000 && (len & 0xffff) != 0xd000) + type = SNES_ST010_LEG; + break; + case ADDON_ST011: + if ((len & 0x3ffff) != 0x11000 && (len & 0xffff) != 0xd000) + type = SNES_ST011_LEG; + break; + } + slot_string = sns_get_slot(type); global_free(ROM); @@ -1036,17 +1147,6 @@ WRITE8_MEMBER(base_sns_cart_slot_device::chip_write) } -/*------------------------------------------------- - snes_stop_addon_cpu - -------------------------------------------------*/ - -void base_sns_cart_slot_device::snes_stop_addon_cpu(const char *cputag) -{ - astring cpu(m_cart->device().tag(), ":", cputag); - if (m_cart && machine().device(cpu)) - machine().device(cpu.cstr())->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); -} - /*------------------------------------------------- Internal header logging -------------------------------------------------*/ diff --git a/src/mess/machine/sns_slot.h b/src/mess/machine/sns_slot.h index 2a2f44c55b1..9c4189d7686 100644 --- a/src/mess/machine/sns_slot.h +++ b/src/mess/machine/sns_slot.h @@ -55,7 +55,16 @@ enum SNES_MCPIR2, SNES_20COL, SNES_BANANA, // wip - SNES_BUGS // wip + SNES_BUGS, // wip + // legacy types to support DSPx games from fullpath + SNES_DSP1_LEG, + SNES_DSP1B_LEG, + SNES_DSP2_LEG, + SNES_DSP3_LEG, + SNES_DSP4_LEG, + SNES_DSP1_MODE21_LEG, + SNES_ST010_LEG, + SNES_ST011_LEG }; /* add-ons to handle legacy dumps in snes_add */ @@ -160,7 +169,6 @@ public: void get_cart_type_addon(UINT8 *ROM, UINT32 len, int &type, int &addon); UINT32 snes_skip_header(UINT8 *ROM, UINT32 snes_rom_size); int get_type() { return m_type; } - int get_addon() { return m_addon; } void setup_nvram(); void internal_header_logging(UINT8 *ROM, UINT32 len); @@ -186,12 +194,9 @@ public: virtual DECLARE_READ8_MEMBER(chip_read); virtual DECLARE_WRITE8_MEMBER(chip_write); - // in order to support legacy dumps, we enable add-on CPUs even when loading from fullpath - // and then we stop them at MACHINE_RESET to avoid crashes - void snes_stop_addon_cpu(const char *cputag); // in order to support legacy dumps + add-on CPU dump appended at the end of the file, we // check if the required data is present and update bank map accordingly - void setup_appended_addon(); + void setup_addon_from_fullpath(); // m_cart cannot be made private yet, because we need to check nvram_size from the driver... diff --git a/src/mess/machine/sns_upd.c b/src/mess/machine/sns_upd.c index f6b3054a501..35a2adea374 100644 --- a/src/mess/machine/sns_upd.c +++ b/src/mess/machine/sns_upd.c @@ -22,12 +22,24 @@ const device_type SNS_LOROM_SETA10 = &device_creator; const device_type SNS_LOROM_SETA11 = &device_creator; +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) + : sns_rom_device(mconfig, type, name, tag, owner, clock), + m_upd7725(*this, "dsp") +{ +} + sns_rom20_necdsp_device::sns_rom20_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : sns_rom_device(mconfig, SNS_LOROM_NECDSP, "SNES Cart (LoROM) + NEC DSP", tag, owner, clock), m_upd7725(*this, "dsp") { } +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) + : sns_rom21_device(mconfig, type, name, tag, owner, clock), + m_upd7725(*this, "dsp") +{ +} + sns_rom21_necdsp_device::sns_rom21_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : sns_rom21_device(mconfig, SNS_HIROM_NECDSP, "SNES Cart (HiROM) + NEC DSP", tag, owner, clock), m_upd7725(*this, "dsp") @@ -326,3 +338,176 @@ machine_config_constructor sns_rom_seta11dsp_device::device_mconfig_additions() { return MACHINE_CONFIG_NAME( snes_st011 ); } + + + + +// Legacy versions including DSP dump roms, in order to support faulty dumps missing DSP data... + +const device_type SNS_LOROM_NECDSP1_LEG = &device_creator; +const device_type SNS_LOROM_NECDSP1B_LEG = &device_creator; +const device_type SNS_LOROM_NECDSP2_LEG = &device_creator; +const device_type SNS_LOROM_NECDSP3_LEG = &device_creator; +const device_type SNS_LOROM_NECDSP4_LEG = &device_creator; +const device_type SNS_HIROM_NECDSP1_LEG = &device_creator; +const device_type SNS_LOROM_SETA10_LEG = &device_creator; +const device_type SNS_LOROM_SETA11_LEG = &device_creator; + + +sns_rom20_necdsp1_legacy_device::sns_rom20_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP1_LEG, "SNES Cart (LoROM) + NEC DSP1 Legacy", tag, owner, clock) +{ +} + +sns_rom20_necdsp1b_legacy_device::sns_rom20_necdsp1b_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP1B_LEG, "SNES Cart (LoROM) + NEC DSP1B Legacy", tag, owner, clock) +{ +} + +sns_rom20_necdsp2_legacy_device::sns_rom20_necdsp2_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP2_LEG, "SNES Cart (LoROM) + NEC DSP2 Legacy", tag, owner, clock) +{ +} + +sns_rom20_necdsp3_legacy_device::sns_rom20_necdsp3_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP3_LEG, "SNES Cart (LoROM) + NEC DSP3 Legacy", tag, owner, clock) +{ +} + +sns_rom20_necdsp4_legacy_device::sns_rom20_necdsp4_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP4_LEG, "SNES Cart (LoROM) + NEC DSP4 Legacy", tag, owner, clock) +{ +} + +sns_rom21_necdsp1_legacy_device::sns_rom21_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sns_rom21_necdsp_device(mconfig, SNS_HIROM_NECDSP1_LEG, "SNES Cart (HiROM) + NEC DSP1 Legacy", tag, owner, clock) +{ +} + +sns_rom_seta10dsp_legacy_device::sns_rom_seta10dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sns_rom_setadsp_device(mconfig, SNS_LOROM_SETA10_LEG, "SNES Cart (LoROM) + Seta ST010 DSP Legacy", tag, owner, clock) +{ +} + +sns_rom_seta11dsp_legacy_device::sns_rom_seta11dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sns_rom_setadsp_device(mconfig, SNS_LOROM_SETA11_LEG, "SNES Cart (LoROM) + Seta ST011 DSP Legacy", tag, owner, clock) +{ +} + + +machine_config_constructor sns_rom20_necdsp1_legacy_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( snes_dsp_lorom ); +} + +machine_config_constructor sns_rom20_necdsp1b_legacy_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( snes_dsp_lorom ); +} + +machine_config_constructor sns_rom20_necdsp2_legacy_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( snes_dsp_lorom ); +} + +machine_config_constructor sns_rom20_necdsp3_legacy_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( snes_dsp_lorom ); +} + +machine_config_constructor sns_rom20_necdsp4_legacy_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( snes_dsp_lorom ); +} + +machine_config_constructor sns_rom21_necdsp1_legacy_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( snes_dsp_hirom ); +} + +machine_config_constructor sns_rom_seta10dsp_legacy_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( snes_st010 ); +} + +machine_config_constructor sns_rom_seta11dsp_legacy_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( snes_st011 ); +} + + +ROM_START( snes_dsp1 ) + ROM_REGION(0x2800, "addon", 0) + ROM_LOAD( "dsp1.bin", 0, 0x02800, CRC(2838f9f5) SHA1(0a03ccb1fd2bea91151c745a4d1f217ae784f889) ) +ROM_END + +ROM_START( snes_dsp1b ) + ROM_REGION(0x2800, "addon", 0) + ROM_LOAD( "dsp1b.bin", 0, 0x02800, CRC(453557e0) SHA1(3a218b0e4572a8eba6d0121b17fdac9529609220) ) +ROM_END + +ROM_START( snes_dsp2 ) + ROM_REGION(0x2800, "addon", 0) + ROM_LOAD( "dsp2.bin", 0, 0x02800, CRC(8e9fbd9b) SHA1(06dd9fcb118d18f6bbe234e013cb8780e06d6e63) ) +ROM_END + +ROM_START( snes_dsp3 ) + ROM_REGION(0x2800, "addon", 0) + ROM_LOAD( "dsp3.bin", 0, 0x02800, CRC(6b86728a) SHA1(1b133741fad810eb7320c21ecfdd427d25a46da1) ) +ROM_END + +ROM_START( snes_dsp4 ) + ROM_REGION(0x2800, "addon", 0) + ROM_LOAD( "dsp4.bin", 0, 0x02800, CRC(ce0c7783) SHA1(76fd25f7dc26c3b3f7868a3aa78c7684068713e5) ) +ROM_END + +ROM_START( snes_st010 ) + ROM_REGION(0x11000, "addon", 0) + ROM_LOAD( "st010.bin", 0, 0x11000, CRC(aa11ee2d) SHA1(cc1984e989cb94e3dcbb5f99e085b5414e18a017) ) +ROM_END + +ROM_START( snes_st011 ) + ROM_REGION(0x11000, "addon", 0) + ROM_LOAD( "st011.bin", 0, 0x11000, CRC(34d2952c) SHA1(1375b8c1efc8cae4962b57dfe22f6b78e1ddacc8) ) +ROM_END + +const rom_entry *sns_rom20_necdsp1_legacy_device::device_rom_region() const +{ + return ROM_NAME( snes_dsp1 ); +} + +const rom_entry *sns_rom20_necdsp1b_legacy_device::device_rom_region() const +{ + return ROM_NAME( snes_dsp1b ); +} + +const rom_entry *sns_rom20_necdsp2_legacy_device::device_rom_region() const +{ + return ROM_NAME( snes_dsp2 ); +} + +const rom_entry *sns_rom20_necdsp3_legacy_device::device_rom_region() const +{ + return ROM_NAME( snes_dsp3 ); +} + +const rom_entry *sns_rom20_necdsp4_legacy_device::device_rom_region() const +{ + return ROM_NAME( snes_dsp4 ); +} + +const rom_entry *sns_rom21_necdsp1_legacy_device::device_rom_region() const +{ + return ROM_NAME( snes_dsp1 ); +} + +const rom_entry *sns_rom_seta10dsp_legacy_device::device_rom_region() const +{ + return ROM_NAME( snes_st010 ); +} + +const rom_entry *sns_rom_seta11dsp_legacy_device::device_rom_region() const +{ + return ROM_NAME( snes_st011 ); +} + diff --git a/src/mess/machine/sns_upd.h b/src/mess/machine/sns_upd.h index 3a82d13ba7a..4726ab587ce 100644 --- a/src/mess/machine/sns_upd.h +++ b/src/mess/machine/sns_upd.h @@ -12,6 +12,7 @@ class sns_rom20_necdsp_device : public sns_rom_device { public: // construction/destruction + sns_rom20_necdsp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); sns_rom20_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // device-level overrides @@ -35,6 +36,7 @@ class sns_rom21_necdsp_device : public sns_rom21_device { public: // construction/destruction + sns_rom21_necdsp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); sns_rom21_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // device-level overrides @@ -74,7 +76,7 @@ public: virtual DECLARE_READ16_MEMBER(setadsp_data_r); }; -// ======================> sns_rom_seta10_device +// ======================> sns_rom_seta10dsp_device class sns_rom_seta10dsp_device : public sns_rom_setadsp_device { @@ -87,7 +89,7 @@ public: virtual machine_config_constructor device_mconfig_additions() const; }; -// ======================> sns_rom_seta11_device [Faster CPU than ST010] +// ======================> sns_rom_seta11dsp_device [Faster CPU than ST010] class sns_rom_seta11dsp_device : public sns_rom_setadsp_device { @@ -107,4 +109,114 @@ extern const device_type SNS_HIROM_NECDSP; extern const device_type SNS_LOROM_SETA10; extern const device_type SNS_LOROM_SETA11; + + + +// Devices including DSP dumps to support faulty .sfc dumps missing DSP data + +class sns_rom20_necdsp1_legacy_device : public sns_rom20_necdsp_device +{ +public: + // construction/destruction + sns_rom20_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_config_complete() { m_shortname = "dsp1leg"; } + virtual machine_config_constructor device_mconfig_additions() const; + virtual const rom_entry *device_rom_region() const; +}; + +class sns_rom20_necdsp1b_legacy_device : public sns_rom20_necdsp_device +{ +public: + // construction/destruction + sns_rom20_necdsp1b_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_config_complete() { m_shortname = "dsp1bleg"; } + virtual machine_config_constructor device_mconfig_additions() const; + virtual const rom_entry *device_rom_region() const; +}; + +class sns_rom20_necdsp2_legacy_device : public sns_rom20_necdsp_device +{ +public: + // construction/destruction + sns_rom20_necdsp2_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_config_complete() { m_shortname = "dsp2leg"; } + virtual machine_config_constructor device_mconfig_additions() const; + virtual const rom_entry *device_rom_region() const; +}; + +class sns_rom20_necdsp3_legacy_device : public sns_rom20_necdsp_device +{ +public: + // construction/destruction + sns_rom20_necdsp3_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_config_complete() { m_shortname = "dsp3leg"; } + virtual machine_config_constructor device_mconfig_additions() const; + virtual const rom_entry *device_rom_region() const; +}; + +class sns_rom20_necdsp4_legacy_device : public sns_rom20_necdsp_device +{ +public: + // construction/destruction + sns_rom20_necdsp4_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_config_complete() { m_shortname = "dsp4leg"; } + virtual machine_config_constructor device_mconfig_additions() const; + virtual const rom_entry *device_rom_region() const; +}; + +class sns_rom21_necdsp1_legacy_device : public sns_rom21_necdsp_device +{ +public: + // construction/destruction + sns_rom21_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_config_complete() { m_shortname = "dsp1leg_hi"; } + virtual machine_config_constructor device_mconfig_additions() const; + virtual const rom_entry *device_rom_region() const; +}; + +class sns_rom_seta10dsp_legacy_device : public sns_rom_setadsp_device +{ +public: + // construction/destruction + sns_rom_seta10dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_config_complete() { m_shortname = "seta10leg"; } + virtual machine_config_constructor device_mconfig_additions() const; + virtual const rom_entry *device_rom_region() const; +}; + +class sns_rom_seta11dsp_legacy_device : public sns_rom_setadsp_device +{ +public: + // construction/destruction + sns_rom_seta11dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_config_complete() { m_shortname = "seta11leg"; } + virtual machine_config_constructor device_mconfig_additions() const; + virtual const rom_entry *device_rom_region() const; +}; + +extern const device_type SNS_LOROM_NECDSP1_LEG; +extern const device_type SNS_LOROM_NECDSP1B_LEG; +extern const device_type SNS_LOROM_NECDSP2_LEG; +extern const device_type SNS_LOROM_NECDSP3_LEG; +extern const device_type SNS_LOROM_NECDSP4_LEG; +extern const device_type SNS_HIROM_NECDSP1_LEG; +extern const device_type SNS_LOROM_SETA10_LEG; +extern const device_type SNS_LOROM_SETA11_LEG; + #endif diff --git a/src/mess/mess.lst b/src/mess/mess.lst index f9d1cc59803..8b20eb049b6 100644 --- a/src/mess/mess.lst +++ b/src/mess/mess.lst @@ -70,8 +70,6 @@ gbcolor // Nintendo Game Boy Color Handheld gba // Nintendo Game Boy Advance Handheld snes // Nintendo Super Nintendo NTSC snespal // Nintendo Super Nintendo PAL -snes_add // Nintendo Super Nintendo NTSC w/add-on CPUs as BIOS (legacy driver to run old dumps) -snesp_add // Nintendo Super Nintendo PAL w/add-on CPUs as BIOS (legacy driver to run old dumps) n64 // Nintendo N64 n64dd // Nintendo N64 (64DD Attachment) pokemini // Nintendo Pokemon Mini