diff options
Diffstat (limited to 'src/devices/bus/nes/mmc1_clones.cpp')
-rw-r--r-- | src/devices/bus/nes/mmc1_clones.cpp | 79 |
1 files changed, 76 insertions, 3 deletions
diff --git a/src/devices/bus/nes/mmc1_clones.cpp b/src/devices/bus/nes/mmc1_clones.cpp index eb5b7d937ab..b0502e5f394 100644 --- a/src/devices/bus/nes/mmc1_clones.cpp +++ b/src/devices/bus/nes/mmc1_clones.cpp @@ -28,11 +28,17 @@ // constructor //------------------------------------------------- -DEFINE_DEVICE_TYPE(NES_NINJARYU, nes_ninjaryu_device, "nes_ninjaryu", "NES Cart Ninja Ryukenden Chinese PCB") -DEFINE_DEVICE_TYPE(NES_RESETSXROM, nes_resetsxrom_device, "nes_resetsxrom", "NES Cart BMC RESET-SXROM PCB") -DEFINE_DEVICE_TYPE(NES_TXC_22110, nes_txc_22110_device, "nes_txc_22110", "NES Cart TXC 01-22110-000 PCB") +DEFINE_DEVICE_TYPE(NES_BMC_JY820845C, nes_bmc_jy820845c_device, "nes_bmc_jy820845c", "NES Cart BMC JY820845C PCB") +DEFINE_DEVICE_TYPE(NES_NINJARYU, nes_ninjaryu_device, "nes_ninjaryu", "NES Cart Ninja Ryukenden Chinese PCB") +DEFINE_DEVICE_TYPE(NES_RESETSXROM, nes_resetsxrom_device, "nes_resetsxrom", "NES Cart BMC RESET-SXROM PCB") +DEFINE_DEVICE_TYPE(NES_TXC_22110, nes_txc_22110_device, "nes_txc_22110", "NES Cart TXC 01-22110-000 PCB") +nes_bmc_jy820845c_device::nes_bmc_jy820845c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_sxrom_device(mconfig, NES_BMC_JY820845C, tag, owner, clock), m_latch0(0), m_mode(0) +{ +} + nes_ninjaryu_device::nes_ninjaryu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_sxrom_device(mconfig, NES_NINJARYU, tag, owner, clock) { @@ -50,6 +56,22 @@ nes_txc_22110_device::nes_txc_22110_device(const machine_config &mconfig, const +void nes_bmc_jy820845c_device::device_start() +{ + nes_sxrom_device::device_start(); + save_item(NAME(m_latch0)); + save_item(NAME(m_mode)); +} + +void nes_bmc_jy820845c_device::pcb_reset() +{ + nes_sxrom_device::pcb_reset(); + + m_latch0 = 0; + m_mode = 0; + update_banks(); +} + void nes_resetsxrom_device::device_start() { nes_sxrom_device::device_start(); @@ -117,6 +139,57 @@ void nes_ninjaryu_device::write_h(offs_t offset, u8 data) /*------------------------------------------------- + BMC-JY820845C + + Games: 7 in 1 1993 Chess Series (JY-015) + + MMC1 clone with banking for multigame menu. + + NES 2.0: mapper 550 + + In MAME: Supported. + + -------------------------------------------------*/ + +void nes_bmc_jy820845c_device::update_banks() // used by menu and MHROM games +{ + prg32((m_mode & 0x07) << 1 | BIT(m_latch0, 4)); + chr8((m_mode & 0x06) << 1 | (m_latch0 & 0x03), CHRROM); +} + +void nes_bmc_jy820845c_device::write_m(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_jy820845c write_m, offset: %04x, data: %02x\n", offset, data)); + + nes_sxrom_device::write_m(offset, data); // register overlaid on WRAM + + if (offset >= 0x1000 && !BIT(m_mode, 3)) + { + m_mode = offset & 0x0f; + if ((m_mode & 0x06) == 0x06) // MMC1 mode + { + set_prg(); + set_chr(); + } + else + update_banks(); + } +} + +void nes_bmc_jy820845c_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_jy820845c write_h, offset: %04x, data: %02x\n", offset, data)); + + m_latch0 = data; + + if ((m_mode & 0x06) == 0x06) + nes_sxrom_device::write_h(offset, data); + else + update_banks(); +} + +/*------------------------------------------------- + BMC-RESET-SXROM Games: 4 in 1 (JY-021, JY-022, JY-051) |