Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bus/nes: More fixes for various multicart types. #8567

Merged
merged 1 commit into from Sep 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 20 additions & 5 deletions hash/nes.xml
Expand Up @@ -80281,7 +80281,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="bmc_d1038" />
<feature name="slot" value="bmc_vt5201" />
<feature name="pcb" value="BMC-D1038" />
<dataarea name="chr" size="65536">
<rom name="46-in-1 (d1038) [p1][u].chr" size="65536" crc="a2f2b37b" sha1="4cd8720e70762038b4a9cf2dec92dde0e38698d6" offset="00000" status="baddump" />
Expand Down Expand Up @@ -80707,7 +80707,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="bmc_d1038" />
<feature name="slot" value="bmc_vt5201" />
<feature name="pcb" value="BMC-D1038" />
<dataarea name="chr" size="65536">
<rom name="65-in-1 (nt766) [p1][u].chr" size="65536" crc="e1d03e4a" sha1="13c52b601ee0a9e3fe4030562e86118b7a5c9d62" offset="00000" status="baddump" />
Expand Down Expand Up @@ -80938,7 +80938,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="bmc_d1038" />
<feature name="slot" value="bmc_vt5201" />
<feature name="pcb" value="BMC-D1038" />
<dataarea name="chr" size="65536">
<rom name="74-in-1 (nt886) [p1][u].chr" size="65536" crc="b2f00487" sha1="f21320df2d199887a4e9b231c7bf3afcc77ac9ec" offset="00000" status="baddump" />
Expand Down Expand Up @@ -80992,7 +80992,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="bmc_d1038" />
<feature name="slot" value="bmc_vt5201" />
<feature name="pcb" value="BMC-D1038" />
<dataarea name="chr" size="65536">
<rom name="77-in-1 (nt141) [p1][u].chr" size="65536" crc="3f03ecaf" sha1="1e65bb75da9f008bf37a0a2c058f9771ac09caac" offset="00000" status="baddump" />
Expand All @@ -81016,6 +81016,7 @@ be better to redump them properly. -->
<part name="cart" interface="nes_cart">
<feature name="slot" value="bmc_21in1" />
<feature name="pcb" value="BMC-21IN1" />
<feature name="mirroring" value="horizontal" />
<dataarea name="chr" size="32768">
<rom name="8-in-1 [p1].chr" size="32768" crc="a1f6c479" sha1="888834d627637e75d2636a7f34d6a0ff234e8929" offset="00000" status="baddump" />
</dataarea>
Expand Down Expand Up @@ -81915,6 +81916,21 @@ to check why this is different -->
</part>
</software>

<software name="mc_s190">
<description>Super 190 in 1</description>
<year>19??</year>
<publisher>&lt;pirate&gt;</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="bmc_s700" />
<dataarea name="prg" size="2097152">
<rom name="super 190-in-1.prg" size="2097152" crc="8dae13b2" sha1="cd36b113a0091666621c3248601ae5ca33d0605d" status="baddump" />
</dataarea>
<dataarea name="chr" size="1048576">
<rom name="super 190-in-1.chr" size="1048576" crc="47abdc9f" sha1="289ae7628687dc4b370adee42f3a97034ce6ed2b" status="baddump" />
</dataarea>
</part>
</software>

<!-- If you select the keyboard it does not work due to missing data -->
<software name="mc_s200" supported="partial">
<description>Super 200 in 1 MD-8802 (Incomplete?)</description>
Expand Down Expand Up @@ -82089,7 +82105,6 @@ to check why this is different -->
<part name="cart" interface="nes_cart">
<feature name="slot" value="bmc_vt5201" />
<feature name="pcb" value="BMC-VT5201" />
<feature name="mirroring" value="high" />
<dataarea name="chr" size="65536">
<rom name="super 35 in 1 (6 in 1 vt5201).chr" size="65536" crc="a3d8d9dd" sha1="34703a76b76c7244a21237e41b8aed7a1ef95cae" offset="00000" status="baddump" />
</dataarea>
Expand Down
145 changes: 56 additions & 89 deletions src/devices/bus/nes/multigame.cpp
Expand Up @@ -186,8 +186,8 @@ nes_bmc_190in1_device::nes_bmc_190in1_device(const machine_config &mconfig, cons
{
}

nes_vt5201_device::nes_vt5201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: nes_nrom_device(mconfig, NES_VT5201, tag, owner, clock), m_latch(0), m_dipsetting(0)
nes_vt5201_device::nes_vt5201_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_VT5201, tag, owner, clock), m_latch(0), m_jumper(0)
{
}

