mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
misc cleanup, no emulation changes
This commit is contained in:
parent
208b502dab
commit
72ece3f019
@ -1,5 +1,7 @@
|
||||
/***************************************************************************
|
||||
|
||||
Seibu Raiden hardware
|
||||
|
||||
Raiden (c) 1990 Seibu Kaihatsu
|
||||
Raiden (Alternate Hardware) (c) 1990 Seibu Kaihatsu
|
||||
Raiden (Korean license) (c) 1990 Seibu Kaihatsu
|
||||
@ -16,13 +18,10 @@
|
||||
|
||||
To access test mode, reset with both start buttons held.
|
||||
|
||||
Coin inputs are handled by the sound CPU, so they don't work with sound
|
||||
disabled. Just put the game in Free Play mode.
|
||||
|
||||
The country byte is stored at 0xffffd in the main cpu region,
|
||||
(that's 0x1fffe in program rom 4).
|
||||
|
||||
0x80 = World/Japan version? (Seibu Kaihatsu)
|
||||
0x80 = World/Japan version? (Seibu Kaihatsu) (distributed by Tecmo?)
|
||||
0x81 = USA version (Fabtek license)
|
||||
0x82 = Taiwan version (Liang HWA Electronics license)
|
||||
0x83 = Hong Kong version (Wah Yan Electronics license)
|
||||
@ -49,13 +48,13 @@
|
||||
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, raiden_state )
|
||||
AM_RANGE(0x00000, 0x06fff) AM_RAM
|
||||
AM_RANGE(0x07000, 0x07fff) AM_RAM AM_SHARE("spriteram")
|
||||
AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE("shared_ram")
|
||||
AM_RANGE(0x0b000, 0x0b001) AM_READ_PORT("P1_P2")
|
||||
AM_RANGE(0x0b002, 0x0b003) AM_READ_PORT("DSW")
|
||||
AM_RANGE(0x0b000, 0x0b007) AM_WRITE(raiden_control_w)
|
||||
AM_RANGE(0x08000, 0x08fff) AM_RAM AM_SHARE("shared_ram")
|
||||
AM_RANGE(0x0a000, 0x0a00d) AM_READWRITE_LEGACY(seibu_main_word_r, seibu_main_word_w)
|
||||
AM_RANGE(0x0c000, 0x0c7ff) AM_WRITE(raiden_text_w) AM_SHARE("videoram")
|
||||
AM_RANGE(0x0d000, 0x0d00d) AM_READWRITE_LEGACY(seibu_main_word_r, seibu_main_word_w)
|
||||
AM_RANGE(0x0d060, 0x0d067) AM_WRITEONLY AM_SHARE("scroll_ram")
|
||||
AM_RANGE(0x0e000, 0x0e001) AM_READ_PORT("P1_P2")
|
||||
AM_RANGE(0x0e000, 0x0e007) AM_WRITE(raiden_control_w)
|
||||
AM_RANGE(0x0e002, 0x0e003) AM_READ_PORT("DSW")
|
||||
AM_RANGE(0x0f000, 0x0f03f) AM_WRITEONLY AM_SHARE("scroll_ram")
|
||||
AM_RANGE(0xa0000, 0xfffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -65,69 +64,74 @@ static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 16, raiden_state )
|
||||
AM_RANGE(0x02800, 0x02fff) AM_RAM_WRITE(raiden_foreground_w) AM_SHARE("fore_data")
|
||||
AM_RANGE(0x03000, 0x03fff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
|
||||
AM_RANGE(0x04000, 0x04fff) AM_RAM AM_SHARE("shared_ram")
|
||||
AM_RANGE(0x07ffe, 0x0afff) AM_WRITENOP
|
||||
AM_RANGE(0x07ffe, 0x07fff) AM_WRITENOP // ?
|
||||
AM_RANGE(0x08000, 0x08001) AM_WRITENOP // ?
|
||||
AM_RANGE(0x0a000, 0x0a001) AM_WRITENOP // ?
|
||||
AM_RANGE(0xc0000, 0xfffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/************************* Alternate board set ************************/
|
||||
|
||||
static ADDRESS_MAP_START( alt_main_map, AS_PROGRAM, 16, raiden_state )
|
||||
AM_RANGE(0x00000, 0x06fff) AM_RAM
|
||||
AM_RANGE(0x07000, 0x07fff) AM_RAM AM_SHARE("spriteram")
|
||||
AM_RANGE(0x08000, 0x08fff) AM_RAM AM_SHARE("shared_ram")
|
||||
AM_RANGE(0x0a000, 0x0a00d) AM_READWRITE_LEGACY(seibu_main_word_r, seibu_main_word_w)
|
||||
AM_RANGE(0x0c000, 0x0c7ff) AM_WRITE(raiden_text_w) AM_SHARE("videoram")
|
||||
AM_RANGE(0x0e000, 0x0e001) AM_READ_PORT("P1_P2")
|
||||
AM_RANGE(0x0e000, 0x0e007) AM_WRITE(raidena_control_w)
|
||||
AM_RANGE(0x0e002, 0x0e003) AM_READ_PORT("DSW")
|
||||
AM_RANGE(0x0f000, 0x0f035) AM_WRITEONLY AM_SHARE("scroll_ram")
|
||||
AM_RANGE(0xa0000, 0xfffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static ADDRESS_MAP_START( raidenu_main_map, AS_PROGRAM, 16, raiden_state )
|
||||
AM_RANGE(0x00000, 0x06fff) AM_RAM
|
||||
AM_RANGE(0x07000, 0x07fff) AM_RAM AM_SHARE("spriteram")
|
||||
AM_RANGE(0x08000, 0x08035) AM_WRITEONLY AM_SHARE("scroll_ram")
|
||||
AM_RANGE(0x08000, 0x0803f) AM_WRITEONLY AM_SHARE("scroll_ram")
|
||||
AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE("shared_ram")
|
||||
AM_RANGE(0x0b000, 0x0b001) AM_READ_PORT("P1_P2")
|
||||
AM_RANGE(0x0b002, 0x0b003) AM_READ_PORT("DSW")
|
||||
AM_RANGE(0x0b000, 0x0b007) AM_WRITE(raidena_control_w)
|
||||
AM_RANGE(0x0b000, 0x0b007) AM_WRITE(raiden_control_w)
|
||||
AM_RANGE(0x0c000, 0x0c7ff) AM_WRITE(raiden_text_w) AM_SHARE("videoram")
|
||||
AM_RANGE(0x0d000, 0x0d00d) AM_READWRITE_LEGACY(seibu_main_word_r, seibu_main_word_w)
|
||||
AM_RANGE(0xa0000, 0xfffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( raidenu_sub_map, AS_PROGRAM, 16, raiden_state )
|
||||
AM_RANGE(0x00000, 0x05fff) AM_RAM
|
||||
AM_RANGE(0x06000, 0x067ff) AM_RAM_WRITE(raiden_background_w) AM_SHARE("back_data")
|
||||
AM_RANGE(0x06800, 0x06fff) AM_RAM_WRITE(raiden_foreground_w) AM_SHARE("fore_data")
|
||||
AM_RANGE(0x07000, 0x07fff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
|
||||
AM_RANGE(0x08000, 0x08fff) AM_RAM AM_SHARE("shared_ram")
|
||||
//AM_RANGE(0x07ffe, 0x0afff) AM_WRITENOP
|
||||
AM_RANGE(0x0a000, 0x0a001) AM_WRITENOP // ?
|
||||
AM_RANGE(0x0c000, 0x0c001) AM_WRITENOP // ?
|
||||
AM_RANGE(0xc0000, 0xfffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static ADDRESS_MAP_START( raidenb_main_map, AS_PROGRAM, 16, raiden_state )
|
||||
AM_RANGE(0x00000, 0x06fff) AM_RAM
|
||||
AM_RANGE(0x07000, 0x07fff) AM_RAM AM_SHARE("spriteram")
|
||||
AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE("shared_ram")
|
||||
AM_RANGE(0x0b000, 0x0b001) AM_READ_PORT("P1_P2")
|
||||
AM_RANGE(0x0b002, 0x0b003) AM_READ_PORT("DSW")
|
||||
AM_RANGE(0x0b000, 0x0b007) AM_WRITE(raidenb_control_w)
|
||||
AM_RANGE(0x0c000, 0x0c7ff) AM_WRITE(raiden_text_w) AM_SHARE("videoram")
|
||||
AM_RANGE(0x0d000, 0x0d00d) AM_READWRITE_LEGACY(seibu_main_word_r, seibu_main_word_w)
|
||||
AM_RANGE(0x0d060, 0x0d067) AM_WRITEONLY AM_SHARE("scroll_ram")
|
||||
AM_RANGE(0xa0000, 0xfffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static INPUT_PORTS_START( raiden )
|
||||
SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */
|
||||
SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */
|
||||
|
||||
PORT_START("P1_P2")
|
||||
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)
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
|
||||
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
@ -197,6 +201,7 @@ static INPUT_PORTS_START( raiden )
|
||||
PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static const gfx_layout raiden_charlayout =
|
||||
@ -212,9 +217,9 @@ static const gfx_layout raiden_charlayout =
|
||||
|
||||
static const gfx_layout raiden_spritelayout =
|
||||
{
|
||||
16,16, /* 16*16 tiles */
|
||||
16,16, /* 16*16 tiles */
|
||||
4096, /* 2048*4 tiles */
|
||||
4, /* 4 bits per pixel */
|
||||
4, /* 4 bits per pixel */
|
||||
{ 12, 8, 4, 0 },
|
||||
{
|
||||
0,1,2,3, 16,17,18,19,
|
||||
@ -235,11 +240,12 @@ static GFXDECODE_START( raiden )
|
||||
GFXDECODE_ENTRY( "gfx4", 0, raiden_spritelayout, 512, 16 )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
INTERRUPT_GEN_MEMBER(raiden_state::raiden_interrupt)
|
||||
{
|
||||
device.execute().set_input_line_and_vector(0, HOLD_LINE, 0xc8/4); /* VBL */
|
||||
device.execute().set_input_line_and_vector(0, HOLD_LINE, 0xc8/4); /* VBL */
|
||||
}
|
||||
|
||||
static MACHINE_CONFIG_START( raiden, raiden_state )
|
||||
@ -247,11 +253,11 @@ static MACHINE_CONFIG_START( raiden, raiden_state )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", V30,XTAL_20MHz/2) /* NEC V30 CPU, 20MHz verified on pcb */
|
||||
MCFG_CPU_PROGRAM_MAP(main_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", raiden_state, raiden_interrupt)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", raiden_state, raiden_interrupt)
|
||||
|
||||
MCFG_CPU_ADD("sub", V30,XTAL_20MHz/2) /* NEC V30 CPU, 20MHz verified on pcb */
|
||||
MCFG_CPU_PROGRAM_MAP(sub_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", raiden_state, raiden_interrupt)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", raiden_state, raiden_interrupt)
|
||||
|
||||
SEIBU_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) /* verified on pcb */
|
||||
|
||||
@ -263,7 +269,7 @@ static MACHINE_CONFIG_START( raiden, raiden_state )
|
||||
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
|
||||
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(59.60) /* verified on pcb */
|
||||
MCFG_SCREEN_REFRESH_RATE(59.60) /* verified on pcb */
|
||||
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-1)
|
||||
@ -273,27 +279,31 @@ static MACHINE_CONFIG_START( raiden, raiden_state )
|
||||
MCFG_GFXDECODE(raiden)
|
||||
MCFG_PALETTE_LENGTH(2048)
|
||||
|
||||
|
||||
/* sound hardware */
|
||||
SEIBU_SOUND_SYSTEM_YM3812_RAIDEN_INTERFACE(XTAL_14_31818MHz/4,XTAL_12MHz/12) // frequency and pin 7 verified (pin set in audio\seibu.h)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( raidena, raiden )
|
||||
MCFG_CPU_MODIFY("maincpu")
|
||||
MCFG_CPU_PROGRAM_MAP(alt_main_map)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(raiden_state,raidena)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( raidenu, raiden )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_MODIFY("maincpu")
|
||||
MCFG_CPU_PROGRAM_MAP(raidenu_main_map)
|
||||
|
||||
MCFG_CPU_MODIFY("sub")
|
||||
MCFG_CPU_PROGRAM_MAP(raidenu_sub_map)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(raiden_state,raidena)
|
||||
static MACHINE_CONFIG_DERIVED( raidenb, raiden )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_MODIFY("maincpu")
|
||||
MCFG_CPU_PROGRAM_MAP(raidenb_main_map)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_VIDEO_START_OVERRIDE(raiden_state,raidenb)
|
||||
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_UPDATE_DRIVER(raiden_state, screen_update_raidenb)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -546,30 +556,6 @@ ROM_END
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
|
||||
/* this used to be needed to stop the collisions from breaking (high interleave didn't help), is it still required? */
|
||||
//#define SYNC_HACK
|
||||
|
||||
#ifdef SYNC_HACK
|
||||
READ16_MEMBER(raiden_state::sub_cpu_spin_r)
|
||||
{
|
||||
int pc=space.device().safe_pc();
|
||||
int ret=m_shared_ram[0x4];
|
||||
|
||||
// main set
|
||||
if (pc==0xfcde6 && ret!=0x40)
|
||||
space.device().execute().spin();
|
||||
|
||||
// alt sets
|
||||
if (pc==0xfcde8 && ret!=0x40)
|
||||
space.device().execute().spin();
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* This is based on code by Niclas Karlsson Mate, who figured out the
|
||||
encryption method! The technique is a combination of a XOR table plus
|
||||
bit-swapping */
|
||||
@ -600,49 +586,36 @@ void raiden_state::common_decrypt()
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
DRIVER_INIT_MEMBER(raiden_state,raidena)
|
||||
{
|
||||
#ifdef SYNC_HACK
|
||||
m_subcpu->space(AS_PROGRAM).install_legacy_read_handler(0x4008, 0x4009, FUNC(sub_cpu_spin_r));
|
||||
#endif
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(raiden_state,raiden)
|
||||
{
|
||||
DRIVER_INIT_CALL(raidena);
|
||||
common_decrypt();
|
||||
seibu_sound_decrypt(machine(),"audiocpu",0x20000);
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(raiden_state,raidenk)
|
||||
{
|
||||
DRIVER_INIT_CALL(raidena);
|
||||
common_decrypt();
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(raiden_state,raidenu)
|
||||
{
|
||||
DRIVER_INIT_CALL(raidena);
|
||||
seibu_sound_decrypt(machine(),"audiocpu",0x20000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
/* Same PCB, differ by region byte(s) */
|
||||
GAME( 1990, raiden, 0, raidena, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu", "Raiden (set 1)", 0 )
|
||||
GAME( 1990, raidena, raiden, raidena, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu", "Raiden (set 2)", 0 )
|
||||
GAME( 1990, raidenu, raiden, raidena, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US, set 1)", 0 )
|
||||
GAME( 1990, raident, raiden, raidena, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Liang HWA Electronics license)", "Raiden (Taiwan)", 0 )
|
||||
GAME( 1990, raiden, 0, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu", "Raiden (set 1)", 0 )
|
||||
GAME( 1990, raidena, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu", "Raiden (set 2)", 0 )
|
||||
GAME( 1990, raidenu, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US)", 0 )
|
||||
GAME( 1990, raident, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Liang HWA Electronics license)", "Raiden (Taiwan)", 0 )
|
||||
|
||||
/* Same as above, but the sound CPU code is not encrypted */
|
||||
GAME( 1990, raidenk, raiden, raidena, raiden, raiden_state, raidenk, ROT270, "Seibu Kaihatsu (IBL Corporation license)", "Raiden (Korea)", 0 )
|
||||
GAME( 1990, raidenk, raiden, raiden, raiden, raiden_state, raidenk, ROT270, "Seibu Kaihatsu (IBL Corporation license)", "Raiden (Korea)", 0 )
|
||||
|
||||
/* Alternate hardware. Main & Sub CPU code not encrypted */
|
||||
GAME( 1990, raidenua, raiden, raidenu, raiden, raiden_state, raidenu, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US, set 2, SEI8904 + SEI9008 PCBs)", 0 )
|
||||
/* Alternate hardware; SEI8904 + SEI9008 PCBs. Main & Sub CPU code not encrypted */
|
||||
GAME( 1990, raidenua, raiden, raidenu, raiden, raiden_state, raidenu, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US, newer?)", 0 )
|
||||
|
||||
/* Alternate hardware. Main, Sub & Sound CPU code not encrypted */
|
||||
GAME( 1990, raidenb, raiden, raiden, raiden, raiden_state, raidena, ROT270, "Seibu Kaihatsu", "Raiden (set 3, Alternate hardware)", 0 )
|
||||
/* Alternate hardware. Main, Sub & Sound CPU code not encrypted - could possibly be a bootleg?? */
|
||||
GAME( 1990, raidenb, raiden, raidenb, raiden, driver_device, 0, ROT270, "Seibu Kaihatsu", "Raiden (set 3)", 0 )
|
||||
|
@ -1,3 +1,9 @@
|
||||
/*******************************************************************************
|
||||
|
||||
Seibu Raiden hardware
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#include "video/bufsprite.h"
|
||||
|
||||
class raiden_state : public driver_device
|
||||
@ -5,44 +11,45 @@ class raiden_state : public driver_device
|
||||
public:
|
||||
raiden_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_spriteram(*this, "spriteram") ,
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_shared_ram(*this, "shared_ram"),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_scroll_ram(*this, "scroll_ram"),
|
||||
m_back_data(*this, "back_data"),
|
||||
m_fore_data(*this, "fore_data"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_fore_data(*this, "fore_data")
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<buffered_spriteram16_device> m_spriteram;
|
||||
required_shared_ptr<UINT16> m_shared_ram;
|
||||
required_shared_ptr<UINT16> m_videoram;
|
||||
required_shared_ptr<UINT16> m_scroll_ram;
|
||||
required_shared_ptr<UINT16> m_back_data;
|
||||
required_shared_ptr<UINT16> m_fore_data;
|
||||
|
||||
tilemap_t *m_bg_layer;
|
||||
tilemap_t *m_fg_layer;
|
||||
tilemap_t *m_tx_layer;
|
||||
int m_flipscreen;
|
||||
int m_alternate;
|
||||
|
||||
DECLARE_READ16_MEMBER(sub_cpu_spin_r);
|
||||
DECLARE_WRITE16_MEMBER(raiden_background_w);
|
||||
DECLARE_WRITE16_MEMBER(raiden_foreground_w);
|
||||
DECLARE_WRITE16_MEMBER(raiden_text_w);
|
||||
DECLARE_WRITE16_MEMBER(raiden_control_w);
|
||||
DECLARE_WRITE16_MEMBER(raidena_control_w);
|
||||
DECLARE_WRITE16_MEMBER(raidenb_control_w);
|
||||
DECLARE_DRIVER_INIT(raidenu);
|
||||
DECLARE_DRIVER_INIT(raidenk);
|
||||
DECLARE_DRIVER_INIT(raiden);
|
||||
DECLARE_DRIVER_INIT(raidena);
|
||||
TILE_GET_INFO_MEMBER(get_back_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_fore_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_text_tile_info);
|
||||
virtual void video_start();
|
||||
DECLARE_VIDEO_START(raidena);
|
||||
DECLARE_VIDEO_START(raidenb);
|
||||
UINT32 screen_update_raiden(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_raidenb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(raiden_interrupt);
|
||||
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri_mask);
|
||||
void common_decrypt();
|
||||
required_device<cpu_device> m_maincpu;
|
||||
};
|
||||
|
@ -1,3 +1,11 @@
|
||||
/*******************************************************************************
|
||||
|
||||
Seibu Raiden hardware
|
||||
|
||||
Functions to emulate the video hardware
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/raiden.h"
|
||||
|
||||
@ -18,79 +26,26 @@ WRITE16_MEMBER(raiden_state::raiden_foreground_w)
|
||||
|
||||
WRITE16_MEMBER(raiden_state::raiden_text_w)
|
||||
{
|
||||
UINT16 *videoram = m_videoram;
|
||||
COMBINE_DATA(&videoram[offset]);
|
||||
COMBINE_DATA(&m_videoram[offset]);
|
||||
m_tx_layer->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(raiden_state::get_back_tile_info)
|
||||
{
|
||||
int tile=m_back_data[tile_index];
|
||||
int color=tile >> 12;
|
||||
|
||||
tile=tile&0xfff;
|
||||
|
||||
SET_TILE_INFO_MEMBER(
|
||||
1,
|
||||
tile,
|
||||
color,
|
||||
0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(raiden_state::get_fore_tile_info)
|
||||
{
|
||||
int tile=m_fore_data[tile_index];
|
||||
int color=tile >> 12;
|
||||
|
||||
tile=tile&0xfff;
|
||||
|
||||
SET_TILE_INFO_MEMBER(
|
||||
2,
|
||||
tile,
|
||||
color,
|
||||
0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(raiden_state::get_text_tile_info)
|
||||
{
|
||||
UINT16 *videoram = m_videoram;
|
||||
int tiledata = videoram[tile_index];
|
||||
int tile = (tiledata & 0xff) | ((tiledata >> 6) & 0x300);
|
||||
int color = (tiledata >> 8) & 0x0f;
|
||||
|
||||
SET_TILE_INFO_MEMBER(
|
||||
0,
|
||||
tile,
|
||||
color,
|
||||
0);
|
||||
}
|
||||
|
||||
void raiden_state::video_start()
|
||||
{
|
||||
m_bg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_back_tile_info),this),TILEMAP_SCAN_COLS, 16,16,32,32);
|
||||
m_fg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_fore_tile_info),this),TILEMAP_SCAN_COLS,16,16,32,32);
|
||||
m_tx_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_text_tile_info),this),TILEMAP_SCAN_COLS,8,8,32,32);
|
||||
m_alternate=0;
|
||||
|
||||
m_fg_layer->set_transparent_pen(15);
|
||||
m_tx_layer->set_transparent_pen(15);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(raiden_state,raidena)
|
||||
{
|
||||
m_bg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_back_tile_info),this),TILEMAP_SCAN_COLS, 16,16,32,32);
|
||||
m_fg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_fore_tile_info),this),TILEMAP_SCAN_COLS,16,16,32,32);
|
||||
m_tx_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
|
||||
m_alternate=1;
|
||||
|
||||
m_fg_layer->set_transparent_pen(15);
|
||||
m_tx_layer->set_transparent_pen(15);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(raiden_state::raiden_control_w)
|
||||
{
|
||||
/* All other bits unknown - could be playfield enables */
|
||||
|
||||
/* Flipscreen */
|
||||
if (offset==3 && ACCESSING_BITS_0_7) {
|
||||
m_flipscreen=data&0x40;
|
||||
machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(raiden_state::raidenb_control_w)
|
||||
{
|
||||
/* raidenb uses 0x02 instead of 0x40 */
|
||||
|
||||
/* Flipscreen */
|
||||
if (offset==3 && ACCESSING_BITS_0_7) {
|
||||
m_flipscreen=data&0x2;
|
||||
@ -98,16 +53,8 @@ WRITE16_MEMBER(raiden_state::raiden_control_w)
|
||||
}
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(raiden_state::raidena_control_w)
|
||||
{
|
||||
/* raidena uses 0x40 instead of 0x02 */
|
||||
|
||||
/* Flipscreen */
|
||||
if (offset==3 && ACCESSING_BITS_0_7) {
|
||||
m_flipscreen=data&0x40;
|
||||
machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
|
||||
}
|
||||
}
|
||||
/******************************************************************************/
|
||||
|
||||
void raiden_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri_mask)
|
||||
{
|
||||
@ -118,8 +65,8 @@ void raiden_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,i
|
||||
{
|
||||
if (!(pri_mask&(buffered_spriteram16[offs+2]>>8))) continue;
|
||||
|
||||
fx = buffered_spriteram16[offs+0] & 0x2000;
|
||||
fy = buffered_spriteram16[offs+0] & 0x4000;
|
||||
fx = buffered_spriteram16[offs+0] & 0x2000;
|
||||
fy = buffered_spriteram16[offs+0] & 0x4000;
|
||||
color = (buffered_spriteram16[offs+0] & 0x0f00) >> 8;
|
||||
y = buffered_spriteram16[offs+0] & 0x00ff;
|
||||
|
||||
@ -144,19 +91,10 @@ void raiden_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,i
|
||||
|
||||
UINT32 raiden_state::screen_update_raiden(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
/* Setup the tilemaps, alternate version has different scroll positions */
|
||||
if (!m_alternate) {
|
||||
m_bg_layer->set_scrollx(0, m_scroll_ram[0]);
|
||||
m_bg_layer->set_scrolly(0, m_scroll_ram[1]);
|
||||
m_fg_layer->set_scrollx(0, m_scroll_ram[2]);
|
||||
m_fg_layer->set_scrolly(0, m_scroll_ram[3]);
|
||||
}
|
||||
else {
|
||||
m_bg_layer->set_scrolly(0, ((m_scroll_ram[0x01]&0x30)<<4)+((m_scroll_ram[0x02]&0x7f)<<1)+((m_scroll_ram[0x02]&0x80)>>7) );
|
||||
m_bg_layer->set_scrollx(0, ((m_scroll_ram[0x09]&0x30)<<4)+((m_scroll_ram[0x0a]&0x7f)<<1)+((m_scroll_ram[0x0a]&0x80)>>7) );
|
||||
m_fg_layer->set_scrolly(0, ((m_scroll_ram[0x11]&0x30)<<4)+((m_scroll_ram[0x12]&0x7f)<<1)+((m_scroll_ram[0x12]&0x80)>>7) );
|
||||
m_fg_layer->set_scrollx(0, ((m_scroll_ram[0x19]&0x30)<<4)+((m_scroll_ram[0x1a]&0x7f)<<1)+((m_scroll_ram[0x1a]&0x80)>>7) );
|
||||
}
|
||||
m_bg_layer->set_scrolly(0, ((m_scroll_ram[0x01]&0x30)<<4)+((m_scroll_ram[0x02]&0x7f)<<1)+((m_scroll_ram[0x02]&0x80)>>7));
|
||||
m_bg_layer->set_scrollx(0, ((m_scroll_ram[0x09]&0x30)<<4)+((m_scroll_ram[0x0a]&0x7f)<<1)+((m_scroll_ram[0x0a]&0x80)>>7));
|
||||
m_fg_layer->set_scrolly(0, ((m_scroll_ram[0x11]&0x30)<<4)+((m_scroll_ram[0x12]&0x7f)<<1)+((m_scroll_ram[0x12]&0x80)>>7));
|
||||
m_fg_layer->set_scrollx(0, ((m_scroll_ram[0x19]&0x30)<<4)+((m_scroll_ram[0x1a]&0x7f)<<1)+((m_scroll_ram[0x1a]&0x80)>>7));
|
||||
|
||||
m_bg_layer->draw(bitmap, cliprect, 0,0);
|
||||
|
||||
@ -171,3 +109,75 @@ UINT32 raiden_state::screen_update_raiden(screen_device &screen, bitmap_ind16 &b
|
||||
m_tx_layer->draw(bitmap, cliprect, 0,0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT32 raiden_state::screen_update_raidenb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
/* raidenb has different scroll positions */
|
||||
m_bg_layer->set_scrollx(0, m_scroll_ram[0]);
|
||||
m_bg_layer->set_scrolly(0, m_scroll_ram[1]);
|
||||
m_fg_layer->set_scrollx(0, m_scroll_ram[2]);
|
||||
m_fg_layer->set_scrolly(0, m_scroll_ram[3]);
|
||||
|
||||
m_bg_layer->draw(bitmap, cliprect, 0,0);
|
||||
|
||||
/* Draw sprites underneath foreground */
|
||||
draw_sprites(bitmap,cliprect,0x40);
|
||||
m_fg_layer->draw(bitmap, cliprect, 0,0);
|
||||
|
||||
/* Rest of sprites */
|
||||
draw_sprites(bitmap,cliprect,0x80);
|
||||
|
||||
/* Text layer */
|
||||
m_tx_layer->draw(bitmap, cliprect, 0,0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
TILE_GET_INFO_MEMBER(raiden_state::get_back_tile_info)
|
||||
{
|
||||
int tiledata = m_back_data[tile_index];
|
||||
int tile = tiledata & 0x0fff;
|
||||
int color = tiledata >> 12;
|
||||
|
||||
SET_TILE_INFO_MEMBER(1, tile, color, 0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(raiden_state::get_fore_tile_info)
|
||||
{
|
||||
int tiledata = m_fore_data[tile_index];
|
||||
int tile = tiledata & 0x0fff;
|
||||
int color = tiledata >> 12;
|
||||
|
||||
SET_TILE_INFO_MEMBER(2, tile, color, 0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(raiden_state::get_text_tile_info)
|
||||
{
|
||||
int tiledata = m_videoram[tile_index];
|
||||
int tile = (tiledata & 0xff) | ((tiledata >> 6) & 0x300);
|
||||
int color = (tiledata >> 8) & 0x0f;
|
||||
|
||||
SET_TILE_INFO_MEMBER(0, tile, color, 0);
|
||||
}
|
||||
|
||||
void raiden_state::video_start()
|
||||
{
|
||||
m_bg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_back_tile_info),this),TILEMAP_SCAN_COLS,16,16,32,32);
|
||||
m_fg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_fore_tile_info),this),TILEMAP_SCAN_COLS,16,16,32,32);
|
||||
m_tx_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS,8, 8, 32,32);
|
||||
|
||||
m_fg_layer->set_transparent_pen(15);
|
||||
m_tx_layer->set_transparent_pen(15);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(raiden_state,raidenb)
|
||||
{
|
||||
m_bg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_back_tile_info),this),TILEMAP_SCAN_COLS,16,16,32,32);
|
||||
m_fg_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_fore_tile_info),this),TILEMAP_SCAN_COLS,16,16,32,32);
|
||||
m_tx_layer = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(raiden_state::get_text_tile_info),this),TILEMAP_SCAN_COLS,8, 8, 32,32);
|
||||
|
||||
m_fg_layer->set_transparent_pen(15);
|
||||
m_tx_layer->set_transparent_pen(15);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user