bus/nes: Added support for Sachen's Zhōngguó Dàhēng cartridge. (#9540)

This commit is contained in:
0kmg 2022-04-09 16:51:16 -08:00 committed by GitHub
parent 07b5dc9d47
commit 0270ca721b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 117 additions and 12 deletions

View File

@ -54310,7 +54310,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
<info name="alt_title" value="侍魂"/>
<info name="alt_title" value="Shìhún"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="unl_shero" />
<feature name="slot" value="sachen_shero" />
<feature name="pcb" value="UNL-SHERO" />
<feature name="mirroring" value="4screen" />
<dataarea name="chr" size="524288">
@ -54399,23 +54399,26 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
<!-- TC-031 is unknown. Possibly "Bridge", an unreleased proto -->
<software name="chuugokt" supported="partial">
<description>Chuugoku Taitei (Tw)</description>
<year>19??</year>
<software name="zgdaheng">
<description>Zhōngguó Dàhēng (Taiwan)</description>
<year>199?</year>
<publisher>Sachen</publisher>
<info name="serial" value="TC-032"/>
<info name="alt_title" value="中國大亨"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="txrom" />
<feature name="pcb" value="NES-TLROM" /> <!-- Original header was mapper 116, but it's not a SOMARI pcb... -->
<feature name="slot" value="sachen_zgdh" />
<dataarea name="chr" size="131072">
<rom name="chuugoku taitei (asia) (unl).chr" size="131072" crc="d9203c08" sha1="b32ef62e4583b216aea84f7d0da0269c01b61e26" offset="00000" status="baddump" />
</dataarea>
<dataarea name="prg" size="262144">
<rom name="chuugoku taitei (asia) (unl).prg" size="262144" crc="3acdcc64" sha1="32436a43d3c371ab7aa6bb5165f60ca5c006a60e" offset="00000" status="baddump" />
</dataarea>
<!-- 8k WRAM on cartridge -->
<dataarea name="wram" size="8192">
<!-- 8k VRAM on cartridge -->
<dataarea name="vram" size="8192">
</dataarea>
<!-- 8k WRAM on cartridge, battery backed up -->
<dataarea name="bwram" size="8192">
<rom value="0x00" size="8192" offset="0" loadflag="fill" />
</dataarea>
</part>
</software>

View File

