Add VM "I/O devices", clock, mouse as demo

This commit is contained in:
Tim Mickel 2016-08-15 21:37:36 -04:00
parent c969b51dee
commit aebcfde492
8 changed files with 151 additions and 2 deletions
src/engine

View file

@ -77,7 +77,14 @@ var execute = function (sequencer, thread) {
startBranch: function (branchNum) {
sequencer.stepToBranch(thread, branchNum);
},
target: target
target: target,
ioQuery: function (device, func, args) {
// Find the I/O device and execute the query/function call.
if (runtime.ioDevices[device] && runtime.ioDevices[device][func]) {
var devObject = runtime.ioDevices[device];
return devObject[func].call(devObject, args);
}
}
});
// Deal with any reported value.