summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author 0kmg <9137159+0kmg@users.noreply.github.com>2021-10-17 04:45:10 -0800
committer GitHub <noreply@github.com>2021-10-17 23:45:10 +1100
commita7b07bab172a7a9075c1739e23bfe530b955c304 (patch)
treedfb164fcc5d48c223874b8ef90697302a2cda296 /src/devices
parentb856132ffa03bb1af7410c149c925ecb6b9e3dcb (diff)
bus/nes: Improved support for Super Cool Boy and related multicarts. (#8706)
* Also renamed set mc_4scb and made it a clone of one of the new additions. New working software list additions (nes.xml) ----------------------------------- Super Cool Boy 3 in 1 (ABAB CB-403x) [NewRisingSun] Super Cool Boy 4 in 1 (CB-4011) [Consolethinks, NewRisingSun] Super Cool Boy 4 in 1 (CB-4034) [Consolethinks, NewRisingSun] Super Cool Boy 4 in 1 (CB-4035) [CaH4e3, NewRisingSun] 4 in 1 (JH-274) [anonymous] 1998 HIGH 4 in 1 (YH-463) [anonymous] 4 in 1 (YH-4103) [anonymous]
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/bus/nes/mmc3_clones.cpp70
-rw-r--r--src/devices/bus/nes/mmc3_clones.h13
-rw-r--r--src/devices/bus/nes/nes_ines.hxx2
3 files changed, 65 insertions, 20 deletions
diff --git a/src/devices/bus/nes/mmc3_clones.cpp b/src/devices/bus/nes/mmc3_clones.cpp
index 87f6544449c..15b3845edb4 100644
--- a/src/devices/bus/nes/mmc3_clones.cpp
+++ b/src/devices/bus/nes/mmc3_clones.cpp
@@ -31,8 +31,8 @@
DEFINE_DEVICE_TYPE(NES_NITRA, nes_nitra_device, "nes_nitra", "NES Cart Nitra PCB")
DEFINE_DEVICE_TYPE(NES_FS6, nes_fs6_device, "nes_fs6", "NES Cart Fight Street VI PCB")
DEFINE_DEVICE_TYPE(NES_SBROS11, nes_sbros11_device, "nes_smb11", "NES Cart SMB 11 PCB")
-DEFINE_DEVICE_TYPE(NES_MALISB, nes_malisb_device, "nes_malisb", "NES Cart Mali Spash Bomb PCB")
-DEFINE_DEVICE_TYPE(NES_FAMILY4646, nes_family4646_device, "nes_family4646", "NES Cart BMC-FAMILY04646 PCB")
+DEFINE_DEVICE_TYPE(NES_MALISB, nes_malisb_device, "nes_malisb", "NES Cart Mali Splash Bomb PCB")
+DEFINE_DEVICE_TYPE(NES_FAMILY4646, nes_family4646_device, "nes_family4646", "NES Cart BMC-FAMILY4646 PCB")
DEFINE_DEVICE_TYPE(NES_PIKAY2K, nes_pikay2k_device, "nes_pikay2k", "NES Cart PIKACHU Y2K PCB")
DEFINE_DEVICE_TYPE(NES_8237, nes_8237_device, "nes_8237", "NES Cart UNL-8237 PCB")
DEFINE_DEVICE_TYPE(NES_8237A, nes_8237a_device, "nes_8237a", "NES Cart UNL-8237A PCB")
@@ -140,7 +140,7 @@ nes_malisb_device::nes_malisb_device(const machine_config &mconfig, const char *
{
}
-nes_family4646_device::nes_family4646_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_family4646_device::nes_family4646_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_txrom_device(mconfig, NES_FAMILY4646, tag, owner, clock)
{
}
@@ -414,12 +414,19 @@ nes_coolboy_device::nes_coolboy_device(const machine_config &mconfig, const char
{
}
-
+void nes_family4646_device::device_start()
+{
+ mmc3_start();
+ save_item(NAME(m_reg));
+}
void nes_family4646_device::pcb_reset()
{
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
+
+ std::fill(std::begin(m_reg), std::end(m_reg), 0x00);
mmc3_common_initialize(0x1f, 0xff, 0);
+ set_nt_mirroring(PPU_MIRROR_HORZ); // Space Shuttle on CB-4035 doesn't set mirroring bit. Whether this cart is hard-wired to reset correctly to horizontal mirroring is not clear.
}
void nes_pikay2k_device::device_start()
@@ -1070,29 +1077,60 @@ void nes_malisb_device::write_h(offs_t offset, uint8_t data)
BMC-FAMILY-4646B
Known Boards: Unknown Multigame Bootleg Board (4646B)
- Games: 2 in 1 - Family Kid & Aladdin 4
+ Games: 2 in 1 - Family Kid & Aladdin 4, various multicarts.
- MMC3 clone
+ MMC3 clone with banking for multigame menu.
iNES: mapper 134
- In MESS: Supported.
+ In MAME: Preliminary supported.
+
+ TODO: There are unknown writes to the unused reg 3,
+ though it seems only 0x00 is written. Next, some
+ carts have solder pad setting readable at 0x8000.
+ Lastly, YH-4103 doesn't soft reset cleanly like
+ the other carts, but does this happen on hardware?
-------------------------------------------------*/
-void nes_family4646_device::write_m(offs_t offset, uint8_t data)
+void nes_family4646_device::prg_cb(int start, int bank)
+{
+ if (!BIT(m_reg[1], 7)) // MMC3 mode
+ nes_txrom_device::prg_cb(start, bank);
+ else if (start == 0) // NROM mode, only uses MMC3's $8000 bank
+ {
+ if (BIT(m_reg[1], 3))
+ {
+ prg16_89ab(bank & ~0x01);
+ prg16_cdef(bank & ~0x01);
+ }
+ else
+ prg32(bank & ~0x03);
+ }
+}
+
+void nes_family4646_device::write_m(offs_t offset, u8 data)
{
LOG_MMC(("family4646 write_m, offset: %04x, data: %02x\n", offset, data));
- if (offset == 0x01)
- {
- m_prg_base = (data & 0x02) << 4;
- m_prg_mask = 0x1f;
- m_chr_base = (data & 0x20) << 3;
- m_chr_mask = 0xff;
- set_prg(m_prg_base, m_prg_mask);
+ int reg = offset & 0x03;
+ if (!BIT(m_reg[0], 7)) // lock bit
+ m_reg[reg] = data;
+ else if (reg == 2) // final two bits of reg 2 respond regardless
+ m_reg[reg] = (m_reg[reg] & ~0x03) | (data & 0x03);
+ else
+ return;
+
+ m_prg_base = (m_reg[1] & 0x03) << 4;
+ m_prg_mask = 0x1f >> BIT(m_reg[1], 2);
+ set_prg(m_prg_base, m_prg_mask);
+
+ m_chr_base = (m_reg[1] & 0x30) << 3;
+ m_chr_mask = 0xff >> BIT(m_reg[1], 6);
+ if (BIT(m_reg[0], 3)) // CNROM-like mode
+ chr8(m_chr_base >> 3 | (m_reg[2] & (m_chr_mask >> 3)), m_chr_source);
+ else // MMC3 mode
set_chr(m_chr_source, m_chr_base, m_chr_mask);
- }
}
/*-------------------------------------------------
diff --git a/src/devices/bus/nes/mmc3_clones.h b/src/devices/bus/nes/mmc3_clones.h
index d008d788d66..88578ef9512 100644
--- a/src/devices/bus/nes/mmc3_clones.h
+++ b/src/devices/bus/nes/mmc3_clones.h
@@ -68,12 +68,19 @@ class nes_family4646_device : public nes_txrom_device
{
public:
// construction/destruction
- nes_family4646_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ nes_family4646_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- // device-level overrides
- virtual void write_m(offs_t offset, uint8_t data) override;
+ 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:
+ u8 m_reg[4];
};
diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx
index b6fed4d957a..52a2b0ce605 100644
--- a/src/devices/bus/nes/nes_ines.hxx
+++ b/src/devices/bus/nes/nes_ines.hxx
@@ -329,7 +329,7 @@ static const nes_mmc mmc_list[] =
{ 291, BMC_NT639 },
// { 292, UNL_DRAGONFIGHTER }, in nes.xml, not emulated yet
// 293 NewStar multicarts, do we have these in nes.xml?
- // 294 variant of mapper 134?
+ { 294, BMC_FAMILY_4646 }, // FIXME: is this really exactly the same as mapper 134?
// 295 JY multicarts not yet in nes.xml
// 296 VT3x handhelds
{ 297, TXC_22110 }, // 2-in-1 Uzi Lightgun