📄 thepit.c
字号:
/***************************************************************************
The Pit/Round Up/Intrepid/Super Mouse memory map (preliminary)
Main CPU:
0000-4fff ROM
8000-87ff RAM
8800-8bff Color RAM (Not used in Intrepid/Super Mouse)
8c00-8fff Mirror for above (Not used in Intrepid/Super Mouse)
9000-93ff Video RAM
9400-97ff Mirror for above (Color RAM in Intrepid/Super Mouse)
9800-983f Attributes RAM
9840-985f Sprite RAM
Read:
a000 Input Port 0
a800 Input Port 1
b000 DIP Switches
b800 Watchdog Reset
Write:
b000 NMI Enable
b002 Coin Lockout
b003 Sound Enable
b005 Intrepid graphics bank select
b006 Flip Screen X
b007 Flip Screen Y
b800 Sound Command
Sound CPU:
0000-0fff ROM (0000-07ff in The Pit)
3800-3bff RAM
Port I/O Read:
8f AY8910 Read Port
Port I/O Write:
00 Reset Sound Command
8c AY8910 #2 Control Port (Intrepid/Super Mouse only)
8d AY8910 #2 Write Port (Intrepid/Super Mouse only)
8e AY8910 #1 Control Port
8f AY8910 #1 Write Port
***************************************************************************/
#include "driver.h"
#include "vidhrdw/generic.h"
extern unsigned char *galaxian_attributesram;
extern unsigned char *intrepid_sprite_bank_select;
void galaxian_attributes_w(int offset,int data);
void thepit_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
void thepit_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
void thepit_flipx_w(int offset,int data);
void thepit_flipy_w(int offset,int data);
int thepit_input_port_0_r(int offset);
void thepit_sound_enable_w(int offset, int data);
void thepit_AY8910_0_w(int offset, int data);
void thepit_AY8910_1_w(int offset, int data);
void intrepid_graphics_bank_select_w(int offset, int data);
static struct MemoryReadAddress thepit_readmem[] =
{
{ 0x0000, 0x4fff, MRA_ROM },
{ 0x8000, 0x87ff, MRA_RAM },
{ 0x8800, 0x93ff, MRA_RAM },
{ 0x9400, 0x97ff, videoram_r },
{ 0x9800, 0x98ff, MRA_RAM },
{ 0xa000, 0xa000, thepit_input_port_0_r },
{ 0xa800, 0xa800, input_port_1_r },
{ 0xb000, 0xb000, input_port_2_r },
{ 0xb800, 0xb800, watchdog_reset_r },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress thepit_writemem[] =
{
{ 0x8000, 0x87ff, MWA_RAM },
{ 0x8800, 0x8bff, colorram_w, &colorram },
{ 0x8c00, 0x8fff, colorram_w },
{ 0x9000, 0x93ff, videoram_w, &videoram, &videoram_size },
{ 0x9400, 0x97ff, videoram_w },
{ 0x9800, 0x983f, galaxian_attributes_w, &galaxian_attributesram },
{ 0x9840, 0x985f, MWA_RAM, &spriteram, &spriteram_size },
{ 0x9860, 0x98ff, MWA_RAM },
{ 0xa000, 0xa000, MWA_NOP },
{ 0xb000, 0xb000, interrupt_enable_w },
{ 0xb001, 0xb001, MWA_NOP },
{ 0xb002, 0xb002, MWA_NOP },
{ 0xb003, 0xb003, thepit_sound_enable_w },
{ 0xb004, 0xb005, MWA_NOP },
{ 0xb006, 0xb006, thepit_flipx_w, &flip_screen_x },
{ 0xb007, 0xb007, thepit_flipy_w, &flip_screen_y },
{ 0xb800, 0xb800, soundlatch_w },
{ -1 } /* end of table */
};
static struct MemoryReadAddress intrepid_readmem[] =
{
{ 0x0000, 0x4fff, MRA_ROM },
{ 0x8000, 0x87ff, MRA_RAM },
{ 0x9000, 0x98ff, MRA_RAM },
{ 0xa000, 0xa000, thepit_input_port_0_r },
{ 0xa800, 0xa800, input_port_1_r },
{ 0xb000, 0xb000, input_port_2_r },
{ 0xb800, 0xb800, watchdog_reset_r },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress intrepid_writemem[] =
{
{ 0x8000, 0x87ff, MWA_RAM },
{ 0x9000, 0x93ff, videoram_w, &videoram, &videoram_size },
{ 0x9400, 0x97ff, colorram_w, &colorram },
{ 0x9800, 0x983f, galaxian_attributes_w, &galaxian_attributesram },
{ 0x9840, 0x985f, MWA_RAM, &spriteram, &spriteram_size },
{ 0x9860, 0x98ff, MWA_RAM },
{ 0xb000, 0xb000, interrupt_enable_w },
{ 0xb001, 0xb001, MWA_NOP },
{ 0xb002, 0xb002, MWA_NOP },
{ 0xb003, 0xb003, thepit_sound_enable_w },
{ 0xb004, 0xb004, MWA_NOP },
{ 0xb005, 0xb005, intrepid_graphics_bank_select_w },
{ 0xb006, 0xb006, thepit_flipx_w, &flip_screen_x },
{ 0xb007, 0xb007, thepit_flipy_w, &flip_screen_y },
{ 0xb800, 0xb800, soundlatch_w },
{ -1 } /* end of table */
};
static struct MemoryReadAddress sound_readmem[] =
{
{ 0x0000, 0x0fff, MRA_ROM },
{ 0x3800, 0x3bff, MRA_RAM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress sound_writemem[] =
{
{ 0x3800, 0x3bff, MWA_RAM },
{ -1 } /* end of table */
};
static struct IOReadPort sound_readport[] =
{
{ 0x8f, 0x8f, AY8910_read_port_0_r },
{ -1 } /* end of table */
};
static struct IOWritePort sound_writeport[] =
{
{ 0x00, 0x00, soundlatch_clear_w },
{ 0x8c, 0x8d, thepit_AY8910_1_w },
{ 0x8e, 0x8f, thepit_AY8910_0_w },
{ -1 } /* end of table */
};
INPUT_PORTS_START( thepit_input_ports )
PORT_START /* IN0 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START /* IN1 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START /* DSW0 */
PORT_DIPNAME( 0x03, 0x00, "Coinage P1/P2", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "1Cr/2Cr" )
PORT_DIPSETTING( 0x01, "2Cr/3Cr" )
PORT_DIPSETTING( 0x02, "2Cr/4Cr" )
PORT_DIPSETTING( 0x03, "Free Play" )
PORT_DIPNAME( 0x04, 0x00, "Game Speed", IP_KEY_NONE )
PORT_DIPSETTING( 0x04, "Slow" )
PORT_DIPSETTING( 0x00, "Fast" )
PORT_DIPNAME( 0x08, 0x00, "Time Limit", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "Long" )
PORT_DIPSETTING( 0x08, "Short" )
PORT_DIPNAME( 0x10, 0x00, "Flip Screen", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "Off" )
PORT_DIPSETTING( 0x10, "On" )
PORT_DIPNAME( 0x20, 0x00, "Cabinet", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "Upright" )
PORT_DIPSETTING( 0x20, "Cocktail" )
PORT_DIPNAME( 0x40, 0x00, "Lives", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x40, "4" )
PORT_DIPNAME( 0x80, 0x00, "Unknown", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "Off" )
PORT_DIPSETTING( 0x80, "On" )
/* Since the real inputs are multiplexed, we used this fake port
to read the 2nd player controls when the screen is flipped */
PORT_START /* IN2 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
INPUT_PORTS_END
INPUT_PORTS_START( roundup_input_ports )
PORT_START /* IN1 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START /* IN2 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START /* DSW0 */
PORT_DIPNAME( 0x03, 0x01, "Coinage", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "2 Coins/1 Credit" )
PORT_DIPSETTING( 0x01, "1 Coin/1 Credit" )
PORT_DIPSETTING( 0x02, "1 Coin/2 Credits" )
PORT_DIPSETTING( 0x03, "1 Coin/3 Credits" )
PORT_DIPNAME( 0x0c, 0x04, "Lives", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x04, "3" )
PORT_DIPSETTING( 0x08, "4" )
PORT_DIPSETTING( 0x0c, "5" )
PORT_DIPNAME( 0x10, 0x10, "Cabinet", IP_KEY_NONE )
PORT_DIPSETTING( 0x10, "Upright" )
PORT_DIPSETTING( 0x00, "Cocktail" )
PORT_DIPNAME( 0x20, 0x00, "Bonus Life At", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "10,000" )
PORT_DIPSETTING( 0x20, "30,000" )
PORT_DIPNAME( 0x40, 0x40, "Gly Boys Wake Up", IP_KEY_NONE )
PORT_DIPSETTING( 0x40, "Slow" )
PORT_DIPSETTING( 0x00, "Fast" )
PORT_BITX( 0x80, 0x00, IPT_DIPSWITCH_NAME | IPF_TOGGLE, "Service Mode", OSD_KEY_F2, IP_JOY_NONE, 0 )
PORT_DIPSETTING( 0x00, "Off" )
PORT_DIPSETTING( 0x80, "On" )
/* Since the real inputs are multiplexed, we used this fake port
to read the 2nd player controls when the screen is flipped */
PORT_START /* IN2 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
INPUT_PORTS_END
INPUT_PORTS_START( intrepid_input_ports )
PORT_START /* IN1 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Starts a timer, which, */
/* after it runs down, doesn't */
PORT_START /* IN2 */ /* seem to do anything. See $0105 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START /* DSW0 */
PORT_BITX( 0x01, 0x01, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE, 0 )
PORT_DIPSETTING( 0x01, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x02, 0x00, "Demo Sounds", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "Off" )
PORT_DIPSETTING( 0x02, "On" )
PORT_DIPNAME( 0x04, 0x04, "Cabinet", IP_KEY_NONE )
PORT_DIPSETTING( 0x04, "Upright" )
PORT_DIPSETTING( 0x00, "Cocktail" )
PORT_DIPNAME( 0x08, 0x08, "Difficulty", IP_KEY_NONE )
PORT_DIPSETTING( 0x08, "Easy" )
PORT_DIPSETTING( 0x00, "Hard" )
PORT_DIPNAME( 0x10, 0x00, "Bonus Life", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "10,000" )
PORT_DIPSETTING( 0x10, "30,000" )
PORT_DIPNAME( 0x20, 0x00, "Lives", IP_KEY_NONE )
PORT_DIPSETTING( 0x20, "3" )
PORT_DIPSETTING( 0x00, "5" )
PORT_DIPNAME( 0xc0, 0x40, "Coinage", IP_KEY_NONE )
PORT_DIPSETTING( 0x80, "2 Coins/1 Credit" )
PORT_DIPSETTING( 0x40, "1 Coin/1 Credit" )
PORT_DIPSETTING( 0xc0, "1 Coin/2 Credits" )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -