bus/nes: Added support for multicart variant of JY830623C board. (#9120)

- Renamed MK2 board to JY830623C, the PCB label of at least one of the related bootlegs.
- Removed deprecated hold_irq_line().

New working software list additions (nes.xml)
-----------------------------------
1995 Super HiK 4 in 1 (JY-016) [krzysiobal, NewRisingSun]
1995 Super HiK 4 in 1 (JY-017) [krzysiobal, NewRisingSun]
This commit is contained in:
0kmg 2022-02-07 15:12:19 -09:00 committed by GitHub
parent b8f4bb43f7
commit 9da06744f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 115 additions and 71 deletions

View File

@ -52139,6 +52139,36 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
</part>
</software>
<software name="mc_4jy16">
<description>1995 Super HiK 4 in 1 (JY-016)</description>
<year>1995</year>
<publisher>J.Y. Company</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="jy830623c" />
<dataarea name="prg" size="524288">
<rom name="1995 super hik 4-in-1 (jy-016).prg" size="524288" crc="843f9a6b" sha1="4b80da18c37e0ff351333f0b660a51e1e5a4c160" status="baddump" />
</dataarea>
<dataarea name="chr" size="1048576">
<rom name="1995 super hik 4-in-1 (jy-016).chr" size="1048576" crc="afa3e3b8" sha1="80d4d42179505448f436558880cb5966d6fe863d" status="baddump" />
</dataarea>
</part>
</software>
<software name="mc_4jy17">
<description>1995 Super HiK 4 in 1 (JY-017)</description>
<year>1995</year>
<publisher>J.Y. Company</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="jy830623c" />
<dataarea name="prg" size="524288">
<rom name="1995 super hik 4-in-1 (jy-017).prg" size="524288" crc="92b53816" sha1="21e5467a0108bb5f6a2911b17a24875a5cc2c70e" status="baddump" />
</dataarea>
<dataarea name="chr" size="1048576">
<rom name="1995 super hik 4-in-1 (jy-017).chr" size="1048576" crc="4c2b11f3" sha1="f24da433a562945d9c4aeb55cc375bdd05284b07" status="baddump" />
</dataarea>
</part>
</software>
<software name="mc_4jy18">
<description>1996 Super HiK 4 in 1 (JY-018)</description>
<year>1996</year>
@ -66504,8 +66534,7 @@ from the NEStopia source, hence they would require confirmation. -->
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="mk2" />
<feature name="pcb" value="UNL-MK2" />
<feature name="slot" value="jy830623c" />
<dataarea name="chr" size="262144">
<rom name="dragon ball z - super butoden 2 (199x)(-)(as)[p][a mapper 91].chr" size="262144" crc="589aa731" sha1="f49e24a9bc277065f6ac2132233bdbcb3df7163e" offset="00000" status="baddump" />
</dataarea>
@ -75660,8 +75689,7 @@ Other
<year>19??</year>
<publisher>&lt;pirate&gt;</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="mk2" />
<feature name="pcb" value="UNL-MK2" />
<feature name="slot" value="jy830623c" />
<dataarea name="chr" size="131072">
<rom name="super mario &amp; sonic 2 (as).chr" size="131072" crc="275e90da" sha1="b54ef68bbd5f7a3ff82cc2891945fc3d5b9984f2" offset="00000" status="baddump" />
</dataarea>
@ -75952,8 +75980,7 @@ Other
<year>19??</year>
<publisher>&lt;pirate&gt;</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="mk2" />
<feature name="pcb" value="UNL-MK2" />
<feature name="slot" value="jy830623c" />
<dataarea name="chr" size="65536">
<rom name="super mario kart raider (top rider hack)[p1].chr" size="65536" crc="efce7a4f" sha1="c96f07160658682ac5663e00fc2489e85cac5b13" offset="00000" status="baddump" />
</dataarea>
@ -75968,8 +75995,7 @@ Other
<year>19??</year>
<publisher>&lt;pirate&gt;</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="mk2" />
<feature name="pcb" value="UNL-MK2" />
<feature name="slot" value="jy830623c" />
<dataarea name="chr" size="32768">
<rom name="mario rider (unl).chr" size="32768" crc="8779113b" sha1="aaddb6a0702213923f89a693739652ee8c9c241d" offset="00000" status="baddump" />
</dataarea>
@ -77615,8 +77641,7 @@ be better to redump them properly. -->
<publisher>&lt;unknown&gt;</publisher>
<info name="alt_title" value="Street Fighter III - Mari Turbo"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="mk2" />
<feature name="pcb" value="UNL-MK2" />
<feature name="slot" value="jy830623c" />
<dataarea name="chr" size="524288">
<rom name="mari street fighter iii turbo (unl).chr" size="524288" crc="8f32eafb" sha1="cee57b353b6a6fd6d033a86bb83a5744dd0a02b4" offset="00000" status="baddump" />
</dataarea>
@ -77921,8 +77946,7 @@ be better to redump them properly. -->
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="mk2" />
<feature name="pcb" value="UNL-MK2" />
<feature name="slot" value="jy830623c" />
<dataarea name="chr" size="262144">
<rom name="mortal kombat ii (original) [p1].chr" size="262144" crc="79e05969" sha1="dc95afb67aba1ebb6c7b6101d38810aaac383e1d" offset="00000" status="baddump" />
</dataarea>
@ -78245,8 +78269,7 @@ be better to redump them properly. -->
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="mk2" />
<feature name="pcb" value="UNL-MK2" />
<feature name="slot" value="jy830623c" />
<dataarea name="chr" size="524288">
<rom name="street fighter iii (18 fighter) (unl).chr" size="524288" crc="2c40e304" sha1="3b868bd7404b6bb16740c280b4c80363eb66b014" offset="00000" status="baddump" />
</dataarea>
@ -78261,8 +78284,7 @@ be better to redump them properly. -->
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="mk2" />
<feature name="pcb" value="UNL-MK2" />
<feature name="slot" value="jy830623c" />
<dataarea name="chr" size="524288">
<rom name="street fighter iii (9 fighter) (unl).chr" size="524288" crc="2c40e304" sha1="3b868bd7404b6bb16740c280b4c80363eb66b014" offset="00000" status="baddump" />
</dataarea>

View File

@ -293,7 +293,7 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("xiaozy", NES_XIAOZY);
device.option_add_internal("edu2k", NES_EDU2K);
device.option_add_internal("t230", NES_T230);
device.option_add_internal("mk2", NES_MK2);
device.option_add_internal("jy830623c", NES_JY830623C);
device.option_add_internal("unl_43272", NES_43272); // used in Gaau Hok Gwong Cheung
device.option_add_internal("tf1201", NES_TF1201);
device.option_add_internal("th21311", NES_TH21311);

View File

@ -123,7 +123,7 @@ static const nes_mmc mmc_list[] =
{ 88, NAMCOT_34X3 },
{ 89, SUNSOFT_2 },
{ 90, JYCOMPANY_A },
{ 91, UNL_MK2 },
{ 91, UNL_JY830623C },
{ 92, JALECO_JF19 },
{ 93, SUNSOFT_2 },
{ 94, STD_UN1ROM },

View File

@ -201,7 +201,7 @@ static const nes_pcb pcb_list[] =
{ "xiaozy", UNL_XIAOZY },
{ "edu2k", UNL_EDU2K },
{ "t230", UNL_T230 },
{ "mk2", UNL_MK2 },
{ "jy830623c", UNL_JY830623C },
{ "zemina", ZEMINA_BOARD },
// misc bootleg boards
{ "ax40g", UNL_AX40G },

View File

@ -112,7 +112,7 @@ enum
// Unlicensed
UNL_8237, UNL_8237A, UNL_CC21, UNL_AX40G, UNL_AX5705, UNL_KN42,
UNL_KOF97, UNL_N625092, UNL_SC127, UNL_SMB2J, UNL_T230, UNL_MMALEE,
UNL_MK2, UNL_XIAOZY, UNL_KOF96, UNL_FS6,
UNL_JY830623C, UNL_XIAOZY, UNL_KOF96, UNL_FS6,
UNL_SF3, UNL_RACERMATE, UNL_EDU2K,
UNL_STUDYNGAME, UNL_603_5052, UNL_H2288, UNL_158B, UNL_2708,
UNL_MALISB, UNL_AC08, UNL_A9746, UNL_43272, UNL_TF1201, UNL_TH21311,

View File

@ -43,7 +43,7 @@ DEFINE_DEVICE_TYPE(NES_DAOU306, nes_daou306_device, "nes_daou306", "
DEFINE_DEVICE_TYPE(NES_CC21, nes_cc21_device, "nes_cc21", "NES Cart CC-21 PCB")
DEFINE_DEVICE_TYPE(NES_XIAOZY, nes_xiaozy_device, "nes_xiaozy", "NES Cart Xiao Zhuan Yuan PCB")
DEFINE_DEVICE_TYPE(NES_EDU2K, nes_edu2k_device, "nes_edu2k", "NES Cart Educational Computer 2000 PCB")
DEFINE_DEVICE_TYPE(NES_MK2, nes_mk2_device, "nes_mk2", "NES Cart Mortal Kombat 2 PCB")
DEFINE_DEVICE_TYPE(NES_JY830623C, nes_jy830623c_device, "nes_jy830623c", "NES Cart JY830623C PCB")
DEFINE_DEVICE_TYPE(NES_43272, nes_43272_device, "nes_43272", "NES Cart UNL-43272 PCB")
DEFINE_DEVICE_TYPE(NES_EH8813A, nes_eh8813a_device, "nes_eh8813a", "NES Cart UNL-EH8813A PCB")
@ -93,8 +93,8 @@ nes_edu2k_device::nes_edu2k_device(const machine_config &mconfig, const char *ta
{
}
nes_mk2_device::nes_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: nes_nrom_device(mconfig, NES_MK2, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0)
nes_jy830623c_device::nes_jy830623c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_JY830623C, tag, owner, clock), m_latch(0), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0)
{
}
@ -217,24 +217,23 @@ void nes_edu2k_device::pcb_reset()
m_latch = 0;
}
void nes_mk2_device::device_start()
void nes_jy830623c_device::device_start()
{
common_start();
save_item(NAME(m_irq_clear));
save_item(NAME(m_latch));
save_item(NAME(m_reg));
save_item(NAME(m_irq_enable));
save_item(NAME(m_irq_count));
save_item(NAME(m_irq_count_latch));
}
void nes_mk2_device::pcb_reset()
void nes_jy830623c_device::pcb_reset()
{
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(m_prg_chunks - 1);
prg16_cdef(m_prg_chunks - 1);
chr8(0, m_chr_source);
m_latch = 0;
std::fill(std::begin(m_reg), std::end(m_reg), 0x00);
update_banks();
set_nt_mirroring(PPU_MIRROR_VERT);
m_irq_clear = 0;
m_irq_enable = 0;
m_irq_count = m_irq_count_latch = 0;
}
@ -625,67 +624,86 @@ uint8_t nes_edu2k_device::read_m(offs_t offset)
/*-------------------------------------------------
Bootleg Board for MK2
Bootleg Board JY830623C
Games: Mortal Kombat II, Street Fighter III, Super Mario
Kart Rider
This board uses an IRQ system very similar to MMC3. We indeed
use mapper4_irq, but there is some small glitch!
iNES: mapper 91
In MESS: Supported.
In MAME: Partially supported.
FIXME: IRQ is fixed length but not every 7 scanlines
as done here. Rather it triggers once every 64 rises
of PPU A12. Various games have very obvious raster-
split issues from this bug. Also note there is
another submapper with cycle-based IRQ.
-------------------------------------------------*/
// Same IRQ as MMC3
void nes_mk2_device::hblank_irq( int scanline, int vblank, int blanked )
void nes_jy830623c_device::hblank_irq(int scanline, int vblank, int blanked)
{
if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE)
{
int prior_count = m_irq_count;
if ((m_irq_count == 0) || m_irq_clear)
m_irq_count = m_irq_count_latch;
else
if (m_irq_count)
m_irq_count--;
else
m_irq_count = m_irq_count_latch;
if (m_irq_enable && !blanked && (m_irq_count == 0) && (prior_count || m_irq_clear))
if (m_irq_enable && !blanked && !m_irq_count && prior_count)
{
LOG_MMC(("irq fired, scanline: %d\n", scanline));
hold_irq_line();
set_irq_line(ASSERT_LINE);
}
}
m_irq_clear = 0;
}
void nes_mk2_device::write_m(offs_t offset, uint8_t data)
void nes_jy830623c_device::update_banks()
{
LOG_MMC(("mk2 write_m, offset: %04x, data: %02x\n", offset, data));
prg8_89((m_latch & 0x06) << 3 | m_reg[4]);
prg8_ab((m_latch & 0x06) << 3 | m_reg[5]);
prg16_cdef((m_latch & 0x06) << 2 | 0x07);
switch (offset & 0x1000)
for (int i = 0; i < 4; i++)
chr2_x(2 * i, (m_latch & 1) << 8 | m_reg[i], CHRROM);
}
void nes_jy830623c_device::write_m(offs_t offset, u8 data)
{
LOG_MMC(("jy830623c write_m, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x1003)
{
case 0x0000:
switch (offset & 0x03)
{
case 0x00: chr2_0(data, CHRROM); break;
case 0x01: chr2_2(data, CHRROM); break;
case 0x02: chr2_4(data, CHRROM); break;
case 0x03: chr2_6(data, CHRROM); break;
}
break;
case 0x0001:
case 0x0002:
case 0x0003:
case 0x1000:
switch (offset & 0x03)
{
case 0x00: prg8_89(data); break;
case 0x01: prg8_ab(data); break;
case 0x02: m_irq_enable = 0; m_irq_count = 0; break;
case 0x03: m_irq_enable = 1; m_irq_count = 7; break;
}
case 0x1001:
m_reg[bitswap<3>(offset, 12, 1, 0)] = data;
update_banks();
break;
default:
logerror("mk2 write_m, uncaught addr: %04x value: %02x\n", offset + 0x6000, data);
case 0x1002:
m_irq_enable = 0;
m_irq_count = 0;
set_irq_line(CLEAR_LINE);
break;
case 0x1003:
m_irq_enable = 1;
m_irq_count = 7;
break;
}
}
void nes_jy830623c_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("jy830623c write_h, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x2000)
{
m_latch = offset;
update_banks();
}
}

View File

@ -178,15 +178,16 @@ private:
};
// ======================> nes_mk2_device
// ======================> nes_jy830623c_device
class nes_mk2_device : public nes_nrom_device
class nes_jy830623c_device : public nes_nrom_device
{
public:
// construction/destruction
nes_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
nes_jy830623c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
virtual void write_m(offs_t offset, uint8_t data) override;
virtual void write_m(offs_t offset, u8 data) override;
virtual void write_h(offs_t offset, u8 data) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
@ -196,8 +197,11 @@ protected:
virtual void device_start() override;
private:
uint16_t m_irq_count, m_irq_count_latch;
uint8_t m_irq_clear;
void update_banks();
u8 m_latch;
u8 m_reg[6];
u16 m_irq_count, m_irq_count_latch;
int m_irq_enable;
};
@ -283,7 +287,7 @@ DECLARE_DEVICE_TYPE(NES_DAOU306, nes_daou306_device)
DECLARE_DEVICE_TYPE(NES_CC21, nes_cc21_device)
DECLARE_DEVICE_TYPE(NES_XIAOZY, nes_xiaozy_device)
DECLARE_DEVICE_TYPE(NES_EDU2K, nes_edu2k_device)
DECLARE_DEVICE_TYPE(NES_MK2, nes_mk2_device)
DECLARE_DEVICE_TYPE(NES_JY830623C, nes_jy830623c_device)
DECLARE_DEVICE_TYPE(NES_43272, nes_43272_device)
DECLARE_DEVICE_TYPE(NES_EH8813A, nes_eh8813a_device)
//DECLARE_DEVICE_TYPE(NES_FUJIYA, nes_fujiya_device)