bus/nes: Improved support for BMC-64IN1NR boards. (#9586)

New working software list additions (nes.xml)
-----------------------------------
76 in 1 Y2K [superretrogamer2741]
Super HiK 42 in 1 (K-42001) [Consolethinks]
This commit is contained in:
0kmg 2022-04-17 16:49:57 -08:00 committed by GitHub
parent 8b2ee49845
commit ab79550425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 68 additions and 49 deletions

View File

@ -84139,6 +84139,21 @@ be better to redump them properly. -->
</part>
</software>
<software name="mc_76y2k">
<description>76 in 1 Y2K</description>
<year>19??</year>
<publisher>&lt;pirate&gt;</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="bmc_64y2k" />
<dataarea name="prg" size="2097152">
<rom name="y2k 76-in-1.prg" size="2097152" crc="736dd9e1" sha1="d666c646342fd5c72630d989d3f633c53143ef33" />
</dataarea>
<!-- 8k VRAM on cartridge -->
<dataarea name="vram" size="8192">
</dataarea>
</part>
</software>
<software name="mc_77">
<description>77 in 1 (NT141)</description>
<year>19??</year>
@ -85882,6 +85897,21 @@ be better to redump them properly. -->
</part>
</software>
<software name="mc_sh42">
<description>Super HiK 42 in 1 (K-42001)</description>
<year>1998</year>
<publisher>&lt;pirate&gt;</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="bmc_64y2k" />
<dataarea name="prg" size="1048576">
<rom name="super hik 42-in-1 (k-42001).prg" size="1048576" crc="ad97266b" sha1="a10bd03f1e125fa1d39b1c9db2b49b783de3dd45" />
</dataarea>
<!-- 8k VRAM on cartridge -->
<dataarea name="vram" size="8192">
</dataarea>
</part>
</software>
<software name="mc_sh6ek">
<description>1994 Super HIK 6 in 1 (EK-601)</description>
<year>19??</year>

View File

@ -357,8 +357,8 @@ nes_bmc_22games_device::nes_bmc_22games_device(const machine_config &mconfig, co
{
}
nes_bmc_64y2k_device::nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: nes_nrom_device(mconfig, NES_BMC_64Y2K, tag, owner, clock)
nes_bmc_64y2k_device::nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BMC_64Y2K, tag, owner, clock), m_reg_mask(0)
{
}
@ -986,14 +986,11 @@ void nes_bmc_64y2k_device::device_start()
void nes_bmc_64y2k_device::pcb_reset()
{
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
chr8(0, m_chr_source);
m_reg_mask = m_chr_source == CHRROM ? 0x03 : 0x01;
m_reg[0] = 0x80;
m_reg[1] = 0x43;
m_reg[2] = m_reg[3] = 0;
set_prg();
set_nt_mirroring(PPU_MIRROR_VERT);
update_banks();
}
void nes_bmc_420y2k_device::device_start()
@ -2652,54 +2649,45 @@ void nes_bmc_22games_device::write_h(offs_t offset, u8 data)
Games: 64-in-1 Y2K
In MESS: Supported
NES 2.0: mapper 314
In MAME: Supported.
-------------------------------------------------*/
void nes_bmc_64y2k_device::set_prg()
void nes_bmc_64y2k_device::update_banks()
{
uint8_t helper1 = m_reg[1] & 0x1f;
uint8_t helper2 = (helper1 << 1) | BIT(m_reg[1], 6);
if (m_reg[0] & 0x80)
{
if (m_reg[1] & 0x80)
prg32(helper1);
else
{
prg16_89ab(helper2);
prg16_cdef(helper2);
}
}
if (BIT(m_reg[0] & m_reg[1], 7))
prg32(m_reg[1]);
else
prg16_cdef(helper2);
}
void nes_bmc_64y2k_device::write_l(offs_t offset, uint8_t data)
{
LOG_MMC(("bmc64y2k write_l, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
switch (offset)
{
case 0x1000:
case 0x1001:
case 0x1002:
case 0x1003:
m_reg[offset & 0x03] = data;
set_prg();
chr8(BIT(m_reg[0], 1, 2) | (m_reg[2] << 2), CHRROM);
break;
u8 bank = m_reg[1] << 1 | BIT(m_reg[1], 6);
prg16_89ab(bank);
prg16_cdef(bank | (BIT(m_reg[0], 7) ? 0 : 7));
}
if (offset == 0x1000) /* write to reg[0] also sets mirroring */
set_nt_mirroring(BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
chr8(BIT(m_reg[0], 1, 2) | (m_reg[2] << 2), m_chr_source);
set_nt_mirroring(BIT(m_reg[0], 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
void nes_bmc_64y2k_device::write_h(offs_t offset, uint8_t data)
void nes_bmc_64y2k_device::write_l(offs_t offset, u8 data)
{
LOG_MMC(("bmc64y2k write_h, offset: %04x, data: %02x\n", offset, data));
LOG_MMC(("bmc_64y2k write_l, offset: %04x, data: %02x\n", offset, data));
m_reg[3] = data; // reg[3] is currently unused?!?
offset += 0x100;
if (offset >= 0x1000)
{
m_reg[offset & m_reg_mask] = data;
update_banks();
}
}
void nes_bmc_64y2k_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("bmc_64y2k write_h, offset: %04x, data: %02x\n", offset, data));
if (!BIT(m_reg[0], 7))
prg16_89ab(((m_reg[1] << 1) & ~0x07) | (data & 0x07));
}
/*-------------------------------------------------

View File

@ -798,10 +798,10 @@ class nes_bmc_64y2k_device : public nes_nrom_device
{
public:
// construction/destruction
nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
virtual void write_l(offs_t offset, uint8_t data) override;
virtual void write_h(offs_t offset, uint8_t data) override;
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;
@ -810,8 +810,9 @@ protected:
virtual void device_start() override;
private:
void set_prg();
uint8_t m_reg[4];
void update_banks();
u8 m_reg[4];
u8 m_reg_mask;
};