diff options
author | 2021-12-30 13:06:56 -0900 | |
---|---|---|
committer | 2021-12-30 17:06:56 -0500 | |
commit | 46071314578f2b960f246f51feff4403b047ebdb (patch) | |
tree | 46d6565ec663aebd9ea8f651558c984cc45748bb /src/devices/bus | |
parent | 4aca8e189096236b4d5586cf993882a5f2a30e66 (diff) |
bus/nes: Added support for multicart board FAM250. (#9071)
New working software list additions (nes.xml)
-----------------------------------
250 in 1 [krzysiobal]
Diffstat (limited to 'src/devices/bus')
-rw-r--r-- | src/devices/bus/nes/multigame.cpp | 76 | ||||
-rw-r--r-- | src/devices/bus/nes/multigame.h | 27 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_carts.cpp | 1 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_ines.hxx | 2 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_pcb.hxx | 1 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_slot.h | 4 |
6 files changed, 106 insertions, 5 deletions
diff --git a/src/devices/bus/nes/multigame.cpp b/src/devices/bus/nes/multigame.cpp index 0c4265482f0..383503546e6 100644 --- a/src/devices/bus/nes/multigame.cpp +++ b/src/devices/bus/nes/multigame.cpp @@ -54,6 +54,7 @@ DEFINE_DEVICE_TYPE(NES_BMC_850437C, nes_bmc_850437c_device, "nes_bmc_85043 DEFINE_DEVICE_TYPE(NES_BMC_970630C, nes_bmc_970630c_device, "nes_bmc_970630c", "NES Cart BMC 970630C PCB") DEFINE_DEVICE_TYPE(NES_NTD03, nes_ntd03_device, "nes_ntd03", "NES Cart NTD-03 PCB") DEFINE_DEVICE_TYPE(NES_BMC_CTC09, nes_bmc_ctc09_device, "nes_bmc_ctc09", "NES Cart BMC CTC-09 PCB") +DEFINE_DEVICE_TYPE(NES_BMC_FAM250, nes_bmc_fam250_device, "nes_bmc_fam250", "NES Cart BMC FAM250 PCB") DEFINE_DEVICE_TYPE(NES_BMC_GKA, nes_bmc_gka_device, "nes_bmc_gka", "NES Cart BMC GK-A PCB") DEFINE_DEVICE_TYPE(NES_BMC_GKB, nes_bmc_gkb_device, "nes_bmc_gkb", "NES Cart BMC GK-B PCB") DEFINE_DEVICE_TYPE(NES_BMC_GKCXIN1, nes_bmc_gkcxin1_device, "nes_bmc_gkcxin1", "NES Cart BMC GKCXIN1 PCB") @@ -460,8 +461,18 @@ nes_bmc_60311c_device::nes_bmc_60311c_device(const machine_config &mconfig, cons { } +nes_bmc_k1029_device::nes_bmc_k1029_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : nes_vram_protect_device(mconfig, type, tag, owner, clock) +{ +} + nes_bmc_k1029_device::nes_bmc_k1029_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : nes_vram_protect_device(mconfig, NES_BMC_K1029, tag, owner, clock) + : nes_bmc_k1029_device(mconfig, NES_BMC_K1029, tag, owner, clock) +{ +} + +nes_bmc_fam250_device::nes_bmc_fam250_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_bmc_k1029_device(mconfig, NES_BMC_FAM250, tag, owner, clock), m_latch(0), m_reg(0) { } @@ -1140,6 +1151,21 @@ void nes_bmc_60311c_device::pcb_reset() update_banks(); } +void nes_bmc_fam250_device::device_start() +{ + nes_bmc_k1029_device::device_start(); + save_item(NAME(m_latch)); + save_item(NAME(m_reg)); +} + +void nes_bmc_fam250_device::pcb_reset() +{ + nes_bmc_k1029_device::pcb_reset(); + + m_latch = 0; + m_reg = 0; +} + void nes_n625092_device::device_start() { nes_vram_protect_device::device_start(); @@ -2380,7 +2406,7 @@ u8 nes_bmc_ball11_device::read_m(offs_t offset) LOG_MMC(("bmc_ball11 read_m, offset: %04x, data: %02x\n", offset)); u8 bank = m_reg[1] << 2 | (m_reg[0] ? 0x23 : 0x2f); - return m_prg[bank * 0x2000 + offset]; + return m_prg[(bank * 0x2000 + offset) & (m_prg_size - 1)]; } void nes_bmc_ball11_device::update_prg() @@ -3204,6 +3230,52 @@ void nes_bmc_60311c_device::write_h(offs_t offset, u8 data) /*------------------------------------------------- + BMC-FAM250 + + Games: 250 in 1 + + This board is very close to the K-1029 board of the + famous Contra 100 and 168 multicarts. It sports an + extra mode to support a Bubble Bobble FDS bootleg. + + NES 2.0: mapper 354 + + In MAME: Supported. + + TODO: Circus Charlie's mirroring is incorrectly set + to horizontal. Is this a BTANB? + + -------------------------------------------------*/ + +u8 nes_bmc_fam250_device::read_m(offs_t offset) +{ +// LOG_MMC(("fam250 read_m, offset: %04x\n", offset)); + + if (m_latch == 5) // only the Bubble Bobble FDS bootleg uses this + return m_prg[(((m_reg & 0x1f) << 1 | BIT(m_reg, 7)) * 0x2000 + offset) & (m_prg_size - 1)]; + else + return get_open_bus(); +} + +void nes_bmc_fam250_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("fam250 write_h, offset: %04x, data: %02x\n", offset, data)); + + if (offset >= 0x7000) + { + nes_bmc_k1029_device::write_h(offset, data); + + m_latch = offset & 0x07; + m_reg = data; + if (m_latch == 5) + prg32((m_reg & 0x18) >> 1 | 0x03); + + m_vram_protect = BIT(offset, 3); + } +} + +/*------------------------------------------------- + BMC-K-1029 Games: 100 in 1 Contra Function 16, 168 in 1 diff --git a/src/devices/bus/nes/multigame.h b/src/devices/bus/nes/multigame.h index a5f2f1a307f..31c38a08955 100644 --- a/src/devices/bus/nes/multigame.h +++ b/src/devices/bus/nes/multigame.h @@ -1183,6 +1183,32 @@ public: nes_bmc_k1029_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); virtual void write_h(offs_t offset, u8 data) override; + +protected: + // construction/destruction + nes_bmc_k1029_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); +}; + + +// ======================> nes_bmc_fam250_device + +class nes_bmc_fam250_device : public nes_bmc_k1029_device +{ +public: + // construction/destruction + nes_bmc_fam250_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual u8 read_m(offs_t offset) override; + virtual void write_h(offs_t offset, u8 data) override; + + virtual void pcb_reset() override; + +protected: + // device-level overrides + virtual void device_start() override; + +private: + u8 m_latch, m_reg; }; @@ -1244,6 +1270,7 @@ DECLARE_DEVICE_TYPE(NES_BMC_850437C, nes_bmc_850437c_device) DECLARE_DEVICE_TYPE(NES_BMC_970630C, nes_bmc_970630c_device) DECLARE_DEVICE_TYPE(NES_NTD03, nes_ntd03_device) DECLARE_DEVICE_TYPE(NES_BMC_CTC09, nes_bmc_ctc09_device) +DECLARE_DEVICE_TYPE(NES_BMC_FAM250, nes_bmc_fam250_device) DECLARE_DEVICE_TYPE(NES_BMC_GKA, nes_bmc_gka_device) DECLARE_DEVICE_TYPE(NES_BMC_GKB, nes_bmc_gkb_device) DECLARE_DEVICE_TYPE(NES_BMC_GKCXIN1, nes_bmc_gkcxin1_device) diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index 729d6e4a51c..ba99930536a 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -393,6 +393,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("n32_4in1", NES_N32_4IN1); device.option_add_internal("ntd03", NES_NTD03); device.option_add_internal("bmc_ctc09", NES_BMC_CTC09); + device.option_add_internal("bmc_fam250", NES_BMC_FAM250); device.option_add_internal("bmc_gka", NES_BMC_GKA); device.option_add_internal("bmc_gkb", NES_BMC_GKB); device.option_add_internal("bmc_gkcxin1", NES_BMC_GKCXIN1); diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index 4a5496a39a9..d33c723d26e 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -389,7 +389,7 @@ static const nes_mmc mmc_list[] = { 351, BMC_TECHLINE9IN1 }, { 352, KAISER_KS106C }, // 4-in-1 { 353, BMC_810305C }, // Super Mario Family multicart - // 354 250-in-1 multicart with FDS Bubble Bobble + { 354, BMC_FAM250 }, // 355 Hwang Shinwei 3-D Block etc, currently has unemulated PIC16C54 { 356, BMC_JY208 }, // 357 Bit Corp 4-in-1 (ID 4602) diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index 8bed49c9257..eb1fa98da3e 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -273,6 +273,7 @@ static const nes_pcb pcb_list[] = { "n32_4in1", BMC_N32_4IN1 }, { "ntd03", BMC_NTD_03 }, { "bmc_ctc09", BMC_CTC09 }, + { "bmc_fam250", BMC_FAM250 }, { "bmc_gka", BMC_GKA }, { "bmc_gkb", BMC_GKB }, { "bmc_gkcxin1", BMC_GKCXIN1 }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index df06c894daf..33f258f83cb 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -100,8 +100,8 @@ enum BMC_60311C, BMC_80013B, BMC_810544C, BMC_830425C, BMC_830506C, BMC_830928C, BMC_850437C, BMC_970630C, BMC_N32_4IN1, BMC_NC20MB, BMC_NT639, BMC_NTD_03, BMC_SRPG_5IN1, - BMC_EL860947C, BMC_EL861121C, BMC_FK23C, BMC_FK23CA, BMC_JY012005, - BMC_JY820845C, BMC_PJOY84, BMC_TH22913, BMC_11160, BMC_G146, + BMC_EL860947C, BMC_EL861121C, BMC_FAM250, BMC_FK23C, BMC_FK23CA, + BMC_JY012005, BMC_JY820845C, BMC_PJOY84, BMC_TH22913, BMC_11160, BMC_G146, BMC_2751, BMC_8157, BMC_00202650, BMC_411120C, BMC_810305C, BMC_820720C, BMC_830118C, BMC_830832C, BMC_YY841101C, BMC_YY841155C, |