@ -52,6 +52,7 @@ DEFINE_DEVICE_TYPE(NES_COCOMA, nes_cocoma_device, "nes_cocoma",
DEFINE_DEVICE_TYPE(NES_GOUDER, nes_gouder_device, "nes_gouder", "NES Cart Gouder PCB")
DEFINE_DEVICE_TYPE(NES_SA9602B, nes_sa9602b_device, "nes_sa9602b", "NES Cart SA-9602B PCB")
DEFINE_DEVICE_TYPE(NES_SACHEN_SHERO, nes_sachen_shero_device, "nes_shero", "NES Cart Street Hero PCB")
DEFINE_DEVICE_TYPE(NES_SACHEN_ZGDH, nes_sachen_zgdh_device, "nes_zgdh", "NES Cart Zhongguo Daheng PCB")
DEFINE_DEVICE_TYPE(NES_A9746, nes_a9746_device, "nes_bmc_a9746", "NES Cart A-9746 PCB")
DEFINE_DEVICE_TYPE(NES_A88S1, nes_a88s1_device, "nes_a88s1", "NES Cart BMC A88S-1 PCB")
@ -294,6 +295,11 @@ nes_sachen_shero_device::nes_sachen_shero_device(const machine_config &mconfig,
{
}
nes_sachen_zgdh_device::nes_sachen_zgdh_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_txrom_device(mconfig, NES_SACHEN_ZGDH, tag, owner, clock), m_reg(0)
{
}
nes_a9746_device::nes_a9746_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: nes_txrom_device(mconfig, NES_A9746, tag, owner, clock)
{
@ -689,6 +695,20 @@ void nes_sachen_shero_device::pcb_reset()
mmc3_common_initialize(0xff, 0xff, 0);
}
void nes_sachen_zgdh_device::device_start()
{
mmc3_start();
save_item(NAME(m_reg));
}
void nes_sachen_zgdh_device::pcb_reset()
{
assert(m_vram.size() >= 0x2000);
m_reg = 0;
mmc3_common_initialize(0x1f, 0x7f, 0);
}
void nes_a9746_device::device_start()
{
mmc3_start();
@ -2116,6 +2136,61 @@ u8 nes_sachen_shero_device::read_l(offs_t offset)
return get_open_bus();
}
/*-------------------------------------------------
SACHEN-ZGDH
Sachen board used for Zhongguo Daheng
NES 2.0: mapper 512
In MAME: Supported.
-------------------------------------------------*/
u8 nes_sachen_zgdh_device::nt_r(offs_t offset)
{
if (m_reg == 1)
return m_vram[0x1000 + (offset & 0x0fff)];
else
return device_nes_cart_interface::nt_r(offset);
}
void nes_sachen_zgdh_device::nt_w(offs_t offset, u8 data)
{
if (m_reg == 1)
m_vram[0x1000 + (offset & 0x0fff)] = data;
else
device_nes_cart_interface::nt_w(offset, data);
}
void nes_sachen_zgdh_device::set_chr(u8 chr, int chr_base, int chr_mask)
{
if (m_reg <= 1)
{
chr = CHRROM;
m_chr_mask = 0x7f;
}
else
{
chr = CHRRAM;
m_chr_mask = 0x03;
}
nes_txrom_device::set_chr(chr, chr_base, m_chr_mask);
}
void nes_sachen_zgdh_device::write_l(offs_t offset, u8 data)
{
LOG_MMC(("zgdh write_l, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
if ((offset & 0x1100) == 0x0100)
{
m_reg = data & 0x03;
set_chr(m_chr_source, m_chr_base, m_chr_mask);
}
}
/*-------------------------------------------------
UNL-A9746

View File

@ -476,6 +476,30 @@ private:
u8 m_reg;
};
// ======================> nes_sachen_zgdh_device
class nes_sachen_zgdh_device : public nes_txrom_device
{
public:
// construction/destruction
nes_sachen_zgdh_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
virtual void write_l(offs_t offset, u8 data) override;
virtual u8 nt_r(offs_t offset) override;
virtual void nt_w(offs_t offset, u8 data) override;
virtual void pcb_reset() override;
protected:
// device-level overrides
virtual void device_start() override;
virtual void set_chr(u8 chr, int chr_base, int chr_mask) override;
private:
u8 m_reg;
};
// ======================> nes_a9746_device
class nes_a9746_device : public nes_txrom_device
@ -1229,6 +1253,7 @@ DECLARE_DEVICE_TYPE(NES_COCOMA, nes_cocoma_device)
DECLARE_DEVICE_TYPE(NES_GOUDER, nes_gouder_device)
DECLARE_DEVICE_TYPE(NES_SA9602B, nes_sa9602b_device)
DECLARE_DEVICE_TYPE(NES_SACHEN_SHERO, nes_sachen_shero_device)
DECLARE_DEVICE_TYPE(NES_SACHEN_ZGDH, nes_sachen_zgdh_device)
DECLARE_DEVICE_TYPE(NES_A9746, nes_a9746_device)
DECLARE_DEVICE_TYPE(NES_A88S1, nes_a88s1_device)

View File

@ -364,7 +364,8 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("sfight3", NES_SF3);
device.option_add_internal("gouder", NES_GOUDER);
device.option_add_internal("sa9602b", NES_SA9602B);
device.option_add_internal("unl_shero", NES_SACHEN_SHERO);
device.option_add_internal("sachen_shero", NES_SACHEN_SHERO);
device.option_add_internal("sachen_zgdh", NES_SACHEN_ZGDH);
device.option_add_internal("a9746", NES_A9746); // mapper 219
// misc multigame cart boards
device.option_add_internal("benshieng", NES_BENSHIENG);

View File

@ -490,7 +490,7 @@ static const nes_mmc mmc_list[] =
{ 452, BMC_DS927 },
// 453 Realtec 8042
// 454...511 Unused
// 512 probably the correct MMC3 clone for chuugokt in nes.xml
{ 512, SACHEN_ZGDH },
{ 513, SACHEN_SA9602B },
// 514 seems to be for skaraok, currently set to UNKNOWN in nes.xml
// 515 Korean Family Noraebang karaoke cart with expansion cart, mic, and YM2413!

View File

@ -369,7 +369,8 @@ static const nes_pcb pcb_list[] =
{ "jyc_c", JYCOMPANY_C },
{ "tek90", JYCOMPANY_A },
{ "sa9602b", SACHEN_SA9602B },
{ "unl_shero", SACHEN_SHERO },
{ "sachen_shero", SACHEN_SHERO },
{ "sachen_zgdh", SACHEN_ZGDH },
{ "a9746", UNL_A9746 },
{ "mmalee2", UNL_MMALEE },
{ "unl_2708", UNL_2708 },

View File

@ -72,7 +72,7 @@ enum
SACHEN_SA009, SACHEN_SA0036, SACHEN_SA0037,
SACHEN_SA72007, SACHEN_SA72008, SACHEN_SA9602B,
SACHEN_TCA01, SACHEN_TCU01, SACHEN_TCU02, SACHEN_3013, SACHEN_3014,
SACHEN_74LS374, SACHEN_74LS374_ALT, SACHEN_SHERO,
SACHEN_74LS374, SACHEN_74LS374_ALT, SACHEN_SHERO, SACHEN_ZGDH,
// Sunsoft
SUNSOFT_1, SUNSOFT_2, SUNSOFT_3, SUNSOFT_4,
SUNSOFT_DCS, SUNSOFT_5, SUNSOFT_FME7,