コード例 #1
0
ファイル: tumblep.c プロジェクト: AltimorTASDK/shmupmametgm
/******************************************************************************/

static const gfx_layout tile_8x8_layout =
{
	8,8,
	RGN_FRAC(1,2),
	4,
	{ RGN_FRAC(1,2)+8,RGN_FRAC(1,2)+0,RGN_FRAC(0,2)+8,RGN_FRAC(0,2)+0 },
	{ 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
};

static const gfx_layout tile_16x16_layout =
{
	16,16,
	RGN_FRAC(1,2),
	4,
	{ RGN_FRAC(1,2)+8,RGN_FRAC(1,2)+0,RGN_FRAC(0,2)+8,RGN_FRAC(0,2)+0 },
	{ 256,257,258,259,260,261,262,263,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 },
	32*16
};

static const gfx_layout spritelayout =
{
	16,16,
	RGN_FRAC(1,1),
	4,
	{ 24,8,16,0 },
	{ 512,513,514,515,516,517,518,519, 0, 1, 2, 3, 4, 5, 6, 7 },
	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
	  8*32, 9*32,10*32,11*32,12*32,13*32,14*32,15*32},
	32*32
};

static GFXDECODE_START( tumblep )
	GFXDECODE_ENTRY( "gfx1", 0, tile_8x8_layout,     0x100, 32 )	/* Tiles (8x8) */
	GFXDECODE_ENTRY( "gfx1", 0, tile_16x16_layout,   0x100, 32 )	/* Tiles (16x16) */
	GFXDECODE_ENTRY( "gfx2", 0, spritelayout,        0, 16 )	/* Sprites (16x16) */
GFXDECODE_END

/***************************************************************************/

