Page 2 of 2

Re: Keyboard in QEMU extremly slow

Posted: Thu Oct 02, 2014 8:26 am
by Muazzam
SpyderTL wrote: That's up to you, but I would start by changing .scanCode from a 32-bit number to an array of 32 bit numbers. Then change the .keyboardChanged variable from a Boolean 32-bit number to a counter. (i.e. change mov [.keyboardChanged], 1 to inc [.keyboardChanged]).

Then just loop through the .scanCode array using the count from the .keyboardChanged counter, and read the scan codes. Then when you are done, you can just set the .keyboardChanged back to 0.

In your INT 0x01 handler, you will need to use the .keyboardChanged counter to figure out where to store the scan code in the .scanCode array.

This is the easiest solution I can think of, given your current code. It should be usable until you decide to replace it with something a lot more complex, like a keyboard driver and an event system.
Thanks for help.

Re: Keyboard in QEMU extremly slow

Posted: Sun Feb 08, 2015 11:19 am
by Muazzam
SpyderTL wrote: But just remember that this code will probably need to be redesigned at some point in the future.
You were right then. I have changed my code to implement buffer (array) today.