From f4acd7279e3d9b9dac4773bef6695d232de2a584 Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Thu, 21 Apr 2022 04:50:15 -0800 Subject: [PATCH] bus/nes: Work on Tengen boards. (#9594) New NOT_WORKING software list additions (nes.xml) --------------------------------------- Skull & Crossbones (Korea) [MLX] --- hash/nes.xml | 136 +++++++++++++----------- src/devices/bus/nes/nes_carts.cpp | 1 - src/devices/bus/nes/nes_pcb.hxx | 1 - src/devices/bus/nes/nes_slot.h | 2 +- src/devices/bus/nes/sachen.cpp | 20 ++-- src/devices/bus/nes/sachen.h | 8 +- src/devices/bus/nes/tengen.cpp | 168 ++++++++++++------------------ src/devices/bus/nes/tengen.h | 46 +++----- 8 files changed, 176 insertions(+), 206 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index 86069d8d37d..34c3ddfbce4 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -39242,7 +39242,7 @@ license:CC0 Tengen - + @@ -54569,11 +54569,11 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - Taiwan Mahjong - Tai Wan Ma Que 16 (Tw) + Taiwan Mahjong - Tai Wan Ma Que 16 (Taiwan) 1989 Sachen - + @@ -54588,9 +54588,10 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - Taiwan Mahjong - Tai Wan Ma Que 16 (Tw, Alt) + Taiwan Mahjong - Tai Wan Ma Que 16 (Taiwan, alt) 1989 Sachen + @@ -54605,9 +54606,10 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - Taiwan Mahjong - Tai Wan Ma Que 16 (Tw, Pirate?) + Taiwan Mahjong - Tai Wan Ma Que 16 (Asia, pirate?) 1989 <pirate> + @@ -56101,6 +56103,77 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + + + Black Dragon (Korea) + 1991 + Haitai + + + + + + + + + + + + + + + + Nar-ara Superboy (Korea) + 1991? + Haitai + + + + + + + + + + + + + + + + Skull & Crossbones (Korea) + 1991 + Haitai + + + + + + + + + + + + + + Toobin' (Korea) + 1991? + Haitai + + + + + + + + + + + + + @@ -64125,24 +64198,6 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Black Dragon (Korea) - 19?? - Haitai - - - - - - - - - - - - - - Block Force (Asia, Ripped from Tetris Family 9 in 1?) 19?? @@ -64942,24 +64997,6 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Nar-ara Superboy (Korea) - 199? - Haitai - - - - - - - - - - - - - - Fudou Myouou Den (pirate) 19?? @@ -66590,23 +66627,6 @@ We don't include these hacks because they were not burned into real carts nor so - - Toobin' (Korea) - 1991? - Haitai - - - - - - - - - - - - - Toy Story 19?? diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index a83d436958b..5ea9c587d12 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -221,7 +221,6 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("s74x374a", NES_SACHEN_74X374_ALT); // FIXME: Made up boards some different handling device.option_add_internal("tcu01", NES_SACHEN_TCU01); device.option_add_internal("tcu02", NES_SACHEN_TCU02); - device.option_add_internal("tengen_800008", NES_TENGEN_800008); // FIXME: Is this the same as CNROM? device.option_add_internal("tengen_800032", NES_TENGEN_800032); device.option_add_internal("tengen_800037", NES_TENGEN_800037); device.option_add_internal("txc_22110", NES_TXC_22110); diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index ecadd4a788b..48c7995417d 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -129,7 +129,6 @@ static const nes_pcb pcb_list[] = { "tcu01", SACHEN_TCU01 }, { "tcu02", SACHEN_TCU02 }, { "sa9602b", SACHEN_SA9602B }, - { "tengen_800008", TENGEN_800008 }, /* FIXME: Is this the same as mapper 3? */ { "tengen_800032", TENGEN_800032 }, { "tengen_800037", TENGEN_800037 }, { "txc_22110", TXC_22110 }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index ff96195f03e..6370269332f 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -80,7 +80,7 @@ enum TAITO_TC0190FMC, TAITO_TC0190FMCP, TAITO_X1_005, TAITO_X1_017, // Tengen - TENGEN_800008, TENGEN_800032, TENGEN_800037, + TENGEN_800032, TENGEN_800037, // TXC TXC_22110, TXC_22211, TXC_COMMANDOS, TXC_DUMARACING, TXC_MJBLOCK, TXC_STRIKEW, TXC_TW, diff --git a/src/devices/bus/nes/sachen.cpp b/src/devices/bus/nes/sachen.cpp index 568e3f0f85d..c0a7cf09e75 100644 --- a/src/devices/bus/nes/sachen.cpp +++ b/src/devices/bus/nes/sachen.cpp @@ -9,8 +9,8 @@ Here we emulate the following PCBs * Sachen SA-009 [mapper 160] - * Sachen SA-0036 [mapper 148] - * Sachen SA-0037 [mapper 149] + * Sachen SA-0036 [mapper 149] + * Sachen SA-0037 [mapper 148] * Sachen SA-72007 [mapper 145] * Sachen SA-72008 [mapper 133] * Sachen TCA-01 [mapper 143] @@ -69,7 +69,7 @@ nes_sachen_sa009_device::nes_sachen_sa009_device(const machine_config &mconfig, { } -nes_sachen_sa0036_device::nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_sachen_sa0036_device::nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_SACHEN_SA0036, tag, owner, clock) { } @@ -274,30 +274,34 @@ void nes_sachen_sa009_device::write_l(offs_t offset, uint8_t data) iNES: mapper 149 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_sachen_sa0036_device::write_h(offs_t offset, uint8_t data) +void nes_sachen_sa0036_device::write_h(offs_t offset, u8 data) { LOG_MMC(("sa0036 write_h, offset: %04x, data: %02x\n", offset, data)); + // this pcb is subject to bus conflict + data = account_bus_conflict(offset, data); + chr8(data >> 7, CHRROM); } /*------------------------------------------------- Sachen SA0037 bootleg boards + Tengen 800008 board - Games: Mahjong World, Shisen Mahjong + Games: Mahjong World, Shisen Mahjong, Tengen Tetris iNES: mapper 148 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_sachen_sa0037_device::write_h(offs_t offset, uint8_t data) +void nes_sachen_sa0037_device::write_h(offs_t offset, u8 data) { LOG_MMC(("sa0037 write_h, offset: %04x, data: %02x\n", offset, data)); diff --git a/src/devices/bus/nes/sachen.h b/src/devices/bus/nes/sachen.h index f3d0ee1e5cd..51d80966380 100644 --- a/src/devices/bus/nes/sachen.h +++ b/src/devices/bus/nes/sachen.h @@ -26,9 +26,9 @@ class nes_sachen_sa0036_device : public nes_nrom_device { public: // construction/destruction - nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_sachen_sa0036_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; }; @@ -38,9 +38,9 @@ class nes_sachen_sa0037_device : public nes_nrom_device { public: // construction/destruction - nes_sachen_sa0037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_sachen_sa0037_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; }; diff --git a/src/devices/bus/nes/tengen.cpp b/src/devices/bus/nes/tengen.cpp index 264bdbf4870..5281d1e2fb2 100644 --- a/src/devices/bus/nes/tengen.cpp +++ b/src/devices/bus/nes/tengen.cpp @@ -8,12 +8,10 @@ Here we emulate the following PCBs - * Tengen 800008 * Tengen 800032 [mapper 64] * Tengen 800037 [mapper 158] - TODO: - - emulated the IRQ delay in 800032 (possibly reason of Skull & Crossbones not working?) + Note, Tetris' Tengen 800008 [mapper 148] is implemented in sachen.cpp. ***********************************************************************************************************/ @@ -37,27 +35,21 @@ // constructor //------------------------------------------------- -DEFINE_DEVICE_TYPE(NES_TENGEN_800008, nes_tengen008_device, "nes_tengen008", "NES Cart Tengen 800008 PCB") DEFINE_DEVICE_TYPE(NES_TENGEN_800032, nes_tengen032_device, "nes_tengen032", "NES Cart Tengen 800032 PCB") DEFINE_DEVICE_TYPE(NES_TENGEN_800037, nes_tengen037_device, "nes_tengen037", "NES Cart Tengen 800037 PCB") -nes_tengen008_device::nes_tengen008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, NES_TENGEN_800008, tag, owner, clock) +nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch(0), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_reset(0), m_irq_enable(0), m_irq_pending(0), irq_timer(nullptr) { } -nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, type, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_reset(0), m_irq_enable(0), m_latch(0), irq_timer(nullptr) -{ -} - -nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_tengen032_device(mconfig, NES_TENGEN_800032, tag, owner, clock) { } -nes_tengen037_device::nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_tengen037_device::nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_tengen032_device(mconfig, NES_TENGEN_800037, tag, owner, clock) { } @@ -69,8 +61,8 @@ void nes_tengen032_device::device_start() { common_start(); irq_timer = timer_alloc(TIMER_IRQ); - irq_timer->reset(); timer_freq = clocks_to_attotime(4); + irq_timer->adjust(attotime::zero, 0, timer_freq); save_item(NAME(m_mmc_prg_bank)); save_item(NAME(m_mmc_vrom_bank)); @@ -79,24 +71,27 @@ void nes_tengen032_device::device_start() save_item(NAME(m_irq_mode)); save_item(NAME(m_irq_reset)); save_item(NAME(m_irq_enable)); + save_item(NAME(m_irq_pending)); save_item(NAME(m_irq_count)); save_item(NAME(m_irq_count_latch)); } void nes_tengen032_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg16_89ab(m_prg_chunks - 1); + prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); - memset(m_mmc_prg_bank, 0, sizeof(m_mmc_prg_bank)); - memset(m_mmc_vrom_bank, 0, sizeof(m_mmc_vrom_bank)); + + std::fill(std::begin(m_mmc_prg_bank), std::end(m_mmc_prg_bank), 0x00); + std::fill(std::begin(m_mmc_vrom_bank), std::end(m_mmc_vrom_bank), 0x00); m_latch = 0; m_irq_mode = 0; m_irq_reset = 0; m_irq_enable = 0; - m_irq_count = m_irq_count_latch = 0; + m_irq_pending = 0; + m_irq_count = 0; + m_irq_count_latch = 0xff; } @@ -104,27 +99,6 @@ void nes_tengen032_device::pcb_reset() mapper specific handlers -------------------------------------------------*/ -/*------------------------------------------------- - - Tengen 800008 Board - - iNES: mapper 3? - - In MESS: Supported. - - -------------------------------------------------*/ - -void nes_tengen008_device::write_h(offs_t offset, uint8_t data) -{ - LOG_MMC(("tengen008 write_h, offset: %04x, data: %02x\n", offset, data)); - - // this pcb is subject to bus conflict - data = account_bus_conflict(offset, data); - - prg32(data >> 3); - chr8(data, CHRROM); -} - /*------------------------------------------------- Tengen 800032 Board @@ -138,10 +112,12 @@ void nes_tengen008_device::write_h(offs_t offset, uint8_t data) iNES: mapper 64 - In MESS: Partially Supported (there should be a small - delay between the IRQ and its execution, but that is not - emulated yet: this is possibly the problem with Skulls - & Crossbones) + In MAME: Partially supported. + + TODO: There are issues with IRQ. Skull & Crossbones + probably doesn't work because of this? It alone uses + the cycle-based IRQ (and it constantly switches + between IRQ modes). -------------------------------------------------*/ @@ -156,14 +132,15 @@ inline void nes_tengen032_device::irq_clock(int blanked) if (m_irq_reset) { m_irq_reset = 0; - m_irq_count = m_irq_count_latch + 1; + m_irq_count = m_irq_count_latch | (m_irq_count_latch ? 1 : 0); } else if (!m_irq_count) m_irq_count = m_irq_count_latch; + else + m_irq_count--; - m_irq_count--; if (m_irq_enable && !blanked && !m_irq_count) - set_irq_line(ASSERT_LINE); + m_irq_pending = 1; } // we use the HBLANK IRQ latch from PPU for the scanline based IRQ mode @@ -173,7 +150,14 @@ void nes_tengen032_device::device_timer(emu_timer &timer, device_timer_id id, in { if (id == TIMER_IRQ) { - irq_clock(0); + if (m_irq_pending) + { + set_irq_line(ASSERT_LINE); + m_irq_pending = 0; + } + + if (m_irq_mode) + irq_clock(0); } } @@ -182,7 +166,7 @@ void nes_tengen032_device::hblank_irq(int scanline, int vblank, int blanked) { if (!m_irq_mode) // we are in scanline mode! { - if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE) + if (scanline <= ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE) { irq_clock(blanked); } @@ -191,47 +175,40 @@ void nes_tengen032_device::hblank_irq(int scanline, int vblank, int blanked) void nes_tengen032_device::set_prg() { - uint8_t prg_mode = m_latch & 0x40; + u8 prg_flip = (m_latch & 0x40) >> 5; - prg8_89(m_mmc_prg_bank[prg_mode ? 2: 0]); - prg8_ab(m_mmc_prg_bank[prg_mode ? 0: 1]); - prg8_cd(m_mmc_prg_bank[prg_mode ? 1: 2]); -} - -void nes_tengen032_device::chr_cb(int start, int bank, int source) -{ - chr1_x(start, bank, source); + prg8_89(m_mmc_prg_bank[0 ^ prg_flip]); + prg8_ab(m_mmc_prg_bank[1]); + prg8_cd(m_mmc_prg_bank[2 ^ prg_flip]); } void nes_tengen032_device::set_chr() { - uint8_t chr_page = (m_latch & 0x80) >> 5; + u8 chr_flip = (m_latch & 0x80) >> 5; if (m_latch & 0x20) { - chr_cb(0 ^ chr_page, m_mmc_vrom_bank[0], CHRROM); - chr_cb(1 ^ chr_page, m_mmc_vrom_bank[6], CHRROM); - chr_cb(2 ^ chr_page, m_mmc_vrom_bank[1], CHRROM); - chr_cb(3 ^ chr_page, m_mmc_vrom_bank[7], CHRROM); + chr1_x(0 ^ chr_flip, m_mmc_vrom_bank[0], CHRROM); + chr1_x(1 ^ chr_flip, m_mmc_vrom_bank[6], CHRROM); + chr1_x(2 ^ chr_flip, m_mmc_vrom_bank[1], CHRROM); + chr1_x(3 ^ chr_flip, m_mmc_vrom_bank[7], CHRROM); } else { - chr_cb(0 ^ chr_page, m_mmc_vrom_bank[0] & ~0x01, CHRROM); - chr_cb(1 ^ chr_page, m_mmc_vrom_bank[0] | 0x01, CHRROM); - chr_cb(2 ^ chr_page, m_mmc_vrom_bank[1] & ~0x01, CHRROM); - chr_cb(3 ^ chr_page, m_mmc_vrom_bank[1] | 0x01, CHRROM); + chr2_x(0 ^ chr_flip, m_mmc_vrom_bank[0] >> 1, CHRROM); + chr2_x(2 ^ chr_flip, m_mmc_vrom_bank[1] >> 1, CHRROM); } - chr_cb(4 ^ chr_page, m_mmc_vrom_bank[2], CHRROM); - chr_cb(5 ^ chr_page, m_mmc_vrom_bank[3], CHRROM); - chr_cb(6 ^ chr_page, m_mmc_vrom_bank[4], CHRROM); - chr_cb(7 ^ chr_page, m_mmc_vrom_bank[5], CHRROM); + chr1_x(4 ^ chr_flip, m_mmc_vrom_bank[2], CHRROM); + chr1_x(5 ^ chr_flip, m_mmc_vrom_bank[3], CHRROM); + chr1_x(6 ^ chr_flip, m_mmc_vrom_bank[4], CHRROM); + chr1_x(7 ^ chr_flip, m_mmc_vrom_bank[5], CHRROM); } -void nes_tengen032_device::tengen032_write(offs_t offset, uint8_t data) +void nes_tengen032_device::write_h(offs_t offset, u8 data) { - uint8_t helper, cmd; - LOG_MMC(("tengen032_write, offset: %04x, data: %02x\n", offset, data)); + u8 helper, cmd; + LOG_MMC(("tengen032 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x6001) { @@ -281,17 +258,16 @@ void nes_tengen032_device::tengen032_write(offs_t offset, uint8_t data) m_irq_count_latch = data; break; - case 0x4001: /* $c001 - IRQ scanline latch */ + case 0x4001: // $c001 - IRQ scanline latch m_irq_mode = data & 0x01; if (m_irq_mode) irq_timer->adjust(attotime::zero, 0, timer_freq); - else - irq_timer->adjust(attotime::never); m_irq_reset = 1; break; case 0x6000: m_irq_enable = 0; + m_irq_pending = 0; set_irq_line(CLEAR_LINE); break; @@ -318,36 +294,23 @@ void nes_tengen032_device::tengen032_write(offs_t offset, uint8_t data) iNES: mapper 158 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_tengen037_device::set_mirror() +void nes_tengen037_device::set_chr() { - if (m_latch & 0x80) - { - set_nt_page(0, CIRAM, BIT(m_mmc_vrom_bank[2],7), 1); - set_nt_page(1, CIRAM, BIT(m_mmc_vrom_bank[3],7), 1); - set_nt_page(2, CIRAM, BIT(m_mmc_vrom_bank[4],7), 1); - set_nt_page(3, CIRAM, BIT(m_mmc_vrom_bank[5],7), 1); - } - else - { - set_nt_page(0, CIRAM, BIT(m_mmc_vrom_bank[0],7), 1); - set_nt_page(1, CIRAM, BIT(m_mmc_vrom_bank[0],7), 1); - set_nt_page(2, CIRAM, BIT(m_mmc_vrom_bank[1],7), 1); - set_nt_page(3, CIRAM, BIT(m_mmc_vrom_bank[1],7), 1); - } + nes_tengen032_device::set_chr(); + + // do nametables + static constexpr u8 bank[8] = { 0, 0, 1, 1, 2, 3, 4, 5 }; + int start = (m_latch & 0x80) >> 5; + + for (int i = 0; i < 4; i++) + set_nt_page(i, CIRAM, BIT(m_mmc_vrom_bank[bank[start + i]], 7), 1); } -void nes_tengen037_device::chr_cb( int start, int bank, int source ) -{ - set_mirror(); // we could probably update only for one (e.g. the first) call, to slightly optimize the code - chr1_x(start, bank, source); -} - - -void nes_tengen037_device::write_h(offs_t offset, uint8_t data) +void nes_tengen037_device::write_h(offs_t offset, u8 data) { LOG_MMC(("tengen037 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -355,9 +318,8 @@ void nes_tengen037_device::write_h(offs_t offset, uint8_t data) { case 0x2000: break; - default: - tengen032_write(offset, data); + nes_tengen032_device::write_h(offset, data); break; } } diff --git a/src/devices/bus/nes/tengen.h b/src/devices/bus/nes/tengen.h index 765b2273cb7..6c2af124841 100644 --- a/src/devices/bus/nes/tengen.h +++ b/src/devices/bus/nes/tengen.h @@ -6,54 +6,42 @@ #include "nxrom.h" -// ======================> nes_tengen008_device - -class nes_tengen008_device : public nes_nrom_device -{ -public: - // construction/destruction - nes_tengen008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual void write_h(offs_t offset, uint8_t data) override; -}; - - // ======================> nes_tengen032_device class nes_tengen032_device : public nes_nrom_device { public: // construction/destruction - nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - void tengen032_write(offs_t offset, uint8_t data); - virtual void write_h(offs_t offset, uint8_t data) override { tengen032_write(offset, data); } + virtual void write_h(offs_t offset, u8 data) override; virtual void hblank_irq(int scanline, int vblank, int blanked) override; virtual void pcb_reset() override; protected: - nes_tengen032_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + nes_tengen032_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); // device-level overrides virtual void device_start() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; - virtual void chr_cb(int start, int bank, int source); + virtual void set_chr(); + u8 m_latch; + u8 m_mmc_vrom_bank[8]; + +private: void set_prg(); - void set_chr(); void irq_clock(int blanked); - uint16_t m_irq_count, m_irq_count_latch; - uint8_t m_irq_mode, m_irq_reset; - int m_irq_enable; + u16 m_irq_count, m_irq_count_latch; + u8 m_irq_mode, m_irq_reset; + u8 m_irq_enable, m_irq_pending; - uint8_t m_latch; - uint8_t m_mmc_prg_bank[3]; - uint8_t m_mmc_vrom_bank[8]; + u8 m_mmc_prg_bank[3]; - static const device_timer_id TIMER_IRQ = 0; + static constexpr device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; attotime timer_freq; }; @@ -65,19 +53,17 @@ class nes_tengen037_device : public nes_tengen032_device { public: // construction/destruction - nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); // device-level overrides - virtual void write_h(offs_t offset, uint8_t data) override; - virtual void chr_cb(int start, int bank, int source) override; + virtual void write_h(offs_t offset, u8 data) override; protected: - void set_mirror(); + virtual void set_chr() override; }; // device type definition -DECLARE_DEVICE_TYPE(NES_TENGEN_800008, nes_tengen008_device) DECLARE_DEVICE_TYPE(NES_TENGEN_800032, nes_tengen032_device) DECLARE_DEVICE_TYPE(NES_TENGEN_800037, nes_tengen037_device)