bus/nes: Added support for MMC1-based multicarts.

- Modified MMC1 base class (SxROM) to have outer bank base/mask to make it extensible by multicarts.
- Implemented two boards, reset-based SxROM and a 2-in-1 by TXC, as proof of concept.
- Marked Operation Wolf games as partially supported due to zapper inputs not working.
- Marked Space Shadow as not supported since it requires the extra buttons on the Bandai Hyper Shot gun.

New working software list additions (nes.xml)
-----------------------------------
1997 Super HiK 4 in 1 (JY-021) [MLX]
1995 Super HiK 4 in 1 (JY-022) [NewRisingSun, taizou]
1996 Super HiK 4 in 1 (JY-051) [NewRisingSun, taizou]
2 in 1 Uzi Lightgun [CaH4e3]
This commit is contained in:
0kmg 2021-09-08 16:31:48 -08:00
parent 925f5183a1
commit 968fb7f491
10 changed files with 342 additions and 21 deletions

View File

@ -27662,7 +27662,8 @@ license:CC0
</part>
</software>
<software name="opwolfj" cloneof="opwolf">
<!-- Playable with joypad but zapper does not work -->
<software name="opwolfj" cloneof="opwolf" supported="partial">
<description>Operation Wolf (Jpn)</description>
<year>1989</year>
<publisher>Taito</publisher>
@ -27683,7 +27684,8 @@ license:CC0
</part>
</software>
<software name="opwolfu" cloneof="opwolf">
<!-- Playable with joypad but zapper does not work -->
<software name="opwolfu" cloneof="opwolf" supported="partial">
<description>Operation Wolf - Take no Prisoners (USA, Rev. 0A)</description>
<year>1989</year>
<publisher>Taito</publisher>
@ -27703,7 +27705,8 @@ license:CC0
</part>
</software>
<software name="opwolf">
<!-- Playable with joypad but zapper does not work -->
<software name="opwolf" supported="partial">
<description>Operation Wolf - Take no Prisoners (Euro)</description>
<year>1992</year>
<publisher>Taito</publisher>
@ -49948,7 +49951,8 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
</part>
</software>
<software name="spaceshd">
<!-- The Bandai Hyper Shot controller/zapper for Space Shadow is not emulated -->
<software name="spaceshd" supported="no">
<description>Space Shadow (Jpn)</description>
<year>1989</year>
<publisher>Bandai</publisher>
@ -51850,6 +51854,38 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
</part>
</software>
<software name="mc_4jy21">
<description>1997 Super HiK 4 in 1 (JY-021)</description>
<year>1997</year>
<publisher>J.Y. Company</publisher>
<info name="usage" value="Press reset to switch games."/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="resetsxrom" />
<dataarea name="prg" size="524288">
<rom name="1997 super hik 4-in-1 (jy-021).prg" size="524288" crc="a609e2f0" sha1="27bfcd42d267cfa9a1d0bcbca1a6b0065a9352d9" status="baddump" />
</dataarea>
<dataarea name="chr" size="524288">
<rom name="1997 super hik 4-in-1 (jy-021).chr" size="524288" crc="4a797d16" sha1="e7cf3951f727913aa94dd702e1d5c48e19976bb9" status="baddump" />
</dataarea>
</part>
</software>
<software name="mc_4jy22">
<description>1995 Super HiK 4 in 1 (JY-022)</description>
<year>1995</year>
<publisher>J.Y. Company</publisher>
<info name="usage" value="Press reset to switch games."/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="resetsxrom" />
<dataarea name="prg" size="524288">
<rom name="1995 super hik 4-in-1 (jy-022).prg" size="524288" crc="22536920" sha1="64697df47dccdfc66609dc501c27ef321fcae9d5" status="baddump" />
</dataarea>
<dataarea name="chr" size="524288">
<rom name="1995 super hik 4-in-1 (jy-022).chr" size="524288" crc="7e83958f" sha1="ce0d958db917d8fb648db34e85e79dbad515d9f2" status="baddump" />
</dataarea>
</part>
</software>
<software name="mc_4jy23">
<description>1995 Super HiK 4 in 1 (JY-023)</description>
<year>1995</year>
@ -52019,6 +52055,23 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
</part>
</software>
<!-- Helicopter sprite in Cobra Command is corrupt in one of its two frames of animation. This is in CHR data. Either it's a bad dump or an error introduced by bootleggers. -->
<software name="mc_4jy51">
<description>1996 Super HiK 4 in 1 (JY-051)</description>
<year>1996</year>
<publisher>J.Y. Company</publisher>
<info name="usage" value="Press reset to switch games."/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="resetsxrom" />
<dataarea name="prg" size="524288">
<rom name="1996 super hik 4-in-1 (jy-051).prg" size="524288" crc="c936c92b" sha1="f0f66c30b06e980659dd757724ffe4fad5e01494" status="baddump" />
</dataarea>
<dataarea name="chr" size="524288">
<rom name="1996 super hik 4-in-1 (jy-051).chr" size="524288" crc="20303ae8" sha1="3a7fa6feb1b2083987357db9fdf0222d76e2b964" status="baddump" />
</dataarea>
</part>
</software>
<software name="mc_4jy57">
<description>1996 Super HiK 4 in 1 (JY-057)</description>
<year>1996</year>
@ -54488,6 +54541,23 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
</part>
</software>
<!-- The Bandai Hyper Shot controller/zapper for Space Shadow is not emulated. Operation Wolf currently only works with joypad but not zapper. -->
<software name="2uzilght" supported="partial">
<description>2 in 1 Uzi Lightgun</description>
<year>199?</year>
<publisher>Micro Genius</publisher>
<info name="serial" value="MGC-002"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="txc_22110" />
<dataarea name="prg" size="262144">
<rom name="2-in-1 uzi lightgun (mgc-002).prg" size="262144" crc="7349c91a" sha1="00d0c7a423b9c8c18974022c619d9f3084c4fd8d" status="baddump" />
</dataarea>
<dataarea name="chr" size="262144">
<rom name="2-in-1 uzi lightgun (mgc-002).chr" size="262144" crc="609035fd" sha1="309fddfd18f55d9d73fabfd0788bb8b92065c607" status="baddump" />
</dataarea>
</part>
</software>
<!-- Also verified on a Spanish cart by Gluk Video -->
<software name="creatom">
<description>Creatom (Tw, Spa)</description>

