diff options
author | kazblox <kazbloxmc@gmail.com> | 2017-02-25 15:01:15 -0500 |
---|---|---|
committer | ajrhacker <ajrhacker@users.noreply.github.com> | 2017-02-25 15:01:15 -0500 |
commit | 1c780926ae7aa79bde9063050343af3087f20ba4 (patch) | |
tree | 80e885560c70a38135dc0955707880ec19c6ab7e | |
parent | ba7e8fb8eee2b3d7f82add55214fb358aa285287 (diff) |
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)
-rw-r--r-- | src/devices/bus/nes/nes_carts.cpp | 2 | ||||
-rw-r--r-- | src/devices/bus/nes/zemina.cpp | 82 | ||||
-rw-r--r-- | src/devices/bus/nes/zemina.h | 13 | ||||
-rw-r--r-- | src/mame/drivers/galaxold.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/marineb.cpp | 3 | ||||
-rw-r--r-- | src/mame/includes/marineb.h | 7 |
6 files changed, 70 insertions, 39 deletions
diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index d9a84cff424..cc692ee9f0d 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -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("tf1201", NES_TF1201) 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 SLOT_INTERFACE_INTERNAL("ax5705", NES_AX5705) SLOT_INTERFACE_INTERNAL("sc127", NES_SC127) 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 diff --git a/src/devices/bus/nes/zemina.h b/src/devices/bus/nes/zemina.h index f217183058a..825e9109657 100644 --- a/src/devices/bus/nes/zemina.h +++ b/src/devices/bus/nes/zemina.h @@ -1,13 +1,18 @@ // license:BSD-3-Clause // copyright-holders:Kaz -#ifndef __NES_ZEMINA_H -#define __NES_ZEMINA_H +#ifndef MAME_BUS_NES_ZEMINA_H +#define MAME_BUS_NES_ZEMINA_H #include "nxrom.h" +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + // ======================> nes_zemina_device -class nes_zemina_device : public nes_nrom_device +class nes_zemina_device : + public nes_nrom_device { public: // construction/destruction @@ -23,4 +28,4 @@ public: // device type definition extern const device_type NES_ZEMINA; -#endif
\ No newline at end of file +#endif /* MAME_BUS_NES_ZEMINA_H */
\ No newline at end of file diff --git a/src/mame/drivers/galaxold.cpp b/src/mame/drivers/galaxold.cpp index 7711f5e446b..fcd0caa8923 100644 --- a/src/mame/drivers/galaxold.cpp +++ b/src/mame/drivers/galaxold.cpp @@ -2344,7 +2344,7 @@ static MACHINE_CONFIG_DERIVED( dkongjrm, mooncrst ) MACHINE_CONFIG_END -static MACHINE_CONFIG_DERIVED( rockclim, galaxian ) +static MACHINE_CONFIG_DERIVED( rockclim, mooncrst ) /* basic machine hardware */ MCFG_CPU_MODIFY("maincpu") diff --git a/src/mame/drivers/marineb.cpp b/src/mame/drivers/marineb.cpp index fdea6da16c5..f04bccfe4df 100644 --- a/src/mame/drivers/marineb.cpp +++ b/src/mame/drivers/marineb.cpp @@ -42,6 +42,9 @@ write #include "sound/ay8910.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() { diff --git a/src/mame/includes/marineb.h b/src/mame/includes/marineb.h index e9319c9bb1d..9c1cad46b64 100644 --- a/src/mame/includes/marineb.h +++ b/src/mame/includes/marineb.h @@ -1,10 +1,5 @@ // license:BSD-3-Clause // 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 { public: @@ -60,4 +55,4 @@ public: INTERRUPT_GEN_MEMBER(marineb_vblank_irq); INTERRUPT_GEN_MEMBER(wanted_vblank_irq); void set_tilemap_scrolly( int cols ); -}; +};
\ No newline at end of file |