abstract-machine,nemu: add keyboard support
This commit is contained in:
parent
c9ad69a32d
commit
fed4ac225d
2 changed files with 4 additions and 2 deletions
|
@ -4,6 +4,7 @@
|
|||
#define KEYDOWN_MASK 0x8000
|
||||
|
||||
void __am_input_keybrd(AM_INPUT_KEYBRD_T *kbd) {
|
||||
kbd->keydown = 0;
|
||||
kbd->keycode = AM_KEY_NONE;
|
||||
uint32_t keycode = inl(KBD_ADDR);
|
||||
kbd->keydown = ((keycode & KEYDOWN_MASK) != 0);
|
||||
kbd->keycode = keycode & (~KEYDOWN_MASK);
|
||||
}
|
||||
|
|
|
@ -176,6 +176,7 @@ breakpoint_t *cpu_exec_with_bp(uint64_t n, breakpoint_t *bp, size_t len) {
|
|||
}
|
||||
exec_once(&s, cpu.pc);
|
||||
g_nr_guest_inst++;
|
||||
IFDEF(CONFIG_DEVICE, device_update());
|
||||
if (nemu_state.state != NEMU_RUNNING)
|
||||
return NULL;
|
||||
} while (--n);
|
||||
|
|
Loading…
Reference in a new issue