Expand Down Expand Up @@ -298,7 +298,7 @@ nes_bmc_hik300_device::nes_bmc_hik300_device(const machine_config &mconfig, cons
{
}

nes_bmc_s700_device::nes_bmc_s700_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
nes_bmc_s700_device::nes_bmc_s700_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BMC_S700, tag, owner, clock)
{
}
Expand All @@ -323,12 +323,12 @@ nes_bmc_12in1_device::nes_bmc_12in1_device(const machine_config &mconfig, const
{
}

nes_bmc_20in1_device::nes_bmc_20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
nes_bmc_20in1_device::nes_bmc_20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BMC_20IN1, tag, owner, clock)
{
}

nes_bmc_21in1_device::nes_bmc_21in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
nes_bmc_21in1_device::nes_bmc_21in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BMC_21IN1, tag, owner, clock)
{
}
Expand Down Expand Up @@ -614,17 +614,16 @@ void nes_vt5201_device::device_start()
{
common_start();
save_item(NAME(m_latch));
save_item(NAME(m_dipsetting));
save_item(NAME(m_jumper));
}

void nes_vt5201_device::pcb_reset()
{
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg32(0);
chr8(0, m_chr_source);
chr8(0, CHRROM);

m_latch = 0;
m_dipsetting = 0;
m_jumper = 0;
}

void nes_bmc_80013b_device::device_start()
Expand Down Expand Up @@ -827,18 +826,6 @@ void nes_bmc_hik300_device::pcb_reset()
chr8(0, CHRROM);
}

void nes_bmc_s700_device::device_start()
{
common_start();
}

void nes_bmc_s700_device::pcb_reset()
{
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg32(0);
chr8(0, m_chr_source);
}

void nes_bmc_ball11_device::device_start()
{
common_start();
Expand Down Expand Up @@ -913,32 +900,6 @@ void nes_bmc_12in1_device::pcb_reset()
update_banks();
}

void nes_bmc_20in1_device::device_start()
{
common_start();
}

void nes_bmc_20in1_device::pcb_reset()
{
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(0);
prg16_cdef(m_prg_chunks - 1);
chr8(0, m_chr_source);
set_nt_mirroring(PPU_MIRROR_VERT);
}

void nes_bmc_21in1_device::device_start()
{
common_start();
}

void nes_bmc_21in1_device::pcb_reset()
{
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg32(0);
chr8(0, m_chr_source);
}

void nes_bmc_35in1_device::device_start()
{
common_start();
Expand Down Expand Up @@ -1576,36 +1537,41 @@ void nes_bmc_190in1_device::write_h(offs_t offset, u8 data)

/*-------------------------------------------------

BMC-VT5201
BMC-VT5201, BMC-T3H53, BMC-D1038

Games: Super 35 in 1, TN 95 in 1, 46 in 1, 65 in 1,
74 in 1, 77 in 1

iNES: mapper 59

In MAME: Supported.

-------------------------------------------------*/

void nes_vt5201_device::write_h(offs_t offset, uint8_t data)
void nes_vt5201_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("vt5201 wirte_h, offset: %04x, data: %02x\n", offset, data));
LOG_MMC(("vt5201 write_h, offset: %04x, data: %02x\n", offset, data));

m_latch = BIT(offset, 8);

