📄 brkthru.c
字号:
/***************************************************************************
Break Thru Doc. Data East (1986)
UNK-1.1 (16Kb) Code (4000-7FFF)
UNK-1.2 (32Kb) Main 6809 (8000-FFFF)
UNK-1.3 (32Kb) Mapped (2000-3FFF)
UNK-1.4 (32Kb) Mapped (2000-3FFF)
UNK-1.5 (32Kb) Sound 6809 (8000-FFFF)
Background has 4 banks, with 256 16x16x8 tiles in each bank.
UNK-1.6 (32Kb) GFX Background
UNK-1.7 (32Kb) GFX Background
UNK-1.8 (32Kb) GFX Background
Sprites ROMs haven't been dumped, but are probably the same format as the background.
UNK-1.9 (32Kb) GFX Sprites
UNK-1.10 (32Kb) GFX Sprites
UNK-1.11 (32Kb) GFX Sprites
Text has 256 8x8x4 characters.
UNK-1.12 (8Kb) GFX Text
**************************************************************************
Memory Map for Main CPU by Carlos A. Lozano
**************************************************************************
MAIN CPU
0000-03FF W Plane0
0400-0BFF R/W RAM
0C00-0FFF W Plane2(Background)
1000-10FF W Plane1(sprites)
1100-17FF R/W RAM
1800-180F R/W In/Out
1810-1FFF R/W RAM (unmapped?)
2000-3FFF R ROM Mapped(*)
4000-7FFF R ROM(UNK-1.1)
8000-FFFF R ROM(UNK-1.2)
Interrupts: Reset, NMI, IRQ
The test routine is at F000
Sound: YM2203 and YM3526 driven by 6809. Sound added by Bryan McPhail, 1/4/98.
***************************************************************************/
#include "driver.h"
#include "vidhrdw/generic.h"
#include "M6809/M6809.h"
unsigned char *brkthru_nmi_enable; /* needs to be tracked down */
extern unsigned char *brkthru_videoram;
extern int brkthru_videoram_size;
void brkthru_1800_w(int offset,int data);
int brkthru_vh_start(void);
void brkthru_vh_stop(void);
void brkthru_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
void brkthru_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
static int nmi_enable;
void brkthru_1803_w(int offset, int data)
{
/* bit 0 = NMI enable */
nmi_enable = ~data & 1;
/* bit 1 = ? maybe IRQ acknowledge */
}
void darwin_0803_w(int offset, int data)
{
/* bit 0 = NMI enable */
/*nmi_enable = ~data & 1;*/
nmi_enable = data;
/* bit 1 = ? maybe IRQ acknowledge */
}
void brkthru_soundlatch_w(int offset, int data)
{
soundlatch_w(offset,data);
cpu_cause_interrupt(1,M6809_INT_NMI);
}
static struct MemoryReadAddress readmem[] =
{
{ 0x0000, 0x03ff, MRA_RAM }, /* Plane 0: Text */
{ 0x0400, 0x0bff, MRA_RAM },
{ 0x0c00, 0x0fff, MRA_RAM }, /* Plane 2 Background */
{ 0x1000, 0x10ff, MRA_RAM }, /* Plane 1: Sprites */
{ 0x1100, 0x17ff, MRA_RAM },
{ 0x1800, 0x1800, input_port_0_r }, /* player controls, player start */
{ 0x1801, 0x1801, input_port_1_r }, /* cocktail player controls */
{ 0x1802, 0x1802, input_port_3_r }, /* DSW 0 */
{ 0x1803, 0x1803, input_port_2_r }, /* coin input & DSW */
{ 0x2000, 0x3fff, MRA_BANK1 },
{ 0x4000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress writemem[] =
{
{ 0x0000, 0x03ff, MWA_RAM, &brkthru_videoram, (int *)&brkthru_videoram_size },
{ 0x0400, 0x0bff, MWA_RAM },
{ 0x0c00, 0x0fff, videoram_w, &videoram, &videoram_size },
{ 0x1000, 0x10ff, MWA_RAM, &spriteram, &spriteram_size },
{ 0x1100, 0x17ff, MWA_RAM },
{ 0x1800, 0x1801, brkthru_1800_w }, /* bg scroll and color, ROM bank selection, flip screen */
{ 0x1802, 0x1802, brkthru_soundlatch_w },
{ 0x1803, 0x1803, brkthru_1803_w }, /* NMI enable, + ? */
{ 0x2000, 0xffff, MWA_ROM },
{ -1 } /* end of table */
};
static struct MemoryReadAddress darwin_readmem[] =
{
{ 0x1000, 0x13ff, MRA_RAM }, /* Plane 0: Text */
{ 0x0400, 0x07ff, MRA_RAM },
{ 0x1c00, 0x1fff, MRA_RAM }, /* Plane 2 Background */
{ 0x0000, 0x00ff, MRA_RAM }, /* Plane 1: Sprites */
{ 0x1400, 0x1bff, MRA_RAM },
{ 0x0800, 0x0800, input_port_0_r }, /* player controls, player start */
{ 0x0801, 0x0801, input_port_1_r }, /* cocktail player controls */
{ 0x0802, 0x0802, input_port_3_r }, /* DSW 0 */
{ 0x0803, 0x0803, input_port_2_r }, /* coin input & DSW */
{ 0x2000, 0x3fff, MRA_BANK1 },
{ 0x4000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress darwin_writemem[] =
{
{ 0x1000, 0x13ff, MWA_RAM, &brkthru_videoram, &brkthru_videoram_size },
{ 0x1c00, 0x1fff, videoram_w, &videoram, &videoram_size },
{ 0x0000, 0x00ff, MWA_RAM, &spriteram, &spriteram_size },
{ 0x1400, 0x1bff, MWA_RAM },
{ 0x0100, 0x01ff, MWA_NOP }, /*tidyup, nothing realy here?*/
{ 0x0800, 0x0801, brkthru_1800_w }, /* bg scroll and color, ROM bank selection, flip screen */
{ 0x0802, 0x0802, brkthru_soundlatch_w },
{ 0x0803, 0x0803, darwin_0803_w }, /* NMI enable, + ? */
{ 0x2000, 0xffff, MWA_ROM },
{ -1 } /* end of table */
};
static struct MemoryReadAddress sound_readmem[] =
{
{ 0x0000, 0x1fff, MRA_RAM },
{ 0x4000, 0x4000, soundlatch_r },
{ 0x6000, 0x6000, YM2203_status_port_0_r },
{ 0x8000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress sound_writemem[] =
{
{ 0x0000, 0x1fff, MWA_RAM },
{ 0x2000, 0x2000, YM3526_control_port_0_w },
{ 0x2001, 0x2001, YM3526_write_port_0_w },
{ 0x6000, 0x6000, YM2203_control_port_0_w },
{ 0x6001, 0x6001, YM2203_write_port_0_w },
{ 0x8000, 0xffff, MWA_ROM },
{ -1 } /* end of table */
};
int brkthru_interrupt(void)
{
if (cpu_getiloops() == 0)
{
if (nmi_enable) return nmi_interrupt();
}
else
{
/* generate IRQ on coin insertion */
if ((readinputport(2) & 0xe0) != 0xe0) return interrupt();
}
return ignore_interrupt();
}
INPUT_PORTS_START( input_ports )
PORT_START /* IN0 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START /* IN1 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) /* used only by the self test */
PORT_START /* IN2 */
PORT_DIPNAME( 0x03, 0x03, "Lives", IP_KEY_NONE )
PORT_DIPSETTING( 0x02, "2" )
PORT_DIPSETTING( 0x03, "3" )
PORT_DIPSETTING( 0x01, "5" )
PORT_BITX(0, 0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "99", IP_KEY_NONE, IP_JOY_NONE, 0)
PORT_DIPNAME( 0x04, 0x04, "Unknown 1", IP_KEY_NONE )
PORT_DIPSETTING( 0x04, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x08, 0x08, "Unknown 2", IP_KEY_NONE )
PORT_DIPSETTING( 0x08, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x10, 0x10, "Allow Continue", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "No" )
PORT_DIPSETTING( 0x10, "Yes" )
PORT_BITX(0x20, IP_ACTIVE_LOW, IPT_COIN1 | IPF_IMPULSE, "Coin A", IP_KEY_DEFAULT, IP_JOY_DEFAULT, 2)
PORT_BITX(0x40, IP_ACTIVE_LOW, IPT_COIN2 | IPF_IMPULSE, "Coin B", IP_KEY_DEFAULT, IP_JOY_DEFAULT, 2)
PORT_BITX(0x80, IP_ACTIVE_LOW, IPT_COIN3 | IPF_IMPULSE, "Coin C", IP_KEY_DEFAULT, IP_JOY_DEFAULT, 2)
PORT_START /* DSW0 */
PORT_DIPNAME( 0x03, 0x03, "Coin A", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "2 Coins/1 Credit" )
PORT_DIPSETTING( 0x03, "1 Coin/1 Credit" )
PORT_DIPSETTING( 0x02, "1 Coin/2 Credits" )
PORT_DIPSETTING( 0x01, "1 Coin/3 Credits" )
PORT_DIPNAME( 0x0c, 0x0c, "Coin B", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "2 Coins/1 Credit" )
PORT_DIPSETTING( 0x0c, "1 Coin/1 Credit" )
PORT_DIPSETTING( 0x08, "1 Coin/2 Credits" )
PORT_DIPSETTING( 0x04, "1 Coin/3 Credits" )
PORT_DIPNAME( 0x10, 0x10, "Unknown 4", IP_KEY_NONE )
PORT_DIPSETTING( 0x10, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x20, 0x20, "Unknown 5", IP_KEY_NONE )
PORT_DIPSETTING( 0x20, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x40, 0x00, "Cabinet", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "Upright" )
PORT_DIPSETTING( 0x40, "Cocktail" )
PORT_DIPNAME( 0x80, 0x80, "Unknown 6", IP_KEY_NONE )
PORT_DIPSETTING( 0x80, "Off" )
PORT_DIPSETTING( 0x00, "On" )
INPUT_PORTS_END
INPUT_PORTS_START( darwin_input_ports )
PORT_START /* IN0 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START /* IN1 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) /* used only by the self test */
PORT_START /* IN2 */
PORT_DIPNAME( 0x01, 0x01, "Lives", IP_KEY_NONE )
PORT_DIPSETTING( 0x01, "3" )
PORT_DIPSETTING( 0x00, "5" )
PORT_DIPNAME( 0x02, 0x02, "Unknown 0", IP_KEY_NONE )
PORT_DIPSETTING( 0x02, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x04, 0x04, "Unknown 1", IP_KEY_NONE )
PORT_DIPSETTING( 0x04, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x08, 0x08, "Unknown 2", IP_KEY_NONE )
PORT_DIPSETTING( 0x08, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x10, 0x10, "Unknown 3", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "Off" )
PORT_DIPSETTING( 0x10, "On" )
PORT_BITX(0x20, IP_ACTIVE_LOW, IPT_COIN1 | IPF_IMPULSE, "Coin A", IP_KEY_DEFAULT, IP_JOY_DEFAULT, 2)
PORT_BITX(0x40, IP_ACTIVE_LOW, IPT_COIN2 | IPF_IMPULSE, "Coin B", IP_KEY_DEFAULT, IP_JOY_DEFAULT, 2)
PORT_BITX(0x80, IP_ACTIVE_LOW, IPT_COIN3 | IPF_IMPULSE, "Coin C", IP_KEY_DEFAULT, IP_JOY_DEFAULT, 2)
PORT_START /* DSW0 */
PORT_DIPNAME( 0x03, 0x03, "Coin A", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "2 Coins/1 Credit" )
PORT_DIPSETTING( 0x03, "1 Coin/1 Credit" )
PORT_DIPSETTING( 0x02, "1 Coin/2 Credits" )
PORT_DIPSETTING( 0x01, "1 Coin/3 Credits" )
PORT_DIPNAME( 0x0c, 0x0c, "Coin B", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "2 Coins/1 Credit" )
PORT_DIPSETTING( 0x0c, "1 Coin/1 Credit" )
PORT_DIPSETTING( 0x08, "1 Coin/2 Credits" )
PORT_DIPSETTING( 0x04, "1 Coin/3 Credits" )
PORT_DIPNAME( 0x10, 0x10, "Unknown 4", IP_KEY_NONE )
PORT_DIPSETTING( 0x10, "Off" )
PORT_DIPSETTING( 0x00, "On" )
PORT_DIPNAME( 0x20, 0x00, "Cabinet", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "Upright" )
PORT_DIPSETTING( 0x20, "Cocktail" )
PORT_DIPNAME( 0x40, 0x40, "Demo Sounds", IP_KEY_NONE )
PORT_DIPSETTING( 0x00, "Off" )
PORT_DIPSETTING( 0x40, "On" )
PORT_DIPNAME( 0x80, 0x80, "Unknown 6", IP_KEY_NONE )
PORT_DIPSETTING( 0x80, "Off" )
PORT_DIPSETTING( 0x00, "On" )
INPUT_PORTS_END
static struct GfxLayout charlayout =
{
8,8, /* 8*8 chars */
256, /* 256 characters */
3, /* 3 bits per pixel */
{ 512*8*8+4, 0, 4 }, /* plane offset */
{ 256*8*8+0, 256*8*8+1, 256*8*8+2, 256*8*8+3, 0, 1, 2, 3 },
{ 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 tilelayout1 =
{
16,16, /* 16*16 tiles */
128, /* 128 tiles */
3, /* 3 bits per pixel */
{ 0x4000*8+4, 0, 4 }, /* plane offset */
{ 0, 1, 2, 3, 1024*8*8+0, 1024*8*8+1, 1024*8*8+2, 1024*8*8+3,
16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+1024*8*8+0, 16*8+1024*8*8+1, 16*8+1024*8*8+2, 16*8+1024*8*8+3 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
32*8 /* every tile takes 32 consecutive bytes */
};
static struct GfxLayout tilelayout2 =
{
16,16, /* 16*16 tiles */
128, /* 128 tiles */
3, /* 3 bits per pixel */
{ 0x3000*8+0, 0, 4 }, /* plane offset */
{ 0, 1, 2, 3, 1024*8*8+0, 1024*8*8+1, 1024*8*8+2, 1024*8*8+3,
16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+1024*8*8+0, 16*8+1024*8*8+1, 16*8+1024*8*8+2, 16*8+1024*8*8+3 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
32*8 /* every tile takes 32 consecutive bytes */
};
static struct GfxLayout spritelayout =
{
16,16, /* 16*16 sprites */
1024, /* 1024 sprites */
3, /* 3 bits per pixel */
{ 2*1024*32*8, 1024*32*8, 0 }, /* plane offset */
{ 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7,
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, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
32*8 /* every sprite takes 32 consecutive bytes */
};
static struct GfxDecodeInfo gfxdecodeinfo[] =
{
{ 1, 0x00000, &charlayout, 0, 1 },
{ 1, 0x02000, &tilelayout1, 8+8*8, 16 },
{ 1, 0x03000, &tilelayout2, 8+8*8, 16 },
{ 1, 0x0a000, &tilelayout1, 8+8*8, 16 },
{ 1, 0x0b000, &tilelayout2, 8+8*8, 16 },
{ 1, 0x12000, &tilelayout1, 8+8*8, 16 },
{ 1, 0x13000, &tilelayout2, 8+8*8, 16 },
{ 1, 0x1a000, &tilelayout1, 8+8*8, 16 },
{ 1, 0x1b000, &tilelayout2, 8+8*8, 16 },
{ 1, 0x22000, &spritelayout, 8, 8 },
{ -1 } /* end of array */
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -