示例#1
0
void aakart_device::write_kbd_buf()
{
	//printf("%08x\n",data);
	m_out_tx_func(ASSERT_LINE);
	//debugger_break(machine());
	m_status = STATUS_KEYDOWN;
}
示例#2
0
void serial_keyboard_device::device_reset()
{
	generic_keyboard_device::device_reset();
	m_rbit = 1;
	if(m_slot)
		m_owner->out_rx(m_rbit);
	else
		m_out_tx_func(m_rbit);

	UINT8 val = m_io_term_frame->read();
	set_tra_rate(rates[val & 0x0f]);

	switch(val & 0x30)
	{
	case 0x10:
		set_data_frame(7, 1, SERIAL_PARITY_EVEN);
		break;
	case 0x00:
	default:
		set_data_frame(8, 1, SERIAL_PARITY_NONE);
		break;
	case 0x20:
		set_data_frame(8, 2, SERIAL_PARITY_NONE);
		break;
	case 0x30:
		set_data_frame(8, 1, SERIAL_PARITY_EVEN);
		break;
	}
}
示例#3
0
void serial_keyboard_device::tra_callback()
{
	m_rbit = transmit_register_get_data_bit();
	if(m_slot)
		m_owner->out_rx(m_rbit);
	else
		m_out_tx_func(m_rbit);
}
示例#4
0
void serial_keyboard_device::device_reset()
{
	generic_keyboard_device::device_reset();
	m_rbit = 1;
	if(m_slot)
		m_owner->out_rx(m_rbit);
	else
		m_out_tx_func(m_rbit);
}
示例#5
0
void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	if(id == RX_TIMER && m_new_command & 2)
	{
		m_out_rx_func(ASSERT_LINE);
		m_out_tx_func(CLEAR_LINE);
		m_rx = m_rx_latch;
		return;
	}

	if(id == TX_TIMER && m_new_command & 1)
	{
		m_out_tx_func(ASSERT_LINE);
		m_new_command &= ~1;
		m_new_command |= 2;
		return;
	}
}
示例#6
0
文件: midikbd.c 项目: Ilgrim/MAMEHub
void midi_keyboard_device::tra_callback()
{
	m_out_tx_func(transmit_register_get_data_bit());
}
示例#7
0
void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	#if 0
	if(id == KEYB_TIMER && m_keyb_enable && m_status == STATUS_NORMAL)
	{
		m_new_command |= 2;
		m_rx_latch = 0xd0 | 0; // keyb scancode (0xd0=up 0xc0=down, bits 3-0 row)
		m_status = STATUS_KEYUP;
		//m_ff ^= 1;
		return;
	}
	#endif

	if(id == MOUSE_TIMER && m_mouse_enable && m_status == STATUS_NORMAL)
	{
		m_new_command |= 2;
		m_rx_latch = 0; // mouse X position
		m_status = STATUS_MOUSE;
		//m_ff ^= 1;
		return;
	}

	if(m_new_command == 0)
		return;

	if(id == RX_TIMER && m_new_command & 2)
	{
		m_out_rx_func(ASSERT_LINE);
		m_new_command &= ~2;
		m_rx = m_rx_latch;
		return;
	}

	if(id == TX_TIMER && m_new_command & 1)
	{
		switch(m_status)
		{
			case STATUS_NORMAL:
			{
				switch(m_tx_latch)
				{
					case 0x00: // set leds
						break;
					case RQID:
						m_rx_latch = 0x81; //keyboard ID
						break;
					case SMAK:
					case MACK:
					case SACK:
					case NACK:
						if(m_tx_latch & 2) { m_mouse_enable = 1; }
						if(m_tx_latch & 1) { m_keyb_enable = 1; }
						break;
					case HRST:
						m_rx_latch = HRST;
						m_status = STATUS_HRST;
						break;
					default:
						//printf("%02x\n",m_tx_latch);
						break;
				}
				break;
			}
			case STATUS_KEYDOWN:
			{
				switch(m_tx_latch)
				{
					case BACK:
						m_rx_latch = 0xc0 | 0; // keyb scancode (0xd0=up 0xc0=down, bits 3-0 col)
						m_status = STATUS_NORMAL;
						break;
					case HRST:
						m_rx_latch = HRST;
						m_status = STATUS_HRST;
						break;
				}
				break;
			}
			case STATUS_KEYUP:
			{
				switch(m_tx_latch)
				{
					case BACK:
						m_rx_latch = 0xd0 | 0; // keyb scancode (0xd0=up 0xc0=down, bits 3-0 col)
						m_status = STATUS_NORMAL;
						break;
					case HRST:
						m_rx_latch = HRST;
						m_status = STATUS_HRST;
						break;
				}
				break;
			}
			case STATUS_MOUSE:
			{
				switch(m_tx_latch)
				{
					case BACK:
						m_rx_latch = 0; // mouse Y
						m_status = STATUS_NORMAL;
						break;
					default:
					case HRST:
						m_rx_latch = HRST;
						m_status = STATUS_HRST;
						break;
				}
				break;
			}
			case STATUS_HRST:
			{
				switch(m_tx_latch)
				{
					case HRST:  { m_rx_latch = HRST; m_keyb_enable = m_mouse_enable = 0; break; }
					case RAK1:  { m_rx_latch = RAK1; m_keyb_enable = m_mouse_enable = 0; break; }
					case RAK2:  { m_rx_latch = RAK2; m_status = STATUS_NORMAL; break; }
				}
				break;
			}
		}
		m_out_tx_func(ASSERT_LINE);
		m_new_command &= ~1;
		m_new_command |= 2;
	}
}
示例#8
0
void esqpanel_device::tra_callback()    // Tx send bit
{
	int bit = transmit_register_get_data_bit();
	m_out_tx_func(bit);
}