static void sound_irq(running_device *device, int state)
{
	tumblep_state *driver_state = (tumblep_state *)device->machine->driver_data;
	cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
コード例 #2
0
static WRITE8_HANDLER( beast_data_w )
{
	djboy_state *state = space->machine->driver_data<djboy_state>();

	state->data_to_beast = data;
	state->z80_to_beast_full = 1;
	state->beast_int0_l = 0;
	cpu_set_input_line(state->beast, INPUT_LINE_IRQ0, ASSERT_LINE);
}
コード例 #3
0
ファイル: mcatadv.c プロジェクト: DarrenBranford/MAME4iOS
GFXDECODE_END


/* Stolen from Psikyo.c */
static void sound_irq( running_device *device, int irq )
{
	mcatadv_state *state = device->machine->driver_data<mcatadv_state>();
	cpu_set_input_line(state->soundcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
コード例 #4
0
static TIMER_CALLBACK( nmi_callback )
{
	bublbobl_state *state = machine->driver_data<bublbobl_state>();

	if (state->sound_nmi_enable)
		cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
	else
		state->pending_nmi = 1;
}
コード例 #5
0
ファイル: jackal.c プロジェクト: DarrenBranford/MAME4iOS
GFXDECODE_END

/*************************************
 *
 *  Interrupt generator
 *
 *************************************/

static INTERRUPT_GEN( jackal_interrupt )
{
	jackal_state *state = device->machine->driver_data<jackal_state>();

	if (state->irq_enable)
	{
		cpu_set_input_line(device, 0, HOLD_LINE);
		cpu_set_input_line(state->slavecpu, INPUT_LINE_NMI, PULSE_LINE);
	}
}
コード例 #6
0
ファイル: f1gp.c プロジェクト: AltimorTASDK/shmupmametgm
GFXDECODE_END



static void irqhandler( running_device *device, int irq )
{
	f1gp_state *state = (f1gp_state *)device->machine->driver_data;
	cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
コード例 #7
0
static WRITE16_HANDLER( sound_command_w )
{
	deniam_state *state = space->machine->driver_data<deniam_state>();
	if (ACCESSING_BITS_8_15)
	{
		soundlatch_w(space,offset, (data >> 8) & 0xff);
		cpu_set_input_line(state->audio_cpu, INPUT_LINE_NMI, PULSE_LINE);
	}
}
コード例 #8
0
GFXDECODE_END



static void irqhandler( device_t *device, int irq )
{
	tail2nos_state *state = device->machine->driver_data<tail2nos_state>();
	cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
コード例 #9
0
ファイル: lgp.c プロジェクト: AltimorTASDK/shmupmametgm
static INTERRUPT_GEN( vblank_callback_lgp )
{
	// NMI
	//cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);

	// IRQ
	cpu_set_input_line(device, 0, ASSERT_LINE);
	timer_set(device->machine, ATTOTIME_IN_USEC(50), NULL, 0, irq_stop);
}
コード例 #10
0
static WRITE8_HANDLER( mermaid_data_w )
{
	hvyunit_state *state = space->machine->driver_data<hvyunit_state>();

	state->data_to_mermaid = data;
	state->z80_to_mermaid_full = 1;
	state->mermaid_int0_l = 0;
	cpu_set_input_line(state->mermaid, INPUT_LINE_IRQ0, ASSERT_LINE);
}
コード例 #11
0
ファイル: gotcha.c プロジェクト: AltimorTASDK/shmupmametgm
GFXDECODE_END



static void irqhandler( running_device *device, int linestate )
{
	gotcha_state *state = (gotcha_state *)device->machine->driver_data;
	cpu_set_input_line(state->audiocpu, 0, linestate);
}
コード例 #12
0
ファイル: actfancr.c プロジェクト: AltimorTASDK/shmupmametgm
GFXDECODE_END

/******************************************************************************/

static void sound_irq(running_device *device, int linestate)
{
	actfancr_state *state = (actfancr_state *)device->machine->driver_data;
	cpu_set_input_line(state->audiocpu, 0, linestate); /* IRQ */
}
コード例 #13
0
ファイル: goal92.c プロジェクト: hstampfl/mame2010-libretro
static WRITE16_HANDLER( goal92_sound_command_w )
{
	goal92_state *state = (goal92_state *)space->machine->driver_data;
	if (ACCESSING_BITS_8_15)
	{
		soundlatch_w(space, 0, (data >> 8) & 0xff);
		cpu_set_input_line(state->audiocpu, 0, HOLD_LINE);
	}
}
コード例 #14
0
ファイル: ninjaw.c プロジェクト: hstampfl/mame2010-libretro
static void parse_control( running_machine *machine )	/* assumes Z80 sandwiched between 68Ks */
{
	/* bit 0 enables cpu B */
	/* however this fails when recovering from a save state
       if cpu B is disabled !! */
	ninjaw_state *state = (ninjaw_state *)machine->driver_data;
	cpu_set_input_line(state->subcpu, INPUT_LINE_RESET, (state->cpua_ctrl & 0x1) ? CLEAR_LINE : ASSERT_LINE);

}
コード例 #15
0
static WRITE16_HANDLER( sound_command_w )
{
	suprslam_state *state = space->machine->driver_data<suprslam_state>();
	if (ACCESSING_BITS_0_7)
	{
		state->pending_command = 1;
		soundlatch_w(space, offset, data & 0xff);
		cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
	}
}
コード例 #16
0
ファイル: blktiger.c プロジェクト: AltimorTASDK/shmupmametgm
/**************************************************

Protection comms between main cpu and i8751

**************************************************/

static READ8_HANDLER( blktiger_from_mcu_r )
{
	blktiger_state *state = (blktiger_state *)space->machine->driver_data;
	return state->i8751_latch;
}

static WRITE8_HANDLER( blktiger_to_mcu_w )
{
	blktiger_state *state = (blktiger_state *)space->machine->driver_data;
	cpu_set_input_line(state->mcu, MCS51_INT1_LINE, ASSERT_LINE);
	state->z80_latch = data;
}

static READ8_HANDLER( blktiger_from_main_r )
{
	blktiger_state *state = (blktiger_state *)space->machine->driver_data;
	cpu_set_input_line(state->mcu, MCS51_INT1_LINE, CLEAR_LINE);
	//printf("%02x read\n",latch);
	return state->z80_latch;
}

static WRITE8_HANDLER( blktiger_to_main_w )
{
	blktiger_state *state = (blktiger_state *)space->machine->driver_data;
	//printf("%02x write\n",data);
	state->i8751_latch = data;
}



static WRITE8_HANDLER( blktiger_bankswitch_w )
{
	memory_set_bank(space->machine, "bank1", data & 0x0f);
}

static WRITE8_HANDLER( blktiger_coinlockout_w )
{
	if (input_port_read(space->machine, "COIN_LOCKOUT") & 0x01)
	{
		coin_lockout_w(space->machine, 0,~data & 0x01);
		coin_lockout_w(space->machine, 1,~data & 0x02);
	}
}


static ADDRESS_MAP_START( blktiger_map, ADDRESS_SPACE_PROGRAM, 8 )
	AM_RANGE(0x0000, 0x7fff) AM_ROM
	AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
	AM_RANGE(0xc000, 0xcfff) AM_READWRITE(blktiger_bgvideoram_r, blktiger_bgvideoram_w)
	AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(blktiger_txvideoram_w) AM_BASE_MEMBER(blktiger_state, txvideoram)
	AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split1_w) AM_BASE_GENERIC(paletteram)
	AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split2_w) AM_BASE_GENERIC(paletteram2)
	AM_RANGE(0xe000, 0xfdff) AM_RAM
	AM_RANGE(0xfe00, 0xffff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
ADDRESS_MAP_END

static ADDRESS_MAP_START( blktiger_io_map, ADDRESS_SPACE_IO, 8 )
	ADDRESS_MAP_GLOBAL_MASK(0xff)
	AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")	AM_WRITE(soundlatch_w)
	AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")	AM_WRITE(blktiger_bankswitch_w)
	AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2")
	AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW0")	AM_WRITE(blktiger_coinlockout_w)
	AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1")	AM_WRITE(blktiger_video_control_w)
	AM_RANGE(0x05, 0x05) AM_READ_PORT("FREEZE")
	AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
	AM_RANGE(0x07, 0x07) AM_READWRITE(blktiger_from_mcu_r,blktiger_to_mcu_w)	 /* Software protection (7) */
	AM_RANGE(0x08, 0x09) AM_WRITE(blktiger_scrollx_w)
	AM_RANGE(0x0a, 0x0b) AM_WRITE(blktiger_scrolly_w)
	AM_RANGE(0x0c, 0x0c) AM_WRITE(blktiger_video_enable_w)
	AM_RANGE(0x0d, 0x0d) AM_WRITE(blktiger_bgvideoram_bank_w)
	AM_RANGE(0x0e, 0x0e) AM_WRITE(blktiger_screen_layout_w)
ADDRESS_MAP_END

static ADDRESS_MAP_START( blktigerbl_io_map, ADDRESS_SPACE_IO, 8 )
	ADDRESS_MAP_GLOBAL_MASK(0xff)
	AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")	AM_WRITE(soundlatch_w)
	AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")	AM_WRITE(blktiger_bankswitch_w)
	AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2")
	AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW0")	AM_WRITE(blktiger_coinlockout_w)
	AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1")	AM_WRITE(blktiger_video_control_w)
	AM_RANGE(0x05, 0x05) AM_READ_PORT("FREEZE")
	AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
	AM_RANGE(0x07, 0x07) AM_NOP	 /* Software protection (7) */
	AM_RANGE(0x08, 0x09) AM_WRITE(blktiger_scrollx_w)
	AM_RANGE(0x0a, 0x0b) AM_WRITE(blktiger_scrolly_w)
	AM_RANGE(0x0c, 0x0c) AM_WRITE(blktiger_video_enable_w)
	AM_RANGE(0x0d, 0x0d) AM_WRITE(blktiger_bgvideoram_bank_w)
	AM_RANGE(0x0e, 0x0e) AM_WRITE(blktiger_screen_layout_w)
ADDRESS_MAP_END

static ADDRESS_MAP_START( blktiger_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
	AM_RANGE(0x0000, 0x7fff) AM_ROM
	AM_RANGE(0xc000, 0xc7ff) AM_RAM
	AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_r)
	AM_RANGE(0xe000, 0xe001) AM_DEVREADWRITE("ym1", ym2203_r, ym2203_w)
	AM_RANGE(0xe002, 0xe003) AM_DEVREADWRITE("ym2", ym2203_r, ym2203_w)
ADDRESS_MAP_END

static ADDRESS_MAP_START( blktiger_mcu_map, ADDRESS_SPACE_PROGRAM, 8 )
	AM_RANGE(0x0000, 0x0fff) AM_ROM
ADDRESS_MAP_END

static ADDRESS_MAP_START( blktiger_mcu_io_map, ADDRESS_SPACE_IO, 8 )
	AM_RANGE(MCS51_PORT_P0,MCS51_PORT_P0) AM_READWRITE(blktiger_from_main_r,blktiger_to_main_w)
	AM_RANGE(MCS51_PORT_P1,MCS51_PORT_P3) AM_WRITENOP	/* other ports unknown */
ADDRESS_MAP_END



static INPUT_PORTS_START( blktiger )
	PORT_START("IN0")
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* probably unused */
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* probably unused */
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* probably unused */
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )

	PORT_START("IN1")
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_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 )	/* probably unused */
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* probably unused */

	PORT_START("IN2")
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* probably unused */
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* probably unused */

	PORT_START("DSW0")
	PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )		PORT_DIPLOCATION( "SW1:1,2,3" )
	PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
	PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
	PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
	PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
	PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
	PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
	PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
	PORT_DIPSETTING(    0x03, DEF_STR( 1C_5C ) )
	PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )		PORT_DIPLOCATION( "SW1:4,5,6" )
	PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
	PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
	PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
	PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
	PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
	PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
	PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
	PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C ) )
	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )	PORT_DIPLOCATION( "SW1:7" )
	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Test ) )			PORT_DIPLOCATION( "SW1:8" )
	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )

	PORT_START("DSW1")
	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )		PORT_DIPLOCATION( "SW2:1,2" )
	PORT_DIPSETTING(    0x02, "2" )
	PORT_DIPSETTING(    0x03, "3" )
	PORT_DIPSETTING(    0x01, "5" )
	PORT_DIPSETTING(    0x00, "7")
	PORT_DIPNAME( 0x1c, 0x0c, DEF_STR( Difficulty ) )	PORT_DIPLOCATION( "SW2:3,4,5" )
	PORT_DIPSETTING(    0x1c, "1 (Easiest)")
	PORT_DIPSETTING(    0x18, "2" )
	PORT_DIPSETTING(    0x14, "3" )
	PORT_DIPSETTING(    0x10, "4" )
	PORT_DIPSETTING(    0x0c, "5 (Normal)" )
	PORT_DIPSETTING(    0x08, "6" )
	PORT_DIPSETTING(    0x04, "7" )
	PORT_DIPSETTING(    0x00, "8 (Hardest)" )
	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )	PORT_DIPLOCATION( "SW2:6" )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )	PORT_DIPLOCATION( "SW2:7" )
	PORT_DIPSETTING(    0x00, DEF_STR( No ) )
	PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )		PORT_DIPLOCATION( "SW2:8" )
	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
	PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )

	PORT_START("FREEZE")
	PORT_DIPNAME( 0x01, 0x01, "Freeze" )	/* could be VBLANK */
	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )

	PORT_START("COIN_LOCKOUT")
	PORT_CONFNAME( 0x01, 0x01, "Coin Lockout Hardware Present" )
	PORT_CONFSETTING( 0x01, DEF_STR( Yes ) )
	PORT_CONFSETTING( 0x00, DEF_STR( No ) )
