-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathcrt.js
26 lines (23 loc) · 822 Bytes
/
crt.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
26
// The CRT sub-system.
define(["Node"], function (Node) {
var importSymbols = function (symbolTable) {
// Keyboard functions.
symbolTable.addNativeFunction("KeyPressed", Node.booleanType, [], function (ctl) {
return ctl.keyPressed();
});
symbolTable.addNativeFunction("ReadKey", Node.charType, [], function (ctl) {
return ctl.readKey();
});
// Sound functions.
symbolTable.addNativeFunction("Sound", Node.voidType, [Node.integerType],
function (ctl, hz) {
// Not implemented.
});
symbolTable.addNativeFunction("NoSound", Node.voidType, [], function (ctl) {
// Not implemented.
});
};
return {
importSymbols: importSymbols
};
});