1
0
mirror of https://github.com/mist64/perfect6502.git synced 2024-06-12 07:29:28 +00:00

remove more

This commit is contained in:
Michael Steil 2010-09-21 05:34:38 +00:00
parent aacd2d2683
commit 2fea263184
4 changed files with 3 additions and 96 deletions

View File

@ -11,7 +11,6 @@
</head>
<body onload="setTimeout(setup,200);">
<div class="frame" id="frame">
<div class = "buttons">
<div style="position:relative; float:left;">
<a href ="javascript:stopChip()"id="stop"><img class="navstop" src="images/stop.png"></a>
@ -25,6 +24,5 @@
</div>
<p class="status" id="status">x: 0<br>y: 0</p>
<table class="memtable" id="memtable"></table>
</div>
</body>
</html>

View File

@ -45,49 +45,7 @@ function steps(){
}
}
function testNMI(n){
initChip();
mWrite(0x0000, 0x38); // set carry
mWrite(0x0001, 0x4c); // jump to test code
mWrite(0x0002, 0x06);
mWrite(0x0003, 0x23);
mWrite(0x22ff, 0x38); // set carry
mWrite(0x2300, 0xea);
mWrite(0x2301, 0xea);
mWrite(0x2302, 0xea);
mWrite(0x2303, 0xea);
mWrite(0x2304, 0xb0); // branch carry set to self
mWrite(0x2305, 0xfe);
mWrite(0x2306, 0xb0); // branch carry set to self
mWrite(0x2307, 0x01);
mWrite(0x2308, 0x00); // brk should be skipped
mWrite(0x2309, 0xa9); // anything
mWrite(0x230a, 0xde); // anything
mWrite(0x230b, 0xb0); // branch back with page crossing
mWrite(0x230c, 0xf2);
mWrite(0xc018, 0x40); // nmi handler
mWrite(0xfffa, 0x18); // nmi vector
mWrite(0xfffb, 0xc0);
mWrite(0xfffc, 0x00); // reset vector
mWrite(0xfffd, 0x00);
for(var i=0;i<n;i++){step();}
setLow('nmi');
chipStatus();
for(var i=0;i<8;i++){step();}
setHigh('nmi');
chipStatus();
for(var i=0;i<16;i++){step();}
}
function initChip(){
var start = now();
for(var nn in nodes) nodes[nn].state = 'fl';
nodes[ngnd].state = 'gnd';
nodes[npwr].state = 'vcc';
@ -100,11 +58,9 @@ function initChip(){
for(var i=0;i<8;i++){setHigh('clk0'), setLow('clk0');}
setHigh('res');
for(var i=0;i<18;i++){resetStep();}
// refresh();
cycle = 0;
trace = Array();
chipStatus();
if(ctrace)console.log('initChip done after', now()-start);
}
function step(){
@ -118,7 +74,6 @@ function halfStep(){
var clk = isNodeHigh(nodenames['clk0']);
if (clk) {setLow('clk0'); handleBusRead(); }
else {setHigh('clk0'); handleBusWrite();}
// refresh();
}
function resetStep(){

View File

@ -28,13 +28,6 @@ body {
font-size: 12px;
}
div.frame {
margin-left: 10px;
position: relative;
width: 1150px;
height: 600px;
}
img.navbutton{
border: 0px;
}

View File

@ -20,10 +20,6 @@
THE SOFTWARE.
*/
var frame, chipbg, overlay, hilite, hitbuffer, ctx;
var centerx=300, centery=300;
var zoom=1;
var dragMouseX, dragMouseY, moved;
var statbox;
// Index of layerNames corresponds to index into drawLayers
@ -47,23 +43,18 @@ var npwr = nodenames['vcc'];
// try to present a meaningful page before starting expensive work
function setup(){
statbox = document.getElementById('status');
setStatus('loading 6502...');
setTimeout(setup_part2, 0);
}
function setup_part2(){
frame = document.getElementById('frame');
statbox = document.getElementById('status');
setupNodes();
setupTransistors();
setupTable();
setStatus('resetting 6502...');
initChip();
document.getElementById('stop').style.visibility = 'hidden';
go();
}
function setup_part2(){
}
function setupNodes(){
for(var i in segdefs){
var seg = segdefs[i];
@ -90,46 +81,16 @@ function setupTransistors(){
}
}
function hexdigit(n){return '0123456789ABCDEF'.charAt(n);}
/////////////////////////
//
// Etc.
//
/////////////////////////
function setChipStyle(props){
for(var i in props){
// chipbg.style[i] = props[i];
overlay.style[i] = props[i];
hilite.style[i] = props[i];
hitbuffer.style[i] = props[i];
}
}
function localx(el, gx){
return gx-el.getBoundingClientRect().left;
}
function localy(el, gy){
return gy-el.getBoundingClientRect().top;
}
function setStatus(){
var res = '';
for(var i=0;i<arguments.length;i++) res=res+arguments[i]+' ';
statbox.innerHTML = res;
}
function nodeName(n) {
for(var i in nodenames){
if(nodenames[i]==n) return i;
}
return '';
}
function now(){return new Date().getTime();}