View File

@ -2830,6 +2830,8 @@ if (BUSES["NES"]~=null) then
MAME_DIR .. "src/devices/bus/nes/legacy.h",
MAME_DIR .. "src/devices/bus/nes/mmc1.cpp",
MAME_DIR .. "src/devices/bus/nes/mmc1.h",
MAME_DIR .. "src/devices/bus/nes/mmc1_clones.cpp",
MAME_DIR .. "src/devices/bus/nes/mmc1_clones.h",
MAME_DIR .. "src/devices/bus/nes/mmc2.cpp",
MAME_DIR .. "src/devices/bus/nes/mmc2.h",
MAME_DIR .. "src/devices/bus/nes/mmc3.cpp",

View File

@ -13,6 +13,10 @@
* 001 Yoshi flashes in-game.
* 001 Back to the Future have heavily corrupted graphics (since forever).
TODO:
- Combine 2 versions of set_prg in SxROM base class. This means dealing with
variant boards SNROM, SUROM, etc which repurpose bits in the MMC1 regs.
***********************************************************************************************************/
@ -142,6 +146,28 @@ TIMER_CALLBACK_MEMBER( nes_sxrom_device::resync_callback )
}
// Standard MMC1 PRG banking with base and mask (to support multicarts, etc)
void nes_sxrom_device::set_prg(int prg_base, int prg_mask)
{
u8 bank = prg_base | (m_reg[3] & prg_mask);
switch ((m_reg[0] >> 2) & 3)
{
case 0:
case 1:
prg32(bank >> 1);
break;
case 2:
prg16_89ab(prg_base);
prg16_cdef(bank);
break;
case 3:
prg16_89ab(bank);
prg16_cdef(prg_base | prg_mask);
break;
}
}
void nes_sxrom_device::set_prg()
{
uint8_t prg_mode, prg_offset;
@ -177,17 +203,16 @@ void nes_sxrom_device::set_prg()
}
}
void nes_sxrom_device::set_chr()
// Standard MMC1 CHR banking with base and mask (to support multicarts, etc)
void nes_sxrom_device::set_chr(int chr_base, int chr_mask)
{
uint8_t chr_mode = BIT(m_reg[0], 4);
if (chr_mode)
if (BIT(m_reg[0], 4))
{
chr4_0(m_reg[1] & 0x1f, m_chr_source);
chr4_4(m_reg[2] & 0x1f, m_chr_source);
chr4_0(chr_base | (m_reg[1] & chr_mask), m_chr_source);
chr4_4(chr_base | (m_reg[2] & chr_mask), m_chr_source);
}
else
chr8((m_reg[1] & 0x1f) >> 1, m_chr_source);
chr8((chr_base | (m_reg[1] & chr_mask)) >> 1, m_chr_source);
}
// this allows for easier implementation of the NES-EVENT board used for Nintento World Championships

