Skip to content

Commit

Permalink
bus/nes: Added support for multicart board DS-9-27. (#9525)
Browse files Browse the repository at this point in the history
New working software list additions (nes.xml)
-----------------------------------
Gàishì 190 in 1 [Consolethinks]
  • Loading branch information
0kmg committed Apr 6, 2022
1 parent 9abd5fa commit e65b730
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 2 deletions.
20 changes: 20 additions & 0 deletions hash/nes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81184,6 +81184,26 @@ be better to redump them properly. -->
</part>
</software>

<software name="mc_190a">
<description>Gàishì 190 in 1</description>
<year>1992</year>
<publisher>&lt;pirate&gt;</publisher>
<info name="alt_title" value="1992 蓋世 190-in-1"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="bmc_ds927" />
<feature name="pcb_model" value="DS-9-27" />
<dataarea name="prg" size="1048576">
<rom name="190-in-1.prg" size="1048576" crc="ef212a73" sha1="8667ab8e727dc340ba082097ca906e85424e7cd3" />
</dataarea>
<!-- 8k VRAM on cartridge -->
<dataarea name="vram" size="8192">
</dataarea>
<!-- 8k WRAM on cartridge -->
<dataarea name="wram" size="8192">
</dataarea>
</part>
</software>

<software name="mc_1500">
<description>1500 in 1</description>
<year>199?</year>
Expand Down
91 changes: 91 additions & 0 deletions src/devices/bus/nes/multigame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ DEFINE_DEVICE_TYPE(NES_BMC_970630C, nes_bmc_970630c_device, "nes_bmc_97063
DEFINE_DEVICE_TYPE(NES_NTD03, nes_ntd03_device, "nes_ntd03", "NES Cart NTD-03 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_CTC09, nes_bmc_ctc09_device, "nes_bmc_ctc09", "NES Cart BMC CTC-09 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_CTC12IN1, nes_bmc_ctc12in1_device, "nes_bmc_ctc12in1", "NES Cart BMC CTC-12IN1 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_DS927, nes_bmc_ds927_device, "nes_bmc_ds927", "NES Cart BMC DS-9-27 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_FAM250, nes_bmc_fam250_device, "nes_bmc_fam250", "NES Cart BMC FAM250 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_GKA, nes_bmc_gka_device, "nes_bmc_gka", "NES Cart BMC GK-A PCB")
DEFINE_DEVICE_TYPE(NES_BMC_GKB, nes_bmc_gkb_device, "nes_bmc_gkb", "NES Cart BMC GK-B PCB")
Expand Down Expand Up @@ -239,6 +240,11 @@ nes_bmc_ctc09_device::nes_bmc_ctc09_device(const machine_config &mconfig, const
{
}

nes_bmc_ds927_device::nes_bmc_ds927_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BMC_DS927, tag, owner, clock), m_latch(0), m_mode(0)
{
}

nes_bmc_gka_device::nes_bmc_gka_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BMC_GKA, tag, owner, clock)
{
Expand Down Expand Up @@ -761,6 +767,24 @@ void nes_bmc_ctc09_device::pcb_reset()
// contents?). Soft reset can similarly crash the main menu (BTANB?).
}

void nes_bmc_ds927_device::device_start()
{
common_start();
save_item(NAME(m_latch));
save_item(NAME(m_mode));
}

void nes_bmc_ds927_device::pcb_reset()
{
assert(m_prgram.size() >= 0x2000);

prg16_89ab(0);
prg16_cdef(0);

m_latch = 0;
m_mode = 0;
}

void nes_bmc_gka_device::device_start()
{
common_start();
Expand Down Expand Up @@ -1858,6 +1882,73 @@ void nes_bmc_ctc09_device::write_h(offs_t offset, u8 data)
chr8(data & 0x0f, CHRROM);
}

/*-------------------------------------------------
Board DS-9-27
Games: 190 in 1
Bizarro board of mostly simple games that has
8K of WRAM that is mappable, with mirroring in
NROM128 mode, to anywhere in upper memory.
NES 2.0: mapper 452
In MAME: Supported.
-------------------------------------------------*/

u8 nes_bmc_ds927_device::read_h(offs_t offset)
{
// LOG_MMC(("bmc_ds927 read_h, offset: %04x\n", offset));

int bits = m_mode == 1 ? 1 : 2;

if (BIT(offset, 13, bits) == BIT(m_latch, 4, bits))
return m_prgram[offset & 0x1fff];

return hi_access_rom(offset);
}

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

if (offset < 0x6000)
{
m_latch = data;
m_mode = bitswap<2>(data, 3, 1);

int bank = BIT(offset, 1, 7);

switch (m_mode)
{
case 0:
prg16_89ab(bank >> 1);
prg16_cdef(0);
break;
case 1:
for (int i = 0; i < 4; i++)
prg8_x(i, bank);
break;
case 2:
case 3:
prg8_89(bank);
prg8_ab(bank | 1);
prg8_cd(bank | 2);
prg8_ef(bank | 3 | (data & 0x04));
break;
}
}

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

int bits = m_mode == 1 ? 1 : 2;

if (BIT(offset, 13, bits) == BIT(m_latch, 4, bits))
m_prgram[offset & 0x1fff] = data;
}

/*-------------------------------------------------
Board BMC-GKA
Expand Down
23 changes: 23 additions & 0 deletions src/devices/bus/nes/multigame.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,28 @@ class nes_bmc_ctc09_device : public nes_nrom_device
};


// ======================> nes_bmc_ds927_device

class nes_bmc_ds927_device : public nes_nrom_device
{
public:
// construction/destruction
nes_bmc_ds927_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);

virtual u8 read_h(offs_t offset) 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;

private:
u8 m_latch, m_mode;
};


// ======================> nes_bmc_gka_device

class nes_bmc_gka_device : public nes_nrom_device
Expand Down Expand Up @@ -1322,6 +1344,7 @@ DECLARE_DEVICE_TYPE(NES_BMC_970630C, nes_bmc_970630c_device)
DECLARE_DEVICE_TYPE(NES_NTD03, nes_ntd03_device)
DECLARE_DEVICE_TYPE(NES_BMC_CTC09, nes_bmc_ctc09_device)
DECLARE_DEVICE_TYPE(NES_BMC_CTC12IN1, nes_bmc_ctc12in1_device)
DECLARE_DEVICE_TYPE(NES_BMC_DS927, nes_bmc_ds927_device)
DECLARE_DEVICE_TYPE(NES_BMC_FAM250, nes_bmc_fam250_device)
DECLARE_DEVICE_TYPE(NES_BMC_GKA, nes_bmc_gka_device)
DECLARE_DEVICE_TYPE(NES_BMC_GKB, nes_bmc_gkb_device)
Expand Down
1 change: 1 addition & 0 deletions src/devices/bus/nes/nes_carts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("ntd03", NES_NTD03);
device.option_add_internal("bmc_ctc09", NES_BMC_CTC09);
device.option_add_internal("bmc_ctc12in1", NES_BMC_CTC12IN1);
device.option_add_internal("bmc_ds927", NES_BMC_DS927);
device.option_add_internal("bmc_fam250", NES_BMC_FAM250);
device.option_add_internal("bmc_gka", NES_BMC_GKA);
device.option_add_internal("bmc_gkb", NES_BMC_GKB);
Expand Down
8 changes: 7 additions & 1 deletion src/devices/bus/nes/nes_ines.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,13 @@ static const nes_mmc mmc_list[] =
// 445 DG574B MMC3-compatible multicart
// 446 Mindkids SMD172B_FPGA board
// 447 VRC4-based KL-06 multicart
// 448...511 Unused
// 448 VRC4-based 830768C multicart
// 449 Super Games King multicart
// 450 VRC2-based YY841157C multicart
// 451 homebrew Haratyler HP/MP
{ 452, BMC_DS927 },
// 453 Realtec 8042
// 454...511 Unused
// 512 probably the correct MMC3 clone for chuugokt in nes.xml
{ 513, SACHEN_SA9602B },
// 514 seems to be for skaraok, currently set to UNKNOWN in nes.xml
Expand Down
1 change: 1 addition & 0 deletions src/devices/bus/nes/nes_pcb.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ static const nes_pcb pcb_list[] =
{ "ntd03", BMC_NTD_03 },
{ "bmc_ctc09", BMC_CTC09 },
{ "bmc_ctc12in1", BMC_CTC_12IN1 },
{ "bmc_ds927", BMC_DS927 },
{ "bmc_fam250", BMC_FAM250 },
{ "bmc_gka", BMC_GKA },
{ "bmc_gkb", BMC_GKB },
Expand Down
2 changes: 1 addition & 1 deletion src/devices/bus/nes/nes_slot.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ enum
BMC_72IN1, BMC_SUPER_42IN1, BMC_76IN1,
BMC_31IN1, BMC_22GAMES, BMC_20IN1, BMC_5IN1_1993,
BMC_70IN1, BMC_500IN1, BMC_800IN1, BMC_1200IN1,
BMC_GKA, BMC_GKB, BMC_GKCXIN1, BMC_GN91B, BMC_GOLD260,
BMC_DS927, BMC_GKA, BMC_GKB, BMC_GKCXIN1, BMC_GN91B, BMC_GOLD260,
BMC_HP898F, BMC_VT5201, BMC_BENSHIENG,
BMC_CTC09, BMC_CTC_12IN1, BMC_60311C, BMC_80013B, BMC_810544C, BMC_82AB,
BMC_830425C, BMC_830506C, BMC_830928C, BMC_850437C, BMC_891227, BMC_970630C,
Expand Down
1 change: 1 addition & 0 deletions src/mame/machine/nes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ void nes_state::machine_start()
BMC_800IN1,
BMC_8157,
BMC_970630C,
BMC_DS927,
BMC_KC885,
BMC_TELETUBBIES,
BMC_VT5201,
Expand Down

0 comments on commit e65b730

Please sign in to comment.