Beispiel #1
0
static void tape_set_motor( int bOn )
{
	if( bOn )
	{
		/* If talk track is not playing, start it. */
		if (! sample_playing( kTalkTrack ))
			sample_start( 0, kTalkTrack, 1 );

		/* Resume playback of talk track. */
		sample_set_pause( kTalkTrack, 0);


		/* If crash track is not playing, start it. */
		if (! sample_playing( kCrashTrack ))
			sample_start( 1, kCrashTrack, 1 );

		/* Resume playback of crash track. */
		sample_set_pause( kCrashTrack, 0);
	}
	else
	{
		/* Pause both the talk and crash tracks. */
		sample_set_pause( kTalkTrack, 1 );
		sample_set_pause( kCrashTrack, 1 );
	}
}
static void triplhnt_update_misc(running_machine &machine, int offset)
{
	triplhnt_state *state = machine.driver_data<triplhnt_state>();
	device_t *samples = machine.device("samples");
	device_t *discrete = machine.device("discrete");
	UINT8 is_witch_hunt;
	UINT8 bit = offset >> 1;

	/* BIT0 => UNUSED      */
	/* BIT1 => LAMP        */
	/* BIT2 => SCREECH     */
	/* BIT3 => LOCKOUT     */
	/* BIT4 => SPRITE ZOOM */
	/* BIT5 => CMOS WRITE  */
	/* BIT6 => TAPE CTRL   */
	/* BIT7 => SPRITE BANK */

	if (offset & 1)
	{
		state->m_misc_flags |= 1 << bit;

		if (bit == 5)
		{
			state->m_cmos[state->m_cmos_latch] = state->m_da_latch;
		}
	}
	else
	{
		state->m_misc_flags &= ~(1 << bit);
	}

	state->m_sprite_zoom = (state->m_misc_flags >> 4) & 1;
	state->m_sprite_bank = (state->m_misc_flags >> 7) & 1;

	set_led_status(machine, 0, state->m_misc_flags & 0x02);

	coin_lockout_w(machine, 0, !(state->m_misc_flags & 0x08));
	coin_lockout_w(machine, 1, !(state->m_misc_flags & 0x08));

	discrete_sound_w(discrete, TRIPLHNT_SCREECH_EN, state->m_misc_flags & 0x04);	// screech
	discrete_sound_w(discrete, TRIPLHNT_LAMP_EN, state->m_misc_flags & 0x02);	// Lamp is used to reset noise
	discrete_sound_w(discrete, TRIPLHNT_BEAR_EN, state->m_misc_flags & 0x80);	// bear

	is_witch_hunt = input_port_read(machine, "0C09") == 0x40;
	bit = ~state->m_misc_flags & 0x40;

	/* if we're not playing the sample yet, start it */
	if (!sample_playing(samples, 0))
		sample_start(samples, 0, 0, 1);
	if (!sample_playing(samples, 1))
		sample_start(samples, 1, 1, 1);

	/* bit 6 turns cassette on/off */
	sample_set_pause(samples, 0,  is_witch_hunt || bit);
	sample_set_pause(samples, 1, !is_witch_hunt || bit);
}