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.cpp82
1 files changed, 55 insertions, 27 deletions
diff --git a/src/devices/bus/nes/zemina.cpp b/src/devices/bus/nes/zemina.cpp
index e6b42f88dbe..f17e3eb981e 100644
--- a/src/devices/bus/nes/zemina.cpp
+++ b/src/devices/bus/nes/zemina.cpp
@@ -15,24 +15,40 @@
#define VERBOSE 0
#endif
-#define LOG_MMC(x) do { if (VERBOSE) logerror x; } while (0)
+#define LOG_MMC(...) do { if (VERBOSE) logerror(__VA_ARGS__); } while (0)
-//-------------------------------------------------
-// constructor
-//-------------------------------------------------
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
const device_type NES_ZEMINA = &device_creator<nes_zemina_device>;
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// nes_zemina_device - constructor
+//-------------------------------------------------
+
nes_zemina_device::nes_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: nes_nrom_device(mconfig, NES_ZEMINA, "NES Cart Zemina PCB", tag, owner, clock, "nes_zemina", __FILE__)
{
}
+/*-------------------------------------------------
+ device_start
+-------------------------------------------------*/
+
void nes_zemina_device::device_start()
{
common_start();
}
+/*-------------------------------------------------
+ pcb_reset
+-------------------------------------------------*/
+
void nes_zemina_device::pcb_reset()
{
set_nt_mirroring(PPU_MIRROR_VERT);
@@ -45,41 +61,53 @@ void nes_zemina_device::pcb_reset()
}
/*-------------------------------------------------
- mapper specific handlers
- -------------------------------------------------*/
+ mapper specific handlers
+-------------------------------------------------*/
/*-------------------------------------------------
Zemina board emulation
Currently, this board is only known to be used
- by one game: Magic Kid Googoo.
+ by one game: Magic Kid GooGoo.
Info from kevtris at NESDev, who dumped the game:
- https://wiki.nesdev.com/w/index.php/INES_Mapper_190
+ wiki.nesdev.com/w/index.php/INES_Mapper_190
+
+-------------------------------------------------*/
- -------------------------------------------------*/
+/*-------------------------------------------------
+ write
+-------------------------------------------------*/
WRITE8_MEMBER(nes_zemina_device::write_h)
{
- LOG_MMC(("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
+ LOG_MMC("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 & 0x03) // only A0, A1, A13, A14, and A15 are used to select the CHR bank
{
- 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 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;
}
+ }
} \ No newline at end of file