Beispiel #1
0
inline void upd65031_device::interrupt_refresh()
{
	if ((m_int & INT_GINT) && ((m_int & m_sta & 0x7c) || ((m_int & INT_TIME) && (m_sta & STA_TIME))))
	{
		if (LOG) logerror("uPD65031 '%s': set int\n", tag());

		m_write_int(ASSERT_LINE);
	}
	else
	{
		if (LOG) logerror("uPD65031 '%s': clear int\n", tag());

		m_write_int(CLEAR_LINE);
	}
}
Beispiel #2
0
void cdp1861_device::device_reset()
{
	m_int_timer->adjust(screen().time_until_pos(SCANLINE_INT_START, 0));
	m_efx_timer->adjust(screen().time_until_pos(SCANLINE_EFX_TOP_START, 0));
	m_dma_timer->adjust(clocks_to_attotime(CDP1861_CYCLES_DMA_START));

	m_disp = 0;
	m_dmaout = 0;
	m_dispon = 0;

	m_write_int(CLEAR_LINE);
	m_write_dma_out(CLEAR_LINE);
	m_write_efx(CLEAR_LINE);
}
Beispiel #3
0
inline void crt9007_t::trigger_interrupt(int line)
{
	if (INTERRUPT_ENABLE & line)
	{
		int status = m_status;

		m_status |= STATUS_INTERRUPT_PENDING | line;

		if (!(status & STATUS_INTERRUPT_PENDING))
		{
			if (LOG) logerror("CRT9007 '%s' INT 1\n", tag());
			m_write_int(ASSERT_LINE);
		}
	}
}
Beispiel #4
0
void crt9007_t::device_reset()
{
	m_disp = 0;
	m_vs = 0;
	m_cblank = 0;

	// HS = 1
	m_write_hs(1);

	// VS = 1
	m_write_vs(1);

	// CBLANK = 1
	m_write_cblank(0);

	// CURS = 0
	m_write_curs(0);

	// VLT = 0
	m_write_vlt(0);

	// DRB = 1
	m_write_drb(1);

	// INT = 0
	m_write_int(CLEAR_LINE);

	// 28 (DMAR) = 0
	m_write_dmar(CLEAR_LINE);

	// 29 (WBEN) = 0
	m_write_wben(1); // HACK

	// 30 (SLG) = 0
	m_write_slg(0);

	// 31 (SLD) = 0
	m_write_sld(0);

	// 32 (LPSTB) = 0
}
Beispiel #5
0
void cdp1861_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	int scanline = screen().vpos();

	switch (id)
	{
	case TIMER_INT:
		if (scanline == SCANLINE_INT_START)
		{
			if (m_disp)
			{
				m_write_int(ASSERT_LINE);
			}

			m_int_timer->adjust(screen().time_until_pos( SCANLINE_INT_END, 0));
		}
		else
		{
			if (m_disp)
			{
				m_write_int(CLEAR_LINE);
			}

			m_int_timer->adjust(screen().time_until_pos(SCANLINE_INT_START, 0));
		}
		break;

	case TIMER_EFX:
		switch (scanline)
		{
		case SCANLINE_EFX_TOP_START:
			m_write_efx(ASSERT_LINE);
			m_efx_timer->adjust(screen().time_until_pos(SCANLINE_EFX_TOP_END, 0));
			break;

		case SCANLINE_EFX_TOP_END:
			m_write_efx(CLEAR_LINE);
			m_efx_timer->adjust(screen().time_until_pos(SCANLINE_EFX_BOTTOM_START, 0));
			break;

		case SCANLINE_EFX_BOTTOM_START:
			m_write_efx(ASSERT_LINE);
			m_efx_timer->adjust(screen().time_until_pos(SCANLINE_EFX_BOTTOM_END, 0));
			break;

		case SCANLINE_EFX_BOTTOM_END:
			m_write_efx(CLEAR_LINE);
			m_efx_timer->adjust(screen().time_until_pos(SCANLINE_EFX_TOP_START, 0));
			break;
		}
		break;

	case TIMER_DMA:
		if (m_dmaout)
		{
			if (m_disp)
			{
				if (scanline >= SCANLINE_DISPLAY_START && scanline < SCANLINE_DISPLAY_END)
				{
					m_write_dma_out(CLEAR_LINE);
				}
			}

			m_dma_timer->adjust(clocks_to_attotime(CDP1861_CYCLES_DMA_WAIT));

			m_dmaout = CLEAR_LINE;
		}
		else
		{
			if (m_disp)
			{
				if (scanline >= SCANLINE_DISPLAY_START && scanline < SCANLINE_DISPLAY_END)
				{
					m_write_dma_out(ASSERT_LINE);
				}
			}

			m_dma_timer->adjust(clocks_to_attotime(CDP1861_CYCLES_DMA_ACTIVE));

			m_dmaout = ASSERT_LINE;
		}
		break;
	}
}