diff --git a/hash/nes.xml b/hash/nes.xml index 50c01537ccf..f81b66423e2 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -82360,18 +82360,21 @@ be better to redump them properly. --> - - Mario Family 10 in 1 - 19?? + + Super Mario Family 10 in 1 + 1992? <pirate> - - - - + + + + - - + + + + + diff --git a/src/devices/bus/nes/mmc3_clones.cpp b/src/devices/bus/nes/mmc3_clones.cpp index aba487fccba..828189f9767 100644 --- a/src/devices/bus/nes/mmc3_clones.cpp +++ b/src/devices/bus/nes/mmc3_clones.cpp @@ -74,6 +74,7 @@ DEFINE_DEVICE_TYPE(NES_BMC_K3006, nes_bmc_k3006_device, "nes_bmc_k3006", DEFINE_DEVICE_TYPE(NES_BMC_K3033, nes_bmc_k3033_device, "nes_bmc_k3033", "NES Cart BMC K-3033 PCB") DEFINE_DEVICE_TYPE(NES_BMC_00202650, nes_bmc_00202650_device, "nes_bmc_00202650", "NES Cart BMC 00202650 PCB") DEFINE_DEVICE_TYPE(NES_BMC_411120C, nes_bmc_411120c_device, "nes_bmc_411120c", "NES Cart BMC 411120C PCB") +DEFINE_DEVICE_TYPE(NES_BMC_810305C, nes_bmc_810305c_device, "nes_bmc_810305c", "NES Cart BMC 81-03-05-C PCB") DEFINE_DEVICE_TYPE(NES_BMC_820720C, nes_bmc_820720c_device, "nes_bmc_820720c", "NES Cart BMC 820720C PCB") DEFINE_DEVICE_TYPE(NES_BMC_830118C, nes_bmc_830118c_device, "nes_bmc_830118c", "NES Cart BMC 830118C PCB") DEFINE_DEVICE_TYPE(NES_BMC_830832C, nes_bmc_830832c_device, "nes_bmc_830832c", "NES Cart BMC 830832C PCB") @@ -367,6 +368,11 @@ nes_bmc_411120c_device::nes_bmc_411120c_device(const machine_config &mconfig, co { } +nes_bmc_810305c_device::nes_bmc_810305c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_txsrom_device(mconfig, NES_BMC_810305C, tag, owner, clock), m_outer(0) +{ +} + nes_bmc_820720c_device::nes_bmc_820720c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_txrom_device(mconfig, NES_BMC_820720C, tag, owner, clock), m_reg(0) { @@ -865,6 +871,20 @@ void nes_bmc_411120c_device::pcb_reset() mmc3_common_initialize(0x0f, 0x7f, 0); } +void nes_bmc_810305c_device::device_start() +{ + mmc3_start(); + save_item(NAME(m_outer)); +} + +void nes_bmc_810305c_device::pcb_reset() +{ + m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; + + m_outer = 0; + mmc3_common_initialize(0x1f, 0x7f, 0); +} + void nes_bmc_820720c_device::device_start() { mmc3_start(); @@ -3007,6 +3027,77 @@ void nes_bmc_411120c_device::write_m(offs_t offset, u8 data) } } +/*------------------------------------------------- + + BMC-81-03-05-C + + Games: 92' Super Mario Family + + MMC3 clone with banking for multigame menu. Note, + this cart has one TxSROM game (SMB4) and so it uses + the nonstandard MMC3 mirroring of those boards. + + NES 2.0: mapper 353 + + In MAME: Partially supported. + + TODO: Banking isn't quite right. Golden Mario, the + 4th game, should be SMB2J but loads as plain old + Mario Bros with garbled graphics. Golden Mario + should be on the last outer bank #3. + + -------------------------------------------------*/ + +void nes_bmc_810305c_device::set_prg(int prg_base, int prg_mask) +{ + u8 a17 = BIT(m_mmc_vrom_bank[0], 7); + + nes_txrom_device::set_prg(prg_base | (m_outer == 2 && a17) << 4, prg_mask); + + if (m_outer == 3 && !a17) + { + prg8_cd(m_mmc_prg_bank[0] | 0x70); + prg8_ef(m_mmc_prg_bank[1] | 0x70); + } +} + +void nes_bmc_810305c_device::set_chr(u8 chr, int chr_base, int chr_mask) +{ + if (m_outer == 2 && BIT(m_mmc_vrom_bank[0], 7)) + chr8(0, CHRRAM); + else + nes_txrom_device::set_chr(chr, chr_base, chr_mask); +} + +void nes_bmc_810305c_device::chr_cb(int start, int bank, int source) +{ + if (m_outer) + nes_txrom_device::chr_cb(start, bank, source); + else + nes_txsrom_device::chr_cb(start, bank, source); +} + +void nes_bmc_810305c_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_810305c write_h, offset: %04x, data: %02x\n", offset, data)); + + if (BIT(offset, 7)) // outer register + { + m_outer = (offset >> 13) & 0x03; + + m_prg_base = m_outer << 5; + m_prg_mask = 0x1f >> (m_outer == 2); + set_prg(m_prg_base, m_prg_mask); + + m_chr_base = m_outer << 7; + set_chr(m_chr_source, m_chr_base, m_chr_mask); + } + else if (m_outer) // standard MMC3 registers + nes_txrom_device::write_h(offset, data); + else // TxSROM MMC3 registers without mirroring bit + nes_txsrom_device::write_h(offset, data); +} + /*------------------------------------------------- BMC-820720C diff --git a/src/devices/bus/nes/mmc3_clones.h b/src/devices/bus/nes/mmc3_clones.h index f1d73d146f2..61cfa0d568e 100644 --- a/src/devices/bus/nes/mmc3_clones.h +++ b/src/devices/bus/nes/mmc3_clones.h @@ -884,6 +884,31 @@ private: }; +// ======================> nes_bmc_810305c_device + +class nes_bmc_810305c_device : public nes_txsrom_device +{ +public: + // construction/destruction + nes_bmc_810305c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual void write_h(offs_t offset, u8 data) override; + virtual void chr_cb(int start, int bank, int source) override; + + virtual void pcb_reset() override; + +protected: + // device-level overrides + virtual void device_start() override; + + virtual void set_prg(int prg_base, int prg_mask) override; + virtual void set_chr(u8 chr, int chr_base, int chr_mask) override; + +private: + u8 m_outer; +}; + + // ======================> nes_bmc_820720c_device class nes_bmc_820720c_device : public nes_txrom_device @@ -1069,6 +1094,7 @@ DECLARE_DEVICE_TYPE(NES_BMC_K3006, nes_bmc_k3006_device) DECLARE_DEVICE_TYPE(NES_BMC_K3033, nes_bmc_k3033_device) DECLARE_DEVICE_TYPE(NES_BMC_00202650, nes_bmc_00202650_device) DECLARE_DEVICE_TYPE(NES_BMC_411120C, nes_bmc_411120c_device) +DECLARE_DEVICE_TYPE(NES_BMC_810305C, nes_bmc_810305c_device) DECLARE_DEVICE_TYPE(NES_BMC_820720C, nes_bmc_820720c_device) DECLARE_DEVICE_TYPE(NES_BMC_830118C, nes_bmc_830118c_device) DECLARE_DEVICE_TYPE(NES_BMC_830832C, nes_bmc_830832c_device) diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index 5b8e5d03fbd..29fc3cc5541 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -451,6 +451,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("bmc_gold7in1", NES_BMC_GOLD7IN1); device.option_add_internal("bmc_00202650", NES_BMC_00202650); device.option_add_internal("bmc_411120c", NES_BMC_411120C); + device.option_add_internal("bmc_810305c", NES_BMC_810305C); device.option_add_internal("bmc_820720c", NES_BMC_820720C); device.option_add_internal("bmc_830118c", NES_BMC_830118C); device.option_add_internal("bmc_830832c", NES_BMC_830832C); diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index ed4f49034ae..b8c1a5a59c3 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -388,7 +388,7 @@ static const nes_mmc mmc_list[] = // { 350, BMC_891227 }, not in nes.xml { 351, BMC_TECHLINE9IN1 }, { 352, KAISER_KS106C }, // 4-in-1 - // 353 Super Mario Family multicart + { 353, BMC_810305C }, // Super Mario Family multicart // 354 250-in-1 multicart with FDS Bubble Bobble // 355 Hwang Shinwei 3-D Block etc, currently has unemulated PIC16C54 // 356 7-in-1 Rockman (JY-208) diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index 56cc5f4adfc..20b18da7827 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -324,6 +324,7 @@ static const nes_pcb pcb_list[] = { "bmc_gold7in1", BMC_GOLD_7IN1 }, { "bmc_00202650", BMC_00202650 }, { "bmc_411120c", BMC_411120C }, + { "bmc_810305c", BMC_810305C }, { "bmc_820720c", BMC_820720C }, { "bmc_830118c", BMC_830118C }, { "bmc_830832c", BMC_830832C }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index cd29cd78633..476b0fdbc73 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -102,8 +102,9 @@ enum BMC_EL860947C, BMC_EL861121C, BMC_FK23C, BMC_FK23CA, BMC_JY820845C, BMC_PJOY84, BMC_TH22913, BMC_11160, BMC_G146, BMC_2751, BMC_8157, BMC_00202650, - BMC_820720C, BMC_830118C, BMC_830832C, BMC_YY841101C, BMC_YY841155C, - BMC_411120C, BMC_GOLD150, BMC_GOLD260, + BMC_411120C, BMC_810305C, BMC_820720C, BMC_830118C, + BMC_830832C, BMC_YY841101C, BMC_YY841155C, + BMC_GOLD150, BMC_GOLD260, BMC_12IN1, BMC_4IN1RESET, BMC_42IN1RESET, BMC_LITTLECOM160, BMC_CTC09, BMC_K1029, BMC_K3006, BMC_K3033, BMC_K3036, BMC_K3046, BMC_SA005A, BMC_TJ03, BMC_RESETSXROM, BMC_RESETTXROM, BMC_TECHLINE9IN1,