summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author 0kmg <9137159+0kmg@users.noreply.github.com>2021-09-14 13:02:04 -0800
committer 0kmg <9137159+0kmg@users.noreply.github.com>2021-09-14 16:34:52 -0800
commit59298e7360231eaf59898b8f5b8d44fd68ceb850 (patch)
tree8f2c701287979ef7845087a8a0d1bca23bea0e2a /src
parentf24933a0776b4fbc1ceda0354d792bd5e48efe1a (diff)
bus/nes: Improved emulation of reset-based 42 in 1 cartridge.
- Removed dump and code for Super 22 in 1, which is a CRC match for the 42-in-1. - Cleaned up a few recent multicart fixes, making them uniform with the rest. Software list items promoted to working (nes.xml) --------------------------------------- 42 in 1 (Reset Switch)
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/nes/multigame.cpp157
-rw-r--r--src/devices/bus/nes/multigame.h46
-rw-r--r--src/devices/bus/nes/nes_carts.cpp4
-rw-r--r--src/devices/bus/nes/nes_ines.hxx2
-rw-r--r--src/devices/bus/nes/nes_pcb.hxx2
-rw-r--r--src/devices/bus/nes/nes_slot.h2
6 files changed, 57 insertions, 156 deletions
diff --git a/src/devices/bus/nes/multigame.cpp b/src/devices/bus/nes/multigame.cpp
index 179b2297765..18ae4573048 100644
--- a/src/devices/bus/nes/multigame.cpp
+++ b/src/devices/bus/nes/multigame.cpp
@@ -87,7 +87,6 @@ DEFINE_DEVICE_TYPE(NES_BMC_1200IN1, nes_bmc_1200in1_device, "nes_bmc_1200i
DEFINE_DEVICE_TYPE(NES_BMC_GOLD150, nes_bmc_gold150_device, "nes_bmc_gold150", "NES Cart BMC Golden 150 in 1 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_GOLD260, nes_bmc_gold260_device, "nes_bmc_gold260", "NES Cart BMC Golden 260 in 1 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_TH22913, nes_bmc_th22913_device, "nes_bmc_th22913", "NES Cart BMC TH2291-3 PCB")
-DEFINE_DEVICE_TYPE(NES_BMC_SUPER22, nes_bmc_super22_device, "nes_bmc_super22", "NES Cart BMC Super 22 Games PCB")
DEFINE_DEVICE_TYPE(NES_BMC_4IN1RESET, nes_bmc_4in1reset_device, "nes_bmc_4in1reset", "NES Cart BMC 4 in 1 (Reset Based) PCB")
DEFINE_DEVICE_TYPE(NES_BMC_42IN1RESET, nes_bmc_42in1reset_device, "nes_bmc_42in1reset", "NES Cart BMC 42 in 1 (Reset Based) PCB")
DEFINE_DEVICE_TYPE(NES_BMC_LC160, nes_bmc_lc160_device, "nes_bmc_lc160", "NES Cart BMC Little Com 160 PCB")
@@ -363,12 +362,12 @@ nes_bmc_72in1_device::nes_bmc_72in1_device(const machine_config &mconfig, const
{
}
-nes_bmc_76in1_device::nes_bmc_76in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_bmc_76in1_device::nes_bmc_76in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BMC_76IN1, tag, owner, clock)
{
}
-nes_bmc_150in1_device::nes_bmc_150in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_bmc_150in1_device::nes_bmc_150in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BMC_150IN1, tag, owner, clock)
{
}
@@ -398,17 +397,12 @@ nes_bmc_gold260_device::nes_bmc_gold260_device(const machine_config &mconfig, co
{
}
-nes_bmc_super22_device::nes_bmc_super22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_SUPER22, tag, owner, clock)
-{
-}
-
-nes_bmc_4in1reset_device::nes_bmc_4in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_bmc_4in1reset_device::nes_bmc_4in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BMC_4IN1RESET, tag, owner, clock), m_latch(0)
{
}
-nes_bmc_42in1reset_device::nes_bmc_42in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_bmc_42in1reset_device::nes_bmc_42in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BMC_42IN1RESET, tag, owner, clock), m_latch(0)
{
}
@@ -976,17 +970,11 @@ void nes_bmc_76in1_device::pcb_reset()
m_reg[0] = m_reg[1] = 0;
}
-void nes_bmc_150in1_device::device_start()
-{
- common_start();
-}
-
void nes_bmc_150in1_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(0);
prg16_cdef(0);
- chr8(0, m_chr_source);
+ chr8(0, CHRROM);
}
void nes_bmc_800in1_device::device_start()
@@ -1049,54 +1037,35 @@ void nes_bmc_gold260_device::pcb_reset()
chr8(0, m_chr_source);
}
-void nes_bmc_super22_device::device_start()
-{
- common_start();
-}
-
-void nes_bmc_super22_device::pcb_reset()
-{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg32(0);
- chr8(0, m_chr_source);
-}
-
-
// This PCB is fully emulated here :)
void nes_bmc_4in1reset_device::device_start()
{
common_start();
- m_latch = -1;
+ m_latch = 3;
save_item(NAME(m_latch));
}
void nes_bmc_4in1reset_device::pcb_reset()
{
- m_latch++;
- m_latch &= 3;
- chr8(m_latch, CHRROM);
+ m_latch = (m_latch + 1) & 3;
prg16_89ab(m_latch);
prg16_cdef(m_latch);
+ chr8(m_latch, CHRROM);
}
void nes_bmc_42in1reset_device::device_start()
{
common_start();
- m_latch = -1;
- save_item(NAME(m_reg));
+ m_latch = 0x20;
+ save_item(NAME(m_latch));
}
void nes_bmc_42in1reset_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- m_latch++;
- m_latch &= 1;
- chr8(0, m_chr_source);
- prg32(m_latch << 4);
-
- m_reg[0] = 0;
- m_reg[1] = 0;
+ m_latch ^= 0x20;
+ prg32(m_latch >> 1);
+ chr8(0, CHRRAM);
}
void nes_vram_protect_device::device_start()
@@ -2672,13 +2641,13 @@ void nes_bmc_76in1_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("bmc_76in1 write_h, offset: %04x, data: %02x\n", offset, data));
m_reg[offset & 0x01] = data;
- set_nt_mirroring(BIT(m_reg[0], 6) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
- u8 bank = (m_reg[1] << 6) | ((m_reg[0] & 0x80) >> 2) | (m_reg[0] & 0x1f);
- u8 mode_16k = BIT(m_reg[0], 5);
- bank &= 0x7e | mode_16k;
- prg16_89ab(bank);
- prg16_cdef(bank | !mode_16k);
+ u8 bank = m_reg[1] << 6 | (m_reg[0] & 0x80) >> 2 | (m_reg[0] & 0x1f);
+ u8 mode = !BIT(m_reg[0], 5);
+ prg16_89ab(bank & ~mode);
+ prg16_cdef(bank | mode);
+
+ set_nt_mirroring(BIT(m_reg[0], 6) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
}
/*-------------------------------------------------
@@ -2690,20 +2659,20 @@ void nes_bmc_76in1_device::write_h(offs_t offset, u8 data)
iNES: mapper 202
- In MESS: Supported.
+ In MAME: Supported.
-------------------------------------------------*/
-void nes_bmc_150in1_device::write_h(offs_t offset, uint8_t data)
+void nes_bmc_150in1_device::write_h(offs_t offset, u8 data)
{
- int bank = (offset >> 1) & 0x07;
-
LOG_MMC(("bmc_150in1 write_h, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(bank);
- prg16_cdef(bank + (((bank & 0x06) == 0x06) ? 1 : 0));
- chr8(bank, CHRROM);
+ u8 bank = (offset >> 1) & 0x07;
+ u8 mode = (bank & 0x06) == 0x06;
+ prg16_89ab(bank & ~mode);
+ prg16_cdef(bank | mode);
+ chr8(bank, CHRROM);
set_nt_mirroring(BIT(offset, 0) ? PPU_MIRROR_HORZ: PPU_MIRROR_VERT);
}
@@ -2917,55 +2886,18 @@ uint8_t nes_bmc_gold150_device::read_h(offs_t offset)
/*-------------------------------------------------
- BMC-SUPER22GAMES
-
- Unknown Bootleg Multigame Board
- Games:
-
- iNES:
-
- is there a dsw to access the higher banks above 0x20?
-
- In MESS: Preliminary Supported.
-
- -------------------------------------------------*/
-
-void nes_bmc_super22_device::write_h(offs_t offset, uint8_t data)
-{
- LOG_MMC(("bmc_super22 write_h, offset: %04x, data: %02x\n", offset, data));
-
- if (data & 0x20)
- {
- prg16_89ab(data & 0x1f);
- prg16_cdef(data & 0x1f);
- }
- else
- prg32((data & 0x1f) >> 1);
-
- switch (data & 0xc0)
- {
- case 0x00: set_nt_mirroring(PPU_MIRROR_LOW); break;
- case 0x40: set_nt_mirroring(PPU_MIRROR_VERT); break;
- case 0x80: set_nt_mirroring(PPU_MIRROR_HORZ); break;
- case 0xc0: set_nt_mirroring(PPU_MIRROR_HIGH); break;
- }
-}
-
-
-/*-------------------------------------------------
-
BMC-RESETBASED4IN1
Unknown Bootleg Multigame Board
- Games:
+ Games: 4 in 1 (several of them)
- iNES:
+ iNES: mapper 60
No need to use handlers. At reset the banks change
and so does the game.
- In MESS: Preliminary Supported.
+ In MAME: Supported.
-------------------------------------------------*/
@@ -2974,33 +2906,30 @@ void nes_bmc_super22_device::write_h(offs_t offset, uint8_t data)
BMC-42IN1RESETBASED
Unknown Bootleg Multigame Board
+ Games: 42 (22 + 20) in 1
- Games:
+ There is an identical dump identified as SUPER22GAMES
+ that supposedly selected between the two menus by
+ dip switch. It's not clear which, if any, variants of
+ this cart exist, nor if this is really reset-based.
- iNES:
+ iNES: mapper 233
- In MESS: Preliminary Supported.
+ In MAME: Supported.
-------------------------------------------------*/
-void nes_bmc_42in1reset_device::write_h(offs_t offset, uint8_t data)
+void nes_bmc_42in1reset_device::write_h(offs_t offset, u8 data)
{
- int bank;
LOG_MMC(("bmc_42in1reset write_h, offset: %04x, data: %02x\n", offset, data));
- m_reg[offset & 1] = data;
- bank = (m_reg[0] & 0x1f) | (m_latch << 5) | ((m_reg[1] & 1) << 6);
-
- if (!(m_reg[0] & 0x20))
- prg32(bank >> 1);
- else
- {
- prg16_89ab(bank);
- prg16_cdef(bank);
- }
-
- set_nt_mirroring(BIT(offset, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ u8 bank = m_latch | (data & 0x1f);
+ u8 mode = !BIT(data, 5);
+ prg16_89ab(bank & ~mode);
+ prg16_cdef(bank | mode);
+ // some sources say there are 1-screen modes, but this works as is
+ set_nt_mirroring(BIT(data, 6) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
}
/*-------------------------------------------------
diff --git a/src/devices/bus/nes/multigame.h b/src/devices/bus/nes/multigame.h
index d8eaf82b82e..51cfb3be3d9 100644
--- a/src/devices/bus/nes/multigame.h
+++ b/src/devices/bus/nes/multigame.h
@@ -883,9 +883,9 @@ class nes_bmc_76in1_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_bmc_76in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ nes_bmc_76in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- virtual void write_h(offs_t offset, uint8_t data) override;
+ virtual void write_h(offs_t offset, u8 data) override;
virtual void pcb_reset() override;
@@ -894,7 +894,7 @@ protected:
virtual void device_start() override;
private:
- uint8_t m_reg[2];
+ u8 m_reg[2];
};
@@ -904,15 +904,11 @@ class nes_bmc_150in1_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_bmc_150in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ nes_bmc_150in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- virtual void write_h(offs_t offset, uint8_t data) 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;
};
@@ -924,7 +920,7 @@ public:
// construction/destruction
nes_bmc_500in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- virtual void write_h(offs_t offset, uint8_t data) override;
+ virtual void write_h(offs_t offset, u8 data) override;
};
@@ -1013,31 +1009,13 @@ protected:
};
-// ======================> nes_bmc_super22_device
-
-class nes_bmc_super22_device : public nes_nrom_device
-{
-public:
- // construction/destruction
- nes_bmc_super22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- virtual void write_h(offs_t offset, uint8_t data) override;
-
- virtual void pcb_reset() override;
-
-protected:
- // device-level overrides
- virtual void device_start() override;
-};
-
-
// ======================> nes_bmc_4in1reset_device
class nes_bmc_4in1reset_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_bmc_4in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ nes_bmc_4in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
virtual void pcb_reset() override;
@@ -1046,7 +1024,7 @@ protected:
virtual void device_start() override;
private:
- int m_latch;
+ u8 m_latch;
};
@@ -1056,9 +1034,9 @@ class nes_bmc_42in1reset_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_bmc_42in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ nes_bmc_42in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- virtual void write_h(offs_t offset, uint8_t data) override;
+ virtual void write_h(offs_t offset, u8 data) override;
virtual void pcb_reset() override;
@@ -1067,8 +1045,7 @@ protected:
virtual void device_start() override;
private:
- int m_latch;
- uint8_t m_reg[2];
+ u8 m_latch;
};
@@ -1233,7 +1210,6 @@ DECLARE_DEVICE_TYPE(NES_BMC_800IN1, nes_bmc_800in1_device)
DECLARE_DEVICE_TYPE(NES_BMC_1200IN1, nes_bmc_1200in1_device)
DECLARE_DEVICE_TYPE(NES_BMC_GOLD150, nes_bmc_gold150_device)
DECLARE_DEVICE_TYPE(NES_BMC_GOLD260, nes_bmc_gold260_device)
-DECLARE_DEVICE_TYPE(NES_BMC_SUPER22, nes_bmc_super22_device)
DECLARE_DEVICE_TYPE(NES_BMC_4IN1RESET, nes_bmc_4in1reset_device)
DECLARE_DEVICE_TYPE(NES_BMC_42IN1RESET, nes_bmc_42in1reset_device)
DECLARE_DEVICE_TYPE(NES_BMC_LC160, nes_bmc_lc160_device)
diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp
index 0c6c5bb0f56..9590b739b28 100644
--- a/src/devices/bus/nes/nes_carts.cpp
+++ b/src/devices/bus/nes/nes_carts.cpp
@@ -409,7 +409,6 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("bmc_70in1", NES_BMC_70IN1); // mapper 236
device.option_add_internal("bmc_72in1", NES_BMC_72IN1);
device.option_add_internal("bmc_76in1", NES_BMC_76IN1);
- device.option_add_internal("bmc_s42in1", NES_BMC_76IN1);
device.option_add_internal("bmc_150in1", NES_BMC_150IN1);
device.option_add_internal("bmc_190in1", NES_BMC_190IN1);
device.option_add_internal("bmc_500in1", NES_BMC_500IN1);
@@ -418,9 +417,8 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("bmc_gold150", NES_BMC_GOLD150); // mapper 235 with 2M PRG
device.option_add_internal("bmc_gold260", NES_BMC_GOLD260); // mapper 235 with 4M PRG
device.option_add_internal("bmc_th22913", NES_BMC_TH22913); // mapper 63
- device.option_add_internal("bmc_s22games", NES_BMC_SUPER22); // mapper 233
device.option_add_internal("bmc_reset4", NES_BMC_4IN1RESET); // mapper 60 with 64k prg and 32k chr
- device.option_add_internal("bmc_reset42", NES_BMC_42IN1RESET); // mapper 226? or 233?
+ device.option_add_internal("bmc_reset42", NES_BMC_42IN1RESET); // mapper 233
device.option_add_internal("bmc_lc160", NES_BMC_LC160);
device.option_add_internal("resetsxrom", NES_RESETSXROM);
// misc multigame cart MMC3 clone boards
diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx
index 665496f5a9b..1060662b90a 100644
--- a/src/devices/bus/nes/nes_ines.hxx
+++ b/src/devices/bus/nes/nes_ines.hxx
@@ -266,7 +266,7 @@ static const nes_mmc mmc_list[] =
{ 230, BMC_22GAMES },
{ 231, BMC_20IN1 },
{ 232, CAMERICA_BF9096 },
- { 233, BMC_SUPER22 },
+ { 233, BMC_42IN1RESET },
{ 234, AVE_MAXI15 },
{ 235, BMC_GOLD150 }, // 235 Golden Game x-in-1 - Unsupported
// 236 Game 800-in-1 - Unsupported, Realtec boards 8031 and 8155
diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx
index b97138aad0d..e751df39fa2 100644
--- a/src/devices/bus/nes/nes_pcb.hxx
+++ b/src/devices/bus/nes/nes_pcb.hxx
@@ -290,7 +290,6 @@ static const nes_pcb pcb_list[] =
{ "bmc_70in1", BMC_70IN1 },
{ "bmc_72in1", BMC_72IN1 },
{ "bmc_76in1", BMC_76IN1 },
- { "bmc_s42in1", BMC_76IN1 },
{ "bmc_150in1", BMC_150IN1 },
{ "bmc_190in1", BMC_190IN1 },
{ "bmc_500in1", BMC_500IN1 },
@@ -329,7 +328,6 @@ static const nes_pcb pcb_list[] =
{ "bmc_gold150", BMC_GOLD150 },
{ "bmc_gold260", BMC_GOLD260 },
{ "bmc_th22913", BMC_TH22913 },
- { "bmc_s22games", BMC_SUPER22 },
{ "bmc_reset4", BMC_4IN1RESET },
{ "bmc_reset42", BMC_42IN1RESET },
{ "bmc_lc160", BMC_LITTLECOM160 },
diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h
index 90a2c73a603..6a50a9cf5ea 100644
--- a/src/devices/bus/nes/nes_slot.h
+++ b/src/devices/bus/nes/nes_slot.h
@@ -101,7 +101,7 @@ enum
BMC_FCGENJIN_8IN1, BMC_FK23C, BMC_FK23CA, BMC_JY820845C,
BMC_PJOY84, BMC_TH22913, BMC_11160, BMC_G146,
BMC_2751, BMC_8157, BMC_820720C, BMC_830118C, BMC_830832C, BMC_841101C,
- BMC_411120C, BMC_GOLD150, BMC_GOLD260, BMC_SUPER22,
+ 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_RESETSXROM, BMC_RESETTXROM0, BMC_RESETTXROM1, BMC_RESETTXROM2, BMC_TECHLINE9IN1,