INPUT_PORTS_END



static const gfx_layout charlayout =
{
	8,8,
	RGN_FRAC(1,1),
	2,
	{ 4, 0 },
	{ 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 },
	{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
	16*8
};

static const gfx_layout spritelayout =
{
	16,16,
	RGN_FRAC(1,2),
	4,
	{ RGN_FRAC(1,2)+4, RGN_FRAC(1,2)+0, 4, 0 },
	{ 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3,
			16*16+0, 16*16+1, 16*16+2, 16*16+3, 16*16+8+0, 16*16+8+1, 16*16+8+2, 16*16+8+3 },
	{ 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 },
	32*16
};

static GFXDECODE_START( blktiger )
	GFXDECODE_ENTRY( "gfx1", 0, charlayout,   0x300, 32 )	/* colors 0x300-0x37f */
	GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x000, 16 )	/* colors 0x000-0x0ff */
	GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x200,  8 )	/* colors 0x200-0x27f */
GFXDECODE_END



/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler( running_device *device, int irq )
{
	blktiger_state *state = (blktiger_state *)device->machine->driver_data;
	cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
コード例 #17
0
static WRITE16_HANDLER( bigkarnk_sound_command_w )
{
	gaelco_state *state = space->machine->driver_data<gaelco_state>();

	if (ACCESSING_BITS_0_7)
	{
		soundlatch_w(space, 0, data & 0xff);
		cpu_set_input_line(state->audiocpu, M6809_FIRQ_LINE, HOLD_LINE);
	}
}
コード例 #18
0
ファイル: exprraid.c プロジェクト: hstampfl/mame2010-libretro
static INTERRUPT_GEN( exprraid_interrupt )
{
	exprraid_state *state = (exprraid_state *)device->machine->driver_data;

	if ((~input_port_read(device->machine, "IN2")) & 0xc0)
	{
		if (state->coin == 0)
		{
			state->coin = 1;
			//cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
			cpu_set_input_line(device, DECO16_IRQ_LINE, ASSERT_LINE);
		}
	}
	else
	{
		cpu_set_input_line(device, DECO16_IRQ_LINE, CLEAR_LINE);
		state->coin = 0;
	}
}
コード例 #19
0
ファイル: rastan.c プロジェクト: DarrenBranford/MAME4iOS
GFXDECODE_END



/* handler called by the YM2151 emulator when the internal timers cause an IRQ */
static void irqhandler( running_device *device, int irq )
{
	rastan_state *state = device->machine->driver_data<rastan_state>();
	cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
コード例 #20
0
ファイル: flstory.c プロジェクト: AltimorTASDK/shmupmametgm
static WRITE8_HANDLER( nmi_enable_w )
{
    flstory_state *state = (flstory_state *)space->machine->driver_data;
    state->sound_nmi_enable = 1;
    if (state->pending_nmi)
    {
        cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
        state->pending_nmi = 0;
    }
}
コード例 #21
0
ファイル: asterix.c プロジェクト: hstampfl/mame2010-libretro
static INTERRUPT_GEN( asterix_interrupt )
{
	asterix_state *state = (asterix_state *)device->machine->driver_data;

	// global interrupt masking
	if (!k056832_is_irq_enabled(state->k056832, 0))
		return;

	cpu_set_input_line(device, 5, HOLD_LINE); /* ??? All irqs have the same vector, and the mask used is 0 or 7 */
}
コード例 #22
0
static WRITE8_HANDLER( irqack_w )
{
	_20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
	int bit = data & 1;

	cpu_interrupt_enable(state->maincpu, bit);

	if (!bit)
		cpu_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
コード例 #23
0
ファイル: rainbow.c プロジェクト: AltimorTASDK/shmupmametgm
static WRITE16_HANDLER( jumping_sound_w )
{
	rainbow_state *state = (rainbow_state *)space->machine->driver_data;

	if (ACCESSING_BITS_0_7)
	{
		state->jumping_latch = data & 0xff; /*M68000 writes .b to $400007*/
		cpu_set_input_line(state->audiocpu, 0, HOLD_LINE);
	}
}
コード例 #24
0
ファイル: diverboy.c プロジェクト: DarrenBranford/MAME4iOS
static WRITE16_HANDLER( soundcmd_w )
{
	diverboy_state *state = space->machine->driver_data<diverboy_state>();

	if (ACCESSING_BITS_0_7)
	{
		soundlatch_w(space, 0, data & 0xff);
		cpu_set_input_line(state->audiocpu, 0, HOLD_LINE);
	}
}
コード例 #25
0
ファイル: glass.c プロジェクト: AltimorTASDK/shmupmametgm
static INTERRUPT_GEN( glass_interrupt )
{
	glass_state *state = (glass_state *)device->machine->driver_data;

	if (state->cause_interrupt)
	{
		cpu_set_input_line(device, 6, HOLD_LINE);
		state->cause_interrupt = 0;
	}
}
コード例 #26
0
ファイル: blockade.c プロジェクト: Paulodx/sdl-mame-wii
static INTERRUPT_GEN( blockade_interrupt )
{
	cpu_resume(device, SUSPEND_ANY_REASON);

	if ((input_port_read(device->machine, "IN0") & 0x80) == 0)
	{
		just_been_reset = 1;
		cpu_set_input_line(device, INPUT_LINE_RESET, PULSE_LINE);
	}
}
コード例 #27
0
ファイル: goal92.c プロジェクト: DarrenBranford/MAME4iOS
static void goal92_adpcm_int( running_device *device )
{
	goal92_state *state = device->machine->driver_data<goal92_state>();
	msm5205_data_w(device, state->msm5205next);
	state->msm5205next >>= 4;
	state->adpcm_toggle^= 1;

	if (state->adpcm_toggle)
		cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
コード例 #28
0
/******************************************************************************/

static const gfx_layout sprite_layout =
{
	16,16,
	RGN_FRAC(1,4),
	4,
	{ RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4) },
	{ 0, 1, 2, 3, 4, 5, 6, 7,
			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*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
};

static const gfx_layout text_layout =
{
	8,8,
	RGN_FRAC(1,1),
	2,
	{ 4, 0 },
	{ 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 },
	{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
	16*8
};

static const gfx_layout madgear_tile =
{
	16,16,
	RGN_FRAC(1,1),
	4,
	{ 3*4, 2*4, 1*4, 0*4 },
	{ 0, 1, 2, 3, 16+0, 16+1, 16+2, 16+3,
			32*16+0, 32*16+1, 32*16+2, 32*16+3, 32*16+16+0, 32*16+16+1, 32*16+16+2, 32*16+16+3 },
	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
			8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
	64*16
};

static const gfx_layout madgear_tile2 =
{
	16,16,
	RGN_FRAC(1,1),
	4,
	{ 1*4, 3*4, 0*4, 2*4 },
	{ 0, 1, 2, 3, 16+0, 16+1, 16+2, 16+3,
			32*16+0, 32*16+1, 32*16+2, 32*16+3, 32*16+16+0, 32*16+16+1, 32*16+16+2, 32*16+16+3 },
	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
			8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
	64*16
};

static GFXDECODE_START( lastduel )
	GFXDECODE_ENTRY( "gfx1", 0, sprite_layout, 0x200, 16 )	/* colors 0x200-0x2ff */
	GFXDECODE_ENTRY( "gfx2", 0, text_layout,   0x300, 16 )	/* colors 0x300-0x33f */
	GFXDECODE_ENTRY( "gfx3", 0, madgear_tile,  0x000, 16 )	/* colors 0x000-0x0ff */
	GFXDECODE_ENTRY( "gfx4", 0, madgear_tile,  0x100, 16 )	/* colors 0x100-0x1ff */
GFXDECODE_END

static GFXDECODE_START( madgear )
	GFXDECODE_ENTRY( "gfx1", 0, sprite_layout, 0x200, 16 )	/* colors 0x200-0x2ff */
	GFXDECODE_ENTRY( "gfx2", 0, text_layout,   0x300, 16 )	/* colors 0x300-0x33f */
	GFXDECODE_ENTRY( "gfx3", 0, madgear_tile,  0x000, 16 )	/* colors 0x000-0x0ff */
	GFXDECODE_ENTRY( "gfx4", 0, madgear_tile2, 0x100, 16 )	/* colors 0x100-0x1ff */
GFXDECODE_END

/******************************************************************************/

/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
	lastduel_state *state = device->machine->driver_data<lastduel_state>();
	cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
コード例 #29
0
ファイル: tail2nos.c プロジェクト: AltimorTASDK/shmupmametgm
static WRITE16_HANDLER( sound_command_w )
{
	tail2nos_state *state = (tail2nos_state *)space->machine->driver_data;

	if (ACCESSING_BITS_0_7)
	{
		soundlatch_w(space, offset, data & 0xff);
		cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
	}
}
コード例 #30
0
ファイル: fuukifg2.c プロジェクト: AltimorTASDK/shmupmametgm
static WRITE16_HANDLER( fuuki16_sound_command_w )
{
	fuuki16_state *state = (fuuki16_state *)space->machine->driver_data;
	if (ACCESSING_BITS_0_7)
	{
		soundlatch_w(space,0,data & 0xff);
		cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
//      cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(50));   // Allow the other CPU to reply
		cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(50)); // Fixes glitching in rasters
	}
}