summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes
diff options
context:
space:
mode:
author 0kmg <9137159+0kmg@users.noreply.github.com>2022-01-25 14:10:05 -0900
committer GitHub <noreply@github.com>2022-01-25 18:10:05 -0500
commit2a8eda25406cd04b91a482fb6d9a3471c3b7ae37 (patch)
tree84282f12ace5fb6a8720bd2d9768ef7906b50f87 /src/devices/bus/nes
parent3bf2c17c1da80a9a47e17100bd8a5f7b91d4ae9a (diff)
bus/nes: Added support for BMC-CTC-12IN1 and BMC-891227 boards. (#9207)
* bus/nes: Added support for BMC-CTC-12IN1 and BMC-891227 boards. New working software list additions (nes.xml) ----------------------------------- 12 in 1 Game Card [anonymous] Super 15 in 1 Game Card [anonymous] * Fixed most of the mirroring glitches for 12 in 1 Hwang Shinwei. * Typo in comment.
Diffstat (limited to 'src/devices/bus/nes')
-rw-r--r--src/devices/bus/nes/multigame.cpp116
-rw-r--r--src/devices/bus/nes/multigame.h38
-rw-r--r--src/devices/bus/nes/nes_carts.cpp2
-rw-r--r--src/devices/bus/nes/nes_ines.hxx4
-rw-r--r--src/devices/bus/nes/nes_pcb.hxx2
-rw-r--r--src/devices/bus/nes/nes_slot.h6
6 files changed, 163 insertions, 5 deletions
diff --git a/src/devices/bus/nes/multigame.cpp b/src/devices/bus/nes/multigame.cpp
index 383503546e6..33aff6df695 100644
--- a/src/devices/bus/nes/multigame.cpp
+++ b/src/devices/bus/nes/multigame.cpp
@@ -51,9 +51,11 @@ DEFINE_DEVICE_TYPE(NES_BMC_810544C, nes_bmc_810544c_device, "nes_bmc_81054
DEFINE_DEVICE_TYPE(NES_BMC_830425C, nes_bmc_830425c_device, "nes_bmc_830425c", "NES Cart BMC 830425C-4391T PCB")
DEFINE_DEVICE_TYPE(NES_BMC_830928C, nes_bmc_830928c_device, "nes_bmc_830928c", "NES Cart BMC 830928C PCB")
DEFINE_DEVICE_TYPE(NES_BMC_850437C, nes_bmc_850437c_device, "nes_bmc_850437c", "NES Cart BMC 850437C PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_891227, nes_bmc_891227_device, "nes_bmc_891227", "NES Cart BMC 891227 PCB")
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_CTC12IN1, nes_bmc_ctc12in1_device, "nes_bmc_ctc12in1", "NES Cart BMC CTC-12IN1 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")
@@ -461,6 +463,21 @@ nes_bmc_60311c_device::nes_bmc_60311c_device(const machine_config &mconfig, cons
{
}
+nes_bmc_ctc12in1_device::nes_bmc_ctc12in1_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_ctc12in1_device::nes_bmc_ctc12in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_bmc_ctc12in1_device(mconfig, NES_BMC_CTC12IN1, tag, owner, clock)
+{
+}
+
+nes_bmc_891227_device::nes_bmc_891227_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_bmc_ctc12in1_device(mconfig, NES_BMC_891227, tag, owner, clock)
+{
+}
+
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)
{
@@ -1151,6 +1168,21 @@ void nes_bmc_60311c_device::pcb_reset()
update_banks();
}
+void nes_bmc_ctc12in1_device::device_start()
+{
+ nes_vram_protect_device::device_start();
+ save_item(NAME(m_reg));
+}
+
+void nes_bmc_ctc12in1_device::pcb_reset()
+{
+ nes_vram_protect_device::pcb_reset();
+ prg16_89ab(0);
+ prg16_cdef(0);
+
+ m_reg[0] = m_reg[1] = 0;
+}
+
void nes_bmc_fam250_device::device_start()
{
nes_bmc_k1029_device::device_start();
@@ -3230,6 +3262,90 @@ void nes_bmc_60311c_device::write_h(offs_t offset, u8 data)
/*-------------------------------------------------
+ BMC-CTC-12IN1
+
+ Games: 12 in 1 Game Card
+
+ NES 2.0: mapper 337
+
+ In MAME: Supported.
+
+ TODO: Investigate why Legend of Kage has a corrupt
+ title screen (inverting mirroring bit fixes it but
+ breaks the rest of the game). Also why are walls in
+ Pacman glitched?
+
+ -------------------------------------------------*/
+
+u8 nes_bmc_ctc12in1_device::read_m(offs_t offset)
+{
+ LOG_MMC(("bmc_ctc12in1 read_m, offset: %04x, data: %02x\n", offset));
+ return m_prg[0x01 * 0x2000 + offset]; // fixed to bank 1
+}
+
+void nes_bmc_ctc12in1_device::write_h(offs_t offset, u8 data)
+{
+ LOG_MMC(("bmc_ctc12in1 write_h, offset: %04x, data: %02x\n", offset, data));
+ m_reg[BIT(offset, 14)] = data;
+
+ u8 bank = (m_reg[0] & 0x18) | (m_reg[1] & 0x07);
+ switch (m_reg[0] >> 6)
+ {
+ case 0:
+ prg16_89ab(bank);
+ prg16_cdef(bank);
+ break;
+ case 1:
+ prg32(bank >> 1);
+ break;
+ case 2:
+ case 3:
+ prg16_89ab(bank);
+ prg16_cdef(bank | 0x07);
+ break;
+ }
+
+ m_vram_protect == !BIT(m_reg[0], 7) || (offset & 0x6000) == 0x6000;
+ set_nt_mirroring(BIT(m_reg[0], 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+}
+
+/*-------------------------------------------------
+
+ BMC-891227
+
+ Games: Super 15 in 1 Game Card
+
+ NES 2.0: mapper 350
+
+ This board is similar to CTC-12IN1 above but with
+ the mirroring and banking mode bits moved and with
+ support for Contra on a separate 128K chip.
+
+ In MAME: Supported.
+
+ TODO: Contra bugs: Without input character sprite
+ is always in the UP position. Cannot pickup weapons.
+
+ -------------------------------------------------*/
+
+void nes_bmc_891227_device::write_h(offs_t offset, u8 data)
+{
+ LOG_MMC(("bmc_891227 write_h, offset: %04x, data: %02x\n", offset, data));
+
+ if (offset < 0x4000)
+ data = (data & 0x80) >> 2 | (data & 0x60) << 1 | (data & 0x1f);
+
+ nes_bmc_ctc12in1_device::write_h(offset, data);
+
+ if ((m_reg[0] & 0xc0) == 0xc0) // Contra only mode
+ {
+ prg16_89ab(0x20 | (m_reg[1] & 0x07));
+ prg16_cdef(0x27);
+ }
+}
+
+/*-------------------------------------------------
+
BMC-FAM250
Games: 250 in 1
diff --git a/src/devices/bus/nes/multigame.h b/src/devices/bus/nes/multigame.h
index 31c38a08955..1214710ea66 100644
--- a/src/devices/bus/nes/multigame.h
+++ b/src/devices/bus/nes/multigame.h
@@ -1174,6 +1174,42 @@ private:
};
+// ======================> nes_bmc_ctc12in1_device
+
+class nes_bmc_ctc12in1_device : public nes_vram_protect_device
+{
+public:
+ // construction/destruction
+ nes_bmc_ctc12in1_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:
+ // construction/destruction
+ nes_bmc_ctc12in1_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
+ u8 m_reg[2];
+};
+
+
+// ======================> nes_bmc_891227_device
+
+class nes_bmc_891227_device : public nes_bmc_ctc12in1_device
+{
+public:
+ // construction/destruction
+ nes_bmc_891227_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+ virtual void write_h(offs_t offset, u8 data) override;
+};
+
+
// ======================> nes_bmc_k1029_device
class nes_bmc_k1029_device : public nes_vram_protect_device
@@ -1267,9 +1303,11 @@ DECLARE_DEVICE_TYPE(NES_BMC_810544C, nes_bmc_810544c_device)
DECLARE_DEVICE_TYPE(NES_BMC_830425C, nes_bmc_830425c_device)
DECLARE_DEVICE_TYPE(NES_BMC_830928C, nes_bmc_830928c_device)
DECLARE_DEVICE_TYPE(NES_BMC_850437C, nes_bmc_850437c_device)
+DECLARE_DEVICE_TYPE(NES_BMC_891227, nes_bmc_891227_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_CTC12IN1, nes_bmc_ctc12in1_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)
diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp
index e4ec97267df..b22ac853406 100644
--- a/src/devices/bus/nes/nes_carts.cpp
+++ b/src/devices/bus/nes/nes_carts.cpp
@@ -387,6 +387,7 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("bmc_830506c", NES_BMC_830506C);
device.option_add_internal("bmc_830928c", NES_BMC_830928C);
device.option_add_internal("bmc_850437c", NES_BMC_850437C);
+ device.option_add_internal("bmc_891227", NES_BMC_891227);
device.option_add_internal("bmc_970630c", NES_BMC_970630C);
device.option_add_internal("bmc_jy012005", NES_BMC_JY012005);
device.option_add_internal("bmc_jy820845c", NES_BMC_JY820845C);
@@ -394,6 +395,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_ctc12in1", NES_BMC_CTC12IN1);
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);
diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx
index aba521601ae..0666bedb205 100644
--- a/src/devices/bus/nes/nes_ines.hxx
+++ b/src/devices/bus/nes/nes_ines.hxx
@@ -372,7 +372,7 @@ static const nes_mmc mmc_list[] =
{ 334, BMC_5IN1_1993 },
{ 335, BMC_CTC09 },
{ 336, BMC_K3046 },
- // { 337, BMC_CTC_12IN1 }, not in nes.xml
+ { 337, BMC_CTC_12IN1 },
{ 338, BMC_SA005A },
{ 339, BMC_K3006 },
{ 340, BMC_K3036 },
@@ -385,7 +385,7 @@ static const nes_mmc mmc_list[] =
{ 347, KAISER_KS7030 }, // Doki Doki Panic alt FDS conversion
{ 348, BMC_830118C },
{ 349, BMC_G146 },
- // { 350, BMC_891227 }, not in nes.xml
+ { 350, BMC_891227 },
{ 351, BMC_TECHLINE9IN1 },
{ 352, KAISER_KS106C }, // 4-in-1
{ 353, BMC_810305C }, // Super Mario Family multicart
diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx
index e544b5874e5..f6c36bfd095 100644
--- a/src/devices/bus/nes/nes_pcb.hxx
+++ b/src/devices/bus/nes/nes_pcb.hxx
@@ -267,6 +267,7 @@ static const nes_pcb pcb_list[] =
{ "bmc_830506c", BMC_830506C },
{ "bmc_830928c", BMC_830928C },
{ "bmc_850437c", BMC_850437C },
+ { "bmc_891227", BMC_891227 },
{ "bmc_970630c", BMC_970630C },
{ "bmc_jy012005", BMC_JY012005 },
{ "bmc_jy820845c", BMC_JY820845C },
@@ -274,6 +275,7 @@ static const nes_pcb pcb_list[] =
{ "n32_4in1", BMC_N32_4IN1 },
{ "ntd03", BMC_NTD_03 },
{ "bmc_ctc09", BMC_CTC09 },
+ { "bmc_ctc12in1", BMC_CTC_12IN1 },
{ "bmc_fam250", BMC_FAM250 },
{ "bmc_gka", BMC_GKA },
{ "bmc_gkb", BMC_GKB },
diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h
index 7d763a314ca..8c0b6efa3ce 100644
--- a/src/devices/bus/nes/nes_slot.h
+++ b/src/devices/bus/nes/nes_slot.h
@@ -97,8 +97,8 @@ enum
BMC_70IN1, BMC_500IN1, BMC_800IN1, BMC_1200IN1,
BMC_GKA, BMC_GKB, BMC_GKCXIN1, BMC_GN91B,
BMC_HP898F, BMC_VT5201, BMC_BENSHIENG,
- BMC_60311C, BMC_80013B, BMC_810544C, BMC_830425C,
- BMC_830506C, BMC_830928C, BMC_850437C, BMC_970630C,
+ BMC_CTC09, BMC_CTC_12IN1, BMC_60311C, BMC_80013B, BMC_810544C,
+ BMC_830425C, BMC_830506C, BMC_830928C, BMC_850437C, BMC_891227, BMC_970630C,
BMC_N32_4IN1, BMC_NC20MB, BMC_NT639, BMC_NTD_03, BMC_SRPG_5IN1,
BMC_EL860947C, BMC_EL861121C, BMC_FAM250, BMC_FK23C, BMC_FK23CA,
BMC_JY012005, BMC_JY820845C, BMC_PJOY84, BMC_TH22913, BMC_11160, BMC_G146,
@@ -106,7 +106,7 @@ enum
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_12IN1, BMC_4IN1RESET, BMC_42IN1RESET, BMC_LITTLECOM160,
BMC_K1029, BMC_K3006, BMC_K3033, BMC_K3036, BMC_K3046, BMC_SA005A,
BMC_TF2740, BMC_TJ03, BMC_RESETSXROM, BMC_RESETTXROM, BMC_TECHLINE9IN1,
// Unlicensed