// not sure about this mirroring bit!!
// without it TN 95 in 1 has glitches in Lunar Ball; with it TN 95 in 1 has glitches in Galaxian!
set_nt_mirroring(BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
if (BIT(offset, 7))
if (!BIT(m_latch, 1)) // lock bit
{
prg16_89ab((offset >> 4) & 0x07);
prg16_cdef((offset >> 4) & 0x07);
m_latch = offset >> 8;

u8 bank = (offset >> 4) & 0x07;
u8 mode = !BIT(offset, 7);
prg16_89ab(bank & ~mode);
prg16_cdef(bank | mode);

chr8(offset & 0x07, CHRROM);
set_nt_mirroring(BIT(offset, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
else
prg32((offset >> 5) & 0x03);
chr8(offset, CHRROM);
}

uint8_t nes_vt5201_device::read_h(offs_t offset)
u8 nes_vt5201_device::read_h(offs_t offset)
{
LOG_MMC(("bmc_vt5201 read_h, offset: %04x\n", offset));
// m_dipsetting = ioport("CARTDIPS")->read();

if (m_latch)
return m_dipsetting; // cart mode, depending on the Dip Switches (always zero atm, given we have no way to add cart-based DIPs)
if (BIT(m_latch, 0))
return (get_open_bus() & 0xfc) | m_jumper; // TODO: add jumper settings, m_jumper is 0 for now
else
return hi_access_rom(offset);
}
Expand Down Expand Up @@ -2237,31 +2203,33 @@ void nes_bmc_hik300_device::write_h(offs_t offset, u8 data)
BMC-SUPER-700IN1

Unknown Bootleg Multigame Board
Games: Super 700 in 1
Games: Super 700 in 1, Super 190 in 1

iNES: mapper 62

In MESS: Supported.
In MAME: Supported.

TODO:
- Investigate why Gradius menu items 643-649 crash
700-in-1 after pressing start at title screen.
Gradius works from other menu numbers fine.
- Slalom and Star Force have the wrong mirroring
on 190-in-1. Bug on cart, bad dump, or is there
another bit that affects mirroring?

-------------------------------------------------*/

void nes_bmc_s700_device::write_h(offs_t offset, uint8_t data)
void nes_bmc_s700_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("bmc_s700 write_h, offset :%04x, data: %02x\n", offset, data));

chr8(((offset & 0x1f) << 2) | (data & 0x03), CHRROM);
LOG_MMC(("bmc_s700 write_h, offset: %04x, data: %02x\n", offset, data));

if (offset & 0x20)
{
prg16_89ab((offset & 0x40) | ((offset >> 8) & 0x3f));
prg16_cdef((offset & 0x40) | ((offset >> 8) & 0x3f));
}
else
{
prg32(((offset & 0x40) | ((offset >> 8) & 0x3f)) >> 1);
}
u8 bank = (offset & 0x40) | ((offset >> 8) & 0x3f);
u8 mode = !BIT(offset, 5);
prg16_89ab(bank & ~mode);
prg16_cdef(bank | mode);

set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
chr8((offset & 0x1f) << 2 | (data & 0x03), CHRROM);
set_nt_mirroring(BIT(offset, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}

/*-------------------------------------------------
Expand Down Expand Up @@ -2454,18 +2422,17 @@ void nes_bmc_12in1_device::write_h(offs_t offset, uint8_t data)

iNES: mapper 231

In MESS: Supported.
In MAME: Supported.

-------------------------------------------------*/

void nes_bmc_20in1_device::write_h(offs_t offset, uint8_t data)
void nes_bmc_20in1_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("bmc_20in1 write_h, offset: %04x, data: %02x\n", offset, data));

set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);

prg16_89ab((offset & 0x1e));
prg16_cdef((offset & 0x1e) | ((offset & 0x20) ? 1 : 0));
prg16_89ab(offset & 0x1e);
prg16_cdef((offset & 0x1e) | BIT(offset, 5));
set_nt_mirroring(BIT(offset, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}

/*-------------------------------------------------
Expand All @@ -2477,11 +2444,11 @@ void nes_bmc_20in1_device::write_h(offs_t offset, uint8_t data)

iNES: mapper 201

In MESS: Supported.
In MAME: Supported.

-------------------------------------------------*/

void nes_bmc_21in1_device::write_h(offs_t offset, uint8_t data)
void nes_bmc_21in1_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("bmc_21in1 write_h, offset: %04x, data: %02x\n", offset, data));

Expand Down