forked from levskaya/jslinux-deobfuscated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKBD.js
27 lines (23 loc) · 771 Bytes
/
KBD.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
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.
Keyboard Device Emulator
*/
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;
}
KBD.prototype.read_status = function(mem8_loc) {
return 0;
};
KBD.prototype.write_command = function(mem8_loc, x) {
switch (x) {
case 0xfe: // Resend command. Other commands are, apparently, ignored.
this.reset_request();
break;
default:
break;
}
};