6 Commits
V0.1 ... V0.2

8 changed files with 83 additions and 26 deletions

10
README
View File

@ -1,8 +1,10 @@
This is the javascript simulator from the visual5602.org project.
This is the javascript simulator from the visual5602.org project:
www.visual6502.org/JSSim
It includes a general purpose switch-level simulator, layout browser,
and data from a 6502D chip.
It includes a general purpose transistor-level simulator, layout browser,
and the data from a 6502 revD chip.
Please note the various licenses of the different files.
Note the various licenses and Copyright associated with each file.
Enjoy!
- The Visual 6502 Team

33
browsertrouble.html Normal file
View File

@ -0,0 +1,33 @@
<!DOCTYPE html>
<head>
<title>Visual 6502 in JavaScript</title>
<style type="text/css">@import "wires.css";</style>
</head>
<body>
<span id="title"><a href="http://visual6502.org">The Visual 6502</a></span>
<span id="plain">
<br />
<span id="title">Browser Trouble?</span>
<br />
<a href="http://www.visual6502.org/faq.html">FAQ</a>&nbsp;
<a href="http://blog.visual6502.org">Blog</a>&nbsp;
<a href="http://www.visual6502.org/links.html">Links</a>&nbsp
<p>
Our chip simulator makes heavy use of the latest version of HTML5 drawing technology.
<p>
It will only run on recent browsers and on a computer with sufficient memory (we recommend at least 2Gbytes.)
<p>
We've tested it on Chrome, Firefox, Safari and Opera. Unfortunately Internet Explorer isn't yet capable of running the graphics.
<p>
If you're using one of the above browsers and having trouble, please restart the browser.
<p>
If you have a problem report or you're able to help us with compatilibity, please get in touch - our contact details are on the main page.
<p>
In the meantime, here's a picture of what you're missing:
<p>
<a href="http://visual6502.org"><img src="images/jssim2.png" style="border:10px"></a>
</span>
</body>
</html>

View File

@ -35,7 +35,7 @@ function recalcNodeList(list){
list = recalclist;
recalclist = new Array();
}
console.log(n,'looping...');
if(ctrace) console.log(n,'looping...');
}
function recalcNode(node, recalclist){
@ -131,7 +131,7 @@ function getNodeValue(group){
if((n.state=='fl')&&(flstate==undefined)) flstate = 'fl';
if(n.state=='fh') flstate = 'fh';
}
if(flstate==undefined) console.log(group);
if(flstate==undefined && ctrace) console.log(group);
return flstate;
}

