diff options
author | 0kmg <9137159+0kmg@users.noreply.github.com> | 2021-10-06 18:19:45 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-06 22:19:45 -0400 |
commit | 0a1a74b7350d74500641c811e5bff8a8fa195783 (patch) | |
tree | b912e2c408efc96c90f2b22a0a1792fdc39a66ee /src/devices/bus | |
parent | 34de176b6d6213766ee1ae3f9eb2e0d3b8622ba6 (diff) |
bus/nes: Added support for K-3033 and 970670C type multicart. (#8665)
New working software list additions (nes.xml)
-----------------------------------
2 in 1 (NT-811) [Consolethinks]
4 in 1 1999 [Consolethinks]
35 in 1 (K-3033) [anonymous]
Diffstat (limited to 'src/devices/bus')
-rw-r--r-- | src/devices/bus/nes/mmc3_clones.cpp | 77 | ||||
-rw-r--r-- | src/devices/bus/nes/mmc3_clones.h | 23 | ||||
-rw-r--r-- | src/devices/bus/nes/multigame.cpp | 74 | ||||
-rw-r--r-- | src/devices/bus/nes/multigame.h | 23 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_carts.cpp | 2 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_ines.hxx | 4 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_pcb.hxx | 2 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_slot.h | 5 |
8 files changed, 203 insertions, 7 deletions
diff --git a/src/devices/bus/nes/mmc3_clones.cpp b/src/devices/bus/nes/mmc3_clones.cpp index 82e3d0abfaf..99f0f1d3542 100644 --- a/src/devices/bus/nes/mmc3_clones.cpp +++ b/src/devices/bus/nes/mmc3_clones.cpp @@ -72,6 +72,7 @@ DEFINE_DEVICE_TYPE(NES_BMC_F15, nes_bmc_f15_device, "nes_bmc_f15", DEFINE_DEVICE_TYPE(NES_BMC_GN45, nes_bmc_gn45_device, "nes_bmc_gn45", "NES Cart BMC GN-45 PCB") DEFINE_DEVICE_TYPE(NES_BMC_GOLD7IN1, nes_bmc_gold7in1_device, "nes_bmc_gold7in1", "NES Cart BMC Golden 7 in 1 PCB") DEFINE_DEVICE_TYPE(NES_BMC_K3006, nes_bmc_k3006_device, "nes_bmc_k3006", "NES Cart BMC K-3006 PCB") +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_820720C, nes_bmc_820720c_device, "nes_bmc_820720c", "NES Cart BMC 820720C PCB") @@ -348,6 +349,11 @@ nes_bmc_k3006_device::nes_bmc_k3006_device(const machine_config &mconfig, const { } +nes_bmc_k3033_device::nes_bmc_k3033_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_txrom_device(mconfig, NES_BMC_K3033, tag, owner, clock), m_mmc3_mode(false) +{ +} + nes_bmc_00202650_device::nes_bmc_00202650_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_txrom_device(mconfig, NES_BMC_00202650, tag, owner, clock), m_mmc3_mode(false) { @@ -794,6 +800,22 @@ void nes_bmc_k3006_device::pcb_reset() prg16_cdef(0); } +void nes_bmc_k3033_device::device_start() +{ + mmc3_start(); + save_item(NAME(m_mmc3_mode)); +} + +void nes_bmc_k3033_device::pcb_reset() +{ + m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; + + m_mmc3_mode = false; + mmc3_common_initialize(0x0f, 0x7f, 0); + prg16_89ab(0); + prg16_cdef(0); +} + void nes_bmc_00202650_device::device_start() { mmc3_start(); @@ -2773,6 +2795,55 @@ void nes_bmc_k3006_device::write_m(offs_t offset, u8 data) /*------------------------------------------------- + BMC-K-3033 + + Games: 35 in 1 + + MMC3 clone with banking for multigame menu. + + NES 2.0: mapper 322 + + In MAME: Supported. + + -------------------------------------------------*/ + +void nes_bmc_k3033_device::prg_cb(int start, int bank) +{ + if (m_mmc3_mode) + nes_txrom_device::prg_cb(start, bank); +} + +void nes_bmc_k3033_device::write_m(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_k3033 write_m, offset: %04x, data: %02x\n", offset, data)) +; + if ((m_wram_protect & 0xc0) == 0x80) + { + m_mmc3_mode = BIT(offset, 5); + + u8 mode_128k = !(BIT(offset, 7) && m_mmc3_mode); + m_chr_base = bitswap<3>(offset, 6, 4, 3) << (8 - mode_128k); + m_chr_mask = 0xff >> mode_128k; + set_chr(m_chr_source, m_chr_base, m_chr_mask); + + if (m_mmc3_mode) + { + m_prg_base = m_chr_base >> 3; + m_prg_mask = m_chr_mask >> 3; + set_prg(m_prg_base, m_prg_mask); + } + else // NROM mode + { + u8 bank = (offset & 0x40) >> 1 | (offset & 0x1f); + u8 mode = !!(offset & 0x03); + prg16_89ab(bank & ~mode); + prg16_cdef(bank | mode); + } + } +} + +/*------------------------------------------------- + BMC-00202650 Games: 8 in 1 @@ -2783,9 +2854,9 @@ void nes_bmc_k3006_device::write_m(offs_t offset, u8 data) In MAME: Supported. - TODO: Soft reset does work for some games some of the - time. Seems to be caused by main RAM contents. Does - this happen on hardware? + TODO: Soft reset doesn't work for some games some of + the time. Seems to be caused by main RAM contents. + Does this happen on hardware? -------------------------------------------------*/ diff --git a/src/devices/bus/nes/mmc3_clones.h b/src/devices/bus/nes/mmc3_clones.h index 08822d6a7f2..ba8311cc384 100644 --- a/src/devices/bus/nes/mmc3_clones.h +++ b/src/devices/bus/nes/mmc3_clones.h @@ -814,6 +814,28 @@ public: }; +// ======================> nes_bmc_k3033_device + +class nes_bmc_k3033_device : public nes_txrom_device +{ +public: + // construction/destruction + nes_bmc_k3033_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual void write_m(offs_t offset, u8 data) override; + virtual void prg_cb(int start, int bank) override; + + virtual void pcb_reset() override; + +protected: + // device-level overrides + virtual void device_start() override; + +private: + bool m_mmc3_mode; +}; + + // ======================> nes_bmc_00202650_device class nes_bmc_00202650_device : public nes_txrom_device @@ -1043,6 +1065,7 @@ DECLARE_DEVICE_TYPE(NES_BMC_F15, nes_bmc_f15_device) DECLARE_DEVICE_TYPE(NES_BMC_GN45, nes_bmc_gn45_device) DECLARE_DEVICE_TYPE(NES_BMC_GOLD7IN1, nes_bmc_gold7in1_device) 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_820720C, nes_bmc_820720c_device) diff --git a/src/devices/bus/nes/multigame.cpp b/src/devices/bus/nes/multigame.cpp index 6e38c8eae3d..48ea16fbcc1 100644 --- a/src/devices/bus/nes/multigame.cpp +++ b/src/devices/bus/nes/multigame.cpp @@ -47,6 +47,7 @@ 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_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_GKA, nes_bmc_gka_device, "nes_bmc_gka", "NES Cart BMC GK-A PCB") @@ -210,6 +211,11 @@ nes_bmc_850437c_device::nes_bmc_850437c_device(const machine_config &mconfig, co { } +nes_bmc_970630c_device::nes_bmc_970630c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_BMC_970630C, tag, owner, clock), m_latch(0) +{ +} + nes_ntd03_device::nes_ntd03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NTD03, tag, owner, clock) { @@ -688,6 +694,21 @@ void nes_bmc_850437c_device::pcb_reset() m_reg[0] = m_reg[1] = 0; } +void nes_bmc_970630c_device::device_start() +{ + common_start(); + save_item(NAME(m_latch)); +} + +void nes_bmc_970630c_device::pcb_reset() +{ + prg16_89ab(0); + prg16_cdef(7); + chr8(0, CHRRAM); + + m_latch = 0; +} + void nes_ntd03_device::device_start() { common_start(); @@ -1668,8 +1689,61 @@ void nes_bmc_850437c_device::write_h(offs_t offset, u8 data) /*------------------------------------------------- + BMC-970630C + + Games: 2 in 1 (NT-811), 4 in 1 1999 + + NES 2.0: mapper 380 + + In MAME: Supported. + + TODO: Contra has the same graphics glitches as in + BMC-8157. These are marked as partially supported + in the softlist, but maybe this is just a BTANB? + + -------------------------------------------------*/ + +void nes_bmc_970630c_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_970630c write_h, offset: %04x, data: %02x\n", offset, data)); + + u8 bank = (offset >> 2) & 0x1f; + if (BIT(offset, 9)) // NROM mode + { + u8 mode = !BIT(offset, 0); + prg16_89ab(bank & ~mode); + prg16_cdef(bank | mode); + } + else // UNROM-esque mode + { + prg16_89ab(bank); + prg16_cdef(bank | 0x07); + } + + set_nt_mirroring(BIT(offset, 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + m_latch = BIT(offset, 8); +} + +u8 nes_bmc_970630c_device::read_h(offs_t offset) +{ +// LOG_MMC(("bmc_970630c read_h, offset: %04x\n", offset)); + + if (m_latch) + return 0; // TODO: menu supposedly varies by solder pad value returned here, but it doesn't seem to work... + else + return hi_access_rom(offset); +} + +/*------------------------------------------------- + BMC-NTD-03 + Games: ASDER 20 in 1 + + NES 2.0: mapper 290 + + In MAME: Supported. + -------------------------------------------------*/ void nes_ntd03_device::write_h(offs_t offset, uint8_t data) diff --git a/src/devices/bus/nes/multigame.h b/src/devices/bus/nes/multigame.h index c9c6f639cf3..a5577e3341c 100644 --- a/src/devices/bus/nes/multigame.h +++ b/src/devices/bus/nes/multigame.h @@ -369,6 +369,28 @@ private: }; +// ======================> nes_bmc_970630c_device + +class nes_bmc_970630c_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_bmc_970630c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual u8 read_h(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; +}; + + // ======================> nes_ntd03_device class nes_ntd03_device : public nes_nrom_device @@ -1164,6 +1186,7 @@ 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_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_GKA, nes_bmc_gka_device) diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index d980365a9e8..c12e3dbfdba 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -379,6 +379,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("bmc_830928c", NES_BMC_830928C); device.option_add_internal("bmc_830425c", NES_BMC_830425C); device.option_add_internal("bmc_850437c", NES_BMC_850437C); + device.option_add_internal("bmc_970630c", NES_BMC_970630C); device.option_add_internal("bmc_jy820845c", NES_BMC_JY820845C); device.option_add_internal("n32_4in1", NES_N32_4IN1); device.option_add_internal("ntd03", NES_NTD03); @@ -389,6 +390,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("bmc_hp898f", NES_BMC_HP898F); device.option_add_internal("bmc_k1029", NES_BMC_K1029); device.option_add_internal("bmc_k3006", NES_BMC_K3006); + device.option_add_internal("bmc_k3033", NES_BMC_K3033); device.option_add_internal("bmc_k3036", NES_BMC_K3036); device.option_add_internal("bmc_k3046", NES_BMC_K3046); device.option_add_internal("bmc_sa005a", NES_BMC_SA005A); diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index 8bb29031146..232ca0dbfe8 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -357,7 +357,7 @@ static const nes_mmc mmc_list[] = { 319, BMC_HP898F }, { 320, BMC_830425C }, // 321 duplicate of 287? - // 322 BMC-K-3033 35-in-1, related to mc_35? + { 322, BMC_K3033 }, { 323, FARID_SLROM8IN1 }, // homebrew 8-in-1 { 324, FARID_UNROM8IN1 }, // homebrew 8-in-1 { 325, UNL_MALISB }, // Super Mali Splash Bomb pirate hack @@ -415,7 +415,7 @@ static const nes_mmc mmc_list[] = // 377 JY-111 multicart, similar to mapper 367 // 378 8-in-1 multicart, which one? // 379 35-in-1 multicart, similar to mapper 38 - // 380 970630C multicart + { 380, BMC_970630C }, { 381, UNL_KN42 }, // 2-in-1 Big Nose games { 382, BMC_830928C }, // 383 JY-014 multicart diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index fdbe945c9eb..ff897bc1886 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -260,6 +260,7 @@ static const nes_pcb pcb_list[] = { "bmc_830425c", BMC_830425C }, { "bmc_830928c", BMC_830928C }, { "bmc_850437c", BMC_850437C }, + { "bmc_970630c", BMC_970630C }, { "bmc_jy820845c", BMC_JY820845C }, { "n32_4in1", BMC_N32_4IN1 }, { "ntd03", BMC_NTD_03 }, @@ -270,6 +271,7 @@ static const nes_pcb pcb_list[] = { "bmc_hp898f", BMC_HP898F }, { "bmc_k1029", BMC_K1029 }, { "bmc_k3006", BMC_K3006 }, + { "bmc_k3033", BMC_K3033 }, { "bmc_k3036", BMC_K3036 }, { "bmc_k3046", BMC_K3046 }, { "bmc_sa005a", BMC_SA005A }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index e8ce215d760..14d3d3ef8ac 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -95,7 +95,8 @@ enum BMC_31IN1, BMC_22GAMES, BMC_20IN1, BMC_70IN1, BMC_500IN1, BMC_800IN1, BMC_1200IN1, BMC_GKA, BMC_GKB, BMC_GKCXIN1, BMC_HP898F, BMC_VT5201, BMC_BENSHIENG, - BMC_60311C, BMC_80013B, BMC_810544C, BMC_830425C, BMC_830928C, BMC_850437C, + BMC_60311C, BMC_80013B, BMC_810544C, BMC_830425C, + BMC_830928C, BMC_850437C, BMC_970630C, BMC_N32_4IN1, BMC_NT639, BMC_NTD_03, BMC_FCGENJIN_8IN1, BMC_FK23C, BMC_FK23CA, BMC_JY820845C, BMC_PJOY84, BMC_TH22913, BMC_11160, BMC_G146, @@ -103,7 +104,7 @@ enum BMC_820720C, BMC_830118C, BMC_830832C, BMC_YY841101C, BMC_YY841155C, BMC_411120C, BMC_GOLD150, BMC_GOLD260, BMC_12IN1, BMC_4IN1RESET, BMC_42IN1RESET, BMC_LITTLECOM160, BMC_CTC09, - BMC_K1029, BMC_K3006, BMC_K3036, BMC_K3046, BMC_SA005A, BMC_TJ03, + BMC_K1029, BMC_K3006, BMC_K3033, BMC_K3036, BMC_K3046, BMC_SA005A, BMC_TJ03, BMC_RESETSXROM, BMC_RESETTXROM0, BMC_RESETTXROM1, BMC_RESETTXROM2, BMC_TECHLINE9IN1, // Unlicensed UNL_8237, UNL_8237A, UNL_CC21, UNL_AX5705, UNL_KN42, UNL_KOF97, |