コード例 #1
0
ファイル: pcshare.c プロジェクト: nitrologic/emu
void init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(running_machine *, int))
{
	/* PC-XT keyboard */
	if (flags & PCCOMMON_KEYBOARD_AT)
		at_keyboard_init(machine, AT_KEYBOARD_TYPE_AT);
	else
		at_keyboard_init(machine, AT_KEYBOARD_TYPE_PC);
	at_keyboard_set_scan_code_set(1);

	memset(&pc_keyb, 0, sizeof(pc_keyb));
	pc_keyb.machine = machine;
	pc_keyb.int_cb = set_keyb_int_func;
	pc_keyb.timer = timer_alloc(machine, pc_keyb_timer, NULL);
}
コード例 #2
0
ファイル: 8042kbdc.c プロジェクト: jiangzhonghui/mame
void kbdc8042_device::device_start()
{
	// resolve callbacks
	m_system_reset_func.resolve(m_system_reset_cb, *this);
	m_gate_a20_func.resolve(m_gate_a20_cb, *this);
	m_input_buffer_full_func.resolve(m_input_buffer_full_cb, *this);
	m_output_buffer_empty_func.resolve(m_output_buffer_empty_cb, *this);
	m_speaker_func.resolve(m_speaker_cb, *this);
	machine().scheduler().timer_pulse(attotime::from_hz(60), timer_expired_delegate(FUNC(kbdc8042_device::kbdc8042_time),this));
	at_keyboard_init(machine(), AT_KEYBOARD_TYPE_AT);
	at_keyboard_set_scan_code_set(1);
	m_operation_write_state = 0; /* first write to 0x60 might occur before anything can set this */
}