BIN
images/jssim2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<head>
<title>6502</title>
<title>Visual 6502 in JavaScript</title>
<style type="text/css">@import "wires.css";</style>
<script src="segdefs.js"></script>
<script src="transdefs.js"></script>
@ -10,14 +10,34 @@
<script src="chipsim.js"></script>
<script src="memtable.js"></script>
<script src="macros.js"></script>
<script type="text/javascript">
function handleOnload() {
if((navigator.appName == 'Microsoft Internet Explorer') && (parseInt(navigator.appVersion,10)<9)){
document.getElementById('browsertrouble').innerHTML=
'<p>Sorry, '+navigator.appName+' not supported - showing you a picture instead!</p>';
document.getElementById('frame').innerHTML='<a href="browsertrouble.html"><img src="images/jssim2.png" style="border:10px"></a>';
}else{
setTimeout(setup,200);
}
}
</script>
</head>
<body onload="setTimeout(setup,200)">
<body onload="handleOnload();">
<br />
<span id="title"><a href="/">The Visual 6502</a></span><br /><br />
<span id="title"><a href="http://visual6502.org">The Visual 6502</a></span>
<span id="plain">
If the chip does not load, try another browser: Chrome, Safari, or Firefox
<br />
<a href="http://www.visual6502.org/faq.html">FAQ</a>&nbsp;
<a href="http://blog.visual6502.org">Blog</a>&nbsp;
<a href="http://www.visual6502.org/links.html">Links</a>&nbsp
<br /><br />
This simulator uses HTML5 features only found on the latest versions of browsers and needs
lots of RAM. If you have trouble, please <a href="browsertrouble.html">check compatibility.</a>
<br />
<span id="browsertrouble"></span>
<br />
Hit '>' to zoom in, '<' to zoom out
<br />
@ -28,7 +48,7 @@ Enter your own program into the array of RAM
<br />
</span>
<div class="frame" id="frame">
<div class="chip">
<div class="chip" id="chip">
<canvas class="chip" id="chipbg"></canvas>
<canvas class="chip" id="overlay"></canvas>
<canvas class="chip" id="hilite"></canvas>
@ -50,11 +70,11 @@ Enter your own program into the array of RAM
</div>
<div id="updateShow"> Show:
<input type="checkbox" name="0" id="updateShow0" onchange="updateShow(this.name,this.checked)" />(metal)
<input type="checkbox" name="1" id="updateShow1" onchange="updateShow(this.name,this.checked)" />(diff)
<input type="checkbox" name="1" id="updateShow1" onchange="updateShow(this.name,this.checked)" />(switched diffusion)
<input type="checkbox" name="3" id="updateShow3" onchange="updateShow(this.name,this.checked)" />(grounded diffusion)
<input type="checkbox" name="4" id="updateShow4" onchange="updateShow(this.name,this.checked)" />(powered diffusion)
<input type="checkbox" name="5" id="updateShow5" onchange="updateShow(this.name,this.checked)" />(polysilicon)
<input type="checkbox" name="2" id="updateShow2" onchange="updateShow(this.name,this.checked)" />(diode)
<input type="checkbox" name="3" id="updateShow3" onchange="updateShow(this.name,this.checked)" />(diff0)
<input type="checkbox" name="4" id="updateShow4" onchange="updateShow(this.name,this.checked)" />(diff1)
<input type="checkbox" name="5" id="updateShow5" onchange="updateShow(this.name,this.checked)" />(poly)
</div>
<br />
<br />

View File

@ -104,7 +104,7 @@ function initChip(){
cycle = 0;
trace = Array();
chipStatus();
console.log('initChip done after', now()-start);
if(ctrace)console.log('initChip done after', now()-start);
}
function step(){
@ -275,7 +275,7 @@ function chipStatus(){
' clearIR:' + readBit('clearIR') +
' D1x1:' + readBit('D1x1');
setStatus(machine1 + "<br>" + machine2);
if (loglevel>2) {
if (loglevel>2 && ctrace) {
console.log(machine1 + " " + machine2 + " " + machine3 + " " + machine4 + " " + machine5);
}
selectCell(ab);

View File

@ -23,7 +23,8 @@
body {
background: white;
color: black;
font-family: cursive;
/* font-family: cursive;*/
font-family :Verdana, Arial, Helvetica, Sans-Serif;
font-size: 12px;
}
@ -86,3 +87,8 @@ table.memtable {
font-size: 12px;
border-spacing: 0px;
}
#title {
font-size:30px;
font-weight:bold;
}

View File

@ -26,7 +26,8 @@ var zoom=1;
var dragMouseX, dragMouseY, moved;
var statbox;
var layernames = ['metal', 'diff', 'inputdiode', 'diff0', 'diff1', 'poly'];
// Index of layerNames corresponds to index into drawLayers
var layernames = ['metal', 'switched diffusion', 'inputdiode', 'grounded diffusion', 'powered diffusion', 'polysilicon'];
var colors = ['rgba(128,128,192,0.4)','#FFFF00','#FF00FF','#4DFF4D',
'#FF4D4D','#801AC0','rgba(128,0,255,0.75)'];
var drawlayers = [true, true, true, true, true, true];
@ -114,7 +115,6 @@ function setupLayerVisibility(){
}
function setupBackground(){
console.log('starting setupBackground');
chipbg = document.getElementById('chipbg');
chipbg.width = 4000;
chipbg.height = 4000;
@ -335,15 +335,11 @@ function setChipStyle(props){
function localx(el, gx){
var lx = gx+window.pageXOffset;
lx-=el.getBoundingClientRect().left
return lx;
return gx-el.getBoundingClientRect().left;
}
function localy(el, gy){
var ly = gy+window.pageYOffset;
ly-=el.getBoundingClientRect().top
return ly;
return gy-el.getBoundingClientRect().top;
}
function setStatus(){