summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-10-24 17:27:32 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-10-24 17:27:35 -0400
commit594d8798fd9ae90be6e6936041c084e1da845dd5 (patch)
tree1b65cfd3665386095a65aee49b970f8d27f40f04
parent66e0e0d42a71dd06f20f98e7d5671a137536d177 (diff)
sdgndmps: Replace ROM patch with a slightly less gross hack (nw)
-rw-r--r--src/mame/drivers/dcon.cpp32
-rw-r--r--src/mame/includes/dcon.h8
2 files changed, 24 insertions, 16 deletions
diff --git a/src/mame/drivers/dcon.cpp b/src/mame/drivers/dcon.cpp
index 85b0f9c7f62..bd14b6c1145 100644
--- a/src/mame/drivers/dcon.cpp
+++ b/src/mame/drivers/dcon.cpp
@@ -22,7 +22,6 @@
#include "sound/3812intf.h"
#include "sound/ym2151.h"
#include "sound/okim6295.h"
-#include "audio/seibu.h"
#include "video/seibu_crtc.h"
#include "screen.h"
#include "speaker.h"
@@ -30,6 +29,15 @@
/***************************************************************************/
+READ8_MEMBER(dcon_state::sdgndmps_sound_comms_r)
+{
+ // Routine at 134C sends no sound commands if lowest bit is 0
+ if (offset == 5) // ($a000a)
+ return 1;
+
+ return m_seibu_sound->main_r(space, offset);
+}
+
static ADDRESS_MAP_START( dcon_map, AS_PROGRAM, 16, dcon_state )
AM_RANGE(0x00000, 0x7ffff) AM_ROM
AM_RANGE(0x80000, 0x8bfff) AM_RAM
@@ -51,6 +59,11 @@ static ADDRESS_MAP_START( dcon_map, AS_PROGRAM, 16, dcon_state )
AM_RANGE(0xe0004, 0xe0005) AM_READ_PORT("SYSTEM")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( sdgndmps_map, AS_PROGRAM, 16, dcon_state )
+ AM_RANGE(0xa0000, 0xa000d) AM_READ8(sdgndmps_sound_comms_r, 0x00ff)
+ AM_IMPORT_FROM(dcon_map)
+ADDRESS_MAP_END
+
/******************************************************************************/
static INPUT_PORTS_START( common )
@@ -308,7 +321,7 @@ static MACHINE_CONFIG_START( sdgndmps ) /* PCB number is PB91008 */
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_20MHz/2)
- MCFG_CPU_PROGRAM_MAP(dcon_map)
+ MCFG_CPU_PROGRAM_MAP(sdgndmps_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", dcon_state, irq4_line_hold)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_14_31818MHz/4)
@@ -423,17 +436,6 @@ ROM_START( sdgndmps )
ROM_END
/***************************************************************************/
-DRIVER_INIT_MEMBER(dcon_state,sdgndmps)
-{
- uint16_t *RAM = (uint16_t *)memregion("maincpu")->base();
- RAM[0x1356/2] = 0x4e71; /* beq -> nop */
- RAM[0x1358/2] = 0x4e71;
-
- RAM[0x4de/2] = 0x4245; /* ROM checksum */
- RAM[0x4e0/2] = 0x4e71;
- RAM[0x4e2/2] = 0x4e71;
-}
-
-GAME( 1991, sdgndmps, 0, sdgndmps, sdgndmps, dcon_state, sdgndmps, ROT0, "Banpresto / Bandai", "SD Gundam Psycho Salamander no Kyoui", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
-GAME( 1992, dcon, 0, dcon, dcon, dcon_state, 0, ROT0, "Success", "D-Con", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
+GAME( 1991, sdgndmps, 0, sdgndmps, sdgndmps, dcon_state, 0, ROT0, "Banpresto / Bandai", "SD Gundam Psycho Salamander no Kyoui", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
+GAME( 1992, dcon, 0, dcon, dcon, dcon_state, 0, ROT0, "Success", "D-Con", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/includes/dcon.h b/src/mame/includes/dcon.h
index 6243dfccc9a..af8da933caf 100644
--- a/src/mame/includes/dcon.h
+++ b/src/mame/includes/dcon.h
@@ -1,11 +1,15 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail
+
+#include "audio/seibu.h"
+
class dcon_state : public driver_device
{
public:
dcon_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
+ m_seibu_sound(*this, "seibu_sound"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_back_data(*this, "back_data"),
@@ -15,6 +19,7 @@ public:
m_spriteram(*this, "spriteram") { }
required_device<cpu_device> m_maincpu;
+ required_device<seibu_sound_device> m_seibu_sound;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -34,6 +39,8 @@ public:
uint16_t m_scroll_ram[6];
uint16_t m_layer_en;
+ DECLARE_READ8_MEMBER(sdgndmps_sound_comms_r);
+
DECLARE_WRITE16_MEMBER(layer_en_w);
DECLARE_WRITE16_MEMBER(layer_scroll_w);
DECLARE_WRITE16_MEMBER(gfxbank_w);
@@ -47,7 +54,6 @@ public:
TILE_GET_INFO_MEMBER(get_mid_tile_info);
TILE_GET_INFO_MEMBER(get_text_tile_info);
- DECLARE_DRIVER_INIT(sdgndmps);
virtual void video_start() override;
uint32_t screen_update_dcon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);