1
0
mirror of https://github.com/pkimpel/retro-b5500.git synced 2026-05-05 15:44:28 +00:00

Implement branches; debug CC test loader and character mode tests.

This commit is contained in:
paul
2013-01-27 02:37:26 +00:00
parent eced9eba34
commit fcfbd4bab1
5 changed files with 309 additions and 75 deletions

View File

@@ -280,6 +280,7 @@ function displayProcessorState() {
displayStack();
displayMemory();
displayRegisters();
window.focus();
}
function stepIt(exec) {
@@ -387,7 +388,55 @@ function tos_onChange(ev, bicID, valueID, origID) {
return value;
}
window.onload = function() {
function fileLoader_onLoad(ev) {
/* Handle the onload event for an ArrayBuffer FileReader */
var addr = 0; // starting B5500 memory address
var buf = ev.target.result;
var words = 0;
try {
words = cc.loadTest(buf, addr);
alert("File loaded: " + buf.byteLength + " bytes, " +
words + " words, last addr = @" + (addr+words-1).toString(8));
} catch (e) {
words = 0;
alert("File load failed: " + e.toString());
}
if (words > 0) {
cc.P1.preset(0x10); // execute from address @20
displayProcessorState();
}
}
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();
reader.onload = fileLoader_onLoad;
reader.readAsArrayBuffer(f);
}
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.FileList) {missing += ", FileList"}
if (!window.Blob) {missing += ", Blob"}
if (!window.ArrayBuffer) {missing += ", ArrayBuffer"}
if (!window.DataView) {missing += ", DataView"}
if (missing.length == 0) {
return true;
} else {
alert("No can do... your browser does not support the following features:\n" + missing.substring(2));
return false;
}
}
function initialize() {
$$("LogoDiv").onclick = function(ev) {
displayProcessorState();
@@ -523,6 +572,8 @@ window.onload = function() {
$$("MWordP3").onchange = word_onChange;
$$("MWordP4").onchange = word_onChange;
document.getElementById("FileSelector").addEventListener("change", fileSelector_onChange, false);
cc = new B5500CentralControl();
cc.powerOn();
cc.clear();
@@ -540,6 +591,12 @@ window.onload = function() {
displayProcessorState();
}
window.onload = function() {
if (checkBrowser()) {
initialize();
}
}
</script>
</head>
@@ -554,6 +611,9 @@ window.onload = function() {
</div>
<h3>B5500 Syllable Debugger</h3>
<p>
<input id=FileSelector type=file size=60>
</p>
<table id=RegisterBank1 class="normal border">
<thead>