bus/nes: Enable menu access for a Contra/22-in-1 combo cart.

This commit is contained in:
0kmg 2021-08-02 13:46:06 -08:00
parent 14c82e93d6
commit 528c36e9c7
3 changed files with 39 additions and 29 deletions

View File

@ -78461,14 +78461,14 @@ be better to redump them properly. -->
</part>
</software>
<software name="mc_22rb" supported="partial">
<software name="mc_22rb">
<description>22 in 1 (Reset Based)</description>
<year>19??</year>
<publisher>&lt;pirate&gt;</publisher>
<info name="usage" value="Press reset to use multigame menu."/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="bmc_22games" />
<feature name="pcb" value="BMC-22GAMES" />
<feature name="mirroring" value="vertical" />
<dataarea name="prg" size="655360">
<rom name="22 in 1 (reset based).prg" size="655360" crc="03fdefad" sha1="4e84be9a20c5e385ae71c466a02613d5a74de01e" offset="00000" status="baddump" />
</dataarea>

View File

@ -301,8 +301,8 @@ nes_bmc_ball11_device::nes_bmc_ball11_device(const machine_config &mconfig, cons
{
}
nes_bmc_22games_device::nes_bmc_22games_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: nes_nrom_device(mconfig, NES_BMC_22GAMES, tag, owner, clock)
nes_bmc_22games_device::nes_bmc_22games_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BMC_22GAMES, tag, owner, clock), m_latch(0), m_reset(0)
{
}
@ -851,14 +851,25 @@ void nes_bmc_ball11_device::pcb_reset()
void nes_bmc_22games_device::device_start()
{
common_start();
save_item(NAME(m_latch));
save_item(NAME(m_reset));
}
void nes_bmc_22games_device::pcb_reset()
{
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(0);
prg16_cdef(7);
chr8(0, m_chr_source);
if (m_reset)
{
prg32(4);
m_latch = 1;
}
else
{
prg16_89ab(0);
prg16_cdef(7);
set_nt_mirroring(PPU_MIRROR_VERT);
m_reset = 1;
}
chr8(0, CHRRAM);
}
void nes_bmc_64y2k_device::device_start()
@ -2278,37 +2289,33 @@ void nes_bmc_ball11_device::write_h(offs_t offset, u8 data)
BMC-22GAMES
Unknown Bootleg Multigame Board
Games: 22 in 1
Games: Contra/22 in 1 combo
iNES: mapper 230
In MESS: Partially Supported. It would need a reset
to work (not possible yet)
In MAME: Supported.
TODO: Determine whether reset works as written or
whether it toggles between Contra and the game menu.
Reset to Contra from the menu or other games often
fails due to RAM contents it seems.
-------------------------------------------------*/
void nes_bmc_22games_device::write_h(offs_t offset, uint8_t data)
void nes_bmc_22games_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("bmc_22games write_h, offset: %04x, data: %02x\n", offset, data));
if (1) // this should flip at reset
if (m_latch)
{
prg16_89ab(data & 0x07);
}
else
{
if (data & 0x20)
{
prg16_89ab((data & 0x1f) + 8);
prg16_cdef((data & 0x1f) + 8);
}
else
{
prg16_89ab((data & 0x1f) + 8);
prg16_cdef((data & 0x1f) + 9);
}
u8 bank = (data & 0x1f) + 8;
u8 mode = !BIT(data, 5);
prg16_89ab(bank & ~mode);
prg16_cdef(bank | mode);
set_nt_mirroring(BIT(data, 6) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
}
else
prg16_89ab(data & 0x07);
}
/*-------------------------------------------------

View File

@ -675,15 +675,18 @@ class nes_bmc_22games_device : public nes_nrom_device
{
public:
// construction/destruction
nes_bmc_22games_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
nes_bmc_22games_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
virtual void write_h(offs_t offset, uint8_t data) 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:
int m_latch, m_reset;
};