📄 phoenix.c
字号:
/***************************************************************************
Note:
pleiads is using another sound driver, sndhrdw\pleiads.c
Andrew Scott (ascott@utkux.utcc.utk.edu)
Phoenix memory map
0000-3fff 16Kb Program ROM
4000-43ff 1Kb Video RAM Charset A (4340-43ff variables)
4400-47ff 1Kb Work RAM
4800-4bff 1Kb Video RAM Charset B (4840-4bff variables)
4c00-4fff 1Kb Work RAM
5000-53ff 1Kb Video Control write-only (mirrored)
5400-47ff 1Kb Work RAM
5800-5bff 1Kb Video Scroll Register (mirrored)
5c00-5fff 1Kb Work RAM
6000-63ff 1Kb Sound Control A (mirrored)
6400-67ff 1Kb Work RAM
6800-6bff 1Kb Sound Control B (mirrored)
6c00-6fff 1Kb Work RAM
7000-73ff 1Kb 8bit Game Control read-only (mirrored)
7400-77ff 1Kb Work RAM
7800-7bff 1Kb 8bit Dip Switch read-only (mirrored)
7c00-7fff 1Kb Work RAM
memory mapped ports:
read-only:
7000-73ff IN
7800-7bff DSW
* IN (all bits are inverted)
* bit 7 : barrier
* bit 6 : Left
* bit 5 : Right
* bit 4 : Fire
* bit 3 : -
* bit 2 : Start 2
* bit 1 : Start 1
* bit 0 : Coin
* DSW
* bit 7 : VBlank
* bit 6 : free play (pleiads only)
* bit 5 : attract sound 0 = off 1 = on (pleiads only?)
* bit 4 : coins per play 0 = 1 coin 1 = 2 coins
* bit 3 :\ bonus
* bit 2 :/ 00 = 3000 01 = 4000 10 = 5000 11 = 6000
* bit 1 :\ number of lives
* bit 0 :/ 00 = 3 01 = 4 10 = 5 11 = 6
***************************************************************************/
#include "driver.h"
#include "vidhrdw/generic.h"
extern unsigned char *phoenix_videoram2;
int phoenix_DSW_r (int offset);
void phoenix_videoreg_w (int offset,int data);
void phoenix_scroll_w (int offset,int data);
void phoenix_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
void phoenix_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
void phoenix_sound_control_a_w(int offset, int data);
void phoenix_sound_control_b_w(int offset, int data);
int phoenix_sh_start(void);
void phoenix_sh_update(void);
void pleiads_sound_control_a_w(int offset, int data);
void pleiads_sound_control_b_w(int offset, int data);
int pleiads_sh_start(void);
void pleiads_sh_update(void);
static struct MemoryReadAddress readmem[] =
{
{ 0x0000, 0x3fff, MRA_ROM },
{ 0x4000, 0x4fff, MRA_RAM }, /* video RAM */
{ 0x5000, 0x6fff, MRA_RAM },
{ 0x7000, 0x73ff, input_port_0_r }, /* IN0 */
{ 0x7400, 0x77ff, MRA_RAM },
{ 0x7800, 0x7bff, input_port_1_r }, /* DSW */
{ 0x7c00, 0x7fff, MRA_RAM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress writemem[] =
{
{ 0x0000, 0x3fff, MWA_ROM },
{ 0x4000, 0x43ff, MWA_RAM, &phoenix_videoram2 },
{ 0x4400, 0x47ff, MWA_RAM },
{ 0x4800, 0x4bff, videoram_w, &videoram, &videoram_size },
{ 0x4C00, 0x4fff, MWA_RAM },
{ 0x5000, 0x53ff, phoenix_videoreg_w },
{ 0x5400, 0x57ff, MWA_RAM },
{ 0x5800, 0x5bff, phoenix_scroll_w }, /* the game sometimes writes at mirror addresses */
{ 0x5C00, 0x5fff, MWA_RAM },
{ 0x6000, 0x63ff, phoenix_sound_control_a_w },
{ 0x6400, 0x67ff, MWA_RAM },
{ 0x6800, 0x6bff, phoenix_sound_control_b_w },
{ 0x6C00, 0x6fff, MWA_RAM },
{ 0x7400, 0x77ff, MWA_RAM },
{ 0x7C00, 0x7fff, MWA_RAM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress pl_writemem[] =
{
{ 0x0000, 0x3fff, MWA_ROM },
{ 0x4000, 0x43ff, MWA_RAM, &phoenix_videoram2 },
{ 0x4400, 0x47ff, MWA_RAM },
{ 0x4800, 0x4bff, videoram_w, &videoram, &videoram_size },
{ 0x4C00, 0x4fff, MWA_RAM },
{ 0x5000, 0x53ff, phoenix_videoreg_w },
{ 0x5400, 0x57ff, MWA_RAM },
{ 0x5800, 0x5bff, phoenix_scroll_w },
{ 0x5C00, 0x5fff, MWA_RAM },
{ 0x6000, 0x63ff, pleiads_sound_control_a_w },
{ 0x6400, 0x67ff, MWA_RAM },
{ 0x6800, 0x6bff, pleiads_sound_control_b_w },
{ 0x6C00, 0x6fff, MWA_RAM },
{ 0x7400, 0x77ff, MWA_RAM },
{ 0x7C00, 0x7fff, MWA_RAM },
{ -1 } /* end of table */
};
INPUT_PORTS_START( phoenix_input_ports )
PORT_START /* IN0 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_START /* DSW0 */
PORT_DIPNAME( 0x03, 0x00, "Lives", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x01, "4" )
PORT_DIPSETTING( 0x02, "5" )
PORT_DIPSETTING( 0x03, "6" )
PORT_DIPNAME( 0x0c, 0x00, "Bonus", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "3000" )
PORT_DIPSETTING( 0x04, "4000" )
PORT_DIPSETTING( 0x08, "5000" )
PORT_DIPSETTING( 0x0c, "6000" )
PORT_DIPNAME( 0x10, 0x00, "Coinage", IP_KEY_NONE )
PORT_DIPSETTING( 0x10, "2 Coins/1 Credit" )
PORT_DIPSETTING( 0x00, "1 Coin/1 Credit" )
PORT_DIPNAME( 0x20, 0x20, "DSW 6 Unknown", IP_KEY_NONE )
PORT_DIPSETTING( 0x20, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x40, 0x40, "DSW 7 Unknown", IP_KEY_NONE )
PORT_DIPSETTING( 0x40, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
INPUT_PORTS_END
INPUT_PORTS_START( phoenixt_input_ports )
PORT_START /* IN0 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_START /* DSW0 */
PORT_DIPNAME( 0x03, 0x00, "Lives", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x01, "4" )
PORT_DIPSETTING( 0x02, "5" )
PORT_DIPSETTING( 0x03, "6" )
PORT_DIPNAME( 0x0c, 0x00, "Bonus", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "3000" )
PORT_DIPSETTING( 0x04, "4000" )
PORT_DIPSETTING( 0x08, "5000" )
PORT_DIPSETTING( 0x0c, "6000" )
PORT_DIPNAME( 0x10, 0x10, "DSW 5 Unknown", IP_KEY_NONE )
PORT_DIPSETTING( 0x10, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x20, 0x20, "DSW 6 Unknown", IP_KEY_NONE )
PORT_DIPSETTING( 0x20, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x40, 0x40, "DSW 7 Unknown", IP_KEY_NONE )
PORT_DIPSETTING( 0x40, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
INPUT_PORTS_END
INPUT_PORTS_START( phoenix3_input_ports )
PORT_START /* IN0 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_START /* DSW0 */
PORT_DIPNAME( 0x03, 0x00, "Lives", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x01, "4" )
PORT_DIPSETTING( 0x02, "5" )
PORT_DIPSETTING( 0x03, "6" )
PORT_DIPNAME( 0x0c, 0x00, "Bonus", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "3000" )
PORT_DIPSETTING( 0x04, "4000" )
PORT_DIPSETTING( 0x08, "5000" )
PORT_DIPSETTING( 0x0c, "6000" )
PORT_DIPNAME( 0x10, 0x10, "DSW 5 Unknown", IP_KEY_NONE )
PORT_DIPSETTING( 0x10, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x20, 0x20, "DSW 6 Unknown", IP_KEY_NONE )
PORT_DIPSETTING( 0x20, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x40, 0x00, "Coinage", IP_KEY_NONE )
PORT_DIPSETTING( 0x40, "2 Coins/1 Credit" )
PORT_DIPSETTING( 0x00, "1 Coin/1 Credit" )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
INPUT_PORTS_END
INPUT_PORTS_START( pleiads_input_ports )
PORT_START /* IN0 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_START /* DSW0 */
PORT_DIPNAME( 0x03, 0x00, "Lives", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x01, "4" )
PORT_DIPSETTING( 0x02, "5" )
PORT_DIPSETTING( 0x03, "6" )
PORT_DIPNAME( 0x0c, 0x00, "Bonus", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "3000" )
PORT_DIPSETTING( 0x04, "4000" )
PORT_DIPSETTING( 0x08, "5000" )
PORT_DIPSETTING( 0x0c, "6000" )
PORT_DIPNAME( 0x10, 0x00, "Coinage", IP_KEY_NONE )
PORT_DIPSETTING( 0x10, "2 Coins/1 Credit" )
PORT_DIPSETTING( 0x00, "1 Coin/1 Credit" )
PORT_DIPNAME( 0x20, 0x20, "DSW 6 Unknown", IP_KEY_NONE )
PORT_DIPSETTING( 0x20, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x40, 0x40, "Free Play", IP_KEY_NONE )
PORT_DIPSETTING( 0x40, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
INPUT_PORTS_END
static struct GfxLayout charlayout =
{
8,8, /* 8*8 characters */
256, /* 256 characters */
2, /* 2 bits per pixel */
{ 256*8*8, 0 }, /* the two bitplanes are separated */
{ 7, 6, 5, 4, 3, 2, 1, 0 }, /* pretty straightforward layout */
{ 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 GfxDecodeInfo gfxdecodeinfo[] =
{
{ 1, 0x0000, &charlayout, 0, 16 },
{ 1, 0x1000, &charlayout, 16*4, 16 },
{ -1 } /* end of array */
};
static struct MachineDriver machine_driver =
{
/* basic machine hardware */
{
{
CPU_8080,
3072000, /* 3 Mhz ? */
0,
readmem,writemem,0,0,
ignore_interrupt,1
}
},
60, DEFAULT_REAL_60HZ_VBLANK_DURATION, /* frames per second, vblank duration */
1, /* single CPU, no need for interleaving */
0,
/* video hardware */
32*8, 32*8, { 0*8, 31*8-1, 0*8, 26*8-1 },
gfxdecodeinfo,
256,16*4+16*4,
phoenix_vh_convert_color_prom,
VIDEO_TYPE_RASTER,
0,
generic_vh_start,
generic_vh_stop,
phoenix_vh_screenrefresh,
/* sound hardware */
0,
phoenix_sh_start,
0,
phoenix_sh_update
};
static struct MachineDriver pleiads_machine_driver =
{
/* basic machine hardware */
{
{
CPU_8080,
3072000, /* 3 Mhz ? */
0,
readmem,pl_writemem,0,0,
ignore_interrupt,1
}
},
60, DEFAULT_REAL_60HZ_VBLANK_DURATION, /* frames per second, vblank duration */
1, /* single CPU, no need for interleaving */
0,
/* video hardware */
32*8, 32*8, { 0*8, 31*8-1, 0*8, 26*8-1 },
gfxdecodeinfo,
256,16*4+16*4,
phoenix_vh_convert_color_prom,
VIDEO_TYPE_RASTER,
0,
generic_vh_start,
generic_vh_stop,
phoenix_vh_screenrefresh,
/* sound hardware */
0,
pleiads_sh_start,
0,
pleiads_sh_update
};
static const char *phoenix_sample_names[] =
{
"*phoenix",
"shot8.sam",
"death8.sam",
"phoenix1.sam",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -