2011-12-21 13:34:38 +08:00
|
|
|
/*
|
2013-03-29 10:43:44 +08:00
|
|
|
JSLinux-deobfuscated - An annotated version of the original JSLinux.
|
|
|
|
|
|
|
|
Original is Copyright (c) 2011-2012 Fabrice Bellard
|
|
|
|
Redistribution or commercial use is prohibited without the author's permission.
|
2011-12-21 13:34:38 +08:00
|
|
|
|
|
|
|
Keyboard Device Emulator
|
|
|
|
*/
|
2011-12-24 11:28:34 +08:00
|
|
|
function KBD(PC, reset_callback) {
|
|
|
|
PC.register_ioport_read(0x64, 1, 1, this.read_status.bind(this));
|
|
|
|
PC.register_ioport_write(0x64, 1, 1, this.write_command.bind(this));
|
|
|
|
this.reset_request = reset_callback;
|
2011-12-21 13:34:38 +08:00
|
|
|
}
|
|
|
|
KBD.prototype.read_status = function(mem8_loc) {
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
KBD.prototype.write_command = function(mem8_loc, x) {
|
|
|
|
switch (x) {
|
2013-03-21 12:25:29 +08:00
|
|
|
case 0xfe: // Resend command. Other commands are, apparently, ignored.
|
2011-12-21 13:34:38 +08:00
|
|
|
this.reset_request();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
};
|
2011-12-24 11:28:34 +08:00
|
|
|
|
|
|
|
|