From 1341bc53217c4b390f28edc02ad93a64f1c9f298 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sat, 11 Feb 2017 14:40:49 +0100 Subject: [PATCH] ambush: Rewrite driver. - Use tilemap system to draw background/foreground characters (and use generic gfx_8x8x2_planar layout) - Add mario and dkong3 bootlegs running on extended hardware (color PROMs for those haven't been dumped, using the PROMs from the original currently) - Update and correct dip switches - Document tile attribute RAM and sprite RAM layout bits - Use screen raw parameters - Add connector layout - Update TODO list - Update ROM filenames New working driver: ------------------- Donkey Kong 3 (bootleg on Ambush hardware) --- scripts/target/mame/arcade.lua | 2 - src/mame/audio/mario.cpp | 4 - src/mame/drivers/ambush.cpp | 1021 +++++++++++++++++++++++++------- src/mame/drivers/mario.cpp | 296 +-------- src/mame/includes/ambush.h | 38 -- src/mame/includes/mario.h | 11 +- src/mame/mame.lst | 4 +- src/mame/nl.lst | 2 - src/mame/video/ambush.cpp | 159 ----- src/mame/video/mario.cpp | 105 +--- 10 files changed, 829 insertions(+), 813 deletions(-) delete mode 100644 src/mame/includes/ambush.h delete mode 100644 src/mame/video/ambush.cpp diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index c12b156813c..199d8f95029 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -3852,8 +3852,6 @@ files { createMAMEProjects(_target, _subtarget, "tecfri") files { MAME_DIR .. "src/mame/drivers/ambush.cpp", - MAME_DIR .. "src/mame/includes/ambush.h", - MAME_DIR .. "src/mame/video/ambush.cpp", MAME_DIR .. "src/mame/drivers/holeland.cpp", MAME_DIR .. "src/mame/includes/holeland.h", MAME_DIR .. "src/mame/video/holeland.cpp", diff --git a/src/mame/audio/mario.cpp b/src/mame/audio/mario.cpp index c7fd9b96292..4a31e113e5d 100644 --- a/src/mame/audio/mario.cpp +++ b/src/mame/audio/mario.cpp @@ -419,8 +419,6 @@ void mario_state::sound_start() { device_t *audiocpu = machine().device("audiocpu"); - if (!audiocpu) return; - #if USE_8039 uint8_t *SND = memregion("audiocpu")->base(); @@ -442,8 +440,6 @@ void mario_state::sound_start() void mario_state::sound_reset() { - if (!m_audiocpu) return; - address_space &space = machine().device("audiocpu")->memory().space(AS_PROGRAM); #if USE_8039 diff --git a/src/mame/drivers/ambush.cpp b/src/mame/drivers/ambush.cpp index efb124e4f54..41307bdafac 100644 --- a/src/mame/drivers/ambush.cpp +++ b/src/mame/drivers/ambush.cpp @@ -1,37 +1,45 @@ -// license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari +// license: BSD-3-Clause +// copyright-holders: Zsolt Vasvari, Dirk Best /*************************************************************************** - Ambush Memory Map (preliminary) + Ambush - driver by Zsolt Vasvari + © 1983 Tecfri + PCB connector pinout - Memory Mapped: - - 0000-7fff R ROM - 8000-87ff R/W RAM - a000 R Watchdog Reset - c080-c09f W Scroll RAM (1 byte for each column) - c100-c1ff W Color RAM (1 line corresponds to 4 in the video ram) - c200-c3ff W Sprite RAM - c400-c7ff W Video RAM - c800 R DIP Switches - cc00-cc03 W ??? (Maybe analog sound triggers?) - cc04 W Flip Screen - cc05 W Color Bank Select - cc07 W Coin Counter - - - I/O Ports: - - 00-01 R/W AY8912 #0 (Port A = Input Port #0) - 80-81 R/W AY8912 #1 (Port A = Input Port #1) + +5V 1 A GND + +5V 2 B GND + +12V Coin Counter 3 C +12V Coin Counter + 1P Button 1 4 D 1P Up + 1P Button 2 5 E 1P Down + 2P Button 1 6 F 1P Left + 2P Button 2 7 G 1P Right + 2P Start 8 H 2P Up + 1P Start 9 I 2P Down + Coin 2 10 J 2P Left + Coin 1 11 K 2P Right + Blue 12 L Counter + Red 13 M Counter + Green 14 N Counter + Sync 15 O Speaker Right + +12V 16 P Speaker Left + Speaker- 17 Q +5V + Video GND 18 R +5V + The bootlegs are running on a kind of extended hardware. It has + double the amount of work RAM, an updated graphics system to + accommodate the bootlegged games and the AY8912s were changed to + AY8910s. TODO: - - - Verify actual Z80 and AY8912 clock speeds from PCB (XTAL confirmed) + - Verify actual Z80 and AY891x clock speeds from PCB (XTAL confirmed) + - VBlank IRQ ACK + - Verify screen raw parameters + - Identify the changes in the 'hacked' set and why they were made + - Is 'b' really a second color PROM? + - Figure out what the additional PROMs do (and dump the missing ones) + - Unknown dkong3abl dip switch: Coinage related? ***************************************************************************/ @@ -39,50 +47,112 @@ #include "cpu/z80/z80.h" #include "machine/watchdog.h" #include "sound/ay8910.h" -#include "includes/ambush.h" -/************************************* - * - * Memory handlers - * - *************************************/ +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** -WRITE8_MEMBER(ambush_state::ambush_coin_counter_w) +class ambush_base_state : public driver_device { - machine().bookkeeping().coin_counter_w(0, data & 0x01); - machine().bookkeeping().coin_counter_w(1, data & 0x02); -} +public: + ambush_base_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_gfxdecode(*this, "gfxdecode"), + m_video_ram(*this, "video_ram"), + m_sprite_ram(*this, "sprite_ram"), + m_attribute_ram(*this, "attribute_ram"), + m_scroll_ram(*this, "scroll_ram"), + m_char_tilemap(nullptr), + m_color_bank(0) + { } -WRITE8_MEMBER(ambush_state::flip_screen_w) + DECLARE_WRITE8_MEMBER(scroll_ram_w); + DECLARE_WRITE8_MEMBER(coin_counter_w); + DECLARE_WRITE8_MEMBER(color_bank_w); + +protected: + virtual void machine_start() override; + + required_device m_gfxdecode; + required_shared_ptr m_video_ram; + required_shared_ptr m_sprite_ram; + required_shared_ptr m_attribute_ram; + required_shared_ptr m_scroll_ram; + + tilemap_t *m_char_tilemap; + uint8_t m_color_bank; +}; + +class ambush_state : public ambush_base_state { - flip_screen_set(data); -} +public: + ambush_state(const machine_config &mconfig, device_type type, const char *tag) + : ambush_base_state(mconfig, type, tag) + { } + + DECLARE_PALETTE_INIT(ambush); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + TILE_GET_INFO_MEMBER(char_tile_info); + DECLARE_WRITE8_MEMBER(flip_screen_w); + DECLARE_WRITE8_MEMBER(unk_w); + +protected: + virtual void machine_start() override; +}; + +class mariobl_state : public ambush_base_state +{ +public: + mariobl_state(const machine_config &mconfig, device_type type, const char *tag) + : ambush_base_state(mconfig, type, tag) + { } + + DECLARE_PALETTE_INIT(mario); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + TILE_GET_INFO_MEMBER(mario_char_tile_info); + +protected: + virtual void machine_start() override; +}; + +class dkong3abl_state : public mariobl_state +{ +public: + dkong3abl_state(const machine_config &mconfig, device_type type, const char *tag) + : mariobl_state(mconfig, type, tag) + { } + + DECLARE_PALETTE_INIT(dkong3); + TILE_GET_INFO_MEMBER(dkong3_char_tile_info); + +protected: + virtual void machine_start() override; +}; -/************************************* - * - * Address maps - * - *************************************/ +//************************************************************************** +// ADDRESS MAPS +//************************************************************************** static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, ambush_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0x87ff) AM_RAM AM_RANGE(0xa000, 0xa000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) - AM_RANGE(0xc000, 0xc7ff) AM_RAM - AM_RANGE(0xc080, 0xc09f) AM_SHARE("scrollram") - AM_RANGE(0xc100, 0xc1ff) AM_SHARE("colorram") - AM_RANGE(0xc200, 0xc3ff) AM_SHARE("spriteram") - AM_RANGE(0xc400, 0xc7ff) AM_SHARE("videoram") - AM_RANGE(0xc800, 0xc800) AM_READ_PORT("DSW1") - AM_RANGE(0xcc00, 0xcc03) AM_WRITENOP + AM_RANGE(0xc000, 0xc07f) AM_RAM + AM_RANGE(0xc080, 0xc09f) AM_RAM_WRITE(scroll_ram_w) AM_SHARE("scroll_ram") // 1 byte for each column + AM_RANGE(0xc0a0, 0xc0ff) AM_RAM + AM_RANGE(0xc100, 0xc1ff) AM_RAM AM_SHARE("attribute_ram") // 1 line corresponds to 4 in the video ram + AM_RANGE(0xc200, 0xc3ff) AM_RAM AM_SHARE("sprite_ram") + AM_RANGE(0xc400, 0xc7ff) AM_RAM AM_SHARE("video_ram") + AM_RANGE(0xc800, 0xc800) AM_READ_PORT("sw1") + AM_RANGE(0xcc00, 0xcc03) AM_WRITE(unk_w) AM_RANGE(0xcc04, 0xcc04) AM_WRITE(flip_screen_w) - AM_RANGE(0xcc05, 0xcc05) AM_WRITEONLY AM_SHARE("colorbank") - AM_RANGE(0xcc07, 0xcc07) AM_WRITE(ambush_coin_counter_w) + AM_RANGE(0xcc05, 0xcc05) AM_WRITE(color_bank_w) + AM_RANGE(0xcc07, 0xcc07) AM_WRITE(coin_counter_w) ADDRESS_MAP_END -static ADDRESS_MAP_START( main_portmap, AS_IO, 8, ambush_state ) +static ADDRESS_MAP_START( main_portmap, AS_IO, 8, ambush_base_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("ay1", ay8910_device, data_r, address_w) AM_RANGE(0x01, 0x01) AM_DEVWRITE("ay1", ay8910_device, data_w) @@ -90,253 +160,750 @@ static ADDRESS_MAP_START( main_portmap, AS_IO, 8, ambush_state ) AM_RANGE(0x81, 0x81) AM_DEVWRITE("ay2", ay8910_device, data_w) ADDRESS_MAP_END +static ADDRESS_MAP_START( bootleg_map, AS_PROGRAM, 8, mariobl_state ) + AM_RANGE(0x0000, 0x5fff) AM_ROM + AM_RANGE(0x6000, 0x6fff) AM_RAM + AM_RANGE(0x7000, 0x77ff) AM_RAM + AM_RANGE(0x7000, 0x71ff) AM_SHARE("sprite_ram") + AM_RANGE(0x7200, 0x72ff) AM_SHARE("attribute_ram") + AM_RANGE(0x7380, 0x739f) AM_SHARE("scroll_ram") // not used on bootlegs? + AM_RANGE(0x7400, 0x77ff) AM_SHARE("video_ram") + AM_RANGE(0x8000, 0x9fff) AM_ROM + AM_RANGE(0xa000, 0xa000) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) + AM_RANGE(0xa100, 0xa100) AM_READ_PORT("sw1") + AM_RANGE(0xa204, 0xa204) AM_WRITE(coin_counter_w) + AM_RANGE(0xa206, 0xa206) AM_WRITE(color_bank_w) + AM_RANGE(0xb000, 0xbfff) AM_ROM + AM_RANGE(0xe000, 0xffff) AM_ROM +ADDRESS_MAP_END -/************************************* - * - * Input ports - * - *************************************/ + +//************************************************************************** +// INPUTS +//************************************************************************** static INPUT_PORTS_START( ambush ) - PORT_START("SYSTEM") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_START("buttons") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON2) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON1) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_COCKTAIL + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_COCKTAIL + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START2) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_START1) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_COIN2) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_COIN1) - PORT_START("INPUTS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL + PORT_START("joystick") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_8WAY + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_8WAY + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_8WAY + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_8WAY + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_8WAY PORT_COCKTAIL + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_8WAY PORT_COCKTAIL + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_8WAY PORT_COCKTAIL + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_8WAY PORT_COCKTAIL - PORT_START("DSW1") - PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") - PORT_DIPSETTING( 0x00, "3" ) - PORT_DIPSETTING( 0x01, "4" ) - PORT_DIPSETTING( 0x02, "5" ) - PORT_DIPSETTING( 0x03, "6" ) - PORT_DIPNAME( 0x1c, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,4,5") - PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x14, DEF_STR( 2C_3C ) ) - PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x18, DEF_STR( 2C_5C ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0x1c, "Service Mode/Free Play" ) - PORT_DIPNAME( 0x20, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6") - PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7") - PORT_DIPSETTING( 0x40, "80000" ) - PORT_DIPSETTING( 0x00, "120000" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8") - PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) + PORT_START("sw1") + PORT_DIPNAME(0x03, 0x00, DEF_STR( Lives )) PORT_DIPLOCATION("SW1:1,2") + PORT_DIPSETTING( 0x00, "3") + PORT_DIPSETTING( 0x01, "4") + PORT_DIPSETTING( 0x02, "5") + PORT_DIPSETTING( 0x03, "6") + PORT_DIPNAME(0x1c, 0x00, DEF_STR( Coinage )) PORT_DIPLOCATION("SW1:3,4,5") + PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C )) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C )) + PORT_DIPSETTING( 0x14, DEF_STR( 2C_3C )) + PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C )) + PORT_DIPSETTING( 0x18, DEF_STR( 2C_5C )) + PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C )) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C )) + PORT_DIPSETTING( 0x1c, "Service Mode/Free Play") + PORT_DIPNAME(0x20, 0x00, DEF_STR( Difficulty )) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x00, DEF_STR( Easy )) + PORT_DIPSETTING( 0x20, DEF_STR( Hard )) + PORT_DIPNAME(0x40, 0x40, DEF_STR( Bonus_Life )) PORT_DIPLOCATION("SW1:7") + PORT_DIPSETTING( 0x40, "80000") + PORT_DIPSETTING( 0x00, "120000") + PORT_DIPNAME(0x80, 0x80, DEF_STR( Cabinet )) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x80, DEF_STR( Upright )) + PORT_DIPSETTING( 0x00, DEF_STR( Cocktail )) INPUT_PORTS_END static INPUT_PORTS_START( ambusht ) - PORT_INCLUDE( ambush ) + PORT_INCLUDE(ambush) - PORT_MODIFY("DSW1") - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:3") - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x08, 0x00, "Service Mode/Free Play" ) PORT_DIPLOCATION("SW1:4") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:5") - PORT_DIPSETTING( 0x00, "A 1/1 B 1/2" ) - PORT_DIPSETTING( 0x10, "A 2/1 B 1/3" ) + PORT_MODIFY("sw1") + PORT_DIPNAME(0x04, 0x04, DEF_STR( Allow_Continue )) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x00, DEF_STR( No )) + PORT_DIPSETTING( 0x04, DEF_STR( Yes )) + PORT_DIPNAME(0x08, 0x00, "Service Mode/Free Play") PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x00, DEF_STR( Off )) + PORT_DIPSETTING( 0x08, DEF_STR( On )) + PORT_DIPNAME(0x10, 0x00, DEF_STR( Coinage )) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x00, "A 1 Coin/1 Credit B 1 Coin/2 Credits") + PORT_DIPSETTING( 0x10, "A 2 Coins/3 Credits B 1 Coin/3 Credits") +INPUT_PORTS_END + +static INPUT_PORTS_START( mariobl ) + PORT_INCLUDE(ambush) + + PORT_MODIFY("buttons") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_SERVICE) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_MODIFY("joystick") + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) PORT_2WAY + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_2WAY + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_2WAY + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) PORT_2WAY + PORT_BIT(0x33, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_MODIFY("sw1") + PORT_DIPNAME(0x1c, 0x00, DEF_STR( Coinage )) PORT_DIPLOCATION("SW1:3,4,5") + PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C )) + PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C )) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C )) + PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C )) + PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C )) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C )) + PORT_DIPSETTING( 0x14, DEF_STR( 1C_5C )) + PORT_DIPSETTING( 0x1c, DEF_STR( 1C_6C )) + PORT_DIPNAME(0x20, 0x20, "2 Players Game") PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x00, "1 Credit") + PORT_DIPSETTING( 0x20, "2 Credits") + PORT_DIPNAME(0xc0, 0x00, DEF_STR( Bonus_Life )) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0x00, "20k 50k 30k+") + PORT_DIPSETTING( 0x40, "30k 60k 30k+") + PORT_DIPSETTING( 0x80, "40k 70k 30k+") + PORT_DIPSETTING( 0xc0, DEF_STR( None )) +INPUT_PORTS_END + +static INPUT_PORTS_START( dkong3abl ) + PORT_INCLUDE(ambush) + + PORT_MODIFY("buttons") + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2) + PORT_BIT(0x05, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_MODIFY("joystick") + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) + + PORT_MODIFY("sw1") + PORT_DIPNAME(0x0c, 0x00, DEF_STR( Bonus_Life )) PORT_DIPLOCATION("SW1:3,4") + PORT_DIPSETTING( 0x00, "30k") + PORT_DIPSETTING( 0x04, "40k") + PORT_DIPSETTING( 0x08, "50k") + PORT_DIPSETTING( 0x0c, DEF_STR( None )) + PORT_DIPNAME(0x10, 0x10, DEF_STR( Unknown )) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off )) + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPNAME(0x20, 0x00, DEF_STR( Coinage )) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C )) + PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C )) + PORT_DIPNAME(0xc0, 0x00, DEF_STR( Difficulty )) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0x00, DEF_STR( Easy )) + PORT_DIPSETTING( 0x40, DEF_STR( Medium )) + PORT_DIPSETTING( 0x80, DEF_STR( Hard )) + PORT_DIPSETTING( 0xc0, DEF_STR( Hardest )) INPUT_PORTS_END -/************************************* - * - * Graphics definitions - * - *************************************/ +//************************************************************************** +// PALETTES +//************************************************************************** -static const gfx_layout charlayout = +PALETTE_INIT_MEMBER( ambush_state, ambush ) { - 8,8, /* 8*8 chars */ - 1024, /* 2048 characters */ - 2, /* 2 bits per pixel */ - { 0, 0x2000*8 }, /* The bitplanes are separate */ - { 0, 1, 2, 3, 4, 5, 6, 7}, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8}, - 8*8 /* every char takes 8 consecutive bytes */ -}; + const uint8_t *color_prom = memregion("colors")->base(); + + for (int i = 0; i < palette.entries(); i++) + { + int bit0, bit1, bit2, r, g, b; + + // red component + bit0 = (color_prom[i] >> 0) & 0x01; + bit1 = (color_prom[i] >> 1) & 0x01; + bit2 = (color_prom[i] >> 2) & 0x01; + r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // green component + bit0 = (color_prom[i] >> 3) & 0x01; + bit1 = (color_prom[i] >> 4) & 0x01; + bit2 = (color_prom[i] >> 5) & 0x01; + g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // blue component + bit0 = 0; + bit1 = (color_prom[i] >> 6) & 0x01; + bit2 = (color_prom[i] >> 7) & 0x01; + b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + palette.set_pen_color(i, rgb_t(r,g,b)); + } +} + +PALETTE_INIT_MEMBER( mariobl_state, mario ) +{ + const uint8_t *color_prom = memregion("colors")->base(); + + for (int i = 0; i < palette.entries(); i++) + { + int bit0, bit1, bit2, r, g, b; + + // red component + bit0 = (color_prom[i] >> 5) & 1; + bit1 = (color_prom[i] >> 6) & 1; + bit2 = (color_prom[i] >> 7) & 1; + r = 255 - (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2); + + // green component + bit0 = (color_prom[i] >> 2) & 1; + bit1 = (color_prom[i] >> 3) & 1; + bit2 = (color_prom[i] >> 4) & 1; + g = 255 - (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2); + + // blue component + bit0 = (color_prom[i] >> 0) & 1; + bit1 = (color_prom[i] >> 1) & 1; + b = 255 - (0x55 * bit0 + 0xaa * bit1); + + palette.set_pen_color(i, rgb_t(r,g,b)); + } +} + +PALETTE_INIT_MEMBER( dkong3abl_state, dkong3 ) +{ + const uint8_t *color_prom = memregion("colors")->base(); + + for (int i = 0; i < palette.entries(); i++) + { + int bit0, bit1, bit2, bit3, r, g, b; + + // red component + bit0 = (color_prom[i] >> 4) & 0x01; + bit1 = (color_prom[i] >> 5) & 0x01; + bit2 = (color_prom[i] >> 6) & 0x01; + bit3 = (color_prom[i] >> 7) & 0x01; + r = 255 - (0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3); + + // green component + bit0 = (color_prom[i] >> 0) & 0x01; + bit1 = (color_prom[i] >> 1) & 0x01; + bit2 = (color_prom[i] >> 2) & 0x01; + bit3 = (color_prom[i] >> 3) & 0x01; + g = 255 - (0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3); + + // blue component + bit0 = (color_prom[i + 0x200] >> 0) & 0x01; + bit1 = (color_prom[i + 0x200] >> 1) & 0x01; + bit2 = (color_prom[i + 0x200] >> 2) & 0x01; + bit3 = (color_prom[i + 0x200] >> 3) & 0x01; + b = 255 - (0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3); + + palette.set_pen_color(i, rgb_t(r,g,b)); + } +} + + +//************************************************************************** +// VIDEO EMULATION +//************************************************************************** + +uint32_t ambush_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + + // always draw all tiles + m_char_tilemap->mark_all_dirty(); + + // draw the background characters + m_char_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0); + + // draw the sprites + for (int offs = m_sprite_ram.bytes() - 4; offs >= 0; offs -= 4) + { + // 0 76653210 Y coordinate + // 1 7------- Flip Y + // 1 -6------ Flip X + // 1 --543210 Code low bits + // 2 7------- Size (1 = 16x16, 0 = 8x8) + // 2 -65----- Code high bits + // 2 ---4---- Wrap allowed? (1 = wrap right, 0 = wrap left) + // 2 ----3210 Color + // 3 76653210 X coordinate + + int sx = m_sprite_ram[offs + 3]; + int sy = m_sprite_ram[offs + 0]; + int wrap = BIT(m_sprite_ram[offs + 2], 4); + + // sprite disabled? + if (sy == 0x00 || sy == 0xff) + continue; + + // prevent wraparound + if (((sx < 0x40) && wrap) || ((sx >= 0xc0) && !wrap)) + continue; + + int gfx = BIT(m_sprite_ram[offs + 2], 7); + int code = ((m_sprite_ram[offs + 2] & 0x60) << 1) | (m_sprite_ram[offs + 1] & 0x3f); + + if (gfx == 1) + { + // 16x16 sprites + if (!flip_screen()) + sy = 240 - sy; + else + sx = 240 - sx; + } + else + { + // 8x8 sprites + code <<= 2; + + if (!flip_screen()) + sy = 248 - sy; + else + sx = 248 - sx; + } + + int flipx = BIT(m_sprite_ram[offs + 1], 6); + int flipy = BIT(m_sprite_ram[offs + 1], 7); + + if (flip_screen()) + { + flipx = !flipx; + flipy = !flipy; + } + + int color = (m_color_bank << 4) | (m_sprite_ram[offs + 2] & 0x0f); + + m_gfxdecode->gfx(gfx)->transpen(bitmap, cliprect, code, color, flipx, flipy, sx, sy, 0); + } + + // draw the foreground priority characters with transparency over the sprites + m_char_tilemap->draw(screen, bitmap, cliprect, 1, 0); + + return 0; +} + +uint32_t mariobl_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + + // always draw all tiles + m_char_tilemap->mark_all_dirty(); + + // draw the background characters + m_char_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + // draw the sprites + for (int offs = m_sprite_ram.bytes() - 4; offs >= 0; offs -= 4) + { + // 0 76653210 X coordinate + // 1 7------- Flip X + // 1 -6------ Code high bit + // 1 --54---- ? + // 1 ----3210 Color + // 2 7------- Flip Y + // 2 -6543210 Code low bits + // 3 76653210 Y coordinate + + int sx = m_sprite_ram[offs + 0]; + int sy = m_sprite_ram[offs + 3]; + + // sprite disabled? + if (sy == 0x00 || sy == 0xff) + continue; + + // adjust for rotation + sy = 240 - sy; + + int flipx = BIT(m_sprite_ram[offs + 1], 7); + int flipy = BIT(m_sprite_ram[offs + 2], 7); + + int code = ((m_sprite_ram[offs + 1] & 0x40) << 1) | (m_sprite_ram[offs + 2] & 0x7f); + int color = (m_color_bank << 4) | (m_sprite_ram[offs + 1] & 0x0f); + + m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, color, flipx, flipy, sx, sy, 0); + } + + return 0; +} + +WRITE8_MEMBER( ambush_state::flip_screen_w ) +{ + flip_screen_set(data); +} + +WRITE8_MEMBER( ambush_base_state::scroll_ram_w ) +{ + m_scroll_ram[offset] = data; + m_char_tilemap->set_scrolly(offset, data + 1); +} + +WRITE8_MEMBER( ambush_base_state::color_bank_w ) +{ + m_color_bank = data & 0x03; +} + + +//************************************************************************** +// DRAWGFX LAYOUTS +//************************************************************************** static const gfx_layout spritelayout = { - 16,16, /* 8*8 chars */ - 256, /* 2048 characters */ - 2, /* 2 bits per pixel */ - { 0, 0x2000*8 }, /* The bitplanes are separate */ + 16,16, + RGN_FRAC(1,2), // 256 sprites + 2, + { RGN_FRAC(1,2), RGN_FRAC(0,2) }, { 0, 1, 2, 3, 4, 5, 6, 7, 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }, - 32*8 /* every char takes 32 consecutive bytes */ + 32*8 }; static GFXDECODE_START( ambush ) - GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 64 ) - GFXDECODE_ENTRY( "gfx1", 0x0000, spritelayout, 0, 64 ) + GFXDECODE_ENTRY("gfx1", 0, gfx_8x8x2_planar, 0, 64) + GFXDECODE_ENTRY("gfx1", 0, spritelayout, 0, 64) GFXDECODE_END +// same layout as ambush, just 3 bits per pixel +static const gfx_layout spritelayout_mariobl = +{ + 16,16, + RGN_FRAC(1,3), // 256 sprites + 3, + { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, + { 0, 1, 2, 3, 4, 5, 6, 7, + 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }, + { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, + 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }, + 32*8 +}; -/************************************* - * - * Machine driver - * - *************************************/ +static GFXDECODE_START( mariobl ) + GFXDECODE_ENTRY("gfx1", 0, gfx_8x8x2_planar, 0, 32) + GFXDECODE_ENTRY("gfx2", 0, spritelayout_mariobl, 0, 32) +GFXDECODE_END -static MACHINE_CONFIG_START( ambush, ambush_state ) +static GFXDECODE_START( dkong3abl ) + GFXDECODE_ENTRY("gfx1", 0, gfx_8x8x2_planar, 0, 64) + GFXDECODE_ENTRY("gfx2", 0, spritelayout, 0, 32) +GFXDECODE_END - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6) /* XTAL confirmed, divisor guessed */ +TILE_GET_INFO_MEMBER( ambush_state::char_tile_info ) +{ + uint8_t attr = m_attribute_ram[((tile_index >> 2) & 0xe0) | (tile_index & 0x1f)]; + + // 7------- Unused + // -65----- Code high bits + // ---4---- Priority + // ----3210 Color + + int code = ((attr & 0x60) << 3) | m_video_ram[tile_index]; + int color = (m_color_bank << 4) | (attr & 0x0f); + tileinfo.category = BIT(attr, 4); + + SET_TILE_INFO_MEMBER(0, code, color, 0); +} + +TILE_GET_INFO_MEMBER( mariobl_state::mario_char_tile_info ) +{ + uint8_t attr = m_attribute_ram[((tile_index >> 2) & 0xe0) | (tile_index & 0x1f)]; + + // -6------ Color bank + + int code = ((attr & 0x40) << 2) | m_video_ram[tile_index]; + int color = ((attr & 0x40) >> 2) | 8 | (m_video_ram[tile_index] >> 5); + + SET_TILE_INFO_MEMBER(0, code, color, 0); +} + +TILE_GET_INFO_MEMBER( dkong3abl_state::dkong3_char_tile_info ) +{ + uint8_t attr = m_attribute_ram[((tile_index >> 2) & 0xe0) | (tile_index & 0x1f)]; + + // -6------ Color bank + // -----210 Color + + int code = ((attr & 0x40) << 2) | m_video_ram[tile_index]; + int color = (BIT(attr, 6) << 5) | (BIT(attr, 6) << 4) | (attr & 0x07); + + SET_TILE_INFO_MEMBER(0, code, color, 0); +} + + +//************************************************************************** +// MACHINE EMULATION +//************************************************************************** + +void ambush_base_state::machine_start() +{ + // register for save states + save_item(NAME(m_color_bank)); +} + +void ambush_state::machine_start() +{ + ambush_base_state::machine_start(); + + // create character tilemap + m_char_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(ambush_state::char_tile_info), this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_char_tilemap->set_transparent_pen(0); + m_char_tilemap->set_scroll_cols(32); +} + +void mariobl_state::machine_start() +{ + ambush_base_state::machine_start(); + + // create character tilemap + m_char_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(mariobl_state::mario_char_tile_info), this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_char_tilemap->set_transparent_pen(0); + m_gfxdecode->gfx(0)->set_granularity(8); +} + +void dkong3abl_state::machine_start() +{ + ambush_base_state::machine_start(); + + // create character tilemap + m_char_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(dkong3abl_state::dkong3_char_tile_info), this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_char_tilemap->set_transparent_pen(0); +} + +WRITE8_MEMBER( ambush_base_state::coin_counter_w ) +{ + machine().bookkeeping().coin_counter_w(0, data & 0x01); + machine().bookkeeping().coin_counter_w(1, data & 0x02); +} + +WRITE8_MEMBER( ambush_state::unk_w ) +{ + logerror("unk_w: %02x = %02x\n", offset, data); +} + + +//************************************************************************** +// MACHINE DEFINTIONS +//************************************************************************** + +static MACHINE_CONFIG_START( ambush_base, ambush_base_state ) + MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6) MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_IO_MAP(main_portmap) - MCFG_CPU_VBLANK_INT_DRIVER("screen", ambush_state, irq0_line_hold) + MCFG_CPU_VBLANK_INT_DRIVER("screen", ambush_base_state, irq0_line_hold) MCFG_WATCHDOG_ADD("watchdog") - /* video hardware */ + // video hardware MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-3) /* The -3 makes the cocktail mode perfect */ - MCFG_SCREEN_UPDATE_DRIVER(ambush_state, screen_update_ambush) + MCFG_SCREEN_RAW_PARAMS(XTAL_18_432MHz/3, 384, 0, 256, 264, 16, 240) MCFG_SCREEN_PALETTE("palette") - MCFG_GFXDECODE_ADD("gfxdecode", "palette", ambush) MCFG_PALETTE_ADD("palette", 256) + + // sound hardware + MCFG_SPEAKER_STANDARD_MONO("mono") +MACHINE_CONFIG_END + +static MACHINE_CONFIG_DERIVED_CLASS( ambush, ambush_base, ambush_state ) + MCFG_SCREEN_MODIFY("screen") + MCFG_SCREEN_UPDATE_DRIVER(ambush_state, screen_update) + + MCFG_PALETTE_MODIFY("palette") MCFG_PALETTE_INIT_OWNER(ambush_state, ambush) - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GFXDECODE_ADD("gfxdecode", "palette", ambush) - MCFG_SOUND_ADD("ay1", AY8912, XTAL_18_432MHz/6/2) /* XTAL confirmed, divisor guessed */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("SYSTEM")) + MCFG_SOUND_ADD("ay1", AY8912, XTAL_18_432MHz/6/2) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("buttons")) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) - MCFG_SOUND_ADD("ay2", AY8912, XTAL_18_432MHz/6/2) /* XTAL confirmed, divisor guessed */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("INPUTS")) + MCFG_SOUND_ADD("ay2", AY8912, XTAL_18_432MHz/6/2) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("joystick")) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) MACHINE_CONFIG_END +static MACHINE_CONFIG_DERIVED_CLASS( mariobl, ambush_base, mariobl_state ) + MCFG_CPU_MODIFY("maincpu") + MCFG_CPU_PROGRAM_MAP(bootleg_map) -/************************************* - * - * ROM definition(s) - * - *************************************/ + MCFG_SCREEN_MODIFY("screen") + MCFG_SCREEN_UPDATE_DRIVER(mariobl_state, screen_update) + + MCFG_GFXDECODE_ADD("gfxdecode", "palette", mariobl) + + MCFG_PALETTE_MODIFY("palette") + MCFG_PALETTE_INIT_OWNER(mariobl_state, mario) + + MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/6/2) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("buttons")) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) + + MCFG_SOUND_ADD("ay2", AY8910, XTAL_18_432MHz/6/2) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("joystick")) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) +MACHINE_CONFIG_END + +static MACHINE_CONFIG_DERIVED_CLASS( dkong3abl, mariobl, dkong3abl_state ) + MCFG_GFXDECODE_MODIFY("gfxdecode", dkong3abl) + + MCFG_PALETTE_MODIFY("palette") + MCFG_PALETTE_INIT_OWNER(dkong3abl_state, dkong3) +MACHINE_CONFIG_END + + +//************************************************************************** +// ROM DEFINITIONS +//************************************************************************** ROM_START( ambush ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "a1.i7", 0x0000, 0x2000, CRC(31b85d9d) SHA1(24e60d053cf70ea15430d970ac2385bdd7341ab1) ) - ROM_LOAD( "a2.g7", 0x2000, 0x2000, CRC(8328d88a) SHA1(690f0af10a0550566b67ee570f849b2764448d15) ) - ROM_LOAD( "a3.f7", 0x4000, 0x2000, CRC(8db57ab5) SHA1(5cc7d7ebdfc91fb8d9ed52836d70c1de68001402) ) - ROM_LOAD( "a4.e7", 0x6000, 0x2000, CRC(4a34d2a4) SHA1(ad623161cd6031cb6503ff7445fdd9fb4ea83c8c) ) + ROM_REGION(0x8000, "maincpu", 0) + ROM_LOAD("a1.i7", 0x0000, 0x2000, CRC(31b85d9d) SHA1(24e60d053cf70ea15430d970ac2385bdd7341ab1)) + ROM_LOAD("a2.g7", 0x2000, 0x2000, CRC(8328d88a) SHA1(690f0af10a0550566b67ee570f849b2764448d15)) + ROM_LOAD("a3.f7", 0x4000, 0x2000, CRC(8db57ab5) SHA1(5cc7d7ebdfc91fb8d9ed52836d70c1de68001402)) + ROM_LOAD("a4.e7", 0x6000, 0x2000, CRC(4a34d2a4) SHA1(ad623161cd6031cb6503ff7445fdd9fb4ea83c8c)) - ROM_REGION( 0x4000, "gfx1", 0 ) - ROM_LOAD( "fa2.n4", 0x0000, 0x2000, CRC(e7f134ba) SHA1(c38321f3da049f756337cba5b3c71f6935922f80) ) - ROM_LOAD( "fa1.m4", 0x2000, 0x2000, CRC(ad10969e) SHA1(4cfccdc4ca377693e92d77cde16f88bbdb840b38) ) + ROM_REGION(0x4000, "gfx1", 0) + ROM_LOAD("fa1.m4", 0x0000, 0x2000, CRC(ad10969e) SHA1(4cfccdc4ca377693e92d77cde16f88bbdb840b38)) + ROM_LOAD("fa2.n4", 0x2000, 0x2000, CRC(e7f134ba) SHA1(c38321f3da049f756337cba5b3c71f6935922f80)) - ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "a.bpr", 0x0000, 0x0100, CRC(5f27f511) SHA1(fe3ae701443ff50d3d03c0a5d0e0ab0e716b05cc) ) /* color PROMs */ + ROM_REGION(0x200, "colors", 0) + ROM_LOAD("a.bpr", 0x000, 0x100, CRC(5f27f511) SHA1(fe3ae701443ff50d3d03c0a5d0e0ab0e716b05cc)) + ROM_LOAD("b.bpr", 0x100, 0x100, CRC(1b03fd3b) SHA1(1a58b212476cacace6065056f23b59a69053a2f6)) - ROM_LOAD( "b.bpr", 0x0100, 0x0100, CRC(1b03fd3b) SHA1(1a58b212476cacace6065056f23b59a69053a2f6) ) /* How is this selected, */ - ROM_LOAD( "13.bpr", 0x0200, 0x0100, CRC(547e970f) SHA1(e2ec0bece49fb283e43549703d6d5d6f561c69a6) ) /* I'm not sure what these do. */ - ROM_LOAD( "14.bpr", 0x0300, 0x0100, CRC(622a8ce7) SHA1(6834f67874251f2ef3a33aec893311f5d10e496f) ) /* They don't look like color PROMs */ + ROM_REGION(0x200, "proms", 0) + ROM_LOAD("13.bpr", 0x000, 0x100, CRC(547e970f) SHA1(e2ec0bece49fb283e43549703d6d5d6f561c69a6)) + ROM_LOAD("14.bpr", 0x100, 0x100, CRC(622a8ce7) SHA1(6834f67874251f2ef3a33aec893311f5d10e496f)) ROM_END ROM_START( ambushh ) - ROM_REGION( 0x10000, "maincpu", 0 ) - /* displays an M ("Mal" is Bad in Spanish) next to ROM 1 during the test, why is internal checksum wrong (0x02 instead of 0x00) ? - I think the ROM has been hacked(?) - */ - ROM_LOAD( "a1_hack.i7", 0x0000, 0x2000, CRC(a7cd149d) SHA1(470ebe60bc23a7908fb96caef8074d65f8c57625) ) + ROM_REGION(0x8000, "maincpu", 0) + // displays an M ("Mal" is Bad in Spanish) next to ROM 1 during the test, why is internal checksum wrong (0x02 instead of 0x00) ? + // I think the ROM has been hacked(?) + ROM_LOAD("a1_hack.i7", 0x0000, 0x2000, CRC(a7cd149d) SHA1(470ebe60bc23a7908fb96caef8074d65f8c57625)) // 1A6D: 0C -> 00 // 1A75: 18 -> 0D // 1A76: D5 -> 18 // 1A77: 00 -> D6 + ROM_LOAD("a2.g7", 0x2000, 0x2000, CRC(8328d88a) SHA1(690f0af10a0550566b67ee570f849b2764448d15)) + ROM_LOAD("a3.f7", 0x4000, 0x2000, CRC(8db57ab5) SHA1(5cc7d7ebdfc91fb8d9ed52836d70c1de68001402)) + ROM_LOAD("a4.e7", 0x6000, 0x2000, CRC(4a34d2a4) SHA1(ad623161cd6031cb6503ff7445fdd9fb4ea83c8c)) - ROM_LOAD( "a2.g7", 0x2000, 0x2000, CRC(8328d88a) SHA1(690f0af10a0550566b67ee570f849b2764448d15) ) - ROM_LOAD( "a3.f7", 0x4000, 0x2000, CRC(8db57ab5) SHA1(5cc7d7ebdfc91fb8d9ed52836d70c1de68001402) ) - ROM_LOAD( "a4.e7", 0x6000, 0x2000, CRC(4a34d2a4) SHA1(ad623161cd6031cb6503ff7445fdd9fb4ea83c8c) ) + ROM_REGION(0x4000, "gfx1", 0) + ROM_LOAD("fa1.m4", 0x0000, 0x2000, CRC(ad10969e) SHA1(4cfccdc4ca377693e92d77cde16f88bbdb840b38)) + ROM_LOAD("fa2.n4", 0x2000, 0x2000, CRC(e7f134ba) SHA1(c38321f3da049f756337cba5b3c71f6935922f80)) - ROM_REGION( 0x4000, "gfx1", 0 ) - ROM_LOAD( "fa2.n4", 0x0000, 0x2000, CRC(e7f134ba) SHA1(c38321f3da049f756337cba5b3c71f6935922f80) ) - ROM_LOAD( "fa1.m4", 0x2000, 0x2000, CRC(ad10969e) SHA1(4cfccdc4ca377693e92d77cde16f88bbdb840b38) ) + ROM_REGION(0x200, "colors", 0) + ROM_LOAD("a.bpr", 0x000, 0x100, CRC(5f27f511) SHA1(fe3ae701443ff50d3d03c0a5d0e0ab0e716b05cc)) + ROM_LOAD("b.bpr", 0x100, 0x100, CRC(1b03fd3b) SHA1(1a58b212476cacace6065056f23b59a69053a2f6)) - ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "a.bpr", 0x0000, 0x0100, CRC(5f27f511) SHA1(fe3ae701443ff50d3d03c0a5d0e0ab0e716b05cc) ) /* color PROMs */ - - ROM_LOAD( "b.bpr", 0x0100, 0x0100, CRC(1b03fd3b) SHA1(1a58b212476cacace6065056f23b59a69053a2f6) ) /* How is this selected, */ - ROM_LOAD( "13.bpr", 0x0200, 0x0100, CRC(547e970f) SHA1(e2ec0bece49fb283e43549703d6d5d6f561c69a6) ) /* I'm not sure what these do. */ - ROM_LOAD( "14.bpr", 0x0300, 0x0100, CRC(622a8ce7) SHA1(6834f67874251f2ef3a33aec893311f5d10e496f) ) /* They don't look like color PROMs */ + ROM_REGION(0x200, "proms", 0) + ROM_LOAD("13.bpr", 0x000, 0x100, CRC(547e970f) SHA1(e2ec0bece49fb283e43549703d6d5d6f561c69a6)) + ROM_LOAD("14.bpr", 0x100, 0x100, CRC(622a8ce7) SHA1(6834f67874251f2ef3a33aec893311f5d10e496f)) ROM_END - - ROM_START( ambushj ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "ambush.h7", 0x0000, 0x2000, CRC(ce306563) SHA1(c69b5c4465187a8eda6367d6cd3e0b71a57588d1) ) - ROM_LOAD( "ambush.g7", 0x2000, 0x2000, CRC(90291409) SHA1(82f1e109bd066ad9fdea1ce0086be6c334e2658a) ) - ROM_LOAD( "ambush.f7", 0x4000, 0x2000, CRC(d023ca29) SHA1(1ac44960cf6d79936517a9ad4bae6ccd825c9496) ) - ROM_LOAD( "ambush.e7", 0x6000, 0x2000, CRC(6cc2d3ee) SHA1(dccb417d156460ca745d7b62f1df733cbf85d092) ) + ROM_REGION(0x8000, "maincpu", 0) + ROM_LOAD("ambush.h7", 0x0000, 0x2000, CRC(ce306563) SHA1(c69b5c4465187a8eda6367d6cd3e0b71a57588d1)) + ROM_LOAD("ambush.g7", 0x2000, 0x2000, CRC(90291409) SHA1(82f1e109bd066ad9fdea1ce0086be6c334e2658a)) + ROM_LOAD("ambush.f7", 0x4000, 0x2000, CRC(d023ca29) SHA1(1ac44960cf6d79936517a9ad4bae6ccd825c9496)) + ROM_LOAD("ambush.e7", 0x6000, 0x2000, CRC(6cc2d3ee) SHA1(dccb417d156460ca745d7b62f1df733cbf85d092)) - ROM_REGION( 0x4000, "gfx1", 0 ) - ROM_LOAD( "ambush.n4", 0x0000, 0x2000, CRC(ecc0dc85) SHA1(577304bb575293b97b50eea4faafb5394e3da0f5) ) - ROM_LOAD( "ambush.m4", 0x2000, 0x2000, CRC(e86ca98a) SHA1(fae0786bb78ead81653adddd2edb3058371ca5bc) ) + ROM_REGION(0x4000, "gfx1", 0) + ROM_LOAD("ambush.m4", 0x0000, 0x2000, CRC(e86ca98a) SHA1(fae0786bb78ead81653adddd2edb3058371ca5bc)) + ROM_LOAD("ambush.n4", 0x2000, 0x2000, CRC(ecc0dc85) SHA1(577304bb575293b97b50eea4faafb5394e3da0f5)) - ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "a.bpr", 0x0000, 0x0100, CRC(5f27f511) SHA1(fe3ae701443ff50d3d03c0a5d0e0ab0e716b05cc) ) /* color PROMs */ + ROM_REGION(0x200, "colors", 0) + ROM_LOAD("a.bpr", 0x000, 0x100, CRC(5f27f511) SHA1(fe3ae701443ff50d3d03c0a5d0e0ab0e716b05cc)) + ROM_LOAD("b.bpr", 0x100, 0x100, CRC(1b03fd3b) SHA1(1a58b212476cacace6065056f23b59a69053a2f6)) - ROM_LOAD( "b.bpr", 0x0100, 0x0100, CRC(1b03fd3b) SHA1(1a58b212476cacace6065056f23b59a69053a2f6) ) /* How is this selected, */ - ROM_LOAD( "13.bpr", 0x0200, 0x0100, CRC(547e970f) SHA1(e2ec0bece49fb283e43549703d6d5d6f561c69a6) ) /* I'm not sure what these do. */ - ROM_LOAD( "14.bpr", 0x0300, 0x0100, CRC(622a8ce7) SHA1(6834f67874251f2ef3a33aec893311f5d10e496f) ) /* They don't look like color PROMs */ + ROM_REGION(0x200, "proms", 0) + ROM_LOAD("13.bpr", 0x000, 0x100, CRC(547e970f) SHA1(e2ec0bece49fb283e43549703d6d5d6f561c69a6)) + ROM_LOAD("14.bpr", 0x100, 0x100, CRC(622a8ce7) SHA1(6834f67874251f2ef3a33aec893311f5d10e496f)) ROM_END ROM_START( ambushv ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "n1_h7.bin", 0x0000, 0x2000, CRC(3c0833b4) SHA1(dd0cfb6da281742114abfe652d38038b078b959e) ) - ROM_LOAD( "ambush.g7", 0x2000, 0x2000, CRC(90291409) SHA1(82f1e109bd066ad9fdea1ce0086be6c334e2658a) ) - ROM_LOAD( "ambush.f7", 0x4000, 0x2000, CRC(d023ca29) SHA1(1ac44960cf6d79936517a9ad4bae6ccd825c9496) ) - ROM_LOAD( "ambush.e7", 0x6000, 0x2000, CRC(6cc2d3ee) SHA1(dccb417d156460ca745d7b62f1df733cbf85d092) ) + ROM_REGION(0x8000, "maincpu", 0) + ROM_LOAD("n1.h7", 0x0000, 0x2000, CRC(3c0833b4) SHA1(dd0cfb6da281742114abfe652d38038b078b959e)) + ROM_LOAD("n2.g7", 0x2000, 0x2000, CRC(90291409) SHA1(82f1e109bd066ad9fdea1ce0086be6c334e2658a)) + ROM_LOAD("n3.f7", 0x4000, 0x2000, CRC(d023ca29) SHA1(1ac44960cf6d79936517a9ad4bae6ccd825c9496)) + ROM_LOAD("n4.e7", 0x6000, 0x2000, CRC(6cc2d3ee) SHA1(dccb417d156460ca745d7b62f1df733cbf85d092)) - ROM_REGION( 0x4000, "gfx1", 0 ) - ROM_LOAD( "ambush.n4", 0x0000, 0x2000, CRC(ecc0dc85) SHA1(577304bb575293b97b50eea4faafb5394e3da0f5) ) - ROM_LOAD( "ambush.m4", 0x2000, 0x2000, CRC(e86ca98a) SHA1(fae0786bb78ead81653adddd2edb3058371ca5bc) ) + ROM_REGION(0x4000, "gfx1", 0) + ROM_LOAD("f1.m4", 0x0000, 0x2000, CRC(e86ca98a) SHA1(fae0786bb78ead81653adddd2edb3058371ca5bc)) + ROM_LOAD("f2.n4", 0x2000, 0x2000, CRC(ecc0dc85) SHA1(577304bb575293b97b50eea4faafb5394e3da0f5)) - ROM_REGION( 0x0400, "proms", 0 ) - ROM_LOAD( "a.bpr", 0x0000, 0x0100, CRC(5f27f511) SHA1(fe3ae701443ff50d3d03c0a5d0e0ab0e716b05cc) ) /* color PROMs */ + ROM_REGION(0x200, "colors", 0) + ROM_LOAD("a.bpr", 0x000, 0x100, CRC(5f27f511) SHA1(fe3ae701443ff50d3d03c0a5d0e0ab0e716b05cc)) + ROM_LOAD("b.bpr", 0x100, 0x100, CRC(1b03fd3b) SHA1(1a58b212476cacace6065056f23b59a69053a2f6)) - ROM_LOAD( "b.bpr", 0x0100, 0x0100, CRC(1b03fd3b) SHA1(1a58b212476cacace6065056f23b59a69053a2f6) ) /* How is this selected, */ - ROM_LOAD( "13.bpr", 0x0200, 0x0100, CRC(547e970f) SHA1(e2ec0bece49fb283e43549703d6d5d6f561c69a6) ) /* I'm not sure what these do. */ - ROM_LOAD( "14.bpr", 0x0300, 0x0100, CRC(622a8ce7) SHA1(6834f67874251f2ef3a33aec893311f5d10e496f) ) /* They don't look like color PROMs */ + ROM_REGION(0x200, "proms", 0) + ROM_LOAD("13.bpr", 0x000, 0x100, CRC(547e970f) SHA1(e2ec0bece49fb283e43549703d6d5d6f561c69a6)) + ROM_LOAD("14.bpr", 0x100, 0x100, CRC(622a8ce7) SHA1(6834f67874251f2ef3a33aec893311f5d10e496f)) ROM_END -/************************************* - * - * Game driver(s) - * - *************************************/ +ROM_START( mariobl ) + ROM_REGION(0x10000, "maincpu", 0) + ROM_LOAD("mbjba-8.7h", 0x0000, 0x4000, CRC(344c959d) SHA1(162e39c3a17e0dcde3b7eefebe224318c8884de2)) + ROM_LOAD("mbjba-7.7g", 0x4000, 0x2000, CRC(06faf308) SHA1(8c213d9390c168034c1673f3dd97b99322b3485a)) + ROM_LOAD("mbjba-6.7f", 0xe000, 0x2000, CRC(761dd670) SHA1(6d6e45ced8c535cdf56e0ed1bcedb342e9e10a55)) -GAME( 1983, ambush, 0, ambush, ambusht, driver_device, 0, ROT0, "Tecfri", "Ambush", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, ambushh, ambush, ambush, ambusht, driver_device, 0, ROT0, "Tecfri", "Ambush (hack?)", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, ambushj, ambush, ambush, ambush, driver_device, 0, ROT0, "Tecfri (Nippon Amuse license)", "Ambush (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, ambushv, ambush, ambush, ambush, driver_device, 0, ROT0, "Tecfri (Volt Electronics license)", "Ambush (Volt Electronics)", MACHINE_SUPPORTS_SAVE ) + ROM_REGION(0x2000, "gfx1", ROMREGION_INVERT) + ROM_LOAD("mbjba-5.4n", 0x0000, 0x1000, CRC(9bbcf9fb) SHA1(a917241a3bd94bff72f509d6b3ab8358b9c03eac)) + ROM_LOAD("mbjba-4.4l", 0x1000, 0x1000, CRC(9379e836) SHA1(fcce66c1b2c5120441840b80723c7d209d42bc45)) + + ROM_REGION(0x6000, "gfx2", 0) + ROM_LOAD("mbjba-3.3ns", 0x0000, 0x2000, CRC(3981adb2) SHA1(c12a0c2ae04de6969f4b2dae3bdefc4515d87c55)) + ROM_LOAD("mbjba-2.3ls", 0x2000, 0x2000, CRC(7b58c92e) SHA1(25dfce7a4a93f661f495cc80378d445a2b064ba7)) + ROM_LOAD("mbjba-1.3l", 0x4000, 0x2000, CRC(c772cb8f) SHA1(7fd6dd9888928fad5c50d96b4ecff954ea8975ce)) + + ROM_REGION(0x200, "colors", 0) + ROM_LOAD("a.bpr", 0x000, 0x100, NO_DUMP) + ROM_LOAD("b.bpr", 0x100, 0x100, NO_DUMP) + // taken from mario + ROM_LOAD("tma1-c-4p.4p", 0x000, 0x200, CRC(afc9bd41) SHA1(90b739c4c7f24a88b6ac5ca29b06c032906a2801)) +ROM_END + +ROM_START( dkong3abl ) + ROM_REGION(0x10000, "maincpu", 0) + ROM_LOAD("dk3ba-7.7i", 0x0000, 0x4000, CRC(a9263275) SHA1(c3867f6b0d379b70669b3b954e582533406db203)) + ROM_LOAD("dk3ba-6.7g", 0x4000, 0x2000, CRC(31b8401d) SHA1(0e3dfea0c7fe99d48c5d984c47fa746caf0879f3)) + ROM_CONTINUE(0x8000, 0x2000) + ROM_LOAD("dk3ba-5.7f", 0xb000, 0x1000, CRC(07d3fd88) SHA1(721f401d077e3e051672513f9df5614eeb0f6466)) + + ROM_REGION(0x2000, "gfx1", 0) + ROM_LOAD("dk3ba-3.4l", 0x0000, 0x1000, CRC(67ac65d4) SHA1(d28bdb99310370513597ca80185ac6c56a11f63c)) + ROM_LOAD("dk3ba-4.4n", 0x1000, 0x1000, CRC(84b319d6) SHA1(eaf160948f8cd4fecfdd909876de7cd16340885c)) + + ROM_REGION(0x4000, "gfx2", 0) + ROM_LOAD("dk3ba-1.3l", 0x0000, 0x2000, CRC(d4a88e04) SHA1(4f797c25d26c1022dcf026021979ef0fbab48baf)) + ROM_LOAD("dk3ba-2.3m", 0x2000, 0x2000, CRC(f71185ee) SHA1(6652cf958d7afa8bb8dcfded997bb418a75223d8)) + + ROM_REGION(0x400, "colors", 0) + ROM_LOAD("a.bpr", 0x000, 0x100, NO_DUMP) + ROM_LOAD("b.bpr", 0x100, 0x100, NO_DUMP) + // taken from dkong3 + ROM_LOAD("dkc1-c.1d", 0x000, 0x200, CRC(df54befc) SHA1(7912dbf0a0c8ef68f4ae0f95e55ab164da80e4a1)) + ROM_LOAD("dkc1-c.1c", 0x200, 0x200, CRC(66a77f40) SHA1(c408d65990f0edd78c4590c447426f383fcd2d88)) +ROM_END + + +//************************************************************************** +// SYSTEM DRIVERS +//************************************************************************** + +// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROTATION COMPANY FULLNAME FLAGS +GAME( 1983, ambush, 0, ambush, ambusht, driver_device, 0, ROT0, "Tecfri", "Ambush", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, ambushh, ambush, ambush, ambusht, driver_device, 0, ROT0, "Tecfri", "Ambush (hack?)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, ambushj, ambush, ambush, ambush, driver_device, 0, ROT0, "Tecfri (Nippon Amuse license)", "Ambush (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, ambushv, ambush, ambush, ambush, driver_device, 0, ROT0, "Tecfri (Volt Electronics license)", "Ambush (Volt Electronics)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, mariobl, 0, mariobl, mariobl, driver_device, 0, ROT180, "bootleg", "Mario Bros. (bootleg on Ambush Hardware)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, dkong3abl, 0, dkong3abl, dkong3abl, driver_device, 0, ROT90, "bootleg", "Donkey Kong 3 (bootleg on Ambush hardware)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/mario.cpp b/src/mame/drivers/mario.cpp index 5c21955bfab..5c66ce11582 100644 --- a/src/mame/drivers/mario.cpp +++ b/src/mame/drivers/mario.cpp @@ -94,10 +94,9 @@ write: #include "emu.h" #include "cpu/z80/z80.h" #include "machine/z80dma.h" -#include "sound/ay8910.h" - #include "includes/mario.h" + /************************************* * * statics @@ -176,34 +175,6 @@ static ADDRESS_MAP_START( mario_io_map, AS_IO, 8, mario_state) ADDRESS_MAP_END -static ADDRESS_MAP_START( mariobl_map, AS_PROGRAM, 8, mario_state) - AM_RANGE(0x0000, 0x5fff) AM_ROM - AM_RANGE(0x6000, 0x6fff) AM_RAM - AM_RANGE(0x7000, 0x71ff) AM_RAM AM_SHARE("spriteram") /* physical sprite ram */ - AM_RANGE(0x7200, 0x72ff) AM_RAM // attrram? (only enough for sprites?) - AM_RANGE(0x7300, 0x737f) AM_RAM // probably x-scroll? - AM_RANGE(0x7380, 0x7380) AM_WRITE(mariobl_scroll_w) - AM_RANGE(0x7281, 0x73ff) AM_RAM // seems to have scroll vals for every column on this bl - AM_RANGE(0x7400, 0x77ff) AM_RAM_WRITE(mario_videoram_w) AM_SHARE("videoram") - //AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN1") - AM_RANGE(0xa000, 0xa000) AM_READNOP /* watchdog? */ - AM_RANGE(0xa100, 0xa100) AM_READ_PORT("DSW") /* DSW */ - AM_RANGE(0xa206, 0xa206) AM_WRITE(mario_gfxbank_w) - - AM_RANGE(0x8000, 0x9fff) AM_ROM - AM_RANGE(0xb000, 0xbfff) AM_ROM - AM_RANGE(0xe000, 0xffff) AM_ROM -ADDRESS_MAP_END - -static ADDRESS_MAP_START( mariobl_io_map, AS_IO, 8, mario_state ) - ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("ay1", ay8910_device, data_r, address_w) - AM_RANGE(0x01, 0x01) AM_DEVWRITE("ay1", ay8910_device, data_w) - AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("ay2", ay8910_device, data_r, address_w) - AM_RANGE(0x81, 0x81) AM_DEVWRITE("ay2", ay8910_device, data_w) -ADDRESS_MAP_END - - /************************************* * * Port definitions @@ -309,115 +280,6 @@ static INPUT_PORTS_START( marioj ) INPUT_PORTS_END -static INPUT_PORTS_START( mariobl ) - - PORT_START("SYSTEM") - PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) - - PORT_START("INPUTS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL - - PORT_START("DSW") - PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!1,!2") - PORT_DIPSETTING( 0x00, "3" ) - PORT_DIPSETTING( 0x01, "4" ) - PORT_DIPSETTING( 0x02, "5" ) - PORT_DIPSETTING( 0x03, "6" ) - PORT_DIPNAME( 0x1c, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!3,!4,!5") - PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0x14, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x1c, DEF_STR( 1C_6C ) ) - PORT_DIPNAME( 0x20, 0x20, "2 Players Game" ) PORT_DIPLOCATION("SW1:!6") - PORT_DIPSETTING( 0x00, "1 Credit" ) - PORT_DIPSETTING( 0x20, "2 Credits" ) - PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:!7,!8") - PORT_DIPSETTING( 0x00, "20k 50k 30k+" ) - PORT_DIPSETTING( 0x40, "30k 60k 30k+" ) - PORT_DIPSETTING( 0x80, "40k 70k 30k+" ) - PORT_DIPSETTING( 0xc0, DEF_STR( None ) ) - - PORT_START("MONITOR") - PORT_CONFNAME( 0x01, 0x00, "Monitor" ) - PORT_CONFSETTING( 0x00, "Nintendo" ) - PORT_CONFSETTING( 0x01, "Std 15.72Khz" ) - -INPUT_PORTS_END - - - -static INPUT_PORTS_START( dkong3abl ) - - PORT_START("SYSTEM") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) - - PORT_START("INPUTS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL - - PORT_START("DSW") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("MONITOR") - PORT_CONFNAME( 0x01, 0x00, "Monitor" ) - PORT_CONFSETTING( 0x00, "Nintendo" ) - PORT_CONFSETTING( 0x01, "Std 15.72Khz" ) - -INPUT_PORTS_END /************************************* * @@ -455,42 +317,6 @@ static GFXDECODE_START( mario ) GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0, 32 ) GFXDECODE_END -static const gfx_layout spritelayout_bl = -{ - 16,16, /* 16*16 sprites */ - RGN_FRAC(1,3), /* 256 sprites */ - 3, /* 3 bits per pixel */ - { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) }, - { 0, 1, 2, 3, 4, 5, 6, 7, - 64,65,66,67,68,69,70,71 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }, - 16*16 -}; - -static GFXDECODE_START( mariobl ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, spritelayout_bl, 0, 32 ) -GFXDECODE_END - -static const gfx_layout spritelayout_bl2 = -{ - 16,16, /* 16*16 sprites */ - RGN_FRAC(1,2), /* 256 sprites */ - 2, /* 3 bits per pixel */ - { RGN_FRAC(1,2),RGN_FRAC(0,2) }, - { 0, 1, 2, 3, 4, 5, 6, 7, - 64,65,66,67,68,69,70,71 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }, - 16*16 -}; - -static GFXDECODE_START( dkong3abl ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) - GFXDECODE_ENTRY( "gfx2", 0, spritelayout_bl2, 0, 32 ) -GFXDECODE_END - /************************************* * @@ -521,7 +347,7 @@ static MACHINE_CONFIG_START( mario_base, mario_state ) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(mario_state, screen_update_mario) + MCFG_SCREEN_UPDATE_DRIVER(mario_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", mario) MCFG_PALETTE_ADD("palette", 256) @@ -530,18 +356,10 @@ static MACHINE_CONFIG_START( mario_base, mario_state ) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( mario, mario_base ) - - /* basic machine hardware */ - - /* sound hardware */ MCFG_FRAGMENT_ADD(mario_audio) MACHINE_CONFIG_END - static MACHINE_CONFIG_DERIVED( masao, mario_base ) - - /* basic machine hardware */ - MCFG_CPU_MODIFY("maincpu") MCFG_CPU_CLOCK(4000000) /* 4.000 MHz (?) */ MCFG_CPU_PROGRAM_MAP(masao_map) @@ -550,75 +368,6 @@ static MACHINE_CONFIG_DERIVED( masao, mario_base ) MCFG_FRAGMENT_ADD(masao_audio) MACHINE_CONFIG_END -/* -Mario Bros japan bootleg on Ambush hardware - -This romset (japanese version) comes from a faulty bootleg pcb.Game differences are none. -Note:it runs on a modified (extended) Tecfri's Ambush hardware. -Main cpu Z80 -Sound ic AY-3-8910 x2 -instead of AY-3-8912 x2 of Ambush -Work ram 4Kb (6116 x2) -double of Ambush -OSC: 18,432 Mhz -Rom definition: -mbjba-6, mbjba-7, mbjba-8 main program -mbjba-1 to mbjba-5 gfx (chars,sprites) -Eproms are 2732,2764,27128 - -Dumped by tirino73 -*/ - -static MACHINE_CONFIG_START( mariobl, mario_state ) - - MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6) /* XTAL confirmed, divisor guessed */ - MCFG_CPU_PROGRAM_MAP(mariobl_map) - MCFG_CPU_IO_MAP(mariobl_io_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", mario_state, irq0_line_hold) - - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(mario_state, screen_update_mariobl) - MCFG_SCREEN_PALETTE("palette") - MCFG_GFXDECODE_ADD("gfxdecode", "palette", mariobl) - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_INIT_OWNER(mario_state, mario) - - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") - - MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/6/2) /* XTAL confirmed, divisor guessed */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("SYSTEM")) -// MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(mario_state, ay1_outputb_w)) - - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) - - MCFG_SOUND_ADD("ay2", AY8910, XTAL_18_432MHz/6/2) /* XTAL confirmed, divisor guessed */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("INPUTS")) -// MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(mario_state, ay2_outputb_w)) - - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) - -MACHINE_CONFIG_END - -/* -Donkey Kong 3 bootleg on Ambush hardware - -This romset comes from a faulty bootleg pcb.Game differences are none. -Note:it runs on a modified (extended) Tecfri's Ambush hardware. -Main cpu Z80 -Sound ic AY-3-8910 x2 -instead of AY-3-8912 x2 of Ambush -Work ram 4Kb (6116 x2) -double of Ambush -OSC: 18,432 Mhz -Rom definition: -dk3ba-5,dk3ba-6,dk3ba-7 main program -dk3ba-1 to dk3ba-4 gfx (chars,sprites) -Eproms are 2732,2764,27128 - -Dumped by tirino73 >isolani1973@libero.it< -*/ -static MACHINE_CONFIG_DERIVED( dkong3abl, mariobl ) - MCFG_GFXDECODE_MODIFY("gfxdecode", dkong3abl) -MACHINE_CONFIG_END /************************************* * @@ -788,43 +537,6 @@ ROM_START( masao ) ROM_LOAD( "tma1-c-4p.4p", 0x0000, 0x0200, CRC(afc9bd41) SHA1(90b739c4c7f24a88b6ac5ca29b06c032906a2801) ) ROM_END -ROM_START( mariobl ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "mbjba-8.7i", 0x0000, 0x4000, CRC(344c959d) SHA1(162e39c3a17e0dcde3b7eefebe224318c8884de2) ) - ROM_LOAD( "mbjba-7.7g", 0x4000, 0x2000, CRC(06faf308) SHA1(8c213d9390c168034c1673f3dd97b99322b3485a) ) - ROM_LOAD( "mbjba-6.7f", 0xe000, 0x2000, CRC(761dd670) SHA1(6d6e45ced8c535cdf56e0ed1bcedb342e9e10a55) ) - - ROM_REGION( 0x2000, "gfx1", ROMREGION_INVERT ) - ROM_LOAD( "mbjba-4.4l", 0x1000, 0x1000, CRC(9379e836) SHA1(fcce66c1b2c5120441840b80723c7d209d42bc45) ) - ROM_LOAD( "mbjba-5.4n", 0x0000, 0x1000, CRC(9bbcf9fb) SHA1(a917241a3bd94bff72f509d6b3ab8358b9c03eac) ) - - ROM_REGION( 0x6000, "gfx2", 0 ) - ROM_LOAD( "mbjba-1.3l", 0x4000, 0x2000, CRC(c772cb8f) SHA1(7fd6dd9888928fad5c50d96b4ecff954ea8975ce) ) - ROM_LOAD( "mbjba-2.3ls", 0x2000, 0x2000, CRC(7b58c92e) SHA1(25dfce7a4a93f661f495cc80378d445a2b064ba7) ) - ROM_LOAD( "mbjba-3.3ns", 0x0000, 0x2000, CRC(3981adb2) SHA1(c12a0c2ae04de6969f4b2dae3bdefc4515d87c55) ) - - ROM_REGION( 0x0200, "proms", 0 ) // no prom was present in the dump, assuming to be the same - ROM_LOAD( "tma1-c-4p.4p", 0x0000, 0x0200, CRC(afc9bd41) SHA1(90b739c4c7f24a88b6ac5ca29b06c032906a2801) ) -ROM_END - -ROM_START( dkong3abl ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "dk3ba-7.7i", 0x0000, 0x4000, CRC(a9263275) SHA1(c3867f6b0d379b70669b3b954e582533406db203) ) - ROM_LOAD( "dk3ba-6.7g", 0x4000, 0x2000, CRC(31b8401d) SHA1(0e3dfea0c7fe99d48c5d984c47fa746caf0879f3) ) - ROM_CONTINUE(0x8000,0x2000) - ROM_LOAD( "dk3ba-5.7f", 0xb000, 0x1000, CRC(07d3fd88) SHA1(721f401d077e3e051672513f9df5614eeb0f6466) ) - - ROM_REGION( 0x2000, "gfx1", ROMREGION_INVERT ) - ROM_LOAD( "dk3ba-3.4l", 0x1000, 0x1000, CRC(67ac65d4) SHA1(d28bdb99310370513597ca80185ac6c56a11f63c) ) - ROM_LOAD( "dk3ba-4.4n", 0x0000, 0x1000, CRC(84b319d6) SHA1(eaf160948f8cd4fecfdd909876de7cd16340885c) ) - - ROM_REGION( 0x4000, "gfx2", 0 ) - ROM_LOAD( "dk3ba-1.3l", 0x0000, 0x2000, CRC(d4a88e04) SHA1(4f797c25d26c1022dcf026021979ef0fbab48baf) ) - ROM_LOAD( "dk3ba-2.3m", 0x2000, 0x2000, CRC(f71185ee) SHA1(6652cf958d7afa8bb8dcfded997bb418a75223d8) ) - - ROM_REGION( 0x0200, "proms", 0 ) // no prom was present in the dump, probably need to use the original ones again - ROM_LOAD( "tma1-c-4p.4p", 0x0000, 0x0200, CRC(afc9bd41) SHA1(90b739c4c7f24a88b6ac5ca29b06c032906a2801) ) // this is from mario.. remove -ROM_END /************************************* * @@ -837,7 +549,3 @@ GAME( 1983, marioe, mario, mario, marioe, driver_device, 0, ROT0, "Ninte GAME( 1983, marioo, mario, mario, marioo, driver_device, 0, ROT0, "Nintendo of America", "Mario Bros. (US, Unknown Rev)", MACHINE_SUPPORTS_SAVE ) GAME( 1983, marioj, mario, mario, marioj, driver_device, 0, ROT0, "Nintendo", "Mario Bros. (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1983, masao, mario, masao, mario, driver_device, 0, ROT0, "bootleg", "Masao", MACHINE_SUPPORTS_SAVE ) - -// todo, these might have a better home than in here -GAME( 1983, mariobl, mario, mariobl, mariobl,driver_device, 0, ROT180, "bootleg", "Mario Bros. (Japan, bootleg)", MACHINE_SUPPORTS_SAVE ) // was listed as 'on extended Ambush hardware' but doesn't seem similar apart from the sound system? -GAME( 1983, dkong3abl,dkong3, dkong3abl,dkong3abl,driver_device,0, ROT90, "bootleg", "Donkey Kong 3 (bootleg with 2xAY8910)", MACHINE_NOT_WORKING ) // likewise, put here because it's similar to mariobl diff --git a/src/mame/includes/ambush.h b/src/mame/includes/ambush.h deleted file mode 100644 index ed042b802f6..00000000000 --- a/src/mame/includes/ambush.h +++ /dev/null @@ -1,38 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari -/************************************************************************* - - Ambush - -*************************************************************************/ - -class ambush_state : public driver_device -{ -public: - ambush_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram"), - m_colorram(*this, "colorram"), - m_scrollram(*this, "scrollram"), - m_colorbank(*this, "colorbank"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } - - /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; - required_shared_ptr m_scrollram; - required_shared_ptr m_colorbank; - - DECLARE_WRITE8_MEMBER(ambush_coin_counter_w); - DECLARE_WRITE8_MEMBER(flip_screen_w); - DECLARE_PALETTE_INIT(ambush); - uint32_t screen_update_ambush(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_chars( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; -}; diff --git a/src/mame/includes/mario.h b/src/mame/includes/mario.h index 6201d67bb36..57fd4f27ce2 100644 --- a/src/mame/includes/mario.h +++ b/src/mame/includes/mario.h @@ -71,10 +71,10 @@ public: /* devices */ required_device m_maincpu; - optional_device m_audiocpu; + required_device m_audiocpu; required_device m_gfxdecode; required_device m_palette; - optional_device m_z80dma; + required_device m_z80dma; optional_device m_soundlatch; optional_device m_soundlatch2; optional_device m_soundlatch3; @@ -111,7 +111,6 @@ public: DECLARE_WRITE8_MEMBER(mario_gfxbank_w); DECLARE_WRITE8_MEMBER(mario_palettebank_w); DECLARE_WRITE8_MEMBER(mario_scroll_w); - DECLARE_WRITE8_MEMBER(mariobl_scroll_w); DECLARE_WRITE8_MEMBER(mario_flip_w); DECLARE_READ8_MEMBER(mario_sh_p1_r); DECLARE_READ8_MEMBER(mario_sh_p2_r); @@ -129,16 +128,14 @@ public: virtual void sound_start() override; virtual void sound_reset() override; DECLARE_PALETTE_INIT(mario); - uint32_t screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_mario(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_mariobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); DECLARE_WRITE8_MEMBER(mario_sh_sound_w); DECLARE_WRITE8_MEMBER(mario_sh1_w); DECLARE_WRITE8_MEMBER(mario_sh2_w); DECLARE_READ8_MEMBER(memory_read_byte); DECLARE_WRITE8_MEMBER(memory_write_byte); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int is_bootleg); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; /*----------- defined in audio/mario.c -----------*/ diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 8b7576c2e3e..ab4874fbd5a 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -1096,6 +1096,8 @@ ambush // (c) 1983 ambushh // (c) 1983 ambushj // (c) 1983 Nippon Amuse license ambushv // (c) 1983 Volt Electronics license +dkong3abl // bootleg +mariobl // bootleg @source:amerihok.cpp amerihok // @@ -17812,9 +17814,7 @@ wanted // (c) 1984 Sigma Ent. Inc. marinedt // MG (c) 1981 Taito Corporation @source:mario.cpp -dkong3abl // mario // (c) 1983 Nintendo of America -mariobl // bootleg marioe // (c) 1983 Nintendo of America marioj // (c) 1983 Nintendo marioo // (c) 1983 Nintendo of America diff --git a/src/mame/nl.lst b/src/mame/nl.lst index 135f3e375a2..0377148d474 100644 --- a/src/mame/nl.lst +++ b/src/mame/nl.lst @@ -48,9 +48,7 @@ yanchamr // (c) 1986 (Japan) youjyudn // (c) 1986 (Japan) // mario.cpp -dkong3abl // mario // (c) 1983 Nintendo of America -mariobl // bootleg marioe // (c) 1983 Nintendo of America marioj // (c) 1983 Nintendo marioo // (c) 1983 Nintendo of America diff --git a/src/mame/video/ambush.cpp b/src/mame/video/ambush.cpp deleted file mode 100644 index 15e50cd27cd..00000000000 --- a/src/mame/video/ambush.cpp +++ /dev/null @@ -1,159 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari -/*************************************************************************** - - video.c - - Functions to emulate the video hardware of the machine. - -***************************************************************************/ - -#include "emu.h" -#include "includes/ambush.h" - - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - - I'm not sure about the resistor value, I'm using the Galaxian ones. - -***************************************************************************/ - -PALETTE_INIT_MEMBER(ambush_state, ambush) -{ - const uint8_t *color_prom = memregion("proms")->base(); - int i; - - for (i = 0; i < palette.entries(); i++) - { - int bit0, bit1, bit2, r, g, b; - - /* red component */ - bit0 = (color_prom[i] >> 0) & 0x01; - bit1 = (color_prom[i] >> 1) & 0x01; - bit2 = (color_prom[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* green component */ - bit0 = (color_prom[i] >> 3) & 0x01; - bit1 = (color_prom[i] >> 4) & 0x01; - bit2 = (color_prom[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* blue component */ - bit0 = 0; - bit1 = (color_prom[i] >> 6) & 0x01; - bit2 = (color_prom[i] >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - palette.set_pen_color(i, rgb_t(r,g,b)); - } -} - - -void ambush_state::draw_chars( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ) -{ - int offs, transpen; - - transpen = (priority == 0) ? -1 : 0; - - for (offs = 0; offs < m_videoram.bytes(); offs++) - { - int code, sx, sy, col; - uint8_t scroll; - - sy = (offs / 32); - sx = (offs % 32); - - col = m_colorram[((sy & 0x1c) << 3) + sx]; - - if (priority & ~col) - continue; - - scroll = ~m_scrollram[sx]; - - code = m_videoram[offs] | ((col & 0x60) << 3); - - if (flip_screen()) - { - sx = 31 - sx; - sy = 31 - sy; - scroll = ~scroll - 1; - } - - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, - code, - (col & 0x0f) | ((*m_colorbank & 0x03) << 4), - flip_screen(), flip_screen(), - 8 * sx, (8 * sy + scroll) & 0xff, transpen); - } -} - - -uint32_t ambush_state::screen_update_ambush(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int offs; - - bitmap.fill(0, cliprect); - - /* Draw the characters */ - draw_chars(bitmap, cliprect, 0x00); - - /* Draw the sprites. */ - for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4) - { - int code, col, sx, sy, flipx, flipy, gfx; - - sy = m_spriteram[offs + 0]; - sx = m_spriteram[offs + 3]; - - if ( (sy == 0) || - (sy == 0xff) || - ((sx < 0x40) && ( m_spriteram[offs + 2] & 0x10)) || - ((sx >= 0xc0) && (!(m_spriteram[offs + 2] & 0x10)))) - continue; /* prevent wraparound */ - - - code = (m_spriteram[offs + 1] & 0x3f) | ((m_spriteram[offs + 2] & 0x60) << 1); - - if (m_spriteram[offs + 2] & 0x80) - { - /* 16x16 sprites */ - gfx = 1; - - if (!flip_screen()) - sy = 240 - sy; - else - sx = 240 - sx; - } - else - { - /* 8x8 sprites */ - gfx = 0; - code <<= 2; - - if (!flip_screen()) - sy = 248 - sy; - else - sx = 248 - sx; - } - - col = m_spriteram[offs + 2] & 0x0f; - flipx = m_spriteram[offs + 1] & 0x40; - flipy = m_spriteram[offs + 1] & 0x80; - - if (flip_screen()) - { - flipx = !flipx; - flipy = !flipy; - } - - m_gfxdecode->gfx(gfx)->transpen(bitmap,cliprect, - code, col | ((*m_colorbank & 0x03) << 4), - flipx, flipy, - sx,sy,0); - } - - /* Draw the foreground priority characters over the sprites */ - draw_chars(bitmap, cliprect, 0x10); - return 0; -} diff --git a/src/mame/video/mario.cpp b/src/mame/video/mario.cpp index 635f2094d45..34e542bf24b 100644 --- a/src/mame/video/mario.cpp +++ b/src/mame/video/mario.cpp @@ -107,11 +107,6 @@ WRITE8_MEMBER(mario_state::mario_scroll_w) m_gfx_scroll = data + 17; } -WRITE8_MEMBER(mario_state::mariobl_scroll_w) -{ - m_gfx_scroll = data; -} - WRITE8_MEMBER(mario_state::mario_flip_w) { if (m_flip != (data & 0x01)) @@ -155,7 +150,7 @@ void mario_state::video_start() * confirmed on mametests.org as being present on real PCB as well. */ -void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int is_bootleg) +void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { /* TODO: draw_sprites should adopt the scanline logic from dkong.c * The schematics have the same logic for sprite buffering. @@ -164,70 +159,42 @@ void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int start, end, inc; - if (!is_bootleg) - { - start = 0; - end = m_spriteram.bytes(); - inc = 4; - } - else - { - start = m_spriteram.bytes()-4; - end = -4; - inc = -4; - } + start = 0; + end = m_spriteram.bytes(); + inc = 4; offs = start; while (offs != end) { - if (is_bootleg || m_spriteram[offs]) + if (m_spriteram[offs]) { int x, y; int code, color, flipx, flipy; - if (!is_bootleg) + // from schematics .... + y = (m_spriteram[offs + 0] + (m_flip ? 0xF7 : 0xF9) + 1) & 0xFF; + x = m_spriteram[offs + 3]; + // sprite will be drawn if (y + scanline) & 0xF0 = 0xF0 + y = 240 - y; /* logical screen position */ + + y = y ^ (m_flip ? 0xFF : 0x00); /* physical screen location */ + x = x ^ (m_flip ? 0xFF : 0x00); /* physical screen location */ + + code = m_spriteram[offs + 2]; + color = (m_spriteram[offs + 1] & 0x0f) + 16 * m_palette_bank; + flipx = (m_spriteram[offs + 1] & 0x80); + flipy = (m_spriteram[offs + 1] & 0x40); + + if (m_flip) { - // from schematics .... - y = (m_spriteram[offs + 0] + (m_flip ? 0xF7 : 0xF9) + 1) & 0xFF; - x = m_spriteram[offs + 3]; - // sprite will be drawn if (y + scanline) & 0xF0 = 0xF0 - y = 240 - y; /* logical screen position */ - - y = y ^ (m_flip ? 0xFF : 0x00); /* physical screen location */ - x = x ^ (m_flip ? 0xFF : 0x00); /* physical screen location */ - - code = m_spriteram[offs + 2]; - color = (m_spriteram[offs + 1] & 0x0f) + 16 * m_palette_bank; - flipx = (m_spriteram[offs + 1] & 0x80); - flipy = (m_spriteram[offs + 1] & 0x40); - - if (m_flip) - { - y -= 14; - x -= 7; - } - else - { - y += 1; - x -= 8; - } + y -= 14; + x -= 7; } else { - y = (m_spriteram[offs + 3] + (m_flip ? 0xF7 : 0xF9) + 1) & 0xFF; - x = m_spriteram[offs + 0]; - y = 240 - y; /* logical screen position */ - - // y = y ^ (m_flip ? 0xFF : 0x00); /* physical screen location */ - // x = x ^ (m_flip ? 0xFF : 0x00); /* physical screen location */ - - code = (m_spriteram[offs + 2] & 0x7f) | ((m_spriteram[offs + 1] & 0x40) << 1); // upper tile bit is where the flipy bit goes on mario - color = (m_spriteram[offs + 1] & 0x0f) + 16 * m_palette_bank; - flipx = (m_spriteram[offs + 1] & 0x80); - flipy = (m_spriteram[offs + 2] & 0x80); // and the flipy bit is where the upper tile bit is on mario - - y += -7; + y += 1; + x -= 8; } if (m_flip) @@ -252,7 +219,7 @@ void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, } } -uint32_t mario_state::screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mario_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int t; @@ -264,27 +231,9 @@ uint32_t mario_state::screen_update_common(screen_device &screen, bitmap_ind16 & } m_bg_tilemap->set_scrolly(0, m_gfx_scroll); - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - return 0; -} - -uint32_t mario_state::screen_update_mario(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - screen_update_common(screen, bitmap, cliprect); - draw_sprites(bitmap, cliprect, 0); - return 0; -} - -uint32_t mario_state::screen_update_mariobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - // not sure - m_palette_bank = m_gfx_bank; // might be the 'attr' ram - machine().tilemap().mark_all_dirty(); - - - screen_update_common(screen, bitmap, cliprect); - draw_sprites(bitmap, cliprect, 1); + draw_sprites(bitmap, cliprect); + return 0; }