示例#1
0
static TIMER_CALLBACK( schaser_effect_555_cb )
{
	_8080bw_state *state = machine.driver_data<_8080bw_state>();
	int effect = param;
	attotime new_time;
	/* Toggle 555 output */
	state->m_schaser_effect_555_is_low = !state->m_schaser_effect_555_is_low;
	state->m_schaser_effect_555_time_remain = attotime::zero;
	state->m_schaser_effect_555_time_remain_savable = state->m_schaser_effect_555_time_remain.as_double();

	if (state->m_schaser_effect_555_is_low)
		new_time = PERIOD_OF_555_ASTABLE(0, RES_K(20), CAP_U(1)) / 2;
	else
	{
		if (effect)
			new_time = attotime(0, ATTOSECONDS_PER_SECOND * .8873 * schaser_effect_rc[effect]);
		else
			new_time = attotime::never;
	}
	state->m_schaser_effect_555_timer->adjust(new_time, effect);
	sn76477_enable_w(state->m_sn, !(state->m_schaser_effect_555_is_low || state->m_schaser_explosion));
	sn76477_one_shot_cap_voltage_w(state->m_sn, !(state->m_schaser_effect_555_is_low || state->m_schaser_explosion) ? 0 : SN76477_EXTERNAL_VOLTAGE_DISCONNECT);
}
示例#2
0
static TIMER_CALLBACK( schaser_effect_555_cb )
{
    mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
    int effect = param;
    attotime new_time;
    /* Toggle 555 output */
    state->schaser_effect_555_is_low = !state->schaser_effect_555_is_low;
    state->schaser_effect_555_time_remain = attotime_zero;
    state->schaser_effect_555_time_remain_savable = attotime_to_double(state->schaser_effect_555_time_remain);

    if (state->schaser_effect_555_is_low)
        new_time = attotime_div(PERIOD_OF_555_ASTABLE(0, RES_K(20), CAP_U(1)), 2);
    else
    {
        if (effect)
            new_time = attotime_make(0, ATTOSECONDS_PER_SECOND * .8873 * schaser_effect_rc[effect]);
        else
            new_time = attotime_never;
    }
    timer_adjust_oneshot(state->schaser_effect_555_timer, new_time, effect);
    sn76477_enable_w(state->sn, !(state->schaser_effect_555_is_low || state->schaser_explosion));
    sn76477_one_shot_cap_voltage_w(state->sn, !(state->schaser_effect_555_is_low || state->schaser_explosion) ? 0 : SN76477_EXTERNAL_VOLTAGE_DISCONNECT);
}
示例#3
0
void tutankhm_state::tutankhm(machine_config &config)
{
	/* basic machine hardware */
	MC6809E(config, m_maincpu, XTAL(18'432'000)/12);   /* 1.5 MHz ??? */
	m_maincpu->set_addrmap(AS_PROGRAM, &tutankhm_state::main_map);

	ls259_device &mainlatch(LS259(config, "mainlatch")); // C3
	mainlatch.q_out_cb<0>().set(FUNC(tutankhm_state::irq_enable_w));
	mainlatch.q_out_cb<1>().set_nop(); // PAY OUT - not used
	mainlatch.q_out_cb<2>().set(FUNC(tutankhm_state::coin_counter_2_w));
	mainlatch.q_out_cb<3>().set(FUNC(tutankhm_state::coin_counter_1_w));
	mainlatch.q_out_cb<4>().set(FUNC(tutankhm_state::galaxian_stars_enable_w));
	mainlatch.q_out_cb<5>().set("timeplt_audio", FUNC(timeplt_audio_device::mute_w));
	mainlatch.q_out_cb<6>().set(FUNC(tutankhm_state::flip_screen_x_w));
	mainlatch.q_out_cb<7>().set(FUNC(tutankhm_state::flip_screen_y_w));

	WATCHDOG_TIMER(config, "watchdog");

	/* video hardware */
	SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
	m_screen->set_raw(GALAXIAN_PIXEL_CLOCK, GALAXIAN_HTOTAL, GALAXIAN_HBEND, GALAXIAN_HBSTART, GALAXIAN_VTOTAL, GALAXIAN_VBEND, GALAXIAN_VBSTART);
	PALETTE(config, m_palette).set_format(1, tutankhm_state::raw_to_rgb_func, 16);

	m_screen->set_screen_update(FUNC(tutankhm_state::screen_update_tutankhm));
	m_screen->screen_vblank().set(FUNC(tutankhm_state::vblank_irq));

	/* sound hardware */
	TIMEPLT_AUDIO(config, "timeplt_audio");

	/* blinking frequency is determined by 555 counter with Ra=100k, Rb=10k, C=10uF */
	TIMER(config, "stars").configure_periodic(FUNC(tutankhm_state::scramble_stars_blink_timer), PERIOD_OF_555_ASTABLE(100000, 10000, 0.00001));
}
示例#4
0
GFXDECODE_END

/* Machine Initialization */

/* Machine Driver */

static MACHINE_CONFIG_START( nitedrvr, nitedrvr_state )

	/* basic machine hardware */
	MCFG_CPU_ADD("maincpu", M6502, XTAL_12_096MHz/12) // 1 MHz
	MCFG_CPU_PROGRAM_MAP(nitedrvr_map)
	MCFG_CPU_VBLANK_INT_DRIVER("screen", nitedrvr_state,  irq0_line_hold)
	MCFG_WATCHDOG_VBLANK_INIT(3)


	MCFG_TIMER_DRIVER_ADD_PERIODIC("crash_timer", nitedrvr_state, nitedrvr_crash_toggle_callback, PERIOD_OF_555_ASTABLE(RES_K(180), 330, CAP_U(1)))

	/* video hardware */
	MCFG_SCREEN_ADD("screen", RASTER)
	MCFG_SCREEN_REFRESH_RATE(57) // how is this derived?
	MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
	MCFG_SCREEN_SIZE(32*8, 32*8)
	MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
	MCFG_SCREEN_UPDATE_DRIVER(nitedrvr_state, screen_update_nitedrvr)

	MCFG_GFXDECODE(nitedrvr)
	MCFG_PALETTE_LENGTH(2)

	MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)

	/* sound hardware */
示例#5
0
static MACHINE_RESET( nitedrvr )
{
	timer_pulse(PERIOD_OF_555_ASTABLE(RES_K(180), 330, CAP_U(1)), NULL, 0, nitedrvr_crash_toggle_callback);
	nitedrvr_register_machine_vars();
}