summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes/zemina.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/nes/zemina.cpp')
-rw-r--r--src/devices/bus/nes/zemina.cpp79
1 files changed, 24 insertions, 55 deletions
diff --git a/src/devices/bus/nes/zemina.cpp b/src/devices/bus/nes/zemina.cpp
index 22741967572..5268a31cb30 100644
--- a/src/devices/bus/nes/zemina.cpp
+++ b/src/devices/bus/nes/zemina.cpp
@@ -10,12 +10,11 @@
#include "zemina.h"
#ifdef NES_PCB_DEBUG
-#define VERBOSE 1
+#define VERBOSE (LOG_GENERAL)
#else
-#define VERBOSE 0
+#define VERBOSE (0)
#endif
-
-#define LOG_MMC(...) do { if (VERBOSE) logerror(__VA_ARGS__); } while (0)
+#include "logmacro.h"
//**************************************************************************
// DEVICE DEFINITIONS
@@ -28,38 +27,28 @@ DEFINE_DEVICE_TYPE(NES_ZEMINA, nes_zemina_device, "nes_zemina", "NES Cart Zemina
//**************************************************************************
//-------------------------------------------------
-// nes_zemina_device - constructor
+// constructor
//-------------------------------------------------
-nes_zemina_device::nes_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_zemina_device::nes_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_ZEMINA, tag, owner, clock)
{
}
-/*-------------------------------------------------
- device_start
--------------------------------------------------*/
-void nes_zemina_device::device_start()
-{
- common_start();
-}
-/*-------------------------------------------------
- pcb_reset
--------------------------------------------------*/
void nes_zemina_device::pcb_reset()
{
- set_nt_mirroring(PPU_MIRROR_VERT);
- chr2_0(0, CHRROM);
- chr2_2(0, CHRROM);
- chr2_4(0, CHRROM);
- chr2_6(0, CHRROM);
prg16_89ab(0);
- prg16_cdef(0);
+ prg16_cdef(0); // fixed bank
+
+ for (int i = 0; i < 4; i++)
+ chr2_x(i << 1, 0, CHRROM);
}
+
+
/*-------------------------------------------------
mapper specific handlers
-------------------------------------------------*/
@@ -68,46 +57,26 @@ void nes_zemina_device::pcb_reset()
Zemina board emulation
- Currently, this board is only known to be used
- by one game: Magic Kid GooGoo.
+ Games: Magic Kid GooGoo
- Info from kevtris at NESDev, who dumped the game:
- wiki.nesdev.com/w/index.php/INES_Mapper_190
+ iNES: mapper 190
--------------------------------------------------*/
+ In MAME: Supported.
-/*-------------------------------------------------
- write
-------------------------------------------------*/
-void nes_zemina_device::write_h(offs_t offset, uint8_t data)
+void nes_zemina_device::write_h(offs_t offset, u8 data)
{
- LOG_MMC("zemina write_h, offset: %04x, data: %02x\n", offset, data);
+ LOG("zemina write_h, offset: %04x, data: %02x\n", offset, data);
- if (offset >= 0x0000 && offset <= 0x1FFF)
- {
- prg16_89ab(data & 0x07);
- }
- else if (offset >= 0x4000 && offset <= 0x5FFF)
- {
- prg16_89ab((data & 0x07) | 0x08);
- }
- else if ((offset & 0x2000) == 0x2000) // 2K CHR banks
+ switch (offset & 0x6000)
{
- switch (offset & 0x03) // only A0, A1, A13, A14, and A15 are used to select the CHR bank
- {
- case 0x00:
- chr2_0(data, CHRROM);
- break;
- case 0x01:
- chr2_2(data, CHRROM);
- break;
- case 0x02:
- chr2_4(data, CHRROM);
- break;
- case 0x03:
- chr2_6(data, CHRROM);
- break;
- }
+ case 0x0000:
+ case 0x4000:
+ prg16_89ab(BIT(offset, 14) << 3 | (data & 0x07));
+ break;
+ case 0x2000:
+ chr2_x((offset & 0x03) << 1, data, CHRROM);
+ break;
}
}