📄 darkseal.c
字号:
/***************************************************************************
Dark Seal, (c) 1990 Data East Corporation (Japanese version)
Gate Of Doom, (c) 1990 Data East Corporation (USA version)
Basically an improved version of Midnight Resistance hardware:
More sprites,
More colours,
Bigger playfields,
Better sound,
Encrypted roms.
Probably same hardware as Too Crude/Crude Buster.
Sound:
Unknown CPU, so no music or effects
1 of the Oki chips can be triggered from sound code without need to emulate
the sound CPU (this can be removed once sound CPU _is_ emulated...)
YM2151 (music)
YM2203C (effects)
2 Oki ADPCM chips
Driver notes:
No sound.
Gate of Doom has no tile or sprite roms dumped as they were soldered to the
board, it seems quite safe to use the ones from Dark Seal.
Emulation by Bryan McPhail, mish@tendril.force9.net
***************************************************************************/
#include "driver.h"
#include "vidhrdw/generic.h"
static unsigned char *ram_drkseal; /* used by high scores */
int darkseal_vh_start(void);
void darkseal_vh_stop(void);
void darkseal_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
void darkseal_pf1_data_w(int offset,int data);
void darkseal_pf2_data_w(int offset,int data);
void darkseal_pf3_data_w(int offset,int data);
void darkseal_pf3b_data_w(int offset,int data);
void darkseal_control_0_w(int offset,int data);
void darkseal_control_1_w(int offset,int data);
void darkseal_palette_24bit_rg(int offset,int data);
void darkseal_palette_24bit_b(int offset,int data);
int darkseal_palette_24bit_rg_r(int offset);
int darkseal_palette_24bit_b_r(int offset);
extern unsigned char *darkseal_sprite;
static unsigned char *darkseal_ram;
/* System prototypes - from machine/dec0.c */
int slyspy_controls_read(int offset);
/******************************************************************************/
static void darkseal_control_w(int offset,int data)
{
int sound;
switch (offset) {
case 0xa:
case 6: /* 0 written very frequently */
return;
case 8: /* Sound CPU write */
sound=data&0xff;
if (sound>0x46) ADPCM_trigger(0,sound);
return;
}
}
/******************************************************************************/
static struct MemoryReadAddress darkseal_readmem[] =
{
{ 0x000000, 0x07ffff, MRA_ROM },
{ 0x100000, 0x103fff, MRA_BANK1, &ram_drkseal},
{ 0x120000, 0x1207ff, MRA_BANK2 },
{ 0x140000, 0x140fff, darkseal_palette_24bit_rg_r },
{ 0x141000, 0x141fff, darkseal_palette_24bit_b_r },
{ 0x180000, 0x18000f, slyspy_controls_read },
{ 0x220000, 0x220fff, MRA_BANK3 }, /* Palette gets moved here at colour fades */
{ 0x222000, 0x222fff, MRA_BANK4 }, /* Palette gets moved here at colour fades */
{ -1 } /* end of table */
};
static struct MemoryWriteAddress darkseal_writemem[] =
{
{ 0x000000, 0x07ffff, MWA_ROM },
{ 0x100000, 0x103fff, MWA_BANK1, &darkseal_ram },
{ 0x120000, 0x1207ff, MWA_BANK2, &darkseal_sprite },
{ 0x140000, 0x140fff, darkseal_palette_24bit_rg, &paletteram },
{ 0x141000, 0x141fff, darkseal_palette_24bit_b, &paletteram_2 },
{ 0x180000, 0x18000f, darkseal_control_w },
{ 0x200000, 0x200fff, darkseal_pf3b_data_w }, /* 2nd half of pf3, only used on last level */
{ 0x202000, 0x202fff, darkseal_pf3_data_w },
{ 0x220000, 0x220fff, MWA_BANK3 }, /* Palette gets moved here at colour fades */
{ 0x222000, 0x222fff, MWA_BANK4 }, /* Palette gets moved here at colour fades */
{ 0x240000, 0x24000f, darkseal_control_0_w },
{ 0x260000, 0x261fff, darkseal_pf2_data_w },
{ 0x262000, 0x263fff, darkseal_pf1_data_w },
{ 0x2a0000, 0x2a000f, darkseal_control_1_w },
{ -1 } /* end of table */
};
/******************************************************************************/
INPUT_PORTS_START( darkseal_input_ports )
PORT_START /* Player 1 controls */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* button 3 - unused */
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
PORT_START /* Player 2 controls */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* button 3 - unused */
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START /* Credits */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START /* Dip switch bank 1 */
PORT_DIPNAME( 0x07, 0x07, "Coin A", IP_KEY_NONE )
PORT_DIPSETTING( 0x07, "1 Coin/1 Credit" )
PORT_DIPSETTING( 0x06, "1 Coin/2 Credits" )
PORT_DIPSETTING( 0x05, "1 Coin/3 Credits" )
PORT_DIPSETTING( 0x04, "1 Coin/4 Credits" )
PORT_DIPSETTING( 0x03, "1 Coin/5 Credits" )
PORT_DIPSETTING( 0x02, "1 Coin/6 Credits" )
PORT_DIPSETTING( 0x01, "2 Coin/1 Credit" )
PORT_DIPSETTING( 0x00, "3 Coin/1 Credit" )
PORT_DIPNAME( 0x38, 0x38, "Coin B", IP_KEY_NONE )
PORT_DIPSETTING( 0x38, "1 Coin/1 Credit" )
PORT_DIPSETTING( 0x30, "1 Coin/2 Credits" )
PORT_DIPSETTING( 0x28, "1 Coin/3 Credits" )
PORT_DIPSETTING( 0x20, "1 Coin/4 Credits" )
PORT_DIPSETTING( 0x18, "1 Coin/5 Credits" )
PORT_DIPSETTING( 0x10, "1 Coin/6 Credits" )
PORT_DIPSETTING( 0x08, "2 Coin/1 Credit" )
PORT_DIPSETTING( 0x00, "3 Coin/1 Credit" )
PORT_DIPNAME( 0x40, 0x40, "Flip Screen", IP_KEY_NONE )
PORT_DIPSETTING( 0x40, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START /* Dip switch bank 2 */
PORT_DIPNAME( 0x03, 0x03, "Lives", IP_KEY_NONE )
PORT_DIPSETTING( 0x03, "3" )
PORT_DIPSETTING( 0x02, "4" )
PORT_DIPSETTING( 0x01, "2" )
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPNAME( 0x0c, 0x0c, "Difficulty", IP_KEY_NONE )
PORT_DIPSETTING( 0x0c, "Normal" )
PORT_DIPSETTING( 0x08, "Easy" )
PORT_DIPSETTING( 0x04, "Hard" )
PORT_DIPSETTING( 0x00, "Hardest" )
PORT_DIPNAME( 0x30, 0x30, "Energy", IP_KEY_NONE )
PORT_DIPSETTING( 0x30, "3" )
PORT_DIPSETTING( 0x20, "4" )
PORT_DIPSETTING( 0x10, "2.5" )
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPNAME( 0x40, 0x40, "Allow Continue", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "No" )
PORT_DIPSETTING( 0x40, "Yes" )
PORT_DIPNAME( 0x80, 0x80, "Demo Sounds", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPSETTING( 0x80, "Off" )
INPUT_PORTS_END
/******************************************************************************/
static struct GfxLayout charlayout =
{
8,8, /* 8*8 chars */
4096,
4, /* 4 bits per pixel */
{ 0x00000*8, 0x10000*8, 0x8000*8, 0x18000*8 },
{ 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 */
};
static struct GfxLayout seallayout =
{
16,16,
4096,
4,
{ 8, 0, 0x40000*8+8, 0x40000*8,},
{ 32*8+0, 32*8+1, 32*8+2, 32*8+3, 32*8+4, 32*8+5, 32*8+6, 32*8+7,
0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
64*8
};
static struct GfxLayout seallayout2 =
{
16,16,
4096*2, /* A lotta sprites.. */
4,
{ 8, 0, 0x80000*8+8, 0x80000*8 },
{ 32*8+0, 32*8+1, 32*8+2, 32*8+3, 32*8+4, 32*8+5, 32*8+6, 32*8+7,
0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
64*8
};
static struct GfxDecodeInfo gfxdecodeinfo[] =
{
{ 1, 0x000000, &charlayout, 0, 16 }, /* Characters 8x8 */
{ 1, 0x020000, &seallayout, 768, 16 }, /* Tiles 16x16 */
{ 1, 0x0a0000, &seallayout, 1024, 16 }, /* Tiles 16x16 */
{ 1, 0x120000, &seallayout2, 256, 32 }, /* Sprites 16x16 */
{ -1 } /* end of array */
};
/******************************************************************************/
static struct ADPCMinterface adpcm_interface =
{
1, /* 1 chip */
8000, /* 8000Hz playback */
3, /* memory region 3 */
0, /* init function */
{ 255 }
};
static struct MachineDriver darkseal_machine_driver =
{
/* basic machine hardware */
{
{
CPU_M68000,
10000000,
0,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -