dietgo (nw)

This commit is contained in:
David Haywood 2013-07-21 11:53:14 +00:00
parent d87241531f
commit 03c75f5013
2 changed files with 32 additions and 3 deletions

View File

@ -26,6 +26,25 @@ PAL16R6A 11H
#include "includes/decocrpt.h"
#include "includes/dietgo.h"
READ16_MEMBER( dietgo_state::dietgo_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( dietgo_state::dietgo_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( dietgo_map, AS_PROGRAM, 16, dietgo_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
@ -35,7 +54,8 @@ static ADDRESS_MAP_START( dietgo_map, AS_PROGRAM, 16, dietgo_state )
AM_RANGE(0x222000, 0x2227ff) AM_WRITEONLY AM_SHARE("pf2_rowscroll")
AM_RANGE(0x280000, 0x2807ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x300000, 0x300bff) AM_RAM_DEVWRITE("deco_common", decocomn_device, nonbuffered_palette_w) AM_SHARE("paletteram")
AM_RANGE(0x340000, 0x3407ff) AM_READWRITE_LEGACY(dietgo_104_prot_r, dietgo_104_prot_w)
// AM_RANGE(0x340000, 0x3407ff) AM_READWRITE_LEGACY(dietgo_104_prot_r, dietgo_104_prot_w)
AM_RANGE(0x340000, 0x343fff) AM_READWRITE(dietgo_protection_region_0_104_r,dietgo_protection_region_0_104_w)AM_SHARE("prot16ram") /* Protection device */
AM_RANGE(0x380000, 0x38ffff) AM_RAM // mainram
ADDRESS_MAP_END
@ -56,13 +76,13 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( dietgo )
PORT_START("IN0") /* Verified as 4 bit input port only */
PORT_START("IN1") /* Verified as 4 bit input port only */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN1")
PORT_START("IN0")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
@ -226,6 +246,10 @@ static MACHINE_CONFIG_START( dietgo, dietgo_state )
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
decospr_device::set_gfx_region(*device, 2);
MCFG_DECO104_ADD("ioprot104")
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")

View File

@ -14,6 +14,7 @@ class dietgo_state : public driver_device
public:
dietgo_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_deco104(*this, "ioprot104"),
m_pf1_rowscroll(*this, "pf1_rowscroll"),
m_pf2_rowscroll(*this, "pf2_rowscroll"),
m_spriteram(*this, "spriteram"),
@ -24,6 +25,7 @@ public:
m_decocomn(*this, "deco_common")
{ }
optional_device<deco104_device> m_deco104;
/* memory pointers */
required_shared_ptr<UINT16> m_pf1_rowscroll;
required_shared_ptr<UINT16> m_pf2_rowscroll;
@ -39,4 +41,7 @@ public:
DECLARE_DRIVER_INIT(dietgo);
virtual void machine_start();
UINT32 screen_update_dietgo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_READ16_MEMBER( dietgo_protection_region_0_104_r );
DECLARE_WRITE16_MEMBER( dietgo_protection_region_0_104_w );
};