mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-10 06:54:04 +09:00
moving everything neatly into the assets directory
This commit is contained in:
39
assets/bios/tbasdist.js
Normal file
39
assets/bios/tbasdist.js
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
var _BIOS = {};
|
||||
|
||||
// Syntax: [Port, Drive-number]
|
||||
// Port #0-3: Serial port 1-4
|
||||
// #4+ : Left for future extension
|
||||
// Drive-number always starts at 1
|
||||
_BIOS.FIRST_BOOTABLE_PORT = [0,1]; // ah screw it
|
||||
|
||||
Object.freeze(_BIOS);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// load basic.js
|
||||
let p = _BIOS.FIRST_BOOTABLE_PORT;
|
||||
com.sendMessage(0, "DEVRST\x17");
|
||||
com.sendMessage(0, 'OPENR"tbas/basic.js",1');
|
||||
let r = com.getStatusCode(0);
|
||||
|
||||
if (r == 0){
|
||||
com.sendMessage(0, "READ");
|
||||
r = com.getStatusCode(0);
|
||||
if (r == 0) {
|
||||
try {
|
||||
let g=com.pullMessage(0);
|
||||
let execAppPrg = eval("var _appStub=function(exec_args){"+g+"};_appStub;"); // making 'exec_args' a app-level global
|
||||
execAppPrg();
|
||||
return 0;
|
||||
}
|
||||
catch (e) {
|
||||
printerrln("\n"+e.stack);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
printerrln("I/O Error");
|
||||
}
|
||||
else
|
||||
printerrln("No bootable medium found.");
|
||||
Reference in New Issue
Block a user