Cleanups to satisfy cuavas's OCD (#2089)

* nes_zemina_device: cleanups

marineb: moved definitions

rockclim: base off mooncrst (Z80 sound code was stolen from that game and MAME code suggests that the video board uses some mooncrst logic, so...)

* Googoo -> GooGoo (nw)
This commit is contained in:
kazblox 2017-02-25 15:01:15 -05:00 committed by ajrhacker
parent ba7e8fb8ee
commit 1c780926ae
6 changed files with 69 additions and 38 deletions

View File

@ -225,7 +225,7 @@ SLOT_INTERFACE_START(nes_cart)
SLOT_INTERFACE_INTERNAL("unl_43272", NES_43272) // used in Gaau Hok Gwong Cheung SLOT_INTERFACE_INTERNAL("unl_43272", NES_43272) // used in Gaau Hok Gwong Cheung
SLOT_INTERFACE_INTERNAL("tf1201", NES_TF1201) SLOT_INTERFACE_INTERNAL("tf1201", NES_TF1201)
SLOT_INTERFACE_INTERNAL("unl_cfight", NES_CITYFIGHT) // used by City Fighter IV SLOT_INTERFACE_INTERNAL("unl_cfight", NES_CITYFIGHT) // used by City Fighter IV
SLOT_INTERFACE_INTERNAL("zemina", NES_ZEMINA) // mapper 190 - Magic Kid Googoo, etc. SLOT_INTERFACE_INTERNAL("zemina", NES_ZEMINA) // mapper 190 - Magic Kid GooGoo
// misc bootleg boards // misc bootleg boards
SLOT_INTERFACE_INTERNAL("ax5705", NES_AX5705) SLOT_INTERFACE_INTERNAL("ax5705", NES_AX5705)
SLOT_INTERFACE_INTERNAL("sc127", NES_SC127) SLOT_INTERFACE_INTERNAL("sc127", NES_SC127)

View File

@ -15,24 +15,40 @@
#define VERBOSE 0 #define VERBOSE 0
#endif #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>; 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_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__) : nes_nrom_device(mconfig, NES_ZEMINA, "NES Cart Zemina PCB", tag, owner, clock, "nes_zemina", __FILE__)
{ {
} }
/*-------------------------------------------------
device_start
-------------------------------------------------*/
void nes_zemina_device::device_start() void nes_zemina_device::device_start()
{ {
common_start(); common_start();
} }
/*-------------------------------------------------
pcb_reset
-------------------------------------------------*/
void nes_zemina_device::pcb_reset() void nes_zemina_device::pcb_reset()
{ {
set_nt_mirroring(PPU_MIRROR_VERT); 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 Zemina board emulation
Currently, this board is only known to be used 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: 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) WRITE8_MEMBER(nes_zemina_device::write_h)
{ {
LOG_MMC(("zemina write_h, offset: %04x, data: %02x\n", offset, data)); LOG_MMC("zemina write_h, offset: %04x, data: %02x\n", offset, data);
if (offset >= 0x0000 && offset <= 0x1FFF) 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
{ {
prg16_89ab(data & 0x07); case 0x00:
} chr2_0(data, CHRROM);
else if (offset >= 0x4000 && offset <= 0x5FFF) break;
{ case 0x01:
prg16_89ab((data & 0x07) | 0x08); chr2_2(data, CHRROM);
} break;
else if ((offset & 0x2000) == 0x2000) // 2K CHR banks case 0x02:
{ chr2_4(data, CHRROM);
switch (offset & 0x03) // only A0, A1, A13, A14, and A15 are used to select the CHR bank break;
{ case 0x03:
case 0x00: chr2_0(data, CHRROM); break; chr2_6(data, CHRROM);
case 0x01: chr2_2(data, CHRROM); break; break;
case 0x02: chr2_4(data, CHRROM); break;
case 0x03: chr2_6(data, CHRROM); break;
}
} }
}
} }

View File

@ -1,13 +1,18 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:Kaz // copyright-holders:Kaz
#ifndef __NES_ZEMINA_H #ifndef MAME_BUS_NES_ZEMINA_H
#define __NES_ZEMINA_H #define MAME_BUS_NES_ZEMINA_H
#include "nxrom.h" #include "nxrom.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> nes_zemina_device // ======================> nes_zemina_device
class nes_zemina_device : public nes_nrom_device class nes_zemina_device :
public nes_nrom_device
{ {
public: public:
// construction/destruction // construction/destruction
@ -23,4 +28,4 @@ public:
// device type definition // device type definition
extern const device_type NES_ZEMINA; extern const device_type NES_ZEMINA;
#endif #endif /* MAME_BUS_NES_ZEMINA_H */

View File

@ -2344,7 +2344,7 @@ static MACHINE_CONFIG_DERIVED( dkongjrm, mooncrst )
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( rockclim, galaxian ) static MACHINE_CONFIG_DERIVED( rockclim, mooncrst )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_MODIFY("maincpu") MCFG_CPU_MODIFY("maincpu")

View File

@ -42,6 +42,9 @@ write
#include "sound/ay8910.h" #include "sound/ay8910.h"
#include "includes/marineb.h" #include "includes/marineb.h"
#define MASTER_CLOCK (XTAL_12MHz)
#define CPU_CLOCK (MASTER_CLOCK/4)
#define SOUND_CLOCK (MASTER_CLOCK/8)
void marineb_state::machine_reset() void marineb_state::machine_reset()
{ {

View File

@ -1,10 +1,5 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:Zsolt Vasvari // copyright-holders:Zsolt Vasvari
#define MASTER_CLOCK (XTAL_12MHz)
#define CPU_CLOCK (MASTER_CLOCK/4)
#define SOUND_CLOCK (MASTER_CLOCK/8)
class marineb_state : public driver_device class marineb_state : public driver_device
{ {
public: public: