summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author David Haywood <mamehaze@users.noreply.github.com>2013-07-21 15:14:15 +0000
committer David Haywood <mamehaze@users.noreply.github.com>2013-07-21 15:14:15 +0000
commitad27c3045a98515cb9e349d508737d4fa0fa2a44 (patch)
tree4f1d487cdb267a80dec0af44bb6b8cfdf270f8d8
parentbefa27b30dcc52476e05b48a96fe7480a0b4b5df (diff)
dreambal (nw)
-rw-r--r--src/mame/drivers/dreambal.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/mame/drivers/dreambal.c b/src/mame/drivers/dreambal.c
index db6c8fbf388..1d90b11895a 100644
--- a/src/mame/drivers/dreambal.c
+++ b/src/mame/drivers/dreambal.c
@@ -51,6 +51,9 @@ public:
virtual void machine_reset();
UINT32 screen_update_dreambal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_READ16_MEMBER( dreambal_protection_region_0_104_r );
+ DECLARE_WRITE16_MEMBER( dreambal_protection_region_0_104_w );
+
DECLARE_WRITE16_HANDLER( dreambal_eeprom_w )
{
if (data&0xfff8)
@@ -85,6 +88,23 @@ UINT32 dreambal_state::screen_update_dreambal(screen_device &screen, bitmap_ind1
}
+READ16_MEMBER( dreambal_state::dreambal_protection_region_0_104_r )
+{
+ int real_address = 0 + (offset *2);
+ int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff;
+ UINT8 cs = 0;
+ UINT16 data = m_deco104->read_data( deco146_addr, mem_mask, cs );
+ return data;
+}
+
+WRITE16_MEMBER( dreambal_state::dreambal_protection_region_0_104_w )
+{
+ int real_address = 0 + (offset *2);
+ int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff;
+ UINT8 cs = 0;
+ m_deco104->write_data( space, deco146_addr, data, mem_mask, cs );
+}
+
static ADDRESS_MAP_START( dreambal_map, AS_PROGRAM, 16, dreambal_state )
//ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x000000, 0x07ffff) AM_ROM
@@ -97,9 +117,7 @@ static ADDRESS_MAP_START( dreambal_map, AS_PROGRAM, 16, dreambal_state )
AM_RANGE(0x140000, 0x1403ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
AM_RANGE(0x161000, 0x16100f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
- AM_RANGE(0x160088, 0x160089) AM_READ_PORT("INP")
- AM_RANGE(0x160292, 0x160293) AM_READ_PORT("SYS")
- AM_RANGE(0x16036C, 0x16036D) AM_READ_PORT("COIN")
+ AM_RANGE(0x160000, 0x163fff) AM_READWRITE(dreambal_protection_region_0_104_r,dreambal_protection_region_0_104_w)AM_SHARE("prot16ram") /* Protection device */
AM_RANGE(0x180000, 0x180001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
@@ -145,7 +163,7 @@ static GFXDECODE_START( dreambal )
GFXDECODE_END
static INPUT_PORTS_START( dreambal )
- PORT_START("INP")
+ PORT_START("INPUTS")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // currently causes hopper error
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) // fold?
@@ -173,7 +191,7 @@ static INPUT_PORTS_START( dreambal )
PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_START("SYS")
+ PORT_START("DSW")
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
@@ -221,7 +239,7 @@ static INPUT_PORTS_START( dreambal )
PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_START("COIN")
+ PORT_START("SYSTEM")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_DIPNAME( 0x0004, 0x0004, "3" ) // freeze / vbl?