View File

@ -31,8 +31,11 @@ protected:
TIMER_CALLBACK_MEMBER(resync_callback);
virtual void update_regs(int reg); // this is needed to simplify NES-EVENT pcb implementation, which handle differently some regs!
void set_prg(int prg_base, int prg_mask);
void set_chr(int chr_base, int chr_mask);
virtual void set_prg();
virtual void set_chr();
// virtual void set_prg() { set_prg(0x00, 0x0f); }
virtual void set_chr() { set_chr(0x00, 0x1f); }
uint8_t m_reg[4];
int m_reg_write_enable;

View File

@ -0,0 +1,153 @@
// license:BSD-3-Clause
// copyright-holders: kmg, Fabio Priuli
/***********************************************************************************************************
NES/Famicom cartridge emulation for MMC-1 clone PCBs
Here we emulate several pirate PCBs based on MMC-1 boards
***********************************************************************************************************/
#include "emu.h"
#include "mmc1_clones.h"
#ifdef NES_PCB_DEBUG
#define VERBOSE 1
#else
#define VERBOSE 0
#endif
#define LOG_MMC(x) do { if (VERBOSE) logerror x; } while (0)
//-------------------------------------------------
// constructor
//-------------------------------------------------
DEFINE_DEVICE_TYPE(NES_RESETSXROM, nes_resetsxrom_device, "nes_resetsxrom", "NES Cart BMC RESET-SXROM PCB")
DEFINE_DEVICE_TYPE(NES_TXC_22110, nes_txc_22110_device, "nes_txc_22110", "NES Cart TXC 01-22110-000 PCB")
nes_resetsxrom_device::nes_resetsxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_sxrom_device(mconfig, NES_RESETSXROM, tag, owner, clock), m_reset_count(-1)
{
}
nes_txc_22110_device::nes_txc_22110_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_sxrom_device(mconfig, NES_TXC_22110, tag, owner, clock), m_latch0(0), m_mode(0)
{
}
void nes_resetsxrom_device::device_start()
{
nes_sxrom_device::device_start();
save_item(NAME(m_reset_count));
}
void nes_resetsxrom_device::pcb_reset()
{
m_reset_count = (m_reset_count + 1) & 3;
nes_sxrom_device::pcb_reset();
}
void nes_txc_22110_device::device_start()
{
nes_sxrom_device::device_start();
save_item(NAME(m_latch0));
save_item(NAME(m_mode));
}
void nes_txc_22110_device::pcb_reset()
{
nes_sxrom_device::pcb_reset();
set_nt_mirroring(PPU_MIRROR_VERT);
m_latch0 = 0;
m_mode = 0;
update_banks();
}
/*-------------------------------------------------
mapper specific handlers
-------------------------------------------------*/
/*-------------------------------------------------
MULTIGAME CARTS BASED ON MMC1
-------------------------------------------------*/
/*-------------------------------------------------
BMC-RESET-SXROM
Games: 4 in 1 (JY-021, JY-022, JY-051)
MMC1 clone with outer banks switched by resetting.
NES 2.0: mapper 374
In MAME: Supported.
-------------------------------------------------*/
/*-------------------------------------------------
TXC 01-22110-000 Board
Games: 2 in 1 Uzi Lightgun (MGC-002)
This board has an MMC1 clone for Operation Wolf and
otherwise is mostly compatible with mapper 70 for
Bandai's Space Shadow.
NES 2.0: mapper 297
In MAME: Supported.
-------------------------------------------------*/
void nes_txc_22110_device::update_banks() // used by menu and Space Shadow
{
u8 outer = (m_mode & 0x02) << 1;
prg16_89ab(outer | (m_latch0 & 0x30) >> 4);
prg16_cdef(outer | 3);
chr8(m_latch0 & 0x0f, CHRROM);
}
void nes_txc_22110_device::write_l(offs_t offset, u8 data)
{
LOG_MMC(("TXC 22110 write_l, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x100) // $4100 - $41ff
{
m_mode = data;
if (m_mode & 1) // MMC1 mode
{
set_prg();
set_chr();
}
else
update_banks();
}
}
void nes_txc_22110_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("TXC 22110 write_h, offset: %04x, data: %02x\n", offset, data));
if (m_mode & 1)
nes_sxrom_device::write_h(offset, data);
else
{
m_latch0 = data;
update_banks();
}
}

