moving everything neatly into the assets directory

This commit is contained in:
minjaesong
2020-12-24 11:00:32 +09:00
parent 74b1279ed4
commit 608f61c617
111 changed files with 98 additions and 28 deletions

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

39
assets/bios/tbasdist.js Normal file
View 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.");

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 158 KiB

View File

@@ -11,6 +11,5 @@ for (i = indices.length - 1; i > 0; i--) {
}
for (i = 0; i < 250880; i++) {
graphics.plotPixel(indices[i] % 560, (indices[i] / 560)|0, image[indices[i]]);
graphics.plotPixel(indices[i] % 560, (indices[i] / 560)|0, image[indices[i]]);
}
con.color_fore(0);

View File

@@ -15,18 +15,19 @@ if (exec_args !== undefined && exec_args[1] !== undefined && exec_args[1].starts
let INDEX_BASE = 0;
let TRACEON = true;
let DBGON = true;
let TRACEON = false;
let DBGON = false;
let DATA_CURSOR = 0;
let DATA_CONSTS = [];
let DEFUNS_BUILD_DEFUNS = true;
const DEFUNS_BUILD_DEFUNS = true;
const BASIC_HOME_PATH = "/home/basic/"
if (system.maxmem() < 8192) {
println("Out of memory. BASIC requires 8K or more User RAM");
throw Error("Out of memory");
}
let vmemsize = system.maxmem() - 5236;
let vmemsize = system.maxmem();
let cmdbuf = []; // index: line number
let gotoLabels = {};
@@ -132,7 +133,7 @@ fs.open = function(path, operationMode) {
throw Error("Unknown file opening mode: " + mode);
}
com.sendMessage(port[0], "OPEN"+mode+'"'+path+'",'+port[1]);
com.sendMessage(port[0], "OPEN"+mode+'"'+BASIC_HOME_PATH+path+'",'+port[1]);
let response = com.getStatusCode(port[0]);
return (response == 0);
};
@@ -196,8 +197,14 @@ let reNumber = /([0-9]*[.][0-9]+[eE]*[\-+0-9]*[fF]*|[0-9]+[.eEfF][0-9+\-]*[fF]?)
let reNum = /[0-9]+/;
let tbasexit = false;
const greetText = "Terran BASIC 1.0 "+String.fromCharCode(179)+" Scratchpad Memory: "+vmemsize+" bytes";
const greetLeftPad = (80 - greetText.length) >> 1;
const greetRightPad = 80 - greetLeftPad - greetText.length;
println("Terran BASIC 1.0 "+vmemsize+" bytes free");
con.color_pair(0,253);
print(" ".repeat(greetLeftPad)+greetText+" ".repeat(greetRightPad));
con.color_pair(239,255);
println();
println(prompt);
// variable object constructor
@@ -1887,7 +1894,7 @@ bF.isSemanticLiteral = function(token, state) {
return undefined == token || "]" == token || ")" == token ||
"qot" == state || "num" == state || "bool" == state || "lit" == state;
}
bF.parserDoDebugPrint = true;
bF.parserDoDebugPrint = false;
bF.parserPrintdbg = any => { if (bF.parserDoDebugPrint) serial.println(any) };
bF.parserPrintdbg2 = function(icon, lnum, tokens, states, recDepth) {
if (bF.parserDoDebugPrint) {
@@ -2611,8 +2618,8 @@ bF._troNOP = function(lnum, stmtnum) { return new SyntaxTreeReturnObj("null", un
bF._executeSyntaxTree = function(lnum, stmtnum, syntaxTree, recDepth) {
if (lnum === undefined || stmtnum === undefined) throw Error(`Line or statement number is undefined: (${lnum},${stmtnum})`);
let _debugExec = true;
let _debugPrintCurrentLine = true;
let _debugExec = false;
let _debugPrintCurrentLine = false;
let recWedge = ">".repeat(recDepth) + " ";
if (_debugExec || _debugPrintCurrentLine) serial.println(recWedge+"@@ EXECUTE @@");
@@ -3050,7 +3057,7 @@ bF.catalog = function(args) { // CATALOG function
};
Object.freeze(bF);
if (exec_args[1] !== undefined) {
if (exec_args !== undefined && exec_args[1] !== undefined) {
bF.load(["load", exec_args[1]]);
try {
bF.run();

View File

@@ -206,11 +206,11 @@ Functions are a form of expression that may taks input arguments surrounded by p
\subsection{PEEK}
\codeline{BYTE \textbf{= PEEK(}MEM\_ADDR\textbf{)}}\par
Returns whatever the value stored in the \code{MEM\_ADDR} of the scratchpad-memory.\par
Returns whatever the value stored in the \code{MEM\_ADDR} of the Scratchpad Memory.\par
Address mirroring, illegal access, etc. are entirely up to the virtual machine which the BASIC interpreter is running on.
\subsection{POKE}
\codeline{\textbf{POKE(}MEM\_ADDR \textbf{,} BYTE\textbf{)}}\par
Puts a \code{BYTE} into the \code{MEM\_ADDR} of the scratchpad-memory.
Puts a \code{BYTE} into the \code{MEM\_ADDR} of the Scratchpad Memory.
\section{Higher-order Function}

View File

@@ -15,7 +15,7 @@ _TVDOS.getPath = function() {
_TVDOS.variables = {
DOSDIR: "\\tvdos",
LANG: "EN",
PATH: "\\tvdos\\bin",
PATH: ";\\tvdos\\bin;\\tbas;\\home",
PATHEXT: ".com;.bat;.js",
HELPPATH: "\\tvdos\\help",
OS_NAME: "Terrarum Virtual DOS",

View File

Before

Width:  |  Height:  |  Size: 304 KiB

After

Width:  |  Height:  |  Size: 304 KiB

View File

Before

Width:  |  Height:  |  Size: 1017 B

After

Width:  |  Height:  |  Size: 1017 B

View File

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

View File

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 589 B

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
assets/tsvm_graphics_mockup.kra LFS Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More