diff options
author | 0kmg <9137159+0kmg@users.noreply.github.com> | 2021-08-29 02:14:29 -0800 |
---|---|---|
committer | 0kmg <9137159+0kmg@users.noreply.github.com> | 2021-08-29 13:23:14 -0800 |
commit | 3ef474b26a961a8bae8c257e7fea1db9244904d2 (patch) | |
tree | 8582f62166607e93ddd423a8577076ca6f3e49b2 /src/devices/bus | |
parent | d30361b7f003aff1fca171cac83cd9584fae03f1 (diff) |
bus/nes: Fixed several games not loading in Maxi 15 multicarts.
Software list items promoted to working (nes.xml)
---------------------------------------
Maxi 15 (Aus)
Maxi 15 (USA)
Maxi 15 (USA, v2.0)
Diffstat (limited to 'src/devices/bus')
-rw-r--r-- | src/devices/bus/nes/ave.cpp | 62 | ||||
-rw-r--r-- | src/devices/bus/nes/ave.h | 8 |
2 files changed, 26 insertions, 44 deletions
diff --git a/src/devices/bus/nes/ave.cpp b/src/devices/bus/nes/ave.cpp index 2e93ea17501..836cdaed9df 100644 --- a/src/devices/bus/nes/ave.cpp +++ b/src/devices/bus/nes/ave.cpp @@ -48,8 +48,8 @@ nes_nina006_device::nes_nina006_device(const machine_config &mconfig, const char { } -nes_maxi15_device::nes_maxi15_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, NES_MAXI15, tag, owner, clock), m_reg(0), m_bank(0) +nes_maxi15_device::nes_maxi15_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_MAXI15, tag, owner, clock) { } @@ -80,29 +80,24 @@ void nes_nina006_device::pcb_reset() chr8(0, m_chr_source); } - void nes_maxi15_device::device_start() { common_start(); - save_item(NAME(m_bank)); save_item(NAME(m_reg)); } void nes_maxi15_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg32(0); - chr8(0, m_chr_source); + chr8(0, CHRROM); set_nt_mirroring(PPU_MIRROR_VERT); - m_reg = 0; - m_bank = 0; + m_reg[0] = m_reg[1] = 0; } - /*------------------------------------------------- mapper specific handlers -------------------------------------------------*/ @@ -118,7 +113,7 @@ void nes_maxi15_device::pcb_reset() then readable back in WRAM (WRAM is tested by Impossible Mission II at start) - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ @@ -151,7 +146,7 @@ void nes_nina001_device::write_m(offs_t offset, uint8_t data) iNES: mapper 79 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ @@ -174,41 +169,30 @@ void nes_nina006_device::write_l(offs_t offset, uint8_t data) iNES: mapper 234 - In MESS: Partially Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_maxi15_device::update_banks() -{ - if (m_bank & 0x40) - { - prg32((m_bank & 0x0e) | (m_reg & 1)); - chr8(((m_bank & 0x0e) << 2) | ((m_reg >> 4) & 7), m_chr_source); - } - else - { - prg32(m_bank & 0x0f); - chr8(((m_bank & 0x0f) << 2) | ((m_reg >> 4) & 3), m_chr_source); - } -} - -uint8_t nes_maxi15_device::read_h(offs_t offset) +u8 nes_maxi15_device::read_h(offs_t offset) { LOG_MMC(("Maxi 15 read_h, offset: %04x\n", offset)); - if (offset >= 0x7f80 && offset < 0x7fa0) - { - m_bank = hi_access_rom(offset); - set_nt_mirroring(BIT(m_bank, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); - update_banks(); - return m_bank; - } - if (offset >= 0x7fe8 && offset < 0x7ff8) + u8 temp = hi_access_rom(offset); + + if ((offset >= 0x7f80 && offset < 0x7fa0) || (offset >= 0x7fe8 && offset < 0x7ff8)) { - m_reg = hi_access_rom(offset); - update_banks(); - return m_reg; + int reg = BIT(offset, 6); + if (reg || !(m_reg[0] & 0x3f)) // inner banks always modifiable, outer banks locked once set + { + m_reg[reg] = temp; + + u8 mode = !BIT(m_reg[0], 6); + u8 outer = m_reg[0] & (0x0e | mode); + prg32(outer | (m_reg[1] & !mode)); + chr8(outer << 2 | ((m_reg[1] >> 4) & (7 >> mode)), CHRROM); + set_nt_mirroring(BIT(m_reg[0], 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + } } - return hi_access_rom(offset); + return temp; } diff --git a/src/devices/bus/nes/ave.h b/src/devices/bus/nes/ave.h index b40d2ed6d9d..14a1203678d 100644 --- a/src/devices/bus/nes/ave.h +++ b/src/devices/bus/nes/ave.h @@ -50,9 +50,9 @@ class nes_maxi15_device : public nes_nrom_device { public: // construction/destruction - nes_maxi15_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_maxi15_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual uint8_t read_h(offs_t offset) override; + virtual u8 read_h(offs_t offset) override; virtual void pcb_reset() override; @@ -61,9 +61,7 @@ protected: virtual void device_start() override; private: - void update_banks(); - - uint8_t m_reg, m_bank; + u8 m_reg[2]; }; |