View File

@ -0,0 +1,63 @@
// license:BSD-3-Clause
// copyright-holders: kmg, Fabio Priuli
#ifndef MAME_BUS_NES_MMC1_CLONES_H
#define MAME_BUS_NES_MMC1_CLONES_H
#pragma once
#include "mmc1.h"
// ======================> nes_resetsxrom_device
class nes_resetsxrom_device : public nes_sxrom_device
{
public:
// construction/destruction
nes_resetsxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
virtual void pcb_reset() override;
protected:
// device-level overrides
virtual void device_start() override;
virtual void set_prg() override { nes_sxrom_device::set_prg(m_reset_count << 3, 0x07); }
virtual void set_chr() override { nes_sxrom_device::set_chr(m_reset_count << 5, 0x1f); }
private:
int m_reset_count;
};
// ======================> nes_txc_22110_device
class nes_txc_22110_device : public nes_sxrom_device
{
public:
// construction/destruction
nes_txc_22110_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
virtual void write_l(offs_t offset, u8 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;
virtual void set_prg() override { nes_sxrom_device::set_prg(0x08, 0x07); }
virtual void set_chr() override { nes_sxrom_device::set_chr(0x20, 0x1f); }
private:
void update_banks();
u8 m_latch0, m_mode;
};
// device type definition
DECLARE_DEVICE_TYPE(NES_RESETSXROM, nes_resetsxrom_device)
DECLARE_DEVICE_TYPE(NES_TXC_22110, nes_txc_22110_device)
#endif // MAME_BUS_NES_MMC1_CLONES_H

View File

@ -61,6 +61,7 @@
#include "bootleg.h"
#include "multigame.h"
#include "pirate.h"
#include "mmc1_clones.h"
#include "mmc3_clones.h"
@ -217,6 +218,7 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("tengen_800008", NES_TENGEN_800008); // FIXME: Is this the same as CNROM?
device.option_add_internal("tengen_800032", NES_TENGEN_800032);
device.option_add_internal("tengen_800037", NES_TENGEN_800037);
device.option_add_internal("txc_22110", NES_TXC_22110);
device.option_add_internal("txc_22211", NES_TXC_22211);
device.option_add_internal("txc_dumarc", NES_TXC_DUMARACING);
device.option_add_internal("txc_mjblock", NES_TXC_MJBLOCK);
@ -418,6 +420,7 @@ void nes_cart(device_slot_interface &device)
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_lc160", NES_BMC_LC160);
device.option_add_internal("resetsxrom", NES_RESETSXROM);
// misc multigame cart MMC3 clone boards
device.option_add_internal("a88s1", NES_A88S1);
device.option_add_internal("fcgj8in1", NES_FCGJ8IN1);

View File

@ -175,7 +175,7 @@ static const nes_mmc mmc_list[] =
{ 139, SACHEN_8259C },
{ 140, JALECO_JF11 },
{ 141, SACHEN_8259A },
{ 142, KAISER_KS7032},
{ 142, KAISER_KS7032 },
{ 143, SACHEN_TCA01 },
{ 144, AGCI_50282 },
{ 145, SACHEN_SA72007 },
@ -195,8 +195,8 @@ static const nes_mmc mmc_list[] =
{ 159, BANDAI_LZ93EX1 }, // with 24c01
{ 160, SACHEN_SA009 },
// 161 Unused
{ 162, WAIXING_FS304}, // not confirmed, but a lot of chinese releases use it like this...
{ 163, NANJING_BOARD},
{ 162, WAIXING_FS304 }, // not confirmed, but a lot of chinese releases use it like this...
{ 163, NANJING_BOARD },
{ 164, WAIXING_FFV },
{ 165, WAIXING_SH2 },
{ 166, SUBOR_TYPE1 },
@ -208,7 +208,7 @@ static const nes_mmc mmc_list[] =
{ 172, TXC_DUMARACING },
{ 173, TXC_MJBLOCK },
{ 174, BMC_2751 },
{ 175, KAISER_KS7022},
{ 175, KAISER_KS7022 },
{ 176, UNL_XIAOZY },
{ 177, HENGG_SRICH },
{ 178, WAIXING_SGZLZ },
@ -332,7 +332,7 @@ static const nes_mmc mmc_list[] =
// 294 variant of mapper 134?
// 295 JY multicarts not yet in nes.xml
// 296 VT3x handhelds
// 297 2-in-1 Uzi Lightgun not in nes.xml
{ 297, TXC_22110 }, // 2-in-1 Uzi Lightgun
{ 298, UNL_TF1201 }, // Lethal Weapon (Enforcers) pirate
{ 299, BMC_11160 },
{ 300, BMC_190IN1 },
@ -409,7 +409,7 @@ static const nes_mmc mmc_list[] =
// 371 Spanish PEC-586 computer main cart
// 372 Rockman 1-6 multicart very close to mapper 45
// 373 Super 4-in-1, not in nes.xml?
// 374 various JY multicarts
{ 374, BMC_RESETSXROM },
// 375 135-in-1 2MB multicart
// 376 JY-041 multicart
// 377 JY-111 multicart, similar to mapper 367

View File

@ -130,6 +130,7 @@ static const nes_pcb pcb_list[] =
{ "tengen_800008", TENGEN_800008 }, /* FIXME: Is this the same as mapper 3? */
{ "tengen_800032", TENGEN_800032 },
{ "tengen_800037", TENGEN_800037 },
{ "txc_22110", TXC_22110 },
{ "txc_22211", TXC_22211 },
{ "txc_dumarc", TXC_DUMARACING },
{ "txc_mjblock", TXC_MJBLOCK },
@ -302,6 +303,7 @@ static const nes_pcb pcb_list[] =
{ "fk23c", BMC_FK23C },
{ "fk23ca", BMC_FK23CA },
{ "nt639", BMC_NT639 },
{ "resetsxrom", BMC_RESETSXROM },
{ "resettxrom0", BMC_RESETTXROM0 },
{ "resettxrom1", BMC_RESETTXROM1 },
{ "resettxrom2", BMC_RESETTXROM2 },

View File

@ -83,8 +83,8 @@ enum
// Tengen
TENGEN_800008, TENGEN_800032, TENGEN_800037,
// TXC
TXC_22211, TXC_DUMARACING, TXC_MJBLOCK,
TXC_COMMANDOS, TXC_TW, TXC_STRIKEW,
TXC_22110, TXC_22211, TXC_COMMANDOS, TXC_DUMARACING,
TXC_MJBLOCK, TXC_STRIKEW, TXC_TW,
// Multigame Carts
BMC_64IN1NR, BMC_190IN1, BMC_A65AS, BMC_A88S1, BMC_F15, BMC_GN45,
BMC_HIK8IN1, BMC_NOVEL1, BMC_NOVEL2, BMC_S24IN1SC03, BMC_T262,
@ -104,7 +104,7 @@ enum
BMC_411120C, BMC_GOLD150, BMC_GOLD260, BMC_SUPER22,
BMC_12IN1, BMC_4IN1RESET, BMC_42IN1RESET, BMC_LITTLECOM160, BMC_CTC09,
BMC_K1029, BMC_K3006, BMC_K3036, BMC_K3046, BMC_SA005A, BMC_TJ03,
BMC_RESETTXROM0, BMC_RESETTXROM1, BMC_RESETTXROM2, BMC_TECHLINE9IN1,
BMC_RESETSXROM, BMC_RESETTXROM0, BMC_RESETTXROM1, BMC_RESETTXROM2, BMC_TECHLINE9IN1,
// Unlicensed
UNL_8237, UNL_8237A, UNL_CC21, UNL_AX5705, UNL_KN42, UNL_KOF97,
UNL_N625092, UNL_SC127, UNL_SMB2J, UNL_T230, UNL_MMALEE,