diff options
author | etabeta78 <doge.fabio@gmail.com> | 2016-06-27 18:32:36 +0200 |
---|---|---|
committer | etabeta78 <doge.fabio@gmail.com> | 2016-06-27 18:32:36 +0200 |
commit | fb781994a4d3de868f175d32d3e8df5a027d8914 (patch) | |
tree | f4d3e3ad6333637cfdadef92619b6e49b71df97f /src/devices/bus/nes/kaiser.cpp | |
parent | b730796b8f4517cb56ebb760acdb37b01f72e139 (diff) |
checkpoint. nw.
Diffstat (limited to 'src/devices/bus/nes/kaiser.cpp')
-rw-r--r-- | src/devices/bus/nes/kaiser.cpp | 159 |
1 files changed, 157 insertions, 2 deletions
diff --git a/src/devices/bus/nes/kaiser.cpp b/src/devices/bus/nes/kaiser.cpp index 911099d71b4..340aca500cc 100644 --- a/src/devices/bus/nes/kaiser.cpp +++ b/src/devices/bus/nes/kaiser.cpp @@ -15,14 +15,15 @@ * Kaiser KS7022 * Kaiser KS7032 * Kaiser KS7058 + * Kaiser KS7016 + * Kaiser KS7037 - The Kaiser KS7057 bootleg board is emulated in nes_mmc3_clones.c + The Kaiser KS7057 bootleg board is emulated in nes_mmc3_clones.cpp TODO: - FCEUmm lists more Kaiser PCBs: * KS7030 (for Yume Koujou Doki Doki Panic by Kaiser?) - * KS7037 but there seem to be no available dumps... ***********************************************************************************************************/ @@ -55,6 +56,8 @@ const device_type NES_KS7017 = &device_creator<nes_ks7017_device>; const device_type NES_KS7012 = &device_creator<nes_ks7012_device>; const device_type NES_KS7013B = &device_creator<nes_ks7013b_device>; const device_type NES_KS7031 = &device_creator<nes_ks7031_device>; +const device_type NES_KS7016 = &device_creator<nes_ks7016_device>; +const device_type NES_KS7037 = &device_creator<nes_ks7037_device>; nes_ks7058_device::nes_ks7058_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) @@ -102,6 +105,16 @@ nes_ks7031_device::nes_ks7031_device(const machine_config &mconfig, const char * { } +nes_ks7016_device::nes_ks7016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : nes_nrom_device(mconfig, NES_KS7031, "NES Cart Kaiser KS-7016 PCB", tag, owner, clock, "nes_ks7016", __FILE__) +{ +} + +nes_ks7037_device::nes_ks7037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : nes_nrom_device(mconfig, NES_KS7037, "NES Cart Kaiser KS-7037 PCB", tag, owner, clock, "nes_ks7037", __FILE__) +{ +} + @@ -226,7 +239,41 @@ void nes_ks7031_device::pcb_reset() m_reg[3] = 0; } +void nes_ks7016_device::device_start() +{ + common_start(); + save_item(NAME(m_reg)); +} + +void nes_ks7016_device::pcb_reset() +{ + prg8_89(0xc); + prg8_ab(0xd); + prg8_cd(0xe); + prg8_ef(0xf); + chr8(0, CHRRAM); + + m_reg = 4; +} + +void nes_ks7037_device::device_start() +{ + common_start(); + save_item(NAME(m_latch)); + save_item(NAME(m_reg)); +} +void nes_ks7037_device::pcb_reset() +{ + prg8_89(0); + prg8_ab(0x1e); + prg8_cd(0); + prg8_ef(0x1f); + chr8(0, CHRRAM); + + memset(m_reg, 0, sizeof(m_reg)); + m_latch = 0; +} @@ -586,3 +633,111 @@ WRITE8_MEMBER(nes_ks7031_device::write_h) LOG_MMC(("ks7031 write_h, offset: %04x, data: %02x\n", offset, data)); m_reg[(offset >> 11) & 3] = data & 0x3f; } + + + +/*------------------------------------------------- + + Kaiser Board KS7016 + + Games: Exciting Basket FDS Conversion + + iNES: + + In MESS: Unsupported. + + -------------------------------------------------*/ + +READ8_MEMBER(nes_ks7016_device::read_m) +{ +// LOG_MMC(("ks7016 read_m, offset: %04x\n", offset)); + return m_prg[((m_reg * 0x2000) + (offset & 0x1fff)) & (m_prg_size - 1)]; +} + +WRITE8_MEMBER(nes_ks7016_device::write_h) +{ + LOG_MMC(("ks7016 write_h, offset: %04x, data: %02x\n", offset, data)); + UINT8 mask = offset & 0x30; + if ((offset & 0x5943) == 0x5943) + m_reg = (mask == 0x30) ? 0xb : (((offset >> 2) & 0x0f) << 1); + if ((offset & 0x5943) == 0x5903) + m_reg = (mask != 0x30) ? 0xb : (((offset >> 2) & 0x0f) << 1); +} + + +/*------------------------------------------------- + + Kaiser Board KS7037 + + Games: Metroid (FDS conversion) + + This PCB maps PRG in 0x7000-0x7fff in a very + similar fashion to LH10 (see bootleg.cpp) + but with WRAM split between 0x6000-0x6fff + and 0xb000-0xbfff. + + iNES: + + In MESS: Unsupported. + + -------------------------------------------------*/ + +void nes_ks7037_device::update_prg() +{ + prg8_89(m_reg[6]); + prg8_ab(0xfe); + prg8_cd(m_reg[7]); + prg8_ef(0xff); + set_nt_page(0, CIRAM, m_reg[2] & 1, 1); + set_nt_page(1, CIRAM, m_reg[3] & 1, 1); + set_nt_page(2, CIRAM, m_reg[4] & 1, 1); + set_nt_page(3, CIRAM, m_reg[5] & 1, 1); +} + +READ8_MEMBER(nes_ks7037_device::read_m) +{ +// LOG_MMC(("ks7037 read_m, offset: %04x\n", offset)); + if (offset < 0x1000) + return m_prgram[offset & 0x0fff]; + else + return m_prg[(0x1e * 0x1000) + (offset & 0x0fff)]; +} + +WRITE8_MEMBER(nes_ks7037_device::write_m) +{ + LOG_MMC(("ks7037 write_m, offset: %04x, data: %02x\n", offset, data)); + if (offset < 0x1000) + m_prgram[offset & 0x0fff] = data; +} + +READ8_MEMBER(nes_ks7037_device::read_h) +{ +// LOG_MMC(("ks7037 read_h, offset: %04x\n", offset)); + + if (offset >= 0x3000 && offset < 0x4000) + return m_prgram[0x1000 + (offset & 0x0fff)]; + + return hi_access_rom(offset); +} + +WRITE8_MEMBER(nes_ks7037_device::write_h) +{ + LOG_MMC(("ks7037 write_h, offset: %04x, data: %02x\n", offset, data)); + + if (offset >= 0x3000 && offset < 0x4000) + m_prgram[0x1000 + (offset & 0x0fff)] = data; + else + { + switch (offset & 0x6001) + { + case 0x0000: + m_latch = data & 7; + break; + case 0x0001: + m_reg[m_latch] = data; + update_prg(); + break; + } + } +} + |