diff options
Diffstat (limited to 'src/devices/bus/nes/sealie.cpp')
-rw-r--r-- | src/devices/bus/nes/sealie.cpp | 104 |
1 files changed, 92 insertions, 12 deletions
diff --git a/src/devices/bus/nes/sealie.cpp b/src/devices/bus/nes/sealie.cpp index f9ecbdfa272..5c7b42cfe4e 100644 --- a/src/devices/bus/nes/sealie.cpp +++ b/src/devices/bus/nes/sealie.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders: kmg, Fabio Priuli +// copyright-holders:kmg /*********************************************************************************************************** @@ -11,6 +11,7 @@ * SEALIE RET-CUFROM [mapper 29] * SEALIE DPCMcart [mapper 409] * SEALIE UNROM 512 [mapper 30] + * SEALIE 8BIT XMAS [mapper 30] ***********************************************************************************************************/ @@ -20,18 +21,18 @@ #ifdef NES_PCB_DEBUG -#define VERBOSE 1 +#define VERBOSE (LOG_GENERAL) #else -#define VERBOSE 0 +#define VERBOSE (0) #endif - -#define LOG_MMC(x) do { if (VERBOSE) logerror x; } while (0) +#include "logmacro.h" //------------------------------------------------- // constructor //------------------------------------------------- +DEFINE_DEVICE_TYPE(NES_8BITXMAS, nes_8bitxmas_device, "nes_8bitxmas", "NES Cart Sealie 8BIT XMAS PCB") DEFINE_DEVICE_TYPE(NES_CUFROM, nes_cufrom_device, "nes_cufrom", "NES Cart Sealie RET-CUFROM PCB") DEFINE_DEVICE_TYPE(NES_DPCMCART, nes_dpcmcart_device, "nes_dpcmcart", "NES Cart Sealie DPCMcart PCB") DEFINE_DEVICE_TYPE(NES_UNROM512, nes_unrom512_device, "nes_unrom512", "NES Cart Sealie UNROM 512 PCB") @@ -47,8 +48,18 @@ nes_dpcmcart_device::nes_dpcmcart_device(const machine_config &mconfig, const ch { } +nes_unrom512_device::nes_unrom512_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, type, tag, owner, clock) +{ +} + nes_unrom512_device::nes_unrom512_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : nes_nrom_device(mconfig, NES_UNROM512, tag, owner, clock) + : nes_unrom512_device(mconfig, NES_UNROM512, tag, owner, clock) +{ +} + +nes_8bitxmas_device::nes_8bitxmas_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_unrom512_device(mconfig, NES_8BITXMAS, tag, owner, clock), m_led(0) { } @@ -65,7 +76,6 @@ void nes_dpcmcart_device::pcb_reset() { prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); - chr8(0, CHRRAM); } void nes_unrom512_device::pcb_reset() @@ -77,6 +87,23 @@ void nes_unrom512_device::pcb_reset() set_nt_mirroring(PPU_MIRROR_LOW); } +void nes_8bitxmas_device::device_start() +{ + nes_unrom512_device::device_start(); + save_item(NAME(m_led)); + + m_bus_conflict = false; +} + +void nes_8bitxmas_device::pcb_reset() +{ + nes_unrom512_device::pcb_reset(); + + m_led = 0; + update_led(); +} + + /*------------------------------------------------- mapper specific handlers @@ -101,9 +128,9 @@ void nes_unrom512_device::pcb_reset() void nes_cufrom_device::write_h(offs_t offset, u8 data) { - LOG_MMC(("cufrom write_h, offset: %04x, data: %02x\n", offset, data)); + LOG("cufrom write_h, offset: %04x, data: %02x\n", offset, data); - prg16_89ab((data >> 2) & 0x07); + prg16_89ab(BIT(data, 2, 3)); chr8(data & 0x03, CHRRAM); } @@ -126,7 +153,7 @@ void nes_cufrom_device::write_h(offs_t offset, u8 data) void nes_dpcmcart_device::write_h(offs_t offset, u8 data) { - LOG_MMC(("dpcmcart write_h, offset: %04x, data: %02x\n", offset, data)); + LOG("dpcmcart write_h, offset: %04x, data: %02x\n", offset, data); prg16_89ab(offset & 0x0fff); } @@ -149,7 +176,7 @@ void nes_dpcmcart_device::write_h(offs_t offset, u8 data) void nes_unrom512_device::write_h(offs_t offset, u8 data) { - LOG_MMC(("unrom512 write_h, offset: %04x, data: %02x\n", offset, data)); + LOG("unrom512 write_h, offset: %04x, data: %02x\n", offset, data); // this pcb is subject to bus conflict in its nonflashable configuration data = account_bus_conflict(offset, data); @@ -157,5 +184,58 @@ void nes_unrom512_device::write_h(offs_t offset, u8 data) if (m_pcb_ctrl_mirror) set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW); prg16_89ab(data & 0x1f); - chr8((data >> 5) & 0x03, CHRRAM); + chr8(BIT(data, 5, 2), CHRRAM); +} + +/*------------------------------------------------- + + Sealie 8BIT XMAS revD board + + Games: 8-bit Xmas 2012-2016 and 2018-2021? + + This board is a variant of UNROM512 with 16 LEDs + in 4 colors, blue, yellow, green, red, which are + controlled in pairs by each byte written to + 0x8000-0xbfff. Bits are [BYGR bygr] where bygr + control LEDs 1,2 and BYGR control LEDs 3,4. On + the 8BIT XMAS revD 2012 board LEDS are arranged: + + _______________________________ + | RED2 GRN3 | + | | + | YEL2 BLU3 | + | | + | BLU1 YEL4 | + | | + | GRN1 RED4 | + | | + | RED1 GRN4 | + | | + | YEL1 BLU4 | + -- -- + | GRN2 BLU2 YEL3 RED3 | + | | + + iNES: mapper 30 + + In MAME: Preliminary partial support. + + -------------------------------------------------*/ + +void nes_8bitxmas_device::update_led() +{ + // TODO: add artwork +} + +void nes_8bitxmas_device::write_h(offs_t offset, u8 data) +{ + LOG("8bitxmas write_h, offset: %04x, data: %02x\n", offset, data); + + if (BIT(offset, 14)) + nes_unrom512_device::write_h(offset, data); + else if (m_led != data) + { + m_led = data; + update_led(); + } } |