1
0
mirror of https://github.com/pkimpel/retro-b5500.git synced 2026-02-13 03:34:29 +00:00
Files
pkimpel.retro-b5500/webUI/prototypes/webkitFileSystemTest.html
paul.kimpel@digm.com 2dadec8b8b Release emulator version 0.17:
1. Enable (finally!) functioning of P2, the second processor, in CentralControl and Processor.
2. Fix bugs in Character Mode syllables FAD, FSU: initial compare of operands was alphanumeric instead of numeric.
3. Fix bugs in Character Mode syllables TRN, TRZ, TBN: non-boundary destination words were not being fetched into the B register.
4. Enable configuration of additional tape drives (up to the maximum of 16).
5. Implement new flip-flop latching mechanism in CentralControl for use by B5500Console.
6. Optimize clearing of interrupts in Central Control.
7. Implement preliminary mechanism to allow P2 to be added to the configuration temporarily without altering B5500SystemConfiguration.js.
8. Implement new average slack and delay algorithms in Processor.schedule().
9. Optimize some Character Mode syllables by substituting local variables for "this" properties.
10. Fix bugs in Processor single-precision divide syllables leaving the stack in an incorrect state after a divide by zero in Control State.
11. Further minor tweaks to performance throttling.
12. Optimize references to this.cc in Processor.run().
13. Minor improvements to B5500MagTapeDrive: eliminate oscillation at load point, improve timing of rewind operations.
14. Implement build-release.cmd script to generate emulator release archive files.
15. Commit initial Mark-XVI TSSINT transcription from Fausto Saporito.
2013-12-16 04:52:03 +00:00

168 lines
5.7 KiB
HTML

<!DOCTYPE html>
<head>
<title>B5500 LibMaint Decoder</title>
<meta name="Author" content="Paul Kimpel">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<script>
"use strict";
window.onload = function() {
var fs = null;
var writer = null;
var BICtoANSI = [
"0", "1", "2", "3", "4", "5", "6", "7",
"8", "9", "#", "@", "?", ":", ">", "}",
"+", "A", "B", "C", "D", "E", "F", "G",
"H", "I", ".", "[", "&", "(", "<", "~",
"|", "J", "K", "L", "M", "N", "O", "P",
"Q", "R", "$", "*", "-", ")", ";", "{",
" ", "/", "S", "T", "U", "V", "W", "X",
"Y", "Z", ",", "%", "!", "=", "]", "\""];
function appendLine(panel, text) {
/* Appends "text"+NL as a new text node to the panel DOM element */
var e = document.createTextNode(text + "\n");
panel.appendChild(e);
writer.write(new Blob([text, "\n"]));
}
function clearPanel(panel) {
/* Clears the text panel */
var kid;
while (kid = panel.firstChild) {
panel.removeChild(kid);
}
}
function fileLoader_onLoad(ev) {
/* Handle the onload event for an ArrayBuffer FileReader */
var buf = ev.target.result;
var bytes = buf.byteLength;
var data = new DataView(buf); // use DataView() to avoid problems with littleendians.
var panel = document.getElementById("TextPanel");
var text = "";
var v;
var x = 0;
clearPanel(panel);
window.webkitStorageInfo.requestQuota(PERSISTENT, 50e6, function(granted) {
var rqfs = window.requestFileSystem || window.webkitRequestFileSystem;
rqfs(window.PERSISTENT, granted, function(fileSystem) {
fs = fileSystem;
alert("File system " + fileSystem.name + " obtained");
fs.root.getFile("test1.txt", {create:true, exclusive:false}, function(f) {
alert(f.fullPath + " created");
f.createWriter(function(fileWriter) {
writer = fileWriter;
writer.write(new Blob(["This is the first line\n"], {type: "text/plain"}));
do {
v = data.getUint8(x);
if (v & 0x80) {
appendLine(panel, text);
panel.appendChild(document.createElement("hr"));
if (v == 0x8F) {
text = "\\\\\\\\\\ [EOF] /////";
} else {
text = BICtoANSI[v & 0x3F];
}
} else {
if (text.length >= 80) {
appendLine(panel, text);
text = "";
}
text += BICtoANSI[v & 0x3F];
}
} while (++x < bytes);
appendLine(panel, text);
});
}, function(e) {alert("Create Error:" + e)});
}, function(e) {alert("RQFS Error:" + e)});
}, function(e) {alert("Quota Error:" + e)});
//document.getElementById("RunBtn").disabled = false;
}
function fileSelector_onChange(ev) {
/* Handle the <input type=file> onchange event when a file is selected */
var f = ev.target.files[0];
var reader = new FileReader();
document.getElementById("GoBtn").disabled = true;
alert("File selected: " + f.name +
"\nModified " + f.lastModifiedDate +
"\nType=" + f.type + ", Size=" + f.size + " octets");
reader.onload = fileLoader_onLoad;
reader.readAsArrayBuffer(f.slice(0,65536));
}
function goBtn_onClick(ev) {
/* Driver to process the data file */
}
function checkBrowser() {
/* Checks whether this browser can support the necessary stuff */
var missing = "";
if (!window.File) {missing += ", File"}
if (!window.FileReader) {missing += ", FileReader"}
if (!window.webkitRequestFileSystem) {missing += ", webkitRequestFileSystem"}
if (!window.FileList) {missing += ", FileList"}
if (!window.Blob) {missing += ", Blob"}
if (!window.ArrayBuffer) {missing += ", ArrayBuffer"}
if (!window.DataView) {missing += ", DataView"}
if (missing.length == 0) {
return false;
} else {
alert("No can do... your browser does not support the following features:\n" + missing.substring(2));
return true;
}
}
/* Start of window.onload() */
if (checkBrowser()) {
return;
}
document.getElementById("FileSelector").addEventListener("change", fileSelector_onChange, false);
document.getElementById("GoBtn").addEventListener("click", goBtn_onClick, false);
}
</script>
</head>
<body>
<div style="position:relative; width:100%">
<div style="position:absolute; left:0; top:0; width:auto">
retro-B5500 LibMaint Tape Decoder
</div>
<div style="position:absolute; top:0; right:0; width:auto">
<input id=FileSelector type=file size=60>
&nbsp;
<input id=GoBtn type=button value=Go disabled>
</div>
</div>
<pre id=TextPanel>
</pre>
</body>
</html>