Ejemplo n.º 1
0
void rp5c15_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch (id)
	{
	case TIMER_CLOCK:
		if (m_1hz && (m_mode & MODE_TIMER_EN))
		{
			advance_seconds();
		}

		m_1hz = !m_1hz;
		set_alarm_line();
		break;

	case TIMER_16HZ:
		m_16hz = !m_16hz;
		set_alarm_line();
		break;

	case TIMER_CLKOUT:
		m_clkout = !m_clkout;
		m_out_clkout_func(m_clkout);
		break;
	}
}
Ejemplo n.º 2
0
void hd64610_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch (id)
	{
	case TIMER_UPDATE_COUNTER:
		if(m_hline_state || (m_regs[REG_CRB] & CRB_S))
		{
			m_regs[REG_64HZ]++;

			if (m_regs[REG_64HZ] & 0x80)
			{
				// update seconds
				advance_seconds();

				// set carry flag
				m_regs[REG_CRA] |= CRA_CF;

				m_regs[REG_64HZ] &= 0x7f;
			}

			// update 1Hz out
			m_out_1hz_func(BIT(m_regs[REG_64HZ], 6));

			// update IRQ
			check_alarm();
			set_irq_line();
		}
		break;
	}
}
Ejemplo n.º 3
0
void upd1990a_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch (id)
	{
	case TIMER_CLOCK:
		advance_seconds();
		break;

	case TIMER_TP:
		m_tp = !m_tp;

		if (LOG) logerror("uPD1990A '%s' TP %u\n", tag(), m_tp);

		m_out_tp_func(m_tp);
		break;

	case TIMER_DATA_OUT:
		m_data_out = !m_data_out;

		if (LOG) logerror("uPD1990A '%s' DATA OUT TICK %u\n", tag(), m_data_out);

		m_out_data_func(m_data_out);
		break;
	}
}
Ejemplo n.º 4
0
void upd1990a_rtc_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch (id)
	{
	case TIMER_CLOCK:
		advance_seconds();
		break;

	case TIMER_TP:
		m_tp = !m_tp;

		if (LOG) logerror("uPD1990A '%s' TP %u\n", tag(), m_tp);

		m_out_tp_func(m_tp);
		break;

	case TIMER_DATA_OUT:
		m_data_out = !m_data_out;

		if (LOG) logerror("uPD1990A '%s' DATA OUT TICK %u\n", tag(), m_data_out);

		m_out_data_func(m_data_out);
		break;

	case TIMER_TEST_MODE:
		if (m_oe)
		{
			/* TODO: completely untested */
			/* time counter is advanced at 1024 Hz from "Second" counter input */
			int i;

			m_data_out = (m_time_counter[4] == 0);

			for(i=0;i<5;i++)
			{
				m_time_counter[i]++;
				if(m_time_counter[i] != 0)
					return;
			}
		}
		else // parallel
		{
			int i;
			/* each counter is advanced at 1024 Hz in parallel, overflow carry does not affect next counter */
			m_time_counter[0]++;
			m_time_counter[1]++;
			m_time_counter[2]++;
			m_time_counter[3]++;
			m_time_counter[4]++;

			m_data_out = 0;

			for(i=0;i<5;i++)
				m_data_out |= (m_time_counter[i] == 0);
		}

		break;
	}
}
Ejemplo n.º 5
0
void mccs1850_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch (id)
	{
	case TIMER_CLOCK:
		advance_seconds();
		break;
	}
}
Ejemplo n.º 6
0
void msm5832_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch (id)
	{
	case TIMER_CLOCK:
		if (!m_hold)
		{
			advance_seconds();
		}
		break;
	}
}
Ejemplo n.º 7
0
void pcf8593_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch(id)
	{
		case TIMER_UPDATE_COUNTER:
			_logerror( 2, ("pcf8593_timer_callback (%d)\n", param));
			// check if counting is enabled
			if (!(m_data[0] & 0x80))
				advance_seconds();
			break;
	}
}
Ejemplo n.º 8
0
void mm58167_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	m_milliseconds++;

	if (m_milliseconds >= 999)
	{
		advance_seconds();
		m_milliseconds = 0;
	}

	m_regs[R_CNT_MILLISECONDS] = make_bcd(m_milliseconds % 10);
	m_regs[R_CNT_HUNDTENTHS] = make_bcd(m_milliseconds / 10);
}
Ejemplo n.º 9
0
void upd1990a_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch (id)
	{
	case TIMER_CLOCK:
		advance_seconds();
		break;

	case TIMER_TP:
		m_tp = !m_tp;
		m_write_tp(m_tp);
		break;

	case TIMER_DATA_OUT:
		m_data_out = !m_data_out;
		m_write_data(get_data_out());
		break;

	case TIMER_TEST_MODE:
		if (m_oe)
		{
			/* TODO: completely untested */
			/* time counter is advanced from "Second" counter input */
			int max_shift = is_serial_mode() ? 6 : 5;
			m_data_out = (m_time_counter[max_shift - 1] == 0);
			m_write_data(get_data_out());

			for (int i = 0; i < max_shift; i++)
			{
				m_time_counter[i]++;
				if (m_time_counter[i] != 0)
					return;
			}
		}
		else
		{
			/* each counter is advanced in parallel, overflow carry does not affect next counter */
			m_data_out = 0;

			int max_shift = is_serial_mode() ? 6 : 5;
			for (int i = 0; i < max_shift; i++)
			{
				m_time_counter[i]++;
				m_data_out |= (m_time_counter[i] == 0);
			}
			m_write_data(get_data_out());
		}

		break;
	}
}
Ejemplo n.º 10
0
void msm58321_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch (id)
	{
	case TIMER_CLOCK:
		advance_seconds();
		break;

	case TIMER_BUSY:
		m_out_busy_func(m_busy);
		m_busy = !m_busy;
		break;
	}
}
Ejemplo n.º 11
0
void hp98035_io_card::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	if (id == MSEC_TMR_ID) {
		// On real hw there's a full 4-bit decimal counter, but only the LSB is used to
		// generate interrupts
		m_np_irq = !m_np_irq;
		update_dc();
	} else if (id == CLOCK_TMR_ID) {
		// Update digit multiplexer
		if (m_clock_state == CLOCK_OFF) {
			m_clock_mux = 0;
		} else {
			m_clock_mux <<= 1;
			if ((m_clock_mux & 7) == 0) {
				m_clock_mux = 1;
			}
		}
		// Act on clock chip "keys"
		if (m_clock_keys == 0 || m_clock_keys != m_prev_clock_keys) {
			m_clock_key_cnt = 0;
			if (m_clock_keys == 0 && m_clock_state == CLOCK_HHMM) {
				// Keys released in HHMM state -> turn display off
				// In real hw there is probably 1 s delay
				m_clock_state = CLOCK_OFF;
				regen_clock_image();
			}
		} else if (m_clock_key_cnt < KEY_PRESS_LONG) {
			m_clock_key_cnt++;
			if (m_clock_key_cnt == KEY_PRESS_SHORT) {
				/// Short key press
				clock_short_press();
			} else if (m_clock_key_cnt == KEY_PRESS_LONG) {
				// Long key press
				clock_long_press();
			}
		}
		m_prev_clock_keys = m_clock_keys;
		// Count seconds
		m_clock_1s_div++;
		if (m_clock_1s_div >= DIGIT_MUX_FREQ) {
			m_clock_1s_div = 0;
			advance_seconds();
			regen_clock_image();
		}
	}
}
Ejemplo n.º 12
0
void cdp1879_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	advance_seconds();

	// comparator IRQ
	bool new_state = true;
	for (int i = R_CNT_SECONDS; i <= R_CNT_HOURS; i++)
	{
		if(m_regs[i] != m_regs[i + 6])
		{
			new_state = false;
			break;
		}
	}

	if (!m_comparator_state && new_state)  // positive-edge-triggered
		set_irq(7);

	m_comparator_state = new_state;
}
Ejemplo n.º 13
0
void CRP5C01::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
    switch (id)
    {
    case TIMER_CLOCK:
        if (m_1hz && (m_mode & MODE_TIMER_EN))
        {
            advance_seconds();
        }

        m_1hz = !m_1hz;
        set_alarm_line();
        break;

    case TIMER_16HZ:
        m_16hz = !m_16hz;
        set_alarm_line();
        break;
    }
}
Ejemplo n.º 14
0
void e0516_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	advance_seconds();
}